code: def check_matching_coordinates(func):
      
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          data_arrays = ([a for a in args if isinstance(a, xr.DataArray)]
                         + [a for a in kwargs.values() if isinstance(a, xr.DataArray)])
          if len(data_arrays) > 1:
              first = data_arrays[0]
              for other in data_arrays[1:]:
                  if not first.metpy.coordinates_identical(other):
                      raise ValueError('Input DataArray arguments must be on same coordinates.')
          return func(*args, **kwargs)
      return wrapper
docs: Decorate a function to make sure all given DataArrays have matching coordinates.