Add files using upload-large-folder tool
Browse files- notebooks/results/checkpoint-3000/config.json +26 -0
- notebooks/results/checkpoint-3000/trainer_state.json +244 -0
- notebooks/results/checkpoint-3500/config.json +26 -0
- notebooks/results/checkpoint-3500/trainer_state.json +279 -0
- notebooks/results/checkpoint-4000/config.json +26 -0
- notebooks/results/checkpoint-4000/trainer_state.json +314 -0
- notebooks/results/checkpoint-4500/config.json +26 -0
- notebooks/results/checkpoint-4500/trainer_state.json +349 -0
- notebooks/results/checkpoint-4689/config.json +26 -0
- notebooks/results/checkpoint-4689/trainer_state.json +356 -0
- notebooks/results/checkpoint-500/config.json +26 -0
- notebooks/results/checkpoint-500/trainer_state.json +69 -0
- venv/Lib/site-packages/anyio-4.9.0.dist-info/LICENSE +20 -0
- venv/Lib/site-packages/anyio-4.9.0.dist-info/METADATA +105 -0
- venv/Lib/site-packages/anyio-4.9.0.dist-info/RECORD +88 -0
- venv/Lib/site-packages/anyio-4.9.0.dist-info/WHEEL +5 -0
- venv/Lib/site-packages/anyio-4.9.0.dist-info/top_level.txt +1 -0
- venv/Lib/site-packages/argon2/__init__.py +92 -0
- venv/Lib/site-packages/argon2/__main__.py +90 -0
- venv/Lib/site-packages/argon2/_legacy.py +91 -0
- venv/Lib/site-packages/argon2/_password_hasher.py +251 -0
- venv/Lib/site-packages/argon2/_typing.py +15 -0
- venv/Lib/site-packages/argon2/_utils.py +140 -0
- venv/Lib/site-packages/argon2/exceptions.py +56 -0
- venv/Lib/site-packages/argon2/low_level.py +238 -0
- venv/Lib/site-packages/argon2/profiles.py +60 -0
- venv/Lib/site-packages/argon2/py.typed +0 -0
- venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/INSTALLER +1 -0
- venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/METADATA +128 -0
- venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/RECORD +24 -0
- venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/WHEEL +4 -0
- venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/INSTALLER +1 -0
- venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/LICENSE +21 -0
- venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/METADATA +152 -0
- venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/RECORD +11 -0
- venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/WHEEL +5 -0
- venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/top_level.txt +2 -0
- venv/Lib/site-packages/arrow/api.py +126 -0
- venv/Scripts/Activate.ps1 +528 -0
- venv/Scripts/activate +76 -0
- venv/Scripts/activate.bat +34 -0
- venv/Scripts/deactivate.bat +22 -0
- venv/Scripts/get_gprof +75 -0
- venv/Scripts/get_objgraph +54 -0
- venv/Scripts/jsonpointer +67 -0
- venv/Scripts/pywin32_postinstall.py +733 -0
- venv/Scripts/pywin32_testall.py +120 -0
- venv/Scripts/undill +22 -0
- venv/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json +7 -0
- venv/etc/jupyter/jupyter_server_config.d/jupyter-lsp-jupyter-server.json +7 -0
notebooks/results/checkpoint-3000/config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForSequenceClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 3072,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"problem_type": "single_label_classification",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.51.3",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
notebooks/results/checkpoint-3000/trainer_state.json
ADDED
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_global_step": null,
|
3 |
+
"best_metric": null,
|
4 |
+
"best_model_checkpoint": null,
|
5 |
+
"epoch": 1.9193857965451055,
|
6 |
+
"eval_steps": 500,
|
7 |
+
"global_step": 3000,
|
8 |
+
"is_hyper_param_search": false,
|
9 |
+
"is_local_process_zero": true,
|
10 |
+
"is_world_process_zero": true,
|
11 |
+
"log_history": [
|
12 |
+
{
|
13 |
+
"epoch": 0.06397952655150352,
|
14 |
+
"grad_norm": 5.188015460968018,
|
15 |
+
"learning_rate": 4.8944337811900195e-05,
|
16 |
+
"loss": 0.5162,
|
17 |
+
"step": 100
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"epoch": 0.12795905310300704,
|
21 |
+
"grad_norm": 8.62886905670166,
|
22 |
+
"learning_rate": 4.7878012369375135e-05,
|
23 |
+
"loss": 0.4123,
|
24 |
+
"step": 200
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.19193857965451055,
|
28 |
+
"grad_norm": 6.661285877227783,
|
29 |
+
"learning_rate": 4.681168692685008e-05,
|
30 |
+
"loss": 0.4106,
|
31 |
+
"step": 300
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.2559181062060141,
|
35 |
+
"grad_norm": 7.992310523986816,
|
36 |
+
"learning_rate": 4.5745361484325014e-05,
|
37 |
+
"loss": 0.3619,
|
38 |
+
"step": 400
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.3198976327575176,
|
42 |
+
"grad_norm": 8.48903751373291,
|
43 |
+
"learning_rate": 4.467903604179996e-05,
|
44 |
+
"loss": 0.3724,
|
45 |
+
"step": 500
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"epoch": 0.3838771593090211,
|
49 |
+
"grad_norm": 7.3620219230651855,
|
50 |
+
"learning_rate": 4.3612710599274906e-05,
|
51 |
+
"loss": 0.3582,
|
52 |
+
"step": 600
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"epoch": 0.44785668586052463,
|
56 |
+
"grad_norm": 7.127757549285889,
|
57 |
+
"learning_rate": 4.254638515674984e-05,
|
58 |
+
"loss": 0.351,
|
59 |
+
"step": 700
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"epoch": 0.5118362124120281,
|
63 |
+
"grad_norm": 8.284778594970703,
|
64 |
+
"learning_rate": 4.1480059714224785e-05,
|
65 |
+
"loss": 0.3517,
|
66 |
+
"step": 800
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 0.5758157389635317,
|
70 |
+
"grad_norm": 6.389641284942627,
|
71 |
+
"learning_rate": 4.0413734271699725e-05,
|
72 |
+
"loss": 0.3197,
|
73 |
+
"step": 900
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"epoch": 0.6397952655150352,
|
77 |
+
"grad_norm": 8.652924537658691,
|
78 |
+
"learning_rate": 3.9347408829174664e-05,
|
79 |
+
"loss": 0.3457,
|
80 |
+
"step": 1000
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.7037747920665387,
|
84 |
+
"grad_norm": 9.87730598449707,
|
85 |
+
"learning_rate": 3.828108338664961e-05,
|
86 |
+
"loss": 0.3152,
|
87 |
+
"step": 1100
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"epoch": 0.7677543186180422,
|
91 |
+
"grad_norm": 9.235931396484375,
|
92 |
+
"learning_rate": 3.721475794412455e-05,
|
93 |
+
"loss": 0.3312,
|
94 |
+
"step": 1200
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"epoch": 0.8317338451695457,
|
98 |
+
"grad_norm": 8.75272274017334,
|
99 |
+
"learning_rate": 3.614843250159949e-05,
|
100 |
+
"loss": 0.3098,
|
101 |
+
"step": 1300
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"epoch": 0.8957133717210493,
|
105 |
+
"grad_norm": 3.6930184364318848,
|
106 |
+
"learning_rate": 3.508210705907443e-05,
|
107 |
+
"loss": 0.3057,
|
108 |
+
"step": 1400
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"epoch": 0.9596928982725528,
|
112 |
+
"grad_norm": 15.71256160736084,
|
113 |
+
"learning_rate": 3.4015781616549375e-05,
|
114 |
+
"loss": 0.2994,
|
115 |
+
"step": 1500
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 1.0236724248240563,
|
119 |
+
"grad_norm": 10.11008071899414,
|
120 |
+
"learning_rate": 3.2949456174024315e-05,
|
121 |
+
"loss": 0.2945,
|
122 |
+
"step": 1600
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 1.0876519513755598,
|
126 |
+
"grad_norm": 1.052371859550476,
|
127 |
+
"learning_rate": 3.1883130731499254e-05,
|
128 |
+
"loss": 0.2072,
|
129 |
+
"step": 1700
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 1.1516314779270633,
|
133 |
+
"grad_norm": 0.17214666306972504,
|
134 |
+
"learning_rate": 3.08168052889742e-05,
|
135 |
+
"loss": 0.1915,
|
136 |
+
"step": 1800
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"epoch": 1.2156110044785668,
|
140 |
+
"grad_norm": 3.5573925971984863,
|
141 |
+
"learning_rate": 2.9750479846449137e-05,
|
142 |
+
"loss": 0.2268,
|
143 |
+
"step": 1900
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"epoch": 1.2795905310300704,
|
147 |
+
"grad_norm": 12.984672546386719,
|
148 |
+
"learning_rate": 2.868415440392408e-05,
|
149 |
+
"loss": 0.1639,
|
150 |
+
"step": 2000
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"epoch": 1.3435700575815739,
|
154 |
+
"grad_norm": 0.8138177990913391,
|
155 |
+
"learning_rate": 2.7617828961399022e-05,
|
156 |
+
"loss": 0.1866,
|
157 |
+
"step": 2100
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"epoch": 1.4075495841330774,
|
161 |
+
"grad_norm": 10.373751640319824,
|
162 |
+
"learning_rate": 2.6551503518873962e-05,
|
163 |
+
"loss": 0.2171,
|
164 |
+
"step": 2200
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 1.471529110684581,
|
168 |
+
"grad_norm": 5.024399757385254,
|
169 |
+
"learning_rate": 2.5485178076348905e-05,
|
170 |
+
"loss": 0.1796,
|
171 |
+
"step": 2300
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"epoch": 1.5355086372360844,
|
175 |
+
"grad_norm": 7.260871887207031,
|
176 |
+
"learning_rate": 2.4418852633823844e-05,
|
177 |
+
"loss": 0.1878,
|
178 |
+
"step": 2400
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"epoch": 1.599488163787588,
|
182 |
+
"grad_norm": 6.540918350219727,
|
183 |
+
"learning_rate": 2.3352527191298784e-05,
|
184 |
+
"loss": 0.1675,
|
185 |
+
"step": 2500
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"epoch": 1.6634676903390915,
|
189 |
+
"grad_norm": 2.625058650970459,
|
190 |
+
"learning_rate": 2.2286201748773727e-05,
|
191 |
+
"loss": 0.2044,
|
192 |
+
"step": 2600
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"epoch": 1.727447216890595,
|
196 |
+
"grad_norm": 7.691290855407715,
|
197 |
+
"learning_rate": 2.1219876306248666e-05,
|
198 |
+
"loss": 0.1827,
|
199 |
+
"step": 2700
|
200 |
+
},
|
201 |
+
{
|
202 |
+
"epoch": 1.7914267434420985,
|
203 |
+
"grad_norm": 8.49361515045166,
|
204 |
+
"learning_rate": 2.015355086372361e-05,
|
205 |
+
"loss": 0.1954,
|
206 |
+
"step": 2800
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"epoch": 1.855406269993602,
|
210 |
+
"grad_norm": 0.37825897336006165,
|
211 |
+
"learning_rate": 1.9087225421198552e-05,
|
212 |
+
"loss": 0.1838,
|
213 |
+
"step": 2900
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"epoch": 1.9193857965451055,
|
217 |
+
"grad_norm": 22.31838035583496,
|
218 |
+
"learning_rate": 1.802089997867349e-05,
|
219 |
+
"loss": 0.1847,
|
220 |
+
"step": 3000
|
221 |
+
}
|
222 |
+
],
|
223 |
+
"logging_steps": 100,
|
224 |
+
"max_steps": 4689,
|
225 |
+
"num_input_tokens_seen": 0,
|
226 |
+
"num_train_epochs": 3,
|
227 |
+
"save_steps": 500,
|
228 |
+
"stateful_callbacks": {
|
229 |
+
"TrainerControl": {
|
230 |
+
"args": {
|
231 |
+
"should_epoch_stop": false,
|
232 |
+
"should_evaluate": false,
|
233 |
+
"should_log": false,
|
234 |
+
"should_save": true,
|
235 |
+
"should_training_stop": false
|
236 |
+
},
|
237 |
+
"attributes": {}
|
238 |
+
}
|
239 |
+
},
|
240 |
+
"total_flos": 3156806442209280.0,
|
241 |
+
"train_batch_size": 16,
|
242 |
+
"trial_name": null,
|
243 |
+
"trial_params": null
|
244 |
+
}
|
notebooks/results/checkpoint-3500/config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForSequenceClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 3072,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"problem_type": "single_label_classification",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.51.3",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
notebooks/results/checkpoint-3500/trainer_state.json
ADDED
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_global_step": null,
|
3 |
+
"best_metric": null,
|
4 |
+
"best_model_checkpoint": null,
|
5 |
+
"epoch": 2.239283429302623,
|
6 |
+
"eval_steps": 500,
|
7 |
+
"global_step": 3500,
|
8 |
+
"is_hyper_param_search": false,
|
9 |
+
"is_local_process_zero": true,
|
10 |
+
"is_world_process_zero": true,
|
11 |
+
"log_history": [
|
12 |
+
{
|
13 |
+
"epoch": 0.06397952655150352,
|
14 |
+
"grad_norm": 5.188015460968018,
|
15 |
+
"learning_rate": 4.8944337811900195e-05,
|
16 |
+
"loss": 0.5162,
|
17 |
+
"step": 100
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"epoch": 0.12795905310300704,
|
21 |
+
"grad_norm": 8.62886905670166,
|
22 |
+
"learning_rate": 4.7878012369375135e-05,
|
23 |
+
"loss": 0.4123,
|
24 |
+
"step": 200
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.19193857965451055,
|
28 |
+
"grad_norm": 6.661285877227783,
|
29 |
+
"learning_rate": 4.681168692685008e-05,
|
30 |
+
"loss": 0.4106,
|
31 |
+
"step": 300
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.2559181062060141,
|
35 |
+
"grad_norm": 7.992310523986816,
|
36 |
+
"learning_rate": 4.5745361484325014e-05,
|
37 |
+
"loss": 0.3619,
|
38 |
+
"step": 400
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.3198976327575176,
|
42 |
+
"grad_norm": 8.48903751373291,
|
43 |
+
"learning_rate": 4.467903604179996e-05,
|
44 |
+
"loss": 0.3724,
|
45 |
+
"step": 500
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"epoch": 0.3838771593090211,
|
49 |
+
"grad_norm": 7.3620219230651855,
|
50 |
+
"learning_rate": 4.3612710599274906e-05,
|
51 |
+
"loss": 0.3582,
|
52 |
+
"step": 600
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"epoch": 0.44785668586052463,
|
56 |
+
"grad_norm": 7.127757549285889,
|
57 |
+
"learning_rate": 4.254638515674984e-05,
|
58 |
+
"loss": 0.351,
|
59 |
+
"step": 700
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"epoch": 0.5118362124120281,
|
63 |
+
"grad_norm": 8.284778594970703,
|
64 |
+
"learning_rate": 4.1480059714224785e-05,
|
65 |
+
"loss": 0.3517,
|
66 |
+
"step": 800
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 0.5758157389635317,
|
70 |
+
"grad_norm": 6.389641284942627,
|
71 |
+
"learning_rate": 4.0413734271699725e-05,
|
72 |
+
"loss": 0.3197,
|
73 |
+
"step": 900
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"epoch": 0.6397952655150352,
|
77 |
+
"grad_norm": 8.652924537658691,
|
78 |
+
"learning_rate": 3.9347408829174664e-05,
|
79 |
+
"loss": 0.3457,
|
80 |
+
"step": 1000
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.7037747920665387,
|
84 |
+
"grad_norm": 9.87730598449707,
|
85 |
+
"learning_rate": 3.828108338664961e-05,
|
86 |
+
"loss": 0.3152,
|
87 |
+
"step": 1100
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"epoch": 0.7677543186180422,
|
91 |
+
"grad_norm": 9.235931396484375,
|
92 |
+
"learning_rate": 3.721475794412455e-05,
|
93 |
+
"loss": 0.3312,
|
94 |
+
"step": 1200
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"epoch": 0.8317338451695457,
|
98 |
+
"grad_norm": 8.75272274017334,
|
99 |
+
"learning_rate": 3.614843250159949e-05,
|
100 |
+
"loss": 0.3098,
|
101 |
+
"step": 1300
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"epoch": 0.8957133717210493,
|
105 |
+
"grad_norm": 3.6930184364318848,
|
106 |
+
"learning_rate": 3.508210705907443e-05,
|
107 |
+
"loss": 0.3057,
|
108 |
+
"step": 1400
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"epoch": 0.9596928982725528,
|
112 |
+
"grad_norm": 15.71256160736084,
|
113 |
+
"learning_rate": 3.4015781616549375e-05,
|
114 |
+
"loss": 0.2994,
|
115 |
+
"step": 1500
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 1.0236724248240563,
|
119 |
+
"grad_norm": 10.11008071899414,
|
120 |
+
"learning_rate": 3.2949456174024315e-05,
|
121 |
+
"loss": 0.2945,
|
122 |
+
"step": 1600
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 1.0876519513755598,
|
126 |
+
"grad_norm": 1.052371859550476,
|
127 |
+
"learning_rate": 3.1883130731499254e-05,
|
128 |
+
"loss": 0.2072,
|
129 |
+
"step": 1700
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 1.1516314779270633,
|
133 |
+
"grad_norm": 0.17214666306972504,
|
134 |
+
"learning_rate": 3.08168052889742e-05,
|
135 |
+
"loss": 0.1915,
|
136 |
+
"step": 1800
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"epoch": 1.2156110044785668,
|
140 |
+
"grad_norm": 3.5573925971984863,
|
141 |
+
"learning_rate": 2.9750479846449137e-05,
|
142 |
+
"loss": 0.2268,
|
143 |
+
"step": 1900
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"epoch": 1.2795905310300704,
|
147 |
+
"grad_norm": 12.984672546386719,
|
148 |
+
"learning_rate": 2.868415440392408e-05,
|
149 |
+
"loss": 0.1639,
|
150 |
+
"step": 2000
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"epoch": 1.3435700575815739,
|
154 |
+
"grad_norm": 0.8138177990913391,
|
155 |
+
"learning_rate": 2.7617828961399022e-05,
|
156 |
+
"loss": 0.1866,
|
157 |
+
"step": 2100
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"epoch": 1.4075495841330774,
|
161 |
+
"grad_norm": 10.373751640319824,
|
162 |
+
"learning_rate": 2.6551503518873962e-05,
|
163 |
+
"loss": 0.2171,
|
164 |
+
"step": 2200
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 1.471529110684581,
|
168 |
+
"grad_norm": 5.024399757385254,
|
169 |
+
"learning_rate": 2.5485178076348905e-05,
|
170 |
+
"loss": 0.1796,
|
171 |
+
"step": 2300
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"epoch": 1.5355086372360844,
|
175 |
+
"grad_norm": 7.260871887207031,
|
176 |
+
"learning_rate": 2.4418852633823844e-05,
|
177 |
+
"loss": 0.1878,
|
178 |
+
"step": 2400
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"epoch": 1.599488163787588,
|
182 |
+
"grad_norm": 6.540918350219727,
|
183 |
+
"learning_rate": 2.3352527191298784e-05,
|
184 |
+
"loss": 0.1675,
|
185 |
+
"step": 2500
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"epoch": 1.6634676903390915,
|
189 |
+
"grad_norm": 2.625058650970459,
|
190 |
+
"learning_rate": 2.2286201748773727e-05,
|
191 |
+
"loss": 0.2044,
|
192 |
+
"step": 2600
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"epoch": 1.727447216890595,
|
196 |
+
"grad_norm": 7.691290855407715,
|
197 |
+
"learning_rate": 2.1219876306248666e-05,
|
198 |
+
"loss": 0.1827,
|
199 |
+
"step": 2700
|
200 |
+
},
|
201 |
+
{
|
202 |
+
"epoch": 1.7914267434420985,
|
203 |
+
"grad_norm": 8.49361515045166,
|
204 |
+
"learning_rate": 2.015355086372361e-05,
|
205 |
+
"loss": 0.1954,
|
206 |
+
"step": 2800
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"epoch": 1.855406269993602,
|
210 |
+
"grad_norm": 0.37825897336006165,
|
211 |
+
"learning_rate": 1.9087225421198552e-05,
|
212 |
+
"loss": 0.1838,
|
213 |
+
"step": 2900
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"epoch": 1.9193857965451055,
|
217 |
+
"grad_norm": 22.31838035583496,
|
218 |
+
"learning_rate": 1.802089997867349e-05,
|
219 |
+
"loss": 0.1847,
|
220 |
+
"step": 3000
|
221 |
+
},
|
222 |
+
{
|
223 |
+
"epoch": 1.983365323096609,
|
224 |
+
"grad_norm": 20.675575256347656,
|
225 |
+
"learning_rate": 1.695457453614843e-05,
|
226 |
+
"loss": 0.1817,
|
227 |
+
"step": 3100
|
228 |
+
},
|
229 |
+
{
|
230 |
+
"epoch": 2.0473448496481126,
|
231 |
+
"grad_norm": 0.051862724125385284,
|
232 |
+
"learning_rate": 1.5888249093623374e-05,
|
233 |
+
"loss": 0.1106,
|
234 |
+
"step": 3200
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"epoch": 2.111324376199616,
|
238 |
+
"grad_norm": 31.099328994750977,
|
239 |
+
"learning_rate": 1.4821923651098315e-05,
|
240 |
+
"loss": 0.0715,
|
241 |
+
"step": 3300
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"epoch": 2.1753039027511196,
|
245 |
+
"grad_norm": 17.968420028686523,
|
246 |
+
"learning_rate": 1.3755598208573256e-05,
|
247 |
+
"loss": 0.0986,
|
248 |
+
"step": 3400
|
249 |
+
},
|
250 |
+
{
|
251 |
+
"epoch": 2.239283429302623,
|
252 |
+
"grad_norm": 11.89964485168457,
|
253 |
+
"learning_rate": 1.2689272766048199e-05,
|
254 |
+
"loss": 0.0842,
|
255 |
+
"step": 3500
|
256 |
+
}
|
257 |
+
],
|
258 |
+
"logging_steps": 100,
|
259 |
+
"max_steps": 4689,
|
260 |
+
"num_input_tokens_seen": 0,
|
261 |
+
"num_train_epochs": 3,
|
262 |
+
"save_steps": 500,
|
263 |
+
"stateful_callbacks": {
|
264 |
+
"TrainerControl": {
|
265 |
+
"args": {
|
266 |
+
"should_epoch_stop": false,
|
267 |
+
"should_evaluate": false,
|
268 |
+
"should_log": false,
|
269 |
+
"should_save": true,
|
270 |
+
"should_training_stop": false
|
271 |
+
},
|
272 |
+
"attributes": {}
|
273 |
+
}
|
274 |
+
},
|
275 |
+
"total_flos": 3682502330818560.0,
|
276 |
+
"train_batch_size": 16,
|
277 |
+
"trial_name": null,
|
278 |
+
"trial_params": null
|
279 |
+
}
|
notebooks/results/checkpoint-4000/config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForSequenceClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 3072,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"problem_type": "single_label_classification",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.51.3",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
notebooks/results/checkpoint-4000/trainer_state.json
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_global_step": null,
|
3 |
+
"best_metric": null,
|
4 |
+
"best_model_checkpoint": null,
|
5 |
+
"epoch": 2.5591810620601407,
|
6 |
+
"eval_steps": 500,
|
7 |
+
"global_step": 4000,
|
8 |
+
"is_hyper_param_search": false,
|
9 |
+
"is_local_process_zero": true,
|
10 |
+
"is_world_process_zero": true,
|
11 |
+
"log_history": [
|
12 |
+
{
|
13 |
+
"epoch": 0.06397952655150352,
|
14 |
+
"grad_norm": 5.188015460968018,
|
15 |
+
"learning_rate": 4.8944337811900195e-05,
|
16 |
+
"loss": 0.5162,
|
17 |
+
"step": 100
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"epoch": 0.12795905310300704,
|
21 |
+
"grad_norm": 8.62886905670166,
|
22 |
+
"learning_rate": 4.7878012369375135e-05,
|
23 |
+
"loss": 0.4123,
|
24 |
+
"step": 200
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.19193857965451055,
|
28 |
+
"grad_norm": 6.661285877227783,
|
29 |
+
"learning_rate": 4.681168692685008e-05,
|
30 |
+
"loss": 0.4106,
|
31 |
+
"step": 300
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.2559181062060141,
|
35 |
+
"grad_norm": 7.992310523986816,
|
36 |
+
"learning_rate": 4.5745361484325014e-05,
|
37 |
+
"loss": 0.3619,
|
38 |
+
"step": 400
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.3198976327575176,
|
42 |
+
"grad_norm": 8.48903751373291,
|
43 |
+
"learning_rate": 4.467903604179996e-05,
|
44 |
+
"loss": 0.3724,
|
45 |
+
"step": 500
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"epoch": 0.3838771593090211,
|
49 |
+
"grad_norm": 7.3620219230651855,
|
50 |
+
"learning_rate": 4.3612710599274906e-05,
|
51 |
+
"loss": 0.3582,
|
52 |
+
"step": 600
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"epoch": 0.44785668586052463,
|
56 |
+
"grad_norm": 7.127757549285889,
|
57 |
+
"learning_rate": 4.254638515674984e-05,
|
58 |
+
"loss": 0.351,
|
59 |
+
"step": 700
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"epoch": 0.5118362124120281,
|
63 |
+
"grad_norm": 8.284778594970703,
|
64 |
+
"learning_rate": 4.1480059714224785e-05,
|
65 |
+
"loss": 0.3517,
|
66 |
+
"step": 800
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 0.5758157389635317,
|
70 |
+
"grad_norm": 6.389641284942627,
|
71 |
+
"learning_rate": 4.0413734271699725e-05,
|
72 |
+
"loss": 0.3197,
|
73 |
+
"step": 900
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"epoch": 0.6397952655150352,
|
77 |
+
"grad_norm": 8.652924537658691,
|
78 |
+
"learning_rate": 3.9347408829174664e-05,
|
79 |
+
"loss": 0.3457,
|
80 |
+
"step": 1000
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.7037747920665387,
|
84 |
+
"grad_norm": 9.87730598449707,
|
85 |
+
"learning_rate": 3.828108338664961e-05,
|
86 |
+
"loss": 0.3152,
|
87 |
+
"step": 1100
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"epoch": 0.7677543186180422,
|
91 |
+
"grad_norm": 9.235931396484375,
|
92 |
+
"learning_rate": 3.721475794412455e-05,
|
93 |
+
"loss": 0.3312,
|
94 |
+
"step": 1200
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"epoch": 0.8317338451695457,
|
98 |
+
"grad_norm": 8.75272274017334,
|
99 |
+
"learning_rate": 3.614843250159949e-05,
|
100 |
+
"loss": 0.3098,
|
101 |
+
"step": 1300
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"epoch": 0.8957133717210493,
|
105 |
+
"grad_norm": 3.6930184364318848,
|
106 |
+
"learning_rate": 3.508210705907443e-05,
|
107 |
+
"loss": 0.3057,
|
108 |
+
"step": 1400
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"epoch": 0.9596928982725528,
|
112 |
+
"grad_norm": 15.71256160736084,
|
113 |
+
"learning_rate": 3.4015781616549375e-05,
|
114 |
+
"loss": 0.2994,
|
115 |
+
"step": 1500
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 1.0236724248240563,
|
119 |
+
"grad_norm": 10.11008071899414,
|
120 |
+
"learning_rate": 3.2949456174024315e-05,
|
121 |
+
"loss": 0.2945,
|
122 |
+
"step": 1600
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 1.0876519513755598,
|
126 |
+
"grad_norm": 1.052371859550476,
|
127 |
+
"learning_rate": 3.1883130731499254e-05,
|
128 |
+
"loss": 0.2072,
|
129 |
+
"step": 1700
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 1.1516314779270633,
|
133 |
+
"grad_norm": 0.17214666306972504,
|
134 |
+
"learning_rate": 3.08168052889742e-05,
|
135 |
+
"loss": 0.1915,
|
136 |
+
"step": 1800
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"epoch": 1.2156110044785668,
|
140 |
+
"grad_norm": 3.5573925971984863,
|
141 |
+
"learning_rate": 2.9750479846449137e-05,
|
142 |
+
"loss": 0.2268,
|
143 |
+
"step": 1900
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"epoch": 1.2795905310300704,
|
147 |
+
"grad_norm": 12.984672546386719,
|
148 |
+
"learning_rate": 2.868415440392408e-05,
|
149 |
+
"loss": 0.1639,
|
150 |
+
"step": 2000
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"epoch": 1.3435700575815739,
|
154 |
+
"grad_norm": 0.8138177990913391,
|
155 |
+
"learning_rate": 2.7617828961399022e-05,
|
156 |
+
"loss": 0.1866,
|
157 |
+
"step": 2100
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"epoch": 1.4075495841330774,
|
161 |
+
"grad_norm": 10.373751640319824,
|
162 |
+
"learning_rate": 2.6551503518873962e-05,
|
163 |
+
"loss": 0.2171,
|
164 |
+
"step": 2200
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 1.471529110684581,
|
168 |
+
"grad_norm": 5.024399757385254,
|
169 |
+
"learning_rate": 2.5485178076348905e-05,
|
170 |
+
"loss": 0.1796,
|
171 |
+
"step": 2300
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"epoch": 1.5355086372360844,
|
175 |
+
"grad_norm": 7.260871887207031,
|
176 |
+
"learning_rate": 2.4418852633823844e-05,
|
177 |
+
"loss": 0.1878,
|
178 |
+
"step": 2400
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"epoch": 1.599488163787588,
|
182 |
+
"grad_norm": 6.540918350219727,
|
183 |
+
"learning_rate": 2.3352527191298784e-05,
|
184 |
+
"loss": 0.1675,
|
185 |
+
"step": 2500
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"epoch": 1.6634676903390915,
|
189 |
+
"grad_norm": 2.625058650970459,
|
190 |
+
"learning_rate": 2.2286201748773727e-05,
|
191 |
+
"loss": 0.2044,
|
192 |
+
"step": 2600
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"epoch": 1.727447216890595,
|
196 |
+
"grad_norm": 7.691290855407715,
|
197 |
+
"learning_rate": 2.1219876306248666e-05,
|
198 |
+
"loss": 0.1827,
|
199 |
+
"step": 2700
|
200 |
+
},
|
201 |
+
{
|
202 |
+
"epoch": 1.7914267434420985,
|
203 |
+
"grad_norm": 8.49361515045166,
|
204 |
+
"learning_rate": 2.015355086372361e-05,
|
205 |
+
"loss": 0.1954,
|
206 |
+
"step": 2800
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"epoch": 1.855406269993602,
|
210 |
+
"grad_norm": 0.37825897336006165,
|
211 |
+
"learning_rate": 1.9087225421198552e-05,
|
212 |
+
"loss": 0.1838,
|
213 |
+
"step": 2900
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"epoch": 1.9193857965451055,
|
217 |
+
"grad_norm": 22.31838035583496,
|
218 |
+
"learning_rate": 1.802089997867349e-05,
|
219 |
+
"loss": 0.1847,
|
220 |
+
"step": 3000
|
221 |
+
},
|
222 |
+
{
|
223 |
+
"epoch": 1.983365323096609,
|
224 |
+
"grad_norm": 20.675575256347656,
|
225 |
+
"learning_rate": 1.695457453614843e-05,
|
226 |
+
"loss": 0.1817,
|
227 |
+
"step": 3100
|
228 |
+
},
|
229 |
+
{
|
230 |
+
"epoch": 2.0473448496481126,
|
231 |
+
"grad_norm": 0.051862724125385284,
|
232 |
+
"learning_rate": 1.5888249093623374e-05,
|
233 |
+
"loss": 0.1106,
|
234 |
+
"step": 3200
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"epoch": 2.111324376199616,
|
238 |
+
"grad_norm": 31.099328994750977,
|
239 |
+
"learning_rate": 1.4821923651098315e-05,
|
240 |
+
"loss": 0.0715,
|
241 |
+
"step": 3300
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"epoch": 2.1753039027511196,
|
245 |
+
"grad_norm": 17.968420028686523,
|
246 |
+
"learning_rate": 1.3755598208573256e-05,
|
247 |
+
"loss": 0.0986,
|
248 |
+
"step": 3400
|
249 |
+
},
|
250 |
+
{
|
251 |
+
"epoch": 2.239283429302623,
|
252 |
+
"grad_norm": 11.89964485168457,
|
253 |
+
"learning_rate": 1.2689272766048199e-05,
|
254 |
+
"loss": 0.0842,
|
255 |
+
"step": 3500
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"epoch": 2.3032629558541267,
|
259 |
+
"grad_norm": 0.15594251453876495,
|
260 |
+
"learning_rate": 1.162294732352314e-05,
|
261 |
+
"loss": 0.0859,
|
262 |
+
"step": 3600
|
263 |
+
},
|
264 |
+
{
|
265 |
+
"epoch": 2.36724248240563,
|
266 |
+
"grad_norm": 0.04546676576137543,
|
267 |
+
"learning_rate": 1.0556621880998081e-05,
|
268 |
+
"loss": 0.0831,
|
269 |
+
"step": 3700
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"epoch": 2.4312220089571337,
|
273 |
+
"grad_norm": 0.08984202891588211,
|
274 |
+
"learning_rate": 9.490296438473023e-06,
|
275 |
+
"loss": 0.0859,
|
276 |
+
"step": 3800
|
277 |
+
},
|
278 |
+
{
|
279 |
+
"epoch": 2.495201535508637,
|
280 |
+
"grad_norm": 25.065441131591797,
|
281 |
+
"learning_rate": 8.423970995947964e-06,
|
282 |
+
"loss": 0.0972,
|
283 |
+
"step": 3900
|
284 |
+
},
|
285 |
+
{
|
286 |
+
"epoch": 2.5591810620601407,
|
287 |
+
"grad_norm": 0.09699796140193939,
|
288 |
+
"learning_rate": 7.357645553422905e-06,
|
289 |
+
"loss": 0.0777,
|
290 |
+
"step": 4000
|
291 |
+
}
|
292 |
+
],
|
293 |
+
"logging_steps": 100,
|
294 |
+
"max_steps": 4689,
|
295 |
+
"num_input_tokens_seen": 0,
|
296 |
+
"num_train_epochs": 3,
|
297 |
+
"save_steps": 500,
|
298 |
+
"stateful_callbacks": {
|
299 |
+
"TrainerControl": {
|
300 |
+
"args": {
|
301 |
+
"should_epoch_stop": false,
|
302 |
+
"should_evaluate": false,
|
303 |
+
"should_log": false,
|
304 |
+
"should_save": true,
|
305 |
+
"should_training_stop": false
|
306 |
+
},
|
307 |
+
"attributes": {}
|
308 |
+
}
|
309 |
+
},
|
310 |
+
"total_flos": 4208724441538560.0,
|
311 |
+
"train_batch_size": 16,
|
312 |
+
"trial_name": null,
|
313 |
+
"trial_params": null
|
314 |
+
}
|
notebooks/results/checkpoint-4500/config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForSequenceClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 3072,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"problem_type": "single_label_classification",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.51.3",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
notebooks/results/checkpoint-4500/trainer_state.json
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_global_step": null,
|
3 |
+
"best_metric": null,
|
4 |
+
"best_model_checkpoint": null,
|
5 |
+
"epoch": 2.8790786948176583,
|
6 |
+
"eval_steps": 500,
|
7 |
+
"global_step": 4500,
|
8 |
+
"is_hyper_param_search": false,
|
9 |
+
"is_local_process_zero": true,
|
10 |
+
"is_world_process_zero": true,
|
11 |
+
"log_history": [
|
12 |
+
{
|
13 |
+
"epoch": 0.06397952655150352,
|
14 |
+
"grad_norm": 5.188015460968018,
|
15 |
+
"learning_rate": 4.8944337811900195e-05,
|
16 |
+
"loss": 0.5162,
|
17 |
+
"step": 100
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"epoch": 0.12795905310300704,
|
21 |
+
"grad_norm": 8.62886905670166,
|
22 |
+
"learning_rate": 4.7878012369375135e-05,
|
23 |
+
"loss": 0.4123,
|
24 |
+
"step": 200
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.19193857965451055,
|
28 |
+
"grad_norm": 6.661285877227783,
|
29 |
+
"learning_rate": 4.681168692685008e-05,
|
30 |
+
"loss": 0.4106,
|
31 |
+
"step": 300
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.2559181062060141,
|
35 |
+
"grad_norm": 7.992310523986816,
|
36 |
+
"learning_rate": 4.5745361484325014e-05,
|
37 |
+
"loss": 0.3619,
|
38 |
+
"step": 400
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.3198976327575176,
|
42 |
+
"grad_norm": 8.48903751373291,
|
43 |
+
"learning_rate": 4.467903604179996e-05,
|
44 |
+
"loss": 0.3724,
|
45 |
+
"step": 500
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"epoch": 0.3838771593090211,
|
49 |
+
"grad_norm": 7.3620219230651855,
|
50 |
+
"learning_rate": 4.3612710599274906e-05,
|
51 |
+
"loss": 0.3582,
|
52 |
+
"step": 600
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"epoch": 0.44785668586052463,
|
56 |
+
"grad_norm": 7.127757549285889,
|
57 |
+
"learning_rate": 4.254638515674984e-05,
|
58 |
+
"loss": 0.351,
|
59 |
+
"step": 700
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"epoch": 0.5118362124120281,
|
63 |
+
"grad_norm": 8.284778594970703,
|
64 |
+
"learning_rate": 4.1480059714224785e-05,
|
65 |
+
"loss": 0.3517,
|
66 |
+
"step": 800
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 0.5758157389635317,
|
70 |
+
"grad_norm": 6.389641284942627,
|
71 |
+
"learning_rate": 4.0413734271699725e-05,
|
72 |
+
"loss": 0.3197,
|
73 |
+
"step": 900
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"epoch": 0.6397952655150352,
|
77 |
+
"grad_norm": 8.652924537658691,
|
78 |
+
"learning_rate": 3.9347408829174664e-05,
|
79 |
+
"loss": 0.3457,
|
80 |
+
"step": 1000
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.7037747920665387,
|
84 |
+
"grad_norm": 9.87730598449707,
|
85 |
+
"learning_rate": 3.828108338664961e-05,
|
86 |
+
"loss": 0.3152,
|
87 |
+
"step": 1100
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"epoch": 0.7677543186180422,
|
91 |
+
"grad_norm": 9.235931396484375,
|
92 |
+
"learning_rate": 3.721475794412455e-05,
|
93 |
+
"loss": 0.3312,
|
94 |
+
"step": 1200
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"epoch": 0.8317338451695457,
|
98 |
+
"grad_norm": 8.75272274017334,
|
99 |
+
"learning_rate": 3.614843250159949e-05,
|
100 |
+
"loss": 0.3098,
|
101 |
+
"step": 1300
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"epoch": 0.8957133717210493,
|
105 |
+
"grad_norm": 3.6930184364318848,
|
106 |
+
"learning_rate": 3.508210705907443e-05,
|
107 |
+
"loss": 0.3057,
|
108 |
+
"step": 1400
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"epoch": 0.9596928982725528,
|
112 |
+
"grad_norm": 15.71256160736084,
|
113 |
+
"learning_rate": 3.4015781616549375e-05,
|
114 |
+
"loss": 0.2994,
|
115 |
+
"step": 1500
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 1.0236724248240563,
|
119 |
+
"grad_norm": 10.11008071899414,
|
120 |
+
"learning_rate": 3.2949456174024315e-05,
|
121 |
+
"loss": 0.2945,
|
122 |
+
"step": 1600
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 1.0876519513755598,
|
126 |
+
"grad_norm": 1.052371859550476,
|
127 |
+
"learning_rate": 3.1883130731499254e-05,
|
128 |
+
"loss": 0.2072,
|
129 |
+
"step": 1700
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 1.1516314779270633,
|
133 |
+
"grad_norm": 0.17214666306972504,
|
134 |
+
"learning_rate": 3.08168052889742e-05,
|
135 |
+
"loss": 0.1915,
|
136 |
+
"step": 1800
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"epoch": 1.2156110044785668,
|
140 |
+
"grad_norm": 3.5573925971984863,
|
141 |
+
"learning_rate": 2.9750479846449137e-05,
|
142 |
+
"loss": 0.2268,
|
143 |
+
"step": 1900
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"epoch": 1.2795905310300704,
|
147 |
+
"grad_norm": 12.984672546386719,
|
148 |
+
"learning_rate": 2.868415440392408e-05,
|
149 |
+
"loss": 0.1639,
|
150 |
+
"step": 2000
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"epoch": 1.3435700575815739,
|
154 |
+
"grad_norm": 0.8138177990913391,
|
155 |
+
"learning_rate": 2.7617828961399022e-05,
|
156 |
+
"loss": 0.1866,
|
157 |
+
"step": 2100
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"epoch": 1.4075495841330774,
|
161 |
+
"grad_norm": 10.373751640319824,
|
162 |
+
"learning_rate": 2.6551503518873962e-05,
|
163 |
+
"loss": 0.2171,
|
164 |
+
"step": 2200
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 1.471529110684581,
|
168 |
+
"grad_norm": 5.024399757385254,
|
169 |
+
"learning_rate": 2.5485178076348905e-05,
|
170 |
+
"loss": 0.1796,
|
171 |
+
"step": 2300
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"epoch": 1.5355086372360844,
|
175 |
+
"grad_norm": 7.260871887207031,
|
176 |
+
"learning_rate": 2.4418852633823844e-05,
|
177 |
+
"loss": 0.1878,
|
178 |
+
"step": 2400
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"epoch": 1.599488163787588,
|
182 |
+
"grad_norm": 6.540918350219727,
|
183 |
+
"learning_rate": 2.3352527191298784e-05,
|
184 |
+
"loss": 0.1675,
|
185 |
+
"step": 2500
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"epoch": 1.6634676903390915,
|
189 |
+
"grad_norm": 2.625058650970459,
|
190 |
+
"learning_rate": 2.2286201748773727e-05,
|
191 |
+
"loss": 0.2044,
|
192 |
+
"step": 2600
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"epoch": 1.727447216890595,
|
196 |
+
"grad_norm": 7.691290855407715,
|
197 |
+
"learning_rate": 2.1219876306248666e-05,
|
198 |
+
"loss": 0.1827,
|
199 |
+
"step": 2700
|
200 |
+
},
|
201 |
+
{
|
202 |
+
"epoch": 1.7914267434420985,
|
203 |
+
"grad_norm": 8.49361515045166,
|
204 |
+
"learning_rate": 2.015355086372361e-05,
|
205 |
+
"loss": 0.1954,
|
206 |
+
"step": 2800
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"epoch": 1.855406269993602,
|
210 |
+
"grad_norm": 0.37825897336006165,
|
211 |
+
"learning_rate": 1.9087225421198552e-05,
|
212 |
+
"loss": 0.1838,
|
213 |
+
"step": 2900
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"epoch": 1.9193857965451055,
|
217 |
+
"grad_norm": 22.31838035583496,
|
218 |
+
"learning_rate": 1.802089997867349e-05,
|
219 |
+
"loss": 0.1847,
|
220 |
+
"step": 3000
|
221 |
+
},
|
222 |
+
{
|
223 |
+
"epoch": 1.983365323096609,
|
224 |
+
"grad_norm": 20.675575256347656,
|
225 |
+
"learning_rate": 1.695457453614843e-05,
|
226 |
+
"loss": 0.1817,
|
227 |
+
"step": 3100
|
228 |
+
},
|
229 |
+
{
|
230 |
+
"epoch": 2.0473448496481126,
|
231 |
+
"grad_norm": 0.051862724125385284,
|
232 |
+
"learning_rate": 1.5888249093623374e-05,
|
233 |
+
"loss": 0.1106,
|
234 |
+
"step": 3200
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"epoch": 2.111324376199616,
|
238 |
+
"grad_norm": 31.099328994750977,
|
239 |
+
"learning_rate": 1.4821923651098315e-05,
|
240 |
+
"loss": 0.0715,
|
241 |
+
"step": 3300
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"epoch": 2.1753039027511196,
|
245 |
+
"grad_norm": 17.968420028686523,
|
246 |
+
"learning_rate": 1.3755598208573256e-05,
|
247 |
+
"loss": 0.0986,
|
248 |
+
"step": 3400
|
249 |
+
},
|
250 |
+
{
|
251 |
+
"epoch": 2.239283429302623,
|
252 |
+
"grad_norm": 11.89964485168457,
|
253 |
+
"learning_rate": 1.2689272766048199e-05,
|
254 |
+
"loss": 0.0842,
|
255 |
+
"step": 3500
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"epoch": 2.3032629558541267,
|
259 |
+
"grad_norm": 0.15594251453876495,
|
260 |
+
"learning_rate": 1.162294732352314e-05,
|
261 |
+
"loss": 0.0859,
|
262 |
+
"step": 3600
|
263 |
+
},
|
264 |
+
{
|
265 |
+
"epoch": 2.36724248240563,
|
266 |
+
"grad_norm": 0.04546676576137543,
|
267 |
+
"learning_rate": 1.0556621880998081e-05,
|
268 |
+
"loss": 0.0831,
|
269 |
+
"step": 3700
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"epoch": 2.4312220089571337,
|
273 |
+
"grad_norm": 0.08984202891588211,
|
274 |
+
"learning_rate": 9.490296438473023e-06,
|
275 |
+
"loss": 0.0859,
|
276 |
+
"step": 3800
|
277 |
+
},
|
278 |
+
{
|
279 |
+
"epoch": 2.495201535508637,
|
280 |
+
"grad_norm": 25.065441131591797,
|
281 |
+
"learning_rate": 8.423970995947964e-06,
|
282 |
+
"loss": 0.0972,
|
283 |
+
"step": 3900
|
284 |
+
},
|
285 |
+
{
|
286 |
+
"epoch": 2.5591810620601407,
|
287 |
+
"grad_norm": 0.09699796140193939,
|
288 |
+
"learning_rate": 7.357645553422905e-06,
|
289 |
+
"loss": 0.0777,
|
290 |
+
"step": 4000
|
291 |
+
},
|
292 |
+
{
|
293 |
+
"epoch": 2.6231605886116443,
|
294 |
+
"grad_norm": 9.286548614501953,
|
295 |
+
"learning_rate": 6.291320110897847e-06,
|
296 |
+
"loss": 0.0896,
|
297 |
+
"step": 4100
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"epoch": 2.6871401151631478,
|
301 |
+
"grad_norm": 26.573453903198242,
|
302 |
+
"learning_rate": 5.224994668372787e-06,
|
303 |
+
"loss": 0.0966,
|
304 |
+
"step": 4200
|
305 |
+
},
|
306 |
+
{
|
307 |
+
"epoch": 2.7511196417146513,
|
308 |
+
"grad_norm": 8.264235496520996,
|
309 |
+
"learning_rate": 4.158669225847729e-06,
|
310 |
+
"loss": 0.0734,
|
311 |
+
"step": 4300
|
312 |
+
},
|
313 |
+
{
|
314 |
+
"epoch": 2.815099168266155,
|
315 |
+
"grad_norm": 29.1925048828125,
|
316 |
+
"learning_rate": 3.09234378332267e-06,
|
317 |
+
"loss": 0.0863,
|
318 |
+
"step": 4400
|
319 |
+
},
|
320 |
+
{
|
321 |
+
"epoch": 2.8790786948176583,
|
322 |
+
"grad_norm": 0.08194595575332642,
|
323 |
+
"learning_rate": 2.0260183407976117e-06,
|
324 |
+
"loss": 0.0607,
|
325 |
+
"step": 4500
|
326 |
+
}
|
327 |
+
],
|
328 |
+
"logging_steps": 100,
|
329 |
+
"max_steps": 4689,
|
330 |
+
"num_input_tokens_seen": 0,
|
331 |
+
"num_train_epochs": 3,
|
332 |
+
"save_steps": 500,
|
333 |
+
"stateful_callbacks": {
|
334 |
+
"TrainerControl": {
|
335 |
+
"args": {
|
336 |
+
"should_epoch_stop": false,
|
337 |
+
"should_evaluate": false,
|
338 |
+
"should_log": false,
|
339 |
+
"should_save": true,
|
340 |
+
"should_training_stop": false
|
341 |
+
},
|
342 |
+
"attributes": {}
|
343 |
+
}
|
344 |
+
},
|
345 |
+
"total_flos": 4734946552258560.0,
|
346 |
+
"train_batch_size": 16,
|
347 |
+
"trial_name": null,
|
348 |
+
"trial_params": null
|
349 |
+
}
|
notebooks/results/checkpoint-4689/config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForSequenceClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 3072,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"problem_type": "single_label_classification",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.51.3",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
notebooks/results/checkpoint-4689/trainer_state.json
ADDED
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_global_step": null,
|
3 |
+
"best_metric": null,
|
4 |
+
"best_model_checkpoint": null,
|
5 |
+
"epoch": 3.0,
|
6 |
+
"eval_steps": 500,
|
7 |
+
"global_step": 4689,
|
8 |
+
"is_hyper_param_search": false,
|
9 |
+
"is_local_process_zero": true,
|
10 |
+
"is_world_process_zero": true,
|
11 |
+
"log_history": [
|
12 |
+
{
|
13 |
+
"epoch": 0.06397952655150352,
|
14 |
+
"grad_norm": 5.188015460968018,
|
15 |
+
"learning_rate": 4.8944337811900195e-05,
|
16 |
+
"loss": 0.5162,
|
17 |
+
"step": 100
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"epoch": 0.12795905310300704,
|
21 |
+
"grad_norm": 8.62886905670166,
|
22 |
+
"learning_rate": 4.7878012369375135e-05,
|
23 |
+
"loss": 0.4123,
|
24 |
+
"step": 200
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.19193857965451055,
|
28 |
+
"grad_norm": 6.661285877227783,
|
29 |
+
"learning_rate": 4.681168692685008e-05,
|
30 |
+
"loss": 0.4106,
|
31 |
+
"step": 300
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.2559181062060141,
|
35 |
+
"grad_norm": 7.992310523986816,
|
36 |
+
"learning_rate": 4.5745361484325014e-05,
|
37 |
+
"loss": 0.3619,
|
38 |
+
"step": 400
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.3198976327575176,
|
42 |
+
"grad_norm": 8.48903751373291,
|
43 |
+
"learning_rate": 4.467903604179996e-05,
|
44 |
+
"loss": 0.3724,
|
45 |
+
"step": 500
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"epoch": 0.3838771593090211,
|
49 |
+
"grad_norm": 7.3620219230651855,
|
50 |
+
"learning_rate": 4.3612710599274906e-05,
|
51 |
+
"loss": 0.3582,
|
52 |
+
"step": 600
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"epoch": 0.44785668586052463,
|
56 |
+
"grad_norm": 7.127757549285889,
|
57 |
+
"learning_rate": 4.254638515674984e-05,
|
58 |
+
"loss": 0.351,
|
59 |
+
"step": 700
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"epoch": 0.5118362124120281,
|
63 |
+
"grad_norm": 8.284778594970703,
|
64 |
+
"learning_rate": 4.1480059714224785e-05,
|
65 |
+
"loss": 0.3517,
|
66 |
+
"step": 800
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 0.5758157389635317,
|
70 |
+
"grad_norm": 6.389641284942627,
|
71 |
+
"learning_rate": 4.0413734271699725e-05,
|
72 |
+
"loss": 0.3197,
|
73 |
+
"step": 900
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"epoch": 0.6397952655150352,
|
77 |
+
"grad_norm": 8.652924537658691,
|
78 |
+
"learning_rate": 3.9347408829174664e-05,
|
79 |
+
"loss": 0.3457,
|
80 |
+
"step": 1000
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.7037747920665387,
|
84 |
+
"grad_norm": 9.87730598449707,
|
85 |
+
"learning_rate": 3.828108338664961e-05,
|
86 |
+
"loss": 0.3152,
|
87 |
+
"step": 1100
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"epoch": 0.7677543186180422,
|
91 |
+
"grad_norm": 9.235931396484375,
|
92 |
+
"learning_rate": 3.721475794412455e-05,
|
93 |
+
"loss": 0.3312,
|
94 |
+
"step": 1200
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"epoch": 0.8317338451695457,
|
98 |
+
"grad_norm": 8.75272274017334,
|
99 |
+
"learning_rate": 3.614843250159949e-05,
|
100 |
+
"loss": 0.3098,
|
101 |
+
"step": 1300
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"epoch": 0.8957133717210493,
|
105 |
+
"grad_norm": 3.6930184364318848,
|
106 |
+
"learning_rate": 3.508210705907443e-05,
|
107 |
+
"loss": 0.3057,
|
108 |
+
"step": 1400
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"epoch": 0.9596928982725528,
|
112 |
+
"grad_norm": 15.71256160736084,
|
113 |
+
"learning_rate": 3.4015781616549375e-05,
|
114 |
+
"loss": 0.2994,
|
115 |
+
"step": 1500
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 1.0236724248240563,
|
119 |
+
"grad_norm": 10.11008071899414,
|
120 |
+
"learning_rate": 3.2949456174024315e-05,
|
121 |
+
"loss": 0.2945,
|
122 |
+
"step": 1600
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 1.0876519513755598,
|
126 |
+
"grad_norm": 1.052371859550476,
|
127 |
+
"learning_rate": 3.1883130731499254e-05,
|
128 |
+
"loss": 0.2072,
|
129 |
+
"step": 1700
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 1.1516314779270633,
|
133 |
+
"grad_norm": 0.17214666306972504,
|
134 |
+
"learning_rate": 3.08168052889742e-05,
|
135 |
+
"loss": 0.1915,
|
136 |
+
"step": 1800
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"epoch": 1.2156110044785668,
|
140 |
+
"grad_norm": 3.5573925971984863,
|
141 |
+
"learning_rate": 2.9750479846449137e-05,
|
142 |
+
"loss": 0.2268,
|
143 |
+
"step": 1900
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"epoch": 1.2795905310300704,
|
147 |
+
"grad_norm": 12.984672546386719,
|
148 |
+
"learning_rate": 2.868415440392408e-05,
|
149 |
+
"loss": 0.1639,
|
150 |
+
"step": 2000
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"epoch": 1.3435700575815739,
|
154 |
+
"grad_norm": 0.8138177990913391,
|
155 |
+
"learning_rate": 2.7617828961399022e-05,
|
156 |
+
"loss": 0.1866,
|
157 |
+
"step": 2100
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"epoch": 1.4075495841330774,
|
161 |
+
"grad_norm": 10.373751640319824,
|
162 |
+
"learning_rate": 2.6551503518873962e-05,
|
163 |
+
"loss": 0.2171,
|
164 |
+
"step": 2200
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 1.471529110684581,
|
168 |
+
"grad_norm": 5.024399757385254,
|
169 |
+
"learning_rate": 2.5485178076348905e-05,
|
170 |
+
"loss": 0.1796,
|
171 |
+
"step": 2300
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"epoch": 1.5355086372360844,
|
175 |
+
"grad_norm": 7.260871887207031,
|
176 |
+
"learning_rate": 2.4418852633823844e-05,
|
177 |
+
"loss": 0.1878,
|
178 |
+
"step": 2400
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"epoch": 1.599488163787588,
|
182 |
+
"grad_norm": 6.540918350219727,
|
183 |
+
"learning_rate": 2.3352527191298784e-05,
|
184 |
+
"loss": 0.1675,
|
185 |
+
"step": 2500
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"epoch": 1.6634676903390915,
|
189 |
+
"grad_norm": 2.625058650970459,
|
190 |
+
"learning_rate": 2.2286201748773727e-05,
|
191 |
+
"loss": 0.2044,
|
192 |
+
"step": 2600
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"epoch": 1.727447216890595,
|
196 |
+
"grad_norm": 7.691290855407715,
|
197 |
+
"learning_rate": 2.1219876306248666e-05,
|
198 |
+
"loss": 0.1827,
|
199 |
+
"step": 2700
|
200 |
+
},
|
201 |
+
{
|
202 |
+
"epoch": 1.7914267434420985,
|
203 |
+
"grad_norm": 8.49361515045166,
|
204 |
+
"learning_rate": 2.015355086372361e-05,
|
205 |
+
"loss": 0.1954,
|
206 |
+
"step": 2800
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"epoch": 1.855406269993602,
|
210 |
+
"grad_norm": 0.37825897336006165,
|
211 |
+
"learning_rate": 1.9087225421198552e-05,
|
212 |
+
"loss": 0.1838,
|
213 |
+
"step": 2900
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"epoch": 1.9193857965451055,
|
217 |
+
"grad_norm": 22.31838035583496,
|
218 |
+
"learning_rate": 1.802089997867349e-05,
|
219 |
+
"loss": 0.1847,
|
220 |
+
"step": 3000
|
221 |
+
},
|
222 |
+
{
|
223 |
+
"epoch": 1.983365323096609,
|
224 |
+
"grad_norm": 20.675575256347656,
|
225 |
+
"learning_rate": 1.695457453614843e-05,
|
226 |
+
"loss": 0.1817,
|
227 |
+
"step": 3100
|
228 |
+
},
|
229 |
+
{
|
230 |
+
"epoch": 2.0473448496481126,
|
231 |
+
"grad_norm": 0.051862724125385284,
|
232 |
+
"learning_rate": 1.5888249093623374e-05,
|
233 |
+
"loss": 0.1106,
|
234 |
+
"step": 3200
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"epoch": 2.111324376199616,
|
238 |
+
"grad_norm": 31.099328994750977,
|
239 |
+
"learning_rate": 1.4821923651098315e-05,
|
240 |
+
"loss": 0.0715,
|
241 |
+
"step": 3300
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"epoch": 2.1753039027511196,
|
245 |
+
"grad_norm": 17.968420028686523,
|
246 |
+
"learning_rate": 1.3755598208573256e-05,
|
247 |
+
"loss": 0.0986,
|
248 |
+
"step": 3400
|
249 |
+
},
|
250 |
+
{
|
251 |
+
"epoch": 2.239283429302623,
|
252 |
+
"grad_norm": 11.89964485168457,
|
253 |
+
"learning_rate": 1.2689272766048199e-05,
|
254 |
+
"loss": 0.0842,
|
255 |
+
"step": 3500
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"epoch": 2.3032629558541267,
|
259 |
+
"grad_norm": 0.15594251453876495,
|
260 |
+
"learning_rate": 1.162294732352314e-05,
|
261 |
+
"loss": 0.0859,
|
262 |
+
"step": 3600
|
263 |
+
},
|
264 |
+
{
|
265 |
+
"epoch": 2.36724248240563,
|
266 |
+
"grad_norm": 0.04546676576137543,
|
267 |
+
"learning_rate": 1.0556621880998081e-05,
|
268 |
+
"loss": 0.0831,
|
269 |
+
"step": 3700
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"epoch": 2.4312220089571337,
|
273 |
+
"grad_norm": 0.08984202891588211,
|
274 |
+
"learning_rate": 9.490296438473023e-06,
|
275 |
+
"loss": 0.0859,
|
276 |
+
"step": 3800
|
277 |
+
},
|
278 |
+
{
|
279 |
+
"epoch": 2.495201535508637,
|
280 |
+
"grad_norm": 25.065441131591797,
|
281 |
+
"learning_rate": 8.423970995947964e-06,
|
282 |
+
"loss": 0.0972,
|
283 |
+
"step": 3900
|
284 |
+
},
|
285 |
+
{
|
286 |
+
"epoch": 2.5591810620601407,
|
287 |
+
"grad_norm": 0.09699796140193939,
|
288 |
+
"learning_rate": 7.357645553422905e-06,
|
289 |
+
"loss": 0.0777,
|
290 |
+
"step": 4000
|
291 |
+
},
|
292 |
+
{
|
293 |
+
"epoch": 2.6231605886116443,
|
294 |
+
"grad_norm": 9.286548614501953,
|
295 |
+
"learning_rate": 6.291320110897847e-06,
|
296 |
+
"loss": 0.0896,
|
297 |
+
"step": 4100
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"epoch": 2.6871401151631478,
|
301 |
+
"grad_norm": 26.573453903198242,
|
302 |
+
"learning_rate": 5.224994668372787e-06,
|
303 |
+
"loss": 0.0966,
|
304 |
+
"step": 4200
|
305 |
+
},
|
306 |
+
{
|
307 |
+
"epoch": 2.7511196417146513,
|
308 |
+
"grad_norm": 8.264235496520996,
|
309 |
+
"learning_rate": 4.158669225847729e-06,
|
310 |
+
"loss": 0.0734,
|
311 |
+
"step": 4300
|
312 |
+
},
|
313 |
+
{
|
314 |
+
"epoch": 2.815099168266155,
|
315 |
+
"grad_norm": 29.1925048828125,
|
316 |
+
"learning_rate": 3.09234378332267e-06,
|
317 |
+
"loss": 0.0863,
|
318 |
+
"step": 4400
|
319 |
+
},
|
320 |
+
{
|
321 |
+
"epoch": 2.8790786948176583,
|
322 |
+
"grad_norm": 0.08194595575332642,
|
323 |
+
"learning_rate": 2.0260183407976117e-06,
|
324 |
+
"loss": 0.0607,
|
325 |
+
"step": 4500
|
326 |
+
},
|
327 |
+
{
|
328 |
+
"epoch": 2.943058221369162,
|
329 |
+
"grad_norm": 0.2947525084018707,
|
330 |
+
"learning_rate": 9.596928982725527e-07,
|
331 |
+
"loss": 0.059,
|
332 |
+
"step": 4600
|
333 |
+
}
|
334 |
+
],
|
335 |
+
"logging_steps": 100,
|
336 |
+
"max_steps": 4689,
|
337 |
+
"num_input_tokens_seen": 0,
|
338 |
+
"num_train_epochs": 3,
|
339 |
+
"save_steps": 500,
|
340 |
+
"stateful_callbacks": {
|
341 |
+
"TrainerControl": {
|
342 |
+
"args": {
|
343 |
+
"should_epoch_stop": false,
|
344 |
+
"should_evaluate": false,
|
345 |
+
"should_log": false,
|
346 |
+
"should_save": true,
|
347 |
+
"should_training_stop": true
|
348 |
+
},
|
349 |
+
"attributes": {}
|
350 |
+
}
|
351 |
+
},
|
352 |
+
"total_flos": 4933332288000000.0,
|
353 |
+
"train_batch_size": 16,
|
354 |
+
"trial_name": null,
|
355 |
+
"trial_params": null
|
356 |
+
}
|
notebooks/results/checkpoint-500/config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForSequenceClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 3072,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"problem_type": "single_label_classification",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.51.3",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
notebooks/results/checkpoint-500/trainer_state.json
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_global_step": null,
|
3 |
+
"best_metric": null,
|
4 |
+
"best_model_checkpoint": null,
|
5 |
+
"epoch": 0.3198976327575176,
|
6 |
+
"eval_steps": 500,
|
7 |
+
"global_step": 500,
|
8 |
+
"is_hyper_param_search": false,
|
9 |
+
"is_local_process_zero": true,
|
10 |
+
"is_world_process_zero": true,
|
11 |
+
"log_history": [
|
12 |
+
{
|
13 |
+
"epoch": 0.06397952655150352,
|
14 |
+
"grad_norm": 5.188015460968018,
|
15 |
+
"learning_rate": 4.8944337811900195e-05,
|
16 |
+
"loss": 0.5162,
|
17 |
+
"step": 100
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"epoch": 0.12795905310300704,
|
21 |
+
"grad_norm": 8.62886905670166,
|
22 |
+
"learning_rate": 4.7878012369375135e-05,
|
23 |
+
"loss": 0.4123,
|
24 |
+
"step": 200
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.19193857965451055,
|
28 |
+
"grad_norm": 6.661285877227783,
|
29 |
+
"learning_rate": 4.681168692685008e-05,
|
30 |
+
"loss": 0.4106,
|
31 |
+
"step": 300
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.2559181062060141,
|
35 |
+
"grad_norm": 7.992310523986816,
|
36 |
+
"learning_rate": 4.5745361484325014e-05,
|
37 |
+
"loss": 0.3619,
|
38 |
+
"step": 400
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.3198976327575176,
|
42 |
+
"grad_norm": 8.48903751373291,
|
43 |
+
"learning_rate": 4.467903604179996e-05,
|
44 |
+
"loss": 0.3724,
|
45 |
+
"step": 500
|
46 |
+
}
|
47 |
+
],
|
48 |
+
"logging_steps": 100,
|
49 |
+
"max_steps": 4689,
|
50 |
+
"num_input_tokens_seen": 0,
|
51 |
+
"num_train_epochs": 3,
|
52 |
+
"save_steps": 500,
|
53 |
+
"stateful_callbacks": {
|
54 |
+
"TrainerControl": {
|
55 |
+
"args": {
|
56 |
+
"should_epoch_stop": false,
|
57 |
+
"should_evaluate": false,
|
58 |
+
"should_log": false,
|
59 |
+
"should_save": true,
|
60 |
+
"should_training_stop": false
|
61 |
+
},
|
62 |
+
"attributes": {}
|
63 |
+
}
|
64 |
+
},
|
65 |
+
"total_flos": 526222110720000.0,
|
66 |
+
"train_batch_size": 16,
|
67 |
+
"trial_name": null,
|
68 |
+
"trial_params": null
|
69 |
+
}
|
venv/Lib/site-packages/anyio-4.9.0.dist-info/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2018 Alex Grönholm
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
+
this software and associated documentation files (the "Software"), to deal in
|
7 |
+
the Software without restriction, including without limitation the rights to
|
8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
+
subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
venv/Lib/site-packages/anyio-4.9.0.dist-info/METADATA
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.2
|
2 |
+
Name: anyio
|
3 |
+
Version: 4.9.0
|
4 |
+
Summary: High level compatibility layer for multiple asynchronous event loop implementations
|
5 |
+
Author-email: Alex Grönholm <[email protected]>
|
6 |
+
License: MIT
|
7 |
+
Project-URL: Documentation, https://anyio.readthedocs.io/en/latest/
|
8 |
+
Project-URL: Changelog, https://anyio.readthedocs.io/en/stable/versionhistory.html
|
9 |
+
Project-URL: Source code, https://github.com/agronholm/anyio
|
10 |
+
Project-URL: Issue tracker, https://github.com/agronholm/anyio/issues
|
11 |
+
Classifier: Development Status :: 5 - Production/Stable
|
12 |
+
Classifier: Intended Audience :: Developers
|
13 |
+
Classifier: License :: OSI Approved :: MIT License
|
14 |
+
Classifier: Framework :: AnyIO
|
15 |
+
Classifier: Typing :: Typed
|
16 |
+
Classifier: Programming Language :: Python
|
17 |
+
Classifier: Programming Language :: Python :: 3
|
18 |
+
Classifier: Programming Language :: Python :: 3.9
|
19 |
+
Classifier: Programming Language :: Python :: 3.10
|
20 |
+
Classifier: Programming Language :: Python :: 3.11
|
21 |
+
Classifier: Programming Language :: Python :: 3.12
|
22 |
+
Classifier: Programming Language :: Python :: 3.13
|
23 |
+
Requires-Python: >=3.9
|
24 |
+
Description-Content-Type: text/x-rst
|
25 |
+
License-File: LICENSE
|
26 |
+
Requires-Dist: exceptiongroup>=1.0.2; python_version < "3.11"
|
27 |
+
Requires-Dist: idna>=2.8
|
28 |
+
Requires-Dist: sniffio>=1.1
|
29 |
+
Requires-Dist: typing_extensions>=4.5; python_version < "3.13"
|
30 |
+
Provides-Extra: trio
|
31 |
+
Requires-Dist: trio>=0.26.1; extra == "trio"
|
32 |
+
Provides-Extra: test
|
33 |
+
Requires-Dist: anyio[trio]; extra == "test"
|
34 |
+
Requires-Dist: blockbuster>=1.5.23; extra == "test"
|
35 |
+
Requires-Dist: coverage[toml]>=7; extra == "test"
|
36 |
+
Requires-Dist: exceptiongroup>=1.2.0; extra == "test"
|
37 |
+
Requires-Dist: hypothesis>=4.0; extra == "test"
|
38 |
+
Requires-Dist: psutil>=5.9; extra == "test"
|
39 |
+
Requires-Dist: pytest>=7.0; extra == "test"
|
40 |
+
Requires-Dist: trustme; extra == "test"
|
41 |
+
Requires-Dist: truststore>=0.9.1; python_version >= "3.10" and extra == "test"
|
42 |
+
Requires-Dist: uvloop>=0.21; (platform_python_implementation == "CPython" and platform_system != "Windows" and python_version < "3.14") and extra == "test"
|
43 |
+
Provides-Extra: doc
|
44 |
+
Requires-Dist: packaging; extra == "doc"
|
45 |
+
Requires-Dist: Sphinx~=8.2; extra == "doc"
|
46 |
+
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
47 |
+
Requires-Dist: sphinx-autodoc-typehints>=1.2.0; extra == "doc"
|
48 |
+
|
49 |
+
.. image:: https://github.com/agronholm/anyio/actions/workflows/test.yml/badge.svg
|
50 |
+
:target: https://github.com/agronholm/anyio/actions/workflows/test.yml
|
51 |
+
:alt: Build Status
|
52 |
+
.. image:: https://coveralls.io/repos/github/agronholm/anyio/badge.svg?branch=master
|
53 |
+
:target: https://coveralls.io/github/agronholm/anyio?branch=master
|
54 |
+
:alt: Code Coverage
|
55 |
+
.. image:: https://readthedocs.org/projects/anyio/badge/?version=latest
|
56 |
+
:target: https://anyio.readthedocs.io/en/latest/?badge=latest
|
57 |
+
:alt: Documentation
|
58 |
+
.. image:: https://badges.gitter.im/gitterHQ/gitter.svg
|
59 |
+
:target: https://gitter.im/python-trio/AnyIO
|
60 |
+
:alt: Gitter chat
|
61 |
+
|
62 |
+
AnyIO is an asynchronous networking and concurrency library that works on top of either asyncio_ or
|
63 |
+
trio_. It implements trio-like `structured concurrency`_ (SC) on top of asyncio and works in harmony
|
64 |
+
with the native SC of trio itself.
|
65 |
+
|
66 |
+
Applications and libraries written against AnyIO's API will run unmodified on either asyncio_ or
|
67 |
+
trio_. AnyIO can also be adopted into a library or application incrementally – bit by bit, no full
|
68 |
+
refactoring necessary. It will blend in with the native libraries of your chosen backend.
|
69 |
+
|
70 |
+
Documentation
|
71 |
+
-------------
|
72 |
+
|
73 |
+
View full documentation at: https://anyio.readthedocs.io/
|
74 |
+
|
75 |
+
Features
|
76 |
+
--------
|
77 |
+
|
78 |
+
AnyIO offers the following functionality:
|
79 |
+
|
80 |
+
* Task groups (nurseries_ in trio terminology)
|
81 |
+
* High-level networking (TCP, UDP and UNIX sockets)
|
82 |
+
|
83 |
+
* `Happy eyeballs`_ algorithm for TCP connections (more robust than that of asyncio on Python
|
84 |
+
3.8)
|
85 |
+
* async/await style UDP sockets (unlike asyncio where you still have to use Transports and
|
86 |
+
Protocols)
|
87 |
+
|
88 |
+
* A versatile API for byte streams and object streams
|
89 |
+
* Inter-task synchronization and communication (locks, conditions, events, semaphores, object
|
90 |
+
streams)
|
91 |
+
* Worker threads
|
92 |
+
* Subprocesses
|
93 |
+
* Asynchronous file I/O (using worker threads)
|
94 |
+
* Signal handling
|
95 |
+
|
96 |
+
AnyIO also comes with its own pytest_ plugin which also supports asynchronous fixtures.
|
97 |
+
It even works with the popular Hypothesis_ library.
|
98 |
+
|
99 |
+
.. _asyncio: https://docs.python.org/3/library/asyncio.html
|
100 |
+
.. _trio: https://github.com/python-trio/trio
|
101 |
+
.. _structured concurrency: https://en.wikipedia.org/wiki/Structured_concurrency
|
102 |
+
.. _nurseries: https://trio.readthedocs.io/en/stable/reference-core.html#nurseries-and-spawning
|
103 |
+
.. _Happy eyeballs: https://en.wikipedia.org/wiki/Happy_Eyeballs
|
104 |
+
.. _pytest: https://docs.pytest.org/en/latest/
|
105 |
+
.. _Hypothesis: https://hypothesis.works/
|
venv/Lib/site-packages/anyio-4.9.0.dist-info/RECORD
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
anyio-4.9.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
2 |
+
anyio-4.9.0.dist-info/LICENSE,sha256=U2GsncWPLvX9LpsJxoKXwX8ElQkJu8gCO9uC6s8iwrA,1081
|
3 |
+
anyio-4.9.0.dist-info/METADATA,sha256=vvkWPXXTbrpTCFK7zdcYwQcSQhx6Q4qITM9t_PEQCrY,4682
|
4 |
+
anyio-4.9.0.dist-info/RECORD,,
|
5 |
+
anyio-4.9.0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
6 |
+
anyio-4.9.0.dist-info/entry_points.txt,sha256=_d6Yu6uiaZmNe0CydowirE9Cmg7zUL2g08tQpoS3Qvc,39
|
7 |
+
anyio-4.9.0.dist-info/top_level.txt,sha256=QglSMiWX8_5dpoVAEIHdEYzvqFMdSYWmCj6tYw2ITkQ,6
|
8 |
+
anyio/__init__.py,sha256=t8bZuNXa5ncwXBaNKbv48BDgZt48RT_zCEtrnPmjNU8,4993
|
9 |
+
anyio/__pycache__/__init__.cpython-312.pyc,,
|
10 |
+
anyio/__pycache__/from_thread.cpython-312.pyc,,
|
11 |
+
anyio/__pycache__/lowlevel.cpython-312.pyc,,
|
12 |
+
anyio/__pycache__/pytest_plugin.cpython-312.pyc,,
|
13 |
+
anyio/__pycache__/to_interpreter.cpython-312.pyc,,
|
14 |
+
anyio/__pycache__/to_process.cpython-312.pyc,,
|
15 |
+
anyio/__pycache__/to_thread.cpython-312.pyc,,
|
16 |
+
anyio/_backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17 |
+
anyio/_backends/__pycache__/__init__.cpython-312.pyc,,
|
18 |
+
anyio/_backends/__pycache__/_asyncio.cpython-312.pyc,,
|
19 |
+
anyio/_backends/__pycache__/_trio.cpython-312.pyc,,
|
20 |
+
anyio/_backends/_asyncio.py,sha256=AT1oaTfCE-9YFxooMlvld2yDqY5U2A-ANMcBDh9eRfI,93455
|
21 |
+
anyio/_backends/_trio.py,sha256=HVfDqRGQ7Xj3JfTcYdgzmC7pZEplqU4NOO5kxNNSZnk,40429
|
22 |
+
anyio/_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23 |
+
anyio/_core/__pycache__/__init__.cpython-312.pyc,,
|
24 |
+
anyio/_core/__pycache__/_asyncio_selector_thread.cpython-312.pyc,,
|
25 |
+
anyio/_core/__pycache__/_eventloop.cpython-312.pyc,,
|
26 |
+
anyio/_core/__pycache__/_exceptions.cpython-312.pyc,,
|
27 |
+
anyio/_core/__pycache__/_fileio.cpython-312.pyc,,
|
28 |
+
anyio/_core/__pycache__/_resources.cpython-312.pyc,,
|
29 |
+
anyio/_core/__pycache__/_signals.cpython-312.pyc,,
|
30 |
+
anyio/_core/__pycache__/_sockets.cpython-312.pyc,,
|
31 |
+
anyio/_core/__pycache__/_streams.cpython-312.pyc,,
|
32 |
+
anyio/_core/__pycache__/_subprocesses.cpython-312.pyc,,
|
33 |
+
anyio/_core/__pycache__/_synchronization.cpython-312.pyc,,
|
34 |
+
anyio/_core/__pycache__/_tasks.cpython-312.pyc,,
|
35 |
+
anyio/_core/__pycache__/_tempfile.cpython-312.pyc,,
|
36 |
+
anyio/_core/__pycache__/_testing.cpython-312.pyc,,
|
37 |
+
anyio/_core/__pycache__/_typedattr.cpython-312.pyc,,
|
38 |
+
anyio/_core/_asyncio_selector_thread.py,sha256=2PdxFM3cs02Kp6BSppbvmRT7q7asreTW5FgBxEsflBo,5626
|
39 |
+
anyio/_core/_eventloop.py,sha256=t_tAwBFPjF8jrZGjlJ6bbYy6KA3bjsbZxV9mvh9t1i0,4695
|
40 |
+
anyio/_core/_exceptions.py,sha256=RlPRlwastdmfDPoskdXNO6SI8_l3fclA2wtW6cokU9I,3503
|
41 |
+
anyio/_core/_fileio.py,sha256=qFZhkLIz0cGXluvih_vcPUTucgq8UFVgsTCtYbijZIg,23340
|
42 |
+
anyio/_core/_resources.py,sha256=NbmU5O5UX3xEyACnkmYX28Fmwdl-f-ny0tHym26e0w0,435
|
43 |
+
anyio/_core/_signals.py,sha256=vulT1M1xdLYtAR-eY5TamIgaf1WTlOwOrMGwswlTTr8,905
|
44 |
+
anyio/_core/_sockets.py,sha256=5Okc_UThGDEN9KCnsIhqWPRHBNuSy6b4NmG1i51TVF4,27150
|
45 |
+
anyio/_core/_streams.py,sha256=OnaKgoDD-FcMSwLvkoAUGP51sG2ZdRvMpxt9q2w1gYA,1804
|
46 |
+
anyio/_core/_subprocesses.py,sha256=EXm5igL7dj55iYkPlbYVAqtbqxJxjU-6OndSTIx9SRg,8047
|
47 |
+
anyio/_core/_synchronization.py,sha256=DwUh8Tl6cG_UMVC_GyzPoC_U9BpfDfjMl9SINSxcZN4,20320
|
48 |
+
anyio/_core/_tasks.py,sha256=f3CuWwo06cCZ6jaOv-JHFKWkgpgf2cvaF25Oh4augMA,4757
|
49 |
+
anyio/_core/_tempfile.py,sha256=s-_ucacXbxBH5Bo5eo65lN0lPwZQd5B8yNN_9nARpCM,19696
|
50 |
+
anyio/_core/_testing.py,sha256=YUGwA5cgFFbUTv4WFd7cv_BSVr4ryTtPp8owQA3JdWE,2118
|
51 |
+
anyio/_core/_typedattr.py,sha256=P4ozZikn3-DbpoYcvyghS_FOYAgbmUxeoU8-L_07pZM,2508
|
52 |
+
anyio/abc/__init__.py,sha256=c2OQbTCS_fQowviMXanLPh8m29ccwkXmpDr7uyNZYOo,2652
|
53 |
+
anyio/abc/__pycache__/__init__.cpython-312.pyc,,
|
54 |
+
anyio/abc/__pycache__/_eventloop.cpython-312.pyc,,
|
55 |
+
anyio/abc/__pycache__/_resources.cpython-312.pyc,,
|
56 |
+
anyio/abc/__pycache__/_sockets.cpython-312.pyc,,
|
57 |
+
anyio/abc/__pycache__/_streams.cpython-312.pyc,,
|
58 |
+
anyio/abc/__pycache__/_subprocesses.cpython-312.pyc,,
|
59 |
+
anyio/abc/__pycache__/_tasks.cpython-312.pyc,,
|
60 |
+
anyio/abc/__pycache__/_testing.cpython-312.pyc,,
|
61 |
+
anyio/abc/_eventloop.py,sha256=UmL8DZCvQTgxzmyBZcGm9kWj9VQY8BMWueLh5S8yWN4,9682
|
62 |
+
anyio/abc/_resources.py,sha256=DrYvkNN1hH6Uvv5_5uKySvDsnknGVDe8FCKfko0VtN8,783
|
63 |
+
anyio/abc/_sockets.py,sha256=KhWtJxan8jpBXKwPaFeQzI4iRXdFaOIn0HXtDZnaO7U,6262
|
64 |
+
anyio/abc/_streams.py,sha256=He_JpkAW2g5veOzcUq0XsRC2nId_i35L-d8cs7Uj1ZQ,6598
|
65 |
+
anyio/abc/_subprocesses.py,sha256=cumAPJTktOQtw63IqG0lDpyZqu_l1EElvQHMiwJgL08,2067
|
66 |
+
anyio/abc/_tasks.py,sha256=yJWbMwowvqjlAX4oJ3l9Is1w-zwynr2lX1Z02AWJqsY,3080
|
67 |
+
anyio/abc/_testing.py,sha256=tBJUzkSfOXJw23fe8qSJ03kJlShOYjjaEyFB6k6MYT8,1821
|
68 |
+
anyio/from_thread.py,sha256=MbXHZpgM9wgsRkbGhMNMomEGYj7Y_QYq6a5BZ3c5Ev8,17478
|
69 |
+
anyio/lowlevel.py,sha256=nkgmW--SdxGVp0cmLUYazjkigveRm5HY7-gW8Bpp9oY,4169
|
70 |
+
anyio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
71 |
+
anyio/pytest_plugin.py,sha256=qXNwk9Pa7hPQKWocgLl9qijqKGMkGzdH2wJa-jPkGUM,9375
|
72 |
+
anyio/streams/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
73 |
+
anyio/streams/__pycache__/__init__.cpython-312.pyc,,
|
74 |
+
anyio/streams/__pycache__/buffered.cpython-312.pyc,,
|
75 |
+
anyio/streams/__pycache__/file.cpython-312.pyc,,
|
76 |
+
anyio/streams/__pycache__/memory.cpython-312.pyc,,
|
77 |
+
anyio/streams/__pycache__/stapled.cpython-312.pyc,,
|
78 |
+
anyio/streams/__pycache__/text.cpython-312.pyc,,
|
79 |
+
anyio/streams/__pycache__/tls.cpython-312.pyc,,
|
80 |
+
anyio/streams/buffered.py,sha256=UCldKC168YuLvT7n3HtNPnQ2iWAMSTYQWbZvzLwMwkM,4500
|
81 |
+
anyio/streams/file.py,sha256=6uoTNb5KbMoj-6gS3_xrrL8uZN8Q4iIvOS1WtGyFfKw,4383
|
82 |
+
anyio/streams/memory.py,sha256=o1OVVx0OooteTTe2GytJreum93Ucuw5s4cAsr3X0-Ag,10560
|
83 |
+
anyio/streams/stapled.py,sha256=U09pCrmOw9kkNhe6tKopsm1QIMT1lFTFvtb-A7SIe4k,4302
|
84 |
+
anyio/streams/text.py,sha256=6x8w8xlfCZKTUWQoJiMPoMhSSJFUBRKgoBNSBtbd9yg,5094
|
85 |
+
anyio/streams/tls.py,sha256=HxzpVmUgo8SUSIBass_lvef1pAI1uRSrnysM3iEGzl4,13199
|
86 |
+
anyio/to_interpreter.py,sha256=UhuNCIucCRN7ZtyJg35Mlamzs1JpgDvK4xnL4TDWrAo,6527
|
87 |
+
anyio/to_process.py,sha256=ZvruelRM-HNmqDaql4sdNODg2QD_uSlwSCxnV4OhsfQ,9595
|
88 |
+
anyio/to_thread.py,sha256=WM2JQ2MbVsd5D5CM08bQiTwzZIvpsGjfH1Fy247KoDQ,2396
|
venv/Lib/site-packages/anyio-4.9.0.dist-info/WHEEL
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: setuptools (76.0.0)
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-any
|
5 |
+
|
venv/Lib/site-packages/anyio-4.9.0.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
anyio
|
venv/Lib/site-packages/argon2/__init__.py
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Argon2 for Python
|
5 |
+
"""
|
6 |
+
|
7 |
+
from . import exceptions, low_level, profiles
|
8 |
+
from ._legacy import hash_password, hash_password_raw, verify_password
|
9 |
+
from ._password_hasher import (
|
10 |
+
DEFAULT_HASH_LENGTH,
|
11 |
+
DEFAULT_MEMORY_COST,
|
12 |
+
DEFAULT_PARALLELISM,
|
13 |
+
DEFAULT_RANDOM_SALT_LENGTH,
|
14 |
+
DEFAULT_TIME_COST,
|
15 |
+
PasswordHasher,
|
16 |
+
)
|
17 |
+
from ._utils import Parameters, extract_parameters
|
18 |
+
from .low_level import Type
|
19 |
+
|
20 |
+
|
21 |
+
__title__ = "argon2-cffi"
|
22 |
+
|
23 |
+
__author__ = "Hynek Schlawack"
|
24 |
+
__copyright__ = "Copyright (c) 2015 " + __author__
|
25 |
+
__license__ = "MIT"
|
26 |
+
|
27 |
+
|
28 |
+
__all__ = [
|
29 |
+
"DEFAULT_HASH_LENGTH",
|
30 |
+
"DEFAULT_MEMORY_COST",
|
31 |
+
"DEFAULT_PARALLELISM",
|
32 |
+
"DEFAULT_RANDOM_SALT_LENGTH",
|
33 |
+
"DEFAULT_TIME_COST",
|
34 |
+
"Parameters",
|
35 |
+
"PasswordHasher",
|
36 |
+
"Type",
|
37 |
+
"exceptions",
|
38 |
+
"extract_parameters",
|
39 |
+
"hash_password",
|
40 |
+
"hash_password_raw",
|
41 |
+
"low_level",
|
42 |
+
"profiles",
|
43 |
+
"verify_password",
|
44 |
+
]
|
45 |
+
|
46 |
+
|
47 |
+
def __getattr__(name: str) -> str:
|
48 |
+
dunder_to_metadata = {
|
49 |
+
"__version__": "version",
|
50 |
+
"__description__": "summary",
|
51 |
+
"__uri__": "",
|
52 |
+
"__url__": "",
|
53 |
+
"__email__": "",
|
54 |
+
}
|
55 |
+
if name not in dunder_to_metadata:
|
56 |
+
msg = f"module {__name__} has no attribute {name}"
|
57 |
+
raise AttributeError(msg)
|
58 |
+
|
59 |
+
import sys
|
60 |
+
import warnings
|
61 |
+
|
62 |
+
if sys.version_info < (3, 8):
|
63 |
+
from importlib_metadata import metadata
|
64 |
+
else:
|
65 |
+
from importlib.metadata import metadata
|
66 |
+
|
67 |
+
warnings.warn(
|
68 |
+
f"Accessing argon2.{name} is deprecated and will be "
|
69 |
+
"removed in a future release. Use importlib.metadata directly "
|
70 |
+
"to query for structlog's packaging metadata.",
|
71 |
+
DeprecationWarning,
|
72 |
+
stacklevel=2,
|
73 |
+
)
|
74 |
+
|
75 |
+
meta = metadata("argon2-cffi")
|
76 |
+
|
77 |
+
if name in ("__uri__", "__url__"):
|
78 |
+
return meta["Project-URL"].split(" ", 1)[-1]
|
79 |
+
|
80 |
+
if name == "__email__":
|
81 |
+
return meta["Author-email"].split("<", 1)[1].rstrip(">")
|
82 |
+
|
83 |
+
return meta[dunder_to_metadata[name]]
|
84 |
+
|
85 |
+
|
86 |
+
# Make nicer public names.
|
87 |
+
__locals = locals()
|
88 |
+
for __name in __all__:
|
89 |
+
if not __name.startswith(("__", "DEFAULT_")) and not __name.islower():
|
90 |
+
__locals[__name].__module__ = "argon2"
|
91 |
+
del __locals
|
92 |
+
del __name # pyright: ignore[reportUnboundVariable]
|
venv/Lib/site-packages/argon2/__main__.py
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
import argparse
|
6 |
+
import sys
|
7 |
+
import timeit
|
8 |
+
|
9 |
+
from . import (
|
10 |
+
DEFAULT_HASH_LENGTH,
|
11 |
+
DEFAULT_MEMORY_COST,
|
12 |
+
DEFAULT_PARALLELISM,
|
13 |
+
DEFAULT_TIME_COST,
|
14 |
+
PasswordHasher,
|
15 |
+
profiles,
|
16 |
+
)
|
17 |
+
|
18 |
+
|
19 |
+
def main(argv: list[str]) -> None:
|
20 |
+
parser = argparse.ArgumentParser(description="Benchmark Argon2.")
|
21 |
+
parser.add_argument(
|
22 |
+
"-n", type=int, default=100, help="Number of iterations to measure."
|
23 |
+
)
|
24 |
+
parser.add_argument(
|
25 |
+
"-t", type=int, help="`time_cost`", default=DEFAULT_TIME_COST
|
26 |
+
)
|
27 |
+
parser.add_argument(
|
28 |
+
"-m", type=int, help="`memory_cost`", default=DEFAULT_MEMORY_COST
|
29 |
+
)
|
30 |
+
parser.add_argument(
|
31 |
+
"-p", type=int, help="`parallelism`", default=DEFAULT_PARALLELISM
|
32 |
+
)
|
33 |
+
parser.add_argument(
|
34 |
+
"-l", type=int, help="`hash_length`", default=DEFAULT_HASH_LENGTH
|
35 |
+
)
|
36 |
+
parser.add_argument(
|
37 |
+
"--profile",
|
38 |
+
type=str,
|
39 |
+
help="A profile from `argon2.profiles. Takes precedence.",
|
40 |
+
default=None,
|
41 |
+
)
|
42 |
+
|
43 |
+
args = parser.parse_args(argv[1:])
|
44 |
+
|
45 |
+
password = b"secret"
|
46 |
+
if args.profile:
|
47 |
+
ph = PasswordHasher.from_parameters(
|
48 |
+
getattr(profiles, args.profile.upper())
|
49 |
+
)
|
50 |
+
else:
|
51 |
+
ph = PasswordHasher(
|
52 |
+
time_cost=args.t,
|
53 |
+
memory_cost=args.m,
|
54 |
+
parallelism=args.p,
|
55 |
+
hash_len=args.l,
|
56 |
+
)
|
57 |
+
hash = ph.hash(password)
|
58 |
+
|
59 |
+
params = {
|
60 |
+
"time_cost": (ph.time_cost, "iterations"),
|
61 |
+
"memory_cost": (ph.memory_cost, "KiB"),
|
62 |
+
"parallelism": (ph.parallelism, "threads"),
|
63 |
+
"hash_len": (ph.hash_len, "bytes"),
|
64 |
+
}
|
65 |
+
|
66 |
+
print("Running Argon2id %d times with:" % (args.n,))
|
67 |
+
|
68 |
+
for k, v in sorted(params.items()):
|
69 |
+
print("%s: %d %s" % (k, v[0], v[1]))
|
70 |
+
|
71 |
+
print("\nMeasuring...")
|
72 |
+
duration = timeit.timeit(
|
73 |
+
f"ph.verify({hash!r}, {password!r})",
|
74 |
+
setup=f"""\
|
75 |
+
from argon2 import PasswordHasher, Type
|
76 |
+
|
77 |
+
ph = PasswordHasher(
|
78 |
+
time_cost={args.t!r},
|
79 |
+
memory_cost={args.m!r},
|
80 |
+
parallelism={args.p!r},
|
81 |
+
hash_len={args.l!r},
|
82 |
+
)
|
83 |
+
gc.enable()""",
|
84 |
+
number=args.n,
|
85 |
+
)
|
86 |
+
print(f"\n{duration / args.n * 1000:.1f}ms per password verification")
|
87 |
+
|
88 |
+
|
89 |
+
if __name__ == "__main__": # pragma: no cover
|
90 |
+
main(sys.argv)
|
venv/Lib/site-packages/argon2/_legacy.py
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Legacy mid-level functions.
|
5 |
+
"""
|
6 |
+
|
7 |
+
from __future__ import annotations
|
8 |
+
|
9 |
+
import os
|
10 |
+
import warnings
|
11 |
+
|
12 |
+
from ._password_hasher import (
|
13 |
+
DEFAULT_HASH_LENGTH,
|
14 |
+
DEFAULT_MEMORY_COST,
|
15 |
+
DEFAULT_PARALLELISM,
|
16 |
+
DEFAULT_RANDOM_SALT_LENGTH,
|
17 |
+
DEFAULT_TIME_COST,
|
18 |
+
)
|
19 |
+
from ._typing import Literal
|
20 |
+
from .low_level import Type, hash_secret, hash_secret_raw, verify_secret
|
21 |
+
|
22 |
+
|
23 |
+
_INSTEAD = " is deprecated, use argon2.PasswordHasher instead"
|
24 |
+
|
25 |
+
|
26 |
+
def hash_password(
|
27 |
+
password: bytes,
|
28 |
+
salt: bytes | None = None,
|
29 |
+
time_cost: int = DEFAULT_TIME_COST,
|
30 |
+
memory_cost: int = DEFAULT_MEMORY_COST,
|
31 |
+
parallelism: int = DEFAULT_PARALLELISM,
|
32 |
+
hash_len: int = DEFAULT_HASH_LENGTH,
|
33 |
+
type: Type = Type.I,
|
34 |
+
) -> bytes:
|
35 |
+
"""
|
36 |
+
Legacy alias for :func:`argon2.low_level.hash_secret` with default
|
37 |
+
parameters.
|
38 |
+
|
39 |
+
.. deprecated:: 16.0.0
|
40 |
+
Use :class:`argon2.PasswordHasher` for passwords.
|
41 |
+
"""
|
42 |
+
warnings.warn(
|
43 |
+
"argon2.hash_password" + _INSTEAD, DeprecationWarning, stacklevel=2
|
44 |
+
)
|
45 |
+
if salt is None:
|
46 |
+
salt = os.urandom(DEFAULT_RANDOM_SALT_LENGTH)
|
47 |
+
return hash_secret(
|
48 |
+
password, salt, time_cost, memory_cost, parallelism, hash_len, type
|
49 |
+
)
|
50 |
+
|
51 |
+
|
52 |
+
def hash_password_raw(
|
53 |
+
password: bytes,
|
54 |
+
salt: bytes | None = None,
|
55 |
+
time_cost: int = DEFAULT_TIME_COST,
|
56 |
+
memory_cost: int = DEFAULT_MEMORY_COST,
|
57 |
+
parallelism: int = DEFAULT_PARALLELISM,
|
58 |
+
hash_len: int = DEFAULT_HASH_LENGTH,
|
59 |
+
type: Type = Type.I,
|
60 |
+
) -> bytes:
|
61 |
+
"""
|
62 |
+
Legacy alias for :func:`argon2.low_level.hash_secret_raw` with default
|
63 |
+
parameters.
|
64 |
+
|
65 |
+
.. deprecated:: 16.0.0
|
66 |
+
Use :class:`argon2.PasswordHasher` for passwords.
|
67 |
+
"""
|
68 |
+
warnings.warn(
|
69 |
+
"argon2.hash_password_raw" + _INSTEAD, DeprecationWarning, stacklevel=2
|
70 |
+
)
|
71 |
+
if salt is None:
|
72 |
+
salt = os.urandom(DEFAULT_RANDOM_SALT_LENGTH)
|
73 |
+
return hash_secret_raw(
|
74 |
+
password, salt, time_cost, memory_cost, parallelism, hash_len, type
|
75 |
+
)
|
76 |
+
|
77 |
+
|
78 |
+
def verify_password(
|
79 |
+
hash: bytes, password: bytes, type: Type = Type.I
|
80 |
+
) -> Literal[True]:
|
81 |
+
"""
|
82 |
+
Legacy alias for :func:`argon2.low_level.verify_secret` with default
|
83 |
+
parameters.
|
84 |
+
|
85 |
+
.. deprecated:: 16.0.0
|
86 |
+
Use :class:`argon2.PasswordHasher` for passwords.
|
87 |
+
"""
|
88 |
+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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
import os
|
6 |
+
|
7 |
+
from typing import ClassVar
|
8 |
+
|
9 |
+
from ._typing import Literal
|
10 |
+
from ._utils import Parameters, _check_types, extract_parameters
|
11 |
+
from .exceptions import InvalidHashError
|
12 |
+
from .low_level import Type, hash_secret, verify_secret
|
13 |
+
from .profiles import RFC_9106_LOW_MEMORY
|
14 |
+
|
15 |
+
|
16 |
+
DEFAULT_RANDOM_SALT_LENGTH = RFC_9106_LOW_MEMORY.salt_len
|
17 |
+
DEFAULT_HASH_LENGTH = RFC_9106_LOW_MEMORY.hash_len
|
18 |
+
DEFAULT_TIME_COST = RFC_9106_LOW_MEMORY.time_cost
|
19 |
+
DEFAULT_MEMORY_COST = RFC_9106_LOW_MEMORY.memory_cost
|
20 |
+
DEFAULT_PARALLELISM = RFC_9106_LOW_MEMORY.parallelism
|
21 |
+
|
22 |
+
|
23 |
+
def _ensure_bytes(s: bytes | str, encoding: str) -> bytes:
|
24 |
+
"""
|
25 |
+
Ensure *s* is a bytes string. Encode using *encoding* if it isn't.
|
26 |
+
"""
|
27 |
+
if isinstance(s, bytes):
|
28 |
+
return s
|
29 |
+
return s.encode(encoding)
|
30 |
+
|
31 |
+
|
32 |
+
class PasswordHasher:
|
33 |
+
r"""
|
34 |
+
High level class to hash passwords with sensible defaults.
|
35 |
+
|
36 |
+
Uses Argon2\ **id** by default and always uses a random salt_ for hashing.
|
37 |
+
But it can verify any type of Argon2 as long as the hash is correctly
|
38 |
+
encoded.
|
39 |
+
|
40 |
+
The reason for this being a class is both for convenience to carry
|
41 |
+
parameters and to verify the parameters only *once*. Any unnecessary
|
42 |
+
slowdown when hashing is a tangible advantage for a brute force attacker.
|
43 |
+
|
44 |
+
:param int time_cost: Defines the amount of computation realized and
|
45 |
+
therefore the execution time, given in number of iterations.
|
46 |
+
:param int memory_cost: Defines the memory usage, given in kibibytes_.
|
47 |
+
:param int parallelism: Defines the number of parallel threads (*changes*
|
48 |
+
the resulting hash value).
|
49 |
+
:param int hash_len: Length of the hash in bytes.
|
50 |
+
:param int salt_len: Length of random salt to be generated for each
|
51 |
+
password.
|
52 |
+
:param str encoding: The Argon2 C library expects bytes. So if
|
53 |
+
:meth:`hash` or :meth:`verify` are passed a ``str``, it will be
|
54 |
+
encoded using this encoding.
|
55 |
+
:param Type type: Argon2 type to use. Only change for interoperability
|
56 |
+
with legacy systems.
|
57 |
+
|
58 |
+
.. versionadded:: 16.0.0
|
59 |
+
.. versionchanged:: 18.2.0
|
60 |
+
Switch from Argon2i to Argon2id based on the recommendation by the
|
61 |
+
current RFC draft. See also :doc:`parameters`.
|
62 |
+
.. versionchanged:: 18.2.0
|
63 |
+
Changed default *memory_cost* to 100 MiB and default *parallelism* to 8.
|
64 |
+
.. versionchanged:: 18.2.0 ``verify`` now will determine the type of hash.
|
65 |
+
.. versionchanged:: 18.3.0 The Argon2 type is configurable now.
|
66 |
+
.. versionadded:: 21.2.0 :meth:`from_parameters`
|
67 |
+
.. versionchanged:: 21.2.0
|
68 |
+
Changed defaults to :data:`argon2.profiles.RFC_9106_LOW_MEMORY`.
|
69 |
+
|
70 |
+
.. _salt: https://en.wikipedia.org/wiki/Salt_(cryptography)
|
71 |
+
.. _kibibytes: https://en.wikipedia.org/wiki/Binary_prefix#kibi
|
72 |
+
"""
|
73 |
+
__slots__ = ["_parameters", "encoding"]
|
74 |
+
|
75 |
+
_parameters: Parameters
|
76 |
+
encoding: str
|
77 |
+
|
78 |
+
def __init__(
|
79 |
+
self,
|
80 |
+
time_cost: int = DEFAULT_TIME_COST,
|
81 |
+
memory_cost: int = DEFAULT_MEMORY_COST,
|
82 |
+
parallelism: int = DEFAULT_PARALLELISM,
|
83 |
+
hash_len: int = DEFAULT_HASH_LENGTH,
|
84 |
+
salt_len: int = DEFAULT_RANDOM_SALT_LENGTH,
|
85 |
+
encoding: str = "utf-8",
|
86 |
+
type: Type = Type.ID,
|
87 |
+
):
|
88 |
+
e = _check_types(
|
89 |
+
time_cost=(time_cost, int),
|
90 |
+
memory_cost=(memory_cost, int),
|
91 |
+
parallelism=(parallelism, int),
|
92 |
+
hash_len=(hash_len, int),
|
93 |
+
salt_len=(salt_len, int),
|
94 |
+
encoding=(encoding, str),
|
95 |
+
type=(type, Type),
|
96 |
+
)
|
97 |
+
if e:
|
98 |
+
raise TypeError(e)
|
99 |
+
|
100 |
+
# Cache a Parameters object for check_needs_rehash.
|
101 |
+
self._parameters = Parameters(
|
102 |
+
type=type,
|
103 |
+
version=19,
|
104 |
+
salt_len=salt_len,
|
105 |
+
hash_len=hash_len,
|
106 |
+
time_cost=time_cost,
|
107 |
+
memory_cost=memory_cost,
|
108 |
+
parallelism=parallelism,
|
109 |
+
)
|
110 |
+
self.encoding = encoding
|
111 |
+
|
112 |
+
@classmethod
|
113 |
+
def from_parameters(cls, params: Parameters) -> PasswordHasher:
|
114 |
+
"""
|
115 |
+
Construct a `PasswordHasher` from *params*.
|
116 |
+
|
117 |
+
.. versionadded:: 21.2.0
|
118 |
+
"""
|
119 |
+
ph = cls()
|
120 |
+
ph._parameters = params
|
121 |
+
|
122 |
+
return ph
|
123 |
+
|
124 |
+
@property
|
125 |
+
def time_cost(self) -> int:
|
126 |
+
return self._parameters.time_cost
|
127 |
+
|
128 |
+
@property
|
129 |
+
def memory_cost(self) -> int:
|
130 |
+
return self._parameters.memory_cost
|
131 |
+
|
132 |
+
@property
|
133 |
+
def parallelism(self) -> int:
|
134 |
+
return self._parameters.parallelism
|
135 |
+
|
136 |
+
@property
|
137 |
+
def hash_len(self) -> int:
|
138 |
+
return self._parameters.hash_len
|
139 |
+
|
140 |
+
@property
|
141 |
+
def salt_len(self) -> int:
|
142 |
+
return self._parameters.salt_len
|
143 |
+
|
144 |
+
@property
|
145 |
+
def type(self) -> Type:
|
146 |
+
return self._parameters.type
|
147 |
+
|
148 |
+
def hash(self, password: str | bytes, *, salt: bytes | None = None) -> str:
|
149 |
+
"""
|
150 |
+
Hash *password* and return an encoded hash.
|
151 |
+
|
152 |
+
Parameters:
|
153 |
+
|
154 |
+
password: Password to hash.
|
155 |
+
|
156 |
+
salt: If None, a random salt is securely created.
|
157 |
+
|
158 |
+
.. danger::
|
159 |
+
|
160 |
+
You should **not** pass a salt unless you really know what
|
161 |
+
you are doing.
|
162 |
+
|
163 |
+
Raises:
|
164 |
+
|
165 |
+
argon2.exceptions.HashingError: If hashing fails.
|
166 |
+
|
167 |
+
Returns:
|
168 |
+
|
169 |
+
Hashed *password*.
|
170 |
+
|
171 |
+
.. versionadded:: 23.1.0 *salt* parameter
|
172 |
+
"""
|
173 |
+
return hash_secret(
|
174 |
+
secret=_ensure_bytes(password, self.encoding),
|
175 |
+
salt=salt or os.urandom(self.salt_len),
|
176 |
+
time_cost=self.time_cost,
|
177 |
+
memory_cost=self.memory_cost,
|
178 |
+
parallelism=self.parallelism,
|
179 |
+
hash_len=self.hash_len,
|
180 |
+
type=self.type,
|
181 |
+
).decode("ascii")
|
182 |
+
|
183 |
+
_header_to_type: ClassVar[dict[bytes, Type]] = {
|
184 |
+
b"$argon2i$": Type.I,
|
185 |
+
b"$argon2d$": Type.D,
|
186 |
+
b"$argon2id": Type.ID,
|
187 |
+
}
|
188 |
+
|
189 |
+
def verify(
|
190 |
+
self, hash: str | bytes, password: str | bytes
|
191 |
+
) -> Literal[True]:
|
192 |
+
"""
|
193 |
+
Verify that *password* matches *hash*.
|
194 |
+
|
195 |
+
.. warning::
|
196 |
+
|
197 |
+
It is assumed that the caller is in full control of the hash. No
|
198 |
+
other parsing than the determination of the hash type is done by
|
199 |
+
*argon2-cffi*.
|
200 |
+
|
201 |
+
:param hash: An encoded hash as returned from
|
202 |
+
:meth:`PasswordHasher.hash`.
|
203 |
+
:type hash: ``bytes`` or ``str``
|
204 |
+
|
205 |
+
:param password: The password to verify.
|
206 |
+
:type password: ``bytes`` or ``str``
|
207 |
+
|
208 |
+
:raises argon2.exceptions.VerifyMismatchError: If verification fails
|
209 |
+
because *hash* is not valid for *password*.
|
210 |
+
:raises argon2.exceptions.VerificationError: If verification fails for
|
211 |
+
other reasons.
|
212 |
+
:raises argon2.exceptions.InvalidHashError: If *hash* is so clearly
|
213 |
+
invalid, that it couldn't be passed to Argon2.
|
214 |
+
|
215 |
+
:return: ``True`` on success, raise
|
216 |
+
:exc:`~argon2.exceptions.VerificationError` otherwise.
|
217 |
+
:rtype: bool
|
218 |
+
|
219 |
+
.. versionchanged:: 16.1.0
|
220 |
+
Raise :exc:`~argon2.exceptions.VerifyMismatchError` on mismatches
|
221 |
+
instead of its more generic superclass.
|
222 |
+
.. versionadded:: 18.2.0 Hash type agility.
|
223 |
+
"""
|
224 |
+
hash = _ensure_bytes(hash, "ascii")
|
225 |
+
try:
|
226 |
+
hash_type = self._header_to_type[hash[:9]]
|
227 |
+
except LookupError:
|
228 |
+
raise InvalidHashError from None
|
229 |
+
|
230 |
+
return verify_secret(
|
231 |
+
hash, _ensure_bytes(password, self.encoding), hash_type
|
232 |
+
)
|
233 |
+
|
234 |
+
def check_needs_rehash(self, hash: str) -> bool:
|
235 |
+
"""
|
236 |
+
Check whether *hash* was created using the instance's parameters.
|
237 |
+
|
238 |
+
Whenever your Argon2 parameters -- or *argon2-cffi*'s defaults! --
|
239 |
+
change, you should rehash your passwords at the next opportunity. The
|
240 |
+
common approach is to do that whenever a user logs in, since that
|
241 |
+
should be the only time when you have access to the cleartext
|
242 |
+
password.
|
243 |
+
|
244 |
+
Therefore it's best practice to check -- and if necessary rehash --
|
245 |
+
passwords after each successful authentication.
|
246 |
+
|
247 |
+
:rtype: bool
|
248 |
+
|
249 |
+
.. versionadded:: 18.2.0
|
250 |
+
"""
|
251 |
+
return self._parameters != extract_parameters(hash)
|
venv/Lib/site-packages/argon2/_typing.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
import sys
|
6 |
+
|
7 |
+
|
8 |
+
# try/except ImportError does NOT work.
|
9 |
+
# c.f. https://github.com/python/mypy/issues/8520
|
10 |
+
if sys.version_info >= (3, 8):
|
11 |
+
from typing import Literal
|
12 |
+
else:
|
13 |
+
from typing_extensions import Literal
|
14 |
+
|
15 |
+
__all__ = ["Literal"]
|
venv/Lib/site-packages/argon2/_utils.py
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
from dataclasses import dataclass
|
6 |
+
from typing import Any
|
7 |
+
|
8 |
+
from .exceptions import InvalidHashError
|
9 |
+
from .low_level import Type
|
10 |
+
|
11 |
+
|
12 |
+
NoneType = type(None)
|
13 |
+
|
14 |
+
|
15 |
+
def _check_types(**kw: Any) -> str | None:
|
16 |
+
"""
|
17 |
+
Check each ``name: (value, types)`` in *kw*.
|
18 |
+
|
19 |
+
Returns a human-readable string of all violations or `None``.
|
20 |
+
"""
|
21 |
+
errors = []
|
22 |
+
for name, (value, types) in kw.items():
|
23 |
+
if not isinstance(value, types):
|
24 |
+
if isinstance(types, tuple):
|
25 |
+
types = ", or ".join(t.__name__ for t in types)
|
26 |
+
else:
|
27 |
+
types = types.__name__
|
28 |
+
errors.append(
|
29 |
+
f"'{name}' must be a {types} (got {type(value).__name__})"
|
30 |
+
)
|
31 |
+
|
32 |
+
if errors != []:
|
33 |
+
return ", ".join(errors) + "."
|
34 |
+
|
35 |
+
return None
|
36 |
+
|
37 |
+
|
38 |
+
def _decoded_str_len(length: int) -> int:
|
39 |
+
"""
|
40 |
+
Compute how long an encoded string of length *l* becomes.
|
41 |
+
"""
|
42 |
+
rem = length % 4
|
43 |
+
|
44 |
+
if rem == 3:
|
45 |
+
last_group_len = 2
|
46 |
+
elif rem == 2:
|
47 |
+
last_group_len = 1
|
48 |
+
else:
|
49 |
+
last_group_len = 0
|
50 |
+
|
51 |
+
return length // 4 * 3 + last_group_len
|
52 |
+
|
53 |
+
|
54 |
+
@dataclass
|
55 |
+
class Parameters:
|
56 |
+
"""
|
57 |
+
Argon2 hash parameters.
|
58 |
+
|
59 |
+
See :doc:`parameters` on how to pick them.
|
60 |
+
|
61 |
+
:ivar Type type: Hash type.
|
62 |
+
:ivar int version: Argon2 version.
|
63 |
+
:ivar int salt_len: Length of the salt in bytes.
|
64 |
+
:ivar int hash_len: Length of the hash in bytes.
|
65 |
+
:ivar int time_cost: Time cost in iterations.
|
66 |
+
:ivar int memory_cost: Memory cost in kibibytes.
|
67 |
+
:ivar int parallelism: Number of parallel threads.
|
68 |
+
|
69 |
+
.. versionadded:: 18.2.0
|
70 |
+
"""
|
71 |
+
|
72 |
+
type: Type
|
73 |
+
version: int
|
74 |
+
salt_len: int
|
75 |
+
hash_len: int
|
76 |
+
time_cost: int
|
77 |
+
memory_cost: int
|
78 |
+
parallelism: int
|
79 |
+
|
80 |
+
__slots__ = (
|
81 |
+
"type",
|
82 |
+
"version",
|
83 |
+
"salt_len",
|
84 |
+
"hash_len",
|
85 |
+
"time_cost",
|
86 |
+
"memory_cost",
|
87 |
+
"parallelism",
|
88 |
+
)
|
89 |
+
|
90 |
+
|
91 |
+
_NAME_TO_TYPE = {"argon2id": Type.ID, "argon2i": Type.I, "argon2d": Type.D}
|
92 |
+
_REQUIRED_KEYS = sorted(("v", "m", "t", "p"))
|
93 |
+
|
94 |
+
|
95 |
+
def extract_parameters(hash: str) -> Parameters:
|
96 |
+
"""
|
97 |
+
Extract parameters from an encoded *hash*.
|
98 |
+
|
99 |
+
:param str params: An encoded Argon2 hash string.
|
100 |
+
|
101 |
+
:rtype: Parameters
|
102 |
+
|
103 |
+
.. versionadded:: 18.2.0
|
104 |
+
"""
|
105 |
+
parts = hash.split("$")
|
106 |
+
|
107 |
+
# Backwards compatibility for Argon v1.2 hashes
|
108 |
+
if len(parts) == 5:
|
109 |
+
parts.insert(2, "v=18")
|
110 |
+
|
111 |
+
if len(parts) != 6:
|
112 |
+
raise InvalidHashError
|
113 |
+
|
114 |
+
if parts[0]:
|
115 |
+
raise InvalidHashError
|
116 |
+
|
117 |
+
try:
|
118 |
+
type = _NAME_TO_TYPE[parts[1]]
|
119 |
+
|
120 |
+
kvs = {
|
121 |
+
k: int(v)
|
122 |
+
for k, v in (
|
123 |
+
s.split("=") for s in [parts[2], *parts[3].split(",")]
|
124 |
+
)
|
125 |
+
}
|
126 |
+
except Exception: # noqa: BLE001
|
127 |
+
raise InvalidHashError from None
|
128 |
+
|
129 |
+
if sorted(kvs.keys()) != _REQUIRED_KEYS:
|
130 |
+
raise InvalidHashError
|
131 |
+
|
132 |
+
return Parameters(
|
133 |
+
type=type,
|
134 |
+
salt_len=_decoded_str_len(len(parts[4])),
|
135 |
+
hash_len=_decoded_str_len(len(parts[5])),
|
136 |
+
version=kvs["v"],
|
137 |
+
time_cost=kvs["t"],
|
138 |
+
memory_cost=kvs["m"],
|
139 |
+
parallelism=kvs["p"],
|
140 |
+
)
|
venv/Lib/site-packages/argon2/exceptions.py
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
|
6 |
+
class Argon2Error(Exception):
|
7 |
+
"""
|
8 |
+
Superclass of all argon2 exceptions.
|
9 |
+
|
10 |
+
Never thrown directly.
|
11 |
+
"""
|
12 |
+
|
13 |
+
|
14 |
+
class VerificationError(Argon2Error):
|
15 |
+
"""
|
16 |
+
Verification failed.
|
17 |
+
|
18 |
+
You can find the original error message from Argon2 in ``args[0]``.
|
19 |
+
"""
|
20 |
+
|
21 |
+
|
22 |
+
class VerifyMismatchError(VerificationError):
|
23 |
+
"""
|
24 |
+
The secret does not match the hash.
|
25 |
+
|
26 |
+
Subclass of :exc:`argon2.exceptions.VerificationError`.
|
27 |
+
|
28 |
+
.. versionadded:: 16.1.0
|
29 |
+
"""
|
30 |
+
|
31 |
+
|
32 |
+
class HashingError(Argon2Error):
|
33 |
+
"""
|
34 |
+
Raised if hashing failed.
|
35 |
+
|
36 |
+
You can find the original error message from Argon2 in ``args[0]``.
|
37 |
+
"""
|
38 |
+
|
39 |
+
|
40 |
+
class InvalidHashError(ValueError):
|
41 |
+
"""
|
42 |
+
Raised if the hash is invalid before passing it to Argon2.
|
43 |
+
|
44 |
+
.. versionadded:: 23.1.0
|
45 |
+
As a replacement for :exc:`argon2.exceptions.InvalidHash`.
|
46 |
+
"""
|
47 |
+
|
48 |
+
|
49 |
+
InvalidHash = InvalidHashError
|
50 |
+
"""
|
51 |
+
Deprecated alias for :class:`InvalidHashError`.
|
52 |
+
|
53 |
+
.. versionadded:: 18.2.0
|
54 |
+
.. deprecated:: 23.1.0
|
55 |
+
Use :exc:`argon2.exceptions.InvalidHashError` instead.
|
56 |
+
"""
|
venv/Lib/site-packages/argon2/low_level.py
ADDED
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Low-level functions if you want to build your own higher level abstractions.
|
5 |
+
|
6 |
+
.. warning::
|
7 |
+
This is a "Hazardous Materials" module. You should **ONLY** use it if
|
8 |
+
you're 100% absolutely sure that you know what you're doing because this
|
9 |
+
module is full of land mines, dragons, and dinosaurs with laser guns.
|
10 |
+
"""
|
11 |
+
|
12 |
+
from __future__ import annotations
|
13 |
+
|
14 |
+
from enum import Enum
|
15 |
+
from typing import Any
|
16 |
+
|
17 |
+
from _argon2_cffi_bindings import ffi, lib
|
18 |
+
|
19 |
+
from ._typing import Literal
|
20 |
+
from .exceptions import HashingError, VerificationError, VerifyMismatchError
|
21 |
+
|
22 |
+
|
23 |
+
__all__ = [
|
24 |
+
"ARGON2_VERSION",
|
25 |
+
"Type",
|
26 |
+
"ffi",
|
27 |
+
"hash_secret",
|
28 |
+
"hash_secret_raw",
|
29 |
+
"verify_secret",
|
30 |
+
]
|
31 |
+
|
32 |
+
ARGON2_VERSION = lib.ARGON2_VERSION_NUMBER
|
33 |
+
"""
|
34 |
+
The latest version of the Argon2 algorithm that is supported (and used by
|
35 |
+
default).
|
36 |
+
|
37 |
+
.. versionadded:: 16.1.0
|
38 |
+
"""
|
39 |
+
|
40 |
+
|
41 |
+
class Type(Enum):
|
42 |
+
"""
|
43 |
+
Enum of Argon2 variants.
|
44 |
+
|
45 |
+
Please see :doc:`parameters` on how to pick one.
|
46 |
+
"""
|
47 |
+
|
48 |
+
D = lib.Argon2_d
|
49 |
+
I = lib.Argon2_i # noqa: E741
|
50 |
+
ID = lib.Argon2_id
|
51 |
+
|
52 |
+
|
53 |
+
def hash_secret(
|
54 |
+
secret: bytes,
|
55 |
+
salt: bytes,
|
56 |
+
time_cost: int,
|
57 |
+
memory_cost: int,
|
58 |
+
parallelism: int,
|
59 |
+
hash_len: int,
|
60 |
+
type: Type,
|
61 |
+
version: int = ARGON2_VERSION,
|
62 |
+
) -> bytes:
|
63 |
+
"""
|
64 |
+
Hash *secret* and return an **encoded** hash.
|
65 |
+
|
66 |
+
An encoded hash can be directly passed into :func:`verify_secret` as it
|
67 |
+
contains all parameters and the salt.
|
68 |
+
|
69 |
+
:param bytes secret: Secret to hash.
|
70 |
+
:param bytes salt: A salt_. Should be random and different for each
|
71 |
+
secret.
|
72 |
+
:param Type type: Which Argon2 variant to use.
|
73 |
+
:param int version: Which Argon2 version to use.
|
74 |
+
|
75 |
+
For an explanation of the Argon2 parameters see
|
76 |
+
:class:`argon2.PasswordHasher`.
|
77 |
+
|
78 |
+
:rtype: bytes
|
79 |
+
|
80 |
+
:raises argon2.exceptions.HashingError: If hashing fails.
|
81 |
+
|
82 |
+
.. versionadded:: 16.0.0
|
83 |
+
|
84 |
+
.. _salt: https://en.wikipedia.org/wiki/Salt_(cryptography)
|
85 |
+
.. _kibibytes: https://en.wikipedia.org/wiki/Binary_prefix#kibi
|
86 |
+
"""
|
87 |
+
size = (
|
88 |
+
lib.argon2_encodedlen(
|
89 |
+
time_cost,
|
90 |
+
memory_cost,
|
91 |
+
parallelism,
|
92 |
+
len(salt),
|
93 |
+
hash_len,
|
94 |
+
type.value,
|
95 |
+
)
|
96 |
+
+ 1
|
97 |
+
)
|
98 |
+
buf = ffi.new("char[]", size)
|
99 |
+
rv = lib.argon2_hash(
|
100 |
+
time_cost,
|
101 |
+
memory_cost,
|
102 |
+
parallelism,
|
103 |
+
ffi.new("uint8_t[]", secret),
|
104 |
+
len(secret),
|
105 |
+
ffi.new("uint8_t[]", salt),
|
106 |
+
len(salt),
|
107 |
+
ffi.NULL,
|
108 |
+
hash_len,
|
109 |
+
buf,
|
110 |
+
size,
|
111 |
+
type.value,
|
112 |
+
version,
|
113 |
+
)
|
114 |
+
if rv != lib.ARGON2_OK:
|
115 |
+
raise HashingError(error_to_str(rv))
|
116 |
+
|
117 |
+
return ffi.string(buf) # type: ignore[no-any-return]
|
118 |
+
|
119 |
+
|
120 |
+
def hash_secret_raw(
|
121 |
+
secret: bytes,
|
122 |
+
salt: bytes,
|
123 |
+
time_cost: int,
|
124 |
+
memory_cost: int,
|
125 |
+
parallelism: int,
|
126 |
+
hash_len: int,
|
127 |
+
type: Type,
|
128 |
+
version: int = ARGON2_VERSION,
|
129 |
+
) -> bytes:
|
130 |
+
"""
|
131 |
+
Hash *password* and return a **raw** hash.
|
132 |
+
|
133 |
+
This function takes the same parameters as :func:`hash_secret`.
|
134 |
+
|
135 |
+
.. versionadded:: 16.0.0
|
136 |
+
"""
|
137 |
+
buf = ffi.new("uint8_t[]", hash_len)
|
138 |
+
|
139 |
+
rv = lib.argon2_hash(
|
140 |
+
time_cost,
|
141 |
+
memory_cost,
|
142 |
+
parallelism,
|
143 |
+
ffi.new("uint8_t[]", secret),
|
144 |
+
len(secret),
|
145 |
+
ffi.new("uint8_t[]", salt),
|
146 |
+
len(salt),
|
147 |
+
buf,
|
148 |
+
hash_len,
|
149 |
+
ffi.NULL,
|
150 |
+
0,
|
151 |
+
type.value,
|
152 |
+
version,
|
153 |
+
)
|
154 |
+
if rv != lib.ARGON2_OK:
|
155 |
+
raise HashingError(error_to_str(rv))
|
156 |
+
|
157 |
+
return bytes(ffi.buffer(buf, hash_len))
|
158 |
+
|
159 |
+
|
160 |
+
def verify_secret(hash: bytes, secret: bytes, type: Type) -> Literal[True]:
|
161 |
+
"""
|
162 |
+
Verify whether *secret* is correct for *hash* of *type*.
|
163 |
+
|
164 |
+
:param bytes hash: An encoded Argon2 hash as returned by
|
165 |
+
:func:`hash_secret`.
|
166 |
+
:param bytes secret: The secret to verify whether it matches the one
|
167 |
+
in *hash*.
|
168 |
+
:param Type type: Type for *hash*.
|
169 |
+
|
170 |
+
:raises argon2.exceptions.VerifyMismatchError: If verification fails
|
171 |
+
because *hash* is not valid for *secret* of *type*.
|
172 |
+
:raises argon2.exceptions.VerificationError: If verification fails for
|
173 |
+
other reasons.
|
174 |
+
|
175 |
+
:return: ``True`` on success, raise
|
176 |
+
:exc:`~argon2.exceptions.VerificationError` otherwise.
|
177 |
+
:rtype: bool
|
178 |
+
|
179 |
+
.. versionadded:: 16.0.0
|
180 |
+
.. versionchanged:: 16.1.0
|
181 |
+
Raise :exc:`~argon2.exceptions.VerifyMismatchError` on mismatches
|
182 |
+
instead of its more generic superclass.
|
183 |
+
"""
|
184 |
+
rv = lib.argon2_verify(
|
185 |
+
ffi.new("char[]", hash),
|
186 |
+
ffi.new("uint8_t[]", secret),
|
187 |
+
len(secret),
|
188 |
+
type.value,
|
189 |
+
)
|
190 |
+
|
191 |
+
if rv == lib.ARGON2_OK:
|
192 |
+
return True
|
193 |
+
|
194 |
+
if rv == lib.ARGON2_VERIFY_MISMATCH:
|
195 |
+
raise VerifyMismatchError(error_to_str(rv))
|
196 |
+
|
197 |
+
raise VerificationError(error_to_str(rv))
|
198 |
+
|
199 |
+
|
200 |
+
def core(context: Any, type: int) -> int:
|
201 |
+
"""
|
202 |
+
Direct binding to the ``argon2_ctx`` function.
|
203 |
+
|
204 |
+
.. warning::
|
205 |
+
This is a strictly advanced function working on raw C data structures.
|
206 |
+
Both Argon2's and *argon2-cffi*'s higher-level bindings do a lot of
|
207 |
+
sanity checks and housekeeping work that *you* are now responsible for
|
208 |
+
(e.g. clearing buffers). The structure of the *context* object can,
|
209 |
+
has, and will change with *any* release!
|
210 |
+
|
211 |
+
Use at your own peril; *argon2-cffi* does *not* use this binding
|
212 |
+
itself.
|
213 |
+
|
214 |
+
:param context: A CFFI Argon2 context object (i.e. an ``struct
|
215 |
+
Argon2_Context`` / ``argon2_context``).
|
216 |
+
:param int type: Which Argon2 variant to use. You can use the ``value``
|
217 |
+
field of :class:`Type`'s fields.
|
218 |
+
|
219 |
+
:rtype: int
|
220 |
+
:return: An Argon2 error code. Can be transformed into a string using
|
221 |
+
:func:`error_to_str`.
|
222 |
+
|
223 |
+
.. versionadded:: 16.0.0
|
224 |
+
"""
|
225 |
+
return lib.argon2_ctx(context, type) # type: ignore[no-any-return]
|
226 |
+
|
227 |
+
|
228 |
+
def error_to_str(error: int) -> str:
|
229 |
+
"""
|
230 |
+
Convert an Argon2 error code into a native string.
|
231 |
+
|
232 |
+
:param int error: An Argon2 error code as returned by :func:`core`.
|
233 |
+
|
234 |
+
:rtype: str
|
235 |
+
|
236 |
+
.. versionadded:: 16.0.0
|
237 |
+
"""
|
238 |
+
return ffi.string(lib.argon2_error_message(error)).decode("ascii") # type: ignore[no-any-return]
|
venv/Lib/site-packages/argon2/profiles.py
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
This module offers access to standardized parameters that you can load using
|
5 |
+
:meth:`argon2.PasswordHasher.from_parameters()`. See the `source code
|
6 |
+
<https://github.com/hynek/argon2-cffi/blob/main/src/argon2/profiles.py>`_ for
|
7 |
+
concrete values and :doc:`parameters` for more information.
|
8 |
+
|
9 |
+
.. versionadded:: 21.2.0
|
10 |
+
"""
|
11 |
+
|
12 |
+
from __future__ import annotations
|
13 |
+
|
14 |
+
from ._utils import Parameters
|
15 |
+
from .low_level import Type
|
16 |
+
|
17 |
+
|
18 |
+
# FIRST RECOMMENDED option per RFC 9106.
|
19 |
+
RFC_9106_HIGH_MEMORY = Parameters(
|
20 |
+
type=Type.ID,
|
21 |
+
version=19,
|
22 |
+
salt_len=16,
|
23 |
+
hash_len=32,
|
24 |
+
time_cost=1,
|
25 |
+
memory_cost=2097152, # 2 GiB
|
26 |
+
parallelism=4,
|
27 |
+
)
|
28 |
+
|
29 |
+
# SECOND RECOMMENDED option per RFC 9106.
|
30 |
+
RFC_9106_LOW_MEMORY = Parameters(
|
31 |
+
type=Type.ID,
|
32 |
+
version=19,
|
33 |
+
salt_len=16,
|
34 |
+
hash_len=32,
|
35 |
+
time_cost=3,
|
36 |
+
memory_cost=65536, # 64 MiB
|
37 |
+
parallelism=4,
|
38 |
+
)
|
39 |
+
|
40 |
+
# The pre-RFC defaults in argon2-cffi 18.2.0 - 21.1.0.
|
41 |
+
PRE_21_2 = Parameters(
|
42 |
+
type=Type.ID,
|
43 |
+
version=19,
|
44 |
+
salt_len=16,
|
45 |
+
hash_len=16,
|
46 |
+
time_cost=2,
|
47 |
+
memory_cost=102400, # 100 MiB
|
48 |
+
parallelism=8,
|
49 |
+
)
|
50 |
+
|
51 |
+
# Only for testing!
|
52 |
+
CHEAPEST = Parameters(
|
53 |
+
type=Type.ID,
|
54 |
+
version=19,
|
55 |
+
salt_len=8,
|
56 |
+
hash_len=4,
|
57 |
+
time_cost=1,
|
58 |
+
memory_cost=8,
|
59 |
+
parallelism=1,
|
60 |
+
)
|
venv/Lib/site-packages/argon2/py.typed
ADDED
File without changes
|
venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/METADATA
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: argon2-cffi
|
3 |
+
Version: 23.1.0
|
4 |
+
Summary: Argon2 for Python
|
5 |
+
Project-URL: Documentation, https://argon2-cffi.readthedocs.io/
|
6 |
+
Project-URL: Changelog, https://github.com/hynek/argon2-cffi/blob/main/CHANGELOG.md
|
7 |
+
Project-URL: GitHub, https://github.com/hynek/argon2-cffi
|
8 |
+
Project-URL: Funding, https://github.com/sponsors/hynek
|
9 |
+
Project-URL: Tidelift, https://tidelift.com/?utm_source=lifter&utm_medium=referral&utm_campaign=hynek
|
10 |
+
Author-email: Hynek Schlawack <[email protected]>
|
11 |
+
License-Expression: MIT
|
12 |
+
License-File: LICENSE
|
13 |
+
Keywords: hash,hashing,password,security
|
14 |
+
Classifier: Development Status :: 5 - Production/Stable
|
15 |
+
Classifier: Intended Audience :: Developers
|
16 |
+
Classifier: License :: OSI Approved :: MIT License
|
17 |
+
Classifier: Operating System :: MacOS :: MacOS X
|
18 |
+
Classifier: Operating System :: Microsoft :: Windows
|
19 |
+
Classifier: Operating System :: POSIX
|
20 |
+
Classifier: Operating System :: Unix
|
21 |
+
Classifier: Programming Language :: Python :: 3.7
|
22 |
+
Classifier: Programming Language :: Python :: 3.8
|
23 |
+
Classifier: Programming Language :: Python :: 3.9
|
24 |
+
Classifier: Programming Language :: Python :: 3.10
|
25 |
+
Classifier: Programming Language :: Python :: 3.11
|
26 |
+
Classifier: Programming Language :: Python :: 3.12
|
27 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
28 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
29 |
+
Classifier: Topic :: Security :: Cryptography
|
30 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
31 |
+
Requires-Python: >=3.7
|
32 |
+
Requires-Dist: argon2-cffi-bindings
|
33 |
+
Requires-Dist: typing-extensions; python_version < '3.8'
|
34 |
+
Provides-Extra: dev
|
35 |
+
Requires-Dist: argon2-cffi[tests,typing]; extra == 'dev'
|
36 |
+
Requires-Dist: tox>4; extra == 'dev'
|
37 |
+
Provides-Extra: docs
|
38 |
+
Requires-Dist: furo; extra == 'docs'
|
39 |
+
Requires-Dist: myst-parser; extra == 'docs'
|
40 |
+
Requires-Dist: sphinx; extra == 'docs'
|
41 |
+
Requires-Dist: sphinx-copybutton; extra == 'docs'
|
42 |
+
Requires-Dist: sphinx-notfound-page; extra == 'docs'
|
43 |
+
Provides-Extra: tests
|
44 |
+
Requires-Dist: hypothesis; extra == 'tests'
|
45 |
+
Requires-Dist: pytest; extra == 'tests'
|
46 |
+
Provides-Extra: typing
|
47 |
+
Requires-Dist: mypy; extra == 'typing'
|
48 |
+
Description-Content-Type: text/markdown
|
49 |
+
|
50 |
+
# *argon2-cffi*: Argon2 for Python
|
51 |
+
|
52 |
+
|
53 |
+
[Argon2](https://github.com/p-h-c/phc-winner-argon2) won the [Password Hashing Competition](https://www.password-hashing.net/) and *argon2-cffi* is the simplest way to use it in Python:
|
54 |
+
|
55 |
+
```pycon
|
56 |
+
>>> from argon2 import PasswordHasher
|
57 |
+
>>> ph = PasswordHasher()
|
58 |
+
>>> hash = ph.hash("correct horse battery staple")
|
59 |
+
>>> hash # doctest: +SKIP
|
60 |
+
'$argon2id$v=19$m=65536,t=3,p=4$MIIRqgvgQbgj220jfp0MPA$YfwJSVjtjSU0zzV/P3S9nnQ/USre2wvJMjfCIjrTQbg'
|
61 |
+
>>> ph.verify(hash, "correct horse battery staple")
|
62 |
+
True
|
63 |
+
>>> ph.check_needs_rehash(hash)
|
64 |
+
False
|
65 |
+
>>> ph.verify(hash, "Tr0ub4dor&3")
|
66 |
+
Traceback (most recent call last):
|
67 |
+
...
|
68 |
+
argon2.exceptions.VerifyMismatchError: The password does not match the supplied hash
|
69 |
+
|
70 |
+
```
|
71 |
+
<!-- end short -->
|
72 |
+
|
73 |
+
## Project Links
|
74 |
+
|
75 |
+
- [**PyPI**](https://pypi.org/project/argon2-cffi/)
|
76 |
+
- [**GitHub**](https://github.com/hynek/argon2-cffi)
|
77 |
+
- [**Documentation**](https://argon2-cffi.readthedocs.io/)
|
78 |
+
- [**Changelog**](https://github.com/hynek/argon2-cffi/blob/main/CHANGELOG.md)
|
79 |
+
- [**Funding**](https://hynek.me/say-thanks/)
|
80 |
+
- The low-level Argon2 CFFI bindings are maintained in the separate [*argon2-cffi-bindings*](https://github.com/hynek/argon2-cffi-bindings) project.
|
81 |
+
|
82 |
+
## Release Information
|
83 |
+
|
84 |
+
### Removed
|
85 |
+
|
86 |
+
- Python 3.6 is not supported anymore.
|
87 |
+
|
88 |
+
|
89 |
+
### Deprecated
|
90 |
+
|
91 |
+
- The `InvalidHash` exception is deprecated in favor of `InvalidHashError`.
|
92 |
+
No plans for removal currently exist and the names can (but shouldn't) be used interchangeably.
|
93 |
+
|
94 |
+
- `argon2.hash_password()`, `argon2.hash_password_raw()`, and `argon2.verify_password()` that have been soft-deprecated since 2016 are now hard-deprecated.
|
95 |
+
They now raise `DeprecationWarning`s and will be removed in 2024.
|
96 |
+
|
97 |
+
|
98 |
+
### Added
|
99 |
+
|
100 |
+
- Official support for Python 3.11 and 3.12.
|
101 |
+
No code changes were necessary.
|
102 |
+
|
103 |
+
- `argon2.exceptions.InvalidHashError` as a replacement for `InvalidHash`.
|
104 |
+
|
105 |
+
- *salt* parameter to `argon2.PasswordHasher.hash()` to allow for custom salts.
|
106 |
+
This is only useful for specialized use-cases -- leave it on None unless you know exactly what you are doing.
|
107 |
+
[#153](https://github.com/hynek/argon2-cffi/pull/153)
|
108 |
+
|
109 |
+
|
110 |
+
---
|
111 |
+
|
112 |
+
[→ Full Changelog](https://github.com/hynek/argon2-cffi/blob/main/CHANGELOG.md)
|
113 |
+
|
114 |
+
|
115 |
+
## Credits
|
116 |
+
|
117 |
+
*argon2-cffi* is maintained by [Hynek Schlawack](https://hynek.me/).
|
118 |
+
|
119 |
+
The development is kindly supported by my employer [Variomedia AG](https://www.variomedia.de/), *argon2-cffi* [Tidelift subscribers](https://tidelift.com/?utm_source=lifter&utm_medium=referral&utm_campaign=hynek), and my amazing [GitHub Sponsors](https://github.com/sponsors/hynek).
|
120 |
+
|
121 |
+
|
122 |
+
## *argon2-cffi* for Enterprise
|
123 |
+
|
124 |
+
Available as part of the Tidelift Subscription.
|
125 |
+
|
126 |
+
The maintainers of *argon2-cffi* and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open-source packages you use to build your applications.
|
127 |
+
Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.
|
128 |
+
[Learn more.](https://tidelift.com/?utm_source=lifter&utm_medium=referral&utm_campaign=hynek)
|
venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/RECORD
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
argon2/__init__.py,sha256=jDpUpW9taHKrUcS245AffLDv_-NktN-6gpStEqkm4Cg,2238
|
2 |
+
argon2/__main__.py,sha256=3Oo7cJhgwjQRWXgMMDp7GiGom4oyT6Tdrrlf8dx4yXs,2290
|
3 |
+
argon2/__pycache__/__init__.cpython-312.pyc,,
|
4 |
+
argon2/__pycache__/__main__.cpython-312.pyc,,
|
5 |
+
argon2/__pycache__/_legacy.cpython-312.pyc,,
|
6 |
+
argon2/__pycache__/_password_hasher.cpython-312.pyc,,
|
7 |
+
argon2/__pycache__/_typing.cpython-312.pyc,,
|
8 |
+
argon2/__pycache__/_utils.cpython-312.pyc,,
|
9 |
+
argon2/__pycache__/exceptions.cpython-312.pyc,,
|
10 |
+
argon2/__pycache__/low_level.cpython-312.pyc,,
|
11 |
+
argon2/__pycache__/profiles.cpython-312.pyc,,
|
12 |
+
argon2/_legacy.py,sha256=Wumpg1-oG6coGlhcw2nE1CGFDnf_808E4b_lPbABJ4s,2417
|
13 |
+
argon2/_password_hasher.py,sha256=06Ie5-f4u6Jsjafhb_AgVuMdslTjDGG2V09AuD-aUJI,8213
|
14 |
+
argon2/_typing.py,sha256=JYHDd_ZM9pCmVM1d0lKruTu3Fk6zW63tt_wtRDz279M,304
|
15 |
+
argon2/_utils.py,sha256=aBCZPr8lwl9wetNsbBOyw0dLHSNjoDY4fLS6MkxuLbs,3172
|
16 |
+
argon2/exceptions.py,sha256=0CBxmt5BquHsDjNKRUiSoS9o-w8n0eSFK9txzPJhj48,1097
|
17 |
+
argon2/low_level.py,sha256=v1red7BdmVRGozlhYiFNSt8d4JbshD8jua-6F6VGdfc,6165
|
18 |
+
argon2/profiles.py,sha256=gGXlTTdatbLq6wPSD4OCRqqX0tRm_WfQpYLG9Sxv4G0,1268
|
19 |
+
argon2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20 |
+
argon2_cffi-23.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
21 |
+
argon2_cffi-23.1.0.dist-info/METADATA,sha256=G5tmqJUpogTUcFYf-k9DWw9pMbP1n2hVi6vi0ZtAuKw,5217
|
22 |
+
argon2_cffi-23.1.0.dist-info/RECORD,,
|
23 |
+
argon2_cffi-23.1.0.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
|
24 |
+
argon2_cffi-23.1.0.dist-info/licenses/LICENSE,sha256=tpRNOG6HzPSdljLaCDaFpLdiRzPmhqf-KD3S1Cg0HXc,1115
|
venv/Lib/site-packages/argon2_cffi-23.1.0.dist-info/WHEEL
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: hatchling 1.18.0
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-any
|
venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2021 Hynek Schlawack
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/METADATA
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: argon2-cffi-bindings
|
3 |
+
Version: 21.2.0
|
4 |
+
Summary: Low-level CFFI bindings for Argon2
|
5 |
+
Home-page: https://github.com/hynek/argon2-cffi-bindings
|
6 |
+
Author: Hynek Schlawack
|
7 |
+
Author-email: [email protected]
|
8 |
+
Maintainer: Hynek Schlawack
|
9 |
+
Maintainer-email: [email protected]
|
10 |
+
License: MIT
|
11 |
+
Project-URL: Source Code, https://github.com/hynek/argon2-cffi-bindings
|
12 |
+
Project-URL: Funding, https://github.com/sponsors/hynek
|
13 |
+
Project-URL: Tidelift, https://tidelift.com/subscription/pkg/pypi-argon2-cffi?utm_source=pypi-argon2-cffi&utm_medium=pypi
|
14 |
+
Project-URL: Ko-fi, https://ko-fi.com/the_hynek
|
15 |
+
Keywords: password,hash,hashing,security,bindings,cffi
|
16 |
+
Platform: UNKNOWN
|
17 |
+
Classifier: Development Status :: 5 - Production/Stable
|
18 |
+
Classifier: Intended Audience :: Developers
|
19 |
+
Classifier: License :: OSI Approved :: MIT License
|
20 |
+
Classifier: Natural Language :: English
|
21 |
+
Classifier: Operating System :: MacOS :: MacOS X
|
22 |
+
Classifier: Operating System :: Microsoft :: Windows
|
23 |
+
Classifier: Operating System :: POSIX
|
24 |
+
Classifier: Operating System :: Unix
|
25 |
+
Classifier: Programming Language :: Python :: 3
|
26 |
+
Classifier: Programming Language :: Python :: 3.6
|
27 |
+
Classifier: Programming Language :: Python :: 3.7
|
28 |
+
Classifier: Programming Language :: Python :: 3.8
|
29 |
+
Classifier: Programming Language :: Python :: 3.9
|
30 |
+
Classifier: Programming Language :: Python :: 3.10
|
31 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
32 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
33 |
+
Classifier: Programming Language :: Python
|
34 |
+
Classifier: Topic :: Security :: Cryptography
|
35 |
+
Classifier: Topic :: Security
|
36 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
37 |
+
Requires-Python: >=3.6
|
38 |
+
Description-Content-Type: text/markdown
|
39 |
+
License-File: LICENSE
|
40 |
+
Requires-Dist: cffi (>=1.0.1)
|
41 |
+
Provides-Extra: dev
|
42 |
+
Requires-Dist: pytest ; extra == 'dev'
|
43 |
+
Requires-Dist: cogapp ; extra == 'dev'
|
44 |
+
Requires-Dist: pre-commit ; extra == 'dev'
|
45 |
+
Requires-Dist: wheel ; extra == 'dev'
|
46 |
+
Provides-Extra: tests
|
47 |
+
Requires-Dist: pytest ; extra == 'tests'
|
48 |
+
|
49 |
+
# Low-level Python CFFI Bindings for Argon2
|
50 |
+
|
51 |
+
*argon2-cffi-bindings* provides low-level [*CFFI*](https://cffi.readthedocs.io/) bindings to the [*Argon2*] password hashing algorithm including a vendored version of them.
|
52 |
+
|
53 |
+
<!-- [[[cog
|
54 |
+
# Extract commit ID; refresh using `tox -e cog`
|
55 |
+
import subprocess
|
56 |
+
out = subprocess.check_output(["git", "submodule"], text=True)
|
57 |
+
id = out.strip().split(" ", 1)[0]
|
58 |
+
link = f'[**`{id[:7]}`**](https://github.com/P-H-C/phc-winner-argon2/commit/{id})'
|
59 |
+
print(f"The currently vendored *Argon2* commit ID is {link}.")
|
60 |
+
]]] -->
|
61 |
+
The currently vendored *Argon2* commit ID is [**`f57e61e`**](https://github.com/P-H-C/phc-winner-argon2/commit/f57e61e19229e23c4445b85494dbf7c07de721cb).
|
62 |
+
<!-- [[[end]]] -->
|
63 |
+
|
64 |
+
> If you want to hash passwords in an application, this package is **not** for you.
|
65 |
+
> Have a look at [*argon2-cffi*] with its high-level abstractions!
|
66 |
+
|
67 |
+
These bindings have been extracted from [*argon2-cffi*] and it remains its main consumer.
|
68 |
+
However, they may be used by other packages that want to use the *Argon2* library without dealing with C-related complexities.
|
69 |
+
|
70 |
+
|
71 |
+
## Usage
|
72 |
+
|
73 |
+
*argon2-cffi-bindings* is available from [PyPI](https://pypi.org/project/argon2-cffi-bindings/).
|
74 |
+
The provided *CFFI* bindings are compiled in API mode.
|
75 |
+
|
76 |
+
Best effort is given to provide binary wheels for as many platforms as possible.
|
77 |
+
|
78 |
+
|
79 |
+
### Disabling Vendored Code
|
80 |
+
|
81 |
+
A copy of [*Argon2*] is vendored and used by default, but can be disabled if *argon2-cffi-bindings* is installed using:
|
82 |
+
|
83 |
+
```console
|
84 |
+
$ env ARGON2_CFFI_USE_SYSTEM=1 \
|
85 |
+
python -m pip install --no-binary=argon2-cffi-bindings argon2-cffi-bindings
|
86 |
+
```
|
87 |
+
|
88 |
+
|
89 |
+
### Overriding Automatic *SSE2* Detection
|
90 |
+
|
91 |
+
Usually the build process tries to guess whether or not it should use [*SSE2*](https://en.wikipedia.org/wiki/SSE2)-optimized code (see [`_ffi_build.py`](https://github.com/hynek/argon2-cffi-bindings/blob/main/src/_argon2_cffi_bindings/_ffi_build.py) for details).
|
92 |
+
This can go wrong and is problematic for cross-compiling.
|
93 |
+
|
94 |
+
Therefore you can use the `ARGON2_CFFI_USE_SSE2` environment variable to control the process:
|
95 |
+
|
96 |
+
- If you set it to ``1``, *argon2-cffi-bindings* will build **with** SSE2 support.
|
97 |
+
- If you set it to ``0``, *argon2-cffi-bindings* will build **without** SSE2 support.
|
98 |
+
- If you set it to anything else, it will be ignored and *argon2-cffi-bindings* will try to guess.
|
99 |
+
|
100 |
+
However, if our heuristics fail you, we would welcome a bug report.
|
101 |
+
|
102 |
+
|
103 |
+
### Python API
|
104 |
+
|
105 |
+
Since this package is intended to be an implementation detail, it uses a private module name to prevent your users from using it by accident.
|
106 |
+
|
107 |
+
Therefore you have to import the symbols from `_argon2_cffi_bindings`:
|
108 |
+
|
109 |
+
```python
|
110 |
+
from _argon2_cffi_bindings import ffi, lib
|
111 |
+
```
|
112 |
+
|
113 |
+
Please refer to [*cffi* documentation](https://cffi.readthedocs.io/en/latest/using.html) on how to use the `ffi` and `lib` objects.
|
114 |
+
|
115 |
+
The list of symbols that are provided can be found in the [`_ffi_build.py` file](https://github.com/hynek/argon2-cffi-bindings/blob/main/src/_argon2_cffi_bindings/_ffi_build.py).
|
116 |
+
|
117 |
+
[*Argon2*]: https://github.com/p-h-c/phc-winner-argon2
|
118 |
+
[*argon2-cffi*]: https://argon2-cffi.readthedocs.io/
|
119 |
+
|
120 |
+
|
121 |
+
## Project Information
|
122 |
+
|
123 |
+
*argon2-cffi-bindings* is available under the MIT license, available from [PyPI](https://pypi.org/project/argon2-cffi-bindings/), the source code and documentation can be found on [GitHub](https://github.com/hynek/argon2-cffi-bindings).
|
124 |
+
|
125 |
+
*argon2-cffi-bindings* targets Python 3.6 and later, including PyPy3.
|
126 |
+
|
127 |
+
|
128 |
+
### Credits & License
|
129 |
+
|
130 |
+
*argon2-cffi-bindings* is written and maintained by [Hynek Schlawack](https://hynek.me/about/).
|
131 |
+
It is released under the [MIT license](https://github.com/hynek/argon2-cffi/blob/main/LICENSE>).
|
132 |
+
|
133 |
+
The development is kindly supported by [Variomedia AG](https://www.variomedia.de/).
|
134 |
+
|
135 |
+
The authors of *Argon2* were very helpful to get the library to compile on ancient versions of Visual Studio for ancient versions of Python.
|
136 |
+
|
137 |
+
The documentation quotes frequently in verbatim from the *Argon2* [paper](https://www.password-hashing.net/argon2-specs.pdf) to avoid mistakes by rephrasing.
|
138 |
+
|
139 |
+
|
140 |
+
#### Vendored Code
|
141 |
+
|
142 |
+
The original *Argon2* repo can be found at <https://github.com/P-H-C/phc-winner-argon2/>.
|
143 |
+
|
144 |
+
Except for the components listed below, the *Argon2* code in this repository is copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main authors), Jean-Philippe Aumasson and Samuel Neves, and under [CC0] license.
|
145 |
+
|
146 |
+
The string encoding routines in src/encoding.c are copyright (c) 2015 Thomas Pornin, and under [CC0] license.
|
147 |
+
|
148 |
+
The [*BLAKE2*](https://www.blake2.net) code in ``src/blake2/`` is copyright (c) Samuel Neves, 2013-2015, and under [CC0] license.
|
149 |
+
|
150 |
+
[CC0]: https://creativecommons.org/publicdomain/zero/1.0/
|
151 |
+
|
152 |
+
|
venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/RECORD
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_argon2_cffi_bindings/__init__.py,sha256=Gm_s_NmP0nyKhjkqPk-5gq6aluEEO6YziCY8cZzs30k,92
|
2 |
+
_argon2_cffi_bindings/__pycache__/__init__.cpython-312.pyc,,
|
3 |
+
_argon2_cffi_bindings/__pycache__/_ffi_build.cpython-312.pyc,,
|
4 |
+
_argon2_cffi_bindings/_ffi.pyd,sha256=LHT5PPJFHMvV7q8LTQd26yhWzVilzHJ5AxvmpiqD568,53248
|
5 |
+
_argon2_cffi_bindings/_ffi_build.py,sha256=GWyfVuQ-48rPhhdo2rjDc_tr1QYsRo2fPTqYzr_5xSk,6316
|
6 |
+
argon2_cffi_bindings-21.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
7 |
+
argon2_cffi_bindings-21.2.0.dist-info/LICENSE,sha256=WrxzxDB5_M_mxNxxCvLftKWaZTmxQ0I29u-MdbAVDWE,1103
|
8 |
+
argon2_cffi_bindings-21.2.0.dist-info/METADATA,sha256=Zoe40TTiS4EwkPh7nbOWc1pHzu6HMeQCGTjsV17A_Mk,6705
|
9 |
+
argon2_cffi_bindings-21.2.0.dist-info/RECORD,,
|
10 |
+
argon2_cffi_bindings-21.2.0.dist-info/WHEEL,sha256=g0Gp_9X_YiwOuaF1hZMQNaS1qKUg2WIXRJjlZWggGSw,100
|
11 |
+
argon2_cffi_bindings-21.2.0.dist-info/top_level.txt,sha256=WyRJzxvIv58cyvTye2AsVz50Lw0hDxUYBuCH1rUb_tg,27
|
venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/WHEEL
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.37.0)
|
3 |
+
Root-Is-Purelib: false
|
4 |
+
Tag: cp36-abi3-win_amd64
|
5 |
+
|
venv/Lib/site-packages/argon2_cffi_bindings-21.2.0.dist-info/top_level.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
_argon2_cffi_bindings
|
2 |
+
_ffi
|
venv/Lib/site-packages/arrow/api.py
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Provides the default implementation of :class:`ArrowFactory <arrow.factory.ArrowFactory>`
|
3 |
+
methods for use as a module API.
|
4 |
+
|
5 |
+
"""
|
6 |
+
|
7 |
+
from datetime import date, datetime
|
8 |
+
from datetime import tzinfo as dt_tzinfo
|
9 |
+
from time import struct_time
|
10 |
+
from typing import Any, List, Optional, Tuple, Type, Union, overload
|
11 |
+
|
12 |
+
from arrow.arrow import TZ_EXPR, Arrow
|
13 |
+
from arrow.constants import DEFAULT_LOCALE
|
14 |
+
from arrow.factory import ArrowFactory
|
15 |
+
|
16 |
+
# internal default factory.
|
17 |
+
_factory = ArrowFactory()
|
18 |
+
|
19 |
+
# TODO: Use Positional Only Argument (https://www.python.org/dev/peps/pep-0570/)
|
20 |
+
# after Python 3.7 deprecation
|
21 |
+
|
22 |
+
|
23 |
+
@overload
|
24 |
+
def get(
|
25 |
+
*,
|
26 |
+
locale: str = DEFAULT_LOCALE,
|
27 |
+
tzinfo: Optional[TZ_EXPR] = None,
|
28 |
+
normalize_whitespace: bool = False,
|
29 |
+
) -> Arrow:
|
30 |
+
... # pragma: no cover
|
31 |
+
|
32 |
+
|
33 |
+
@overload
|
34 |
+
def get(
|
35 |
+
*args: int,
|
36 |
+
locale: str = DEFAULT_LOCALE,
|
37 |
+
tzinfo: Optional[TZ_EXPR] = None,
|
38 |
+
normalize_whitespace: bool = False,
|
39 |
+
) -> Arrow:
|
40 |
+
... # pragma: no cover
|
41 |
+
|
42 |
+
|
43 |
+
@overload
|
44 |
+
def get(
|
45 |
+
__obj: Union[
|
46 |
+
Arrow,
|
47 |
+
datetime,
|
48 |
+
date,
|
49 |
+
struct_time,
|
50 |
+
dt_tzinfo,
|
51 |
+
int,
|
52 |
+
float,
|
53 |
+
str,
|
54 |
+
Tuple[int, int, int],
|
55 |
+
],
|
56 |
+
*,
|
57 |
+
locale: str = DEFAULT_LOCALE,
|
58 |
+
tzinfo: Optional[TZ_EXPR] = None,
|
59 |
+
normalize_whitespace: bool = False,
|
60 |
+
) -> Arrow:
|
61 |
+
... # pragma: no cover
|
62 |
+
|
63 |
+
|
64 |
+
@overload
|
65 |
+
def get(
|
66 |
+
__arg1: Union[datetime, date],
|
67 |
+
__arg2: TZ_EXPR,
|
68 |
+
*,
|
69 |
+
locale: str = DEFAULT_LOCALE,
|
70 |
+
tzinfo: Optional[TZ_EXPR] = None,
|
71 |
+
normalize_whitespace: bool = False,
|
72 |
+
) -> Arrow:
|
73 |
+
... # pragma: no cover
|
74 |
+
|
75 |
+
|
76 |
+
@overload
|
77 |
+
def get(
|
78 |
+
__arg1: str,
|
79 |
+
__arg2: Union[str, List[str]],
|
80 |
+
*,
|
81 |
+
locale: str = DEFAULT_LOCALE,
|
82 |
+
tzinfo: Optional[TZ_EXPR] = None,
|
83 |
+
normalize_whitespace: bool = False,
|
84 |
+
) -> Arrow:
|
85 |
+
... # pragma: no cover
|
86 |
+
|
87 |
+
|
88 |
+
def get(*args: Any, **kwargs: Any) -> Arrow:
|
89 |
+
"""Calls the default :class:`ArrowFactory <arrow.factory.ArrowFactory>` ``get`` method."""
|
90 |
+
|
91 |
+
return _factory.get(*args, **kwargs)
|
92 |
+
|
93 |
+
|
94 |
+
get.__doc__ = _factory.get.__doc__
|
95 |
+
|
96 |
+
|
97 |
+
def utcnow() -> Arrow:
|
98 |
+
"""Calls the default :class:`ArrowFactory <arrow.factory.ArrowFactory>` ``utcnow`` method."""
|
99 |
+
|
100 |
+
return _factory.utcnow()
|
101 |
+
|
102 |
+
|
103 |
+
utcnow.__doc__ = _factory.utcnow.__doc__
|
104 |
+
|
105 |
+
|
106 |
+
def now(tz: Optional[TZ_EXPR] = None) -> Arrow:
|
107 |
+
"""Calls the default :class:`ArrowFactory <arrow.factory.ArrowFactory>` ``now`` method."""
|
108 |
+
|
109 |
+
return _factory.now(tz)
|
110 |
+
|
111 |
+
|
112 |
+
now.__doc__ = _factory.now.__doc__
|
113 |
+
|
114 |
+
|
115 |
+
def factory(type: Type[Arrow]) -> ArrowFactory:
|
116 |
+
"""Returns an :class:`.ArrowFactory` for the specified :class:`Arrow <arrow.arrow.Arrow>`
|
117 |
+
or derived type.
|
118 |
+
|
119 |
+
:param type: the type, :class:`Arrow <arrow.arrow.Arrow>` or derived.
|
120 |
+
|
121 |
+
"""
|
122 |
+
|
123 |
+
return ArrowFactory(type)
|
124 |
+
|
125 |
+
|
126 |
+
__all__ = ["get", "utcnow", "now", "factory"]
|
venv/Scripts/Activate.ps1
ADDED
@@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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<#
|
2 |
+
.Synopsis
|
3 |
+
Activate a Python virtual environment for the current PowerShell session.
|
4 |
+
|
5 |
+
.Description
|
6 |
+
Pushes the python executable for a virtual environment to the front of the
|
7 |
+
$Env:PATH environment variable and sets the prompt to signify that you are
|
8 |
+
in a Python virtual environment. Makes use of the command line switches as
|
9 |
+
well as the `pyvenv.cfg` file values present in the virtual environment.
|
10 |
+
|
11 |
+
.Parameter VenvDir
|
12 |
+
Path to the directory that contains the virtual environment to activate. The
|
13 |
+
default value for this is the parent of the directory that the Activate.ps1
|
14 |
+
script is located within.
|
15 |
+
|
16 |
+
.Parameter Prompt
|
17 |
+
The prompt prefix to display when this virtual environment is activated. By
|
18 |
+
default, this prompt is the name of the virtual environment folder (VenvDir)
|
19 |
+
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
|
20 |
+
|
21 |
+
.Example
|
22 |
+
Activate.ps1
|
23 |
+
Activates the Python virtual environment that contains the Activate.ps1 script.
|
24 |
+
|
25 |
+
.Example
|
26 |
+
Activate.ps1 -Verbose
|
27 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
28 |
+
and shows extra information about the activation as it executes.
|
29 |
+
|
30 |
+
.Example
|
31 |
+
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
|
32 |
+
Activates the Python virtual environment located in the specified location.
|
33 |
+
|
34 |
+
.Example
|
35 |
+
Activate.ps1 -Prompt "MyPython"
|
36 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
37 |
+
and prefixes the current prompt with the specified string (surrounded in
|
38 |
+
parentheses) while the virtual environment is active.
|
39 |
+
|
40 |
+
.Notes
|
41 |
+
On Windows, it may be required to enable this Activate.ps1 script by setting the
|
42 |
+
execution policy for the user. You can do this by issuing the following PowerShell
|
43 |
+
command:
|
44 |
+
|
45 |
+
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
46 |
+
|
47 |
+
For more information on Execution Policies:
|
48 |
+
https://go.microsoft.com/fwlink/?LinkID=135170
|
49 |
+
|
50 |
+
#>
|
51 |
+
Param(
|
52 |
+
[Parameter(Mandatory = $false)]
|
53 |
+
[String]
|
54 |
+
$VenvDir,
|
55 |
+
[Parameter(Mandatory = $false)]
|
56 |
+
[String]
|
57 |
+
$Prompt
|
58 |
+
)
|
59 |
+
|
60 |
+
<# Function declarations --------------------------------------------------- #>
|
61 |
+
|
62 |
+
<#
|
63 |
+
.Synopsis
|
64 |
+
Remove all shell session elements added by the Activate script, including the
|
65 |
+
addition of the virtual environment's Python executable from the beginning of
|
66 |
+
the PATH variable.
|
67 |
+
|
68 |
+
.Parameter NonDestructive
|
69 |
+
If present, do not remove this function from the global namespace for the
|
70 |
+
session.
|
71 |
+
|
72 |
+
#>
|
73 |
+
function global:deactivate ([switch]$NonDestructive) {
|
74 |
+
# Revert to original values
|
75 |
+
|
76 |
+
# The prior prompt:
|
77 |
+
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
|
78 |
+
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
|
79 |
+
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
|
80 |
+
}
|
81 |
+
|
82 |
+
# The prior PYTHONHOME:
|
83 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
|
84 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
|
85 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
|
86 |
+
}
|
87 |
+
|
88 |
+
# The prior PATH:
|
89 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
|
90 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
|
91 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
|
92 |
+
}
|
93 |
+
|
94 |
+
# Just remove the VIRTUAL_ENV altogether:
|
95 |
+
if (Test-Path -Path Env:VIRTUAL_ENV) {
|
96 |
+
Remove-Item -Path env:VIRTUAL_ENV
|
97 |
+
}
|
98 |
+
|
99 |
+
# Just remove VIRTUAL_ENV_PROMPT altogether.
|
100 |
+
if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
|
101 |
+
Remove-Item -Path env:VIRTUAL_ENV_PROMPT
|
102 |
+
}
|
103 |
+
|
104 |
+
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
|
105 |
+
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
|
106 |
+
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
|
107 |
+
}
|
108 |
+
|
109 |
+
# Leave deactivate function in the global namespace if requested:
|
110 |
+
if (-not $NonDestructive) {
|
111 |
+
Remove-Item -Path function:deactivate
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
<#
|
116 |
+
.Description
|
117 |
+
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
|
118 |
+
given folder, and returns them in a map.
|
119 |
+
|
120 |
+
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
|
121 |
+
two strings separated by `=` (with any amount of whitespace surrounding the =)
|
122 |
+
then it is considered a `key = value` line. The left hand string is the key,
|
123 |
+
the right hand is the value.
|
124 |
+
|
125 |
+
If the value starts with a `'` or a `"` then the first and last character is
|
126 |
+
stripped from the value before being captured.
|
127 |
+
|
128 |
+
.Parameter ConfigDir
|
129 |
+
Path to the directory that contains the `pyvenv.cfg` file.
|
130 |
+
#>
|
131 |
+
function Get-PyVenvConfig(
|
132 |
+
[String]
|
133 |
+
$ConfigDir
|
134 |
+
) {
|
135 |
+
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
|
136 |
+
|
137 |
+
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
|
138 |
+
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
|
139 |
+
|
140 |
+
# An empty map will be returned if no config file is found.
|
141 |
+
$pyvenvConfig = @{ }
|
142 |
+
|
143 |
+
if ($pyvenvConfigPath) {
|
144 |
+
|
145 |
+
Write-Verbose "File exists, parse `key = value` lines"
|
146 |
+
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
|
147 |
+
|
148 |
+
$pyvenvConfigContent | ForEach-Object {
|
149 |
+
$keyval = $PSItem -split "\s*=\s*", 2
|
150 |
+
if ($keyval[0] -and $keyval[1]) {
|
151 |
+
$val = $keyval[1]
|
152 |
+
|
153 |
+
# Remove extraneous quotations around a string value.
|
154 |
+
if ("'""".Contains($val.Substring(0, 1))) {
|
155 |
+
$val = $val.Substring(1, $val.Length - 2)
|
156 |
+
}
|
157 |
+
|
158 |
+
$pyvenvConfig[$keyval[0]] = $val
|
159 |
+
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
return $pyvenvConfig
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
<# Begin Activate script --------------------------------------------------- #>
|
168 |
+
|
169 |
+
# Determine the containing directory of this script
|
170 |
+
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
171 |
+
$VenvExecDir = Get-Item -Path $VenvExecPath
|
172 |
+
|
173 |
+
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
|
174 |
+
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
|
175 |
+
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
|
176 |
+
|
177 |
+
# Set values required in priority: CmdLine, ConfigFile, Default
|
178 |
+
# First, get the location of the virtual environment, it might not be
|
179 |
+
# VenvExecDir if specified on the command line.
|
180 |
+
if ($VenvDir) {
|
181 |
+
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
|
182 |
+
}
|
183 |
+
else {
|
184 |
+
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
|
185 |
+
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
|
186 |
+
Write-Verbose "VenvDir=$VenvDir"
|
187 |
+
}
|
188 |
+
|
189 |
+
# Next, read the `pyvenv.cfg` file to determine any required value such
|
190 |
+
# as `prompt`.
|
191 |
+
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
|
192 |
+
|
193 |
+
# Next, set the prompt from the command line, or the config file, or
|
194 |
+
# just use the name of the virtual environment folder.
|
195 |
+
if ($Prompt) {
|
196 |
+
Write-Verbose "Prompt specified as argument, using '$Prompt'"
|
197 |
+
}
|
198 |
+
else {
|
199 |
+
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
|
200 |
+
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
|
201 |
+
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
|
202 |
+
$Prompt = $pyvenvCfg['prompt'];
|
203 |
+
}
|
204 |
+
else {
|
205 |
+
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
|
206 |
+
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
|
207 |
+
$Prompt = Split-Path -Path $venvDir -Leaf
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
Write-Verbose "Prompt = '$Prompt'"
|
212 |
+
Write-Verbose "VenvDir='$VenvDir'"
|
213 |
+
|
214 |
+
# Deactivate any currently active virtual environment, but leave the
|
215 |
+
# deactivate function in place.
|
216 |
+
deactivate -nondestructive
|
217 |
+
|
218 |
+
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
|
219 |
+
# that there is an activated venv.
|
220 |
+
$env:VIRTUAL_ENV = $VenvDir
|
221 |
+
|
222 |
+
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
|
223 |
+
|
224 |
+
Write-Verbose "Setting prompt to '$Prompt'"
|
225 |
+
|
226 |
+
# Set the prompt to include the env name
|
227 |
+
# Make sure _OLD_VIRTUAL_PROMPT is global
|
228 |
+
function global:_OLD_VIRTUAL_PROMPT { "" }
|
229 |
+
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
|
230 |
+
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
|
231 |
+
|
232 |
+
function global:prompt {
|
233 |
+
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
|
234 |
+
_OLD_VIRTUAL_PROMPT
|
235 |
+
}
|
236 |
+
$env:VIRTUAL_ENV_PROMPT = $Prompt
|
237 |
+
}
|
238 |
+
|
239 |
+
# Clear PYTHONHOME
|
240 |
+
if (Test-Path -Path Env:PYTHONHOME) {
|
241 |
+
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
|
242 |
+
Remove-Item -Path Env:PYTHONHOME
|
243 |
+
}
|
244 |
+
|
245 |
+
# Add the venv to the PATH
|
246 |
+
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
|
247 |
+
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
|
248 |
+
|
249 |
+
# SIG # Begin signature block
|
250 |
+
# MII0CQYJKoZIhvcNAQcCoIIz+jCCM/YCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
251 |
+
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
|
252 |
+
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBnL745ElCYk8vk
|
253 |
+
# dBtMuQhLeWJ3ZGfzKW4DHCYzAn+QB6CCG9IwggXMMIIDtKADA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 |
+
# KYlVavvBAvaJCORUO7j8PyzzDINuzQorP9+i399ORjOnqeC92Cb0V12LcoqqtJaf
|
527 |
+
# 7oSB86VOI0lfHnPUlLWvoiLHrFR5PsYkltOuPqU=
|
528 |
+
# SIG # End signature block
|
venv/Scripts/activate
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file must be used with "source bin/activate" *from bash*
|
2 |
+
# You cannot run it directly
|
3 |
+
|
4 |
+
deactivate () {
|
5 |
+
# reset old environment variables
|
6 |
+
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
|
7 |
+
PATH="${_OLD_VIRTUAL_PATH:-}"
|
8 |
+
export PATH
|
9 |
+
unset _OLD_VIRTUAL_PATH
|
10 |
+
fi
|
11 |
+
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
|
12 |
+
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
|
13 |
+
export PYTHONHOME
|
14 |
+
unset _OLD_VIRTUAL_PYTHONHOME
|
15 |
+
fi
|
16 |
+
|
17 |
+
# Call hash to forget past locations. Without forgetting
|
18 |
+
# past locations the $PATH changes we made may not be respected.
|
19 |
+
# See "man bash" for more details. hash is usually a builtin of your shell
|
20 |
+
hash -r 2> /dev/null
|
21 |
+
|
22 |
+
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
|
23 |
+
PS1="${_OLD_VIRTUAL_PS1:-}"
|
24 |
+
export PS1
|
25 |
+
unset _OLD_VIRTUAL_PS1
|
26 |
+
fi
|
27 |
+
|
28 |
+
unset VIRTUAL_ENV
|
29 |
+
unset VIRTUAL_ENV_PROMPT
|
30 |
+
if [ ! "${1:-}" = "nondestructive" ] ; then
|
31 |
+
# Self destruct!
|
32 |
+
unset -f deactivate
|
33 |
+
fi
|
34 |
+
}
|
35 |
+
|
36 |
+
# unset irrelevant variables
|
37 |
+
deactivate nondestructive
|
38 |
+
|
39 |
+
# on Windows, a path can contain colons and backslashes and has to be converted:
|
40 |
+
case "$(uname)" in
|
41 |
+
CYGWIN*|MSYS*|MINGW*)
|
42 |
+
# transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW
|
43 |
+
# and to /cygdrive/d/path/to/venv on Cygwin
|
44 |
+
VIRTUAL_ENV=$(cygpath 'C:\Users\Light\Documents\sentiment-analysis-bert\venv')
|
45 |
+
export VIRTUAL_ENV
|
46 |
+
;;
|
47 |
+
*)
|
48 |
+
# use the path as-is
|
49 |
+
export VIRTUAL_ENV='C:\Users\Light\Documents\sentiment-analysis-bert\venv'
|
50 |
+
;;
|
51 |
+
esac
|
52 |
+
|
53 |
+
_OLD_VIRTUAL_PATH="$PATH"
|
54 |
+
PATH="$VIRTUAL_ENV/"Scripts":$PATH"
|
55 |
+
export PATH
|
56 |
+
|
57 |
+
VIRTUAL_ENV_PROMPT='(venv) '
|
58 |
+
export VIRTUAL_ENV_PROMPT
|
59 |
+
|
60 |
+
# unset PYTHONHOME if set
|
61 |
+
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
|
62 |
+
# could use `if (set -u; : $PYTHONHOME) ;` in bash
|
63 |
+
if [ -n "${PYTHONHOME:-}" ] ; then
|
64 |
+
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
|
65 |
+
unset PYTHONHOME
|
66 |
+
fi
|
67 |
+
|
68 |
+
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
|
69 |
+
_OLD_VIRTUAL_PS1="${PS1:-}"
|
70 |
+
PS1="("'(venv) '") ${PS1:-}"
|
71 |
+
export PS1
|
72 |
+
fi
|
73 |
+
|
74 |
+
# Call hash to forget past commands. Without forgetting
|
75 |
+
# past commands the $PATH changes we made may not be respected
|
76 |
+
hash -r 2> /dev/null
|
venv/Scripts/activate.bat
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@echo off
|
2 |
+
|
3 |
+
rem This file is UTF-8 encoded, so we need to update the current code page while executing it
|
4 |
+
for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do (
|
5 |
+
set _OLD_CODEPAGE=%%a
|
6 |
+
)
|
7 |
+
if defined _OLD_CODEPAGE (
|
8 |
+
"%SystemRoot%\System32\chcp.com" 65001 > nul
|
9 |
+
)
|
10 |
+
|
11 |
+
set "VIRTUAL_ENV=C:\Users\Light\Documents\sentiment-analysis-bert\venv"
|
12 |
+
|
13 |
+
if not defined PROMPT set PROMPT=$P$G
|
14 |
+
|
15 |
+
if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT%
|
16 |
+
if defined _OLD_VIRTUAL_PYTHONHOME set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%
|
17 |
+
|
18 |
+
set _OLD_VIRTUAL_PROMPT=%PROMPT%
|
19 |
+
set PROMPT=(venv) %PROMPT%
|
20 |
+
|
21 |
+
if defined PYTHONHOME set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%
|
22 |
+
set PYTHONHOME=
|
23 |
+
|
24 |
+
if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%
|
25 |
+
if not defined _OLD_VIRTUAL_PATH set _OLD_VIRTUAL_PATH=%PATH%
|
26 |
+
|
27 |
+
set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%"
|
28 |
+
set "VIRTUAL_ENV_PROMPT=(venv) "
|
29 |
+
|
30 |
+
:END
|
31 |
+
if defined _OLD_CODEPAGE (
|
32 |
+
"%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul
|
33 |
+
set _OLD_CODEPAGE=
|
34 |
+
)
|
venv/Scripts/deactivate.bat
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@echo off
|
2 |
+
|
3 |
+
if defined _OLD_VIRTUAL_PROMPT (
|
4 |
+
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
|
5 |
+
)
|
6 |
+
set _OLD_VIRTUAL_PROMPT=
|
7 |
+
|
8 |
+
if defined _OLD_VIRTUAL_PYTHONHOME (
|
9 |
+
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
|
10 |
+
set _OLD_VIRTUAL_PYTHONHOME=
|
11 |
+
)
|
12 |
+
|
13 |
+
if defined _OLD_VIRTUAL_PATH (
|
14 |
+
set "PATH=%_OLD_VIRTUAL_PATH%"
|
15 |
+
)
|
16 |
+
|
17 |
+
set _OLD_VIRTUAL_PATH=
|
18 |
+
|
19 |
+
set VIRTUAL_ENV=
|
20 |
+
set VIRTUAL_ENV_PROMPT=
|
21 |
+
|
22 |
+
:END
|
venv/Scripts/get_gprof
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!C:\Users\Light\Documents\sentiment-analysis-bert\venv\Scripts\python.exe
|
2 |
+
#
|
3 |
+
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
|
4 |
+
# Copyright (c) 2008-2016 California Institute of Technology.
|
5 |
+
# Copyright (c) 2016-2024 The Uncertainty Quantification Foundation.
|
6 |
+
# License: 3-clause BSD. The full license text is available at:
|
7 |
+
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
|
8 |
+
'''
|
9 |
+
build profile graph for the given instance
|
10 |
+
|
11 |
+
running:
|
12 |
+
$ get_gprof <args> <instance>
|
13 |
+
|
14 |
+
executes:
|
15 |
+
gprof2dot -f pstats <args> <type>.prof | dot -Tpng -o <type>.call.png
|
16 |
+
|
17 |
+
where:
|
18 |
+
<args> are arguments for gprof2dot, such as "-n 5 -e 5"
|
19 |
+
<instance> is code to create the instance to profile
|
20 |
+
<type> is the class of the instance (i.e. type(instance))
|
21 |
+
|
22 |
+
For example:
|
23 |
+
$ get_gprof -n 5 -e 1 "import numpy; numpy.array([1,2])"
|
24 |
+
|
25 |
+
will create 'ndarray.call.png' with the profile graph for numpy.array([1,2]),
|
26 |
+
where '-n 5' eliminates nodes below 5% threshold, similarly '-e 1' eliminates
|
27 |
+
edges below 1% threshold
|
28 |
+
'''
|
29 |
+
|
30 |
+
if __name__ == "__main__":
|
31 |
+
import sys
|
32 |
+
if len(sys.argv) < 2:
|
33 |
+
print ("Please provide an object instance (e.g. 'import math; math.pi')")
|
34 |
+
sys.exit()
|
35 |
+
# grab args for gprof2dot
|
36 |
+
args = sys.argv[1:-1]
|
37 |
+
args = ' '.join(args)
|
38 |
+
# last arg builds the object
|
39 |
+
obj = sys.argv[-1]
|
40 |
+
obj = obj.split(';')
|
41 |
+
# multi-line prep for generating an instance
|
42 |
+
for line in obj[:-1]:
|
43 |
+
exec(line)
|
44 |
+
# one-line generation of an instance
|
45 |
+
try:
|
46 |
+
obj = eval(obj[-1])
|
47 |
+
except Exception:
|
48 |
+
print ("Error processing object instance")
|
49 |
+
sys.exit()
|
50 |
+
|
51 |
+
# get object 'name'
|
52 |
+
objtype = type(obj)
|
53 |
+
name = getattr(objtype, '__name__', getattr(objtype, '__class__', objtype))
|
54 |
+
|
55 |
+
# profile dumping an object
|
56 |
+
import dill
|
57 |
+
import os
|
58 |
+
import cProfile
|
59 |
+
#name = os.path.splitext(os.path.basename(__file__))[0]
|
60 |
+
cProfile.run("dill.dumps(obj)", filename="%s.prof" % name)
|
61 |
+
msg = "gprof2dot -f pstats %s %s.prof | dot -Tpng -o %s.call.png" % (args, name, name)
|
62 |
+
try:
|
63 |
+
res = os.system(msg)
|
64 |
+
except Exception:
|
65 |
+
print ("Please verify install of 'gprof2dot' to view profile graphs")
|
66 |
+
if res:
|
67 |
+
print ("Please verify install of 'gprof2dot' to view profile graphs")
|
68 |
+
|
69 |
+
# get stats
|
70 |
+
f_prof = "%s.prof" % name
|
71 |
+
import pstats
|
72 |
+
stats = pstats.Stats(f_prof, stream=sys.stdout)
|
73 |
+
stats.strip_dirs().sort_stats('cumtime')
|
74 |
+
stats.print_stats(20) #XXX: save to file instead of print top 20?
|
75 |
+
os.remove(f_prof)
|
venv/Scripts/get_objgraph
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!C:\Users\Light\Documents\sentiment-analysis-bert\venv\Scripts\python.exe
|
2 |
+
#
|
3 |
+
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
|
4 |
+
# Copyright (c) 2008-2016 California Institute of Technology.
|
5 |
+
# Copyright (c) 2016-2024 The Uncertainty Quantification Foundation.
|
6 |
+
# License: 3-clause BSD. The full license text is available at:
|
7 |
+
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
|
8 |
+
"""
|
9 |
+
display the reference paths for objects in ``dill.types`` or a .pkl file
|
10 |
+
|
11 |
+
Notes:
|
12 |
+
the generated image is useful in showing the pointer references in
|
13 |
+
objects that are or can be pickled. Any object in ``dill.objects``
|
14 |
+
listed in ``dill.load_types(picklable=True, unpicklable=True)`` works.
|
15 |
+
|
16 |
+
Examples::
|
17 |
+
|
18 |
+
$ get_objgraph ArrayType
|
19 |
+
Image generated as ArrayType.png
|
20 |
+
"""
|
21 |
+
|
22 |
+
import dill as pickle
|
23 |
+
#pickle.debug.trace(True)
|
24 |
+
#import pickle
|
25 |
+
|
26 |
+
# get all objects for testing
|
27 |
+
from dill import load_types
|
28 |
+
load_types(pickleable=True,unpickleable=True)
|
29 |
+
from dill import objects
|
30 |
+
|
31 |
+
if __name__ == "__main__":
|
32 |
+
import sys
|
33 |
+
if len(sys.argv) != 2:
|
34 |
+
print ("Please provide exactly one file or type name (e.g. 'IntType')")
|
35 |
+
msg = "\n"
|
36 |
+
for objtype in list(objects.keys())[:40]:
|
37 |
+
msg += objtype + ', '
|
38 |
+
print (msg + "...")
|
39 |
+
else:
|
40 |
+
objtype = str(sys.argv[-1])
|
41 |
+
try:
|
42 |
+
obj = objects[objtype]
|
43 |
+
except KeyError:
|
44 |
+
obj = pickle.load(open(objtype,'rb'))
|
45 |
+
import os
|
46 |
+
objtype = os.path.splitext(objtype)[0]
|
47 |
+
try:
|
48 |
+
import objgraph
|
49 |
+
objgraph.show_refs(obj, filename=objtype+'.png')
|
50 |
+
except ImportError:
|
51 |
+
print ("Please install 'objgraph' to view object graphs")
|
52 |
+
|
53 |
+
|
54 |
+
# EOF
|
venv/Scripts/jsonpointer
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!C:\Users\Light\Documents\sentiment-analysis-bert\venv\Scripts\python.exe
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
|
4 |
+
|
5 |
+
import argparse
|
6 |
+
import json
|
7 |
+
import sys
|
8 |
+
|
9 |
+
import jsonpointer
|
10 |
+
|
11 |
+
parser = argparse.ArgumentParser(
|
12 |
+
description='Resolve a JSON pointer on JSON files')
|
13 |
+
|
14 |
+
# Accept pointer as argument or as file
|
15 |
+
ptr_group = parser.add_mutually_exclusive_group(required=True)
|
16 |
+
|
17 |
+
ptr_group.add_argument('-f', '--pointer-file', type=argparse.FileType('r'),
|
18 |
+
nargs='?',
|
19 |
+
help='File containing a JSON pointer expression')
|
20 |
+
|
21 |
+
ptr_group.add_argument('POINTER', type=str, nargs='?',
|
22 |
+
help='A JSON pointer expression')
|
23 |
+
|
24 |
+
parser.add_argument('FILE', type=argparse.FileType('r'), nargs='+',
|
25 |
+
help='Files for which the pointer should be resolved')
|
26 |
+
parser.add_argument('--indent', type=int, default=None,
|
27 |
+
help='Indent output by n spaces')
|
28 |
+
parser.add_argument('-v', '--version', action='version',
|
29 |
+
version='%(prog)s ' + jsonpointer.__version__)
|
30 |
+
|
31 |
+
|
32 |
+
def main():
|
33 |
+
try:
|
34 |
+
resolve_files()
|
35 |
+
except KeyboardInterrupt:
|
36 |
+
sys.exit(1)
|
37 |
+
|
38 |
+
|
39 |
+
def parse_pointer(args):
|
40 |
+
if args.POINTER:
|
41 |
+
ptr = args.POINTER
|
42 |
+
elif args.pointer_file:
|
43 |
+
ptr = args.pointer_file.read().strip()
|
44 |
+
else:
|
45 |
+
parser.print_usage()
|
46 |
+
sys.exit(1)
|
47 |
+
|
48 |
+
return ptr
|
49 |
+
|
50 |
+
|
51 |
+
def resolve_files():
|
52 |
+
""" Resolve a JSON pointer on JSON files """
|
53 |
+
args = parser.parse_args()
|
54 |
+
|
55 |
+
ptr = parse_pointer(args)
|
56 |
+
|
57 |
+
for f in args.FILE:
|
58 |
+
doc = json.load(f)
|
59 |
+
try:
|
60 |
+
result = jsonpointer.resolve_pointer(doc, ptr)
|
61 |
+
print(json.dumps(result, indent=args.indent))
|
62 |
+
except jsonpointer.JsonPointerException as e:
|
63 |
+
print('Could not resolve pointer: %s' % str(e), file=sys.stderr)
|
64 |
+
|
65 |
+
|
66 |
+
if __name__ == "__main__":
|
67 |
+
main()
|
venv/Scripts/pywin32_postinstall.py
ADDED
@@ -0,0 +1,733 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# postinstall script for pywin32
|
2 |
+
#
|
3 |
+
# copies pywintypesXX.dll and pythoncomXX.dll into the system directory,
|
4 |
+
# and creates a pth file
|
5 |
+
import argparse
|
6 |
+
import glob
|
7 |
+
import os
|
8 |
+
import shutil
|
9 |
+
import sys
|
10 |
+
import sysconfig
|
11 |
+
import tempfile
|
12 |
+
import winreg
|
13 |
+
|
14 |
+
tee_f = open(
|
15 |
+
os.path.join(
|
16 |
+
tempfile.gettempdir(), # Send output somewhere so it can be found if necessary...
|
17 |
+
"pywin32_postinstall.log",
|
18 |
+
),
|
19 |
+
"w",
|
20 |
+
)
|
21 |
+
|
22 |
+
|
23 |
+
class Tee:
|
24 |
+
def __init__(self, file):
|
25 |
+
self.f = file
|
26 |
+
|
27 |
+
def write(self, what):
|
28 |
+
if self.f is not None:
|
29 |
+
try:
|
30 |
+
self.f.write(what.replace("\n", "\r\n"))
|
31 |
+
except OSError:
|
32 |
+
pass
|
33 |
+
tee_f.write(what)
|
34 |
+
|
35 |
+
def flush(self):
|
36 |
+
if self.f is not None:
|
37 |
+
try:
|
38 |
+
self.f.flush()
|
39 |
+
except OSError:
|
40 |
+
pass
|
41 |
+
tee_f.flush()
|
42 |
+
|
43 |
+
|
44 |
+
sys.stderr = Tee(sys.stderr)
|
45 |
+
sys.stdout = Tee(sys.stdout)
|
46 |
+
|
47 |
+
com_modules = [
|
48 |
+
# module_name, class_names
|
49 |
+
("win32com.servers.interp", "Interpreter"),
|
50 |
+
("win32com.servers.dictionary", "DictionaryPolicy"),
|
51 |
+
("win32com.axscript.client.pyscript", "PyScript"),
|
52 |
+
]
|
53 |
+
|
54 |
+
# Is this a 'silent' install - ie, avoid all dialogs.
|
55 |
+
# Different than 'verbose'
|
56 |
+
silent = 0
|
57 |
+
|
58 |
+
# Verbosity of output messages.
|
59 |
+
verbose = 1
|
60 |
+
|
61 |
+
root_key_name = "Software\\Python\\PythonCore\\" + sys.winver
|
62 |
+
|
63 |
+
|
64 |
+
def get_root_hkey():
|
65 |
+
try:
|
66 |
+
winreg.OpenKey(
|
67 |
+
winreg.HKEY_LOCAL_MACHINE, root_key_name, 0, winreg.KEY_CREATE_SUB_KEY
|
68 |
+
)
|
69 |
+
return winreg.HKEY_LOCAL_MACHINE
|
70 |
+
except OSError:
|
71 |
+
# Either not exist, or no permissions to create subkey means
|
72 |
+
# must be HKCU
|
73 |
+
return winreg.HKEY_CURRENT_USER
|
74 |
+
|
75 |
+
|
76 |
+
# Create a function with the same signature as create_shortcut
|
77 |
+
# previously provided by bdist_wininst
|
78 |
+
def create_shortcut(
|
79 |
+
path, description, filename, arguments="", workdir="", iconpath="", iconindex=0
|
80 |
+
):
|
81 |
+
import pythoncom
|
82 |
+
from win32com.shell import shell
|
83 |
+
|
84 |
+
ilink = pythoncom.CoCreateInstance(
|
85 |
+
shell.CLSID_ShellLink,
|
86 |
+
None,
|
87 |
+
pythoncom.CLSCTX_INPROC_SERVER,
|
88 |
+
shell.IID_IShellLink,
|
89 |
+
)
|
90 |
+
ilink.SetPath(path)
|
91 |
+
ilink.SetDescription(description)
|
92 |
+
if arguments:
|
93 |
+
ilink.SetArguments(arguments)
|
94 |
+
if workdir:
|
95 |
+
ilink.SetWorkingDirectory(workdir)
|
96 |
+
if iconpath or iconindex:
|
97 |
+
ilink.SetIconLocation(iconpath, iconindex)
|
98 |
+
# now save it.
|
99 |
+
ipf = ilink.QueryInterface(pythoncom.IID_IPersistFile)
|
100 |
+
ipf.Save(filename, 0)
|
101 |
+
|
102 |
+
|
103 |
+
# Support the same list of "path names" as bdist_wininst used to
|
104 |
+
def get_special_folder_path(path_name):
|
105 |
+
from win32com.shell import shell, shellcon
|
106 |
+
|
107 |
+
for maybe in """
|
108 |
+
CSIDL_COMMON_STARTMENU CSIDL_STARTMENU CSIDL_COMMON_APPDATA
|
109 |
+
CSIDL_LOCAL_APPDATA CSIDL_APPDATA CSIDL_COMMON_DESKTOPDIRECTORY
|
110 |
+
CSIDL_DESKTOPDIRECTORY CSIDL_COMMON_STARTUP CSIDL_STARTUP
|
111 |
+
CSIDL_COMMON_PROGRAMS CSIDL_PROGRAMS CSIDL_PROGRAM_FILES_COMMON
|
112 |
+
CSIDL_PROGRAM_FILES CSIDL_FONTS""".split():
|
113 |
+
if maybe == path_name:
|
114 |
+
csidl = getattr(shellcon, maybe)
|
115 |
+
return shell.SHGetSpecialFolderPath(0, csidl, False)
|
116 |
+
raise ValueError(f"{path_name} is an unknown path ID")
|
117 |
+
|
118 |
+
|
119 |
+
def CopyTo(desc, src, dest):
|
120 |
+
import win32api
|
121 |
+
import win32con
|
122 |
+
|
123 |
+
while 1:
|
124 |
+
try:
|
125 |
+
win32api.CopyFile(src, dest, 0)
|
126 |
+
return
|
127 |
+
except win32api.error as details:
|
128 |
+
if details.winerror == 5: # access denied - user not admin.
|
129 |
+
raise
|
130 |
+
if silent:
|
131 |
+
# Running silent mode - just re-raise the error.
|
132 |
+
raise
|
133 |
+
full_desc = (
|
134 |
+
f"Error {desc}\n\n"
|
135 |
+
"If you have any Python applications running, "
|
136 |
+
f"please close them now\nand select 'Retry'\n\n{details.strerror}"
|
137 |
+
)
|
138 |
+
rc = win32api.MessageBox(
|
139 |
+
0, full_desc, "Installation Error", win32con.MB_ABORTRETRYIGNORE
|
140 |
+
)
|
141 |
+
if rc == win32con.IDABORT:
|
142 |
+
raise
|
143 |
+
elif rc == win32con.IDIGNORE:
|
144 |
+
return
|
145 |
+
# else retry - around we go again.
|
146 |
+
|
147 |
+
|
148 |
+
# We need to import win32api to determine the Windows system directory,
|
149 |
+
# so we can copy our system files there - but importing win32api will
|
150 |
+
# load the pywintypes.dll already in the system directory preventing us
|
151 |
+
# from updating them!
|
152 |
+
# So, we pull the same trick pywintypes.py does, but it loads from
|
153 |
+
# our pywintypes_system32 directory.
|
154 |
+
def LoadSystemModule(lib_dir, modname):
|
155 |
+
# See if this is a debug build.
|
156 |
+
import importlib.machinery
|
157 |
+
import importlib.util
|
158 |
+
|
159 |
+
suffix = "_d" if "_d.pyd" in importlib.machinery.EXTENSION_SUFFIXES else ""
|
160 |
+
filename = "%s%d%d%s.dll" % (
|
161 |
+
modname,
|
162 |
+
sys.version_info.major,
|
163 |
+
sys.version_info.minor,
|
164 |
+
suffix,
|
165 |
+
)
|
166 |
+
filename = os.path.join(lib_dir, "pywin32_system32", filename)
|
167 |
+
loader = importlib.machinery.ExtensionFileLoader(modname, filename)
|
168 |
+
spec = importlib.machinery.ModuleSpec(name=modname, loader=loader, origin=filename)
|
169 |
+
mod = importlib.util.module_from_spec(spec)
|
170 |
+
loader.exec_module(mod)
|
171 |
+
|
172 |
+
|
173 |
+
def SetPyKeyVal(key_name, value_name, value):
|
174 |
+
root_hkey = get_root_hkey()
|
175 |
+
root_key = winreg.OpenKey(root_hkey, root_key_name)
|
176 |
+
try:
|
177 |
+
my_key = winreg.CreateKey(root_key, key_name)
|
178 |
+
try:
|
179 |
+
winreg.SetValueEx(my_key, value_name, 0, winreg.REG_SZ, value)
|
180 |
+
if verbose:
|
181 |
+
print(f"-> {root_key_name}\\{key_name}[{value_name}]={value!r}")
|
182 |
+
finally:
|
183 |
+
my_key.Close()
|
184 |
+
finally:
|
185 |
+
root_key.Close()
|
186 |
+
|
187 |
+
|
188 |
+
def UnsetPyKeyVal(key_name, value_name, delete_key=False):
|
189 |
+
root_hkey = get_root_hkey()
|
190 |
+
root_key = winreg.OpenKey(root_hkey, root_key_name)
|
191 |
+
try:
|
192 |
+
my_key = winreg.OpenKey(root_key, key_name, 0, winreg.KEY_SET_VALUE)
|
193 |
+
try:
|
194 |
+
winreg.DeleteValue(my_key, value_name)
|
195 |
+
if verbose:
|
196 |
+
print(f"-> DELETE {root_key_name}\\{key_name}[{value_name}]")
|
197 |
+
finally:
|
198 |
+
my_key.Close()
|
199 |
+
if delete_key:
|
200 |
+
winreg.DeleteKey(root_key, key_name)
|
201 |
+
if verbose:
|
202 |
+
print(f"-> DELETE {root_key_name}\\{key_name}")
|
203 |
+
except OSError as why:
|
204 |
+
winerror = getattr(why, "winerror", why.errno)
|
205 |
+
if winerror != 2: # file not found
|
206 |
+
raise
|
207 |
+
finally:
|
208 |
+
root_key.Close()
|
209 |
+
|
210 |
+
|
211 |
+
def RegisterCOMObjects(register=True):
|
212 |
+
import win32com.server.register
|
213 |
+
|
214 |
+
if register:
|
215 |
+
func = win32com.server.register.RegisterClasses
|
216 |
+
else:
|
217 |
+
func = win32com.server.register.UnregisterClasses
|
218 |
+
flags = {}
|
219 |
+
if not verbose:
|
220 |
+
flags["quiet"] = 1
|
221 |
+
for module, klass_name in com_modules:
|
222 |
+
__import__(module)
|
223 |
+
mod = sys.modules[module]
|
224 |
+
flags["finalize_register"] = getattr(mod, "DllRegisterServer", None)
|
225 |
+
flags["finalize_unregister"] = getattr(mod, "DllUnregisterServer", None)
|
226 |
+
klass = getattr(mod, klass_name)
|
227 |
+
func(klass, **flags)
|
228 |
+
|
229 |
+
|
230 |
+
def RegisterHelpFile(register=True, lib_dir=None):
|
231 |
+
if lib_dir is None:
|
232 |
+
lib_dir = sysconfig.get_paths()["platlib"]
|
233 |
+
if register:
|
234 |
+
# Register the .chm help file.
|
235 |
+
chm_file = os.path.join(lib_dir, "PyWin32.chm")
|
236 |
+
if os.path.isfile(chm_file):
|
237 |
+
# This isn't recursive, so if 'Help' doesn't exist, we croak
|
238 |
+
SetPyKeyVal("Help", None, None)
|
239 |
+
SetPyKeyVal("Help\\Pythonwin Reference", None, chm_file)
|
240 |
+
return chm_file
|
241 |
+
else:
|
242 |
+
print("NOTE: PyWin32.chm can not be located, so has not been registered")
|
243 |
+
else:
|
244 |
+
UnsetPyKeyVal("Help\\Pythonwin Reference", None, delete_key=True)
|
245 |
+
return None
|
246 |
+
|
247 |
+
|
248 |
+
def RegisterPythonwin(register=True, lib_dir=None):
|
249 |
+
"""Add (or remove) Pythonwin to context menu for python scripts.
|
250 |
+
??? Should probably also add Edit command for pys files also.
|
251 |
+
Also need to remove these keys on uninstall, but there's no function
|
252 |
+
to add registry entries to uninstall log ???
|
253 |
+
"""
|
254 |
+
import os
|
255 |
+
|
256 |
+
if lib_dir is None:
|
257 |
+
lib_dir = sysconfig.get_paths()["platlib"]
|
258 |
+
classes_root = get_root_hkey()
|
259 |
+
## Installer executable doesn't seem to pass anything to postinstall script indicating if it's a debug build
|
260 |
+
pythonwin_exe = os.path.join(lib_dir, "Pythonwin", "Pythonwin.exe")
|
261 |
+
pythonwin_edit_command = pythonwin_exe + ' -edit "%1"'
|
262 |
+
|
263 |
+
keys_vals = [
|
264 |
+
(
|
265 |
+
"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Pythonwin.exe",
|
266 |
+
"",
|
267 |
+
pythonwin_exe,
|
268 |
+
),
|
269 |
+
(
|
270 |
+
"Software\\Classes\\Python.File\\shell\\Edit with Pythonwin",
|
271 |
+
"command",
|
272 |
+
pythonwin_edit_command,
|
273 |
+
),
|
274 |
+
(
|
275 |
+
"Software\\Classes\\Python.NoConFile\\shell\\Edit with Pythonwin",
|
276 |
+
"command",
|
277 |
+
pythonwin_edit_command,
|
278 |
+
),
|
279 |
+
]
|
280 |
+
|
281 |
+
try:
|
282 |
+
if register:
|
283 |
+
for key, sub_key, val in keys_vals:
|
284 |
+
## Since winreg only uses the character Api functions, this can fail if Python
|
285 |
+
## is installed to a path containing non-ascii characters
|
286 |
+
hkey = winreg.CreateKey(classes_root, key)
|
287 |
+
if sub_key:
|
288 |
+
hkey = winreg.CreateKey(hkey, sub_key)
|
289 |
+
winreg.SetValueEx(hkey, None, 0, winreg.REG_SZ, val)
|
290 |
+
hkey.Close()
|
291 |
+
else:
|
292 |
+
for key, sub_key, val in keys_vals:
|
293 |
+
try:
|
294 |
+
if sub_key:
|
295 |
+
hkey = winreg.OpenKey(classes_root, key)
|
296 |
+
winreg.DeleteKey(hkey, sub_key)
|
297 |
+
hkey.Close()
|
298 |
+
winreg.DeleteKey(classes_root, key)
|
299 |
+
except OSError as why:
|
300 |
+
winerror = getattr(why, "winerror", why.errno)
|
301 |
+
if winerror != 2: # file not found
|
302 |
+
raise
|
303 |
+
finally:
|
304 |
+
# tell windows about the change
|
305 |
+
from win32com.shell import shell, shellcon
|
306 |
+
|
307 |
+
shell.SHChangeNotify(
|
308 |
+
shellcon.SHCNE_ASSOCCHANGED, shellcon.SHCNF_IDLIST, None, None
|
309 |
+
)
|
310 |
+
|
311 |
+
|
312 |
+
def get_shortcuts_folder():
|
313 |
+
if get_root_hkey() == winreg.HKEY_LOCAL_MACHINE:
|
314 |
+
try:
|
315 |
+
fldr = get_special_folder_path("CSIDL_COMMON_PROGRAMS")
|
316 |
+
except OSError:
|
317 |
+
# No CSIDL_COMMON_PROGRAMS on this platform
|
318 |
+
fldr = get_special_folder_path("CSIDL_PROGRAMS")
|
319 |
+
else:
|
320 |
+
# non-admin install - always goes in this user's start menu.
|
321 |
+
fldr = get_special_folder_path("CSIDL_PROGRAMS")
|
322 |
+
|
323 |
+
try:
|
324 |
+
install_group = winreg.QueryValue(
|
325 |
+
get_root_hkey(), root_key_name + "\\InstallPath\\InstallGroup"
|
326 |
+
)
|
327 |
+
except OSError:
|
328 |
+
install_group = "Python %d.%d" % (
|
329 |
+
sys.version_info.major,
|
330 |
+
sys.version_info.minor,
|
331 |
+
)
|
332 |
+
return os.path.join(fldr, install_group)
|
333 |
+
|
334 |
+
|
335 |
+
# Get the system directory, which may be the Wow64 directory if we are a 32bit
|
336 |
+
# python on a 64bit OS.
|
337 |
+
def get_system_dir():
|
338 |
+
import win32api # we assume this exists.
|
339 |
+
|
340 |
+
try:
|
341 |
+
import pythoncom
|
342 |
+
import win32process
|
343 |
+
from win32com.shell import shell, shellcon
|
344 |
+
|
345 |
+
try:
|
346 |
+
if win32process.IsWow64Process():
|
347 |
+
return shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_SYSTEMX86)
|
348 |
+
return shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_SYSTEM)
|
349 |
+
except (pythoncom.com_error, win32process.error):
|
350 |
+
return win32api.GetSystemDirectory()
|
351 |
+
except ImportError:
|
352 |
+
return win32api.GetSystemDirectory()
|
353 |
+
|
354 |
+
|
355 |
+
def fixup_dbi():
|
356 |
+
# We used to have a dbi.pyd with our .pyd files, but now have a .py file.
|
357 |
+
# If the user didn't uninstall, they will find the .pyd which will cause
|
358 |
+
# problems - so handle that.
|
359 |
+
import win32api
|
360 |
+
import win32con
|
361 |
+
|
362 |
+
pyd_name = os.path.join(os.path.dirname(win32api.__file__), "dbi.pyd")
|
363 |
+
pyd_d_name = os.path.join(os.path.dirname(win32api.__file__), "dbi_d.pyd")
|
364 |
+
py_name = os.path.join(os.path.dirname(win32con.__file__), "dbi.py")
|
365 |
+
for this_pyd in (pyd_name, pyd_d_name):
|
366 |
+
this_dest = this_pyd + ".old"
|
367 |
+
if os.path.isfile(this_pyd) and os.path.isfile(py_name):
|
368 |
+
try:
|
369 |
+
if os.path.isfile(this_dest):
|
370 |
+
print(
|
371 |
+
f"Old dbi '{this_dest}' already exists - deleting '{this_pyd}'"
|
372 |
+
)
|
373 |
+
os.remove(this_pyd)
|
374 |
+
else:
|
375 |
+
os.rename(this_pyd, this_dest)
|
376 |
+
print(f"renamed '{this_pyd}'->'{this_pyd}.old'")
|
377 |
+
except OSError as exc:
|
378 |
+
print(f"FAILED to rename '{this_pyd}': {exc}")
|
379 |
+
|
380 |
+
|
381 |
+
def install(lib_dir):
|
382 |
+
import traceback
|
383 |
+
|
384 |
+
# The .pth file is now installed as a regular file.
|
385 |
+
# Create the .pth file in the site-packages dir, and use only relative paths
|
386 |
+
# We used to write a .pth directly to sys.prefix - clobber it.
|
387 |
+
if os.path.isfile(os.path.join(sys.prefix, "pywin32.pth")):
|
388 |
+
os.unlink(os.path.join(sys.prefix, "pywin32.pth"))
|
389 |
+
# The .pth may be new and therefore not loaded in this session.
|
390 |
+
# Setup the paths just in case.
|
391 |
+
for name in "win32 win32\\lib Pythonwin".split():
|
392 |
+
sys.path.append(os.path.join(lib_dir, name))
|
393 |
+
# It is possible people with old versions installed with still have
|
394 |
+
# pywintypes and pythoncom registered. We no longer need this, and stale
|
395 |
+
# entries hurt us.
|
396 |
+
for name in "pythoncom pywintypes".split():
|
397 |
+
keyname = "Software\\Python\\PythonCore\\" + sys.winver + "\\Modules\\" + name
|
398 |
+
for root in winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER:
|
399 |
+
try:
|
400 |
+
winreg.DeleteKey(root, keyname + "\\Debug")
|
401 |
+
except OSError:
|
402 |
+
pass
|
403 |
+
try:
|
404 |
+
winreg.DeleteKey(root, keyname)
|
405 |
+
except OSError:
|
406 |
+
pass
|
407 |
+
LoadSystemModule(lib_dir, "pywintypes")
|
408 |
+
LoadSystemModule(lib_dir, "pythoncom")
|
409 |
+
import win32api
|
410 |
+
|
411 |
+
# and now we can get the system directory:
|
412 |
+
files = glob.glob(os.path.join(lib_dir, "pywin32_system32\\*.*"))
|
413 |
+
if not files:
|
414 |
+
raise RuntimeError("No system files to copy!!")
|
415 |
+
# Try the system32 directory first - if that fails due to "access denied",
|
416 |
+
# it implies a non-admin user, and we use sys.prefix
|
417 |
+
for dest_dir in [get_system_dir(), sys.prefix]:
|
418 |
+
# and copy some files over there
|
419 |
+
worked = 0
|
420 |
+
try:
|
421 |
+
for fname in files:
|
422 |
+
base = os.path.basename(fname)
|
423 |
+
dst = os.path.join(dest_dir, base)
|
424 |
+
CopyTo("installing %s" % base, fname, dst)
|
425 |
+
if verbose:
|
426 |
+
print(f"Copied {base} to {dst}")
|
427 |
+
worked = 1
|
428 |
+
# Nuke any other versions that may exist - having
|
429 |
+
# duplicates causes major headaches.
|
430 |
+
bad_dest_dirs = [
|
431 |
+
os.path.join(sys.prefix, "Library\\bin"),
|
432 |
+
os.path.join(sys.prefix, "Lib\\site-packages\\win32"),
|
433 |
+
]
|
434 |
+
if dest_dir != sys.prefix:
|
435 |
+
bad_dest_dirs.append(sys.prefix)
|
436 |
+
for bad_dest_dir in bad_dest_dirs:
|
437 |
+
bad_fname = os.path.join(bad_dest_dir, base)
|
438 |
+
if os.path.exists(bad_fname):
|
439 |
+
# let exceptions go here - delete must succeed
|
440 |
+
os.unlink(bad_fname)
|
441 |
+
if worked:
|
442 |
+
break
|
443 |
+
except win32api.error as details:
|
444 |
+
if details.winerror == 5:
|
445 |
+
# access denied - user not admin - try sys.prefix dir,
|
446 |
+
# but first check that a version doesn't already exist
|
447 |
+
# in that place - otherwise that one will still get used!
|
448 |
+
if os.path.exists(dst):
|
449 |
+
msg = (
|
450 |
+
"The file '%s' exists, but can not be replaced "
|
451 |
+
"due to insufficient permissions. You must "
|
452 |
+
"reinstall this software as an Administrator" % dst
|
453 |
+
)
|
454 |
+
print(msg)
|
455 |
+
raise RuntimeError(msg)
|
456 |
+
continue
|
457 |
+
raise
|
458 |
+
else:
|
459 |
+
raise RuntimeError(
|
460 |
+
"You don't have enough permissions to install the system files"
|
461 |
+
)
|
462 |
+
|
463 |
+
# Register our demo COM objects.
|
464 |
+
try:
|
465 |
+
try:
|
466 |
+
RegisterCOMObjects()
|
467 |
+
except win32api.error as details:
|
468 |
+
if details.winerror != 5: # ERROR_ACCESS_DENIED
|
469 |
+
raise
|
470 |
+
print("You do not have the permissions to install COM objects.")
|
471 |
+
print("The sample COM objects were not registered.")
|
472 |
+
except Exception:
|
473 |
+
print("FAILED to register the Python COM objects")
|
474 |
+
traceback.print_exc()
|
475 |
+
|
476 |
+
# There may be no main Python key in HKCU if, eg, an admin installed
|
477 |
+
# python itself.
|
478 |
+
winreg.CreateKey(get_root_hkey(), root_key_name)
|
479 |
+
|
480 |
+
chm_file = None
|
481 |
+
try:
|
482 |
+
chm_file = RegisterHelpFile(True, lib_dir)
|
483 |
+
except Exception:
|
484 |
+
print("Failed to register help file")
|
485 |
+
traceback.print_exc()
|
486 |
+
else:
|
487 |
+
if verbose:
|
488 |
+
print("Registered help file")
|
489 |
+
|
490 |
+
# misc other fixups.
|
491 |
+
fixup_dbi()
|
492 |
+
|
493 |
+
# Register Pythonwin in context menu
|
494 |
+
try:
|
495 |
+
RegisterPythonwin(True, lib_dir)
|
496 |
+
except Exception:
|
497 |
+
print("Failed to register pythonwin as editor")
|
498 |
+
traceback.print_exc()
|
499 |
+
else:
|
500 |
+
if verbose:
|
501 |
+
print("Pythonwin has been registered in context menu")
|
502 |
+
|
503 |
+
# Create the win32com\gen_py directory.
|
504 |
+
make_dir = os.path.join(lib_dir, "win32com", "gen_py")
|
505 |
+
if not os.path.isdir(make_dir):
|
506 |
+
if verbose:
|
507 |
+
print(f"Creating directory {make_dir}")
|
508 |
+
os.mkdir(make_dir)
|
509 |
+
|
510 |
+
try:
|
511 |
+
# create shortcuts
|
512 |
+
# CSIDL_COMMON_PROGRAMS only available works on NT/2000/XP, and
|
513 |
+
# will fail there if the user has no admin rights.
|
514 |
+
fldr = get_shortcuts_folder()
|
515 |
+
# If the group doesn't exist, then we don't make shortcuts - its
|
516 |
+
# possible that this isn't a "normal" install.
|
517 |
+
if os.path.isdir(fldr):
|
518 |
+
dst = os.path.join(fldr, "PythonWin.lnk")
|
519 |
+
create_shortcut(
|
520 |
+
os.path.join(lib_dir, "Pythonwin\\Pythonwin.exe"),
|
521 |
+
"The Pythonwin IDE",
|
522 |
+
dst,
|
523 |
+
"",
|
524 |
+
sys.prefix,
|
525 |
+
)
|
526 |
+
if verbose:
|
527 |
+
print("Shortcut for Pythonwin created")
|
528 |
+
# And the docs.
|
529 |
+
if chm_file:
|
530 |
+
dst = os.path.join(fldr, "Python for Windows Documentation.lnk")
|
531 |
+
doc = "Documentation for the PyWin32 extensions"
|
532 |
+
create_shortcut(chm_file, doc, dst)
|
533 |
+
if verbose:
|
534 |
+
print("Shortcut to documentation created")
|
535 |
+
else:
|
536 |
+
if verbose:
|
537 |
+
print(f"Can't install shortcuts - {fldr!r} is not a folder")
|
538 |
+
except Exception as details:
|
539 |
+
print(details)
|
540 |
+
|
541 |
+
# importing win32com.client ensures the gen_py dir created - not strictly
|
542 |
+
# necessary to do now, but this makes the installation "complete"
|
543 |
+
try:
|
544 |
+
import win32com.client # noqa
|
545 |
+
except ImportError:
|
546 |
+
# Don't let this error sound fatal
|
547 |
+
pass
|
548 |
+
print("The pywin32 extensions were successfully installed.")
|
549 |
+
|
550 |
+
|
551 |
+
def uninstall(lib_dir):
|
552 |
+
# First ensure our system modules are loaded from pywin32_system, so
|
553 |
+
# we can remove the ones we copied...
|
554 |
+
LoadSystemModule(lib_dir, "pywintypes")
|
555 |
+
LoadSystemModule(lib_dir, "pythoncom")
|
556 |
+
|
557 |
+
try:
|
558 |
+
RegisterCOMObjects(False)
|
559 |
+
except Exception as why:
|
560 |
+
print(f"Failed to unregister COM objects: {why}")
|
561 |
+
|
562 |
+
try:
|
563 |
+
RegisterHelpFile(False, lib_dir)
|
564 |
+
except Exception as why:
|
565 |
+
print(f"Failed to unregister help file: {why}")
|
566 |
+
else:
|
567 |
+
if verbose:
|
568 |
+
print("Unregistered help file")
|
569 |
+
|
570 |
+
try:
|
571 |
+
RegisterPythonwin(False, lib_dir)
|
572 |
+
except Exception as why:
|
573 |
+
print(f"Failed to unregister Pythonwin: {why}")
|
574 |
+
else:
|
575 |
+
if verbose:
|
576 |
+
print("Unregistered Pythonwin")
|
577 |
+
|
578 |
+
try:
|
579 |
+
# remove gen_py directory.
|
580 |
+
gen_dir = os.path.join(lib_dir, "win32com", "gen_py")
|
581 |
+
if os.path.isdir(gen_dir):
|
582 |
+
shutil.rmtree(gen_dir)
|
583 |
+
if verbose:
|
584 |
+
print(f"Removed directory {gen_dir}")
|
585 |
+
|
586 |
+
# Remove pythonwin compiled "config" files.
|
587 |
+
pywin_dir = os.path.join(lib_dir, "Pythonwin", "pywin")
|
588 |
+
for fname in glob.glob(os.path.join(pywin_dir, "*.cfc")):
|
589 |
+
os.remove(fname)
|
590 |
+
|
591 |
+
# The dbi.pyd.old files we may have created.
|
592 |
+
try:
|
593 |
+
os.remove(os.path.join(lib_dir, "win32", "dbi.pyd.old"))
|
594 |
+
except OSError:
|
595 |
+
pass
|
596 |
+
try:
|
597 |
+
os.remove(os.path.join(lib_dir, "win32", "dbi_d.pyd.old"))
|
598 |
+
except OSError:
|
599 |
+
pass
|
600 |
+
|
601 |
+
except Exception as why:
|
602 |
+
print(f"Failed to remove misc files: {why}")
|
603 |
+
|
604 |
+
try:
|
605 |
+
fldr = get_shortcuts_folder()
|
606 |
+
for link in ("PythonWin.lnk", "Python for Windows Documentation.lnk"):
|
607 |
+
fqlink = os.path.join(fldr, link)
|
608 |
+
if os.path.isfile(fqlink):
|
609 |
+
os.remove(fqlink)
|
610 |
+
if verbose:
|
611 |
+
print(f"Removed {link}")
|
612 |
+
except Exception as why:
|
613 |
+
print(f"Failed to remove shortcuts: {why}")
|
614 |
+
# Now remove the system32 files.
|
615 |
+
files = glob.glob(os.path.join(lib_dir, "pywin32_system32\\*.*"))
|
616 |
+
# Try the system32 directory first - if that fails due to "access denied",
|
617 |
+
# it implies a non-admin user, and we use sys.prefix
|
618 |
+
try:
|
619 |
+
for dest_dir in [get_system_dir(), sys.prefix]:
|
620 |
+
# and copy some files over there
|
621 |
+
worked = 0
|
622 |
+
for fname in files:
|
623 |
+
base = os.path.basename(fname)
|
624 |
+
dst = os.path.join(dest_dir, base)
|
625 |
+
if os.path.isfile(dst):
|
626 |
+
try:
|
627 |
+
os.remove(dst)
|
628 |
+
worked = 1
|
629 |
+
if verbose:
|
630 |
+
print("Removed file %s" % (dst))
|
631 |
+
except Exception:
|
632 |
+
print(f"FAILED to remove {dst}")
|
633 |
+
if worked:
|
634 |
+
break
|
635 |
+
except Exception as why:
|
636 |
+
print(f"FAILED to remove system files: {why}")
|
637 |
+
|
638 |
+
|
639 |
+
# NOTE: This used to be run from inside the bdist_wininst created binary un/installer.
|
640 |
+
# From inside the binary installer this script HAD to NOT
|
641 |
+
# call sys.exit() or raise SystemExit, otherwise the installer would also terminate!
|
642 |
+
# Out of principle, we're still not using system exits.
|
643 |
+
|
644 |
+
|
645 |
+
def verify_destination(location: str) -> str:
|
646 |
+
location = os.path.abspath(location)
|
647 |
+
if not os.path.isdir(location):
|
648 |
+
raise argparse.ArgumentTypeError(
|
649 |
+
f'Path "{location}" is not an existing directory!'
|
650 |
+
)
|
651 |
+
return location
|
652 |
+
|
653 |
+
|
654 |
+
def main():
|
655 |
+
parser = argparse.ArgumentParser(
|
656 |
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
657 |
+
description="""A post-install script for the pywin32 extensions.
|
658 |
+
|
659 |
+
* Typical usage:
|
660 |
+
|
661 |
+
> python -m pywin32_postinstall -install
|
662 |
+
|
663 |
+
* or (shorter but you don't have control over which python environment is used)
|
664 |
+
|
665 |
+
> pywin32_postinstall -install
|
666 |
+
|
667 |
+
You need to execute this script, with a '-install' parameter,
|
668 |
+
to ensure the environment is setup correctly to install COM objects, services, etc.
|
669 |
+
""",
|
670 |
+
)
|
671 |
+
parser.add_argument(
|
672 |
+
"-install",
|
673 |
+
default=False,
|
674 |
+
action="store_true",
|
675 |
+
help="Configure the Python environment correctly for pywin32.",
|
676 |
+
)
|
677 |
+
parser.add_argument(
|
678 |
+
"-remove",
|
679 |
+
default=False,
|
680 |
+
action="store_true",
|
681 |
+
help="Try and remove everything that was installed or copied.",
|
682 |
+
)
|
683 |
+
parser.add_argument(
|
684 |
+
"-wait",
|
685 |
+
type=int,
|
686 |
+
help="Wait for the specified process to terminate before starting.",
|
687 |
+
)
|
688 |
+
parser.add_argument(
|
689 |
+
"-silent",
|
690 |
+
default=False,
|
691 |
+
action="store_true",
|
692 |
+
help='Don\'t display the "Abort/Retry/Ignore" dialog for files in use.',
|
693 |
+
)
|
694 |
+
parser.add_argument(
|
695 |
+
"-quiet",
|
696 |
+
default=False,
|
697 |
+
action="store_true",
|
698 |
+
help="Don't display progress messages.",
|
699 |
+
)
|
700 |
+
parser.add_argument(
|
701 |
+
"-destination",
|
702 |
+
default=sysconfig.get_paths()["platlib"],
|
703 |
+
type=verify_destination,
|
704 |
+
help="Location of the PyWin32 installation",
|
705 |
+
)
|
706 |
+
|
707 |
+
args = parser.parse_args()
|
708 |
+
|
709 |
+
if not args.quiet:
|
710 |
+
print(f"Parsed arguments are: {args}")
|
711 |
+
|
712 |
+
if not args.install ^ args.remove:
|
713 |
+
parser.error("You need to either choose to -install or -remove!")
|
714 |
+
|
715 |
+
if args.wait is not None:
|
716 |
+
try:
|
717 |
+
os.waitpid(args.wait, 0)
|
718 |
+
except OSError:
|
719 |
+
# child already dead
|
720 |
+
pass
|
721 |
+
|
722 |
+
silent = args.silent
|
723 |
+
verbose = not args.quiet
|
724 |
+
|
725 |
+
if args.install:
|
726 |
+
install(args.destination)
|
727 |
+
|
728 |
+
if args.remove:
|
729 |
+
uninstall(args.destination)
|
730 |
+
|
731 |
+
|
732 |
+
if __name__ == "__main__":
|
733 |
+
main()
|
venv/Scripts/pywin32_testall.py
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""A test runner for pywin32"""
|
2 |
+
|
3 |
+
import os
|
4 |
+
import site
|
5 |
+
import subprocess
|
6 |
+
import sys
|
7 |
+
|
8 |
+
# locate the dirs based on where this script is - it may be either in the
|
9 |
+
# source tree, or in an installed Python 'Scripts' tree.
|
10 |
+
project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
11 |
+
site_packages = [site.getusersitepackages()] + site.getsitepackages()
|
12 |
+
|
13 |
+
failures = []
|
14 |
+
|
15 |
+
|
16 |
+
# Run a test using subprocess and wait for the result.
|
17 |
+
# If we get an returncode != 0, we know that there was an error, but we don't
|
18 |
+
# abort immediately - we run as many tests as we can.
|
19 |
+
def run_test(script, cmdline_extras):
|
20 |
+
dirname, scriptname = os.path.split(script)
|
21 |
+
# some tests prefer to be run from their directory.
|
22 |
+
cmd = [sys.executable, "-u", scriptname] + cmdline_extras
|
23 |
+
print("--- Running '%s' ---" % script)
|
24 |
+
sys.stdout.flush()
|
25 |
+
result = subprocess.run(cmd, check=False, cwd=dirname)
|
26 |
+
print(f"*** Test script '{script}' exited with {result.returncode}")
|
27 |
+
sys.stdout.flush()
|
28 |
+
if result.returncode:
|
29 |
+
failures.append(script)
|
30 |
+
|
31 |
+
|
32 |
+
def find_and_run(possible_locations, extras):
|
33 |
+
for maybe in possible_locations:
|
34 |
+
if os.path.isfile(maybe):
|
35 |
+
run_test(maybe, extras)
|
36 |
+
break
|
37 |
+
else:
|
38 |
+
raise RuntimeError(
|
39 |
+
"Failed to locate a test script in one of %s" % possible_locations
|
40 |
+
)
|
41 |
+
|
42 |
+
|
43 |
+
def main():
|
44 |
+
import argparse
|
45 |
+
|
46 |
+
code_directories = [project_root] + site_packages
|
47 |
+
|
48 |
+
parser = argparse.ArgumentParser(
|
49 |
+
description="A script to trigger tests in all subprojects of PyWin32."
|
50 |
+
)
|
51 |
+
parser.add_argument(
|
52 |
+
"-no-user-interaction",
|
53 |
+
default=False,
|
54 |
+
action="store_true",
|
55 |
+
help="(This is now the default - use `-user-interaction` to include them)",
|
56 |
+
)
|
57 |
+
|
58 |
+
parser.add_argument(
|
59 |
+
"-user-interaction",
|
60 |
+
action="store_true",
|
61 |
+
help="Include tests which require user interaction",
|
62 |
+
)
|
63 |
+
|
64 |
+
parser.add_argument(
|
65 |
+
"-skip-adodbapi",
|
66 |
+
default=False,
|
67 |
+
action="store_true",
|
68 |
+
help="Skip the adodbapi tests; useful for CI where there's no provider",
|
69 |
+
)
|
70 |
+
|
71 |
+
args, remains = parser.parse_known_args()
|
72 |
+
|
73 |
+
# win32, win32ui / Pythonwin
|
74 |
+
|
75 |
+
extras = []
|
76 |
+
if args.user_interaction:
|
77 |
+
extras.append("-user-interaction")
|
78 |
+
extras.extend(remains)
|
79 |
+
scripts = [
|
80 |
+
"win32/test/testall.py",
|
81 |
+
"Pythonwin/pywin/test/all.py",
|
82 |
+
]
|
83 |
+
for script in scripts:
|
84 |
+
maybes = [os.path.join(directory, script) for directory in code_directories]
|
85 |
+
find_and_run(maybes, extras)
|
86 |
+
|
87 |
+
# win32com
|
88 |
+
maybes = [
|
89 |
+
os.path.join(directory, "win32com", "test", "testall.py")
|
90 |
+
for directory in [os.path.join(project_root, "com")] + site_packages
|
91 |
+
]
|
92 |
+
extras = remains + ["1"] # only run "level 1" tests in CI
|
93 |
+
find_and_run(maybes, extras)
|
94 |
+
|
95 |
+
# adodbapi
|
96 |
+
if not args.skip_adodbapi:
|
97 |
+
maybes = [
|
98 |
+
os.path.join(directory, "adodbapi", "test", "adodbapitest.py")
|
99 |
+
for directory in code_directories
|
100 |
+
]
|
101 |
+
find_and_run(maybes, remains)
|
102 |
+
# This script has a hard-coded sql server name in it, (and markh typically
|
103 |
+
# doesn't have a different server to test on) but there is now supposed to be a server out there on the Internet
|
104 |
+
# just to run these tests, so try it...
|
105 |
+
maybes = [
|
106 |
+
os.path.join(directory, "adodbapi", "test", "test_adodbapi_dbapi20.py")
|
107 |
+
for directory in code_directories
|
108 |
+
]
|
109 |
+
find_and_run(maybes, remains)
|
110 |
+
|
111 |
+
if failures:
|
112 |
+
print("The following scripts failed")
|
113 |
+
for failure in failures:
|
114 |
+
print(">", failure)
|
115 |
+
sys.exit(1)
|
116 |
+
print("All tests passed \\o/")
|
117 |
+
|
118 |
+
|
119 |
+
if __name__ == "__main__":
|
120 |
+
main()
|
venv/Scripts/undill
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!C:\Users\Light\Documents\sentiment-analysis-bert\venv\Scripts\python.exe
|
2 |
+
#
|
3 |
+
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
|
4 |
+
# Copyright (c) 2008-2016 California Institute of Technology.
|
5 |
+
# Copyright (c) 2016-2024 The Uncertainty Quantification Foundation.
|
6 |
+
# License: 3-clause BSD. The full license text is available at:
|
7 |
+
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
|
8 |
+
"""
|
9 |
+
unpickle the contents of a pickled object file
|
10 |
+
|
11 |
+
Examples::
|
12 |
+
|
13 |
+
$ undill hello.pkl
|
14 |
+
['hello', 'world']
|
15 |
+
"""
|
16 |
+
|
17 |
+
if __name__ == '__main__':
|
18 |
+
import sys
|
19 |
+
import dill
|
20 |
+
for file in sys.argv[1:]:
|
21 |
+
print (dill.load(open(file,'rb')))
|
22 |
+
|
venv/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"NotebookApp": {
|
3 |
+
"nbserver_extensions": {
|
4 |
+
"jupyterlab": true
|
5 |
+
}
|
6 |
+
}
|
7 |
+
}
|
venv/etc/jupyter/jupyter_server_config.d/jupyter-lsp-jupyter-server.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"ServerApp": {
|
3 |
+
"jpserver_extensions": {
|
4 |
+
"jupyter_lsp": true
|
5 |
+
}
|
6 |
+
}
|
7 |
+
}
|