-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
very overloaded (right) way to get task names
- Loading branch information
Showing
5 changed files
with
289 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
.DS_Store | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
|
||
class AbstractTaskNamesGetter(ABC): | ||
def __init__(self): | ||
self.__task_names = [] | ||
|
||
@abstractmethod | ||
def __create_task_names__(self, task_names): | ||
pass | ||
|
||
def get_task_names(self): | ||
self.__create_task_names__(self.__task_names) | ||
return self.__task_names | ||
|
||
|
||
class BasicTaskNamesGetter(AbstractTaskNamesGetter): | ||
def __create_task_names__(self, task_names): | ||
task_names += ['1_5', '6_9', '10_11'] | ||
|
||
|
||
class AdvanceTaskNamesGetter(AbstractTaskNamesGetter): | ||
def __create_task_names__(self, task_names): | ||
flag_numbers = self.__get_flag_numbers__() | ||
|
||
for i in range(len(flag_numbers)): | ||
start = self.__get_start__(i, flag_numbers) | ||
end = self.__get_end__(i, flag_numbers) | ||
|
||
temp_task_name = "%d_%d" % (start, end) | ||
task_names.append(temp_task_name) | ||
|
||
@abstractmethod | ||
def __get_flag_numbers__(self): | ||
pass | ||
|
||
@abstractmethod | ||
def __get_start__(self, i, flag_numbers): | ||
pass | ||
|
||
@abstractmethod | ||
def __get_end__(self, i, flag_numbers): | ||
pass | ||
|
||
|
||
class PrefixTaskNamesGetter(AdvanceTaskNamesGetter): | ||
def __get_flag_numbers__(self): | ||
return [5, 9, 11] | ||
|
||
def __get_start__(self, i, flag_numbers): | ||
if i == 0: | ||
return 1 | ||
else: | ||
return flag_numbers[i - 1] + 1 | ||
|
||
def __get_end__(self, i, flag_numbers): | ||
return flag_numbers[i] | ||
|
||
|
||
class PostfixTaskNamesGetter(AdvanceTaskNamesGetter): | ||
def __get_flag_numbers__(self): | ||
return [1, 6, 10] | ||
|
||
def __get_start__(self, i, flag_numbers): | ||
return flag_numbers[i] | ||
|
||
def __get_end__(self, i, flag_numbers): | ||
if i == len(flag_numbers) - 1: | ||
return 11 | ||
else: | ||
return flag_numbers[i + 1] - 1 | ||
|
||
|
||
def main(): | ||
for task_name_class in [BasicTaskNamesGetter, PrefixTaskNamesGetter, PostfixTaskNamesGetter]: | ||
task_names_getter = task_name_class() | ||
task_names = task_names_getter.get_task_names() | ||
print(*task_names) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
1 249 10 Фиб 34{^2}1{^1} 9С 10 11 651111 Факт 10 117 10 Фиб | ||
2 270 10 Фиб 1{^2}{^3}0{^4} 9С 10 12 262320 Факт 10 130 10 Фиб | ||
3 292 10 Фиб {^4}1{^3}22 9С 10 13 543210 Факт 10 144 10 Фиб | ||
4 315 10 Фиб 703 -10 10 14 430121 Факт 10 159 10 Фиб | ||
5 339 10 Фиб 814 -10 10 15 140301 Факт 10 175 10 Фиб | ||
6 621 10 Факт 925 -10 10 16 354320 Факт 10 192 10 Фиб | ||
7 732 10 Факт 136 -10 10 17 142121 Факт 10 175 10 Фиб | ||
8 843 10 Факт 1001010 Фиб 10 18 611020 Факт 10 192 10 Фиб | ||
9 954 10 Факт 1001001 Фиб 10 19 244321 Факт 10 210 10 Фиб | ||
10 265 10 Факт 1010010 Фиб 10 20 613301 Факт 10 229 10 Фиб | ||
21 42 10 Фиб 147 -10 10 31 121 10 Факт 1010101 Фиб 10 | ||
22 45 10 Фиб 258 -10 10 32 232 10 Факт 1001001 Фиб 10 | ||
23 49 10 Фиб 369 -10 10 33 343 10 Факт 1010010 Фиб 10 | ||
24 54 10 Фиб 470 -10 10 34 454 10 Факт 1001000 Фиб 10 | ||
25 60 10 Фиб 581 -10 10 35 565 10 Факт 1000101 Фиб 10 | ||
26 67 10 Фиб 692 -10 10 36 676 10 Факт 1001001 Фиб 10 | ||
27 75 10 Фиб 33{^2}00 7С 10 37 787 10 Факт 1000100 Фиб 10 | ||
28 84 10 Фиб {^1)303{^2} 7С 10 38 898 10 Факт 1010001 Фиб 10 | ||
29 94 10 Фиб {^1}{^2}{^3}21 7С 10 39 909 10 Факт 1010010 Фиб 10 | ||
30 105 10 Фиб 2{^1}33{^3} 7С 10 40 510 10 Факт 1001001 Фиб 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
1 39275 10 7 55856 13 10 46320 7 13 35,34 10 2 2A,A3 16 2 | ||
2 40311 10 11 46200 7 10 370D1 15 5 93,64 10 2 FA,BC 16 2 | ||
3 20946 10 5 A4702 11 10 89358 13 7 67,95 10 2 B9,46 16 2 | ||
4 62740 10 5 56666 9 10 89618 11 9 46,96 10 2 32,22 16 2 | ||
5 49152 10 13 17566 9 10 799BC 15 5 99,27 10 2 E1,DB 16 2 | ||
6 29351 10 15 47658 11 10 C9120 15 5 56,37 10 2 33,25 16 2 | ||
7 35292 10 5 17A0A 11 10 13242 7 13 33,45 10 2 14,69 16 2 | ||
8 52261 10 7 14511 9 10 17008 9 11 30,91 10 2 48,4C 16 2 | ||
9 59047 10 15 33240 7 10 21300 9 11 94,85 10 2 CD,BC 16 2 | ||
10 17109 10 13 55404 9 10 25860 9 11 35,22 10 2 5F,26 16 2 | ||
11 36734 10 13 20046 7 10 30242 5 15 87,71 10 2 29,5B 16 2 | ||
12 57970 10 5 23143 5 10 11204 5 15 46,64 10 2 C2,59 16 2 | ||
13 38985 10 7 CAD9B 15 10 628ED 15 5 36,63 10 2 58,3C 16 2 | ||
14 76779 10 13 53255 7 10 53441 7 13 69,47 10 2 8A,63 16 2 | ||
15 69244 10 9 66875 9 10 12250 7 13 63,99 10 2 6B,51 16 2 | ||
16 35146 10 7 13608 11 10 12024 5 15 89,11 10 2 8C,9D 16 2 | ||
17 25334 10 9 22211 5 10 3CAAD 15 5 53,54 10 2 72,98 16 2 | ||
18 28593 10 5 868A3 13 10 495D7 15 5 48,77 10 2 28,A2 16 2 | ||
19 70013 10 9 A414C 15 10 41343 5 15 39,44 10 2 EC,42 16 2 | ||
20 68981 10 7 40403 5 10 B9235 15 5 58,88 10 2 BA,12 16 2 | ||
21 34106 10 15 16116 7 10 21104 5 15 51,96 10 2 41,6C 16 2 | ||
22 94118 10 15 9A977 13 10 95183 11 9 65,94 10 2 DE,86 16 2 | ||
23 31961 10 13 60678 9 10 74B55 13 7 96,87 10 2 FB,B1 16 2 | ||
24 74496 10 7 20021 5 10 27072 9 11 43,68 10 2 59,DF 16 2 | ||
25 46318 10 15 25115 7 10 29A13 11 9 26,48 10 2 5A,EF 16 2 | ||
26 85407 10 11 1A550 11 10 43455 7 13 36,19 10 2 83,E1 16 2 | ||
27 25307 10 9 10053 7 10 28D10 15 5 52,16 10 2 3B,64 16 2 | ||
28 25285 10 15 C2A41 15 10 40674 9 11 10,25 10 2 7D,F5 16 2 | ||
29 50822 10 9 85667 9 10 10101 5 15 68,82 10 2 25,23 16 2 | ||
30 95518 10 11 89373 11 10 2E6ED 15 5 68,41 10 2 B5,12 16 2 | ||
31 92934 10 11 A0661 13 10 71574 11 9 56,26 10 2 9B,AA 16 2 | ||
32 64073 10 7 31234 5 10 B0524 13 7 95,73 10 2 EA,D9 16 2 | ||
33 27162 10 7 84054 11 10 4435A 15 5 27,58 10 2 6A,36 16 2 | ||
34 88222 10 15 46632 7 10 66062 9 11 24,63 10 2 BA,B9 16 2 | ||
35 35069 10 5 36934 11 10 83488 9 11 94,76 10 2 47,48 16 2 | ||
36 83932 10 15 87238 13 10 4945C 13 7 46,33 10 2 68,76 16 2 | ||
37 21909 10 9 57A0A 11 10 BECD6 15 5 64,81 10 2 C7,A8 16 2 | ||
38 46302 10 11 6CD08 15 10 B3BC9 13 7 93,88 10 2 3E,9D 16 2 | ||
39 61196 10 9 20601 7 10 41230 5 15 12,83 10 2 3C,6F 16 2 | ||
40 18491 10 7 66305 11 10 B2E7D 15 5 40,56 10 2 F9,A2 16 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
1 34,17 8 2 0,011111 2 16 0,010011 2 10 BF,FA 16 10 | ||
2 22,17 8 2 0,000101 2 16 0,001101 2 10 47,C4 16 10 | ||
3 27,71 8 2 0,000011 2 16 0,010101 2 10 C3,71 16 10 | ||
4 15,26 8 2 0,001001 2 16 0,101111 2 10 D8,A5 16 10 | ||
5 72,32 8 2 0,000111 2 16 0,010101 2 10 BB,78 16 10 | ||
6 50,56 8 2 0,000101 2 16 0,110111 2 10 71,F1 16 10 | ||
7 23,77 8 2 0,110011 2 16 0,010001 2 10 79,87 16 10 | ||
8 24,22 8 2 0,011101 2 16 0,011111 2 10 25,4D 16 10 | ||
9 76,22 8 2 0,111111 2 16 0,100111 2 10 E3,AF 16 10 | ||
10 36,36 8 2 0,010001 2 16 0,010001 2 10 CF,A2 16 10 | ||
11 37,76 8 2 0,100101 2 16 0,001111 2 10 C9,CB 16 10 | ||
12 15,33 8 2 0,010001 2 16 0,000111 2 10 B4,CE 16 10 | ||
13 66,36 8 2 0,110111 2 16 0,001001 2 10 A6,CF 16 10 | ||
14 36,37 8 2 0,110111 2 16 0,111011 2 10 14,12 16 10 | ||
15 63,51 8 2 0,000101 2 16 0,010111 2 10 6E,D5 16 10 | ||
16 23,74 8 2 0,000101 2 16 0,100001 2 10 8C,E9 16 10 | ||
17 25,11 8 2 0,011111 2 16 0,000001 2 10 7A,87 16 10 | ||
18 31,42 8 2 0,110101 2 16 0,011001 2 10 69,18 16 10 | ||
19 36,43 8 2 0,000001 2 16 0,010001 2 10 86,86 16 10 | ||
20 34,43 8 2 0,111101 2 16 0,100001 2 10 52,A1 16 10 | ||
21 14,67 8 2 0,001101 2 16 0,001011 2 10 1B,08 16 10 | ||
22 10,55 8 2 0,110001 2 16 0,101011 2 10 DE,EF 16 10 | ||
23 43,71 8 2 0,001111 2 16 0,011101 2 10 68,88 16 10 | ||
24 13,36 8 2 0,100001 2 16 0,110011 2 10 81,76 16 10 | ||
25 44,12 8 2 0,011111 2 16 0,110011 2 10 2E,22 16 10 | ||
26 22,32 8 2 0,011101 2 16 0,001001 2 10 B7,F4 16 10 | ||
27 73,14 8 2 0,001001 2 16 0,011001 2 10 1F,1E 16 10 | ||
28 41,25 8 2 0,000001 2 16 0,000011 2 10 6F,09 16 10 | ||
29 63,56 8 2 0,110101 2 16 0,101111 2 10 B7,93 16 10 | ||
30 25,22 8 2 0,101001 2 16 0,101101 2 10 28,D2 16 10 | ||
31 55,63 8 2 0,010001 2 16 0,011001 2 10 AD,4D 16 10 | ||
32 41,17 8 2 0,100001 2 16 0,000001 2 10 45,19 16 10 | ||
33 35,47 8 2 0,011011 2 16 0,100101 2 10 FC,BD 16 10 | ||
34 65,21 8 2 0,101001 2 16 0,000101 2 10 FC,2C 16 10 | ||
35 61,25 8 2 0,010111 2 16 0,111101 2 10 CD,BF 16 10 | ||
36 10,56 8 2 0,011101 2 16 0,010001 2 10 8F,41 16 10 | ||
37 26,33 8 2 0,101101 2 16 0,110111 2 10 33,14 16 10 | ||
38 33,27 8 2 0,010011 2 16 0,000011 2 10 45,47 16 10 | ||
39 35,43 8 2 0,110111 2 16 0,010011 2 10 EE,3C 16 10 | ||
40 62,43 8 2 0,100001 2 16 0,111011 2 10 EF,10 16 10 |