code: def get_metadata_attribute(self, metaname):
          
          metadata_value = self.metadata.get(metaname, None)
          if metadata_value is None:
              raise NoMetadataException(
                  "No metadata attribute named %s" % metaname)
          if not isinstance(metadata_value, list):
              raise TypeError("Metadata is not a list and it should be.")
  
          if len(metadata_value) > 1:
              return metadata_value
          else:
              return metadata_value[0]
docs: Get the metadata attribute by the name.
  
          Args:
              metaname (:obj:`str`): Name of the attribute
  
          Returns:
              :obj:`list` or :obj:`str`: Value(s) of the requested metadata
                  attribute
  
          Raises:
              NoMetadataException: Attribute error
              TypeError: Metadata should be a list