-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevents.py
77 lines (55 loc) · 1.22 KB
/
events.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
import re
from dataclasses import dataclass
class Event:
@classmethod
def event_name(cls):
# transforms the class name so that it is better readable in MixPanel,
# e.g. CreateProject becomes "Create Project"
matches = re.finditer(
".+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)", cls.__name__
)
return " ".join([m.group(0) for m in matches])
class SignUp(Event):
pass
@dataclass
class AddNotification(Event):
Level: str
Message: str
@dataclass
class CreateProject(Event):
Name: str
Description: str
@dataclass
class UploadRecords(Event):
ProjectName: str
Records: int
@dataclass
class AddLabelingTask(Event):
ProjectName: str
Name: str
Type: str
@dataclass
class AddLabel(Event):
ProjectName: str
LabelingTaskName: str
Name: str
@dataclass
class AddLabelsToRecord(Event):
ProjectName: str
Type: str
@dataclass
class AddInformationSourceRun(Event):
ProjectName: str
Type: str
Code: str
Logs: str
RunTime: float
@dataclass
class AddWeakSupervisionRun(Event):
ProjectName: str
RunTime: float
@dataclass
class AppNavigation(Event):
old: str
new: str
name: str