code: def _as_tensor_helper(draw):
      dtype_and_x = draw(
          st.one_of(
              helpers.dtype_and_values(
                  available_dtypes=helpers.get_dtypes("valid"),
              ),
              st.floats(),
              st.integers(),
              st.lists(
                  st.one_of(st.floats(), st.integers()), min_size=1
              ),
          )
      )
      if isinstance(dtype_and_x, tuple):
          input_dtype = dtype_and_x[0]
          x = dtype_and_x[1][0]
      else:
          input_dtype = []
          x = dtype_and_x
      dtype = draw(
          st.one_of(
              helpers.get_castable_dtype(
                  draw(helpers.get_dtypes("valid")),
                  dtype=draw(helpers.get_dtypes("valid", full=False))[
                      0
                  ],
                  x=x,
              ),
              st.none(),
          )
      )
      if isinstance(dtype, tuple):
          dtype = dtype[0]
      return input_dtype, x, dtype
  
imports: from hypothesis import strategies, assume
  import math
  import numpy
  import ivy_tests.test_ivy.helpers
  import ivy_tests.test_ivy.helpers.globals
  from ivy_tests.test_ivy.helpers import handle_frontend_test, BackendHandler
label_desc: Use image node_id 2 for calling a global function with example usage: _as_tensor_helper(draw) and returns: input_dtype,  x,  dtype