code: def _check_bounds_and_get_shape(low, high, shape):
      if shape is not None:
          ivy.utils.assertions.check_all_or_any_fn(
              low,
              high,
              fn=lambda x: isinstance(x, (int, float)),
              type="all",
              message="low and high bounds must be numerics when shape is specified",
          )
          return ivy.Shape(shape)
  
      valid_types = (ivy.Array,)
      if len(backend_stack) == 0:
          valid_types += (ivy.current_backend().NativeArray,)
      else:
          valid_types += (ivy.NativeArray,)
      if isinstance(low, valid_types):
          if isinstance(high, valid_types):
              ivy.utils.assertions.check_equal(
                  ivy.shape(low), ivy.shape(high), as_array=False
              )
          return ivy.shape(low)
      if isinstance(high, valid_types):
          return ivy.shape(high)
      return ivy.Shape(())
  
file_path: ivy/ivy/functional/ivy/random.py
imports: from typing import Optional, Union
  import ivy
  from ivy.func_wrapper import handle_array_function, infer_dtype, handle_out_argument, to_native_arrays_and_back, inputs_to_native_shapes, handle_nestable, handle_device, handle_backend_invalid
  from ivy.utils.backend import backend_stack
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 1 for calling a global function with example usage: _check_bounds_and_get_shape(low, high, shape) and returns: ivy, ivy, ivy, ivy