def choose_lines(source, number, seed=None, generator=random):
 if (seed is not None):
  generator.seed(seed)
 sources = source.split('\n')
 return [generator.choice(sources) for n in range(number)]

def choose_lines ( source , number , seed = None , generator = random ) : if ( seed is not None ) : generator . seed ( seed ) sources = source . split ( '\n' ) return [ generator . choice ( sources ) for n in range ( number ) ]
return a list of number lines randomly chosen from the source .