parameters: (value, endchars)
return_statement: return ''.join(vchars), ''.join([fragment[pos:]] + remainder), had_qp
docstring: Scan printables/quoted-pairs until endchars and return unquoted ptext.
  
      This function turns a run of qcontent, ccontent-without-comments, or
      dtext-with-quoted-printables into a single string by unquoting any
      quoted printables.  It returns the string, the remaining value, and
      a flag that is True iff there were any quoted printables decoded.
docstring_summary: Scan printables/quoted-pairs until endchars and return unquoted ptext.
docstring_tokens: Scan printables / quoted - pairs until endchars and return unquoted ptext .
function: def _get_ptext_to_endchars(value, endchars):
      """Scan printables/quoted-pairs until endchars and return unquoted ptext.
  
      This function turns a run of qcontent, ccontent-without-comments, or
      dtext-with-quoted-printables into a single string by unquoting any
      quoted printables.  It returns the string, the remaining value, and
      a flag that is True iff there were any quoted printables decoded.
  
      """
      fragment, *remainder = _wsp_splitter(value, 1)
      vchars = []
      escape = False
      had_qp = False
      for pos in range(len(fragment)):
          if fragment[pos] == '\\':
              if escape:
                  escape = False
                  had_qp = True
              else:
                  escape = True
                  continue
          if escape:
              escape = False
          elif fragment[pos] in endchars:
              break
          vchars.append(fragment[pos])
      else:
          pos = pos + 1
      return ''.join(vchars), ''.join([fragment[pos:]] + remainder), had_qp
function_tokens: def _get_ptext_to_endchars ( value , endchars ) : fragment , * remainder = _wsp_splitter ( value , 1 ) vchars = [ ] escape = False had_qp = False for pos in range ( len ( fragment ) ) : if fragment [ pos ] == '\\' : if escape : escape = False had_qp = True else : escape = True continue if escape : escape = False elif fragment [ pos ] in endchars : break vchars . append ( fragment [ pos ] ) else : pos = pos + 1 return '' . join ( vchars ) , '' . join ( [ fragment [ pos : ] ] + remainder ) , had_qp