def get_database(dialect):
    """
    Returns requested database package with modules that provide additional functionality.

    :param string dialect: (required). Database dialect name.
    """
    aliases = {
        ('mysql',): 'mysql',
        ('sqlite',): 'sqlite',
        ('pgsql', 'postgres', 'postgresql'): 'postgresql',
    }

    dialect = next((aliases[alias] for alias in aliases if dialect in alias), dialect)
    names = [str(mod[1]) for mod in pkgutil.iter_modules([os.path.join(os.path.dirname(__file__), dialect)])]

    try:
        return __import__('{0}'.format(dialect), globals(), level=1, fromlist=names)
    except __HOLE__:
        raise DatabaseError(
            current=dialect,
            allowed=[name for _, name, is_pkg in pkgutil.iter_modules([os.path.dirname(__file__)]) if is_pkg])
dataset/ETHPy150Open maxtepkeev/architect/architect/databases/utilities.py/get_database