nodes: 0, module; 1, function_definition; 2, function_name:_log_board_ports; 3, parameters; 4, block; 5, identifier:self; 6, identifier:ports; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, comment:"""
          A board with no ports is allowed.
  
          In the logfile, ports must be sorted
          - ascending by tile identifier (primary)
          - alphabetical by edge direction (secondary)
  
          :param ports: list of catan.board.Port objects
          """; 11, assignment; 12, call; 13, identifier:ports; 14, call; 15, attribute; 16, argument_list; 17, identifier:sorted; 18, argument_list; 19, identifier:self; 20, identifier:_logln; 21, call; 22, identifier:ports; 23, keyword_argument; 24, attribute; 25, argument_list; 26, identifier:key; 27, lambda; 28, string; 29, identifier:format; 30, call; 31, lambda_parameters; 32, tuple; 33, string_content:ports: {0}; 34, attribute; 35, generator_expression; 36, identifier:port; 37, attribute; 38, attribute; 39, string; 40, identifier:join; 41, call; 42, for_in_clause; 43, identifier:port; 44, identifier:tile_id; 45, identifier:port; 46, identifier:direction; 47, string_content:; 48, attribute; 49, argument_list; 50, identifier:p; 51, identifier:ports; 52, string; 53, identifier:format; 54, attribute; 55, attribute; 56, attribute; 57, string_content:{}({} {}); 58, attribute; 59, identifier:value; 60, identifier:p; 61, identifier:tile_id; 62, identifier:p; 63, identifier:direction; 64, identifier:p; 65, identifier:type
code: def _log_board_ports(self, ports):
          """
          A board with no ports is allowed.
  
          In the logfile, ports must be sorted
          - ascending by tile identifier (primary)
          - alphabetical by edge direction (secondary)
  
          :param ports: list of catan.board.Port objects
          """
          ports = sorted(ports, key=lambda port: (port.tile_id, port.direction))
          self._logln('ports: {0}'.format(' '.join('{}({} {})'.format(p.type.value, p.tile_id, p.direction)
                                                  for p in ports)))