def add_driver(key, driver_class, force=False):
    """
    Add a driver class to the list of drivers.

    :Parameters:
        key : str
            the key, also used as the driver's name
        driver_class : class
            the ``DBDriver`` subclass object
        force : bool
            ``True`` to force registration of the driver, even if there's an
            existing driver with the same key; ``False`` to throw an exception
            if there's an existing driver with the same key.

    :raise ValueError: There's an existing driver with the same key, and
                       ``force`` is ``False``
    """
    try:
        drivers[key]
        if not force:
            raise ValueError, 'A DB driver named "%s" is already installed' %\
                  key
    except __HOLE__:
        pass

    drivers[key] = driver_class
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/grizzled/grizzled/db/__init__.py/add_driver