code: def _helper_random_tensorarray(draw, fn=None):
      size = draw(st.integers(1, 10))
      dynamic_size = draw(st.booleans())
      clear_after_read = draw(st.booleans())
      infer_shape = draw(st.booleans())
      element_shape = draw(helpers.get_shape())
      element_shape = draw(
          st.one_of(st.just(None), st.just(element_shape))
      )
      shape = None
      if (
          infer_shape
          or element_shape is not None
          or fn in ["scatter", "stack", "gather", "concat"]
      ):
          if fn == "concat":
              element_shape = None
              infer_shape = False
              shape = list(draw(helpers.get_shape(min_num_dims=1)))
          elif element_shape is None:
              shape = draw(helpers.get_shape())
          else:
              shape = element_shape
      dtype = draw(
          helpers.get_dtypes(full=False, prune_function=False)
      )[0]
      if fn in ["stack", "concat"]:
          ids_to_write = [True for i in range(size)]
      else:
          ids_to_write = [draw(st.booleans()) for i in range(size)]
          if sum(ids_to_write) == 0:
              ids_to_write[draw(st.integers(0, size - 1))] = True
      kwargs = {
          "dtype": dtype,
          "size": size,
          "dynamic_size": dynamic_size,
          "clear_after_read": clear_after_read,
          "infer_shape": infer_shape,
          "element_shape": element_shape,
      }
      id_write = []
      for id, flag in enumerate(ids_to_write):
          if fn == "concat":
              shape[0] = draw(st.integers(1, 10))
          if flag:
              write = np.array(
                  draw(
                      helpers.array_values(
                          dtype=dtype,
                          shape=shape
                          if shape is not None
                          else helpers.get_shape(),
                      )
                  )
              )
              id_write.append((id, write))
      if fn != "gather":
          return id_write, kwargs
      else:
          ids = []
          for id, _ in id_write:
              if draw(st.booleans()):
                  ids.append(id)
          if not ids:
              ids.append(id)
          return id_write, kwargs, ids
  
imports: from hypothesis import strategies, given
  import numpy
  import tensorflow
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import BackendHandler
label_desc: Use image node_id 2 for calling a global function with example usage: _helper_random_tensorarray(draw, fn) and returns: id_write,  kwargs, id_write,  kwargs,  ids