<commit_before>from google.appengine.api import users
from google.appengine.ext import ndb

import jinja2
import webapp2
import os

JINJA_ENVIRONMENT = jinja2.Environment(
    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
    extensions=['jinja2.ext.autoescape'],
    autoescape=True)


class HashStore(ndb.Model):
    """Models an individual HashStore entry with hastag, content, and date."""
    hastag = ndb.StringProperty(indexed=True)
    content = ndb.StringProperty(indexed=False)
    date = ndb.DateTimeProperty(auto_now_add=True)


class Note(ndb.Model):
    """Models an individual Note entry."""
    # author = ndb.UserProperty()
    title = ndb.StringProperty(indexed=False)
    content = ndb.StringProperty(indexed=False)
    hashtag = ndb.StringProperty(repeated=True)
    last_viewed = ndb.DateTimeProperty(auto_now_add=True)


class login(webapp2.RequestHandler):

    def get(self):
        user = users.get_current_user()

        if user:
            self.redirect("/")
        else:
            self.redirect(users.create_login_url(self.request.uri))
        
class Add(webapp2.RequestHandler):

    def post(self):
        NoteTitle = self.request.get("title")
        NoteHashtags = self.request.get("hashtags")
        
        HashEntry=HashStore(hastag=NoteHashtags,content="data")
        HashEntry.put()
        
        NoteEntry = Note(parent=ndb.Key(users,users.get_current_user()),hashtag=NoteHashtags,title=NoteTitle)
        NoteEntry.content="data"
        NoteEntry.put()


class Remove(webapp2.RequestHandler):

    def post(self):
        noteId = self.request.get("noteId")
        self.response.write(str(noteId))
        
class View(webapp2.RequestHandler):

    def get(self):
        # noteId = self.request.get("noteId")
        
        key = ndb.Key(users.get_current_user())
        qry = Note.query(ancestor=key)
        
        self.response.write(str(qry))

class renderPage(webapp2.RequestHandler):
    
    def get(self):
        
        msg="Hello !"
        user=users.get_current_user()
        
        if user:<commit_msg>Data structure problem<commit_after>from google.appengine.api import users
from google.appengine.ext import ndb

import jinja2
import webapp2
import os

JINJA_ENVIRONMENT = jinja2.Environment(
    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
    extensions=['jinja2.ext.autoescape'],
    autoescape=True)


class HashStore(ndb.Model):
    """Models an individual HashStore entry with hastag, content, and date."""
    hastag = ndb.StringProperty(indexed=True)
    content = ndb.StringProperty(indexed=False)
    date = ndb.DateTimeProperty(auto_now_add=True)


class Note(ndb.Model):
    """Models an individual Note entry."""
    author = ndb.UserProperty()
    title = ndb.StringProperty(indexed=False)
    content = ndb.StringProperty(indexed=False)
    hashtag = ndb.StringProperty(repeated=True)
    last_viewed = ndb.DateTimeProperty(auto_now_add=True)


class login(webapp2.RequestHandler):

    def get(self):
        user = users.get_current_user()

        if user:
            self.redirect("/")
        else:
            self.redirect(users.create_login_url(self.request.uri))
        
class Add(webapp2.RequestHandler):

    def post(self):
        NoteTitle = self.request.get("title")
        NoteHashtags = self.request.get("hashtags")
        
        HashEntry=HashStore(hastag=NoteHashtags,content="data")
        HashEntry.put()
        
        NoteEntry = Note(author=users.get_current_user(),hashtag=NoteHashtags,title=NoteTitle)
        NoteEntry.content="data"
        NoteEntry.put()


class Remove(webapp2.RequestHandler):

    def post(self):
        noteId = self.request.get("noteId")
        self.response.write(str(noteId))
        
class View(webapp2.RequestHandler):

    def get(self):
        # noteId = self.request.get("noteId")
        
        qry = Note.query(author=users.get_current_user())
        
        self.response.write(str(qry))

class renderPage(webapp2.RequestHandler):
    
    def get(self):
        
        msg="Hello !"
        user=users.get_current_user()
        
        if user:
{'fraction_non_alphanumeric': 0.11496746203904555, 'fraction_numerical': 0.004820438659918052, 'mean_word_length': 3.0330417881438287, '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': '859487', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1309, 'n_words': 209}