-
Notifications
You must be signed in to change notification settings - Fork 4
/
transformations.py
202 lines (181 loc) · 8.93 KB
/
transformations.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
import random
transformations = dict()
def register(transformation):
"""
Register a transformation function
"""
transformations[transformation.__name__] = transformation
return transformation
@register
def normal(name):
"""
>>> assert normal('hello') == 'hello'
"""
return name
@register
def nicknames(name):
mobster_nicknames = ["Joe Bananas", "Ice Pick Willie", "Johnny Sausage",
"Baby Shanks", "Whack-Whack", "Tick–Tock",
"Quack Quack", "The Wizard of Odds", "Louie Bagels",
"Tommy Sneakers", "Pat the Cat", "Chee-Chee",
"Tommy Karate", "Willie Potatoes", "Bootsie",
"Jimmy Dumps", "One Armed Ronnie", "The Toupee",
"Chicken Man", "Socks", "Jimmy Nap", "Charley Wagons",
"Joe the Builder", "Benny Squint", "Mr. Bread",
"Dopey Benny", "The Typewriter", "The Artichoke King",
"Shellackhead", "The Owl", "Louie Eggs",
"The Clutch Hand", "14th Street Steve", "Corky",
"Flipper", "Legs DiCocco", "The Golfer",
"The Reluctant Prince", "Georgie Neck", "Baldy Dom",
"Larry Fab", "George from Canada",
"Master of Disaster", "Dr. Doom", "Zero Cool",
"Crash Override", "Acid Burn", "The Phantom Phreak",
"Cereal Killer", "Lord Nikon", "The Plague",
"The Gibson Killer", "Da Vinci"]
nick_prefix = ["Sweet", "Swift", "Slick", "The", "The Mad", "Stylin'",
"Big", "The Big", "Big City", "Big Slack Attack",
"Beast Mode", "Master", "Steel", "Diamond-Tipped", "Iron",
"Cousin", "T-Tops", "T-Bone", "Hackmaster", "Monster",
"Grandmaster", "M.C.", "Poker Face", "Gold Tooth",
"Maserati", "Fast Talkin'", "Glam", "The Animal",
"Maddog", "Doctor"]
name_parts = name.split(' ', 1)
if len(name_parts) < 2:
if random.randint(0, 10) > 4:
nick = f"{name} {random.choice(nick_prefix)}"
else:
nick = random.choice(mobster_nicknames)
return f"{name}– A.K.A. \"{nick}\""
else:
name_parts_for_nick = name_parts.copy()
random.shuffle(name_parts_for_nick)
nick = random.choice(mobster_nicknames)
if random.randint(0, 10) > 4:
nick = f"{random.choice(nick_prefix)} {nick}"
return f'{name_parts[0]} \"{nick}\" {" ".join(name_parts[1:])}'
@register
def shifted(name):
vowels = ["a", "e", "i", "o", "u", "y"]
output = ''
for char in name.lower():
if char in vowels:
output += random.choice(vowels)
else:
output += char
return output.title()
@register
def jargon(name):
verbs = ["reinvent", "unpack", "pencil-in", "touch base on", "maximize",
"resonate with", "preplan", "preschedule", "push the envelope on",
"ideate about", "reincentivize", "deincentivize", "incentivize",
"get on-board with", "come up-to-speed on", "reprioritize",
"deprioritize", "prioritize", "fish or cut bait with",
"evangelize", "circle the wagons on", "circle back around to",
"do a deep dive on", "innovate on", "enact change with",
"give 110% using", "leverage", "take it to the next level with",
"get buy-in from key stakeholders about", "make hay using",
"move the needle on", "scale", "vertically integrate",
"rearchitect", "punt on", "make a business case for",
"be a change agent for", "champion",
"proactively guesstimate about",
"heard cats for", "raise the bar with",
"maintain radio silence on", "reach out about",
"avoid reinventing the wheel with", "take strides on",
"task team members with", "add value to",
"become a key stakeholder in", "implement solutions for",
"monetize", "bake in", "champion", "avoid boiling the ocean with",
"gain traction with", "utilize", "herd cats for",
"make informed guesstimates about", "re-evaluate",
"incorporate feedback about", "minimize the impact of",
"let the chips fall where they may with",
"wrap their brain around", "do some blue sky thinking about",
"move the goalposts on", "drill-down on",
"avoid dropping the ball on", "review", "facilitate",
"get in-the-loop about", "engage thought leaders on",
"eat our own dogfood for",
"be in a holding pattern until key stakeholders approve",
"iron out", "ideate best approaches to", "blueprint",
"free up some cycles for"]
adjectives = ["full-service", "robust", "high-price-point",
"best-of-breed", "frictionless", "turn-key", "game-changing",
"mission-critical", "proactive", "seamless", "soup-to-nuts",
"value-added", "win-win", "world-class", "bleeding-edge",
"the highest bang for our buck", "zero-sum",
"belt-and-suspenders", "above-board", "restructured",
"user-focused", "risk-managing", "disruptive",
"high-granularity", "critical", "key"]
plural_nouns = ["hard stops", "solutions", "learnings", "best practices",
"cost analyses", "core competencies", "ecosystems",
"800lb gorilla issues", "action items", "spinning plates",
"bells and whistles", "brain dumps", "business cases",
"stakeholders", "moving parts", "best practices",
"change agents", "deliverables", "evangelism",
"guesstimates", "human capital", "rocket science",
"brain surgery", "valued partners", "low-hanging fruit",
"magic bullets", "next steps", "pain points",
"paradigm shifts", "secret sauce", "litmus tests",
"bio breaks", "life cycles", "markets", "timelines",
"strategies", "benchmarks", "paradigms", "metrics",
"red tape", "business practices", "corporate messaging",
"institutional learnings", "institutional knowlege",
"key players"]
prefix = ["Going forward", "Moving forward", "At the end of the day",
"While key players are in a holding pattern",
"While we're all on the same page",
"While things are still up in the air", "Across the board"]
suffix = ["utilizing feedback from the big wigs",
"in partnership with the c-suite",
"on a level playing field", "with a sense of urgency",
"embracing out-of-the-box approaches",
"and run it up the flagpole",
"in partnership with key stakeholders",
"without just throwing it over-the-fence afterwards",
"with an eye towards best practices",
"where the rubber hits the road"]
adjective = ""
if random.random() > 0.5:
adjective = f"{random.choice(adjectives)} "
j = "{} will {} {}{}".format(
name.split(' ', 1)[0].capitalize(),
random.choice(verbs),
adjective,
random.choice(plural_nouns)
)
prefix_suffix_seed = random.random()
if prefix_suffix_seed < 0.15:
j = f"{j} {random.choice(suffix)}"
elif prefix_suffix_seed > 0.75:
j = f"{random.choice(prefix).capitalize()}, {j}"
return f"{name.title()}: {j}."
@register
def cats(name):
catname = random.choice([
{"name": "Asparagus", "nickname": "Theatre Cat"},
{"name": "Bombalurina"},
{"name": "Bustopher Jones", "nickname": "Cat About Town"},
{"name": "Demeter"},
{"name": "Grizabella"},
{"name": "Jellylorum"},
{"name": "Sillabub"},
{"name": "Jennyanydots", "nickname": "Old Gumbie Cat"},
{"name": "Macavity", "nickname": "Mystery Cat"},
{"name": "Mr. Mistoffelees"},
{"name": "Mungojerrie"},
{"name": "Munkustrap"},
{"name": "Old Deuteronomy"},
{"name": "Rumpleteazer"},
{"name": "Rum Tum Tugger"},
{"name": "Skimbleshanks", "nickname": "Railway Cat"},
{"name": "Victoria"}
])
namelist = [namepart.title() for namepart in name.split(' ', 1)]
n = namelist[0]
cat = catname['name']
if "nickname" in catname and len(namelist) == 1:
return f"{n}, known to be the {catname['nickname']}, is {cat}"
elif len(namelist) == 1:
return f"{n} a.k.a. {cat}"
elif "nickname" in catname:
return f"{n} \"{cat}\" {namelist[1]} is the {catname['nickname']}"
else:
return f"{n} \"{cat}\" {namelist[1]}"