code: def interp(self, coords=None, method='linear', assume_sorted=False,
                 kwargs={}, **coords_kwargs):
          from . import missing
          coords = either_dict_or_kwargs(coords, coords_kwargs, 'interp')
          indexers = OrderedDict(self._validate_indexers(coords))
          obj = self if assume_sorted else self.sortby([k for k in coords])
          def maybe_variable(obj, k):
              try:
                  return obj._variables[k]
              except KeyError:
                  return as_variable((k, range(obj.dims[k])))
          def _validate_interp_indexer(x, new_x):
              if (_contains_datetime_like_objects(x) and
                      not _contains_datetime_like_objects(new_x)):
                  raise TypeError('When interpolating over a datetime-like '
                                  'coordinate, the coordinates to '
                                  'interpolate to must be either datetime '
                                  'strings or datetimes. '
                                  'Instead got\n{}'.format(new_x))
              else:
                  return (x, new_x)
          variables = OrderedDict()
          for name, var in obj._variables.items():
              if name not in indexers:
                  if var.dtype.kind in 'uifc':
                      var_indexers = {
                          k: _validate_interp_indexer(maybe_variable(obj, k), v)
                          for k, v in indexers.items()
                          if k in var.dims
                      }
                      variables[name] = missing.interp(
                          var, var_indexers, method, **kwargs)
                  elif all(d not in indexers for d in var.dims):
                      variables[name] = var
          coord_names = set(variables).intersection(obj._coord_names)
          indexes = OrderedDict(
              (k, v) for k, v in obj.indexes.items() if k not in indexers)
          selected = self._replace_with_new_dims(
              variables.copy(), coord_names, indexes=indexes)
          variables.update(indexers)
          indexes.update(
              (k, v.to_index()) for k, v in indexers.items() if v.dims == (k,)
          )
          coord_vars, new_indexes = (
              selected._get_indexers_coords_and_indexes(coords))
          variables.update(coord_vars)
          indexes.update(new_indexes)
          coord_names = (set(variables)
                         .intersection(obj._coord_names)
                         .union(coord_vars))
          return self._replace_with_new_dims(
              variables, coord_names, indexes=indexes)