code: def register_coco():
      """
      Register COCO 2004 datasets to the data catalog.
      We first look up for these datasets paths in the dataset catalog,
      if the paths exist, we register, otherwise we remove the
      coco2014_folder from the catalog registry.
      """
      data_info = VisslDatasetCatalog.get("coco2014_folder")
      data_folder = data_info["train"][0]
      if g_pathmgr.exists(data_folder):
          train_data_info = get_coco_imgs_labels_info(
              "train", data_folder
          )
          test_data_info = get_coco_imgs_labels_info("val", data_folder)
          data_info["train"] = train_data_info
          data_info["val"] = test_data_info
          VisslDatasetCatalog.remove("coco2014_folder")
          VisslDatasetCatalog.register_data(
              "coco2014_folder", data_info
          )
      else:
          VisslDatasetCatalog.remove("coco2014_folder")
  
imports: import json
  import logging
  import os
  from typing import List
  import numpy
  from iopath.common.file_io import g_pathmgr
  from vissl.data.datasets import get_coco_imgs_labels_info, get_voc_images_labels_info
  from vissl.utils.misc import get_json_data_catalog_file
  from vissl.utils.slurm import get_slurm_dir
label_desc: Use image node_id 5 for calling a global function with example usage: register_coco() without return types