def __init__(self, dburl=None, host=None, dbname=None, user=None,<EOL>password=None, autocommit=True):
if dburl:<EOL><INDENT>(scheme, user, password, host, dbname) = parse_dburl(dburl)<EOL>if scheme != '<STR_LIT>':<EOL><INDENT>raise ValueError('<STR_LIT>'.format(scheme))<EOL><DEDENT><DEDENT>self._conn = psycopg2.connect(user=user, dbname=dbname, host=host,<EOL>password=password)<EOL>self._cursor = self._conn.cursor(<EOL>cursor_factory=psycopg2.extras.RealDictCursor)<EOL>self.autocommit = autocommit<EOL>
Instantiate a new DB object.
        Needs parameters dbname, user, host, and password.
        Or, specify a DB url of the form pg://user:password@host/dbname
        If host is None or not specified, PG driver will connect using
        the default unix socket.

        You can change db.autocommit after the object has been
        instantiated.

        >>> import getpass
        >>> s = DB(dbname='test', user=getpass.getuser())
        >>> s = DB(dburl='pg://' + getpass.getuser() + ':@/test')
        >>> s = DB(dburl='mysql://:@/test')
        Traceback (most recent call last):
            ...
        ValueError: Unsupported DB scheme "mysql"