def METHOD_NAME():
    """Create the DATASET_MAP from recipe datasets to ESGF dataset names.
    Run `python -m esmvalcore.esgf.facets` to print an up to date map.
    """
    cfg = get_esgf_config()
    search_args = dict(cfg["search_connection"])
    url = search_args.pop("urls")[0]
    connection = pyesgf.search.SearchConnection(url=url, **search_args)
    dataset_map = {}
    indices = {
        'CMIP3': 2,
        'CMIP5': 3,
        'CMIP6': 3,
        'CORDEX': 7,
        'obs4MIPs': 2,
    }
    for project in FACETS:
        dataset_map[project] = {}
        dataset_key = FACETS[project]['dataset']
        ctx = connection.new_context(
            project=project,
            facets=[dataset_key],
            fields=['id'],
            latest=True,
        )
        available_datasets = sorted(ctx.facet_counts[dataset_key])
        print(f"The following datasets are available for project {project}:")
        for dataset in available_datasets:
            print(dataset)
        # Figure out the ESGF name of the requested dataset
        n_available = len(available_datasets)
        for i, dataset in enumerate(available_datasets, 1):
            print(f"Looking for dataset name of facet name"
                  f" {dataset} ({i} of {n_available})")
            query = {dataset_key: dataset}
            dataset_result = next(iter(ctx.search(batch_size=1, **query)))
            print(f"Dataset id: {dataset_result.dataset_id}")
            dataset_id = dataset_result.dataset_id
            if dataset not in dataset_id:
                idx = indices[project]
                dataset_alias = dataset_id.split('.')[idx]
                print(f"Found dataset name '{dataset_alias}'"
                      f" for facet '{dataset}',")
                dataset_map[project][dataset_alias] = dataset
    return dataset_map