code: def broadcastable_shapes(
      shape, min_dims=0, max_dims=None, min_side=1, max_side=None
  ):
      # type: (Shape, int, int, int, int) -> st.SearchStrategy[Shape]
      """Return a strategy for generating shapes that are broadcast-compatible
      with the provided shape.
  
      Examples from this strategy shrink towards a shape with length ``min_dims``.
      The size of an aligned dimension shrinks towards size ``1``. The
      size of an unaligned dimension shrink towards ``min_side``.
  
      * ``shape`` a tuple of integers
      * ``min_dims`` The smallest length that the generated shape can possess.
      * ``max_dims`` The largest length that the generated shape can possess.
        The default-value for ``max_dims`` is ``min(32, max(len(shape), min_dims) + 2)``.
      * ``min_side`` The smallest size that an unaligned dimension can possess.
      * ``max_side`` The largest size that an unaligned dimension can possess.
        The default value is 2 + 'size-of-largest-aligned-dimension'.
  
      The following are some examples drawn from this strategy.
  
      .. code-block:: pycon
  
          >>> [broadcastable_shapes(shape=(2, 3)).example() for i in range(5)]
          [(1, 3), (), (2, 3), (2, 1), (4, 1, 3), (3, )]
  
      """
      check_type(tuple, shape, "shape")
      strict_check = max_side is None or max_dims is None
      check_type(integer_types, min_side, "min_side")
      check_type(integer_types, min_dims, "min_dims")
  
      if max_dims is None:
          max_dims = min(32, max(len(shape), min_dims) + 2)
      else:
          check_type(integer_types, max_dims, "max_dims")
  
      if max_side is None:
          max_side = max(tuple(shape[-max_dims:]) + (min_side,)) + 2
      else:
          check_type(integer_types, max_side, "max_side")
  
      order_check("dims", 0, min_dims, max_dims)
      order_check("side", 0, min_side, max_side)
  
      if 32 < max_dims:
          raise InvalidArgument("max_dims cannot exceed 32")
  
      dims, bnd_name = (
          (max_dims, "max_dims")
          if strict_check
          else (min_dims, "min_dims")
      )
  
      # check for unsatisfiable min_side
      if not all(min_side <= s for s in shape[::-1][:dims] if s != 1):
          raise InvalidArgument(
              "Given shape=%r, there are no broadcast-compatible "
              "shapes that satisfy: %s=%s and min_side=%s"
              % (shape, bnd_name, dims, min_side)
          )
  
      # check for unsatisfiable [min_side, max_side]
      if not (
          min_side <= 1 <= max_side
          or all(s <= max_side for s in shape[::-1][:dims])
      ):
          raise InvalidArgument(
              "Given shape=%r, there are no broadcast-compatible shapes "
              "that satisfy: %s=%s and [min_side=%s, max_side=%s]"
              % (shape, bnd_name, dims, min_side, max_side)
          )
  
      if not strict_check:
          # reduce max_dims to exclude unsatisfiable dimensions
          for n, s in zip(range(max_dims), reversed(shape)):
              if s < min_side and s != 1:
                  max_dims = n
                  break
              elif not (min_side <= 1 <= max_side or s <= max_side):
                  max_dims = n
                  break
  
      return MutuallyBroadcastableShapesStrategy(
          num_shapes=1,
          base_shape=shape,
          min_dims=min_dims,
          max_dims=max_dims,
          min_side=min_side,
          max_side=max_side,
      ).map(lambda x: x.input_shapes[0])
  
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 23 for calling a global function with example usage: broadcastable_shapes(shape, min_dims, max_dims, min_side, max_side) and returns: MutuallyBroadcastableShapesStrategy