def METHOD_NAME(workspace):  # pylint: disable=redefined-outer-name
    '''
    Returns a function that creates a temporary workspace from the files dict.
    The dict is in the format {"file_name": "file_contents"}
    '''
    def fn(files):
        def create_file(name, content):
            fn = os.path.join(workspace.root_path, name)
            with open(fn, 'w', encoding='utf-8') as f:
                f.write(content)
            workspace.put_document(uris.from_fs_path(fn), content)
        for name, content in files.items():
            create_file(name, content)
        return workspace
    return fn