def path_and_line(req):
 (path, line) = re.match('-r (.*) \\(line (\\d+)\\)$', req.comes_from).groups()
 return (path, int(line))

def path_and_line ( req ) : ( path , line ) = re . match ( '-r (.*) \\(line (\\d+)\\)$' , req . comes_from ) . groups ( ) return ( path , int ( line ) )
return the path and line number of the file from which an installrequirement came .