code: def connection(self, name=None):
          
          if not name:
              name = self._get_default_connection_name()
          if name in self.pool:
              return self.pool[name]
          self.pool[name] = psycopg2.connect(self.dsn)
          return self.pool[name]
docs: 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