<s> from __future__ import unicode_literals <EOL> from . helpers import use_appropriate_encoding <EOL> from . device import Device <EOL> class Chat ( Device ) : <EOL> def __init__ ( self , account , chat_info ) : <EOL> self . _account = account <EOL> self . iden = chat_info . get ( "<STR_LIT>" ) <EOL> contact_info = chat_info [ '<STR_LIT>' ] <EOL> for attr in ( "<STR_LIT>" , "<STR_LIT>" ) : <EOL> setattr ( self , attr , chat_info . get ( attr ) ) <EOL> for attr in ( "<STR_LIT:name>" , "<STR_LIT:email>" , "<STR_LIT>" , "<STR_LIT>" ) : <EOL> setattr ( self , attr , contact_info . get ( attr ) ) <EOL> def _push ( self , data ) : <EOL> data [ "<STR_LIT:email>" ] = self . email <EOL> return self . _account . _push ( data ) <EOL> @ use_appropriate_encoding <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" . format ( self . name , self . email_normalized ) </s>
