def connection(self, name=None):
if not name:<EOL><INDENT>name = self._get_default_connection_name()<EOL><DEDENT>if name in self.pool:<EOL><INDENT>return self.pool[name]<EOL><DEDENT>self.pool[name] = psycopg2.connect(self.dsn)<EOL>return self.pool[name]<EOL>
return a named connection.

        This function will return a named connection by either finding one
        in its pool by the name or creating a new one.  If no name is given,
        it will use the name of the current executing thread as the name of
        the connection.

        parameters:
            name - a name as a string