docs: def prepare(value, should_escape):
      """
      Prepares a value to be added to the result
  
      :param value:
          The value to add to the result
  
      :param should_escape:
          If the string should be HTML-escaped
  
      :return:
          A unicode string or strlist
      """
  
      if value is None:
          return u''
      type_ = type(value)
      if type_ is not strlist:
          if type_ is not str_class:
              if type_ is bool:
                  value = u'true' if value else u'false'
              else:
                  value = str_class(value)
          if should_escape:
              value = escape(value)
      return value