#NEWLINE# def get_portal_by_id( self , ID ) : #NEWLINE# #INDENT# '     Returns a portal object by ID input. \n        \n            http://docs.exosite.com/portals/#get-portal\n        ' #NEWLINE# headers = { #NEWLINE# #INDENT# 'User-Agent' : self . user_agent ( ) , #NEWLINE# 'Host' : self . domain ( ) , #NEWLINE# 'Accept' : '*/*' , #NEWLINE# #UNINDENT# } #NEWLINE# headers . update ( self . headers ( ) ) #NEWLINE# r = requests . get ( ( ( self . portals_url ( ) + '/portals/' ) + str ( ID ) ) , headers = headers , auth = self . auth ( ) ) #NEWLINE# if ( HTTP_STATUS . OK == r . status_code ) : #NEWLINE# #INDENT# return r . json ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'get_portal_by_id: Something went wrong: <{0}>: {1}' . format ( r . status_code , r . reason ) ) #NEWLINE# r . raise_for_status ( )