nodes: 0, module; 1, function_definition; 2, function_name:append; 3, parameters; 4, block; 5, identifier:self; 6, identifier:hcont; 7, identifier:value; 8, default_parameter; 9, expression_statement; 10, assert_statement; 11, if_statement; 12, expression_statement; 13, identifier:score; 14, None; 15, comment:""" If sort_field is specified, score must be None.
              If sort_field is not specified, score is mandatory. """; 16, comparison_operator:(score is None) != (self.field.sort_field is None); 17, comparison_operator:score is None; 18, block; 19, call; 20, parenthesized_expression; 21, parenthesized_expression; 22, identifier:score; 23, None; 24, expression_statement; 25, attribute; 26, argument_list; 27, comparison_operator:score is None; 28, comparison_operator:self.field.sort_field is None; 29, assignment; 30, identifier:ContainerFieldWriter; 31, identifier:append; 32, identifier:self; 33, identifier:hcont; 34, identifier:value; 35, identifier:score; 36, identifier:score; 37, None; 38, attribute; 39, None; 40, identifier:score; 41, call; 42, attribute; 43, identifier:sort_field; 44, identifier:getattr; 45, argument_list; 46, identifier:self; 47, identifier:field; 48, identifier:value; 49, attribute; 50, attribute; 51, identifier:name; 52, attribute; 53, identifier:sort_field; 54, identifier:self; 55, identifier:field
code: def append(self, hcont, value, score = None):
          """ If sort_field is specified, score must be None.
              If sort_field is not specified, score is mandatory. """
          assert (score is None) != (self.field.sort_field is None)
          if score is None:
              score = getattr(value, self.field.sort_field.name)
          ContainerFieldWriter.append(self, hcont, value, score)