code: def test_can_cast_safely_mixed_kind():
      data = cudf.Series([1, 2, 3], dtype="int32")._column
      to_dtype = np.dtype("float32")
      assert data.can_cast_safely(to_dtype)
  
      # too big to fit into f32 exactly
      data = cudf.Series([1, 2, 2**24 + 1], dtype="int32")._column
      assert not data.can_cast_safely(to_dtype)
  
      data = cudf.Series([1, 2, 3], dtype="uint32")._column
      to_dtype = np.dtype("float32")
      assert data.can_cast_safely(to_dtype)
  
      # too big to fit into f32 exactly
      data = cudf.Series([1, 2, 2**24 + 1], dtype="uint32")._column
      assert not data.can_cast_safely(to_dtype)
  
      to_dtype = np.dtype("float64")
      assert data.can_cast_safely(to_dtype)
  
      data = cudf.Series([1.0, 2.0, 3.0], dtype="float32")._column
      to_dtype = np.dtype("int32")
      assert data.can_cast_safely(to_dtype)
  
      # not integer float
      data = cudf.Series([1.0, 2.0, 3.5], dtype="float32")._column
      assert not data.can_cast_safely(to_dtype)
  
      data = cudf.Series([10.0, 11.0, 2000.0], dtype="float64")._column
      assert data.can_cast_safely(to_dtype)
  
      # float out of int range
      data = cudf.Series(
          [1.0, 2.0, 1.0 * (2**31)], dtype="float32"
      )._column
      assert not data.can_cast_safely(to_dtype)
  
      # negative signed integers casting to unsigned integers
      data = cudf.Series([-1, 0, 1], dtype="int32")._column
      to_dtype = np.dtype("uint32")
      assert not data.can_cast_safely(to_dtype)
  
imports: import numpy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_150
  from cudf.testing._utils import NUMERIC_TYPES, assert_eq
  from cudf.utils.dtypes import np_dtypes_to_pandas_dtypes
label_desc: Use image node_id 2 for calling a global function with example usage: test_can_cast_safely_mixed_kind() without return types