code: def _check_class_weight_option(class_weight):
      if class_weight is not None:
          if class_weight.ndim != 1:
              raise ValueError("class_weight.ndim should be 1")
          if class_weight.dtype.kind != "f":
              raise ValueError(
                  "The dtype of class_weight should be 'f'"
              )
          if isinstance(class_weight, variable.Variable):
              raise ValueError(
                  "class_weight should be a numpy.ndarray or "
                  "cupy.ndarray, not a chainer.Variable"
              )
  
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.functions.activation import log_softmax
  from chainer.utils import type_check
  from chainer import variable
  import chainerx
label_desc: Use image node_id 2 for calling a global function with example usage: _check_class_weight_option(class_weight) without return types