def _validate_directives(self):
        """
        Validate that the directives are valid and have valid values
        """
        if (self.processing_directives['contentType'] and 
            self.processing_directives['contentType'].lower() not in VALID_CONTENT_TYPES):
            raise TypeError("%s is not a valid content type.")
        if (self.processing_directives['outputFormat'] and
            self.processing_directives['outputFormat'].lower() not in VALID_OUTPUT_TYPES):
            raise TypeError("%s is not a valid output type.")
        if (self.processing_directives['enableMetadataType'] and
            self.processing_directives['enableMetadataType'].lower() not in VALID_METADATA_TYPES):
            raise TypeError("%s is not a valid metadata type.")
        
        if (self.processing_directives['calculateRelevanceScore'] and 
            not isinstance(self.processing_directives['calculateRelevanceScore'], bool)):
            if self.processing_directives['calculateRelevanceScore'].lower() not in VALID_BOOLEAN_TYPES:
                raise TypeError("%s is not a valid boolean type.")
        
        if (self.processing_directives['docRDFaccessible'] and 
            not isinstance(self.processing_directives['docRDFaccessible'], bool)):
            if self.processing_directives['docRDFaccessible'].lower() not in VALID_BOOLEAN_TYPES:
                raise TypeError("%s is not a valid boolean type.")
        
        if (self.user_directives['allowDistribution'] and 
            not isinstance(self.user_directives['allowDistribution'], bool)):
            if self.user_directives['allowDistribution'].lower() not in VALID_BOOLEAN_TYPES:
                raise TypeError("%s is not a valid boolean type.")
        
        if (self.user_directives['allowSearch'] and 
            not isinstance(self.user_directives['allowSearch'], bool)):
            if self.user_directives['allowSearch'].lower() not in VALID_BOOLEAN_TYPES:
                raise TypeError("%s is not a valid boolean type.")
dataset/ETHPy150Open callowayproject/django-supertagging/supertagging/calais.py/Calais._validate_directives/original