def import_fresh_module(name, fresh=(), blocked=(), deprecated=False):
 with _ignore_deprecated_imports(deprecated):
  orig_modules = {}
  names_to_remove = []
  _save_and_remove_module(name, orig_modules)
  try:
   for fresh_name in fresh:
    _save_and_remove_module(fresh_name, orig_modules)
   for blocked_name in blocked:
    if (not _save_and_block_module(blocked_name, orig_modules)):
     names_to_remove.append(blocked_name)
   fresh_module = importlib.import_module(name)
  except ImportError:
   fresh_module = None
  finally:
   for (orig_name, module) in orig_modules.items():
    sys.modules[orig_name] = module
   for name_to_remove in names_to_remove:
    del sys.modules[name_to_remove]
  return fresh_module

def import_fresh_module ( name , fresh = ( ) , blocked = ( ) , deprecated = False ) : with _ignore_deprecated_imports ( deprecated ) : orig_modules = { } names_to_remove = [ ] _save_and_remove_module ( name , orig_modules ) try : for fresh_name in fresh : _save_and_remove_module ( fresh_name , orig_modules ) for blocked_name in blocked : if ( not _save_and_block_module ( blocked_name , orig_modules ) ) : names_to_remove . append ( blocked_name ) fresh_module = importlib . import_module ( name ) except ImportError : fresh_module = None finally : for ( orig_name , module ) in orig_modules . items ( ) : sys . modules [ orig_name ] = module for name_to_remove in names_to_remove : del sys . modules [ name_to_remove ] return fresh_module
imports and returns a module .