def raise_for_redefined_namespace(self, line: str, position: int, namespace: str) -> None:
        """Raise an exception if a namespace is already defined.

        :raises: RedefinedNamespaceError
        """
        if self.disallow_redefinition and self.has_namespace(namespace):
            raise RedefinedNamespaceError(self.get_line_number(), line, position, namespace)
def raise_for_redefined_namespace ( self , line : str , position : int , namespace : str ) -> None : if self . disallow_redefinition and self . has_namespace ( namespace ) : raise RedefinedNamespaceError ( self . get_line_number ( ) , line , position , namespace )
Raise an exception if a namespace is already defined.

        :raises: RedefinedNamespaceError