def handle_deprecated_args(tokens, args, kwargs):
    """
    Backwards compatibility with deprecated arguments ``pattern`` and ``r``.
    """
    num_args = len(args)
    pattern = args[0] if num_args else kwargs.get('pattern', None)
    regex = args[1] if num_args > 1 else kwargs.get('r', None)

    if pattern is not None:
        tokens = tools.filter_wildcard(tokens, pattern)
        sys.stderr.write(
            'Please use see().match() now. The "pattern" argument is '
            'deprecated and will be removed in a later release. \n')

    if regex is not None:
        tokens = tools.filter_regex(tokens, re.compile(regex))
        sys.stderr.write(
            'Please use see().match() now. The "r" argument is '
            'deprecated and will be removed in a later release. \n')

    return tokens
def handle_deprecated_args ( tokens , args , kwargs ) : num_args = len ( args ) pattern = args [ 0 ] if num_args else kwargs . get ( 'pattern' , None ) regex = args [ 1 ] if num_args > 1 else kwargs . get ( 'r' , None ) if pattern is not None : tokens = tools . filter_wildcard ( tokens , pattern ) sys . stderr . write ( 'Please use see().match() now. The "pattern" argument is ' 'deprecated and will be removed in a later release. \n' ) if regex is not None : tokens = tools . filter_regex ( tokens , re . compile ( regex ) ) sys . stderr . write ( 'Please use see().match() now. The "r" argument is ' 'deprecated and will be removed in a later release. \n' ) return tokens
Backwards compatibility with deprecated arguments ``pattern`` and ``r``.