code: def check_crs(crs):
      """
      Checks if the crs represents a valid grid, projection or ESPG string.
  
      (Code copied and adapted from https://github.com/fmaussion/salem)
  
      Examples
      --------
      >>> p = check_crs('epsg:26915 +units=m')
      >>> p.srs
      '+proj=utm +zone=15 +datum=NAD83 +units=m +no_defs'
      >>> p = check_crs('wrong')
      >>> p is None
      True
  
      Returns
      -------
      A valid crs if possible, otherwise None.
      """
      import pyproj
  
      try:
          crs_type = pyproj.crs.CRS
      except AttributeError:
  
          class Dummy:
              pass
  
          crs_type = Dummy
  
      if isinstance(crs, pyproj.Proj):
          out = crs
      elif isinstance(crs, crs_type):
          out = pyproj.Proj(crs.to_wkt(), preserve_units=True)
      elif isinstance(crs, dict) or isinstance(crs, str):
          if isinstance(crs, str):
              try:
                  crs = pyproj.CRS.from_wkt(crs)
              except RuntimeError:
                  # quick fix for https://github.com/pyproj4/pyproj/issues/345
                  crs = crs.replace(" ", "").replace("+", " +")
          try:
              out = pyproj.Proj(crs, preserve_units=True)
          except RuntimeError:
              try:
                  out = pyproj.Proj(init=crs, preserve_units=True)
              except RuntimeError:
                  out = None
      else:
          out = None
      return out
  
imports: import sys
  from collections.abc import Hashable
  from functools import wraps
  from packaging.version import Version
  from types import FunctionType
  import bokeh
  import numpy
  import pandas
  import param
  import holoviews
label_desc: Use image node_id 3 for calling a global function with example usage: check_crs(crs) and returns: out