def unpickle_generator(filename):
    '''
    @param filename: source file of pickled generator
    '''
    input_pkl = open(filename, "rb")
    gen_snapshot = pickle.load(input_pkl)
    return copy_generator(gen_snapshot)[0]

    @param filename: source file of pickled generator
    
recipes/Python/528951_Pickling_Generators/recipe-528951.py