def patch_locals(depth=<NUM_LIT:2>):
for name, locals_dict in traverse_local_prefs(depth):<EOL><INDENT>locals_dict[name] = PatchedLocal(name, locals_dict[name])<EOL><DEDENT>get_frame_locals(depth)[__PATCHED_LOCALS_SENTINEL] = True<EOL>
Temporarily (see unpatch_locals()) replaces all module variables
    considered preferences with PatchedLocal objects, so that every
    variable has different hash returned by id().