<s> """<STR_LIT>""" <EOL> from apiclient import APIClient <EOL> class FacebookError ( Exception ) : <EOL> def __init__ ( self , type , message , response = None ) : <EOL> self . type = type <EOL> self . message = message <EOL> self . response = response <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . type , self . message ) <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % ( self . __class__ . __name__ , self . type ) <EOL> class FacebookAPI ( APIClient ) : <EOL> BASE_URL = '<STR_LIT>' <EOL> def _handle_response ( self , response ) : <EOL> r = super ( FacebookAPI , self ) . _handle_response ( response ) <EOL> has_error = r . get ( '<STR_LIT:error>' ) <EOL> if not has_error : <EOL> return r <EOL> raise FacebookError ( has_error [ '<STR_LIT:type>' ] , has_error [ '<STR_LIT:message>' ] , response = response ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> api = FacebookAPI ( ) <EOL> r = api . call ( '<STR_LIT:/>' , ids = '<STR_LIT>' ) <EOL> print r </s>
