code: def _parse_axes(option, grid=True):
      """parse option string into grid axes; using modified numpy.ogrid notation
  
      For example:
        option='-1:10:.1, 0:10:.1' yields x,y=ogrid[-1:10:.1,0:10:.1],
  
      If grid is False, accept options suitable for line plotting.
      For example:
        option='-1:10' yields x=ogrid[-1:10] and y=0,
        option='-1:10, 2' yields x=ogrid[-1:10] and y=2,
  
      Returns tuple (x,y) with 'x,y' defined above.
      """
      option = option.split(",")
      msg = "invalid format string: '{0}'".format(",".join(option))
      opt = dict(zip(["x", "y", "z"], option))
      if len(option) > 2 or len(option) < 1:
          msg = "invalid format string: '{0}'".format(",".join(option))
          raise ValueError(msg)
      z = bool(grid)
      if len(option) == 1:
          opt["y"] = "0"
      xd = True if ":" in opt["x"] else False
      yd = True if ":" in opt["y"] else False
      # XXX: accepts option='3:1', '1:1', and '1:2:10' (try to catch?)
      globals = {}
      code = "import numpy;"
      if xd and yd:
          try:  # x,y form a 2D grid
              code += "x,y = numpy.ogrid[{0},{1}]".format(
                  opt["x"], opt["y"]
              )
              code = compile(code, "<string>", "exec")
              exec(code, globals)
              x = globals["x"]
              y = globals["y"]
          except:  # AttributeError:
              msg = "invalid format string: '{0}'".format(
                  ",".join(option)
              )
              raise ValueError(msg)
      elif xd and not z:
          try:
              code += "x = numpy.ogrid[{0}]".format(opt["x"])
              code = compile(code, "<string>", "exec")
              exec(code, globals)
              x = globals["x"]
              y = float(opt["y"])
          except:  # (AttributeError, SyntaxError, ValueError):
              msg = "invalid format string: '{0}'".format(
                  ",".join(option)
              )
              raise ValueError(msg)
      elif yd and not z:
          try:
              x = float(opt["x"])
              code += "y = numpy.ogrid[{0}]".format(opt["y"])
              code = compile(code, "<string>", "exec")
              exec(code, globals)
              y = globals["y"]
          except:  # (AttributeError, SyntaxError, ValueError):
              msg = "invalid format string: '{0}'".format(
                  ",".join(option)
              )
              raise ValueError(msg)
      else:
          msg = "invalid format string: '{0}'".format(",".join(option))
          raise ValueError(msg)
      if not x.size or not y.size:
          msg = "invalid format string: '{0}'".format(",".join(option))
          raise ValueError(msg)
      return x, y
  
imports: from collections.abc import Callable
label_desc: Use image node_id 21 for calling a global function with example usage: _parse_axes(option, grid) and returns: x,  y