code: def build_datasets():
      """Build datasets."""
  
      local_dataset = {
          "cityscapes": CITYSCAPES,
          "ade20k": ADE20K,
          "ade20k_ind": ADE20KSUBSET,
          "ade20k_ood_open": ADE20KOPEN,
      }
  
      # -----------------------------
      # Construct ade20k_c dataset:
      # -----------------------------
      for severity in ADE20K_C_SEVERITIES:
          for corruption in ADE20K_C_CORRUPTIONS:
              tfds_dataset_name = (
                  f"ade20k_corrupted/ade20k_{corruption}_{severity}"
              )
              temp_dataset_name = f"ade20k_c_{corruption}_{severity}"
              local_dataset[temp_dataset_name] = DatasetInfo(
                  tfds_name=tfds_dataset_name,
                  image_key="image",
                  label_key="annotations",
                  classes=ADE20K_CLASSES,
                  pixels_per_class=None,
                  data_dir=ADE20K_CORRUPTED_DIR,
              )
  
      # -------------------------------
      # Construct ade20k_ind_c dataset:
      # -------------------------------
      for severity in ADE20K_C_SEVERITIES:
          for corruption in ADE20K_C_CORRUPTIONS:
              tfds_dataset_name = (
                  f"ade20k_corrupted/ade20k_{corruption}_{severity}"
              )
              temp_dataset_name = (
                  f"ade20k_ind_c_{corruption}_{severity}"
              )
              local_dataset[temp_dataset_name] = DatasetInfo(
                  tfds_name=tfds_dataset_name,
                  image_key="image",
                  label_key="annotations",
                  classes=ADE20KSUBSET_CLASSES,
                  pixels_per_class=None,
                  data_dir=ADE20K_CORRUPTED_DIR,
              )
  
      # ------------------------------------
      # Construct ade20k_ood_open_c dataset:
      # ------------------------------------
      for severity in ADE20K_C_SEVERITIES:
          for corruption in ADE20K_C_CORRUPTIONS:
              tfds_dataset_name = (
                  f"ade20k_corrupted/ade20k_{corruption}_{severity}"
              )
              temp_dataset_name = (
                  f"ade20k_ood_open_c_{corruption}_{severity}"
              )
              local_dataset[temp_dataset_name] = DatasetInfo(
                  tfds_name=tfds_dataset_name,
                  image_key="image",
                  label_key="annotations",
                  classes=ADE20KOPEN_3CLASSES,
                  ood_classes=ADE20KOPEN_CLASSES,
                  pixels_per_class=None,
                  data_dir=ADE20K_CORRUPTED_DIR,
              )
  
      return local_dataset
  
imports: import collections
  import dataclasses
  from typing import Dict, Any, List, Optional
label_desc: Use image node_id 1 for calling a global function with example usage: build_datasets() and returns: local_dataset