code: def sep(
      self,
      sepchar: str,
      title: Optional[str] = None,
      fullwidth: Optional[int] = None,
      **markup: bool,
  ) -> None:
      if fullwidth is None:
          fullwidth = self.fullwidth
      # The goal is to have the line be as long as possible
      # under the condition that len(line) <= fullwidth.
      if sys.platform == "win32":
          # If we print in the last column on windows we are on a
          # new line but there is no way to verify/neutralize this
          # (we may not know the exact line width).
          # So let's be defensive to avoid empty lines in the output.
          fullwidth -= 1
      if title is not None:
          # we want 2 + 2*len(fill) + len(title) <= fullwidth
          # i.e.    2 + 2*len(sepchar)*N + len(title) <= fullwidth
          #         2*len(sepchar)*N <= fullwidth - len(title) - 2
          #         N <= (fullwidth - len(title) - 2) // (2*len(sepchar))
          N = max((fullwidth - len(title) - 2) // (2 * len(sepchar)), 1)
          fill = sepchar * N
          line = f"{fill} {title} {fill}"
      else:
          # we want len(sepchar)*N <= fullwidth
          # i.e.    N <= fullwidth // len(sepchar)
          line = sepchar * (fullwidth // len(sepchar))
      # In some situations there is room for an extra sepchar at the right,
      # in particular if we consider that with a sepchar like "_ " the
      # trailing space is not important at the end of the line.
      if len(line) + len(sepchar.rstrip()) <= fullwidth:
          line += sepchar.rstrip()
  
      self.line(line, **markup)
  
imports: import os
  import shutil
  import sys
  from typing import Optional
  from typing import Sequence
  from typing import TextIO
  from .wcwidth import wcswidth
  from _pytest.compat import final
label_desc: Use image node_id 6 for calling the TerminalWriter obj's underlying member method code with example usage: obj.sep(sepchar, title, fullwidth) without return types