def _ensure_connection(self):
conn = self.connect()<EOL>if conn.recycle and conn.recycle < time.time():<EOL><INDENT>logger.debug('<STR_LIT>', self._recycle)<EOL>self.close()<EOL>conn = self.connect()<EOL><DEDENT>return conn<EOL>
Make certain we have a valid connection and return it.