<commit_before>#
# backend model for retrieving data, from files, BigQuery, and from ndb
#

import csv
import codecs
import models
import logging

import gsdata
import bqutil
from collections import defaultdict, OrderedDict
from google.appengine.api import memcache

mem = memcache.Client()

NDB_DATASETS = {'staff': models.StaffUser}

class DataSource(object):
    '''
    Methods for retrieving data from files, BigQuery, and from ndb
    '''

    #-----------------------------------------------------------------------------

    def get_data(self, source, key=None):
        '''
        Get data from source, and return.
        source should either be string of the form "dataset.table" specifying a BigQuery source,
        or "docs:file_name:sheet_name" specifying a Google Spreadsheet source.<commit_msg>missing datetime import<commit_after>#
# backend model for retrieving data, from files, BigQuery, and from ndb
#

import csv
import codecs
import models
import logging

import gsdata
import bqutil
import datetime
from collections import defaultdict, OrderedDict
from google.appengine.api import memcache

mem = memcache.Client()

NDB_DATASETS = {'staff': models.StaffUser}

class DataSource(object):
    '''
    Methods for retrieving data from files, BigQuery, and from ndb
    '''

    #-----------------------------------------------------------------------------

    def get_data(self, source, key=None):
        '''
        Get data from source, and return.
        source should either be string of the form "dataset.table" specifying a BigQuery source,
        or "docs:file_name:sheet_name" specifying a Google Spreadsheet source.
{'fraction_non_alphanumeric': 0.15980629539951574, 'fraction_numerical': 0.0, 'mean_word_length': 2.554838709677419, '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': '3338407', 'n_tokens_mistral': 435, 'n_tokens_neox': 414, 'n_words': 163}