Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
application.run(
host='0.0.0.0',
port=80,
threaded=True,
debug=True
)
self.darkResults(
elastic.titleList[i],
cat,
val,
elastic.namesList[i],
elastic.datesList[i]
)
)
descTotal = descTotal + description
elastic.free_mem() # Attempting to free up memory..
del elastic
return Markup(descTotal)
if __name__ == '__main__':
example = BackCheck('John Smith')
print example.output
def runSetup(self, jsonPath):
self.pandas_to_json(jsonPath)
self.save_json(self.searchIndex)
def check_cat(self, description):
return 'tor'
def free_mem(self):
del self.briefList
del self.namesList
del self.datesList
del self.titleList
if __name__ == '__main__':
test = DarkElastic()
test.runSetup("../logs/process2.json")
# Build your index.
test.ingest_items()
es.indices.refresh(index='dark')
print test.search_index('dark', 'cocaine', 15, 10)
"URLS",
"NAMES",
"SIZE",
]
)
# Columns = [DATE,URL,NAME,SIZE,LANG,CONTENT')]
# with open("logs/process.csv", "a") as log:
# log.write('DATE,URL,NAME,SIZE,LANG,CONTENT\n')
for i in range(0, len(logs)):
date = str(logs['DATE'][i].strip())
url = str(logs['URL'][i].strip())
name = str(logs['NAME'][i].strip())
size = str(logs['SIZE'][i])
try:
output = Tikify(dataPath + name)
content = unicode(output.content)
title = str(output.title)
lang = str(output.lang)
with open("../logs/process2.csv", "a") as log:
log.write(('%s\t%s\t%s\t%s\t%s\t%s\t%s\n') % (date, url, name, size, lang, title, content))
print ('Appended line %d...') % i
except Exception:
continue