class_docstr: Automatically select scale of geometries based on extent of plotted axes.
code: def scale_from_extent(self, extent):
      scale = self._default_scale
  
      if extent is not None:
          width = abs(extent[1] - extent[0])
          height = abs(extent[3] - extent[2])
          min_extent = min(width, height)
  
          if min_extent != 0:
              for scale_candidate, upper_bound in self._limits:
                  if min_extent <= upper_bound:
                      # It is a valid scale, so track it.
                      scale = scale_candidate
                  else:
                      # This scale is not valid and we can stop looking.
                      # We use the last (valid) scale that we saw.
                      break
  
      self._scale = scale
      return self._scale
  
imports: from abc import ABCMeta, abstractmethod
  import numpy
  import shapely.geometry
  import cartopy.crs
  import cartopy.io.shapereader
label_desc: Use image node_id 2 for calling the AdaptiveScaler obj's underlying member method code with example usage: obj.scale_from_extent(extent) and returns: self