MCPcopy Index your code
hub / github.com/jhao104/proxy_pool / getCount

Function getCount

api/proxyApi.py:94–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93@app.route('/count/')
94def getCount():
95 proxies = proxy_handler.getAll()
96 http_type_dict = {}
97 source_dict = {}
98 for proxy in proxies:
99 http_type = 'https' if proxy.https else 'http'
100 http_type_dict[http_type] = http_type_dict.get(http_type, 0) + 1
101 for source in proxy.source.split('/'):
102 source_dict[source] = source_dict.get(source, 0) + 1
103 return {"http_type": http_type_dict, "source": source_dict, "count": len(proxies)}
104
105
106def runFlask():

Callers

nothing calls this directly

Calls 2

getAllMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected