src/pybel/manager/cache_manager.py
def ensure_regex_namespace(self, keyword: str, pattern: str) -> Namespace:
        """Get or create a regular expression namespace.

        :param keyword: The keyword of a regular expression namespace
        :param pattern: The pattern for a regular expression namespace
        """
        if pattern is None:
            raise ValueError('cannot have null pattern')

        namespace = self.get_namespace_by_keyword_pattern(keyword, pattern)

        if namespace is None:
            logger.info('creating regex namespace: %s:%s', keyword, pattern)
            namespace = Namespace(
                keyword=keyword,
                pattern=pattern,
            )
            self.session.add(namespace)
            self.session.commit()

        return namespace
Get or create a regular expression namespace.

        :param keyword: The keyword of a regular expression namespace
        :param pattern: The pattern for a regular expression namespace
        
Get or create a regular expression namespace.
Get or create a regular expression namespace .
def ensure_regex_namespace(self, keyword: str, pattern: str) -> Namespace:
        if pattern is None:
            raise ValueError('cannot have null pattern')
        namespace = self.get_namespace_by_keyword_pattern(keyword, pattern)
        if namespace is None:
            logger.info('creating regex namespace: %s:%s', keyword, pattern)
            namespace = Namespace(
                keyword=keyword,
                pattern=pattern,
            )
            self.session.add(namespace)
            self.session.commit()
        return namespace
def ensure_regex_namespace ( self , keyword : str , pattern : str ) -> Namespace : if pattern is None : raise ValueError ( 'cannot have null pattern' ) namespace = self . get_namespace_by_keyword_pattern ( keyword , pattern ) if namespace is None : logger . info ( 'creating regex namespace: %s:%s' , keyword , pattern ) namespace = Namespace ( keyword = keyword , pattern = pattern , ) self . session . add ( namespace ) self . session . commit ( ) return namespace
Get or create a regular expression namespace.
Get or create a regular expression namespace .
"""Get or create a regular expression namespace.

        :param keyword: The keyword of a regular expression namespace
        :param pattern: The pattern for a regular expression namespace
        """
self
keyword
str
The keyword of a regular expression namespace
The keyword of a regular expression namespace
pattern
str
The pattern for a regular expression namespace
The pattern for a regular expression namespace