code: def get_data_format(data_format, keras_mode=True):
      if keras_mode:
          dic = {"NCHW": "channels_first", "NHWC": "channels_last"}
      else:
          dic = {"channels_first": "NCHW", "channels_last": "NHWC"}
      ret = dic.get(data_format, data_format)
      if ret not in dic.values():
          raise ValueError(
              "Unknown data_format: {}".format(data_format)
          )
      return ret
  
file_path: tensorpack/tensorpack/utils/argtools.py
imports: import inspect
  import functools
  from .None import logger
label_desc: Use image node_id 5 for calling a global function with example usage: get_data_format(data_format, keras_mode) and returns: ret