#NEWLINE# def get_port_stats( self , dpid , port_id = None ) : #NEWLINE# #INDENT# 'List all port statistics for a given datapath or for a\n        given datapath and port number\n\n        :param str dpid: Filter by Datapath ID\n        :param str port_id: Filter by Port ID\n        :returns: Statistics for Port\n        :rtype: hpsdnclient.datatypes.Stats\n\n        ' #NEWLINE# url = ( dpid . _of_base_url + 'stats/ports?dpid={0}' . format ( urllib . quote ( dpid ) ) ) #NEWLINE# if port_id : #NEWLINE# #INDENT# url = ( url + '&port_id={0}' . format ( port_id ) ) #NEWLINE# #UNINDENT# return self . restclient . get ( url )