code: def _parse_gufunc_signature(signature):
      """
      Parse string signatures for a generalized universal function.
  
      Arguments
      ---------
      signature : string
          Generalized universal function signature, e.g., ``(m,n),(n,p)->(m,p)``
          for ``np.matmul``.
  
      Returns
      -------
      Tuple of input and output core dimensions parsed from the signature, each
      of the form List[Tuple[str, ...]].
      """
      signature = re.sub(r"\s+", "", signature)
  
      if not re.match(_SIGNATURE, signature):
          raise ValueError(f"not a valid gufunc signature: {signature}")
      return tuple(
          [
              tuple(re.findall(_DIMENSION_NAME, arg))
              for arg in re.findall(_ARGUMENT, arg_list)
          ]
          for arg_list in signature.split("->")
      )
  
file_path: pytensor/pytensor/tensor/utils.py
imports: import re
  from collections.abc import Sequence
  from typing import Union
  import numpy
  import pytensor
  from pytensor.utils import hash_from_code
label_desc: Use image node_id 6 for calling a global function with example usage: _parse_gufunc_signature(signature) and returns: tuple