def get_estimate(self):
    '\n    :return: estimation count of unique values\n\n    If heap size is smaller than sample size, just return heap size.\n    Otherwise, takes into account the possibility of hash collisions,\n    which become more likely than not for 2^32 distinct elements.\n    Note that log(1+x) ~ x for small x, so for sampleSize << maxHash\n    log(1 - sample_size/sample_space) / log(1 - 1/sample_space) ~ sample_size\n    and hence estimate ~ sample_size * hash_space / sample_space\n    as one would expect.\n\n    Given sample_size / sample_space = est / hash_space\n    est = sample_size * hash_space / sample_space\n\n    Given above sample_size approximate,\n    est = log1p(-sample_size/sample_space) / log1p(-1/sample_space)\n      * hash_space / sample_space\n    '
    if (len(self._sample_heap) < self._sample_size):
        return len(self._sample_heap)
    else:
        sample_space_size = (sys.maxsize - (1.0 * self._min_hash))
        est = (((math.log1p(((- self._sample_size) / sample_space_size)) / math.log1p(((- 1) / sample_space_size))) * self._HASH_SPACE_SIZE) / sample_space_size)
        return round(est)
:return: estimation count of unique values

If heap size is smaller than sample size, just return heap size.
Otherwise, takes into account the possibility of hash collisions,
which become more likely than not for 2^32 distinct elements.
Note that log(1+x) ~ x for small x, so for sampleSize << maxHash
log(1 - sample_size/sample_space) / log(1 - 1/sample_space) ~ sample_size
and hence estimate ~ sample_size * hash_space / sample_space
as one would expect.

Given sample_size / sample_space = est / hash_space
est = sample_size * hash_space / sample_space

Given above sample_size approximate,
est = log1p(-sample_size/sample_space) / log1p(-1/sample_space)
  * hash_space / sample_space
def get_estimate(self):
    '\n    :return: estimation count of unique values\n\n    If heap size is smaller than sample size, just return heap size.\n    Otherwise, takes into account the possibility of hash collisions,\n    which become more likely than not for 2^32 distinct elements.\n    Note that log(1+x) ~ x for small x, so for sampleSize << maxHash\n    log(1 - sample_size/sample_space) / log(1 - 1/sample_space) ~ sample_size\n    and hence estimate ~ sample_size * hash_space / sample_space\n    as one would expect.\n\n    Given sample_size / sample_space = est / hash_space\n    est = sample_size * hash_space / sample_space\n\n    Given above sample_size approximate,\n    est = log1p(-sample_size/sample_space) / log1p(-1/sample_space)\n      * hash_space / sample_space\n    '
    if (len(self._sample_heap) < self._sample_size):
        return len(self._sample_heap)
    else:
        sample_space_size = (sys.maxsize - (1.0 * self._min_hash))
        est = (((math.log1p(((- self._sample_size) / sample_space_size)) / math.log1p(((- 1) / sample_space_size))) * self._HASH_SPACE_SIZE) / sample_space_size)
        return round(est)