class_docstr: Tick formatter for a longitude axis.
class_docstr_tok: ["Tick","formatter","for","a","longitude","axis","."]
code: def _fix_lons(cls, lons):
      if isinstance(lons, list):
          return [cls._fix_lons(lon) for lon in lons]
      p180 = lons == 180
      m180 = lons == -180
  
      # Wrap
      lons = ((lons + 180) % 360) - 180
  
      # Keep -180 and 180 when requested
      for mp180, value in [(m180, -180), (p180, 180)]:
          if np.any(mp180):
              if isinstance(lons, np.ndarray):
                  lons = np.where(mp180, value, lons)
              else:
                  lons = value
  
      return lons
  
imports: import matplotlib
  from matplotlib.ticker import Formatter, MaxNLocator
  import numpy
  import cartopy.crs
  from cartopy.mpl.geoaxes import GeoAxes
label_desc: Use image node_id 3 for calling the LongitudeFormatter obj's underlying member method code with example usage: obj._fix_lons(cls, lons) and returns: lons, unknown