code: def _pivot(M, i, j):
      """
      The pivot element `M[i, j]` is inverted and the rest of the matrix
      modified and returned as a new matrix; original is left unmodified.
  
      Example
      =======
  
      >>> from sympy.matrices.dense import Matrix
      >>> from sympy.solvers.simplex import _pivot
      >>> from sympy import var
      >>> Matrix(3, 3, var('a:i'))
      Matrix([
      [a, b, c],
      [d, e, f],
      [g, h, i]])
      >>> _pivot(_, 1, 0)
      Matrix([
      [-a/d, -a*e/d + b, -a*f/d + c],
      [ 1/d,        e/d,        f/d],
      [-g/d,  h - e*g/d,  i - f*g/d]])
      """
      Mi, Mj, Mij = M[i, :], M[:, j], M[i, j]
      if Mij == 0:
          raise ZeroDivisionError(
              "Tried to pivot about zero-valued entry."
          )
      A = M - Mj * (Mi / Mij)
      A[i, :] = Mi / Mij
      A[:, j] = -Mj / Mij
      A[i, j] = 1 / Mij
      return A
  
imports: from sympy.core import sympify
  from sympy.core.exprtools import factor_terms
  from sympy.core.relational import Le, Ge, Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy
  from sympy.core.sorting import ordered
  from sympy.functions.elementary.complexes import sign
  from sympy.matrices.dense import Matrix, zeros
  from sympy.solvers.solveset import linear_eq_to_matrix
  from sympy.utilities.iterables import numbered_symbols
  from sympy.utilities.misc import filldedent
label_desc: Use image node_id 1 for calling a global function with example usage: _pivot(M, i, j) and returns: A