generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import unify | ||
import random | ||
|
||
unify.activate("derived_entry") | ||
|
||
for _ in range(20): | ||
unify.log( | ||
x=random.random(), | ||
y=random.random() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import unify | ||
unify.activate("gender_loc_salary") | ||
import random | ||
|
||
gender_factors = {"male": 1500, "female": 750} | ||
loc_offsets = {"UK": 15000, "US": 45000} | ||
for gender in ["male", "female"]: | ||
for loc in ["UK", "US"]: | ||
for age in range(20, 55): | ||
unify.log( | ||
gender=gender, | ||
nationality=loc, | ||
age=age, | ||
salary=( | ||
age*500 + | ||
age*gender_factors[gender]*random.random() + | ||
loc_offsets[loc]*random.random() | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import unify | ||
unify.activate("histogram-demo", overwrite=True) | ||
import random | ||
from datetime import date | ||
|
||
n = 10 | ||
for month in range(1, 13): | ||
num_queries = random.randint(month*n, (month+10)*n) | ||
print(f"creating logs for {month} with {num_queries} queries... ") | ||
unify.create_logs( | ||
entries=[ | ||
{ | ||
"date": date( | ||
2025, month, random.randint(1, 28) | ||
).isoformat() | ||
} | ||
for _ in range(num_queries) | ||
] | ||
) | ||
print(f"created {num_queries} logs for {month}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters