code: def write(self, valuedict):
          
          if self.identifier in valuedict:
              value = valuedict[self.identifier]
          elif self.default is not None:
              value = self.default
          elif self.fromtag is not None and self.fromtag in valuedict:
              if self.operator == "count":
                  value = len(valuedict[self.fromtag])
              else:
                  msg.err("referenced 'from' attribute/operator {} not in xml dictionary.".format(self.fromtag))
                  exit(1)
          else:
              msg.err("a required line {} had no value or default specified.".format(self.identifier))
              exit(1)            
  
          #Before we generate the result, validate the choices if they exist
          if len(self.choices) > 0:
              for single in value:
                  if str(single) not in self.choices:
                      msg.warn("failed choices validation for {} in {} (line {})".format(
                          single, self.choices, self.identifier))
  
          result = []
          #Get the string representation of the value
          if isinstance(value, list):
              sval = " ".join([ str(val) for val in value])
          else:
              sval = str(value)
  
          if self.comment != "" and (self.nvalues < 0 or self.nvalues > 5):
              #We will put the comments on a separate line from the actual values.
              result.append(self.comment)
              result.append(sval)
          else:
              result.append("{} {}".format(sval, self.comment))
                      
          return result
docs: Returns the lines that this template line should add to the input file.