rbx.cp 0.13.8__py3-none-any.whl → 0.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rbx/box/cli.py +74 -70
- rbx/box/code.py +3 -0
- rbx/box/contest/build_contest_statements.py +65 -23
- rbx/box/contest/contest_package.py +8 -1
- rbx/box/contest/main.py +9 -3
- rbx/box/contest/schema.py +17 -13
- rbx/box/contest/statements.py +12 -8
- rbx/box/dump_schemas.py +2 -1
- rbx/box/environment.py +1 -1
- rbx/box/fields.py +22 -4
- rbx/box/generators.py +32 -13
- rbx/box/limits_info.py +161 -0
- rbx/box/package.py +18 -1
- rbx/box/packaging/boca/boca_language_utils.py +26 -0
- rbx/box/packaging/boca/boca_outcome_utils.py +10 -0
- rbx/box/packaging/boca/packager.py +7 -5
- rbx/box/packaging/contest_main.py +20 -12
- rbx/box/packaging/packager.py +24 -14
- rbx/box/packaging/polygon/packager.py +7 -3
- rbx/box/packaging/polygon/upload.py +2 -1
- rbx/box/presets/__init__.py +64 -64
- rbx/box/remote.py +3 -3
- rbx/box/sanitizers/issue_stack.py +124 -0
- rbx/box/schema.py +87 -27
- rbx/box/solutions.py +74 -117
- rbx/box/statements/build_statements.py +12 -1
- rbx/box/statements/builders.py +5 -3
- rbx/box/statements/latex_jinja.py +73 -23
- rbx/box/statements/schema.py +7 -9
- rbx/box/stressing/generator_parser.py +3 -1
- rbx/box/tasks.py +10 -10
- rbx/box/testcase_extractors.py +8 -0
- rbx/box/testing/testing_preset.py +129 -2
- rbx/box/testing/testing_shared.py +3 -1
- rbx/box/timing.py +305 -0
- rbx/box/tooling/boca/debug_utils.py +88 -0
- rbx/box/tooling/boca/manual_scrape.py +20 -0
- rbx/box/tooling/boca/scraper.py +660 -57
- rbx/box/unit.py +0 -2
- rbx/box/validators.py +0 -4
- rbx/grading/judge/cacher.py +36 -0
- rbx/grading/judge/program.py +12 -2
- rbx/grading/judge/sandbox.py +1 -1
- rbx/grading/judge/sandboxes/stupid_sandbox.py +2 -1
- rbx/grading/judge/storage.py +36 -3
- rbx/grading/limits.py +4 -0
- rbx/grading/steps.py +3 -2
- rbx/resources/presets/default/contest/contest.rbx.yml +7 -1
- rbx/resources/presets/default/contest/statement/info.rbx.tex +54 -0
- rbx/resources/presets/default/problem/.gitignore +1 -0
- rbx/resources/presets/default/problem/problem.rbx.yml +19 -3
- rbx/resources/presets/default/problem/rbx.h +52 -5
- rbx/resources/presets/default/problem/statement/statement.rbx.tex +6 -2
- rbx/resources/presets/default/problem/testlib.h +6299 -0
- rbx/resources/presets/default/problem/validator.cpp +4 -3
- rbx/resources/presets/default/shared/contest_template.rbx.tex +8 -4
- rbx/resources/presets/default/shared/icpc.sty +16 -1
- rbx/resources/presets/default/shared/problem_template.rbx.tex +4 -1
- rbx/testing_utils.py +17 -1
- {rbx_cp-0.13.8.dist-info → rbx_cp-0.14.0.dist-info}/METADATA +4 -2
- {rbx_cp-0.13.8.dist-info → rbx_cp-0.14.0.dist-info}/RECORD +65 -62
- {rbx_cp-0.13.8.dist-info → rbx_cp-0.14.0.dist-info}/WHEEL +1 -1
- {rbx_cp-0.13.8.dist-info → rbx_cp-0.14.0.dist-info}/entry_points.txt +0 -1
- rbx/providers/__init__.py +0 -43
- rbx/providers/codeforces.py +0 -73
- rbx/providers/provider.py +0 -26
- rbx/submitors/__init__.py +0 -18
- rbx/submitors/codeforces.py +0 -121
- rbx/submitors/submitor.py +0 -25
- /rbx/resources/presets/default/problem/sols/{wa.cpp → wa-overflow.cpp} +0 -0
- {rbx_cp-0.13.8.dist-info → rbx_cp-0.14.0.dist-info}/LICENSE +0 -0
@@ -7,11 +7,12 @@ int main(int argc, char *argv[]) {
|
|
7
7
|
registerValidation(argc, argv);
|
8
8
|
prepareOpts(argc, argv);
|
9
9
|
|
10
|
-
int
|
10
|
+
int MIN_N = getVar<int>("N.min"); // Read from package vars.
|
11
|
+
int MAX_N = getVar<int>("N.max");
|
11
12
|
|
12
|
-
inf.readInt(
|
13
|
+
inf.readInt(MIN_N, MAX_N, "A");
|
13
14
|
inf.readSpace();
|
14
|
-
inf.readInt(
|
15
|
+
inf.readInt(MIN_N, MAX_N, "B");
|
15
16
|
inf.readEoln();
|
16
17
|
inf.readEof();
|
17
18
|
}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
%- if problem.vars.show_problem is truthy or problem.vars.editorial is falsy
|
2
1
|
\includeProblem
|
3
2
|
%- if problem.short_name is defined
|
4
3
|
[\VAR{problem.short_name}]
|
@@ -6,11 +5,16 @@
|
|
6
5
|
{\VAR{problem.title | escape}}{
|
7
6
|
|
8
7
|
%- if problem.vars.show_limits is truthy
|
9
|
-
|
8
|
+
\includeLimits
|
9
|
+
{\VAR{problem.limits.timeLimit} ms}
|
10
|
+
{\VAR{problem.limits.memoryLimit} MiB}
|
11
|
+
{\VAR{problem.vars.author if problem.vars.author is truthy and problem.vars.editorial is truthy else ''}}
|
10
12
|
%- else
|
11
|
-
|
13
|
+
\vspace{0.55cm}
|
12
14
|
%- endif
|
13
15
|
|
16
|
+
%- if problem.vars.show_problem is truthy or problem.vars.editorial is falsy
|
17
|
+
|
14
18
|
\VAR{problem.blocks.legend}
|
15
19
|
|
16
20
|
%- if problem.blocks.input is defined
|
@@ -48,8 +52,8 @@
|
|
48
52
|
\subsection*{\strNotes}
|
49
53
|
\VAR{problem.blocks.notes}
|
50
54
|
%- endif
|
51
|
-
}
|
52
55
|
%- endif
|
56
|
+
}
|
53
57
|
%- if problem.blocks.editorial is nonnull and problem.vars.editorial is truthy
|
54
58
|
\subsection*{\strSolution}
|
55
59
|
\VAR{problem.blocks.editorial}
|
@@ -100,6 +100,7 @@
|
|
100
100
|
\def\strHosted{Realização}
|
101
101
|
\def\strOrganized{Organização}
|
102
102
|
\def\strProblem{Problema }
|
103
|
+
\def\strAuthor{Autor}
|
103
104
|
\def\strExplanation{Explicação do exemplo }
|
104
105
|
\def\strInput{Entrada}
|
105
106
|
\def\strOutput{Saída}
|
@@ -112,6 +113,10 @@
|
|
112
113
|
\def\strExamples{Exemplos}
|
113
114
|
\def\strSolution{Solução}
|
114
115
|
\def\strNotes{Observações}
|
116
|
+
\def\strInfoSheet{Folha de Informações}
|
117
|
+
\def\strLimits{Limites}
|
118
|
+
\def\strTimeLimit{Tempo limite}
|
119
|
+
\def\strMemoryLimit{Memória limite}
|
115
120
|
\else
|
116
121
|
\def\strTaskSheet{Task Sheet}
|
117
122
|
\def\strSolutionSheet{Solution Sheet}
|
@@ -119,6 +124,7 @@
|
|
119
124
|
\def\strHosted{Hosted by}
|
120
125
|
\def\strOrganized{Organized by}
|
121
126
|
\def\strProblem{Problem }
|
127
|
+
\def\strAuthor{Author}
|
122
128
|
\def\strExplanation{Explanation of sample }
|
123
129
|
\def\strInput{Input}
|
124
130
|
\def\strOutput{Output}
|
@@ -131,6 +137,10 @@
|
|
131
137
|
\def\strExamples{Examples}
|
132
138
|
\def\strSolution{Solution}
|
133
139
|
\def\strNotes{Notes}
|
140
|
+
\def\strInfoSheet{Information Sheet}
|
141
|
+
\def\strLimits{Limits}
|
142
|
+
\def\strTimeLimit{Time limit}
|
143
|
+
\def\strMemoryLimit{Memory limit}
|
134
144
|
\fi
|
135
145
|
|
136
146
|
\newcommand{\includeProblem}[3][]
|
@@ -145,11 +155,16 @@
|
|
145
155
|
#3
|
146
156
|
}
|
147
157
|
|
148
|
-
\newcommand{\includeLimits}[
|
158
|
+
\newcommand{\includeLimits}[3]{
|
149
159
|
\vspace{0.2cm}
|
150
160
|
\begin{center}
|
151
161
|
\textit{\strTimeLimit: #1}\\
|
152
162
|
\textit{\strMemoryLimit: #2}
|
163
|
+
\ifx#3\empty
|
164
|
+
\else
|
165
|
+
\\
|
166
|
+
\textit{\strAuthor: #3}
|
167
|
+
\fi
|
153
168
|
\end{center}
|
154
169
|
\vspace{0.25cm}
|
155
170
|
}
|
@@ -16,7 +16,10 @@
|
|
16
16
|
{\VAR{problem.title | escape}}{
|
17
17
|
|
18
18
|
%- if problem.vars.show_limits is truthy
|
19
|
-
\includeLimits
|
19
|
+
\includeLimits
|
20
|
+
{\VAR{problem.limits.timeLimit} ms}
|
21
|
+
{\VAR{problem.limits.memoryLimit} MiB}
|
22
|
+
{\VAR{problem.vars.author if problem.vars.author is truthy and problem.vars.editorial is truthy else ''}}
|
20
23
|
%- else
|
21
24
|
\vspace{0.55cm}
|
22
25
|
%- endif
|
rbx/testing_utils.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import importlib.resources
|
2
|
+
import os
|
2
3
|
import pathlib
|
3
4
|
|
4
5
|
import rich.markup
|
@@ -59,9 +60,24 @@ def walk_directory(
|
|
59
60
|
text_filename = rich.text.Text(path.name, 'green')
|
60
61
|
text_filename.highlight_regex(r'\..*$', 'bold red')
|
61
62
|
text_filename.stylize(f'link file://{path}')
|
63
|
+
|
64
|
+
# Check if it's a symlink and show the resolved path
|
65
|
+
if path.is_symlink():
|
66
|
+
try:
|
67
|
+
resolved = path.resolve()
|
68
|
+
text_filename.append(' → ', 'cyan')
|
69
|
+
text_filename.append(str(resolved), 'cyan italic')
|
70
|
+
except (OSError, RuntimeError):
|
71
|
+
text_filename.append(' → ', 'red')
|
72
|
+
text_filename.append(f'{os.readlink(path)}', 'red italic')
|
73
|
+
|
62
74
|
file_size = path.stat().st_size
|
63
75
|
text_filename.append(f' ({decimal(file_size)})', 'blue')
|
64
|
-
icon =
|
76
|
+
icon = (
|
77
|
+
'🔗 '
|
78
|
+
if path.is_symlink()
|
79
|
+
else ('🐍 ' if path.suffix == '.py' else '📄 ')
|
80
|
+
)
|
65
81
|
tree.add(rich.text.Text(icon) + text_filename)
|
66
82
|
|
67
83
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: rbx.cp
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.14.0
|
4
4
|
Summary:
|
5
5
|
Author: Roberto Sales
|
6
6
|
Requires-Python: >=3.9.1,<4.0.0
|
@@ -30,7 +30,7 @@ Requires-Dist: more-itertools (>=10.5.0,<11.0.0)
|
|
30
30
|
Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
|
31
31
|
Requires-Dist: ordered-set (>=4.1.0,<5.0.0)
|
32
32
|
Requires-Dist: psutil (>=7.0.0,<8.0.0)
|
33
|
-
Requires-Dist: pydantic (
|
33
|
+
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
|
34
34
|
Requires-Dist: pydantic-xml[lxml] (>=2.11.0,<3.0.0)
|
35
35
|
Requires-Dist: pypandoc (>=1.15,<2.0)
|
36
36
|
Requires-Dist: pyte (>=0.8.2,<0.9.0)
|
@@ -44,7 +44,9 @@ Requires-Dist: sqlitedict (>=2.1.0,<3.0.0)
|
|
44
44
|
Requires-Dist: syncer (>=2.0.3,<3.0.0)
|
45
45
|
Requires-Dist: textual (>=3.1.1,<4.0.0)
|
46
46
|
Requires-Dist: textual-serve (>=1.1.2,<2.0.0)
|
47
|
+
Requires-Dist: throttlex (>=1.0.0,<2.0.0)
|
47
48
|
Requires-Dist: typer (>=0.15.1,<0.16.0)
|
49
|
+
Requires-Dist: typing-extensions (>=4.14.1,<5.0.0)
|
48
50
|
Requires-Dist: yamlfix (>=1.17.0,<2.0.0)
|
49
51
|
Description-Content-Type: text/markdown
|
50
52
|
|
@@ -5,88 +5,95 @@ rbx/box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
rbx/box/builder.py,sha256=umrTdVAwvsOosBDVvDZ6kq1yWg3Z2Lxp2o1zK-V7BBk,3594
|
6
6
|
rbx/box/cd.py,sha256=_XAzb3kV1NUaaRs8hc9SGDo10O1yh2_gr1EiAKzfUjI,2711
|
7
7
|
rbx/box/checkers.py,sha256=mRovZyTZdySFEaYFVc3Lc-xgEsu6F9FjVPOxDwub7aY,13226
|
8
|
-
rbx/box/cli.py,sha256=
|
9
|
-
rbx/box/code.py,sha256=
|
8
|
+
rbx/box/cli.py,sha256=ybtCWnH0uYhUe95s6ZhBGoPmanMMleaTaWB78tA3kag,29773
|
9
|
+
rbx/box/code.py,sha256=TWF-o8fTh5nAtndKuO9Ti7KL-Ye6mkOoUnRzS4POrfw,25524
|
10
10
|
rbx/box/compile.py,sha256=Kzn5mEQu4vb91W9vjyt0DS6cfPJzFLTUoowFj7uHLUo,2539
|
11
11
|
rbx/box/contest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
-
rbx/box/contest/build_contest_statements.py,sha256=
|
13
|
-
rbx/box/contest/contest_package.py,sha256=
|
12
|
+
rbx/box/contest/build_contest_statements.py,sha256=y-jODWc5ANm5uhj2kTHxyYnEOr4CzpxynJFvFjClTso,14734
|
13
|
+
rbx/box/contest/contest_package.py,sha256=d7PoUHIWVtqaRGatYOfRvZbQ-bz4MPGmv-H94Eg1yyQ,3289
|
14
14
|
rbx/box/contest/contest_utils.py,sha256=fsWHG1e65wq9zvRY3tdf32VF0nU1yzGTOBX5yjXiNk4,1102
|
15
|
-
rbx/box/contest/main.py,sha256
|
16
|
-
rbx/box/contest/schema.py,sha256=
|
17
|
-
rbx/box/contest/statements.py,sha256=
|
15
|
+
rbx/box/contest/main.py,sha256=-aBmlwbEbGMHxWlF7ulIAeKLy2v7VVsvpb4c-kkqKK8,8564
|
16
|
+
rbx/box/contest/schema.py,sha256=PgJ8eDiwR6iW4bx1E2MB6T4XiD5FpChSboveOcxMVg0,7376
|
17
|
+
rbx/box/contest/statements.py,sha256=f_fn-6e_1406L5EDsnDprz1_8q8qrJ4AjSUpTJqZ1MA,4051
|
18
18
|
rbx/box/creation.py,sha256=oTAC11XV2Pw2YAlF_d11Eo7A1fD6ItlpFMpLEzMLyFI,1331
|
19
19
|
rbx/box/deferred.py,sha256=II3X9e87JCOZtmspnHh-n4PFqh-FsH_oc0XJHZ9ZYVQ,691
|
20
20
|
rbx/box/download.py,sha256=tLW5gLVeLk0gHMEMwScSoHIXQPkXuPsqXzItsrsnUZY,3070
|
21
|
-
rbx/box/dump_schemas.py,sha256=
|
22
|
-
rbx/box/environment.py,sha256=
|
21
|
+
rbx/box/dump_schemas.py,sha256=HXJ195h4e017DpfoFfW3MRDukON2ZhcKtJjkRPX-dX4,649
|
22
|
+
rbx/box/environment.py,sha256=BRwbeqE5To4yBGP7CJbKPMUxUXIlOWscXw1Vp8glrQ0,14018
|
23
23
|
rbx/box/extensions.py,sha256=Von8kIeXvNFTkGlMRMTvL2HIHPwlkuiMswr-ydbGV1w,519
|
24
|
-
rbx/box/fields.py,sha256=
|
24
|
+
rbx/box/fields.py,sha256=Gsox7Q1M7I8I2FtKvwiAfYUC6USpwghk8fel2Q9Eyhg,2291
|
25
25
|
rbx/box/formatting.py,sha256=i3vXHpo_L_VpVPxOe4wHlai1WhlDJlfxUexS9DC0Szg,1249
|
26
|
-
rbx/box/generators.py,sha256=
|
26
|
+
rbx/box/generators.py,sha256=trI4i3BFAzIK4wA0hdCjU1rf8QLwSXKWzSFtCZX17SA,17739
|
27
27
|
rbx/box/git_utils.py,sha256=VlUgzuHOCnrjjiJQnDB32qDHbHw_zkwgA7wm4bloibc,750
|
28
28
|
rbx/box/global_package.py,sha256=YfFGw2vxFspF2v3phBEeBCrLe1sfbANrctGqii3I2X4,2106
|
29
29
|
rbx/box/header.py,sha256=OZJD2J0fdIiYyiEAwQ3x3M8TwM1v1J9nhIjnPVz4Zy8,3029
|
30
30
|
rbx/box/lang.py,sha256=CSD-yxFUC3LWdGpv4IVFOLdgONc_JbsI45BEN3bjaFw,888
|
31
31
|
rbx/box/lazy_importing_main.py,sha256=6Z8As7qVFFT619xHH9Xt8VCH57NjC4aDxfAgkWiUwT8,116
|
32
|
+
rbx/box/limits_info.py,sha256=NTtcZTlDzemOtQQXbNbLORpl3RM9nYHc2-cGMnGYfF8,5370
|
32
33
|
rbx/box/linting.py,sha256=wRE0hKCduTBHZYBFmmis_d9AMTsDu0Q-AjByCeTnkrY,3187
|
33
34
|
rbx/box/main.py,sha256=a8CYi77kOywPFly4-ucEIJLXQW-1NFp91kK2fA42YTE,86
|
34
35
|
rbx/box/naming.py,sha256=pOG37X_wQM9CCSYwJIUf-b-ZHEs_nchO7wQEdP_quJg,1367
|
35
|
-
rbx/box/package.py,sha256=
|
36
|
+
rbx/box/package.py,sha256=FjJWSr5yom4_S2k-HZfmDYRB954WaefFaVVME90CdEE,15382
|
36
37
|
rbx/box/packaging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
38
|
rbx/box/packaging/boca/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
|
+
rbx/box/packaging/boca/boca_language_utils.py,sha256=bd5-KxN-0h6yg74Jx3NUsgwf_euBU95zC2GLw0MAFS4,1071
|
40
|
+
rbx/box/packaging/boca/boca_outcome_utils.py,sha256=MhO7aKTJ1weCgSJBA9MF_ejK3HFBFwC5dIsiR4wA1Mw,310
|
38
41
|
rbx/box/packaging/boca/extension.py,sha256=EQALNEOv4zVDXSKs_dk11n92y7cBZVn8TogIK683lE0,890
|
39
|
-
rbx/box/packaging/boca/packager.py,sha256=
|
40
|
-
rbx/box/packaging/contest_main.py,sha256=
|
42
|
+
rbx/box/packaging/boca/packager.py,sha256=31fwscJR0JZTr-55i070fOpb6lAXtEGu50xWFTC2U4o,13746
|
43
|
+
rbx/box/packaging/contest_main.py,sha256=G3CO4RILxGbUhyLsTdeDqPXEJ3sK2pSH9X8piqU61FQ,4486
|
41
44
|
rbx/box/packaging/importer.py,sha256=qcKpDQyf6EvYXorofLs5abteBEWV9AezA8tcihCw5wk,909
|
42
45
|
rbx/box/packaging/main.py,sha256=hP4UEKjLowRHBzttGKWx0UMAw8_8lVAAhQ9I9Y3khXA,2724
|
43
46
|
rbx/box/packaging/moj/packager.py,sha256=FjghOe5CPlaF1GqK0NZgWVV_eYWpdTmz88bh04yeAyI,8708
|
44
|
-
rbx/box/packaging/packager.py,sha256=
|
47
|
+
rbx/box/packaging/packager.py,sha256=2a2yldbVZzEQLoQnfGc8fHDHasFRdLUwAGlQuxudLBs,7324
|
45
48
|
rbx/box/packaging/pkg/packager.py,sha256=4pt4cZa_MU9gsWNVvh5Um1KEIh_axBHlXmPf6rpFoHg,4904
|
46
49
|
rbx/box/packaging/polygon/importer.py,sha256=xmtKQo5q81s30u41cEe5PWsepDMJx2XbZRxa6vA4p9c,7571
|
47
|
-
rbx/box/packaging/polygon/packager.py,sha256=
|
50
|
+
rbx/box/packaging/polygon/packager.py,sha256=1ddKbUJ-RgzgolDZTkmDJFF5N3JGTXRYVA84L4QU62c,12311
|
48
51
|
rbx/box/packaging/polygon/polygon_api.py,sha256=mPKEqiwANJ1nr-JhOgzGMaDhnbljsAgzzPHW6kkf7R4,41016
|
49
52
|
rbx/box/packaging/polygon/test.py,sha256=bgEju5PwudgyfwxXJagm8fM6CJVlWM6l_-2q1V-oKaQ,3069
|
50
|
-
rbx/box/packaging/polygon/upload.py,sha256=
|
53
|
+
rbx/box/packaging/polygon/upload.py,sha256=w7F0ejfEwhXrAyKADkA2FGuOfTCq96nMNi1YJNRyrtU,13801
|
51
54
|
rbx/box/packaging/polygon/xml_schema.py,sha256=TSl4BWwMWv7V07BKJ56mcLXNr_3zlRgNmqN2q-wnk4M,3128
|
52
|
-
rbx/box/presets/__init__.py,sha256=
|
55
|
+
rbx/box/presets/__init__.py,sha256=aBgqq6sfMSuXE1IxpJRtztVoR-eIt5SzhmXQ7pIgeFw,33375
|
53
56
|
rbx/box/presets/fetch.py,sha256=900aq9S8e12TlgSenG0iHgtF4OWgqavZsptgI_a1YKM,2508
|
54
57
|
rbx/box/presets/lock_schema.py,sha256=8PKL7UMX4dkdVpCPLwYtaNIIrZpAfHGvTfnF8bRFedM,1708
|
55
58
|
rbx/box/presets/schema.py,sha256=iOGWHqJ9Z-ljQV8ljOjQMuCwqJQLJKm_pYX9cLjZbmE,2432
|
56
|
-
rbx/box/remote.py,sha256=
|
59
|
+
rbx/box/remote.py,sha256=hCdiZSmh6Y1vnSEwLZ_gtAMYV-WLVlU3iVnvcObRpRc,5274
|
57
60
|
rbx/box/retries.py,sha256=BZsi4sYBjm3VK5zb_pBQSYQuKo3ZntmtEFoVPZHg4QI,4982
|
61
|
+
rbx/box/sanitizers/issue_stack.py,sha256=N4RVVHnswNPsZZaPcVAkNIhRH32AUo8fxfoka4lgRrQ,3420
|
58
62
|
rbx/box/sanitizers/warning_stack.py,sha256=6-rr3dkMq6MpfjrVZ8lSQjF4RZ5YzZSAPMzHCfm-6h4,2876
|
59
|
-
rbx/box/schema.py,sha256=
|
63
|
+
rbx/box/schema.py,sha256=SfGQYGrB6To4pRm4Y1ly5ON6Ng3oKBFQ6GVKpeSslr0,19808
|
60
64
|
rbx/box/setter_config.py,sha256=vyZbsbgkjelZOblMLX5A1j4CLqPNQkrv83IZr_3-46Y,5301
|
61
|
-
rbx/box/solutions.py,sha256=
|
65
|
+
rbx/box/solutions.py,sha256=Id5X9711p5VX0kZfVXpj_klADPz8k5GvQsV3oXvhgrU,52848
|
62
66
|
rbx/box/state.py,sha256=MMf3DvfQji0jKEliCHct2Tpp_0epL1tvP8HbHNArQIc,166
|
63
67
|
rbx/box/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
64
|
-
rbx/box/statements/build_statements.py,sha256=
|
65
|
-
rbx/box/statements/builders.py,sha256=
|
68
|
+
rbx/box/statements/build_statements.py,sha256=ZbciKblRUnRnTuuZfqU4W4EK6XhKkxuT1ByGMPjzNQU,13298
|
69
|
+
rbx/box/statements/builders.py,sha256=OkT8f9mRSZKztobrzEAXW5KTbPpUknFeL1Jns7Xx2K0,13778
|
66
70
|
rbx/box/statements/expander.py,sha256=sdbMtNcJQCbXGIkFIl9h24pGr77vhFLnM31V5AfuduI,1715
|
67
71
|
rbx/box/statements/joiners.py,sha256=jItNXkAbTjFQpPMgfDMW86n3vMTbaE8sgo9I8Yf4Txg,2886
|
68
72
|
rbx/box/statements/latex.py,sha256=ipTGjL4kjAsnqgiH6Pk1PwKFegBumQP4-y0pFAbNN8I,1584
|
69
|
-
rbx/box/statements/latex_jinja.py,sha256=
|
70
|
-
rbx/box/statements/schema.py,sha256=
|
73
|
+
rbx/box/statements/latex_jinja.py,sha256=UQyD3hOFsiEQdFjqMswRrPXyGCiRPgnzZPmAcvJuPyM,11671
|
74
|
+
rbx/box/statements/schema.py,sha256=mTaowRbRvtgspQk9JqejIxc2BERz3ooP4xT1ZudZmcw,5381
|
71
75
|
rbx/box/stats.py,sha256=rUAnmp7kTgUvIQ56NLpQaIQkazB37MVcUos5en3xUQw,3258
|
72
76
|
rbx/box/stresses.py,sha256=SV0Hx7SPZZEIhwasWDVpTWuMhWWTjfJs2IEW-H0xJZw,12092
|
73
77
|
rbx/box/stressing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
74
78
|
rbx/box/stressing/finder_parser.py,sha256=PnONJD2yun5X5EmHqkaz-rh3DHhn_BkTPHZrIXRKZbw,11898
|
75
|
-
rbx/box/stressing/generator_parser.py,sha256=
|
76
|
-
rbx/box/tasks.py,sha256=
|
77
|
-
rbx/box/testcase_extractors.py,sha256
|
79
|
+
rbx/box/stressing/generator_parser.py,sha256=0L5ST9YEByGL8k8jjWYtrBVpJpoUqYm3456b5Tpb-RQ,7428
|
80
|
+
rbx/box/tasks.py,sha256=XLLFVOVMkL-PCuetuDx_XGHVnlDkaUnXl7PCRyv-9dE,11393
|
81
|
+
rbx/box/testcase_extractors.py,sha256=-Pk3N1URV6HPdszfSAjae_Dt4obhTNBeDe1TD3a-nYM,12353
|
78
82
|
rbx/box/testcase_utils.py,sha256=gFBs6OqdYk9NYhVuCP2BMxKvqKCmBUnbW5nKm0AKqoc,6941
|
79
83
|
rbx/box/testcases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
80
84
|
rbx/box/testcases/main.py,sha256=_I7h_obRcpNLRQ6dDJDIE5NAvTyn5nBOhdsBhRA_PvU,5442
|
81
85
|
rbx/box/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
82
86
|
rbx/box/testing/testing_package.py,sha256=szNc8GcxI0ywCjzV8fOuZh5F0fMtQ6_tLOfivF7hu10,15401
|
83
|
-
rbx/box/testing/testing_preset.py,sha256=
|
84
|
-
rbx/box/testing/testing_shared.py,sha256=
|
87
|
+
rbx/box/testing/testing_preset.py,sha256=pY8Vh0Y9emZXv6LPqYkXtARCBeTDvKe6c8-CX7mN_t8,5766
|
88
|
+
rbx/box/testing/testing_shared.py,sha256=W4JCUo_tKvGRDSeeUx6THjGkzngSqjQlPjn_FYTa-kU,2720
|
89
|
+
rbx/box/timing.py,sha256=vvghTagSTM9UiL98Tin6MMhDfE_9WMH8Vs-eFryMcIE,10268
|
85
90
|
rbx/box/tooling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
86
91
|
rbx/box/tooling/boca/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
92
|
+
rbx/box/tooling/boca/debug_utils.py,sha256=Rs1ptMWsy32jl_DJZASeOfyqh8HCJdhIXufdbxpE_oM,4732
|
87
93
|
rbx/box/tooling/boca/main.py,sha256=knl1rpaHIwA63KkzMJMZQrejzMpbTPBhYqGx1IpuNm4,289
|
94
|
+
rbx/box/tooling/boca/manual_scrape.py,sha256=iuNtOHrWczdaWNNRMKGYkgr-wSwgtjZedpz5-sX5IRQ,724
|
88
95
|
rbx/box/tooling/boca/scrape.py,sha256=q1BoVstfLbw5CwB9e2hQnseBv6HQMnXq2z_tk18ui6M,1024
|
89
|
-
rbx/box/tooling/boca/scraper.py,sha256=
|
96
|
+
rbx/box/tooling/boca/scraper.py,sha256=6B3aI62YdzD7o1zykh9qavl6Qm6cTD--mEvVIjPvEaI,33701
|
90
97
|
rbx/box/tooling/converter.py,sha256=CvZXDjmKqYLTFq9oaQjERa4Gqjlq3rK5dfQl1HFuRrI,2537
|
91
98
|
rbx/box/tooling/main.py,sha256=uj6XHjJMF3nyb4enbbTK8XbUAuiRLT_RP1kVwSMqV5E,2003
|
92
99
|
rbx/box/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -113,8 +120,8 @@ rbx/box/ui/widgets/interaction_box.py,sha256=mJoQjHegxkIL00OgiCULmV0_w-2ZcwsQEa-
|
|
113
120
|
rbx/box/ui/widgets/rich_log_box.py,sha256=mF565c_Y3RYUZ_GJEFj5Eb86SFjsib31wE5qu1K0UBM,91
|
114
121
|
rbx/box/ui/widgets/test_output_box.py,sha256=ws7Oa2E8ZABM6Q4ZtL2UQiq59sJzKYPe-STrqhZJI8M,3871
|
115
122
|
rbx/box/ui/widgets/two_sided_test_output_box.py,sha256=L-ORiDwd6CP5DFpavrKGBaX0ZHkSoQqbJrGZ4BdFUWc,2289
|
116
|
-
rbx/box/unit.py,sha256=
|
117
|
-
rbx/box/validators.py,sha256=
|
123
|
+
rbx/box/unit.py,sha256=fOltTLM2ONkUbKhetpRrgUyphEXvmvn8_kPH26LPXmo,7860
|
124
|
+
rbx/box/validators.py,sha256=nugrsZ6NMJa1SCH-VybDTDDf_hLP3tJehksessNv75s,10445
|
118
125
|
rbx/config.py,sha256=Tj0NHSf13fXxbNpif5C4qnaL1k3S-G87OnzuykEAcNQ,8463
|
119
126
|
rbx/console.py,sha256=X8EJy68OROgh6ao3ZcUjZm5Y56VFMzen58ywAuQ7pAU,990
|
120
127
|
rbx/grading/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -122,21 +129,18 @@ rbx/grading/caching.py,sha256=hasSs10PV4J_3e6b3xc7BDCnUNzT9uwrDZcZ_h_hL1I,16951
|
|
122
129
|
rbx/grading/debug_context.py,sha256=kuAXEI8yRG8xfhS9WKKIRh9X0e5JUD8zvl_cpczJTC8,699
|
123
130
|
rbx/grading/grading_context.py,sha256=TaRyLwPkkxvspQIFUFk8Ok0T8EST2pHMMNoVDx9lbFU,3416
|
124
131
|
rbx/grading/judge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
125
|
-
rbx/grading/judge/cacher.py,sha256=
|
132
|
+
rbx/grading/judge/cacher.py,sha256=zPyOqd7hP_zjuAGAauckFs6EvQE8pP7Mrug7fylIZvY,21929
|
126
133
|
rbx/grading/judge/digester.py,sha256=gtOIe_iL4PEWA7OKelW1gjSI-nBvbOpDPJGV8VQyjSg,912
|
127
|
-
rbx/grading/judge/program.py,sha256=
|
128
|
-
rbx/grading/judge/sandbox.py,sha256=
|
134
|
+
rbx/grading/judge/program.py,sha256=8hVme1IbyZlrgg8j-po3KZJsYqUbgqfpax-vSZbobRA,9993
|
135
|
+
rbx/grading/judge/sandbox.py,sha256=tSJKSkupSqSiIPHx4rjZ_fhZKzJ9tqqqlsLNSfy9tcc,21334
|
129
136
|
rbx/grading/judge/sandboxes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
130
|
-
rbx/grading/judge/sandboxes/stupid_sandbox.py,sha256=
|
137
|
+
rbx/grading/judge/sandboxes/stupid_sandbox.py,sha256=QuIP93lBOm7bnkwB3NlhHWxRTs4DTosa_EYPqHq2QCY,11600
|
131
138
|
rbx/grading/judge/sandboxes/tee.py,sha256=fLulB8fV7k5cO-ikRgURpsETrvr6LoUSjGxFM3GZs5U,672
|
132
|
-
rbx/grading/judge/storage.py,sha256=
|
133
|
-
rbx/grading/limits.py,sha256=
|
139
|
+
rbx/grading/judge/storage.py,sha256=yE9eIOW7tnmv_h3nTmWe4YFwErBTh84Ny4C1KLoZ2js,15613
|
140
|
+
rbx/grading/limits.py,sha256=zCyRTEtUQFd1RKL_fFKl3qSiRSIDCalBaSLlt1yhi0Y,896
|
134
141
|
rbx/grading/profiling.py,sha256=OEdtoAzjYjLfi-QI5Ke7tLZzJeqvGpMB2utQBNuH3E4,3369
|
135
|
-
rbx/grading/steps.py,sha256=
|
142
|
+
rbx/grading/steps.py,sha256=qJ0tVWSggGhWj6zUuCV8HTJD9NE11JzRFZN41_jBz_0,26674
|
136
143
|
rbx/grading/steps_with_caching.py,sha256=RWHtmlEfszKnKM9ADrfbCUZbxZSTD-BiHV3XSiGW8WY,4797
|
137
|
-
rbx/providers/__init__.py,sha256=gHXg1BTiXJ_0Z_HoVTZrqhi5IIZ57Dhy0pt7K2ETbA4,1378
|
138
|
-
rbx/providers/codeforces.py,sha256=HWQN3Zb9UfXgCfwcNMEk6m1HoXQ-UE2odVfZoPukyCg,2294
|
139
|
-
rbx/providers/provider.py,sha256=CNRB-uJZkNFIWv8xhW2s8PY9EwUSK8Ey1Yvxk4YLvcg,688
|
140
144
|
rbx/resources/checkers/boilerplate.cpp,sha256=vj1Qjy59JKEzb4ZpaX_MkL1FaZn_tTLZXjrIkP0nGfc,363
|
141
145
|
rbx/resources/checkers/noop.cpp,sha256=aZI6EfZEWq2opbb-kysvl0UeUoYGLU682LccP7cfBG8,214
|
142
146
|
rbx/resources/default_config.json,sha256=8GZVHns4nci0-e5ALk9C1lfO6TO9W2ZlmZtxHkL6ibA,949
|
@@ -190,37 +194,36 @@ rbx/resources/packagers/moj/scripts/py3/compile.sh,sha256=XPn8qDR_gPAAZD9h5lVEMd
|
|
190
194
|
rbx/resources/packagers/moj/scripts/py3/prep.sh,sha256=it1e07QRpsnku3-rXOO1ovaw-RJlVVPy9R3I6WWwgMM,126
|
191
195
|
rbx/resources/packagers/moj/scripts/py3/run.sh,sha256=LrMi7Tap9no8gh64QNGUXbWauP6ZpSl-wEwXZ2qhPo0,197
|
192
196
|
rbx/resources/presets/default/contest/.gitignore,sha256=CMwGD717vKcbQrXjha2D4LMwjDfQcev8rjFPg0AIi4A,131
|
193
|
-
rbx/resources/presets/default/contest/contest.rbx.yml,sha256=
|
197
|
+
rbx/resources/presets/default/contest/contest.rbx.yml,sha256=qa-FJEUP2o4mTfkfw8vb3TcSYRMC_N3yVoe7ZhjpP3U,1236
|
194
198
|
rbx/resources/presets/default/contest/statement/contest.rbx.tex,sha256=Jx6op_WdVpQOMekvOAZnBzDxxvBzg1_9ZFWtbzGasLo,793
|
199
|
+
rbx/resources/presets/default/contest/statement/info.rbx.tex,sha256=RaI5edNL-yHHH_1rGkT-C6sQs9a1PQE9pEp2CylvYV4,1195
|
195
200
|
rbx/resources/presets/default/contest/statement/instructions.tex,sha256=JG_eR13ukZgEahrrmrbg40H8cUzpoUE8QLocihN-fZ8,2414
|
196
201
|
rbx/resources/presets/default/contest/statement/logo.png,sha256=RLNYmZoc-BR6AZKkmr4UEg3h01YeFzvy604jMAQC7aA,414485
|
197
202
|
rbx/resources/presets/default/env.rbx.yml,sha256=quSPG5Xs9KroYLATNLPNtORLGRWtrLLt2Fx81T1enAM,1692
|
198
203
|
rbx/resources/presets/default/preset.rbx.yml,sha256=s7OFotxoe3aFFEstJv5QG7LU3UP370dGe5hA9gWRQpg,498
|
199
|
-
rbx/resources/presets/default/problem/.gitignore,sha256=
|
204
|
+
rbx/resources/presets/default/problem/.gitignore,sha256=1rt95y9Q7ZHIQn28JyZQUdD5zkpRosjAl9ZqoQmX2cE,149
|
200
205
|
rbx/resources/presets/default/problem/gens/gen.cpp,sha256=rn6sGRjZ1sFE1Rq02r6488iquY9xTrutcvLv4d1sohA,178
|
201
206
|
rbx/resources/presets/default/problem/manual_tests/samples/000.in,sha256=w66OEtCJGqjUNj8cJrqgImgGVm8W_OlIUtF255ds-ow,4
|
202
207
|
rbx/resources/presets/default/problem/manual_tests/samples/001.in,sha256=P4QInDX87xXoDWu4PVIzUeNW5LtTlUKbMCvJ9uZOPGw,20
|
203
|
-
rbx/resources/presets/default/problem/problem.rbx.yml,sha256=
|
204
|
-
rbx/resources/presets/default/problem/rbx.h,sha256=
|
208
|
+
rbx/resources/presets/default/problem/problem.rbx.yml,sha256=MMqCKkrRMoycIg5CmuV9hkGo45aUHCyRHQehzwZwzpo,2215
|
209
|
+
rbx/resources/presets/default/problem/rbx.h,sha256=iMNSI9tKGK8KJkl0Cgw1jhGdlRjqN_frFs-MFFS5Oq8,3760
|
205
210
|
rbx/resources/presets/default/problem/sols/main.cpp,sha256=AW-j65DiFYUN18rddTKCWc_VyYCMgCbjZ0jAJ-0JLuA,124
|
206
|
-
rbx/resources/presets/default/problem/sols/wa.cpp,sha256=Bj7tejPIlXG_JqUHWY1zi9TDbHdRZzgT_JDbCLRdhbQ,136
|
207
|
-
rbx/resources/presets/default/problem/statement/statement.rbx.tex,sha256=
|
211
|
+
rbx/resources/presets/default/problem/sols/wa-overflow.cpp,sha256=Bj7tejPIlXG_JqUHWY1zi9TDbHdRZzgT_JDbCLRdhbQ,136
|
212
|
+
rbx/resources/presets/default/problem/statement/statement.rbx.tex,sha256=iJhNF-OCskYJQA7XIC5CayZY1DZCcvnQ2XBkCESFlwI,431
|
213
|
+
rbx/resources/presets/default/problem/testlib.h,sha256=JvrK8SWQcesU_54BG2tQRzoUqw4KjnAgh7c8_9H7G5A,207138
|
208
214
|
rbx/resources/presets/default/problem/testplan/random.py,sha256=XclCB6pw9NT1ahu9bjr3fLZidNGi1E8OnNAPYZEY-Yk,103
|
209
215
|
rbx/resources/presets/default/problem/testplan/random.txt,sha256=XDrow4p79owKnjqyvaIVSNTXwWQDe3X1k_9-2zH43O8,34
|
210
|
-
rbx/resources/presets/default/problem/validator.cpp,sha256=
|
216
|
+
rbx/resources/presets/default/problem/validator.cpp,sha256=Dqd3y4v8W4A3sYXHEqxsS4rZnMqQpUrNQfwVetxPdlo,381
|
211
217
|
rbx/resources/presets/default/problem/wcmp.cpp,sha256=gbjJe3Vf9-YzHCEqBUq30aI3jMZXhqBDn3jjecYOn-w,902
|
212
|
-
rbx/resources/presets/default/shared/contest_template.rbx.tex,sha256=
|
213
|
-
rbx/resources/presets/default/shared/icpc.sty,sha256=
|
214
|
-
rbx/resources/presets/default/shared/problem_template.rbx.tex,sha256=
|
218
|
+
rbx/resources/presets/default/shared/contest_template.rbx.tex,sha256=9leq7cJFP1sB-gLSBdXAjTDuZTD89S4y18_nvifUTjE,1589
|
219
|
+
rbx/resources/presets/default/shared/icpc.sty,sha256=NJzS7iR8tuUjfpHUn8mVgUit8ny2vuW6rPL2zs5_tyE,8827
|
220
|
+
rbx/resources/presets/default/shared/problem_template.rbx.tex,sha256=KDibf4LtUio9hNFgIfd1VarQxfp9XLrxhyk_nWEQGa4,1706
|
215
221
|
rbx/resources/templates/rbx.h,sha256=0AZds9R0PmuPgnlTENb33Y81LW0LlnmOJFaoN8oG3Yo,3638
|
216
222
|
rbx/resources/templates/template.cpp,sha256=xXWpWo7fa7HfmPNqkmHcmv3i46Wm0ZL-gPmkRfGvLn4,317
|
217
|
-
rbx/
|
218
|
-
rbx/submitors/codeforces.py,sha256=s8c7sXfm5k76SKMC8g0Y93-RRf8wY2uWbBtA8ODD5eM,4030
|
219
|
-
rbx/submitors/submitor.py,sha256=8q-Hbdahxt30ciT_R9j_xF6lEPUh9IcfAUnzjQjbvHU,457
|
220
|
-
rbx/testing_utils.py,sha256=965vlkQpUW8cEqjB6S2g_C_avL5fn503mJPbqjY_zt4,2317
|
223
|
+
rbx/testing_utils.py,sha256=vNNdaytowJfuopszVHeFzVtHWlPfipPW4zpqCOvdZKU,2908
|
221
224
|
rbx/utils.py,sha256=xDqmry5rpqRGPFrx3ipNGBt2WxWDAD5LwU7jvgibXkk,8630
|
222
|
-
rbx_cp-0.
|
223
|
-
rbx_cp-0.
|
224
|
-
rbx_cp-0.
|
225
|
-
rbx_cp-0.
|
226
|
-
rbx_cp-0.
|
225
|
+
rbx_cp-0.14.0.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
226
|
+
rbx_cp-0.14.0.dist-info/METADATA,sha256=azukLiwm5Vz3vutXiyoabb5z3vDnAvn2h_JKDpuoNnM,4760
|
227
|
+
rbx_cp-0.14.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
228
|
+
rbx_cp-0.14.0.dist-info/entry_points.txt,sha256=Gw2_BZ5Jon61biaH_ETbAQGXy8fR5On9gw2U4A1erpo,40
|
229
|
+
rbx_cp-0.14.0.dist-info/RECORD,,
|
rbx/providers/__init__.py
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
from typing import List
|
2
|
-
|
3
|
-
from rbx.providers.codeforces import CodeforcesProvider
|
4
|
-
from rbx.providers.provider import ProviderInterface
|
5
|
-
from rbx.schema import Problem
|
6
|
-
|
7
|
-
ALL_PROVIDERS: List[ProviderInterface] = [
|
8
|
-
CodeforcesProvider(),
|
9
|
-
]
|
10
|
-
|
11
|
-
|
12
|
-
def is_contest(problems: List[Problem]) -> bool:
|
13
|
-
for provider in ALL_PROVIDERS:
|
14
|
-
handle_all = all(provider.should_handle(problem.url) for problem in problems)
|
15
|
-
if handle_all:
|
16
|
-
return provider.is_contest(problems)
|
17
|
-
return False
|
18
|
-
|
19
|
-
|
20
|
-
def should_simplify_contest_problems(problems: List[Problem]) -> bool:
|
21
|
-
if not is_contest(problems):
|
22
|
-
return False
|
23
|
-
for provider in ALL_PROVIDERS:
|
24
|
-
handle_all = all(provider.should_handle(problem.url) for problem in problems)
|
25
|
-
if handle_all:
|
26
|
-
return provider.should_simplify_contest_problems()
|
27
|
-
return False
|
28
|
-
|
29
|
-
|
30
|
-
def get_code(problem: Problem, simplify: bool = False) -> str:
|
31
|
-
for provider in ALL_PROVIDERS:
|
32
|
-
if provider.should_handle(problem.url):
|
33
|
-
if simplify:
|
34
|
-
return provider.get_problem_code_within_contest(problem)
|
35
|
-
return provider.get_code(problem)
|
36
|
-
return problem.get_normalized_name()
|
37
|
-
|
38
|
-
|
39
|
-
def get_aliases(problem: Problem) -> List[str]:
|
40
|
-
for provider in ALL_PROVIDERS:
|
41
|
-
if provider.should_handle(problem.url):
|
42
|
-
return provider.get_aliases(problem)
|
43
|
-
return []
|
rbx/providers/codeforces.py
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
import re
|
2
|
-
from typing import List, Optional
|
3
|
-
|
4
|
-
from rbx.providers.provider import ProviderInterface
|
5
|
-
from rbx.schema import Problem
|
6
|
-
|
7
|
-
|
8
|
-
def _add_underscores(matches: List[str]) -> List[str]:
|
9
|
-
if len(matches) <= 2:
|
10
|
-
return matches
|
11
|
-
return [f'{x}_' for x in matches[:-2]] + matches[-2:]
|
12
|
-
|
13
|
-
|
14
|
-
_PATTERNS = [
|
15
|
-
r'https?://(?:.*\.)?codeforces.(?:com|ml|es)/(?:contest|gym)/(\d+)/problem/([^/]+)',
|
16
|
-
r'https?://(?:.*\.)?codeforces.(?:com|ml|es)/problemset/problem/(\d+)/([^/]+)',
|
17
|
-
(
|
18
|
-
r'https?://(?:.*\.)?codeforces.(?:com|ml|es)/group/([^/]+)/contest/(\d+)/problem/([^/]+)',
|
19
|
-
_add_underscores,
|
20
|
-
),
|
21
|
-
r'https?://(?:.*\.)?codeforces.(?:com|ml|es)/problemset/(gym)Problem/([^/]+)',
|
22
|
-
r'https?://(?:.*\.)?codeforces.(?:com|ml|es)/problemsets/(acm)sguru/problem/(?:\d+)/([^/]+)',
|
23
|
-
# TODO: add EDU
|
24
|
-
]
|
25
|
-
|
26
|
-
|
27
|
-
def _compiled_pattern(pattern):
|
28
|
-
if isinstance(pattern, tuple):
|
29
|
-
return (re.compile(pattern[0]), pattern[1])
|
30
|
-
return re.compile(pattern)
|
31
|
-
|
32
|
-
|
33
|
-
_COMPILED_PATTERNS = [_compiled_pattern(pattern) for pattern in _PATTERNS]
|
34
|
-
|
35
|
-
|
36
|
-
def get_code_tuple(url: str) -> Optional[List[str]]:
|
37
|
-
for pattern_obj in _COMPILED_PATTERNS:
|
38
|
-
if isinstance(pattern_obj, tuple):
|
39
|
-
pattern, extract = pattern_obj
|
40
|
-
else:
|
41
|
-
pattern = pattern_obj
|
42
|
-
extract = lambda x: x # noqa: E731
|
43
|
-
|
44
|
-
if match := pattern.match(url):
|
45
|
-
return extract(list(match.groups()))
|
46
|
-
return None
|
47
|
-
|
48
|
-
|
49
|
-
class CodeforcesProvider(ProviderInterface):
|
50
|
-
def should_handle(self, url: str) -> bool:
|
51
|
-
return 'codeforces.com/' in url
|
52
|
-
|
53
|
-
def should_simplify_contest_problems(self) -> bool:
|
54
|
-
return True
|
55
|
-
|
56
|
-
def get_problem_code_within_contest(self, problem: Problem) -> str:
|
57
|
-
return self.get_aliases(problem)[-1]
|
58
|
-
|
59
|
-
def get_code(self, problem: Problem) -> str:
|
60
|
-
code_tuple = get_code_tuple(problem.url)
|
61
|
-
if not code_tuple:
|
62
|
-
return super().get_code(problem)
|
63
|
-
return ''.join(code_tuple)
|
64
|
-
|
65
|
-
def get_aliases(self, problem: Problem) -> List[str]:
|
66
|
-
code_tuple = get_code_tuple(problem.url)
|
67
|
-
if not code_tuple:
|
68
|
-
return super().get_aliases(problem)
|
69
|
-
|
70
|
-
aliases = []
|
71
|
-
for i in range(len(code_tuple)):
|
72
|
-
aliases.append(''.join(code_tuple[i:]))
|
73
|
-
return aliases
|
rbx/providers/provider.py
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
import abc
|
2
|
-
from typing import List
|
3
|
-
|
4
|
-
from rbx.schema import Problem
|
5
|
-
|
6
|
-
|
7
|
-
class ProviderInterface(abc.ABC):
|
8
|
-
@abc.abstractmethod
|
9
|
-
def should_handle(self, url: str) -> bool:
|
10
|
-
pass
|
11
|
-
|
12
|
-
def is_contest(self, problems: List[Problem]) -> bool:
|
13
|
-
batches = set(problem.batch.id for problem in problems)
|
14
|
-
return len(batches) == 1
|
15
|
-
|
16
|
-
def should_simplify_contest_problems(self) -> bool:
|
17
|
-
return False
|
18
|
-
|
19
|
-
def get_problem_code_within_contest(self, problem: Problem) -> str:
|
20
|
-
return self.get_code(problem)
|
21
|
-
|
22
|
-
def get_code(self, problem: Problem) -> str:
|
23
|
-
return problem.name
|
24
|
-
|
25
|
-
def get_aliases(self, problem: Problem) -> List[str]:
|
26
|
-
return []
|
rbx/submitors/__init__.py
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import pathlib
|
2
|
-
|
3
|
-
from rbx.config import Language, get_config
|
4
|
-
from rbx.schema import Problem
|
5
|
-
from rbx.submitors.codeforces import CodeforcesSubmitor
|
6
|
-
|
7
|
-
_SUBMITORS = [CodeforcesSubmitor()]
|
8
|
-
|
9
|
-
|
10
|
-
def handle_submit(file: pathlib.Path, problem: Problem, lang: Language) -> bool:
|
11
|
-
for submitor in _SUBMITORS:
|
12
|
-
if submitor.should_handle(problem):
|
13
|
-
submitor_config = get_config().submitor[lang.submitor]
|
14
|
-
credentials = get_config().credentials[submitor.key()]
|
15
|
-
return submitor.submit(
|
16
|
-
file, problem, submitor_config[submitor.key()], credentials
|
17
|
-
)
|
18
|
-
return False
|