def manipulate_bytecode(self, name, mapping, manipulator, *, del_source=False, invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP):
    'Manipulate the bytecode of a module by passing it into a callable\n        that returns what to use as the new bytecode.'
    try:
        del sys.modules['_temp']
    except KeyError:
        pass
    py_compile.compile(mapping[name], invalidation_mode=invalidation_mode)
    if (not del_source):
        bytecode_path = self.util.cache_from_source(mapping[name])
    else:
        os.unlink(mapping[name])
        bytecode_path = make_legacy_pyc(mapping[name])
    if manipulator:
        with open(bytecode_path, 'rb') as file:
            bc = file.read()
            new_bc = manipulator(bc)
        with open(bytecode_path, 'wb') as file:
            if (new_bc is not None):
                file.write(new_bc)
    return bytecode_path
Manipulate the bytecode of a module by passing it into a callable
that returns what to use as the new bytecode.
def manipulate_bytecode(self, name, mapping, manipulator, *, del_source=False, invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP):
    'Manipulate the bytecode of a module by passing it into a callable\n        that returns what to use as the new bytecode.'
    try:
        del sys.modules['_temp']
    except KeyError:
        pass
    py_compile.compile(mapping[name], invalidation_mode=invalidation_mode)
    if (not del_source):
        bytecode_path = self.util.cache_from_source(mapping[name])
    else:
        os.unlink(mapping[name])
        bytecode_path = make_legacy_pyc(mapping[name])
    if manipulator:
        with open(bytecode_path, 'rb') as file:
            bc = file.read()
            new_bc = manipulator(bc)
        with open(bytecode_path, 'wb') as file:
            if (new_bc is not None):
                file.write(new_bc)
    return bytecode_path