def METHOD_NAME(*names):
    """Uncache a module from sys.modules.
    A basic sanity check is performed to prevent uncaching modules that either
    cannot/shouldn't be uncached.
    """
    for name in names:
        if name in ('sys', 'marshal', 'imp'):
            raise ValueError(
                "cannot uncache {0} as it will break _importlib".format(name))
        try:
            del sys.modules[name]
        except KeyError:
            pass
    try:
        yield
    finally:
        for name in names:
            try:
                del sys.modules[name]
            except KeyError:
                pass