@classmethod<EOL><INDENT>def close_idle_connections(self, pool_id=None):<DEDENT>
if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>return<EOL><DEDENT>if pool_id:<EOL><INDENT>if pool_id not in self._pools:<EOL><INDENT>raise ProgrammingError("<STR_LIT>" % pool_id)<EOL><DEDENT>else:<EOL><INDENT>pool = self._pools[pool_id]<EOL>pool.close()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for pool_id, pool in self._pools.items():<EOL><INDENT>pool.close()<EOL><DEDENT><DEDENT>
close idle connections to mongo