code: def _parse_gufunc_signature(
      signature: str,
  ) -> tuple[list[CoreDims], list[CoreDims]]:
      """Parse string signatures for a generalized universal function.
  
      Args:
        signature: generalized universal function signature, e.g.,
          ``(m,n),(n,p)->(m,p)`` for ``jnp.matmul``.
  
      Returns:
        Input and output core dimensions parsed from the signature.
      """
      if not re.match(_SIGNATURE, signature):
          raise ValueError(f"not a valid gufunc signature: {signature}")
      args, retvals = (
          [
              tuple(re.findall(_DIMENSION_NAME, arg))
              for arg in re.findall(_ARGUMENT, arg_list)
          ]
          for arg_list in signature.split("->")
      )
      return args, retvals
  
file_path: jax/jax/_src/numpy/vectorize.py
imports: from __future__ import annotations
  from collections.abc import Collection, Sequence
  import functools
  import re
  from typing import Any, Callable
  from jax._src import api
  from jax import lax
  from jax._src.numpy import lax_numpy
  from jax._src.util import safe_map, safe_zip
label_desc: Use image node_id 1 for calling a global function with example usage: _parse_gufunc_signature(signature) and returns: args,  retvals