parameters: (line, header)
return_statement: return newline + line
docstring: Code a single line as quoted-printable.
      If header is set, quote some extra characters.
docstring_summary: Code a single line as quoted-printable.
      If header is set, quote some extra characters.
docstring_tokens: Code a single line as quoted - printable . If header is set quote some extra characters .
function: def mime_encode(line, header):
      """Code a single line as quoted-printable.
      If header is set, quote some extra characters."""
      if header:
          reg = mime_header_char
      else:
          reg = mime_char
      newline = ''
      pos = 0
      if len(line) >= 5 and line[:5] == 'From ':
          # quote 'From ' at the start of a line for stupid mailers
          newline = ('=%02x' % ord('F')).upper()
          pos = 1
      while 1:
          res = reg.search(line, pos)
          if res is None:
              break
          newline = newline + line[pos:res.start(0)] + \
                    ('=%02x' % ord(res.group(0))).upper()
          pos = res.end(0)
      line = newline + line[pos:]
  
      newline = ''
      while len(line) >= 75:
          i = 73
          while line[i] == '=' or line[i-1] == '=':
              i = i - 1
          i = i + 1
          newline = newline + line[:i] + '=\n'
          line = line[i:]
      return newline + line
function_tokens: def mime_encode ( line , header ) : if header : reg = mime_header_char else : reg = mime_char newline = '' pos = 0 if len ( line ) >= 5 and line [ : 5 ] == 'From ' : # quote 'From ' at the start of a line for stupid mailers newline = ( '=%02x' % ord ( 'F' ) ) . upper ( ) pos = 1 while 1 : res = reg . search ( line , pos ) if res is None : break newline = newline + line [ pos : res . start ( 0 ) ] + ( '=%02x' % ord ( res . group ( 0 ) ) ) . upper ( ) pos = res . end ( 0 ) line = newline + line [ pos : ] newline = '' while len ( line ) >= 75 : i = 73 while line [ i ] == '=' or line [ i - 1 ] == '=' : i = i - 1 i = i + 1 newline = newline + line [ : i ] + '=\n' line = line [ i : ] return newline + line