code: def parse_config_str(config_str):
      """Parses config string.
  
      For example: config_str = "a=1 b='hello'", the function returns
      {'a': 1, 'b': 'hello'}.
  
      Args:
        config_str: A config string.
      Returns:
        A dictionary.
      """
      ans = {}
      for line in config_str.split("\n"):
          k, v = line.partition("=")[::2]
          k = k.strip()
          v = v.strip()
          if k and not k.startswith("//"):
              try:
                  v = int(v)
              except ValueError:
                  try:
                      v = float(v)
                  except ValueError:
                      v = v[1:-1]  # remove quotes for string argument.
              ans[k] = v
      return ans
  
file_path: magenta/magenta/models/gansynth/lib/util.py
imports: import io
  import os
  from absl import logging
  import numpy
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 7 for calling a global function with example usage: parse_config_str(config_str) and returns: ans