code: def _register_scatter():
      
  
      @functools.wraps(PathCollection.__init__)
      def __init__(self, *args, **kwargs):
          _nonscatter_pathcollections.add(self)
          return __init__.__wrapped__(self, *args, **kwargs)
      PathCollection.__init__ = __init__
  
      @functools.wraps(Axes.scatter)
      def scatter(*args, **kwargs):
          paths = scatter.__wrapped__(*args, **kwargs)
          with suppress(KeyError):
              _nonscatter_pathcollections.remove(paths)
          return paths
      Axes.scatter = scatter
docs: Patch `PathCollection` and `scatter` to register their return values.
  
      This registration allows us to distinguish `PathCollection`s created by
      `Axes.scatter`, which should use point-like picking, from others, which
      should use path-like picking.  The former is more common, so we store the
      latter instead; this also lets us guess the type better if this module is
      imported late.