code: def call_highest_priority(method_name):
      """A decorator for binary special methods to handle _op_priority.
  
      Explanation
      ===========
  
      Binary special methods in Expr and its subclasses use a special attribute
      '_op_priority' to determine whose special method will be called to
      handle the operation. In general, the object having the highest value of
      '_op_priority' will handle the operation. Expr and subclasses that define
      custom binary special methods (__mul__, etc.) should decorate those
      methods with this decorator to add the priority logic.
  
      The ``method_name`` argument is the name of the method of the other class
      that will be called.  Use this decorator in the following manner::
  
          # Call other.__rmul__ if other._op_priority > self._op_priority
          @call_highest_priority('__rmul__')
          def __mul__(self, other):
              ...
  
          # Call other.__mul__ if other._op_priority > self._op_priority
          @call_highest_priority('__mul__')
          def __rmul__(self, other):
          ...
      """
  
      def priority_decorator(func):
          @wraps(func)
          def binary_op_wrapper(self, other):
              if hasattr(other, "_op_priority"):
                  if other._op_priority > self._op_priority:
                      f = getattr(other, method_name, None)
                      if f is not None:
                          return f(self)
              return func(self, other)
  
          return binary_op_wrapper
  
      return priority_decorator
  
file_path: sympy/sympy/core/decorators.py
imports: from functools import wraps
  from .sympify import SympifyError, sympify
label_desc: Use image node_id 3 for calling a global function with example usage: call_highest_priority(method_name) and returns: priority_decorator, binary_op_wrapper, func, f