code: def has_idle_connection(cls, pid):
          
          with cls._lock:
              cls._ensure_pool_exists(pid)
              return bool(cls._pools[pid].idle_connections)
docs: Check to see if a pool has an idle connection
  
          :param str pid: The pool ID
          :rtype: bool