class_docstr: Interface for simple dictionary-based dataset format. The dictionary
  keys correspond to the column (i.e. dimension) names and the values
  are collections representing the values in that column.
class_docstr_tok: ["Interface","for","simple","dictionary-based","dataset","format",".","The","dictionary","keys","correspond","to","the","column","(","i.e",".","dimension",")","names","and","the","values","are","collections","representing","the","values","in","that","column","."]
docstr: Given a dataset object and data in the appropriate format for
  the interface, return a simple scalar.
docstr_tok: ["Given","a","dataset","object","and","data","in","the","appropriate","format","for","the","interface",",","return","a","simple","scalar","."]
code: def unpack_scalar(cls, dataset, data):
      """
      Given a dataset object and data in the appropriate format for
      the interface, return a simple scalar.
      """
      if len(data) != 1:
          return data
      key = next(iter(data.keys()))
  
      if len(data[key]) == 1 and key in dataset.vdims:
          scalar = data[key][0]
          return (
              scalar.compute() if hasattr(scalar, "compute") else scalar
          )
      return data
  
imports: from collections import OrderedDict, defaultdict
  import numpy
  from ..None import util
  from ..dimension import dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from ..util import isscalar
  from .interface import DataError, Interface
label_desc: Use image node_id 4 for calling the DictInterface obj's underlying member method code with example usage: obj.unpack_scalar(cls, dataset, data) and returns: data, data, unknown