-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.py
98 lines (62 loc) · 1.29 KB
/
functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
from random import random
from pytest_cleanup import Recorder
def sub():
print('in sub')
def inner():
print('in inner')
def inner2():
print('in inner2')
inner2()
inner()
from datetime import datetime
return datetime(1970, 1, 1)
def return1():
return 1
def go(a, b):
print('in go')
# @profile
def inner():
print('in inner2')
sub()
inner()
return random()
def higher_order(fn):
def inner():
return fn()
return inner
def higher_order2():
from random import random
def inner():
return random()
return inner
def generator1(count):
for i in range(count):
yield i
def higher_order3():
return return1
async def print_header(c, a=None, b=None):
print('some async message')
return 1
async def go_async():
result = higher_order(higher_order2)
higher_order3()
generator1(2)
generator1(3)
generator1(2)
result()()
higher_order2()
higher_order3()
return1()
return1()
await print_header('hey', b='hi')
# print_clients()
def start():
go(1, 2)
sub()
another.go(2, 3)
#
# if __name__ == '__main__':
# with Recorder():
# start()
# # go(1, 2) #
# # Recorder().exit()