class_docstr: Overloading getitem so that the 'data' copy is only done when the dictionary item is accessed.
class_docstr_tok: ["Overloading","getitem","so","that","the","'data","'","copy","is","only","done","when","the","dictionary","item","is","accessed","."]
code: def __getitem__(self, k):
      val = super(BlobsDict, self).__getitem__(k)
      if isinstance(val, dict):
          return BlobsDict(val)
      # We need to ask isinstance without actually importing blob here
      # so we accept that in order to appreciate beauty in life we must have a dash of ugliness.
      # ans instead of -
      # elif isinstance(val, Blob):
      # we ask:
      elif (
          hasattr(val, "__class__") and val.__class__.__name__ == "Blob"
      ):
          return val.data
      else:
          return val
  
imports: from typing import Optional, Any
label_desc: Use image node_id 2 for calling the BlobsDict obj's underlying member method code with example usage: obj.__getitem__(k) and returns: BlobsDict, val, val