code: def _get_first_match(expr, pattern):
      from matchpy import ManyToOneMatcher, Pattern
  
      matcher = ManyToOneMatcher()
      matcher.add(Pattern(pattern))
      return next(iter(matcher.match(expr)))
  
file_path: sympy/sympy/utilities/tests/test_matchpy_connector.py
imports: import pickle
  from sympy.core.relational import Eq, Ne
  from sympy.core.singleton import S
  from sympy.core.symbol import symbols
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.external import import_module
  from sympy.testing.pytest import skip
  from sympy.utilities.matchpy_connector import WildDot, WildPlus, WildStar, Replacer
label_desc: Use image node_id 1 for calling a global function with example usage: _get_first_match(expr, pattern) and returns: next