code: def test_asarray(
      *,
      x_dtype_x_and_dtype,
      test_flags,
      backend_fw,
      fn_name,
      on_device,
  ):
      x_dtype, x, dtype = x_dtype_x_and_dtype
      if isinstance(x, list) and len(x) == 1:
          x = x[0]
      assume(not test_flags.container[0])
      # avoid casting complex to non-complex
      if dtype is not None:
          assume(
              not ("complex" in x_dtype[0] and "complex" not in dtype)
          )
      helpers.test_function(
          input_dtypes=x_dtype,
          test_flags=test_flags,
          on_device=on_device,
          backend_to_test=backend_fw,
          fn_name=fn_name,
          object_in=x,
          dtype=dtype,
          device=on_device,
      )
  
imports: from hypothesis import strategies, assume
  import numpy
  import ivy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test, BackendHandler
  import ivy_tests.test_ivy.helpers.globals
  from ivy_tests.test_ivy.test_functional.test_core.test_dtype import astype_helper
label_desc: Use image node_id 9 for calling a global function with example usage: test_asarray() without return types