code: def from_json(cls, raw):
          
          if raw is None:
              return None
  
          bcls = None
          _type = raw.get('type')
          try:
              bcls = cls._blob_type_map[BlobType(_type)]
          except (KeyError, ValueError) as e:
              logger.warning('Unknown blob type: %s', _type)
              if DEBUG:
                  raise_from(exception.ParseException('Parse error for %s' % (_type), raw), e)
              return None
          blob = bcls()
          blob.load(raw)
  
          return blob
docs: Helper to construct a blob from a dict.
  
          Args:
              raw (dict): Raw blob representation.
  
          Returns:
              NodeBlob: A NodeBlob object or None.