|
4 | 4 | import os |
5 | 5 | import re |
6 | 6 | import base64 |
| 7 | +import string |
7 | 8 | import concurrent |
8 | 9 | import hashlib |
9 | 10 | import logging |
@@ -63,62 +64,9 @@ def validate_label(value): |
63 | 64 |
|
64 | 65 | def generate_app_name(): |
65 | 66 | """Return a randomly-generated memorable name.""" |
66 | | - adjectives = [ |
67 | | - 'ablest', 'absurd', 'actual', 'aerial', 'allied', 'artful', 'atomic', 'august', |
68 | | - 'bamboo', 'benign', 'blonde', 'blurry', 'bolder', 'breezy', 'bubbly', 'burley', |
69 | | - 'candid', 'calmer', 'casual', 'cheery', 'classy', 'clever', 'convex', 'cubist', |
70 | | - 'dainty', 'dapper', 'decent', 'deluxe', 'docile', 'dogged', 'drafty', 'dreamy', |
71 | | - 'earthy', 'easier', 'echoed', 'edible', 'elfish', 'excess', 'exotic', 'expert', |
72 | | - 'fabled', 'famous', 'feline', 'finest', 'flaxen', 'folksy', 'frisky', 'frozen', |
73 | | - 'gaslit', 'gentle', 'gifted', 'ginger', 'global', 'golden', 'grassy', 'guided', |
74 | | - 'haptic', 'hearty', 'hidden', 'hipper', 'honest', 'humble', 'hungry', 'hushed', |
75 | | - 'iambic', 'iciest', 'iconic', 'indoor', 'inward', 'ironic', 'island', 'italic', |
76 | | - 'jagged', 'jangly', 'jaunty', 'jicama', 'jiggly', 'jovial', 'joyful', 'junior', |
77 | | - 'kabuki', 'karmic', 'keener', 'kiddie', 'kindly', 'kingly', 'klutzy', 'knotty', |
78 | | - 'lambda', 'latest', 'leader', 'linear', 'lively', 'lonely', 'loving', 'luxury', |
79 | | - 'madcap', 'madras', 'marble', 'mellow', 'metric', 'modest', 'molten', 'mystic', |
80 | | - 'native', 'nearby', 'nested', 'newish', 'nickel', 'nimbus', 'nonfat', 'normal', |
81 | | - 'oblong', 'oddest', 'offset', 'oldest', 'onside', 'orange', 'outlaw', 'owlish', |
82 | | - 'padded', 'pastry', 'peachy', 'pepper', 'player', 'preset', 'proper', 'pulsar', |
83 | | - 'quacky', 'quaint', 'quartz', 'queens', 'queued', 'quinoa', 'quirky', 'quoted', |
84 | | - 'racing', 'rental', 'ribbed', 'rising', 'rococo', 'rubber', 'rugged', 'rustic', |
85 | | - 'sanest', 'scenic', 'seeing', 'shadow', 'skiing', 'stable', 'steely', 'syrupy', |
86 | | - 'taller', 'tender', 'tested', 'timely', 'trendy', 'triple', 'truthy', 'twenty', |
87 | | - 'ultima', 'unbent', 'unisex', 'united', 'upbeat', 'uphill', 'usable', 'utmost', |
88 | | - 'vacuum', 'valued', 'vanity', 'velcro', 'velvet', 'verbal', 'violet', 'vulcan', |
89 | | - 'walkup', 'webbed', 'wicker', 'wiggly', 'wilder', 'wonder', 'wooden', 'woodsy', |
90 | | - 'yearly', 'yeasty', 'yellow', 'yeoman', 'yogurt', 'yonder', 'youthy', 'yuppie', |
91 | | - 'zaftig', 'zanier', 'zephyr', 'zeroed', 'zigzag', 'zipped', 'zircon', 'zydeco', |
92 | | - ] |
93 | | - nouns = [ |
94 | | - 'addendum', 'anaconda', 'airfield', 'aqualung', 'armchair', 'asteroid', 'autoharp', |
95 | | - 'babushka', 'backbone', 'bagpiper', 'barbecue', 'bookworm', 'bullfrog', 'buttress', |
96 | | - 'caffeine', 'checkers', 'chinbone', 'countess', 'crawfish', 'cucumber', 'cutpurse', |
97 | | - 'daffodil', 'darkroom', 'deadbolt', 'doghouse', 'dragster', 'drumroll', 'duckling', |
98 | | - 'earrings', 'earthman', 'eggplant', 'electron', 'elephant', 'espresso', 'eyetooth', |
99 | | - 'falconer', 'farmland', 'ferryman', 'fireball', 'fishbone', 'footwear', 'frosting', |
100 | | - 'gadabout', 'gasworks', 'gatepost', 'gemstone', 'gladness', 'goldfish', 'greenery', |
101 | | - 'hacienda', 'handbill', 'hardtack', 'hawthorn', 'headwind', 'henhouse', 'huntress', |
102 | | - 'icehouse', 'idealist', 'inchworm', 'instinct', 'inventor', 'insignia', 'ironwood', |
103 | | - 'jailbird', 'jamboree', 'jerrycan', 'jetliner', 'jokester', 'joyrider', 'jumpsuit', |
104 | | - 'kangaroo', 'keepsake', 'kerchief', 'keypunch', 'kingfish', 'knapsack', 'knothole', |
105 | | - 'ladybird', 'lakeside', 'lambskin', 'landmass', 'larkspur', 'lollipop', 'lungfish', |
106 | | - 'macaroni', 'mackinaw', 'magician', 'mainsail', 'milepost', 'mongoose', 'moonrise', |
107 | | - 'nailhead', 'nautilus', 'neckwear', 'newsreel', 'nonesuch', 'novelist', 'nuthatch', |
108 | | - 'occupant', 'odometer', 'offering', 'offshoot', 'original', 'organism', 'overalls', |
109 | | - 'pachinko', 'painting', 'pamphlet', 'paneling', 'pendulum', 'playroom', 'ponytail', |
110 | | - 'quacking', 'quadrant', 'quantity', 'queendom', 'question', 'quilting', 'quotient', |
111 | | - 'rabbitry', 'radiator', 'renegade', 'ricochet', 'riverbed', 'rosewood', 'rucksack', |
112 | | - 'sailfish', 'sandwich', 'sculptor', 'seashore', 'seedcake', 'skylight', 'stickpin', |
113 | | - 'tabletop', 'tailbone', 'teamwork', 'teaspoon', 'tinkerer', 'traverse', 'turbojet', |
114 | | - 'umbrella', 'underdog', 'undertow', 'unicycle', 'universe', 'uptowner', 'utensils', |
115 | | - 'vacation', 'vagabond', 'valkyrie', 'variable', 'villager', 'vineyard', 'vocalist', |
116 | | - 'waggoner', 'waxworks', 'waterbed', 'wayfarer', 'whitecap', 'windmill', 'woodshed', |
117 | | - 'yachting', 'yardbird', 'yardwork', 'yearbook', 'yearling', 'yeomanry', 'yodeling', |
118 | | - 'zaniness', 'zeppelin', 'ziggurat', 'zillions', 'zirconia', 'zoologer', 'zucchini', |
119 | | - ] |
120 | | - return "{}-{}".format( |
121 | | - random.choice(adjectives), random.choice(nouns)) |
| 67 | + random_string = lambda num: ''.join( |
| 68 | + [random.choice(string.ascii_lowercase) for i in range(num)]) |
| 69 | + return "{}-{}".format(random_string(6), random_string(8)) |
122 | 70 |
|
123 | 71 |
|
124 | 72 | def dict_diff(dict1, dict2): |
|
0 commit comments