jaseci 1.4.2.6__py3-none-any.whl → 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jaseci might be problematic. Click here for more details.

Files changed (187) hide show
  1. jaseci/__init__.py +3 -37
  2. jaseci-2.0.0.dist-info/METADATA +65 -0
  3. jaseci-2.0.0.dist-info/RECORD +4 -0
  4. {jaseci-1.4.2.6.dist-info → jaseci-2.0.0.dist-info}/WHEEL +1 -2
  5. jaseci/VERSION +0 -1
  6. jaseci/cli_tools/__init__.py +0 -0
  7. jaseci/cli_tools/book_tools.py +0 -457
  8. jaseci/cli_tools/jsctl.py +0 -500
  9. jaseci/cli_tools/tests/__init__.py +0 -0
  10. jaseci/cli_tools/tests/test_jsctl.py +0 -556
  11. jaseci/extens/__init__.py +0 -0
  12. jaseci/extens/act_lib/__init__.py +0 -0
  13. jaseci/extens/act_lib/date.py +0 -118
  14. jaseci/extens/act_lib/elastic.py +0 -87
  15. jaseci/extens/act_lib/file.py +0 -77
  16. jaseci/extens/act_lib/file_handler.py +0 -190
  17. jaseci/extens/act_lib/internal.py +0 -19
  18. jaseci/extens/act_lib/jaseci.py +0 -62
  19. jaseci/extens/act_lib/mail.py +0 -10
  20. jaseci/extens/act_lib/maths.py +0 -168
  21. jaseci/extens/act_lib/net.py +0 -192
  22. jaseci/extens/act_lib/rand.py +0 -83
  23. jaseci/extens/act_lib/regex.py +0 -85
  24. jaseci/extens/act_lib/request.py +0 -170
  25. jaseci/extens/act_lib/std.py +0 -236
  26. jaseci/extens/act_lib/storage.py +0 -53
  27. jaseci/extens/act_lib/stripe.py +0 -338
  28. jaseci/extens/act_lib/task.py +0 -14
  29. jaseci/extens/act_lib/tests/__init__.py +0 -0
  30. jaseci/extens/act_lib/tests/std_test_code.py +0 -37
  31. jaseci/extens/act_lib/tests/test_date.py +0 -26
  32. jaseci/extens/act_lib/tests/test_elastic.py +0 -159
  33. jaseci/extens/act_lib/tests/test_file.py +0 -116
  34. jaseci/extens/act_lib/tests/test_file_lib.py +0 -40
  35. jaseci/extens/act_lib/tests/test_mail_lib.py +0 -33
  36. jaseci/extens/act_lib/tests/test_maths.py +0 -147
  37. jaseci/extens/act_lib/tests/test_net_lib.py +0 -62
  38. jaseci/extens/act_lib/tests/test_regex.py +0 -61
  39. jaseci/extens/act_lib/tests/test_std.py +0 -51
  40. jaseci/extens/act_lib/tests/test_std_lib.py +0 -36
  41. jaseci/extens/act_lib/tests/test_url.py +0 -32
  42. jaseci/extens/act_lib/tests/test_vector.py +0 -36
  43. jaseci/extens/act_lib/tests/test_webtool.py +0 -44
  44. jaseci/extens/act_lib/tests/test_zlib.py +0 -24
  45. jaseci/extens/act_lib/url.py +0 -80
  46. jaseci/extens/act_lib/vector.py +0 -158
  47. jaseci/extens/act_lib/webtool.py +0 -29
  48. jaseci/extens/act_lib/zip.py +0 -34
  49. jaseci/extens/api/__init__.py +0 -0
  50. jaseci/extens/api/actions_api.py +0 -171
  51. jaseci/extens/api/alias_api.py +0 -140
  52. jaseci/extens/api/architype_api.py +0 -197
  53. jaseci/extens/api/config_api.py +0 -129
  54. jaseci/extens/api/global_api.py +0 -85
  55. jaseci/extens/api/graph_api.py +0 -168
  56. jaseci/extens/api/health_api.py +0 -21
  57. jaseci/extens/api/interface.py +0 -269
  58. jaseci/extens/api/jac_api.py +0 -172
  59. jaseci/extens/api/jsorc_api.py +0 -317
  60. jaseci/extens/api/logger_api.py +0 -90
  61. jaseci/extens/api/master_api.py +0 -134
  62. jaseci/extens/api/object_api.py +0 -102
  63. jaseci/extens/api/prometheus_api.py +0 -75
  64. jaseci/extens/api/queue_api.py +0 -141
  65. jaseci/extens/api/sentinel_api.py +0 -271
  66. jaseci/extens/api/share_api.py +0 -64
  67. jaseci/extens/api/super_api.py +0 -65
  68. jaseci/extens/api/tests/__init__.py +0 -0
  69. jaseci/extens/api/tests/test_architype_api.py +0 -66
  70. jaseci/extens/api/tests/test_global_api.py +0 -179
  71. jaseci/extens/api/tests/test_graph_api.py +0 -64
  72. jaseci/extens/api/tests/test_logger_api.py +0 -43
  73. jaseci/extens/api/tests/test_object_api.py +0 -20
  74. jaseci/extens/api/tests/test_sentinel_api.py +0 -66
  75. jaseci/extens/api/tests/test_uncommon.py +0 -107
  76. jaseci/extens/api/tests/test_user_api.py +0 -32
  77. jaseci/extens/api/tests/test_walker_api.py +0 -316
  78. jaseci/extens/api/user_api.py +0 -166
  79. jaseci/extens/api/walker_api.py +0 -299
  80. jaseci/extens/api/webhook_api.py +0 -77
  81. jaseci/extens/svc/__init__.py +0 -0
  82. jaseci/extens/svc/elastic_svc.py +0 -366
  83. jaseci/extens/svc/kube_svc.py +0 -432
  84. jaseci/extens/svc/mail_svc.py +0 -156
  85. jaseci/extens/svc/prome_svc.py +0 -378
  86. jaseci/extens/svc/redis_svc.py +0 -63
  87. jaseci/extens/svc/storage_svc.py +0 -193
  88. jaseci/extens/svc/stripe_svc.py +0 -51
  89. jaseci/extens/svc/task_svc.py +0 -155
  90. jaseci/extens/svc/tasks.py +0 -302
  91. jaseci/jac/__init__.py +0 -0
  92. jaseci/jac/interpreter/__init__.py +0 -0
  93. jaseci/jac/interpreter/architype_interp.py +0 -219
  94. jaseci/jac/interpreter/interp.py +0 -1784
  95. jaseci/jac/interpreter/sentinel_interp.py +0 -260
  96. jaseci/jac/interpreter/tests/__init__.py +0 -0
  97. jaseci/jac/interpreter/tests/test_interp.py +0 -42
  98. jaseci/jac/interpreter/walker_interp.py +0 -249
  99. jaseci/jac/ir/__init__.py +0 -0
  100. jaseci/jac/ir/ast.py +0 -73
  101. jaseci/jac/ir/ast_builder.py +0 -249
  102. jaseci/jac/ir/jac_code.py +0 -151
  103. jaseci/jac/ir/passes/__init__.py +0 -6
  104. jaseci/jac/ir/passes/ast_prune_pass.py +0 -9
  105. jaseci/jac/ir/passes/codegen_pass.py +0 -244
  106. jaseci/jac/ir/passes/ir_pass.py +0 -29
  107. jaseci/jac/ir/passes/printer_pass.py +0 -23
  108. jaseci/jac/ir/passes/pt_prune_pass.py +0 -29
  109. jaseci/jac/ir/passes/schedule.py +0 -23
  110. jaseci/jac/ir/passes/stats_pass.py +0 -16
  111. jaseci/jac/jac.g4 +0 -450
  112. jaseci/jac/jac_parse/__init__.py +0 -0
  113. jaseci/jac/jac_parse/jacLexer.py +0 -809
  114. jaseci/jac/jac_parse/jacListener.py +0 -853
  115. jaseci/jac/jac_parse/jacParser.py +0 -9192
  116. jaseci/jac/jac_set.py +0 -120
  117. jaseci/jac/jsci_vm/__init__.py +0 -0
  118. jaseci/jac/jsci_vm/disasm.py +0 -94
  119. jaseci/jac/jsci_vm/inst_ptr.py +0 -31
  120. jaseci/jac/jsci_vm/machine.py +0 -188
  121. jaseci/jac/jsci_vm/op_codes.py +0 -82
  122. jaseci/jac/jsci_vm/tests/__init__.py +0 -0
  123. jaseci/jac/jsci_vm/tests/test_codegen.py +0 -31
  124. jaseci/jac/machine/__init__.py +0 -0
  125. jaseci/jac/machine/jac_scope.py +0 -86
  126. jaseci/jac/machine/jac_value.py +0 -227
  127. jaseci/jac/machine/machine_state.py +0 -386
  128. jaseci/jac/tests/__init__.py +0 -0
  129. jaseci/jac/tests/book_code.py +0 -624
  130. jaseci/jac/tests/test_book.py +0 -380
  131. jaseci/jac/tests/test_lang_14.py +0 -49
  132. jaseci/jsorc/__init__.py +0 -7
  133. jaseci/jsorc/jsorc.py +0 -642
  134. jaseci/jsorc/jsorc_settings.py +0 -211
  135. jaseci/jsorc/jsorc_utils.py +0 -298
  136. jaseci/jsorc/live_actions.py +0 -365
  137. jaseci/jsorc/manifests/__init__.py +0 -0
  138. jaseci/jsorc/manifests/database.yaml +0 -109
  139. jaseci/jsorc/manifests/elastic.yaml +0 -6029
  140. jaseci/jsorc/manifests/prometheus.yaml +0 -1383
  141. jaseci/jsorc/manifests/redis.yaml +0 -64
  142. jaseci/jsorc/memory.py +0 -258
  143. jaseci/jsorc/redis.py +0 -140
  144. jaseci/jsorc/remote_actions.py +0 -158
  145. jaseci/jsorc/tests/__init__.py +0 -0
  146. jaseci/jsorc/tests/test_actions.py +0 -542
  147. jaseci/jsorc/tests/test_jsorc.py +0 -112
  148. jaseci/prim/__init__.py +0 -0
  149. jaseci/prim/ability.py +0 -94
  150. jaseci/prim/architype.py +0 -90
  151. jaseci/prim/edge.py +0 -173
  152. jaseci/prim/element.py +0 -233
  153. jaseci/prim/graph.py +0 -27
  154. jaseci/prim/master.py +0 -67
  155. jaseci/prim/node.py +0 -533
  156. jaseci/prim/obj_mixins.py +0 -238
  157. jaseci/prim/sentinel.py +0 -282
  158. jaseci/prim/super_master.py +0 -31
  159. jaseci/prim/walker.py +0 -261
  160. jaseci/svc/__init__.py +0 -0
  161. jaseci/tests/__init__.py +0 -0
  162. jaseci/tests/infer.py +0 -39
  163. jaseci/tests/jac_test_code.py +0 -1293
  164. jaseci/tests/jac_test_progs.py +0 -774
  165. jaseci/tests/test_core.py +0 -153
  166. jaseci/tests/test_jac.py +0 -824
  167. jaseci/tests/test_node.py +0 -89
  168. jaseci/tests/test_progs.py +0 -702
  169. jaseci/tests/test_stack.py +0 -220
  170. jaseci/tests/test_stripe.py +0 -225
  171. jaseci/utils/__init__.py +0 -0
  172. jaseci/utils/actions/__init__.py +0 -0
  173. jaseci/utils/actions/actions_manager.py +0 -254
  174. jaseci/utils/actions/actions_optimizer.py +0 -517
  175. jaseci/utils/actions/actions_state.py +0 -95
  176. jaseci/utils/file_handler.py +0 -171
  177. jaseci/utils/gprof2dot.py +0 -3786
  178. jaseci/utils/id_list.py +0 -169
  179. jaseci/utils/json_handler.py +0 -70
  180. jaseci/utils/log_utils.py +0 -57
  181. jaseci/utils/test_core.py +0 -62
  182. jaseci/utils/utils.py +0 -387
  183. jaseci-1.4.2.6.dist-info/LICENSE +0 -21
  184. jaseci-1.4.2.6.dist-info/METADATA +0 -39
  185. jaseci-1.4.2.6.dist-info/RECORD +0 -185
  186. jaseci-1.4.2.6.dist-info/entry_points.txt +0 -3
  187. jaseci-1.4.2.6.dist-info/top_level.txt +0 -1
