code: def get_class_names(path, parent_path=None, subset_path=None):
      """
      Read json file with entries {classname: index} and return
      an array of class names in order.
      If parent_path is provided, load and map all children to their ids.
      Args:
          path (str): path to class ids json file.
              File must be in the format {"class1": id1, "class2": id2, ...}
          parent_path (Optional[str]): path to parent-child json file.
              File must be in the format {"parent1": ["child1", "child2", ...], ...}
          subset_path (Optional[str]): path to text file containing a subset
              of class names, separated by newline characters.
      Returns:
          class_names (list of strs): list of class names.
          class_parents (dict): a dictionary where key is the name of the parent class
              and value is a list of ids of the children classes.
          subset_ids (list of ints): list of ids of the classes provided in the
              subset file.
      """
      try:
          with pathmgr.open(path, "r") as f:
              class2idx = json.load(f)
      except Exception as err:
          print(
              "Fail to load file from {} with error {}".format(
                  path, err
              )
          )
          return
  
      max_key = max(class2idx.values())
      class_names = [None] * (max_key + 1)
  
      for k, i in class2idx.items():
          class_names[i] = k
  
      class_parent = None
      if parent_path is not None and parent_path != "":
          try:
              with pathmgr.open(parent_path, "r") as f:
                  d_parent = json.load(f)
          except EnvironmentError as err:
              print(
                  "Fail to load file from {} with error {}".format(
                      parent_path, err
                  )
              )
              return
          class_parent = {}
          for parent, children in d_parent.items():
              indices = [
                  class2idx[c]
                  for c in children
                  if class2idx.get(c) is not None
              ]
              class_parent[parent] = indices
  
      subset_ids = None
      if subset_path is not None and subset_path != "":
          try:
              with pathmgr.open(subset_path, "r") as f:
                  subset = f.read().split("\n")
                  subset_ids = [
                      class2idx[name]
                      for name in subset
                      if class2idx.get(name) is not None
                  ]
          except EnvironmentError as err:
              print(
                  "Fail to load file from {} with error {}".format(
                      subset_path, err
                  )
              )
              return
  
      return class_names, class_parent, subset_ids
  
imports: import json
  import logging
  import math
  import numpy
  import os
  from datetime import datetime
  import psutil
  import torch
  import torchvision.io
  from fvcore.nn.activation_count import activation_count
  from fvcore.nn.flop_count import flop_count
  from matplotlib import pyplot
  from torch import nn
  from torchvision.utils import make_grid
  import slowfast.utils.logging
  import slowfast.utils.multiprocessing
  from slowfast.datasets.utils import pack_pathway_output
  from slowfast.models.batchnorm_helper import SubBatchNorm3d
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 15 for calling a global function with example usage: get_class_names(path, parent_path, subset_path) and returns: class_names,  class_parent,  subset_ids