code: def _from_type(thing: Type[Ex]) -> Optional[st.SearchStrategy[Ex]]:
      """Called by st.from_type to try to infer a strategy for thing using numpy.
  
      If we can infer a numpy-specific strategy for thing, we return that; otherwise,
      we return None.
      """
  
      base_strats = st.one_of(
          [
              st.booleans(),
              st.integers(),
              st.floats(),
              st.complex_numbers(),
              st.text(),
              st.binary(),
          ]
      )
      # don't mix strings and non-ascii bytestrings (ex: ['', b'\x80']). See
      # https://github.com/numpy/numpy/issues/23899.
      base_strats_ascii = st.one_of(
          [
              st.booleans(),
              st.integers(),
              st.floats(),
              st.complex_numbers(),
              st.text(),
              st.binary().filter(bytes.isascii),
          ]
      )
  
      if thing == np.dtype:
          # Note: Parameterized dtypes and DTypeLike are not supported.
          return st.one_of(
              scalar_dtypes(),
              byte_string_dtypes(),
              unicode_string_dtypes(),
              array_dtypes(),
              nested_dtypes(),
          )
  
      if thing == ArrayLike:
          # We override the default type resolution to ensure the "coercible to
          # array" contract is honoured. See
          # https://github.com/HypothesisWorks/hypothesis/pull/3670#issuecomment-1578140422.
          # The actual type is (as of np 1.24), with
          # scalars:=[bool, int, float, complex, str, bytes]:
          # Union[
          #     _SupportsArray,
          #     _NestedSequence[_SupportsArray],
          #     *scalars,
          #     _NestedSequence[Union[*scalars]]
          # ]
          return st.one_of(
              # *scalars
              base_strats,
              # The two recursive strategies below cover the following cases:
              # - _SupportsArray (using plain ndarrays)
              # - _NestedSequence[Union[*scalars]] (but excluding non-ascii binary)
              # - _NestedSequence[_SupportsArray] (but with a single leaf element
              # .  to avoid the issue of unequally sized leaves)
              st.recursive(
                  st.lists(base_strats_ascii), extend=st.tuples
              ),
              st.recursive(st.from_type(np.ndarray), extend=st.tuples),
          )
  
      if isinstance(thing, type) and issubclass(thing, np.generic):
          dtype = np.dtype(thing)
          return from_dtype(dtype) if dtype.kind not in "OV" else None
  
      real_thing, args = _unpack_generic(thing)
  
      if real_thing == _NestedSequence:
          # We have to override the default resolution to ensure sequences are of
          # equal length. Actually they are still not, if the arg specialization
          # returns arbitrary-shaped sequences or arrays - hence the even more special
          # resolution of ArrayLike, above.
          assert len(args) <= 1
          base_strat = st.from_type(args[0]) if args else base_strats
          return st.one_of(
              st.lists(base_strat),
              st.recursive(st.tuples(), st.tuples),
              st.recursive(st.tuples(base_strat), st.tuples),
              st.recursive(
                  st.tuples(base_strat, base_strat), st.tuples
              ),
          )
  
      if real_thing in [np.ndarray, _SupportsArray]:
          dtype, shape = _dtype_and_shape_from_args(args)
          return arrays(dtype, shape)
  
      # We didn't find a type to resolve, continue
      return None
  
imports: import importlib
  import math
  from typing import TYPE_CHECKING, Any, Literal, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union
  import numpy
  from hypothesis import strategies
  from hypothesis._settings import note_deprecation
  from hypothesis.errors import HypothesisException, InvalidArgument
  from hypothesis.extra._array_helpers import NDIM_MAX, BasicIndex, BasicIndexStrategy, BroadcastableShapes, Shape, array_shapes, broadcastable_shapes, check_argument, check_valid_dims, mutually_broadcastable_shapes, order_check, valid_tuple_axes
  from hypothesis.internal.conjecture import utils
  from hypothesis.internal.coverage import check_function
  from hypothesis.internal.reflection import proxies
  from hypothesis.internal.validation import check_type
  from hypothesis.strategies._internal.numbers import Real
  from hypothesis.strategies._internal.strategies import Ex, T, check_strategy
  from hypothesis.strategies._internal.utils import defines_strategy
label_desc: Use image node_id 28 for calling a global function with example usage: _from_type(thing) and returns: None, st, st, unknown, st, arrays