<commit_before>description = "a module housing basic utilities for scheduling actions and uploads into GraceDb"
author = "<EMAIL>"

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

import time

import json

from ligo.gracedb.rest import GraceDb
from ligoTest.gracedb.rest import FakeDb
from ligoTest.gracedb.rest import FakeTTPResponse

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

def initGraceDb(url):
    '''
    a method that decides whether we want an actual instance of GraceDb or an instance of FakeDb based on the url
    currently, that's done by requring 'http' to be the begining of the url for real GraceDb instances. 
    Otherwise we try to set up FakeDb, in which case we expect url to be a path.
    '''
    if 'http' == url[:4]:
        return GraceDb(url)
    else:
        return FakeDb(url) ### expects url to be a path

#-------------------------------------------------<commit_msg>added a comment about fragility<commit_after>description = "a module housing basic utilities for scheduling actions and uploads into GraceDb"
author = "<EMAIL>"

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

import time

import json

from ligo.gracedb.rest import GraceDb
from ligoTest.gracedb.rest import FakeDb
from ligoTest.gracedb.rest import FakeTTPResponse

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

def initGraceDb(url):
    '''
    a method that decides whether we want an actual instance of GraceDb or an instance of FakeDb based on the url
    currently, that's done by requring 'http' to be the begining of the url for real GraceDb instances. 
    Otherwise we try to set up FakeDb, in which case we expect url to be a path.
    '''
    if 'http' == url[:4]: ### could be fragile...
        return GraceDb(url)
    else:
        return FakeDb(url) ### expects url to be a path

#-------------------------------------------------
{'fraction_non_alphanumeric': 0.21627408993576017, 'fraction_numerical': 0.0010706638115631692, 'mean_word_length': 1.8931888544891642, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2797047', 'n_tokens_mistral': 480, 'n_tokens_neox': 471, 'n_words': 211}