code: def svg_parse(path):
      commands = {
          "M": (Path.MOVETO,),
          "L": (Path.LINETO,),
          "Q": (Path.CURVE3,) * 2,
          "C": (Path.CURVE4,) * 3,
          "Z": (Path.CLOSEPOLY,),
      }
      vertices = []
      codes = []
      cmd_values = re.split("([A-Za-z])", path)[
          1:
      ]  # Split over commands.
      for cmd, values in zip(cmd_values[::2], cmd_values[1::2]):
          # Numbers are separated either by commas, or by +/- signs (but not at
          # the beginning of the string).
          points = (
              [*map(float, re.split(",|(?<!^)(?=[+-])", values))]
              if values
              else [(0.0, 0.0)]
          )  # Only for "z/Z" (CLOSEPOLY).
          points = np.reshape(points, (-1, 2))
          if cmd.islower():
              points += vertices[-1][-1]
          codes.extend(commands[cmd.upper()])
          vertices.append(points)
      return np.array(codes), np.concatenate(vertices)
  
imports: import re
  import matplotlib.pyplot
  import numpy
  import matplotlib.patches
  from matplotlib.path import Path
label_desc: Use image node_id 1 for calling a global function with example usage: svg_parse(path) and returns: np,  np