parameters: (self, text)
docstring: Creates a tclib.Message object from 'text', attempting to recognize
      a few different formats of text that can be automatically placeholderized
      (HTML code, printf-style format strings, and FormatMessage-style format
      strings).
docstring_summary: Creates a tclib.Message object from 'text', attempting to recognize
      a few different formats of text that can be automatically placeholderized
      (HTML code, printf-style format strings, and FormatMessage-style format
      strings).
docstring_tokens: Creates a tclib . Message object from text attempting to recognize a few different formats of text that can be automatically placeholderized ( HTML code printf - style format strings and FormatMessage - style format strings ) .
function: def Placeholderize(self, text):
      '''Creates a tclib.Message object from 'text', attempting to recognize
      a few different formats of text that can be automatically placeholderized
      (HTML code, printf-style format strings, and FormatMessage-style format
      strings).
      '''
  
      try:
        # First try HTML placeholderizing.
        # TODO(joi) Allow use of non-TotalRecall flavors of HTML placeholderizing
        msg = tr_html.HtmlToMessage(text, True)
        for item in msg.GetContent():
          if not isinstance(item, six.string_types):
            return msg  # Contained at least one placeholder, so we're done
  
        # HTML placeholderization didn't do anything, so try to find printf or
        # FormatMessage format specifiers and change them into placeholders.
        msg = tclib.Message()
        parts = _FORMAT_SPECIFIER.split(text)
        todo_counter = 1  # We make placeholder IDs 'TODO_0001' etc.
        for part in parts:
          if _FORMAT_SPECIFIER.match(part):
            msg.AppendPlaceholder(tclib.Placeholder(
              'TODO_%04d' % todo_counter, part, 'TODO'))
            todo_counter += 1
          elif part != '':
            msg.AppendText(part)
  
        if self.role_model and len(parts) > 1:  # there are TODO placeholders
          role_model_msg = self.role_model.UberClique().BestCliqueByOriginalText(
            msg.GetRealContent(), '')
          if role_model_msg:
            # replace wholesale to get placeholder names and examples
            msg = role_model_msg
  
        return msg
      except:
        print('Exception processing message with text "%s"' % text)
        raise
function_tokens: def Placeholderize ( self , text ) : try : # First try HTML placeholderizing. # TODO(joi) Allow use of non-TotalRecall flavors of HTML placeholderizing msg = tr_html . HtmlToMessage ( text , True ) for item in msg . GetContent ( ) : if not isinstance ( item , six . string_types ) : return msg # Contained at least one placeholder, so we're done # HTML placeholderization didn't do anything, so try to find printf or # FormatMessage format specifiers and change them into placeholders. msg = tclib . Message ( ) parts = _FORMAT_SPECIFIER . split ( text ) todo_counter = 1 # We make placeholder IDs 'TODO_0001' etc. for part in parts : if _FORMAT_SPECIFIER . match ( part ) : msg . AppendPlaceholder ( tclib . Placeholder ( 'TODO_%04d' % todo_counter , part , 'TODO' ) ) todo_counter += 1 elif part != '' : msg . AppendText ( part ) if self . role_model and len ( parts ) > 1 : # there are TODO placeholders role_model_msg = self . role_model . UberClique ( ) . BestCliqueByOriginalText ( msg . GetRealContent ( ) , '' ) if role_model_msg : # replace wholesale to get placeholder names and examples msg = role_model_msg return msg except : print ( 'Exception processing message with text "%s"' % text ) raise