code: def _get_output(array, out, fname, dtype=None, output=None):
      """
      output = _get_output(array, out, fname, dtype=None, output=None)
  
      Implements the mahotas 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 : ndarray
      out : ndarray or None
      fname : str
          Function name. Used in error messages
  
      Returns
      -------
      output : ndarray
      """
      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`.\nMahotas 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(
              "mahotas.%s: `out` has wrong type (out.dtype is %s; expected %s)%s"
              % (fname, out.dtype, dtype, detail)
          )
      if out.shape != array.shape:
          raise ValueError(
              "mahotas.%s: `out` has wrong shape (got %s, while expecting %s)%s"
              % (fname, out.shape, array.shape, detail)
          )
      if not out.flags.contiguous:
          raise ValueError(
              "mahotas.%s: `out` is not c-array%s" % (fname, detail)
          )
      return out
  
file_path: mahotas/mahotas/internal.py
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _get_output(array, out, fname, dtype, output) and returns: out, np