<commit_before>from google.appengine.ext import db
from google.appengine.api import users
from time import mktime

class User(db.Model):
    google_user = db.UserProperty()
    nickname = db.StringProperty()
    nickname_lower = db.StringProperty()
    deleted = db.BooleanProperty(default=False)
    
    def fetch_feeds(self):
    	return {}
    
    def to_struct(self):
    	if self.deleted:
	    	return None
    	else:
    		return {
    			'nickname': self.nickname
    		}

class InviteToken(db.Model):
    email = db.StringProperty()
    token = db.StringProperty()

class InputFeed(db.Model):
    # parent(User)
    title = db.StringProperty()
    url = db.StringProperty()
    time_fetched = db.DateTimeProperty()
    deleted = db.BooleanProperty()

    def fetch_entries(self):
    	return []

    def to_struct(self):
		return {
			'title': self.title,
			'url': self.url,
			'time_fetched': mktime(self.time_fetched.timetuple()),
		}

class Entry(db.Model):
    #parent(InputFeed)
    id = db.StringProperty()
    title = db.StringProperty()
    content = db.TextProperty()
    link = db.TextProperty()
    time_published = db.DateTimeProperty()
    published = db.BooleanProperty()
    tags = db.ListProperty(db.Key)
    user = db.ReferenceProperty(reference_class=User)

    def to_struct(self, include_tags=False):
    	tags = []
    	if include_tags:
    		for tag in db.get(self.tags):
				tags.append(tag.to_struct())
    	
    	return {
    		'id': self.id,
    		'title': self.title,
    		'content': self.summary,
    		'link': self.link,
    		'time_published': mktime(self.time_published.timetuple()),
    		'published': self.published,
    		'tags': tags,
    	}

class Tag(db.Model):
    #parent(User)
    title = db.StringProperty()
    title_lower = db.StringProperty()
    entry_count = db.IntegerProperty(default=0)
    entries = db.ListProperty(db.Key)

    def tag_entry(self, entry) {
    	self.entry_count += 1
    	entry.tags.append(self.Key())
    	entry.save()
    	self.save()
    }

    to_struct(include_entries=False):
    	entries = []<commit_msg>Fixed syntax<commit_after>from google.appengine.ext import db
from google.appengine.api import users
from time import mktime

class User(db.Model):
    google_user = db.UserProperty()
    nickname = db.StringProperty()
    nickname_lower = db.StringProperty()
    deleted = db.BooleanProperty(default=False)
    
    def fetch_feeds(self):
    	return {}
    
    def to_struct(self):
    	if self.deleted:
	    	return None
    	else:
    		return {
    			'nickname': self.nickname
    		}

class InviteToken(db.Model):
    email = db.StringProperty()
    token = db.StringProperty()

class InputFeed(db.Model):
    # parent(User)
    title = db.StringProperty()
    url = db.StringProperty()
    time_fetched = db.DateTimeProperty()
    deleted = db.BooleanProperty()

    def fetch_entries(self):
    	return []

    def to_struct(self):
		return {
			'title': self.title,
			'url': self.url,
			'time_fetched': mktime(self.time_fetched.timetuple()),
		}

class Entry(db.Model):
    #parent(InputFeed)
    id = db.StringProperty()
    title = db.StringProperty()
    content = db.TextProperty()
    link = db.TextProperty()
    time_published = db.DateTimeProperty()
    published = db.BooleanProperty()
    tags = db.ListProperty(db.Key)
    user = db.ReferenceProperty(reference_class=User)

    def to_struct(self, include_tags=False):
    	tags = []
    	if include_tags:
    		for tag in db.get(self.tags):
				tags.append(tag.to_struct())
    	
    	return {
    		'id': self.id,
    		'title': self.title,
    		'content': self.summary,
    		'link': self.link,
    		'time_published': mktime(self.time_published.timetuple()),
    		'published': self.published,
    		'tags': tags,
    	}

class Tag(db.Model):
    #parent(User)
    title = db.StringProperty()
    title_lower = db.StringProperty()
    entry_count = db.IntegerProperty(default=0)
    entries = db.ListProperty(db.Key)

    def tag_entry(self, entry):
    	self.entry_count += 1
    	entry.tags.append(self.Key())
    	entry.save()
    	self.save()

    def to_struct(include_entries=False):
    	entries = []
{'fraction_non_alphanumeric': 0.12667624521072796, 'fraction_numerical': 0.0009578544061302681, 'mean_word_length': 2.9073900841908324, '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': '2506694', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1406, 'n_words': 262}