code: def _minor(M, i, j, method="berkowitz"):
      """Return the (i,j) minor of ``M``.  That is,
      return the determinant of the matrix obtained by deleting
      the `i`th row and `j`th column from ``M``.
  
      Parameters
      ==========
  
      i, j : int
          The row and column to exclude to obtain the submatrix.
  
      method : string, optional
          Method to use to find the determinant of the submatrix, can be
          "bareiss", "berkowitz", "bird", "laplace" or "lu".
  
      Examples
      ========
  
      >>> from sympy import Matrix
      >>> M = Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
      >>> M.minor(1, 1)
      -12
  
      See Also
      ========
  
      minor_submatrix
      cofactor
      det
      """
  
      if not M.is_square:
          raise NonSquareMatrixError()
  
      return M.minor_submatrix(i, j).det(method=method)
  
imports: from types import FunctionType
  from sympy.core.cache import cacheit
  from sympy.core.numbers import Float, Integer
  from sympy.core.singleton import S
  from sympy.core.symbol import uniquely_named_symbol
  from sympy.core.mul import Mul
  from sympy.polys import PurePoly, cancel
  from sympy.functions.combinatorial.numbers import nC
  from sympy.polys.matrices.domainmatrix import DomainMatrix
  from sympy.polys.matrices.ddm import DDM
  from .exceptions import NonSquareMatrixError
  from .utilities import _get_intermediate_simp, _get_intermediate_simp_bool, _iszero, _is_zero_after_expand_mul, _dotprodsimp, _simplify
label_desc: Use image node_id 18 for calling a global function with example usage: _minor(M, i, j, method) and returns: M