code: def _maybe_load_yaml(item):
      """Parses `item` only if it is a string. If `item` is a dictionary
      it is returned as-is.
      """
      if isinstance(item, six.string_types):
          return yaml.load(item)
      elif isinstance(item, dict):
          return item
      else:
          raise ValueError(
              "Got {}, expected YAML string or dict", type(item)
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import copy
  from pydoc import locate
  import six
  import yaml
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: _maybe_load_yaml(item) and returns: yaml, item