code: def concat(variables, dim='concat_dim', positions=None, shortcut=False):
      
      variables = list(variables)
      if all(isinstance(v, IndexVariable) for v in variables):
          return IndexVariable.concat(variables, dim, positions, shortcut)
      else:
          return Variable.concat(variables, dim, positions, shortcut)
docs: Concatenate variables along a new or existing dimension.
  
      Parameters
      ----------
      variables : iterable of Array
          Arrays to stack together. Each variable is expected to have
          matching dimensions and shape except for along the stacked
          dimension.
      dim : str or DataArray, optional
          Name of the dimension to stack along. This can either be a new
          dimension name, in which case it is added along axis=0, or an
          existing dimension name, in which case the location of the
          dimension is unchanged. Where to insert the new dimension is
          determined by the first variable.
      positions : None or list of integer arrays, optional
          List of integer arrays which specifies the integer positions to which
          to assign each dataset along the concatenated dimension. If not
          supplied, objects are concatenated in the provided order.
      shortcut : bool, optional
          This option is used internally to speed-up groupby operations.
          If `shortcut` is True, some checks of internal consistency between
          arrays to concatenate are skipped.
  
      Returns
      -------
      stacked : Variable
          Concatenated Variable formed by stacking all the supplied variables
          along the given dimension.