<commit_before>from google.appengine.ext import ndb
from endpoints_proto_datastore.ndb import EndpointsModel
from endpoints_proto_datastore import MessageFieldsSchema
from google.appengine.api import search
import model


class Opportunitystage (EndpointsModel):
    _message_fields_schema = ('id','entityKey','created_at','updated_at','name','probability','owner','organization',)
    owner = ndb.StringProperty()
    organization = ndb.KeyProperty()
    created_at = ndb.DateTimeProperty(auto_now_add=True)
    updated_at = ndb.DateTimeProperty(auto_now=True)
    name = ndb.StringProperty()
    probability = ndb.StringProperty()
    created_by = ndb.KeyProperty()
    last_modified_by = ndb.KeyProperty()
    #created_by = ndb.KeyProperty()
    #last_modified_by = ndb.KeyProperty()
def put(self, **kwargs):
    	ndb.Model.put(self, **kwargs)
    	self.put_index()

def put_index(self):
        """ index the element at each"""
        empty_string = lambda x: x if x else ""
        organization = str(self.organization.id())
        my_document = search.Document(
        doc_id = str(self.key.id()),
        fields=[
            search.TextField(name=u'type', value=u'Opportunitystage'),
            search.TextField(name='organization', value = empty_string(organization) ),
            search.TextField(name='owner', value = empty_string(self.owner) ),
            search.TextField(name='title', value = empty_string(self.name) ),
            search.TextField(name='probability', value = empty_string(self.probability)),
            search.DateField(name='created_at', value = self.created_at),
             ])<commit_msg>probability<commit_after>from google.appengine.ext import ndb
from endpoints_proto_datastore.ndb import EndpointsModel
from endpoints_proto_datastore import MessageFieldsSchema
from google.appengine.api import search
import model


class Opportunitystage (EndpointsModel):
    _message_fields_schema = ('id','entityKey','created_at','updated_at','name','probability','owner','organization',)
    owner = ndb.StringProperty()
    organization = ndb.KeyProperty()
    created_at = ndb.DateTimeProperty(auto_now_add=True)
    updated_at = ndb.DateTimeProperty(auto_now=True)
    name = ndb.StringProperty()
    probability = ndb.IntegerProperty()
    created_by = ndb.KeyProperty()
    last_modified_by = ndb.KeyProperty()
    #created_by = ndb.KeyProperty()
    #last_modified_by = ndb.KeyProperty()
def put(self, **kwargs):
    	ndb.Model.put(self, **kwargs)
    	self.put_index()

def put_index(self):
        """ index the element at each"""
        empty_string = lambda x: x if x else ""
        organization = str(self.organization.id())
        my_document = search.Document(
        doc_id = str(self.key.id()),
        fields=[
            search.TextField(name=u'type', value=u'Opportunitystage'),
            search.TextField(name='organization', value = empty_string(organization) ),
            search.TextField(name='owner', value = empty_string(self.owner) ),
            search.TextField(name='title', value = empty_string(self.name) ),
            search.TextField(name='probability', value = empty_string(self.probability)),
            search.DateField(name='created_at', value = self.created_at),
             ])
{'fraction_non_alphanumeric': 0.12327506899724011, 'fraction_numerical': 0.0, 'mean_word_length': 3.8614008941877795, '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': '1198428', 'n_tokens_mistral': 956, 'n_tokens_neox': 937, 'n_words': 174}