code: def download_nouns_mapping():
      """Downloads a mapping between noun id (``nXXXXXXXX`` form) and the noun string representation.
  
      :return: A dictionary: ``{noun_id : text}``
      """
      NOUN_MAP_URL = "https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json"
      request = urlopen(NOUN_MAP_URL)
      class_map_json = request.read()
  
      # raw_dict has the form of {id: [noun_id, text]}. We flatten it into {noun_id: text}
      raw_dict = json.loads(class_map_json.decode("utf-8"))
      nouns_map = {k: v for k, v in raw_dict.values()}
      return nouns_map
  
file_path: petastorm/examples/imagenet/generate_petastorm_imagenet.py
imports: from __future__ import division
  import argparse
  import glob
  import json
  import os
  import cv2
  from pyspark.sql import SparkSession
  from six.moves.urllib.request import urlopen
  from examples.imagenet.schema import ImagenetSchema
  from petastorm.etl.dataset_metadata import materialize_dataset
  from petastorm.unischema import dict_to_spark_row
label_desc: Use image node_id 2 for calling a global function with example usage: download_nouns_mapping() and returns: nouns_map