code: def cursor(pickables=None, **kwargs):
      
  
      if pickables is None:
          # Do not import pyplot ourselves to avoid forcing the backend.
          plt = sys.modules.get("matplotlib.pyplot")
          pickables = [
              plt.figure(num) for num in plt.get_fignums()] if plt else []
      elif (isinstance(pickables, Container)
            or not isinstance(pickables, Iterable)):
          pickables = [pickables]
  
      def iter_unpack_figures(pickables):
          for entry in pickables:
              if isinstance(entry, Figure):
                  yield from entry.axes
              else:
                  yield entry
  
      def iter_unpack_axes(pickables):
          for entry in pickables:
              if isinstance(entry, Axes):
                  yield from _iter_axes_subartists(entry)
                  containers.extend(entry.containers)
              elif isinstance(entry, Container):
                  containers.append(entry)
              else:
                  yield entry
  
      containers = []
      artists = list(iter_unpack_axes(iter_unpack_figures(pickables)))
      for container in containers:
          contained = list(filter(None, container.get_children()))
          for artist in contained:
              with suppress(ValueError):
                  artists.remove(artist)
          if contained:
              artists.append(_pick_info.ContainerArtist(container))
  
      return Cursor(artists, **kwargs)
docs: Create a `Cursor` for a list of artists, containers, and axes.
  
      Parameters
      ----------
  
      pickables : Optional[List[Union[Artist, Container, Axes, Figure]]]
          All artists and containers in the list or on any of the axes or
          figures passed in the list are selectable by the constructed `Cursor`.
          Defaults to all artists and containers on any of the figures that
          :mod:`~matplotlib.pyplot` is tracking.  Note that the latter will only
          work when relying on pyplot, not when figures are directly instantiated
          (e.g., when manually embedding Matplotlib in a GUI toolkit).
  
      **kwargs
          Keyword arguments are passed to the `Cursor` constructor.