def get_pasted_lines(sentinel, l_input=py3compat.input, quiet=False):
 if (not quiet):
  print ("Pasting code; enter '%s' alone on the line to stop or use Ctrl-D." % sentinel)
  prompt = ':'
 else:
  prompt = ''
 while True:
  try:
   l = l_input(prompt)
   if (l == sentinel):
    return
   else:
    (yield l)
  except EOFError:
   print '<EOF>'
   return

def get_pasted_lines ( sentinel , l_input = py3compat . input , quiet = False ) : if ( not quiet ) : print ( "Pasting code; enter '%s' alone on the line to stop or use Ctrl-D." % sentinel ) prompt = ':' else : prompt = '' while True : try : l = l_input ( prompt ) if ( l == sentinel ) : return else : ( yield l ) except EOFError : print '<EOF>' return
yield pasted lines until the user enters the given sentinel value .