hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
fda14a693742eb4f2ed15a8a28ecc9bff2d835b7
338
py
Python
timer/ds.py
KingsleyXie/Yatpd
26f7aa779124fb96a0f8c146108ca1e77c4fa791
[ "MIT" ]
1
2020-04-26T06:07:53.000Z
2020-04-26T06:07:53.000Z
timer/ds.py
KingsleyXie/Yatpd
26f7aa779124fb96a0f8c146108ca1e77c4fa791
[ "MIT" ]
null
null
null
timer/ds.py
KingsleyXie/Yatpd
26f7aa779124fb96a0f8c146108ca1e77c4fa791
[ "MIT" ]
null
null
null
# Data Structure Base Class class DS: def __init__(self, cmp): raise NotImplementedError def gettop(self): raise NotImplementedError def extracttop(self): raise NotImplementedError def insert(self, val): raise NotImplementedError def print(self): raise NotImplementedError
18.777778
33
0.66568
33
338
6.69697
0.484848
0.542986
0.488688
0.280543
0
0
0
0
0
0
0
0
0.278107
338
17
34
19.882353
0.905738
0.073965
0
0.454545
0
0
0
0
0
0
0
0
0
1
0.454545
false
0
0
0
0.545455
0.090909
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
fdaa031bb6050828f9bcbb223110a1bd6ec1bbe6
82
py
Python
project/map/__init__.py
ayr-ton/Emberblast
9ba53a983489d7ae732debe0f1958587fe43a8ff
[ "MIT" ]
9
2021-05-19T18:54:20.000Z
2022-03-13T10:57:09.000Z
project/map/__init__.py
ayr-ton/Emberblast
9ba53a983489d7ae732debe0f1958587fe43a8ff
[ "MIT" ]
1
2021-12-15T20:03:48.000Z
2021-12-15T20:03:48.000Z
project/map/__init__.py
ayr-ton/Emberblast
9ba53a983489d7ae732debe0f1958587fe43a8ff
[ "MIT" ]
3
2021-06-17T21:12:18.000Z
2021-12-28T02:07:35.000Z
from .map import MapFactory, Map, Graph __all__ = ['MapFactory', 'Map', 'Graph']
20.5
40
0.682927
10
82
5.2
0.6
0.5
0.692308
0
0
0
0
0
0
0
0
0
0.146341
82
3
41
27.333333
0.742857
0
0
0
0
0
0.219512
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
fdcad9ed469b058209ef13105708ae46eef41798
264
py
Python
example/apps/buttons/views.py
NinjaDero/Directly
bb241b49c54c8a1510438f955b39d1785594cc64
[ "MIT" ]
4
2015-03-09T10:50:05.000Z
2020-07-02T17:22:37.000Z
example/apps/buttons/views.py
NinjaDero/Directly
bb241b49c54c8a1510438f955b39d1785594cc64
[ "MIT" ]
null
null
null
example/apps/buttons/views.py
NinjaDero/Directly
bb241b49c54c8a1510438f955b39d1785594cc64
[ "MIT" ]
null
null
null
from django.shortcuts import render_to_response from django.template import RequestContext def index(request): # Somehow get the html delivered, everything else is usually JavaScript in Ext return render_to_response('index.html', RequestContext(request))
37.714286
82
0.810606
35
264
6
0.714286
0.095238
0.152381
0
0
0
0
0
0
0
0
0
0.132576
264
7
83
37.714286
0.917031
0.287879
0
0
0
0
0.053476
0
0
0
0
0
0
1
0.25
false
0
0.5
0.25
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
5
fde2c294d1b04a55991d10d40c2602f45689c2b5
986
py
Python
client.py
felix2072/pytorch-CycleGAN-and-pix2pix
4980106ceab5e1eb7bb20c2b492d007b6310d9e1
[ "BSD-3-Clause" ]
null
null
null
client.py
felix2072/pytorch-CycleGAN-and-pix2pix
4980106ceab5e1eb7bb20c2b492d007b6310d9e1
[ "BSD-3-Clause" ]
null
null
null
client.py
felix2072/pytorch-CycleGAN-and-pix2pix
4980106ceab5e1eb7bb20c2b492d007b6310d9e1
[ "BSD-3-Clause" ]
null
null
null
import socket import time UDP_IP = "127.0.0.1" OUT_PORT = 5004 IN_PORT = 5005 buf = 1024 timeout = 3 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) info = "need file" sock.sendto(info.encode(), (UDP_IP, OUT_PORT)) time.sleep(0.01) info = "end" sock.sendto(info.encode(), (UDP_IP, OUT_PORT)) sock.close() sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind((UDP_IP, IN_PORT)) while True: print("wait for message") data, addr = sock.recvfrom(1024) if data.decode("utf-8") == "image saved": print("load base image") break info = "fake is ready" sock.sendto(info.encode(), (UDP_IP, OUT_PORT)) time.sleep(0.01) info = "end" sock.sendto(info.encode(), (UDP_IP, OUT_PORT)) sock.close() sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind((UDP_IP, IN_PORT)) while True: print("wait for message") data, addr = sock.recvfrom(1024) if data.decode("utf-8") == "got fake": print("fake image") break
22.409091
55
0.672414
159
986
4.037736
0.333333
0.054517
0.087227
0.124611
0.758567
0.758567
0.758567
0.758567
0.758567
0.691589
0
0.042579
0.166329
986
44
56
22.409091
0.738443
0
0
0.638889
0
0
0.12462
0
0
0
0
0
0
1
0
false
0
0.055556
0
0.055556
0.111111
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
e313621727e5306d46ae550aa5853927cb3566a4
253
py
Python
webapp/app/forms.py
Jinchu/covid-plotter
17fd3fc4f7a4e135cc79204ec3b7cdff90b9ff8f
[ "MIT" ]
null
null
null
webapp/app/forms.py
Jinchu/covid-plotter
17fd3fc4f7a4e135cc79204ec3b7cdff90b9ff8f
[ "MIT" ]
null
null
null
webapp/app/forms.py
Jinchu/covid-plotter
17fd3fc4f7a4e135cc79204ec3b7cdff90b9ff8f
[ "MIT" ]
null
null
null
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import DataRequired class CountryForm(FlaskForm): country = StringField('Country') submit = SubmitField('Search')
31.625
73
0.806324
26
253
7.807692
0.653846
0.108374
0
0
0
0
0
0
0
0
0
0
0.126482
253
7
74
36.142857
0.918552
0
0
0
0
0
0.051383
0
0
0
0
0
0
1
0
false
0.166667
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
5
e340deee2b5fafc854f27174f6c913990f8b965e
19
py
Python
print.py
nightlxight/improvedly
7633cab0a8c4c0c95360e52f28f583c71153228e
[ "MIT" ]
null
null
null
print.py
nightlxight/improvedly
7633cab0a8c4c0c95360e52f28f583c71153228e
[ "MIT" ]
null
null
null
print.py
nightlxight/improvedly
7633cab0a8c4c0c95360e52f28f583c71153228e
[ "MIT" ]
null
null
null
print("Hey world!")
19
19
0.684211
3
19
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.052632
19
1
19
19
0.722222
0
0
0
0
0
0.5
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
8ba79e391f01bd4eb2c0c2b4f1d1d9a4e5cb6310
39,197
py
Python
pyslate/locales.py
GreeKpl/pystlate
57b62d8e3f2f51770eeaa3bd7bfde4df9f574690
[ "MIT" ]
4
2016-03-12T05:47:52.000Z
2020-06-02T00:41:16.000Z
pyslate/locales.py
alchrabas/pyslate
57b62d8e3f2f51770eeaa3bd7bfde4df9f574690
[ "MIT" ]
null
null
null
pyslate/locales.py
alchrabas/pyslate
57b62d8e3f2f51770eeaa3bd7bfde4df9f574690
[ "MIT" ]
1
2015-03-16T21:22:13.000Z
2015-03-16T21:22:13.000Z
def is_integral(n): return int(n) == n LOCALES = { "af": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-I:%M:%S %p", "datetime_short": "%Y-%m-%-d %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Afrikaans", "native_name": "Afrikaans", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "am": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Amharic", "native_name": "\u12a0\u121b\u122d\u129b", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ar": { "format": { "date": "%-d\u200f/%m\u200f/%Y", "datetime": "%-d\u200f/%m\u200f/%Y %-I:%M:%S %p", "datetime_short": "%-d\u200f/%m\u200f/%Y %-I:%M %p", "decimal_point": "\u066b", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Arabic", "native_name": "\u0627\u0644\u0639\u0631\u0628\u064a\u0629", "number_rule": lambda n: 'p' if not is_integral(n) else ('z' if n == 0 else '' if n == 1 else 't' if n == 2 else 'w' if n % 100 >= 3 and n % 100 <= 10 else 'y' if n % 100 >= 11 else 'p') }, "az": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Azeri", "native_name": "az\u0259rbaycan", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "bg": { "format": { "date": "%-d.%m.%Y '\u0433'.", "datetime": "%-d.%m.%Y '\u0433'., %-H:%M:%S", "datetime_short": "%-d.%m.%Y '\u0433'., %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Bulgarian", "native_name": "\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "bn": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Bengali", "native_name": "\u09ac\u09be\u0982\u09b2\u09be", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "bs": { "format": { "date": "%-d.%m.%Y.", "datetime": "%-d.%m.%Y. %-H:%M:%S", "datetime_short": "%-d.%m.%Y. %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Bosnian", "native_name": "bosanski", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "ca": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Catalan", "native_name": "catal\u00e0", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "cs": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Czech", "native_name": "\u010de\u0161tina", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1) else 'w' if (n >= 2 and n <= 4) else 'p') }, "cy": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Welsh", "native_name": "Cymraeg", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1) else 't' if (n == 2) else 'p' if (n != 8 and n != 11) else 'y') }, "da": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H.%M.%S", "datetime_short": "%-d/%m/%Y %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Danish", "native_name": "dansk", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "de": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "German", "native_name": "Deutsch", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "dz": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b%-I:%M:%S %p", "datetime_short": "%Y-%m-%-d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b %-I \u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b %M %p", "decimal_point": ".", "time": "\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b%-I:%M:%S %p", "time_short": "\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b %-I \u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b %M %p" }, "name": "Dzongkha", "native_name": "\u0f62\u0fab\u0f7c\u0f44\u0f0b\u0f41", "number_rule": lambda n: '' }, "el": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Greek", "native_name": "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "en": { "format": { "date": "%Y-%-m-%-d", "datetime": "%Y-%-m-%-d, %-I:%M:%S %p", "datetime_short": "%Y-%-m-%-d, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "English", "native_name": "English", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "en-US": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y, %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "English", "native_name": "English", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "es": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Spanish", "native_name": "espa\u00f1ol", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "et": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M.%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M.%S", "time_short": "%-H:%M" }, "name": "Estonian", "native_name": "eesti", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "eu": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %-H:%M:%S", "datetime_short": "%Y/%m/%-d %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Basque", "native_name": "euskara", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fa": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d\u060c\u200f %-H:%M:%S", "datetime_short": "%Y/%m/%-d\u060c\u200f %-H:%M", "decimal_point": "\u066b", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Persian", "native_name": "\u0641\u0627\u0631\u0633\u06cc", "number_rule": lambda n: '' }, "fi": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H.%M.%S", "datetime_short": "%-d.%m.%Y %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Finnish", "native_name": "suomi", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fo": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Faroese", "native_name": "f\u00f8royskt", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fr": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "French", "native_name": "fran\u00e7ais", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "fy": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Western Frisian", "native_name": "West-Frysk", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ga": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Irish", "native_name": "Gaeilge", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 't' if n == 2 else 't' if (n > 2 and n < 7) else 'y' if (n > 6 and n < 11) else 'p') }, "gd": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Scottish Gaelic", "native_name": "G\u00e0idhlig", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1 or n == 11) else 't' if (n == 2 or n == 12) else 'w' if (n > 2 and n < 20) else 'p') }, "gl": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Galician", "native_name": "galego", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "gu": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Gujarati", "native_name": "\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "he": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Hebrew", "native_name": "\u05e2\u05d1\u05e8\u05d9\u05ea", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "hi": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Hindi", "native_name": "\u0939\u093f\u0928\u094d\u0926\u0940", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "hr": { "format": { "date": "%-d.%m.%Y.", "datetime": "%-d.%m.%Y. %-H:%M:%S", "datetime_short": "%-d.%m.%Y. %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Croatian", "native_name": "hrvatski", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "hu": { "format": { "date": "%Y. %m. %-d.", "datetime": "%Y. %m. %-d. %-H:%M:%S", "datetime_short": "%Y. %m. %-d. %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Hungarian", "native_name": "magyar", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "hy": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Armenian", "native_name": "\u0570\u0561\u0575\u0565\u0580\u0565\u0576", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "id": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H.%M.%S", "datetime_short": "%-d/%m/%Y %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Indonesian", "native_name": "Bahasa Indonesia", "number_rule": lambda n: '' }, "is": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Icelandic", "native_name": "\u00edslenska", "number_rule": lambda n: 'p' if not is_integral(n) else ('p' if (n % 10 != 1 or n % 100 == 11) else '') }, "it": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-H:%M:%S", "datetime_short": "%-d/%m/%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Italian", "native_name": "italiano", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ja": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %-H:%M:%S", "datetime_short": "%Y/%m/%-d %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Japanese", "native_name": "\u65e5\u672c\u8a9e", "number_rule": lambda n: '' }, "ka": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Georgian", "native_name": "\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8", "number_rule": lambda n: '' }, "kk": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Kazakh", "native_name": "\u049b\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456", "number_rule": lambda n: '' }, "kl": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-I:%M:%S %p", "datetime_short": "%Y-%m-%-d %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Kalaallisut", "native_name": "kalaallisut", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "km": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Khmer", "native_name": "\u1781\u17d2\u1798\u17c2\u179a", "number_rule": lambda n: '' }, "kn": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Kannada", "native_name": "\u0c95\u0ca8\u0ccd\u0ca8\u0ca1", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ko": { "format": { "date": "%Y. %m. %-d.", "datetime": "%Y. %m. %-d. %p %-I:%M:%S", "datetime_short": "%Y. %m. %-d. %p %-I:%M", "decimal_point": ".", "time": "%p %-I:%M:%S", "time_short": "%p %-I:%M" }, "name": "Korean", "native_name": "\ud55c\uad6d\uc5b4", "number_rule": lambda n: '' }, "ks": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Kashmiri", "native_name": "\u06a9\u0672\u0634\u064f\u0631", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ky": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Kirghiz", "native_name": "\u043a\u044b\u0440\u0433\u044b\u0437\u0447\u0430", "number_rule": lambda n: '' }, "lb": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Luxembourgish", "native_name": "L\u00ebtzebuergesch", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "lo": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-H:%M:%S", "datetime_short": "%-d/%m/%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Lao", "native_name": "\u0ea5\u0eb2\u0ea7", "number_rule": lambda n: '' }, "lt": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-H:%M:%S", "datetime_short": "%Y-%m-%-d %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Lithuanian", "native_name": "lietuvi\u0173", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "lv": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Latvian", "native_name": "latvie\u0161u", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'p' if n != 0 else 'z') }, "mk": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Macedonian", "native_name": "\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ml": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Malayalam", "native_name": "\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "mn": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d, %-H:%M:%S", "datetime_short": "%Y-%m-%-d, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Mongolian", "native_name": "\u043c\u043e\u043d\u0433\u043e\u043b", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "mr": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Marathi", "native_name": "\u092e\u0930\u093e\u0920\u0940", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ms": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Malay", "native_name": "Bahasa Melayu", "number_rule": lambda n: '' }, "my": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Burmese", "native_name": "\u1017\u1019\u102c", "number_rule": lambda n: '' }, "nb": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H.%M.%S", "datetime_short": "%-d.%m.%Y, %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Norwegian Bokm\u00e5l", "native_name": "norsk bokm\u00e5l", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ne": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d, %-H:%M:%S", "datetime_short": "%Y-%m-%-d, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Nepali", "native_name": "\u0928\u0947\u092a\u093e\u0932\u0940", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "nl": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-H:%M:%S", "datetime_short": "%-d-%m-%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Dutch", "native_name": "Nederlands", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "nn": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Norwegian Nynorsk", "native_name": "nynorsk", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "os": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Ossetic", "native_name": "\u0438\u0440\u043e\u043d", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "pa": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y, %-I:%M %p", "decimal_point": "\u066b", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Punjabi", "native_name": "\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "pl": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Polish", "native_name": "polski", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "pt": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Portuguese", "native_name": "portugu\u00eas", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ro": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Romanian", "native_name": "rom\u00e2n\u0103", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'w' if (n == 0 or (n % 100 > 0 and n % 100 < 20)) else 'p') }, "ru": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Russian", "native_name": "\u0440\u0443\u0441\u0441\u043a\u0438\u0439", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "si": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %p %-I.%M.%S", "datetime_short": "%Y-%m-%-d %p %-I.%M", "decimal_point": ".", "time": "%p %-I.%M.%S", "time_short": "%p %-I.%M" }, "name": "Sinhala", "native_name": "\u0dc3\u0dd2\u0d82\u0dc4\u0dbd", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "sk": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Slovak", "native_name": "sloven\u010dina", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if (n == 1) else 'w' if (n >= 2 and n <= 4) else 'p') }, "sl": { "format": { "date": "%-d. %m. %Y", "datetime": "%-d. %m. %Y %-H:%M:%S", "datetime_short": "%-d. %m. %Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Slovenian", "native_name": "sloven\u0161\u010dina", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 100 == 1 else 't' if n % 100 == 2 else 'w' if n % 100 == 3 or n % 100 == 4 else 'p') }, "sq": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y, %-H:%M:%S", "datetime_short": "%-d.%m.%Y, %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Albanian", "native_name": "shqip", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "sr": { "format": { "date": "%-d.%m.%Y.", "datetime": "%-d.%m.%Y. %-H.%M.%S", "datetime_short": "%-d.%m.%Y. %-H.%M", "decimal_point": ",", "time": "%-H.%M.%S", "time_short": "%-H.%M" }, "name": "Serbian", "native_name": "\u0441\u0440\u043f\u0441\u043a\u0438", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "sv": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-H:%M:%S", "datetime_short": "%Y-%m-%-d %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Swedish", "native_name": "svenska", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "sw": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Swahili", "native_name": "Kiswahili", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ta": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y, %-I:%M:%S %p", "datetime_short": "%-d-%m-%Y, %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Tamil", "native_name": "\u0ba4\u0bae\u0bbf\u0bb4\u0bcd", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "te": { "format": { "date": "%-d-%m-%Y", "datetime": "%-d-%m-%Y %-I:%M:%S %p", "datetime_short": "%-d-%m-%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Telugu", "native_name": "\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "th": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-H:%M:%S", "datetime_short": "%-d/%m/%Y %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Thai", "native_name": "\u0e44\u0e17\u0e22", "number_rule": lambda n: '' }, "to": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Tongan", "native_name": "lea fakatonga", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "tr": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Turkish", "native_name": "T\u00fcrk\u00e7e", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "ug": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y\u060c %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y\u060c %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Uighur", "native_name": "\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5", "number_rule": lambda n: '' }, "uk": { "format": { "date": "%-d.%m.%Y", "datetime": "%-d.%m.%Y %-H:%M:%S", "datetime_short": "%-d.%m.%Y %-H:%M", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Ukrainian", "native_name": "\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n % 10 == 1 and n % 100 != 11 else 'w' if n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20) else 'p') }, "ur": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y %-I:%M:%S %p", "datetime_short": "%-d/%m/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Urdu", "native_name": "\u0627\u0631\u062f\u0648", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "uz": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %-H:%M:%S", "datetime_short": "%Y/%m/%-d %-H:%M", "decimal_point": "\u066b", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Uzbek", "native_name": "o\u02bbzbekcha", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "vi": { "format": { "date": "%-d/%m/%Y", "datetime": "%-H:%M:%S %-d/%m/%Y", "datetime_short": "%-H:%M %-d/%m/%Y", "decimal_point": ",", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Vietnamese", "native_name": "Ti\u1ebfng Vi\u1ec7t", "number_rule": lambda n: '' }, "yi": { "format": { "date": "%-d/%m/%Y", "datetime": "%-d/%m/%Y, %-H:%M:%S", "datetime_short": "%-d/%m/%Y, %-H:%M", "decimal_point": ".", "time": "%-H:%M:%S", "time_short": "%-H:%M" }, "name": "Yiddish", "native_name": "\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') }, "zh": { "format": { "date": "%Y/%m/%-d", "datetime": "%Y/%m/%-d %p%-I:%M:%S", "datetime_short": "%Y/%m/%-d %p%-I:%M", "decimal_point": ".", "time": "%p%-I:%M:%S", "time_short": "%p%-I:%M" }, "name": "Chinese", "native_name": "\u4e2d\u6587", "number_rule": lambda n: '' }, "zu": { "format": { "date": "%-m/%-d/%Y", "datetime": "%-m/%-d/%Y %-I:%M:%S %p", "datetime_short": "%-m/%-d/%Y %-I:%M %p", "decimal_point": ".", "time": "%-I:%M:%S %p", "time_short": "%-I:%M %p" }, "name": "Zulu", "native_name": "isiZulu", "number_rule": lambda n: 'p' if not is_integral(n) else ('' if n == 1 else 'p') } }
35.312613
194
0.382274
4,835
39,197
2.996691
0.093278
0.031472
0.039133
0.025399
0.753399
0.745186
0.741528
0.736214
0.73228
0.72524
0
0.048832
0.354772
39,197
1,110
195
35.312613
0.52406
0
0
0.568981
0
0.003607
0.406934
0.041635
0
0
0
0
0
1
0.000902
false
0
0
0.000902
0.001803
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
474407d055e395ba35b61981f878cdfbd9b1a9c5
23
py
Python
__init__.py
grzeimann/Panacea
e0e9b5c64fa612659572343a47d518d8db63f2b8
[ "BSD-3-Clause" ]
8
2017-01-12T16:18:52.000Z
2020-02-19T20:01:44.000Z
__init__.py
grzeimann/Panacea
e0e9b5c64fa612659572343a47d518d8db63f2b8
[ "BSD-3-Clause" ]
null
null
null
__init__.py
grzeimann/Panacea
e0e9b5c64fa612659572343a47d518d8db63f2b8
[ "BSD-3-Clause" ]
1
2017-02-16T19:14:47.000Z
2017-02-16T19:14:47.000Z
# blank initialization
11.5
22
0.826087
2
23
9.5
1
0
0
0
0
0
0
0
0
0
0
0
0.130435
23
1
23
23
0.95
0.869565
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
479925cfedc97707b5ac74561376ac44deba2019
141
py
Python
Python/ex021.py
Bijitakc/Hacktoberfest2021-2
167e7c81dc9c5cc83fd604ea1d4bce52aa882605
[ "MIT" ]
20
2021-10-06T13:51:46.000Z
2021-11-11T16:12:17.000Z
Python/ex021.py
Bijitakc/Hacktoberfest2021-2
167e7c81dc9c5cc83fd604ea1d4bce52aa882605
[ "MIT" ]
42
2021-10-08T09:49:17.000Z
2021-10-21T23:18:39.000Z
Python/ex021.py
Bijitakc/Hacktoberfest2021-2
167e7c81dc9c5cc83fd604ea1d4bce52aa882605
[ "MIT" ]
97
2021-10-06T13:04:34.000Z
2021-11-11T16:12:21.000Z
import pygame pygame.init() pygame.mixer.init() pygame.mixer.music.load("recairei.mp3") pygame.mixer.music.play() import time time.sleep(300)
20.142857
39
0.780142
22
141
5
0.545455
0.3
0.272727
0
0
0
0
0
0
0
0
0.030075
0.056738
141
7
40
20.142857
0.796992
0
0
0
0
0
0.084507
0
0
0
0
0
0
1
0
true
0
0.285714
0
0.285714
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
47bae7b537b515003be9ea90efab273f87d59a26
54,059
py
Python
207-Course-Schedule/solution01.py
Eroica-cpp/LeetCode
07276bd11558f3d0e32bec768b09e886de145f9e
[ "CC-BY-3.0", "MIT" ]
7
2015-05-05T22:21:30.000Z
2021-03-13T04:04:15.000Z
207-Course-Schedule/solution01.py
Eroica-cpp/LeetCode
07276bd11558f3d0e32bec768b09e886de145f9e
[ "CC-BY-3.0", "MIT" ]
null
null
null
207-Course-Schedule/solution01.py
Eroica-cpp/LeetCode
07276bd11558f3d0e32bec768b09e886de145f9e
[ "CC-BY-3.0", "MIT" ]
2
2018-12-26T08:13:25.000Z
2020-07-18T20:18:24.000Z
#!/usr/bin/python # ============================================================================== # Author: Tao Li (taoli@ucsd.edu) # Date: Jun 12, 2015 # Question: 207-Course-Schedule # Link: https://leetcode.com/problems/course-schedule/ # ============================================================================== # There are a total of n courses you have to take, labeled from 0 to n - 1. # # Some courses may have prerequisites, for example to take course 0 you have # to first take course 1, which is expressed as a pair: [0,1] # # Given the total number of courses and a list of prerequisite pairs, is it # possible for you to finish all courses? # # For example: # # 2, [[1,0]] # There are a total of 2 courses to take. To take course 1 you should have # finished course 0. So it is possible. # # 2, [[1,0],[0,1]] # There are a total of 2 courses to take. To take course 1 you should have # finished course 0, and to take course 0 you should also have finished course # 1. So it is impossible. # # Note: # The input prerequisites is a graph represented by a list of edges, not # adjacency matrices. Read more about how a graph is represented. # ============================================================================== # Method: DFS; figure out whether have loops in a graph # Time Complexity: O(n) # Space Complexity: O(n) # ============================================================================== class Solution: # @param {integer} numCourses # @param {integer[][]} prerequisites # @return {boolean} def canFinish(self, numCourses, prerequisites): graph = [[] for _ in xrange(numCourses)] for edge in prerequisites: graph[edge[0]].append(edge[1]) visitedInsideDFS = [False] * numCourses visitedCourse = [False] * numCourses for course in xrange(numCourses): if not visitedCourse[course]: if self.hasLoop(graph, course, visitedInsideDFS, visitedCourse): return False return True def hasLoop(self, graph, course, visitedInsideDFS, visitedCourse): if visitedInsideDFS[course]: return True visitedInsideDFS[course] = True for nextNode in graph[course]: if self.hasLoop(graph, nextNode, visitedInsideDFS, visitedCourse): return True visitedInsideDFS[course] = False visitedCourse[course] = True return False if __name__ == '__main__': numCourses, prerequisites = 2, [[1,0]] numCourses, prerequisites = 2, [[1,0],[0,1]] numCourses, prerequisites = 1, [] numCourses, prerequisites = 3, [[2,0],[2,1]] numCourses, prerequisites = 2000, [[781,650],[650,1175],[1175,1961],[1961,1414],[1414,1144],[1144,461],[461,1450],[1450,1836],[1836,754],[754,1429],[1429,97],[97,385],[385,1260],[1260,1345],[1345,1751],[1751,1775],[1775,1273],[1273,18],[18,1307],[1307,859],[859,1792],[1792,1258],[1258,1609],[1609,999],[999,1485],[1485,887],[887,82],[82,285],[285,1026],[1026,1442],[1442,328],[328,224],[224,33],[33,1687],[1687,1797],[1797,510],[510,1266],[1266,1984],[1984,314],[314,1314],[1314,67],[67,375],[375,1969],[1969,560],[560,1466],[1466,1362],[1362,1672],[1672,1657],[1657,1323],[1323,114],[114,745],[745,1455],[1455,1306],[1306,241],[241,960],[960,271],[271,57],[57,324],[324,400],[400,609],[609,721],[721,1387],[1387,793],[793,482],[482,873],[873,311],[311,833],[833,637],[637,491],[491,886],[886,1426],[1426,201],[201,1740],[1740,183],[183,1706],[1706,626],[626,546],[546,318],[318,903],[903,1979],[1979,69],[69,472],[472,16],[16,576],[576,1370],[1370,1691],[1691,665],[665,256],[256,1884],[1884,548],[548,28],[28,176],[176,252],[252,1105],[1105,274],[274,1721],[1721,1718],[1718,906],[906,852],[852,1435],[1435,865],[865,896],[896,699],[699,1156],[1156,259],[259,1399],[1399,740],[740,673],[673,622],[622,984],[984,794],[794,963],[963,1753],[1753,1454],[1454,1017],[1017,1636],[1636,627],[627,1498],[1498,1628],[1628,628],[628,513],[513,1044],[1044,1564],[1564,933],[933,653],[653,1401],[1401,909],[909,1768],[1768,840],[840,1749],[1749,554],[554,1326],[1326,1931],[1931,844],[844,645],[645,1592],[1592,1183],[1183,306],[306,1949],[1949,1970],[1970,1680],[1680,27],[27,1329],[1329,277],[277,354],[354,612],[612,1844],[1844,1389],[1389,550],[550,1291],[1291,1524],[1524,686],[686,688],[688,1845],[1845,448],[448,730],[730,1603],[1603,185],[185,109],[109,591],[591,1159],[1159,1919],[1919,380],[380,719],[719,728],[728,1873],[1873,1093],[1093,969],[969,1798],[1798,1413],[1413,492],[492,365],[365,1988],[1988,695],[695,14],[14,773],[773,177],[177,1720],[1720,1964],[1964,1432],[1432,1187],[1187,1479],[1479,784],[784,118],[118,741],[741,967],[967,1641],[1641,490],[490,966],[966,1591],[1591,1778],[1778,1576],[1576,1615],[1615,723],[723,1724],[1724,1954],[1954,1709],[1709,96],[96,1486],[1486,1642],[1642,1776],[1776,994],[994,1758],[1758,1983],[1983,483],[483,917],[917,738],[738,1428],[1428,1852],[1852,1648],[1648,1953],[1953,155],[155,181],[181,815],[815,1180],[1180,1666],[1666,88],[88,1226],[1226,876],[876,1179],[1179,251],[251,720],[720,1073],[1073,1042],[1042,1599],[1599,102],[102,372],[372,466],[466,636],[636,1892],[1892,620],[620,164],[164,866],[866,1646],[1646,1253],[1253,467],[467,1342],[1342,1584],[1584,540],[540,1104],[1104,543],[543,1677],[1677,529],[529,1705],[1705,429],[429,1606],[1606,1202],[1202,1886],[1886,508],[508,883],[883,694],[694,1542],[1542,1774],[1774,371],[371,1586],[1586,414],[414,1877],[1877,1398],[1398,1182],[1182,644],[644,809],[809,890],[890,1035],[1035,390],[390,1671],[1671,970],[970,756],[756,1267],[1267,1332],[1332,158],[158,1587],[1587,1940],[1940,475],[475,478],[478,1206],[1206,590],[590,1731],[1731,573],[573,392],[392,1728],[1728,281],[281,1834],[1834,404],[404,1471],[1471,615],[615,1109],[1109,621],[621,1861],[1861,925],[925,1874],[1874,1882],[1882,1013],[1013,1367],[1367,1660],[1660,1380],[1380,243],[243,722],[722,668],[668,1526],[1526,1855],[1855,1118],[1118,1243],[1243,128],[128,1842],[1842,1178],[1178,1472],[1472,370],[370,1437],[1437,1274],[1274,434],[434,1782],[1782,511],[511,402],[402,1982],[1982,1875],[1875,703],[703,1131],[1131,1085],[1085,1034],[1034,1181],[1181,1467],[1467,556],[556,139],[139,298],[298,1440],[1440,1298],[1298,1899],[1899,1978],[1978,1217],[1217,1951],[1951,1683],[1683,1280],[1280,1204],[1204,405],[405,99],[99,1448],[1448,162],[162,1112],[1112,1157],[1157,1929],[1929,1890],[1890,1926],[1926,1302],[1302,1425],[1425,1699],[1699,565],[565,1627],[1627,1483],[1483,1676],[1676,66],[66,1116],[1116,986],[986,1041],[1041,62],[62,1818],[1818,1888],[1888,355],[355,266],[266,431],[431,1218],[1218,1763],[1763,115],[115,997],[997,1099],[1099,936],[936,249],[249,1704],[1704,930],[930,1560],[1560,1230],[1230,646],[646,144],[144,1059],[1059,1506],[1506,791],[791,811],[811,1427],[1427,595],[595,413],[413,1800],[1800,399],[399,299],[299,1902],[1902,1679],[1679,1871],[1871,87],[87,1914],[1914,260],[260,361],[361,1726],[1726,1880],[1880,200],[200,1225],[1225,1772],[1772,1608],[1608,1866],[1866,1346],[1346,538],[538,669],[669,1000],[1000,1190],[1190,330],[330,1434],[1434,1896],[1896,117],[117,1779],[1779,836],[836,1692],[1692,1386],[1386,417],[417,596],[596,1993],[1993,422],[422,1248],[1248,928],[928,253],[253,1012],[1012,457],[457,1991],[1991,1412],[1412,1801],[1801,1127],[1127,1331],[1331,1920],[1920,1945],[1945,671],[671,1837],[1837,317],[317,301],[301,335],[335,1674],[1674,1121],[1121,1921],[1921,1198],[1198,411],[411,1152],[1152,1277],[1277,1912],[1912,586],[586,310],[310,1525],[1525,1174],[1174,1254],[1254,284],[284,1103],[1103,1350],[1350,1396],[1396,835],[835,1509],[1509,1275],[1275,127],[127,206],[206,188],[188,1960],[1960,980],[980,1122],[1122,77],[77,31],[31,652],[652,1507],[1507,386],[386,655],[655,129],[129,1215],[1215,1552],[1552,1620],[1620,1616],[1616,696],[696,1223],[1223,1719],[1719,1548],[1548,455],[455,920],[920,1601],[1601,1421],[1421,509],[509,257],[257,1007],[1007,680],[680,675],[675,240],[240,1682],[1682,661],[661,484],[484,327],[327,132],[132,1518],[1518,1827],[1827,687],[687,195],[195,1027],[1027,469],[469,752],[752,566],[566,280],[280,796],[796,104],[104,142],[142,750],[750,957],[957,425],[425,1272],[1272,239],[239,1446],[1446,1208],[1208,888],[888,1585],[1585,1655],[1655,391],[391,1905],[1905,1697],[1697,972],[972,1166],[1166,101],[101,65],[65,727],[727,797],[797,1795],[1795,1972],[1972,1808],[1808,558],[558,1745],[1745,1813],[1813,296],[296,826],[826,1901],[1901,12],[12,683],[683,1110],[1110,1312],[1312,1725],[1725,685],[685,691],[691,407],[407,1147],[1147,1809],[1809,1965],[1965,332],[332,1785],[1785,393],[393,639],[639,998],[998,976],[976,1381],[1381,1349],[1349,1402],[1402,60],[60,154],[154,93],[93,1784],[1784,1384],[1384,351],[351,1959],[1959,1826],[1826,855],[855,843],[843,1072],[1072,1865],[1865,1805],[1805,1231],[1231,1600],[1600,1517],[1517,394],[394,850],[850,1742],[1742,789],[789,442],[442,4],[4,169],[169,838],[838,631],[631,915],[915,932],[932,604],[604,1997],[1997,1995],[1995,230],[230,1799],[1799,309],[309,1209],[1209,1541],[1541,707],[707,90],[90,1288],[1288,1487],[1487,885],[885,146],[146,1256],[1256,137],[137,901],[901,520],[520,746],[746,148],[148,1911],[1911,1673],[1673,772],[772,597],[597,856],[856,61],[61,1503],[1503,507],[507,1568],[1568,288],[288,40],[40,996],[996,401],[401,1461],[1461,1464],[1464,46],[46,1240],[1240,20],[20,1743],[1743,1065],[1065,1056],[1056,79],[79,1579],[1579,1261],[1261,44],[44,767],[767,1932],[1932,292],[292,373],[373,1734],[1734,1968],[1968,1385],[1385,1501],[1501,321],[321,1605],[1605,350],[350,1786],[1786,598],[598,803],[803,1018],[1018,198],[198,757],[757,486],[486,468],[468,893],[893,924],[924,1573],[1573,126],[126,783],[783,1299],[1299,1358],[1358,26],[26,1263],[1263,758],[758,1014],[1014,927],[927,130],[130,729],[729,473],[473,1321],[1321,202],[202,210],[210,1693],[1693,657],[657,1259],[1259,1430],[1430,1328],[1328,1108],[1108,534],[534,1863],[1863,555],[555,1347],[1347,1392],[1392,1575],[1575,710],[710,654],[654,1079],[1079,1224],[1224,171],[171,1251],[1251,1352],[1352,1141],[1141,945],[945,1058],[1058,1172],[1172,1746],[1746,449],[449,1610],[1610,493],[493,1955],[1955,503],[503,450],[450,1717],[1717,1950],[1950,1638],[1638,1069],[1069,419],[419,170],[170,816],[816,152],[152,362],[362,1958],[1958,1005],[1005,813],[813,1213],[1213,956],[956,1216],[1216,1747],[1747,1153],[1153,1815],[1815,1031],[1031,1074],[1074,428],[428,625],[625,708],[708,1364],[1364,1102],[1102,857],[857,795],[795,1824],[1824,1935],[1935,1284],[1284,1419],[1419,717],[717,1094],[1094,23],[23,81],[81,1310],[1310,1624],[1624,701],[701,131],[131,541],[541,1702],[1702,1545],[1545,1322],[1322,270],[270,49],[49,742],[742,1145],[1145,726],[726,1372],[1372,1476],[1476,1249],[1249,1228],[1228,1810],[1810,1571],[1571,1986],[1986,1851],[1851,1171],[1171,1802],[1802,1028],[1028,1030],[1030,1126],[1126,1054],[1054,1091],[1091,278],[278,762],[762,824],[824,1481],[1481,1378],[1378,136],[136,755],[755,764],[764,216],[216,905],[905,1977],[1977,982],[982,1055],[1055,1357],[1357,1265],[1265,1546],[1546,1872],[1872,379],[379,1701],[1701,398],[398,1645],[1645,437],[437,1535],[1535,1904],[1904,78],[78,1612],[1612,1668],[1668,245],[245,849],[849,83],[83,954],[954,1558],[1558,1494],[1494,1239],[1239,964],[964,825],[825,1375],[1375,821],[821,68],[68,1443],[1443,869],[869,123],[123,470],[470,1647],[1647,1513],[1513,329],[329,1004],[1004,800],[800,517],[517,34],[34,423],[423,634],[634,562],[562,273],[273,1770],[1770,1316],[1316,713],[713,978],[978,315],[315,1678],[1678,1848],[1848,1077],[1077,1536],[1536,500],[500,662],[662,1910],[1910,147],[147,585],[585,777],[777,235],[235,421],[421,1733],[1733,22],[22,1214],[1214,1344],[1344,297],[297,1803],[1803,1849],[1849,874],[874,1879],[1879,934],[934,955],[955,831],[831,348],[348,1057],[1057,1011],[1011,1024],[1024,219],[219,1097],[1097,539],[539,870],[870,1351],[1351,810],[810,363],[363,487],[487,218],[218,454],[454,1956],[1956,1651],[1651,841],[841,480],[480,262],[262,1893],[1893,1941],[1941,1359],[1359,356],[356,347],[347,1083],[1083,1821],[1821,1478],[1478,180],[180,247],[247,333],[333,1468],[1468,771],[771,931],[931,1830],[1830,1390],[1390,232],[232,1080],[1080,322],[322,537],[537,1822],[1822,1595],[1595,666],[666,1823],[1823,248],[248,1368],[1368,1741],[1741,3],[3,1451],[1451,618],[618,1626],[1626,718],[718,939],[939,184],[184,1337],[1337,806],[806,1029],[1029,374],[374,11],[11,189],[189,947],[947,1066],[1066,1046],[1046,640],[640,124],[124,1976],[1976,420],[420,462],[462,670],[670,1037],[1037,456],[456,276],[276,89],[89,904],[904,140],[140,1895],[1895,1395],[1395,1563],[1563,1191],[1191,246],[246,1459],[1459,851],[851,1439],[1439,1766],[1766,92],[92,1582],[1582,1520],[1520,705],[705,54],[54,884],[884,743],[743,1832],[1832,1710],[1710,410],[410,1916],[1916,1045],[1045,1010],[1010,443],[443,15],[15,1247],[1247,1788],[1788,55],[55,549],[549,1232],[1232,1416],[1416,225],[225,8],[8,1529],[1529,1148],[1148,353],[353,1860],[1860,376],[376,531],[531,339],[339,418],[418,250],[250,733],[733,325],[325,258],[258,599],[599,951],[951,1730],[1730,959],[959,1658],[1658,331],[331,571],[571,1319],[1319,1762],[1762,551],[551,269],[269,1363],[1363,261],[261,121],[121,837],[837,842],[842,961],[961,1688],[1688,808],[808,1137],[1137,1143],[1143,220],[220,1990],[1990,1760],[1760,760],[760,1114],[1114,1164],[1164,1493],[1493,921],[921,1870],[1870,496],[496,731],[731,1767],[1767,1759],[1759,1499],[1499,1068],[1068,697],[697,914],[914,1169],[1169,1296],[1296,190],[190,1405],[1405,474],[474,435],[435,192],[192,149],[149,412],[412,1151],[1151,494],[494,1379],[1379,1020],[1020,1295],[1295,1233],[1233,608],[608,145],[145,74],[74,1246],[1246,846],[846,438],[438,263],[263,1167],[1167,1534],[1534,895],[895,1820],[1820,1282],[1282,1936],[1936,582],[582,1474],[1474,1285],[1285,396],[396,120],[120,698],[698,1407],[1407,1071],[1071,593],[593,944],[944,1197],[1197,1947],[1947,1161],[1161,938],[938,1796],[1796,340],[340,1470],[1470,971],[971,1376],[1376,1989],[1989,1107],[1107,1092],[1092,197],[197,1039],[1039,1480],[1480,215],[215,1445],[1445,1052],[1052,1420],[1420,1739],[1739,525],[525,1854],[1854,1257],[1257,937],[937,165],[165,1033],[1033,1212],[1212,568],[568,763],[763,313],[313,1681],[1681,1653],[1653,1637],[1637,207],[207,1264],[1264,953],[953,1580],[1580,415],[415,388],[388,110],[110,168],[168,1562],[1562,1944],[1944,822],[822,897],[897,1447],[1447,1355],[1355,871],[871,1812],[1812,1075],[1075,1076],[1076,161],[161,656],[656,1356],[1356,1294],[1294,203],[203,10],[10,383],[383,236],[236,1100],[1100,1317],[1317,294],[294,1348],[1348,1089],[1089,302],[302,209],[209,1279],[1279,1369],[1369,572],[572,1095],[1095,1975],[1975,64],[64,95],[95,1814],[1814,725],[725,1611],[1611,1783],[1783,1130],[1130,1334],[1334,1639],[1639,275],[275,759],[759,463],[463,689],[689,227],[227,1806],[1806,1971],[1971,975],[975,1828],[1828,1557],[1557,1889],[1889,1188],[1188,501],[501,1406],[1406,291],[291,968],[968,366],[366,1003],[1003,1135],[1135,1623],[1623,589],[589,488],[488,1366],[1366,1781],[1781,51],[51,610],[610,526],[526,135],[135,747],[747,1962],[1962,1192],[1192,312],[312,1134],[1134,349],[349,912],[912,732],[732,1908],[1908,1394],[1394,1723],[1723,820],[820,616],[616,926],[926,1773],[1773,624],[624,868],[868,660],[660,563],[563,1942],[1942,1883],[1883,319],[319,1619],[1619,39],[39,1465],[1465,962],[962,1160],[1160,606],[606,406],[406,1839],[1839,711],[711,58],[58,1021],[1021,775],[775,1339],[1339,38],[38,231],[231,1925],[1925,119],[119,1881],[1881,1829],[1829,532],[532,1128],[1128,561],[561,41],[41,533],[533,1735],[1735,802],[802,32],[32,858],[858,1640],[1640,459],[459,1907],[1907,1318],[1318,875],[875,1195],[1195,545],[545,1566],[1566,1514],[1514,958],[958,1484],[1484,1550],[1550,1196],[1196,1869],[1869,35],[35,228],[228,217],[217,950],[950,1165],[1165,1594],[1594,502],[502,444],[444,1900],[1900,337],[337,1088],[1088,635],[635,84],[84,1974],[1974,471],[471,94],[94,676],[676,178],[178,1793],[1793,48],[48,73],[73,1409],[1409,1523],[1523,734],[734,191],[191,382],[382,577],[577,642],[642,899],[899,1186],[1186,1711],[1711,965],[965,56],[56,1670],[1670,1868],[1868,580],[580,268],[268,436],[436,1001],[1001,212],[212,1238],[1238,514],[514,1185],[1185,1857],[1857,1732],[1732,1897],[1897,432],[432,1096],[1096,1393],[1393,1597],[1597,516],[516,1664],[1664,163],[163,1305],[1305,326],[326,748],[748,1549],[1549,922],[922,1937],[1937,1635],[1635,787],[787,575],[575,1244],[1244,693],[693,735],[735,369],[369,1533],[1533,427],[427,1111],[1111,892],[892,1512],[1512,681],[681,774],[774,1570],[1570,807],[807,141],[141,1700],[1700,1939],[1939,1755],[1755,17],[17,1938],[1938,1200],[1200,1761],[1761,1722],[1722,1168],[1168,1098],[1098,780],[780,714],[714,1604],[1604,343],[343,1631],[1631,433],[433,1449],[1449,293],[293,515],[515,1572],[1572,103],[103,1790],[1790,408],[408,1819],[1819,1287],[1287,860],[860,557],[557,910],[910,105],[105,283],[283,1583],[1583,174],[174,559],[559,1155],[1155,804],[804,611],[611,1923],[1923,1173],[1173,613],[613,761],[761,1853],[1853,913],[913,1113],[1113,1738],[1738,766],[766,194],[194,1675],[1675,1876],[1876,1696],[1696,649],[649,829],[829,583],[583,946],[946,1515],[1515,658],[658,1227],[1227,1124],[1124,1453],[1453,416],[416,1544],[1544,667],[667,1555],[1555,1522],[1522,736],[736,1132],[1132,1538],[1538,290],[290,1933],[1933,1343],[1343,1490],[1490,864],[864,1150],[1150,221],[221,853],[853,264],[264,607],[607,1106],[1106,1325],[1325,700],[700,1120],[1120,1613],[1613,1521],[1521,122],[122,1189],[1189,175],[175,205],[205,1360],[1360,1708],[1708,1617],[1617,1750],[1750,1530],[1530,113],[113,854],[854,1707],[1707,504],[504,1162],[1162,907],[907,24],[24,481],[481,902],[902,1374],[1374,588],[588,587],[587,877],[877,1577],[1577,682],[682,1505],[1505,564],[564,630],[630,439],[439,1043],[1043,702],[702,1569],[1569,1553],[1553,527],[527,138],[138,1777],[1777,1694],[1694,724],[724,569],[569,1841],[1841,812],[812,574],[574,1744],[1744,1492],[1492,1669],[1669,1327],[1327,1308],[1308,1237],[1237,769],[769,304],[304,1444],[1444,1115],[1115,242],[242,1062],[1062,948],[948,1353],[1353,1270],[1270,1622],[1622,552],[552,1496],[1496,1748],[1748,159],[159,542],[542,739],[739,1025],[1025,1510],[1510,1400],[1400,1408],[1408,1867],[1867,991],[991,830],[830,1008],[1008,715],[715,553],[553,1320],[1320,1729],[1729,1262],[1262,1061],[1061,182],[182,1654],[1654,238],[238,1154],[1154,709],[709,1686],[1686,663],[663,633],[633,1462],[1462,1593],[1593,579],[579,1690],[1690,987],[987,267],[267,614],[614,1999],[1999,1365],[1365,91],[91,1927],[1927,1002],[1002,479],[479,1987],[1987,768],[768,153],[153,993],[993,156],[156,1438],[1438,1081],[1081,1596],[1596,30],[30,1913],[1913,497],[497,1],[1,1539],[1539,1219],[1219,845],[845,338],[338,1885],[1885,387],[387,1023],[1023,744],[744,1630],[1630,106],[106,1292],[1292,286],[286,1915],[1915,919],[919,45],[45,889],[889,706],[706,1255],[1255,506],[506,1831],[1831,1661],[1661,1221],[1221,166],[166,1194],[1194,952],[952,677],[677,1847],[1847,1423],[1423,1397],[1397,76],[76,303],[303,1946],[1946,1229],[1229,799],[799,1527],[1527,451],[451,1887],[1887,287],[287,523],[523,1441],[1441,1060],[1060,1698],[1698,1540],[1540,476],[476,13],[13,578],[578,1737],[1737,211],[211,229],[229,1241],[1241,1417],[1417,839],[839,1771],[1771,1765],[1765,1313],[1313,1422],[1422,818],[818,1607],[1607,623],[623,1431],[1431,112],[112,1036],[1036,1878],[1878,237],[237,1543],[1543,1482],[1482,908],[908,307],[307,368],[368,1146],[1146,834],[834,1504],[1504,1268],[1268,521],[521,1650],[1650,819],[819,651],[651,1551],[1551,0],[0,133],[133,1567],[1567,1304],[1304,1994],[1994,765],[765,1090],[1090,308],[308,222],[222,1966],[1966,2],[2,1290],[1290,678],[678,1477],[1477,1193],[1193,1754],[1754,1403],[1403,1163],[1163,1922],[1922,1210],[1210,530],[530,1032],[1032,1391],[1391,1278],[1278,1588],[1588,316],[316,1667],[1667,300],[300,395],[395,63],[63,918],[918,47],[47,272],[272,495],[495,848],[848,1663],[1663,1727],[1727,601],[601,1361],[1361,498],[498,1574],[1574,941],[941,1757],[1757,1457],[1457,1040],[1040,485],[485,878],[878,1864],[1864,323],[323,1201],[1201,1811],[1811,1473],[1473,1621],[1621,1858],[1858,1078],[1078,1335],[1335,684],[684,1756],[1756,367],[367,1303],[1303,1590],[1590,1764],[1764,524],[524,426],[426,1415],[1415,1340],[1340,1082],[1082,916],[916,1176],[1176,1311],[1311,1614],[1614,751],[751,1333],[1333,1906],[1906,1684],[1684,1377],[1377,477],[477,1589],[1589,85],[85,1125],[1125,157],[157,1140],[1140,1315],[1315,1338],[1338,359],[359,1136],[1136,244],[244,1158],[1158,150],[150,1411],[1411,1245],[1245,1371],[1371,1250],[1250,1794],[1794,847],[847,1502],[1502,381],[381,42],[42,295],[295,632],[632,1963],[1963,1475],[1475,692],[692,1336],[1336,1006],[1006,25],[25,770],[770,567],[567,704],[704,345],[345,254],[254,1211],[1211,160],[160,995],[995,397],[397,992],[992,1980],[1980,187],[187,1086],[1086,801],[801,1271],[1271,1047],[1047,1511],[1511,1843],[1843,792],[792,1038],[1038,464],[464,59],[59,1769],[1769,643],[643,753],[753,52],[52,1957],[1957,974],[974,1662],[1662,1497],[1497,1559],[1559,75],[75,1424],[1424,70],[70,80],[80,430],[430,208],[208,1460],[1460,584],[584,346],[346,358],[358,1301],[1301,629],[629,1404],[1404,1625],[1625,894],[894,776],[776,378],[378,1602],[1602,1410],[1410,282],[282,21],[21,6],[6,1207],[1207,458],[458,409],[409,1632],[1632,1500],[1500,1659],[1659,1495],[1495,779],[779,377],[377,179],[179,1050],[1050,1714],[1714,364],[364,1469],[1469,881],[881,424],[424,489],[489,389],[389,1203],[1203,213],[213,641],[641,143],[143,1433],[1433,1488],[1488,535],[535,1452],[1452,167],[167,226],[226,1652],[1652,647],[647,460],[460,499],[499,872],[872,1133],[1133,1064],[1064,1516],[1516,1791],[1791,882],[882,452],[452,53],[53,778],[778,1184],[1184,547],[547,505],[505,900],[900,1943],[1943,125],[125,1780],[1780,1894],[1894,1634],[1634,1324],[1324,679],[679,1856],[1856,1649],[1649,863],[863,536],[536,1051],[1051,107],[107,1300],[1300,1531],[1531,204],[204,1289],[1289,37],[37,1547],[1547,43],[43,1491],[1491,223],[223,1063],[1063,929],[929,1934],[1934,522],[522,600],[600,172],[172,544],[544,1928],[1928,71],[71,1170],[1170,1629],[1629,1236],[1236,279],[279,1918],[1918,1101],[1101,1016],[1016,749],[749,1862],[1862,602],[602,827],[827,1685],[1685,342],[342,1787],[1787,672],[672,985],[985,1456],[1456,664],[664,1598],[1598,1850],[1850,1924],[1924,352],[352,1199],[1199,1252],[1252,1436],[1436,1656],[1656,1807],[1807,942],[942,619],[619,116],[116,1985],[1985,1556],[1556,1581],[1581,879],[879,981],[981,186],[186,570],[570,737],[737,1528],[1528,786],[786,1070],[1070,234],[234,440],[440,1293],[1293,1117],[1117,193],[193,1220],[1220,1129],[1129,1418],[1418,1618],[1618,384],[384,1269],[1269,108],[108,1833],[1833,199],[199,233],[233,19],[19,360],[360,798],[798,214],[214,465],[465,5],[5,9],[9,1840],[1840,1388],[1388,690],[690,817],[817,1508],[1508,1142],[1142,403],[403,1903],[1903,36],[36,86],[86,898],[898,1695],[1695,1909],[1909,1891],[1891,1752],[1752,528],[528,1222],[1222,1859],[1859,1015],[1015,441],[441,949],[949,1330],[1330,716],[716,1382],[1382,1713],[1713,1463],[1463,1235],[1235,1917],[1917,1712],[1712,1458],[1458,1123],[1123,1898],[1898,289],[289,1578],[1578,1846],[1846,1789],[1789,1665],[1665,1009],[1009,990],[990,790],[790,1736],[1736,973],[973,453],[453,1177],[1177,674],[674,1537],[1537,1689],[1689,196],[196,832],[832,935],[935,940],[940,445],[445,518],[518,1139],[1139,265],[265,1973],[1973,828],[828,1967],[1967,1309],[1309,1242],[1242,1373],[1373,1554],[1554,782],[782,1565],[1565,659],[659,1149],[1149,1716],[1716,72],[72,98],[98,1276],[1276,983],[983,305],[305,867],[867,862],[862,594],[594,1948],[1948,1354],[1354,1138],[1138,447],[447,805],[805,1998],[1998,1084],[1084,603],[603,134],[134,1825],[1825,617],[617,1992],[1992,979],[979,1053],[1053,814],[814,1804],[1804,1561],[1561,1835],[1835,911],[911,1341],[1341,341],[341,1489],[1489,334],[334,712],[712,1297],[1297,1383],[1383,648],[648,50],[50,1067],[1067,1048],[1048,1633],[1633,151],[151,943],[943,1022],[1022,7],[7,1816],[1816,788],[788,861],[861,988],[988,1234],[1234,1952],[1952,1715],[1715,1283],[1283,446],[446,1703],[1703,923],[923,255],[255,1119],[1119,357],[357,1930],[1930,173],[173,1281],[1281,1644],[1644,605],[605,1019],[1019,1286],[1286,638],[638,891],[891,29],[29,519],[519,1532],[1532,1519],[1519,1087],[1087,581],[581,1981],[1981,336],[336,785],[785,1205],[1205,989],[989,1817],[1817,512],[512,592],[592,1838],[1838,977],[977,1049],[1049,320],[320,880],[880,823],[823,1643],[1643,1996],[1996,100],[100,111],[111,344],[344,781]] numCourses, prerequisites = 1000, [[867,339],[741,322],[467,399],[836,393],[923,753],[374,63],[728,656],[184,108],[556,36],[802,257],[548,140],[686,532],[524,111],[796,351],[767,621],[846,701],[573,479],[608,462],[485,70],[675,669],[705,675],[140,60],[950,874],[621,236],[622,172],[947,441],[511,504],[506,176],[797,217],[312,256],[513,253],[579,339],[933,931],[888,580],[349,269],[960,374],[316,207],[399,109],[599,7],[42,17],[921,884],[616,590],[478,368],[928,526],[841,338],[872,621],[882,656],[601,160],[875,27],[88,44],[912,270],[538,510],[769,99],[377,293],[364,121],[944,847],[940,569],[758,686],[330,59],[816,303],[993,335],[480,127],[650,28],[469,57],[892,518],[745,230],[813,148],[130,6],[868,770],[515,492],[433,330],[735,497],[401,139],[955,384],[499,124],[947,107],[478,203],[570,179],[765,347],[269,158],[348,340],[982,211],[631,99],[467,339],[573,213],[346,200],[729,666],[785,367],[840,30],[764,137],[955,476],[972,816],[714,284],[322,16],[935,808],[581,310],[634,291],[960,159],[371,59],[682,642],[613,67],[971,356],[830,355],[585,237],[630,197],[300,277],[313,223],[310,280],[923,718],[895,839],[671,238],[722,668],[883,491],[996,873],[591,437],[954,628],[796,582],[986,191],[927,831],[699,680],[870,466],[899,576],[530,488],[861,396],[779,477],[701,442],[693,525],[673,423],[844,114],[987,24],[723,226],[479,194],[754,338],[623,280],[203,83],[882,192],[758,320],[490,268],[914,14],[733,489],[873,589],[672,212],[734,279],[844,66],[969,812],[577,153],[349,316],[941,344],[668,508],[834,343],[767,592],[131,17],[479,420],[472,224],[940,680],[629,569],[904,666],[845,822],[675,180],[85,73],[578,81],[694,535],[611,367],[593,82],[687,633],[622,75],[444,25],[457,25],[896,361],[667,541],[693,671],[985,88],[871,93],[829,423],[621,103],[785,416],[941,261],[491,382],[729,554],[902,298],[342,324],[673,319],[800,276],[949,772],[905,642],[453,421],[566,367],[233,104],[202,87],[734,137],[922,408],[823,157],[614,72],[491,294],[669,564],[377,372],[431,412],[702,347],[431,311],[875,386],[389,105],[664,411],[726,56],[513,478],[838,721],[499,235],[371,125],[607,552],[386,81],[514,402],[692,464],[433,243],[895,197],[734,164],[964,298],[632,131],[697,166],[814,45],[690,623],[986,368],[556,240],[410,105],[731,360],[174,120],[815,484],[535,51],[637,83],[770,703],[442,159],[853,761],[887,73],[447,375],[981,656],[852,178],[645,269],[425,386],[645,596],[789,459],[606,28],[578,80],[486,397],[735,333],[938,696],[558,132],[615,188],[666,60],[156,68],[646,469],[841,826],[925,89],[832,256],[801,702],[696,315],[329,284],[673,179],[620,503],[895,5],[953,517],[671,64],[906,811],[623,113],[597,410],[798,332],[819,168],[802,387],[498,407],[922,522],[705,699],[861,599],[395,85],[315,237],[726,382],[704,199],[514,477],[967,920],[383,219],[617,520],[583,40],[671,222],[461,407],[562,98],[977,688],[907,127],[953,610],[518,329],[435,23],[117,47],[747,730],[920,461],[998,359],[929,621],[987,520],[303,122],[735,283],[754,216],[724,518],[432,327],[834,132],[534,406],[835,154],[986,298],[619,511],[920,862],[983,643],[770,247],[178,71],[895,128],[842,213],[682,315],[474,278],[621,440],[954,810],[773,162],[298,192],[834,784],[862,160],[611,370],[341,246],[488,313],[984,873],[406,245],[641,571],[893,472],[208,70],[329,147],[996,328],[566,181],[585,434],[222,51],[850,375],[933,311],[998,991],[931,694],[975,300],[961,280],[512,41],[945,84],[823,88],[397,187],[108,77],[750,33],[928,65],[456,223],[997,0],[992,943],[262,74],[936,196],[243,203],[649,285],[580,204],[748,683],[568,32],[434,430],[937,173],[602,190],[407,65],[874,624],[374,19],[290,155],[854,288],[702,78],[329,314],[669,440],[964,40],[577,296],[743,682],[612,487],[822,624],[166,79],[564,199],[318,101],[909,72],[933,373],[413,96],[240,20],[440,323],[638,533],[527,518],[407,280],[952,949],[730,385],[512,365],[603,254],[396,205],[864,142],[309,104],[515,81],[851,748],[812,667],[515,233],[581,304],[666,550],[759,423],[933,682],[894,656],[387,1],[722,81],[561,247],[864,61],[265,228],[496,70],[674,428],[894,133],[868,695],[754,436],[951,499],[987,218],[963,562],[349,256],[890,158],[818,430],[924,791],[667,508],[244,186],[861,351],[869,605],[638,200],[224,94],[877,137],[867,335],[691,158],[406,384],[220,115],[728,240],[914,413],[817,333],[951,739],[829,435],[843,837],[681,632],[829,71],[296,166],[712,388],[900,271],[223,63],[698,420],[811,676],[827,362],[996,188],[584,313],[977,269],[509,94],[824,310],[704,660],[359,141],[396,374],[611,513],[450,160],[745,344],[849,318],[602,204],[958,484],[977,193],[882,149],[709,343],[859,368],[847,417],[455,28],[540,184],[673,423],[232,67],[528,502],[780,71],[785,186],[988,883],[908,451],[668,542],[794,150],[155,145],[994,226],[848,692],[660,106],[735,385],[929,448],[637,45],[907,16],[564,26],[985,451],[621,515],[806,435],[925,193],[454,81],[140,99],[933,695],[637,479],[489,287],[705,638],[914,419],[876,711],[892,29],[409,99],[674,440],[583,198],[341,199],[664,161],[925,225],[790,532],[763,135],[795,564],[204,186],[931,17],[684,553],[199,45],[882,645],[752,313],[568,431],[794,601],[979,512],[577,520],[36,28],[704,509],[923,399],[817,752],[930,412],[857,775],[899,200],[855,299],[410,216],[245,127],[873,42],[260,34],[929,456],[739,144],[927,639],[702,381],[370,199],[361,340],[119,116],[209,119],[963,404],[933,21],[970,876],[433,336],[719,373],[998,884],[985,821],[549,271],[532,149],[549,142],[586,420],[895,660],[662,164],[402,146],[804,257],[876,652],[843,792],[693,259],[548,46],[905,750],[436,90],[564,283],[676,671],[373,341],[585,306],[865,282],[329,57],[903,821],[925,403],[809,227],[804,64],[658,505],[884,13],[455,92],[632,191],[909,506],[507,361],[802,361],[931,882],[292,86],[591,458],[439,425],[421,200],[802,552],[748,144],[773,2],[120,42],[573,415],[830,808],[846,355],[981,442],[520,146],[881,735],[877,686],[436,372],[923,727],[455,131],[863,239],[913,67],[864,800],[973,968],[157,50],[983,783],[903,270],[97,40],[441,18],[709,45],[598,168],[844,626],[244,136],[803,376],[126,125],[603,284],[796,752],[978,672],[561,376],[844,737],[580,177],[807,613],[647,598],[885,76],[565,286],[901,722],[908,32],[840,487],[885,238],[758,580],[451,207],[992,96],[546,62],[573,493],[505,35],[897,664],[491,76],[996,885],[864,240],[988,89],[870,368],[455,391],[512,384],[819,486],[758,461],[869,533],[701,584],[187,70],[677,40],[957,534],[754,479],[885,106],[710,34],[191,49],[886,80],[831,224],[301,135],[832,658],[960,184],[323,304],[853,599],[419,1],[508,285],[983,117],[901,669],[859,134],[605,406],[518,448],[242,115],[951,139],[606,7],[665,535],[935,539],[549,422],[941,300],[677,288],[256,128],[382,87],[517,64],[767,123],[976,718],[602,279],[970,805],[975,641],[871,177],[670,546],[374,215],[948,382],[403,144],[206,123],[783,579],[942,373],[811,386],[512,453],[144,51],[947,525],[743,363],[937,416],[410,396],[718,458],[383,123],[708,327],[753,378],[849,120],[973,789],[765,574],[323,276],[507,492],[718,435],[770,143],[789,661],[447,330],[486,369],[960,934],[696,539],[822,166],[464,178],[554,141],[814,35],[877,454],[922,82],[318,211],[995,202],[666,248],[753,378],[655,295],[945,772],[962,691],[883,168],[461,437],[666,245],[727,282],[465,292],[885,278],[562,232],[863,90],[786,638],[479,75],[791,585],[995,698],[906,184],[977,450],[948,275],[810,576],[479,429],[488,441],[881,702],[997,825],[340,309],[445,107],[715,137],[984,724],[818,814],[563,300],[678,150],[632,12],[313,281],[551,380],[450,420],[97,70],[994,952],[986,166],[914,729],[953,584],[983,556],[276,153],[872,415],[775,313],[568,429],[87,79],[598,229],[710,454],[989,305],[540,191],[672,74],[926,795],[857,161],[577,219],[650,572],[909,889],[796,587],[686,665],[367,27],[782,606],[433,214],[799,403],[973,176],[310,40],[573,273],[986,829],[535,342],[587,564],[923,48],[893,624],[536,273],[568,474],[530,181],[809,568],[499,189],[717,203],[391,250],[944,160],[841,430],[821,652],[395,32],[854,15],[916,646],[963,839],[912,325],[951,931],[652,22],[803,161],[742,480],[592,339],[713,471],[188,133],[506,463],[751,531],[915,754],[899,342],[959,247],[992,182],[629,522],[823,61],[575,336],[929,258],[566,482],[809,563],[754,233],[931,432],[574,278],[628,234],[307,247],[752,253],[790,265],[853,560],[852,850],[444,106],[927,638],[953,233],[638,273],[467,212],[888,17],[756,696],[609,119],[772,2],[944,474],[513,484],[989,168],[593,432],[957,885],[923,906],[479,451],[298,180],[930,928],[606,566],[673,59],[962,762],[932,224],[978,946],[432,83],[942,167],[918,247],[520,154],[957,288],[868,566],[762,467],[165,35],[751,451],[960,946],[563,474],[892,262],[872,638],[735,68],[491,477],[727,397],[804,620],[913,223],[641,166],[561,232],[561,539],[716,240],[701,437],[541,383],[361,217],[705,413],[835,556],[659,30],[511,252],[500,125],[314,95],[936,626],[786,451],[314,226],[324,173],[866,56],[813,9],[715,109],[503,289],[511,374],[525,333],[734,553],[771,28],[643,250],[987,908],[445,259],[888,453],[669,361],[536,303],[798,493],[881,594],[832,177],[912,834],[797,367],[725,686],[230,226],[960,556],[705,401],[711,598],[897,500],[890,538],[661,258],[358,283],[898,259],[857,733],[411,184],[765,156],[313,32],[517,452],[575,246],[199,72],[939,275],[796,384],[887,275],[986,310],[662,572],[276,13],[323,25],[747,504],[931,144],[411,46],[227,192],[694,199],[90,12],[516,72],[937,18],[614,563],[948,373],[437,398],[356,224],[173,126],[596,309],[754,436],[399,30],[682,406],[938,774],[994,300],[273,70],[423,367],[917,781],[745,538],[522,142],[689,611],[46,44],[627,142],[614,487],[488,393],[761,78],[29,12],[994,385],[557,272],[818,302],[700,606],[255,64],[588,353],[843,221],[596,485],[719,669],[618,109],[564,59],[747,392],[349,322],[686,407],[261,80],[805,102],[835,33],[931,759],[949,782],[302,215],[679,660],[803,474],[939,100],[75,5],[989,958],[490,54],[797,32],[674,173],[796,329],[571,69],[850,196],[579,487],[395,191],[611,287],[917,65],[912,155],[694,640],[940,848],[973,511],[752,732],[814,429],[938,109],[956,611],[936,675],[625,190],[999,218],[846,813],[414,13],[786,380],[505,385],[887,515],[62,8],[915,496],[532,265],[660,646],[637,414],[120,83],[676,538],[581,35],[737,720],[830,188],[710,257],[449,150],[983,106],[964,184],[516,62],[799,678],[823,286],[677,370],[214,93],[723,183],[945,135],[930,603],[829,200],[909,218],[174,49],[802,337],[719,659],[955,399],[681,543],[580,542],[49,26],[736,368],[779,101],[688,283],[868,68],[785,613],[209,74],[833,511],[731,595],[853,760],[458,426],[503,26],[922,606],[589,125],[136,13],[725,396],[224,128],[616,52],[255,224],[924,197],[710,273],[459,76],[478,266],[802,199],[416,21],[942,921],[974,520],[740,23],[938,468],[632,325],[957,579],[301,213],[544,99],[777,676],[686,367],[481,239],[895,549],[399,83],[94,67],[99,0],[355,203],[494,448],[447,249],[704,267],[740,320],[777,270],[385,197],[615,564],[983,755],[941,549],[675,178],[418,305],[882,532],[681,106],[536,464],[832,84],[859,763],[998,845],[888,600],[737,545],[939,713],[993,152],[811,468],[449,88],[599,496],[601,340],[960,288],[846,494],[609,232],[426,165],[409,361],[581,30],[446,50],[319,79],[883,200],[811,359],[669,502],[940,833],[671,206],[651,357],[708,387],[681,494],[464,335],[967,785],[907,678],[695,560],[566,73],[670,447],[828,358],[914,49],[931,285],[521,98],[415,271],[364,225],[380,328],[153,50],[651,235],[690,680],[265,52],[285,59],[847,460],[571,256],[522,409],[969,635],[579,559],[114,104],[964,770],[965,119],[548,367],[879,570],[508,170],[757,80],[780,346],[953,908],[795,772],[711,439],[907,20],[794,98],[864,506],[762,428],[768,575],[335,118],[914,104],[762,283],[840,433],[329,91],[638,132],[431,89],[543,19],[685,102],[525,318],[608,234],[814,502],[312,140],[934,399],[827,16],[460,369],[957,291],[967,30],[837,433],[868,256],[930,622],[290,164],[961,335],[830,595],[910,382],[901,865],[561,205],[421,398],[908,137],[711,95],[800,173],[564,521],[678,124],[319,41],[966,823],[813,169],[733,42],[640,451],[566,532],[797,101],[786,90],[995,608],[688,25],[422,367],[336,293],[557,103],[426,57],[356,244],[398,367],[250,171],[823,156],[891,836],[770,114],[825,322],[293,62],[816,222],[606,207],[691,544],[926,205],[950,573],[211,64],[821,157],[953,25],[681,349],[141,39],[807,750],[447,228],[315,310],[765,175],[991,52],[911,643],[835,13],[601,370],[937,491],[897,761],[933,519],[953,638],[986,786],[450,181],[997,834],[772,201],[890,527],[581,243],[482,199],[454,128],[209,56],[783,450],[639,615],[743,171],[529,134],[873,866],[916,309],[850,254],[859,150],[751,617],[455,36],[958,363],[771,457],[923,635],[509,108],[687,485],[786,594],[881,254],[901,591],[603,197],[525,483],[847,577],[559,539],[744,129],[868,334],[907,442],[359,231],[972,273],[363,123],[808,63],[551,544],[741,514],[536,420],[979,244],[602,40],[800,659],[296,195],[720,205],[295,46],[233,95],[519,393],[991,599],[961,835],[297,13],[225,146],[723,716],[998,429],[185,176],[805,717],[930,201],[213,164],[958,596],[158,35],[918,342],[777,713],[343,278],[289,141],[920,148],[714,215],[857,653],[568,400],[347,217],[859,563],[899,189],[599,147],[809,604],[426,0],[755,516],[386,88],[458,199],[674,87],[760,592],[949,363],[672,192],[282,188],[826,335],[683,648],[288,28],[871,849],[703,79],[698,249],[486,378],[661,217],[793,449],[419,412],[888,407],[368,242],[224,25],[947,153],[454,11],[875,437],[661,423],[975,62],[453,46],[579,328],[780,280],[934,462],[735,611],[681,152],[988,893],[978,256],[604,326],[405,302],[762,507],[518,245],[408,92],[833,752],[947,771],[575,133],[699,411],[782,150],[713,642],[392,355],[457,7],[623,275],[769,618],[933,491],[647,483],[781,223],[783,337],[549,475],[782,276],[229,155],[710,708],[937,128],[391,315],[456,303],[628,385],[719,130],[673,448],[812,56],[881,58],[721,588],[713,80],[918,459],[936,650],[701,25],[671,115],[911,784],[784,94],[624,306],[555,8],[885,864],[565,166],[827,413],[366,79],[250,77],[502,145],[545,196],[593,36],[594,434],[560,419],[889,19],[751,217],[686,276],[644,337],[346,11],[369,25],[976,178],[986,983],[681,396],[875,507],[964,389],[677,151],[779,335],[874,246],[801,216],[617,188],[511,204],[545,519],[426,397],[418,384],[424,49],[702,448],[496,326],[969,858],[640,152],[270,121],[724,113],[210,127],[941,445],[818,641],[977,377],[491,401],[690,563],[966,640],[985,170],[990,161],[833,10],[507,103],[837,381],[991,535],[702,28],[162,41],[756,679],[767,577],[820,303],[587,328],[990,588],[463,342],[857,730],[445,279],[598,127],[931,778],[706,669],[408,201],[961,520],[746,641],[838,678],[785,218],[268,181],[413,262],[487,40],[47,42],[585,542],[838,3],[510,338],[392,129],[998,305],[123,53],[960,645],[351,80],[730,429],[974,781],[753,378],[683,167],[706,383],[629,267],[971,905],[667,189],[774,595],[819,422],[728,89],[228,11],[295,257],[909,849],[948,392],[838,759],[447,205],[746,215],[696,259],[800,231],[963,92],[933,828],[744,516],[467,243],[866,581],[506,505],[845,204],[646,426],[777,432],[626,140],[926,831],[463,384],[761,405],[708,488],[583,559],[825,595],[969,479],[956,70],[776,301],[907,582],[183,182],[613,477],[502,369],[357,44],[813,64],[595,419],[786,402],[487,154],[968,263],[915,573],[654,153],[574,185],[623,386],[503,193],[865,369],[794,518],[723,283],[326,188],[860,375],[595,83],[969,398],[811,102],[727,49],[773,59],[938,274],[854,475],[508,429],[74,49],[651,600],[636,358],[776,353],[547,466],[937,598],[720,132],[834,172],[414,282],[872,137],[653,269],[936,527],[776,234],[452,119],[416,345],[839,462],[257,180],[517,342],[526,206],[348,241],[602,390],[428,279],[656,532],[452,367],[129,49],[824,61],[581,564],[748,350],[435,45],[689,273],[276,226],[357,78],[696,206],[821,316],[732,50],[731,438],[584,551],[853,750],[430,202],[899,601],[189,2],[382,76],[579,561],[675,328],[548,499],[857,746],[353,278],[970,105],[963,714],[763,165],[658,566],[974,194],[594,4],[990,472],[643,617],[687,438],[643,410],[539,274],[562,469],[625,331],[648,342],[968,50],[714,651],[683,487],[608,372],[812,411],[958,512],[899,883],[814,595],[727,564],[453,316],[860,349],[568,50],[873,308],[924,660],[865,672],[981,934],[549,368],[961,426],[882,774],[940,67],[471,183],[289,146],[939,114],[390,371],[465,450],[305,95],[539,89],[759,424],[763,231],[660,510],[128,97],[973,404],[546,57],[393,281],[988,301],[73,41],[595,447],[972,191],[201,81],[428,75],[949,855],[657,282],[906,710],[933,124],[414,358],[799,705],[238,37],[974,746],[531,475],[654,301],[937,703],[505,444],[569,544],[923,364],[741,144],[661,390],[248,68],[656,494],[929,924],[387,61],[726,74],[984,155],[538,163],[878,537],[345,59],[568,62],[830,605],[66,14],[518,495],[500,317],[877,312],[296,9],[605,8],[371,12],[993,827],[982,616],[468,155],[465,393],[535,496],[685,94],[510,504],[659,3],[661,166],[293,257],[958,744],[840,342],[913,453],[935,683],[520,264],[717,571],[680,622],[801,374],[437,68],[809,647],[333,268],[874,6],[931,168],[554,439],[535,357],[885,864],[744,336],[211,181],[147,68],[655,385],[877,530],[675,158],[652,100],[663,640],[644,96],[734,562],[418,186],[637,155],[781,131],[335,308],[818,747],[677,245],[978,146],[662,309],[473,221],[672,318],[297,109],[716,530],[841,83],[637,633],[780,78],[468,188],[451,217],[871,228],[299,215],[674,636],[590,179],[646,77],[382,112],[371,344],[892,325],[956,176],[917,73],[562,48],[909,108],[526,485],[924,569],[539,77],[807,618],[366,57],[877,263],[908,253],[891,540],[222,173],[917,499],[868,544],[471,257],[564,265],[821,562],[985,31],[647,610],[946,608],[963,500],[563,64],[838,496],[653,566],[978,933],[563,467],[672,513],[914,531],[688,513],[510,489],[228,76],[938,495],[838,625],[454,249],[915,54],[831,457],[847,105],[361,92],[599,345],[478,266],[599,111],[988,22],[998,724],[735,183],[686,378],[985,194],[746,213],[873,637],[850,481],[566,162],[925,76],[841,373],[626,190],[539,438],[452,266],[527,492],[541,83],[540,80],[324,182],[480,456],[812,416],[575,512],[948,886],[861,535],[687,120],[502,80],[944,36],[806,475],[521,504],[687,632],[343,173],[779,296],[488,105],[236,166],[920,429],[589,327],[506,414],[832,714],[810,706],[962,597],[813,3],[857,90],[627,69],[733,255],[781,119],[63,5],[762,547],[358,296],[538,247],[910,39],[339,35],[950,96],[487,414],[880,193],[987,116],[397,210],[152,30],[922,881],[857,1],[617,407],[630,110],[162,68],[910,903],[989,767],[720,528],[851,684],[591,266],[518,253],[906,134],[518,10],[790,311],[21,16],[845,211],[858,716],[661,304],[625,434],[924,294],[876,361],[629,220],[997,390],[588,50],[670,597],[740,457],[918,253],[926,911],[51,19],[934,199],[441,44],[729,540],[980,115],[384,155],[647,129],[568,46],[997,887],[560,97],[771,666],[229,222],[229,53],[822,662],[522,150],[483,270],[743,716],[187,24],[175,111],[923,127],[779,15],[802,452],[417,27],[158,111],[655,388],[854,93],[858,581],[608,594],[895,485],[853,751],[220,24],[872,17],[954,174],[178,85],[913,475],[931,348],[654,18],[789,292],[228,168],[934,759],[758,72],[833,603],[580,113],[150,69],[784,316],[620,384],[688,309],[918,510],[285,249],[664,325],[561,175],[795,498],[996,903],[897,424],[608,594],[429,34],[889,198],[845,660],[629,236],[485,327],[539,123],[568,79],[553,104],[683,4],[957,716],[912,589],[718,348],[338,161],[276,137],[917,369],[676,227],[905,29],[689,186],[723,106],[818,732],[951,333],[916,841],[771,298],[593,72],[951,873],[994,49],[252,229],[860,173],[736,204],[734,520],[298,282],[359,179],[496,170],[989,245],[927,94],[910,852],[880,663],[129,99],[992,88],[689,303],[937,129],[602,336],[942,31],[831,630],[855,465],[850,768],[343,193],[166,143],[982,577],[410,390],[801,311],[82,46],[643,240],[716,446],[760,313],[842,74],[419,133],[972,210],[869,849],[901,515],[446,331],[499,41],[946,457],[742,537],[948,393],[872,643],[697,648],[931,232],[508,2],[704,145],[802,706],[854,844],[950,748],[865,571],[375,34],[792,320],[553,403],[188,181],[613,538],[348,305],[860,282],[891,311],[736,226],[837,683],[899,140],[722,633],[806,754],[604,101],[952,231],[713,660],[914,70],[606,407],[592,460],[414,142],[619,28],[331,276],[459,145],[386,31],[564,486],[612,29],[366,158],[769,450],[592,25],[768,442],[878,869],[921,326],[816,521],[656,614],[737,637],[906,66],[184,25],[541,168],[620,277],[205,185],[643,26],[459,59],[312,111],[630,383],[805,135],[901,540],[986,384],[812,94],[675,471],[984,390],[888,44],[808,747],[391,388],[847,416],[858,758],[754,704],[697,18],[812,268],[700,132],[868,497],[405,266],[722,517],[569,263],[892,764],[897,129],[960,781],[937,27],[508,83],[295,280],[749,672],[978,762],[705,293],[538,337],[287,213],[879,196],[368,85],[938,801],[910,649],[509,284],[757,358],[650,385],[248,7],[732,185],[931,200],[412,290],[755,451],[817,133],[952,771],[657,335],[495,478],[886,728],[747,642],[579,486],[654,513],[431,82],[862,501],[334,142],[542,252],[399,91],[799,256],[959,861],[810,476],[826,584],[727,715],[676,339],[799,492],[554,508],[912,170],[193,31],[737,387],[845,390],[449,257],[309,46],[611,80],[458,209],[965,328],[814,416],[547,504],[912,375],[785,340],[896,776],[620,301],[278,179],[319,200],[961,676],[667,512],[570,475],[131,70],[601,334],[999,181],[416,355],[571,414],[641,598],[903,588],[341,147],[774,733],[871,550],[170,50],[995,503],[527,381],[967,400],[629,391],[800,660],[760,273],[867,221],[745,203],[865,393],[947,639],[757,280],[593,114],[534,164],[647,549],[700,434],[388,35],[916,624],[424,399],[873,778],[625,115],[464,380],[374,190],[257,251],[435,92],[763,731],[990,730],[780,92],[746,334],[553,361],[221,45],[790,323],[999,315],[396,27],[951,471],[860,28],[671,328],[146,112],[616,310],[945,267],[518,450],[991,609],[842,38],[506,19],[935,154],[673,348],[967,607],[673,618],[901,836],[691,452],[957,538],[892,81],[415,319],[952,829],[480,335],[352,160],[902,310],[579,283],[600,122],[799,559],[521,272],[565,277],[746,649],[875,323],[590,257],[969,298],[502,215],[645,91],[378,271],[242,85],[948,629],[236,165],[843,671],[506,371],[887,401],[893,392],[921,727],[580,169],[206,117],[780,351],[924,57],[913,80],[562,51],[824,529],[342,121],[631,533],[991,856],[693,617],[873,682],[871,258],[675,293],[316,313],[208,39],[986,880],[610,28],[482,351],[456,296],[384,298],[703,14],[938,182],[990,349],[835,309],[793,464],[584,211],[228,30],[701,287],[770,164],[397,331],[678,528],[758,123],[696,204],[994,228],[735,32],[727,261],[946,164],[365,299],[925,316],[459,32],[607,473],[766,734],[112,66],[349,257],[554,154],[985,858],[490,167],[373,132],[303,84],[524,167],[612,70],[939,558],[899,152],[256,104],[432,291],[488,58],[867,148],[919,755],[883,76],[522,472],[569,508],[398,231],[810,153],[144,119],[449,206],[841,94],[641,252],[975,186],[336,284],[745,145],[463,432],[616,131],[249,211],[497,240],[952,445],[829,306],[813,92],[433,125],[713,59],[854,310],[920,851],[112,83],[720,466],[453,413],[145,10],[533,235],[252,43],[870,148],[384,71],[994,693],[819,796],[802,104],[533,468],[274,126],[193,162],[37,35],[815,11],[289,29],[702,355],[310,257],[885,362],[940,920],[992,881],[802,437],[953,517],[933,31],[165,68],[389,328],[359,348],[159,28],[689,212],[845,126],[938,583],[667,177],[398,134],[925,13],[395,13],[725,365],[653,569],[453,257],[763,344],[704,41],[930,41],[560,304],[436,74],[918,263],[853,489],[58,36],[511,210],[867,740],[769,204],[936,628],[882,281],[767,147],[707,678],[960,641],[637,475],[977,843],[375,358],[865,214],[761,573],[626,486],[507,299],[925,714],[932,153],[911,446],[961,439],[985,434],[688,483],[278,217],[951,865],[979,870],[517,252],[590,383],[775,208],[581,230],[951,764],[872,646],[624,122],[684,554],[559,178],[709,514],[658,190],[683,291],[973,101],[848,30],[447,354],[918,367],[994,488],[260,126],[202,51],[723,324],[77,59],[857,717],[441,365],[431,186],[747,399],[988,130],[898,129],[519,228],[515,202],[554,176],[819,446],[905,723],[664,197],[766,570],[905,15],[477,367],[719,86],[829,589],[929,651],[681,88],[953,443],[975,783],[844,274],[600,80],[316,243],[864,395],[196,180],[932,288],[542,66],[924,481],[797,342],[766,669],[800,483],[485,285],[472,285],[672,614],[793,4],[409,353],[363,65],[795,41],[536,458],[692,389],[663,508],[830,55],[682,1],[938,814],[884,698],[905,624],[514,43],[690,387],[690,88],[394,389],[615,105],[643,23],[755,743],[226,147],[832,32],[601,166],[930,585],[978,114],[889,40],[723,649],[509,113],[639,191],[992,384],[980,58],[952,451],[936,872],[905,676],[796,60],[504,289],[616,392],[622,302],[971,467],[747,545],[912,725],[403,212],[590,195],[729,290],[963,522],[716,627],[839,622],[977,465],[800,727],[783,7],[174,100],[923,446],[853,17],[419,149],[847,69],[871,13],[987,858],[538,320],[618,312],[821,296],[913,45],[907,206],[656,445],[735,369],[746,343],[769,52],[953,260],[655,27],[797,200],[911,133],[728,565],[664,612],[836,602],[798,420],[112,17],[748,475],[812,415],[920,796],[769,328],[353,236],[507,117],[988,199],[965,827],[987,733],[855,214],[944,680],[405,165],[426,184],[414,164],[763,347],[602,565],[637,444],[906,364],[917,689],[809,343],[788,548],[502,266],[796,689],[985,284],[707,441],[875,323],[830,10],[840,646],[881,844],[898,62],[735,279],[455,150],[369,282],[933,514],[675,435],[501,203],[267,151],[985,419],[845,456],[598,288],[582,43],[897,302],[993,189],[568,160],[964,520],[714,489],[523,364],[743,647],[338,207],[665,42],[343,50],[234,220],[659,105],[684,238],[917,512],[459,121],[668,659],[953,630],[412,392],[899,450],[993,339],[630,169],[246,88],[920,537],[320,133],[706,6],[646,78],[753,122],[927,441],[306,256],[210,195],[343,170],[936,777],[957,559],[912,34],[745,571],[714,692],[965,291],[723,557],[799,365],[856,214],[794,67],[926,755],[267,82],[843,415],[242,6],[385,56],[609,27],[700,149],[975,68],[719,251],[230,211],[977,365],[437,156],[499,463],[776,243],[365,56],[901,796],[339,141],[671,560],[528,283],[746,605],[594,292],[994,944],[635,518],[704,517],[864,820],[824,313],[737,655],[623,291],[460,342],[979,448],[466,271],[962,449],[571,497],[263,241],[851,126],[759,438],[945,820],[929,591],[766,724],[968,823],[955,447],[722,697],[795,783],[356,267],[960,425],[825,327],[246,101],[852,599],[901,517],[905,45],[310,79],[723,482],[798,698],[985,737],[880,354],[941,680],[295,37],[947,900],[616,226],[553,61],[931,147],[749,102],[537,446],[934,122],[888,427],[565,467],[832,642],[950,768],[791,239],[560,493],[781,226],[368,93],[992,46],[944,526],[339,199],[509,447],[963,542],[580,97],[915,307],[998,383],[596,122],[580,304],[134,59],[816,332],[713,557],[828,468],[949,50],[275,31],[695,18],[752,327],[729,93],[604,29],[858,418],[633,473],[889,454],[745,594],[658,598],[567,117],[939,676],[269,148],[781,174],[711,593],[900,614],[935,474],[188,159],[396,86],[729,699],[897,523],[26,17],[821,161],[935,194],[809,385],[764,196],[743,549],[954,39],[813,70],[471,216],[620,200],[607,418],[586,399],[424,249],[797,355],[224,147],[620,41],[112,36],[625,250],[911,444],[846,10],[994,946],[562,291],[949,21],[427,1],[774,390],[743,711],[963,436],[952,941],[772,156],[428,230],[990,431],[724,558],[226,48],[660,619],[404,260],[699,427],[866,663],[961,595],[614,596],[360,116],[906,393],[844,501],[474,51],[221,132],[69,5],[263,80],[981,761],[836,488],[789,585],[384,286],[700,572],[715,387],[564,13],[239,141],[811,601],[475,417],[331,86],[549,221],[725,294],[101,76],[126,12],[908,295],[738,714],[458,279],[169,78],[830,101],[761,530],[280,77],[868,433],[872,424],[462,175],[385,312],[677,545],[701,222],[801,644],[240,105],[960,212],[984,218],[332,261],[622,609],[861,563],[89,9],[641,487],[682,412],[495,146],[886,283],[544,188],[660,497],[720,685],[755,736],[300,52],[917,527],[847,783],[412,137],[292,84],[892,484],[731,284],[671,393],[596,436],[719,637],[946,580],[876,71],[993,704],[882,410],[997,50],[485,129],[568,348],[839,238],[422,356],[853,187],[595,258],[636,126],[613,18],[917,678],[782,463],[895,802],[333,206],[803,29],[492,203],[810,734],[461,34],[711,49],[575,373],[947,367],[214,2],[604,535],[835,413],[256,175],[637,240],[700,147],[679,211],[749,662],[682,77],[972,545],[493,418],[721,463],[835,622],[352,271],[725,699],[471,189],[829,620],[943,840],[828,589],[666,90],[210,16],[284,201],[888,270],[676,317],[554,153],[797,414],[663,486],[234,57],[604,560],[394,86],[566,474],[922,563],[812,275],[814,312],[728,321],[257,48],[614,345],[834,775],[504,448],[763,294],[330,261],[630,274],[119,14],[485,111],[848,700],[546,322],[973,288],[273,37],[419,288],[577,281],[652,552],[748,93],[656,172],[836,265],[898,446],[159,141],[693,306],[889,822],[956,611],[963,271],[198,40],[699,242],[677,469],[896,526],[85,31],[599,34],[963,274],[707,229],[651,252],[994,114],[713,234],[567,463],[248,64],[179,170],[986,704],[136,113],[608,224],[916,628],[803,394],[829,615],[785,622],[416,361],[864,389],[943,411],[673,101],[625,407],[993,399],[783,333],[520,169],[826,168],[852,839],[836,467],[879,408],[350,27],[952,707],[535,384],[618,483],[578,564],[821,796],[497,331],[872,445],[680,473],[395,368],[653,358],[927,623],[429,13],[604,230],[852,463],[655,175],[522,191],[712,204],[291,240],[76,8],[962,76],[610,546],[877,390],[277,149],[848,12],[819,244],[513,454],[198,104],[583,152],[863,338],[278,90],[871,90],[679,374],[322,46],[482,139],[794,481],[598,553],[377,66],[914,188],[307,166],[673,374],[454,0],[617,186],[261,46],[220,161],[342,289],[818,303],[911,457],[400,297],[832,376],[944,518],[927,90],[580,133],[920,84],[722,77],[923,185],[551,194],[896,798],[495,76],[896,426],[882,195],[561,210],[521,153],[562,185],[902,142],[928,284],[995,263],[655,245],[485,23],[785,180],[936,296],[728,244],[835,517],[877,155],[808,358],[645,617],[758,435],[972,241],[641,391],[660,556],[557,484],[500,101],[838,120],[530,375],[742,135],[630,393],[942,205],[563,197],[435,284],[913,334],[801,727],[717,45],[678,538],[752,659],[378,359],[263,85],[644,593],[853,778],[380,38],[460,251],[419,245],[974,215],[155,96],[361,106],[377,165],[625,110],[617,304],[311,157],[707,108],[391,328],[293,109],[543,238],[267,131],[817,86]] numCourses, prerequisites = 8, [[1,0],[2,6],[1,7],[5,1],[6,4],[7,0],[0,5],[5,1],[6,4]] print Solution().canFinish(numCourses, prerequisites)
720.786667
29,410
0.607392
10,348
54,059
3.172207
0.203711
0.006306
0.001462
0.001279
0.009048
0.004326
0.004326
0.004326
0.004326
0.004326
0
0.584344
0.011524
54,059
75
29,411
720.786667
0.029961
0.026971
0
0.16129
0
0
0.000152
0
0
0
0
0
0
0
null
null
0
0
null
null
0.032258
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
47cf4a3ffcadd9cfc6fd7b0066777fb1e80590d8
107
py
Python
discord_api/__init__.py
tuna2134sub/discord-api.py
471fc9dc26d28e80eac309e5d68c7cd6be4021ed
[ "MIT" ]
1
2021-12-15T08:10:41.000Z
2021-12-15T08:10:41.000Z
discord_api/__init__.py
tasuren/discord-api.py
ead9c2d4bab1251cf781a776d314348405f03c3c
[ "MIT" ]
null
null
null
discord_api/__init__.py
tasuren/discord-api.py
ead9c2d4bab1251cf781a776d314348405f03c3c
[ "MIT" ]
null
null
null
from .client import Client from .command import Command from .embed import Embed from .interaction import *
26.75
28
0.813084
15
107
5.8
0.4
0
0
0
0
0
0
0
0
0
0
0
0.140187
107
4
29
26.75
0.945652
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
47d108d7bc2c0092383f27936bc1d943064dd29f
74
py
Python
Basics/test.py
Jatin-8898/WebScraping
80c576e6611d6d7549ba622133063f0dad780685
[ "MIT" ]
2
2018-10-03T12:58:51.000Z
2019-02-07T13:40:20.000Z
Basics/test.py
Jatin-8898/WebScraping
80c576e6611d6d7549ba622133063f0dad780685
[ "MIT" ]
null
null
null
Basics/test.py
Jatin-8898/WebScraping
80c576e6611d6d7549ba622133063f0dad780685
[ "MIT" ]
1
2021-02-04T19:30:08.000Z
2021-02-04T19:30:08.000Z
print 'Hello World' from selenium import webdriver #webdriver.PhantomJS
14.8
30
0.810811
9
74
6.666667
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.135135
74
5
31
14.8
0.9375
0.256757
0
0
0
0
0.2
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
1
0
5
9a20b9228dd0dcb7d7862e8543855f0b710883b3
173
py
Python
flask_admin/contrib/humbledb/__init__.py
laiyonghao/flask-admin
3d677674bad7298e7e1b668c229a332b22108eed
[ "BSD-3-Clause" ]
null
null
null
flask_admin/contrib/humbledb/__init__.py
laiyonghao/flask-admin
3d677674bad7298e7e1b668c229a332b22108eed
[ "BSD-3-Clause" ]
null
null
null
flask_admin/contrib/humbledb/__init__.py
laiyonghao/flask-admin
3d677674bad7298e7e1b668c229a332b22108eed
[ "BSD-3-Clause" ]
null
null
null
# flake8: noqa try: import humbledb except ImportError: raise Exception('Please install humbledb in order to use humbledb integration') from .view import ModelView
21.625
83
0.768786
22
173
6.045455
0.863636
0
0
0
0
0
0
0
0
0
0
0.007042
0.179191
173
7
84
24.714286
0.929577
0.069364
0
0
0
0
0.377358
0
0
0
0
0
0
1
0
true
0
0.6
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9a49290f87f7b3470bb4c368379492c9c69e4224
217
py
Python
uv_worker/note_app_2.py
k0imet/2020
f4c9de230095dc1460ffdce84a44f8c98468156a
[ "MIT" ]
23
2020-06-14T17:01:16.000Z
2020-07-18T05:45:20.000Z
uv_worker/note_app_2.py
k0imet/2020
f4c9de230095dc1460ffdce84a44f8c98468156a
[ "MIT" ]
null
null
null
uv_worker/note_app_2.py
k0imet/2020
f4c9de230095dc1460ffdce84a44f8c98468156a
[ "MIT" ]
7
2020-06-14T17:01:19.000Z
2020-07-18T05:45:21.000Z
PASSWORD = "Lq#QHMnpyk6Y+.]" def check(selenium_obj, host): current_host = f"http://na2.{host}/" selenium_obj.get(current_host) selenium_obj.add_cookie({'name': 'token', 'value': PASSWORD, 'path': '/'})
27.125
78
0.654378
28
217
4.857143
0.678571
0.242647
0.220588
0
0
0
0
0
0
0
0
0.010695
0.138249
217
7
79
31
0.716578
0
0
0
0
0
0.239631
0
0
0
0
0
0
1
0.2
false
0.4
0
0
0.2
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
7be97e68125e85b76ae160c120c5a4c0d8fb56b8
149
py
Python
hello.py
O-Seok/branch-practice
077cd37d36696bcc760a0bac382f286b37324d32
[ "MIT" ]
null
null
null
hello.py
O-Seok/branch-practice
077cd37d36696bcc760a0bac382f286b37324d32
[ "MIT" ]
null
null
null
hello.py
O-Seok/branch-practice
077cd37d36696bcc760a0bac382f286b37324d32
[ "MIT" ]
null
null
null
print('hello, world !') print('---------------') for v in range(0, 5+1): if v % 2 == 0: print('hello, world !') else: print(v, " is odd")
21.285714
27
0.463087
23
149
3
0.652174
0.289855
0.434783
0
0
0
0
0
0
0
0
0.043478
0.228188
149
7
28
21.285714
0.556522
0
0
0.285714
0
0
0.333333
0
0
0
0
0
0
1
0
false
0
0
0
0
0.571429
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
7bebf44976b43d89da0dd40c2d1f602b66e7bb77
1,203
py
Python
tests/cli/test_site_delete.py
dnimtheory/WordOps
82fc71f5f563df0e4249cc178f768f6cf6c005f6
[ "MIT" ]
2
2019-09-03T03:39:40.000Z
2021-04-22T12:09:50.000Z
tests/cli/test_site_delete.py
BreezeRo/WordOps
3c5cb8ba0ed8d619cddb170386a07102cb385727
[ "MIT" ]
null
null
null
tests/cli/test_site_delete.py
BreezeRo/WordOps
3c5cb8ba0ed8d619cddb170386a07102cb385727
[ "MIT" ]
2
2021-01-02T07:49:51.000Z
2022-03-26T15:58:50.000Z
from wo.utils import test from wo.cli.main import get_test_app class CliTestCaseSite(test.WOTestCase): def test_wo_cli(self): self.app.setup() self.app.run() self.app.close() def test_wo_cli_site_detele(self): self.app = get_test_app(argv=['site', 'delete', 'example1.com', '--no-prompt']) self.app.setup() self.app.run() self.app.close() def test_wo_cli_site_detele_all(self): self.app = get_test_app(argv=['site', 'delete', 'example2.com', '--all', '--no-prompt']) self.app.setup() self.app.run() self.app.close() def test_wo_cli_site_detele_db(self): self.app = get_test_app(argv=['site', 'delete', 'example3.com', '--db', '--no-prompt']) self.app.setup() self.app.run() self.app.close() def test_wo_cli_site_detele_files(self): self.app = get_test_app(argv=['site', 'delete', 'example4.com', '--files', '--no-prompt']) self.app.setup() self.app.run() self.app.close()
30.846154
71
0.519534
149
1,203
3.986577
0.208054
0.223906
0.084175
0.10101
0.723906
0.723906
0.723906
0.723906
0.723906
0.488215
0
0.004938
0.326683
1,203
38
72
31.657895
0.728395
0
0
0.483871
0
0
0.123026
0
0
0
0
0
0
1
0.16129
false
0
0.064516
0
0.258065
0
0
0
0
null
1
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d0108728e1cc7871b95f9ba9621018f017b55f2e
53
py
Python
python/Rose/BinaryAnalysis/Unparser/__init__.py
ouankou/rose
76f2a004bd6d8036bc24be2c566a14e33ba4f825
[ "BSD-3-Clause" ]
488
2015-01-09T08:54:48.000Z
2022-03-30T07:15:46.000Z
python/Rose/BinaryAnalysis/Unparser/__init__.py
WildeGeist/rose
17db6454e8baba0014e30a8ec23df1a11ac55a0c
[ "BSD-3-Clause" ]
174
2015-01-28T18:41:32.000Z
2022-03-31T16:51:05.000Z
python/Rose/BinaryAnalysis/Unparser/__init__.py
WildeGeist/rose
17db6454e8baba0014e30a8ec23df1a11ac55a0c
[ "BSD-3-Clause" ]
146
2015-04-27T02:48:34.000Z
2022-03-04T07:32:53.000Z
from Rose.BinaryAnalysis.Unparser._Unparser import *
26.5
52
0.849057
6
53
7.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.075472
53
1
53
53
0.897959
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d05e22d16bfb06a4c8a857f97e22ede8ac3e0967
318
py
Python
python/20190102/Code/c2.py
Realize0917/career
b5d02ac53cfc3ce3a2ca38d11480c51560283e67
[ "MIT" ]
3
2019-01-17T05:50:51.000Z
2019-03-15T10:10:07.000Z
python/20190102/Code/c2.py
Realize0917/career
b5d02ac53cfc3ce3a2ca38d11480c51560283e67
[ "MIT" ]
10
2019-01-17T06:07:03.000Z
2019-02-19T05:55:25.000Z
python/20190102/Code/c2.py
Realize0917/career
b5d02ac53cfc3ce3a2ca38d11480c51560283e67
[ "MIT" ]
4
2018-12-22T07:32:55.000Z
2019-03-06T09:13:48.000Z
def func(a, word='hello', *para, **kwords): print(type(para)) print(para) for i in para: print(i) def func1(**kwords): print(type(kwords)) print(kwords) for k,v in kwords.items(): print(k,':', v) # 任意函数(装饰器会用到) def func3(*params, **kwords): pass
15.9
43
0.515723
42
318
3.904762
0.5
0.20122
0.182927
0
0
0
0
0
0
0
0
0.009174
0.314465
318
19
44
16.736842
0.743119
0.037736
0
0
0
0
0.019737
0
0
0
0
0
0
1
0.25
false
0.083333
0
0
0.25
0.5
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
1
0
5
d065f7892fa0935102d48f11ea566b9c4d0b965e
3,778
py
Python
maskrcnn_benchmark/data/transforms/build.py
YanhuaCheng/maskrcnn-benchmark
4bdea73f9c12ba11b82be0d51c32a5b2ab3317b9
[ "MIT" ]
null
null
null
maskrcnn_benchmark/data/transforms/build.py
YanhuaCheng/maskrcnn-benchmark
4bdea73f9c12ba11b82be0d51c32a5b2ab3317b9
[ "MIT" ]
null
null
null
maskrcnn_benchmark/data/transforms/build.py
YanhuaCheng/maskrcnn-benchmark
4bdea73f9c12ba11b82be0d51c32a5b2ab3317b9
[ "MIT" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from . import transforms as T def build_transforms(cfg, is_train=True): if is_train: keep_aspect_ratio = cfg.INPUT.KEEP_ASPECT_RATIO min_size = cfg.INPUT.MIN_SIZE_TRAIN max_size = cfg.INPUT.MAX_SIZE_TRAIN flip_prob = cfg.INPUT.FLIP_PROB_TRAIN vertical_flip_prob = cfg.INPUT.VERTICAL_FLIP_PROB_TRAIN flip_90_prob = cfg.INPUT.FLIP_90_PROB_TRAIN crop_prob = cfg.INPUT.CROP_PROB_TRAIN blur_prob = cfg.INPUT.BLUR_PROB_TRAIN contrast_prob = cfg.INPUT.CONTRAST_PROB_TRAIN hsv_prob = cfg.INPUT.HSV_PROB_TRAIN else: keep_aspect_ratio = cfg.INPUT.KEEP_ASPECT_RATIO min_size = cfg.INPUT.MIN_SIZE_TEST max_size = cfg.INPUT.MAX_SIZE_TEST flip_prob = 0 vertical_flip_prob = 0 flip_90_prob = 0 crop_prob = 0 blur_prob = 0 contrast_prob = 0 hsv_prob = 0 to_bgr255 = cfg.INPUT.TO_BGR255 normalize_transform = T.Normalize( mean=cfg.INPUT.PIXEL_MEAN, std=cfg.INPUT.PIXEL_STD, to_bgr255=to_bgr255 ) transform = T.Compose( [ T.RandomValidAreaCrop(crop_prob), T.Resize(min_size, max_size, keep_aspect_ratio), T.Blur(blur_prob), T.ContrastNormalization(contrast_prob), T.ChangeHSV(hsv_prob), T.RandomHorizontalFlip(flip_prob), T.RandomVerticalFlip(vertical_flip_prob), T.RandomRotate90(flip_90_prob), T.ToTensor(), normalize_transform, ] ) return transform def build_transforms_batch(cfg, is_train=True): if is_train: keep_aspect_ratio = cfg.INPUT.KEEP_ASPECT_RATIO min_size = cfg.INPUT.MIN_SIZE_TRAIN max_size = cfg.INPUT.MAX_SIZE_TRAIN flip_prob = cfg.INPUT.FLIP_PROB_TRAIN vertical_flip_prob = cfg.INPUT.VERTICAL_FLIP_PROB_TRAIN flip_90_prob = cfg.INPUT.FLIP_90_PROB_TRAIN crop_prob = cfg.INPUT.CROP_PROB_TRAIN blur_prob = cfg.INPUT.BLUR_PROB_TRAIN contrast_prob = cfg.INPUT.CONTRAST_PROB_TRAIN hsv_prob = cfg.INPUT.HSV_PROB_TRAIN mixup_prob = cfg.INPUT.MIXUP_PROB_TRAIN mixup_alpha = cfg.INPUT.MIXUP_ALPHA aug_bndobj_prob = cfg.INPUT.AUG_BNDOBJ_PROB_TRAIN aug_bndobj_ratio = cfg.INPUT.AUG_BNDOBJ_RATIO else: keep_aspect_ratio = cfg.INPUT.KEEP_ASPECT_RATIO min_size = cfg.INPUT.MIN_SIZE_TEST max_size = cfg.INPUT.MAX_SIZE_TEST flip_prob = 0 vertical_flip_prob = 0 flip_90_prob = 0 crop_prob = 0 blur_prob = 0 contrast_prob = 0 hsv_prob = 0 mixup_prob = 0 mixup_alpha = cfg.INPUT.MIXUP_ALPHA aug_bndobj_prob = 0 aug_bndobj_ratio = cfg.INPUT.AUG_BNDOBJ_RATIO to_bgr255 = cfg.INPUT.TO_BGR255 normalize_transform_batch = T.NormalizeBatch( mean=cfg.INPUT.PIXEL_MEAN, std=cfg.INPUT.PIXEL_STD, to_bgr255=to_bgr255 ) transform_img = T.Compose( [ T.RandomValidAreaCrop(crop_prob), T.Blur(blur_prob), T.ContrastNormalization(contrast_prob), T.ChangeHSV(hsv_prob), T.RandomHorizontalFlip(flip_prob), T.RandomVerticalFlip(vertical_flip_prob), T.RandomRotate90(flip_90_prob), ] ) transform_batch = T.Compose( [ T.ResizeBatch(min_size, max_size, keep_aspect_ratio), T.MixUpBatch(mixup_prob, mixup_alpha), T.AugBndObjBatch(aug_bndobj_prob, aug_bndobj_ratio), T.ToTensorBatch(), normalize_transform_batch, ] ) return transform_img, transform_batch
34.036036
79
0.652991
497
3,778
4.577465
0.136821
0.133626
0.084396
0.031648
0.806154
0.806154
0.806154
0.774066
0.67956
0.643516
0
0.021898
0.274749
3,778
110
80
34.345455
0.808394
0.018264
0
0.666667
0
0
0
0
0
0
0
0
0
1
0.020202
false
0
0.010101
0
0.050505
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d07b4c731c63ee6a5a0a48fcc3dac83d0ef08b05
126
py
Python
dps/hyper/__init__.py
alcinos/dps
5467db1216e9f9089376d2c71f524ced2382e4f6
[ "Apache-2.0" ]
2
2019-12-18T15:32:57.000Z
2020-11-10T00:23:17.000Z
dps/hyper/__init__.py
alcinos/dps
5467db1216e9f9089376d2c71f524ced2382e4f6
[ "Apache-2.0" ]
1
2020-05-02T16:40:59.000Z
2020-05-02T16:40:59.000Z
dps/hyper/__init__.py
alcinos/dps
5467db1216e9f9089376d2c71f524ced2382e4f6
[ "Apache-2.0" ]
3
2019-05-02T15:09:36.000Z
2020-11-15T10:33:19.000Z
from .base import HyperSearch, build_search, build_and_submit, run_experiment from .parallel_session import DEFAULT_HOST_POOL
42
77
0.873016
18
126
5.722222
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.087302
126
2
78
63
0.895652
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d0f4ccff5bd4165e3f07b8b03f7cdf44ef1dd618
111
py
Python
waypy/settings/__init__.py
Waypy/waypy
0e8ae05563f7cd75a84b40577c6dee08802a5ce6
[ "MIT" ]
1
2017-11-20T07:43:05.000Z
2017-11-20T07:43:05.000Z
waypy/settings/__init__.py
Waypy/waypy
0e8ae05563f7cd75a84b40577c6dee08802a5ce6
[ "MIT" ]
1
2021-08-25T16:14:17.000Z
2021-08-25T16:14:17.000Z
waypy/settings/__init__.py
Waypy/waypy
0e8ae05563f7cd75a84b40577c6dee08802a5ce6
[ "MIT" ]
2
2017-09-12T13:00:33.000Z
2017-09-29T07:18:39.000Z
from .base import * from .module import * try: from .unique import * except ModuleNotFoundError: pass
13.875
27
0.702703
13
111
6
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.225225
111
7
28
15.857143
0.906977
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.166667
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
0
0
0
5
ef8370cda4fdd12c896899db07d353fecb89d107
17
py
Python
tests/test1.py
apascoa/Python_Code_Runner
3ccafa73917af595adace354e02e324a6b744d7e
[ "MIT" ]
null
null
null
tests/test1.py
apascoa/Python_Code_Runner
3ccafa73917af595adace354e02e324a6b744d7e
[ "MIT" ]
null
null
null
tests/test1.py
apascoa/Python_Code_Runner
3ccafa73917af595adace354e02e324a6b744d7e
[ "MIT" ]
null
null
null
print("Working1")
17
17
0.764706
2
17
6.5
1
0
0
0
0
0
0
0
0
0
0
0.058824
0
17
1
17
17
0.705882
0
0
0
0
0
0.444444
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
ef843635c116fe57c9ffa3ade8e8236f51d75e2f
45
py
Python
point/__init__.py
bgottula/point
8fa3be51e3e13973555a862c5f9e5b193a796346
[ "MIT" ]
10
2017-03-08T00:49:30.000Z
2019-01-20T23:03:11.000Z
point/__init__.py
bgottula/point
8fa3be51e3e13973555a862c5f9e5b193a796346
[ "MIT" ]
18
2017-08-12T18:34:53.000Z
2019-01-19T03:43:17.000Z
point/__init__.py
bgottula/point
8fa3be51e3e13973555a862c5f9e5b193a796346
[ "MIT" ]
8
2015-01-03T06:08:41.000Z
2018-10-23T18:01:59.000Z
from .nexstar import * from .gemini import *
15
22
0.733333
6
45
5.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.177778
45
2
23
22.5
0.891892
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
ef969bfc0220df907f44029910868da176f0ff7d
130
py
Python
output/models/ms_data/regex/arabic_presentation_forms_a_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/ms_data/regex/arabic_presentation_forms_a_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/ms_data/regex/arabic_presentation_forms_a_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.ms_data.regex.arabic_presentation_forms_a_xsd.arabic_presentation_forms_a import Doc __all__ = [ "Doc", ]
21.666667
103
0.807692
19
130
4.894737
0.736842
0.387097
0.494624
0.516129
0
0
0
0
0
0
0
0
0.107692
130
5
104
26
0.801724
0
0
0
0
0
0.023077
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
efd783a1169660bb2cb805e362460431f37de866
202
py
Python
funboost/utils/develop_log.py
DJMIN/funboost
7570ca2909bb0b44a1080f5f98aa96c86d3da9d4
[ "Apache-2.0" ]
120
2021-12-26T03:27:12.000Z
2022-03-31T16:20:44.000Z
funboost/utils/develop_log.py
mooti-barry/funboost
2cd9530e2c4e5a52fc921070d243d402adbc3a0e
[ "Apache-2.0" ]
18
2021-12-31T06:26:37.000Z
2022-03-31T16:16:33.000Z
funboost/utils/develop_log.py
mooti-barry/funboost
2cd9530e2c4e5a52fc921070d243d402adbc3a0e
[ "Apache-2.0" ]
27
2021-12-26T16:12:31.000Z
2022-03-26T17:43:08.000Z
import nb_log from funboost import funboost_config_deafult #开发时候的调试日志,比print方便通过级别一键屏蔽。 develop_logger = nb_log.get_logger('fsdf_develop', log_level_int=funboost_config_deafult.FSDF_DEVELOP_LOG_LEVEL)
33.666667
112
0.881188
29
202
5.655172
0.517241
0.060976
0.256098
0.231707
0
0
0
0
0
0
0
0
0.059406
202
5
113
40.4
0.863158
0.133663
0
0
0
0
0.068966
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
4bc8fe016f3eacb0f55d72ff66a1a118492fece4
784
py
Python
resource_managers/common/resource_manager_api.py
uhbuhb/habertest-backend
b6306c629e7755121e23b8cdc70846b573eca160
[ "MIT" ]
4
2021-03-10T14:03:31.000Z
2021-11-24T15:29:35.000Z
resource_managers/common/resource_manager_api.py
solganik/habertest-backend
82f16ad441171fd937853ad6200513585904c74c
[ "MIT" ]
null
null
null
resource_managers/common/resource_manager_api.py
solganik/habertest-backend
82f16ad441171fd937853ad6200513585904c74c
[ "MIT" ]
3
2021-03-10T14:02:24.000Z
2021-07-16T20:59:11.000Z
import requests def create(resource_manager, data): return requests.post("http://%s/vms" % resource_manager, json=data) def delete(resource_manager, vm_name): return requests.delete(f"http://{resource_manager}/vms/{vm_name}") def list_images(resource_manager): return requests.get(f"http://{resource_manager}/images") def list_vms(resource_manager): return requests.get(f"http://{resource_manager}/vms") def update_vm(resource_manager, vm_name, status): return requests.post(f"http://{resource_manager}/vms/{vm_name}/status", json=status) def vm_info(resource_manager, vm_name): return requests.get("http://%s/vms/%s" % (resource_manager, vm_name)) def resources(resource_manager): return requests.get(f"http://{resource_manager}/resources")
26.133333
88
0.741071
110
784
5.063636
0.218182
0.37702
0.116697
0.179533
0.51526
0.509874
0.384201
0.280072
0.280072
0
0
0
0.107143
784
29
89
27.034483
0.795714
0
0
0
0
0
0.267857
0
0
0
0
0
0
1
0.466667
false
0
0.066667
0.466667
1
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
ef403f872f7e61622ae50b9c94a63b64fe220bee
24
py
Python
source/model/__init__.py
tailerr/R-NET-pytorch
a6ed4a02b0cf68bade9e9a43a93ec290a3b6fabd
[ "MIT" ]
null
null
null
source/model/__init__.py
tailerr/R-NET-pytorch
a6ed4a02b0cf68bade9e9a43a93ec290a3b6fabd
[ "MIT" ]
null
null
null
source/model/__init__.py
tailerr/R-NET-pytorch
a6ed4a02b0cf68bade9e9a43a93ec290a3b6fabd
[ "MIT" ]
2
2020-03-04T05:48:48.000Z
2020-03-04T06:37:27.000Z
from .model import RNet
12
23
0.791667
4
24
4.75
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
24
1
24
24
0.95
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
32389cd9f9bb0dd03163620e0308366be8207c70
113
py
Python
swagger_client/apis/__init__.py
jakubzeman/swagger-poc-python-cli
8a3d5a7f9f79bb4a72920bbbecdef7bb410efc59
[ "Apache-2.0" ]
null
null
null
swagger_client/apis/__init__.py
jakubzeman/swagger-poc-python-cli
8a3d5a7f9f79bb4a72920bbbecdef7bb410efc59
[ "Apache-2.0" ]
null
null
null
swagger_client/apis/__init__.py
jakubzeman/swagger-poc-python-cli
8a3d5a7f9f79bb4a72920bbbecdef7bb410efc59
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import # import apis into api package from .entrypoint_api import EntrypointApi
22.6
41
0.849558
15
113
6
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.132743
113
4
42
28.25
0.918367
0.247788
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
323c50db80808fb947456822b28a1116d4703a59
80
py
Python
lib/matplotlib/python/matplotlib_rb/backend_inline.py
zheng-yongping/matplotlib.rb
ee39f0c5b87a774925e5038a241adb05e3bf9d28
[ "MIT" ]
74
2016-10-06T02:04:33.000Z
2022-03-18T13:29:45.000Z
lib/matplotlib/python/matplotlib_rb/backend_inline.py
zheng-yongping/matplotlib.rb
ee39f0c5b87a774925e5038a241adb05e3bf9d28
[ "MIT" ]
12
2017-03-09T13:13:19.000Z
2022-02-04T11:02:02.000Z
lib/matplotlib/python/matplotlib_rb/backend_inline.py
zheng-yongping/matplotlib.rb
ee39f0c5b87a774925e5038a241adb05e3bf9d28
[ "MIT" ]
10
2017-05-13T07:02:45.000Z
2022-03-27T21:13:16.000Z
from matplotlib.backends.backend_agg import new_figure_manager, FigureCanvasAgg
40
79
0.9
10
80
6.9
1
0
0
0
0
0
0
0
0
0
0
0
0.0625
80
1
80
80
0.92
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
32595eb410e3a58ac6823639eaef06aec2ab6593
712
py
Python
podcaststore_api/models/user.py
viniarck/podcaststore-django
90316ffb18793b089291a0e28ac3ee2bb5e458cb
[ "Apache-2.0" ]
null
null
null
podcaststore_api/models/user.py
viniarck/podcaststore-django
90316ffb18793b089291a0e28ac3ee2bb5e458cb
[ "Apache-2.0" ]
3
2019-09-22T17:58:27.000Z
2019-09-22T18:20:20.000Z
podcaststore_api/models/user.py
viniarck/podcaststore-django
90316ffb18793b089291a0e28ac3ee2bb5e458cb
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- import rest_framework.serializers as serializers class UserSerializer(serializers.Serializer): """UserSerializer.""" username = serializers.CharField(max_length=128, required=True) email = serializers.EmailField(required=True) password = serializers.CharField(max_length=128, required=True) first_name = serializers.CharField(max_length=128, required=False) last_name = serializers.CharField(max_length=128, required=False) class LoginSerializer(serializers.Serializer): """LoginSerializer.""" username = serializers.CharField(max_length=128, required=True) password = serializers.CharField(max_length=128, required=True)
30.956522
70
0.758427
78
712
6.807692
0.384615
0.225989
0.259887
0.327684
0.59887
0.59887
0.59887
0.59887
0.241055
0.241055
0
0.030449
0.123596
712
22
71
32.363636
0.820513
0.105337
0
0.4
0
0
0
0
0
0
0
0
0
1
0
false
0.2
0.1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
5
325e1134bcf511429a6a26fd5d1a83b232f76128
42
py
Python
igmov/__init__.py
ngupuk/igmov
dcace345bfd5d21dd62d05bdc6fd623a92bafe5e
[ "MIT" ]
2
2020-06-14T05:41:54.000Z
2020-06-14T05:41:56.000Z
igmov/__init__.py
ngupuk/igmov
dcace345bfd5d21dd62d05bdc6fd623a92bafe5e
[ "MIT" ]
2
2020-06-12T03:03:09.000Z
2020-06-18T13:23:29.000Z
igmov/__init__.py
ngupuk/igmov
dcace345bfd5d21dd62d05bdc6fd623a92bafe5e
[ "MIT" ]
null
null
null
from . import template, dl, analyzer, draw
42
42
0.761905
6
42
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
42
1
42
42
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
325f329dcd0d52ff9e378ba91ec33a96a20db99d
1,331
py
Python
back-end/www/application.py
TUD-KInD/COCTEAU
8ea4f546397feaaf22b4e9958b509324b5b332aa
[ "MIT" ]
null
null
null
back-end/www/application.py
TUD-KInD/COCTEAU
8ea4f546397feaaf22b4e9958b509324b5b332aa
[ "MIT" ]
1
2021-11-15T11:40:04.000Z
2021-11-15T11:40:04.000Z
back-end/www/application.py
TUD-KInD/COCTEAU
8ea4f546397feaaf22b4e9958b509324b5b332aa
[ "MIT" ]
2
2021-07-14T13:07:22.000Z
2022-01-25T23:58:06.000Z
from flask_migrate import Migrate from app.app import app from models.model import db from controllers import root from controllers import template_controller from controllers import photos_controller from controllers import login_controller from controllers import topic_controller from controllers import scenario_controller from controllers import question_controller from controllers import vision_controller from controllers import mood_controller from controllers import answer_controller from controllers import game_controller # Register all routes to the blueprint app.register_blueprint(root.bp) app.register_blueprint(template_controller.bp, url_prefix="/template") app.register_blueprint(photos_controller.bp, url_prefix="/photos") app.register_blueprint(login_controller.bp, url_prefix="/login") app.register_blueprint(topic_controller.bp, url_prefix="/topic") app.register_blueprint(scenario_controller.bp, url_prefix="/scenario") app.register_blueprint(question_controller.bp, url_prefix="/question") app.register_blueprint(vision_controller.bp, url_prefix="/vision") app.register_blueprint(mood_controller.bp, url_prefix="/mood") app.register_blueprint(answer_controller.bp, url_prefix="/answer") app.register_blueprint(game_controller.bp, url_prefix="/game") # Set database migration migrate = Migrate(app, db)
41.59375
70
0.851991
177
1,331
6.169492
0.186441
0.151099
0.211538
0.192308
0
0
0
0
0
0
0
0
0.071375
1,331
31
71
42.935484
0.883495
0.044328
0
0
0
0
0.055162
0
0
0
0
0
0
1
0
false
0
0.538462
0
0.538462
0.423077
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
1
0
5
329d84ab9b244a97140c25521b60d4b094698a29
46
py
Python
tests/__init__.py
oli-chipperfield/bayestestimation
aace7949fff01af2b574334a1a1fd2ce93fe10f4
[ "MIT" ]
1
2021-01-29T01:33:52.000Z
2021-01-29T01:33:52.000Z
tests/__init__.py
oli-chipperfield/bayestestimation
aace7949fff01af2b574334a1a1fd2ce93fe10f4
[ "MIT" ]
null
null
null
tests/__init__.py
oli-chipperfield/bayestestimation
aace7949fff01af2b574334a1a1fd2ce93fe10f4
[ "MIT" ]
null
null
null
"""Unit test package for bayestestimation."""
23
45
0.73913
5
46
6.8
1
0
0
0
0
0
0
0
0
0
0
0
0.108696
46
1
46
46
0.829268
0.847826
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
089048d624620112c8be0bc3f48a910032e4fadd
163
py
Python
visualization.py
Cherine0205/image_processing_project
b7ee6d41aced7a28674e285ffa48984e1813e4f7
[ "MIT" ]
null
null
null
visualization.py
Cherine0205/image_processing_project
b7ee6d41aced7a28674e285ffa48984e1813e4f7
[ "MIT" ]
null
null
null
visualization.py
Cherine0205/image_processing_project
b7ee6d41aced7a28674e285ffa48984e1813e4f7
[ "MIT" ]
null
null
null
from keras.utils import plot_model #from unet import * def model_structure(model,output_name): plot_model(model, to_file=output_name+'.png',show_shapes=True)
27.166667
66
0.791411
26
163
4.692308
0.653846
0.147541
0
0
0
0
0
0
0
0
0
0
0.104294
163
5
67
32.6
0.835616
0.110429
0
0
0
0
0.027778
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
08abd6df16c25a0ec084d61cb8a12c63bbdd1253
132
py
Python
utils/config.py
DiscordHackers/BetterBot
5b21c9b1280d205fa0b81c99f87626c1c8a24b81
[ "Apache-2.0" ]
null
null
null
utils/config.py
DiscordHackers/BetterBot
5b21c9b1280d205fa0b81c99f87626c1c8a24b81
[ "Apache-2.0" ]
null
null
null
utils/config.py
DiscordHackers/BetterBot
5b21c9b1280d205fa0b81c99f87626c1c8a24b81
[ "Apache-2.0" ]
null
null
null
TOKEN = 'OTQxNzg1OTA0MDg1ODY4NjA0.YgbAeQ.YdmB4Sfx8zHYNj_xJettDL3Pzrc' # Файл можешь удалить. Тут типа ТВОЙ конфиг вайл и ТВОЙ токен.
132
132
0.833333
16
132
6.8125
0.9375
0
0
0
0
0
0
0
0
0
0
0.067797
0.106061
132
1
132
132
0.855932
0.454545
0
0
0
0
0.830986
0.830986
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
08ac93235fe89ce7ca9065167f6e9e7641e908b6
170
py
Python
boards/admin.py
jakariapervez/cmis6
de279e5c586a77745ddd3d471599784606d50d15
[ "MIT" ]
null
null
null
boards/admin.py
jakariapervez/cmis6
de279e5c586a77745ddd3d471599784606d50d15
[ "MIT" ]
7
2021-06-04T23:45:15.000Z
2022-03-12T00:44:14.000Z
boards/admin.py
jakariapervez/cmis6
de279e5c586a77745ddd3d471599784606d50d15
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Board from import_export.admin import ImportExportModelAdmin # Register your models here. admin.site.register(Board)
28.333333
54
0.841176
23
170
6.173913
0.565217
0
0
0
0
0
0
0
0
0
0
0
0.105882
170
5
55
34
0.934211
0.152941
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
08f4edba3ed3df2859b8832f76cbd2b8ecfb3445
354
py
Python
ray/ray-autopilot.py
xzrderek/RayCarla
40872e015cba9e32228061e66e56a42b3aef74c6
[ "Apache-2.0" ]
2
2022-01-18T23:41:27.000Z
2022-02-10T21:58:49.000Z
ray/ray-autopilot.py
xzrderek/RayCarla
40872e015cba9e32228061e66e56a42b3aef74c6
[ "Apache-2.0" ]
null
null
null
ray/ray-autopilot.py
xzrderek/RayCarla
40872e015cba9e32228061e66e56a42b3aef74c6
[ "Apache-2.0" ]
null
null
null
# Ray-autopilot def autopilot_on_ray(): """ Speed up the dataset collection by running simulation and autopilot in Ray. 1. Port oatomobile on Carla latest (0.9.12+) version and Python 3.7. 2. Solve the problem of Ray supporting ABC. 3. Use Ray actor and task to make autopilot simulation parrallel and distributive. """ pass
35.4
87
0.706215
54
354
4.592593
0.740741
0
0
0
0
0
0
0
0
0
0
0.032847
0.225989
354
9
88
39.333333
0.872263
0.810734
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0.5
0
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
0
0
0
0
5
3e9a37fb682ea8d7d41339aefeead99aebddb8bd
2,317
py
Python
python/nbdb/anomaly/tests/test_static.py
rubrikinc/nbdb2
359db63a39e016e3eb197b8ea511d6e8cffa1853
[ "Apache-2.0" ]
2
2022-03-21T15:48:33.000Z
2022-03-27T00:43:12.000Z
python/nbdb/anomaly/tests/test_static.py
rubrikinc/nbdb2
359db63a39e016e3eb197b8ea511d6e8cffa1853
[ "Apache-2.0" ]
null
null
null
python/nbdb/anomaly/tests/test_static.py
rubrikinc/nbdb2
359db63a39e016e3eb197b8ea511d6e8cffa1853
[ "Apache-2.0" ]
1
2022-03-27T00:43:31.000Z
2022-03-27T00:43:31.000Z
""" Unit tests for static.py """ import unittest import numpy as np import pandas as pd from nbdb.anomaly.static import Static class TestStatic(unittest.TestCase): """ Unit tests for static threshold based anomaly detection. """ def setUp(self): np.random.seed(1) def test_check_no_anomalies_found_for_normal_data(self): """For data without anomalies, verify empty list is returned""" anomaly_finder = Static({'threshold': 4}) normal_series = pd.Series(np.random.randn(100,), index=range(100)) baseline = normal_series.values anomalies = anomaly_finder.find_anomalies(baseline, normal_series) self.assertEqual(0, len(anomalies)) def test_check_no_anomalies_found_for_flatline_data(self): """For data which is flat, verify empty list is returned""" anomaly_finder = Static({'threshold': 4}) normal_series = pd.Series(np.ones(100,), index=range(100)) baseline = normal_series.values anomalies = anomaly_finder.find_anomalies(baseline, normal_series) self.assertEqual(0, len(anomalies)) def test_check_anomalies_found_for_anomalous_data_gt(self): """For data with anomalies, verify correct anomaly returned (gt)""" anomaly_finder = Static({'threshold': 4}) anomalous_series = pd.Series(np.random.randn(100,), index=range(100)) anomalous_series[95:99] = 5 baseline = np.random.randn(100,) anomalies = anomaly_finder.find_anomalies(baseline, anomalous_series) self.assertEqual(1, len(anomalies)) self.assertEqual(95, anomalies[0].timewindow.start) self.assertEqual(98, anomalies[0].timewindow.end) def test_check_anomalies_found_for_anomalous_data_lt(self): """For data with anomalies, verify correct anomaly returned (lt)""" anomaly_finder = Static({'threshold': -4, 'comparator_fn': 'lt'}) anomalous_series = pd.Series(np.random.randn(100,), index=range(100)) anomalous_series[95:99] = -5 baseline = np.random.randn(100,) anomalies = anomaly_finder.find_anomalies(baseline, anomalous_series) self.assertEqual(1, len(anomalies)) self.assertEqual(95, anomalies[0].timewindow.start) self.assertEqual(98, anomalies[0].timewindow.end)
39.948276
77
0.69098
291
2,317
5.319588
0.243986
0.067183
0.04199
0.05168
0.806848
0.76938
0.76938
0.73708
0.690568
0.623385
0
0.032743
0.195943
2,317
57
78
40.649123
0.798175
0.136815
0
0.567568
0
0
0.02606
0
0
0
0
0
0.216216
1
0.135135
false
0
0.108108
0
0.27027
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
3ee0b6c43c8b30e60dfec510acb38d2305424a29
64
py
Python
ferris/core/oauth2/__init__.py
markEarvin/sl-contest-tracker
dd24b6fb5913b7d1f4c6648ed6c25f4738867485
[ "MIT" ]
null
null
null
ferris/core/oauth2/__init__.py
markEarvin/sl-contest-tracker
dd24b6fb5913b7d1f4c6648ed6c25f4738867485
[ "MIT" ]
null
null
null
ferris/core/oauth2/__init__.py
markEarvin/sl-contest-tracker
dd24b6fb5913b7d1f4c6648ed6c25f4738867485
[ "MIT" ]
null
null
null
from .user_credentials import UserCredentials, find_credentials
32
63
0.890625
7
64
7.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.078125
64
1
64
64
0.932203
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f5cfd80726c68941b4d23aa74c0b4dca27b9827b
2,570
py
Python
src/data.py
fabioo29/csp-sudoku-solver
679ee101572086be84983d0e8868201db823a175
[ "MIT" ]
null
null
null
src/data.py
fabioo29/csp-sudoku-solver
679ee101572086be84983d0e8868201db823a175
[ "MIT" ]
null
null
null
src/data.py
fabioo29/csp-sudoku-solver
679ee101572086be84983d0e8868201db823a175
[ "MIT" ]
null
null
null
CLEAN_BOARD = [ ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], # ------------------------------------------------- ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], # ------------------------------------------------- ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '0', '0'] + ['0', '0', '0'] ] EASY_BOARD = [ ['0', '0', '0'] + ['5', '0', '3'] + ['4', '6', '1'], ['0', '7', '3'] + ['0', '0', '0'] + ['0', '0', '0'], ['1', '0', '0'] + ['2', '8', '0'] + ['0', '0', '0'], # ------------------------------------------------- ['3', '0', '0'] + ['4', '0', '0'] + ['0', '1', '0'], ['0', '9', '4'] + ['3', '0', '1'] + ['5', '7', '0'], ['0', '1', '0'] + ['0', '0', '7'] + ['0', '0', '8'], # ------------------------------------------------- ['0', '0', '0'] + ['0', '3', '2'] + ['0', '0', '5'], ['0', '0', '0'] + ['0', '0', '0'] + ['7', '2', '0'], ['5', '2', '6'] + ['7', '0', '9'] + ['0', '0', '0'] ] MEDIUM_BOARD = [ ['0', '0', '0'] + ['7', '0', '0'] + ['2', '9', '4'], ['0', '0', '0'] + ['8', '2', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '0', '4'] + ['3', '6', '0'], # ------------------------------------------------- ['0', '0', '6'] + ['0', '0', '0'] + ['0', '7', '9'], ['4', '0', '0'] + ['0', '8', '0'] + ['0', '0', '6'], ['2', '1', '0'] + ['0', '0', '0'] + ['4', '0', '0'], # ------------------------------------------------- ['0', '6', '1'] + ['4', '0', '0'] + ['0', '0', '0'], ['0', '0', '0'] + ['0', '6', '2'] + ['0', '0', '0'], ['9', '4', '2'] + ['0', '0', '5'] + ['0', '0', '0'] ] HARD_BOARD = [ ['0', '4', '0'] + ['0', '0', '2'] + ['0', '0', '0'], ['0', '0', '8'] + ['4', '7', '0'] + ['0', '0', '5'], ['0', '0', '0'] + ['0', '0', '6'] + ['0', '7', '0'], # ------------------------------------------------- ['0', '6', '0'] + ['9', '1', '0'] + ['0', '5', '0'], ['3', '0', '0'] + ['0', '0', '0'] + ['0', '0', '8'], ['0', '0', '0'] + ['0', '0', '7'] + ['0', '0', '0'], # ------------------------------------------------- ['0', '9', '0'] + ['5', '4', '0'] + ['0', '1', '0'], ['0', '0', '6'] + ['0', '0', '0'] + ['9', '0', '0'], ['0', '0', '0'] + ['2', '0', '0'] + ['0', '0', '0'] ]
45.892857
56
0.142802
332
2,570
1.093373
0.045181
1.046832
1.214876
1.267218
0.77686
0.683196
0.520661
0.366391
0.322314
0.223141
0
0.165053
0.236187
2,570
55
57
46.727273
0.019868
0.155253
0
0.181818
0
0
0.149861
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
f5d35c635dce295138b95811eec41b86b8491ddf
75
py
Python
MatrixTest/__init__.py
DavyVan/MatrixTest
3007e826a51b497c88e60eb71f4c5fdc58d252df
[ "MIT" ]
null
null
null
MatrixTest/__init__.py
DavyVan/MatrixTest
3007e826a51b497c88e60eb71f4c5fdc58d252df
[ "MIT" ]
null
null
null
MatrixTest/__init__.py
DavyVan/MatrixTest
3007e826a51b497c88e60eb71f4c5fdc58d252df
[ "MIT" ]
null
null
null
from .MatrixTestRunner import MatrixTestRunner from .EmailService import *
25
46
0.853333
7
75
9.142857
0.571429
0
0
0
0
0
0
0
0
0
0
0
0.106667
75
2
47
37.5
0.955224
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
eb052b830f5b3d573e3d79fb2ca506ff4e75df1b
41
py
Python
scrapli/transport/plugins/paramiko/__init__.py
verbosemode/scrapli
b3885169dccf24ac65d0d433eae16bcab8288002
[ "MIT" ]
404
2020-02-11T09:05:40.000Z
2022-03-31T05:10:03.000Z
scrapli/transport/plugins/paramiko/__init__.py
verbosemode/scrapli
b3885169dccf24ac65d0d433eae16bcab8288002
[ "MIT" ]
155
2020-02-18T00:21:43.000Z
2022-03-06T16:34:47.000Z
scrapli/transport/plugins/paramiko/__init__.py
verbosemode/scrapli
b3885169dccf24ac65d0d433eae16bcab8288002
[ "MIT" ]
48
2020-04-02T00:24:44.000Z
2022-03-07T18:24:53.000Z
"""scrapli.transport.plugins.paramiko"""
20.5
40
0.756098
4
41
7.75
1
0
0
0
0
0
0
0
0
0
0
0
0.02439
41
1
41
41
0.775
0.829268
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
eb053a3ff37cb8293785c91671c3ce7574518f5a
219
py
Python
core/src/zeit/cms/generation/evolve14.py
rickdg/vivi
16134ac954bf8425646d4ad47bdd1f372e089355
[ "BSD-3-Clause" ]
5
2019-05-16T09:51:29.000Z
2021-05-31T09:30:03.000Z
core/src/zeit/cms/generation/evolve14.py
rickdg/vivi
16134ac954bf8425646d4ad47bdd1f372e089355
[ "BSD-3-Clause" ]
107
2019-05-24T12:19:02.000Z
2022-03-23T15:05:56.000Z
core/src/zeit/cms/generation/evolve14.py
rickdg/vivi
16134ac954bf8425646d4ad47bdd1f372e089355
[ "BSD-3-Clause" ]
3
2020-08-14T11:01:17.000Z
2022-01-08T17:32:19.000Z
import zeit.cms.generation import zeit.cms.generation.install def update(root): zeit.cms.generation.install.installBrightcoveTaskService() def evolve(context): zeit.cms.generation.do_evolve(context, update)
19.909091
62
0.789954
27
219
6.37037
0.444444
0.162791
0.395349
0.267442
0
0
0
0
0
0
0
0
0.105023
219
10
63
21.9
0.877551
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
0
0
0
5
eb23a842e54e5bb535040623d3748f379bad1cf7
59
py
Python
back/models/layers/__init__.py
nizhib/portrait-demo
b4dc80187824a07c3562c1580a1a7c4f2f4ecc93
[ "MIT" ]
47
2019-04-10T07:27:58.000Z
2022-02-03T10:13:23.000Z
back/models/layers/__init__.py
nizhib/portrait-demo
b4dc80187824a07c3562c1580a1a7c4f2f4ecc93
[ "MIT" ]
3
2021-09-08T01:46:13.000Z
2022-03-12T00:19:09.000Z
back/models/layers/__init__.py
nizhib/portrait-demo
b4dc80187824a07c3562c1580a1a7c4f2f4ecc93
[ "MIT" ]
17
2019-04-01T23:01:57.000Z
2021-06-29T13:23:05.000Z
from .common import conv3x3 from .upsample import Upsample
19.666667
30
0.830508
8
59
6.125
0.625
0
0
0
0
0
0
0
0
0
0
0.039216
0.135593
59
2
31
29.5
0.921569
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
eb27318a54bfbef5e0b56baaeb55e58cb6af19c8
214
py
Python
Python Basics/Conditional Statements Advanced/Lab/Task03.py
DonikaChervenkova/SoftUni
bff579c037ec48f39ed193b34bc3502a32e90732
[ "MIT" ]
1
2022-03-16T10:23:04.000Z
2022-03-16T10:23:04.000Z
Python Basics/Conditional Statements Advance/Lab/Task03.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
null
null
null
Python Basics/Conditional Statements Advance/Lab/Task03.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
1
2021-12-04T12:30:57.000Z
2021-12-04T12:30:57.000Z
animal_class = str(input()) if animal_class == "dog": print("mammal") elif animal_class == "crocodile" or animal_class == "tortoise" or animal_class == "snake": print("reptile") else: print("unknown")
23.777778
90
0.663551
27
214
5.074074
0.592593
0.40146
0.189781
0
0
0
0
0
0
0
0
0
0.168224
214
8
91
26.75
0.769663
0
0
0
0
0
0.21028
0
0
0
0
0
0
1
0
false
0
0
0
0
0.428571
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
de60e64981cffe4fc69a55537c319a44414c9455
103
py
Python
srl_zoo/preprocessing/__init__.py
anonymous-authors-2018/robotics-repo
385d1f3b49f8d414ab90f53c6f06b56614ae83ba
[ "MIT" ]
134
2018-09-26T04:27:20.000Z
2022-03-24T09:39:38.000Z
srl_zoo/preprocessing/__init__.py
BillChan226/POAR-SRL-4-Robot
a6a8052e105369656d34fffc4f7ca4475dcc38df
[ "MIT" ]
3
2018-11-02T19:01:26.000Z
2019-08-09T09:22:19.000Z
srl_zoo/preprocessing/__init__.py
BillChan226/POAR-SRL-4-Robot
a6a8052e105369656d34fffc4f7ca4475dcc38df
[ "MIT" ]
23
2018-10-12T15:51:28.000Z
2021-12-09T02:44:23.000Z
from .data_loader import preprocessImage from .preprocess import getNChannels, getInputDim, N_CHANNELS
34.333333
61
0.864078
12
103
7.25
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.097087
103
2
62
51.5
0.935484
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
de9022c0267d49845036af8f76d286637e5656ef
297
py
Python
Smaug/models/__init__.py
luviiv/Smaug
d26d837bb97ef583e05c43d16aed265356b7cf74
[ "Apache-2.0" ]
null
null
null
Smaug/models/__init__.py
luviiv/Smaug
d26d837bb97ef583e05c43d16aed265356b7cf74
[ "Apache-2.0" ]
null
null
null
Smaug/models/__init__.py
luviiv/Smaug
d26d837bb97ef583e05c43d16aed265356b7cf74
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ __init__.py ~~~~~~~~~~~ :copyright: (c) 2015 by Lu Tianchao. :license: Apache, see LICENSE for more details. """ from .stock_info import StockIdentity from .stock_info import SeasonlySummary from .stock_info import SummaryRatios from .users import User
24.75
51
0.683502
37
297
5.297297
0.702703
0.137755
0.19898
0.290816
0
0
0
0
0
0
0
0.020576
0.181818
297
12
52
24.75
0.786008
0.441077
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
de9ff3b46693ad66bb87b1fac464b8fb3c4ab8d2
1,042
py
Python
mServer/band/models.py
returnToZ/BandHelper
ce8ca3094c6cc4b05b213766710ba6263f41705d
[ "Apache-2.0" ]
null
null
null
mServer/band/models.py
returnToZ/BandHelper
ce8ca3094c6cc4b05b213766710ba6263f41705d
[ "Apache-2.0" ]
null
null
null
mServer/band/models.py
returnToZ/BandHelper
ce8ca3094c6cc4b05b213766710ba6263f41705d
[ "Apache-2.0" ]
1
2021-12-15T02:31:09.000Z
2021-12-15T02:31:09.000Z
#!/usr/bin/env python # coding=utf-8 from __future__ import unicode_literals from django.db import models # Create your models here. ''' 学院派会告诉你在设计的时候把应该有的约束都加上 而实践派得出的结论是主键一定加,非空约束尽量加,外键最好依赖于程序逻辑,而不是数据库,从而更好的拥抱变化,快速响应,数据库也会有相对较好的性能 ''' class Account(models.Model): username = models.CharField(max_length = 20,unique = True)#长度限制逻辑写在app中 password = models.CharField(max_length = 40) def __unicode__(self): return self.password class Personal(models.Model): username = models.CharField(max_length = 20,unique = True) nickname = models.CharField(max_length = 40) gender = models.CharField(max_length = 2) telphone = models.CharField(max_length = 20) email = models.CharField(max_length = 40) status = models.CharField(max_length = 200) def getnickname(self): return self.nickname def getgender(self): return self.gender def gettelphone(self): return self.telphone def getemail(self): return self.email def getstatus(self): return self.status
16.806452
72
0.716891
126
1,042
5.793651
0.436508
0.164384
0.19726
0.263014
0.293151
0.150685
0.150685
0.150685
0.150685
0.150685
0
0.020071
0.18714
1,042
62
73
16.806452
0.841795
0.067179
0
0.083333
0
0
0
0
0
0
0
0
0
1
0.25
false
0.083333
0.083333
0.25
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
0
0
0
5
deac5a36320db88cf3d13e711072ce903798b18e
166
py
Python
pythonteste/desafio27.py
dangiotto/Python
29a9d18d7595a5c21e65dafc39f7fd4c55d8971c
[ "MIT" ]
1
2020-10-17T03:23:59.000Z
2020-10-17T03:23:59.000Z
pythonteste/desafio27.py
dangiotto/Python
29a9d18d7595a5c21e65dafc39f7fd4c55d8971c
[ "MIT" ]
null
null
null
pythonteste/desafio27.py
dangiotto/Python
29a9d18d7595a5c21e65dafc39f7fd4c55d8971c
[ "MIT" ]
null
null
null
nome = str(input('Informe o nome :\n')).strip().split(' ') print('Primeiro nome é {}'.format(nome[0])) print('Último nome é {}'.format(nome[-1])) #(nome[len(nome)-1])
55.333333
63
0.620482
27
166
3.814815
0.592593
0.097087
0.213592
0.291262
0
0
0
0
0
0
0
0.019868
0.090361
166
3
63
55.333333
0.662252
0.114458
0
0
0
0
0.360544
0
0
0
0
0
0
1
0
false
0
0
0
0
0.666667
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
dee64ac77044088f97692d25788e8a6fdb0cb5d8
1,738
py
Python
tests/unit/executors/crafters/numeric/test_io.py
YueLiu-jina/jina
f3e860313f26edc6d9f6e6ecc74cf6c2a3c65bff
[ "Apache-2.0" ]
null
null
null
tests/unit/executors/crafters/numeric/test_io.py
YueLiu-jina/jina
f3e860313f26edc6d9f6e6ecc74cf6c2a3c65bff
[ "Apache-2.0" ]
null
null
null
tests/unit/executors/crafters/numeric/test_io.py
YueLiu-jina/jina
f3e860313f26edc6d9f6e6ecc74cf6c2a3c65bff
[ "Apache-2.0" ]
null
null
null
import unittest import numpy as np from jina.executors.crafters.numeric.io import ArrayStringReader, ArrayBytesReader from tests import JinaTestCase class MyTestCase(JinaTestCase): def test_array_reader(self): size = 8 sample_array = np.random.rand(size).astype('float32') text = ','.join([str(x) for x in sample_array]) reader = ArrayStringReader() crafted_doc = reader.craft(text, 0) self.assertEqual(crafted_doc['blob'].shape[0], size) np.testing.assert_array_equal(crafted_doc['blob'], sample_array) def test_bytes_reader(self): size = 8 sample_array = np.random.rand(size).astype('float32') array_bytes = sample_array.tobytes() reader = ArrayBytesReader() crafted_doc = reader.craft(array_bytes, 0) self.assertEqual(crafted_doc['blob'].shape[0], size) np.testing.assert_array_equal(crafted_doc['blob'], sample_array) def test_bytes_reader_int_type(self): size = 8 sample_array = np.random.rand(size).astype('int') array_bytes = sample_array.tobytes() reader = ArrayBytesReader(as_type='int') crafted_doc = reader.craft(array_bytes, 0) self.assertEqual(crafted_doc['blob'].shape[0], size) np.testing.assert_array_equal(crafted_doc['blob'], sample_array) def test_bytes_reader_wrong_type(self): size = 8 sample_array = np.random.rand(size).astype('float32') array_bytes = sample_array.tobytes() reader = ArrayBytesReader(as_type='float64') crafted_doc = reader.craft(array_bytes, 0) self.assertEqual(crafted_doc['blob'].shape[0], size / 2) if __name__ == '__main__': unittest.main()
31.6
82
0.671461
219
1,738
5.073059
0.251142
0.108911
0.088209
0.054005
0.739874
0.739874
0.739874
0.739874
0.739874
0.684068
0
0.015306
0.210587
1,738
54
83
32.185185
0.794461
0
0
0.5
0
0
0.040852
0
0
0
0
0
0.184211
1
0.105263
false
0
0.105263
0
0.236842
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
723554a714b7cf2225d26c6e1c526809dbce87e8
168
py
Python
pro6/playlist/__init__.py
anthonyeden/Pro6-Utils
b31dfbf5bd94f987b33705992da9948fcf01eeb4
[ "MIT" ]
1
2021-04-28T03:43:38.000Z
2021-04-28T03:43:38.000Z
pro6/playlist/__init__.py
anthonyeden/Pro6-Utils
b31dfbf5bd94f987b33705992da9948fcf01eeb4
[ "MIT" ]
null
null
null
pro6/playlist/__init__.py
anthonyeden/Pro6-Utils
b31dfbf5bd94f987b33705992da9948fcf01eeb4
[ "MIT" ]
1
2020-01-21T07:28:31.000Z
2020-01-21T07:28:31.000Z
from .cues import DocumentCue, HeaderCue from .document import PlaylistDocument from .node import PlaylistNode from .node import NODE_ROOT, NODE_FOLDER, NODE_PLAYLIST
28
55
0.839286
22
168
6.272727
0.545455
0.115942
0.202899
0
0
0
0
0
0
0
0
0
0.119048
168
5
56
33.6
0.932432
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
72365766a38d71010bd9fbc7c1e37504f484d936
39
py
Python
analysis/Python_Scripts/getGeoQueries.py
J-Wengler/NLP_Paper
b5f1952e04172289adfe935297a1fcfd42e2bf70
[ "CC-BY-4.0", "CC0-1.0" ]
1
2021-11-04T11:03:35.000Z
2021-11-04T11:03:35.000Z
analysis/Python_Scripts/getGeoQueries.py
J-Wengler/NLP_Paper
b5f1952e04172289adfe935297a1fcfd42e2bf70
[ "CC-BY-4.0", "CC0-1.0" ]
null
null
null
analysis/Python_Scripts/getGeoQueries.py
J-Wengler/NLP_Paper
b5f1952e04172289adfe935297a1fcfd42e2bf70
[ "CC-BY-4.0", "CC0-1.0" ]
null
null
null
from helper import * evaluateGEO()
13
20
0.692308
4
39
6.75
1
0
0
0
0
0
0
0
0
0
0
0
0.230769
39
2
21
19.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
724636f8fdbcb45ccdf34b7eaa1daf1115cecd72
121
py
Python
pokeapi/api/repositories/__init__.py
QU3B1M/Go-and-Python-MicroMonsters
82343456a619893fe395ba46e8dd06f1ad13b7be
[ "MIT" ]
null
null
null
pokeapi/api/repositories/__init__.py
QU3B1M/Go-and-Python-MicroMonsters
82343456a619893fe395ba46e8dd06f1ad13b7be
[ "MIT" ]
null
null
null
pokeapi/api/repositories/__init__.py
QU3B1M/Go-and-Python-MicroMonsters
82343456a619893fe395ba46e8dd06f1ad13b7be
[ "MIT" ]
null
null
null
from .pokemon import PokemonRepository from .poketype import PokeTypeRepository from .pokemove import PokeMoveRepository
30.25
40
0.876033
12
121
8.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.099174
121
3
41
40.333333
0.972477
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
724d0c344412bff808934183102e000ef0dead04
84,704
py
Python
parsetab.py
ChinaNuke/bwcc
a69e45cb4543ce25b763df658b38bd19a27914bb
[ "MIT" ]
1
2020-12-04T11:07:18.000Z
2020-12-04T11:07:18.000Z
parsetab.py
mengyu-cmd/bwcc
a69e45cb4543ce25b763df658b38bd19a27914bb
[ "MIT" ]
null
null
null
parsetab.py
mengyu-cmd/bwcc
a69e45cb4543ce25b763df658b38bd19a27914bb
[ "MIT" ]
1
2020-12-04T11:07:30.000Z
2020-12-04T11:07:30.000Z
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMODAND ANDEQUAL ARROW AUTO BREAK CHAR CHAR_CONST COLON COMMA CONDOP CONST CONTINUE DIVEQUAL DIVIDE DO DOUBLE ELSE ENUM EQ EQUALS EXTERN FLOAT FLOAT_CONST FOR GE GT ID IF INT INT_CONST LAND LBRACE LBRACKET LE LNOT LONG LOR LPAREN LSHIFT LSHIFTEQUAL LT MINUS MINUSEQUAL MINUSMINUS MOD MODEQUAL NE NOT OR OREQUAL PERIOD PLUS PLUSEQUAL PLUSPLUS RBRACE RBRACKET REGISTER RETURN RPAREN RSHIFT RSHIFTEQUAL SEMI SHORT SIGNED STATIC STRING_LITERAL STRUCT TIMES TIMESEQUAL TYPEDEF TYPEID UNSIGNED VOID VOLATILE WHILE XOR XOREQUALassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_opt : empty\n| declaration_specifiersexpression_opt : empty\n| expressionidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listtype_qualifier_list_opt : empty\n| type_qualifier_list translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n | translation_unit external_declaration\n external_declaration : function_defination external_declaration : declaration function_defination : declaration_specifiers declarator declaration_list_opt compound_statement\n declaration_list : declaration\n | declaration_list declaration\n statement : expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n compound_statement : brace_open block_item_list_opt brace_close block_item_list : block_item\n | block_item_list block_item\n block_item : declaration\n | statement\n expression_statement : expression_opt SEMI selection_statement : IF LPAREN expression RPAREN statement selection_statement : IF LPAREN expression RPAREN statement ELSE statement iteration_statement : WHILE LPAREN expression RPAREN statement iteration_statement : DO statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n declaration : declaration_specifiers init_declarator_list SEMI init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n declarator : direct_declarator\n | pointer direct_declarator\n direct_declarator : ID direct_declarator : LPAREN declarator RPAREN direct_declarator : direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET direct_declarator : direct_declarator LBRACKET STATIC type_qualifier_list assignment_expression RBRACKET\n | direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_declarator : direct_declarator LPAREN identifier_list_opt RPAREN\n | direct_declarator LPAREN parameter_type_list RPAREN\n identifier_list : identifier\n | identifier_list COMMA identifier\n parameter_type_list : parameter_list parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers declarator\n declaration_specifiers : storage_class_specifier declaration_specifiers_opt declaration_specifiers : type_specifier declaration_specifiers_opt declaration_specifiers : type_qualifier declaration_specifiers_opt pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n type_qualifier : CONST\n | VOLATILE\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n type_specifier : type_specifier_simple\n | enum_specifier\n | struct_specifier\n type_specifier_simple : VOID\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | SIGNED\n | UNSIGNED\n | TYPEID\n enum_specifier : ENUM ID enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n struct_specifier : STRUCT ID\n struct_specifier : STRUCT brace_open struct_declaration_list brace_close\n struct_specifier : STRUCT ID brace_open struct_declaration_list brace_close\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list SEMI\n specifier_qualifier_list : specifier_qualifier_list type_specifier specifier_qualifier_list : specifier_qualifier_list type_qualifier specifier_qualifier_list : type_specifier specifier_qualifier_list : type_qualifier_list type_specifier struct_declarator_list : struct_declarator\n | struct_declarator COMMA struct_declarator\n struct_declarator : declarator initializer : assignment_expression initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : initializer\n | initializer_list COMMA initializer\n constant_expression : conditional_expression expression : assignment_expression\n | expression COMMA assignment_expression\n assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression GT binary_expression\n | binary_expression GE binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression XOR binary_expression\n | binary_expression OR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD identifier\n | postfix_expression ARROW identifier\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n primary_expression : identifier\n | constant\n | string_literal\n primary_expression : LPAREN expression RPAREN identifier : ID constant : INT_CONST constant : FLOAT_CONST constant : CHAR_CONST string_literal : STRING_LITERAL brace_open : LBRACE brace_close : RBRACE empty : ' _lr_action_items = {'$end':([0,1,2,3,4,5,6,33,58,79,127,222,],[-191,0,-19,-20,-21,-23,-24,-22,-49,-25,-190,-33,]),'AUTO':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,56,57,58,61,62,79,80,108,121,125,127,130,140,141,142,143,144,145,146,147,148,210,211,213,215,219,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[11,11,-21,-23,-24,11,11,11,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,11,-54,-56,-96,-189,-104,11,-26,-49,11,-55,-25,11,-27,-57,-97,-190,-105,11,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,11,-98,-106,-33,-35,-38,11,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'REGISTER':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,56,57,58,61,62,79,80,108,121,125,127,130,140,141,142,143,144,145,146,147,148,210,211,213,215,219,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[12,12,-21,-23,-24,12,12,12,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,12,-54,-56,-96,-189,-104,12,-26,-49,12,-55,-25,12,-27,-57,-97,-190,-105,12,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,12,-98,-106,-33,-35,-38,12,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'STATIC':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,56,57,58,60,61,62,67,79,80,108,112,121,123,125,127,130,140,141,142,143,144,145,146,147,148,210,211,213,215,219,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[13,13,-21,-23,-24,13,13,13,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,13,-54,-56,-96,-189,-104,13,-26,-49,111,13,-55,-74,-25,13,-27,209,-57,-75,-97,-190,-105,13,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,13,-98,-106,-33,-35,-38,13,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'EXTERN':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,56,57,58,61,62,79,80,108,121,125,127,130,140,141,142,143,144,145,146,147,148,210,211,213,215,219,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[14,14,-21,-23,-24,14,14,14,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,14,-54,-56,-96,-189,-104,14,-26,-49,14,-55,-25,14,-27,-57,-97,-190,-105,14,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,14,-98,-106,-33,-35,-38,14,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'TYPEDEF':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,56,57,58,61,62,79,80,108,121,125,127,130,140,141,142,143,144,145,146,147,148,210,211,213,215,219,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[15,15,-21,-23,-24,15,15,15,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,15,-54,-56,-96,-189,-104,15,-26,-49,15,-55,-25,15,-27,-57,-97,-190,-105,15,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,15,-98,-106,-33,-35,-38,15,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'CONST':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,41,47,49,50,51,56,57,58,60,61,62,66,67,72,73,74,75,76,77,79,80,108,111,112,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,208,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[19,19,-21,-23,-24,19,19,19,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,19,-54,-56,19,-96,-189,-104,19,19,-26,-49,19,19,-55,19,-74,19,19,-107,19,-112,19,-25,19,-27,19,19,-57,-75,-97,-190,19,-105,-108,-110,-111,-113,19,-34,-36,-37,-28,-29,-30,-31,-32,19,-61,-62,19,-98,-106,-109,-33,-35,-38,19,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'VOLATILE':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,41,47,49,50,51,56,57,58,60,61,62,66,67,72,73,74,75,76,77,79,80,108,111,112,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,208,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[20,20,-21,-23,-24,20,20,20,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,20,-54,-56,20,-96,-189,-104,20,20,-26,-49,20,20,-55,20,-74,20,20,-107,20,-112,20,-25,20,-27,20,20,-57,-75,-97,-190,20,-105,-108,-110,-111,-113,20,-34,-36,-37,-28,-29,-30,-31,-32,20,-61,-62,20,-98,-106,-109,-33,-35,-38,20,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'VOID':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[21,21,-21,-23,-24,21,21,21,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,21,-54,-56,-96,-189,-104,21,21,-26,-49,21,-55,-74,21,21,-107,21,-112,21,-25,21,-27,-57,-75,-97,-190,21,-105,-108,-110,-111,-113,21,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,21,-98,-106,-109,-33,-35,-38,21,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'CHAR':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[22,22,-21,-23,-24,22,22,22,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,22,-54,-56,-96,-189,-104,22,22,-26,-49,22,-55,-74,22,22,-107,22,-112,22,-25,22,-27,-57,-75,-97,-190,22,-105,-108,-110,-111,-113,22,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,22,-98,-106,-109,-33,-35,-38,22,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'SHORT':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[23,23,-21,-23,-24,23,23,23,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,23,-54,-56,-96,-189,-104,23,23,-26,-49,23,-55,-74,23,23,-107,23,-112,23,-25,23,-27,-57,-75,-97,-190,23,-105,-108,-110,-111,-113,23,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,23,-98,-106,-109,-33,-35,-38,23,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'INT':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[24,24,-21,-23,-24,24,24,24,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,24,-54,-56,-96,-189,-104,24,24,-26,-49,24,-55,-74,24,24,-107,24,-112,24,-25,24,-27,-57,-75,-97,-190,24,-105,-108,-110,-111,-113,24,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,24,-98,-106,-109,-33,-35,-38,24,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'LONG':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[25,25,-21,-23,-24,25,25,25,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,25,-54,-56,-96,-189,-104,25,25,-26,-49,25,-55,-74,25,25,-107,25,-112,25,-25,25,-27,-57,-75,-97,-190,25,-105,-108,-110,-111,-113,25,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,25,-98,-106,-109,-33,-35,-38,25,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'FLOAT':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[26,26,-21,-23,-24,26,26,26,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,26,-54,-56,-96,-189,-104,26,26,-26,-49,26,-55,-74,26,26,-107,26,-112,26,-25,26,-27,-57,-75,-97,-190,26,-105,-108,-110,-111,-113,26,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,26,-98,-106,-109,-33,-35,-38,26,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'DOUBLE':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[27,27,-21,-23,-24,27,27,27,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,27,-54,-56,-96,-189,-104,27,27,-26,-49,27,-55,-74,27,27,-107,27,-112,27,-25,27,-27,-57,-75,-97,-190,27,-105,-108,-110,-111,-113,27,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,27,-98,-106,-109,-33,-35,-38,27,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'SIGNED':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[28,28,-21,-23,-24,28,28,28,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,28,-54,-56,-96,-189,-104,28,28,-26,-49,28,-55,-74,28,28,-107,28,-112,28,-25,28,-27,-57,-75,-97,-190,28,-105,-108,-110,-111,-113,28,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,28,-98,-106,-109,-33,-35,-38,28,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'UNSIGNED':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[29,29,-21,-23,-24,29,29,29,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,29,-54,-56,-96,-189,-104,29,29,-26,-49,29,-55,-74,29,29,-107,29,-112,29,-25,29,-27,-57,-75,-97,-190,29,-105,-108,-110,-111,-113,29,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,29,-98,-106,-109,-33,-35,-38,29,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'TYPEID':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[30,30,-21,-23,-24,30,30,30,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,30,-54,-56,-96,-189,-104,30,30,-26,-49,30,-55,-74,30,30,-107,30,-112,30,-25,30,-27,-57,-75,-97,-190,30,-105,-108,-110,-111,-113,30,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,30,-98,-106,-109,-33,-35,-38,30,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'ENUM':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[31,31,-21,-23,-24,31,31,31,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,31,-54,-56,-96,-189,-104,31,31,-26,-49,31,-55,-74,31,31,-107,31,-112,31,-25,31,-27,-57,-75,-97,-190,31,-105,-108,-110,-111,-113,31,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,31,-98,-106,-109,-33,-35,-38,31,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'STRUCT':([0,2,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,36,39,47,49,50,51,56,57,58,61,62,67,72,73,74,75,76,77,79,80,108,121,123,125,127,129,130,131,133,134,137,140,141,142,143,144,145,146,147,148,210,211,213,215,219,220,222,223,225,230,231,232,234,264,276,283,284,292,293,301,302,306,307,],[32,32,-21,-23,-24,32,32,32,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-22,32,-54,-56,-96,-189,-104,32,32,-26,-49,32,-55,-74,32,32,-107,32,-112,32,-25,32,-27,-57,-75,-97,-190,32,-105,-108,-110,-111,-113,32,-34,-36,-37,-28,-29,-30,-31,-32,-61,-62,32,-98,-106,-109,-33,-35,-38,32,-45,-46,-48,-58,-47,-59,-60,-39,-41,-40,-42,-44,-43,]),'ID':([7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,37,40,41,42,43,44,45,46,47,48,49,50,52,54,58,59,60,61,64,65,66,67,68,75,76,80,83,88,89,90,92,93,94,95,97,99,100,110,112,120,122,123,125,126,127,128,130,133,134,137,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,208,209,212,215,219,221,222,223,225,226,227,228,230,231,232,234,236,275,276,279,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[39,-191,-191,-191,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,47,50,39,39,-191,-69,-7,-8,-70,-71,-96,71,-189,-104,39,103,-49,39,-191,103,-72,-17,-18,-74,71,39,-112,103,103,103,103,103,-165,-166,-167,-164,103,-168,-169,103,-18,39,-73,-75,-97,71,-190,103,-105,-110,-111,-113,103,-34,-36,-37,-28,-29,-30,-31,-32,103,103,103,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,-98,-106,39,-33,-35,-38,103,103,103,103,-45,-46,-48,103,103,-47,103,103,103,103,103,103,-39,-41,103,103,103,-40,-42,103,103,-44,-43,]),'LPAREN':([7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,36,37,39,40,41,42,43,44,45,46,47,49,50,52,54,58,59,60,62,64,65,66,67,75,76,80,83,87,88,89,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,110,112,120,121,122,123,125,127,128,130,133,134,137,140,141,142,143,144,145,146,147,148,150,152,153,154,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,208,209,210,211,215,219,221,222,223,225,226,227,228,230,231,232,234,236,259,261,262,263,264,273,275,276,279,280,281,282,283,284,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[40,-191,-191,-191,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,61,40,-56,40,-191,-69,-7,-8,-70,-71,-96,-189,-104,40,97,-49,40,-191,61,-72,-17,-18,-74,40,-112,97,97,195,97,97,97,-165,-166,-167,-164,-172,97,-180,-168,-169,-181,-182,-184,-185,-186,-187,-188,97,-18,40,-57,-73,-75,-97,-190,97,-105,-110,-111,-113,97,-34,-36,-37,-28,-29,-30,-31,-32,226,228,97,230,97,97,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,-178,-179,97,97,-61,-62,-98,-106,40,-33,-35,-38,97,97,97,97,-45,-46,-48,97,-175,-176,-177,-183,-58,287,97,-47,97,-173,-174,97,-59,-60,97,97,97,97,-39,-41,97,97,97,-40,-42,97,97,-44,-43,]),'TIMES':([7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,40,41,42,43,44,45,46,47,49,50,52,54,58,59,60,64,65,66,67,75,76,80,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,110,112,120,123,125,127,128,130,133,134,137,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,208,209,215,219,221,222,223,225,226,227,228,230,231,232,234,236,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,275,276,279,280,281,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[41,-191,-191,-191,-78,-79,-80,-81,-82,-83,-84,-85,-76,-77,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,41,-191,-69,-7,-8,-70,-71,-96,-189,-104,41,92,-49,41,-191,41,-17,-18,-74,41,-112,92,92,-159,176,-160,92,92,92,-140,-165,-166,-167,-164,-172,92,-180,-168,-169,-181,-182,-184,-185,-186,-187,-188,92,-18,41,-75,-97,-190,92,-105,-110,-111,-113,92,-34,-36,-37,-28,-29,-30,-31,-32,92,92,92,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,-178,-179,-161,-162,-163,-159,92,92,-98,-106,41,-33,-35,-38,92,92,92,92,-45,-46,-48,92,-141,-142,-143,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,-175,-176,-177,-183,92,-47,92,-173,-174,92,92,92,92,92,-39,-41,92,92,92,-40,-42,92,92,-44,-43,]),'PLUSPLUS':([19,20,49,54,58,60,65,67,80,83,87,88,89,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,208,209,222,223,225,226,227,228,230,231,232,234,236,259,261,262,263,275,276,279,280,281,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,88,-49,-191,-17,-74,88,88,198,88,88,88,-165,-166,-167,-164,-172,88,-180,-168,-169,-181,-182,-184,-185,-186,-187,-188,88,-18,-75,-190,88,88,-34,-36,-37,-28,-29,-30,-31,-32,88,88,88,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,-178,-179,88,88,-33,-35,-38,88,88,88,88,-45,-46,-48,88,-175,-176,-177,-183,88,-47,88,-173,-174,88,88,88,88,88,-39,-41,88,88,88,-40,-42,88,88,-44,-43,]),'MINUSMINUS':([19,20,49,54,58,60,65,67,80,83,87,88,89,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,208,209,222,223,225,226,227,228,230,231,232,234,236,259,261,262,263,275,276,279,280,281,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,89,-49,-191,-17,-74,89,89,199,89,89,89,-165,-166,-167,-164,-172,89,-180,-168,-169,-181,-182,-184,-185,-186,-187,-188,89,-18,-75,-190,89,89,-34,-36,-37,-28,-29,-30,-31,-32,89,89,89,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,-178,-179,89,89,-33,-35,-38,89,89,89,89,-45,-46,-48,89,-175,-176,-177,-183,89,-47,89,-173,-174,89,89,89,89,89,-39,-41,89,89,89,-40,-42,89,89,-44,-43,]),'AND':([19,20,49,54,58,60,65,67,80,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,208,209,222,223,225,226,227,228,230,231,232,234,236,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,275,276,279,280,281,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,95,-49,-191,-17,-74,95,95,-159,189,-160,95,95,95,-140,-165,-166,-167,-164,-172,95,-180,-168,-169,-181,-182,-184,-185,-186,-187,-188,95,-18,-75,-190,95,95,-34,-36,-37,-28,-29,-30,-31,-32,95,95,95,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,-178,-179,-161,-162,-163,-159,95,95,-33,-35,-38,95,95,95,95,-45,-46,-48,95,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,189,189,189,189,-175,-176,-177,-183,95,-47,95,-173,-174,95,95,95,95,95,-39,-41,95,95,95,-40,-42,95,95,-44,-43,]),'PLUS':([19,20,49,54,58,60,65,67,80,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,208,209,222,223,225,226,227,228,230,231,232,234,236,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,275,276,279,280,281,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,93,-49,-191,-17,-74,93,93,-159,179,-160,93,93,93,-140,-165,-166,-167,-164,-172,93,-180,-168,-169,-181,-182,-184,-185,-186,-187,-188,93,-18,-75,-190,93,93,-34,-36,-37,-28,-29,-30,-31,-32,93,93,93,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,-178,-179,-161,-162,-163,-159,93,93,-33,-35,-38,93,93,93,93,-45,-46,-48,93,-141,-142,-143,-144,-145,179,179,179,179,179,179,179,179,179,179,179,179,179,-175,-176,-177,-183,93,-47,93,-173,-174,93,93,93,93,93,-39,-41,93,93,93,-40,-42,93,93,-44,-43,]),'MINUS':([19,20,49,54,58,60,65,67,80,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,208,209,222,223,225,226,227,228,230,231,232,234,236,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,275,276,279,280,281,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,94,-49,-191,-17,-74,94,94,-159,180,-160,94,94,94,-140,-165,-166,-167,-164,-172,94,-180,-168,-169,-181,-182,-184,-185,-186,-187,-188,94,-18,-75,-190,94,94,-34,-36,-37,-28,-29,-30,-31,-32,94,94,94,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,-178,-179,-161,-162,-163,-159,94,94,-33,-35,-38,94,94,94,94,-45,-46,-48,94,-141,-142,-143,-144,-145,180,180,180,180,180,180,180,180,180,180,180,180,180,-175,-176,-177,-183,94,-47,94,-173,-174,94,94,94,94,94,-39,-41,94,94,94,-40,-42,94,94,-44,-43,]),'NOT':([19,20,49,54,58,60,65,67,80,83,88,89,90,92,93,94,95,97,99,100,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,222,223,225,226,227,228,230,231,232,234,236,275,276,279,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,99,-49,-191,-17,-74,99,99,99,99,99,-165,-166,-167,-164,99,-168,-169,99,-18,-75,-190,99,99,-34,-36,-37,-28,-29,-30,-31,-32,99,99,99,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,-33,-35,-38,99,99,99,99,-45,-46,-48,99,99,-47,99,99,99,99,99,99,-39,-41,99,99,99,-40,-42,99,99,-44,-43,]),'LNOT':([19,20,49,54,58,60,65,67,80,83,88,89,90,92,93,94,95,97,99,100,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,222,223,225,226,227,228,230,231,232,234,236,275,276,279,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,100,-49,-191,-17,-74,100,100,100,100,100,-165,-166,-167,-164,100,-168,-169,100,-18,-75,-190,100,100,-34,-36,-37,-28,-29,-30,-31,-32,100,100,100,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,-33,-35,-38,100,100,100,100,-45,-46,-48,100,100,-47,100,100,100,100,100,100,-39,-41,100,100,100,-40,-42,100,100,-44,-43,]),'INT_CONST':([19,20,49,54,58,60,65,67,80,83,88,89,90,92,93,94,95,97,99,100,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,222,223,225,226,227,228,230,231,232,234,236,275,276,279,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,104,-49,-191,-17,-74,104,104,104,104,104,-165,-166,-167,-164,104,-168,-169,104,-18,-75,-190,104,104,-34,-36,-37,-28,-29,-30,-31,-32,104,104,104,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,-33,-35,-38,104,104,104,104,-45,-46,-48,104,104,-47,104,104,104,104,104,104,-39,-41,104,104,104,-40,-42,104,104,-44,-43,]),'FLOAT_CONST':([19,20,49,54,58,60,65,67,80,83,88,89,90,92,93,94,95,97,99,100,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,222,223,225,226,227,228,230,231,232,234,236,275,276,279,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,105,-49,-191,-17,-74,105,105,105,105,105,-165,-166,-167,-164,105,-168,-169,105,-18,-75,-190,105,105,-34,-36,-37,-28,-29,-30,-31,-32,105,105,105,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,-33,-35,-38,105,105,105,105,-45,-46,-48,105,105,-47,105,105,105,105,105,105,-39,-41,105,105,105,-40,-42,105,105,-44,-43,]),'CHAR_CONST':([19,20,49,54,58,60,65,67,80,83,88,89,90,92,93,94,95,97,99,100,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,222,223,225,226,227,228,230,231,232,234,236,275,276,279,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,106,-49,-191,-17,-74,106,106,106,106,106,-165,-166,-167,-164,106,-168,-169,106,-18,-75,-190,106,106,-34,-36,-37,-28,-29,-30,-31,-32,106,106,106,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,106,-33,-35,-38,106,106,106,106,-45,-46,-48,106,106,-47,106,106,106,106,106,106,-39,-41,106,106,106,-40,-42,106,106,-44,-43,]),'STRING_LITERAL':([19,20,49,54,58,60,65,67,80,83,88,89,90,92,93,94,95,97,99,100,110,112,123,127,128,140,141,142,143,144,145,146,147,148,153,157,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,222,223,225,226,227,228,230,231,232,234,236,275,276,279,282,285,286,287,288,292,293,296,297,299,301,302,304,305,306,307,],[-76,-77,-189,107,-49,-191,-17,-74,107,107,107,107,107,-165,-166,-167,-164,107,-168,-169,107,-18,-75,-190,107,107,-34,-36,-37,-28,-29,-30,-31,-32,107,107,107,-127,-128,-129,-130,-131,-132,-133,-134,-135,-136,-137,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,-33,-35,-38,107,107,107,107,-45,-46,-48,107,107,-47,107,107,107,107,107,107,-39,-41,107,107,107,-40,-42,107,107,-44,-43,]),'RBRACKET':([19,20,60,65,67,84,85,86,87,91,96,98,101,102,103,104,105,106,107,110,112,123,158,198,199,200,201,202,203,205,206,207,237,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,259,261,262,263,265,266,271,280,281,290,],[-76,-77,-191,-17,-74,-125,-159,-138,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-191,-18,-75,-123,-178,-179,-161,-162,-163,-159,264,-1,-2,-126,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,280,-175,-176,-177,-183,283,284,-124,-173,-174,-139,]),'LBRACE':([31,32,34,36,39,47,49,50,53,54,55,56,57,58,62,80,83,108,121,127,140,141,142,143,144,145,146,147,148,153,210,211,222,223,225,231,232,234,236,264,276,283,284,285,286,292,293,297,301,302,304,305,306,307,],[49,49,-191,-54,-56,49,-189,49,49,49,-5,-6,-26,-49,-55,49,49,-27,-57,-190,49,-34,-36,-37,-28,-29,-30,-31,-32,49,-61,-62,-33,-35,-38,-45,-46,-48,49,-58,-47,-59,-60,49,49,-39,-41,49,-40,-42,49,49,-44,-43,]),'SEMI':([34,35,36,38,39,49,58,62,78,80,81,82,84,85,86,87,91,96,98,101,102,103,104,105,106,107,109,121,127,132,135,136,139,140,141,142,143,144,145,146,147,148,149,151,153,155,156,157,158,198,199,200,201,202,203,210,211,222,223,224,225,230,231,232,233,234,235,237,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,264,269,271,274,275,276,277,280,281,283,284,285,286,288,289,290,292,293,295,297,298,301,302,304,305,306,307,],[-52,58,-54,-50,-56,-189,-49,-55,-52,-191,-53,-117,-125,-159,-138,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-51,-57,-190,220,-114,-116,-9,-191,-34,-36,-37,-28,-29,-30,-31,-32,225,-10,-191,231,232,234,-123,-178,-179,-161,-162,-163,-159,-61,-62,-33,-35,-9,-38,-191,-45,-46,276,-48,-118,-126,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,-175,-176,-177,-183,-58,-115,-124,288,-191,-47,-119,-173,-174,-59,-60,-191,-191,-191,296,-139,-39,-41,299,-191,302,-40,-42,-191,-191,-44,-43,]),'COMMA':([34,35,36,38,39,62,69,70,71,78,81,82,84,85,86,87,91,96,98,101,102,103,104,105,106,107,109,116,117,118,119,121,124,126,127,135,136,151,158,160,162,198,199,200,201,202,203,204,210,211,214,216,217,218,233,235,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,267,268,270,271,272,277,278,280,281,283,284,290,291,294,],[-52,59,-54,-50,-56,-55,126,-99,-102,-52,-53,-117,-125,-159,-138,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-51,212,213,-63,-66,-57,126,-100,-190,221,-116,227,-123,236,-120,-178,-179,-161,-162,-163,-159,227,-61,-62,-68,-101,-103,-122,227,-118,-126,227,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,227,282,-175,-170,-176,-177,-183,-58,-64,-67,227,-124,227,-119,-121,-173,-174,-59,-60,-139,-171,227,]),'EQUALS':([34,36,39,62,71,78,85,87,96,98,101,102,103,104,105,106,107,121,198,199,200,201,202,203,210,211,259,261,262,263,264,280,281,283,284,],[54,-54,-56,-55,128,54,164,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-57,-178,-179,-161,-162,-163,-159,-61,-62,-175,-176,-177,-183,-58,-173,-174,-59,-60,]),'RPAREN':([36,39,61,62,63,84,85,86,87,91,96,98,101,102,103,104,105,106,107,113,114,115,116,117,118,119,121,151,158,195,198,199,200,201,202,203,204,210,211,214,224,237,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,258,259,260,261,262,263,264,267,268,270,271,272,280,281,283,284,290,291,294,296,299,300,303,],[-54,-56,-191,-55,121,-125,-159,-138,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,210,211,-11,-12,-65,-63,-66,-57,-10,-123,259,-178,-179,-161,-162,-163,-159,263,-61,-62,-68,-9,-126,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,281,-175,-170,-176,-177,-183,-58,-64,-67,285,-124,286,-173,-174,-59,-60,-139,-171,298,-191,-191,304,305,]),'LBRACKET':([36,39,62,87,96,98,101,102,103,104,105,106,107,121,198,199,210,211,259,261,262,263,264,280,281,283,284,],[60,-56,60,194,-172,-180,-181,-182,-184,-185,-186,-187,-188,-57,-178,-179,-61,-62,-175,-176,-177,-183,-58,-173,-174,-59,-60,]),'IF':([49,58,80,127,140,141,142,143,144,145,146,147,148,153,222,223,225,231,232,234,276,285,286,292,293,297,301,302,304,305,306,307,],[-189,-49,150,-190,150,-34,-36,-37,-28,-29,-30,-31,-32,150,-33,-35,-38,-45,-46,-48,-47,150,150,-39,-41,150,-40,-42,150,150,-44,-43,]),'WHILE':([49,58,80,127,140,141,142,143,144,145,146,147,148,153,222,223,225,229,231,232,234,276,285,286,292,293,297,301,302,304,305,306,307,],[-189,-49,152,-190,152,-34,-36,-37,-28,-29,-30,-31,-32,152,-33,-35,-38,273,-45,-46,-48,-47,152,152,-39,-41,152,-40,-42,152,152,-44,-43,]),'DO':([49,58,80,127,140,141,142,143,144,145,146,147,148,153,222,223,225,231,232,234,276,285,286,292,293,297,301,302,304,305,306,307,],[-189,-49,153,-190,153,-34,-36,-37,-28,-29,-30,-31,-32,153,-33,-35,-38,-45,-46,-48,-47,153,153,-39,-41,153,-40,-42,153,153,-44,-43,]),'FOR':([49,58,80,127,140,141,142,143,144,145,146,147,148,153,222,223,225,231,232,234,276,285,286,292,293,297,301,302,304,305,306,307,],[-189,-49,154,-190,154,-34,-36,-37,-28,-29,-30,-31,-32,154,-33,-35,-38,-45,-46,-48,-47,154,154,-39,-41,154,-40,-42,154,154,-44,-43,]),'BREAK':([49,58,80,127,140,141,142,143,144,145,146,147,148,153,222,223,225,231,232,234,276,285,286,292,293,297,301,302,304,305,306,307,],[-189,-49,155,-190,155,-34,-36,-37,-28,-29,-30,-31,-32,155,-33,-35,-38,-45,-46,-48,-47,155,155,-39,-41,155,-40,-42,155,155,-44,-43,]),'CONTINUE':([49,58,80,127,140,141,142,143,144,145,146,147,148,153,222,223,225,231,232,234,276,285,286,292,293,297,301,302,304,305,306,307,],[-189,-49,156,-190,156,-34,-36,-37,-28,-29,-30,-31,-32,156,-33,-35,-38,-45,-46,-48,-47,156,156,-39,-41,156,-40,-42,156,156,-44,-43,]),'RETURN':([49,58,80,127,140,141,142,143,144,145,146,147,148,153,222,223,225,231,232,234,276,285,286,292,293,297,301,302,304,305,306,307,],[-189,-49,157,-190,157,-34,-36,-37,-28,-29,-30,-31,-32,157,-33,-35,-38,-45,-46,-48,-47,157,157,-39,-41,157,-40,-42,157,157,-44,-43,]),'RBRACE':([49,58,69,70,71,73,74,80,82,83,84,85,86,87,91,96,98,101,102,103,104,105,106,107,124,126,127,129,131,138,139,140,141,142,143,144,145,146,147,148,159,160,161,162,198,199,200,201,202,203,216,217,218,220,222,223,225,231,232,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,276,277,278,280,281,290,292,293,301,302,306,307,],[-189,-49,127,-99,-102,127,-107,-191,-117,-191,-125,-159,-138,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,127,-100,-190,127,-108,127,-3,-4,-34,-36,-37,-28,-29,-30,-31,-32,127,-16,-15,-120,-178,-179,-161,-162,-163,-159,-101,-103,-122,-109,-33,-35,-38,-45,-46,-48,-118,127,-126,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,-175,-176,-177,-183,-47,-119,-121,-173,-174,-139,-39,-41,-40,-42,-44,-43,]),'COLON':([84,85,86,87,91,96,98,101,102,103,104,105,106,107,158,198,199,200,201,202,203,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,271,280,281,290,],[-125,-159,-138,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-123,-178,-179,-161,-162,-163,-159,-126,279,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,-175,-176,-177,-183,-124,-173,-174,-139,]),'CONDOP':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,175,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,-175,-176,-177,-183,-173,-174,]),'DIVIDE':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,177,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,-175,-176,-177,-183,-173,-174,]),'MOD':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,178,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,-175,-176,-177,-183,-173,-174,]),'LSHIFT':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,181,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,181,181,181,181,181,181,181,181,181,181,181,-175,-176,-177,-183,-173,-174,]),'RSHIFT':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,182,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,182,182,182,182,182,182,182,182,182,182,182,-175,-176,-177,-183,-173,-174,]),'GT':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,183,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,183,183,183,183,183,183,183,-175,-176,-177,-183,-173,-174,]),'GE':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,184,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,184,184,184,184,184,184,184,-175,-176,-177,-183,-173,-174,]),'LT':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,185,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,185,185,185,185,185,185,185,-175,-176,-177,-183,-173,-174,]),'LE':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,186,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,186,186,186,186,186,186,186,-175,-176,-177,-183,-173,-174,]),'EQ':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,187,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,187,187,187,187,187,-175,-176,-177,-183,-173,-174,]),'NE':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,188,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,188,188,188,188,188,-175,-176,-177,-183,-173,-174,]),'XOR':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,190,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,190,190,190,-175,-176,-177,-183,-173,-174,]),'OR':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,191,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,191,191,-175,-176,-177,-183,-173,-174,]),'LAND':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,192,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,192,-175,-176,-177,-183,-173,-174,]),'LOR':([85,86,87,91,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,259,261,262,263,280,281,],[-159,193,-160,-140,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-141,-142,-143,-144,-145,-146,-147,-148,-149,-150,-151,-152,-153,-154,-155,-156,-157,-158,-175,-176,-177,-183,-173,-174,]),'XOREQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[165,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'TIMESEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[166,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'DIVEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[167,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'MODEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[168,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'PLUSEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[169,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'MINUSEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[170,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'LSHIFTEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[171,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'RSHIFTEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[172,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'ANDEQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[173,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'OREQUAL':([85,87,96,98,101,102,103,104,105,106,107,198,199,200,201,202,203,259,261,262,263,280,281,],[174,-160,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-161,-162,-163,-159,-175,-176,-177,-183,-173,-174,]),'PERIOD':([87,96,98,101,102,103,104,105,106,107,198,199,259,261,262,263,280,281,],[196,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-175,-176,-177,-183,-173,-174,]),'ARROW':([87,96,98,101,102,103,104,105,106,107,198,199,259,261,262,263,280,281,],[197,-172,-180,-181,-182,-184,-185,-186,-187,-188,-178,-179,-175,-176,-177,-183,-173,-174,]),'ELSE':([127,144,145,146,147,148,222,225,231,232,234,276,292,293,301,302,306,307,],[-190,-28,-29,-30,-31,-32,-33,-38,-45,-46,-48,-47,297,-41,-40,-42,-44,-43,]),} _lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'translation_unit_or_empty':([0,],[1,]),'translation_unit':([0,],[2,]),'empty':([0,8,9,10,34,41,60,61,80,83,110,140,153,230,275,285,286,288,296,297,299,304,305,],[3,43,43,43,55,65,65,115,139,161,206,224,224,224,224,224,224,224,224,224,224,224,224,]),'external_declaration':([0,2,],[4,33,]),'function_defination':([0,2,],[5,5,]),'declaration':([0,2,34,56,80,140,230,],[6,6,57,108,142,142,275,]),'declaration_specifiers':([0,2,8,9,10,34,56,61,80,140,213,230,],[7,7,44,44,44,52,52,120,52,52,120,52,]),'storage_class_specifier':([0,2,8,9,10,34,56,61,80,140,213,230,],[8,8,8,8,8,8,8,8,8,8,8,8,]),'type_specifier':([0,2,8,9,10,34,51,56,61,72,73,75,77,80,129,140,213,230,],[9,9,9,9,9,9,76,9,9,76,76,133,137,9,76,9,9,9,]),'type_qualifier':([0,2,8,9,10,34,41,51,56,60,61,66,72,73,75,77,80,111,112,129,140,208,213,230,],[10,10,10,10,10,10,67,67,10,67,10,123,67,67,134,123,10,67,123,67,10,123,10,10,]),'type_specifier_simple':([0,2,8,9,10,34,51,56,61,72,73,75,77,80,129,140,213,230,],[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,]),'enum_specifier':([0,2,8,9,10,34,51,56,61,72,73,75,77,80,129,140,213,230,],[17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,]),'struct_specifier':([0,2,8,9,10,34,51,56,61,72,73,75,77,80,129,140,213,230,],[18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,]),'declarator':([7,40,52,59,75,120,221,],[34,63,78,78,136,214,136,]),'init_declarator_list':([7,52,],[35,35,]),'direct_declarator':([7,37,40,52,59,75,120,221,],[36,62,36,36,36,36,36,36,]),'pointer':([7,40,52,59,64,75,120,221,],[37,37,37,37,122,37,37,37,]),'init_declarator':([7,52,59,],[38,38,109,]),'declaration_specifiers_opt':([8,9,10,],[42,45,46,]),'brace_open':([31,32,47,50,53,54,80,83,140,153,236,285,286,297,304,305,],[48,51,68,72,80,83,80,83,80,80,83,80,80,80,80,80,]),'declaration_list_opt':([34,],[53,]),'declaration_list':([34,],[56,]),'type_qualifier_list_opt':([41,60,],[64,110,]),'type_qualifier_list':([41,51,60,72,73,111,129,],[66,77,112,77,77,208,77,]),'enumerator_list':([48,68,],[69,124,]),'enumerator':([48,68,126,],[70,70,216,]),'struct_declaration_list':([51,72,],[73,129,]),'struct_declaration':([51,72,73,129,],[74,74,131,131,]),'specifier_qualifier_list':([51,72,73,129,],[75,75,75,75,]),'compound_statement':([53,80,140,153,285,286,297,304,305,],[79,145,145,145,145,145,145,145,145,]),'initializer':([54,83,236,],[81,162,278,]),'assignment_expression':([54,80,83,97,110,140,153,157,163,175,194,195,208,209,226,227,228,230,236,275,282,285,286,287,288,296,297,299,304,305,],[82,158,82,158,207,158,158,158,237,158,158,260,265,266,158,271,158,158,82,158,291,158,158,158,158,158,158,158,158,158,]),'conditional_expression':([54,80,83,97,110,128,140,153,157,163,175,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[84,84,84,84,84,218,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,290,84,84,84,84,84,84,84,84,84,84,]),'unary_expression':([54,80,83,88,89,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[85,85,85,200,201,203,85,85,203,85,85,85,85,85,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,85,85,85,85,85,85,85,85,85,85,203,85,85,85,85,85,85,85,85,85,85,]),'binary_expression':([54,80,83,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[86,86,86,86,86,86,86,86,86,86,86,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,]),'postfix_expression':([54,80,83,88,89,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,]),'unary_operator':([54,80,83,88,89,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,]),'cast_expression':([54,80,83,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[91,91,91,202,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,]),'primary_expression':([54,80,83,88,89,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,]),'identifier':([54,61,80,83,88,89,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,208,209,212,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[98,118,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,261,262,98,98,267,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,]),'constant':([54,80,83,88,89,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,]),'string_literal':([54,80,83,88,89,90,97,110,128,140,153,157,163,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,208,209,226,227,228,230,236,275,279,282,285,286,287,288,296,297,299,304,305,],[102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,]),'identifier_list_opt':([61,],[113,]),'parameter_type_list':([61,],[114,]),'identifier_list':([61,],[116,]),'parameter_list':([61,],[117,]),'parameter_declaration':([61,213,],[119,268,]),'brace_close':([69,73,124,129,138,159,236,],[125,130,215,219,222,235,277,]),'struct_declarator_list':([75,],[132,]),'struct_declarator':([75,221,],[135,269,]),'block_item_list_opt':([80,],[138,]),'block_item_list':([80,],[140,]),'block_item':([80,140,],[141,223,]),'statement':([80,140,153,285,286,297,304,305,],[143,143,229,292,293,301,306,307,]),'expression_statement':([80,140,153,285,286,297,304,305,],[144,144,144,144,144,144,144,144,]),'selection_statement':([80,140,153,285,286,297,304,305,],[146,146,146,146,146,146,146,146,]),'iteration_statement':([80,140,153,285,286,297,304,305,],[147,147,147,147,147,147,147,147,]),'jump_statement':([80,140,153,285,286,297,304,305,],[148,148,148,148,148,148,148,148,]),'expression_opt':([80,140,153,230,275,285,286,288,296,297,299,304,305,],[149,149,149,274,289,149,149,295,300,149,303,149,149,]),'expression':([80,97,140,153,157,175,194,226,228,230,275,285,286,287,288,296,297,299,304,305,],[151,204,151,151,233,238,257,270,272,151,151,151,151,294,151,151,151,151,151,151,]),'initializer_list_opt':([83,],[159,]),'initializer_list':([83,],[160,]),'assignment_operator':([85,],[163,]),'assignment_expression_opt':([110,],[205,]),'constant_expression':([128,],[217,]),'argument_expression_list':([195,],[258,]),} _lr_goto = {} for _k, _v in _lr_goto_items.items(): for _x, _y in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> translation_unit_or_empty","S'",1,None,None,None), ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','utils.py',45), ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','utils.py',46), ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','utils.py',45), ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','utils.py',46), ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','utils.py',45), ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','utils.py',46), ('declaration_specifiers_opt -> empty','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','utils.py',45), ('declaration_specifiers_opt -> declaration_specifiers','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','utils.py',46), ('expression_opt -> empty','expression_opt',1,'p_expression_opt','utils.py',45), ('expression_opt -> expression','expression_opt',1,'p_expression_opt','utils.py',46), ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','utils.py',45), ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','utils.py',46), ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','utils.py',45), ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','utils.py',46), ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','utils.py',45), ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','utils.py',46), ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','utils.py',45), ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','utils.py',46), ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',409), ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',410), ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit','c_parser.py',418), ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit','c_parser.py',419), ('external_declaration -> function_defination','external_declaration',1,'p_external_declaration_1','c_parser.py',428), ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',432), ('function_defination -> declaration_specifiers declarator declaration_list_opt compound_statement','function_defination',4,'p_function_defination','c_parser.py',436), ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',449), ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',450), ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',460), ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',461), ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',462), ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',463), ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',464), ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement','c_parser.py',469), ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',473), ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',474), ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',481), ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',482), ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',487), ('selection_statement -> IF LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_1','c_parser.py',494), ('selection_statement -> IF LPAREN expression RPAREN statement ELSE statement','selection_statement',7,'p_selection_statement_2','c_parser.py',498), ('iteration_statement -> WHILE LPAREN expression RPAREN statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',502), ('iteration_statement -> DO statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',506), ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',510), ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',514), ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_1','c_parser.py',519), ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',523), ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_3','c_parser.py',527), ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',528), ('declaration -> declaration_specifiers init_declarator_list SEMI','declaration',3,'p_declaration','c_parser.py',539), ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',548), ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',549), ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',556), ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',557), ('declarator -> direct_declarator','declarator',1,'p_declarator','c_parser.py',565), ('declarator -> pointer direct_declarator','declarator',2,'p_declarator','c_parser.py',566), ('direct_declarator -> ID','direct_declarator',1,'p_direct_declarator_1','c_parser.py',571), ('direct_declarator -> LPAREN declarator RPAREN','direct_declarator',3,'p_direct_declarator_2','c_parser.py',579), ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_declarator',5,'p_direct_declarator_3','c_parser.py',583), ('direct_declarator -> direct_declarator LBRACKET STATIC type_qualifier_list assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','c_parser.py',593), ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','c_parser.py',594), ('direct_declarator -> direct_declarator LPAREN identifier_list_opt RPAREN','direct_declarator',4,'p_direct_declarator_6','c_parser.py',606), ('direct_declarator -> direct_declarator LPAREN parameter_type_list RPAREN','direct_declarator',4,'p_direct_declarator_6','c_parser.py',607), ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',621), ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',622), ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',633), ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',637), ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',638), ('parameter_declaration -> declaration_specifiers declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',647), ('declaration_specifiers -> storage_class_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',674), ('declaration_specifiers -> type_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',678), ('declaration_specifiers -> type_qualifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',682), ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',690), ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',691), ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',708), ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',709), ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',714), ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',715), ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',720), ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',721), ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',722), ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',723), ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',724), ('type_specifier -> type_specifier_simple','type_specifier',1,'p_type_specifier','c_parser.py',731), ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',732), ('type_specifier -> struct_specifier','type_specifier',1,'p_type_specifier','c_parser.py',733), ('type_specifier_simple -> VOID','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',738), ('type_specifier_simple -> CHAR','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',739), ('type_specifier_simple -> SHORT','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',740), ('type_specifier_simple -> INT','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',741), ('type_specifier_simple -> LONG','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',742), ('type_specifier_simple -> FLOAT','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',743), ('type_specifier_simple -> DOUBLE','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',744), ('type_specifier_simple -> SIGNED','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',745), ('type_specifier_simple -> UNSIGNED','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',746), ('type_specifier_simple -> TYPEID','type_specifier_simple',1,'p_type_specifier_simple','c_parser.py',747), ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',755), ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',759), ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',764), ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',769), ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',770), ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',771), ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',782), ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',783), ('struct_specifier -> STRUCT ID','struct_specifier',2,'p_struct_specifier_1','c_parser.py',803), ('struct_specifier -> STRUCT brace_open struct_declaration_list brace_close','struct_specifier',4,'p_struct_specifier_2','c_parser.py',812), ('struct_specifier -> STRUCT ID brace_open struct_declaration_list brace_close','struct_specifier',5,'p_struct_specifier_3','c_parser.py',821), ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',830), ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',831), ('struct_declaration -> specifier_qualifier_list struct_declarator_list SEMI','struct_declaration',3,'p_struct_declaration','c_parser.py',841), ('specifier_qualifier_list -> specifier_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',854), ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',859), ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',864), ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',869), ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',879), ('struct_declarator_list -> struct_declarator COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',880), ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator','c_parser.py',887), ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',901), ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',905), ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',906), ('initializer_list -> initializer','initializer_list',1,'p_initializer_list','c_parser.py',914), ('initializer_list -> initializer_list COMMA initializer','initializer_list',3,'p_initializer_list','c_parser.py',915), ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',927), ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',935), ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',936), ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',950), ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',951), ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',961), ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',962), ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',963), ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',964), ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',965), ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',966), ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',967), ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',968), ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',969), ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',970), ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',971), ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',979), ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',980), ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',992), ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',993), ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',994), ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',995), ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',996), ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',997), ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',998), ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',999), ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1000), ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1001), ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1002), ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1003), ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1004), ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1005), ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1006), ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1007), ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1008), ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1009), ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1010), ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1023), ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1036), ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1040), ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1041), ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1042), ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1048), ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1049), ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1050), ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1051), ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1052), ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1053), ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1060), ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1061), ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1074), ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1078), ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1082), ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1083), ('postfix_expression -> postfix_expression PERIOD identifier','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1088), ('postfix_expression -> postfix_expression ARROW identifier','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1089), ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1096), ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1097), ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1106), ('primary_expression -> constant','primary_expression',1,'p_primary_expression_1','c_parser.py',1107), ('primary_expression -> string_literal','primary_expression',1,'p_primary_expression_1','c_parser.py',1108), ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_2','c_parser.py',1113), ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1119), ('constant -> INT_CONST','constant',1,'p_constant_1','c_parser.py',1125), ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1141), ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1151), ('string_literal -> STRING_LITERAL','string_literal',1,'p_string_literal','c_parser.py',1157), ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1162), ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1167), ('empty -> <empty>','empty',0,'p_empty','c_parser.py',1174), ]
381.54955
43,002
0.680499
16,756
84,704
3.332478
0.038553
0.021687
0.027884
0.013969
0.746038
0.670374
0.614517
0.585899
0.558284
0.51387
0
0.407748
0.06106
84,704
221
43,003
383.276018
0.294347
0.000992
0
0.009479
1
0.004739
0.357632
0.084063
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a0d07493d2ab9895cf8b97e0481b8415e4105e9c
75
py
Python
get_results.py
UCL/scikit-surgeryfredwebapp
3e22fc8b9d0898502a5f8a6c8cc813dc62fc3fd5
[ "BSD-3-Clause" ]
5
2020-10-22T01:41:33.000Z
2022-01-07T08:55:39.000Z
get_results.py
UCL/scikit-surgeryfred
3e60a67fced1ca38f54920ccf37043588bdb1401
[ "BSD-3-Clause" ]
62
2020-06-05T10:54:04.000Z
2021-05-18T19:31:27.000Z
get_results.py
UCL/scikit-surgeryfredwebapp
3e22fc8b9d0898502a5f8a6c8cc813dc62fc3fd5
[ "BSD-3-Clause" ]
1
2020-06-25T09:59:53.000Z
2020-06-25T09:59:53.000Z
from sksurgeryfred.utilities.get_results import get_results get_results()
18.75
59
0.866667
10
75
6.2
0.6
0.483871
0
0
0
0
0
0
0
0
0
0
0.08
75
3
60
25
0.898551
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a0e51268ddacbe09599241b6b8faeaf6fc5aee65
196
py
Python
install.py
priestc/MultiExplorer
5c991cc55fc50155212cda6208dae744e9777d77
[ "MIT" ]
18
2016-07-12T01:22:40.000Z
2022-03-01T08:36:04.000Z
install.py
priestc/MultiExplorer
5c991cc55fc50155212cda6208dae744e9777d77
[ "MIT" ]
14
2016-07-12T01:46:23.000Z
2021-09-22T17:37:41.000Z
install.py
priestc/MultiExplorer
5c991cc55fc50155212cda6208dae744e9777d77
[ "MIT" ]
15
2016-07-12T20:55:14.000Z
2019-10-11T04:25:33.000Z
import os os.system("pip install -r requirements.txt") os.system("cp local_settings_default.py multiexplorer/multiexplorer/local_settings.py") os.system("python multiexplorer/manage.py migrate")
32.666667
87
0.816327
28
196
5.607143
0.607143
0.152866
0
0
0
0
0
0
0
0
0
0
0.066327
196
5
88
39.2
0.857924
0
0
0
0
0
0.729592
0.47449
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
a0eb50b6123e301247880f505c8034a0b816358a
116,241
py
Python
swiftcmdbench/run.py
huaweicloud-obs/swiftcmdbench
68002e49887387a4ed86c12b1341bb38a104d255
[ "Apache-2.0" ]
null
null
null
swiftcmdbench/run.py
huaweicloud-obs/swiftcmdbench
68002e49887387a4ed86c12b1341bb38a104d255
[ "Apache-2.0" ]
null
null
null
swiftcmdbench/run.py
huaweicloud-obs/swiftcmdbench
68002e49887387a4ed86c12b1341bb38a104d255
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # -*- coding:utf-8 -*- import sys import os import time import math import random import logging import logging.config import datetime import hashlib import base64 import multiprocessing import results import Util import s3PyCmd import myLib.cloghandler class User: doc = """ This is user class """ def __init__(self, username, ak, sk): self.username = username self.ak = ak self.sk = sk def read_config(config_file='config.dat'): """ :rtype : None :param config_file: string """ try: f = open(config_file, 'r') lines = f.readlines() for line in lines: line = line.strip() if line and line[0] != '#': CONFIG[line[:line.find('=')].strip()] = line[line.find('=') + 1:].strip() else: continue f.close() CONFIG['OSCs'] = CONFIG['OSCs'].replace(' ', '').replace(',,', ',') if CONFIG['OSCs'][-1:] == ',': CONFIG['OSCs'] = CONFIG['OSCs'][:-1] if CONFIG['IsHTTPs'].lower() == 'true': CONFIG['IsHTTPs'] = True else: CONFIG['IsHTTPs'] = False CONFIG['ConnectTimeout'] = int(CONFIG['ConnectTimeout']) if int(CONFIG['ConnectTimeout']) < 5: CONFIG['ConnectTimeout'] = 5 if CONFIG['LongConnection'].lower() == 'true': CONFIG['LongConnection'] = True else: CONFIG['LongConnection'] = False if CONFIG['UseDomainName'].lower() == 'true': CONFIG['UseDomainName'] = True # 如果使用域名,则OSCs为域名 CONFIG['OSCs'] = CONFIG['DomainName'] else: CONFIG['UseDomainName'] = False if CONFIG['VirtualHost'].lower() == 'true': CONFIG['VirtualHost'] = True else: CONFIG['VirtualHost'] = False if CONFIG['ObjectLexical'].lower() == 'true': CONFIG['ObjectLexical'] = True else: CONFIG['ObjectLexical'] = False if CONFIG['CalHashMD5'].lower() == 'true': CONFIG['CalHashMD5'] = True else: CONFIG['CalHashMD5'] = False CONFIG['Testcase'] = int(CONFIG['Testcase']) CONFIG['Users'] = int(CONFIG['Users']) CONFIG['UserStartIndex'] = int(CONFIG['UserStartIndex']) CONFIG['ThreadsPerUser'] = int(CONFIG['ThreadsPerUser']) CONFIG['Threads'] = CONFIG['Users'] * CONFIG['ThreadsPerUser'] CONFIG['RequestsPerThread'] = int(CONFIG['RequestsPerThread']) CONFIG['BucketsPerUser'] = int(CONFIG['BucketsPerUser']) if CONFIG['copyDstObjFiexed'] and '/' not in CONFIG['copyDstObjFiexed']: CONFIG['copyDstObjFiexed'] = '' if CONFIG['copySrcObjFixed'] and '/' not in CONFIG['copySrcObjFixed']: CONFIG['copySrcObjFixed'] = '' CONFIG['ObjectsPerBucketPerThread'] = int(CONFIG['ObjectsPerBucketPerThread']) CONFIG['DeleteObjectsPerRequest'] = int(CONFIG['DeleteObjectsPerRequest']) CONFIG['PartsForEachUploadID'] = int(CONFIG['PartsForEachUploadID']) if CONFIG['ConcurrentUpParts'].lower() == 'true': CONFIG['ConcurrentUpParts'] = True if CONFIG['PartsForEachUploadID'] % CONFIG['ThreadsPerUser']: if CONFIG['PartsForEachUploadID'] < CONFIG['ThreadsPerUser']: CONFIG['PartsForEachUploadID'] = CONFIG['ThreadsPerUser'] else: CONFIG['PartsForEachUploadID'] = int( round(1.0 * CONFIG['PartsForEachUploadID'] / CONFIG['ThreadsPerUser']) * CONFIG[ 'ThreadsPerUser']) logging.info('change PartsForEachUploadID to %d' % CONFIG['PartsForEachUploadID']) else: CONFIG['ConcurrentUpParts'] = False CONFIG['PutTimesForOneObj'] = int(CONFIG['PutTimesForOneObj']) CONFIG['MixLoopCount'] = int(CONFIG['MixLoopCount']) if CONFIG['RunSeconds']: CONFIG['RunSeconds'] = int(CONFIG['RunSeconds']) if CONFIG['RecordDetails'].lower() == 'true': CONFIG['RecordDetails'] = True else: CONFIG['RecordDetails'] = False CONFIG['StatisticsInterval'] = int(CONFIG['StatisticsInterval']) if CONFIG['BadRequestCounted'].lower() == 'true': CONFIG['BadRequestCounted'] = True else: CONFIG['BadRequestCounted'] = False if CONFIG['AvoidSinBkOp'].lower() == 'true': CONFIG['AvoidSinBkOp'] = True else: CONFIG['AvoidSinBkOp'] = False if CONFIG['PrintProgress'].lower() == 'true': CONFIG['PrintProgress'] = True else: CONFIG['PrintProgress'] = False if not ('processID' in CONFIG['ObjectNamePartten'] and 'ObjectNamePrefix' in CONFIG[ 'ObjectNamePartten'] and 'Index' in CONFIG['ObjectNamePartten']): raise Exception('both of processID,Index,ObjectNamePartten should be in config ObjectNamePartten') except Exception, e: print '[ERROR] Read config file %s error: %s' % (config_file, e) sys.exit() def read_users(): """ load users.dat """ global USERS, CONFIG index = -1 try: with open('./users.dat', 'r') as fd: for line in fd: if not line: continue index += 1 if index >= CONFIG['UserStartIndex'] and len(USERS) <= CONFIG['Users']: user_info = line.strip() user = User(user_info.split(',')[0], user_info.split(',')[1], user_info.split(',')[2]) USERS.append(user) fd.close() logging.debug("load user file end") except Exception, data: print "\033[1;31;40m[ERROR]\033[0m Load users Error, check file users.dat. Use iamPyTool.py to create users [%r]" % ( data) logging.error( 'Load users Error, check file users.dat. Use iamPyTool.py to create users') sys.exit() def list_user_buckets(process_id, user, conn, result_queue): request_type = 'ListUserBuckets' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) i = 0 while i < CONFIG['RequestsPerThread']: i += 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swiftlist_user_containers(process_id, user, conn, result_queue): request_type = 'swiftListUserContainers' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk) rest.headers['X-auth-token'] = user.sk i = 0 while i < CONFIG['RequestsPerThread']: i += 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swiftcreate_container(process_id, user, conn, result_queue): request_type = 'swiftCreateContainer' sendContent = '' rest = s3PyCmd.S3RequestDescriptor(request_type, ak = user.ak, sk = user.sk, send_content = sendContent) rest.headers['X-auth-token'] = user.sk i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) #rest.bucket = '%s.%d' % (CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swifthead_container(process_id, user, conn, result_queue): request_type = 'swiftHeadContainer' sendContent = '' rest = s3PyCmd.S3RequestDescriptor(request_type, ak = user.ak, sk = user.sk, send_content = sendContent) rest.headers['X-auth-token'] = user.sk i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def create_bucket(process_id, user, conn, result_queue): request_type = 'CreateBucket' send_content = '' if CONFIG['BucketLocation']: send_content = '<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">\ <LocationConstraint>%s</LocationConstraint></CreateBucketConfiguration >' % random.choice( CONFIG['BucketLocation'].split(',')) rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], send_content=send_content, virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) if CONFIG['CreateWithACL']: rest.headers['x-amz-acl'] = CONFIG['CreateWithACL'] if CONFIG['MDCPolicy']: rest.headers['x-hws-mdc-storage-policy'] = CONFIG['MDCPolicy'] if CONFIG['StorageClass']: rest.headers['x-default-storage-class'] = CONFIG['StorageClass'] i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swiftlist_objects_in_container(process_id, user, conn, result_queue): request_type = 'swiftListObjectsInContainer' rest = s3PyCmd.S3RequestDescriptor(request_type, ak = user.ak, sk = user.sk) rest.headers['X-auth-token'] = user.sk rest.queryArgs['limit'] = CONFIG['Max-keys'] i = 0 if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i = i + 1 marker = '' while marker != None: rest.queryArgs['marker'] = marker resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() marker = resp.return_data result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def list_objects_in_bucket(process_id, user, conn, result_queue): request_type = 'ListObjectsInBucket' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['max-keys'] = CONFIG['Max-keys'] i = 0 if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 marker = '' while marker is not None: rest.queryArgs['marker'] = marker resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() marker = resp.return_data result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def head_bucket(process_id, user, conn, result_queue): request_type = 'HeadBucket' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swiftdelete_container(process_id, user, conn, result_queue): request_type = 'swiftDeleteContainer' sendContent = '' rest = s3PyCmd.S3RequestDescriptor(request_type, ak = user.ak, sk = user.sk, send_content = sendContent) rest.headers['X-auth-token'] = user.sk i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def delete_bucket(process_id, user, conn, result_queue): request_type = 'DeleteBucket' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def bucket_delete(process_id, user, conn, result_queue): request_type = 'BucketDelete' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['deletebucket'] = None i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] rest.sendContent = '<?xml version="1.0" encoding="UTF-8"?><DeleteBucket><Bucket>' + rest.bucket + '</Bucket></DeleteBucket>' resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def options_bucket(process_id, user, conn, result_queue): request_type = 'OPTIONSBucket' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.headers['Access-Control-Request-Method'] = 'GET' rest.headers['Origin'] = CONFIG['DomainName'] i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def put_bucket_versioning(process_id, user, conn, result_queue): request_type = 'PutBucketVersioning' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['versioning'] = None rest.sendContent = '<VersioningConfiguration><Status>%s</Status></VersioningConfiguration>' % CONFIG[ 'VersionStatus'] rest.headers['Content-MD5'] = base64.b64encode(hashlib.md5(rest.sendContent).digest()) i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) logging.info('bucket:' + rest.bucket) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def get_bucket_versioning(process_id, user, conn, result_queue): request_type = 'GetBucketVersioning' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['versioning'] = None i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def put_bucket_website(process_id, user, conn, result_queue): request_type = 'PutBucketWebsite' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['website'] = None i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] rest.sendContent = '<WebsiteConfiguration><RedirectAllRequestsTo><HostName>' + CONFIG[ 'RedirectHostName'] + '</HostName></RedirectAllRequestsTo></WebsiteConfiguration>' resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def get_bucket_website(process_id, user, conn, result_queue): request_type = 'GetBucketWebsite' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['website'] = None i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def delete_bucket_website(process_id, user, conn, result_queue): request_type = 'DeleteBucketWebsite' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['website'] = None i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] rest.sendContent = '<WebsiteConfiguration><RedirectAllRequestsTo><HostName>' + CONFIG[ 'RedirectHostName'] + '</HostName></RedirectAllRequestsTo></WebsiteConfiguration>' resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def put_bucket_cors(process_id, user, conn, result_queue): request_type = 'PutBucketCORS' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['cors'] = None rest.sendContent = '<CORSConfiguration><CORSRule><AllowedMethod>GET</AllowedMethod><AllowedOrigin>%s</AllowedOrigin></CORSRule></CORSConfiguration>' % \ CONFIG['DomainName'] rest.headers['Content-MD5'] = base64.b64encode(hashlib.md5(rest.sendContent).digest()) i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def get_bucket_cors(process_id, user, conn, result_queue): request_type = 'GetBucketCORS' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['cors'] = None i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def delete_bucket_cors(process_id, user, conn, result_queue): request_type = 'DeleteBucketCORS' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['cors'] = None i = process_id % CONFIG['ThreadsPerUser'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += CONFIG['ThreadsPerUser'] rest.sendContent = '<WebsiteConfiguration><RedirectAllRequestsTo><HostName>' + CONFIG[ 'RedirectHostName'] + '</HostName></RedirectAllRequestsTo></WebsiteConfiguration>' resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def put_object(process_id, user, conn, result_queue): request_type = 'PutObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.headers['content-type'] = 'application/octet-stream' if CONFIG['PutWithACL']: rest.headers['x-amz-acl'] = CONFIG['PutWithACL'] fixed_size = False if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' elif CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG['SrvSideEncryptAlgorithm'].lower() == 'aws:kms': rest.headers['x-amz-server-side-encryption'] = 'aws:kms' if CONFIG['SrvSideEncryptAWSKMSKeyId']: rest.headers['x-amz-server-side-encryption-aws-kms-key-id'] = CONFIG['SrvSideEncryptAWSKMSKeyId'] if CONFIG['SrvSideEncryptContext']: rest.headers['x-amz-server-side-encryption-context'] = CONFIG['SrvSideEncryptContext'] elif CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG['SrvSideEncryptAlgorithm'].lower() == 'aes256': rest.headers['x-amz-server-side-encryption'] = 'AES256' # 如果打开CalHashMD5开关,在对象上传时写入一个自定义元数据,用于标记为本工具put上传的对象。 if CONFIG['CalHashMD5']: rest.headers['x-amz-meta-md5written'] = 'yes' # 对象多版本,需要在上传后记录下版本号 obj_v = '' obj_v_file = 'data/objv-%d.dat' % process_id open(obj_v_file, 'w').write(obj_v) # 错开每个并发起始选桶,避免单桶性能瓶颈。 range_arr = range(0, CONFIG['BucketsPerUser']) if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0, process_id % CONFIG[ 'BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: if CONFIG['ObjectLexical']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str( j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) else: rest.key = Util.random_string_create(random.randint(300, 1024)) if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) logging.debug('side-encryption-customer-key: [%r]' % rest.key[-32:].zfill(32)) j += 1 put_times_for_one_obj = CONFIG['PutTimesForOneObj'] while put_times_for_one_obj > 0: if not fixed_size: # change size every request for the same obj. rest.contentLength, fixed_size = Util.generate_a_size(CONFIG['ObjectSize']) put_times_for_one_obj -= 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) if resp.return_data: obj_v += '%s\t%s\t%s\n' % (rest.bucket, rest.key, resp.return_data) # 每1KB,写入对象的versionID到本地文件objv-process_id.dat if len(obj_v) >= 1024: logging.info('write obj_v to file %s' % obj_v_file) open(obj_v_file, 'a').write(obj_v) obj_v = '' if obj_v: open(obj_v_file, 'a').write(obj_v) def swiftput_object(process_id, user, conn, result_queue): request_type = 'swiftPutObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk) rest.headers['content-type'] = 'application/octet-stream' rest.headers['X-auth-token'] = user.sk fixed_size = False if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] # 如果打开CalHashMD5开关,在对象上传时写入一个自定义元数据,用于标记为本工具put上传的对象。 if CONFIG['CalHashMD5']: rest.headers['x-amz-meta-md5written'] = 'yes' # 对象多版本,需要在上传后记录下版本号 obj_v = '' obj_v_file = 'data/objv-%d.dat' % process_id open(obj_v_file, 'w').write(obj_v) # 错开每个并发起始选桶,避免单桶性能瓶颈。 range_arr = range(0, CONFIG['BucketsPerUser']) if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0, process_id % CONFIG[ 'BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) # rest.bucket = '%s.%d' % (CONFIG['BucketNamePrefix'], i) j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: if CONFIG['ObjectLexical']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str( j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) else: rest.key = Util.random_string_create(random.randint(300, 1024)) j += 1 put_times_for_one_obj = CONFIG['PutTimesForOneObj'] while put_times_for_one_obj > 0: if not fixed_size: # change size every request for the same obj. rest.contentLength, fixed_size = Util.generate_a_size(CONFIG['ObjectSize']) put_times_for_one_obj -= 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) if resp.return_data: obj_v += '%s\t%s\t%s\n' % (rest.bucket, rest.key, resp.return_data) # 每1KB,写入对象的versionID到本地文件objv-process_id.dat if len(obj_v) >= 1024: logging.info('write obj_v to file %s' % obj_v_file) open(obj_v_file, 'a').write(obj_v) obj_v = '' if obj_v: open(obj_v_file, 'a').write(obj_v) def handle_from_objects(request_type, rest, process_id, user, conn, result_queue): """ :type result_queue: Queue """ global OBJECTS objects_per_user = len(OBJECTS) / CONFIG['Threads'] if objects_per_user == 0: if process_id >= len(OBJECTS): return else: start_index = end_index = process_id else: extra_obj = len(OBJECTS) % CONFIG['Threads'] if process_id == 0: start_index = 0 end_index = objects_per_user + extra_obj else: start_index = process_id * objects_per_user + extra_obj end_index = start_index + objects_per_user while start_index < end_index: rest.bucket = OBJECTS[start_index][:OBJECTS[start_index].find('/')] rest.key = OBJECTS[start_index][OBJECTS[start_index].find('/') + 1:] if CONFIG['Testcase'] in (202,) and CONFIG['Range']: rest.headers['Range'] = 'bytes=%s' % random.choice(CONFIG['Range'].split(';')).strip() start_index += 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) if CONFIG["Testcase"] in (202,): result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) else: result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def handle_from_obj_v(request_type, obj_v_file, rest, process_id, user, conn, result_queue): obj_v_file_read = open(obj_v_file, 'r') obj = obj_v_file_read.readline() while obj: if obj and len(obj.split('\t')) != 3: logging.info('obj [%r] format error in file %s' % (obj, obj_v_file)) continue obj = obj[:-1] rest.bucket = obj.split('\t')[0] rest.key = obj.split('\t')[1] if rest.requestType == 'GetObject': if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) rest.queryArgs['versionId'] = obj.split('\t')[2] obj = obj_v_file_read.readline() resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) def get_object(process_id, user, conn, result_queue): request_type = 'GetObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' if CONFIG['Testcase'] in (202, 900) and CONFIG['Range']: rest.headers['Range'] = 'bytes=%s' % random.choice(CONFIG['Range'].split(';')).strip() # 如果传入OBJECTS,则直接处理OBJECTS。 global OBJECTS if OBJECTS: handle_from_objects(request_type, rest, process_id, user, conn, result_queue) return # 如果data下有上传记录的对象名和版本,从该文件读。 obj_v_file = 'data/objv-%d.dat' % process_id if os.path.exists(obj_v_file) and os.path.getsize(obj_v_file) > 0: handle_from_obj_v(request_type, obj_v_file, rest, process_id, user, conn, result_queue) return # 从字典序对象名下载。 if not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return i = 0 if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if CONFIG['Range']: rest.headers['Range'] = 'bytes=%s' % random.choice(CONFIG['Range'].split(';')).strip() if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) def swiftget_object(process_id, user, conn, result_queue): request_type = 'swiftGetObject' rest = s3PyCmd.S3RequestDescriptor(request_type =request_type, ak = user.ak, sk = user.sk) rest.headers['X-auth-token'] = user.sk if CONFIG['Testcase'] in (202, 900) and CONFIG['Range']: rest.headers['Range'] = 'bytes=%s' % random.choice(CONFIG['Range'].split(';')).strip() global OBJECTS if OBJECTS: handle_from_objects(request_type, rest, process_id, user, conn, result_queue) return # 如果data下有上传记录的对象名和版本,从该文件读。 obj_v_file = 'data/objv-%d.dat' % process_id if os.path.exists(obj_v_file) and os.path.getsize(obj_v_file) > 0: handle_from_obj_v(request_type, obj_v_file, rest, process_id, user, conn, result_queue) return # 从字典序对象名下载。 if not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return i = 0 if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if CONFIG['Range']: rest.headers['Range'] = 'bytes=%s' % random.choice(CONFIG['Range'].split(';')).strip() if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) def swifthead_object(process_id, user, conn, result_queue): request_type = 'swiftHeadObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk) rest.headers['X-auth-token'] = user.sk # 如果传入OBJECTS,则直接处理OBJECTS。 global OBJECTS if OBJECTS: handle_from_objects(request_type, rest, process_id, user, conn, result_queue) return elif not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return i = 0 if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def head_object(process_id, user, conn, result_queue): request_type = 'HeadObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) # 如果传入OBJECTS,则直接处理OBJECTS。 global OBJECTS if OBJECTS: handle_from_objects(request_type, rest, process_id, user, conn, result_queue) return elif not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return i = 0 if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def delete_object(process_id, user, conn, result_queue): request_type = 'DeleteObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) # 如果传入OBJECTS,则直接处理OBJECTS。 global OBJECTS if OBJECTS: handle_from_objects(request_type, rest, process_id, user, conn, result_queue) return # 如果data下有上传记录的对象名和版本,从该文件读。 obj_v_file = 'data/objv-%d.dat' % process_id if os.path.exists(obj_v_file) and os.path.getsize(obj_v_file) > 0: handle_from_obj_v(request_type, obj_v_file, rest, process_id, user, conn, result_queue) return elif not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] range_arr = range(0, CONFIG['BucketsPerUser']) # 错开每个并发起始选桶,避免单桶性能瓶颈。 if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0, process_id % CONFIG[ 'BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swiftdelete_object(process_id, user, conn, result_queue): request_type = 'swiftDeleteObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk) rest.headers['X-auth-token'] = user.sk # 如果传入OBJECTS,则直接处理OBJECTS。 global OBJECTS if OBJECTS: handle_from_objects(request_type, rest, process_id, user, conn, result_queue) return # 如果data下有上传记录的对象名和版本,从该文件读。 obj_v_file = 'data/objv-%d.dat' % process_id if os.path.exists(obj_v_file) and os.path.getsize(obj_v_file) > 0: handle_from_obj_v(request_type, obj_v_file, rest, process_id, user, conn, result_queue) return elif not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] range_arr = range(0, CONFIG['BucketsPerUser']) # 错开每个并发起始选桶,避免单桶性能瓶颈。 if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0, process_id % CONFIG[ 'BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) # rest.bucket = '%s.%d' % (CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def restore_object(process_id, user, conn, result_queue): request_type = 'RestoreObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) # 如果传入OBJECTS,则直接处理OBJECTS。 global OBJECTS if OBJECTS: handle_from_objects(request_type, rest, process_id, user, conn, result_queue) return # 如果data下有上传记录的对象名和版本,从该文件读。 obj_v_file = 'data/objv-%d.dat' % process_id if os.path.exists(obj_v_file) and os.path.getsize(obj_v_file) > 0: handle_from_obj_v(request_type, obj_v_file, rest, process_id, user, conn, result_queue) return elif not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] rest.queryArgs['restore'] = None range_arr = range(0, CONFIG['BucketsPerUser']) # 错开每个并发起始选桶,避免单桶性能瓶颈。 if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0, process_id % CONFIG[ 'BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) rest.sendContent = '<RestoreRequest xmlns="http://s3.amazonaws.com/doc/2006-3-01"><Days>%s</Days><GlacierJobParameters><Tier>%s</Tier></GlacierJobParameters></RestoreRequest>' % ( CONFIG['RestoreDays'], CONFIG['RestoreTier']) logging.debug('send content [%s] ' % rest.sendContent) rest.headers['Content-MD5'] = base64.b64encode(hashlib.md5(rest.sendContent).digest()) j += 1 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def delete_multi_objects(process_id, user, conn, result_queue): if not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return if CONFIG['ObjectsPerBucketPerThread'] <= 0: logging.warn('ObjectsPerBucketPerThread <= 0, exit..') return request_type = 'DeleteMultiObjects' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['delete'] = None i = 0 if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 delete_times_per_bucket = math.ceil( CONFIG['ObjectsPerBucketPerThread'] * 1.0 / CONFIG['DeleteObjectsPerRequest']) logging.debug('ObjectsPerBucketPerThread: %d, DeleteObjectsPerRequest: %d, delete_times_per_bucket:%d' % ( CONFIG['ObjectsPerBucketPerThread'], CONFIG['DeleteObjectsPerRequest'], delete_times_per_bucket)) j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: rest.sendContent = '<Delete>' k = 0 while k < CONFIG['DeleteObjectsPerRequest']: if j >= CONFIG['ObjectsPerBucketPerThread']: break rest.sendContent += '<Object><Key>%s</Key></Object>' % CONFIG['ObjectNamePartten'].replace('processID', str( process_id)).replace( 'Index', str(j)).replace('ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 k += 1 rest.sendContent += '</Delete>' logging.debug('send content [%s] ' % rest.sendContent) rest.headers['Content-MD5'] = base64.b64encode(hashlib.md5(rest.sendContent).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swiftupload_dynamic_big_object(process_id, user, conn, result_queue): request_type = 'swiftUploadDynamicBigObject' sendContent = '' rest = s3PyCmd.S3RequestDescriptor(request_type, ak = user.ak, sk = user.sk, send_content = sendContent) rest.headers['X-auth-token'] = user.sk fixed_size = False rest.headers['content-type'] = 'application/octet-stream' if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.prefixkey = CONFIG['ObjectNameFixed'] # 如果打开CalHashMD5开关,在对象上传时写入一个自定义元数据,用于标记为本工具put上传的对象。 if CONFIG['CalHashMD5']: rest.headers['x-amz-meta-md5written'] = 'yes' # 错开每个并发起始选桶,避免单桶性能瓶颈。 range_arr = range(0, CONFIG['BucketsPerUser']) if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0,process_id % CONFIG['BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: if CONFIG['ObjectLexical']: rest.prefixkey = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str( j)).replace('ObjectNamePrefix', CONFIG['ObjectNamePrefix']) else: rest.prefixkey = Util.random_string_create(random.randint(300, 1024)) j += 1 parts_for_dynamic_big = CONFIG['PartsForEachUploadID'] for k in range(1,parts_for_dynamic_big+1): if not fixed_size: # change size every request for the same obj. rest.contentLength, fixed_size = Util.generate_a_size(CONFIG['PartSize']) rest.key = '%s-%d'%(rest.prefixkey,k) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) rest.key = rest.prefixkey rest.headers['x-object-manifest'] = ('%s/%s'%(rest.bucket, rest.key)) partContentLength = rest.contentLength rest.contentLength=0 resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) rest.headers.pop('x-object-manifest') rest.contentLength = partContentLength def swiftdelete_dynamic_big_object(process_id, user, conn, result_queue): request_type = 'swiftDeleteDynamicBigObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak = user.ak, sk = user.sk) rest.headers['X-auth-token'] = user.sk fixed_size = False rest.headers['content-type'] = 'application/octet-stream' if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.prefixkey = CONFIG['ObjectNameFixed'] # 如果打开CalHashMD5开关,在对象上传时写入一个自定义元数据,用于标记为本工具put上传的对象。 if CONFIG['CalHashMD5']: rest.headers['x-amz-meta-md5written'] = 'yes' # 错开每个并发起始选桶,避免单桶性能瓶颈。 range_arr = range(0, CONFIG['BucketsPerUser']) if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0,process_id % CONFIG['BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: if CONFIG['ObjectLexical']: rest.prefixkey = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str( j)).replace('ObjectNamePrefix', CONFIG['ObjectNamePrefix']) else: rest.prefixkey = Util.random_string_create(random.randint(300, 1024)) j += 1 parts_for_dynamic_big = CONFIG['PartsForEachUploadID'] for k in range(1,parts_for_dynamic_big+1): rest.key = '%s-%d'%(rest.prefixkey,k) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) rest.key = rest.prefixkey resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) def copy_object(process_id, user, conn, result_queue): if not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return request_type = 'CopyObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.headers['x-amz-acl'] = 'public-read-write' rest.headers['x-amz-metadata-directive'] = 'COPY' if CONFIG['copySrcObjFixed']: rest.headers['x-amz-copy-source'] = '/' + CONFIG['copySrcObjFixed'] if CONFIG['copyDstObjFiexed']: rest.bucket = CONFIG['copyDstObjFiexed'].split('/')[0] rest.key = CONFIG['copyDstObjFiexed'].split('/')[1] elif CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' if CONFIG['copySrcSrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-copy-source-server-side-encryption-customer-algorithm'] = 'AES256' if CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG['SrvSideEncryptAlgorithm'].lower() == 'aws:kms': rest.headers['x-amz-server-side-encryption'] = 'aws:kms' if CONFIG['SrvSideEncryptAWSKMSKeyId']: rest.headers['x-amz-server-side-encryption-aws-kms-key-id'] = CONFIG['SrvSideEncryptAWSKMSKeyId'] if CONFIG['SrvSideEncryptContext']: rest.headers['x-amz-server-side-encryption-context'] = CONFIG['SrvSideEncryptContext'] elif CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG['SrvSideEncryptAlgorithm'].lower() == 'aes256': rest.headers['x-amz-server-side-encryption'] = 'AES256' i = 0 while i < CONFIG['BucketsPerUser']: # 如果未配置目的对象和固定桶,设置目的桶为源对象所在的桶 if not CONFIG['copyDstObjFiexed'] and not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['copyDstObjFiexed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix'] + '.copy') if not CONFIG['copySrcObjFixed']: rest.headers['x-amz-copy-source'] = '/%s/%s' % ( rest.bucket, CONFIG['ObjectNamePartten'].replace('processID', str( process_id)).replace('Index', str(j)).replace('ObjectNamePrefix', CONFIG['ObjectNamePrefix'])) j += 1 if CONFIG['copySrcSrvSideEncryptType'].lower() == 'sse-c': src_en_key = rest.headers['x-amz-copy-source'].split('/')[2][-32:].zfill(32) rest.headers['x-amz-copy-source-server-side-encryption-customer-key'] = base64.b64encode(src_en_key) rest.headers['x-amz-copy-source-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(src_en_key).digest()) logging.debug('src encrpt key: %s, src encrypt key md5: %s' % ( src_en_key, rest.headers['x-amz-copy-source-server-side-encryption-customer-key-MD5'])) if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() # 同拷贝对象,若拷贝段操作先返回200 OK,并不代表拷贝成功。如果返回了200,但没有获取到ETag,将response修改为500错误。 if resp.status.startswith('200 ') and not resp.return_data: logging.info('response 200 OK without ETag, set status code 500 InternalError') resp.status = '500 InternalError' result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'copySrc:' + rest.headers['x-amz-copy-source'], resp.request_id, resp.status)) def init_multi_upload(process_id, user, conn, result_queue): if not CONFIG['ObjectLexical']: logging.warn('Object name is not lexical, exit..') return if CONFIG['ObjectsPerBucketPerThread'] <= 0 or CONFIG['BucketsPerUser'] <= 0: logging.warn('ObjectsPerBucketPerThread or BucketsPerUser <= 0, exit..') return request_type = 'InitMultiUpload' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.queryArgs['uploads'] = None if CONFIG['PutWithACL']: rest.headers['x-amz-acl'] = CONFIG['PutWithACL'] if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNameFixed'] if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' elif CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG['SrvSideEncryptAlgorithm'].lower() == 'aws:kms': rest.headers['x-amz-server-side-encryption'] = 'aws:kms' if CONFIG['SrvSideEncryptAWSKMSKeyId']: rest.headers['x-amz-server-side-encryption-aws-kms-key-id'] = CONFIG['SrvSideEncryptAWSKMSKeyId'] if CONFIG['SrvSideEncryptContext']: rest.headers['x-amz-server-side-encryption-context'] = CONFIG['SrvSideEncryptContext'] elif CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG['SrvSideEncryptAlgorithm'].lower() == 'aes256': rest.headers['x-amz-server-side-encryption'] = 'AES256' upload_ids = '' i = 0 while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) # 如果请求成功,记录return_data(UploadId)到本地文件 if resp.status.startswith('200 '): logging.debug('rest.key:%s, rest.returndata:%s' % (rest.key, resp.return_data)) upload_ids += '%s\t%s\t%s\t%s\n' % (user.username, rest.bucket, rest.key, resp.return_data) if upload_ids == '': return None # 退出前,写统计结果到本地文件 uploadid_writer = None uploadid_file = 'data/upload_id-%d.dat' % process_id try: uploadid_writer = open(uploadid_file, 'w') uploadid_writer.write(upload_ids) except Exception, data: logging.error('process [%d] write upload_ids error %s' % (process_id, data)) finally: if uploadid_writer: try: uploadid_writer.close() except IOError: pass def upload_part(process_id, user, conn, result_queue): # 从本地加载本进程需要做的upload_ids。考虑到单upload_id多并发上传段场景,需要加载其它进程初始化的upload_ids。 # 如5个用户,每用户2个并发,则每个upload_id可以最大2个并发上传段。 # upload_id-0(usr0,p0) upload_id-1(usr0,p1) upload_id-2(usr1,p2) upload_id-3(usr1,p3) upload_id-4(usr2,p4) # upload_id-5(usr2,p5) upload_id-6(usr3,p6) upload_id-7(usr3,p7) upload_id-8(usr4,p8) upload_id-9(usr4,p9) # p0,p1需要顺序加载usr0,p0和usr0,p1 upload_ids = [] if not CONFIG['ConcurrentUpParts']: id_files = [process_id] else: id_files = range(process_id / CONFIG['ThreadsPerUser'] * CONFIG['ThreadsPerUser'], (process_id / CONFIG['ThreadsPerUser'] + 1) * CONFIG['ThreadsPerUser']) for i in id_files: upload_id_file = 'data/upload_id-%d.dat' % i try: with open(upload_id_file, 'r') as fd: for line in fd: if line.strip() == '': continue # 如果非本并发的用户初始化的upload_id,跳过。 if not line.startswith(user.username + '\t'): continue if len(line.split('\t')) != 4: logging.warn('upload_ids record error [%s]' % line) continue # 记录upload_id的原并发号i upload_ids.append((str(i) + '.' + line.strip()).split('\t')) fd.close() logging.info('process %d load upload_ids file %s end' % (process_id, upload_id_file)) except Exception, data: logging.error("load %s for process %d error, [%r], exit" % (upload_id_file, process_id, data)) continue if not upload_ids: logging.info("load no upload_id for process %d, from file upload_id-%r exit" % (process_id, idFiles)) return else: logging.info("total load %d upload_ids" % len(upload_ids)) fixed_size = False request_type = 'UploadPart' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.headers['content-type'] = 'application/octet-stream' if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' for upload_id in upload_ids: rest.bucket = upload_id[1] rest.key = upload_id[2] rest.queryArgs['uploadId'] = upload_id[3] # partsRecord += '%d.%s\t%s\t%s\t%s\t' % (tup[0],user.username,tup[1],tup[2],tup[3]) parts_record = '' # 如果开启了并发上传段,本并发只处理部分段。 if not CONFIG['ConcurrentUpParts']: part_ids = range(1, CONFIG['PartsForEachUploadID'] + 1) else: part_ids = range(process_id % CONFIG['ThreadsPerUser'] + 1, CONFIG['PartsForEachUploadID'] + 1, CONFIG['ThreadsPerUser']) logging.debug('process %d handle parts: %r' % (process_id, part_ids)) if not part_ids: logging.info( 'process %d has no parts to do for upload_id %s, break' % (process_id, rest.queryArgs['uploadId'])) continue for i in part_ids: rest.queryArgs['partNumber'] = str(i) if not fixed_size: rest.contentLength, fixed_size = Util.generate_a_size(CONFIG['PartSize']) if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) if resp.status.startswith('200 '): parts_record += '%d:%s,' % (i, resp.return_data) upload_id.append(parts_record) # 记录各段信息到本地文件 ,parts_etag-x.dat,格式:桶名\t对象名\tupload_id\tpartNo:Etag,partNo:Etag,... part_record_file = 'data/parts_etag-%d.dat' % process_id parts_record_writer = None parts_records = '' for upload_id in upload_ids: parts_records += '\t'.join(upload_id) + '\n' try: parts_record_writer = open(part_record_file, 'w') parts_record_writer.write(parts_records) except Exception, data: logging.error('process [%d] write file %s error, %s' % (process_id, part_record_file, data)) finally: if parts_record_writer: try: parts_record_writer.close() except IOError: pass def swiftupload_static_big_object(process_id, user, conn, result_queue): # 从本地加载本进程需要做的upload_ids。考虑到单upload_id多并发上传段场景,需要加载其它进程初始化的upload_ids。 # 如5个用户,每用户2个并发,则每个upload_id可以最大2个并发上传段。 # upload_id-0(usr0,p0) upload_id-1(usr0,p1) upload_id-2(usr1,p2) upload_id-3(usr1,p3) upload_id-4(usr2,p4) # upload_id-5(usr2,p5) upload_id-6(usr3,p6) upload_id-7(usr3,p7) upload_id-8(usr4,p8) upload_id-9(usr4,p9) # p0,p1需要顺序加载usr0,p0和usr0,p1 fixed_size = False request_type = 'swiftUploadStaticBigObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk) rest.headers['content-type'] = 'application/octet-stream' rest.headers['X-auth-token'] = user.sk if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.prefixkey = CONFIG['ObjectNameFixed'] range_arr = range(0, CONFIG['BucketsPerUser']) # 错开每个并发起始选桶,避免单桶性能瓶颈。 if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0,process_id % CONFIG['BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.prefixkey = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 fixed_size = False parts_for_static_big = CONFIG['PartsForEachUploadID'] k=1 manifest='' rest.queryArgs={} rest.sendContent='' for k in range(1,parts_for_static_big+1): if not fixed_size: # change size every request for the same obj. rest.contentLength, fixed_size = Util.generate_a_size(CONFIG['PartSize']) rest.key = '%s-%d'%(rest.prefixkey,k) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'MD5:' + str(resp.content_md5), resp.request_id, resp.status)) # 如果请求成功,记录return_data(UploadId)到本地文件 onemanifest ='' if resp.status.startswith('20'): onemanifest = '"path":"'+rest.bucket+'/'+rest.key+'",' onemanifest += '"etag":"'+resp.return_data+'",' onemanifest += '"size_bytes":'+str(rest.contentLength) manifest +='{'+onemanifest+'},' manifest = manifest[:-1] manifest = '['+manifest+']' rest.queryArgs['multipart-manifest'] ="PUT" rest.key = rest.prefixkey rest.sendContent=manifest resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def swiftdelete_static_big_object(process_id, user, conn, result_queue): request_type = 'swiftDeleteStaticBigObject' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk) rest.headers['content-type'] = 'application/octet-stream' rest.headers['X-auth-token'] = user.sk if CONFIG['BucketNameFixed']: rest.bucket = CONFIG['BucketNameFixed'] if CONFIG['ObjectNameFixed']: rest.prefixkey = CONFIG['ObjectNameFixed'] range_arr = range(0, CONFIG['BucketsPerUser']) # 错开每个并发起始选桶,避免单桶性能瓶颈。 if CONFIG['AvoidSinBkOp']: range_arr = range(process_id % CONFIG['BucketsPerUser'], CONFIG['BucketsPerUser']) + range(0,process_id % CONFIG['BucketsPerUser']) for i in range_arr: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 rest.queryArgs['multipart-manifest'] ="DELETE" resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def copy_part(process_id, user, conn, result_queue): # 必须传入OBJECTS,否则无法拷贝。 global OBJECTS if not OBJECTS: logging.error("can not find source object, exit") return # 从本地加载本进程需要做的upload_ids。考虑到单upload_id多并发上传段场景,需要加载其它进程初始化的upload_ids。 # 如5个用户,每用户2个并发,则每个upload_id可以最大2个并发上传段。 # upload_id-0(usr0,p0) upload_id-1(usr0,p1) upload_id-2(usr1,p2) upload_id-3(usr1,p3) upload_id-4(usr2,p4) # upload_id-5(usr2,p5) upload_id-6(usr3,p6) upload_id-7(usr3,p7) upload_id-8(usr4,p8) upload_id-9(usr4,p9) # p0,p1需要顺序加载usr0,p0和usr0,p1 upload_ids = [] if not CONFIG['ConcurrentUpParts']: id_files = [process_id] else: id_files = range(process_id / CONFIG['ThreadsPerUser'] * CONFIG['ThreadsPerUser'], (process_id / CONFIG['ThreadsPerUser'] + 1) * CONFIG['ThreadsPerUser']) for i in id_files: upload_id_file = 'data/upload_id-%d.dat' % i try: with open(upload_id_file, 'r') as fd: for line in fd: if line.strip() == '': continue # 如果非本并发的用户初始化的upload_id,跳过。 if not line.startswith(user.username + '\t'): continue if len(line.split('\t')) != 4: logging.warn('upload_ids record error [%s]' % line) continue # 记录upload_id的原并发号i upload_ids.append((str(i) + '.' + line.strip()).split('\t')) fd.close() logging.info('process %d load upload_ids file %s end' % (process_id, upload_id_file)) except Exception, data: logging.error("load %s for process %d error, [%r], exit" % (upload_id_file, process_id, data)) continue if not upload_ids: logging.info("load no upload_id for process %d, exit" % process_id) return fixed_size = False request_type = 'CopyPart' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' if CONFIG['copySrcSrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-copy-source-server-side-encryption-customer-algorithm'] = 'AES256' parts_record = '' for upload_id in upload_ids: rest.bucket = upload_id[1] rest.key = upload_id[2] rest.queryArgs['uploadId'] = upload_id[3] # 如果开启了并发上传段,本并发只处理部分段。 if not CONFIG['ConcurrentUpParts']: part_ids = range(1, CONFIG['PartsForEachUploadID'] + 1) else: part_ids = range(process_id % CONFIG['ThreadsPerUser'] + 1, CONFIG['PartsForEachUploadID'] + 1, CONFIG['ThreadsPerUser']) logging.debug('process %d handle parts: %r' % (process_id, part_ids)) if not part_ids: logging.info( 'process %d has no parts to do for upload_id %s, break' % (process_id, rest.queryArgs['uploadId'])) continue for i in part_ids: rest.queryArgs['partNumber'] = str(i) if not fixed_size: range_size, fixed_size = Util.generate_a_size(CONFIG['PartSize']) rest.headers['x-amz-copy-source'] = '/%s' % random.choice(OBJECTS) range_start_index = random.randint(0, range_size * (CONFIG['PartsForEachUploadID'] - 1)) logging.debug('range_start_index:%d' % range_start_index) rest.headers['x-amz-copy-source-range'] = 'bytes=%d-%d' % ( range_start_index, range_start_index + range_size - 1) logging.debug('x-amz-copy-source-range:[%s]' % rest.headers['x-amz-copy-source-range']) # 增加服务器端加密头域 if CONFIG['copySrcSrvSideEncryptType'].lower() == 'sse-c': src_en_key = rest.headers['x-amz-copy-source'].split('/')[2][-32:].zfill(32) rest.headers['x-amz-copy-source-server-side-encryption-customer-key'] = base64.b64encode(src_en_key) rest.headers['x-amz-copy-source-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(src_en_key).digest()) logging.debug('src encrpt key: %s, src encrypt key md5: %s' % ( src_en_key, rest.headers['x-amz-copy-source-server-side-encryption-customer-key-MD5'])) if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() # 同拷贝对象,若拷贝段操作先返回200 OK,并不代表拷贝成功。如果返回了200,但没有获取到ETag,将response修改为500错误。 if resp.status.startswith('200 ') and not resp.return_data: logging.info('response 200 OK without ETag, set status code 500 InternalError') resp.status = '500 InternalError' result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, 'src:' + rest.headers['x-amz-copy-source'] + ':' + rest.headers[ 'x-amz-copy-source-range'], resp.request_id, resp.status)) if resp.status.startswith('200 '): parts_record += '%d:%s,' % (i, resp.return_data) upload_id.append(parts_record) # 记录各段信息到本地文件 ,parts_etag-x.dat,格式:桶名\t对象名\tupload_id\tpartNo:Etag,partNo:Etag,... part_record_file = 'data/parts_etag-%d.dat' % process_id parts_record_writer = None parts_records = '' for upload_id in upload_ids: parts_records += '\t'.join(upload_id) + '\n' try: parts_record_writer = open(part_record_file, 'w') parts_record_writer.write(parts_records) except Exception, data: logging.error('process [%d] write file %s error, %s' % (process_id, part_record_file, data)) finally: if parts_record_writer: try: parts_record_writer.close() except IOError: pass def complete_multi_upload(process_id, user, conn, result_queue): # 从本地parts_etag-x.dat中加载本进程需要做的upload_ids。考虑到单upload_id多并发上传段场景,需要加载其它进程上传的段信息。 # 如3个用户,每用户3个并发,每个upload_id上传6个段,则每个upload_id 3个并发上传段,每个并发对每个upload_id上传2个段。 # parts_etag-0(usr0,p0,part1/4) parts_etag-1(usr0,p1,part2/5) parts_etag-2(usr1,p2,part3/6) # parts_etag-3(usr1,p3,part1/4) parts_etag-4(usr0,p4,part2/5) parts_etag-5(usr1,p5,part3/6) # parts_etag-0(usr2,p6,part1/4) parts_etag-1(usr0,p7,part2/5) parts_etag-2(usr1,p8,part3/6) # p0,p1,p2需要顺序加载parts_etag-0, parts_etag-1, parts_etag-2,取里面属于自已的对象。 part_etags = {} if not CONFIG['ConcurrentUpParts']: part_files = [process_id] else: part_files = range(process_id / CONFIG['ThreadsPerUser'] * CONFIG['ThreadsPerUser'], (process_id / CONFIG['ThreadsPerUser'] + 1) * CONFIG['ThreadsPerUser']) for i in part_files: part_record_file = 'data/parts_etag-%d.dat' % i try: with open(part_record_file, 'r') as fd: for line in fd: if line.strip() == '': continue if not line.startswith('%d.%s\t' % (process_id, user.username)): continue line_array = line.strip().split('\t') if len(line_array) != 5 or not line_array[4]: logging.warn('partEtag record error [%s]' % line) continue # 用户名\t桶名\t对象名\tupoadID\tpartNo:etag,partN0:etag,.. # 合并相同的upload_id多并发上传的段信息 if line_array[3] in part_etags: part_etags[line_array[3]] = ( line_array[1], line_array[2], line_array[4] + part_etags[line_array[3]][2]) else: part_etags[line_array[3]] = (line_array[1], line_array[2], line_array[4]) fd.close() logging.debug('process %d load parts_etag file %s end' % (process_id, part_record_file)) except Exception, data: logging.info( "load parts_etag from file %s for process %d error, [%r], exit" % (part_record_file, process_id, data)) continue if not part_etags: logging.error('process %d load nothing from files %r ' % (process_id, part_files)) return request_type = 'CompleteMultiUpload' rest = s3PyCmd.S3RequestDescriptor(request_type, ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.headers['content-type'] = 'application/xml' for key, value in part_etags.items(): rest.bucket = value[0] rest.key = value[1] rest.queryArgs['uploadId'] = key # 将parts信息排序 parts_dict = {} for item in value[2].split(','): if ':' in item: parts_dict[int(item.split(':')[0])] = item.split(':')[1] # 组装xml body if not parts_dict: continue rest.sendContent = '<CompleteMultipartUpload>' for part_index in sorted(parts_dict): if not parts_dict[part_index]: continue rest.sendContent += '<Part><PartNumber>%d</PartNumber><ETag>%s</ETag></Part>' % ( part_index, parts_dict[part_index]) rest.sendContent += '</CompleteMultipartUpload>' resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, request_type, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) def multi_parts_upload(process_id, user, conn, result_queue): rest = s3PyCmd.S3RequestDescriptor(request_type='', ak=user.ak, sk=user.sk, auth_algorithm=CONFIG['AuthAlgorithm'], virtual_host=CONFIG['VirtualHost'], domain_name=CONFIG['DomainName'], region=CONFIG['Region']) rest.bucket = CONFIG['BucketNameFixed'] rest.key = CONFIG['ObjectNameFixed'] i = 0 while i < CONFIG['BucketsPerUser']: if not CONFIG['BucketNameFixed']: rest.bucket = '%s.%s.%d' % (user.ak.lower(), CONFIG['BucketNamePrefix'], i) i += 1 j = 0 while j < CONFIG['ObjectsPerBucketPerThread']: if not CONFIG['ObjectNameFixed']: rest.key = CONFIG['ObjectNamePartten'].replace('processID', str(process_id)).replace('Index', str(j)).replace( 'ObjectNamePrefix', CONFIG['ObjectNamePrefix']) j += 1 # 1. 初始化对象多段上传任务。 rest.requestType = 'InitMultiUpload' rest.method = 'POST' rest.headers = {} rest.queryArgs = {} rest.sendContent = '' rest.queryArgs['uploads'] = None if CONFIG['PutWithACL']: rest.headers['x-amz-acl'] = CONFIG['PutWithACL'] if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode(rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) elif CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG[ 'SrvSideEncryptAlgorithm'].lower() == 'aws:kms': rest.headers['x-amz-server-side-encryption'] = 'aws:kms' if CONFIG['SrvSideEncryptAWSKMSKeyId']: rest.headers['x-amz-server-side-encryption-aws-kms-key-id'] = CONFIG['SrvSideEncryptAWSKMSKeyId'] if CONFIG['SrvSideEncryptContext']: rest.headers['x-amz-server-side-encryption-context'] = CONFIG['SrvSideEncryptContext'] elif CONFIG['SrvSideEncryptType'].lower() == 'sse-kms' and CONFIG[ 'SrvSideEncryptAlgorithm'].lower() == 'aes256': rest.headers['x-amz-server-side-encryption'] = 'AES256' resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, rest.requestType, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) upload_id = resp.return_data logging.info("upload id: %s" % upload_id) # 2. 串行上传多段 rest.requestType = 'UploadPart' rest.method = 'PUT' rest.headers = {} rest.queryArgs = {} rest.sendContent = '' rest.headers['content-type'] = 'application/octet-stream' rest.queryArgs['uploadId'] = upload_id part_number = 1 fixed_size = False part_etags = {} while part_number <= CONFIG['PartsForEachUploadID']: rest.queryArgs['partNumber'] = str(part_number) if CONFIG['SrvSideEncryptType'].lower() == 'sse-c': rest.headers['x-amz-server-side-encryption-customer-algorithm'] = 'AES256' rest.headers['x-amz-server-side-encryption-customer-key'] = base64.b64encode( rest.key[-32:].zfill(32)) rest.headers['x-amz-server-side-encryption-customer-key-MD5'] = base64.b64encode( hashlib.md5(rest.key[-32:].zfill(32)).digest()) if not fixed_size: rest.contentLength, fixed_size = Util.generate_a_size(CONFIG['PartSize']) resp = s3PyCmd.S3RequestHandler(rest, conn).make_request(cal_md5=CONFIG['CalHashMD5']) result_queue.put( (process_id, user.username, rest.url, rest.requestType, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) if resp.status.startswith('200 '): part_etags[part_number] = resp.return_data part_number += 1 # 3. 合并段 rest.requestType = 'CompleteMultiUpload' rest.method = 'POST' rest.headers = {} rest.queryArgs = {} rest.headers['content-type'] = 'application/xml' rest.queryArgs['uploadId'] = upload_id rest.sendContent = '<CompleteMultipartUpload>' for part_index in sorted(part_etags): rest.sendContent += '<Part><PartNumber>%d</PartNumber><ETag>%s</ETag></Part>' % ( part_index, part_etags[part_index]) rest.sendContent += '</CompleteMultipartUpload>' resp = s3PyCmd.S3RequestHandler(rest, conn).make_request() result_queue.put( (process_id, user.username, rest.url, rest.requestType, resp.start_time, resp.end_time, resp.send_bytes, resp.recv_bytes, '', resp.request_id, resp.status)) # 并发进程入口 def start_process(process_id, user, test_case, results_queue, valid_start_time, valid_end_time, current_threads, lock, conn=None, call_itself=False): global OBJECTS, CONFIG # 如果混合操作自身调用,不增用户,不等待。 if not call_itself: lock.acquire() current_threads.value += 1 lock.release() # 等待所有用户启动 while True: # 如果时间已经被其它进程刷新,直接跳过。 if valid_start_time.value == float(sys.maxint): # 若所有用户均启动,记为合法的有效开始时间 if current_threads.value == CONFIG['Threads']: valid_start_time.value = time.time() + 2 else: time.sleep(.06) else: break time.sleep(2) # 若长连接分配连接。考虑混合操作重复执行场景,若已有连接,不分配连接 if not conn: conn = s3PyCmd.MyHTTPConnection(host=CONFIG['OSCs'], is_secure=CONFIG['IsHTTPs'], ssl_version=CONFIG['sslVersion'], timeout=CONFIG['ConnectTimeout'], serial_no=process_id, long_connection=CONFIG['LongConnection'], conn_header=CONFIG['ConnectionHeader']) from swiftIamTool import RestRequest rest = RestRequest() if test_case != 900: try: method_to_call = globals()[TESTCASES[test_case].split(';')[1]] logging.debug('method %s called ' % method_to_call) method_to_call(process_id, user, conn, results_queue) except KeyboardInterrupt: pass except Exception, e: logging.error('Call method for test case %d except: %s' % (test_case, e)) elif test_case == 900: test_cases = [int(case) for case in CONFIG['MixOperations'].split(',')] tmp = 0 while tmp < CONFIG['MixLoopCount']: t1,t2,t3,t4=rest.GetUserToken(username=user.username) print "t1================================================================================="+t1+"|"+t3 logging.debug("loop count: %d " % tmp) tmp += 1 for case in test_cases: logging.debug("case %d in mix loop called " % case) start_process(process_id, user, case, results_queue, valid_start_time, valid_end_time, current_threads, lock, conn, True) # 如果混合操作自身调用,则直接返回,不断连接,不减用户。 if call_itself: return # close connection for this thread if conn: conn.close_connection() # 执行完业务后,当前用户是第一个退出的用户,记为合法的结束时间 if current_threads.value == CONFIG['Threads']: valid_end_time.value = time.time() logging.info('thread [' + str(process_id) + '], exit, set valid_end_time = ' + str(valid_end_time.value)) # 退出 lock.acquire() current_threads.value -= 1 lock.release() logging.info('process_id [%d] exit, set current_threads.value = %d' % (process_id, current_threads.value)) def get_total_requests(): global OBJECTS, CONFIG if CONFIG['Testcase'] == 100: return CONFIG['RequestsPerThread'] * CONFIG['Threads'] elif CONFIG['Testcase'] in (101, 103, 104, 105, 106, 111, 112, 141, 142, 143, 151, 152, 153): return CONFIG['BucketsPerUser'] * CONFIG['Users'] elif CONFIG['Testcase'] in (201,): return CONFIG['ObjectsPerBucketPerThread'] * CONFIG['BucketsPerUser'] * CONFIG['Threads'] * CONFIG[ 'PutTimesForOneObj'] elif CONFIG['Testcase'] in (202, 203, 204, 206, 207, 211): if len(OBJECTS) > 0: return len(OBJECTS) # 如果从data下加载到对象版本数据,则不清楚总数。 if CONFIG['Testcase'] in (202, 204): for i in range(CONFIG['Threads']): obj_v_file = 'data/objv-%d.dat' % i if os.path.exists(obj_v_file) and os.path.getsize(obj_v_file) > 0: return -1 return CONFIG['ObjectsPerBucketPerThread'] * CONFIG['BucketsPerUser'] * CONFIG['Threads'] elif CONFIG['Testcase'] in (205,): return int((CONFIG['ObjectsPerBucketPerThread'] + CONFIG['DeleteObjectsPerRequest'] - 1) / CONFIG[ 'DeleteObjectsPerRequest']) * CONFIG['BucketsPerUser'] * CONFIG['Threads'] elif CONFIG['Testcase'] in (216,): return CONFIG['ObjectsPerBucketPerThread'] * CONFIG['BucketsPerUser'] * CONFIG['Threads'] * ( 2 + CONFIG['PartsForEachUploadID']) # 对于某些请求无法计算请求总量,返回-1 else: return -1 # return True: pass, False: failed def precondition(): global CONFIG, TESTCASES # 检查当前用户是否root用户 import getpass import platform if 'root' != getpass.getuser() and platform.system().lower().startswith('linux'): return False, "\033[1;31;40m%s\033[0m Please run with root account other than '%s'" % ( "[ERROR]", getpass.getuser()) # 检查测试用例是否支持 if CONFIG['Testcase'] not in TESTCASES: return False, "\033[1;31;40m%s\033[0m Test Case [%d] not supported" % ("[ERROR]", CONFIG['Testcase']) # 如果开启服务器端加密功能,必须使用https+AWSV4 if CONFIG['SrvSideEncryptType']: if not CONFIG['IsHTTPs']: CONFIG['IsHTTPs'] = True logging.info('change IsHTTPs to True while use SrvSideEncryptType') if CONFIG['AuthAlgorithm'] != 'AWSV4': CONFIG['AuthAlgorithm'] = 'AWSV4' logging.info('change AuthAlgorithm to AWSV4 while use SrvSideEncryptType') # 加载用户,检查user是否满足要求 logging.info('loading users...') read_users() if CONFIG['Users'] > len(USERS): return False, "\033[1;31;40m%s\033[0m Not enough users in users.dat after index %d: %d < [Users=%d]" % ( "[ERROR]", CONFIG['UserStartIndex'], len(USERS), CONFIG['Users']) # 测试网络连接 if CONFIG['IsHTTPs']: try: import ssl as ssl if not CONFIG['sslVersion']: CONFIG['sslVersion'] = 'SSLv23' logging.info('import ssl module done, config ssl Version: %s' % CONFIG['sslVersion']) except ImportError: logging.info('import ssl module error') return False, 'Python version %s ,import ssl module error' oscs = CONFIG['OSCs'].split(',') for end_point in oscs: print 'Testing connection to %s\t' % end_point.ljust(20), sys.stdout.flush() test_conn = None try: test_conn = s3PyCmd.MyHTTPConnection(host=end_point, is_secure=CONFIG['IsHTTPs'], ssl_version=CONFIG['sslVersion'], timeout=60, serial_no=0, long_connection=True) test_conn.connect_connection() ssl_ver = '' if CONFIG['IsHTTPs']: if Util.compareVersion(sys.version.split()[0], '2.7.9') < 0: ssl_ver = test_conn.connection.sock._sslobj.cipher()[1] else: ssl_ver = test_conn.connection.sock._sslobj.version() rst = '\033[1;32;40mSUCCESS %s\033[0m'.ljust(10) % ssl_ver else: rst = '\033[1;32;40mSUCCESS\033[0m'.ljust(10) print rst logging.info( 'connect %s success, python version: %s, ssl_ver: %s' % ( end_point, sys.version.replace('\n', ' '), ssl_ver)) except Exception, data: logging.error('Caught exception when testing connection with %s, except: %s' % (end_point, data)) print '\033[1;31;40m%s *%s*\033[0m' % (' Failed'.ljust(8), data) return False, 'Check connection failed' finally: if test_conn: test_conn.close_connection() # 创建data目录 if not os.path.exists('data'): os.mkdir('data') return True, 'check passed' def get_objects_from_file(file_name): global OBJECTS if not os.path.exists(file_name): print 'ERROR,the file configed %s in config.dat not exist' % file_name sys.exit(0) try: with open(file_name, 'r') as fd: for line in fd: if line.strip() == '': continue if len(line.split(',')) != 12: continue if line.split(',')[2][1:].find('/') == -1: continue if line.split(',')[11].strip().startswith('200 OK'): OBJECTS.append(line.split(',')[2][1:]) fd.close() logging.info('load file %s end, get objects [%d]' % (file_name, len(OBJECTS))) except Exception, data: msg = 'load file %s except, %s' % (file_name, data) logging.error(msg) print msg sys.exit() if len(OBJECTS) == 0: print 'get no objects in file %s' % file_name sys.exit() # running config CONFIG = {} # test users USERS = [] OBJECTS = [] TESTCASES_SWIFT = {100: 'swiftListUserContainers;swiftlist_user_containers', 101: 'swiftCreateContainer;swiftcreate_container', 102: 'swiftListObjectsInContainer;swiftlist_objects_in_container', 103: 'swiftHeadContainer;swifthead_container', 104: 'swiftDeleteContainer;swiftdelete_container', 201: 'swiftPutObject;swiftput_object', 202: 'swiftGetObject;swiftget_object', 203: 'swiftHeadObject;swifthead_object', 204: 'swiftDeleteObject;swiftdelete_object', 217: 'swiftUploadDynamicBigObject;swiftupload_dynamic_big_object', 218: 'swiftUploadStaticBigObject;swiftupload_static_big_object', 219: 'swiftDeleteDynamicBigObject;swiftdelete_dynamic_big_object', 220: 'swiftDeleteStaticBigObject;swiftdelete_static_big_object', 900: 'MixOperation;', } TESTCASES = {100: 'ListUserBuckets;list_user_buckets', 101: 'CreateBucket;create_bucket', 102: 'ListObjectsInBucket;list_objects_in_bucket', 103: 'HeadBucket;head_bucket', 104: 'DeleteBucket;delete_bucket', 105: 'BucketDelete;bucket_delete', 106: 'OptionsBucket;options_bucket', 111: 'PutBucketVersiong;put_bucket_versioning', 112: 'GetBucketVersioning;get_bucket_versioning', 141: 'PutBucketWebsite;put_bucket_website', 142: 'GetBucketWebsite;get_bucket_website', 143: 'DeleteBucketWebsite;delete_bucket_website', 151: 'PutBucketCors;put_bucket_cors', 152: 'GetBucketCors;get_bucket_cors', 153: 'DeleteBucketCors;delete_bucket_cors', 161: 'PutBucketTag;put_bucket_tag', 162: 'GetBucketTag;get_bucket_tag', 163: 'DeleteBucketTag;delete_bucket_tag', 201: 'PutObject;put_object', 202: 'GetObject;get_object', 203: 'HeadObject;head_object', 204: 'DeleteObject;delete_object', 205: 'DeleteMultiObjects;delete_multi_objects', 206: 'CopyObject;copy_object', 207: 'RestoreObject;restore_object', 211: 'InitMultiUpload;init_multi_upload', 212: 'UploadPart;upload_part', 213: 'CopyPart;copy_part', 214: 'CompleteMultiUpload;complete_multi_upload', 215: 'AbortMultiUpload;abort_multi_upload', 216: 'MultiPartsUpload;multi_parts_upload', 900: 'MixOperation;' } TESTCASES=TESTCASES_SWIFT if __name__ == '__main__': if not os.path.exists('log'): os.mkdir('log') logging.config.fileConfig('logging.conf') version = '----------------s3PyTool: v20170215, Python: %s----------------' % sys.version.split(' ')[0] logging.info(version) print version # 加载指定配置文件 logging.info('loading config...') config_file = 'config.dat' if len(sys.argv[1:]) > 2: config_file = sys.argv[1:][2] read_config(config_file) print 'Config loaded' print str(CONFIG).replace('\'', '') logging.info(CONFIG) # 如果携带参数,则使用参数,覆盖配置文件。 if len(sys.argv[1:]) > 0: CONFIG['Testcase'] = int(sys.argv[1:][0]) if len(sys.argv[1:]) > 1: CONFIG['Users'] = int(sys.argv[1:][1]) CONFIG['Threads'] = CONFIG['Users'] * CONFIG['ThreadsPerUser'] # 启动前检查 check_result, msg = precondition() if not check_result: print 'Check error, [%s] \nExit...' % msg sys.exit() if CONFIG['objectDesFile']: # 判断操作类型,其它操作不预读文件,即使配置了objectDesFile obj_op = ['202', '203', '204', '213'] if str(CONFIG['Testcase']) in obj_op or ( CONFIG['Testcase'] == 900 and (set(CONFIG['MixOperations'].split(',')) & set(obj_op))): print 'begin to read object file %s' % CONFIG['objectDesFile'] get_objects_from_file(CONFIG['objectDesFile']) print 'finish, get %d objects' % len(OBJECTS) start_wait = False if start_wait: tip = ''' -------------------------------------------------------------------------------- Important: This is the way how we can run multi-clients at the same time. Assuming all the client nodes are sync with the time server. If now 02:10:00, enter 12 to change the minute, then it will start at 02:12:00 -------------------------------------------------------------------------------- ''' print '\033[1;32;40m%s\033[0m' % tip import threading def input_func(input_data): input_data['data'] = raw_input() while False: n = datetime.datetime.now() print 'Now it\'s %2d:\033[1;32;40m%2d\033[0m:%2d, please input to change the minute' % ( n.hour, n.minute, n.second), print '(Press \'Enter\' or wait 30 sec to run, \'q\' to exit): ', try: input_data = {'data': 'default'} t = threading.Thread(target=input_func, args=(input_data,)) t.daemon = True t.start() t.join(30) # 等待30秒 if input_data['data'] == 'q': sys.exit() elif '' == input_data['data'] or 'default' == input_data['data']: break try: input_data['data'] = int(input_data['data']) except ValueError: print '[ERROR] I only receive numbers (*>﹏<*)' continue n = datetime.datetime.now() diff = input_data['data'] * 60 - (n.minute * 60 + n.second) if diff > 0: print 'Wait for %d seconds...' % diff time.sleep(diff) break else: break except KeyboardInterrupt: print '\nSystem exit...' sys.exit() n = datetime.datetime.now() msg = 'Start at %s, pid:%d. Press Ctr+C to stop. Screen Refresh Interval: 3 sec' % ( time.strftime('%X %x %Z'), os.getpid()) print msg logging.info(msg) # valid_start_time: 所有并发均启动。 # valid_end_time: 第一个并发退出时刻。 # current_threads:当前运行的并发数。-2表示手动退出,-1表示正常退出。 valid_start_time = multiprocessing.Value('d', float(sys.maxint)) valid_end_time = multiprocessing.Value('d', float(sys.maxint)) current_threads = multiprocessing.Value('i', 0) # results_queue, 请求记录保存队列。多进程公用。 results_queue = multiprocessing.Queue(0) # 启动统计计算结果的进程 。用于从队列取请求记录,保存到本地,并同时刷新实时结果。 results_writer = results.ResultWriter(CONFIG, TESTCASES[CONFIG['Testcase']].split(';')[0].split(';')[0], results_queue, get_total_requests(), valid_start_time, valid_end_time, current_threads) results_writer.daemon = True results_writer.name = 'resultsWriter' results_writer.start() print 'resultWriter started, pid: %d' % results_writer.pid # 增加该进程的优先级 os.system('renice -19 -p ' + str(results_writer.pid) + ' >/dev/null 2>&1') time.sleep(.2) # 顺序启动多个业务进程 process_list = [] # 多进程公用锁 lock = multiprocessing.Lock() esc = chr(27) # escape key i = 0 while i < CONFIG['Threads']: p = multiprocessing.Process(target=start_process, args=( i, USERS[i / CONFIG['ThreadsPerUser']], CONFIG['Testcase'], results_queue, valid_start_time, valid_end_time, current_threads, lock, None, False)) i += 1 p.daemon = True p.name = 'worker-%d' % i p.start() # 将各工作进程的优先级提高1 os.system('renice -1 -p ' + str(p.pid) + ' >/dev/null 2>&1') process_list.append(p) logging.info('All %d threads started, valid_start_time: %.3f' % (len(process_list), valid_start_time.value)) # 请求未完成退出 def exit_force(signal_num, e): msg = "\n\n\033[5;33;40m[WARN]Terminate Signal %d Received. Terminating... please wait\033[0m" % signal_num logging.warn('%r' % msg) print msg, '\nWaiting for all the threads exit....' lock.acquire() current_threads.value = -2 lock.release() time.sleep(.1) tmpi = 0 for j in process_list: if j.is_alive(): if tmpi >= 100: logging.info('force to terminate process %s' % j.name) j.terminate() else: time.sleep(.1) tmpi += 1 break print "\033[1;32;40mWorkers exited.\033[0m Waiting results_writer exit...", sys.stdout.flush() while results_writer.is_alive(): current_threads.value = -2 tmpi += 1 if tmpi > 1000: logging.warn('retry too many time, shutdown results_writer using terminate()') results_writer.terminate() time.sleep(.01) print "\n\033[1;33;40m[WARN] Terminated\033[0m\n" print version sys.exit() import signal signal.signal(signal.SIGINT, exit_force) signal.signal(signal.SIGTERM, exit_force) time.sleep(1) # 正常退出 stop_mark = False while not stop_mark: time.sleep(.3) if CONFIG['RunSeconds'] and (time.time() - valid_start_time.value >= CONFIG['RunSeconds']): logging.info('time is up, exit') exit_force(99, None) for j in process_list: if j.is_alive(): break stop_mark = True for j in process_list: j.join() # 等待结果进程退出。 logging.info('Waiting results_writer to exit...') while results_writer.is_alive(): current_threads.value = -1 # inform results_writer time.sleep(.3) print "\n\033[1;33;40m[WARN] Terminated after all requests\033[0m\n" print version
50.804633
191
0.591624
12,574
116,241
5.327501
0.066089
0.027542
0.020571
0.016794
0.744984
0.724309
0.715561
0.701499
0.686123
0.669389
0
0.018807
0.274507
116,241
2,287
192
50.826847
0.775518
0.037259
0
0.665015
0
0.004955
0.223095
0.068328
0
0
0
0
0
0
null
null
0.003964
0.012884
null
null
0.014371
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
a0fe082128aa46ade07614206f92ae225093a300
36
py
Python
PythonStuff/Assignment3/inputs3.py
edhackney/mega12June2021
02909f9853edba4940b8d99a3c300844ce68ed1c
[ "BSL-1.0" ]
null
null
null
PythonStuff/Assignment3/inputs3.py
edhackney/mega12June2021
02909f9853edba4940b8d99a3c300844ce68ed1c
[ "BSL-1.0" ]
null
null
null
PythonStuff/Assignment3/inputs3.py
edhackney/mega12June2021
02909f9853edba4940b8d99a3c300844ce68ed1c
[ "BSL-1.0" ]
null
null
null
if True: print("this is true")
12
25
0.583333
6
36
3.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.277778
36
2
26
18
0.807692
0
0
0
0
0
0.333333
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
9d0e0e6ff9d82249eb425fe0b48fb10e3930edcc
275
py
Python
chatbot_tutorial/models.py
chrisjos007/django-bot-server-tutorial
17bff457633b8ad96f56270e3d9e3265827550ba
[ "MIT" ]
null
null
null
chatbot_tutorial/models.py
chrisjos007/django-bot-server-tutorial
17bff457633b8ad96f56270e3d9e3265827550ba
[ "MIT" ]
null
null
null
chatbot_tutorial/models.py
chrisjos007/django-bot-server-tutorial
17bff457633b8ad96f56270e3d9e3265827550ba
[ "MIT" ]
null
null
null
from django.db import models class CallCount(models.Model): email = models.EmailField() fat = models.IntegerField(default=0) stupid = models.IntegerField(default=0) dumb = models.IntegerField(default=0) def __str__(self): return f"{self.email}"
25
43
0.694545
34
275
5.5
0.617647
0.28877
0.40107
0.417112
0
0
0
0
0
0
0
0.013453
0.189091
275
11
44
25
0.825112
0
0
0
0
0
0.043478
0
0
0
0
0
0
1
0.125
false
0
0.125
0.125
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
c22e3f7b734146504dfb1add8239fc2601b9bc66
100
py
Python
sameproject/ops/functions/__init__.py
SAME-Project/same-project
6fb6fdab73d98e1ba8f622c4033dbd8cd351b0f6
[ "Apache-2.0" ]
8
2021-12-17T18:26:24.000Z
2022-03-16T18:21:04.000Z
sameproject/ops/functions/__init__.py
SAME-Project/same-project
6fb6fdab73d98e1ba8f622c4033dbd8cd351b0f6
[ "Apache-2.0" ]
45
2021-12-18T08:28:56.000Z
2022-03-31T21:24:45.000Z
sameproject/ops/functions/__init__.py
SAME-Project/same-project
6fb6fdab73d98e1ba8f622c4033dbd8cd351b0f6
[ "Apache-2.0" ]
5
2021-12-17T20:08:38.000Z
2022-03-21T13:51:06.000Z
from .provision import provision_orchestrator from .render import render from .deploy import deploy
25
45
0.85
13
100
6.461538
0.461538
0
0
0
0
0
0
0
0
0
0
0
0.12
100
3
46
33.333333
0.954545
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c22f428cfedf18bb0438f5ecb2b23431bf7c2e3b
3,999
py
Python
test.py
CDB-2000/mhfp
1c281cf77c7129829cae7648cc83673b4f8315e8
[ "MIT" ]
56
2018-10-07T17:35:02.000Z
2022-03-17T11:30:27.000Z
test.py
CDB-2000/mhfp
1c281cf77c7129829cae7648cc83673b4f8315e8
[ "MIT" ]
5
2018-10-18T00:59:14.000Z
2021-07-19T18:14:07.000Z
test.py
CDB-2000/mhfp
1c281cf77c7129829cae7648cc83673b4f8315e8
[ "MIT" ]
14
2018-10-18T20:32:50.000Z
2022-02-17T08:08:58.000Z
import os import sys import random import pickle import numpy as np from timeit import default_timer as timer from mhfp.encoder import MHFPEncoder from mhfp.lsh_forest import LSHForest from rdkit.Chem import AllChem # config = mstmap.LayoutConfiguration() # # config.merger = mstmap.Merger.Solar # # print(config) # # TODO: Fails for disconnected components! # u = mstmap.VectorUint([0, 1, 2, 3, 4]) # v = mstmap.VectorUint([1, 2, 0, 4, 3]) # w = mstmap.VectorFloat([1.0, 1.0, 1.0, 2.0, 6.0]) # x, y = mstmap.layout(5, u, v, config, w) # print(x) # print(y) enc = MHFPEncoder(512) fps = [] if not os.path.isfile('fps.dat'): with open('drugbank.smi', 'r') as f: i = 0 for line in f: smiles = line.split()[0].strip() mol = AllChem.MolFromSmiles(smiles) if mol: fps.append(enc.encode_mol(mol)) i += 1 if i > 2000: break pickle.dump(fps, open('fps.dat', 'wb')) else: fps = pickle.load(open('fps.dat', 'rb')) m = enc.encode("N=C(N)NCCC[C@H](NC(=O)[C@@H]1CCCN1C(=O)[C@H](N)Cc1ccccc1)C(=O)N1CCC[C@H]1C(=O)NCC(=O)NCC(=O)NCC(=O)NCC(=O)N[C@@H](CC(=O)N)C(=O)NCC(=O)N[C@@H](CC(=O)O)C(=O)N[C@@H](Cc1ccccc1)C(=O)N[C@@H](CCC(=O)O)C(=O)N[C@@H](CCC(=O)O)C(=O)N[C@@H]([C@@H](C)CC)C(=O)N1CCC[C@H]1C(=O)N[C@@H](CCC(=O)O)C(=O)N[C@@H](CCC(=O)O)C(=O)N[C@@H](Cc1ccc(O)cc1)C(=O)N[C@@H](CC(C)C)C(=O)O") n = enc.encode("O=C(N1[C@@H](CCC1)C(=O)NNC(=O)N)[C@@H](NC(=O)[C@@H](NC(=O)[C@H](NC(=O)[C@@H](NC(=O)[C@@H](NC(=O)[C@@H](NC(=O)[C@@H](NC(=O)[C@H]1NC(=O)CC1)Cc1[nH]cnc1)Cc1c2c([nH]c1)cccc2)CO)Cc1ccc(O)cc1)COC(C)(C)C)CC(C)C)CCCN=C(N)N") q = enc.encode("[C@@H](C(=O)NCC(=O)N[C@@H](C(=O)N[C@@H](C)C(=O)N[C@@H](C(=O)N[C@H](C(=O)N[C@@H](C(=O)N[C@H](C(=O)N[C@@H](C(=O)N[C@H](C(=O)N[C@@H](C(=O)N[C@H](C(=O)N[C@@H](C(=O)N[C@H](C(=O)NCCO)Cc1c2c(cccc2)[nH]c1)CC(C)C)Cc1c[nH]c2c1cccc2)CC(C)C)Cc1c[nH]c2c1cccc2)CC(C)C)Cc1c[nH]c2c1cccc2)C(C)C)C(C)C)C(C)C)CC(C)C)(C(C)C)NC=O") r = enc.encode('CNCNCNCNC') lf_classic = LSHForest(512, 64) for i, e in enumerate(fps): lf_classic.add(i, e) lf_classic.index() start = timer() result = lf_classic.query(r, 5) end = timer() print(end - start) print(result) # import os # import sys # import random # import pickle # from timeit import default_timer as timer # from mhfp.encoder import MHFPEncoder # from mhfp.lsh_forest import LSHForest # from mstmap import mstmap # from rdkit.Chem import AllChem # # config = mstmap.LayoutConfiguration() # # # config.merger = mstmap.Merger.Solar # # # print(config) # # # TODO: Fails for disconnected components! # # u = mstmap.VectorUint([0, 1, 2, 3, 4]) # # v = mstmap.VectorUint([1, 2, 0, 4, 3]) # # w = mstmap.VectorFloat([1.0, 1.0, 1.0, 2.0, 6.0]) # # x, y = mstmap.layout(5, u, v, config, w) # # print(x) # # print(y) # fps = [] # enc = MHFPEncoder(128) # if not os.path.isfile('fps.dat'): # with open('drugbank.smi', 'r') as f: # i = 0 # for line in f: # smiles = line.split()[0].strip() # mol = AllChem.MolFromSmiles(smiles) # if mol: # fps.append(enc.encode_mol(mol)) # i += 1 # if i > 3: break # pickle.dump(fps, open('fps.dat', 'wb')) # else: # fps = pickle.load(open('fps.dat', 'rb')) # m = enc.encode("CNCNCNCNCNCNC") # n = enc.encode("CCCCCCCCCCCCC") # q = enc.encode("CCCCCCCCCCCCO") # start = timer() # lf_classic = LSHForest(128, 8) # for i, fp in enumerate(fps): # lf_classic.add(i, m) # lf_classic.index() # end = timer() # print(end - start) # start = timer() # for _ in range(1000): # result = lf_classic.query(q, 5) # end = timer() # print(end - start) # print(result) # start = timer() # lf = mstmap.LSHForest() # for i, fp in enumerate(fps): # lf.add(i, mstmap.VectorUint(m)) # lf.index() # end = timer() # print(end - start) # start = timer() # for _ in range(1000): # result = lf.query(mstmap.VectorUint(q), 5) # end = timer() # print(end - start) # print(result)
26.137255
372
0.583896
747
3,999
3.104418
0.174029
0.032773
0.031048
0.039672
0.773609
0.769297
0.761104
0.705908
0.64295
0.613627
0
0.036303
0.180295
3,999
153
373
26.137255
0.671141
0.492123
0
0
0
0.081081
0.475283
0.451081
0
0
0
0.006536
0
1
0
false
0
0.243243
0
0.243243
0.054054
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
dfa1a0265834e1356056ff8ccde57638d3090c89
163
py
Python
n_day_python/scrape__automate_behind_password_protected_apps_with_selenium__python/example_getpass_auto.py
macknilan/python-examples-and-exercises
be3d60b8c6a4c6a570a7acff4a0f2b358e794e75
[ "MIT" ]
null
null
null
n_day_python/scrape__automate_behind_password_protected_apps_with_selenium__python/example_getpass_auto.py
macknilan/python-examples-and-exercises
be3d60b8c6a4c6a570a7acff4a0f2b358e794e75
[ "MIT" ]
null
null
null
n_day_python/scrape__automate_behind_password_protected_apps_with_selenium__python/example_getpass_auto.py
macknilan/python-examples-and-exercises
be3d60b8c6a4c6a570a7acff4a0f2b358e794e75
[ "MIT" ]
null
null
null
import getpass # https://docs.python.org/3/library/getpass.html the_password = getpass.getpass("Type the password: ") print(f"the_password -> {the_password}")
18.111111
53
0.742331
23
163
5.130435
0.608696
0.372881
0
0
0
0
0
0
0
0
0
0.006849
0.104294
163
8
54
20.375
0.80137
0.282209
0
0
0
0
0.426087
0
0
0
0
0
0
1
0
false
1
0.333333
0
0.333333
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
5
dfcb81be881dbd129daf684e7adbed41df81c312
60,467
py
Python
github/api.py
alextbok/py-github
56e11e9694c0e99a9814382249061c83afe09000
[ "MIT" ]
2
2017-06-14T15:39:13.000Z
2022-02-06T18:43:58.000Z
github/api.py
alextbok/py-github
56e11e9694c0e99a9814382249061c83afe09000
[ "MIT" ]
null
null
null
github/api.py
alextbok/py-github
56e11e9694c0e99a9814382249061c83afe09000
[ "MIT" ]
null
null
null
#!/usr/bin/python import request as r ''' GitHub API object ''' class Api(object): ''' Instantiate with github authentication info. If the authenticated user has signed up for the github developer program, then the rate-limit for api calls is 5000/hour. Otherwise, for an unauthenticated user, it is 60/hour. ''' def __init__(self, username=None, password=None): if username is not None and password is not None: self._auth = (username, password) else: self._auth = None ########### ###USERS### ########### ''' if username: https://developer.github.com/v3/users/#get-a-single-user else: https://developer.github.com/v3/users/#get-all-users ''' def users(self, **kwargs): if 'username' in kwargs: return r.Request.get( ('users/' + username), self._auth) else: if 'since' in kwargs: return r.Request.get( ('users?since=' + str(since) ), self._auth) else: return r.Request.get('users', self._auth) ''' if method is 'GET': https://developer.github.com/v3/users/#get-the-authenticated-user else: https://developer.github.com/v3/users/#update-the-authenticated-user ''' def user(self, method='GET', **kwargs): if method is not 'GET' and method is not 'PATCH': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PATCH\' ' return if method is 'PATCH': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.patch('user', payload, self._auth) return r.Request.get('user', self._auth) ''' if method is 'GET': https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user if method is 'POST': https://developer.github.com/v3/users/emails/#add-email-addresses if method is 'DELETE': https://developer.github.com/v3/users/emails/#delete-email-addresses ''' def user_emails(self, method='GET', **kwargs): if method is not 'GET' and method is not 'POST' and method is 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'DELETE\'' return url_rem = 'user/emails' if method is 'GET': return r.Request.get(url_rem, self._auth) payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'POST': return r.Request.post(url_rem, payload, self._auth) return r.Request.delete(url_rem, data=payload, auth=self._auth) ''' https://developer.github.com/v3/users/followers/#list-followers-of-a-user ''' def users_followers(self, username): return r.Request.get('users/' + username + '/followers', self._auth) ''' https://developer.github.com/v3/users/followers/#list-followers-of-a-user ''' def user_followers(self): return r.Request.get('user/followers', self._auth) ''' if target_user is None: https://developer.github.com/v3/users/followers/#list-users-followed-by-another-user else: https://developer.github.com/v3/users/followers/#check-if-one-user-follows-another ''' def users_following(self, username, target_user=None): url_rem = 'users/' + username + '/following' return r.Request.get(url_rem, self._auth) if target_user is None else r.Request.get(url_rem + '/' + target_user, self._auth) ''' if method is 'GET': if username is None: https://developer.github.com/v3/users/followers/#list-users-followed-by-another-user else: https://developer.github.com/v3/users/followers/#check-if-you-are-following-a-user if method is 'PUT': https://developer.github.com/v3/users/followers/#follow-a-user if method is 'DELETE': https://developer.github.com/v3/users/followers/#unfollow-a-user ''' def user_following(self, username=None, method='GET'): if method is not 'GET' and method is not 'PUT' and method is 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\'' return url_rem = 'user/following' if method is 'PUT': return r.Request.put(url_rem + '/' + username, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + username, self._auth) return r.Request.get(url_rem + '/' + username, self._auth) if username is not None else r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user ''' def users_keys(self, username): return r.Request.get('users/' + username + '/keys', self._auth) ''' if method is 'GET': if id is None: https://developer.github.com/v3/users/keys/#list-your-public-keys else: https://developer.github.com/v3/users/keys/#get-a-single-public-key if method is 'POST': https://developer.github.com/v3/users/keys/#create-a-public-key if method is 'DELETE': https://developer.github.com/v3/users/keys/#delete-a-public-key ''' def user_keys(self, id=None, method='GET', **kwargs): if method is not 'GET' and method is not 'POST' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'DELETE\'' return url_rem = 'users/keys' if method is 'POST': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + str(id), self._auth) return r.Request.get(url_rem, self._auth) if id is None else r.Request.get(url_rem + '/' + str(id), self._auth) ################## ###REPOSITORIES### ################## ''' if method is 'GET': https://developer.github.com/v3/repos/#list-your-repositories else: https://developer.github.com/v3/repos/#create ''' def user_repos(self, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' ' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'POST': if name is None: print "ERROR: name is a required parameter when creating a repository" return return r.Request.post('user/repos', payload, self._auth) return r.Request.get_with_params('user/repos', payload, self._auth) if len(payload) > 0 else r.Request.get('user/repos', self._auth) ''' https://developer.github.com/v3/repos/#list-user-repositories ''' def users_repos(self, username, **kwargs): payload = {} for arg in kwargs: payload[arg] = kwargs[arg] url_rem = 'users/' + username + '/repos' return r.Request.get_with_params(url_rem, payload, self._auth) if len(payload) > 0 else r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/repos/#list-organization-repositories ''' def orgs_repos(self, org, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' ' return url_rem = 'orgs/' + org + '/repos' if method is 'POST': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) return r.Request.get_with_params(url_rem, { 'type' : _type }, self._auth) if type else r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/repos/#list-all-public-repositories ''' def repositories(self, **kwargs): url_rem = 'repositores' return r.Request.get(url_rem + '?since=' + str(kwargs['since']), self._auth) if 'since' in kwargs else r.Request.get(url_rem, self._auth) ''' if method is 'GET': if archive_format is not None: https://developer.github.com/v3/repos/contents/#get-archive-link else: https://developer.github.com/v3/repos/#get elif method is 'PATCH': https://developer.github.com/v3/repos/#edit elif method is 'DELETE': https://developer.github.com/v3/repos/#delete ''' def repos(self, owner, repo, archive_format=None, ref=None, method='GET', **kwargs): if method is not 'GET' and method is not 'PATCH' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PATCH\' or \'DELETE\' ' return url_rem = 'repos/' + owner + '/' + repo if method is 'PATCH': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.patch(url_rem, payload, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) if archive_format is not None and ref is not None: params = {} for arg in kwargs: params[arg] = kwargs[arg] if len(params) > 0: return r.Request.get_with_params(url_rem + '/' + archive_format + '/' + ref, params, self._auth) return r.Request.get(url_rem + '/' + archive_format + '/' + ref, self._auth) return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/repos/#list-contributors ''' def repos_contributors(self, owner, repo, **kwargs): payload = {} for arg in kwargs: payload[arg] = kwargs[arg] url_rem = 'repos/' + owner + '/' + repo + '/contributors' return r.Request.get_with_params(url_rem, payload, self._auth) if anon else r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/repos/#list-languages ''' def repos_languages(self, owner, repo): url_rem = 'repos/' + owner + '/' + repo + '/languages' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/repos/#list-teams ''' def repos_teams(self, owner, repo): url_rem = 'repos/' + owner + '/' + repo + '/teams' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/repos/#list-tags ''' def repos_tags(self, owner, repo): url_rem = 'repos/' + owner + '/' + repo + '/tags' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/repos/#list-branches ''' def repos_branches(self, owner, repo, branch=None): url_rem = 'repos/' + owner + '/' + repo + '/branches' if branch is not None: url_rem += '/' + str(branch) return r.Request.get(url_rem, self._auth) ''' if method is 'GET': if username is None: https://developer.github.com/v3/repos/collaborators/#list else: https://developer.github.com/v3/repos/collaborators/#get if method is 'PUT': https://developer.github.com/v3/repos/collaborators/#add-collaborator if method is 'DELETE': https://developer.github.com/v3/repos/collaborators/#remove-collaborator ''' def repos_collaborators(self, owner, repo, username=None, method='GET'): if method is not 'GET' and method is not 'PUT' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\'' return url_rem = 'repos/' + owner + '/' + repo + '/collaborators' if method is 'PUT': return r.Request.put(url_rem + '/' + username, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + username, self._auth) return r.Request.get(url_rem, self._auth) if username is None else r.Request.get(url_rem + '/' + username, self._auth) ''' if method is 'GET': if id is None: https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository else: https://developer.github.com/v3/repos/comments/#get-a-single-commit-comment if method is 'PATCH': https://developer.github.com/v3/repos/comments/#update-a-commit-comment if method is 'DELETE': https://developer.github.com/v3/repos/comments/#delete-a-commit-comment ''' def repos_comments(self, owner, repo, id=None, method='GET', **kwargs): if method is not 'GET' and method is not 'PATCH' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PATCH\' or \'DELETE\'' return url_rem = 'repos/' + owner + '/' + repo + '/comments' if method is 'PATCH': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if 'body' not in kwargs: print 'ERROR: body is required when editing a commit comment' return return r.Request.patch(url_rem + '/' + str(id), payload, self._auth) if method is 'delete'.upper(): r.Request.patch(url_rem + '/' + str(id), self._auth) return r.Request.get(url_rem, self._auth) if id is None else r.Request.get(url_rem + '/' + str(id), self._auth) ''' if method is 'GET': https://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit else: https://developer.github.com/v3/repos/comments/#create-a-commit-comment ''' def repos_commits_comments(self, owner, repo, ref=None, sha=None, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = url_rem = 'repos/' + owner + '/' + repo + '/commits' if method is 'POST': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem + '/' + sha + '/comments', payload, self._auth) return r.Request.get(url_rem + '/' + ref + '/comments', self._auth) ''' if sha is None: https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository else: https://developer.github.com/v3/repos/commits/#get-a-single-commit ''' def repos_commits(self, owner, repo, sha=None, **kwargs): url_rem = 'repos/' + owner + '/' + repo + '/commits' if sha is None: params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params(url_rem, params, self._auth) return r.Request.get(url_rem + '/' + sha, self._auth) ''' https://developer.github.com/v3/repos/contents/#get-the-readme ''' def repos_readme(self, owner, repo, **kwargs): url_rem = 'repos/' + owner + '/' + repo + '/readme' params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params(url_rem, params, self._auth) if len(params) > 0 else r.Request.get(url_rem, self._auth) ''' if method is 'GET': https://developer.github.com/v3/repos/contents/#get-contents if method is 'PUT': https://developer.github.com/v3/repos/contents/#create-a-file or https://developer.github.com/v3/repos/contents/#update-a-file else: https://developer.github.com/v3/repos/contents/#delete-a-file ''' def repos_contents(self, owner, repo, path, method='GET', **kwargs): if method is not 'GET' and method is not 'PUT' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\'' return url_rem = 'repos/' + owner + '/' + repo + '/contents/' + path if method is 'PUT': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.put(url_rem, payload, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) return r.Request.get_with_params(url_rem, payload, self._auth) if len(payload) > 0 else r.Request.get(url_rem, self._auth) ''' if method is 'GET': if id is None: https://developer.github.com/v3/repos/keys/#list else: https://developer.github.com/v3/repos/keys/#get if method is 'POST': https://developer.github.com/v3/repos/keys/#create else: https://developer.github.com/v3/repos/keys/#delete ''' def repos_keys(self, owner, repo, id=None, method='GET', **kwargs): if method is not 'GET' and method is not 'POST' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'DELETE\'' return url_rem = 'repos/' + owner + '/' + repo + '/keys' if method is 'POST': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + str(id), self._auth) return r.Request.get(url_rem, self._auth) if id is None else r.Request.get(url_rem + '/' + str(id), self._auth) ''' if method is 'GET': https://developer.github.com/v3/repos/forks/#list-forks else: https://developer.github.com/v3/repos/forks/#create-a-fork ''' def repos_forks(self, owner, repo, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'repos/' + owner + '/' + repo + '/forks' if method is 'POST': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) return r.Request.get(url_rem, self._auth) ''' if method is 'GET': if id is None: https://developer.github.com/v3/repos/hooks/#list-hooks else: https://developer.github.com/v3/repos/hooks/#get-single-hook if method is 'POST': https://developer.github.com/v3/repos/hooks/#create-a-hook if method is 'PATCH': https://developer.github.com/v3/repos/hooks/#edit-a-hook else: https://developer.github.com/v3/repos/hooks/#delete-a-hook ''' def repos_hooks(self, owner, repo, id=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'repos/' + owner + '/' + repo + '/hooks' if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + str(id), self._auth) if method is 'POST' or method is 'PATCH': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'PATCH': return r.Request.patch(url_rem + '/' + str(id), payload, self._auth) return r.Request.post(url_rem, payload, self._auth) return r.Request.get(url_rem, self._auth) if id is None else r.Request.get(url_rem + '/' + str(id), self._auth) ''' https://developer.github.com/v3/repos/hooks/#test-a-push-hook ''' def repos_hooks_tests(self, owner, repo, id): return r.Request.post('repos/' + owner + '/' + repo + '/hooks/' + str(id) + '/tests', None, self._auth) ''' https://developer.github.com/v3/repos/hooks/#ping-a-hook ''' def repos_hooks_pings(self, owner, repo, id): return r.Request.post('repos/' + owner + '/' + repo + '/hooks/' + str(id) + '/pings', None, self._auth) ''' https://developer.github.com/v3/repos/merging/#perform-a-merge ''' def repos_merges(self, owner, repo, **kwargs): if 'base' not in kwargs or 'head' not in kwargs: print 'ERROR: base and head are required when performing a merge' return url_rem = 'repos/' + owner + '/' + repo + '/merges' payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) ''' https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site ''' def repos_pages(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/pages', self._auth) ''' https://developer.github.com/v3/repos/pages/#list-pages-builds ''' def repos_pages_builds(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/pages/builds', self._auth) ''' https://developer.github.com/v3/repos/pages/#list-latest-pages-build ''' def repos_pages_builds_latest(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/pages/builds/latest', self._auth) ''' if method is 'GET': if id is None: https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository if method is 'PATCH': https://developer.github.com/v3/repos/releases/#edit-a-release if method is 'POST': https://developer.github.com/v3/repos/releases/#create-a-release else: https://developer.github.com/v3/repos/releases/#delete-a-release ''' def repos_releases(self, owner, repo, id=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'repos/' + owner + '/' + repo + '/releases' if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + str(id), self._auth) if method is 'GET': return r.Request.get(url_rem, self._auth) if id is None else r.Request.get(url_rem + '/' + str(id), self._auth) payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'POST': if 'tag_name' not in kwargs: print 'ERROR: tag_name is requied when creating a release' return return r.Request.post(url_rem, payload, self._auth) return r.Request.patch(url_rem + '/' + str(id), payload, self._auth) ''' https://developer.github.com/v3/repos/releases/#list-assets-for-a-release ''' def repos_releases_assets(self, owner, repo, id): return r.Request.get('repos/' + owner + '/' + repo + '/releases/' + str(id) + '/assets', self._auth) ''' https://developer.github.com/v3/repos/statistics/#contributors ''' def repos_stats_contributors(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/stats/contributors', self._auth) ''' https://developer.github.com/v3/repos/statistics/#commit-activity ''' def repos_stats_commit_activity(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/stats/commit_activity', self._auth) ''' https://developer.github.com/v3/repos/statistics/#code-frequency ''' def repos_stats_code_frequency(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/stats/code_frequency', self._auth) ''' https://developer.github.com/v3/repos/statistics/#participation ''' def repos_stats_participation(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/stats/participation', self._auth) ''' https://developer.github.com/v3/repos/statistics/#punch-card ''' def repos_stats_punch_card(self, owner, repo): return r.Request.get('repos/' + owner + '/' + repo + '/stats/punch_card', self._auth) ''' https://developer.github.com/v3/repos/statuses/#create-a-status ''' def repos_statuses(self, owner, repo, sha, **kwargs): if 'state' not in kwargs: print 'ERROR: state is required when creating a status' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post('repos/' + owner + '/' + repo + '/statuses/' + sha, payload, self._auth) ''' https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref ''' def repos_commits_statuses(self, owner, repo, ref, **kwargs): url_rem = 'repos/' + owner + '/' + repo + '/commits/' + ref + '/statuses' params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params(url_rem, params, self._auth) ''' https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref ''' def repos_commits_status(self, owner, repo, ref, **kwargs): url_rem = 'repos/' + owner + '/' + repo + '/commits/' + ref + '/status' params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params(url_rem, params, self._auth) ########### ##EVENTS### ########### ''' https://developer.github.com/v3/activity/events/#list-public-events ''' def events(self): return r.Request.get('events', self._auth) ''' https://developer.github.com/v3/activity/events/#list-repository-events ''' def repos_events(self, owner, repo): url_rem = 'events/' + owner + '/' + repo + '/events' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository ''' def repos_issues_events(self, owner, repo): url_rem = 'events/' + owner + '/' + repo + '/issues/events' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories ''' def networks_events(self, owner, repo): url_rem = 'networks/' + owner + '/' + repo + '/events' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization ''' def orgs_events(self, org): url_rem = 'orgs/' + org + '/events' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received ''' def user_received_events(self, user): url_rem = 'users/' + user + '/received_events' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received ''' def user_received_events_public(self, user): url_rem = 'users/' + user + '/received_events/public' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/activity/events/#list-events-for-an-organization ''' def users_events_orgs(self, user, org): url_rem = 'users/' + user + '/events/orgs/' + org return r.Request.get(url_rem, self._auth) ########### ###FEEDS### ########### def feeds(self): return r.Request.get('feeds', self._auth) ################# ##NOTIFICATIONS## ################# ''' if method is 'GET': https://developer.github.com/v3/activity/notifications/#list-your-notifications else: https://developer.github.com/v3/activity/notifications/#mark-as-read ''' def notifications(self, method='GET', **kwargs): if method is not 'GET' and method is not 'PUT': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' ' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'PUT': return r.Request.put('notifications', payload, None, self._auth) if len(payload) > 0 else r.Request.put('notifications', None, { 'Content-Length' : 0 }, self._auth) return r.Request.get_with_params('notifications', payload, self._auth) if len(payload) > 0 else r.Request.get('notifications', self._auth) ''' https://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository ''' def repos_notifications(self, owner, repo, **kwargs): url_rem = 'repos/' + owner + '/' + repo + '/notifications' params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params(url_rem, params, self._auth) if len(params) > 0 else r.Request.get(url_rem, self._auth) ''' if method is 'GET': https://developer.github.com/v3/activity/notifications/#view-a-single-thread else: https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read ''' def notifications_threads(self, id, method='GET'): if method is not 'GET' and method is not 'PATCH': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PATCH\' ' return if method is 'PATCH': return r.Request.patch('notifications/threads/' + str(id), self._auth) return r.Request.get('notifications/threads/' + str(id), self._auth) ''' if method is 'GET': https://developer.github.com/v3/activity/notifications/#get-a-thread-subscription elif method is 'PUT': https://developer.github.com/v3/activity/notifications/#set-a-thread-subscription elif method is 'DELETE': https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription ''' def notifications_threads_subscription(self, id, method='GET', **kwargs): if method is not 'GET' and method is not 'PUT' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\'' return url_rem = 'notifications/threads/' + str(id) + '/subscription' if method is 'PUT': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.put(url_rem, payload, None, self._auth) if len(payload) > 0 else r.Request.put(url_rem, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) return r.Request.get(url_rem, self._auth) ############## ###STARRING### ############## ''' https://developer.github.com/v3/activity/starring/#list-stargazers ''' def repos_stargazers(self, owner, repo): url_rem = 'repos/' + owner + '/' + repo + '/stargazers' return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/activity/starring/#list-repositories-being-starred ''' def users_starred(self, username=None, **kwargs): params = {} for arg in kwargs: params[arg] = kwargs[arg] if username is not None: return r.Request.get_with_params('users/' + username + '/starred', params, self._auth) if len(params) > 0 else r.Request.get('users/' + username + '/starred', self._auth) return r.Request.get_with_params('users/starred', params, self._auth) if len(params) > 0 else r.Request.get('users/starred', self._auth) ''' if method is 'GET': https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository elif method is 'PUT': https://developer.github.com/v3/activity/starring/#star-a-repository elif method is DELETE: https://developer.github.com/v3/activity/starring/#unstar-a-repository ''' def user_starred(self, owner, repo, method='GET'): if method is not 'GET' and method is not 'delete'.upper() and method is not 'PUT': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'DELETE\' or \'PUT\'' return url_rem = 'user/starred/' + owner + '/' + repo if method is 'PUT': return r.Request.put(url_rem, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) return r.Request.get(url_rem, self._auth) ############## ###WATCHING### ############## ''' https://developer.github.com/v3/activity/watching/#list-watchers ''' def repos_subscribers(self, owner, repo): url_rem = 'repos/' + owner + '/' + repo + '/subscribers' return r.Request.get(url_rem, self.auth) ''' https://developer.github.com/v3/activity/watching/#list-repositories-being-watched ''' def users_subscriptions(self, user): url_rem = 'users/' + user + '/subscriptions' return r.Request.get(url_rem, self.auth) ''' https://developer.github.com/v3/activity/watching/#list-repositories-being-watched ''' def user_subscriptions(self): return r.Request.get('user/subscriptions', self.auth) ''' https://developer.github.com/v3/activity/watching/#get-a-repository-subscription ''' def repos_subscription(self, owner, repo, method='GET', **kwargs): if method is not 'GET' and method is not 'PUT' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\'' return url_rem = 'repos/' + owner + '/' + repo + '/subscription' if method is 'PUT': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.put(url_rem, payload, None, self._auth) if len(payload) > 0 else r.Request.put(url_rem, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) return r.Request.get(url_rem, self._auth) ########### ###GISTS### ########### ''' https://developer.github.com/v3/gists/#list-gists ''' def users_gists(self, user, since=None): url_rem = 'user/' + user + '/gists' if since is not None: url_rem += '?since=' + str(since) return r.Request.get(url_rem, self._auth) def gists_public(self, user, since=None): url_rem = 'gists/public' if since is not None: url_rem += '?since=' + str(since) return r.Request.get(url_rem, self._auth) def gists_starred(self, user, since=None): url_rem = 'gists/starred' if since is not None: url_rem += '?since=' + str(since) return r.Request.get(url_rem, self._auth) ''' if id is None: https://developer.github.com/v3/gists/#list-gists if id is not None and method is 'GET': https://developer.github.com/v3/gists/#get-a-single-gist if method is 'POST': https://developer.github.com/v3/gists/#create-a-gist if method is 'PATCH': https://developer.github.com/v3/gists/#edit-a-gist if method is 'DELETE': https://developer.github.com/v3/gists/#delete-a-gist ''' def gists(self, user, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\'' return url_rem = 'gists' if 'id' not in kwargs: if since in kwargs: url_rem += '?since=' + str(kwargs['since']) return r.Request.get(url_rem, self._auth) if method is 'GET': return r.Request.get(url_rem + str(kwargs['id']), self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + str(kwargs['id']), self._auth) payload = {} for arg in kwargs: if arg is not 'id': payload[arg] = kwargs[arg] if method is 'POST': if 'files' not in kwargs: print 'ERROR: files param is required when creating a gist' return return r.Request.post(url_rem + str(kwargs['id']), payload, self._auth) return r.Request.patch(url_rem + str(kwargs['id']), payload, self._auth) ''' https://developer.github.com/v3/gists/#list-gist-commits ''' def gists_commits(self, id): return r.Request.get('gists/' + str(id) + '/commits', self._auth) ''' if method is 'GET': https://developer.github.com/v3/gists/#check-if-a-gist-is-starred if method is 'PUT': https://developer.github.com/v3/gists/#star-a-gist if method is 'DELETE': https://developer.github.com/v3/gists/#unstar-a-gist ''' def gists_star(self, id, method='GET'): if method is not 'GET' and method is not 'PUT' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\'' return url_rem = 'gists/' + str(id) + '/star' if method is 'PUT': return r.Request.put(url_rem, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) return r.Request.get(url_rem, self._auth) ''' if method is 'GET': https://developer.github.com/v3/gists/#list-gist-forks else: https://developer.github.com/v3/gists/#fork-a-gist ''' def gists_forks(self, id, method='GET'): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'gists/' + str(id) + '/forks' payload = {} if method is 'POST': return r.Request.post(url_rem, payload, self._auth) return r.Request.get(url_rem, self._auth) ''' if method is 'GET': if id: https://developer.github.com/v3/gists/comments/#get-a-single-comment else: https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist elif method is 'POST': https://developer.github.com/v3/gists/comments/#create-a-comment elif method is 'PATCH': https://developer.github.com/v3/gists/comments/#edit-a-comment elif method is 'DELETE': https://developer.github.com/v3/gists/comments/#delete-a-comment ''' def gists_comments(self, gist_id, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\' or \'DELETE\'' return if (method is 'PATCH' or method is 'delete'.upper() ) and ('id' not in kwargs): print 'ERROR: _id is required when editing or deleting a gist comment' return url_rem = 'gists/' + str(gist_id) + '/comments' if method is 'POST' or method is 'PATCH': if body not in 'kwargs': print 'ERROR: body is a required paramter when creating/editing a gist comment' return if method is 'POST': return r.Requests.post(url_rem, { 'body' : body }, self._auth) return r.Requests.patch(url_rem + '/' + str(kwargs['id']), { 'body' : body }, self._auth) if method is 'delete'.upper(): return r.Requests.delete(url_rem + str(kwargs['id'])) return r.Requests.get(url_rem, self._auth) if 'id' not in kwargs else r.Requests.get(url_rem + '/' + str(kwargs['id']), self._auth) ######### ##BLOBS## ######### ''' if method is 'GET': https://developer.github.com/v3/git/blobs/#get-a-blob else: https://developer.github.com/v3/git/blobs/#create-a-blob ''' def repos_git_blobs(self, owner, repo, sha, **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'repos/' + owner + '/' + repo + '/git/blobs/' + sha if method is 'POST': if 'content' not in kwargs: print 'ERROR: content is required when creating a blob' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) return r.Request.get(url_rem, self._auth) ######### #COMMITS# ######### ''' if method is 'GET': https://developer.github.com/v3/git/commits/#get-a-commit else: https://developer.github.com/v3/git/commits/#create-a-commit ''' def repos_git_commits(self, owner, repo, sha=None, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'repos/' + owner + '/' + repo + '/git/commits' if method is 'POST': if 'message' not in kwargs or 'tree' not in kwargs or 'parents' not in kwargs: print 'ERROR: message, tree and parents are required when creating a commit' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) if 'sha' not in kwargs: print 'ERROR: sha is required to get a commit' return return r.Request.get(url_rem + '/' + kwargs['sha'], self._auth) ############ #REFERENCES# ############ ''' if method is 'GET': if refs is not None: https://developer.github.com/v3/git/refs/#get-a-reference else: https://developer.github.com/v3/git/refs/#get-all-references if method is 'POST': https://developer.github.com/v3/git/refs/#create-a-reference if method is 'PATCH': https://developer.github.com/v3/git/refs/#update-a-reference if method is 'DELTE': https://developer.github.com/v3/git/refs/#delete-a-reference ''' def repos_git_refs(self, owner, repo, ref=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\' or \'DELETE\'' return url_rem = 'repos/' + owner + '/' + repo + '/git/refs' payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'PATCH': return r.Request.patch(url_rem + '/' + ref, payload, self._auth) if method is 'POST': return r.Request.post(url_rem, payload, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + ref, self._auth) return r.Request.get(url_rem, self._auth) if ref is None else r.Request.get(url_rem + '/' + ref, self._auth) ######## ##TAGS## ######## ''' if method is 'GET': https://developer.github.com/v3/git/tags/#get-a-tag else: https://developer.github.com/v3/git/tags/#create-a-tag-object ''' def repos_get_tags(self, owner, repo, sha=None, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'repos/' + owner + '/' + repo + '/git/tags' if method is 'POST': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) return r.Request.get(url_rem + '/' + sha, self._auth) ######### ##TREES## ######### ''' if method is 'GET': https://developer.github.com/v3/git/trees/#get-a-tree else: https://developer.github.com/v3/git/trees/#create-a-tree ''' def repos_git_trees(self, owner, repo, sha=None, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\'' return url_rem = 'repos/' + owner + '/' + repo + '/git/trees' if method is 'POST': if 'tree' not in kwargs: print 'ERROR: tree parameter is required when creating a tree' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, payload, self._auth) return r.Request.get(url_rem + '/' + sha + '?recursive=1', self._auth) if 'recursive' in kwargs else r.Request.get(url_rem + '/' + sha, self._auth) ########## ##ISSUES## ########## ''' https://developer.github.com/v3/issues/#list-issues ''' def issues(self): return r.Request.get('issues', self._auth) def user_issues(self): return r.Request.get('user/issues', self._auth) def org_issues(self, org, **kwargs): params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params('orgs/' + org + '/issues', params, self._auth) ''' if method is 'GET': if number: https://developer.github.com/v3/issues/#get-a-single-issue https://developer.github.com/v3/issues/#list-issues-for-a-repository elif method is 'POST': https://developer.github.com/v3/issues/#create-an-issue elif method is 'PATCH': https://developer.github.com/v3/issues/#edit-an-issue ''' def repos_issues(self, owner, repo, number=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\'' return url_rem = 'repos/' + owner + '/' + repo + '/issues' if method is 'GET': return r.Request.get(url_rem, self._auth) if number is None else r.Request.get(url_rem + '/' + str(number), self._auth) payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'POST': if 'title' not in kwargs: print 'ERROR: title is required when creating an issue' return return r.Request.post(url_rem, payload, self._auth) return r.Request.patch(url_rem + '/' + str(number), payload, self._auth) ''' if 'assignees': https://developer.github.com/v3/issues/assignees/#list-assignees else: https://developer.github.com/v3/issues/assignees/#check-assignee ''' def repos_assignees(self, owner, repo, assignee=None): url_rem = 'repos/' + owner + '/' + repo + '/assignees' return r.Request.get(url_rem + '/' + assignee, self._auth) if assignee is not None else r.Request.get(url_rem, self._auth) ''' if method is 'GET': https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository https://developer.github.com/v3/issues/comments/#get-a-single-comment if method is 'POST': https://developer.github.com/v3/issues/comments/#create-a-comment if method is 'PATCH': https://developer.github.com/v3/issues/comments/#edit-a-comment if method is 'DELETE': https://developer.github.com/v3/issues/comments/#delete-a-comment ''' def repos_issues_comments(self, owner, repo, number=None, id=None, **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\' or \'DELETE\' ' return url_rem = 'repos/' + owner + '/' + repo + '/issues' if method is 'GET': return r.Request.get(url_rem + '/' + str(number) + '/comments', self._auth) if number is not None else r.Request.get(url_rem + '/comments', self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/comments/' + str(id), self._auth) payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if 'body' not in kwargs: print 'ERROR: body is required when creating/editing an issue comment' return if method is 'POST': return r.Request.post(url_rem + '/' + str(number) + '/comments', payload, self._auth) if method is 'PATCH': return r.Request.patch(url_rem + '/comments/' + str(id), payload, self._auth) ''' if issue_number is not None: https://developer.github.com/v3/issues/events/#list-events-for-an-issue if id is not None: https://developer.github.com/v3/issues/events/#get-a-single-event else: https://developer.github.com/v3/issues/events/#list-events-for-a-repository ''' def repos_issues_events(self, owner, repo, issue_number=None, id=None): url_rem = 'repos/' + owner + '/' + repo + '/issues' if issue_number is not None: return r.Request.get(url_rem + '/' + issue_number + '/events', self._auth) if id is not None: return r.Request.get(url_rem + '/events/' + str(id), self._auth) return r.Request.get(url_rem + '/events', self._auth) ''' https://developer.github.com/v3/issues/labels/ ''' def repos_labels(self, owner, repo, number=None, name=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\' or \'DELETE\' ' return url_rem = 'repos/' + owner + '/' + repo + '/labels' if method is 'GET': return r.Request.get(url_rem, self._auth) if name is None else r.Request.get(url_rem + '/' + name, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + name, self._auth) payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if 'name' not in kwargs or 'color' not in kwargs: print 'ERROR: name and color required to create or edit a label' return if method is 'POST': return r.Request.post(url_rem, payload, self._auth) return r.Request.patch(url_rem + '/' + name, payload, self._auth) def repos_issues_labels(self, owner, repo, number, name=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PUT' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PUT\' or \'DELETE\' ' return url_rem = 'repos/' + owner + '/' + repo + '/issues/' + str(number) + '/labels' if method is 'POST': return r.Request.post(url_rem, args, self._auth) if method is 'PUT': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post(url_rem, data=payload, auth=self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) if name is None else r.Request.delete(url_rem + '/' + name, self._auth) return r.Request.get(url_rem, self._auth) ''' https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone ''' def repos_milestones_labels(self): url_rem = 'repos/' + owner + '/' + repo + '/milestones/' + str(number) + '/labels' return r.Request.get(url_rem, self._auth) ''' if method is 'GET': if number is None: https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository https://developer.github.com/v3/issues/milestones/#get-a-single-milestone if method is 'POST': https://developer.github.com/v3/issues/milestones/#create-a-milestone if method is 'PATCH': https://developer.github.com/v3/issues/milestones/#edit-a-milestone if method is 'DELETE': https://developer.github.com/v3/issues/milestones/#delete-a-milestone ''' def repos_milestones(self, owner, repo, number=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\' or \'DELETE\' ' return url_rem = 'repos/' + owner + '/' + repo + '/milestones' payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'POST': if 'title' not in kwargs: print 'ERROR: title is required when creating a milestone' return return r.Request.post(url_rem, payload, self._auth) if method is 'PATCH': return r.Request.patch(url_rem + '/' + str(number), payload, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + str(number), self._auth) if number is not None: return r.Request.get_with_params(url_rem + '/' + str(number), self._auth) return r.Request.get(url_rem, payload, self._auth) ############### #MISCELLANEOUS# ############### ''' https://developer.github.com/v3/emojis/#emojis ''' def emojis(self): return r.Request.get('emojis', self._auth) ''' https://developer.github.com/v3/gitignore/ ''' def gitignore_templates(self): return r.Request.get('gitignore/templates', self._auth) ''' https://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document ''' def markdown(self, **kwargs): if 'text' not in kwargs: print 'ERROR: text required when rendering a mardown document' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post('markdown', payload, self._auth) ''' https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode ''' def markdown_raw(self, **kwargs): payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.post('markdown/raw', payload, self._auth) ''' https://developer.github.com/v3/meta/ ''' def meta(self, **kwargs): params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get('meta', self._auth) if len(kwargs) < 0 else r.Request.get_with_params('meta', params, self._auth) ''' https://developer.github.com/v3/rate_limit/#get-your-current-rate-limit-status ''' def rate_limit(self): return r.Request.get('rate_limit', self._auth) ############### #ORGANIZATIONS# ############### ''' https://developer.github.com/v3/orgs/#list-user-organizations ''' def users_orgs(self, username=None): if username is None: return r.Request.get('users/' + username + '/orgs', self._auth) return r.Request.get('users/orgs', self._auth) ''' if method is 'GET': https://developer.github.com/v3/orgs/#get-an-organization else: https://developer.github.com/v3/orgs/#edit-an-organization ''' def orgs(self, org, method='GET', **kwargs): if method is not 'GET' and method is not 'PATCH': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PATCH\' ' return url_rem = 'orgs/' + org if method is 'PATCH': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.patch(url_rem, payload, self._auth) ''' if method is 'GET': if username is not None: https://developer.github.com/v3/orgs/members/#check-membership else: https://developer.github.com/v3/orgs/members/#members-list else: https://developer.github.com/v3/orgs/members/#remove-a-member ''' def orgs_members(self, org, username=None, method='GET', **kwargs): if method is not 'GET' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'DELETE\' ' return url_rem = 'orgs/' + org + '/members' if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + username, self._auth) params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params(url_rem, params, self._auth) if username is None else r.Request.get(url_rem + '/' + username, self._auth) ''' if method is 'GET': if username is None: https://developer.github.com/v3/orgs/members/#public-members-list else: https://developer.github.com/v3/orgs/members/#check-public-membership elif method is 'PUT': https://developer.github.com/v3/orgs/members/#publicize-a-users-membership else: https://developer.github.com/v3/orgs/members/#conceal-a-users-membership ''' def orgs_public_members(self, org, username=None, method='GET'): if method is not 'GET' and method is not 'PUT' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\' ' return url_rem = 'orgs/' + org + '/public_members' if method is 'PUT': return r.Request.put(url_rem + '/' + username, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + username, self._auth) return r.Request.get(url_rem, self._auth) if username is None else r.Request.get(url_rem + '/' + username, self._auth) ''' if method is 'GET': https://developer.github.com/v3/orgs/teams/#list-teams else: https://developer.github.com/v3/orgs/teams/#create-team ''' def orgs_teams(self, org, method='GET', **kwargs): if method is not 'GET' and method is not 'POST': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' ' return url_rem = 'orgs/' + org + '/teams' if method is 'POST': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if 'name' not in kwargs: print 'ERROR: name is required when creating a team' return return r.Request.post(url_rem, payload, self._auth) return r.Request.get(url_rem, self._auth) ''' if method is 'GET': https://developer.github.com/v3/orgs/teams/#get-team elif method is 'DELETE': https://developer.github.com/v3/orgs/teams/#delete-team else: https://developer.github.com/v3/orgs/teams/#edit-team ''' def teams(self, id, method='GET', **kwargs): if method is not 'GET' and method is not 'PATCH' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PATCH\' or \'DELETE\' ' return url_rem = 'teams/' + str(id) if method is 'PATCH': if 'name' not in kwargs: print 'ERROR: name is required when editing a team' return payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.patch(url_rem, payload, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem, self._auth) return r.Request.get(url_rem, self._auth) ''' if method is 'GET': if username is None: https://developer.github.com/v3/orgs/teams/#list-team-members else: https://developer.github.com/v3/orgs/teams/#get-team-member elif method is 'PUT': https://developer.github.com/v3/orgs/teams/#add-team-member else: https://developer.github.com/v3/orgs/teams/#remove-team-member ''' def teams_members(self, id, username=None, method='GET'): if method is not 'GET' and method is not 'PUT' and method is not 'delete'.upper(): print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\' or \'DELETE\'' return url_rem = 'teams/' + str(id) + '/members' if method is 'PUT': return r.Request.put(url_rem + '/' + username, None, { 'Content-Length' : 0 }, self._auth) if method is 'delete'.upper(): return r.Request.delete(url_rem + '/' + username, self._auth) return r.Request.get(url_rem, self._auth) if username is None else r.Request.get(url_rem + '/' + username, self._auth) ############### #PULL-REQUESTS# ############### ''' if method is 'GET': if number is None: https://developer.github.com/v3/pulls/#link-relations else: https://developer.github.com/v3/pulls/#get-a-single-pull-request elif method is 'POST': https://developer.github.com/v3/pulls/#create-a-pull-request else: https://developer.github.com/v3/pulls/#update-a-pull-request ''' def repos_pulls(self, owner, repo, number=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\'' return url_rem = 'repos/' + owner + '/' + repo + '/pulls' payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'POST': return r.Request.post(url_rem, payload, self._auth) if method is 'PATCH': return r.Request.patch(url_rem + '/' + str(number), payload, self._auth) return r.Request.get_with_params(url_rem, payload, self._auth) if number is None else r.Request.get(url_rem + '/' + str(number), self._auth) ''' https://developer.github.com/v3/pulls/#list-pull-requests-files ''' def repos_pulls_files(self, owner, repo, number): return r.Request.get('repos/' + owner + '/' + repo + '/pulls/' + str(number) + '/files', self._auth) ''' if method is 'GET': https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged else: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button ''' def repos_pulls_merge(self, owner, repo, number, method='GET', **kwargs): if method is not 'GET' and method is not 'PUT': print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'PUT\'' return url_rem = 'repos/' + owner + '/' + repo + '/pulls/' + str(number) + '/merge' if method is 'PUT': payload = {} for arg in kwargs: payload[arg] = kwargs[arg] return r.Request.put(url_rem, payload, None, self._auth) if len(payload) > 0 else r.Request.put(url_rem, None, { 'Content-Length' : 0 }, self._auth) return r.Request.get(url_rem, self._auth) ''' if method is 'GET': if number is None: https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request else: https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository if method is 'DELETE': https://developer.github.com/v3/pulls/comments/#delete-a-comment if method is 'POST': https://developer.github.com/v3/pulls/comments/#create-a-comment else: https://developer.github.com/v3/pulls/comments/#edit-a-comment ''' def repos_pulls_comments(self, owner, repo, number=None, method='GET', **kwargs): if method not in { 'GET' : 1, 'POST' : 1, 'PATCH' : 1, 'delete'.upper() : 1 }: print 'ERROR: invalid method parameter:' + str(method) print 'method must be \'GET\' (default) or \'POST\' or \'PATCH\' or \'DELETE\'' return url_rem = 'repos/' + owner + '/' + repo + '/pulls' if method is 'delete'.upper(): return r.Request.delete(url_rem + '/comments/' + str(number), self._auth) payload = {} for arg in kwargs: payload[arg] = kwargs[arg] if method is 'POST': return r.Request.post(url_rem + '/' + str(number) + '/comments', payload, self._auth) if method is 'PATCH': return r.Request.patch(url_rem + '/comments/' + str(number), payload, self._auth) if number is None: return r.Request.get_with_params(url_rem + '/comments', payload, self._auth) return r.Request.get(url_rem + '/' + str(number) + '/comments', self._auth) ''' This is the only function that doesn't conform to the naming conventions of this class because it is the only one that is truly ambiguous (i.e. it has the same signature as another) https://developer.github.com/v3/pulls/comments/#get-a-single-comment ''' def repo_pulls_comment(self, owner, repo, number): return r.Request.get('repos/' + owner + '/' + repo + '/pulls/comments/' + str(number), self._auth) ########## ##SEARCH## ########## ''' https://developer.github.com/v3/search/#search-repositories ''' def search_repositories(self, **kwargs): params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params('search/repositories', params, self._auth) ''' https://developer.github.com/v3/search/#search-code ''' def search_code(self, **kwargs): params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params('search/code', params, self._auth) ''' https://developer.github.com/v3/search/#search-issues ''' def search_issues(self, **kwargs): params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params('search/issues', params, self._auth) ''' https://developer.github.com/v3/search/#search-users ''' def search_users(self, **kwargs): params = {} for arg in kwargs: params[arg] = kwargs[arg] return r.Request.get_with_params('search/users', params, self._auth)
36.491853
173
0.667157
8,913
60,467
4.4471
0.033322
0.038903
0.10142
0.116633
0.837122
0.799203
0.773696
0.721447
0.665489
0.5978
0
0.00545
0.156399
60,467
1,656
174
36.513889
0.771594
0.002663
0
0.621315
0
0
0.173965
0.003126
0
0
0
0
0
0
null
null
0.003401
0.001134
null
null
0.119048
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
5f160dc49c8eb11040f93239293776631288eeff
393
py
Python
computational_block/two/exceptions.py
spectrum-dev/django-block-monolith
c17a1ef98ae813a4e94581e2e52a4a03f0e65769
[ "MIT" ]
null
null
null
computational_block/two/exceptions.py
spectrum-dev/django-block-monolith
c17a1ef98ae813a4e94581e2e52a4a03f0e65769
[ "MIT" ]
null
null
null
computational_block/two/exceptions.py
spectrum-dev/django-block-monolith
c17a1ef98ae813a4e94581e2e52a4a03f0e65769
[ "MIT" ]
null
null
null
class ComputationalBlockTwoInvalidOperationTypeException(Exception): pass class ComputationalBlockTwoFieldDoesNotExistException(Exception): pass class ComputationalBlockTwoOperationValueNotFloatException(Exception): pass class ComputationalBlockTwoDataValueNotFloatException(Exception): pass class ComputationalBlockTwoInputPayloadInvalidException(Exception): pass
20.684211
70
0.852417
20
393
16.75
0.4
0.19403
0.214925
0
0
0
0
0
0
0
0
0
0.109415
393
18
71
21.833333
0.957143
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
a031782c3688b645bdde44084f7614ced3fe5e6d
670
py
Python
networkx/algorithms/community/tests/test_utils.py
jebogaert/networkx
8563c3313223a53c548530f39c8cfb6e433539d3
[ "BSD-3-Clause" ]
10,024
2015-01-01T13:06:43.000Z
2022-03-31T12:45:25.000Z
networkx/algorithms/community/tests/test_utils.py
jebogaert/networkx
8563c3313223a53c548530f39c8cfb6e433539d3
[ "BSD-3-Clause" ]
3,191
2015-01-01T18:13:11.000Z
2022-03-31T22:06:00.000Z
networkx/algorithms/community/tests/test_utils.py
jebogaert/networkx
8563c3313223a53c548530f39c8cfb6e433539d3
[ "BSD-3-Clause" ]
3,272
2015-01-01T05:04:53.000Z
2022-03-31T17:46:35.000Z
"""Unit tests for the :mod:`networkx.algorithms.community.utils` module. """ import networkx as nx from networkx.algorithms.community import is_partition def test_is_partition(): G = nx.empty_graph(3) assert is_partition(G, [{0, 1}, {2}]) assert is_partition(G, ({0, 1}, {2})) assert is_partition(G, ([0, 1], [2])) assert is_partition(G, [[0, 1], [2]]) def test_not_covering(): G = nx.empty_graph(3) assert not is_partition(G, [{0}, {1}]) def test_not_disjoint(): G = nx.empty_graph(3) assert not is_partition(G, [{0, 1}, {1, 2}]) def test_not_node(): G = nx.empty_graph(3) assert not is_partition(G, [{0, 1}, {3}])
22.333333
72
0.629851
109
670
3.688073
0.275229
0.246269
0.238806
0.226368
0.574627
0.519901
0.485075
0.485075
0.485075
0.485075
0
0.046041
0.189552
670
29
73
23.103448
0.694291
0.102985
0
0.235294
0
0
0
0
0
0
0
0
0.411765
1
0.235294
false
0
0.117647
0
0.352941
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
0
0
0
5
a04ff3cde467e4c7f61e99d6319e26a99e83ca02
50
py
Python
custom/__init__.py
egyptdj/GANs
07c33a6e3978b599d002bc562472040cb6e74e16
[ "MIT" ]
2
2019-03-14T05:43:19.000Z
2020-11-04T19:43:34.000Z
custom/__init__.py
egyptdj/GANs
07c33a6e3978b599d002bc562472040cb6e74e16
[ "MIT" ]
null
null
null
custom/__init__.py
egyptdj/GANs
07c33a6e3978b599d002bc562472040cb6e74e16
[ "MIT" ]
null
null
null
from .layers import * from .regularizers import *
16.666667
27
0.76
6
50
6.333333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.16
50
2
28
25
0.904762
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a06076e7068a2bfe75d0f2fe8838cc2e8f508fed
124
py
Python
scrappy/util/tmpFile.py
V-in/scrappy
d083614e5c6b0821ebffd68dacab7b9301b3f579
[ "MIT" ]
6
2019-04-26T00:32:10.000Z
2020-06-20T12:57:37.000Z
scrappy/util/tmpFile.py
V-in/scrappy
d083614e5c6b0821ebffd68dacab7b9301b3f579
[ "MIT" ]
null
null
null
scrappy/util/tmpFile.py
V-in/scrappy
d083614e5c6b0821ebffd68dacab7b9301b3f579
[ "MIT" ]
null
null
null
from tempfile import gettempdir from os import path def tmpFile(file_path): return path.join(gettempdir(), file_path)
17.714286
45
0.774194
18
124
5.222222
0.611111
0.170213
0
0
0
0
0
0
0
0
0
0
0.153226
124
6
46
20.666667
0.895238
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
0
0
0
5
263a95281fb528324ffb4e6bdcae4d2f4729a342
52
py
Python
backend/products/serializers/__init__.py
MaCkRage/optimize_sql
346011fbda5ddf96a3c34357820452e165b7767c
[ "MIT" ]
null
null
null
backend/products/serializers/__init__.py
MaCkRage/optimize_sql
346011fbda5ddf96a3c34357820452e165b7767c
[ "MIT" ]
null
null
null
backend/products/serializers/__init__.py
MaCkRage/optimize_sql
346011fbda5ddf96a3c34357820452e165b7767c
[ "MIT" ]
null
null
null
from .update_product import UpdateProductSerializer
26
51
0.903846
5
52
9.2
1
0
0
0
0
0
0
0
0
0
0
0
0.076923
52
1
52
52
0.958333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
267cc1c9f84bd68776d318814392d637bcdc5efe
267
py
Python
__init__.py
PapaDoraemon/marina-AI
9f9281b5decf889a55d6c1bdbfe3a62adadd47f9
[ "Apache-2.0" ]
1
2020-09-04T12:42:54.000Z
2020-09-04T12:42:54.000Z
__init__.py
PapaDoraemon/marina-AI
9f9281b5decf889a55d6c1bdbfe3a62adadd47f9
[ "Apache-2.0" ]
null
null
null
__init__.py
PapaDoraemon/marina-AI
9f9281b5decf889a55d6c1bdbfe3a62adadd47f9
[ "Apache-2.0" ]
null
null
null
from .exceptions import * from .MultiChoiceQuestion import * from .Question import * from .ScoreQuestion import * from .ScoringSystem import * from .YesNoQuestion import * from .RankingSystem import * from .StandardInputSingleCandidateRankingSystem import *
26.7
57
0.786517
24
267
8.75
0.416667
0.333333
0
0
0
0
0
0
0
0
0
0
0.153558
267
9
58
29.666667
0.929204
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
26858c56300be395474b8932c2b128d6decdb7e0
139
py
Python
app/core/admin.py
veekthor04/lord-of-the-rings
07d55688d19205f1c8416cf5c6daa6bb8f0e8c9d
[ "MIT" ]
null
null
null
app/core/admin.py
veekthor04/lord-of-the-rings
07d55688d19205f1c8416cf5c6daa6bb8f0e8c9d
[ "MIT" ]
null
null
null
app/core/admin.py
veekthor04/lord-of-the-rings
07d55688d19205f1c8416cf5c6daa6bb8f0e8c9d
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import CustomUser, Favorite admin.site.register(CustomUser) admin.site.register(Favorite)
17.375
40
0.820144
18
139
6.333333
0.555556
0.157895
0.298246
0
0
0
0
0
0
0
0
0
0.100719
139
7
41
19.857143
0.912
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
cd125149dd3759e95eb0d362ac2e36bb948e672e
79
py
Python
checkov/common/util/file_utils.py
pmalkki/checkov
b6cdf386dd976fe27c16fed6d550756a678a5d7b
[ "Apache-2.0" ]
4,013
2019-12-09T13:16:54.000Z
2022-03-31T14:31:01.000Z
checkov/common/util/file_utils.py
pmalkki/checkov
b6cdf386dd976fe27c16fed6d550756a678a5d7b
[ "Apache-2.0" ]
1,258
2019-12-17T09:55:51.000Z
2022-03-31T19:17:17.000Z
checkov/common/util/file_utils.py
pmalkki/checkov
b6cdf386dd976fe27c16fed6d550756a678a5d7b
[ "Apache-2.0" ]
638
2019-12-19T08:57:38.000Z
2022-03-30T21:38:37.000Z
def convert_to_unix_path(path: str) -> str: return path.replace('\\', '/')
26.333333
43
0.632911
11
79
4.272727
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.151899
79
3
44
26.333333
0.701493
0
0
0
0
0
0.037975
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
cd13a9b0f8224975ecd561c3a32a46262c0a4c8f
39
py
Python
ethronsoft/gcspypi/exceptions/state_errors.py
JuergenSimon/gcspypi
80ac843e6702161915db45949c470d749aaabfda
[ "BSD-2-Clause" ]
8
2018-01-06T21:11:36.000Z
2021-07-25T13:19:30.000Z
ethronsoft/gcspypi/exceptions/state_errors.py
JuergenSimon/gcspypi
80ac843e6702161915db45949c470d749aaabfda
[ "BSD-2-Clause" ]
8
2017-05-24T17:14:07.000Z
2021-03-12T22:58:49.000Z
ethronsoft/gcspypi/exceptions/state_errors.py
JuergenSimon/gcspypi
80ac843e6702161915db45949c470d749aaabfda
[ "BSD-2-Clause" ]
7
2018-01-06T21:11:42.000Z
2020-12-06T17:43:53.000Z
class InvalidState(Exception): pass
19.5
30
0.769231
4
39
7.5
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
39
2
31
19.5
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
cd19a3daf7958c1fe9cf8e4becf9b1c665760ea2
148
py
Python
update/__main__.py
aphrim/platform-documentation
66f3f6964e299f35a5eff359276d78d9cc3c4361
[ "MIT" ]
36
2020-04-28T18:42:02.000Z
2022-02-18T20:13:19.000Z
update/__main__.py
aphrim/platform-documentation
66f3f6964e299f35a5eff359276d78d9cc3c4361
[ "MIT" ]
490
2020-03-14T20:42:27.000Z
2022-03-28T16:03:10.000Z
update/__main__.py
aphrim/platform-documentation
66f3f6964e299f35a5eff359276d78d9cc3c4361
[ "MIT" ]
87
2020-03-17T13:21:39.000Z
2022-03-27T10:16:37.000Z
from update import update_dump, update_environment def main(): update_dump() update_environment() if __name__ == '__main__': main()
13.454545
50
0.695946
17
148
5.352941
0.529412
0.21978
0.351648
0.593407
0
0
0
0
0
0
0
0
0.202703
148
10
51
14.8
0.771186
0
0
0
0
0
0.054054
0
0
0
0
0
0
1
0.166667
true
0
0.166667
0
0.333333
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
cd470cf1f1b6d10b8f70ca692b3b5a8c6b47610e
435
py
Python
plynx/web/__init__.py
live-wire/plynx
ed29db2b7880ed512974cd98993587886763a5f5
[ "Apache-2.0" ]
null
null
null
plynx/web/__init__.py
live-wire/plynx
ed29db2b7880ed512974cd98993587886763a5f5
[ "Apache-2.0" ]
null
null
null
plynx/web/__init__.py
live-wire/plynx
ed29db2b7880ed512974cd98993587886763a5f5
[ "Apache-2.0" ]
null
null
null
# flake8: noqa from plynx.web.common import app, verify_password, authenticate, requires_auth, register_user, make_fail_response, run_backend from plynx.web.node import get_nodes, post_node from plynx.web.graph import get_graph, post_graph from plynx.web.resource import get_resource, post_resource from plynx.web.user import get_auth_token, post_demo_user from plynx.web.state import master_state from gevent.pywsgi import WSGIServer
48.333333
126
0.848276
70
435
5.028571
0.471429
0.153409
0.204545
0
0
0
0
0
0
0
0
0.002538
0.094253
435
8
127
54.375
0.890863
0.027586
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.142857
1
0
1
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
0
0
0
5
cd4a77d45c35fc620abccc875e9b3e0559589595
83
py
Python
learn2learn/text/datasets/__init__.py
toughhou/learn2learn
55ba14b02374bbe3bb892977f2b09d17c1e490bb
[ "MIT" ]
null
null
null
learn2learn/text/datasets/__init__.py
toughhou/learn2learn
55ba14b02374bbe3bb892977f2b09d17c1e490bb
[ "MIT" ]
null
null
null
learn2learn/text/datasets/__init__.py
toughhou/learn2learn
55ba14b02374bbe3bb892977f2b09d17c1e490bb
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 from .news_classification import NewsClassificationDataset
20.75
58
0.843373
9
83
7.666667
1
0
0
0
0
0
0
0
0
0
0
0.013158
0.084337
83
3
59
27.666667
0.894737
0.253012
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
cd89c121d0e0304a1c010e62ddc35c0062075ea6
67
py
Python
tests/__init__.py
afranck64/ultimatum
313b840e6f0942c1c937aa8b3f2d26e5059c7a7f
[ "MIT" ]
null
null
null
tests/__init__.py
afranck64/ultimatum
313b840e6f0942c1c937aa8b3f2d26e5059c7a7f
[ "MIT" ]
7
2020-01-28T22:41:06.000Z
2021-04-29T22:23:23.000Z
tests/__init__.py
afranck64/ultimatum
313b840e6f0942c1c937aa8b3f2d26e5059c7a7f
[ "MIT" ]
null
null
null
import os TEST_DIR = os.path.split(os.path.split(__file__)[0])[0]
16.75
55
0.716418
13
67
3.307692
0.615385
0.27907
0.511628
0
0
0
0
0
0
0
0
0.032787
0.089552
67
3
56
22.333333
0.672131
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
26a488196047b6ab522f0f8f3b29d99f3364cc0b
1,258
py
Python
tests/test_admin_views.py
danyentezari/synbiohub
09317e3eb3820c596502efad441031835698ad54
[ "BSD-2-Clause" ]
1
2020-04-02T11:33:14.000Z
2020-04-02T11:33:14.000Z
tests/test_admin_views.py
danyentezari/synbiohub
09317e3eb3820c596502efad441031835698ad54
[ "BSD-2-Clause" ]
null
null
null
tests/test_admin_views.py
danyentezari/synbiohub
09317e3eb3820c596502efad441031835698ad54
[ "BSD-2-Clause" ]
null
null
null
import requests from unittest import TestCase from test_functions import compare_get_request, compare_post_request class TestAdminViews(TestCase): def test_admin_status(self): compare_get_request("/admin") def test_admin_explorer(self): compare_get_request("/admin/explorer") def test_admin_users(self): compare_get_request("/admin/users") def test_admin_mail(self): compare_get_request("/admin/mail") def test_admin_plugins(self): compare_get_request("/admin/plugins") def test_admin_graphs(self): compare_get_request("/admin/graphs") def test_admin_remotes(self): compare_get_request("/admin/remotes") def test_admin_registries(self): compare_get_request("admin/registries") def test_admin_theme(self): compare_get_request("/admin/theme") def test_admin_newUser(self): compare_get_request("/admin/newUser") def test_admin_sparql(self): compare_get_request("/admin/sparql", headers = {"Accept": "text/html"}) # TODO: fix backup in docker containers #def test_admin_backup(self): # compare_get_request("admin/backup") #def test_admin_log(self): # compare_get_request("admin/log")
26.208333
79
0.701113
158
1,258
5.221519
0.240506
0.169697
0.288485
0.330909
0.409697
0
0
0
0
0
0
0
0.193164
1,258
47
80
26.765957
0.812808
0.131161
0
0
0
0
0.142594
0
0
0
0
0.021277
0
1
0.423077
false
0
0.115385
0
0.576923
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
1
0
0
5
26e40e4f25bce9e4dc2ee05d33f8fc21f82a2f36
37
wsgi
Python
flask website/app.wsgi
silas-hw/silaschat
86668c444b2b546cb5d62243a024f0b843c72db6
[ "MIT" ]
1
2020-11-03T15:53:15.000Z
2020-11-03T15:53:15.000Z
flask website/app.wsgi
silas-hw/silaschat
86668c444b2b546cb5d62243a024f0b843c72db6
[ "MIT" ]
null
null
null
flask website/app.wsgi
silas-hw/silaschat
86668c444b2b546cb5d62243a024f0b843c72db6
[ "MIT" ]
null
null
null
from app.py import app as application
37
37
0.837838
7
37
4.428571
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.135135
37
1
37
37
0.96875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
26ee7ec8337c65d594b16b6a6384b10721f3fc6b
39
py
Python
BrainFuck/__init__.py
uesleibros/BigBrain-a-BrainFuck-Interpreter
a96af04f5a5e91f57ff395e960686e86e6c8436d
[ "MIT" ]
1
2022-03-31T23:50:46.000Z
2022-03-31T23:50:46.000Z
BrainFuck/__init__.py
uesleibros/BigBrain-a-BrainFuck-Interpreter
a96af04f5a5e91f57ff395e960686e86e6c8436d
[ "MIT" ]
null
null
null
BrainFuck/__init__.py
uesleibros/BigBrain-a-BrainFuck-Interpreter
a96af04f5a5e91f57ff395e960686e86e6c8436d
[ "MIT" ]
null
null
null
from .Interpreter.interpreter import *
19.5
38
0.820513
4
39
8
0.75
0
0
0
0
0
0
0
0
0
0
0
0.102564
39
1
39
39
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
26eefe369ac8e4cf3f8aa64c9035dfbdc9b4b8bc
9
py
Python
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/imports/test_import_package_5/random_module/in1/file.py
Vladpetr/NewsPortal
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
[ "Apache-2.0" ]
null
null
null
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/imports/test_import_package_5/random_module/in1/file.py
Vladpetr/NewsPortal
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
[ "Apache-2.0" ]
5
2021-04-08T22:02:15.000Z
2022-02-10T14:53:45.000Z
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/imports/test_import_package_5/random_module/in1/file.py
Vladpetr/NewsPortal
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
[ "Apache-2.0" ]
null
null
null
y = 2030
4.5
8
0.555556
2
9
2.5
1
0
0
0
0
0
0
0
0
0
0
0.666667
0.333333
9
1
9
9
0.166667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
f80725f3eb8037e78816d210bb369750024a8401
109
py
Python
gfdata/args/basic/__init__.py
gfquant/gfdata
651f5fca4d8bda6218f2b5ad52c18ac972ec7542
[ "MIT" ]
null
null
null
gfdata/args/basic/__init__.py
gfquant/gfdata
651f5fca4d8bda6218f2b5ad52c18ac972ec7542
[ "MIT" ]
null
null
null
gfdata/args/basic/__init__.py
gfquant/gfdata
651f5fca4d8bda6218f2b5ad52c18ac972ec7542
[ "MIT" ]
1
2022-01-22T15:17:19.000Z
2022-01-22T15:17:19.000Z
# -*- coding: utf-8 -*- # @time: 2022/1/20 1:03 # @Author:lhf # ---------------------- from ._basic import *
18.166667
24
0.449541
14
109
3.428571
0.928571
0
0
0
0
0
0
0
0
0
0
0.119565
0.155963
109
5
25
21.8
0.402174
0.715596
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f81bd238bbc7e83087e86317f229e8c27680670c
443
py
Python
10- Pagination/blog/errors.py
alok-sriv/Flask-Blog
27ac2c63a289ef448ffa9a2321b3c51a3d8c7c64
[ "MIT" ]
null
null
null
10- Pagination/blog/errors.py
alok-sriv/Flask-Blog
27ac2c63a289ef448ffa9a2321b3c51a3d8c7c64
[ "MIT" ]
null
null
null
10- Pagination/blog/errors.py
alok-sriv/Flask-Blog
27ac2c63a289ef448ffa9a2321b3c51a3d8c7c64
[ "MIT" ]
null
null
null
# FileName: Flask-Blog > blog > errors.py from flask import render_template from blog import app, db @app.errorhandler(403) def error_403(error): return render_template('errors/403.html'), 403 @app.errorhandler(404) def not_found_error(error): return render_template('errors/404.html'), 404 @app.errorhandler(500) def internal_error(error): db.session.rollback() return render_template('errors/500.html'), 500
27.6875
51
0.726862
62
443
5.064516
0.387097
0.178344
0.191083
0.248408
0.197452
0
0
0
0
0
0
0.08
0.153499
443
16
52
27.6875
0.757333
0.088036
0
0
0
0
0.115979
0
0
0
0
0
0
1
0.25
false
0
0.166667
0.166667
0.666667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
f83875509fd911967d51e5c9969fafff8d3672d3
29
py
Python
bayesian_irl/src/env/__init__.py
clear-nus/BOIRL
cc872111fda3c7b8118e1a864831013c30f63948
[ "MIT" ]
1
2021-02-26T10:09:15.000Z
2021-02-26T10:09:15.000Z
bayesian_irl/src/env/__init__.py
clear-nus/BOIRL
cc872111fda3c7b8118e1a864831013c30f63948
[ "MIT" ]
null
null
null
bayesian_irl/src/env/__init__.py
clear-nus/BOIRL
cc872111fda3c7b8118e1a864831013c30f63948
[ "MIT" ]
null
null
null
from .loop_env import LoopEnv
29
29
0.862069
5
29
4.8
1
0
0
0
0
0
0
0
0
0
0
0
0.103448
29
1
29
29
0.923077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f84383f3e505c865afb6f84bd8f190661884c4a6
39
py
Python
api/v1/__init__.py
Kadantte/MangAdventure
0646617cb6376eaeb3142cbd1f266267518a149f
[ "MIT" ]
58
2019-03-04T09:22:42.000Z
2022-02-18T09:11:57.000Z
api/v1/__init__.py
Kadantte/MangAdventure
0646617cb6376eaeb3142cbd1f266267518a149f
[ "MIT" ]
21
2019-03-07T19:34:53.000Z
2021-12-19T12:46:40.000Z
api/v1/__init__.py
Kadantte/MangAdventure
0646617cb6376eaeb3142cbd1f266267518a149f
[ "MIT" ]
14
2019-06-06T09:53:13.000Z
2021-12-17T14:34:13.000Z
"""The original version of the API."""
19.5
38
0.666667
6
39
4.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.153846
39
1
39
39
0.787879
0.820513
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
f85f5c0e4f990dd6ce01a751b6873614badb2437
986
py
Python
day02/test_day02.py
patkub/advent-of-code-2021
d1a5b34b2c61655dd52f8379dfd310f16353f981
[ "BSD-3-Clause" ]
null
null
null
day02/test_day02.py
patkub/advent-of-code-2021
d1a5b34b2c61655dd52f8379dfd310f16353f981
[ "BSD-3-Clause" ]
null
null
null
day02/test_day02.py
patkub/advent-of-code-2021
d1a5b34b2c61655dd52f8379dfd310f16353f981
[ "BSD-3-Clause" ]
null
null
null
import pytest from day02 import calc_horizontal_depth, calc_horizontal_depth_part2 def test_example_horizontal_depth(): with open("./day02/example-input") as f: lines = [tuple(line.strip().split()) for line in f.readlines()] res = calc_horizontal_depth(lines) assert res == 150 def test_example_horizontal_depth_part2(): with open("./day02/example-input") as f: lines = [tuple(line.strip().split()) for line in f.readlines()] res = calc_horizontal_depth_part2(lines) assert res == 900 def test_horizontal_depth(): with open("./day02/input") as f: lines = [tuple(line.strip().split()) for line in f.readlines()] res = calc_horizontal_depth(lines) assert res == 1660158 def test_horizontal_depth_part2(): with open("./day02/input") as f: lines = [tuple(line.strip().split()) for line in f.readlines()] res = calc_horizontal_depth_part2(lines) assert res == 1604592846
31.806452
71
0.665314
132
986
4.765152
0.227273
0.238474
0.18124
0.082671
0.829889
0.737679
0.674086
0.674086
0.674086
0.674086
0
0.04878
0.209939
986
30
72
32.866667
0.758665
0
0
0.545455
0
0
0.068966
0.042596
0
0
0
0
0.181818
1
0.181818
false
0
0.090909
0
0.272727
0
0
0
0
null
1
1
0
1
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
f8694b50a382ec56fcfb495d5f38b048bc2de139
47
py
Python
example_snippets/multimenus_snippets/Snippets/NumPy/Reshaping and viewing arrays/Exchange two axes in an array.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
null
null
null
example_snippets/multimenus_snippets/Snippets/NumPy/Reshaping and viewing arrays/Exchange two axes in an array.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
null
null
null
example_snippets/multimenus_snippets/Snippets/NumPy/Reshaping and viewing arrays/Exchange two axes in an array.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
1
2021-02-04T04:51:48.000Z
2021-02-04T04:51:48.000Z
np.arange(210).reshape((2,3,5,7)).swapaxes(1,3)
47
47
0.680851
11
47
2.909091
0.909091
0
0
0
0
0
0
0
0
0
0
0.191489
0
47
1
47
47
0.489362
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
f876af8fe737c9622c80c718cabb7a308793d27b
5,889
py
Python
AI_Engine_Development/Design_Tutorials/07-firFilter_AIEvsHLS/HLS/design/python_scripts/fir_plot.py
themkots/Vitis-Tutorials
1f26cb39917da856b13533ffd41934973f20e0ca
[ "Apache-2.0" ]
1
2022-03-09T06:15:43.000Z
2022-03-09T06:15:43.000Z
AI_Engine_Development/Design_Tutorials/07-firFilter_AIEvsHLS/HLS/design/python_scripts/fir_plot.py
Act862/Vitis-Tutorials
6ced6e695245494089911b840a1808ff1c270a4d
[ "Apache-2.0" ]
null
null
null
AI_Engine_Development/Design_Tutorials/07-firFilter_AIEvsHLS/HLS/design/python_scripts/fir_plot.py
Act862/Vitis-Tutorials
6ced6e695245494089911b840a1808ff1c270a4d
[ "Apache-2.0" ]
null
null
null
#------------------------------------------------------------------------------- # (c) Copyright 2021 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #------------------------------------------------------------------------------- import matplotlib.pyplot as plt #from matplotlib.font_manager import FontProperties... #240 Taps FIR: Power vs. Number of Filters... x1 = [1,10] y1 = [0.642,1.352] # plotting the line 1 points #plt.plot(x1, y1, label = "240 Taps AIE FIR") plt.figure(1) plt.plot(x1, y1, color='blue', linewidth = 3, marker='o', markerfacecolor='blue', markersize=8,label = "240 Taps AIE FIR") #plt.set_xlabel('time [s]', fontsize='large', fontweight='bold') # line 2 points x2 = [1,10] y2 = [0.449,4.103] # plotting the line 2 points #plt.plot(x2, y2, label = "240 Taps HLS FIR") plt.plot(x2, y2, color='orange', linewidth = 3, marker='o', markerfacecolor='orange', markersize=8, label = "240 Taps HLS FIR") # naming the x axis plt.xlabel('Number of Filters') # naming the y axis plt.ylabel('Power (W)') # giving a title to my graph plt.title('240 Taps FIR: Power vs. Number of Filters',fontsize= 16, fontweight='bold') # show a legend on the plot plt.legend() plt.grid() plt.margins() # function to show the plot #plt.show() #240 Taps FIR: Computational Efficiency vs. Number of Filters... x1 = [1,10] y1 = [168.19,38.14] # plotting the line 1 points #plt.plot(x1, y1, label = "240 Taps AIE FIR") plt.figure(2) plt.plot(x1, y1, color='blue', linewidth = 3, marker='o', markerfacecolor='blue', markersize=8,label = "240 Taps AIE FIR") #plt.set_xlabel('time [s]', fontsize='large', fontweight='bold') # line 2 points x2 = [1,10] y2 = [277.97,30.05] # plotting the line 2 points #plt.plot(x2, y2, label = "240 Taps HLS FIR") plt.plot(x2, y2, color='orange', linewidth = 3, marker='o', markerfacecolor='orange', markersize=8, label = "240 Taps HLS FIR") # naming the x axis plt.xlabel('Number of Filters') # naming the y axis plt.ylabel('Computational Efficiency (MSPS/W)') # giving a title to my graph plt.title('240 Taps FIR: Computational Efficiency vs. Number of Filters',fontsize= 16, fontweight='bold') # show a legend on the plot plt.legend() plt.grid() plt.margins() #129 Taps FIR: Casc Length Metrics... ##129 Taps FIR: Throughput vs. Cascade Length... x3 = [1,2,4] y3 = [174.023,259.845,330.189] plt.figure(3) plt.plot(x3, y3, color='blue', linewidth = 3, marker='o', markerfacecolor='blue', markersize=8, label = "129 Taps AIE FIR") # naming the x axis plt.xlabel('Cascade Length') # naming the y axis plt.ylabel('Throughput (MSPS)') # giving a title to my graph plt.title('129 Taps FIR: Throughput vs. Cascade Length',fontsize= 16, fontweight='bold') # show a legend on the plot plt.legend() plt.grid() plt.margins() ##129 Taps FIR: Power vs. Cascade Length... x4 = [1,2,4] y4 = [0.625,0.773,0.886] plt.figure(4) plt.plot(x4, y4, color='blue', linewidth = 3, marker='o', markerfacecolor='blue', markersize=8, label = "129 Taps AIE FIR") # naming the x axis plt.xlabel('Cascade Length') # naming the y axis plt.ylabel('Power (W)') # giving a title to my graph plt.title('129 Taps FIR: Power vs. Cascade Length',fontsize= 16, fontweight='bold') # show a legend on the plot plt.legend() plt.grid() plt.margins() ##129 Taps FIR: Computational Efficiency vs. Cascade Length... x5 = [1,2,4] y5 = [278.437,336.151,372.583] plt.figure(5) plt.plot(x5, y5, color='blue', linewidth = 3, marker='o', markerfacecolor='blue', markersize=8, label = "129 Taps AIE FIR") # naming the x axis plt.xlabel('Cascade Length') # naming the y axis plt.ylabel('Computational Efficiency (MSPS/W)') # giving a title to my graph plt.title('129 Taps FIR: Computational Efficiency vs. Cascade Length',fontsize= 16, fontweight='bold') # show a legend on the plot plt.legend() plt.grid() plt.margins() # function to show the plot plt.show() ###################################################################################### #Subplots #129 Taps FIR: Casc Length Metrics... ##129 Taps FIR: Throughput vs. Cascade Length... #x1 = [1,2,4] #y1 = [168.19,38.14,1] #fig, casc_sbplts = plt.subplots(1, 2) ## plotting the line 1 points ##plt.plot(x1, y1, label = "240 Taps AIE FIR") ##casc_sbplts[0].plot(x1, y1, color='blue', linewidth = 3, ## marker='o', markerfacecolor='blue', markersize=8,label = "129 Taps AIE FIR") #casc_sbplts[0].plot(x1, y1) ## naming the x and y axes #casc_sbplts[0].set(xlabel='Cascade Length', ylabel='Throughput (MSPS)') #casc_sbplts[0].set_title('129 Taps FIR: Throughput vs. Cascade Length') # ## show a legend on the plot ##casc_sbplts[0].legend() #casc_sbplts[0].grid() #casc_sbplts[0].margins() # ###129 Taps FIR: Power vs. Cascade Length... #x2 = [1,2,4] #y2 = [277.97,30.05,1] ## plotting the line 1 points ##plt.plot(x2, y2, label = "240 Taps AIE FIR") ##casc_sbplts[1].plot(x2, y2, color='blue', linewidth = 3, ## marker='o', markerfacecolor='blue', markersize=8,label = "129 Taps AIE FIR") #casc_sbplts[1].plot(x1, y1) ## naming the x and y axes #casc_sbplts[1].set(xlabel='Cascade Length', ylabel='Throughput (MSPS)') #casc_sbplts[1].set_title('129 Taps FIR: Throughput vs. Cascade Length') # ## show a legend on the plot ##casc_sbplts[1].legend() #casc_sbplts[1].grid() #casc_sbplts[1].margins() # ## function to show the plot #fig.show()
32.899441
105
0.659195
928
5,889
4.161638
0.188578
0.030813
0.031072
0.039617
0.792336
0.781978
0.774728
0.763594
0.709736
0.660798
0
0.067665
0.149261
5,889
178
106
33.08427
0.703194
0.555273
0
0.6
0
0
0.256209
0
0
0
0
0
0
1
0
false
0
0.015385
0
0.015385
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
3e42f301e65dab417ed55f064fe7e7fbf20ca03a
61
py
Python
drake/__init__.py
MrinalJain17/drake
3bf23c1604952f9a62bd304b148665383ac4de9c
[ "MIT" ]
null
null
null
drake/__init__.py
MrinalJain17/drake
3bf23c1604952f9a62bd304b148665383ac4de9c
[ "MIT" ]
3
2020-06-15T05:08:07.000Z
2020-06-16T18:01:15.000Z
drake/__init__.py
MrinalJain17/drake
3bf23c1604952f9a62bd304b148665383ac4de9c
[ "MIT" ]
null
null
null
from . import utils from .cluster import ConsensusClustering
20.333333
40
0.836066
7
61
7.285714
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.131148
61
2
41
30.5
0.962264
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e41bdd70019d3aa053b4bad38cdff57696d78928
224
py
Python
KlimaKar/templatetags/contenttypes.py
karpiq24/django-klima-kar
e62e79c66053749e249f55e1ab47f810f449f0aa
[ "MIT" ]
2
2018-01-23T22:38:57.000Z
2019-07-14T08:59:19.000Z
KlimaKar/templatetags/contenttypes.py
karpiq24/django-klima-kar
e62e79c66053749e249f55e1ab47f810f449f0aa
[ "MIT" ]
237
2018-08-15T23:13:52.000Z
2022-01-13T13:08:50.000Z
KlimaKar/templatetags/contenttypes.py
karpiq24/django-klima-kar
e62e79c66053749e249f55e1ab47f810f449f0aa
[ "MIT" ]
null
null
null
from django.template import Library from django.contrib.contenttypes.models import ContentType register = Library() @register.filter() def content_type(instance): return ContentType.objects.get_for_model(instance).pk
22.4
58
0.8125
28
224
6.392857
0.75
0.111732
0
0
0
0
0
0
0
0
0
0
0.102679
224
9
59
24.888889
0.890547
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.166667
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
5
e43760c6ca03d5c848b8174aa709e85cb47c55d2
197
py
Python
reviewboard/accounts/errors.py
znick/reviewboard
f32320b267efcdf2feff1661eabe57f99ef490a7
[ "MIT" ]
1
2018-08-23T09:19:02.000Z
2018-08-23T09:19:02.000Z
reviewboard/accounts/errors.py
klpyang/reviewboard
d7dabf36e5b492f18048dd7084026bf99d6933c5
[ "MIT" ]
null
null
null
reviewboard/accounts/errors.py
klpyang/reviewboard
d7dabf36e5b492f18048dd7084026bf99d6933c5
[ "MIT" ]
1
2021-11-23T15:25:44.000Z
2021-11-23T15:25:44.000Z
class UserQueryError(Exception): def __init__(self, msg): Exception.__init__(self, None) self.msg = msg def __str__(self): return 'User query error: %s' % self.msg
24.625
48
0.624365
24
197
4.625
0.583333
0.189189
0
0
0
0
0
0
0
0
0
0
0.263959
197
7
49
28.142857
0.765517
0
0
0
0
0
0.101523
0
0
0
0
0
0
1
0.333333
false
0
0
0.166667
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
e43f51c4667d733ce1ea947ae4a9b44ead9a0227
5,874
py
Python
src/kuas_api/kuas/kalendar.py
JohnSounder/AP-API
9e1fa4d7de1d844b453cd6b86faefba8bf051c3c
[ "MIT" ]
1
2015-07-19T04:18:37.000Z
2015-07-19T04:18:37.000Z
src/kuas_api/kuas/kalendar.py
JohnSounder/AP-API
9e1fa4d7de1d844b453cd6b86faefba8bf051c3c
[ "MIT" ]
18
2015-09-05T11:14:17.000Z
2015-10-18T08:09:33.000Z
src/kuas_api/kuas/kalendar.py
JohnSounder/AP-API
9e1fa4d7de1d844b453cd6b86faefba8bf051c3c
[ "MIT" ]
null
null
null
# -*- coding: utf -*- import requests from lxml import etree def get_wtf_data(): r = requests.post('http://active.kuas.edu.tw/EPortfolio/Activity/UnitBsCalendar.aspx') root = etree.HTML(r.text) result = {} for i in root.xpath("//input[@type='hidden']"): result[i.values()[-2]] = i.values()[-1] return result def get_admin_calendar(year, semester): data = { "ContentPlaceHolder1_ToolkitScriptManager1_HiddenField": ";;AjaxControlToolkit,+Version=4.1.60919.0,+Culture=neutral,+PublicKeyToken=28f01b0e84b6d53e:zh-TW:ee051b62-9cd6-49a5-87bb-93c07bc43d63:de1feab2:f9cec9bc:a0b0f951:a67c2700:fcf0e993:f2c8e708:720a52bf:589eaa30:698129cf:fb9b4c57:ccb96cf9", "__EVENTTARGET": "", "__EVENTARGUMENT": "", "ContentPlaceHolder1_TabContainer1_ClientState": '{"ActiveTabIndex":1,"TabEnabledState":[true,true,true,true,true],"TabWasLoadedOnceState":[true,true,false,false,false]}', "__LASTFOCUS": "", "__VIEWSTATE": "/wEPDwUKMTI1OTYxMzEwMA8WAh4XRGVmYXVsdFNjaFllYXJTZW1TdHJpbmcFBTEwMy0yFgJmD2QWAgIED2QWAgIBD2QWBgIBD2QWAgIBD2QWBAIBDw8WAh4HVmlzaWJsZWhkFgQCAw8PFgIeBFRleHQFD+iri+i8uOWFpeW4s+iZn2RkAgcPDxYEHgRNb2RlCyolU3lzdGVtLldlYi5VSS5XZWJDb250cm9scy5UZXh0Qm94TW9kZQAfAgUP6KuL6Ly45YWl5a+G56K8ZGQCAw8PFgIfAWdkFgQCAQ8PFgIfAgUZ5Zub6LOH5bel5LiJ55SyLeWRgue0ueamlWRkAgMPDxYCHwIFHeatoei/juS9v+eUqCDmpa3li5nooYzkuovmm4YhZGQCAw9kFgICAQ88KwANAQwUKwACBQcyOjAsMDowFCsAAhYEHwIFD+alreWLmeihjOS6i+abhh4FVmFsdWUFD+alreWLmeihjOS6i+abhmQWAmYPZBYCZg8VAQ/mpa3li5nooYzkuovmm4ZkAgUPZBYCAgEPZBYCAgEPZBYCAgMPDxYEHghUYWJJbmRleAEAAB4STGFzdEFjdGl2ZVRhYkluZGV4AgFkFgZmD2QWAmYPZBYCAgEPZBYEAgEPEA8WBh4NRGF0YVRleHRGaWVsZAUQU2NoWWVhclNlbVN0cmluZx4ORGF0YVZhbHVlRmllbGQFD1NjaFllYXJTZW1WYWx1ZR4LXyFEYXRhQm91bmRnZBAVBAcxMDQg5LiLBzEwNCDkuIoHMTAzIOS4iwcxMDMg5LiKFQQFMTA0LTIFMTA0LTEFMTAzLTIFMTAzLTEUKwMEZ2dnZ2RkAgcPZBYCAgEPFgIeA3NyYwVRaHR0cDovL2FjdGl2ZS5rdWFzLmVkdS50dy9FUG9ydGZvbGlvL0FjdGl2aXR5L0RvY3VtZW50L0JzL0NhbGVuZGFyL0JzXzEwMy3kuIsucGRmZAIBD2QWAmYPZBYCAgEPZBYEAgEPEA8WBh8HBRBTY2hZZWFyU2VtU3RyaW5nHwgFD1NjaFllYXJTZW1WYWx1ZR8JZ2QQFQQHMTA0IOS4iwcxMDQg5LiKBzEwMyDkuIsHMTAzIOS4ihUEBTEwNC0yBTEwNC0xBTEwMy0yBTEwMy0xFCsDBGdnZ2dkZAIDDxAPFgYfBwUKdXBVbml0TmFtZR8IBQh1cFVuaXRpZB8JZ2QQFRMM5YWo6YOo6aGv56S6CeaVmeWLmeiZlQnkuLvoqIjlrqQP6YCy5L+u5o6o5buj6JmVDOmAsuS/ruWtuOmZognnuL3li5nomZUY55Kw5aKD5a6J5YWo6KGb55Sf5Lit5b+DGOioiOeul+apn+iIh+e2sui3r+S4reW/gwnlnJbmm7jppKgJ5Lq65LqL5a6kCemrlOiCsuWupAzlia/moKHplbflrqQJ56CU55m86JmVD+Wci+mam+S6i+WLmeiZlRjmoKHlj4voga/ntaHogbfmtq/kuK3lv4MJ5a245YuZ6JmVCeenmOabuOWupBLpgJrorZjmlZnogrLkuK3lv4MP54eV5bei5qCh5YuZ6YOoFRMBQQRBQTAwBEFDMDAEQUUwMARBVDAwBEdBMDAER0IwMARJQzAwBExCMDAEUEUwMARQSDAwBFBTMDAEUkEwMARSQjAwBFJEMDAEU0EwMARTRTAwBFhDMDAEWUQwMBQrAxNnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZGQCBA9kFgJmD2QWAgIBD2QWDAIFDxBkZBYBZmQCBw8QZGQWAGQCEQ9kFgICBQ9kFgQCAQ8QZGQWAQIIZAIDDxBkZBYBZmQCEw9kFgICBQ9kFgQCAQ8QZGQWAQIIZAIDDxBkZBYBZmQCFQ8PFgIfAgUS5qWt5YuZ5rS75YuV5p+l6KmiZGQCGQ88KwARAQEQFgAWABYAZBgDBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUnY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRUYWJDb250YWluZXIxBSdjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJFRhYkNvbnRhaW5lcjEPD2QCAWQFTGN0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkVGFiQ29udGFpbmVyMSRUYWJQYW5lbEJzU2VhcmNoJGd2Rm9yQnNBY3RpdmVTZWFyY2gPZ2RyQEeUQZjPVmQxmQjXEE2h5a2Akm5FOox6NGaKCQuRSg==", "__EVENTVALIDATION": "/wEWNQLQjpnOBwLe9pSEBwLRovlJAqCG2dcHAqGG2dcHAr/xv7kNArzxv7kNAueA6J4LAtqnpbUMAoaIxIIDAoeIxIIDApn/ouwJApr/ouwJAoOR2+EEAqXQ+IUIAqXQ8IUIAqXQiIYIAqXQzIUIAq/Q+IUIAq/Q9IUIAt3R8IUIAqLQ9IUIAtbRiIYIAtbR3IUIAtbRsIUIAtTR+IUIAtTR9IUIAtTRjIYIAtvR+IUIAtvRiIYIAs7R8IUIAs3RjIYIApW90PwFAuKa6aQNAoWPzooGAqzGkOoMAreinuYKAtSP93EC0pDX/QEC9czo6g0ChJvWOwKOnbn6BALd9PzVDALm9IzLDAKV0ZqFCQLswvqaBgKNu8fRDwKH9+z4CAKM5rDmAQLrtJjFBALpvue2BwLE4euUCQKVtruvDVM6q8J60kK+Rs+JNbFQOsCQU/juUwZnaTkYwDCI5LJO", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBs$DropDownListForBsFormalSchYearSem": "103-2", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBsGov$DropDownListForBsGovSchYearSem": "103-2", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBsGov$DropDownListForBsGovUnit": "A", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBsGov$ButtonSearchForBsGov": "查詢", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBsSearch$TextBoxForKeyword": "", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBsSearch$DDLForGovOrTeach": "選擇部門", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBsSearch$DateTimeBoxForStart$DateFieldBox": "2015/9/11", "ctl00$ContentPlaceHolder1$TabContainer1$TabPanelBsSearch$DateTimeBoxForEnd$DateFieldBox": "2015/9/11", } hidden_value = get_wtf_data() for key in hidden_value: data[key] = hidden_value[key] print(data) cookies = { # '_ga': 'GA1.3.518100922.1435057856', # 'ASP.NET_SessionId': 'jyeffb1tbujhgzju0mpclnaz', # '_gat': '1', } headers = { 'Host': 'active.kuas.edu.tw', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.7,zh-TW;q=0.3', 'Referer': 'http://active.kuas.edu.tw/EPortfolio/Activity/UnitBsCalendar.aspx', 'Connection': 'keep-alive', } r = requests.post('http://active.kuas.edu.tw/EPortfolio/Activity/UnitBsCalendar.aspx', headers=headers, cookies=cookies, data=data) f = open("/tmp/test", "w") f.write(r.text) root = etree.HTML(r.text) #root.xpath("id('ContentPlaceHolder1_TabContainer1_TabPanelBsGov_TDContent_109')")[0].xpath("a")[7].values() print(r.text) td = root.xpath("id('ContentPlaceHolder1_TabContainer1_TabPanelBsGov_TDContent_279')")[0] td = list(td.itertext())[::2] a = td.xpath("a") for i, j in (td, a): print(i, j.values()) if __name__ == "__main__": get_admin_calendar(104, 1)
76.285714
2,286
0.8238
383
5,874
12.516971
0.535248
0.073425
0.061744
0.012516
0.096996
0.089487
0.066959
0.039841
0.039841
0.028369
0
0.095415
0.082908
5,874
76
2,287
77.289474
0.794505
0.038304
0
0.037736
0
0.132075
0.791069
0.708843
0
1
0
0
0
1
0.037736
false
0
0.037736
0
0.09434
0.056604
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
5
e46cb3b998f9aebb6c3a4d148b0985ceba67b78e
100
py
Python
transactions/accounts/admin.py
akash-dev-github/Transactions
7f1b8897d914a1cf297aeff750c197d21ce98ca8
[ "MIT" ]
null
null
null
transactions/accounts/admin.py
akash-dev-github/Transactions
7f1b8897d914a1cf297aeff750c197d21ce98ca8
[ "MIT" ]
null
null
null
transactions/accounts/admin.py
akash-dev-github/Transactions
7f1b8897d914a1cf297aeff750c197d21ce98ca8
[ "MIT" ]
null
null
null
from django.contrib import admin from accounts.models import Account admin.site.register(Account)
16.666667
35
0.83
14
100
5.928571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.11
100
5
36
20
0.932584
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e47875ae57fea042d12cf3ab74b8cfb9b46f2748
19,065
py
Python
tests/test_papernetwork.py
EvdH0/papernetwork
b7e5ee3480c0f80c7426af3c37be204464df4043
[ "MIT" ]
null
null
null
tests/test_papernetwork.py
EvdH0/papernetwork
b7e5ee3480c0f80c7426af3c37be204464df4043
[ "MIT" ]
null
null
null
tests/test_papernetwork.py
EvdH0/papernetwork
b7e5ee3480c0f80c7426af3c37be204464df4043
[ "MIT" ]
null
null
null
# Sample Test passing with nose and pytest # Run with ```python -m pytest tests``` import pytest import json from papernetwork.core import PaperNetwork, Paper, PaperList import copy def test_pass(): assert True, "dummy sample test" def test_load_from_file(): assert Paper(filename='tests/test_files/10.1038_SLASH_s41564-019-0626-z.json')['title'] == "Rapid MinION profiling of preterm microbiota and antimicrobial-resistant pathogens" my_paper = Paper() my_paper.load_from_file('tests/test_files/10.1038_SLASH_s41564-019-0626-z.json') assert my_paper['title'] == "Rapid MinION profiling of preterm microbiota and antimicrobial-resistant pathogens" def test_load_from_file_two(): my_paper = Paper(filename='tests/test_files/paper-a.json') assert my_paper['title'] == "title - a" assert my_paper['year'] == "2000" assert len(my_paper['references']) == 2 assert len(my_paper['citations']) == 2 def test_load_url_ok(): """ From jsonplaceholder.com retrieve a fake response to test the url part without overloading semantic scholar""" data = json.loads(Paper().load_url('https://jsonplaceholder.typicode.com/todos/1').read()) assert data == {'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False} def test_load_url_fail(): data = Paper().load_url('http://www.dnacoil.com/doesntwork') assert data is False def test_append_wrong_type(): with pytest.raises(Exception) as execinfo: my_network = PaperNetwork() my_network.collection.append('this is not a Paper object but a string') assert str(execinfo.value) == 'the item you are trying to add should be of the type Paper' def test_append(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-k.json') my_network = PaperNetwork() my_network.collection.append(my_paper) assert my_paper in my_network.collection assert my_paper2 not in my_network.collection def test_append_not_unique(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper_duplicate = Paper(filename='tests/test_files/paper-a.json') my_network = PaperNetwork() my_network.collection.append(my_paper) with pytest.raises(ValueError, match=r"This paperId is already present, only unique paperIds allowed"): my_network.collection.append(my_paper_duplicate) #print (my_network.collection) def test_paper_equal(): my_paper1 = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-a.json') my_paper3 = Paper(filename='tests/test_files/paper-k.json') assert my_paper1 == my_paper2 assert my_paper1 != my_paper3 def test_update_paper_without_title(): my_paper = Paper(filename='tests/test_files/paper-a.json') with pytest.raises(ValueError, match=r"Paper cannot have an empty title"): my_paper['title'] = '' with pytest.raises(ValueError, match=r"Paper cannot have an empty title"): del my_paper['title'] def test_update_paper_without_paperId(): my_paper = Paper(filename='tests/test_files/paper-a.json') with pytest.raises(ValueError, match=r"Paper cannot have an empty paperId"): my_paper['paperId'] = '' with pytest.raises(ValueError, match=r"Paper cannot have an empty paperId"): del my_paper['paperId'] def test_update_paper_title_not_as_string(): my_paper = Paper(filename='tests/test_files/paper-a.json') with pytest.raises(TypeError, match=r"title must be a string"): my_paper['title'] = 3 def test_update_paper_paperId_not_as_string(): my_paper = Paper(filename='tests/test_files/paper-a.json') with pytest.raises(TypeError, match=r"paperId must be a string"): my_paper['paperId'] = 3 def test_setting_paper_directly(): my_paper = Paper(data={"paperId":"q","title":"title - q","year":"2000"}) assert my_paper['title'] == 'title - q' def test_setting_paper_directly_without_title(): with pytest.raises(ValueError, match=r"Paper cannot have an empty title"): my_paper = Paper(data={"paperId":"q","title":"","year":"2000"}) def test_copy(): #my_paper = Paper(filename='tests/test_files/paper-a.json') #my_paper2 = Paper(filename='tests/test_files/paper-k.json') my_network = PaperNetwork() with pytest.raises(TypeError, match=r"JSON argument needs to be a Paper or dict"): my_network._copy_paper_attributes_to_graph('foo node', 'a string not a dict or paper') with pytest.raises(ValueError, match=r"The node is not part of the graph, add the node first"): my_network._copy_paper_attributes_to_graph('foo node', {}) with pytest.raises(TypeError, match=r"Node identifier needs to be a string, such as the paperId"): my_network._copy_paper_attributes_to_graph(2, {}) def test_paper_parse(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-k.json') my_network = PaperNetwork() my_network.collection.append(my_paper) my_network.collection.append(my_paper2) assert my_network.graph.size() == 6 assert len(my_network.graph.nodes()) == 6 #-> ['title - x', 'title - a', 'title - y', 'title - b', 'title - c', 'title - k'] assert my_network.graph.nodes['a']['year'] == "2000" assert my_network.graph.nodes['b']['year'] == "1990" assert my_network.graph.nodes['x']['year'] == "2003" assert my_network.graph.nodes['c']['year'] == "1991" assert my_network.graph.nodes['k']['year'] == "2005" assert my_network.graph.nodes['y']['year'] == "2011" def test_paper_list_representations(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-k.json') list1 = PaperList([my_paper, my_paper2]) assert list1.titles == ['title - a', 'title - k'] assert list1.paperIds == ['a', 'k'] def test_paper_list(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-k.json') list1 = PaperList([my_paper]) list2 = PaperList([my_paper]) list3 = PaperList([my_paper2]) assert list1 == list2 assert list1 != list3 list1 = PaperList([my_paper, my_paper2]) list2 = PaperList([my_paper, my_paper2]) list3 = PaperList([my_paper2, my_paper]) assert list1 == list2 assert list1 != list3 # PaperList is a List and not a Set, so these are not equal def test_paper_list_two(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-k.json') listA = PaperList([my_paper, my_paper2]) listB = copy.deepcopy(listA) assert listA == listB listA[0]['new key'] = 'makes listA and listB not the same' assert listA != listB #not_a_paper_list = [] #with pytest.raises(TypeError, match=r"Node identifier needs to be a string, such as the paperId"): # if list1 != "not_a_paper_list": # pass def test_paper_parse_two(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-k.json') my_network = PaperNetwork() my_network.collection.append(my_paper) my_network.collection.append(my_paper2) #my_network.parse_papers() assert my_network.graph.size() == 6 assert len(my_network.graph.nodes()) == 6 #-> ['title - x', 'title - a', 'title - y', 'title - b', 'title - c', 'title - k'] assert my_network.graph.nodes['a']['year'] == "2000" assert my_network.graph.nodes['b']['year'] == "1990" assert my_network.graph.nodes['x']['year'] == "2003" my_network.collection.remove(my_paper2) assert my_network.graph.size() == 4 assert len(my_network.graph.nodes()) == 5 # Testing the deepcopy function. Everytime we access the graph, we need to check whether the collection changed assert my_network.graph.nodes[my_network.collection[0]['paperId']]['year'] == my_network.collection[0]['year'] my_network.collection[0]['year'] = "9999" assert my_network.graph.nodes[my_network.collection[0]['paperId']]['year'] == my_network.collection[0]['year'] # Test that the deepcopy of the Paperlist is functioning assert my_network.graph.size() == 4 def test_load_from_semantic_scholar_wrong_doi(): with pytest.raises(Exception) as execinfo: data = Paper().load_from_semantic_scholar('doidoesnotexcist') assert str(execinfo.value) == 'Download failed' # While devving keep this live connection to s_s out def test_load_from_semantic_scholar(): data = Paper() data.load_from_semantic_scholar('10.1093/nar/gkw1328') assert data['title']=='Rapid resistome mapping using nanopore sequencing' data2 = Paper(doi='10.1093/nar/gkw1328') assert data2['title']=='Rapid resistome mapping using nanopore sequencing' def test_paper_json(): my_paper = Paper(filename='tests/test_files/paper-a.json') my_paper2 = Paper(filename='tests/test_files/paper-k.json') my_network = PaperNetwork() my_network.collection.append(my_paper) my_network.collection.append(my_paper2) assert my_network.calculate_json() == {'directed': True, 'multigraph': False, 'graph': {}, 'nodes': [{'title': 'title - a', 'year': '2000', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 2, 'corpus': 1, 'out_degree': 0, 'id': 'a'}, {'title': 'title - x', 'year': '2003', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 5, 'out_degree': 1, 'id': 'x'}, {'title': 'title - y', 'year': '2011', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 0, 'corpus': 5, 'out_degree': 1, 'id': 'y'}, {'title': 'title - b', 'year': '1990', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 0, 'out_degree': 0, 'id': 'b'}, {'title': 'title - c', 'year': '1991', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 2, 'corpus': 0, 'out_degree': 0, 'id': 'c'}, {'title': 'title - k', 'year': '2005', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 0, 'corpus': 1, 'out_degree': 0, 'id': 'k'}], 'links': [{'source': 'a', 'target': 'b'}, {'source': 'a', 'target': 'c'}, {'source': 'x', 'target': 'a'}, {'source': 'y', 'target': 'a'}, {'source': 'k', 'target': 'x'}, {'source': 'k', 'target': 'c'}]} # these three cases should not change the output assert my_network.calculate_json(mimimum_citation_count_of_references=1) == {'directed': True, 'multigraph': False, 'graph': {}, 'nodes': [{'title': 'title - a', 'year': '2000', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 2, 'corpus': 1, 'out_degree': 0, 'id': 'a'}, {'title': 'title - x', 'year': '2003', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 5, 'out_degree': 1, 'id': 'x'}, {'title': 'title - y', 'year': '2011', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 0, 'corpus': 5, 'out_degree': 1, 'id': 'y'}, {'title': 'title - b', 'year': '1990', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 0, 'out_degree': 0, 'id': 'b'}, {'title': 'title - c', 'year': '1991', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 2, 'corpus': 0, 'out_degree': 0, 'id': 'c'}, {'title': 'title - k', 'year': '2005', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 0, 'corpus': 1, 'out_degree': 0, 'id': 'k'}], 'links': [{'source': 'a', 'target': 'b'}, {'source': 'a', 'target': 'c'}, {'source': 'x', 'target': 'a'}, {'source': 'y', 'target': 'a'}, {'source': 'k', 'target': 'x'}, {'source': 'k', 'target': 'c'}]} assert my_network.calculate_json(mimimum_citation_count_of_references=1, minimum_times_citing_collection=1) == {'directed': True, 'multigraph': False, 'graph': {}, 'nodes': [{'title': 'title - a', 'year': '2000', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 2, 'corpus': 1, 'out_degree': 0, 'id': 'a'}, {'title': 'title - x', 'year': '2003', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 5, 'out_degree': 1, 'id': 'x'}, {'title': 'title - y', 'year': '2011', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 0, 'corpus': 5, 'out_degree': 1, 'id': 'y'}, {'title': 'title - b', 'year': '1990', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 0, 'out_degree': 0, 'id': 'b'}, {'title': 'title - c', 'year': '1991', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 2, 'corpus': 0, 'out_degree': 0, 'id': 'c'}, {'title': 'title - k', 'year': '2005', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 0, 'corpus': 1, 'out_degree': 0, 'id': 'k'}], 'links': [{'source': 'a', 'target': 'b'}, {'source': 'a', 'target': 'c'}, {'source': 'x', 'target': 'a'}, {'source': 'y', 'target': 'a'}, {'source': 'k', 'target': 'x'}, {'source': 'k', 'target': 'c'}]} assert my_network.calculate_json(minimum_times_citing_collection=1) == {'directed': True, 'multigraph': False, 'graph': {}, 'nodes': [{'title': 'title - a', 'year': '2000', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 2, 'corpus': 1, 'out_degree': 0, 'id': 'a'}, {'title': 'title - x', 'year': '2003', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 5, 'out_degree': 1, 'id': 'x'}, {'title': 'title - y', 'year': '2011', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 0, 'corpus': 5, 'out_degree': 1, 'id': 'y'}, {'title': 'title - b', 'year': '1990', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 0, 'out_degree': 0, 'id': 'b'}, {'title': 'title - c', 'year': '1991', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 2, 'corpus': 0, 'out_degree': 0, 'id': 'c'}, {'title': 'title - k', 'year': '2005', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 0, 'corpus': 1, 'out_degree': 0, 'id': 'k'}], 'links': [{'source': 'a', 'target': 'b'}, {'source': 'a', 'target': 'c'}, {'source': 'x', 'target': 'a'}, {'source': 'y', 'target': 'a'}, {'source': 'k', 'target': 'x'}, {'source': 'k', 'target': 'c'}]} # with restrictions assert my_network.calculate_json(mimimum_citation_count_of_references=2) == {'directed': True, 'multigraph': False, 'graph': {}, 'nodes': [{'title': 'title - a', 'year': '2000', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 2, 'corpus': 1, 'out_degree': 0, 'id': 'a'}, {'title': 'title - x', 'year': '2003', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 5, 'out_degree': 1, 'id': 'x'}, {'title': 'title - y', 'year': '2011', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 0, 'corpus': 5, 'out_degree': 1, 'id': 'y'}, {'title': 'title - c', 'year': '1991', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 2, 'corpus': 0, 'out_degree': 0, 'id': 'c'}, {'title': 'title - k', 'year': '2005', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 0, 'corpus': 1, 'out_degree': 0, 'id': 'k'}], 'links': [{'source': 'a', 'target': 'c'}, {'source': 'x', 'target': 'a'}, {'source': 'y', 'target': 'a'}, {'source': 'k', 'target': 'x'}, {'source': 'k', 'target': 'c'}]} assert my_network.calculate_json(minimum_times_citing_collection=2) == {'directed': True, 'multigraph': False, 'graph': {}, 'nodes': [{'title': 'title - a', 'year': '2000', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 2, 'corpus': 1, 'out_degree': 0, 'id': 'a'}, {'title': 'title - x', 'year': '2003', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 1, 'corpus': 5, 'out_degree': 1, 'id': 'x'}, {'title': 'title - c', 'year': '1991', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 2, 'corpus': 0, 'out_degree': 0, 'id': 'c'}, {'title': 'title - k', 'year': '2005', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 0, 'corpus': 1, 'out_degree': 0, 'id': 'k'}], 'links': [{'source': 'a', 'target': 'c'}, {'source': 'x', 'target': 'a'}, {'source': 'k', 'target': 'x'}, {'source': 'k', 'target': 'c'}]} # double restrictions assert my_network.calculate_json(mimimum_citation_count_of_references=2, minimum_times_citing_collection=2 ) == {'directed': True, 'multigraph': False, 'graph': {}, 'nodes': [{'title': 'title - a', 'year': '2000', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 1, 'corpus': 1, 'out_degree': 0, 'id': 'a'}, {'title': 'title - c', 'year': '1991', 'url': [], 'authors': [], 'venue': [], 'warning': [], 'in_degree': 2, 'corpus': 0, 'out_degree': 0, 'id': 'c'}, {'title': 'title - k', 'year': '2005', 'url': [], 'authors': [], 'venue': [], 'warning': ['Serious warning: reference list seems very short (<10)', 'Note: seems like not widely cited (<5)'], 'in_degree': 0, 'corpus': 1, 'out_degree': 0, 'id': 'k'}], 'links': [{'source': 'a', 'target': 'c'}, {'source': 'k', 'target': 'c'}]} def test_pn_init(): list_of_jsons = ['tests/test_files/paper-a.json', 'tests/test_files/paper-k.json'] my_network = PaperNetwork(filename_list=list_of_jsons) assert len(my_network.collection) == 2 # Turns of while devving list_of_dois = ['10.1093/nar/gkw1328'] my_network = PaperNetwork(filename_list=list_of_jsons, doi_list=list_of_dois) assert len(my_network.collection) == 3 def test_init_fail_both(): with pytest.raises(Exception) as execinfo: Paper(filename='foo', doi='bar') assert str(execinfo.value) == 'Cannot use both filename and doi to retreive paper' def test_load_url_fail(): Paper().load_url('https://jsonplaceholder.typicode.com/todos/1')
69.835165
1,483
0.625439
2,609
19,065
4.415102
0.099655
0.046098
0.046879
0.068756
0.807101
0.760396
0.719507
0.690772
0.681743
0.656828
0
0.030238
0.150013
19,065
273
1,484
69.835165
0.680592
0.056124
0
0.367232
0
0
0.386777
0.05042
0
0
0
0
0.305085
1
0.152542
false
0.00565
0.022599
0
0.175141
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
e48450d72d623926d88e2d9bd423a373ae3c2a97
213
py
Python
HackerRank/CircularArrayRotation.py
kokuraxc/play-ground
48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd
[ "MIT" ]
null
null
null
HackerRank/CircularArrayRotation.py
kokuraxc/play-ground
48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd
[ "MIT" ]
null
null
null
HackerRank/CircularArrayRotation.py
kokuraxc/play-ground
48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd
[ "MIT" ]
null
null
null
# https://www.hackerrank.com/challenges/circular-array-rotation/problem # Complete the circularArrayRotation function below. def circularArrayRotation(a, k, queries): return [a[(q-k)%len(a)] for q in queries]
42.6
71
0.765258
29
213
5.62069
0.793103
0
0
0
0
0
0
0
0
0
0
0
0.103286
213
4
72
53.25
0.853403
0.56338
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
e4c30d20a3be14675ba485c58a7cfed30206ce14
54
py
Python
vmodel/util/__init__.py
lis-epfl/vmodel
d8860087b94ffc3582f187523864550ecf135b24
[ "MIT" ]
null
null
null
vmodel/util/__init__.py
lis-epfl/vmodel
d8860087b94ffc3582f187523864550ecf135b24
[ "MIT" ]
null
null
null
vmodel/util/__init__.py
lis-epfl/vmodel
d8860087b94ffc3582f187523864550ecf135b24
[ "MIT" ]
null
null
null
def sort_dict(d): return dict(sorted(d.items()))
13.5
34
0.648148
9
54
3.777778
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.166667
54
3
35
18
0.755556
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
e4df692b7ebdf3fb58620fbf5df928d76c9f4998
98
py
Python
app/api/v1/__init__.py
kelvinbunei/Politico
d7ad9355fe6375ba5d87da56eed100eb31cfd9a0
[ "MIT" ]
null
null
null
app/api/v1/__init__.py
kelvinbunei/Politico
d7ad9355fe6375ba5d87da56eed100eb31cfd9a0
[ "MIT" ]
null
null
null
app/api/v1/__init__.py
kelvinbunei/Politico
d7ad9355fe6375ba5d87da56eed100eb31cfd9a0
[ "MIT" ]
null
null
null
from flask import Blueprint version_1 = Blueprint('version_one', __name__, url_prefix='/api/v1')
24.5
68
0.77551
14
98
4.928571
0.857143
0.463768
0
0
0
0
0
0
0
0
0
0.022727
0.102041
98
3
69
32.666667
0.761364
0
0
0
0
0
0.183673
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
1
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
1
0
5
e4fa27a7ceff832fc44cfc211843ec2593ae5fbf
41
py
Python
src/videoanalizer/__init__.py
thomasreolon/DeepfakeDetection
5bbeefdeeb05b2abd45336ad3382da6ce90c2fef
[ "MIT" ]
2
2021-04-21T03:02:59.000Z
2021-07-31T23:35:58.000Z
src/videoanalizer/__init__.py
thomasreolon/DeepfakeDetection
5bbeefdeeb05b2abd45336ad3382da6ce90c2fef
[ "MIT" ]
null
null
null
src/videoanalizer/__init__.py
thomasreolon/DeepfakeDetection
5bbeefdeeb05b2abd45336ad3382da6ce90c2fef
[ "MIT" ]
null
null
null
from .videoanalizer import VideoAnalizer
20.5
40
0.878049
4
41
9
0.75
0
0
0
0
0
0
0
0
0
0
0
0.097561
41
1
41
41
0.972973
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
5f76d88bc14663072fa9797cb4d9ad901ac9d048
2,281
py
Python
PyFiles/Lists.py
JMax45/R6S-App
2d68900535b495a6675f35f492e63bcbf49517d7
[ "MIT" ]
null
null
null
PyFiles/Lists.py
JMax45/R6S-App
2d68900535b495a6675f35f492e63bcbf49517d7
[ "MIT" ]
null
null
null
PyFiles/Lists.py
JMax45/R6S-App
2d68900535b495a6675f35f492e63bcbf49517d7
[ "MIT" ]
null
null
null
import random code_list3 = [("Si"),("No")] code_list4 = [("1°"),("2°"),("3°"),("4°")] code_list5 = [("SWAT"),("SAS"),("GIGN"),("GSG 9"),("JTF2"),("NAVY SEAL"), ("BOPE"),("G.E.O"),("SAT"),("S.D.U"),("GROM"),("707th")] code_list6 = [("Images/RandOperators/Attackers/Ash.png"),("Images/RandOperators/Attackers/Blackbeard.png"), ("Images/RandOperators/Attackers/Blitz.png"),("Images/RandOperators/Attackers/Buck.png"), ("Images/RandOperators/Attackers/Capitao.png"),("Images/RandOperators/Attackers/Dokkaebi.png"), ("Images/RandOperators/Attackers/Finka.png"),("Images/RandOperators/Attackers/Fuze.png"), ("Images/RandOperators/Attackers/Glaz.png"),("Images/RandOperators/Attackers/Hibana.png"), ("Images/RandOperators/Attackers/IQ.png"),("Images/RandOperators/Attackers/Lyon.png"), ("Images/RandOperators/Attackers/Montagne.png"),("Images/RandOperators/Attackers/Sledge.png"), ("Images/RandOperators/Attackers/Thatcher.png"),("Images/RandOperators/Attackers/Thermite.png"), ("Images/RandOperators/Attackers/Twitch.png"),("Images/RandOperators/Attackers/Zofia.png"), ("Images/RandOperators/Attackers/Ying.png"),("Images/RandOperators/Attackers/Jackal.png")] code_list7 = [("Images/RandOperators/Defenders/Smoke.png"),("Images/RandOperators/Defenders/Mute.png"), ("Images/RandOperators/Defenders/Castle.png"),("Images/RandOperators/Defenders/Pulse.png"), ("Images/RandOperators/Defenders/Rook.png"),("Images/RandOperators/Defenders/Doc.png"), ("Images/RandOperators/Defenders/Kapkan.png"),("Images/RandOperators/Defenders/Tachanka.png"), ("Images/RandOperators/Defenders/Jager.png"),("Images/RandOperators/Defenders/Bandit.png"), ("Images/RandOperators/Defenders/Frost.png"),("Images/RandOperators/Defenders/Valkyrie.png"), ("Images/RandOperators/Defenders/Caveira.png"),("Images/RandOperators/Defenders/Echo.png"), ("Images/RandOperators/Defenders/Mira.png"),("Images/RandOperators/Defenders/Lesion.png"), ("Images/RandOperators/Defenders/Ela.png"),("Images/RandOperators/Defenders/Vigil.png")]
71.28125
111
0.65936
230
2,281
6.534783
0.330435
0.480373
0.526946
0.391883
0
0
0
0
0
0
0
0.007165
0.143358
2,281
31
112
73.580645
0.75998
0
0
0
0
0
0.713523
0.683719
0
0
0
0
0
1
0
false
0
0.041667
0
0.041667
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5f7a52ac7423e645df15aeb975b7db89d8d6652a
602
py
Python
src/nonogram_solver/error.py
MikeJongen/nonogram-solver
b174fe6c693c1ace3918bf19a9110165a5b42db9
[ "MIT" ]
null
null
null
src/nonogram_solver/error.py
MikeJongen/nonogram-solver
b174fe6c693c1ace3918bf19a9110165a5b42db9
[ "MIT" ]
null
null
null
src/nonogram_solver/error.py
MikeJongen/nonogram-solver
b174fe6c693c1ace3918bf19a9110165a5b42db9
[ "MIT" ]
null
null
null
class NonogramError(Exception): """Base class for exceptions in this module.""" pass class LengthError(NonogramError): """Exception raised for unexpected list lengths.""" pass class AxisError(NonogramError): """Exception raised for unexpected axis.""" pass class ClueError(NonogramError): """Exception raised for invalid clue.""" pass class SolveError(NonogramError): """Exception raised for when solve action cannot be executed.""" pass class SetSolutionError(NonogramError): """Exception raised for an invalid change of the solution.""" pass
20.758621
68
0.70598
65
602
6.538462
0.507692
0.310588
0.329412
0.364706
0.192941
0
0
0
0
0
0
0
0.194352
602
28
69
21.5
0.876289
0.456811
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
5f87f1d49ae0d81009faa5974fea9c09119076f7
239
py
Python
tests/conftest.py
erickrawczyk/pyzerproc
9e98a18c94673ee7046b59ae0a305e02338dc969
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
erickrawczyk/pyzerproc
9e98a18c94673ee7046b59ae0a305e02338dc969
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
erickrawczyk/pyzerproc
9e98a18c94673ee7046b59ae0a305e02338dc969
[ "Apache-2.0" ]
null
null
null
import pytest @pytest.fixture def adapter(mocker): return mocker.patch('pygatt.GATTToolBackend')() @pytest.fixture def device(mocker, adapter): device = mocker.Mock() adapter.connect.return_value = device return device
17.071429
51
0.728033
28
239
6.178571
0.5
0.150289
0.184971
0
0
0
0
0
0
0
0
0
0.16318
239
13
52
18.384615
0.865
0
0
0.222222
0
0
0.09205
0.09205
0
0
0
0
0
1
0.222222
false
0
0.111111
0.111111
0.555556
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5