<commit_before>import cgi, datetime
from google.appengine.ext import ndb
from google.appengine.ext import db

# File Index
#
# Entry (class)
#       Defines a model for storing custom blocks
# doRun (class)
#       Defines a model for checking whether to add hardcoded blocks
# createTime (function)
#       Takes a number for an hour and a number for a minute and then returns the formated time
# now (function)
#       Checks if the current time is between the inputed start and end times


# Model for entering blocks into the datastore
class Entry(ndb.Model):
    block = ndb.StringProperty(indexed=False)
    sTime = ndb.TimeProperty()
    eTime = ndb.TimeProperty()
    
# Model for checking whether to add the hardcoded blocks to the datastore
class doRun(db.Model):
    runTrue = ndb.BooleanProperty()

# Returns a formated version of time
def createTime(hour, minute):
    hour = int(hour)
    minute = int(minute)
    
    return datetime.time(hour, minute)

# Checks to see whether the current time is within a time range
def now(sTime, eTime):
    current = datetime.datetime.now
    if sTime <= current:
        if eTime => current:
            return True
        return False
    else:
        return False



# Hardcoded Blocks

# This codeblock checks whether a certain datastore entry exists, determining whether to add the hardcoded blocks to the datastore or not
q = doRun.all()
result = q.get()
if not result:
    # Creates a datastore entry to prevent readding hardcoded blocks
    hasRun = doRun(runTrue = True)
    hasRun.put()




# Monday
    # Create the formated times
    sTime = datetime.time(8, 00)
    eTime = datetime.time(8, 45)
    # Store the instance of the class Entry in entries, with entered data
    entries = Entry (block = "Mon_Block 1",
                    sTime = sTime,
                    eTime = eTime)
    # Stores the data that entries contains into the datastore
    entries.put()<commit_msg>fixed greater than inequality (was =>, now is >=)<commit_after>import cgi, datetime
from google.appengine.ext import ndb
from google.appengine.ext import db

# File Index
#
# Entry (class)
#       Defines a model for storing custom blocks
# doRun (class)
#       Defines a model for checking whether to add hardcoded blocks
# createTime (function)
#       Takes a number for an hour and a number for a minute and then returns the formated time
# now (function)
#       Checks if the current time is between the inputed start and end times


# Model for entering blocks into the datastore
class Entry(ndb.Model):
    block = ndb.StringProperty(indexed=False)
    sTime = ndb.TimeProperty()
    eTime = ndb.TimeProperty()
    
# Model for checking whether to add the hardcoded blocks to the datastore
class doRun(db.Model):
    runTrue = ndb.BooleanProperty()

# Returns a formated version of time
def createTime(hour, minute):
    hour = int(hour)
    minute = int(minute)
    
    return datetime.time(hour, minute)

# Checks to see whether the current time is within a time range
def now(sTime, eTime):
    current = datetime.datetime.now
    if sTime <= current:
        if eTime >= current:
            return True
        return False
    else:
        return False



# Hardcoded Blocks

# This codeblock checks whether a certain datastore entry exists, determining whether to add the hardcoded blocks to the datastore or not
q = doRun.all()
result = q.get()
if not result:
    # Creates a datastore entry to prevent readding hardcoded blocks
    hasRun = doRun(runTrue = True)
    hasRun.put()




# Monday
    # Create the formated times
    sTime = datetime.time(8, 00)
    eTime = datetime.time(8, 45)
    # Store the instance of the class Entry in entries, with entered data
    entries = Entry (block = "Mon_Block 1",
                    sTime = sTime,
                    eTime = eTime)
    # Stores the data that entries contains into the datastore
    entries.put()
{'fraction_non_alphanumeric': 0.06858745537990821, 'fraction_numerical': 0.0035696073431922487, 'mean_word_length': 2.9506545820745216, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5235605', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1098, 'n_words': 468}