code: def _get_mpl_patches(
      json_content, transform=None, invert_color=False, **kwargs
  ):
      """Walk over the json content and build a list of matplotlib patches."""
      mpl_patches = []
      kwargs_edgecolor = kwargs.pop("edgecolor", None)
      kwargs_linewidth = kwargs.pop("linewidth", None)
      for path in json_content["paths"]:
          if kwargs_edgecolor is not None:
              edgecolor = kwargs_edgecolor
          else:
              edgecolor = path["edgecolor"]
              if invert_color:
                  edgecolor = _invert_color(edgecolor)
          linewidth = kwargs_linewidth or path["linewidth"]
          path_id = path["id"]
  
          for item in path["items"]:
              type = item["type"]
              pts = item["pts"]
              codes = _codes(type, pts)
              path = Path(pts, codes)
              patch = patches.PathPatch(
                  path,
                  edgecolor=edgecolor,
                  linewidth=linewidth,
                  facecolor="none",
                  gid=path_id,
                  transform=transform,
                  **kwargs,
              )
  
              mpl_patches.append(patch)
  
      return mpl_patches
  
file_path: nilearn/nilearn/plotting/glass_brain.py
imports: import json
  import os
  from matplotlib import colors, patches, transforms
  from matplotlib.path import Path
label_desc: Use image node_id 5 for calling a global function with example usage: _get_mpl_patches(json_content, transform, invert_color) and returns: mpl_patches