<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def casperjs_command_kwargs():
 """ will construct kwargs for cmd """

    kwargs = {
        'stdout': subprocess.PIPE,
        'stderr': subprocess.PIPE,
        'universal_newlines': True
    }
    phantom_js_cmd = app_settings['PHANTOMJS_CMD']
    if phantom_js_cmd:
        path = '{0}:{1}'.format(
            os.getenv('PATH', ''), os.path.dirname(phantom_js_cmd)
        )
        kwargs.update({'env': {'PATH': path}})
    return kwargs