code: def refine_matrixelement(expr, assumptions):
      """
      Handler for symmetric part.
  
      Examples
      ========
  
      >>> from sympy.assumptions.refine import refine_matrixelement
      >>> from sympy import MatrixSymbol, Q
      >>> X = MatrixSymbol('X', 3, 3)
      >>> refine_matrixelement(X[0, 1], Q.symmetric(X))
      X[0, 1]
      >>> refine_matrixelement(X[1, 0], Q.symmetric(X))
      X[0, 1]
      """
      from sympy.matrices.expressions.matexpr import MatrixElement
  
      matrix, i, j = expr.args
      if ask(Q.symmetric(matrix), assumptions):
          if (i - j).could_extract_minus_sign():
              return expr
          return MatrixElement(matrix, j, i)
  
file_path: sympy/sympy/assumptions/refine.py
imports: from __future__ import annotations
  from typing import Callable
  from sympy.core import S, Add, Expr, Basic, Mul, Pow, Rational
  from sympy.core.logic import fuzzy_not
  from sympy.logic.boolalg import Boolean
  from sympy.assumptions import ask, Q
label_desc: Use image node_id 10 for calling a global function with example usage: refine_matrixelement(expr, assumptions) and returns: MatrixElement, expr