refactored reservoir.py to enable building of sampling function with or without replacement within functional calls on RDDs