<commit_before>#!/usr/bin/env python2
#encoding: UTF-8

# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
"""


"""
class NotesApplication(object):
    
    
    def __init__(self,author):
        self.author = author
        notes = []
        self.notes = notes
        
        
    def create(self, note_content):
        self.note_content = note_content
        self.notes.append(self.note_content)
        
    def list(self):
        
        for i in range(len(self.notes)):
            print "Note ID: %d" % i
            print self.get(i)
            print "By Author: %s" % self.author
            print ""
        
    def get(self,note_id):
        return self.notes[note_id]
    
    """
    
    def search(self, search_text):
        for text in search_text:
            for x in self.notes:
                s=x.split(' ')
                for value in s:
                    for v in value:
                        if text in v:
                            print x,"\n"
    
    """
    
    def search(self, search_text):
        print "Showing results for search '%s': \n" % search_text
        not_found = True
        for x in self.notes:
            if search_text in x:
                print "Note ID: %s" % self.notes.index(x)
                print x,"\n"
                not_found = False
        
        if not_found: 
            print "Found 0 matches"
        
    def edit(self, note_id, new_content):
        self.notes[note_id] = new_content

def main():
    note1 = NotesApplication("Paul")
    
    note1.create("Hello World")
    note1.create("Hello Pluto")
    note1.create("Jupiter Hello")
    
    m=raw_input('Enter the search string: ')
    note1.search(m)
        
    
    
if __name__ == "__main__":
    main()
<commit_msg>Added options for the user to select choice<commit_after>#!/usr/bin/env python2
#encoding: UTF-8

# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
"""


"""
class NotesApplication(object):
    
    
    def __init__(self,author):
        self.author = author
        notes = []
        self.notes = notes
        
        
    def create(self, note_content):
        self.note_content = note_content
        self.notes.append(self.note_content)
        
    def list(self):
        
        for i in range(len(self.notes)):
            print "Note ID: %d" % i
            print self.get(i)
            print "By Author: %s" % self.author
            print ""
        
    def get(self,note_id):
        return self.notes[note_id]
    
    """
    
    def search(self, search_text):
        for text in search_text:
            for x in self.notes:
                s=x.split(' ')
                for value in s:
                    for v in value:
                        if text in v:
                            print x,"\n"
    
    """
    
    def search(self, search_text):
        print "Showing results for search '%s': \n" % search_text
        not_found = True
        for x in self.notes:
            if search_text in x:
                print "Note ID: %s" % self.notes.index(x)
                print x,"\n"
                not_found = False
        
        if not_found: 
            print "Found 0 matches"
        
    def edit(self, note_id, new_content):
        self.notes[note_id] = new_content

def main():
    auth_name = raw_input("Enter note author: ")
    note1 = NotesApplication(auth_name)
    
    choice = raw_input("Choose you preferred option: \n\t1. Add note\n\t2. Edit note\n\t3. Print notes\nSelection:")
    
    if choice == '1':
        new_note = raw_input("Enter note content: ")
        note1.create(new_note)
        print "Note added!\n"
    elif choice == '2':
        m = raw_input('Enter the search string: ')
        note1.search(m)
    elif choice == '3':
        if note1.list() is None:
            print "No notes found"
        
    
if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.10096618357487923, 'fraction_numerical': 0.005072463768115942, 'mean_word_length': 1.5913642052565706, 'pattern_counts': {'":': 2, '<': 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': '2444672', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1211, 'n_words': 353}