<commit_before>import logging

from google.appengine.ext import webapp
from google.appengine.api import urlfetch

from models.sitevar import Sitevar

import tba_config
import json


class FirebasePushDo(webapp.RequestHandler):
    """
    Pushes data to Firebase
    """
    SUCCESS_STATUS_CODES = {200, 204}

    def post(self):
        payload = json.loads(self.request.body)
        key = payload['key']
        payload_json = payload['data']

        firebase_secrets = Sitevar.get_by_id("firebase.secrets")
        if firebase_secrets == None:
            raise Exception("Missing sitevar: firebase.secrets. Can't write to Firebase.")
        FIREBASE_SECRET = firebase_secrets.contents['FIREBASE_SECRET']<commit_msg>convert firebase data to json<commit_after>import logging

from google.appengine.ext import webapp
from google.appengine.api import urlfetch

from models.sitevar import Sitevar

import tba_config
import json


class FirebasePushDo(webapp.RequestHandler):
    """
    Pushes data to Firebase
    """
    SUCCESS_STATUS_CODES = {200, 204}

    def post(self):
        payload = json.loads(self.request.body)
        key = payload['key']
        payload_json = json.dumps(payload['data'])

        firebase_secrets = Sitevar.get_by_id("firebase.secrets")
        if firebase_secrets is None:
            raise Exception("Missing sitevar: firebase.secrets. Can't write to Firebase.")
        FIREBASE_SECRET = firebase_secrets.contents['FIREBASE_SECRET']
{'fraction_non_alphanumeric': 0.09035326086956522, 'fraction_numerical': 0.008152173913043478, 'mean_word_length': 3.51840490797546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '2471712', 'n_tokens_mistral': 473, 'n_tokens_neox': 446, 'n_words': 104}