original_docstring: Export the data as an exportable dict
docstring: Export the data as an exportable dict
docstring_tokens: Export the data as an exportable dict
code: def to_dict(self):
          """Export the data as an exportable dict"""
          result = {
              hwaddr: collections.OrderedDict((
                  ('ip', sorted(ips, key=ip_sort_key)),
              ))
              for hwaddr, ips in self.ip_for_hw.items()
          }
          for hwaddr, names in sorted(self.names_for_hw.items()):
              if hwaddr not in result:
                  result[hwaddr] = collections.OrderedDict()
              result[hwaddr]['names'] = sorted(names)
          for hwaddr in self.bridges:
              if hwaddr not in result:
                  result[hwaddr] = collections.OrderedDict()
              result[hwaddr]['is_bridge'] = True
  
          # Record the manufacturer too, when it is known
          for hwaddr, result_data in result.items():
              manufacturer = get_mac_manuf_couple(hwaddr)
              if manufacturer is not None:
                  result_data['manuf'] = manufacturer[0]
                  if manufacturer[1] != manufacturer[0]:
                      # Put the long name if it is different from the short one
                      result_data['manufacturer'] = manufacturer[1]
          return collections.OrderedDict(sorted(result.items()))
code_tokens: def to_dict ( self ) : result = { hwaddr : collections . OrderedDict ( ( ( 'ip' , sorted ( ips , key = ip_sort_key ) ) , ) ) for hwaddr , ips in self . ip_for_hw . items ( ) } for hwaddr , names in sorted ( self . names_for_hw . items ( ) ) : if hwaddr not in result : result [ hwaddr ] = collections . OrderedDict ( ) result [ hwaddr ] [ 'names' ] = sorted ( names ) for hwaddr in self . bridges : if hwaddr not in result : result [ hwaddr ] = collections . OrderedDict ( ) result [ hwaddr ] [ 'is_bridge' ] = True for hwaddr , result_data in result . items ( ) : manufacturer = get_mac_manuf_couple ( hwaddr ) if manufacturer is not None : result_data [ 'manuf' ] = manufacturer [ 0 ] if manufacturer [ 1 ] != manufacturer [ 0 ] : result_data [ 'manufacturer' ] = manufacturer [ 1 ] return collections . OrderedDict ( sorted ( result . items ( ) ) )
short_docstring: Export the data as an exportable dict
short_docstring_tokens: Export the data as an exportable dict
comment: """Export the data as an exportable dict"""$SEP$# Record the manufacturer too, when it is known$SEP$# Put the long name if it is different from the short one