<s> from libsaas . services import base <EOL> from libsaas import parsers , http , port <EOL> class User ( base . Resource ) : <EOL> def __init__ ( self , parent , object_id = None ) : <EOL> self . parent = parent <EOL> self . object_id = object_id <EOL> def get_url ( self , method ) : <EOL> return '<STR_LIT>' . format ( self . parent . get_url ( ) , method ) <EOL> def _post ( self , method , data ) : <EOL> data [ '<STR_LIT>' ] = self . object_id <EOL> request = http . Request ( '<STR_LIT:POST>' , self . get_url ( method ) , data ) <EOL> return request , parsers . parse_json <EOL> @ base . apimethod <EOL> def identify ( self , traits = None , context = None , timestamp = None ) : <EOL> """<STR_LIT>""" <EOL> params = base . get_params ( None , locals ( ) ) <EOL> return self . _post ( '<STR_LIT>' , params ) <EOL> @ base . apimethod <EOL> def track ( self , event , properties = None , context = None , timestamp = None ) : <EOL> """<STR_LIT>""" <EOL> params = base . get_params ( None , locals ( ) ) <EOL> return self . _post ( '<STR_LIT>' , params ) </s>
