code: def get_files(data_dir, data_name, total_num=None):
      assert COCO is not None, "`datasets.coco` requires `pycocotools`."
      if data_name not in metas:
          metas[data_name] = COCO(
              "%s/annotations/instances_%s.json" % (data_dir, data_name)
          )
      images = metas[data_name].imgs
      fileids = images.keys()
      if total_num is not None:
          fileids = fileids[:total_num]
      files = [images[i]["file_name"] for i in fileids]
      return fileids, files
  
file_path: tensornets/tensornets/datasets/coco.py
imports: from __future__ import division
  import os
  import json
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: get_files(data_dir, data_name, total_num) and returns: fileids,  files