Obfuscates *tokens* in-place.  *options* is expected to be the options
    variable passed through from pyminifier.py.

    *module* must be the name of the module we're currently obfuscating

    If *name_generator* is provided it will be used to obtain replacement values
    for identifiers.  If not, a new instance of

    If *table* is given (should be a list containing a single dictionary), it
    will be used to perform lookups of replacements and any new replacements
    will be added to it.

def obfuscate(module, tokens, options, name_generator=None, table=None):
    """
    Obfuscates *tokens* in-place.  *options* is expected to be the options
    variable passed through from pyminifier.py.

    *module* must be the name of the module we're currently obfuscating

    If *name_generator* is provided it will be used to obtain replacement values
    for identifiers.  If not, a new instance of

    If *table* is given (should be a list containing a single dictionary), it
    will be used to perform lookups of replacements and any new replacements
    will be added to it.
    """
    # Need a universal instance of our generator to avoid duplicates
    identifier_length = int(options.replacement_length)
    ignore_length = False
    if not name_generator:
        if options.use_nonlatin:
            ignore_length = True
            if sys.version_info[0] == 3:
                name_generator = obfuscation_machine(
                    use_unicode=True, identifier_length=identifier_length)
            else:
                print(
                    "ERROR: You can't use nonlatin characters without Python 3")
        else:
            name_generator = obfuscation_machine(
                identifier_length=identifier_length)
    if options.obfuscate:
        variables = find_obfuscatables(
            tokens, obfuscatable_variable, ignore_length=ignore_length)
        classes = find_obfuscatables(
            tokens, obfuscatable_class)
        functions = find_obfuscatables(
            tokens, obfuscatable_function)
        for variable in variables:
            replace_obfuscatables(
                module,
                tokens,
                obfuscate_variable,
                variable,
                name_generator,
                table
            )
        for function in functions:
            replace_obfuscatables(
                module,
                tokens,
                obfuscate_function,
                function,
                name_generator,
                table
            )
        for _class in classes:
            replace_obfuscatables(
                module, tokens, obfuscate_class, _class, name_generator, table)
        obfuscate_global_import_methods(module, tokens, name_generator, table)
        obfuscate_builtins(module, tokens, name_generator, table)
    else:
        if options.obf_classes:
            classes = find_obfuscatables(
                tokens, obfuscatable_class)
            for _class in classes:
                replace_obfuscatables(
                    module,
                    tokens,
                    obfuscate_class,
                    _class,
                    name_generator,
                    table
                )
        if options.obf_functions:
            functions = find_obfuscatables(
                tokens, obfuscatable_function)
            for function in functions:
                replace_obfuscatables(
                    module,
                    tokens,
                    obfuscate_function,
                    function,
                    name_generator,
                    table
                )
        if options.obf_variables:
            variables = find_obfuscatables(
                tokens, obfuscatable_variable)
            for variable in variables:
                replace_obfuscatables(
                    module,
                    tokens,
                    obfuscate_variable,
                    variable,
                    name_generator,
                    table
                )
        if options.obf_import_methods:
            obfuscate_global_import_methods(
                module, tokens, name_generator, table)
        if options.obf_builtins:
            obfuscate_builtins(module, tokens, name_generator, table)