code: def dtype_array_query_val(
      draw,
      *,
      available_dtypes,
      min_num_dims=1,
      max_num_dims=3,
      min_dim_size=0,
      max_dim_size=10,
      allow_mask=True,
      allow_neg_step=True,
  ):
      input_dtype, x, query = draw(
          helpers.dtype_array_query(
              available_dtypes=available_dtypes,
              min_num_dims=min_num_dims,
              max_num_dims=max_num_dims,
              min_dim_size=min_dim_size,
              max_dim_size=max_dim_size,
              allow_mask=allow_mask,
              allow_neg_step=allow_neg_step,
          )
      )
      real_shape = x[query].shape
      if len(real_shape):
          val_shape = real_shape[
              draw(st.integers(0, len(real_shape))) :
          ]
      else:
          val_shape = real_shape
      val_dtype, val = draw(
          helpers.dtype_and_values(
              dtype=[input_dtype[0]],
              shape=val_shape,
              large_abs_safety_factor=2,
              small_abs_safety_factor=2,
          )
      )
      val_dtype = draw(
          helpers.get_castable_dtype(
              draw(available_dtypes),
              input_dtype[0],
              x if 0 not in x.shape else None,
          )
      )[-1]
      val = val[0].astype(val_dtype)
      return input_dtype + [val_dtype], x, query, val
  
imports: import numpy
  import hypothesis.extra.numpy
  from hypothesis import strategies
  from hypothesis.internal.floats import float_of
  from functools import reduce
  from operator import mul
  import sys
  import string
  import ml_dtypes
  import ivy_tests.test_ivy.helpers.globals
  from ..pipeline_helper import WithBackendContext
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers.hypothesis_helpers.dtype_helpers import get_dtypes
  from .None import general_helpers
  from .None import dtype_helpers, number_helpers
  from ..globals import mod_backend
label_desc: Use image node_id 19 for calling a global function with example usage: dtype_array_query_val(draw) and returns: unknown,  x,  query,  val