code: def _hypothesis_parse_gufunc_signature(signature, all_checks=True):
      # Disable all_checks to better match the Numpy version, for testing
      if not re.match(_SIGNATURE, signature):
          if re.match(_SIGNATURE_MULTIPLE_OUTPUT, signature):
              raise InvalidArgument(
                  "Hypothesis does not yet support generalised ufunc signatures "
                  "with multiple output arrays - mostly because we don't know of "
                  "anyone who uses them!  Please get in touch with us to fix that."
                  "\n (signature=%r)" % (signature,)
              )
          if re.match(np.lib.function_base._SIGNATURE, signature):
              raise InvalidArgument(
                  "signature=%r matches Numpy's regex for gufunc signatures, but "
                  "contains shapes with more than 32 dimensions and is thus invalid."
                  % (signature,)
              )
          raise InvalidArgument(
              "%r is not a valid gufunc signature" % (signature,)
          )
      input_shapes, output_shapes = (
          tuple(
              tuple(re.findall(_DIMENSION, a))
              for a in re.findall(_SHAPE, arg_list)
          )
          for arg_list in signature.split("->")
      )
      assert len(output_shapes) == 1
      result_shape = output_shapes[0]
      if all_checks:
          # Check that there are no names in output shape that do not appear in inputs.
          # (kept out of parser function for easier generation of test values)
          # We also disallow frozen optional dimensions - this is ambiguous as there is
          # no way to share an un-named dimension between shapes.  Maybe just padding?
          # Anyway, we disallow it pending clarification from upstream.
          frozen_optional_err = (
              "Got dimension %r, but handling of frozen optional dimensions "
              "is ambiguous.  If you known how this should work, please "
              "contact us to get this fixed and documented (signature=%r)."
          )
          only_out_err = (
              "The %r dimension only appears in the output shape, and is "
              "not frozen, so the size is not determined (signature=%r)."
          )
          names_in = {n.strip("?") for shp in input_shapes for n in shp}
          names_out = {n.strip("?") for n in result_shape}
          for shape in input_shapes + (result_shape,):
              for name in shape:
                  try:
                      int(name.strip("?"))
                      if "?" in name:
                          raise InvalidArgument(
                              frozen_optional_err % (name, signature)
                          )
                  except ValueError:
                      if name.strip("?") in (names_out - names_in):
                          quiet_raise(
                              InvalidArgument(
                                  only_out_err % (name, signature)
                              )
                          )
      return _GUfuncSig(
          input_shapes=input_shapes, result_shape=result_shape
      )
  
imports: from __future__ import absolute_import, division, print_function
  import math
  import re
  from collections import namedtuple
  import numpy
  import hypothesis.internal.conjecture.utils
  import hypothesis.strategies._internal.core
  from hypothesis import Verbosity, assume
  from hypothesis._settings import note_deprecation
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.compat import PY2, hrange, integer_types, quiet_raise, string_types
  from hypothesis.internal.coverage import check_function
  from hypothesis.internal.reflection import proxies, reserved_means_kwonly_star
  from hypothesis.internal.validation import check_type, check_valid_interval
  from hypothesis.reporting import current_verbosity
  from hypothesis.strategies._internal import SearchStrategy
  from hypothesis.utils.conventions import UniqueIdentifier, not_set
label_desc: Use image node_id 24 for calling a global function with example usage: _hypothesis_parse_gufunc_signature(signature, all_checks) and returns: _GUfuncSig