def METHOD_NAME(argv=sys.argv[1:]):
    parser = argparse.ArgumentParser(
        description='Create a workspace from vcs repos files.')
    add_argument_rosdistro_name(parser)
    add_argument_repos_file_urls(parser)
    add_argument_repository_names(parser, optional=True)
    add_argument_package_names(parser, optional=True)
    add_argument_package_dependencies(parser)
    add_argument_test_branch(parser)
    parser.add_argument(
        '--workspace-root',
        help='The path of the desired workspace',
        required=True)
    args = parser.parse_args(argv)
    assert args.repos_file_urls or args.repository_names or args.package_names
    ensure_workspace_exists(args.workspace_root)
    repos_files = []
    if args.repository_names or args.package_names:
        with Scope('SUBSECTION', 'get repository information from rosdistro'):
            index = get_index(get_index_url())
            dist = get_cached_distribution(index, args.rosdistro_name)
            data = {}
            for repo_name in args.repository_names or ():
                repo = dist.repositories[repo_name]
                src_repo = repo.source_repository
                repo_data = {
                    'type': src_repo.type,
                    'url': src_repo.url,
                }
                if src_repo.version is not None:
                    repo_data['version'] = src_repo.version
                data[repo_name] = repo_data
            if args.package_dependencies and args.package_names:
                walker = DependencyWalker(dist)
                additional_package_names = set()
                for pkg_name in args.package_names:
                    additional_package_names |= walker.get_recursive_depends(
                        pkg_name,
                        ['buildtool', 'buildtool_export', 'build', 'build_export', 'run', 'test'],
                        ros_packages_only=True)
                additional_package_names.difference_update(args.package_names)
                args.package_names.extend(additional_package_names)
            for pkg_name in args.package_names or ():
                pkg = dist.release_packages[pkg_name]
                repo = dist.repositories[pkg.repository_name]
                rel_repo = repo.release_repository
                repo_data = {
                    'type': 'git',
                    'url': rel_repo.url,
                    'version': rel_repo.tags['release'].format_map({
                        'package': pkg_name,
                        'version': rel_repo.version,
                    }),
                }
                data[pkg_name] = repo_data
            repos_file = os.path.join(args.workspace_root, 'repositories-from-rosdistro.repos')
            with open(repos_file, 'w') as h:
                h.write(yaml.safe_dump({'repositories': data}, default_flow_style=False))
            repos_files.append(repos_file)
    with Scope('SUBSECTION', 'fetch repos files(s)'):
        for index, repos_file_url in enumerate(args.repos_file_urls):
            repos_file = os.path.join(args.workspace_root, '%d.repos' % index)
            print('Fetching \'%s\' to \'%s\'' % (repos_file_url, repos_file))
            urlretrieve(repos_file_url, repos_file)
            repos_files += [repos_file]
    with Scope('SUBSECTION', 'import repositories'):
        source_space = os.path.join(args.workspace_root, 'src')
        for repos_file in repos_files:
            print('Importing repositories from \'%s\'' % (repos_file))
            import_repositories(source_space, repos_file, args.test_branch)
    with Scope('SUBSECTION', 'vcs export --exact'):
        # if a repo has been rebased against the default branch vcs can't detect the remote
        export_repositories(source_space, check=not args.test_branch)