nodes: 0, module; 1, function_definition; 2, function_name:get_line_in_facet; 3, parameters; 4, block; 5, identifier:self; 6, identifier:facet; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, while_statement; 12, return_statement; 13, comment:"""
          Returns the sorted pts in a facet used to draw a line
          """; 14, assignment; 15, assignment; 16, assignment; 17, comparison_operator:len(lines) > 0; 18, block; 19, identifier:pt; 20, identifier:lines; 21, call; 22, identifier:pt; 23, list; 24, identifier:prev; 25, None; 26, call; 27, integer:0; 28, if_statement; 29, comment:# make sure the lines are connected one by one.; 30, comment:# find the way covering all pts and facets; 31, expression_statement; 32, expression_statement; 33, expression_statement; 34, identifier:list; 35, argument_list; 36, identifier:len; 37, argument_list; 38, comparison_operator:prev is None; 39, block; 40, else_clause; 41, call; 42, call; 43, assignment; 44, attribute; 45, identifier:lines; 46, identifier:prev; 47, None; 48, expression_statement; 49, block; 50, attribute; 51, argument_list; 52, attribute; 53, argument_list; 54, identifier:prev; 55, subscript; 56, identifier:facet; 57, identifier:outer_lines; 58, assignment; 59, for_statement; 60, identifier:pt; 61, identifier:append; 62, call; 63, identifier:pt; 64, identifier:append; 65, call; 66, identifier:l; 67, integer:1; 68, identifier:l; 69, call; 70, pattern_list; 71, call; 72, block; 73, attribute; 74, argument_list; 75, attribute; 76, argument_list; 77, attribute; 78, argument_list; 79, identifier:i; 80, identifier:l; 81, identifier:enumerate; 82, argument_list; 83, if_statement; 84, subscript; 85, identifier:tolist; 86, subscript; 87, identifier:tolist; 88, identifier:lines; 89, identifier:pop; 90, integer:0; 91, identifier:lines; 92, comparison_operator:prev in l; 93, block; 94, attribute; 95, subscript; 96, attribute; 97, subscript; 98, identifier:prev; 99, identifier:l; 100, expression_statement; 101, if_statement; 102, break_statement; 103, identifier:self; 104, identifier:wulff_pt_list; 105, identifier:l; 106, integer:0; 107, identifier:self; 108, identifier:wulff_pt_list; 109, identifier:l; 110, integer:1; 111, assignment; 112, comparison_operator:l[1] == prev; 113, block; 114, identifier:l; 115, call; 116, subscript; 117, identifier:prev; 118, expression_statement; 119, attribute; 120, argument_list; 121, identifier:l; 122, integer:1; 123, call; 124, identifier:lines; 125, identifier:pop; 126, identifier:i; 127, attribute; 128, argument_list; 129, identifier:l; 130, identifier:reverse
code: def get_line_in_facet(self, facet):
          """
          Returns the sorted pts in a facet used to draw a line
          """
  
          lines = list(facet.outer_lines)
          pt = []
          prev = None
          while len(lines) > 0:
              if prev is None:
                  l = lines.pop(0)
              else:
                  for i, l in enumerate(lines):
                      if prev in l:
                          l = lines.pop(i)
                          if l[1] == prev:
                              l.reverse()
                          break
              # make sure the lines are connected one by one.
              # find the way covering all pts and facets
              pt.append(self.wulff_pt_list[l[0]].tolist())
              pt.append(self.wulff_pt_list[l[1]].tolist())
              prev = l[1]
  
          return pt