code: def _dtype_pred_and_labels(
      draw,
      *,
      dtype=None,
      available_dtypes=helpers.get_dtypes("numeric"),
      min_pred_val=0,
      max_pred_val=1,  # predication array output as probabilities
      label_set=None,
      min_label_val=0,
      max_label_val=None,
      allow_inf=False,
      allow_nan=False,
      exclude_min=False,
      exclude_max=False,
      sparse_label=False,
      min_num_dims=0,
      max_num_dims=5,
      min_dim_size=1,
      max_dim_size=10,
      shape=None,
  ):
      if isinstance(min_dim_size, st._internal.SearchStrategy):
          min_dim_size = draw(min_dim_size)
      if isinstance(max_dim_size, st._internal.SearchStrategy):
          max_dim_size = draw(max_dim_size)
      if isinstance(available_dtypes, st._internal.SearchStrategy):
          available_dtypes = draw(available_dtypes)
  
      if dtype is None:
          assert (
              available_dtypes is not None
          ), "Unspecified dtype or available_dtypes."
          dtype = draw(
              helpers.array_dtypes(
                  num_arrays=1,
                  available_dtypes=available_dtypes,
              )
          )
          dtype.append("int32")
      # initialize shapes for pred and label
      if shape is not None:
          if not isinstance(shape, (tuple, list)):
              shape = draw(shape)
      else:
          shape = draw(
              st.shared(
                  helpers.get_shape(
                      min_num_dims=min_num_dims,
                      max_num_dims=max_num_dims,
                      min_dim_size=min_dim_size,
                      max_dim_size=max_dim_size,
                  ),
                  key="shape",
              )
          )
  
      if not sparse_label:
          label_shape = shape
      else:
          label_shape = shape[:-1]
  
      pred = draw(
          helpers.array_values(
              dtype=dtype[0],
              shape=shape,
              min_value=min_pred_val,
              max_value=max_pred_val,
              allow_inf=allow_inf,
              allow_nan=allow_nan,
              exclude_min=exclude_min,
              exclude_max=exclude_max,
          )
      )
      # generate labels by restriction
      if label_set is not None:
          length = 1
          for _ in label_shape:
              length *= _
          indices = draw(
              helpers.list_of_size(
                  x=st.integers(
                      min_value=0, max_value=len(label_set) - 1
                  ),
                  size=length,
              )
          )
          values = [label_set[_] for _ in indices]
          array = np.array(values)
          labels = array.reshape(label_shape).tolist()
      else:
          labels = draw(
              helpers.array_values(
                  dtype=dtype[1],
                  shape=label_shape,
                  min_value=min_label_val,
                  max_value=max_label_val,
                  allow_inf=allow_inf,
                  allow_nan=allow_nan,
                  exclude_min=exclude_min,
                  exclude_max=exclude_max,
              )
          )
  
      return dtype, pred, labels
  
imports: import numpy
  from hypothesis import strategies
  import ivy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_frontend_test
label_desc: Use image node_id 2 for calling a global function with example usage: _dtype_pred_and_labels(draw) and returns: dtype,  pred,  labels