parameters: (self, size, seed=0)
docstring: Creates a new reservoir.
  
      Args:
        size: The number of values to keep in the reservoir for each tag. If 0,
          all values will be kept.
        seed: The seed of the random number generator to use when sampling.
          Different values for |seed| will produce different samples from the same
          input items.
  
      Raises:
        ValueError: If size is negative or not an integer.
docstring_summary: Creates a new reservoir.
docstring_tokens: Creates a new reservoir .
function: def __init__(self, size, seed=0):
      """Creates a new reservoir.
  
      Args:
        size: The number of values to keep in the reservoir for each tag. If 0,
          all values will be kept.
        seed: The seed of the random number generator to use when sampling.
          Different values for |seed| will produce different samples from the same
          input items.
  
      Raises:
        ValueError: If size is negative or not an integer.
      """
      if size < 0 or size != round(size):
        raise ValueError('size must be nonegative integer, was %s' % size)
      self._buckets = collections.defaultdict(
          lambda: _ReservoirBucket(size, random.Random(seed)))
      # _mutex guards the keys - creating new keys, retreiving by key, etc
      # the internal items are guarded by the ReservoirBuckets' internal mutexes
      self._mutex = threading.Lock()
function_tokens: def __init__ ( self , size , seed = 0 ) : if size < 0 or size != round ( size ) : raise ValueError ( 'size must be nonegative integer, was %s' % size ) self . _buckets = collections . defaultdict ( lambda : _ReservoirBucket ( size , random . Random ( seed ) ) ) # _mutex guards the keys - creating new keys, retreiving by key, etc # the internal items are guarded by the ReservoirBuckets' internal mutexes self . _mutex = threading . Lock ( )