<jupyter_start><jupyter_text>All blocks with the @ONLOAD tag are loaded at startup<jupyter_code>#@ONLOAD

import pandas as pd
from elastic_helper import es_helper

logger.info("Creating report")
logger.info(report)

start=replacementHT["param2_start"]
end=replacementHT["param2_end"]
logger.info("Start %s" % start)
logger.info("End   %s" % end)

df=es_helper.elastic_to_dataframe(es,start=start,end=end,index="nyx_api*")
    
writer = pd.ExcelWriter(report["output"]+'.xlsx', engine='xlsxwriter')   
df.to_excel(writer, sheet_name='Logs')
writer.close()<jupyter_output><empty_output><jupyter_text>Test BLOCKS<jupyter_code>from elasticsearch import Elasticsearch as ES, RequestsHttpConnection as RC
import pandas as pd
import collections
from datetime import datetime
from elastic_helper import es_helper
import logging

logger=logging.getLogger()

host_params="http://esnodebal:9200"
es = ES(hosts=[host_params])

es.info()
df=es_helper.elastic_to_dataframe(es,start=datetime(2019,1,1),end=datetime.now(),index="nyx_api*")
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1259469696969697, 'fraction_numerical': 0.011363636363636364, 'mean_word_length': 9.163461538461538, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '59429', 'license': 'Apache-2.0', 'n_tokens_mistral': 384, 'n_tokens_neox': 369, 'n_words': 68, 'path': 'sources/demoreports/demoxlsx.ipynb', 'repo_name': 'scoufman/nyx_containers', 'size': '1056'}