def METHOD_NAME(meta, did_type, *, session: "Session"):
    """
    Validates metadata for a did.
    :param meta: the dictionary of metadata.
    :param meta: the type of the did, e.g, DATASET, CONTAINER, FILE.
    :param session: The database session in use.
    :returns: True
    """
    # For now only validate the datatype for datasets
    key = 'datatype'
    if did_type == DIDType.DATASET and key in meta:
        try:
            session.query(models.DIDKeyValueAssociation.value).\
                filter_by(key=key).\
                filter_by(value=meta[key]).\
                one()
        except NoResultFound:
            print("The value '%s' for the key '%s' is not valid" % (meta[key], key))
            raise InvalidObject("The value '%s' for the key '%s' is not valid" % (meta[key], key))