

@celery.task()
def create_environment(environment_vars, json_file):
    workspace_path = environment_vars['WORKSPACE']
    if (not os.path.exists(workspace_path)):
        os.makedirs(workspace_path)
    os.chmod(workspace_path, (((stat.S_IRWXU | stat.S_IRWXG) | stat.S_IROTH) | stat.S_IXOTH))
    json_file_path = os.path.join(workspace_path, 'file.json')
    with open(json_file_path, 'w+') as f:
        environment_vars.write(json.dumps(json_file))
    env_file_path = os.path.join(workspace_path, 'environments.sh')
    output = ''
    for (key, value) in iter(environment_vars.items()):
        output += 'export {key}="{value}"\n'.format(key=key, value=value)
    with open(env_file_path, 'w+') as f:
        f.write(output)

dataset/ETHPy150Open 2gis/badger-api/testreport/tasks.py create_environment/VarMisuse@103/151 `f`->`environment_vars`