<s> """<STR_LIT>""" <EOL> import logging <EOL> from google . appengine . ext import ndb <EOL> from oauth2client import client <EOL> NDB_KEY = ndb . Key <EOL> """<STR_LIT>""" <EOL> NDB_MODEL = ndb . Model <EOL> """<STR_LIT>""" <EOL> _LOGGER = logging . getLogger ( __name__ ) <EOL> class SiteXsrfSecretKeyNDB ( ndb . Model ) : <EOL> """<STR_LIT>""" <EOL> secret = ndb . StringProperty ( ) <EOL> @ classmethod <EOL> def _get_kind ( cls ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' <EOL> class FlowNDBProperty ( ndb . PickleProperty ) : <EOL> """<STR_LIT>""" <EOL> def _validate ( self , value ) : <EOL> """<STR_LIT>""" <EOL> _LOGGER . info ( '<STR_LIT>' , type ( value ) ) <EOL> if value is not None and not isinstance ( value , client . Flow ) : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % ( self . _name , <EOL> value ) ) <EOL> class CredentialsNDBProperty ( ndb . BlobProperty ) : <EOL> """<STR_LIT>""" <EOL> def _validate ( self , value ) : <EOL> """<STR_LIT>""" <EOL> _LOGGER . info ( '<STR_LIT>' , type ( value ) ) <EOL> if value is not None and not isinstance ( value , client . Credentials ) : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( self . _name , value ) ) <EOL> def _to_base_type ( self , value ) : <EOL> """<STR_LIT>""" <EOL> if value is None : <EOL> return '<STR_LIT>' <EOL> else : <EOL> return value . to_json ( ) <EOL> def _from_base_type ( self , value ) : <EOL> """<STR_LIT>""" <EOL> if not value : <EOL> return None <EOL> try : <EOL> credentials = client . Credentials . new_from_json ( value ) <EOL> except ValueError : <EOL> credentials = None <EOL> return credentials <EOL> class CredentialsNDBModel ( ndb . Model ) : <EOL> """<STR_LIT>""" <EOL> credentials = CredentialsNDBProperty ( ) <EOL> @ classmethod <EOL> def _get_kind ( cls ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' </s>
