code: def update_placeholder_formats(self, format_string, placeholder_formats):
          
          # Tokenize the format string and process them
          output = []
          for token in self.tokens(format_string):
              if (
                  token.group("placeholder")
                  and (not token.group("format"))
                  and token.group("key") in placeholder_formats
              ):
                  output.append(
                      "{%s%s}"
                      % (token.group("key"), placeholder_formats[token.group("key")])
                  )
                  continue
              value = token.group(0)
              output.append(value)
          return u"".join(output)
docs: Update a format string adding formats if they are not already present.