def check_include_exclude(attributes):
        """Check __include__ and __exclude__ attributes.

        :type attributes: dict
        """
        include = attributes.get('__include__', tuple())
        exclude = attributes.get('__exclude__', tuple())

        if not isinstance(include, tuple):
            raise TypeError("Attribute __include__ must be a tuple.")

        if not isinstance(exclude, tuple):
            raise TypeError("Attribute __exclude__ must be a tuple.")

        if all((not include, not exclude)):
            return None

        if all((include, exclude)):
            raise AttributeError("Usage of __include__ and __exclude__ "
                                 "at the same time is prohibited.")
def check_include_exclude ( attributes ) : include = attributes . get ( '__include__' , tuple ( ) ) exclude = attributes . get ( '__exclude__' , tuple ( ) ) if not isinstance ( include , tuple ) : raise TypeError ( "Attribute __include__ must be a tuple." ) if not isinstance ( exclude , tuple ) : raise TypeError ( "Attribute __exclude__ must be a tuple." ) if all ( ( not include , not exclude ) ) : return None if all ( ( include , exclude ) ) : raise AttributeError ( "Usage of __include__ and __exclude__ " "at the same time is prohibited." )
Check __include__ and __exclude__ attributes.

        :type attributes: dict