initial commit
This commit is contained in:
commit
41443e5a7d
17 changed files with 2950 additions and 0 deletions
29
examples/do_something_1.py
Normal file
29
examples/do_something_1.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import random
|
||||
import os
|
||||
import string
|
||||
from time import sleep
|
||||
|
||||
|
||||
def main():
|
||||
iterations = random.randint(10, 150)
|
||||
speed = float(os.getenv("SIMULATION_SPEED") or 0.8)
|
||||
print(f"Going for {iterations=}")
|
||||
for i in range(iterations):
|
||||
print(
|
||||
str(i) + " " +
|
||||
''.join(
|
||||
random.sample(
|
||||
" "+string.ascii_uppercase+string.ascii_lowercase+string.digits,
|
||||
int(random.uniform(10, 50))
|
||||
)
|
||||
)
|
||||
)
|
||||
sleep(
|
||||
speed * (0.02 * random.expovariate(0.5) +
|
||||
(random.uniform(0, 1) if random.uniform(0, 1) > 0.8 else 0) +
|
||||
(random.uniform(0, 5) if random.uniform(0, 1) > 0.99 else 0))
|
||||
)
|
||||
print("Done, script is finished")
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue