def get_driver(driver_name):
    """
    Get the DB API object for the specific database type. The list of
    legal database types are available by calling ``get_driver_names()``.

    :Parameters:
        driver_name : str
            name (key) of the driver

    :rtype: DBDriver
    :return: the instantiated driver

    :raise ValueError: Unknown driver name
    """
    try:
        o = drivers[driver_name]
        if type(o) == str:
            exec 'd = %s()' % o
        else:
            d = o()
        return d
    except KeyError:
        raise ValueError, 'Unknown driver name: "%s"' % driver_name
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/grizzled/grizzled/db/__init__.py/get_driver/original