code: def dict(self):
          
          metadata = {}
          properties = {}
          for name, prop in list(self.properties.items()):
              properties[name] = prop.dict
          metadata['properties'] = properties
          return metadata
docs: dictionary representation of the metadata.
  
          :return: dictionary representation of the metadata
          :rtype: dict