code: def clean(inputline, strip=True, rem_indents=True, encoding_errors="replace"):
      
      stdout_encoding = get_encoding(sys.stdout)
      inputline = str(inputline)
      if rem_indents:
          inputline = inputline.replace(openindent, "").replace(closeindent, "")
      if strip:
          inputline = inputline.strip()
      return inputline.encode(stdout_encoding, encoding_errors).decode(stdout_encoding)
docs: Clean and strip a line.