code: def array_dtypes(
      subtype_strategy: st.SearchStrategy[np.dtype] = scalar_dtypes(),
      *,
      min_size: int = 1,
      max_size: int = 5,
      allow_subarrays: bool = False,
  ) -> st.SearchStrategy[np.dtype]:
      """Return a strategy for generating array (compound) dtypes, with members
      drawn from the given subtype strategy."""
      order_check("size", 0, min_size, max_size)
      # The empty string is replaced by f{idx}; see #1963 for details.  Much easier to
      # insist that field names be unique and just boost f{idx} strings manually.
      field_names = st.integers(0, 127).map("f{}".format) | st.text(
          min_size=1
      )
      name_titles = st.one_of(
          field_names,
          st.tuples(field_names, field_names).filter(
              lambda ns: ns[0] != ns[1]
          ),
      )
      elements: st.SearchStrategy[tuple] = st.tuples(
          name_titles, subtype_strategy
      )
      if allow_subarrays:
          elements |= st.tuples(
              name_titles,
              subtype_strategy,
              array_shapes(max_dims=2, max_side=2),
          )
      return st.lists(
          elements=elements,
          min_size=min_size,
          max_size=max_size,
          unique_by=(
              # Deduplicate by both name and title for efficiency before filtering.
              # (Field names must be unique, as must titles, and no intersections)
              lambda d: d[0] if isinstance(d[0], str) else d[0][0],
              lambda d: d[0] if isinstance(d[0], str) else d[0][1],
          ),
      ).filter(_no_title_is_name_of_a_titled_field)
  
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 19 for calling a global function with example usage: array_dtypes(subtype_strategy) and returns: st