code: def arrays(draw, type, size=None, nullable=True):
      if isinstance(type, st.SearchStrategy):
          ty = draw(type)
      elif isinstance(type, pa.DataType):
          ty = type
      else:
          raise TypeError("Type must be a pyarrow DataType")
  
      if isinstance(size, st.SearchStrategy):
          size = draw(size)
      elif size is None:
          size = draw(_default_array_sizes)
      elif not isinstance(size, int):
          raise TypeError("Size must be an integer")
  
      if pa.types.is_null(ty):
          h.assume(nullable)
          value = st.none()
      elif pa.types.is_boolean(ty):
          value = st.booleans()
      elif pa.types.is_integer(ty):
          values = draw(
              npst.arrays(ty.to_pandas_dtype(), shape=(size,))
          )
          return pa.array(values, type=ty)
      elif pa.types.is_floating(ty):
          values = draw(
              npst.arrays(ty.to_pandas_dtype(), shape=(size,))
          )
          # Workaround ARROW-4952: no easy way to assert array equality
          # in a NaN-tolerant way.
          values[np.isnan(values)] = -42.0
          return pa.array(values, type=ty)
      elif pa.types.is_decimal(ty):
          # TODO(kszucs): properly limit the precision
          # value = st.decimals(places=type.scale, allow_infinity=False)
          h.reject()
      elif pa.types.is_time(ty):
          value = st.times()
      elif pa.types.is_date(ty):
          value = st.dates()
      elif pa.types.is_timestamp(ty):
          if zoneinfo is None:
              pytest.skip(
                  "no module named zoneinfo (or tzdata on Windows)"
              )
          if ty.tz is None:
              pytest.skip("requires timezone not None")
          min_int64 = -(2**63)
          max_int64 = 2**63 - 1
          min_datetime = datetime.datetime.fromtimestamp(
              min_int64 // 10**9
          ) + datetime.timedelta(hours=12)
          max_datetime = datetime.datetime.fromtimestamp(
              max_int64 // 10**9
          ) - datetime.timedelta(hours=12)
          try:
              offset = ty.tz.split(":")
              offset_hours = int(offset[0])
              offset_min = int(offset[1])
              tz = datetime.timedelta(
                  hours=offset_hours, minutes=offset_min
              )
          except ValueError:
              tz = zoneinfo.ZoneInfo(ty.tz)
          value = st.datetimes(
              timezones=st.just(tz),
              min_value=min_datetime,
              max_value=max_datetime,
          )
      elif pa.types.is_duration(ty):
          value = st.timedeltas()
      elif pa.types.is_interval(ty):
          value = st.timedeltas()
      elif pa.types.is_binary(ty) or pa.types.is_large_binary(ty):
          value = st.binary()
      elif pa.types.is_string(ty) or pa.types.is_large_string(ty):
          value = st.text()
      elif pa.types.is_fixed_size_binary(ty):
          value = st.binary(
              min_size=ty.byte_width, max_size=ty.byte_width
          )
      elif pa.types.is_list(ty):
          value = _pylist(ty.value_type, size=size, nullable=nullable)
      elif pa.types.is_large_list(ty):
          value = _pylist(ty.value_type, size=size, nullable=nullable)
      elif pa.types.is_fixed_size_list(ty):
          value = _pylist(
              ty.value_type, size=ty.list_size, nullable=nullable
          )
      elif pa.types.is_dictionary(ty):
          values = _pylist(ty.value_type, size=size, nullable=nullable)
          return pa.array(draw(values), type=ty)
      elif pa.types.is_map(ty):
          value = _pymap(
              ty.key_type,
              ty.item_type,
              size=_default_array_sizes,
              nullable=nullable,
          )
      elif pa.types.is_struct(ty):
          h.assume(len(ty) > 0)
          fields, child_arrays = [], []
          for field in ty:
              fields.append(field)
              child_arrays.append(draw(arrays(field.type, size=size)))
          return pa.StructArray.from_arrays(child_arrays, fields=fields)
      else:
          raise NotImplementedError(ty)
  
      if nullable:
          value = st.one_of(st.none(), value)
      values = st.lists(value, min_size=size, max_size=size)
  
      return pa.array(draw(values), type=ty)
  
imports: import datetime
  import sys
  import pytest
  import hypothesis
  import hypothesis.strategies
  import hypothesis.extra.numpy
  import numpy
  import pyarrow
label_desc: Use image node_id 9 for calling a global function with example usage: arrays(draw, type, size, nullable) and returns: pa, pa, pa, pa, pa