code: def _auto_norm_from_scale(scale_cls):
      """
      Automatically generate a norm class from *scale_cls*.
  
      This differs from `.colors.make_norm_from_scale` in the following points:
  
      - This function is not a class decorator, but directly returns a norm class
        (as if decorating `.Normalize`).
      - The scale is automatically constructed with ``nonpositive="mask"``, if it
        supports such a parameter, to work around the difference in defaults
        between standard scales (which use "clip") and norms (which use "mask").
  
      Note that ``make_norm_from_scale`` caches the generated norm classes
      (not the instances) and reuses them for later calls.  For example,
      ``type(_auto_norm_from_scale("log")) == LogNorm``.
      """
      # Actually try to construct an instance, to verify whether
      # ``nonpositive="mask"`` is supported.
      try:
          norm = colors.make_norm_from_scale(
              functools.partial(scale_cls, nonpositive="mask")
          )(colors.Normalize)()
      except TypeError:
          norm = colors.make_norm_from_scale(scale_cls)(
              colors.Normalize
          )()
      return type(norm)
  
imports: from collections.abc import Mapping
  import functools
  import numpy
  from numpy import ma
  import matplotlib
  from matplotlib import _api, colors, cbook, scale
  from matplotlib._cm import datad
  from matplotlib._cm_listed import cmaps
label_desc: Use image node_id 5 for calling a global function with example usage: _auto_norm_from_scale(scale_cls) and returns: type