code: def test_device_scalar_direct_construction(value, decimal_type):
      value = cudf.utils.dtypes.to_cudf_compatible_scalar(value)
  
      dtype = (
          value.dtype
          if not isinstance(value, Decimal)
          else decimal_type._from_decimal(value)
      )
  
      s = cudf._lib.scalar.DeviceScalar(value, dtype)
  
      assert s.value == value or np.isnan(s.value) and np.isnan(value)
      if isinstance(
          dtype,
          (
              cudf.Decimal64Dtype,
              cudf.Decimal128Dtype,
              cudf.Decimal32Dtype,
          ),
      ):
          assert s.dtype.precision == dtype.precision
          assert s.dtype.scale == dtype.scale
      elif dtype.char == "U":
          assert s.dtype == "object"
      else:
          assert s.dtype == dtype
  
imports: import datetime
  import re
  from decimal import Decimal
  import numpy
  import pandas
  import pyarrow
  import pytest
  import rmm
  import cudf
  from cudf._lib.copying import get_element
  from cudf.testing._utils import ALL_TYPES, DATETIME_TYPES, NUMERIC_TYPES, TIMEDELTA_TYPES
label_desc: Use image node_id 16 for calling a global function with example usage: test_device_scalar_direct_construction(value, decimal_type) without return types