code: def clear_cache(ip=None):
      
      if ip:
          with ignored(Exception):
              client = CLIENT_CACHE[ip]
              del CLIENT_CACHE[ip]
              client.close()
      else:
          for client in CLIENT_CACHE.values():
              with ignored(Exception):
                  client.close()
          CLIENT_CACHE.clear()
docs: Clear the client cache or remove key matching the given ip.