class_docstr: Metaclass for Scalar that caches `maxsize` instances.
  
  After `maxsize` is reached, evicts the least recently used
  instances to make room for new values.
class_docstr_tok: ["Metaclass","for","Scalar","that","caches","`","maxsize","`","instances",".","After","`","maxsize","`","is","reached",",","evicts","the","least","recently","used","instances","to","make","room","for","new","values","."]
code: def __call__(self, value, dtype=None):
      # the cache key is constructed from the arguments, and also
      # the _types_ of the arguments, since objects of different
      # types can compare equal
      cache_key = (value, type(value), dtype, type(dtype))
      try:
          # try retrieving an instance from the cache:
          self.__instances.move_to_end(cache_key)
          return self.__instances[cache_key]
      except KeyError:
          # if an instance couldn't be found in the cache,
          # construct it and add to cache:
          obj = super().__call__(value, dtype=dtype)
          try:
              self.__instances[cache_key] = obj
          except TypeError:
              # couldn't hash the arguments, don't cache:
              return obj
          if len(self.__instances) > self.__maxsize:
              self.__instances.popitem(last=False)
          return obj
      except TypeError:
          # couldn't hash the arguments, don't cache:
          return super().__call__(value, dtype=dtype)
  
imports: import decimal
  import operator
  from collections import OrderedDict
  import numpy
  import pyarrow
  import cudf
  from cudf.api.types import is_datetime64_dtype, is_scalar, is_timedelta64_dtype
  from cudf.core.dtypes import ListDtype, StructDtype
  from cudf.core.missing import NA, NaT
  from cudf.core.mixins import BinaryOperand
  from cudf.utils.dtypes import get_allowed_combinations_for_operator, to_cudf_compatible_scalar
label_desc: Use image node_id 3 for calling the CachedScalarInstanceMeta obj's underlying member method code with example usage: obj.__call__(value, dtype) and returns: self, obj, super, obj