def METHOD_NAME(*modnames: str) -> Iterator:
    """Ban some modules from being importable inside the context.
    For example::
        >>> with mask_module('sys'):
        ...     try:
        ...         import sys
        ...     except ImportError:
        ...         print('sys not found')
        sys not found
        >>> import sys  # noqa
        >>> sys.version
        (2, 5, 2, 'final', 0)
    Taken from
    http://bitbucket.org/runeh/snippets/src/tip/missing_modules.py
    """
    realimport = builtins.__import__
    def myimp(name: str, *args: Any, **kwargs: Any) -> ModuleType:
        if name in modnames:
            raise ImportError(f"No module named {name}")
        else:
            return cast(ModuleType, realimport(name, *args, **kwargs))
    builtins.__import__ = myimp
    try:
        yield
    finally:
        builtins.__import__ = realimport