code: def _insert(wrap: str, tag: Optional[str]) -> str:
          
          if tag is None:
              raise ValueError('tag cannot be None')
          formatter = string.Formatter()
          mapping = FormatDict(component=tag)
          return formatter.vformat(wrap, (), mapping)
docs: Insert the component tag into the wrapper html.
  
          This ignores other tags already created like ``{socket}``.
  
          https://stackoverflow.com/a/11284026/744520