code: def cast_filter_helper(d, dtype, x, current_backend):
      with BackendHandler.update_backend(
          current_backend
      ) as ivy_backend:
  
          def bound_dtype_bits(d):
              return (
                  ivy_backend.dtype_bits(d) / 2
                  if ivy_backend.is_complex_dtype(d)
                  else ivy_backend.dtype_bits(d)
              )
  
          if ivy_backend.is_int_dtype(d):
              max_val = ivy_backend.iinfo(d).max
              min_val = ivy_backend.iinfo(d).min
          elif ivy_backend.is_float_dtype(
              d
          ) or ivy_backend.is_complex_dtype(d):
              max_val = ivy_backend.finfo(d).max
              min_val = ivy_backend.finfo(d).min
          else:
              max_val = 1
              min_val = -1
          if x is None:
              if ivy_backend.is_int_dtype(dtype):
                  max_x = ivy_backend.iinfo(dtype).max
                  min_x = ivy_backend.iinfo(dtype).min
              elif ivy_backend.is_float_dtype(
                  dtype
              ) or ivy_backend.is_complex_dtype(dtype):
                  max_x = ivy_backend.finfo(dtype).max
                  min_x = ivy_backend.finfo(dtype).min
              else:
                  max_x = 1
                  min_x = -1
          else:
              max_x = np.max(np.asarray(x))
              min_x = np.min(np.asarray(x))
          return (
              max_x <= max_val
              and min_x >= min_val
              and bound_dtype_bits(d) >= bound_dtype_bits(dtype)
              and (
                  ivy_backend.is_complex_dtype(d)
                  or not ivy_backend.is_complex_dtype(dtype)
              )
              and (min_x > 0 or not ivy_backend.is_uint_dtype(dtype))
          )
  
file_path: ivy/ivy_tests/test_ivy/helpers/hypothesis_helpers/dtype_helpers.py
imports: import numpy
  from hypothesis import strategies
  from typing import Optional
  import ivy
  from ..pipeline_helper import BackendHandler, get_frontend_config
  from .None import number_helpers
  from .None import array_helpers
  from ..None import globals
  from ..globals import mod_backend
label_desc: Use image node_id 8 for calling a global function with example usage: cast_filter_helper(d, dtype, x, current_backend) and returns: unknown, unknown