def METHOD_NAME(prefix):
    """Avoid packages being imported
    Args:
        prefix: string at the beginning of the package name
    """
    realimport = builtins.__import__
    def my_import(name, *args, **kwargs):
        if name.startswith(prefix):
            raise ImportError
        return realimport(name, *args, **kwargs)
    try:
        builtins.__import__ = my_import
        yield
    finally:
        builtins.__import__ = realimport