MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / _timeseries_points

Function _timeseries_points

api/experimentation/services.py:195–209  ·  view source on GitHub ↗
(
    buckets: Sequence[ExposureBucket],
)

Source from the content-addressed store, hash-verified

193
194
195def _timeseries_points(
196 buckets: Sequence[ExposureBucket],
197) -> list[ExposuresTimeseriesPoint]:
198 new_identities_by_bucket: dict[datetime, dict[str, int]] = {}
199 for b in buckets:
200 new_identities_by_bucket.setdefault(b.bucket, {})[b.variant] = (
201 b.first_exposed_identities
202 )
203 return [
204 ExposuresTimeseriesPoint(
205 bucket=bucket_start.isoformat(),
206 new_identities=new_identities_by_bucket[bucket_start],
207 )
208 for bucket_start in sorted(new_identities_by_bucket)
209 ]
210
211
212def _select_exposure_granularity(

Callers 1

build_exposures_summaryFunction · 0.85

Calls 2

sortedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…