setta 0.0.1.dev0__py3-none-any.whl → 0.0.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- setta/__init__.py +1 -1
- setta/cli/__init__.py +1 -0
- setta/cli/connect.py +43 -0
- setta/cli/logger.py +225 -0
- setta/code_gen/__init__.py +0 -0
- setta/code_gen/create_runnable_scripts.py +466 -0
- setta/code_gen/export_selected.py +776 -0
- setta/code_gen/find_placeholders.py +13 -0
- setta/code_gen/python/__init__.py +0 -0
- setta/code_gen/python/ast_utils.py +183 -0
- setta/code_gen/python/check_scope.py +187 -0
- setta/code_gen/python/generate_code.py +280 -0
- setta/code_gen/python/make_parseable.py +97 -0
- setta/code_gen/python/position_line_col.py +33 -0
- setta/code_gen/python/validate_imports.py +87 -0
- setta/code_gen/utils.py +120 -0
- setta/code_gen/yaml/__init__.py +0 -0
- setta/code_gen/yaml/generate_yaml.py +23 -0
- setta/code_gen/yaml/section_dict.py +93 -0
- setta/database/__init__.py +0 -0
- setta/database/backup.py +80 -0
- setta/database/db/__init__.py +0 -0
- setta/database/db/artifacts/__init__.py +0 -0
- setta/database/db/artifacts/load.py +93 -0
- setta/database/db/artifacts/save.py +85 -0
- setta/database/db/artifacts/save_or_create.py +68 -0
- setta/database/db/artifacts/utils.py +13 -0
- setta/database/db/codeInfo/__init__.py +0 -0
- setta/database/db/codeInfo/copy.py +26 -0
- setta/database/db/codeInfo/load.py +65 -0
- setta/database/db/codeInfo/save.py +75 -0
- setta/database/db/codeInfo/utils.py +33 -0
- setta/database/db/evRefs/__init__.py +0 -0
- setta/database/db/evRefs/load.py +45 -0
- setta/database/db/evRefs/save.py +95 -0
- setta/database/db/projects/__init__.py +0 -0
- setta/database/db/projects/copy.py +36 -0
- setta/database/db/projects/delete.py +7 -0
- setta/database/db/projects/load.py +184 -0
- setta/database/db/projects/save.py +267 -0
- setta/database/db/projects/saveAs.py +40 -0
- setta/database/db/projects/utils.py +135 -0
- setta/database/db/sectionVariants/__init__.py +0 -0
- setta/database/db/sectionVariants/copy.py +28 -0
- setta/database/db/sectionVariants/load.py +139 -0
- setta/database/db/sectionVariants/save.py +140 -0
- setta/database/db/sectionVariants/utils.py +44 -0
- setta/database/db/sections/__init__.py +0 -0
- setta/database/db/sections/copy.py +70 -0
- setta/database/db/sections/jsonSource.py +119 -0
- setta/database/db/sections/load.py +350 -0
- setta/database/db/sections/save.py +204 -0
- setta/database/db/sections/utils.py +13 -0
- setta/database/db/uiTypes/__init__.py +0 -0
- setta/database/db/uiTypes/copy.py +33 -0
- setta/database/db/uiTypes/load.py +51 -0
- setta/database/db/uiTypes/save.py +99 -0
- setta/database/db/uiTypes/utils.py +27 -0
- setta/database/db_init.py +36 -0
- setta/database/db_objs.py +102 -0
- setta/database/db_path.py +8 -0
- setta/database/export_db/__init__.py +0 -0
- setta/database/export_db/export_db.py +43 -0
- setta/database/export_db/export_raw.py +53 -0
- setta/database/export_db/export_readable.py +242 -0
- setta/database/export_db/utils.py +16 -0
- setta/database/import_db.py +28 -0
- setta/database/seed.py +41 -0
- setta/database/settings_file.py +118 -0
- setta/database/utils.py +32 -0
- setta/lsp/__init__.py +0 -0
- setta/lsp/file_watcher.py +113 -0
- setta/lsp/reader.py +184 -0
- setta/lsp/reader_fns/__init__.py +0 -0
- setta/lsp/reader_fns/completion.py +84 -0
- setta/lsp/reader_fns/definition.py +2 -0
- setta/lsp/reader_fns/diagnostics.py +99 -0
- setta/lsp/reader_fns/documentHighlight.py +25 -0
- setta/lsp/reader_fns/references.py +34 -0
- setta/lsp/reader_fns/signatureHelp.py +99 -0
- setta/lsp/server.py +150 -0
- setta/lsp/utils.py +60 -0
- setta/lsp/writer.py +306 -0
- setta/routers/__init__.py +11 -0
- setta/routers/artifact.py +105 -0
- setta/routers/code_info.py +32 -0
- setta/routers/dependencies.py +49 -0
- setta/routers/in_memory_fn_stdout_websocket.py +21 -0
- setta/routers/interactive.py +119 -0
- setta/routers/lsp.py +14 -0
- setta/routers/projects.py +188 -0
- setta/routers/reference_renaming.py +111 -0
- setta/routers/sections.py +174 -0
- setta/routers/settings.py +40 -0
- setta/routers/terminals.py +83 -0
- setta/routers/websocket.py +36 -0
- setta/server.py +141 -0
- setta/start.py +112 -0
- setta/static/constants/BaseUITypes.json +153 -0
- setta/static/constants/Settings.json +113 -0
- setta/static/constants/constants.json +117 -0
- setta/static/constants/db_init.sql +249 -0
- setta/static/constants/defaultValues.json +125 -0
- setta/static/constants/settingsProject.json +276 -0
- setta/static/frontend/android-chrome-192x192.png +0 -0
- setta/static/frontend/android-chrome-512x512.png +0 -0
- setta/static/frontend/apple-touch-icon.png +0 -0
- setta/static/frontend/assets/KaTeX_AMS-Regular-0cdd387c.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_AMS-Regular-30da91e8.woff +0 -0
- setta/static/frontend/assets/KaTeX_AMS-Regular-68534840.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Regular-3398dd02.woff +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Bold-74444efd.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Bold-9163df9c.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Regular-51814d27.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Fraktur-Regular-5e28753b.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Bold-0f60d1b8.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-Bold-138ac28d.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Main-Bold-c76c5d69.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Italic-0d85ae7c.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Main-Italic-97479ca6.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-Italic-f1d6ef86.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Regular-c2342cd8.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Main-Regular-c6368d87.woff +0 -0
- setta/static/frontend/assets/KaTeX_Main-Regular-d0332f52.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Math-BoldItalic-850c0af5.woff +0 -0
- setta/static/frontend/assets/KaTeX_Math-BoldItalic-dc47344d.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Math-Italic-08ce98e5.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Math-Italic-7af58c5e.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Math-Italic-8a8d2445.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Bold-e99ae511.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Bold-ece03cfd.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Italic-3931dd81.ttf +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Italic-91ee6750.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_SansSerif-Regular-f36ea897.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Script-Regular-036d4e95.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Script-Regular-1c67f068.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Script-Regular-d96cdf2b.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size1-Regular-6b47c401.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Size1-Regular-95b6d2f1.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Size1-Regular-c943cc98.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size2-Regular-2014c523.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size2-Regular-a6b2099f.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Size2-Regular-d04c5421.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Size3-Regular-500e04d5.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Size3-Regular-6ab6b62e.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size4-Regular-99f9c675.woff +0 -0
- setta/static/frontend/assets/KaTeX_Size4-Regular-a4af7d41.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Size4-Regular-c647367d.ttf +0 -0
- setta/static/frontend/assets/KaTeX_Typewriter-Regular-71d517d6.woff2 +0 -0
- setta/static/frontend/assets/KaTeX_Typewriter-Regular-e14fed02.woff +0 -0
- setta/static/frontend/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf +0 -0
- setta/static/frontend/assets/cormorant-garamond-all-700-italic-c9b58582.woff +0 -0
- setta/static/frontend/assets/cormorant-garamond-cyrillic-700-italic-9101ad5f.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-cyrillic-ext-700-italic-950de0d6.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-latin-700-italic-0bc53e12.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-latin-ext-700-italic-525738e0.woff2 +0 -0
- setta/static/frontend/assets/cormorant-garamond-vietnamese-700-italic-99563037.woff2 +0 -0
- setta/static/frontend/assets/erase-5e0448ea.svg +15 -0
- setta/static/frontend/assets/index-1d4b4ecf.css +32 -0
- setta/static/frontend/assets/index-ee99dc72.js +678 -0
- setta/static/frontend/assets/inter-all-400-normal-054f12d0.woff +0 -0
- setta/static/frontend/assets/inter-all-600-normal-c03769e5.woff +0 -0
- setta/static/frontend/assets/inter-all-800-normal-15dc6e4b.woff +0 -0
- setta/static/frontend/assets/inter-cyrillic-400-normal-a4eee61a.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-600-normal-8b14f703.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-800-normal-e706eaaa.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-ext-400-normal-70047a3b.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-ext-600-normal-d4ab9bc4.woff2 +0 -0
- setta/static/frontend/assets/inter-cyrillic-ext-800-normal-eae7515a.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-400-normal-381ea30d.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-600-normal-601f93a2.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-800-normal-7af4fb64.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-ext-400-normal-27027b17.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-ext-600-normal-f2ddf9de.woff2 +0 -0
- setta/static/frontend/assets/inter-greek-ext-800-normal-4cb6189e.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-400-normal-d56fec21.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-600-normal-ff769fa6.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-800-normal-5eea1309.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-ext-400-normal-bb698d85.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-ext-600-normal-ca4808f9.woff2 +0 -0
- setta/static/frontend/assets/inter-latin-ext-800-normal-ebdacc0f.woff2 +0 -0
- setta/static/frontend/assets/logo/logo.svg +8 -0
- setta/static/frontend/assets/pen-455d7d8a.svg +19 -0
- setta/static/frontend/assets/source-code-pro-all-500-normal-6bdaa03b.woff +0 -0
- setta/static/frontend/assets/source-code-pro-cyrillic-500-normal-288a0d68.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-cyrillic-ext-500-normal-b110a13b.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-greek-500-normal-04328acb.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-latin-500-normal-06edef1e.woff2 +0 -0
- setta/static/frontend/assets/source-code-pro-latin-ext-500-normal-6dc60d5e.woff2 +0 -0
- setta/static/frontend/assets/web-vitals-44a8e082.js +1 -0
- setta/static/frontend/assets/work-sans-all-400-normal-38034a3c.woff +0 -0
- setta/static/frontend/assets/work-sans-all-500-normal-550d64e5.woff +0 -0
- setta/static/frontend/assets/work-sans-all-600-normal-ccf14060.woff +0 -0
- setta/static/frontend/assets/work-sans-all-700-normal-494c2971.woff +0 -0
- setta/static/frontend/assets/work-sans-latin-400-normal-36735bc1.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-500-normal-3790bfda.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-600-normal-5fba494e.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-700-normal-a5033d0a.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-400-normal-c20f571a.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-500-normal-0f5ac96c.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-600-normal-97a237d1.woff2 +0 -0
- setta/static/frontend/assets/work-sans-latin-ext-700-normal-103e112c.woff2 +0 -0
- setta/static/frontend/browserconfig.xml +9 -0
- setta/static/frontend/favicon-16x16.png +0 -0
- setta/static/frontend/favicon-32x32.png +0 -0
- setta/static/frontend/favicon.ico +0 -0
- setta/static/frontend/index.html +30 -0
- setta/static/frontend/manifest.json +25 -0
- setta/static/frontend/mstile-144x144.png +0 -0
- setta/static/frontend/mstile-150x150.png +0 -0
- setta/static/frontend/mstile-310x150.png +0 -0
- setta/static/frontend/mstile-310x310.png +0 -0
- setta/static/frontend/mstile-70x70.png +0 -0
- setta/static/frontend/robots.txt +3 -0
- setta/static/frontend/safari-pinned-tab.svg +18 -0
- setta/static/frontend/site.webmanifest +19 -0
- setta/static/seed/.DS_Store +0 -0
- setta/static/seed/examples/.DS_Store +0 -0
- setta/tasks/__init__.py +0 -0
- setta/tasks/fns/__init__.py +9 -0
- setta/tasks/fns/codeAreaAutocomplete.py +209 -0
- setta/tasks/fns/codeAreaFindTemplateVars.py +128 -0
- setta/tasks/fns/codeAreaInitializeCode.py +98 -0
- setta/tasks/fns/findEVRefs.py +236 -0
- setta/tasks/fns/parametersRequest.py +71 -0
- setta/tasks/fns/textFieldAutocomplete.py +210 -0
- setta/tasks/fns/textFieldInitializeCode.py +99 -0
- setta/tasks/fns/typeCheck.py +40 -0
- setta/tasks/fns/utils.py +134 -0
- setta/tasks/task_runner.py +29 -0
- setta/tasks/tasks.py +152 -0
- setta/tasks/utils.py +178 -0
- setta/terminals/__init__.py +0 -0
- setta/terminals/terminals.py +242 -0
- setta/terminals/utils.py +37 -0
- setta/utils/__init__.py +0 -0
- setta/utils/constants.py +148 -0
- setta/utils/generate_memorable_string.py +431 -0
- setta/utils/generate_new_filename.py +80 -0
- setta/utils/section_contents.py +133 -0
- setta/utils/utils.py +271 -0
- setta/utils/websocket_manager.py +91 -0
- setta-0.0.2.dist-info/LICENSE +201 -0
- setta-0.0.2.dist-info/METADATA +24 -0
- setta-0.0.2.dist-info/RECORD +263 -0
- {setta-0.0.1.dev0.dist-info → setta-0.0.2.dist-info}/WHEEL +1 -1
- setta-0.0.2.dist-info/entry_points.txt +2 -0
- setta-0.0.1.dev0.dist-info/METADATA +0 -18
- setta-0.0.1.dev0.dist-info/RECORD +0 -5
- {setta-0.0.1.dev0.dist-info → setta-0.0.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,431 @@
|
|
1
|
+
import random
|
2
|
+
|
3
|
+
|
4
|
+
def generate_memorable_available_string(taken_strings):
|
5
|
+
name = None
|
6
|
+
while (not name) or name in taken_strings:
|
7
|
+
name = generate_memorable_string()
|
8
|
+
return name
|
9
|
+
|
10
|
+
|
11
|
+
def generate_memorable_string(num_words=2, separator="_"):
|
12
|
+
"""
|
13
|
+
Generate a random name by combining words from predefined lists.
|
14
|
+
|
15
|
+
Args:
|
16
|
+
num_words (int): Number of words to combine (default: 2)
|
17
|
+
separator (str): String to join words with (default: '_')
|
18
|
+
|
19
|
+
Returns:
|
20
|
+
str: Combined random words
|
21
|
+
"""
|
22
|
+
|
23
|
+
adjectives = [
|
24
|
+
"happy",
|
25
|
+
"clever",
|
26
|
+
"swift",
|
27
|
+
"brave",
|
28
|
+
"bright",
|
29
|
+
"calm",
|
30
|
+
"eager",
|
31
|
+
"fierce",
|
32
|
+
"gentle",
|
33
|
+
"kind",
|
34
|
+
"lively",
|
35
|
+
"proud",
|
36
|
+
"quiet",
|
37
|
+
"rapid",
|
38
|
+
"sharp",
|
39
|
+
"smart",
|
40
|
+
"strong",
|
41
|
+
"warm",
|
42
|
+
"wise",
|
43
|
+
"bold",
|
44
|
+
"crisp",
|
45
|
+
"deep",
|
46
|
+
"free",
|
47
|
+
"grand",
|
48
|
+
"high",
|
49
|
+
"keen",
|
50
|
+
"neat",
|
51
|
+
"rich",
|
52
|
+
"safe",
|
53
|
+
"true",
|
54
|
+
"young",
|
55
|
+
"dark",
|
56
|
+
"light",
|
57
|
+
"wild",
|
58
|
+
"soft",
|
59
|
+
"loud",
|
60
|
+
"quick",
|
61
|
+
"slow",
|
62
|
+
"tall",
|
63
|
+
"short",
|
64
|
+
"fresh",
|
65
|
+
"clean",
|
66
|
+
"cool",
|
67
|
+
"hot",
|
68
|
+
"fair",
|
69
|
+
"sweet",
|
70
|
+
"tough",
|
71
|
+
"pure",
|
72
|
+
"nice",
|
73
|
+
"raw",
|
74
|
+
"real",
|
75
|
+
"rare",
|
76
|
+
"fine",
|
77
|
+
"vast",
|
78
|
+
"mild",
|
79
|
+
"firm",
|
80
|
+
"fast",
|
81
|
+
"late",
|
82
|
+
"main",
|
83
|
+
"wide",
|
84
|
+
"deep",
|
85
|
+
"blue",
|
86
|
+
"red",
|
87
|
+
"green",
|
88
|
+
"gold",
|
89
|
+
"pink",
|
90
|
+
"gray",
|
91
|
+
"tiny",
|
92
|
+
"huge",
|
93
|
+
"broad",
|
94
|
+
"flat",
|
95
|
+
"thick",
|
96
|
+
"thin",
|
97
|
+
"white",
|
98
|
+
"black",
|
99
|
+
"round",
|
100
|
+
"dry",
|
101
|
+
"wet",
|
102
|
+
"full",
|
103
|
+
"empty",
|
104
|
+
"heavy",
|
105
|
+
"light",
|
106
|
+
"loose",
|
107
|
+
"tight",
|
108
|
+
"long",
|
109
|
+
"brief",
|
110
|
+
"clear",
|
111
|
+
"dark",
|
112
|
+
"busy",
|
113
|
+
"lazy",
|
114
|
+
"spare",
|
115
|
+
"prime",
|
116
|
+
"royal",
|
117
|
+
"plain",
|
118
|
+
"spare",
|
119
|
+
"crude",
|
120
|
+
"chief",
|
121
|
+
"swift",
|
122
|
+
"dim",
|
123
|
+
"dull",
|
124
|
+
"rough",
|
125
|
+
"smooth",
|
126
|
+
"still",
|
127
|
+
"small",
|
128
|
+
"great",
|
129
|
+
"quick",
|
130
|
+
"ready",
|
131
|
+
"right",
|
132
|
+
"rust",
|
133
|
+
"tame",
|
134
|
+
"vital",
|
135
|
+
"young",
|
136
|
+
"zinc",
|
137
|
+
"zesty",
|
138
|
+
]
|
139
|
+
|
140
|
+
nouns = [
|
141
|
+
"apple",
|
142
|
+
"bear",
|
143
|
+
"bird",
|
144
|
+
"cat",
|
145
|
+
"cloud",
|
146
|
+
"deer",
|
147
|
+
"dog",
|
148
|
+
"fish",
|
149
|
+
"fox",
|
150
|
+
"frog",
|
151
|
+
"hawk",
|
152
|
+
"lion",
|
153
|
+
"moon",
|
154
|
+
"owl",
|
155
|
+
"pine",
|
156
|
+
"rose",
|
157
|
+
"star",
|
158
|
+
"sun",
|
159
|
+
"tree",
|
160
|
+
"wolf",
|
161
|
+
"river",
|
162
|
+
"mountain",
|
163
|
+
"ocean",
|
164
|
+
"forest",
|
165
|
+
"desert",
|
166
|
+
"valley",
|
167
|
+
"meadow",
|
168
|
+
"garden",
|
169
|
+
"brook",
|
170
|
+
"lake",
|
171
|
+
"beach",
|
172
|
+
"cliff",
|
173
|
+
"coast",
|
174
|
+
"creek",
|
175
|
+
"field",
|
176
|
+
"flame",
|
177
|
+
"flood",
|
178
|
+
"frost",
|
179
|
+
"glade",
|
180
|
+
"grove",
|
181
|
+
"shore",
|
182
|
+
"spring",
|
183
|
+
"storm",
|
184
|
+
"stream",
|
185
|
+
"tide",
|
186
|
+
"trail",
|
187
|
+
"whale",
|
188
|
+
"wind",
|
189
|
+
"wood",
|
190
|
+
"world",
|
191
|
+
"amber",
|
192
|
+
"ash",
|
193
|
+
"balm",
|
194
|
+
"bark",
|
195
|
+
"bay",
|
196
|
+
"blade",
|
197
|
+
"bloom",
|
198
|
+
"branch",
|
199
|
+
"brass",
|
200
|
+
"bronze",
|
201
|
+
"cane",
|
202
|
+
"cedar",
|
203
|
+
"chalk",
|
204
|
+
"clay",
|
205
|
+
"cliff",
|
206
|
+
"coal",
|
207
|
+
"coast",
|
208
|
+
"coral",
|
209
|
+
"crown",
|
210
|
+
"crystal",
|
211
|
+
"dew",
|
212
|
+
"dove",
|
213
|
+
"drake",
|
214
|
+
"dune",
|
215
|
+
"dust",
|
216
|
+
"elm",
|
217
|
+
"fern",
|
218
|
+
"flake",
|
219
|
+
"flame",
|
220
|
+
"flock",
|
221
|
+
"foam",
|
222
|
+
"fog",
|
223
|
+
"frost",
|
224
|
+
"gale",
|
225
|
+
"gem",
|
226
|
+
"gill",
|
227
|
+
"glacier",
|
228
|
+
"grove",
|
229
|
+
"gull",
|
230
|
+
"harbor",
|
231
|
+
"hare",
|
232
|
+
"heath",
|
233
|
+
"hill",
|
234
|
+
"jazz",
|
235
|
+
"jewel",
|
236
|
+
"kale",
|
237
|
+
"kelp",
|
238
|
+
"kite",
|
239
|
+
"lark",
|
240
|
+
"leaf",
|
241
|
+
"lime",
|
242
|
+
"mane",
|
243
|
+
"marsh",
|
244
|
+
"mint",
|
245
|
+
"mist",
|
246
|
+
"moss",
|
247
|
+
"nest",
|
248
|
+
"night",
|
249
|
+
"north",
|
250
|
+
"oak",
|
251
|
+
"opal",
|
252
|
+
"otter",
|
253
|
+
"palm",
|
254
|
+
"peak",
|
255
|
+
"pear",
|
256
|
+
"pearl",
|
257
|
+
"petal",
|
258
|
+
"pike",
|
259
|
+
"pine",
|
260
|
+
"plant",
|
261
|
+
"plum",
|
262
|
+
"pond",
|
263
|
+
"pool",
|
264
|
+
"quail",
|
265
|
+
"queen",
|
266
|
+
"quill",
|
267
|
+
"rain",
|
268
|
+
"reef",
|
269
|
+
"rice",
|
270
|
+
"ridge",
|
271
|
+
"rock",
|
272
|
+
"root",
|
273
|
+
"rose",
|
274
|
+
"ruby",
|
275
|
+
"rush",
|
276
|
+
"sage",
|
277
|
+
"sail",
|
278
|
+
"salt",
|
279
|
+
"sand",
|
280
|
+
"seal",
|
281
|
+
"seed",
|
282
|
+
"shark",
|
283
|
+
"shell",
|
284
|
+
"shore",
|
285
|
+
"silk",
|
286
|
+
"slag",
|
287
|
+
"slate",
|
288
|
+
"sleet",
|
289
|
+
"slope",
|
290
|
+
"snow",
|
291
|
+
"south",
|
292
|
+
"spark",
|
293
|
+
"spine",
|
294
|
+
"spray",
|
295
|
+
"spring",
|
296
|
+
"sprout",
|
297
|
+
"squid",
|
298
|
+
"star",
|
299
|
+
"stone",
|
300
|
+
"storm",
|
301
|
+
"swan",
|
302
|
+
"swift",
|
303
|
+
"tank",
|
304
|
+
"tide",
|
305
|
+
"tiger",
|
306
|
+
"torch",
|
307
|
+
"trout",
|
308
|
+
"tulip",
|
309
|
+
"vapor",
|
310
|
+
"vine",
|
311
|
+
"voice",
|
312
|
+
"wave",
|
313
|
+
"weed",
|
314
|
+
"well",
|
315
|
+
"whale",
|
316
|
+
"wind",
|
317
|
+
"wing",
|
318
|
+
"winter",
|
319
|
+
"wolf",
|
320
|
+
"womb",
|
321
|
+
"wood",
|
322
|
+
"wren",
|
323
|
+
"yarn",
|
324
|
+
"yeast",
|
325
|
+
"zebra",
|
326
|
+
]
|
327
|
+
|
328
|
+
verbs = [
|
329
|
+
"running",
|
330
|
+
"jumping",
|
331
|
+
"flying",
|
332
|
+
"dancing",
|
333
|
+
"singing",
|
334
|
+
"laughing",
|
335
|
+
"sleeping",
|
336
|
+
"dreaming",
|
337
|
+
"playing",
|
338
|
+
"swimming",
|
339
|
+
"climbing",
|
340
|
+
"diving",
|
341
|
+
"gliding",
|
342
|
+
"hopping",
|
343
|
+
"leaping",
|
344
|
+
"racing",
|
345
|
+
"skating",
|
346
|
+
"sliding",
|
347
|
+
"walking",
|
348
|
+
"wandering",
|
349
|
+
"acting",
|
350
|
+
"baking",
|
351
|
+
"being",
|
352
|
+
"brewing",
|
353
|
+
"buying",
|
354
|
+
"calling",
|
355
|
+
"caring",
|
356
|
+
"catching",
|
357
|
+
"chasing",
|
358
|
+
"coding",
|
359
|
+
"cooking",
|
360
|
+
"dealing",
|
361
|
+
"doing",
|
362
|
+
"drawing",
|
363
|
+
"driving",
|
364
|
+
"eating",
|
365
|
+
"falling",
|
366
|
+
"feeling",
|
367
|
+
"finding",
|
368
|
+
"flowing",
|
369
|
+
"giving",
|
370
|
+
"glowing",
|
371
|
+
"going",
|
372
|
+
"growing",
|
373
|
+
"having",
|
374
|
+
"hearing",
|
375
|
+
"hiding",
|
376
|
+
"hitting",
|
377
|
+
"holding",
|
378
|
+
"keeping",
|
379
|
+
"knowing",
|
380
|
+
"leading",
|
381
|
+
"leaving",
|
382
|
+
"making",
|
383
|
+
"moving",
|
384
|
+
"painting",
|
385
|
+
"playing",
|
386
|
+
"reading",
|
387
|
+
"riding",
|
388
|
+
"rising",
|
389
|
+
"saying",
|
390
|
+
"seeing",
|
391
|
+
"selling",
|
392
|
+
"sending",
|
393
|
+
"setting",
|
394
|
+
"shining",
|
395
|
+
"showing",
|
396
|
+
"singing",
|
397
|
+
"sitting",
|
398
|
+
"speaking",
|
399
|
+
"spending",
|
400
|
+
"standing",
|
401
|
+
"staying",
|
402
|
+
"taking",
|
403
|
+
"talking",
|
404
|
+
"teaching",
|
405
|
+
"telling",
|
406
|
+
"thinking",
|
407
|
+
"turning",
|
408
|
+
"using",
|
409
|
+
"waiting",
|
410
|
+
"watching",
|
411
|
+
"winning",
|
412
|
+
"working",
|
413
|
+
"writing",
|
414
|
+
"zooming",
|
415
|
+
]
|
416
|
+
|
417
|
+
# Create a list of all word lists to choose from
|
418
|
+
word_lists = [adjectives, nouns, verbs]
|
419
|
+
|
420
|
+
# Select random words from different categories
|
421
|
+
selected_words = []
|
422
|
+
while len(selected_words) < num_words:
|
423
|
+
# Get a random word list
|
424
|
+
word_list = random.choice(word_lists)
|
425
|
+
# Get a random word from that list
|
426
|
+
word = random.choice(word_list)
|
427
|
+
# Only add if we haven't used this word yet
|
428
|
+
if word not in selected_words:
|
429
|
+
selected_words.append(word)
|
430
|
+
|
431
|
+
return separator.join(selected_words)
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import glob
|
2
|
+
import os
|
3
|
+
import random
|
4
|
+
import re
|
5
|
+
import string
|
6
|
+
|
7
|
+
from setta.utils.generate_memorable_string import generate_memorable_string
|
8
|
+
|
9
|
+
|
10
|
+
def generate_new_filename(input_pattern: str) -> str:
|
11
|
+
"""
|
12
|
+
Generate a new filename based on the input pattern, adding a random memorable suffix.
|
13
|
+
Supports complex glob patterns including nested directories and multiple wildcards.
|
14
|
+
Replaces pattern characters with random valid values:
|
15
|
+
- [0-9] is replaced with a random digit
|
16
|
+
- [a-z] is replaced with a random lowercase letter
|
17
|
+
- ? is replaced with a random letter
|
18
|
+
|
19
|
+
Args:
|
20
|
+
input_pattern: Input filename or glob pattern (e.g., "file.json", "*file*.json",
|
21
|
+
"dir/*/*.json", "report_??_*.json", "data[0-9].json")
|
22
|
+
|
23
|
+
Returns:
|
24
|
+
New filepath (as string) with a unique memorable suffix. For glob patterns with no matches,
|
25
|
+
generates a sensible filename following the pattern's structure.
|
26
|
+
"""
|
27
|
+
# Split into directory and filename parts
|
28
|
+
directory = os.path.dirname(input_pattern)
|
29
|
+
filename = os.path.basename(input_pattern)
|
30
|
+
|
31
|
+
# If there are matching files, use the first match as template without any cleaning
|
32
|
+
matching_files = glob.glob(input_pattern)
|
33
|
+
if matching_files:
|
34
|
+
template_name = sorted(matching_files, key=len)[0]
|
35
|
+
directory = os.path.dirname(template_name)
|
36
|
+
filename = os.path.basename(template_name)
|
37
|
+
base_path, extension = os.path.splitext(filename)
|
38
|
+
else:
|
39
|
+
# Only clean the pattern if no existing files match
|
40
|
+
base_path, extension = os.path.splitext(filename)
|
41
|
+
|
42
|
+
# Clean the base path of glob patterns
|
43
|
+
cleaned_base = base_path
|
44
|
+
|
45
|
+
# Helper function to replace each match with a random choice
|
46
|
+
def random_replacement(pattern, choices):
|
47
|
+
def replace_func(match):
|
48
|
+
return random.choice(choices)
|
49
|
+
|
50
|
+
return re.sub(pattern, replace_func, cleaned_base)
|
51
|
+
|
52
|
+
# Replace [0-9] with random digit
|
53
|
+
cleaned_base = random_replacement(r"\[\d+\-\d+\]", string.digits)
|
54
|
+
|
55
|
+
# Replace [a-z] with random lowercase letter
|
56
|
+
cleaned_base = random_replacement(r"\[a-z\]", string.ascii_lowercase)
|
57
|
+
|
58
|
+
# Replace ? with random letter (upper or lowercase)
|
59
|
+
cleaned_base = random_replacement(r"\?", string.ascii_letters)
|
60
|
+
|
61
|
+
# Remove * wildcards entirely since they represent variable length matches
|
62
|
+
cleaned_base = re.sub(r"\*+", "", cleaned_base)
|
63
|
+
|
64
|
+
# If we've cleaned away everything, use a default name
|
65
|
+
if not cleaned_base or cleaned_base.isspace():
|
66
|
+
cleaned_base = "file"
|
67
|
+
|
68
|
+
base_path = cleaned_base
|
69
|
+
|
70
|
+
# Keep trying new suffixes until we find a filename that doesn't exist
|
71
|
+
while True:
|
72
|
+
suffix = generate_memorable_string()
|
73
|
+
new_filename = f"{base_path}_{suffix}{extension}"
|
74
|
+
|
75
|
+
# Reconstruct full path if there was a directory
|
76
|
+
if directory:
|
77
|
+
new_filename = os.path.join(directory, new_filename)
|
78
|
+
|
79
|
+
if not os.path.exists(new_filename):
|
80
|
+
return new_filename
|
@@ -0,0 +1,133 @@
|
|
1
|
+
from setta.utils.constants import C
|
2
|
+
|
3
|
+
# js->python conversion done by claude
|
4
|
+
|
5
|
+
|
6
|
+
def _findAllDescendants(
|
7
|
+
allCodeInfo,
|
8
|
+
codeInfoChildren,
|
9
|
+
codeInfoIds,
|
10
|
+
outputCondition,
|
11
|
+
stackCondition,
|
12
|
+
paramPathCondition=None, # None or a function
|
13
|
+
earlyReturnCondition=None, # None or a function
|
14
|
+
):
|
15
|
+
output = []
|
16
|
+
idStack = list(reversed([x for x in codeInfoIds if stackCondition(allCodeInfo[x])]))
|
17
|
+
visited = set()
|
18
|
+
pathMap = {} if paramPathCondition else None
|
19
|
+
|
20
|
+
if paramPathCondition:
|
21
|
+
for id in idStack:
|
22
|
+
pathMap[id] = [id] if paramPathCondition(allCodeInfo[id]) else []
|
23
|
+
|
24
|
+
while len(idStack) > 0:
|
25
|
+
id = idStack.pop()
|
26
|
+
if not id or id in visited:
|
27
|
+
continue
|
28
|
+
visited.add(id)
|
29
|
+
currInfo = allCodeInfo[id]
|
30
|
+
|
31
|
+
if outputCondition(currInfo):
|
32
|
+
output.append(currInfo["id"])
|
33
|
+
|
34
|
+
if stackCondition(currInfo):
|
35
|
+
children = list(reversed(codeInfoChildren[currInfo["id"]]))
|
36
|
+
if paramPathCondition:
|
37
|
+
currentPath = pathMap[id]
|
38
|
+
for childId in children:
|
39
|
+
pathMap[childId] = (
|
40
|
+
[*currentPath, childId]
|
41
|
+
if paramPathCondition(allCodeInfo[childId])
|
42
|
+
else [*currentPath]
|
43
|
+
)
|
44
|
+
idStack.extend(children)
|
45
|
+
|
46
|
+
if (
|
47
|
+
len(output) > 0
|
48
|
+
and earlyReturnCondition
|
49
|
+
and earlyReturnCondition(allCodeInfo[output[-1]])
|
50
|
+
):
|
51
|
+
return {"ids": output, "pathMap": pathMap, "earlyReturnTriggered": True}
|
52
|
+
|
53
|
+
return {"ids": output, "pathMap": pathMap, "earlyReturnTriggered": False}
|
54
|
+
|
55
|
+
|
56
|
+
def findAllParameters(
|
57
|
+
allCodeInfo,
|
58
|
+
codeInfoChildren,
|
59
|
+
startingId,
|
60
|
+
additionalOutputCondition=None,
|
61
|
+
paramPathCondition=None,
|
62
|
+
earlyReturnCondition=None,
|
63
|
+
):
|
64
|
+
codeInfoIds = [startingId] if startingId else codeInfoChildren.get(startingId, None)
|
65
|
+
|
66
|
+
# if startingId is None, then we're starting at the root
|
67
|
+
# so we don't want to avoid the parameters of callables
|
68
|
+
def stackCondition(c):
|
69
|
+
return True if startingId else c.get("rcType") == C.PARAMETER
|
70
|
+
|
71
|
+
return _findAllDescendants(
|
72
|
+
allCodeInfo,
|
73
|
+
codeInfoChildren,
|
74
|
+
codeInfoIds or [],
|
75
|
+
lambda c: c.get("rcType") == C.PARAMETER
|
76
|
+
and (not additionalOutputCondition or additionalOutputCondition(c)),
|
77
|
+
stackCondition,
|
78
|
+
paramPathCondition,
|
79
|
+
earlyReturnCondition,
|
80
|
+
)
|
81
|
+
|
82
|
+
|
83
|
+
def findAllParametersAndPathMaps(**kwargs):
|
84
|
+
return findAllParameters(
|
85
|
+
**kwargs, paramPathCondition=lambda p: p.get("rcType") == C.PARAMETER
|
86
|
+
)
|
87
|
+
|
88
|
+
|
89
|
+
def getParamIdsToShowInArea(
|
90
|
+
isPinned,
|
91
|
+
codeInfo,
|
92
|
+
codeInfoChildren,
|
93
|
+
parentCodeInfoId,
|
94
|
+
):
|
95
|
+
result = findAllParametersAndPathMaps(
|
96
|
+
allCodeInfo=codeInfo,
|
97
|
+
codeInfoChildren=codeInfoChildren,
|
98
|
+
startingId=parentCodeInfoId,
|
99
|
+
)
|
100
|
+
ids = result["ids"]
|
101
|
+
pathMap = result["pathMap"]
|
102
|
+
ids.reverse()
|
103
|
+
|
104
|
+
topLevelParamIds = []
|
105
|
+
topLevelParamIdsSet = set()
|
106
|
+
requiredParamIdsToPaths = {}
|
107
|
+
|
108
|
+
for a in ids:
|
109
|
+
# Evaluates to true if:
|
110
|
+
# 1. The current param's isPinned matches the isPinned condition
|
111
|
+
# 2. And: either the param has no children or at least one of its children is required
|
112
|
+
# This logic is why it's REQUIRED for ids to be reversed (processed starting with children up to ancestors)
|
113
|
+
if bothTruthyOrFalsey(codeInfo[a].get("isPinned"), isPinned) and (
|
114
|
+
len(codeInfoChildren[a]) == 0
|
115
|
+
or any(child in requiredParamIdsToPaths for child in codeInfoChildren[a])
|
116
|
+
):
|
117
|
+
for p in pathMap[a]:
|
118
|
+
requiredParamIdsToPaths[p] = pathMap[p]
|
119
|
+
if pathMap[a][0] not in topLevelParamIdsSet:
|
120
|
+
topLevelParamIds.append(pathMap[a][0])
|
121
|
+
topLevelParamIdsSet.add(pathMap[a][0])
|
122
|
+
|
123
|
+
# unreverse results
|
124
|
+
topLevelParamIds.reverse()
|
125
|
+
|
126
|
+
return {
|
127
|
+
"requiredParamIdsToPaths": requiredParamIdsToPaths,
|
128
|
+
"topLevelParamIds": topLevelParamIds,
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
def bothTruthyOrFalsey(a, b):
|
133
|
+
return (not a) == (not b) or a == b
|