#NEWLINE# def get_ip_addresses( ns , device ) : #NEWLINE# #INDENT# '\n    Get a list of IP addresses assigned to given device\n\n    :param LMI_IPNetworkConnection device: network device\n    :return: IP addresses with subnet masks (IPv4) or prefixes (IPv6) that is assigned to the device.\n    :rtype: list of tuple (IPAddress, SubnetMask/Prefix)\n    ' #NEWLINE# for endpoint in device . associators ( AssocClass = 'LMI_NetworkSAPSAPDependency' , ResultClass = 'LMI_IPProtocolEndpoint' ) : #NEWLINE# #INDENT# if ( endpoint . ProtocolIFType == ns . LMI_IPProtocolEndpoint . ProtocolIFTypeValues . IPv4 ) : #NEWLINE# #INDENT# ( yield ( ns . IPv4Address , endpoint . SubnetMask ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( endpoint . ProtocolIFType == ns . LMI_IPProtocolEndpoint . ProtocolIFTypeValues . IPv6 ) : #NEWLINE# #INDENT# ( yield ( endpoint . IPv6Address , endpoint . IPv6SubnetPrefixLength ) )