@@ -1,1293 +0,0 @@
1
- prog0 = """
2
- node testnode {
3
- has a, b, c;
4
- can std.log::a,b::>c with exit;
5
- }
6
-
7
- walker testwalk {
8
- testnode {
9
- here.a = 43;
10
- here.b = 'Yeah \\n"fools"!';
11
- report here.b;
12
- if(4 > 6) { std.log("a"); }
13
- elif(5>6) { std.log("b"); }
14
- elif(6>6) { std.log("c"); }
15
- elif(7>6) { std.log(576); }
16
- }
17
- }
18
-
19
- node life {
20
- }
21
-
22
- node year {
23
- has anchor year;
24
-
25
- }
26
-
27
- walker another {
28
- life {
29
- here.a = 43;
30
- here.b = 'Yeah \\n"fools"!';
31
- report here.b;
32
- if("4 > 6" == "4 > 6") { std.log("a"); }
33
- }
34
- }
35
- """
36
-
37
- prog1 = """
38
- node testnode {
39
- has a, b, c;
40
- can std.log::a,b::>c with exit;
41
- }
42
-
43
- walker testwalk {
44
- testnode {
45
- here.a = 43;
46
- here.b = 'Yeah \\n"fools"!';
47
- report here.b;
48
- if(4 > 6) { std.log("a"); }
49
- elif(5>6) { std.log("b"); }
50
- elif(6>6) { std.log("c"); }
51
- elif(7>6) { std.log(576); }
52
- }
53
- }
54
-
55
- node life {
56
- }
57
-
58
- node year {
59
- has anchor year;
60
-
61
- }
62
-
63
- node month {
64
- has anchor month;
65
- }
66
-
67
- node week {
68
- has anchor week;
69
- }
70
-
71
- node day {
72
- has anchor day;
73
- }
74
-
75
- node workette {
76
- has date, owner, status, snooze_till;
77
- has note, is_MIT, is_ritual;
78
- }
79
-
80
- walker use_test {
81
- can use.enc_question, use.enc_answer, use.qa_score;
82
- has output;
83
- q = use.enc_question(["How old are you?",
84
- "which animal is the best?"]);
85
- std.log(q);
86
- a = use.enc_answer(["I'm 40 years old.", "Elephants rule."]);
87
- std.log(a);
88
- output = use.qa_score(q, a);
89
- report output;
90
- }
91
-
92
- walker use_test_with_ctx {
93
- can use.enc_question, use.enc_answer, use.qa_score, use.dist_score;
94
- has output;
95
- q = use.enc_question("Who are you?");
96
- a = use.enc_answer("I am jason");
97
- output = use.qa_score(q, a);
98
- report output;
99
- a = use.enc_answer("You are jon");
100
- output = use.qa_score(q, a);
101
- report output;
102
- a = use.enc_answer("Who are you? You are jon");
103
- output = use.qa_score(q, a);
104
- report output;
105
- a = use.enc_answer("Who are you? You are jon");
106
- output = use.qa_score(q, a);
107
- report output;
108
- q1 = use.enc_question("Who are you?");
109
- q2 = use.enc_question("Who you be?");
110
- q3 = use.enc_question("Who I be?");
111
- output = use.dist_score(q1, q2);
112
- report output;
113
- output = use.dist_score(q1, q3);
114
- report output;
115
- output = use.qa_score(q2, use.enc_answer("Who are you? You are jon"));
116
- report output;
117
- output = use.qa_score(q3, use.enc_answer("Who are you? You are jon"));
118
- report output;
119
- output = use.qa_score(q2, use.enc_answer("I am jason"));
120
- report output;
121
- output = use.qa_score(q3, use.enc_answer("I am jason"));
122
- report output;
123
- }
124
-
125
- walker use_test_with_ctx2 {
126
- can use.enc_question, use.enc_answer, use.qa_score, use.dist_score;
127
-
128
- q1 = use.enc_question("Who are you?");
129
- q2 = use.enc_question("Who you be?");
130
- q3 = use.enc_question("Who I be?");
131
- report use.dist_score(q1, q2);
132
- report use.dist_score(q1, q3);
133
- report use.qa_score(q2, use.enc_answer("Who are you? You are jon"));
134
- report use.qa_score(q3, use.enc_answer("Who are you? You are jon"));
135
- report use.qa_score(q2, use.enc_answer("I am jason"));
136
- report use.qa_score(q3, use.enc_answer("I am jason"));
137
- report use.qa_score(q3, use.enc_answer("I am jason","Who I be?"));
138
- report use.qa_score(q3, use.enc_answer("I am jason Who I be?"));
139
- }
140
-
141
- walker use_test_single {
142
- can use.enc_question, use.enc_answer, use.qa_score;
143
- has output;
144
- q = use.enc_question("Who's your daddy?");
145
- a = use.enc_answer("I'm your father.");
146
- output = use.qa_score(q, a);
147
- report output;
148
- }
149
-
150
- walker get_day {
151
- has date;
152
- life: take infer.year_from_date(date);
153
- year: take infer.month_from_date(date);
154
- month: take infer.week_from_date(date);
155
- week: take infer.day_from_date(date);
156
- day: report --> ;
157
- }
158
-
159
- walker get_gen_day {
160
- has date;
161
- can infer.year_from_date;
162
- can infer.month_from_date;
163
- can infer.week_from_date;
164
- can infer.day_from_date;
165
- life: take --> node::year == infer.year_from_date(date) else {
166
- new = spawn here ++> node::year;
167
- new.year = infer.year_from_date(date);
168
- take --> node::year == infer.year_from_date(date);
169
- }
170
- year: take --> node::month == infer.month_from_date(date) else {
171
- new = spawn here ++> node::month;
172
- new.month = infer.month_from_date(date);
173
- take --> node::month == infer.month_from_date(date);
174
- }
175
- month: take --> node::week == infer.week_from_date(date) else {
176
- new = spawn here ++> node::week;
177
- new.week = infer.week_from_date(date);
178
- take --> node::week == infer.week_from_date(date);
179
- }
180
- week: take --> node::day == infer.day_from_date(date) else {
181
- new = spawn here ++> node::day;
182
- new.day = infer.day_from_date(date);
183
- take --> node::day == infer.day_from_date(date);
184
- }
185
- day: report --> ;
186
- }
187
-
188
- walker get_sub_workettes {
189
- workette: report --> node::workette;
190
- }
191
-
192
- walker get_latest_day {
193
- life: take year.max_outbound;
194
- year: take month.max_outbound;
195
- month: take week.max_outbound;
196
- week: report day.max_outbound;
197
- }
198
-
199
- walker carry_forward {
200
- has my_root;
201
- day {
202
- new_day = spawn here ++> node::day;
203
- my_root = new_day;
204
- take day.outbound_nodes;
205
- }
206
- workette {
207
- if(workette.status == 'done' or
208
- workette.status == 'eliminated') {
209
- continue;
210
- }
211
- childern = workette.outbound_nodes;
212
- new_workette = spawn here ++> node::workette;
213
- parent = me.spawn_history.last(-1);
214
- new_workette <++ parent;
215
- take --> node::workette;
216
- }
217
- report me.spawn_history;
218
- report new_day;
219
- }
220
- """
221
-
222
- edgey = """
223
- node testnode;
224
-
225
- edge apple;
226
- edge banana;
227
-
228
- walker init {
229
- root {
230
- a = spawn here ++> node::testnode ;
231
- here +[apple]+> a;
232
- here +[banana]+> a;
233
- }
234
- }
235
- """
236
-
237
- edgey2 = """
238
- node testnode;
239
-
240
- edge apple;
241
- edge banana;
242
-
243
- walker init {
244
- root {
245
- a = spawn here ++> node::testnode ;
246
- here +[apple]+> a;
247
- here +[banana]+> a;
248
-
249
- here !--> a;
250
- }
251
- }
252
- """
253
-
254
- edgey2b = """
255
- node testnode;
256
-
257
- edge apple;
258
- edge banana;
259
-
260
- walker init {
261
- root {
262
- a = spawn here ++> node::testnode ;
263
- b = spawn here ++> node::testnode ;
264
- here +[apple]+> a;
265
- here +[banana]+> a;
266
-
267
- here !--> a;
268
- }
269
- }
270
- """
271
-
272
- edgey2c = """
273
- node testnode;
274
-
275
- edge apple;
276
- edge banana;
277
-
278
- walker init {
279
- root {
280
- a = spawn here ++> node::testnode ;
281
- b = spawn here ++> node::testnode ;
282
- here +[apple]+> a;
283
- here +[banana]+> a;
284
-
285
- here !-[apple]-> a;
286
- }
287
- }
288
- """
289
-
290
- edgey3 = """
291
- node testnode;
292
-
293
- edge apple;
294
- edge banana;
295
-
296
- walker init {
297
- root {
298
- a = spawn here ++> node::testnode ;
299
- b = spawn here ++> node::testnode ;
300
- here +[apple]+> a;
301
- here +[apple]+> a;
302
- here +[banana]+> a;
303
- here +[banana]+> a;
304
- here +[banana]+> a;
305
-
306
- here !-[apple]-> a;
307
- }
308
- }
309
- """
310
-
311
-
312
- edgey4 = """
313
- node testnode;
314
-
315
- edge apple;
316
- edge banana;
317
-
318
- walker init {
319
- root {
320
- a = spawn here ++> node::testnode ;
321
- here ++> a;
322
- here +[apple]+> a;
323
- here +[banana]+> a;
324
-
325
- here !-[generic]-> a;
326
- }
327
- }
328
- """
329
-
330
- edgey5 = """
331
- node testnode;
332
-
333
- edge apple;
334
- edge banana;
335
-
336
- walker init {
337
- root {
338
- a = spawn here ++> node::testnode ;
339
- here ++> a;
340
- here ++> a;
341
- here +[apple]+> a;
342
- here +[banana]+> a;
343
-
344
- here !-[generic]-> -[generic]->;
345
- }
346
- }
347
- """
348
-
349
- edgey6 = """
350
- node testnode;
351
-
352
- edge apple;
353
- edge banana;
354
-
355
- walker init {
356
- root {
357
- a = spawn here ++> node::testnode ;
358
- b = spawn here ++> node::testnode ;
359
-
360
- here +[apple]+> -[generic]->;
361
- }
362
- }
363
- """
364
-
365
- edgey7 = """
366
- node testnode;
367
-
368
- edge apple;
369
- edge banana;
370
-
371
- walker init {
372
- root {
373
- a = spawn here ++> node::testnode ;
374
- b = spawn here ++> node::testnode ;
375
- here ++> a;
376
- here ++> a;
377
- here +[apple]+> a;
378
- here +[apple]+> b;
379
- here +[banana]+> a;
380
-
381
- here !-[generic]-> -[apple]->;
382
- }
383
- }
384
- """
385
-
386
- edge_access = """
387
- node testnode;
388
-
389
- edge apple {
390
- has v1, v2;
391
- }
392
-
393
- edge banana {
394
- has x1, x2;
395
- }
396
-
397
- walker init {
398
- root {
399
- a = spawn here +[apple]+> node::testnode ;
400
- b = spawn here +[banana]+> node::testnode ;
401
-
402
- e = -[apple]->.edge[0];
403
- e.v1 = 7;
404
- e = (--> node::testnode).edge[1];
405
- e.x1=8;
406
- }
407
- }
408
- """
409
-
410
- has_assign = """
411
- node testnode {
412
- has a=8;
413
- }
414
-
415
-
416
- walker init {
417
- root {
418
- a = spawn here ++> node::testnode ;
419
- b = spawn here ++> node::testnode ;
420
-
421
- std.log(a.a, b.a);
422
- }
423
- }
424
- """
425
-
426
-
427
- set_get_global = """
428
- walker setter {
429
- root {
430
- std.set_global('globby', 59);
431
- }
432
- }
433
-
434
- walker getter {
435
- has a;
436
- root {
437
- a=std.get_global('globby');
438
- std.log(std.get_global('globby'));
439
- }
440
- }
441
- """
442
-
443
- set_get_global2 = """
444
- walker setter {
445
- root {
446
- std.set_global('globby2', 59);
447
- }
448
- }
449
-
450
- walker getter {
451
- has a;
452
- root {
453
- a=std.get_global('globby2');
454
- std.log(std.get_global('globby2'));
455
- }
456
- }
457
- """
458
-
459
- set_get_global_dict = """
460
- walker setter {
461
- root {
462
- std.set_global('globby',
463
- { "max_bot_count": 10, "max_ans_count": 100,
464
- "max_txn_count": 50000, "max_test_suite": 5,
465
- "max_test_cases": 50, "export_import": true,
466
- "analytics": true, "integration": "All"
467
- });
468
- }
469
- }
470
-
471
- walker getter {
472
- has a;
473
- root {
474
- a=std.get_global('globby');
475
- std.log(std.get_global('globby'));
476
- report std.get_global('globby');
477
- }
478
- }
479
- """
480
-
481
- version_label = """
482
- version: "alpha-1.0"
483
-
484
- walker setter {
485
- root {
486
- std.set_global('globby', 59);
487
- }
488
- }
489
-
490
- walker getter {
491
- has a;
492
- root {
493
- a=std.get_global('globby');
494
- std.log(std.get_global('globby'));
495
- }
496
- }
497
- """
498
-
499
- sharable = """
500
- node life {
501
- }
502
-
503
- walker init {
504
- root {
505
- new = spawn here ++> node::life;
506
- take -->;
507
- }
508
- life {
509
- std.out(here);
510
- }
511
- }
512
- """
513
-
514
- basic = """
515
- node life {
516
- }
517
-
518
- walker init {
519
- root {
520
- new = spawn here ++> node::life;
521
- take -->;
522
- }
523
- life {
524
- }
525
- }
526
- """
527
-
528
- visibility_builtins = """
529
- node testnode {
530
- has yo, mama;
531
- }
532
-
533
- edge apple {
534
- has v1, v2;
535
- }
536
-
537
- edge banana {
538
- has x1, x2;
539
- }
540
-
541
- walker init {
542
- root {
543
- a = spawn here +[apple]+> node::testnode ;
544
- a.yo="Yeah i said";
545
- a.mama="Yo Mama Fool!";
546
- b = spawn here +[banana]+> node::testnode ;
547
-
548
- e = -[apple]->.edge[0];
549
- e.v1 = 7;
550
- e = --> node::testnode .edge[1];
551
- e.x1=8;
552
-
553
- report [a.context, b.info, e.details];
554
- }
555
- }
556
- """
557
-
558
- spawn_ctx_edge_node = """
559
- node person: has name, age, birthday, profession;
560
- edge friend: has meeting_place;
561
- edge family: has kind;
562
-
563
- walker init {
564
- person1 = spawn here +[friend(meeting_place = "college")]+>
565
- node::person(name = "Josh", age = 32);
566
- person2 = spawn here +[family(kind = "sister")] +>
567
- node::person(name = "Jane", age = 30);
568
-
569
- for i in -->{
570
- report i.context;
571
- report i.edge[0].context;
572
- }
573
- }
574
- """
575
-
576
- filter_ctx_edge_node = """
577
- node person: has name, age, birthday, profession;
578
- edge friend: has meeting_place;
579
- edge family: has kind;
580
-
581
- walker init {
582
- person1 = spawn here +[friend(meeting_place = "college")]+>
583
- node::person(name = "Josh", age = 32);
584
- person2 = spawn here +[family(kind = "sister")] +>
585
- node::person(name = "Jane", age = 30);
586
-
587
- report --> node::person(name=='Jane')[0].context;
588
- report -[family(kind=="brother")]->;
589
- }
590
- """
591
-
592
- null_handleing = """
593
- node person: has name, age, birthday, profession;
594
-
595
- walker init {
596
- person1 = spawn here ++>
597
- node::person(name = "Josh", age = 32);
598
-
599
- if(person1.birthday==null): report true;
600
- else: report false;
601
-
602
- if(person1.name==null): report true;
603
- else: report false;
604
-
605
- person1.name=null;
606
- report person1.name==null;
607
- person1.name=0;
608
- report person1.name==null;
609
- }
610
- """
611
-
612
- bool_type_convert = """
613
- node person: has name;
614
-
615
- walker init {
616
- p1 = spawn here ++>
617
- node::person(name = "Josh");
618
-
619
- p1.name = true;
620
- report p1.name;
621
- std.log(p1.name);
622
- report p1.context;
623
- }
624
- """
625
-
626
- typecasts = """
627
- walker init {
628
- a=5.6;
629
- report (a+2);
630
- report (a+2).int;
631
- report (a+2).str;
632
- report (a+2).bool;
633
- report (a+2).int.float;
634
-
635
- if(a.str.type == str and !(a.int.type == str)
636
- and a.int.type == int):
637
- report "Types comes back correct";
638
- }
639
- """
640
-
641
- typecasts_error = """
642
- walker init {
643
- a=5.6;
644
- report (a+2);
645
- report (a+2).int;
646
- report (a+2).str;
647
-
648
- try {
649
- report (a+2).edge;
650
- } else with error: report:error = error;
651
-
652
- report ("a+2").int.float;
653
-
654
- if(a.str.type == str and !(a.int.type == str)
655
- and a.int.type == int):
656
- report "Types comes back correct";
657
- }
658
- """
659
-
660
- filter_on_context = """
661
- node testnode {
662
- has yo, mama;
663
- }
664
-
665
- edge apple {
666
- has v1, v2;
667
- }
668
-
669
- edge banana {
670
- has x1, x2;
671
- }
672
-
673
- walker init {
674
- root {
675
- a = spawn here +[apple]+> node::testnode ;
676
- a.yo="Yeah i said";
677
- a.mama="Yo Mama Fool!";
678
- b = spawn here +[banana]+> node::testnode ;
679
-
680
- e = -[apple]->.edge[0];
681
- e.v1 = 7;
682
- e = --> node::testnode .edge[1];
683
- e.x1=8;
684
-
685
- report [a.context.{yo}, b.info.{jid,j_type}, e.details];
686
- }
687
- }
688
- """
689
-
690
- string_manipulation = """
691
- walker init {
692
- a=" tEsting me ";
693
- report a[4];
694
- report a[4:7];
695
- report a[3:-1];
696
- report a.str::upper;
697
- report a.str::lower;
698
- report a.str::title;
699
- report a.str::capitalize;
700
- report a.str::swap_case;
701
- report a.str::is_alnum;
702
- report a.str::is_alpha;
703
- report a.str::is_digit;
704
- report a.str::is_title;
705
- report a.str::is_upper;
706
- report a.str::is_lower;
707
- report a.str::is_space;
708
- report '{"a": 5}'.str::load_json;
709
- report a.str::count('t');
710
- report a.str::find('i');
711
- report a.s::split;
712
- report a.s::split('E');
713
- report a.s::startswith('tEs');
714
- report a.str::endswith('me');
715
- report a.str::replace('me', 'you');
716
- report a.str::strip;
717
- report a.str::strip(' t');
718
- report a.str::lstrip;
719
- report a.str::lstrip(' tE');
720
- report a.str::rstrip;
721
- report a.str::rstrip(' e');
722
-
723
- report a.str::upper.str::is_upper;
724
- }
725
- """
726
-
727
- list_manipulation = """
728
- walker init {
729
- a = [4];
730
- b=a.l::copy;
731
- b[0]+=1;
732
- report a;
733
- report b;
734
- a.list::extend(b);
735
- a.l::append(b[0]);
736
- report a;
737
- a.l::reverse;
738
- report a;
739
- a.list::sort;
740
- report a;
741
- a.l::reverse;
742
- report a.l::index(4);
743
- a.l::append(a.l::index(4));
744
- report a;
745
- a.l::insert(2, "apple");
746
- a.l::remove(5);
747
- report a;
748
- a.l::pop;
749
- report a.l::count(4);
750
- report a;
751
- a.l::clear;
752
- report a;
753
- }
754
- """
755
-
756
- list_reversed = """
757
- walker init {
758
- a = [4, 2, 7];
759
- report a.l::reversed;
760
- report a;
761
- }
762
- """
763
-
764
- dict_manipulation = """
765
- walker init {
766
- a = {'four':4, 'five':5};
767
- b=a.d::copy;
768
- b['four']+=1;
769
- report a;
770
- report b;
771
- report a.dict::items;
772
- report a.d::keys;
773
- a.d::popitem;
774
- report a;
775
- report a.dict::values;
776
- a.d::update({'four': 7});
777
- report a;
778
- a.d::pop('four');
779
- report a;
780
- }
781
- """
782
-
783
- string_join = """
784
- walker init {
785
- a=['test', 'me', 'now'];
786
- report '_'.str::join(a);
787
- }
788
- """
789
-
790
- sub_list = """
791
- walker init {
792
- a=[1,2,3,4,5,6,7,8,9];
793
- report a[4:7];
794
- }
795
- """
796
-
797
- destroy_and_misc = """
798
- node person: has name, age, birthday, profession;
799
- edge friend: has meeting_place;
800
- edge family: has kind;
801
-
802
- walker init {
803
- person1 = spawn here +[friend(meeting_place = "college")]+>
804
- node::person(name = "Josh", age = 32);
805
- person2 = spawn here +[family(kind = "sister")] +>
806
- node::person(name = "Jane", age = 30);
807
-
808
- report person1.name;
809
- destroy person1.name;
810
- report person1.context;
811
- person1.name="pete";
812
- report person1.context;
813
- a=[1,2,3];
814
- destroy a[1];
815
- report a;
816
- b={'a': 'b', 'c':'d'};
817
- destroy b['c'];
818
- report b;
819
- a=[1,2,3,5,6,7,8,9];
820
- destroy a[2:4];
821
- report a;
822
- a[2:4]=[45,33];
823
- report a;
824
- destroy a;
825
- try {
826
- report a;
827
- } else with error: report:error = error;
828
- try {
829
- person1.banana=45;
830
- } else with error: report:error = error;
831
- report person1.context;
832
- report 'age' in person1.context;
833
- }
834
- """
835
-
836
- arbitrary_assign_on_element = """
837
- node person: has name, age, birthday, profession;
838
- walker init {
839
- some = spawn here ++> node::person;
840
- try {
841
- some.apple = 45;
842
- } else with error: report:error = error;
843
-
844
- report some.context;
845
- }
846
- """
847
-
848
- try_else_stmts = """
849
- walker init {
850
- a=null;
851
- try {a=2/0;}
852
- else with err {report err;}
853
- try {a=2/0;}
854
- else {report 'dont need err';}
855
- try {a=2/0;}
856
- try {a=2/0;}
857
- report a;
858
- try {a=2/1;}
859
- report a;
860
- }
861
-
862
- walker sample {
863
- with entry {
864
- try {
865
- a = {};
866
- b = {};
867
-
868
- b.dict::update({
869
- "test2": 1,
870
- "test": a["test"]
871
- });
872
- report b;
873
- } else with error {
874
- report:error = error;
875
- }
876
- }
877
- }
878
- """
879
-
880
- node_edge_same_name = """
881
- node person: has name, age, birthday, profession;
882
- edge person: has meeting_place;
883
-
884
- walker init {
885
- person1 = spawn here +[person(meeting_place = "college")]+>
886
- node::person(name = "Josh", age = 32);
887
-
888
- report -->.edge[0].context;
889
- report -->[0].context;
890
- }
891
- """
892
-
893
- testcases = """
894
- node testnode {
895
- has yo, mama;
896
- }
897
-
898
- node apple {
899
- has v1, v2;
900
- }
901
-
902
- node banana {
903
- has x1, x2;
904
- }
905
-
906
- graph dummy {
907
- has anchor graph_root;
908
- spawn {
909
- graph_root = spawn node::testnode (yo="Hey yo!");
910
- n1=spawn node::apple(v1="I'm apple");
911
- n2=spawn node::banana(x1="I'm banana");
912
- graph_root ++> n1 ++> n2;
913
- }
914
- }
915
-
916
- walker init {
917
- has num=4;
918
- report here.context;
919
- report num;
920
- take -->;
921
- }
922
-
923
- test "basic test with refs"
924
- with graph::dummy by walker::init;
925
-
926
- test "test with refs and assert block"
927
- with graph::dummy by walker::init {
928
- report "ASSERT BLOCK";
929
- }
930
-
931
- test "test with graph ref and walker block"
932
- with graph::dummy by walker {
933
- report here.context;
934
- report "IN generic walker";
935
- take -->;
936
- }
937
-
938
- test "test with graph block and walker ref"
939
- with graph {
940
- has anchor graph_root;
941
- spawn {
942
- graph_root = spawn node::testnode (yo="Hey yo!");
943
- n1=spawn node::apple(v1="I'm apple");
944
- n2=spawn node::banana(x1="I'm banana");
945
- graph_root ++> n1 ++> n2;
946
- graph_root ++> n2;
947
- }
948
- } by walker::init {
949
- report "ASSERT BLOCK";
950
- }
951
- """
952
-
953
-
954
- testcase_asserts = """
955
- node testnode {
956
- has yo, mama;
957
- }
958
-
959
- node apple {
960
- has v1, v2;
961
- }
962
-
963
- node banana {
964
- has x1, x2;
965
- }
966
-
967
- graph dummy {
968
- has anchor graph_root;
969
- spawn {
970
- graph_root = spawn node::testnode (yo="Hey yo!");
971
- n1=spawn node::apple(v1="I'm apple");
972
- n2=spawn node::banana(x1="I'm banana");
973
- graph_root ++> n1 ++> n2;
974
- }
975
- }
976
-
977
- walker init {
978
- has num=4;
979
- report here.context;
980
- report num;
981
- take -->;
982
- }
983
-
984
- test "assert should be valid"
985
- with graph::dummy by walker::init {
986
- assert (num==4);
987
- assert (here.x1=="I'm banana");
988
- assert <--[0].v1=="I'm apple";
989
- }
990
-
991
- test "assert should fail"
992
- with graph::dummy by walker::init {
993
- assert (num==4);
994
- assert (here.x1=="I'm banana");
995
- assert <--[0].v1=="I'm Apple";
996
- }
997
-
998
- test "assert should fail, add internal except"
999
- with graph::dummy by walker::init {
1000
- assert (num==4);
1001
- assert (here.x1=="I'm banana");
1002
- assert <--[10].v1=="I'm apple";
1003
- }
1004
- """
1005
-
1006
- report_not_to_jacset = """
1007
- node testnode {
1008
- has yo, mama;
1009
- }
1010
-
1011
- walker init {
1012
- spawn here ++> node::testnode;
1013
- report -->;
1014
- }
1015
- """
1016
-
1017
- walker_spawn_unwrap_check = """
1018
- node testnode {
1019
- has yo, mama;
1020
- }
1021
-
1022
- walker print {
1023
- has anchor nd;
1024
- nd=here;
1025
- }
1026
-
1027
- walker init {
1028
- report &(spawn here walker::print);
1029
- }
1030
- """
1031
-
1032
- std_get_report = """
1033
- walker init {
1034
- report 3;
1035
- report 5;
1036
- report 6;
1037
- report 7;
1038
- report std.get_report();
1039
- report 8;
1040
- }
1041
- """
1042
-
1043
- func_with_array_index = """
1044
- walker init {
1045
- report 3;
1046
- report 5;
1047
- report std.get_report()[0];
1048
- }
1049
- """
1050
-
1051
- rt_error_test1 = """
1052
- walker init {
1053
- spawn here ++> node::generic;
1054
- report -->[2];
1055
- }
1056
- """
1057
-
1058
-
1059
- root_type_nodes = """
1060
- walker init {
1061
- spawn here +[generic]+> node::root;
1062
- report here.details['name'];
1063
- report -->[0].details['name'];
1064
- }
1065
- """
1066
-
1067
- invalid_key_error = """
1068
- walker init {
1069
- report here.context['adfas'];
1070
- }
1071
- """
1072
-
1073
- auto_cast = """
1074
- walker init {
1075
- report 1==1.0;
1076
- report 1.0==1;
1077
- }
1078
- """
1079
-
1080
- no_error_on_dict_key_assign = """
1081
- walker init {
1082
- a={};
1083
- a['b']=4;
1084
- report a;
1085
- }
1086
- """
1087
-
1088
- report_status = """
1089
- walker init {report:status = 302; report "hello";}
1090
- """
1091
-
1092
-
1093
- graph_in_graph = """
1094
- graph one {
1095
- has anchor graph_root;
1096
- spawn {
1097
- graph_root = spawn node::generic;
1098
- }
1099
- }
1100
-
1101
- graph two {
1102
- has anchor graph_root;
1103
- spawn {
1104
-
1105
- graph_root = spawn node::generic;
1106
- day1 = spawn graph::one;
1107
-
1108
- graph_root ++> day1;
1109
- }
1110
- }
1111
-
1112
- walker init {
1113
- root {
1114
- spawn here ++> graph::two;
1115
- }
1116
- take -->;
1117
- report here;
1118
- }
1119
- """
1120
-
1121
-
1122
- min_max_on_list = """
1123
- walker init {
1124
- a = [45, 3, 531.0, 3, 6, 531.1];
1125
-
1126
- report a.l::max;
1127
- report a.l::min;
1128
- report a.l::idx_of_max;
1129
- report a.l::idx_of_min;
1130
- }
1131
- """
1132
-
1133
- edge_bug = """
1134
- node plain;
1135
-
1136
- edge g;
1137
-
1138
- walker init {
1139
- root {
1140
- nd = spawn here +[g]+> node::plain;
1141
- nd +[g]+> nd;
1142
- spawn nd +[g]+> node::plain;
1143
- spawn nd +[g]+> node::plain;
1144
- a = spawn nd <+[g]+ node::plain;
1145
- spawn nd <+[g]+ node::plain;
1146
- nd +[g]+> a;
1147
- }
1148
- take -[g]->;
1149
- plain {
1150
- report -[g]->.edge;
1151
- disengage;
1152
- }
1153
- }
1154
- """
1155
-
1156
- rand_choice = """
1157
- walker init {
1158
- a = [45, 3, 531.0, 3, 6, 531.1];
1159
-
1160
- report a;
1161
- report rand.choice(a);
1162
- }
1163
- """
1164
-
1165
-
1166
- struct_types = """
1167
- type simple {
1168
- has apple;
1169
- has orange=43;
1170
- }
1171
-
1172
- type another {
1173
- has apple=spawn t::simple(apple=33);
1174
- }
1175
-
1176
- node mynode {
1177
- has basic=spawn type::another;
1178
- }
1179
-
1180
- walker init {
1181
- a = spawn here ++> n::mynode;
1182
-
1183
- report
1184
- [a.basic["apple"]["orange"],
1185
- a.basic["apple"]["apple"]];
1186
- report [a.basic.apple.apple, a.basic.apple.orange];
1187
- }
1188
- """
1189
-
1190
-
1191
- simple_graph = """
1192
- node a1 {has val = 0;}
1193
- node a2 {has val = 0;}
1194
- node a3 {has val = 0;}
1195
- node b1 {has val = 0;}
1196
- node b2 {has val = 0;}
1197
- edge e1 {has val = 0;}
1198
- edge e2 {has val = 0;}
1199
- edge e3 {has val = 0;}
1200
-
1201
- walker sample {
1202
- root {
1203
- take --> node::a1 else: take spawn here +[e1]+> node::a1;
1204
- take --> node::b1 else: take spawn here ++> node::b1;
1205
- }
1206
-
1207
- a1: take --> node::a2 else {
1208
- report --> node::a2;
1209
- report -[e2]-> node::a2;
1210
- take spawn here +[e2]+> node::a2;
1211
- }
1212
- a2: take --> node::a3 else: take spawn here +[e3]+> node::a3;
1213
- b1: take --> node::b2 else: take spawn here ++> node::b2;
1214
- }
1215
-
1216
- walker sample2 {
1217
- root {
1218
- take --> node::a1;
1219
- take --> node::b1;
1220
- }
1221
- a1: take --> node::a2;
1222
- a2: take --> node::a3;
1223
- a3: here.val = 1;
1224
- b1: take --> node::b2;
1225
- b2: here.val = 1;
1226
- }
1227
-
1228
- walker sample3 {
1229
- root {
1230
- take --> node::a1;
1231
- take --> node::b1;
1232
- }
1233
- a1 {
1234
- -[e2]->.edge[0].val = 1;
1235
- take --> node::a2;
1236
- }
1237
- a2 {
1238
- take --> node::a3;
1239
- here not --> node::a3;
1240
- }
1241
- a3: here.val = 2;
1242
- b1: take --> node::b2;
1243
- }
1244
- """
1245
-
1246
- simple_graph2 = """
1247
- node a1 {has val = 0;}
1248
- edge e1 {has val = 0;}
1249
-
1250
- walker sample {
1251
- root: report spawn here <+[e1]+ node::a1;
1252
- }
1253
-
1254
- walker sample2 {
1255
- root: report <-[e1]- node::a1.edge[0].val;
1256
- a1 {
1257
- --> node::root.edge[0].val = 4;
1258
- report -[e1]->.edge[0].val;
1259
- take --> node::root;
1260
- }
1261
- }
1262
-
1263
- walker sample3 {
1264
- root {
1265
- report <-[e1]- node::a1.edge[0].val;
1266
- take <-[e1]- node::a1;
1267
- }
1268
-
1269
- a1: report -[e1]->.edge[0].val;
1270
- }
1271
-
1272
- walker sample4 {
1273
- root {
1274
- <-- node::a1.edge[0].val = 6;
1275
- report <-[e1]- node::a1.edge[0].val;
1276
- take <-[e1]- node::a1;
1277
- }
1278
- a1: report -[e1]-> node::root.edge[0].val;
1279
- }
1280
-
1281
- walker sample5 {
1282
- root: report <-[e1]-.edge[0].val;
1283
- a1 {
1284
- report -[e1]-> node::root.edge[0].val;
1285
- take -[e1]-> node::root;
1286
- }
1287
- }
1288
-
1289
- walker sample6 {
1290
- root: <-[e1]- node::a1.edge[0].val = 8;
1291
- a1: report --> node::root.edge[0].val;
1292
- }
1293
- """