code: def test_gridliner():
      ny, nx = 2, 4
  
      fig = plt.figure(figsize=(10, 10))
  
      ax = fig.add_subplot(nx, ny, 1, projection=ccrs.PlateCarree())
      ax.set_global()
      ax.coastlines(resolution="110m")
      ax.gridlines(linestyle=":")
  
      ax = fig.add_subplot(
          nx, ny, 2, projection=ccrs.OSGB(approx=False)
      )
      ax.set_global()
      ax.coastlines(resolution="110m")
      ax.gridlines(linestyle=":")
  
      ax = fig.add_subplot(
          nx, ny, 3, projection=ccrs.OSGB(approx=False)
      )
      ax.set_global()
      ax.coastlines(resolution="110m")
      ax.gridlines(ccrs.PlateCarree(), color="blue", linestyle="-")
      ax.gridlines(ccrs.OSGB(approx=False), linestyle=":")
  
      ax = fig.add_subplot(nx, ny, 4, projection=ccrs.PlateCarree())
      ax.set_global()
      ax.coastlines(resolution="110m")
      ax.gridlines(
          ccrs.NorthPolarStereo(),
          alpha=0.5,
          linewidth=1.5,
          linestyle="-",
      )
  
      ax = fig.add_subplot(nx, ny, 5, projection=ccrs.PlateCarree())
      ax.set_global()
      ax.coastlines(resolution="110m")
      osgb = ccrs.OSGB(approx=False)
      ax.set_extent(
          tuple(osgb.x_limits) + tuple(osgb.y_limits), crs=osgb
      )
      ax.gridlines(osgb, linestyle=":")
  
      ax = fig.add_subplot(
          nx, ny, 6, projection=ccrs.NorthPolarStereo()
      )
      ax.set_global()
      ax.coastlines(resolution="110m")
      ax.gridlines(alpha=0.5, linewidth=1.5, linestyle="-")
  
      ax = fig.add_subplot(
          nx, ny, 7, projection=ccrs.NorthPolarStereo()
      )
      ax.set_global()
      ax.coastlines(resolution="110m")
      osgb = ccrs.OSGB(approx=False)
      ax.set_extent(
          tuple(osgb.x_limits) + tuple(osgb.y_limits), crs=osgb
      )
      ax.gridlines(osgb, linestyle=":")
  
      ax = fig.add_subplot(
          nx, ny, 8, projection=ccrs.Robinson(central_longitude=135)
      )
      ax.set_global()
      ax.coastlines(resolution="110m")
      ax.gridlines(
          ccrs.PlateCarree(), alpha=0.5, linewidth=1.5, linestyle="-"
      )
  
      delta = 1.5e-2
      fig.subplots_adjust(
          left=0 + delta,
          right=1 - delta,
          top=1 - delta,
          bottom=0 + delta,
      )
      return fig
  
imports: import io
  from unittest import mock
  from matplotlib.collections import PolyCollection
  import matplotlib.pyplot
  import matplotlib.ticker
  import numpy
  import pytest
  from shapely.geos import geos_version
  import cartopy.crs
  from cartopy.mpl import _MPL_36
  from cartopy.mpl.geoaxes import GeoAxes
  from cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER, Gridliner, classic_formatter, classic_locator
  from cartopy.mpl.ticker import LongitudeFormatter, LongitudeLocator
label_desc: Use image node_id 1 for calling a global function with example usage: test_gridliner() and returns: fig