<commit_before># GetAppStats
#
import requests
import os
import datetime, time
import mysql.connector as mysql

from biokbase.narrative_method_store.client import NarrativeMethodStore
import biokbase.narrative.clients as clients
import datetime
from installed_clients.execution_engine2Client import execution_engine2

requests.packages.urllib3.disable_warnings()

##########################
#
#   IMPORTANT - IF EVER BLOW AWAY THE TABLE
#   AND NEED TO REPOPULATE IT (WHICH INCLUDES EE2 Backfill data)
#   MAKSE SURE TO RUN THE CUSTOM_SCRIPTS/Backfill_Ee2_reserved_cpu script
#
##########################


# GetEE2AppStats
ee2 = execution_engine2(
    # CHANGE URL to production: https://kbase.us/services/ee2
    # CHANGE URL for CI: https://ci.kbase.us/services/ee2 (Need to change token in .env as well)
    # CHANGE URL for APPDEV: https://appdev.kbase.us/services/ee2
    url="https://kbase.us/services/ee2",
    token=os.environ["METRICS_USER_TOKEN"],
)

nms = NarrativeMethodStore(url=os.environ["NARRATIVE_METHOD_STORE"])
sql_host = os.environ["SQL_HOST"]
query_on = os.environ["QUERY_ON"]

# Insures all finish times within last day.
yesterday = datetime.date.today() - datetime.timedelta(days=1)


def get_user_app_stats(
    start_date=datetime.datetime.combine(yesterday, datetime.datetime.min.time()),
    end_date=datetime.datetime.combine(yesterday, datetime.datetime.max.time()),<commit_msg>quick fix so that EE2 cron job and backfill works, need to be made .env in the future<commit_after># GetAppStats
#
import requests
import os
import datetime, time
import mysql.connector as mysql

from biokbase.narrative_method_store.client import NarrativeMethodStore
import biokbase.narrative.clients as clients
import datetime
from installed_clients.execution_engine2Client import execution_engine2

requests.packages.urllib3.disable_warnings()

##########################
#
#   IMPORTANT - IF EVER BLOW AWAY THE TABLE
#   AND NEED TO REPOPULATE IT (WHICH INCLUDES EE2 Backfill data)
#   MAKSE SURE TO RUN THE CUSTOM_SCRIPTS/Backfill_Ee2_reserved_cpu script
#
##########################


# GetEE2AppStats
ee2 = execution_engine2(
    # CHANGE URL to production: https://kbase.us/services/ee2
    # CHANGE URL for CI: https://ci.kbase.us/services/ee2 (Need to change token in .env as well)
    # CHANGE URL for APPDEV: https://appdev.kbase.us/services/ee2
    # OLD ONE   url="https://kbase.us/services/ee2",
    url="https://kbase.us/services/ee2-nr",
    token=os.environ["METRICS_USER_TOKEN"],
)

nms = NarrativeMethodStore(url=os.environ["NARRATIVE_METHOD_STORE"])
sql_host = os.environ["SQL_HOST"]
query_on = os.environ["QUERY_ON"]

# Insures all finish times within last day.
yesterday = datetime.date.today() - datetime.timedelta(days=1)


def get_user_app_stats(
    start_date=datetime.datetime.combine(yesterday, datetime.datetime.min.time()),
    end_date=datetime.datetime.combine(yesterday, datetime.datetime.max.time()),
{'fraction_non_alphanumeric': 0.13111413043478262, 'fraction_numerical': 0.009510869565217392, 'mean_word_length': 5.252653927813164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, '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}}
{'dir': 'git-commits-cleaned', 'id': '2489191', 'n_tokens_mistral': 1007, 'n_tokens_neox': 984, 'n_words': 223}