code: def _get_output(array, out, fname, dtype=None, output=None):
      """
      output = _get_output(array, out, fname, dtype=None, output=None)
      Implements the caer output convention:
          (1) if `out` is None, return np.empty(array.shape, array.dtype)
          (2) else verify that output is of right size, shape, and contiguous
      Parameters
      ----------
      array : Tensor
      out : Tensor or None
      fname : str
          Function name. Used in error messages
      Returns
      -------
      output : Tensor
      """
      detail = ".\nWhen an output argument is used, the checking is very strict as this is a performance feature."
      if dtype is None:
          dtype = array.dtype
      if output is not None:  # pragma: no cover
          import warnings
  
          warnings.warn(
              "Using deprecated `output` argument in function `%s`. Please use `out` in the future. It has exactly the same meaning and it matches what numpy uses."
              % fname,
              DeprecationWarning,
          )
          if out is not None:
              warnings.warn(
                  "Using both `out` and `output` in function `%s`.\ncaer is going to ignore the `output` argument and use the `out` version exclusively."
                  % fname
              )
          else:
              out = output
  
      if out is None:
          return np.empty(array.shape, dtype)
  
      if out.dtype != dtype:
          raise ValueError(
              "caer.%s: `out` has wrong type (out.dtype is %s; expected %s)%s"
              % (fname, out.dtype, dtype, detail)
          )
  
      if out.shape != array.shape:
          raise ValueError(
              f"caer.{fname}: `out` has wrong shape (got {out.shape}, while expecting {array.shape}){detail}"
          )
  
      if not out.flags.contiguous:
          raise ValueError(
              f"caer.{fname}: `out` is not c-array{detail}"
          )
  
      return out
  
file_path: caer/caer/_internal.py
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: _get_output(array, out, fname, dtype, output) and returns: out, np