code: def crs_check(path):
      """Get the CRS of a raster file from a file path.
  
      Parameters
      ----------
      path : string
          Path to a raster file in a format that rasterio can read.
  
      Returns
      -------
      crs : crs object
          The CRS object stored in the raster file.
      """
  
      try:
          with rio.open(path) as src:
              # This section runs when the data is in a hierarchial format
              if len(src.subdatasets) > 0:
                  for data in src.subdatasets:
                      with rio.open(data) as data_src:
                          crs = data_src.crs
              else:
                  crs = src.crs
          if crs is None:
              raise ValueError(
                  "No CRS found in data. The raster may not have one."
              )
          else:
              return crs
      except rio.errors.RasterioIOError:
          raise rio.errors.RasterioIOError(
              "Oops, your data are not in a format "
              "that rasterio can read. Please "
              "check the rasterio documentation "
              "for accepted file formats and make "
              "sure that your data are in raster "
              "format..\n"
          )
  
file_path: earthpy/earthpy/spatial.py
imports: import os
  import sys
  import contextlib
  import warnings
  import numpy
  from shapely.geometry import mapping, box
  import geopandas
  import rasterio
  from rasterio.mask import mask
label_desc: Use image node_id 9 for calling a global function with example usage: crs_check(path) and returns: crs