def ClearAllButEncodingsModules(module_dict):
 for module_name in module_dict.keys():
  if ((not IsEncodingsModule(module_name)) and (module_name != 'sys')):
   del module_dict[module_name]

def ClearAllButEncodingsModules ( module_dict ) : for module_name in module_dict . keys ( ) : if ( ( not IsEncodingsModule ( module_name ) ) and ( module_name != 'sys' ) ) : del module_dict [ module_name ]
clear all modules in a module dictionary except for those modules that are in any way related to encodings .