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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fb62f3f5a5769a80a5d13a6f4d1ccd457d5f9675 | 138 | py | Python | hugs/__init__.py | Bogdanp/hugs | e7f16f15369fbe3da11d89882d76c7ef432f3709 | [
"BSD-3-Clause"
] | 22 | 2017-07-20T18:02:27.000Z | 2021-06-10T13:06:22.000Z | hugs/__init__.py | Bogdanp/hugs | e7f16f15369fbe3da11d89882d76c7ef432f3709 | [
"BSD-3-Clause"
] | null | null | null | hugs/__init__.py | Bogdanp/hugs | e7f16f15369fbe3da11d89882d76c7ef432f3709 | [
"BSD-3-Clause"
] | 2 | 2019-12-11T20:44:08.000Z | 2021-02-02T04:37:04.000Z | from .repository import Repository
from .manager import Manager
__all__ = ["Manager", "Repository", "__version__"]
__version__ = "0.2.0"
| 23 | 50 | 0.746377 | 16 | 138 | 5.6875 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024793 | 0.123188 | 138 | 5 | 51 | 27.6 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0.23913 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
fb7583ba835e078f93bcf270c20be6606ba135d8 | 98 | py | Python | test.py | krithikV/vaccineregistration | 5d9aa52c7d8c9b196e23a73525dbaaf1e791e3e2 | [
"Apache-2.0"
] | null | null | null | test.py | krithikV/vaccineregistration | 5d9aa52c7d8c9b196e23a73525dbaaf1e791e3e2 | [
"Apache-2.0"
] | null | null | null | test.py | krithikV/vaccineregistration | 5d9aa52c7d8c9b196e23a73525dbaaf1e791e3e2 | [
"Apache-2.0"
] | null | null | null | from multiprocessing import Process
server = Process(target=app.run)# ...
server.terminate()
| 19.6 | 38 | 0.734694 | 11 | 98 | 6.545455 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 98 | 4 | 39 | 24.5 | 0.857143 | 0.030612 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 3 |
fb9fdfc27bb90a2635e9ed5a41c5798497074c0d | 154 | py | Python | zadania-python/zadanie#8.01-03/zadanie_8_01.py | Qeentissue/wizualizacja-danych | 36914230ff1c28d8a5cd05a2d4dfd5d3f4ddc1b0 | [
"MIT"
] | null | null | null | zadania-python/zadanie#8.01-03/zadanie_8_01.py | Qeentissue/wizualizacja-danych | 36914230ff1c28d8a5cd05a2d4dfd5d3f4ddc1b0 | [
"MIT"
] | null | null | null | zadania-python/zadanie#8.01-03/zadanie_8_01.py | Qeentissue/wizualizacja-danych | 36914230ff1c28d8a5cd05a2d4dfd5d3f4ddc1b0 | [
"MIT"
] | null | null | null | import pandas as pd
# Wczytaj do DataFrame arkusz z narodzinami dzieci
# w Polsce dostępny pod adresem
df = pd.read_csv('Imiona_dzieci_2000-2019.csv')
| 22 | 50 | 0.779221 | 25 | 154 | 4.68 | 0.88 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061538 | 0.155844 | 154 | 6 | 51 | 25.666667 | 0.838462 | 0.506494 | 0 | 0 | 0 | 0 | 0.375 | 0.375 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
fbc201d1881ba8593f71b1f223ddd8ebc3cad88f | 474 | py | Python | tests/search_test.py | martingaston/billy-search | 60bdfa0cf740675c3afd86ad68f83755c9cd6596 | [
"MIT"
] | null | null | null | tests/search_test.py | martingaston/billy-search | 60bdfa0cf740675c3afd86ad68f83755c9cd6596 | [
"MIT"
] | 17 | 2018-11-28T19:20:01.000Z | 2019-01-06T18:00:58.000Z | tests/search_test.py | martingaston/billy-search | 60bdfa0cf740675c3afd86ad68f83755c9cd6596 | [
"MIT"
] | null | null | null | import pytest
from billy.utils.search import google_book_search
class TestGoogleBookSearch(object):
def test_search_returns_200(self, mock):
"""Ensure a basic search returns a 200 request"""
assert google_book_search("Harry Potter")["status"] == 200
def test_search_body_returns_dict(self, mock):
"""Ensure we're getting a JSON dict back from google_book_search()"""
assert type(google_book_search("Harry Potter")["body"]) is dict
| 36.461538 | 77 | 0.721519 | 66 | 474 | 4.954545 | 0.515152 | 0.122324 | 0.195719 | 0.12844 | 0.165138 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023077 | 0.177215 | 474 | 12 | 78 | 39.5 | 0.815385 | 0.225738 | 0 | 0 | 0 | 0 | 0.095506 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.285714 | false | 0 | 0.285714 | 0 | 0.714286 | 0 | 0 | 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 | 0 | 1 | 0 | 0 | 3 |
fbc22fb24183b91ed5d90aa53daf5acd378bad49 | 2,981 | py | Python | src/config.py | Clloud/MostPopularRoute | fd89c103b1635e4028913263fb667949d35c3986 | [
"MIT"
] | 7 | 2019-08-22T06:34:02.000Z | 2021-12-20T00:00:36.000Z | src/config.py | Clloud/MostPopularRoute | fd89c103b1635e4028913263fb667949d35c3986 | [
"MIT"
] | null | null | null | src/config.py | Clloud/MostPopularRoute | fd89c103b1635e4028913263fb667949d35c3986 | [
"MIT"
] | 2 | 2022-01-15T11:48:57.000Z | 2022-02-10T05:24:38.000Z | import math
class Config_1:
DATASET_ROOT_DIR = '../data/test1/Data' # The data set root directory
DATASET_SCALE = 0 # How many users' trajectory data are choosed
TRAJACTORY_SCALE = 20 # How many trajectories are choosed per user
RANGE = { # To pick trajectory points within the range
'status': False
}
GROUP_SIZE_THRESHOLD = 3 # group size threshold φ
COHERENCE_THRESHOLD = 0.4 # coherence threshold τ
SCALING_FACTOR = 1.5 # scaling factor δ
TURNING_ALPHA = 5 # tuning parameter α
TURNING_BETA = 2 # tuning parameter β
RADIUS = SCALING_FACTOR * \
((-math.log(COHERENCE_THRESHOLD)) ** (1 / TURNING_ALPHA))
class Config_2:
DATASET_ROOT_DIR = '../data/test2/Data' # The data set root directory
DATASET_SCALE = 3 # How many users' trajectory data are choosed
TRAJACTORY_SCALE = 4 # How many trajectories are choosed per user
RANGE = { # To pick trajectory points within the range
'status': True,
'longitude_upper_bound': 116.32,
'longitude_lower_bound': 116.304,
'latitude_upper_bound': 40.018,
'latitude_lower_bound': 40.004,
}
GROUP_SIZE_THRESHOLD = 3 # group size threshold φ
COHERENCE_THRESHOLD = 0.99 # coherence threshold τ
SCALING_FACTOR = 15e-4 # scaling factor δ
TURNING_ALPHA = 5 # tuning parameter α
TURNING_BETA = 2 # tuning parameter β
RADIUS = SCALING_FACTOR * \
((-math.log(COHERENCE_THRESHOLD)) ** (1 / TURNING_ALPHA))
class Config_3:
DATASET_ROOT_DIR = '../data/test3/Data' # The data set root directory
DATASET_SCALE = 0 # How many users' trajectory data are choosed
TRAJACTORY_SCALE = 20 # How many trajectories are choosed per user
RANGE = { # To pick trajectory points within the range
'status': False
}
GROUP_SIZE_THRESHOLD = 3 # group size threshold φ
COHERENCE_THRESHOLD = 0.49 # coherence threshold τ
SCALING_FACTOR = 1.1 # scaling factor δ
TURNING_ALPHA = 5 # tuning parameter α
TURNING_BETA = 2 # tuning parameter β
RADIUS = SCALING_FACTOR * \
((-math.log(COHERENCE_THRESHOLD)) ** (1 / TURNING_ALPHA))
class Config(Config_3):
__attr__ = ['DATASET_ROOT_DIR', 'DATASET_SCALE', 'TRAJACTORY_SCALE', 'RANGE',
'GROUP_SIZE_THRESHOLD', 'COHERENCE_THRESHOLD', 'SCALING_FACTOR',
'TURNING_ALPHA', 'TURNING_BETA', 'RADIUS']
def __str__(self):
s = ""
for attr in self.__attr__:
s += attr + ' ' + str(getattr(self, attr)) + '\n'
return s
def __repr__(self):
return self.__str__() | 40.835616 | 85 | 0.578665 | 335 | 2,981 | 4.907463 | 0.247761 | 0.109489 | 0.076642 | 0.032847 | 0.742701 | 0.723236 | 0.68309 | 0.68309 | 0.659367 | 0.628346 | 0 | 0.032143 | 0.342503 | 2,981 | 73 | 86 | 40.835616 | 0.806633 | 0.259309 | 0 | 0.413793 | 0 | 0 | 0.133425 | 0.019257 | 0 | 0 | 0 | 0 | 0 | 1 | 0.034483 | false | 0 | 0.017241 | 0.017241 | 0.689655 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 3 |
839c15c319f76f2a4d3c57f98d73d5a1cfa11959 | 1,563 | py | Python | influxdbnagiosplugin/tests/test_query.py | paulboot/influxdb-nagios-plugin | 945eeb518d22863a7878b3726b24d8a2e9e485bb | [
"Apache-2.0"
] | 5 | 2016-05-16T22:35:09.000Z | 2020-11-13T16:03:45.000Z | influxdbnagiosplugin/tests/test_query.py | paulboot/influxdb-nagios-plugin | 945eeb518d22863a7878b3726b24d8a2e9e485bb | [
"Apache-2.0"
] | 2 | 2017-11-28T00:01:19.000Z | 2022-01-21T14:04:58.000Z | influxdbnagiosplugin/tests/test_query.py | paulboot/influxdb-nagios-plugin | 945eeb518d22863a7878b3726b24d8a2e9e485bb | [
"Apache-2.0"
] | 9 | 2015-12-03T00:37:57.000Z | 2021-09-08T09:23:05.000Z | """
Query construction tests.
"""
from hamcrest import assert_that, is_, equal_to
from influxdbnagiosplugin.query import ExplicitQueryBuilder, SingleMeasurementQueryBuilder
def test_explicit_query():
query = ExplicitQueryBuilder("SHOW MEASUREMENTS")
assert_that(query().query, is_(equal_to(
"SHOW MEASUREMENTS"
)))
def test_single_measurement_query():
query = SingleMeasurementQueryBuilder.for_hostname_and_age(
measurement="disk_free",
hostname="hostname",
age="30s",
where=[],
)
assert_that(query().query, is_(equal_to(
"SELECT time, value FROM disk_free"
" WHERE time > now() - 30s"
" AND host = 'hostname'"
)))
def test_single_measurement_query_where_clause():
query = SingleMeasurementQueryBuilder.for_hostname_and_age(
measurement="disk_free",
hostname="hostname",
age="30s",
where=["path=/"],
)
assert_that(query().query, is_(equal_to(
"SELECT time, value FROM disk_free"
" WHERE time > now() - 30s"
" AND host = 'hostname'"
" AND path = '/'"
)))
def test_single_measurement_query_where_clause_quoted():
query = SingleMeasurementQueryBuilder.for_hostname_and_age(
measurement="disk_free",
hostname="hostname",
age="30s",
where=["path='/'"],
)
assert_that(query().query, is_(equal_to(
"SELECT time, value FROM disk_free"
" WHERE time > now() - 30s"
" AND host = 'hostname'"
" AND path = '/'"
)))
| 26.948276 | 90 | 0.627639 | 162 | 1,563 | 5.771605 | 0.228395 | 0.064171 | 0.048128 | 0.085562 | 0.758289 | 0.727273 | 0.727273 | 0.610695 | 0.610695 | 0.610695 | 0 | 0.010213 | 0.248241 | 1,563 | 57 | 91 | 27.421053 | 0.785532 | 0.015995 | 0 | 0.688889 | 0 | 0 | 0.247059 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 1 | 0.088889 | false | 0 | 0.044444 | 0 | 0.133333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
83a0c16822a34d798946b9dc4c088ff91cd8ad8d | 330 | py | Python | e-olymp/p15/373.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 25 | 2015-01-21T16:39:18.000Z | 2021-05-24T07:01:24.000Z | e-olymp/p15/373.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 2 | 2020-09-30T19:39:36.000Z | 2020-10-01T17:15:16.000Z | e-olymp/p15/373.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 15 | 2015-01-21T16:39:27.000Z | 2020-10-01T17:00:22.000Z | # TODO: tle
import re
import sys
m = {"?": ".?", "*": ".*?"}
def score(s):
return sum(ord(e) - ord("a") + 1 for e in s)
def tr(s):
return "(?=({}))".format("".join(m.get(e, e) for e in s))
for ln in sys.stdin:
p, s = ln.rstrip().split()
res = re.findall(tr(p), s)
print(score(min(res)) if res else -1)
| 15.714286 | 61 | 0.50303 | 59 | 330 | 2.813559 | 0.542373 | 0.084337 | 0.072289 | 0.084337 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007968 | 0.239394 | 330 | 20 | 62 | 16.5 | 0.653386 | 0.027273 | 0 | 0 | 0 | 0 | 0.050157 | 0 | 0 | 0 | 0 | 0.05 | 0 | 1 | 0.181818 | false | 0 | 0.181818 | 0.181818 | 0.545455 | 0.090909 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
83a9d512e8c7c2d7396ec8d190a1c692e2814f87 | 1,812 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/Workset.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Autodesk/Revit/DB/__init___parts/Workset.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Autodesk/Revit/DB/__init___parts/Workset.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class Workset(WorksetPreview,IDisposable):
""" Represents a workset in the document. """
@staticmethod
def Create(document,name):
"""
Create(document: Document,name: str) -> Workset
Creates a new workset.
document: The document in which the new instance is created.
name: The workset name.
Returns: Returns the newly created workset.
"""
pass
def Dispose(self):
""" Dispose(self: WorksetPreview,A_0: bool) """
pass
def ReleaseUnmanagedResources(self,*args):
""" ReleaseUnmanagedResources(self: WorksetPreview,disposing: bool) """
pass
def __enter__(self,*args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self,*args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
IsEditable=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Whether the workset is editable.
Get: IsEditable(self: Workset) -> bool
"""
IsOpen=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Whether the workset is open (rather than closed).
Get: IsOpen(self: Workset) -> bool
"""
IsVisibleByDefault=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Whether the workset is visible by default.
Get: IsVisibleByDefault(self: Workset) -> bool
"""
Kind=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Kind of the workset.
Get: Kind(self: Workset) -> WorksetKind
"""
| 22.37037 | 215 | 0.671634 | 217 | 1,812 | 5.331797 | 0.299539 | 0.103717 | 0.06223 | 0.082973 | 0.330164 | 0.330164 | 0.330164 | 0.330164 | 0.330164 | 0.330164 | 0 | 0.000687 | 0.19702 | 1,812 | 80 | 216 | 22.65 | 0.794502 | 0.37638 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.333333 | 0 | 0 | 0.611111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 3 |
83c70c28fab499273c642ae79b683ba8ed829bd8 | 307 | py | Python | pyNastran/bdf/bdf_interface/encoding.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 293 | 2015-03-22T20:22:01.000Z | 2022-03-14T20:28:24.000Z | pyNastran/bdf/bdf_interface/encoding.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 512 | 2015-03-14T18:39:27.000Z | 2022-03-31T16:15:43.000Z | pyNastran/bdf/bdf_interface/encoding.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 136 | 2015-03-19T03:26:06.000Z | 2022-03-25T22:14:54.000Z | def decode_lines(lines_bytes, encoding: str):
if isinstance(lines_bytes[0], bytes):
lines_str = [line.decode(encoding) for line in lines_bytes]
elif isinstance(lines_bytes[0], str):
lines_str = lines_bytes
else:
raise TypeError(type(lines_bytes[0]))
return lines_str
| 34.111111 | 67 | 0.687296 | 43 | 307 | 4.674419 | 0.418605 | 0.298507 | 0.164179 | 0.208955 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012397 | 0.211726 | 307 | 8 | 68 | 38.375 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 1 | 0 | 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 | 3 |
83e8b5d26b60139b83dc6ffd9717b442165e6180 | 145 | py | Python | 7 kyu/Complete The Pattern 2.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 6 | 2020-09-03T09:32:25.000Z | 2020-12-07T04:10:01.000Z | 7 kyu/Complete The Pattern 2.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 1 | 2021-12-13T15:30:21.000Z | 2021-12-13T15:30:21.000Z | 7 kyu/Complete The Pattern 2.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | null | null | null | def pattern(n):
res=""
for i in range(n,0,-1):
for j in range(i):
res+=str(n-j)
res+="\n"
return res[:-1] | 20.714286 | 27 | 0.427586 | 25 | 145 | 2.48 | 0.52 | 0.225806 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032967 | 0.372414 | 145 | 7 | 28 | 20.714286 | 0.648352 | 0 | 0 | 0 | 0 | 0 | 0.013699 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.285714 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
83fa2b2bb34bdebf6c4cd5300d5d2f1279a8b7ff | 223 | py | Python | get_repo/git.py | florian42/get-repo | 5c1dbf5ecfbdb28f3a628bff57e3a0963ec0fdcc | [
"MIT"
] | null | null | null | get_repo/git.py | florian42/get-repo | 5c1dbf5ecfbdb28f3a628bff57e3a0963ec0fdcc | [
"MIT"
] | null | null | null | get_repo/git.py | florian42/get-repo | 5c1dbf5ecfbdb28f3a628bff57e3a0963ec0fdcc | [
"MIT"
] | null | null | null | import subprocess
def clone(url: str, target_directory: str) -> None:
print(f'Cloning {url} into {target_directory} ...')
subprocess.run(
['git', 'clone', url, target_directory], capture_output=True
)
| 24.777778 | 68 | 0.659193 | 27 | 223 | 5.296296 | 0.666667 | 0.314685 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192825 | 223 | 8 | 69 | 27.875 | 0.794444 | 0 | 0 | 0 | 0 | 0 | 0.219731 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.333333 | 0.166667 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
f7b44e0603289410fe1b212dcf1e2a0ad54c9500 | 62 | py | Python | errores.py | fbzavaleta/DS_Software_Stack | 37cb42c129a6ff4e04704b90cd5b13db3ad9dfcf | [
"MIT"
] | null | null | null | errores.py | fbzavaleta/DS_Software_Stack | 37cb42c129a6ff4e04704b90cd5b13db3ad9dfcf | [
"MIT"
] | null | null | null | errores.py | fbzavaleta/DS_Software_Stack | 37cb42c129a6ff4e04704b90cd5b13db3ad9dfcf | [
"MIT"
] | null | null | null | #
E_LEN = "No es posible operar vectores de diferente módulo"
| 20.666667 | 59 | 0.758065 | 10 | 62 | 4.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177419 | 62 | 2 | 60 | 31 | 0.901961 | 0 | 0 | 0 | 0 | 0 | 0.803279 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f7c20796c689531f3a41f3738826f84aead341b4 | 1,397 | py | Python | distpy/util/__init__.py | CU-NESS/distpy | 279ba7e46726a85246566401fca19b8739d18d08 | [
"Apache-2.0"
] | null | null | null | distpy/util/__init__.py | CU-NESS/distpy | 279ba7e46726a85246566401fca19b8739d18d08 | [
"Apache-2.0"
] | null | null | null | distpy/util/__init__.py | CU-NESS/distpy | 279ba7e46726a85246566401fca19b8739d18d08 | [
"Apache-2.0"
] | null | null | null | """
Introduces utilities used throughout the package, including:
- interfaces for making objects `distpy.util.Savable.Savable` and
`distpy.util.Loadable.Loadable` in binary hdf5 files using h5py
- helper methods for using h5py to save and load variables and arrays
(`h5py_extensions`)
- type category definitions (`distpy.util.TypeCategories`)
- functions for making univariate histograms, bivariate histograms, and
triangle plots (`distpy.util.TrianglePlot`)
- a class that uses strings to represent an `distpy.util.Expression.Expression`
that can be modified and have arguments passed to it before being evaluated
- a class that represents
**File**: $DISTPY/distpy/util/\\_\\_init\\_\\_.py
**Author**: Keith Tauscher
**Date**: 14 May 2021
"""
from distpy.util.Savable import Savable
from distpy.util.Loadable import Loadable
from distpy.util.TypeCategories import bool_types, int_types, float_types,\
real_numerical_types, complex_numerical_types, numerical_types,\
sequence_types
from distpy.util.h5py_extensions import create_hdf5_dataset, get_hdf5_value,\
HDF5Link, save_dictionary, load_dictionary
from distpy.util.TrianglePlot import univariate_histogram,\
confidence_contour_2D, bivariate_histogram, triangle_plot
from distpy.util.Expression import Expression
from distpy.util.SparseSquareBlockDiagonalMatrix import\
SparseSquareBlockDiagonalMatrix
| 43.65625 | 79 | 0.800286 | 177 | 1,397 | 6.169492 | 0.519774 | 0.119048 | 0.089744 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012245 | 0.123121 | 1,397 | 31 | 80 | 45.064516 | 0.879184 | 0.537581 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.583333 | 0 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
f7c92906bdd05fb9011ed12eacbe0ac0a33b671e | 502 | py | Python | python/tests/testdata/region_HU.py | kevin-brown/python-phonenumbers | e4ae191e6fae47581eb40d3d23c7e2b7d422c326 | [
"Apache-2.0"
] | 1 | 2019-08-06T03:19:28.000Z | 2019-08-06T03:19:28.000Z | python/tests/testdata/region_HU.py | kevin-brown/python-phonenumbers | e4ae191e6fae47581eb40d3d23c7e2b7d422c326 | [
"Apache-2.0"
] | null | null | null | python/tests/testdata/region_HU.py | kevin-brown/python-phonenumbers | e4ae191e6fae47581eb40d3d23c7e2b7d422c326 | [
"Apache-2.0"
] | 2 | 2018-02-09T13:52:15.000Z | 2019-09-10T08:36:25.000Z | """Auto-generated file, do not edit by hand. HU metadata"""
from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_HU = PhoneMetadata(id='HU', country_code=36, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='30\\d{7}', possible_length=(9,)),
mobile=PhoneNumberDesc(national_number_pattern='30\\d{7}', example_number='301234567', possible_length=(9,)),
national_prefix='06',
national_prefix_for_parsing='06')
| 55.777778 | 113 | 0.776892 | 63 | 502 | 5.936508 | 0.650794 | 0.122995 | 0.15508 | 0.192513 | 0.213904 | 0.213904 | 0.213904 | 0 | 0 | 0 | 0 | 0.054585 | 0.087649 | 502 | 8 | 114 | 62.75 | 0.762009 | 0.105578 | 0 | 0 | 1 | 0 | 0.074492 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f7cde5f2b92aa7e388bad877341add7fc6bed0cb | 521 | py | Python | create_lesson_plan/admin.py | rishabhranawat/CrowdPlatform | 1de2ad7e70fbf6cbf2e29bc9368341134b4f7e0d | [
"MIT"
] | 1 | 2020-07-23T21:35:40.000Z | 2020-07-23T21:35:40.000Z | create_lesson_plan/admin.py | rishabhranawat/CrowdPlatform | 1de2ad7e70fbf6cbf2e29bc9368341134b4f7e0d | [
"MIT"
] | 9 | 2021-02-08T20:32:35.000Z | 2022-03-02T14:58:07.000Z | create_lesson_plan/admin.py | rishabhranawat/CrowdPlatform | 1de2ad7e70fbf6cbf2e29bc9368341134b4f7e0d | [
"MIT"
] | null | null | null | from django.contrib import admin
from create_lesson_plan.models import *
admin.site.register(lesson)
admin.site.register(lesson_plan)
admin.site.register(Engage_Urls)
admin.site.register(Explain_Urls)
admin.site.register(Evaluate_Urls)
admin.site.register(MCQ)
admin.site.register(FITB)
admin.site.register(Engage_Images)
admin.site.register(Explain_Images)
admin.site.register(Evaluate_Images)
admin.site.register(Document)
admin.site.register(Image)
admin.site.register(TestScore)
admin.site.register(OfflineDocument)
| 28.944444 | 39 | 0.84261 | 74 | 521 | 5.810811 | 0.297297 | 0.293023 | 0.553488 | 0.146512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044146 | 521 | 17 | 40 | 30.647059 | 0.863454 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.125 | 0 | 0.125 | 0 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f7e5ec76a74f735b8085dae26118d20f0eea400d | 453 | py | Python | akagi/data_sources/spreadsheet_data_source.py | pauchan/akagi | 7cf1f5a52b8f1ebfdc74a527bf6b26254f99343b | [
"MIT"
] | 26 | 2017-05-18T11:52:04.000Z | 2018-08-25T22:03:07.000Z | akagi/data_sources/spreadsheet_data_source.py | pauchan/akagi | 7cf1f5a52b8f1ebfdc74a527bf6b26254f99343b | [
"MIT"
] | 325 | 2017-05-08T07:22:28.000Z | 2022-03-31T15:43:18.000Z | akagi/data_sources/spreadsheet_data_source.py | pauchan/akagi | 7cf1f5a52b8f1ebfdc74a527bf6b26254f99343b | [
"MIT"
] | 7 | 2017-05-02T02:06:15.000Z | 2020-04-09T05:32:11.000Z | from akagi.data_source import DataSource
from akagi.data_file import DataFile
class SpreadsheetDataSource(DataSource):
'''SpreadsheetSource replesents a data on Google Spreadsheets
'''
def __init__(self, sheet_id, sheet_range='A:Z', no_cache=False):
self._sheet_id = sheet_id
self._sheet_range = sheet_range
@property
def data_files(self):
return [DataFile.spreadsheet(self._sheet_id, self._sheet_range)]
| 28.3125 | 72 | 0.732892 | 58 | 453 | 5.37931 | 0.517241 | 0.144231 | 0.105769 | 0.102564 | 0.134615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183223 | 453 | 15 | 73 | 30.2 | 0.843243 | 0.128035 | 0 | 0 | 0 | 0 | 0.007813 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
f7fcf7559948b6752dd0ee377be44bd42c092522 | 351 | py | Python | forest_lite/server/lib/palette.py | uk-gov-mirror/MetOffice.forest-lite | 9406b53f7e6a9651eb675e0ac2e5945421b25557 | [
"BSD-3-Clause"
] | 6 | 2020-08-05T16:12:57.000Z | 2022-01-06T01:34:19.000Z | forest_lite/server/lib/palette.py | uk-gov-mirror/MetOffice.forest-lite | 9406b53f7e6a9651eb675e0ac2e5945421b25557 | [
"BSD-3-Clause"
] | 49 | 2020-08-14T13:58:32.000Z | 2021-06-29T11:42:32.000Z | forest_lite/server/lib/palette.py | uk-gov-mirror/MetOffice.forest-lite | 9406b53f7e6a9651eb675e0ac2e5945421b25557 | [
"BSD-3-Clause"
] | 2 | 2020-12-03T09:24:13.000Z | 2021-04-11T06:10:36.000Z | import bokeh.palettes
def all_palettes():
"""List of palette definitions"""
for name in bokeh.palettes.all_palettes:
for number in bokeh.palettes.all_palettes[name]:
yield {
"name": name,
"number": number,
"palette": bokeh.palettes.all_palettes[name][number]
}
| 27 | 68 | 0.566952 | 37 | 351 | 5.27027 | 0.378378 | 0.266667 | 0.246154 | 0.369231 | 0.430769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.327635 | 351 | 12 | 69 | 29.25 | 0.826271 | 0.076923 | 0 | 0 | 0 | 0 | 0.053459 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.111111 | 0 | 0.222222 | 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 | 0 | 0 | 0 | 0 | 3 |
791468fb9834f8a61e661025dfae37ea17e85be7 | 135 | py | Python | note/urls.py | StevenYwch/CloudNote | c36efba53d83a040f4c9cff861d0df28d9db8f1b | [
"MIT"
] | null | null | null | note/urls.py | StevenYwch/CloudNote | c36efba53d83a040f4c9cff861d0df28d9db8f1b | [
"MIT"
] | null | null | null | note/urls.py | StevenYwch/CloudNote | c36efba53d83a040f4c9cff861d0df28d9db8f1b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('list', views.list_view),
path('add', views.add_view),
] | 19.285714 | 34 | 0.681481 | 19 | 135 | 4.736842 | 0.526316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177778 | 135 | 7 | 35 | 19.285714 | 0.810811 | 0 | 0 | 0 | 0 | 0 | 0.051471 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 3 |
791adee85a8db7759e5f3f2e7403b68b0df27e62 | 113 | py | Python | __init__.py | nuxeo-cps/zope2--PortalTransforms | 753f67202b016d0b07edd3bc65fd827cb39e50db | [
"BSD-3-Clause"
] | null | null | null | __init__.py | nuxeo-cps/zope2--PortalTransforms | 753f67202b016d0b07edd3bc65fd827cb39e50db | [
"BSD-3-Clause"
] | null | null | null | __init__.py | nuxeo-cps/zope2--PortalTransforms | 753f67202b016d0b07edd3bc65fd827cb39e50db | [
"BSD-3-Clause"
] | null | null | null | __revision__ = '$Id$'
from utils import HAS_ZOPE
if HAS_ZOPE:
from Products.PortalTransforms.zope import *
| 16.142857 | 48 | 0.752212 | 15 | 113 | 5.266667 | 0.666667 | 0.177215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.168142 | 113 | 6 | 49 | 18.833333 | 0.840426 | 0 | 0 | 0 | 0 | 0 | 0.035398 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
791c899515ab5ee22d19f49f98ec0553bac2d037 | 144 | py | Python | app/donut.py | zaphodef/stockpile | f682c0d16a07ab281363c8031c611305934da46c | [
"Apache-2.0"
] | null | null | null | app/donut.py | zaphodef/stockpile | f682c0d16a07ab281363c8031c611305934da46c | [
"Apache-2.0"
] | null | null | null | app/donut.py | zaphodef/stockpile | f682c0d16a07ab281363c8031c611305934da46c | [
"Apache-2.0"
] | null | null | null | async def donut_handler(args):
print('This is where we would configure things to properly handle a .donut file request.')
return '', ''
| 36 | 94 | 0.708333 | 21 | 144 | 4.809524 | 0.952381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.194444 | 144 | 3 | 95 | 48 | 0.87069 | 0 | 0 | 0 | 0 | 0 | 0.5625 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0.333333 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
f71e495c79f4bb1a1505cad9bdde64d7e37c7ba1 | 1,293 | py | Python | proxy/core/tls/certificate.py | fisabiliyusri/proxy | 29934503251b704813ef3e7ed8c2a5ae69448c8a | [
"BSD-3-Clause"
] | null | null | null | proxy/core/tls/certificate.py | fisabiliyusri/proxy | 29934503251b704813ef3e7ed8c2a5ae69448c8a | [
"BSD-3-Clause"
] | 8 | 2022-01-23T10:51:59.000Z | 2022-03-29T22:11:57.000Z | proxy/core/tls/certificate.py | fisabiliyusri/proxy | 29934503251b704813ef3e7ed8c2a5ae69448c8a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
"""
from typing import Tuple, Optional
class TlsCertificate:
"""TLS Certificate"""
def __init__(self) -> None:
self.data: Optional[bytes] = None
def parse(self, raw: bytes) -> Tuple[bool, bytes]:
self.data = raw
return True, raw
def build(self) -> bytes:
assert self.data
return self.data
class TlsCertificateRequest:
"""TLS Certificate Request"""
def __init__(self) -> None:
self.data: Optional[bytes] = None
def parse(self, raw: bytes) -> Tuple[bool, bytes]:
return False, raw
def build(self) -> bytes:
assert self.data
return self.data
class TlsCertificateVerify:
"""TLS Certificate Verify"""
def __init__(self) -> None:
self.data: Optional[bytes] = None
def parse(self, raw: bytes) -> Tuple[bool, bytes]:
return False, raw
def build(self) -> bytes:
assert self.data
return self.data
| 23.509091 | 86 | 0.622583 | 151 | 1,293 | 5.271523 | 0.417219 | 0.100503 | 0.041457 | 0.056533 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0 | 0.005219 | 0.259087 | 1,293 | 54 | 87 | 23.944444 | 0.822547 | 0.287703 | 0 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 1 | 0.346154 | false | 0 | 0.038462 | 0.076923 | 0.730769 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f71f6972720d1f87a308457a99c2da6ef6fe19d9 | 63,620 | py | Python | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2018/11/26 19:28
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
-------------------------------------------------
Description : 888. 公平的糖果交换
虚拟 用户通过次数 0
虚拟 用户尝试次数 1
虚拟 通过次数 0
虚拟 提交次数 1
题目难度 Easy
爱丽丝和鲍勃有不同大小的糖果棒:A[i] 是爱丽丝拥有的第 i 块糖的大小,B[j] 是鲍勃拥有的第 j 块糖的大小。
因为他们是朋友,所以他们想交换一个糖果棒,这样交换后,他们都有相同的糖果总量。(一个人拥有的糖果总量是他们拥有的糖果棒大小的总和。)
返回一个整数数组 ans,其中 ans[0] 是爱丽丝必须交换的糖果棒的大小,ans[1] 是 Bob 必须交换的糖果棒的大小。
如果有多个答案,你可以返回其中任何一个。保证答案存在。
示例 1:
输入:A = [1,1], B = [2,2]
输出:[1,2]
示例 2:
输入:A = [1,2], B = [2,3]
输出:[1,2]
示例 3:
输入:A = [2], B = [1,3]
输出:[2,3]
示例 4:
输入:A = [1,2,5], B = [2,4]
输出:[5,4]
提示:
1 <= A.length <= 10000
1 <= B.length <= 10000
1 <= A[i] <= 100000
1 <= B[i] <= 100000
保证爱丽丝与鲍勃的糖果总量不同。
答案肯定存在。
-------------------------------------------------
"""
import time
__author__ = 'Max_Pengjb'
start = time.time()
# 下面写上代码块
class Solution(object):
def fairCandySwap(self, A, B):
"""
:type A: List[int]
:type B: List[int]
:rtype: List[int]
"""
k = (sum(A) - sum(B)) // 2
b = dict(zip(B, [1 for _ in B]))
for i in A:
if i - k in b.keys():
return [i, i - k]
A = [1, 2, 5]
B = [2, 4]
a1 = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59,
61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113,
115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205,
207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251,
253, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297,
299, 301, 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, 323, 325, 327, 329, 331, 333, 335, 337, 339, 341, 343,
345, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, 381, 383, 385, 387, 389,
391, 393, 395, 397, 399, 401, 403, 405, 407, 409, 411, 413, 415, 417, 419, 421, 423, 425, 427, 429, 431, 433, 435,
437, 439, 441, 443, 445, 447, 449, 451, 453, 455, 457, 459, 461, 463, 465, 467, 469, 471, 473, 475, 477, 479, 481,
483, 485, 487, 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527,
529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 561, 563, 565, 567, 569, 571, 573,
575, 577, 579, 581, 583, 585, 587, 589, 591, 593, 595, 597, 599, 601, 603, 605, 607, 609, 611, 613, 615, 617, 619,
621, 623, 625, 627, 629, 631, 633, 635, 637, 639, 641, 643, 645, 647, 649, 651, 653, 655, 657, 659, 661, 663, 665,
667, 669, 671, 673, 675, 677, 679, 681, 683, 685, 687, 689, 691, 693, 695, 697, 699, 701, 703, 705, 707, 709, 711,
713, 715, 717, 719, 721, 723, 725, 727, 729, 731, 733, 735, 737, 739, 741, 743, 745, 747, 749, 751, 753, 755, 757,
759, 761, 763, 765, 767, 769, 771, 773, 775, 777, 779, 781, 783, 785, 787, 789, 791, 793, 795, 797, 799, 801, 803,
805, 807, 809, 811, 813, 815, 817, 819, 821, 823, 825, 827, 829, 831, 833, 835, 837, 839, 841, 843, 845, 847, 849,
851, 853, 855, 857, 859, 861, 863, 865, 867, 869, 871, 873, 875, 877, 879, 881, 883, 885, 887, 889, 891, 893, 895,
897, 899, 901, 903, 905, 907, 909, 911, 913, 915, 917, 919, 921, 923, 925, 927, 929, 931, 933, 935, 937, 939, 941,
943, 945, 947, 949, 951, 953, 955, 957, 959, 961, 963, 965, 967, 969, 971, 973, 975, 977, 979, 981, 983, 985, 987,
989, 991, 993, 995, 997, 999, 1001, 1003, 1005, 1007, 1009, 1011, 1013, 1015, 1017, 1019, 1021, 1023, 1025, 1027,
1029, 1031, 1033, 1035, 1037, 1039, 1041, 1043, 1045, 1047, 1049, 1051, 1053, 1055, 1057, 1059, 1061, 1063, 1065,
1067, 1069, 1071, 1073, 1075, 1077, 1079, 1081, 1083, 1085, 1087, 1089, 1091, 1093, 1095, 1097, 1099, 1101, 1103,
1105, 1107, 1109, 1111, 1113, 1115, 1117, 1119, 1121, 1123, 1125, 1127, 1129, 1131, 1133, 1135, 1137, 1139, 1141,
1143, 1145, 1147, 1149, 1151, 1153, 1155, 1157, 1159, 1161, 1163, 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179,
1181, 1183, 1185, 1187, 1189, 1191, 1193, 1195, 1197, 1199, 1201, 1203, 1205, 1207, 1209, 1211, 1213, 1215, 1217,
1219, 1221, 1223, 1225, 1227, 1229, 1231, 1233, 1235, 1237, 1239, 1241, 1243, 1245, 1247, 1249, 1251, 1253, 1255,
1257, 1259, 1261, 1263, 1265, 1267, 1269, 1271, 1273, 1275, 1277, 1279, 1281, 1283, 1285, 1287, 1289, 1291, 1293,
1295, 1297, 1299, 1301, 1303, 1305, 1307, 1309, 1311, 1313, 1315, 1317, 1319, 1321, 1323, 1325, 1327, 1329, 1331,
1333, 1335, 1337, 1339, 1341, 1343, 1345, 1347, 1349, 1351, 1353, 1355, 1357, 1359, 1361, 1363, 1365, 1367, 1369,
1371, 1373, 1375, 1377, 1379, 1381, 1383, 1385, 1387, 1389, 1391, 1393, 1395, 1397, 1399, 1401, 1403, 1405, 1407,
1409, 1411, 1413, 1415, 1417, 1419, 1421, 1423, 1425, 1427, 1429, 1431, 1433, 1435, 1437, 1439, 1441, 1443, 1445,
1447, 1449, 1451, 1453, 1455, 1457, 1459, 1461, 1463, 1465, 1467, 1469, 1471, 1473, 1475, 1477, 1479, 1481, 1483,
1485, 1487, 1489, 1491, 1493, 1495, 1497, 1499, 1501, 1503, 1505, 1507, 1509, 1511, 1513, 1515, 1517, 1519, 1521,
1523, 1525, 1527, 1529, 1531, 1533, 1535, 1537, 1539, 1541, 1543, 1545, 1547, 1549, 1551, 1553, 1555, 1557, 1559,
1561, 1563, 1565, 1567, 1569, 1571, 1573, 1575, 1577, 1579, 1581, 1583, 1585, 1587, 1589, 1591, 1593, 1595, 1597,
1599, 1601, 1603, 1605, 1607, 1609, 1611, 1613, 1615, 1617, 1619, 1621, 1623, 1625, 1627, 1629, 1631, 1633, 1635,
1637, 1639, 1641, 1643, 1645, 1647, 1649, 1651, 1653, 1655, 1657, 1659, 1661, 1663, 1665, 1667, 1669, 1671, 1673,
1675, 1677, 1679, 1681, 1683, 1685, 1687, 1689, 1691, 1693, 1695, 1697, 1699, 1701, 1703, 1705, 1707, 1709, 1711,
1713, 1715, 1717, 1719, 1721, 1723, 1725, 1727, 1729, 1731, 1733, 1735, 1737, 1739, 1741, 1743, 1745, 1747, 1749,
1751, 1753, 1755, 1757, 1759, 1761, 1763, 1765, 1767, 1769, 1771, 1773, 1775, 1777, 1779, 1781, 1783, 1785, 1787,
1789, 1791, 1793, 1795, 1797, 1799, 1801, 1803, 1805, 1807, 1809, 1811, 1813, 1815, 1817, 1819, 1821, 1823, 1825,
1827, 1829, 1831, 1833, 1835, 1837, 1839, 1841, 1843, 1845, 1847, 1849, 1851, 1853, 1855, 1857, 1859, 1861, 1863,
1865, 1867, 1869, 1871, 1873, 1875, 1877, 1879, 1881, 1883, 1885, 1887, 1889, 1891, 1893, 1895, 1897, 1899, 1901,
1903, 1905, 1907, 1909, 1911, 1913, 1915, 1917, 1919, 1921, 1923, 1925, 1927, 1929, 1931, 1933, 1935, 1937, 1939,
1941, 1943, 1945, 1947, 1949, 1951, 1953, 1955, 1957, 1959, 1961, 1963, 1965, 1967, 1969, 1971, 1973, 1975, 1977,
1979, 1981, 1983, 1985, 1987, 1989, 1991, 1993, 1995, 1997, 1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015,
2017, 2019, 2021, 2023, 2025, 2027, 2029, 2031, 2033, 2035, 2037, 2039, 2041, 2043, 2045, 2047, 2049, 2051, 2053,
2055, 2057, 2059, 2061, 2063, 2065, 2067, 2069, 2071, 2073, 2075, 2077, 2079, 2081, 2083, 2085, 2087, 2089, 2091,
2093, 2095, 2097, 2099, 2101, 2103, 2105, 2107, 2109, 2111, 2113, 2115, 2117, 2119, 2121, 2123, 2125, 2127, 2129,
2131, 2133, 2135, 2137, 2139, 2141, 2143, 2145, 2147, 2149, 2151, 2153, 2155, 2157, 2159, 2161, 2163, 2165, 2167,
2169, 2171, 2173, 2175, 2177, 2179, 2181, 2183, 2185, 2187, 2189, 2191, 2193, 2195, 2197, 2199, 2201, 2203, 2205,
2207, 2209, 2211, 2213, 2215, 2217, 2219, 2221, 2223, 2225, 2227, 2229, 2231, 2233, 2235, 2237, 2239, 2241, 2243,
2245, 2247, 2249, 2251, 2253, 2255, 2257, 2259, 2261, 2263, 2265, 2267, 2269, 2271, 2273, 2275, 2277, 2279, 2281,
2283, 2285, 2287, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 2305, 2307, 2309, 2311, 2313, 2315, 2317, 2319,
2321, 2323, 2325, 2327, 2329, 2331, 2333, 2335, 2337, 2339, 2341, 2343, 2345, 2347, 2349, 2351, 2353, 2355, 2357,
2359, 2361, 2363, 2365, 2367, 2369, 2371, 2373, 2375, 2377, 2379, 2381, 2383, 2385, 2387, 2389, 2391, 2393, 2395,
2397, 2399, 2401, 2403, 2405, 2407, 2409, 2411, 2413, 2415, 2417, 2419, 2421, 2423, 2425, 2427, 2429, 2431, 2433,
2435, 2437, 2439, 2441, 2443, 2445, 2447, 2449, 2451, 2453, 2455, 2457, 2459, 2461, 2463, 2465, 2467, 2469, 2471,
2473, 2475, 2477, 2479, 2481, 2483, 2485, 2487, 2489, 2491, 2493, 2495, 2497, 2499, 2501, 2503, 2505, 2507, 2509,
2511, 2513, 2515, 2517, 2519, 2521, 2523, 2525, 2527, 2529, 2531, 2533, 2535, 2537, 2539, 2541, 2543, 2545, 2547,
2549, 2551, 2553, 2555, 2557, 2559, 2561, 2563, 2565, 2567, 2569, 2571, 2573, 2575, 2577, 2579, 2581, 2583, 2585,
2587, 2589, 2591, 2593, 2595, 2597, 2599, 2601, 2603, 2605, 2607, 2609, 2611, 2613, 2615, 2617, 2619, 2621, 2623,
2625, 2627, 2629, 2631, 2633, 2635, 2637, 2639, 2641, 2643, 2645, 2647, 2649, 2651, 2653, 2655, 2657, 2659, 2661,
2663, 2665, 2667, 2669, 2671, 2673, 2675, 2677, 2679, 2681, 2683, 2685, 2687, 2689, 2691, 2693, 2695, 2697, 2699,
2701, 2703, 2705, 2707, 2709, 2711, 2713, 2715, 2717, 2719, 2721, 2723, 2725, 2727, 2729, 2731, 2733, 2735, 2737,
2739, 2741, 2743, 2745, 2747, 2749, 2751, 2753, 2755, 2757, 2759, 2761, 2763, 2765, 2767, 2769, 2771, 2773, 2775,
2777, 2779, 2781, 2783, 2785, 2787, 2789, 2791, 2793, 2795, 2797, 2799, 2801, 2803, 2805, 2807, 2809, 2811, 2813,
2815, 2817, 2819, 2821, 2823, 2825, 2827, 2829, 2831, 2833, 2835, 2837, 2839, 2841, 2843, 2845, 2847, 2849, 2851,
2853, 2855, 2857, 2859, 2861, 2863, 2865, 2867, 2869, 2871, 2873, 2875, 2877, 2879, 2881, 2883, 2885, 2887, 2889,
2891, 2893, 2895, 2897, 2899, 2901, 2903, 2905, 2907, 2909, 2911, 2913, 2915, 2917, 2919, 2921, 2923, 2925, 2927,
2929, 2931, 2933, 2935, 2937, 2939, 2941, 2943, 2945, 2947, 2949, 2951, 2953, 2955, 2957, 2959, 2961, 2963, 2965,
2967, 2969, 2971, 2973, 2975, 2977, 2979, 2981, 2983, 2985, 2987, 2989, 2991, 2993, 2995, 2997, 2999, 3001, 3003,
3005, 3007, 3009, 3011, 3013, 3015, 3017, 3019, 3021, 3023, 3025, 3027, 3029, 3031, 3033, 3035, 3037, 3039, 3041,
3043, 3045, 3047, 3049, 3051, 3053, 3055, 3057, 3059, 3061, 3063, 3065, 3067, 3069, 3071, 3073, 3075, 3077, 3079,
3081, 3083, 3085, 3087, 3089, 3091, 3093, 3095, 3097, 3099, 3101, 3103, 3105, 3107, 3109, 3111, 3113, 3115, 3117,
3119, 3121, 3123, 3125, 3127, 3129, 3131, 3133, 3135, 3137, 3139, 3141, 3143, 3145, 3147, 3149, 3151, 3153, 3155,
3157, 3159, 3161, 3163, 3165, 3167, 3169, 3171, 3173, 3175, 3177, 3179, 3181, 3183, 3185, 3187, 3189, 3191, 3193,
3195, 3197, 3199, 3201, 3203, 3205, 3207, 3209, 3211, 3213, 3215, 3217, 3219, 3221, 3223, 3225, 3227, 3229, 3231,
3233, 3235, 3237, 3239, 3241, 3243, 3245, 3247, 3249, 3251, 3253, 3255, 3257, 3259, 3261, 3263, 3265, 3267, 3269,
3271, 3273, 3275, 3277, 3279, 3281, 3283, 3285, 3287, 3289, 3291, 3293, 3295, 3297, 3299, 3301, 3303, 3305, 3307,
3309, 3311, 3313, 3315, 3317, 3319, 3321, 3323, 3325, 3327, 3329, 3331, 3333, 3335, 3337, 3339, 3341, 3343, 3345,
3347, 3349, 3351, 3353, 3355, 3357, 3359, 3361, 3363, 3365, 3367, 3369, 3371, 3373, 3375, 3377, 3379, 3381, 3383,
3385, 3387, 3389, 3391, 3393, 3395, 3397, 3399, 3401, 3403, 3405, 3407, 3409, 3411, 3413, 3415, 3417, 3419, 3421,
3423, 3425, 3427, 3429, 3431, 3433, 3435, 3437, 3439, 3441, 3443, 3445, 3447, 3449, 3451, 3453, 3455, 3457, 3459,
3461, 3463, 3465, 3467, 3469, 3471, 3473, 3475, 3477, 3479, 3481, 3483, 3485, 3487, 3489, 3491, 3493, 3495, 3497,
3499, 3501, 3503, 3505, 3507, 3509, 3511, 3513, 3515, 3517, 3519, 3521, 3523, 3525, 3527, 3529, 3531, 3533, 3535,
3537, 3539, 3541, 3543, 3545, 3547, 3549, 3551, 3553, 3555, 3557, 3559, 3561, 3563, 3565, 3567, 3569, 3571, 3573,
3575, 3577, 3579, 3581, 3583, 3585, 3587, 3589, 3591, 3593, 3595, 3597, 3599, 3601, 3603, 3605, 3607, 3609, 3611,
3613, 3615, 3617, 3619, 3621, 3623, 3625, 3627, 3629, 3631, 3633, 3635, 3637, 3639, 3641, 3643, 3645, 3647, 3649,
3651, 3653, 3655, 3657, 3659, 3661, 3663, 3665, 3667, 3669, 3671, 3673, 3675, 3677, 3679, 3681, 3683, 3685, 3687,
3689, 3691, 3693, 3695, 3697, 3699, 3701, 3703, 3705, 3707, 3709, 3711, 3713, 3715, 3717, 3719, 3721, 3723, 3725,
3727, 3729, 3731, 3733, 3735, 3737, 3739, 3741, 3743, 3745, 3747, 3749, 3751, 3753, 3755, 3757, 3759, 3761, 3763,
3765, 3767, 3769, 3771, 3773, 3775, 3777, 3779, 3781, 3783, 3785, 3787, 3789, 3791, 3793, 3795, 3797, 3799, 3801,
3803, 3805, 3807, 3809, 3811, 3813, 3815, 3817, 3819, 3821, 3823, 3825, 3827, 3829, 3831, 3833, 3835, 3837, 3839,
3841, 3843, 3845, 3847, 3849, 3851, 3853, 3855, 3857, 3859, 3861, 3863, 3865, 3867, 3869, 3871, 3873, 3875, 3877,
3879, 3881, 3883, 3885, 3887, 3889, 3891, 3893, 3895, 3897, 3899, 3901, 3903, 3905, 3907, 3909, 3911, 3913, 3915,
3917, 3919, 3921, 3923, 3925, 3927, 3929, 3931, 3933, 3935, 3937, 3939, 3941, 3943, 3945, 3947, 3949, 3951, 3953,
3955, 3957, 3959, 3961, 3963, 3965, 3967, 3969, 3971, 3973, 3975, 3977, 3979, 3981, 3983, 3985, 3987, 3989, 3991,
3993, 3995, 3997, 3999, 4001, 4003, 4005, 4007, 4009, 4011, 4013, 4015, 4017, 4019, 4021, 4023, 4025, 4027, 4029,
4031, 4033, 4035, 4037, 4039, 4041, 4043, 4045, 4047, 4049, 4051, 4053, 4055, 4057, 4059, 4061, 4063, 4065, 4067,
4069, 4071, 4073, 4075, 4077, 4079, 4081, 4083, 4085, 4087, 4089, 4091, 4093, 4095, 4097, 4099, 4101, 4103, 4105,
4107, 4109, 4111, 4113, 4115, 4117, 4119, 4121, 4123, 4125, 4127, 4129, 4131, 4133, 4135, 4137, 4139, 4141, 4143,
4145, 4147, 4149, 4151, 4153, 4155, 4157, 4159, 4161, 4163, 4165, 4167, 4169, 4171, 4173, 4175, 4177, 4179, 4181,
4183, 4185, 4187, 4189, 4191, 4193, 4195, 4197, 4199, 4201, 4203, 4205, 4207, 4209, 4211, 4213, 4215, 4217, 4219,
4221, 4223, 4225, 4227, 4229, 4231, 4233, 4235, 4237, 4239, 4241, 4243, 4245, 4247, 4249, 4251, 4253, 4255, 4257,
4259, 4261, 4263, 4265, 4267, 4269, 4271, 4273, 4275, 4277, 4279, 4281, 4283, 4285, 4287, 4289, 4291, 4293, 4295,
4297, 4299, 4301, 4303, 4305, 4307, 4309, 4311, 4313, 4315, 4317, 4319, 4321, 4323, 4325, 4327, 4329, 4331, 4333,
4335, 4337, 4339, 4341, 4343, 4345, 4347, 4349, 4351, 4353, 4355, 4357, 4359, 4361, 4363, 4365, 4367, 4369, 4371,
4373, 4375, 4377, 4379, 4381, 4383, 4385, 4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401, 4403, 4405, 4407, 4409,
4411, 4413, 4415, 4417, 4419, 4421, 4423, 4425, 4427, 4429, 4431, 4433, 4435, 4437, 4439, 4441, 4443, 4445, 4447,
4449, 4451, 4453, 4455, 4457, 4459, 4461, 4463, 4465, 4467, 4469, 4471, 4473, 4475, 4477, 4479, 4481, 4483, 4485,
4487, 4489, 4491, 4493, 4495, 4497, 4499, 4501, 4503, 4505, 4507, 4509, 4511, 4513, 4515, 4517, 4519, 4521, 4523,
4525, 4527, 4529, 4531, 4533, 4535, 4537, 4539, 4541, 4543, 4545, 4547, 4549, 4551, 4553, 4555, 4557, 4559, 4561,
4563, 4565, 4567, 4569, 4571, 4573, 4575, 4577, 4579, 4581, 4583, 4585, 4587, 4589, 4591, 4593, 4595, 4597, 4599,
4601, 4603, 4605, 4607, 4609, 4611, 4613, 4615, 4617, 4619, 4621, 4623, 4625, 4627, 4629, 4631, 4633, 4635, 4637,
4639, 4641, 4643, 4645, 4647, 4649, 4651, 4653, 4655, 4657, 4659, 4661, 4663, 4665, 4667, 4669, 4671, 4673, 4675,
4677, 4679, 4681, 4683, 4685, 4687, 4689, 4691, 4693, 4695, 4697, 4699, 4701, 4703, 4705, 4707, 4709, 4711, 4713,
4715, 4717, 4719, 4721, 4723, 4725, 4727, 4729, 4731, 4733, 4735, 4737, 4739, 4741, 4743, 4745, 4747, 4749, 4751,
4753, 4755, 4757, 4759, 4761, 4763, 4765, 4767, 4769, 4771, 4773, 4775, 4777, 4779, 4781, 4783, 4785, 4787, 4789,
4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, 4807, 4809, 4811, 4813, 4815, 4817, 4819, 4821, 4823, 4825, 4827,
4829, 4831, 4833, 4835, 4837, 4839, 4841, 4843, 4845, 4847, 4849, 4851, 4853, 4855, 4857, 4859, 4861, 4863, 4865,
4867, 4869, 4871, 4873, 4875, 4877, 4879, 4881, 4883, 4885, 4887, 4889, 4891, 4893, 4895, 4897, 4899, 4901, 4903,
4905, 4907, 4909, 4911, 4913, 4915, 4917, 4919, 4921, 4923, 4925, 4927, 4929, 4931, 4933, 4935, 4937, 4939, 4941,
4943, 4945, 4947, 4949, 4951, 4953, 4955, 4957, 4959, 4961, 4963, 4965, 4967, 4969, 4971, 4973, 4975, 4977, 4979,
4981, 4983, 4985, 4987, 4989, 4991, 4993, 4995, 4997, 4999, 5001, 5003, 5005, 5007, 5009, 5011, 5013, 5015, 5017,
5019, 5021, 5023, 5025, 5027, 5029, 5031, 5033, 5035, 5037, 5039, 5041, 5043, 5045, 5047, 5049, 5051, 5053, 5055,
5057, 5059, 5061, 5063, 5065, 5067, 5069, 5071, 5073, 5075, 5077, 5079, 5081, 5083, 5085, 5087, 5089, 5091, 5093,
5095, 5097, 5099, 5101, 5103, 5105, 5107, 5109, 5111, 5113, 5115, 5117, 5119, 5121, 5123, 5125, 5127, 5129, 5131,
5133, 5135, 5137, 5139, 5141, 5143, 5145, 5147, 5149, 5151, 5153, 5155, 5157, 5159, 5161, 5163, 5165, 5167, 5169,
5171, 5173, 5175, 5177, 5179, 5181, 5183, 5185, 5187, 5189, 5191, 5193, 5195, 5197, 5199, 5201, 5203, 5205, 5207,
5209, 5211, 5213, 5215, 5217, 5219, 5221, 5223, 5225, 5227, 5229, 5231, 5233, 5235, 5237, 5239, 5241, 5243, 5245,
5247, 5249, 5251, 5253, 5255, 5257, 5259, 5261, 5263, 5265, 5267, 5269, 5271, 5273, 5275, 5277, 5279, 5281, 5283,
5285, 5287, 5289, 5291, 5293, 5295, 5297, 5299, 5301, 5303, 5305, 5307, 5309, 5311, 5313, 5315, 5317, 5319, 5321,
5323, 5325, 5327, 5329, 5331, 5333, 5335, 5337, 5339, 5341, 5343, 5345, 5347, 5349, 5351, 5353, 5355, 5357, 5359,
5361, 5363, 5365, 5367, 5369, 5371, 5373, 5375, 5377, 5379, 5381, 5383, 5385, 5387, 5389, 5391, 5393, 5395, 5397,
5399, 5401, 5403, 5405, 5407, 5409, 5411, 5413, 5415, 5417, 5419, 5421, 5423, 5425, 5427, 5429, 5431, 5433, 5435,
5437, 5439, 5441, 5443, 5445, 5447, 5449, 5451, 5453, 5455, 5457, 5459, 5461, 5463, 5465, 5467, 5469, 5471, 5473,
5475, 5477, 5479, 5481, 5483, 5485, 5487, 5489, 5491, 5493, 5495, 5497, 5499, 5501, 5503, 5505, 5507, 5509, 5511,
5513, 5515, 5517, 5519, 5521, 5523, 5525, 5527, 5529, 5531, 5533, 5535, 5537, 5539, 5541, 5543, 5545, 5547, 5549,
5551, 5553, 5555, 5557, 5559, 5561, 5563, 5565, 5567, 5569, 5571, 5573, 5575, 5577, 5579, 5581, 5583, 5585, 5587,
5589, 5591, 5593, 5595, 5597, 5599, 5601, 5603, 5605, 5607, 5609, 5611, 5613, 5615, 5617, 5619, 5621, 5623, 5625,
5627, 5629, 5631, 5633, 5635, 5637, 5639, 5641, 5643, 5645, 5647, 5649, 5651, 5653, 5655, 5657, 5659, 5661, 5663,
5665, 5667, 5669, 5671, 5673, 5675, 5677, 5679, 5681, 5683, 5685, 5687, 5689, 5691, 5693, 5695, 5697, 5699, 5701,
5703, 5705, 5707, 5709, 5711, 5713, 5715, 5717, 5719, 5721, 5723, 5725, 5727, 5729, 5731, 5733, 5735, 5737, 5739,
5741, 5743, 5745, 5747, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 5763, 5765, 5767, 5769, 5771, 5773, 5775, 5777,
5779, 5781, 5783, 5785, 5787, 5789, 5791, 5793, 5795, 5797, 5799, 5801, 5803, 5805, 5807, 5809, 5811, 5813, 5815,
5817, 5819, 5821, 5823, 5825, 5827, 5829, 5831, 5833, 5835, 5837, 5839, 5841, 5843, 5845, 5847, 5849, 5851, 5853,
5855, 5857, 5859, 5861, 5863, 5865, 5867, 5869, 5871, 5873, 5875, 5877, 5879, 5881, 5883, 5885, 5887, 5889, 5891,
5893, 5895, 5897, 5899, 5901, 5903, 5905, 5907, 5909, 5911, 5913, 5915, 5917, 5919, 5921, 5923, 5925, 5927, 5929,
5931, 5933, 5935, 5937, 5939, 5941, 5943, 5945, 5947, 5949, 5951, 5953, 5955, 5957, 5959, 5961, 5963, 5965, 5967,
5969, 5971, 5973, 5975, 5977, 5979, 5981, 5983, 5985, 5987, 5989, 5991, 5993, 5995, 5997, 5999, 6001, 6003, 6005,
6007, 6009, 6011, 6013, 6015, 6017, 6019, 6021, 6023, 6025, 6027, 6029, 6031, 6033, 6035, 6037, 6039, 6041, 6043,
6045, 6047, 6049, 6051, 6053, 6055, 6057, 6059, 6061, 6063, 6065, 6067, 6069, 6071, 6073, 6075, 6077, 6079, 6081,
6083, 6085, 6087, 6089, 6091, 6093, 6095, 6097, 6099, 6101, 6103, 6105, 6107, 6109, 6111, 6113, 6115, 6117, 6119,
6121, 6123, 6125, 6127, 6129, 6131, 6133, 6135, 6137, 6139, 6141, 6143, 6145, 6147, 6149, 6151, 6153, 6155, 6157,
6159, 6161, 6163, 6165, 6167, 6169, 6171, 6173, 6175, 6177, 6179, 6181, 6183, 6185, 6187, 6189, 6191, 6193, 6195,
6197, 6199, 6201, 6203, 6205, 6207, 6209, 6211, 6213, 6215, 6217, 6219, 6221, 6223, 6225, 6227, 6229, 6231, 6233,
6235, 6237, 6239, 6241, 6243, 6245, 6247, 6249, 6251, 6253, 6255, 6257, 6259, 6261, 6263, 6265, 6267, 6269, 6271,
6273, 6275, 6277, 6279, 6281, 6283, 6285, 6287, 6289, 6291, 6293, 6295, 6297, 6299, 6301, 6303, 6305, 6307, 6309,
6311, 6313, 6315, 6317, 6319, 6321, 6323, 6325, 6327, 6329, 6331, 6333, 6335, 6337, 6339, 6341, 6343, 6345, 6347,
6349, 6351, 6353, 6355, 6357, 6359, 6361, 6363, 6365, 6367, 6369, 6371, 6373, 6375, 6377, 6379, 6381, 6383, 6385,
6387, 6389, 6391, 6393, 6395, 6397, 6399, 6401, 6403, 6405, 6407, 6409, 6411, 6413, 6415, 6417, 6419, 6421, 6423,
6425, 6427, 6429, 6431, 6433, 6435, 6437, 6439, 6441, 6443, 6445, 6447, 6449, 6451, 6453, 6455, 6457, 6459, 6461,
6463, 6465, 6467, 6469, 6471, 6473, 6475, 6477, 6479, 6481, 6483, 6485, 6487, 6489, 6491, 6493, 6495, 6497, 6499,
6501, 6503, 6505, 6507, 6509, 6511, 6513, 6515, 6517, 6519, 6521, 6523, 6525, 6527, 6529, 6531, 6533, 6535, 6537,
6539, 6541, 6543, 6545, 6547, 6549, 6551, 6553, 6555, 6557, 6559, 6561, 6563, 6565, 6567, 6569, 6571, 6573, 6575,
6577, 6579, 6581, 6583, 6585, 6587, 6589, 6591, 6593, 6595, 6597, 6599, 6601, 6603, 6605, 6607, 6609, 6611, 6613,
6615, 6617, 6619, 6621, 6623, 6625, 6627, 6629, 6631, 6633, 6635, 6637, 6639, 6641, 6643, 6645, 6647, 6649, 6651,
6653, 6655, 6657, 6659, 6661, 6663, 6665, 6667, 6669, 6671, 6673, 6675, 6677, 6679, 6681, 6683, 6685, 6687, 6689,
6691, 6693, 6695, 6697, 6699, 6701, 6703, 6705, 6707, 6709, 6711, 6713, 6715, 6717, 6719, 6721, 6723, 6725, 6727,
6729, 6731, 6733, 6735, 6737, 6739, 6741, 6743, 6745, 6747, 6749, 6751, 6753, 6755, 6757, 6759, 6761, 6763, 6765,
6767, 6769, 6771, 6773, 6775, 6777, 6779, 6781, 6783, 6785, 6787, 6789, 6791, 6793, 6795, 6797, 6799, 6801, 6803,
6805, 6807, 6809, 6811, 6813, 6815, 6817, 6819, 6821, 6823, 6825, 6827, 6829, 6831, 6833, 6835, 6837, 6839, 6841,
6843, 6845, 6847, 6849, 6851, 6853, 6855, 6857, 6859, 6861, 6863, 6865, 6867, 6869, 6871, 6873, 6875, 6877, 6879,
6881, 6883, 6885, 6887, 6889, 6891, 6893, 6895, 6897, 6899, 6901, 6903, 6905, 6907, 6909, 6911, 6913, 6915, 6917,
6919, 6921, 6923, 6925, 6927, 6929, 6931, 6933, 6935, 6937, 6939, 6941, 6943, 6945, 6947, 6949, 6951, 6953, 6955,
6957, 6959, 6961, 6963, 6965, 6967, 6969, 6971, 6973, 6975, 6977, 6979, 6981, 6983, 6985, 6987, 6989, 6991, 6993,
6995, 6997, 6999, 7001, 7003, 7005, 7007, 7009, 7011, 7013, 7015, 7017, 7019, 7021, 7023, 7025, 7027, 7029, 7031,
7033, 7035, 7037, 7039, 7041, 7043, 7045, 7047, 7049, 7051, 7053, 7055, 7057, 7059, 7061, 7063, 7065, 7067, 7069,
7071, 7073, 7075, 7077, 7079, 7081, 7083, 7085, 7087, 7089, 7091, 7093, 7095, 7097, 7099, 7101, 7103, 7105, 7107,
7109, 7111, 7113, 7115, 7117, 7119, 7121, 7123, 7125, 7127, 7129, 7131, 7133, 7135, 7137, 7139, 7141, 7143, 7145,
7147, 7149, 7151, 7153, 7155, 7157, 7159, 7161, 7163, 7165, 7167, 7169, 7171, 7173, 7175, 7177, 7179, 7181, 7183,
7185, 7187, 7189, 7191, 7193, 7195, 7197, 7199, 7201, 7203, 7205, 7207, 7209, 7211, 7213, 7215, 7217, 7219, 7221,
7223, 7225, 7227, 7229, 7231, 7233, 7235, 7237, 7239, 7241, 7243, 7245, 7247, 7249, 7251, 7253, 7255, 7257, 7259,
7261, 7263, 7265, 7267, 7269, 7271, 7273, 7275, 7277, 7279, 7281, 7283, 7285, 7287, 7289, 7291, 7293, 7295, 7297,
7299, 7301, 7303, 7305, 7307, 7309, 7311, 7313, 7315, 7317, 7319, 7321, 7323, 7325, 7327, 7329, 7331, 7333, 7335,
7337, 7339, 7341, 7343, 7345, 7347, 7349, 7351, 7353, 7355, 7357, 7359, 7361, 7363, 7365, 7367, 7369, 7371, 7373,
7375, 7377, 7379, 7381, 7383, 7385, 7387, 7389, 7391, 7393, 7395, 7397, 7399, 7401, 7403, 7405, 7407, 7409, 7411,
7413, 7415, 7417, 7419, 7421, 7423, 7425, 7427, 7429, 7431, 7433, 7435, 7437, 7439, 7441, 7443, 7445, 7447, 7449,
7451, 7453, 7455, 7457, 7459, 7461, 7463, 7465, 7467, 7469, 7471, 7473, 7475, 7477, 7479, 7481, 7483, 7485, 7487,
7489, 7491, 7493, 7495, 7497, 7499, 7501, 7503, 7505, 7507, 7509, 7511, 7513, 7515, 7517, 7519, 7521, 7523, 7525,
7527, 7529, 7531, 7533, 7535, 7537, 7539, 7541, 7543, 7545, 7547, 7549, 7551, 7553, 7555, 7557, 7559, 7561, 7563,
7565, 7567, 7569, 7571, 7573, 7575, 7577, 7579, 7581, 7583, 7585, 7587, 7589, 7591, 7593, 7595, 7597, 7599, 7601,
7603, 7605, 7607, 7609, 7611, 7613, 7615, 7617, 7619, 7621, 7623, 7625, 7627, 7629, 7631, 7633, 7635, 7637, 7639,
7641, 7643, 7645, 7647, 7649, 7651, 7653, 7655, 7657, 7659, 7661, 7663, 7665, 7667, 7669, 7671, 7673, 7675, 7677,
7679, 7681, 7683, 7685, 7687, 7689, 7691, 7693, 7695, 7697, 7699, 7701, 7703, 7705, 7707, 7709, 7711, 7713, 7715,
7717, 7719, 7721, 7723, 7725, 7727, 7729, 7731, 7733, 7735, 7737, 7739, 7741, 7743, 7745, 7747, 7749, 7751, 7753,
7755, 7757, 7759, 7761, 7763, 7765, 7767, 7769, 7771, 7773, 7775, 7777, 7779, 7781, 7783, 7785, 7787, 7789, 7791,
7793, 7795, 7797, 7799, 7801, 7803, 7805, 7807, 7809, 7811, 7813, 7815, 7817, 7819, 7821, 7823, 7825, 7827, 7829,
7831, 7833, 7835, 7837, 7839, 7841, 7843, 7845, 7847, 7849, 7851, 7853, 7855, 7857, 7859, 7861, 7863, 7865, 7867,
7869, 7871, 7873, 7875, 7877, 7879, 7881, 7883, 7885, 7887, 7889, 7891, 7893, 7895, 7897, 7899, 7901, 7903, 7905,
7907, 7909, 7911, 7913, 7915, 7917, 7919, 7921, 7923, 7925, 7927, 7929, 7931, 7933, 7935, 7937, 7939, 7941, 7943,
7945, 7947, 7949, 7951, 7953, 7955, 7957, 7959, 7961, 7963, 7965, 7967, 7969, 7971, 7973, 7975, 7977, 7979, 7981,
7983, 7985, 7987, 7989, 7991, 7993, 7995, 7997, 7999, 8001, 8003, 8005, 8007, 8009, 8011, 8013, 8015, 8017, 8019,
8021, 8023, 8025, 8027, 8029, 8031, 8033, 8035, 8037, 8039, 8041, 8043, 8045, 8047, 8049, 8051, 8053, 8055, 8057,
8059, 8061, 8063, 8065, 8067, 8069, 8071, 8073, 8075, 8077, 8079, 8081, 8083, 8085, 8087, 8089, 8091, 8093, 8095,
8097, 8099, 8101, 8103, 8105, 8107, 8109, 8111, 8113, 8115, 8117, 8119, 8121, 8123, 8125, 8127, 8129, 8131, 8133,
8135, 8137, 8139, 8141, 8143, 8145, 8147, 8149, 8151, 8153, 8155, 8157, 8159, 8161, 8163, 8165, 8167, 8169, 8171,
8173, 8175, 8177, 8179, 8181, 8183, 8185, 8187, 8189, 8191, 8193, 8195, 8197, 8199, 8201, 8203, 8205, 8207, 8209,
8211, 8213, 8215, 8217, 8219, 8221, 8223, 8225, 8227, 8229, 8231, 8233, 8235, 8237, 8239, 8241, 8243, 8245, 8247,
8249, 8251, 8253, 8255, 8257, 8259, 8261, 8263, 8265, 8267, 8269, 8271, 8273, 8275, 8277, 8279, 8281, 8283, 8285,
8287, 8289, 8291, 8293, 8295, 8297, 8299, 8301, 8303, 8305, 8307, 8309, 8311, 8313, 8315, 8317, 8319, 8321, 8323,
8325, 8327, 8329, 8331, 8333, 8335, 8337, 8339, 8341, 8343, 8345, 8347, 8349, 8351, 8353, 8355, 8357, 8359, 8361,
8363, 8365, 8367, 8369, 8371, 8373, 8375, 8377, 8379, 8381, 8383, 8385, 8387, 8389, 8391, 8393, 8395, 8397, 8399,
8401, 8403, 8405, 8407, 8409, 8411, 8413, 8415, 8417, 8419, 8421, 8423, 8425, 8427, 8429, 8431, 8433, 8435, 8437,
8439, 8441, 8443, 8445, 8447, 8449, 8451, 8453, 8455, 8457, 8459, 8461, 8463, 8465, 8467, 8469, 8471, 8473, 8475,
8477, 8479, 8481, 8483, 8485, 8487, 8489, 8491, 8493, 8495, 8497, 8499, 8501, 8503, 8505, 8507, 8509, 8511, 8513,
8515, 8517, 8519, 8521, 8523, 8525, 8527, 8529, 8531, 8533, 8535, 8537, 8539, 8541, 8543, 8545, 8547, 8549, 8551,
8553, 8555, 8557, 8559, 8561, 8563, 8565, 8567, 8569, 8571, 8573, 8575, 8577, 8579, 8581, 8583, 8585, 8587, 8589,
8591, 8593, 8595, 8597, 8599, 8601, 8603, 8605, 8607, 8609, 8611, 8613, 8615, 8617, 8619, 8621, 8623, 8625, 8627,
8629, 8631, 8633, 8635, 8637, 8639, 8641, 8643, 8645, 8647, 8649, 8651, 8653, 8655, 8657, 8659, 8661, 8663, 8665,
8667, 8669, 8671, 8673, 8675, 8677, 8679, 8681, 8683, 8685, 8687, 8689, 8691, 8693, 8695, 8697, 8699, 8701, 8703,
8705, 8707, 8709, 8711, 8713, 8715, 8717, 8719, 8721, 8723, 8725, 8727, 8729, 8731, 8733, 8735, 8737, 8739, 8741,
8743, 8745, 8747, 8749, 8751, 8753, 8755, 8757, 8759, 8761, 8763, 8765, 8767, 8769, 8771, 8773, 8775, 8777, 8779,
8781, 8783, 8785, 8787, 8789, 8791, 8793, 8795, 8797, 8799, 8801, 8803, 8805, 8807, 8809, 8811, 8813, 8815, 8817,
8819, 8821, 8823, 8825, 8827, 8829, 8831, 8833, 8835, 8837, 8839, 8841, 8843, 8845, 8847, 8849, 8851, 8853, 8855,
8857, 8859, 8861, 8863, 8865, 8867, 8869, 8871, 8873, 8875, 8877, 8879, 8881, 8883, 8885, 8887, 8889, 8891, 8893,
8895, 8897, 8899, 8901, 8903, 8905, 8907, 8909, 8911, 8913, 8915, 8917, 8919, 8921, 8923, 8925, 8927, 8929, 8931,
8933, 8935, 8937, 8939, 8941, 8943, 8945, 8947, 8949, 8951, 8953, 8955, 8957, 8959, 8961, 8963, 8965, 8967, 8969,
8971, 8973, 8975, 8977, 8979, 8981, 8983, 8985, 8987, 8989, 8991, 8993, 8995, 8997, 8999, 9001, 9003, 9005, 9007,
9009, 9011, 9013, 9015, 9017, 9019, 9021, 9023, 9025, 9027, 9029, 9031, 9033, 9035, 9037, 9039, 9041, 9043, 9045,
9047, 9049, 9051, 9053, 9055, 9057, 9059, 9061, 9063, 9065, 9067, 9069, 9071, 9073, 9075, 9077, 9079, 9081, 9083,
9085, 9087, 9089, 9091, 9093, 9095, 9097, 9099, 9101, 9103, 9105, 9107, 9109, 9111, 9113, 9115, 9117, 9119, 9121,
9123, 9125, 9127, 9129, 9131, 9133, 9135, 9137, 9139, 9141, 9143, 9145, 9147, 9149, 9151, 9153, 9155, 9157, 9159,
9161, 9163, 9165, 9167, 9169, 9171, 9173, 9175, 9177, 9179, 9181, 9183, 9185, 9187, 9189, 9191, 9193, 9195, 9197,
9199, 9201, 9203, 9205, 9207, 9209, 9211, 9213, 9215, 9217, 9219, 9221, 9223, 9225, 9227, 9229, 9231, 9233, 9235,
9237, 9239, 9241, 9243, 9245, 9247, 9249, 9251, 9253, 9255, 9257, 9259, 9261, 9263, 9265, 9267, 9269, 9271, 9273,
9275, 9277, 9279, 9281, 9283, 9285, 9287, 9289, 9291, 9293, 9295, 9297, 9299, 9301, 9303, 9305, 9307, 9309, 9311,
9313, 9315, 9317, 9319, 9321, 9323, 9325, 9327, 9329, 9331, 9333, 9335, 9337, 9339, 9341, 9343, 9345, 9347, 9349,
9351, 9353, 9355, 9357, 9359, 9361, 9363, 9365, 9367, 9369, 9371, 9373, 9375, 9377, 9379, 9381, 9383, 9385, 9387,
9389, 9391, 9393, 9395, 9397, 9399, 9401, 9403, 9405, 9407, 9409, 9411, 9413, 9415, 9417, 9419, 9421, 9423, 9425,
9427, 9429, 9431, 9433, 9435, 9437, 9439, 9441, 9443, 9445, 9447, 9449, 9451, 9453, 9455, 9457, 9459, 9461, 9463,
9465, 9467, 9469, 9471, 9473, 9475, 9477, 9479, 9481, 9483, 9485, 9487, 9489, 9491, 9493, 9495, 9497, 9499, 9501,
9503, 9505, 9507, 9509, 9511, 9513, 9515, 9517, 9519, 9521, 9523, 9525, 9527, 9529, 9531, 9533, 9535, 9537, 9539,
9541, 9543, 9545, 9547, 9549, 9551, 9553, 9555, 9557, 9559, 9561, 9563, 9565, 9567, 9569, 9571, 9573, 9575, 9577,
9579, 9581, 9583, 9585, 9587, 9589, 9591, 9593, 9595, 9597, 9599, 9601, 9603, 9605, 9607, 9609, 9611, 9613, 9615,
9617, 9619, 9621, 9623, 9625, 9627, 9629, 9631, 9633, 9635, 9637, 9639, 9641, 9643, 9645, 9647, 9649, 9651, 9653,
9655, 9657, 9659, 9661, 9663, 9665, 9667, 9669, 9671, 9673, 9675, 9677, 9679, 9681, 9683, 9685, 9687, 9689, 9691,
9693, 9695, 9697, 9699, 9701, 9703, 9705, 9707, 9709, 9711, 9713, 9715, 9717, 9719, 9721, 9723, 9725, 9727, 9729,
9731, 9733, 9735, 9737, 9739, 9741, 9743, 9745, 9747, 9749, 9751, 9753, 9755, 9757, 9759, 9761, 9763, 9765, 9767,
9769, 9771, 9773, 9775, 9777, 9779, 9781, 9783, 9785, 9787, 9789, 9791, 9793, 9795, 9797, 9799, 9801, 9803, 9805,
9807, 9809, 9811, 9813, 9815, 9817, 9819, 9821, 9823, 9825, 9827, 9829, 9831, 9833, 9835, 9837, 9839, 9841, 9843,
9845, 9847, 9849, 9851, 9853, 9855, 9857, 9859, 9861, 9863, 9865, 9867, 9869, 9871, 9873, 9875, 9877, 9879, 9881,
9883, 9885, 9887, 9889, 9891, 9893, 9895, 9897, 9899, 9901, 9903, 9905, 9907, 9909, 9911, 9913, 9915, 9917, 9919,
9921, 9923, 9925, 9927, 9929, 9931, 9933, 9935, 9937, 9939, 9941, 9943, 9945, 9947, 9949, 9951, 9953, 9955, 9957,
9959, 9961, 9963, 9965, 9967, 9969, 9971, 9973, 9975, 9977, 9979, 9981, 9983, 9985, 9987, 9989, 9991, 9993, 9995,
9997, 9999, 4982]
b1 = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112,
114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158,
160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204,
206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250,
252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296,
298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342,
344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388,
390, 392, 394, 396, 398, 400, 402, 404, 406, 408, 410, 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434,
436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, 480,
482, 484, 486, 488, 490, 492, 494, 496, 498, 500, 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526,
528, 530, 532, 534, 536, 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, 566, 568, 570, 572,
574, 576, 578, 580, 582, 584, 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, 610, 612, 614, 616, 618,
620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 662, 664,
666, 668, 670, 672, 674, 676, 678, 680, 682, 684, 686, 688, 690, 692, 694, 696, 698, 700, 702, 704, 706, 708, 710,
712, 714, 716, 718, 720, 722, 724, 726, 728, 730, 732, 734, 736, 738, 740, 742, 744, 746, 748, 750, 752, 754, 756,
758, 760, 762, 764, 766, 768, 770, 772, 774, 776, 778, 780, 782, 784, 786, 788, 790, 792, 794, 796, 798, 800, 802,
804, 806, 808, 810, 812, 814, 816, 818, 820, 822, 824, 826, 828, 830, 832, 834, 836, 838, 840, 842, 844, 846, 848,
850, 852, 854, 856, 858, 860, 862, 864, 866, 868, 870, 872, 874, 876, 878, 880, 882, 884, 886, 888, 890, 892, 894,
896, 898, 900, 902, 904, 906, 908, 910, 912, 914, 916, 918, 920, 922, 924, 926, 928, 930, 932, 934, 936, 938, 940,
942, 944, 946, 948, 950, 952, 954, 956, 958, 960, 962, 964, 966, 968, 970, 972, 974, 976, 978, 980, 982, 984, 986,
988, 990, 992, 994, 996, 998, 1000, 1002, 1004, 1006, 1008, 1010, 1012, 1014, 1016, 1018, 1020, 1022, 1024, 1026,
1028, 1030, 1032, 1034, 1036, 1038, 1040, 1042, 1044, 1046, 1048, 1050, 1052, 1054, 1056, 1058, 1060, 1062, 1064,
1066, 1068, 1070, 1072, 1074, 1076, 1078, 1080, 1082, 1084, 1086, 1088, 1090, 1092, 1094, 1096, 1098, 1100, 1102,
1104, 1106, 1108, 1110, 1112, 1114, 1116, 1118, 1120, 1122, 1124, 1126, 1128, 1130, 1132, 1134, 1136, 1138, 1140,
1142, 1144, 1146, 1148, 1150, 1152, 1154, 1156, 1158, 1160, 1162, 1164, 1166, 1168, 1170, 1172, 1174, 1176, 1178,
1180, 1182, 1184, 1186, 1188, 1190, 1192, 1194, 1196, 1198, 1200, 1202, 1204, 1206, 1208, 1210, 1212, 1214, 1216,
1218, 1220, 1222, 1224, 1226, 1228, 1230, 1232, 1234, 1236, 1238, 1240, 1242, 1244, 1246, 1248, 1250, 1252, 1254,
1256, 1258, 1260, 1262, 1264, 1266, 1268, 1270, 1272, 1274, 1276, 1278, 1280, 1282, 1284, 1286, 1288, 1290, 1292,
1294, 1296, 1298, 1300, 1302, 1304, 1306, 1308, 1310, 1312, 1314, 1316, 1318, 1320, 1322, 1324, 1326, 1328, 1330,
1332, 1334, 1336, 1338, 1340, 1342, 1344, 1346, 1348, 1350, 1352, 1354, 1356, 1358, 1360, 1362, 1364, 1366, 1368,
1370, 1372, 1374, 1376, 1378, 1380, 1382, 1384, 1386, 1388, 1390, 1392, 1394, 1396, 1398, 1400, 1402, 1404, 1406,
1408, 1410, 1412, 1414, 1416, 1418, 1420, 1422, 1424, 1426, 1428, 1430, 1432, 1434, 1436, 1438, 1440, 1442, 1444,
1446, 1448, 1450, 1452, 1454, 1456, 1458, 1460, 1462, 1464, 1466, 1468, 1470, 1472, 1474, 1476, 1478, 1480, 1482,
1484, 1486, 1488, 1490, 1492, 1494, 1496, 1498, 1500, 1502, 1504, 1506, 1508, 1510, 1512, 1514, 1516, 1518, 1520,
1522, 1524, 1526, 1528, 1530, 1532, 1534, 1536, 1538, 1540, 1542, 1544, 1546, 1548, 1550, 1552, 1554, 1556, 1558,
1560, 1562, 1564, 1566, 1568, 1570, 1572, 1574, 1576, 1578, 1580, 1582, 1584, 1586, 1588, 1590, 1592, 1594, 1596,
1598, 1600, 1602, 1604, 1606, 1608, 1610, 1612, 1614, 1616, 1618, 1620, 1622, 1624, 1626, 1628, 1630, 1632, 1634,
1636, 1638, 1640, 1642, 1644, 1646, 1648, 1650, 1652, 1654, 1656, 1658, 1660, 1662, 1664, 1666, 1668, 1670, 1672,
1674, 1676, 1678, 1680, 1682, 1684, 1686, 1688, 1690, 1692, 1694, 1696, 1698, 1700, 1702, 1704, 1706, 1708, 1710,
1712, 1714, 1716, 1718, 1720, 1722, 1724, 1726, 1728, 1730, 1732, 1734, 1736, 1738, 1740, 1742, 1744, 1746, 1748,
1750, 1752, 1754, 1756, 1758, 1760, 1762, 1764, 1766, 1768, 1770, 1772, 1774, 1776, 1778, 1780, 1782, 1784, 1786,
1788, 1790, 1792, 1794, 1796, 1798, 1800, 1802, 1804, 1806, 1808, 1810, 1812, 1814, 1816, 1818, 1820, 1822, 1824,
1826, 1828, 1830, 1832, 1834, 1836, 1838, 1840, 1842, 1844, 1846, 1848, 1850, 1852, 1854, 1856, 1858, 1860, 1862,
1864, 1866, 1868, 1870, 1872, 1874, 1876, 1878, 1880, 1882, 1884, 1886, 1888, 1890, 1892, 1894, 1896, 1898, 1900,
1902, 1904, 1906, 1908, 1910, 1912, 1914, 1916, 1918, 1920, 1922, 1924, 1926, 1928, 1930, 1932, 1934, 1936, 1938,
1940, 1942, 1944, 1946, 1948, 1950, 1952, 1954, 1956, 1958, 1960, 1962, 1964, 1966, 1968, 1970, 1972, 1974, 1976,
1978, 1980, 1982, 1984, 1986, 1988, 1990, 1992, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014,
2016, 2018, 2020, 2022, 2024, 2026, 2028, 2030, 2032, 2034, 2036, 2038, 2040, 2042, 2044, 2046, 2048, 2050, 2052,
2054, 2056, 2058, 2060, 2062, 2064, 2066, 2068, 2070, 2072, 2074, 2076, 2078, 2080, 2082, 2084, 2086, 2088, 2090,
2092, 2094, 2096, 2098, 2100, 2102, 2104, 2106, 2108, 2110, 2112, 2114, 2116, 2118, 2120, 2122, 2124, 2126, 2128,
2130, 2132, 2134, 2136, 2138, 2140, 2142, 2144, 2146, 2148, 2150, 2152, 2154, 2156, 2158, 2160, 2162, 2164, 2166,
2168, 2170, 2172, 2174, 2176, 2178, 2180, 2182, 2184, 2186, 2188, 2190, 2192, 2194, 2196, 2198, 2200, 2202, 2204,
2206, 2208, 2210, 2212, 2214, 2216, 2218, 2220, 2222, 2224, 2226, 2228, 2230, 2232, 2234, 2236, 2238, 2240, 2242,
2244, 2246, 2248, 2250, 2252, 2254, 2256, 2258, 2260, 2262, 2264, 2266, 2268, 2270, 2272, 2274, 2276, 2278, 2280,
2282, 2284, 2286, 2288, 2290, 2292, 2294, 2296, 2298, 2300, 2302, 2304, 2306, 2308, 2310, 2312, 2314, 2316, 2318,
2320, 2322, 2324, 2326, 2328, 2330, 2332, 2334, 2336, 2338, 2340, 2342, 2344, 2346, 2348, 2350, 2352, 2354, 2356,
2358, 2360, 2362, 2364, 2366, 2368, 2370, 2372, 2374, 2376, 2378, 2380, 2382, 2384, 2386, 2388, 2390, 2392, 2394,
2396, 2398, 2400, 2402, 2404, 2406, 2408, 2410, 2412, 2414, 2416, 2418, 2420, 2422, 2424, 2426, 2428, 2430, 2432,
2434, 2436, 2438, 2440, 2442, 2444, 2446, 2448, 2450, 2452, 2454, 2456, 2458, 2460, 2462, 2464, 2466, 2468, 2470,
2472, 2474, 2476, 2478, 2480, 2482, 2484, 2486, 2488, 2490, 2492, 2494, 2496, 2498, 2500, 2502, 2504, 2506, 2508,
2510, 2512, 2514, 2516, 2518, 2520, 2522, 2524, 2526, 2528, 2530, 2532, 2534, 2536, 2538, 2540, 2542, 2544, 2546,
2548, 2550, 2552, 2554, 2556, 2558, 2560, 2562, 2564, 2566, 2568, 2570, 2572, 2574, 2576, 2578, 2580, 2582, 2584,
2586, 2588, 2590, 2592, 2594, 2596, 2598, 2600, 2602, 2604, 2606, 2608, 2610, 2612, 2614, 2616, 2618, 2620, 2622,
2624, 2626, 2628, 2630, 2632, 2634, 2636, 2638, 2640, 2642, 2644, 2646, 2648, 2650, 2652, 2654, 2656, 2658, 2660,
2662, 2664, 2666, 2668, 2670, 2672, 2674, 2676, 2678, 2680, 2682, 2684, 2686, 2688, 2690, 2692, 2694, 2696, 2698,
2700, 2702, 2704, 2706, 2708, 2710, 2712, 2714, 2716, 2718, 2720, 2722, 2724, 2726, 2728, 2730, 2732, 2734, 2736,
2738, 2740, 2742, 2744, 2746, 2748, 2750, 2752, 2754, 2756, 2758, 2760, 2762, 2764, 2766, 2768, 2770, 2772, 2774,
2776, 2778, 2780, 2782, 2784, 2786, 2788, 2790, 2792, 2794, 2796, 2798, 2800, 2802, 2804, 2806, 2808, 2810, 2812,
2814, 2816, 2818, 2820, 2822, 2824, 2826, 2828, 2830, 2832, 2834, 2836, 2838, 2840, 2842, 2844, 2846, 2848, 2850,
2852, 2854, 2856, 2858, 2860, 2862, 2864, 2866, 2868, 2870, 2872, 2874, 2876, 2878, 2880, 2882, 2884, 2886, 2888,
2890, 2892, 2894, 2896, 2898, 2900, 2902, 2904, 2906, 2908, 2910, 2912, 2914, 2916, 2918, 2920, 2922, 2924, 2926,
2928, 2930, 2932, 2934, 2936, 2938, 2940, 2942, 2944, 2946, 2948, 2950, 2952, 2954, 2956, 2958, 2960, 2962, 2964,
2966, 2968, 2970, 2972, 2974, 2976, 2978, 2980, 2982, 2984, 2986, 2988, 2990, 2992, 2994, 2996, 2998, 3000, 3002,
3004, 3006, 3008, 3010, 3012, 3014, 3016, 3018, 3020, 3022, 3024, 3026, 3028, 3030, 3032, 3034, 3036, 3038, 3040,
3042, 3044, 3046, 3048, 3050, 3052, 3054, 3056, 3058, 3060, 3062, 3064, 3066, 3068, 3070, 3072, 3074, 3076, 3078,
3080, 3082, 3084, 3086, 3088, 3090, 3092, 3094, 3096, 3098, 3100, 3102, 3104, 3106, 3108, 3110, 3112, 3114, 3116,
3118, 3120, 3122, 3124, 3126, 3128, 3130, 3132, 3134, 3136, 3138, 3140, 3142, 3144, 3146, 3148, 3150, 3152, 3154,
3156, 3158, 3160, 3162, 3164, 3166, 3168, 3170, 3172, 3174, 3176, 3178, 3180, 3182, 3184, 3186, 3188, 3190, 3192,
3194, 3196, 3198, 3200, 3202, 3204, 3206, 3208, 3210, 3212, 3214, 3216, 3218, 3220, 3222, 3224, 3226, 3228, 3230,
3232, 3234, 3236, 3238, 3240, 3242, 3244, 3246, 3248, 3250, 3252, 3254, 3256, 3258, 3260, 3262, 3264, 3266, 3268,
3270, 3272, 3274, 3276, 3278, 3280, 3282, 3284, 3286, 3288, 3290, 3292, 3294, 3296, 3298, 3300, 3302, 3304, 3306,
3308, 3310, 3312, 3314, 3316, 3318, 3320, 3322, 3324, 3326, 3328, 3330, 3332, 3334, 3336, 3338, 3340, 3342, 3344,
3346, 3348, 3350, 3352, 3354, 3356, 3358, 3360, 3362, 3364, 3366, 3368, 3370, 3372, 3374, 3376, 3378, 3380, 3382,
3384, 3386, 3388, 3390, 3392, 3394, 3396, 3398, 3400, 3402, 3404, 3406, 3408, 3410, 3412, 3414, 3416, 3418, 3420,
3422, 3424, 3426, 3428, 3430, 3432, 3434, 3436, 3438, 3440, 3442, 3444, 3446, 3448, 3450, 3452, 3454, 3456, 3458,
3460, 3462, 3464, 3466, 3468, 3470, 3472, 3474, 3476, 3478, 3480, 3482, 3484, 3486, 3488, 3490, 3492, 3494, 3496,
3498, 3500, 3502, 3504, 3506, 3508, 3510, 3512, 3514, 3516, 3518, 3520, 3522, 3524, 3526, 3528, 3530, 3532, 3534,
3536, 3538, 3540, 3542, 3544, 3546, 3548, 3550, 3552, 3554, 3556, 3558, 3560, 3562, 3564, 3566, 3568, 3570, 3572,
3574, 3576, 3578, 3580, 3582, 3584, 3586, 3588, 3590, 3592, 3594, 3596, 3598, 3600, 3602, 3604, 3606, 3608, 3610,
3612, 3614, 3616, 3618, 3620, 3622, 3624, 3626, 3628, 3630, 3632, 3634, 3636, 3638, 3640, 3642, 3644, 3646, 3648,
3650, 3652, 3654, 3656, 3658, 3660, 3662, 3664, 3666, 3668, 3670, 3672, 3674, 3676, 3678, 3680, 3682, 3684, 3686,
3688, 3690, 3692, 3694, 3696, 3698, 3700, 3702, 3704, 3706, 3708, 3710, 3712, 3714, 3716, 3718, 3720, 3722, 3724,
3726, 3728, 3730, 3732, 3734, 3736, 3738, 3740, 3742, 3744, 3746, 3748, 3750, 3752, 3754, 3756, 3758, 3760, 3762,
3764, 3766, 3768, 3770, 3772, 3774, 3776, 3778, 3780, 3782, 3784, 3786, 3788, 3790, 3792, 3794, 3796, 3798, 3800,
3802, 3804, 3806, 3808, 3810, 3812, 3814, 3816, 3818, 3820, 3822, 3824, 3826, 3828, 3830, 3832, 3834, 3836, 3838,
3840, 3842, 3844, 3846, 3848, 3850, 3852, 3854, 3856, 3858, 3860, 3862, 3864, 3866, 3868, 3870, 3872, 3874, 3876,
3878, 3880, 3882, 3884, 3886, 3888, 3890, 3892, 3894, 3896, 3898, 3900, 3902, 3904, 3906, 3908, 3910, 3912, 3914,
3916, 3918, 3920, 3922, 3924, 3926, 3928, 3930, 3932, 3934, 3936, 3938, 3940, 3942, 3944, 3946, 3948, 3950, 3952,
3954, 3956, 3958, 3960, 3962, 3964, 3966, 3968, 3970, 3972, 3974, 3976, 3978, 3980, 3982, 3984, 3986, 3988, 3990,
3992, 3994, 3996, 3998, 4000, 4002, 4004, 4006, 4008, 4010, 4012, 4014, 4016, 4018, 4020, 4022, 4024, 4026, 4028,
4030, 4032, 4034, 4036, 4038, 4040, 4042, 4044, 4046, 4048, 4050, 4052, 4054, 4056, 4058, 4060, 4062, 4064, 4066,
4068, 4070, 4072, 4074, 4076, 4078, 4080, 4082, 4084, 4086, 4088, 4090, 4092, 4094, 4096, 4098, 4100, 4102, 4104,
4106, 4108, 4110, 4112, 4114, 4116, 4118, 4120, 4122, 4124, 4126, 4128, 4130, 4132, 4134, 4136, 4138, 4140, 4142,
4144, 4146, 4148, 4150, 4152, 4154, 4156, 4158, 4160, 4162, 4164, 4166, 4168, 4170, 4172, 4174, 4176, 4178, 4180,
4182, 4184, 4186, 4188, 4190, 4192, 4194, 4196, 4198, 4200, 4202, 4204, 4206, 4208, 4210, 4212, 4214, 4216, 4218,
4220, 4222, 4224, 4226, 4228, 4230, 4232, 4234, 4236, 4238, 4240, 4242, 4244, 4246, 4248, 4250, 4252, 4254, 4256,
4258, 4260, 4262, 4264, 4266, 4268, 4270, 4272, 4274, 4276, 4278, 4280, 4282, 4284, 4286, 4288, 4290, 4292, 4294,
4296, 4298, 4300, 4302, 4304, 4306, 4308, 4310, 4312, 4314, 4316, 4318, 4320, 4322, 4324, 4326, 4328, 4330, 4332,
4334, 4336, 4338, 4340, 4342, 4344, 4346, 4348, 4350, 4352, 4354, 4356, 4358, 4360, 4362, 4364, 4366, 4368, 4370,
4372, 4374, 4376, 4378, 4380, 4382, 4384, 4386, 4388, 4390, 4392, 4394, 4396, 4398, 4400, 4402, 4404, 4406, 4408,
4410, 4412, 4414, 4416, 4418, 4420, 4422, 4424, 4426, 4428, 4430, 4432, 4434, 4436, 4438, 4440, 4442, 4444, 4446,
4448, 4450, 4452, 4454, 4456, 4458, 4460, 4462, 4464, 4466, 4468, 4470, 4472, 4474, 4476, 4478, 4480, 4482, 4484,
4486, 4488, 4490, 4492, 4494, 4496, 4498, 4500, 4502, 4504, 4506, 4508, 4510, 4512, 4514, 4516, 4518, 4520, 4522,
4524, 4526, 4528, 4530, 4532, 4534, 4536, 4538, 4540, 4542, 4544, 4546, 4548, 4550, 4552, 4554, 4556, 4558, 4560,
4562, 4564, 4566, 4568, 4570, 4572, 4574, 4576, 4578, 4580, 4582, 4584, 4586, 4588, 4590, 4592, 4594, 4596, 4598,
4600, 4602, 4604, 4606, 4608, 4610, 4612, 4614, 4616, 4618, 4620, 4622, 4624, 4626, 4628, 4630, 4632, 4634, 4636,
4638, 4640, 4642, 4644, 4646, 4648, 4650, 4652, 4654, 4656, 4658, 4660, 4662, 4664, 4666, 4668, 4670, 4672, 4674,
4676, 4678, 4680, 4682, 4684, 4686, 4688, 4690, 4692, 4694, 4696, 4698, 4700, 4702, 4704, 4706, 4708, 4710, 4712,
4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4740, 4742, 4744, 4746, 4748, 4750,
4752, 4754, 4756, 4758, 4760, 4762, 4764, 4766, 4768, 4770, 4772, 4774, 4776, 4778, 4780, 4782, 4784, 4786, 4788,
4790, 4792, 4794, 4796, 4798, 4800, 4802, 4804, 4806, 4808, 4810, 4812, 4814, 4816, 4818, 4820, 4822, 4824, 4826,
4828, 4830, 4832, 4834, 4836, 4838, 4840, 4842, 4844, 4846, 4848, 4850, 4852, 4854, 4856, 4858, 4860, 4862, 4864,
4866, 4868, 4870, 4872, 4874, 4876, 4878, 4880, 4882, 4884, 4886, 4888, 4890, 4892, 4894, 4896, 4898, 4900, 4902,
4904, 4906, 4908, 4910, 4912, 4914, 4916, 4918, 4920, 4922, 4924, 4926, 4928, 4930, 4932, 4934, 4936, 4938, 4940,
4942, 4944, 4946, 4948, 4950, 4952, 4954, 4956, 4958, 4960, 4962, 4964, 4966, 4968, 4970, 4972, 4974, 4976, 4978,
4980, 4982, 4984, 4986, 4988, 4990, 4992, 4994, 4996, 4998, 5000, 5002, 5004, 5006, 5008, 5010, 5012, 5014, 5016,
5018, 5020, 5022, 5024, 5026, 5028, 5030, 5032, 5034, 5036, 5038, 5040, 5042, 5044, 5046, 5048, 5050, 5052, 5054,
5056, 5058, 5060, 5062, 5064, 5066, 5068, 5070, 5072, 5074, 5076, 5078, 5080, 5082, 5084, 5086, 5088, 5090, 5092,
5094, 5096, 5098, 5100, 5102, 5104, 5106, 5108, 5110, 5112, 5114, 5116, 5118, 5120, 5122, 5124, 5126, 5128, 5130,
5132, 5134, 5136, 5138, 5140, 5142, 5144, 5146, 5148, 5150, 5152, 5154, 5156, 5158, 5160, 5162, 5164, 5166, 5168,
5170, 5172, 5174, 5176, 5178, 5180, 5182, 5184, 5186, 5188, 5190, 5192, 5194, 5196, 5198, 5200, 5202, 5204, 5206,
5208, 5210, 5212, 5214, 5216, 5218, 5220, 5222, 5224, 5226, 5228, 5230, 5232, 5234, 5236, 5238, 5240, 5242, 5244,
5246, 5248, 5250, 5252, 5254, 5256, 5258, 5260, 5262, 5264, 5266, 5268, 5270, 5272, 5274, 5276, 5278, 5280, 5282,
5284, 5286, 5288, 5290, 5292, 5294, 5296, 5298, 5300, 5302, 5304, 5306, 5308, 5310, 5312, 5314, 5316, 5318, 5320,
5322, 5324, 5326, 5328, 5330, 5332, 5334, 5336, 5338, 5340, 5342, 5344, 5346, 5348, 5350, 5352, 5354, 5356, 5358,
5360, 5362, 5364, 5366, 5368, 5370, 5372, 5374, 5376, 5378, 5380, 5382, 5384, 5386, 5388, 5390, 5392, 5394, 5396,
5398, 5400, 5402, 5404, 5406, 5408, 5410, 5412, 5414, 5416, 5418, 5420, 5422, 5424, 5426, 5428, 5430, 5432, 5434,
5436, 5438, 5440, 5442, 5444, 5446, 5448, 5450, 5452, 5454, 5456, 5458, 5460, 5462, 5464, 5466, 5468, 5470, 5472,
5474, 5476, 5478, 5480, 5482, 5484, 5486, 5488, 5490, 5492, 5494, 5496, 5498, 5500, 5502, 5504, 5506, 5508, 5510,
5512, 5514, 5516, 5518, 5520, 5522, 5524, 5526, 5528, 5530, 5532, 5534, 5536, 5538, 5540, 5542, 5544, 5546, 5548,
5550, 5552, 5554, 5556, 5558, 5560, 5562, 5564, 5566, 5568, 5570, 5572, 5574, 5576, 5578, 5580, 5582, 5584, 5586,
5588, 5590, 5592, 5594, 5596, 5598, 5600, 5602, 5604, 5606, 5608, 5610, 5612, 5614, 5616, 5618, 5620, 5622, 5624,
5626, 5628, 5630, 5632, 5634, 5636, 5638, 5640, 5642, 5644, 5646, 5648, 5650, 5652, 5654, 5656, 5658, 5660, 5662,
5664, 5666, 5668, 5670, 5672, 5674, 5676, 5678, 5680, 5682, 5684, 5686, 5688, 5690, 5692, 5694, 5696, 5698, 5700,
5702, 5704, 5706, 5708, 5710, 5712, 5714, 5716, 5718, 5720, 5722, 5724, 5726, 5728, 5730, 5732, 5734, 5736, 5738,
5740, 5742, 5744, 5746, 5748, 5750, 5752, 5754, 5756, 5758, 5760, 5762, 5764, 5766, 5768, 5770, 5772, 5774, 5776,
5778, 5780, 5782, 5784, 5786, 5788, 5790, 5792, 5794, 5796, 5798, 5800, 5802, 5804, 5806, 5808, 5810, 5812, 5814,
5816, 5818, 5820, 5822, 5824, 5826, 5828, 5830, 5832, 5834, 5836, 5838, 5840, 5842, 5844, 5846, 5848, 5850, 5852,
5854, 5856, 5858, 5860, 5862, 5864, 5866, 5868, 5870, 5872, 5874, 5876, 5878, 5880, 5882, 5884, 5886, 5888, 5890,
5892, 5894, 5896, 5898, 5900, 5902, 5904, 5906, 5908, 5910, 5912, 5914, 5916, 5918, 5920, 5922, 5924, 5926, 5928,
5930, 5932, 5934, 5936, 5938, 5940, 5942, 5944, 5946, 5948, 5950, 5952, 5954, 5956, 5958, 5960, 5962, 5964, 5966,
5968, 5970, 5972, 5974, 5976, 5978, 5980, 5982, 5984, 5986, 5988, 5990, 5992, 5994, 5996, 5998, 6000, 6002, 6004,
6006, 6008, 6010, 6012, 6014, 6016, 6018, 6020, 6022, 6024, 6026, 6028, 6030, 6032, 6034, 6036, 6038, 6040, 6042,
6044, 6046, 6048, 6050, 6052, 6054, 6056, 6058, 6060, 6062, 6064, 6066, 6068, 6070, 6072, 6074, 6076, 6078, 6080,
6082, 6084, 6086, 6088, 6090, 6092, 6094, 6096, 6098, 6100, 6102, 6104, 6106, 6108, 6110, 6112, 6114, 6116, 6118,
6120, 6122, 6124, 6126, 6128, 6130, 6132, 6134, 6136, 6138, 6140, 6142, 6144, 6146, 6148, 6150, 6152, 6154, 6156,
6158, 6160, 6162, 6164, 6166, 6168, 6170, 6172, 6174, 6176, 6178, 6180, 6182, 6184, 6186, 6188, 6190, 6192, 6194,
6196, 6198, 6200, 6202, 6204, 6206, 6208, 6210, 6212, 6214, 6216, 6218, 6220, 6222, 6224, 6226, 6228, 6230, 6232,
6234, 6236, 6238, 6240, 6242, 6244, 6246, 6248, 6250, 6252, 6254, 6256, 6258, 6260, 6262, 6264, 6266, 6268, 6270,
6272, 6274, 6276, 6278, 6280, 6282, 6284, 6286, 6288, 6290, 6292, 6294, 6296, 6298, 6300, 6302, 6304, 6306, 6308,
6310, 6312, 6314, 6316, 6318, 6320, 6322, 6324, 6326, 6328, 6330, 6332, 6334, 6336, 6338, 6340, 6342, 6344, 6346,
6348, 6350, 6352, 6354, 6356, 6358, 6360, 6362, 6364, 6366, 6368, 6370, 6372, 6374, 6376, 6378, 6380, 6382, 6384,
6386, 6388, 6390, 6392, 6394, 6396, 6398, 6400, 6402, 6404, 6406, 6408, 6410, 6412, 6414, 6416, 6418, 6420, 6422,
6424, 6426, 6428, 6430, 6432, 6434, 6436, 6438, 6440, 6442, 6444, 6446, 6448, 6450, 6452, 6454, 6456, 6458, 6460,
6462, 6464, 6466, 6468, 6470, 6472, 6474, 6476, 6478, 6480, 6482, 6484, 6486, 6488, 6490, 6492, 6494, 6496, 6498,
6500, 6502, 6504, 6506, 6508, 6510, 6512, 6514, 6516, 6518, 6520, 6522, 6524, 6526, 6528, 6530, 6532, 6534, 6536,
6538, 6540, 6542, 6544, 6546, 6548, 6550, 6552, 6554, 6556, 6558, 6560, 6562, 6564, 6566, 6568, 6570, 6572, 6574,
6576, 6578, 6580, 6582, 6584, 6586, 6588, 6590, 6592, 6594, 6596, 6598, 6600, 6602, 6604, 6606, 6608, 6610, 6612,
6614, 6616, 6618, 6620, 6622, 6624, 6626, 6628, 6630, 6632, 6634, 6636, 6638, 6640, 6642, 6644, 6646, 6648, 6650,
6652, 6654, 6656, 6658, 6660, 6662, 6664, 6666, 6668, 6670, 6672, 6674, 6676, 6678, 6680, 6682, 6684, 6686, 6688,
6690, 6692, 6694, 6696, 6698, 6700, 6702, 6704, 6706, 6708, 6710, 6712, 6714, 6716, 6718, 6720, 6722, 6724, 6726,
6728, 6730, 6732, 6734, 6736, 6738, 6740, 6742, 6744, 6746, 6748, 6750, 6752, 6754, 6756, 6758, 6760, 6762, 6764,
6766, 6768, 6770, 6772, 6774, 6776, 6778, 6780, 6782, 6784, 6786, 6788, 6790, 6792, 6794, 6796, 6798, 6800, 6802,
6804, 6806, 6808, 6810, 6812, 6814, 6816, 6818, 6820, 6822, 6824, 6826, 6828, 6830, 6832, 6834, 6836, 6838, 6840,
6842, 6844, 6846, 6848, 6850, 6852, 6854, 6856, 6858, 6860, 6862, 6864, 6866, 6868, 6870, 6872, 6874, 6876, 6878,
6880, 6882, 6884, 6886, 6888, 6890, 6892, 6894, 6896, 6898, 6900, 6902, 6904, 6906, 6908, 6910, 6912, 6914, 6916,
6918, 6920, 6922, 6924, 6926, 6928, 6930, 6932, 6934, 6936, 6938, 6940, 6942, 6944, 6946, 6948, 6950, 6952, 6954,
6956, 6958, 6960, 6962, 6964, 6966, 6968, 6970, 6972, 6974, 6976, 6978, 6980, 6982, 6984, 6986, 6988, 6990, 6992,
6994, 6996, 6998, 7000, 7002, 7004, 7006, 7008, 7010, 7012, 7014, 7016, 7018, 7020, 7022, 7024, 7026, 7028, 7030,
7032, 7034, 7036, 7038, 7040, 7042, 7044, 7046, 7048, 7050, 7052, 7054, 7056, 7058, 7060, 7062, 7064, 7066, 7068,
7070, 7072, 7074, 7076, 7078, 7080, 7082, 7084, 7086, 7088, 7090, 7092, 7094, 7096, 7098, 7100, 7102, 7104, 7106,
7108, 7110, 7112, 7114, 7116, 7118, 7120, 7122, 7124, 7126, 7128, 7130, 7132, 7134, 7136, 7138, 7140, 7142, 7144,
7146, 7148, 7150, 7152, 7154, 7156, 7158, 7160, 7162, 7164, 7166, 7168, 7170, 7172, 7174, 7176, 7178, 7180, 7182,
7184, 7186, 7188, 7190, 7192, 7194, 7196, 7198, 7200, 7202, 7204, 7206, 7208, 7210, 7212, 7214, 7216, 7218, 7220,
7222, 7224, 7226, 7228, 7230, 7232, 7234, 7236, 7238, 7240, 7242, 7244, 7246, 7248, 7250, 7252, 7254, 7256, 7258,
7260, 7262, 7264, 7266, 7268, 7270, 7272, 7274, 7276, 7278, 7280, 7282, 7284, 7286, 7288, 7290, 7292, 7294, 7296,
7298, 7300, 7302, 7304, 7306, 7308, 7310, 7312, 7314, 7316, 7318, 7320, 7322, 7324, 7326, 7328, 7330, 7332, 7334,
7336, 7338, 7340, 7342, 7344, 7346, 7348, 7350, 7352, 7354, 7356, 7358, 7360, 7362, 7364, 7366, 7368, 7370, 7372,
7374, 7376, 7378, 7380, 7382, 7384, 7386, 7388, 7390, 7392, 7394, 7396, 7398, 7400, 7402, 7404, 7406, 7408, 7410,
7412, 7414, 7416, 7418, 7420, 7422, 7424, 7426, 7428, 7430, 7432, 7434, 7436, 7438, 7440, 7442, 7444, 7446, 7448,
7450, 7452, 7454, 7456, 7458, 7460, 7462, 7464, 7466, 7468, 7470, 7472, 7474, 7476, 7478, 7480, 7482, 7484, 7486,
7488, 7490, 7492, 7494, 7496, 7498, 7500, 7502, 7504, 7506, 7508, 7510, 7512, 7514, 7516, 7518, 7520, 7522, 7524,
7526, 7528, 7530, 7532, 7534, 7536, 7538, 7540, 7542, 7544, 7546, 7548, 7550, 7552, 7554, 7556, 7558, 7560, 7562,
7564, 7566, 7568, 7570, 7572, 7574, 7576, 7578, 7580, 7582, 7584, 7586, 7588, 7590, 7592, 7594, 7596, 7598, 7600,
7602, 7604, 7606, 7608, 7610, 7612, 7614, 7616, 7618, 7620, 7622, 7624, 7626, 7628, 7630, 7632, 7634, 7636, 7638,
7640, 7642, 7644, 7646, 7648, 7650, 7652, 7654, 7656, 7658, 7660, 7662, 7664, 7666, 7668, 7670, 7672, 7674, 7676,
7678, 7680, 7682, 7684, 7686, 7688, 7690, 7692, 7694, 7696, 7698, 7700, 7702, 7704, 7706, 7708, 7710, 7712, 7714,
7716, 7718, 7720, 7722, 7724, 7726, 7728, 7730, 7732, 7734, 7736, 7738, 7740, 7742, 7744, 7746, 7748, 7750, 7752,
7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774, 7776, 7778, 7780, 7782, 7784, 7786, 7788, 7790,
7792, 7794, 7796, 7798, 7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822, 7824, 7826, 7828,
7830, 7832, 7834, 7836, 7838, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856, 7858, 7860, 7862, 7864, 7866,
7868, 7870, 7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892, 7894, 7896, 7898, 7900, 7902, 7904,
7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 7922, 7924, 7926, 7928, 7930, 7932, 7934, 7936, 7938, 7940, 7942,
7944, 7946, 7948, 7950, 7952, 7954, 7956, 7958, 7960, 7962, 7964, 7966, 7968, 7970, 7972, 7974, 7976, 7978, 7980,
7982, 7984, 7986, 7988, 7990, 7992, 7994, 7996, 7998, 8000, 8002, 8004, 8006, 8008, 8010, 8012, 8014, 8016, 8018,
8020, 8022, 8024, 8026, 8028, 8030, 8032, 8034, 8036, 8038, 8040, 8042, 8044, 8046, 8048, 8050, 8052, 8054, 8056,
8058, 8060, 8062, 8064, 8066, 8068, 8070, 8072, 8074, 8076, 8078, 8080, 8082, 8084, 8086, 8088, 8090, 8092, 8094,
8096, 8098, 8100, 8102, 8104, 8106, 8108, 8110, 8112, 8114, 8116, 8118, 8120, 8122, 8124, 8126, 8128, 8130, 8132,
8134, 8136, 8138, 8140, 8142, 8144, 8146, 8148, 8150, 8152, 8154, 8156, 8158, 8160, 8162, 8164, 8166, 8168, 8170,
8172, 8174, 8176, 8178, 8180, 8182, 8184, 8186, 8188, 8190, 8192, 8194, 8196, 8198, 8200, 8202, 8204, 8206, 8208,
8210, 8212, 8214, 8216, 8218, 8220, 8222, 8224, 8226, 8228, 8230, 8232, 8234, 8236, 8238, 8240, 8242, 8244, 8246,
8248, 8250, 8252, 8254, 8256, 8258, 8260, 8262, 8264, 8266, 8268, 8270, 8272, 8274, 8276, 8278, 8280, 8282, 8284,
8286, 8288, 8290, 8292, 8294, 8296, 8298, 8300, 8302, 8304, 8306, 8308, 8310, 8312, 8314, 8316, 8318, 8320, 8322,
8324, 8326, 8328, 8330, 8332, 8334, 8336, 8338, 8340, 8342, 8344, 8346, 8348, 8350, 8352, 8354, 8356, 8358, 8360,
8362, 8364, 8366, 8368, 8370, 8372, 8374, 8376, 8378, 8380, 8382, 8384, 8386, 8388, 8390, 8392, 8394, 8396, 8398,
8400, 8402, 8404, 8406, 8408, 8410, 8412, 8414, 8416, 8418, 8420, 8422, 8424, 8426, 8428, 8430, 8432, 8434, 8436,
8438, 8440, 8442, 8444, 8446, 8448, 8450, 8452, 8454, 8456, 8458, 8460, 8462, 8464, 8466, 8468, 8470, 8472, 8474,
8476, 8478, 8480, 8482, 8484, 8486, 8488, 8490, 8492, 8494, 8496, 8498, 8500, 8502, 8504, 8506, 8508, 8510, 8512,
8514, 8516, 8518, 8520, 8522, 8524, 8526, 8528, 8530, 8532, 8534, 8536, 8538, 8540, 8542, 8544, 8546, 8548, 8550,
8552, 8554, 8556, 8558, 8560, 8562, 8564, 8566, 8568, 8570, 8572, 8574, 8576, 8578, 8580, 8582, 8584, 8586, 8588,
8590, 8592, 8594, 8596, 8598, 8600, 8602, 8604, 8606, 8608, 8610, 8612, 8614, 8616, 8618, 8620, 8622, 8624, 8626,
8628, 8630, 8632, 8634, 8636, 8638, 8640, 8642, 8644, 8646, 8648, 8650, 8652, 8654, 8656, 8658, 8660, 8662, 8664,
8666, 8668, 8670, 8672, 8674, 8676, 8678, 8680, 8682, 8684, 8686, 8688, 8690, 8692, 8694, 8696, 8698, 8700, 8702,
8704, 8706, 8708, 8710, 8712, 8714, 8716, 8718, 8720, 8722, 8724, 8726, 8728, 8730, 8732, 8734, 8736, 8738, 8740,
8742, 8744, 8746, 8748, 8750, 8752, 8754, 8756, 8758, 8760, 8762, 8764, 8766, 8768, 8770, 8772, 8774, 8776, 8778,
8780, 8782, 8784, 8786, 8788, 8790, 8792, 8794, 8796, 8798, 8800, 8802, 8804, 8806, 8808, 8810, 8812, 8814, 8816,
8818, 8820, 8822, 8824, 8826, 8828, 8830, 8832, 8834, 8836, 8838, 8840, 8842, 8844, 8846, 8848, 8850, 8852, 8854,
8856, 8858, 8860, 8862, 8864, 8866, 8868, 8870, 8872, 8874, 8876, 8878, 8880, 8882, 8884, 8886, 8888, 8890, 8892,
8894, 8896, 8898, 8900, 8902, 8904, 8906, 8908, 8910, 8912, 8914, 8916, 8918, 8920, 8922, 8924, 8926, 8928, 8930,
8932, 8934, 8936, 8938, 8940, 8942, 8944, 8946, 8948, 8950, 8952, 8954, 8956, 8958, 8960, 8962, 8964, 8966, 8968,
8970, 8972, 8974, 8976, 8978, 8980, 8982, 8984, 8986, 8988, 8990, 8992, 8994, 8996, 8998, 9000, 9002, 9004, 9006,
9008, 9010, 9012, 9014, 9016, 9018, 9020, 9022, 9024, 9026, 9028, 9030, 9032, 9034, 9036, 9038, 9040, 9042, 9044,
9046, 9048, 9050, 9052, 9054, 9056, 9058, 9060, 9062, 9064, 9066, 9068, 9070, 9072, 9074, 9076, 9078, 9080, 9082,
9084, 9086, 9088, 9090, 9092, 9094, 9096, 9098, 9100, 9102, 9104, 9106, 9108, 9110, 9112, 9114, 9116, 9118, 9120,
9122, 9124, 9126, 9128, 9130, 9132, 9134, 9136, 9138, 9140, 9142, 9144, 9146, 9148, 9150, 9152, 9154, 9156, 9158,
9160, 9162, 9164, 9166, 9168, 9170, 9172, 9174, 9176, 9178, 9180, 9182, 9184, 9186, 9188, 9190, 9192, 9194, 9196,
9198, 9200, 9202, 9204, 9206, 9208, 9210, 9212, 9214, 9216, 9218, 9220, 9222, 9224, 9226, 9228, 9230, 9232, 9234,
9236, 9238, 9240, 9242, 9244, 9246, 9248, 9250, 9252, 9254, 9256, 9258, 9260, 9262, 9264, 9266, 9268, 9270, 9272,
9274, 9276, 9278, 9280, 9282, 9284, 9286, 9288, 9290, 9292, 9294, 9296, 9298, 9300, 9302, 9304, 9306, 9308, 9310,
9312, 9314, 9316, 9318, 9320, 9322, 9324, 9326, 9328, 9330, 9332, 9334, 9336, 9338, 9340, 9342, 9344, 9346, 9348,
9350, 9352, 9354, 9356, 9358, 9360, 9362, 9364, 9366, 9368, 9370, 9372, 9374, 9376, 9378, 9380, 9382, 9384, 9386,
9388, 9390, 9392, 9394, 9396, 9398, 9400, 9402, 9404, 9406, 9408, 9410, 9412, 9414, 9416, 9418, 9420, 9422, 9424,
9426, 9428, 9430, 9432, 9434, 9436, 9438, 9440, 9442, 9444, 9446, 9448, 9450, 9452, 9454, 9456, 9458, 9460, 9462,
9464, 9466, 9468, 9470, 9472, 9474, 9476, 9478, 9480, 9482, 9484, 9486, 9488, 9490, 9492, 9494, 9496, 9498, 9500,
9502, 9504, 9506, 9508, 9510, 9512, 9514, 9516, 9518, 9520, 9522, 9524, 9526, 9528, 9530, 9532, 9534, 9536, 9538,
9540, 9542, 9544, 9546, 9548, 9550, 9552, 9554, 9556, 9558, 9560, 9562, 9564, 9566, 9568, 9570, 9572, 9574, 9576,
9578, 9580, 9582, 9584, 9586, 9588, 9590, 9592, 9594, 9596, 9598, 9600, 9602, 9604, 9606, 9608, 9610, 9612, 9614,
9616, 9618, 9620, 9622, 9624, 9626, 9628, 9630, 9632, 9634, 9636, 9638, 9640, 9642, 9644, 9646, 9648, 9650, 9652,
9654, 9656, 9658, 9660, 9662, 9664, 9666, 9668, 9670, 9672, 9674, 9676, 9678, 9680, 9682, 9684, 9686, 9688, 9690,
9692, 9694, 9696, 9698, 9700, 9702, 9704, 9706, 9708, 9710, 9712, 9714, 9716, 9718, 9720, 9722, 9724, 9726, 9728,
9730, 9732, 9734, 9736, 9738, 9740, 9742, 9744, 9746, 9748, 9750, 9752, 9754, 9756, 9758, 9760, 9762, 9764, 9766,
9768, 9770, 9772, 9774, 9776, 9778, 9780, 9782, 9784, 9786, 9788, 9790, 9792, 9794, 9796, 9798, 9800, 9802, 9804,
9806, 9808, 9810, 9812, 9814, 9816, 9818, 9820, 9822, 9824, 9826, 9828, 9830, 9832, 9834, 9836, 9838, 9840, 9842,
9844, 9846, 9848, 9850, 9852, 9854, 9856, 9858, 9860, 9862, 9864, 9866, 9868, 9870, 9872, 9874, 9876, 9878, 9880,
9882, 9884, 9886, 9888, 9890, 9892, 9894, 9896, 9898, 9900, 9902, 9904, 9906, 9908, 9910, 9912, 9914, 9916, 9918,
9920, 9922, 9924, 9926, 9928, 9930, 9932, 9934, 9936, 9938, 9940, 9942, 9944, 9946, 9948, 9950, 9952, 9954, 9956,
9958, 9960, 9962, 9964, 9966, 9968, 9970, 9972, 9974, 9976, 9978, 9980, 9982, 9984, 9986, 9988, 9990, 9992, 9994,
9996, 9998, 10000, 10002]
res = Solution().fairCandySwap(a1, b1)
print(res)
# 上面中间写上代码块
end = time.time()
print('Running time: %s Seconds' % (end - start))
| 104.638158 | 120 | 0.623546 | 10,225 | 63,620 | 3.87912 | 0.987188 | 0.000252 | 0.000303 | 0.000303 | 0.000353 | 0.000353 | 0.000353 | 0 | 0 | 0 | 0 | 0.778725 | 0.212999 | 63,620 | 607 | 121 | 104.810544 | 0.013461 | 0.017479 | 0 | 0 | 0 | 0 | 0.000544 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.001873 | false | 0 | 0.001873 | 0 | 0.007491 | 0.003745 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f726670921d44f21aa09f17d795a742ee0c1fa0c | 8,397 | py | Python | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | import unittest
import mock
import requests
import httpretty
import settings
from bitfinex.client import Client, TradeClient
API_KEY = settings.API_KEY
API_SECRET = settings.API_SECRET
class BitfinexTest(unittest.TestCase):
def setUp(self):
self.client = Client()
def test_should_have_server(self):
self.assertEqual("https://api.bitfinex.com/v1", self.client.server())
def test_should_have_url_for_foo(self):
expected = "https://api.bitfinex.com/v1/foo"
self.assertEqual(expected, self.client.url_for("foo"))
def test_should_have_url_for_path_arg(self):
expected = "https://api.bitfinex.com/v1/foo/bar"
actual = self.client.url_for('foo/%s', path_arg="bar")
self.assertEqual(expected, actual)
def test_should_have_url_with_parameters(self):
expected = "https://api.bitfinex.com/v1/foo?a=1&b=2"
actual = self.client.url_for('foo', parameters={'a': 1, 'b': 2})
self.assertEqual(expected, actual)
def test_should_have_url_for(self):
expected = self.client.url_for("foo")
self.assertEqual("https://api.bitfinex.com/v1/foo", expected)
def test_should_have_url_for_with_path_arg(self):
expected = "https://api.bitfinex.com/v1/foo/bar"
path = "foo/%s"
self.assertEqual(expected, self.client.url_for(path, path_arg='bar'))
self.assertEqual(expected, self.client.url_for(path, 'bar'))
def test_should_have_url_for_with_parameters(self):
expected = "https://api.bitfinex.com/v1/foo?a=1"
self.assertEqual(expected, self.client.url_for("foo", parameters={'a': 1}))
self.assertEqual(expected, self.client.url_for("foo", None, {'a': 1}))
def test_should_have_url_for_with_path_arg_and_parameters(self):
expected = "https://api.bitfinex.com/v1/foo/bar?a=1"
path = "foo/%s"
self.assertEqual(expected, self.client.url_for(path, path_arg='bar', parameters={'a': 1}))
self.assertEqual(expected, self.client.url_for(path, 'bar', {'a': 1}))
@httpretty.activate
def test_should_have_symbols(self):
# mock out the request
mock_body = '["btcusd","ltcusd","ltcbtc"]'
url = self.client.url_for('symbols')
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = ["btcusd","ltcusd","ltcbtc"]
self.assertEqual(expected, self.client.symbols())
@httpretty.activate
def test_should_have_ticker(self):
# mock out the request
mock_body = '{"mid":"562.56495","bid":"562.15","ask":"562.9799","last_price":"562.25","timestamp":"1395552658.339936691"}'
url = self.client.url_for('ticker/%s', path_arg='btcusd')
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = {
"mid": 562.56495,
"bid": 562.15,
"ask": 562.9799,
"last_price": 562.25,
"timestamp": 1395552658.339936691
}
self.assertEqual(expected, self.client.ticker('btcusd'))
@httpretty.activate
def test_should_have_today(self):
# mock out the request
mock_body = '{"low":"550.09","high":"572.2398","volume":"7305.33119836"}'
url = self.client.url_for('today/%s', path_arg='btcusd')
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = {
"low": 550.09,
"high": 572.2398,
"volume": 7305.33119836
}
self.assertEqual(expected, self.client.today('btcusd'))
@httpretty.activate
def test_should_have_stats(self):
# mock out the request
mock_body = '[{"period":1,"volume":"7410.27250155"},{"period":7,"volume":"52251.37118006"},{"period":30,"volume":"464505.07753251"}]'
url = self.client.url_for('stats/%s', path_arg='btcusd')
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = [
{"period": 1, "volume": 7410.27250155},
{"period": 7, "volume": 52251.37118006},
{"period": 30,"volume": 464505.07753251}
]
self.assertEqual(expected, self.client.stats('btcusd'))
@httpretty.activate
def test_should_have_lendbook(self):
# mock out the request
mock_body = '{"bids":[{"rate":"5.475","amount":"15.03894663","period":30,"timestamp":"1395112149.0","frr":"No"},{"rate":"2.409","amount":"14.5121868","period":7,"timestamp":"1395497599.0","frr":"No"}],"asks":[{"rate":"6.351","amount":"15.5180735","period":5,"timestamp":"1395549996.0","frr":"No"},{"rate":"6.3588","amount":"626.94808249","period":30,"timestamp":"1395400654.0","frr":"Yes"}]}'
url = self.client.url_for('lendbook/%s', 'btc')
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = {
"bids": [
{"rate": 5.475, "amount": 15.03894663, "period": 30, "timestamp": 1395112149.0, "frr": False},
{"rate": 2.409, "amount": 14.5121868, "period": 7, "timestamp": 1395497599.0, "frr": False}
],
"asks": [
{"rate": 6.351, "amount": 15.5180735, "period": 5, "timestamp": 1395549996.0, "frr": False},
{"rate": 6.3588, "amount": 626.94808249, "period": 30, "timestamp": 1395400654.0, "frr": True}
]
}
self.assertEqual(expected, self.client.lendbook('btc'))
@httpretty.activate
def test_should_have_lendbook_with_parameters(self):
# mock out the request
mock_body = '{"bids":[{"rate":"5.475","amount":"15.03894663","period":30,"timestamp":"1395112149.0","frr":"No"},{"rate":"2.409","amount":"14.5121868","period":7,"timestamp":"1395497599.0","frr":"No"}],"asks":[]}'
parameters = {'limit_bids': 2, 'limit_asks': 0}
url = self.client.url_for('lendbook/%s', 'btc', parameters)
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = {
"bids": [
{"rate": 5.475, "amount": 15.03894663, "period": 30, "timestamp": 1395112149.0, "frr": False},
{"rate": 2.409, "amount": 14.5121868, "period": 7, "timestamp": 1395497599.0, "frr": False}
],
"asks": [
]
}
self.assertEqual(expected, self.client.lendbook('btc', parameters))
@httpretty.activate
def test_should_have_order_book(self):
# mock out the request
mock_body = '{"bids":[{"price":"562.2601","amount":"0.985","timestamp":"1395567556.0"}],"asks":[{"price":"563.001","amount":"0.3","timestamp":"1395532200.0"}]}'
url = self.client.url_for('book/%s', 'btcusd')
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = {
"bids": [
{"price": 562.2601, "amount": 0.985, "timestamp": 1395567556.0}
],
"asks": [
{"price": 563.001, "amount": 0.3, "timestamp": 1395532200.0}
]
}
self.assertEqual(expected, self.client.order_book('btcusd'))
@httpretty.activate
def test_should_have_order_book_with_parameters(self):
# mock out the request
mock_body = '{"bids":[{"price":"562.2601","amount":"0.985","timestamp":"1395567556.0"}],"asks":[]}'
parameters = {'limit_asks': 0}
url = self.client.url_for('book/%s', 'btcusd', parameters)
httpretty.register_uri(httpretty.GET, url, body=mock_body, status=200)
expected = {
"bids": [
{"price": 562.2601, "amount": 0.985, "timestamp": 1395567556.0}
],
"asks": []
}
self.assertEqual(expected, self.client.order_book('btcusd', parameters))
class TestTradeClient(unittest.TestCase):
def setUp(self):
self.tc = TradeClient(API_KEY, API_SECRET)
def test_instantiate_tradeclient(self):
self.assertIsInstance(self.tc, TradeClient)
def test_get_active_orders_returns_json(self):
ao = self.tc.active_orders()
self.assertIsInstance(ao, list)
def test_get_active_positions_returns_json(self):
ap = self.tc.active_positions()
self.assertIsInstance(ap, list)
def test_get_full_history(self):
ap = self.tc.active_positions()
self.assertIsInstance(ap, list)
| 37.995475 | 400 | 0.609265 | 1,032 | 8,397 | 4.80814 | 0.139535 | 0.056429 | 0.047158 | 0.058041 | 0.861749 | 0.819831 | 0.769045 | 0.674526 | 0.599557 | 0.520959 | 0 | 0.107915 | 0.217578 | 8,397 | 220 | 401 | 38.168182 | 0.647336 | 0.019888 | 0 | 0.329032 | 0 | 0.03871 | 0.239873 | 0.136358 | 0 | 0 | 0 | 0 | 0.148387 | 1 | 0.141935 | false | 0 | 0.03871 | 0 | 0.193548 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 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 | 0 | 0 | 0 | 0 | 3 |
f731ffc418c409ea5c8ec121e5505721921146e2 | 164 | py | Python | natwork/chats/admin.py | Potisin/Natwork | a42b89f18fdd8f8ac69e56cb7184696d6883a9f7 | [
"BSD-3-Clause"
] | null | null | null | natwork/chats/admin.py | Potisin/Natwork | a42b89f18fdd8f8ac69e56cb7184696d6883a9f7 | [
"BSD-3-Clause"
] | null | null | null | natwork/chats/admin.py | Potisin/Natwork | a42b89f18fdd8f8ac69e56cb7184696d6883a9f7 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from .models import Chat
class ChatAdmin(admin.ModelAdmin):
list_display = ("pk",)
admin.site.register(Chat, ChatAdmin)
| 12.615385 | 36 | 0.737805 | 21 | 164 | 5.714286 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158537 | 164 | 12 | 37 | 13.666667 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0.012346 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
f744580853ac0dc47dbf987d1497464099a8f500 | 1,907 | py | Python | tests/test-checkbox.py | JonathanRRogers/twill | e1afc10366dcd29b82eeae2d586e49ca7737039a | [
"MIT"
] | null | null | null | tests/test-checkbox.py | JonathanRRogers/twill | e1afc10366dcd29b82eeae2d586e49ca7737039a | [
"MIT"
] | null | null | null | tests/test-checkbox.py | JonathanRRogers/twill | e1afc10366dcd29b82eeae2d586e49ca7737039a | [
"MIT"
] | null | null | null | import twilltestlib
import twill
from twill import namespaces, commands
from twill.errors import TwillAssertionError
from mechanize import BrowserStateError
def setup_module():
global url
url = twilltestlib.get_url()
def test_select_multiple():
namespaces.new_local_dict()
twill.commands.reset_browser()
browser = twill.get_browser()
try:
browser.get_title()
assert 0, "should never get here"
except BrowserStateError:
pass
commands.go(url)
commands.go('/test_checkboxes')
commands.fv('1', 'checkboxtest', 'one')
commands.fv('1', 'checkboxtest', 'two')
commands.fv('1', 'checkboxtest', 'three')
commands.fv('1', 'checkboxtest', '-one')
commands.fv('1', 'checkboxtest', '-two')
commands.fv('1', 'checkboxtest', '-three')
commands.submit()
assert not 'CHECKBOXTEST' in browser.get_html()
commands.fv('1', 'checkboxtest', '+one')
commands.fv('1', 'checkboxtest', '+two')
commands.fv('1', 'checkboxtest', '+three')
commands.submit()
assert 'CHECKBOXTEST: ==one,two,three==' in browser.get_html()
commands.fv('1', 'checkboxtest', '-one')
commands.fv('1', 'checkboxtest', '-two')
commands.fv('1', 'checkboxtest', '-three')
commands.submit()
assert not 'CHECKBOXTEST' in browser.get_html()
def test_select_single():
namespaces.new_local_dict()
twill.commands.reset_browser()
browser = twill.get_browser()
try:
browser.get_title()
assert 0, "should never get here"
except BrowserStateError:
pass
commands.go(url)
commands.go('/test_checkboxes')
for x in ('1', '0', 'True', 'False'):
try:
commands.fv('1', 'checkboxtest', x)
assert False, ("Should not be able to use a bool style for when "
"there are multiple checkboxes")
except:
pass
| 26.859155 | 77 | 0.631358 | 220 | 1,907 | 5.377273 | 0.272727 | 0.10989 | 0.120879 | 0.252747 | 0.6847 | 0.6847 | 0.6847 | 0.6847 | 0.6847 | 0.6847 | 0 | 0.011494 | 0.224436 | 1,907 | 70 | 78 | 27.242857 | 0.788371 | 0 | 0 | 0.6 | 0 | 0 | 0.230446 | 0 | 0 | 0 | 0 | 0 | 0.127273 | 1 | 0.054545 | false | 0.054545 | 0.090909 | 0 | 0.145455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
f74df4ac592a375e715e992b4854e0bf766ac654 | 865 | py | Python | lab1_rest/project/apps/core/views.py | mratkovic/RZNU-Lab | 2930b249994619c2f17493544db2c0d471ca6cbc | [
"MIT"
] | null | null | null | lab1_rest/project/apps/core/views.py | mratkovic/RZNU-Lab | 2930b249994619c2f17493544db2c0d471ca6cbc | [
"MIT"
] | null | null | null | lab1_rest/project/apps/core/views.py | mratkovic/RZNU-Lab | 2930b249994619c2f17493544db2c0d471ca6cbc | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from .models import User, Photo
from .serializers import UserSerializer, PhotoSerializer
from .mixins import RequestLogViewMixin
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly
class PhotoViewSet(RequestLogViewMixin, viewsets.ModelViewSet):
authentication_classes = (SessionAuthentication, BasicAuthentication)
permission_classes = (IsAuthenticatedOrReadOnly,)
queryset = Photo.objects.all()
serializer_class = PhotoSerializer
class UserViewSet(RequestLogViewMixin, viewsets.ModelViewSet):
authentication_classes = (SessionAuthentication, BasicAuthentication)
permission_classes = (IsAuthenticatedOrReadOnly,)
queryset = User.objects.all()
serializer_class = UserSerializer | 41.190476 | 84 | 0.834682 | 71 | 865 | 10.042254 | 0.408451 | 0.033661 | 0.071529 | 0.148668 | 0.420757 | 0.420757 | 0.420757 | 0.420757 | 0.420757 | 0.420757 | 0 | 0 | 0.110983 | 865 | 21 | 85 | 41.190476 | 0.927178 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 1 | 0 | 0 | 0 | 1 | null | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
f764d5863df085c67cf462549442d82ef895d117 | 653 | py | Python | rhasspy_weather/parser/nlu_intent.py | arniebarni/rhasspy_weather | 6a9df72adad3e5dafa7962c2be37c824dc04137b | [
"MIT"
] | 5 | 2020-03-29T01:00:30.000Z | 2022-02-06T20:00:00.000Z | rhasspy_weather/parser/nlu_intent.py | arniebarni/rhasspy_weather | 6a9df72adad3e5dafa7962c2be37c824dc04137b | [
"MIT"
] | 12 | 2020-04-02T15:09:05.000Z | 2021-10-11T00:44:21.000Z | rhasspy_weather/parser/nlu_intent.py | arniebarni/rhasspy_weather | 6a9df72adad3e5dafa7962c2be37c824dc04137b | [
"MIT"
] | 5 | 2020-03-25T08:33:02.000Z | 2021-05-18T08:47:41.000Z | import logging
from rhasspy_weather.data_types.request import WeatherRequest
from rhasspy_weather.parser import rhasspy_intent
from rhasspyhermes.nlu import NluIntent
log = logging.getLogger(__name__)
def parse_intent_message(intent_message: NluIntent) -> WeatherRequest:
"""
Parses any of the rhasspy weather intents.
Args:
intent_message: a Hermes NluIntent
Returns: WeatherRequest object
"""
return rhasspy_intent.parse_intent_message(intent_message.to_rhasspy_dict())
def get_template_values(intent_message: NluIntent) -> dict:
return rhasspy_intent.get_template_values(intent_message.to_rhasspy_dict())
| 26.12 | 80 | 0.793262 | 80 | 653 | 6.1375 | 0.45 | 0.185336 | 0.07332 | 0.09776 | 0.301426 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14242 | 653 | 24 | 81 | 27.208333 | 0.876786 | 0.183767 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.444444 | 0.111111 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 1 | 0 | 0 | 0 | 3 |
f76f8e181e6635c86576107fa1d30d62af17c114 | 158 | py | Python | FictionTools/amitools/test/suite/vprintf.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | FictionTools/amitools/test/suite/vprintf.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | FictionTools/amitools/test/suite/vprintf.py | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | import pytest
def vprintf_test(vamos):
if vamos.flavor == "agcc":
pytest.skip("vprintf not supported")
vamos.run_prog_check_data("vprintf")
| 19.75 | 44 | 0.689873 | 21 | 158 | 5 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189873 | 158 | 7 | 45 | 22.571429 | 0.820313 | 0 | 0 | 0 | 0 | 0 | 0.202532 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.4 | 0.6 | 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 | 0 | 0 | 0 | 1 | 0 | 3 |
f77f91aa533c688d45149adae8643805965bb2c7 | 622 | py | Python | kruptos/csapp/api.py | ashwani762/Kruptos | 9cd04ee6147c2dc14764e45c3481690ae399e664 | [
"Apache-2.0"
] | null | null | null | kruptos/csapp/api.py | ashwani762/Kruptos | 9cd04ee6147c2dc14764e45c3481690ae399e664 | [
"Apache-2.0"
] | null | null | null | kruptos/csapp/api.py | ashwani762/Kruptos | 9cd04ee6147c2dc14764e45c3481690ae399e664 | [
"Apache-2.0"
] | null | null | null | from csapp.models import Kruptos
from rest_framework import viewsets, permissions
from rest_framework.response import Response
from rest_framework import status
from .serializers import KruptosSerializer
class KruptosViewSet(viewsets.ModelViewSet):
permission_classes = [
permissions.AllowAny
]
serializer_class = KruptosSerializer
def get_queryset(self):
return Kruptos.objects.all()
def perform_create(self, serializer):
serializer.save()
def destroy(self, request, *args, **kwargs):
return Response(status=status.HTTP_400_BAD_REQUEST) | 29.619048 | 59 | 0.726688 | 66 | 622 | 6.69697 | 0.560606 | 0.054299 | 0.115385 | 0.104072 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006098 | 0.209003 | 622 | 21 | 59 | 29.619048 | 0.892276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1875 | false | 0 | 0.3125 | 0.125 | 0.8125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
f78376ac5696d0e27ff83ec0f818efffebaf1f64 | 874 | py | Python | src/domain/usecases/get_all_glaucomatous_images_paths.py | OzielFilho/ProjetoFinalPdi | c9e6fe415f1a985d6eeac204580d3ab623026665 | [
"MIT"
] | null | null | null | src/domain/usecases/get_all_glaucomatous_images_paths.py | OzielFilho/ProjetoFinalPdi | c9e6fe415f1a985d6eeac204580d3ab623026665 | [
"MIT"
] | null | null | null | src/domain/usecases/get_all_glaucomatous_images_paths.py | OzielFilho/ProjetoFinalPdi | c9e6fe415f1a985d6eeac204580d3ab623026665 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from domain.errors.failure import Failure
from domain.errors.image_failure import ImageFailure
from domain.repositories.image_repository_abstraction import ImageRepositoryAbstraction
class GetAllGlaucomatousImagesPathsAbstraction(ABC):
@abstractmethod
def __init__(self, repository: ImageRepositoryAbstraction) -> None:
pass
@abstractmethod
def __call__(self) -> Failure | list[str]:
pass
class GetAllGlaucomatousImagesPaths(GetAllGlaucomatousImagesPathsAbstraction):
def __init__(self, repository: ImageRepositoryAbstraction) -> None:
self.repository = repository
def __call__(self) -> Failure | list[str]:
try:
return self.repository.get_all_glaucomatous_images_paths()
except BaseException as exception:
return ImageFailure(str(exception))
| 32.37037 | 87 | 0.756293 | 80 | 874 | 7.975 | 0.4375 | 0.087774 | 0.050157 | 0.065831 | 0.238245 | 0.238245 | 0 | 0 | 0 | 0 | 0 | 0 | 0.17849 | 874 | 26 | 88 | 33.615385 | 0.888579 | 0 | 0 | 0.421053 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0.105263 | 0.210526 | 0 | 0.631579 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 3 |
f7977957e2a1122df1f177f30c24042002dc1e88 | 1,088 | py | Python | src/ralph/models/edx/enrollment/fields/contexts.py | p-bizouard/ralph | 50a37f6b070dcb4109dcc49d8d885949a0099643 | [
"MIT"
] | 5 | 2020-06-26T10:44:23.000Z | 2022-01-26T11:41:03.000Z | src/ralph/models/edx/enrollment/fields/contexts.py | p-bizouard/ralph | 50a37f6b070dcb4109dcc49d8d885949a0099643 | [
"MIT"
] | 73 | 2020-02-18T15:09:25.000Z | 2022-03-14T13:32:20.000Z | src/ralph/models/edx/enrollment/fields/contexts.py | p-bizouard/ralph | 50a37f6b070dcb4109dcc49d8d885949a0099643 | [
"MIT"
] | 4 | 2020-02-27T12:52:10.000Z | 2021-11-23T19:45:07.000Z | """Enrollment event models context fields definitions"""
from typing import Literal, Union
from ...base import BaseContextField
class EdxCourseEnrollmentUpgradeClickedContextField(BaseContextField):
"""Represents the `context` field of the `edx.course.enrollment.upgrade_clicked`
server statement.
In addition to the common context member fields, this statement also comprises the
`mode` context member field.
Attributes:
mode (str): Consists of either the `audit` or `honor` value. It identifies the
enrollment mode when the user clicked <kbd>Challenge Yourself</kbd>.
"""
mode: Union[Literal["audit"], Literal["honor"]]
class EdxCourseEnrollmentUpgradeSucceededContextField(BaseContextField):
"""Represents the `context` field of the `edx.course.enrollment.upgrade.succeeded`
server statement.
In addition to the common context member fields, this statement also comprises the
`mode` context member field.
Attributes:
mode (str): Consists of the `verified` value.
"""
mode: Literal["verified"]
| 31.085714 | 86 | 0.731618 | 122 | 1,088 | 6.516393 | 0.42623 | 0.065409 | 0.072956 | 0.090566 | 0.515723 | 0.515723 | 0.515723 | 0.515723 | 0.515723 | 0.515723 | 0 | 0 | 0.183824 | 1,088 | 34 | 87 | 32 | 0.89527 | 0.645221 | 0 | 0 | 0 | 0 | 0.056962 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
e3a5f11059953bb156d9e0590e2727a61cd805cc | 282 | py | Python | apps/lectures/serializers.py | csilouanos/student-management-system | 91800a1d95234918ab7e9ce5a2a017eb93e81431 | [
"MIT"
] | null | null | null | apps/lectures/serializers.py | csilouanos/student-management-system | 91800a1d95234918ab7e9ce5a2a017eb93e81431 | [
"MIT"
] | null | null | null | apps/lectures/serializers.py | csilouanos/student-management-system | 91800a1d95234918ab7e9ce5a2a017eb93e81431 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Lecture
class LectureSerializer(serializers.ModelSerializer):
class Meta:
model = Lecture
fields = ('id', 'title', 'lecturer_name', 'date', 'duration',
'slides_url', 'is_required')
| 31.333333 | 70 | 0.659574 | 28 | 282 | 6.5 | 0.821429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.234043 | 282 | 8 | 71 | 35.25 | 0.842593 | 0 | 0 | 0 | 0 | 0 | 0.187943 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.571429 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
e3aa733a9aa92608aebcdce4ac3a723c8a9e99a6 | 356 | py | Python | authz/test/test_obp_helper.py | shivdeep-singh/conversational-ai-chatbot | b67802a96b3fe3d64457931a8cbf8bf03442fd0d | [
"BSD-3-Clause"
] | 11 | 2021-09-09T16:16:48.000Z | 2022-03-31T21:25:46.000Z | authz/test/test_obp_helper.py | shivdeep-singh/conversational-ai-chatbot | b67802a96b3fe3d64457931a8cbf8bf03442fd0d | [
"BSD-3-Clause"
] | 1 | 2022-02-10T06:08:11.000Z | 2022-02-10T06:08:11.000Z | authz/test/test_obp_helper.py | shivdeep-singh/conversational-ai-chatbot | b67802a96b3fe3d64457931a8cbf8bf03442fd0d | [
"BSD-3-Clause"
] | 12 | 2021-09-19T10:39:27.000Z | 2022-03-09T05:17:05.000Z | import unittest
from zmq_integration_lib import RPCClient, RPCServer
import unittest.mock as mock
class TestOBPHelper(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def logout(self, mock_zmq):
self.assertTrue(True)
def get_login_token(self, mock_zmq):
self.assertTrue(True)
| 18.736842 | 52 | 0.676966 | 44 | 356 | 5.340909 | 0.545455 | 0.119149 | 0.093617 | 0.12766 | 0.246809 | 0.246809 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 356 | 18 | 53 | 19.777778 | 0.88015 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.333333 | false | 0.166667 | 0.25 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 3 |
e3b0cc4b1724b29973099266d87959c7fe603cf2 | 108 | wsgi | Python | mysite/auth.wsgi | biljiang/mysite | 15c0a0d7bb6bd46587f4cf805ce43f4c570de1be | [
"BSD-3-Clause"
] | null | null | null | mysite/auth.wsgi | biljiang/mysite | 15c0a0d7bb6bd46587f4cf805ce43f4c570de1be | [
"BSD-3-Clause"
] | null | null | null | mysite/auth.wsgi | biljiang/mysite | 15c0a0d7bb6bd46587f4cf805ce43f4c570de1be | [
"BSD-3-Clause"
] | null | null | null | def groups_for_user(environ, user):
if user == 'feng':
return ['secret-agents']
return ['']
| 21.6 | 35 | 0.583333 | 13 | 108 | 4.692308 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 108 | 4 | 36 | 27 | 0.753086 | 0 | 0 | 0 | 0 | 0 | 0.157407 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e3cb6664659c1efec8fe41651c43927d133e5bf2 | 10,046 | py | Python | tests/unit/test_functions.py | noahsa/scikit-hts | db067f416172d18f7d0127150c45419883260d54 | [
"MIT"
] | null | null | null | tests/unit/test_functions.py | noahsa/scikit-hts | db067f416172d18f7d0127150c45419883260d54 | [
"MIT"
] | null | null | null | tests/unit/test_functions.py | noahsa/scikit-hts | db067f416172d18f7d0127150c45419883260d54 | [
"MIT"
] | null | null | null | import numpy
import pandas
import hts.hierarchy
from hts.functions import (
_create_bl_str_col,
get_agg_series,
get_hierarchichal_df,
to_sum_mat,
)
def test_sum_mat_uv(uv_tree):
mat, sum_mat_labels = to_sum_mat(uv_tree)
assert isinstance(mat, numpy.ndarray)
shp = mat.shape
assert shp[0] == uv_tree.num_nodes() + 1
assert shp[1] == uv_tree.leaf_sum()
def test_sum_mat_mv(mv_tree):
mat, sum_mat_labels = to_sum_mat(mv_tree)
assert isinstance(mat, numpy.ndarray)
shp = mat.shape
assert shp[0] == mv_tree.num_nodes() + 1
assert shp[1] == mv_tree.leaf_sum()
def test_sum_mat_hierarchical():
hierarchy = {"total": ["A", "B"], "A": ["A_X", "A_Y", "A_Z"], "B": ["B_X", "B_Y"]}
hier_df = pandas.DataFrame(
data={
"total": [],
"A": [],
"B": [],
"A_X": [],
"A_Y": [],
"A_Z": [],
"B_X": [],
"B_Y": [],
}
)
tree = hts.hierarchy.HierarchyTree.from_nodes(hierarchy, hier_df)
sum_mat, sum_mat_labels = to_sum_mat(tree)
expected_sum_mat = numpy.array(
[
[1, 1, 1, 1, 1], # total
[0, 0, 0, 1, 1], # B
[1, 1, 1, 0, 0], # A
[1, 0, 0, 0, 0], # A_X
[0, 1, 0, 0, 0], # A_Y
[0, 0, 1, 0, 0], # A_Z
[0, 0, 0, 1, 0], # B_X
[0, 0, 0, 0, 1],
]
) # B_Y
numpy.testing.assert_array_equal(sum_mat, expected_sum_mat)
assert sum_mat_labels == ["total", "B", "A", "A_X", "A_Y", "A_Z", "B_X", "B_Y"]
def test_sum_mat_grouped():
hierarchy = {
"total": ["A", "B", "X", "Y"],
"A": ["A_X", "A_Y"],
"B": ["B_X", "B_Y"],
}
grouped_df = pandas.DataFrame(
data={
"total": [],
"A": [],
"B": [],
"X": [],
"Y": [],
"A_X": [],
"A_Y": [],
"B_X": [],
"B_Y": [],
}
)
tree = hts.hierarchy.HierarchyTree.from_nodes(hierarchy, grouped_df)
sum_mat, sum_mat_labels = to_sum_mat(tree)
expected_sum_mat = numpy.array(
[
[1, 1, 1, 1], # total
[0, 1, 0, 1], # Y
[1, 0, 1, 0], # X
[0, 0, 1, 1], # B
[1, 1, 0, 0], # A
[1, 0, 0, 0], # A_X
[0, 1, 0, 0], # A_Y
[0, 0, 1, 0], # B_X
[0, 0, 0, 1], # B_Y
]
)
numpy.testing.assert_array_equal(sum_mat, expected_sum_mat)
assert sum_mat_labels == ["total", "Y", "X", "B", "A", "A_X", "A_Y", "B_X", "B_Y"]
def test_sum_mat_visnights_hier(visnights_hier):
hier_df = pandas.DataFrame(
data={
"total": [],
"VIC": [],
"QLD": [],
"SAU": [],
"WAU": [],
"OTH": [],
"NSW": [],
"NSW_Metro": [],
"NSW_NthCo": [],
"NSW_NthIn": [],
"NSW_SthCo": [],
"NSW_SthIn": [],
"OTH_Metro": [],
"OTH_NoMet": [],
"QLD_Cntrl": [],
"QLD_Metro": [],
"QLD_NthCo": [],
"SAU_Coast": [],
"SAU_Inner": [],
"SAU_Metro": [],
"VIC_EstCo": [],
"VIC_Inner": [],
"VIC_Metro": [],
"VIC_WstCo": [],
"WAU_Coast": [],
"WAU_Inner": [],
"WAU_Metro": [],
}
)
tree = hts.hierarchy.HierarchyTree.from_nodes(visnights_hier, hier_df)
sum_mat, sum_mat_labels = to_sum_mat(tree)
expected_sum_mat = numpy.array(
[
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], # total
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], # VIC
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], # QLD
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], # SAU
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # WAU
[0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # OTH
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # NSW
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # NSW_Metro
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # NSW_NthCo
[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # NSW_NthIn
[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # NSW_SthCo
[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # NSW_SthIn
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # OTH_Metro
[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # OTH_NoMet
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # WAU_Coast
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # WAU_Inner
[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # WAU_Metro
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], # SAU_Coast
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], # SAU_Inner
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], # SAU_Metro
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], # QLD_Cntrl
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], # QLD_Metro
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], # QLD_NthCo
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], # VIC_EstCo
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], # VIC_Inner
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], # VIC_Metro
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], # VIC_WstCo
]
)
numpy.testing.assert_array_equal(sum_mat, expected_sum_mat)
def test_demo_unique_constraint():
# Example https://otexts.com/fpp2/hts.html
# Does not work when you have elements that are named the same, but represent
# different levels in the hierarchy. See expected_sum_mat below for example.
hierarchy = {"total": ["A", "B"], "A": ["AA", "AB", "AC"], "B": ["BA", "BB"]}
hier_df = pandas.DataFrame(
data={
"total": [],
"A": [],
"B": [],
"AA": [],
"AB": [],
"AC": [],
"BA": [],
"BB": [],
}
)
tree = hts.hierarchy.HierarchyTree.from_nodes(hierarchy, hier_df)
sum_mat, sum_mat_labels = to_sum_mat(tree)
expected_sum_mat = numpy.array(
[
[1, 1, 1, 1, 1], # total
[0, 1, 0, 1, 1], # B, Incorrectly finds B in AB
[1, 1, 1, 1, 0], # A, Incorrectly finds A in BA
[1, 0, 0, 0, 0], # AA
[0, 1, 0, 0, 0], # AB
[0, 0, 1, 0, 0], # AC
[0, 0, 0, 1, 0], # BA
[0, 0, 0, 0, 1], # BB
]
)
numpy.testing.assert_array_equal(sum_mat, expected_sum_mat)
def test_1lev():
grouped_df = pandas.DataFrame(
data={"lev1": ["A", "A", "B", "B"], "lev2": ["X", "Y", "X", "Y"],}
)
levels = get_agg_series(grouped_df, [["lev1"]])
expected_levels = ["A", "B"]
assert sorted(levels) == sorted(expected_levels)
levels = get_agg_series(grouped_df, [["lev2"]])
expected_levels = ["X", "Y"]
assert sorted(levels) == sorted(expected_levels)
def test_2lev():
grouped_df = pandas.DataFrame(
data={"lev1": ["A", "A", "B", "B"], "lev2": ["X", "Y", "X", "Y"],}
)
levels = get_agg_series(grouped_df, [["lev1", "lev2"]])
expected_levels = ["A_X", "A_Y", "B_X", "B_Y"]
assert sorted(levels) == sorted(expected_levels)
def test_hierarchichal():
hier_df = pandas.DataFrame(
data={"lev1": ["A", "A", "A", "B", "B"], "lev2": ["X", "Y", "Z", "X", "Y"],}
)
levels = get_agg_series(hier_df, [["lev1"], ["lev1", "lev2"]])
expected_levels = ["A", "B", "A_X", "A_Y", "A_Z", "B_X", "B_Y"]
assert sorted(levels) == sorted(expected_levels)
def test_grouped():
hier_df = pandas.DataFrame(
data={"lev1": ["A", "A", "A", "B", "B"], "lev2": ["X", "Y", "Z", "X", "Y"],}
)
hierarchy = [["lev1"], ["lev2"], ["lev1", "lev2"]]
levels = get_agg_series(hier_df, hierarchy)
expected_levels = ["A", "B", "X", "Y", "Z", "A_X", "A_Y", "A_Z", "B_X", "B_Y"]
assert sorted(levels) == sorted(expected_levels)
def test_grouped_create_df():
hier_df = pandas.DataFrame(
data={
"ds": ["2020-01", "2020-02"] * 5,
"lev1": ["A", "A", "A", "A", "A", "A", "B", "B", "B", "B"],
"lev2": ["X", "X", "Y", "Y", "Z", "Z", "X", "X", "Y", "Y"],
"val": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
}
)
level_names = ["lev1", "lev2"]
hierarchy = [["lev1"], ["lev2"]]
gts_df, sum_mat, sum_mat_labels = get_hierarchichal_df(
hier_df,
level_names=level_names,
hierarchy=hierarchy,
date_colname="ds",
val_colname="val",
)
expected_columns = [
"A_X",
"A_Y",
"A_Z",
"B_X",
"B_Y",
"A",
"B",
"X",
"Y",
"Z",
"total",
]
assert sorted(list(gts_df.columns)) == sorted(expected_columns)
def test_parent_child():
grouped_df = pandas.DataFrame(
data={"lev1": ["A", "A", "B"], "lev2": ["X", "Y", "Z"],}
)
levels = get_agg_series(grouped_df, [["lev1", "lev2"]])
expected_levels = ["A_X", "A_Y", "B_Z"]
assert sorted(levels) == sorted(expected_levels)
def test_create_bl_str_col():
grouped_df = pandas.DataFrame(
data={"lev1": ["A", "A", "B"], "lev2": ["X", "Y", "Z"],}
)
col = _create_bl_str_col(grouped_df, ["lev1", "lev2"])
assert col == ["A_X", "A_Y", "B_Z"]
| 31.993631 | 86 | 0.429723 | 1,596 | 10,046 | 2.524436 | 0.083333 | 0.231819 | 0.298585 | 0.34351 | 0.721271 | 0.684785 | 0.616282 | 0.581286 | 0.52966 | 0.494415 | 0 | 0.110702 | 0.350786 | 10,046 | 313 | 87 | 32.095847 | 0.507053 | 0.055744 | 0 | 0.301158 | 0 | 0 | 0.073383 | 0 | 0 | 0 | 0 | 0 | 0.07722 | 1 | 0.050193 | false | 0 | 0.015444 | 0 | 0.065637 | 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 | 0 | 0 | 0 | 0 | 3 |
541ac4d6365b97db764dba02574e6974751b26ba | 371 | py | Python | synapyse/impl/activation_functions/linear.py | synapyse/synapyse | 8c9ff53ede2d83af27ce771ce1b6ea6a32155b02 | [
"MIT"
] | 4 | 2015-09-19T11:02:56.000Z | 2019-03-27T11:42:12.000Z | synapyse/impl/activation_functions/linear.py | synapyse/synapyse | 8c9ff53ede2d83af27ce771ce1b6ea6a32155b02 | [
"MIT"
] | null | null | null | synapyse/impl/activation_functions/linear.py | synapyse/synapyse | 8c9ff53ede2d83af27ce771ce1b6ea6a32155b02 | [
"MIT"
] | 1 | 2019-10-29T16:24:28.000Z | 2019-10-29T16:24:28.000Z | from synapyse.base.activation_functions.activation_function import ActivationFunction
__author__ = 'Douglas Eric Fonseca Rodrigues'
class Linear(ActivationFunction):
def calculate_output(self):
return self.x
def calculate_derivative(self):
return 1.0
def clone(self):
clone = Linear()
clone.x = self.x
return clone | 23.1875 | 85 | 0.698113 | 42 | 371 | 5.97619 | 0.595238 | 0.095618 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007018 | 0.231806 | 371 | 16 | 86 | 23.1875 | 0.873684 | 0 | 0 | 0 | 0 | 0 | 0.080645 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.090909 | 0.181818 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
582a2d15de4e22e6a4241b45670672383e57c857 | 387 | py | Python | docker/app.py | dramasamy/kubernetes_training | a5f48d540b7b6e9a79b5ab60f62a13a792f1b0e5 | [
"Apache-2.0"
] | 1 | 2022-03-22T22:31:32.000Z | 2022-03-22T22:31:32.000Z | docker/app.py | dramasamy/training | af7b9352b56c10aaa957062f24f1302a7a4c5797 | [
"Apache-2.0"
] | null | null | null | docker/app.py | dramasamy/training | af7b9352b56c10aaa957062f24f1302a7a4c5797 | [
"Apache-2.0"
] | null | null | null | #! /bin/python
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello World! - v1"
@app.route('/<name>')
def hello_name(name):
return "Hello {}! - v1".format(name)
@app.route('/audio')
def audio():
return "Audio - v1"
@app.route('/video')
def video():
return "Video - v1"
if __name__ == '__main__':
app.run(host='0.0.0.0')
| 13.821429 | 40 | 0.596899 | 55 | 387 | 3.963636 | 0.381818 | 0.146789 | 0.110092 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025559 | 0.191214 | 387 | 27 | 41 | 14.333333 | 0.670927 | 0.033592 | 0 | 0 | 0 | 0 | 0.230563 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.0625 | 0.25 | 0.5625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
584603df6f6456851f5001f52a65f8c0ba217511 | 226 | py | Python | py/loadpage.py | katiehuang1221/onl_ds5_project_2 | dc9243d6bdc0c1952a761b2ed3e91a8548202b42 | [
"MIT"
] | null | null | null | py/loadpage.py | katiehuang1221/onl_ds5_project_2 | dc9243d6bdc0c1952a761b2ed3e91a8548202b42 | [
"MIT"
] | 1 | 2021-01-20T02:34:07.000Z | 2021-01-20T02:34:07.000Z | py/loadpage.py | katiehuang1221/onl_ds5_project_2 | dc9243d6bdc0c1952a761b2ed3e91a8548202b42 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
from IPython.core.display import display, HTML
def get_soup(url):
response = requests.get(url)
page = response.text
soup = BeautifulSoup(page, "lxml")
return soup
| 22.6 | 46 | 0.734513 | 30 | 226 | 5.5 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005435 | 0.185841 | 226 | 9 | 47 | 25.111111 | 0.891304 | 0 | 0 | 0 | 0 | 0 | 0.017699 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
5857c8cf49629013e2ff3dd558ee69aaefccf283 | 208 | py | Python | tests/test_most_invoices.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | tests/test_most_invoices.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | tests/test_most_invoices.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | from src import most_invoices
EXPECTED_RESULT = (14, 'Berlin')
def test_most_invoices() -> None:
tested_result = most_invoices.get_city_with_most_invoices()
assert tested_result == EXPECTED_RESULT
| 23.111111 | 63 | 0.774038 | 28 | 208 | 5.321429 | 0.607143 | 0.322148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011236 | 0.144231 | 208 | 8 | 64 | 26 | 0.825843 | 0 | 0 | 0 | 0 | 0 | 0.028846 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.4 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
585fbd132230f1c1b7c7d02416766ecbbe4a68a2 | 2,893 | py | Python | api/models/__init__.py | victorabarros/challenge-alloy-card | a3188fea298541130c24ebf4639d2af4700ba362 | [
"MIT"
] | null | null | null | api/models/__init__.py | victorabarros/challenge-alloy-card | a3188fea298541130c24ebf4639d2af4700ba362 | [
"MIT"
] | null | null | null | api/models/__init__.py | victorabarros/challenge-alloy-card | a3188fea298541130c24ebf4639d2af4700ba362 | [
"MIT"
] | null | null | null |
class Game:
def __init__(self, *args, **kwargs):
self.player_0 = 'white'
self.player_1 = 'black'
self._new_pieces_game()
self.current_player_turn = self.player_0
def _new_pieces_game(self):
self.board = {
0: {
0: Piece(self.player_0, "rook", 0, (0, 0))
1: Piece(self.player_0, "knight", 0, (0, 1))
2: Piece(self.player_0, "bishop", 0, (0, 2))
3: Piece(self.player_0, "king", 0, (0, 3))
4: Piece(self.player_0, "queen", 0, (0, 4))
5: Piece(self.player_0, "bishop", 1, (0, 5))
6: Piece(self.player_0, "knight", 1, (0, 6))
7: Piece(self.player_0, "rook", 1, (0, 7))
},
1: {
{ii: Piece(self.player_0, "pawn", ii, (1, ii))
},
7: {
0: Piece(self.player_1, "rook", 0, (7, 0))
1: Piece(self.player_1, "knight", 0, (7, 1))
2: Piece(self.player_1, "bishop", 0, (7, 2))
3: Piece(self.player_1, "king", 0, (7, 3))
4: Piece(self.player_1, "queen", 0, (7, 4))
5: Piece(self.player_1, "bishop", 1, (7, 5))
6: Piece(self.player_1, "knight", 1, (7, 6))
7: Piece(self.player_1, "rook", 1, (7, 7))
},
6: {
{ii: Piece(self.player_1, "pawn", ii, (6, ii))
}
}
pieces = {
self.player_0: {
'rook': {0: self.board[0][0], 1: self.board[0][7]},
'knight': {0: self.board[0][1], 1: self.board[0][6]},
'bishop': {0: self.board[0][2], 1: self.board[0][5]},
'king': {0: self.board[0][3]},
'queen': {0: self.board[0][4]},
'pawn': {}
},
self.player_1: {
'rook': {0: self.board[7][0], 1: self.board[7][7]},
'knight': {0: self.board[7][1], 1: self.board[7][6]},
'bishop': {0: self.board[7][2], 1: self.board[7][5]},
'king': {0: self.board[7][3]},
'queen': {0: self.board[7][4]},
'pawn': {}
}
}
for ii in range(0, 8):
pieces[self.player_0]["pawn"][ii] = self.board[1][ii]
pieces[self.player_1]["pawn"][ii] = [6][ii]
self.pieces = pieces
def find_piece(self, x_coordinate, y_coordinate):
piece = self.board.get(x_coordinate, {}).get(y_coordinate)
return piece
def to_dict(self):
return {'current_player_turn': self.current_player_turn,
'pieces': self.pieces}
class Piece:
def __init__(self, player, kind, ii, coordinate):
self.player = player
self.kind = kind
self.ii = ii
self.coordinate = coordinate
| 36.620253 | 69 | 0.444867 | 380 | 2,893 | 3.252632 | 0.115789 | 0.218447 | 0.218447 | 0.116505 | 0.470874 | 0.032362 | 0.032362 | 0 | 0 | 0 | 0 | 0.080992 | 0.372624 | 2,893 | 78 | 70 | 37.089744 | 0.6 | 0 | 0 | 0.028986 | 0 | 0 | 0.066044 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
58733d23c2ee586468a2e3bd18d3eae0569b7613 | 1,946 | py | Python | frequency_domain/dwt.py | StephenTaylor1998/Research | 193dc88d368caf5a458be24456c4f6d5045d341f | [
"Apache-2.0"
] | null | null | null | frequency_domain/dwt.py | StephenTaylor1998/Research | 193dc88d368caf5a458be24456c4f6d5045d341f | [
"Apache-2.0"
] | null | null | null | frequency_domain/dwt.py | StephenTaylor1998/Research | 193dc88d368caf5a458be24456c4f6d5045d341f | [
"Apache-2.0"
] | 1 | 2022-03-27T14:04:46.000Z | 2022-03-27T14:04:46.000Z | import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
import pywt
class DWTForward(nn.Module):
def __init__(self, wave_name="haar"):
super(DWTForward, self).__init__()
wavelet = pywt.Wavelet(wave_name)
ll = np.outer(wavelet.dec_lo, wavelet.dec_lo)
lh = np.outer(wavelet.dec_hi, wavelet.dec_lo)
hl = np.outer(wavelet.dec_lo, wavelet.dec_hi)
hh = np.outer(wavelet.dec_hi, wavelet.dec_hi)
filts = np.stack([ll[None, :, :], lh[None, :, :],
hl[None, :, :], hh[None, :, :]],
axis=0)
self.weight = nn.Parameter(
torch.tensor(filts).to(torch.get_default_dtype()),
requires_grad=False)
def forward(self, x):
channel = x.shape[1]
filters = torch.cat([self.weight, ] * channel, dim=0)
# in tf2 self.strides = [1, 1, 2, 2, 1]
# x = tf.nn.conv3d(x, self.filter, padding='VALID', strides=self.strides)
y = F.conv2d(x, filters, groups=channel, stride=2)
return y
class DWTInverse(nn.Module):
def __init__(self, wave_name="haar"):
super(DWTInverse, self).__init__()
wavelet = pywt.Wavelet(wave_name)
ll = np.outer(wavelet.dec_lo, wavelet.dec_lo)
lh = np.outer(wavelet.dec_hi, wavelet.dec_lo)
hl = np.outer(wavelet.dec_lo, wavelet.dec_hi)
hh = np.outer(wavelet.dec_hi, wavelet.dec_hi)
filts = np.stack([ll[None, :, :], lh[None, :, :],
hl[None, :, :], hh[None, :, :]],
axis=0)
self.weight = nn.Parameter(
torch.tensor(filts).to(torch.get_default_dtype()),
requires_grad=False)
def forward(self, x):
channel = int(x.shape[1] / 4)
filters = torch.cat([self.weight, ] * channel, dim=0)
y = F.conv_transpose2d(x, filters, groups=channel, stride=2)
return y | 38.156863 | 81 | 0.571429 | 263 | 1,946 | 4.064639 | 0.26616 | 0.149673 | 0.104771 | 0.127222 | 0.770814 | 0.770814 | 0.770814 | 0.770814 | 0.637979 | 0.570627 | 0 | 0.012876 | 0.281603 | 1,946 | 51 | 82 | 38.156863 | 0.751788 | 0.056012 | 0 | 0.697674 | 0 | 0 | 0.00436 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.093023 | false | 0 | 0.116279 | 0 | 0.302326 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5445ab0135e0f3ff0f80b808bab631bc81bb1f98 | 804 | py | Python | nsapiwrapper/exceptions.py | DolphDev/nsapiwrapper | cd67be445cfc4845f822ff815f3fb265f75061c9 | [
"MIT"
] | null | null | null | nsapiwrapper/exceptions.py | DolphDev/nsapiwrapper | cd67be445cfc4845f822ff815f3fb265f75061c9 | [
"MIT"
] | null | null | null | nsapiwrapper/exceptions.py | DolphDev/nsapiwrapper | cd67be445cfc4845f822ff815f3fb265f75061c9 | [
"MIT"
] | null | null | null | """Exceptions for this library"""
class NSBaseError(Exception):
"""Base Error for all custom exceptions"""
pass
class RateLimitReached(NSBaseError):
"""Rate Limit was reached"""
class NSServerBaseException(NSBaseError):
"""Exceptions that the server returns"""
pass
class APIError(NSServerBaseException):
"""General API Error"""
pass
class Forbidden(APIError):
pass
class ConflictError(APIError):
"""ConflictError from Server"""
pass
class NotFound(APIError):
"""Nation/Region Not Found"""
pass
class APIRateLimitBan(APIError):
"""Server has banned your IP"""
pass
class APIUsageError(APIError):
pass
class InternalServerError(APIError):
pass
class CloudflareServerError(APIError):
pass
class BadRequest(APIError):
pass | 18.272727 | 46 | 0.705224 | 81 | 804 | 7 | 0.518519 | 0.15873 | 0.119929 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189055 | 804 | 44 | 47 | 18.272727 | 0.869632 | 0.268657 | 0 | 0.478261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.478261 | 0 | 0 | 0.521739 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 3 |
5463fe7521a3910ac70e77bb4ec4fc1c354e171b | 35 | py | Python | pyble/const/characteristic/sensor_location.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 14 | 2015-03-30T23:11:36.000Z | 2020-04-07T00:57:12.000Z | pyble/const/characteristic/sensor_location.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 3 | 2016-05-17T06:11:07.000Z | 2017-05-15T16:43:09.000Z | pyble/const/characteristic/sensor_location.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 11 | 2016-03-11T08:53:03.000Z | 2019-03-11T21:32:13.000Z | NAME="Sensor Location"
UUID=0x2A5D
| 11.666667 | 22 | 0.8 | 5 | 35 | 5.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09375 | 0.085714 | 35 | 2 | 23 | 17.5 | 0.78125 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 0 | 0 | 0 | 0.171429 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5481d023ae1cb5111f38843d186a6cb4876d216a | 175 | py | Python | apps/oper/apps.py | dryprojects/MyBlog | ec04ba2bc658e96cddeb1d4766047ca8e89ff656 | [
"BSD-3-Clause"
] | 2 | 2021-08-17T13:29:21.000Z | 2021-09-04T05:00:01.000Z | apps/oper/apps.py | dryprojects/MyBlog | ec04ba2bc658e96cddeb1d4766047ca8e89ff656 | [
"BSD-3-Clause"
] | 1 | 2020-07-16T11:22:32.000Z | 2020-07-16T11:22:32.000Z | apps/oper/apps.py | dryprojects/MyBlog | ec04ba2bc658e96cddeb1d4766047ca8e89ff656 | [
"BSD-3-Clause"
] | 1 | 2020-09-18T10:41:59.000Z | 2020-09-18T10:41:59.000Z | from django.apps import AppConfig
class OperConfig(AppConfig):
name = 'oper'
verbose_name = '用户操作管理'
def ready(self):
from oper import signals
| 17.5 | 34 | 0.64 | 20 | 175 | 5.55 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 175 | 9 | 35 | 19.444444 | 0.888 | 0 | 0 | 0 | 0 | 0 | 0.060241 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
54a054f1ed42ee815b1ac8ae21d88b15ea91f8bb | 154 | py | Python | pybo/inits/__init__.py | hfukada/pybo | 3be57adad901fcd8d45b8ee2af7c6032ab47611d | [
"BSD-2-Clause"
] | 115 | 2015-01-21T21:31:22.000Z | 2021-08-08T17:10:16.000Z | pybo/inits/__init__.py | hfukada/pybo | 3be57adad901fcd8d45b8ee2af7c6032ab47611d | [
"BSD-2-Clause"
] | 5 | 2016-02-24T16:00:01.000Z | 2020-12-21T00:28:30.000Z | pybo/inits/__init__.py | hfukada/pybo | 3be57adad901fcd8d45b8ee2af7c6032ab47611d | [
"BSD-2-Clause"
] | 35 | 2015-02-27T15:27:36.000Z | 2020-08-19T07:43:53.000Z | """
Initialization methods.
"""
# pylint: disable=wildcard-import
from .methods import *
from . import methods
__all__ = []
__all__ += methods.__all__
| 12.833333 | 33 | 0.714286 | 16 | 154 | 6.125 | 0.5 | 0.204082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.155844 | 154 | 11 | 34 | 14 | 0.753846 | 0.363636 | 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 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
49a8f69931a09da4e91b5822491e86963189f463 | 223 | py | Python | papermerge/apps/e_invoice/apps.py | francescocarzaniga/e_invoice_papermerge | e7a4a3fdab4263c02983b638f873db8d11e89041 | [
"Apache-2.0"
] | 1 | 2021-02-15T06:38:32.000Z | 2021-02-15T06:38:32.000Z | papermerge/apps/e_invoice/apps.py | francescocarzaniga/e_invoice_papermerge | e7a4a3fdab4263c02983b638f873db8d11e89041 | [
"Apache-2.0"
] | null | null | null | papermerge/apps/e_invoice/apps.py | francescocarzaniga/e_invoice_papermerge | e7a4a3fdab4263c02983b638f873db8d11e89041 | [
"Apache-2.0"
] | 1 | 2021-02-15T06:38:35.000Z | 2021-02-15T06:38:35.000Z | from django.apps import AppConfig
class EInvoiceConfig(AppConfig):
name = 'papermerge.apps.e_invoice'
label = 'e_invoice'
# def ready(self):
# from papermerge.apps.data_retention import signals # noqa
| 22.3 | 67 | 0.713004 | 27 | 223 | 5.777778 | 0.703704 | 0.179487 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197309 | 223 | 9 | 68 | 24.777778 | 0.871508 | 0.363229 | 0 | 0 | 0 | 0 | 0.251852 | 0.185185 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
49ad08a13c544d4263d6239603d117433df3bf65 | 53 | py | Python | src/poliastro/_math/integrate.py | DhruvJ22/poliastro | ac5fafc6d054b2c545e111e5a6aa32259998074a | [
"MIT"
] | 8 | 2015-05-09T17:21:57.000Z | 2020-01-28T06:59:18.000Z | src/poliastro/_math/integrate.py | DhruvJ22/poliastro | ac5fafc6d054b2c545e111e5a6aa32259998074a | [
"MIT"
] | 4 | 2015-12-29T13:08:01.000Z | 2019-12-27T12:58:04.000Z | src/poliastro/_math/integrate.py | DhruvJ22/poliastro | ac5fafc6d054b2c545e111e5a6aa32259998074a | [
"MIT"
] | 1 | 2016-10-05T08:34:44.000Z | 2016-10-05T08:34:44.000Z | from scipy.integrate import quad
__all__ = ["quad"]
| 13.25 | 32 | 0.735849 | 7 | 53 | 5 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150943 | 53 | 3 | 33 | 17.666667 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0.075472 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
49dc810a61e2972f79b20f3f39e3b0c03cad34a5 | 552 | py | Python | Data Structures/Python/find-the-parity-outier.py | KhushMody/Ds-Algo-HacktoberFest | 2cb5bdcfcdcb87b67ee31941cc9afc466507a05b | [
"MIT"
] | 12 | 2020-10-04T06:48:29.000Z | 2021-02-16T17:54:04.000Z | Data Structures/Python/find-the-parity-outier.py | KhushMody/Ds-Algo-HacktoberFest | 2cb5bdcfcdcb87b67ee31941cc9afc466507a05b | [
"MIT"
] | 14 | 2020-10-04T09:09:52.000Z | 2021-10-16T19:59:23.000Z | Data Structures/Python/find-the-parity-outier.py | KhushMody/Ds-Algo-HacktoberFest | 2cb5bdcfcdcb87b67ee31941cc9afc466507a05b | [
"MIT"
] | 55 | 2020-10-04T03:09:25.000Z | 2021-10-16T09:00:12.000Z | # You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely comprised of odd integers or entirely comprised of even integers except for a single integer N. Write a method that takes the array as an argument and returns this "outlier" N.
# Examples
# find_outlier([2, 4, 6, 7]) => 7
# find_outlier([3, 7, 11, 2]) => 2
def find_outlier(integers):
l = list(filter(lambda x: x%2==0, integers))
return list(filter(lambda x: x%2, integers))[0] if len(l) > 1 else l[0]
| 61.333333 | 317 | 0.711957 | 101 | 552 | 3.861386 | 0.623762 | 0.084615 | 0.097436 | 0.087179 | 0.097436 | 0.097436 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0.184783 | 552 | 8 | 318 | 69 | 0.826667 | 0.70471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
b708d72fd35c4c8f3891e434790ce2fd08903cc3 | 2,238 | py | Python | setup.py | hivesolutions/pconvert | ff4d09400dc1542080d86f3f99c702ab0ef1405d | [
"Apache-1.1"
] | 4 | 2020-04-18T08:38:42.000Z | 2020-12-10T01:54:57.000Z | setup.py | hivesolutions/pconvert | ff4d09400dc1542080d86f3f99c702ab0ef1405d | [
"Apache-1.1"
] | 3 | 2020-09-09T16:40:47.000Z | 2020-11-11T13:21:58.000Z | setup.py | hivesolutions/pconvert | ff4d09400dc1542080d86f3f99c702ab0ef1405d | [
"Apache-1.1"
] | 4 | 2016-09-28T10:32:42.000Z | 2020-11-11T12:39:02.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import setuptools
setuptools.setup(
name = "pconvert-python",
version = "0.4.1",
author = "Hive Solutions Lda.",
author_email = "development@hive.pt",
description = "PNG Convert",
license = "Apache License, Version 2.0",
keywords = "pconvert converted compositor",
url = "http://pconvert.hive.pt",
packages = [
"pconvert_py",
"pconvert_py.test"
],
test_suite = "pconvert_py.test",
package_dir = {
"" : os.path.normpath("src/python")
},
ext_modules = [
setuptools.Extension(
"pconvert",
include_dirs = ["src/pconvert", "/usr/local/include"],
libraries = [] if os.name in ("nt",) else ["m", "png"],
library_dirs = ["/usr/local/lib"],
extra_compile_args = [] if os.name in ("nt",) else [
"-O3",
"-finline-functions",
"-Winline"
],
sources = [
"src/pconvert/extension.c",
"src/pconvert/opencl.c",
"src/pconvert/pconvert.c",
"src/pconvert/stdafx.c",
"src/pconvert/structs.c",
"src/pconvert/util.c"
],
define_macros = [
("PCONVERT_EXTENSION", None),
("PASS_ERROR", None)
]
)
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Utilities",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.0",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7"
]
)
| 33.402985 | 68 | 0.498213 | 207 | 2,238 | 5.318841 | 0.449275 | 0.189827 | 0.249773 | 0.188919 | 0.029064 | 0.029064 | 0 | 0 | 0 | 0 | 0 | 0.019404 | 0.355228 | 2,238 | 66 | 69 | 33.909091 | 0.74359 | 0.016979 | 0 | 0.064516 | 0 | 0 | 0.46576 | 0.052064 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.016129 | 0.032258 | 0 | 0.032258 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
b71a0544974b49622ebf65934372dde5c8e554ce | 363 | py | Python | backend/api/models.py | pranav2812/9th-inter-iit-traffic-sign | 27d3f14ce8235d5cdedb4bb2dbaa10e436f9b06b | [
"Apache-2.0"
] | 1 | 2021-04-13T07:56:17.000Z | 2021-04-13T07:56:17.000Z | backend/api/models.py | Tech-Meet-Solutions/Bosch-CV-9th-InterIIT | 57f4bd915c4a1e2146a77210e92d756e1cc3722a | [
"Apache-2.0"
] | 1 | 2021-04-09T11:52:01.000Z | 2021-04-09T12:21:36.000Z | backend/api/models.py | pranav2812/9th-inter-iit-traffic-sign | 27d3f14ce8235d5cdedb4bb2dbaa10e436f9b06b | [
"Apache-2.0"
] | 3 | 2021-04-15T10:43:06.000Z | 2021-05-16T00:36:39.000Z | from django.db import models
class File(models.Model):
id = models.AutoField(primary_key= True)
b64 = models.TextField(blank=False, null=False)
lastedit = models.DateTimeField(auto_now= True)
image_class = models.TextField(blank = True, default = "")
labels = models.TextField(blank = True, default= "")
def __str__(self):
return f"Image no.: {self.id}"
| 33 | 59 | 0.730028 | 50 | 363 | 5.16 | 0.62 | 0.174419 | 0.232558 | 0.186047 | 0.24031 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006349 | 0.132231 | 363 | 10 | 60 | 36.3 | 0.812698 | 0 | 0 | 0 | 0 | 0 | 0.055096 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.111111 | 0.111111 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
b71ce22664f675b460275b3803f757d02f90c92c | 189 | py | Python | release/Server/__init__.py | cdfmlr/readquickly_WeChatSmallApp | e489c507bfbf81a9a43872919000b99b803a079c | [
"MIT"
] | 2 | 2019-04-03T13:19:32.000Z | 2019-04-03T23:20:27.000Z | release/Server/__init__.py | cdfmlr/readquickly_WeChatSmallApp | e489c507bfbf81a9a43872919000b99b803a079c | [
"MIT"
] | 1 | 2019-04-03T16:44:36.000Z | 2019-04-03T23:16:35.000Z | release/Server/__init__.py | A666AHL/readquickly_WeChatSmallApp | 7324b7bdd7cf6b7a77e127969077d1c84ada189d | [
"MIT"
] | 2 | 2019-04-04T08:38:08.000Z | 2019-04-04T09:01:42.000Z | '''
# ReadQuickly 后端
```
|-- Server
|-- __init__.py
|-- server.py (请求服务器)
|-- content.py (整合响应数据)
|-- spider (爬虫包)
|-- weather (天气包)
|-- notice (通知包)
```
''' | 12.6 | 28 | 0.449735 | 17 | 189 | 4.764706 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.301587 | 189 | 15 | 29 | 12.6 | 0.613636 | 0.94709 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b72e4a239b1f333096c89a02d6bb509de560e64e | 252 | py | Python | colibris/docs/openapi/__init__.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 6 | 2019-06-22T19:36:10.000Z | 2021-11-16T08:07:21.000Z | colibris/docs/openapi/__init__.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 34 | 2019-07-07T18:01:41.000Z | 2020-11-01T16:14:58.000Z | colibris/docs/openapi/__init__.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 2 | 2020-09-01T13:07:17.000Z | 2021-07-29T12:16:29.000Z | from os.path import abspath, join, dirname
from colibris.conf import settings
STATIC_PATH = abspath(join(dirname(__file__), 'swagger'))
UI_URL = settings.API_DOCS_URL
STATIC_URL = '{}/static'.format(UI_URL)
APISPEC_URL = '{}/apispec'.format(UI_URL)
| 25.2 | 57 | 0.761905 | 37 | 252 | 4.864865 | 0.513514 | 0.083333 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103175 | 252 | 9 | 58 | 28 | 0.79646 | 0 | 0 | 0 | 0 | 0 | 0.103175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
b72ea37d9a980314ac78bb261e8ab6314ebd4e84 | 961 | py | Python | qcloudsdkbatch/TerminateTaskInstanceRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkbatch/TerminateTaskInstanceRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkbatch/TerminateTaskInstanceRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class TerminateTaskInstanceRequest(Request):
def __init__(self):
super(TerminateTaskInstanceRequest, self).__init__(
'batch', 'qcloudcliV1', 'TerminateTaskInstance', 'batch.api.qcloud.com')
def get_JobId(self):
return self.get_params().get('JobId')
def set_JobId(self, JobId):
self.add_param('JobId', JobId)
def get_TaskInstanceIndex(self):
return self.get_params().get('TaskInstanceIndex')
def set_TaskInstanceIndex(self, TaskInstanceIndex):
self.add_param('TaskInstanceIndex', TaskInstanceIndex)
def get_TaskName(self):
return self.get_params().get('TaskName')
def set_TaskName(self, TaskName):
self.add_param('TaskName', TaskName)
def get_Version(self):
return self.get_params().get('Version')
def set_Version(self, Version):
self.add_param('Version', Version)
| 28.264706 | 84 | 0.681582 | 105 | 961 | 6.009524 | 0.27619 | 0.038035 | 0.088748 | 0.107765 | 0.164818 | 0.164818 | 0 | 0 | 0 | 0 | 0 | 0.002581 | 0.193548 | 961 | 33 | 85 | 29.121212 | 0.811613 | 0.021852 | 0 | 0 | 0 | 0 | 0.139659 | 0.022388 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0 | 0.047619 | 0.190476 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
b72fded642f589b2e698b4de11aaec30fbbd5f3f | 5,429 | py | Python | graphit/graph_networkx.py | py-graphit/py-graphit | 533ef47e279fc07d9a88f86cc9d19f09d56176f9 | [
"Apache-2.0"
] | 1 | 2018-12-02T18:56:34.000Z | 2018-12-02T18:56:34.000Z | graphit/graph_networkx.py | py-graphit/py-graphit | 533ef47e279fc07d9a88f86cc9d19f09d56176f9 | [
"Apache-2.0"
] | null | null | null | graphit/graph_networkx.py | py-graphit/py-graphit | 533ef47e279fc07d9a88f86cc9d19f09d56176f9 | [
"Apache-2.0"
] | 1 | 2018-12-02T15:29:41.000Z | 2018-12-02T15:29:41.000Z | # -*- coding: utf-8 -*-
"""
file: graph_networkx.py
Provides a NetworkX compliant Graph class.
"""
from graphit.graph import GraphBase
from graphit.graph_exceptions import GraphitException, GraphitNodeNotFound
from graphit.graph_algorithms import degree, size
from graphit.graph_utils.graph_utilities import graph_undirectional_to_directional, graph_directional_to_undirectional
class NetworkXGraph(GraphBase):
def __init__(self, *args, **kwargs):
"""
Init a NetworkX graph type
Differences with regular Graph:
- 'auto_nid' is unknown in NetworkX, set to False
:param args: arguments to Graph __init__
:param kwargs: keyword arguments to Graph __init__
"""
kwargs['auto_nid'] = False
super(NetworkXGraph, self).__init__(*args, **kwargs)
def __contains__(self, node):
return self.has_node(node)
def __getitem__(self, key):
"""
Implement class __getitem__
Return adjacency based on node ID or edge on edge ID.
:return: adjacency nodes or an edge
:rtype: :py:list
"""
# Return edge using edge ID
if isinstance(key, tuple):
return self.edges[key]
# Return adjacency nodes
# TODO: this should return a view but that is not fully compliant to NetworkX yet
else:
return dict([(nid, self.nodes[nid]) for nid in self.adjacency[key]])
def __iter__(self):
"""
Implement class __iter__
Iterate over nodes IDs
:return: Node identifier (nid)
"""
# Always reset node view
for nid in self.nodes:
yield nid
@property
def adj(self):
return self.adjacency
def add_nodes_from(self, nodes, **kwargs):
return self.add_nodes(nodes, **kwargs)
def add_edges_from(self, edges, **kwargs):
return self.add_edges(edges, **kwargs)
def add_weighted_edges_from(self, edges, weight='weight', **kwargs):
"""
Add edges with a numeric weight factor
:param edges: edges as iterable of tuples with length 3 containing
(node1, node2, weight value)
:param weight: edge weight attribute name
:type weight: :py:str
:param kwargs: additional keyword arguments passed to add_edge
:return: list of edge ids for the objects added in
the same order as th input iterable.
:rtype: :py:list
"""
return self.add_edges(edges, weight=weight, **kwargs)
@property
def degree(self):
return degree(self, self.nodes.keys())
def get_edge_data(self, n1, n2, default=None):
edge = (n1, n2)
if edge not in self.edges:
return default
return self.edges[edge]
def has_edge(self, n1, n2):
return (n1, n2) in self.edges
def has_node(self, node):
return node in self.nodes
def is_directed(self):
"""
Return graph directionality
A graph with mixed edges (partly directed, partly undirected) is
considered a directed graph.
:return: directed or undirected graph
:rtype: :py:bool
"""
return self.directed
def nbunch_iter(self, nodes=None):
if nodes:
nodes = [node for node in nodes if node in self.nodes]
else:
nodes = self.nodes.keys()
return self.iternodes(nodes)
def neighbors(self, node):
if node not in self.nodes:
raise GraphitNodeNotFound()
return iter(self.adjacency[node])
def number_of_edges(self, first=None, second=None):
if first is None:
return int(self.size())
if second is not None and second in self.adjacency[first]:
return 1
return 0
def order(self):
"""
Return the number of nodes in the graph similar to __len__
:return: Number of nodes
:rtype: :py:int
"""
return len(self)
number_of_nodes = order
def remove_nodes_from(self, *args, **kwargs):
return self.remove_nodes(*args, **kwargs)
def remove_edges_from(self, *args, **kwargs):
return self.remove_edges(*args, **kwargs)
def size(self, weight=None):
return size(self, weight=weight)
def subgraph(self, nodes):
return self.getnodes(nodes)
def edge_subgraph(self, edges):
return self.getedges(edges)
def to_directed(self):
return graph_undirectional_to_directional(self)
def to_undirected(self):
return graph_directional_to_undirectional(self)
def update(self, edges=None, nodes=None):
if edges is not None:
if nodes is not None:
self.add_nodes(nodes)
self.add_edges(edges)
else:
if hasattr(edges, 'nodes') and hasattr(edges, 'edges'):
for node, attr in edges.nodes.items():
self.add_node(node, **attr)
for edge, attr in edges.edges.items():
self.add_edge(*edge, **attr)
else:
self.add_edges(edges)
elif nodes is not None:
self.add_nodes(nodes)
else:
raise GraphitException("update needs nodes or edges input")
| 25.729858 | 118 | 0.596611 | 660 | 5,429 | 4.762121 | 0.234848 | 0.041362 | 0.020363 | 0.021635 | 0.055997 | 0.041362 | 0.041362 | 0.019726 | 0 | 0 | 0 | 0.00378 | 0.317738 | 5,429 | 210 | 119 | 25.852381 | 0.844762 | 0.252717 | 0 | 0.120879 | 0 | 0 | 0.01531 | 0 | 0 | 0 | 0 | 0.004762 | 0 | 1 | 0.274725 | false | 0 | 0.043956 | 0.153846 | 0.626374 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
b73d9b6a2ed597b2e555f0e71f5965ac6e15c17b | 462 | py | Python | remcall/schema/typeref.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | remcall/schema/typeref.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | remcall/schema/typeref.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | class TypeRef:
'''Represents temporary type references by an integer; to be resolved
to actual types later
'''
def __init__(self, type_ref: int):
self.type_ref = type_ref
def __hash__(self):
return hash(self.type_ref)
def __eq__(self, other):
return isinstance(other, TypeRef) and self.type_ref == other.type_ref
def __repr__(self):
return '{}({})'.format(self.__class__.__name__, self.type_ref)
| 28.875 | 77 | 0.655844 | 61 | 462 | 4.459016 | 0.47541 | 0.180147 | 0.202206 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.235931 | 462 | 15 | 78 | 30.8 | 0.770538 | 0.190476 | 0 | 0 | 0 | 0 | 0.016854 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.444444 | false | 0 | 0 | 0.333333 | 0.888889 | 0 | 0 | 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 | 0 | 0 | 0 | 3 |
b7447c7e63cef72744a2596b6bfed0bc8c930ff6 | 147 | py | Python | plugins/Hikvision_app.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | 22 | 2016-09-01T08:27:07.000Z | 2021-01-11T13:32:59.000Z | plugins/Hikvision_app.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | null | null | null | plugins/Hikvision_app.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | 20 | 2015-11-07T19:09:48.000Z | 2018-05-02T03:10:41.000Z | #!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_file(pluginname, "doc/page/login.asp", "Hikvision")
| 21 | 74 | 0.721088 | 21 | 147 | 4.952381 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007692 | 0.115646 | 147 | 6 | 75 | 24.5 | 0.792308 | 0.244898 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3fb0b9f6019a06b844fd3dd799c2b173e97e1ff6 | 448 | py | Python | Core/solar/performance_ratio.py | ncatunda/hive | 721731ce83c9ccd4ff1db224824a234035fbcd30 | [
"MIT"
] | null | null | null | Core/solar/performance_ratio.py | ncatunda/hive | 721731ce83c9ccd4ff1db224824a234035fbcd30 | [
"MIT"
] | null | null | null | Core/solar/performance_ratio.py | ncatunda/hive | 721731ce83c9ccd4ff1db224824a234035fbcd30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The data is (should be) based on the lecture Energie und Klimasysteme II,
Erneuerbare Energieerzeugung am Gebäude, FS 2019, Folie 30,
"""
from __future__ import print_function
def get_performance_ratio(performance_scenario):
# return "\n".join("{key}: {value}".format(key=key, value=value)
# for key, value in performance_scenario.items())
return performance_scenario["performance ratio"] | 37.333333 | 74 | 0.705357 | 57 | 448 | 5.368421 | 0.736842 | 0.186275 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01897 | 0.176339 | 448 | 12 | 75 | 37.333333 | 0.810298 | 0.636161 | 0 | 0 | 0 | 0 | 0.11039 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0.333333 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 1 | 0 | 0 | 0 | 3 |
3fe32adbae6d30f0649147cee237cf1904d94533 | 99 | py | Python | ui_automation_core/helpers/browser/alert_action_type.py | Harshavardhanchowdary/python-ui-testing-automation | a624c6b945276c05722be2919d95aa9e5539d0d0 | [
"MIT"
] | null | null | null | ui_automation_core/helpers/browser/alert_action_type.py | Harshavardhanchowdary/python-ui-testing-automation | a624c6b945276c05722be2919d95aa9e5539d0d0 | [
"MIT"
] | null | null | null | ui_automation_core/helpers/browser/alert_action_type.py | Harshavardhanchowdary/python-ui-testing-automation | a624c6b945276c05722be2919d95aa9e5539d0d0 | [
"MIT"
] | null | null | null | from enum import Enum, auto
class AlertActionType(Enum):
ACCEPT = auto()
DISMISS = auto() | 16.5 | 28 | 0.676768 | 12 | 99 | 5.583333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 99 | 6 | 29 | 16.5 | 0.87013 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3fed58a2f0d55e3c995e8a4ab026bd1e2fa3c343 | 59 | py | Python | gmaploader/__init__.py | cormac-rynne/gmaploader | eec679af9a5d36b691bde05ffd6043bfef7e1acf | [
"MIT"
] | 2 | 2022-02-02T16:41:17.000Z | 2022-03-16T08:43:18.000Z | gmaploader/__init__.py | cormac-rynne/gmaploader | eec679af9a5d36b691bde05ffd6043bfef7e1acf | [
"MIT"
] | null | null | null | gmaploader/__init__.py | cormac-rynne/gmaploader | eec679af9a5d36b691bde05ffd6043bfef7e1acf | [
"MIT"
] | null | null | null | __version__ = '0.1.1'
from .gmaploader import GMapLoader
| 11.8 | 34 | 0.745763 | 8 | 59 | 5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06 | 0.152542 | 59 | 4 | 35 | 14.75 | 0.74 | 0 | 0 | 0 | 0 | 0 | 0.086207 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
3ff664299cdf95218a7f9411379521d7b5cdbaa4 | 430 | py | Python | libs/msfpayload.py | darkoperator/SideStep | 2c75af77ee2241595de4c65d7e4f8342dcc0bb50 | [
"BSL-1.0"
] | 3 | 2015-09-16T16:09:14.000Z | 2017-01-14T21:53:08.000Z | libs/msfpayload.py | darkoperator/SideStep | 2c75af77ee2241595de4c65d7e4f8342dcc0bb50 | [
"BSL-1.0"
] | null | null | null | libs/msfpayload.py | darkoperator/SideStep | 2c75af77ee2241595de4c65d7e4f8342dcc0bb50 | [
"BSL-1.0"
] | 2 | 2016-04-22T04:44:50.000Z | 2021-12-18T15:12:22.000Z | """
Generates the Meterpreter payload from msfvenom
"""
import subprocess
def payloadGenerator(msfpath, msfvenom, msfpayload, ip, port):
payload = subprocess.Popen('ruby ' + msfpath + msfvenom + ' -p ' + msfpayload + ' LHOST=' + ip + ' LPORT=' + str(port) + ' EXITFUNC=thread -e x86/alpha_mixed -f raw BufferRegister=EAX', stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE).communicate()[0]
return payload | 53.75 | 275 | 0.727907 | 51 | 430 | 6.117647 | 0.72549 | 0.134615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008043 | 0.132558 | 430 | 8 | 276 | 53.75 | 0.828418 | 0.109302 | 0 | 0 | 1 | 0 | 0.223404 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3ffc66c1a55abdcb165f5612bc7ea3c265086406 | 246 | py | Python | consts.py | mauroreisvieira/sublime-tailwindcss-intellisense | 140edc90c59c045fc8a9d7f6bcff0b727660ee64 | [
"MIT"
] | null | null | null | consts.py | mauroreisvieira/sublime-tailwindcss-intellisense | 140edc90c59c045fc8a9d7f6bcff0b727660ee64 | [
"MIT"
] | null | null | null | consts.py | mauroreisvieira/sublime-tailwindcss-intellisense | 140edc90c59c045fc8a9d7f6bcff0b727660ee64 | [
"MIT"
] | null | null | null | import os
# @see https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss
EXTENSION_UID = "bradlc.vscode-tailwindcss"
EXTENSION_VERSION = "0.5.2"
SERVER_BINARY_PATH = os.path.join("extension", "dist", "server", "index.js")
| 30.75 | 84 | 0.764228 | 33 | 246 | 5.575758 | 0.757576 | 0.130435 | 0.25 | 0.347826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013216 | 0.077236 | 246 | 7 | 85 | 35.142857 | 0.797357 | 0.333333 | 0 | 0 | 0 | 0 | 0.351852 | 0.154321 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 0 | 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 | 0 | 0 | 3 |
b200470663bb7eee02e9c82ffb877d8af91ad93e | 216 | py | Python | aiobotocore_refreshable_credentials/__init__.py | aweber/aiobotocore-refreshable-credentials | 3310d3fa29ac657f7cd5f64829da5f9b12c7a86d | [
"BSD-3-Clause"
] | null | null | null | aiobotocore_refreshable_credentials/__init__.py | aweber/aiobotocore-refreshable-credentials | 3310d3fa29ac657f7cd5f64829da5f9b12c7a86d | [
"BSD-3-Clause"
] | 2 | 2021-05-21T14:18:52.000Z | 2022-03-15T12:34:45.000Z | aiobotocore_refreshable_credentials/__init__.py | aweber/aiobotocore-refreshable-credentials | 3310d3fa29ac657f7cd5f64829da5f9b12c7a86d | [
"BSD-3-Clause"
] | 1 | 2021-06-18T18:37:15.000Z | 2021-06-18T18:37:15.000Z | """
aiobotocore-refreshable-credentials
===================================
"""
from aiobotocore_refreshable_credentials.session import get_session
version = '1.0.3'
__all__ = [
'get_session',
'version'
]
| 15.428571 | 67 | 0.606481 | 19 | 216 | 6.473684 | 0.631579 | 0.357724 | 0.536585 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015957 | 0.12963 | 216 | 13 | 68 | 16.615385 | 0.638298 | 0.328704 | 0 | 0 | 0 | 0 | 0.169118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b20aba712b1ab01e3fb65465b63bc20687698132 | 123 | py | Python | x_3_4.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | x_3_4.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | 1 | 2021-11-13T08:03:04.000Z | 2021-11-13T08:03:04.000Z | x_3_4.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | # x_3_4
#
# mathモジュールからfloor関数だけインポートして切り捨て計算を行ってください
from statistics import mean
data = [7, 4, 3, 9]
print(mean(data))
| 12.3 | 43 | 0.739837 | 16 | 123 | 5.5625 | 0.75 | 0.179775 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057692 | 0.154472 | 123 | 9 | 44 | 13.666667 | 0.798077 | 0.382114 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 3 |
b777b683adb530c1229387728fa21c1239e09fa6 | 23 | py | Python | backend/lorre/__init__.py | nhurman/Lorre | 9a19d00809bd3850d288c9ef1166da016d29b819 | [
"MIT"
] | null | null | null | backend/lorre/__init__.py | nhurman/Lorre | 9a19d00809bd3850d288c9ef1166da016d29b819 | [
"MIT"
] | null | null | null | backend/lorre/__init__.py | nhurman/Lorre | 9a19d00809bd3850d288c9ef1166da016d29b819 | [
"MIT"
] | null | null | null | __author__ = 'nhurman'
| 11.5 | 22 | 0.73913 | 2 | 23 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 23 | 1 | 23 | 23 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0.304348 | 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 | 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 | 3 |
b786deb138ef01a31f9f64e2908250e1c39d81e6 | 253 | py | Python | thippiproject/modelapp/admin.py | Anandgowda18/djangocomplete | c9eebe7834e404c73deca295289142a1e95ab573 | [
"Apache-2.0"
] | null | null | null | thippiproject/modelapp/admin.py | Anandgowda18/djangocomplete | c9eebe7834e404c73deca295289142a1e95ab573 | [
"Apache-2.0"
] | null | null | null | thippiproject/modelapp/admin.py | Anandgowda18/djangocomplete | c9eebe7834e404c73deca295289142a1e95ab573 | [
"Apache-2.0"
] | 1 | 2021-08-31T10:20:49.000Z | 2021-08-31T10:20:49.000Z | from django.contrib import admin
from modelapp.models import Project
# Register your models here.
class Projectadmin(admin.ModelAdmin):
list_display = ['startdate','enddate','name','assignedto','priority']
admin.site.register(Project,Projectadmin) | 31.625 | 73 | 0.786561 | 30 | 253 | 6.6 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094862 | 253 | 8 | 74 | 31.625 | 0.864629 | 0.102767 | 0 | 0 | 0 | 0 | 0.168142 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.8 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b7a030be152f3c0e93089efb532b4fde2f3761dd | 17,258 | py | Python | dependencies/svgwrite/examples/ltattrie/tiling_part_5.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 21 | 2015-01-16T05:10:02.000Z | 2021-06-11T20:48:15.000Z | dependencies/svgwrite/examples/ltattrie/tiling_part_5.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 1 | 2019-09-09T12:10:27.000Z | 2020-05-22T10:12:14.000Z | dependencies/svgwrite/examples/ltattrie/tiling_part_5.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 2 | 2015-05-03T04:51:08.000Z | 2018-08-24T08:28:53.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import math, sys
import svgwrite
#
# http://www.w3.org/TR/SVG11/struct.html#UseElement
#
# For more information on tesselation / tiling see http://en.wikipedia.org/wiki/Wallpaper_group
# The organization of these tilings are from the interesting book
# Designing Testellations: The Secrets of Interlocking Patterns by Jinny Beyer.
PROGNAME = sys.argv[0].rstrip('.py')
def create_svg(name):
svg_size_width = 900
svg_size_height = 1600
font_size = 20
square_size = 30
title1 = name + ': Part 5 tiling with multiple def, groups, use, translate and scale.'
sqrt3 = math.sqrt(3) # do this calc once instead of repeating the calc many times.
dwg = svgwrite.Drawing(name, (svg_size_width, svg_size_height), debug=True)
# ####################
# p3m1 - Mirror and Three rotations
# - Equilateral triangle mirrored, rotated
# All three sides are the same length, all three angles are 60 degrees.
# The height of the triangle h = sqrt(3)/2.0 * length of a side
# The centre of the triangle is sqrt(3)/6.0 * length of a side
defs_g_trieq_size_x = square_size
defs_g_trieq_size_y = defs_g_trieq_size_x * sqrt3 / 2.0
defs_g_trieq_centre = sqrt3 / 6.0 * defs_g_trieq_size_x
# width of equilateral triangle at the centre
defs_g_trieq_centre_size_x = defs_g_trieq_size_x - defs_g_trieq_size_x * defs_g_trieq_centre / defs_g_trieq_size_y
# defs_g_trieq = dwg.defs.add(dwg.g(id='defs_g_trieq', clip_path='url(#cliptrieq)'))
defs_g_trieq = dwg.defs.add(dwg.g(id='defs_g_trieq'))
defs_g_trieq.add(dwg.polygon([(0, -defs_g_trieq_size_y + defs_g_trieq_centre), (defs_g_trieq_size_x / 2.0, defs_g_trieq_centre),
(-defs_g_trieq_size_x / 2.0, defs_g_trieq_centre)], stroke='none'))
defs_g_trieq.add(dwg.polygon([(-defs_g_trieq_size_x / 2.0, defs_g_trieq_centre), (-defs_g_trieq_centre_size_x / 2.0, 0),
(defs_g_trieq_centre_size_x / 2.0, 0), (0, defs_g_trieq_centre)], stroke='none', fill='yellow'))
# Create mirror of the equilateral triangle.
defs_g_trieq_m = dwg.defs.add(dwg.g(id='defs_g_trieq_m'))
defs_g_trieq_m.add(dwg.use(defs_g_trieq, insert=(0, 0)))
defs_g_trieq_m.scale(-1, -1)
# Create combined cell
defs_g_trieq_cc_size_x = 1.5 * defs_g_trieq_size_x
defs_g_trieq_cc_size_y = defs_g_trieq_size_y
defs_g_trieq_cc = dwg.defs.add(dwg.g(id='defs_g_trieq_cc'))
defs_g_trieq_cc.add(dwg.use(defs_g_trieq, insert=(-defs_g_trieq_size_x / 4.0, defs_g_trieq_size_y / 2.0 - defs_g_trieq_centre)))
defs_g_trieq_cc.add(dwg.use(defs_g_trieq_m, insert=(defs_g_trieq_size_x / 4.0, -(defs_g_trieq_size_y / 2.0 - defs_g_trieq_centre))))
# Create rotations of combined cell
defs_g_trieq_cc_120 = dwg.defs.add(dwg.g(id='defs_g_trieq_cc_120'))
defs_g_trieq_cc_120.add(dwg.use(defs_g_trieq_cc, insert=(0, 0), fill='mediumblue'))
defs_g_trieq_cc_120.rotate(120, center=(0, 0))
defs_g_trieq_cc_m120 = dwg.defs.add(dwg.g(id='defs_g_trieq_cc_m120'))
defs_g_trieq_cc_m120.add(dwg.use(defs_g_trieq_cc, insert=(0, 0), fill='navy'))
defs_g_trieq_cc_m120.rotate(-120, center=(0, 0))
# Create pattern from rotations of combined cell
defs_g_trieq_pattern_size_x = 2 * defs_g_trieq_size_x
defs_g_trieq_pattern_size_y = 2 * defs_g_trieq_size_y
defs_g_trieq_pattern = dwg.defs.add(dwg.g(id='defs_g_trieq_pattern'))
defs_g_trieq_pattern.add(dwg.use(defs_g_trieq_cc, insert=(-defs_g_trieq_size_x / 4.0, -defs_g_trieq_cc_size_y / 2.0)))
defs_g_trieq_pattern.add(dwg.use(defs_g_trieq_cc_120, insert=(defs_g_trieq_size_x / 2.0, 0)))
defs_g_trieq_pattern.add(dwg.use(defs_g_trieq_cc_m120, insert=(-defs_g_trieq_size_x / 4.0, defs_g_trieq_cc_size_y / 2.0)))
# ####################
# p31m - Three rotations and a mirror
# - A Kite shape, half hexagon, and half of a 60 degree diamond will all work for this
# symmetry. This one will use a kite.
# 30, 60, 90 angle triangle
# The length of the sides are 1:sqrt(3):2 2 is the hypotenuse
# invsqrt2 = 1/sqrt2
# invsqrt2_2 = invsqrt2 * invsqrt2 = 1/2 = .5 by definition
# sin and cos(45 degrees) is 1/sqrt2 = 0.707106781187
# cos(30 degrees) is sqrt3/2
# sin(30 degrees) is 1/2
# tan(30) = 1/sqrt(3)
# The height of equilateral triangle h = sqrt(3)/2.0 * length of a side
# The centre of equilateral triangle is sqrt(3)/6.0 * length of a side
defs_g_kite_size_x = square_size
defs_g_kite_size_y = defs_g_kite_size_x * sqrt3 / 2.0 + defs_g_kite_size_x * sqrt3 / 6.0
# Having a clip path seems to increase the visibility of the lines between the tiles.
# A clipping path may be necessary if the shapes go outside the triangle.
# defs_g_kite = dwg.defs.add(dwg.g(id='defs_g_kite', clip_path='url(#clipkite)'))
defs_g_kite = dwg.defs.add(dwg.g(id='defs_g_kite'))
defs_g_kite.add(dwg.polygon([(0, 0),
(defs_g_kite_size_x / 2.0, defs_g_kite_size_x / (sqrt3 * 2.0)),
(0, defs_g_kite_size_y),
(-defs_g_kite_size_x / 2.0, defs_g_kite_size_x / (sqrt3 * 2.0))], stroke='none'))
#defs_g_kite.add(dwg.polygon([(0, 0),
# (defs_g_kite_size_x / 4.0, (defs_g_kite_size_y + defs_g_kite_size_x / (sqrt3 * 2.0)) / 2.0),
# (-defs_g_kite_size_x / 2.0, defs_g_kite_size_x / (sqrt3 * 2.0))], stroke='none', fill='yellow'))
defs_g_kite.add(dwg.polygon([(0, 0),
(defs_g_kite_size_x / 2.0, defs_g_kite_size_x / (sqrt3 * 2.0)),
(0, defs_g_kite_size_y / 12.0),
(-defs_g_kite_size_x / 2.0, defs_g_kite_size_x / (sqrt3 * 2.0))], stroke='none',
fill='black'))
defs_g_kite.add(dwg.polygon([(0, defs_g_kite_size_y),
(defs_g_kite_size_x / 2.0, defs_g_kite_size_x / (sqrt3 * 2.0)),
(0, defs_g_kite_size_y * 8.0 / 12.0),
(-defs_g_kite_size_x / 2.0, defs_g_kite_size_x / (sqrt3 * 2.0))], stroke='none',
fill='green'))
# Create rotations of the kite.
defs_g_kite_120 = dwg.defs.add(dwg.g(id='defs_g_kite_120'))
defs_g_kite_120.add(dwg.use(defs_g_kite, insert=(0, 0)))
defs_g_kite_120.rotate(120, center=(0, 0))
defs_g_kite_m120 = dwg.defs.add(dwg.g(id='defs_g_kite_m120'))
defs_g_kite_m120.add(dwg.use(defs_g_kite, insert=(0, 0)))
defs_g_kite_m120.rotate(-120, center=(0, 0))
# Now use the cell, rotated cells to create the combined cell.
# The height of equilateral triangle h = sqrt(3) / 2.0 * length of a side
defs_g_kite_cc_size_x = 2 * defs_g_kite_size_x
defs_g_kite_cc_size_y = defs_g_kite_size_x * sqrt3 # 2*(sqrt(3)/2.0)
defs_g_kite_cc = dwg.defs.add(dwg.g(id='defs_g_kite_cc'))
defs_g_kite_cc.add(dwg.use(defs_g_kite, insert=(0, 0)))
defs_g_kite_cc.add(dwg.use(defs_g_kite_120, insert=(0, 0)))
defs_g_kite_cc.add(dwg.use(defs_g_kite_m120, insert=(0, 0)))
# Now use the combined cell to create a mirrored combined cell
defs_g_kite_mcc = dwg.defs.add(dwg.g(id='defs_g_kite_mcc'))
defs_g_kite_mcc.add(dwg.use(defs_g_kite_cc, insert=(0, 0)))
defs_g_kite_mcc.scale(-1, -1)
# Now use the combined cell, and mirrored combined cell to create a pattern
defs_g_kite_pattern_size_x = 1.5 * defs_g_kite_cc_size_x
defs_g_kite_pattern_size_y = defs_g_kite_cc_size_y
defs_g_kite_pattern = dwg.defs.add(dwg.g(id='defs_g_kite_pattern'))
defs_g_kite_pattern.add(dwg.use(defs_g_kite_cc, insert=(-defs_g_kite_cc_size_x / 4.0, -sqrt3 / 12.0 * defs_g_kite_cc_size_x)))
defs_g_kite_pattern.add(dwg.use(defs_g_kite_mcc, insert=(defs_g_kite_cc_size_x / 4.0, sqrt3 / 12.0 * defs_g_kite_cc_size_x)))
# ####################
# p6m - Kaleidoscope Either of the two long sides of the primary triangle is mirrored. The
# resulting shape is rotated six times.
# 30, 60, 90 angle triangle
# The length of the sides are 1:sqrt(3):2 2 is the hypotenuse
# invsqrt2 = 1/sqrt2
# invsqrt2_2 = invsqrt2 * invsqrt2 = 1/2 = .5 by definition
# sin and cos(45 degrees) is 1/sqrt2 = 0.707106781187
# cos(30 degrees) is sqrt3/2
# sin(30 degrees) is 1/2
# tan(30) = 1/sqrt(3)
# # The height of equilateral triangle h = sqrt(3) / 2.0 * length of a side
# # The centre of equilateral triangle is sqrt(3) / 6.0 * length of a side
defs_g_kale_tri_size_x = square_size
defs_g_kale_tri_size_y = defs_g_kale_tri_size_x * 4.0 / sqrt3
# Having a clip path seems to increase the visibility of the lines between the tiles.
# A clipping path may be necessary if the shapes go outside the triangle.
# defs_g_kale_tri = dwg.defs.add(dwg.g(id='defs_g_kale_tri', clip_path='url(#clipkale)'))
defs_g_kale_tri = dwg.defs.add(dwg.g(id='defs_g_kale_tri'))
defs_g_kale_tri.add(dwg.polygon([(0, -defs_g_kale_tri_size_y), (0, 0), (-defs_g_kale_tri_size_x, defs_g_kale_tri_size_x / sqrt3
- defs_g_kale_tri_size_y)], stroke='none'))
defs_g_kale_tri.add(dwg.polygon([(-defs_g_kale_tri_size_x, defs_g_kale_tri_size_x / sqrt3 - defs_g_kale_tri_size_y), (0, 2.0
* defs_g_kale_tri_size_x / sqrt3 - defs_g_kale_tri_size_y), (0, 3.0 * defs_g_kale_tri_size_x / sqrt3
- defs_g_kale_tri_size_y)], stroke='none', fill='yellow'))
# Create mirror of the kale.
defs_g_kale_tri_m = dwg.defs.add(dwg.g(id='defs_g_kale_tri_m'))
defs_g_kale_tri_m.add(dwg.use(defs_g_kale_tri, insert=(0, 0)))
defs_g_kale_tri_m.scale(-1, 1)
# Now use the tri, rotated tri to create the combined cell.
defs_g_kale_cc_size_x = 2 * defs_g_kale_tri_size_x
defs_g_kale_cc_size_y = defs_g_kale_tri_size_y
defs_g_kale_cc = dwg.defs.add(dwg.g(id='defs_g_kale_cc'))
defs_g_kale_cc.add(dwg.use(defs_g_kale_tri, insert=(0, 0)))
defs_g_kale_cc.add(dwg.use(defs_g_kale_tri_m, insert=(0, 0)))
# Now rotate the combined cell.
defs_g_kale_cc_60 = dwg.defs.add(dwg.g(id='defs_g_kale_cc_60'))
defs_g_kale_cc_60.add(dwg.use(defs_g_kale_cc, insert=(0, 0)))
defs_g_kale_cc_60.rotate(60, center=(0, 0))
defs_g_kale_cc_120 = dwg.defs.add(dwg.g(id='defs_g_kale_cc_120'))
defs_g_kale_cc_120.add(dwg.use(defs_g_kale_cc, insert=(0, 0)))
defs_g_kale_cc_120.rotate(120, center=(0, 0))
defs_g_kale_cc_180 = dwg.defs.add(dwg.g(id='defs_g_kale_cc_180'))
defs_g_kale_cc_180.add(dwg.use(defs_g_kale_cc, insert=(0, 0)))
defs_g_kale_cc_180.rotate(180, center=(0, 0))
defs_g_kale_cc_m60 = dwg.defs.add(dwg.g(id='defs_g_kale_cc_m60'))
defs_g_kale_cc_m60.add(dwg.use(defs_g_kale_cc, insert=(0, 0)))
defs_g_kale_cc_m60.rotate(-60, center=(0, 0))
defs_g_kale_cc_m120 = dwg.defs.add(dwg.g(id='defs_g_kale_cc_m120'))
defs_g_kale_cc_m120.add(dwg.use(defs_g_kale_cc, insert=(0, 0)))
defs_g_kale_cc_m120.rotate(-120, center=(0, 0))
# Now use the cell and five rotated cells to create the pattern.
defs_g_kale_pattern_size_x = 2 * defs_g_kale_cc_size_x
defs_g_kale_pattern_size_y = 2 * defs_g_kale_cc_size_y
defs_g_kale_pattern = dwg.defs.add(dwg.g(id='defs_g_kale_pattern'))
defs_g_kale_pattern.add(dwg.use(defs_g_kale_cc, insert=(0, 0)))
defs_g_kale_pattern.add(dwg.use(defs_g_kale_cc_60, insert=(0, 0)))
defs_g_kale_pattern.add(dwg.use(defs_g_kale_cc_120, insert=(0, 0)))
defs_g_kale_pattern.add(dwg.use(defs_g_kale_cc_180, insert=(0, 0)))
defs_g_kale_pattern.add(dwg.use(defs_g_kale_cc_m60, insert=(0, 0)))
defs_g_kale_pattern.add(dwg.use(defs_g_kale_cc_m120, insert=(0, 0)))
# ########################
# Background will be dark but not black so the background does not overwhelm the colors.
dwg.add(dwg.rect(insert=(0, 0), size=('100%', '100%'), rx=None, ry=None, fill='grey'))
# Give the name of the example and a title.
y = font_size + 5
dwg.add(dwg.text(title1, insert=(0, y), font_family='serif', font_size=font_size, fill='white'))
y = y + font_size
# p3m1 - Mirror and three rotations
title2 = 'Mirror and three rotations, math name: p3m1'
dwg.add(dwg.text(title2, insert=(50, y), font_family='serif', font_size=font_size, fill='white'))
y = y + font_size + defs_g_trieq_size_x
cell_created = dwg.use(defs_g_trieq, insert=(50 + defs_g_trieq_size_x, y), fill='lightblue')
dwg.add(cell_created)
dwg.add(dwg.circle(center=(50 + defs_g_trieq_size_x, y), r=3, stroke='none', fill='purple', opacity='0.5'))
cc_created = dwg.use(defs_g_trieq_cc, insert=(150 + defs_g_trieq_cc_size_x, y), fill='lightblue')
dwg.add(cc_created)
dwg.add(dwg.circle(center=(150 + defs_g_trieq_cc_size_x, y), r=3, stroke='none', fill='purple', opacity='0.5'))
pattern_created = dwg.use(defs_g_trieq_pattern, insert=(250 + defs_g_trieq_cc_size_x, y), fill='lightblue')
dwg.add(pattern_created)
dwg.add(dwg.circle(center=(250 + defs_g_trieq_cc_size_x, y), r=3, stroke='none', fill='purple', opacity='0.5'))
y += defs_g_trieq_pattern_size_y
for i in range(8):
y += defs_g_trieq_pattern_size_y / 2.0
for j in range(6):
if i % 2:
x = 50 + j * 1.5 * defs_g_trieq_pattern_size_x
else:
x = 50 + 1.5 * defs_g_trieq_size_x + j * 1.5 * defs_g_trieq_pattern_size_x
pattern_created = dwg.use(defs_g_trieq_pattern, fill='lightblue')
pattern_created.translate(x, y)
dwg.add(pattern_created)
y += defs_g_trieq_pattern_size_y
#
# p31m sample cell, combined cell and tile
title2 = 'Kite rotated and mirrored, math name: p31m'
dwg.add(dwg.text(title2, insert=(50, y), font_family='serif', font_size=font_size, fill='white'))
y = y + font_size + defs_g_kite_size_y
cell_created = dwg.use(defs_g_kite, insert=(50 + defs_g_kite_size_x / 2.0, y), fill='navy')
dwg.add(cell_created)
dwg.add(dwg.circle(center=(50 + defs_g_kite_size_x / 2.0, y), r=3, stroke='none', fill='purple', opacity='0.5'))
cc_created = dwg.use(defs_g_kite_cc, insert=(150 + defs_g_kite_size_x / 2.0, y), fill='navy')
dwg.add(cc_created)
dwg.add(dwg.circle(center=(150 + defs_g_kite_size_x / 2.0, y), r=3, stroke='none', fill='purple', opacity='0.5'))
mcc_created = dwg.use(defs_g_kite_mcc, insert=(250 + defs_g_kite_cc_size_x / 2, y), fill='navy')
dwg.add(mcc_created)
dwg.add(dwg.circle(center=(250 + defs_g_kite_cc_size_x / 2, y), r=3, stroke='none', fill='purple', opacity='0.5'))
pattern_created = dwg.use(defs_g_kite_pattern, insert=(350 + defs_g_kite_cc_size_x, y), fill='navy')
dwg.add(pattern_created)
dwg.add(dwg.circle(center=(350 + defs_g_kite_cc_size_x, y), r=3, stroke='none', fill='purple', opacity='0.5'))
y += defs_g_kite_pattern_size_y
for i in range(6):
y += defs_g_kite_pattern_size_y
for j in range(8):
if i % 2:
x = 100 + (j + 0.5) * defs_g_kite_cc_size_x
else:
x = 100 + j * defs_g_kite_cc_size_x
pattern_created = dwg.use(defs_g_kite_pattern, fill='navy')
pattern_created.translate(x, y)
dwg.add(pattern_created)
y += defs_g_kite_pattern_size_y
# ##
# p6m kaleidoscope
title2 = 'Kaleidoscope 30, 60, 90 triangle mirrored and rotated, math name: p6m'
dwg.add(dwg.text(title2, insert=(50, y), font_family='serif', font_size=font_size, fill='white'))
y = y + font_size
y += defs_g_kale_tri_size_y
cell_created = dwg.use(defs_g_kale_tri, insert=(50 + defs_g_kale_tri_size_x, y), fill='navy')
dwg.add(cell_created)
dwg.add(dwg.circle(center=(50 + defs_g_kale_tri_size_x, y), r=3, stroke='none', fill='purple', opacity='0.5'))
cc_created = dwg.use(defs_g_kale_cc, insert=(150 + defs_g_kale_cc_size_x / 2.0, y), fill='navy')
dwg.add(cc_created)
dwg.add(dwg.circle(center=(150 + defs_g_kale_cc_size_x / 2.0, y), r=3, stroke='none', fill='purple', opacity='0.5'))
pattern_created = dwg.use(defs_g_kale_pattern, insert=(250 + defs_g_kale_pattern_size_x / 2.0, y), fill='navy')
dwg.add(pattern_created)
dwg.add(dwg.circle(center=(250 + defs_g_kale_pattern_size_x / 2.0, y), r=3, stroke='none', fill='purple', opacity='0.5'))
y += defs_g_kale_pattern_size_y / 2.0
for i in range(4):
y += defs_g_kale_pattern_size_y - defs_g_kale_pattern_size_x / (sqrt3 * 2)
for j in range(6):
if i % 2:
x = 100 + j * defs_g_kale_pattern_size_x
else:
x = 100 + defs_g_kale_cc_size_x + j * defs_g_kale_pattern_size_x
pattern_created = dwg.use(defs_g_kale_pattern, fill='navy')
pattern_created.translate(x, y)
dwg.add(pattern_created)
y += defs_g_kale_pattern_size_y
# All items have been added so save the svg to a the file.
dwg.save()
if __name__ == '__main__':
create_svg(PROGNAME + '.svg')
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 textwidth=99
| 51.825826 | 137 | 0.670877 | 3,129 | 17,258 | 3.33557 | 0.081496 | 0.134617 | 0.082782 | 0.04532 | 0.821405 | 0.771199 | 0.734406 | 0.65766 | 0.602568 | 0.528888 | 0 | 0.050709 | 0.19898 | 17,258 | 332 | 138 | 51.981928 | 0.704282 | 0.210975 | 0 | 0.2 | 0 | 0 | 0.068624 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.005 | false | 0 | 0.01 | 0 | 0.015 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 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 | 0 | 0 | 0 | 0 | 3 |
b7b2bf3009f886fb399b6a73378d628699d8010a | 462 | py | Python | src/pythae/models/svae/svae_config.py | eknag/benchmark_VAE | 8b727f29a68aff7771c4c97aff15f75f88320e1f | [
"Apache-2.0"
] | 1 | 2022-03-20T20:23:59.000Z | 2022-03-20T20:23:59.000Z | src/pythae/models/svae/svae_config.py | eknag/benchmark_VAE | 8b727f29a68aff7771c4c97aff15f75f88320e1f | [
"Apache-2.0"
] | null | null | null | src/pythae/models/svae/svae_config.py | eknag/benchmark_VAE | 8b727f29a68aff7771c4c97aff15f75f88320e1f | [
"Apache-2.0"
] | null | null | null | from pydantic.dataclasses import dataclass
from ...models import VAEConfig
@dataclass
class SVAEConfig(VAEConfig):
r"""
:math:`\mathcal{S}`-VAE model config config class
Parameters:
input_dim (int): The input_data dimension
latent_dim (int): The latent space dimension in which lives the hypersphere. Default: None.
reconstruction_loss (str): The reconstruction loss to use ['bce', 'mse']. Default: 'mse'
"""
pass
| 27.176471 | 99 | 0.690476 | 57 | 462 | 5.526316 | 0.684211 | 0.038095 | 0.057143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209957 | 462 | 16 | 100 | 28.875 | 0.863014 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.166667 | 0.333333 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
b7c583ce42f7da52ba4b620e07b7b1dce4f64729 | 6,467 | py | Python | examples/Components/collision/PrimitiveCreation.py | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | examples/Components/collision/PrimitiveCreation.py | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | examples/Components/collision/PrimitiveCreation.py | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | import Sofa
import random
from cmath import *
############################################################################################
# this is a PythonScriptController example script
############################################################################################
############################################################################################
# following defs are used later in the script
############################################################################################
# utility methods
falling_speed = 0
capsule_height = 5
capsule_chain_height = 5
def createRigidCapsule(parentNode,name,x,y,z,*args):
node = parentNode.createChild(name)
radius=0
if len(args)==0:
radius = random.uniform(1,3)
else:
radius = args[0]
meca = node.createObject('MechanicalObject',name='rigidDOF',template='Rigid',position=str(x)+' '+str(y)+' '+str(z)+' 0 0 0 1',velocity='0 0 '+str(falling_speed)+' 0 0 0 1')
mass = node.createObject('UniformMass',name='mass',totalMass=1)
x_rand=random.uniform(-0.5,0.5)
y_rand=random.uniform(-0.5,0.5)
z_rand=random.uniform(-0.5,0.5)
SurfNode = node.createChild('Surf')
SurfNode.createObject('MechanicalObject',template='Vec3d',name='falling_particle',position=str(x_rand)+' '+str(y_rand)+' '+str(capsule_height/2)+' '+str(-x_rand)+' '+str(-y_rand)+' '+str(- capsule_height/2))
SurfNode.createObject('MeshTopology', name='meshTopology34',edges='0 1',drawEdges='1')
SurfNode.createObject('TCapsuleModel',template='Vec3d',name='capsule_model',defaultRadius=str(radius))
SurfNode.createObject('RigidMapping',template='Rigid,Vec3d',name='rigid_mapping',input='@../rigidDOF',output='@falling_particle')
return node
def createFlexCapsule(parentNode,name,x,y,z,*args):
radius=0
if len(args)==0:
radius = random.uniform(1,3)
else:
radius = args[0]
node = parentNode.createChild(name)
x_rand=random.uniform(-0.5,0.5)
y_rand=random.uniform(-0.5,0.5)
z_rand=random.uniform(-0.5,0.5)
node = node.createChild('Surf')
node.createObject('MechanicalObject',template='Vec3d',name='falling_particle',position=str(x + x_rand)+' '+str(y + y_rand)+' '+str(z + z_rand + capsule_height)+' '+str(x - x_rand)+' '+str(y - y_rand)+' '+str(z - z_rand),velocity='0 0 '+str(falling_speed))
mass = node.createObject('UniformMass',name='mass')
node.createObject('MeshTopology', name='meshTopology34',edges='0 1',drawEdges='1')
node.createObject('TCapsuleModel',template='Vec3d',name='capsule_model',defaultRadius=str(radius))
return node
def createCapsuleChain(parentNode,name,length,x,y,z):
node = parentNode.createChild(name)
#radius=random.uniform(1,3)
radius=0.5
height=5
x_rand=random.uniform(-0.5,0.5)
y_rand=random.uniform(-0.5,0.5)
z_rand=random.uniform(-0.5,0.5)
node = node.createChild('Surf')
ray = 3.0
t = 0.0
delta_t = 0.7
topo_edges=''
particles=''
velocities = ''
springs=''
for i in range(0,length):
particles += str(x + (ray * cos(t)).real)+' '+str(y + (ray * sin(t)).real)+' '+str(z + i*capsule_chain_height)+' '
t += delta_t
if i < length -1:
topo_edges += str(i)+' '+str(i + 1)+' '
springs += str(i)+' '+str(i + 1)+' 10 1 '+str(capsule_chain_height)+' '
velocities+='0 0 '+str(falling_speed)+' '
topo_edges += str(length - 2)+' '+str(length -1)
springs += str(length - 2)+' '+str(length -1)+' 10 1 '+str(capsule_chain_height)
node.createObject('MechanicalObject',template='Vec3d',name='falling_particles',position=particles,velocity=velocities)
node.createObject('StiffSpringForceField',template='Vec3d',name='springforcefield',stiffness='100',damping='1',spring=springs)
mass = node.createObject('UniformMass',name='mass')
node.createObject('MeshTopology', name='meshTopology34',edges=topo_edges,drawEdges='1')
node.createObject('TCapsuleModel',template='Vec3d',name='capsule_model',defaultRadius=str(radius))
return node
def createOBB(parentNode,name,x,y,z,*args):
a=0
b=0
c=0
if len(args)==0:
a=random.uniform(0.5,1.5)
b=random.uniform(0.5,1.5)
c=random.uniform(0.5,1.5)
else:
a=args[0]
b=args[1]
c=args[2]
node = parentNode.createChild(name)
meca = node.createObject('MechanicalObject',name='rigidDOF',template='Rigid',position=str(x)+' '+str(y)+' '+str(z)+' 0 0 0 1',velocity='0 0 '+str(falling_speed)+' 0 0 0 1')
mass = node.createObject('UniformMass',name='mass',totalMass=1)
node.createObject('TOBBModel',template='Rigid',name='OBB_model',extents=str(a)+' '+str(b)+' '+str(c))
return node
def createCapsule(parentNode,name,x,y,z):
if random.randint(0,1) == 0:
return createRigidCapsule(parentNode,name,x,y,z)
else:
return createFlexCapsule(parentNode,name,x,y,z)
def createCapsule(parentNode,name,x,y,z):
if random.randint(0,1) == 0:
return createRigidCapsule(parentNode,name,x,y,z)
else:
return createFlexCapsule(parentNode,name,x,y,z)
def createSphere(parentNode,name,x,y,z,*args):
node = parentNode.createChild(name)
r = 0
if len(args) == 0:
r=random.uniform(1,4)
else:
r = args[0]
#meca = node.createObject('MechanicalObject',name='rigidDOF',template='Rigid',position=str(x)+' '+str(y)+' '+
# str(z)+' 0 0 0 1')
#SurfNode = node.createChild('Surf')
node.createObject('MechanicalObject',template='Vec3d',name='falling_particle',position=str(x)+' '+str(y)+' '+str(z),velocity='0 0 '+str(falling_speed))
node.createObject('TSphereModel',template='Vec3d',name='sphere_model',radius=str(r))
node.createObject('UniformMass',name='mass',totalMass=1)
#SurfNode.createObject('RigidMapping',template='Rigid,Vec3d',name='rigid_mapping',input='@../rigidDOF',output='@falling_particle')
return node
def createRigidSphere(parentNode,name,x,y,z,*args):
node = parentNode.createChild(name)
r = 0
if len(args) == 0:
r=random.uniform(1,4)
else:
r = args[0]
#meca = node.createObject('MechanicalObject',name='rigidDOF',template='Rigid',position=str(x)+' '+str(y)+' '+
# str(z)+' 0 0 0 1')
#SurfNode = node.createChild('Surf')
node.createObject('MechanicalObject',template='Rigid',name='falling_particle',position=str(x)+' '+str(y)+' '+str(z)+' 0 0 0 1',velocity='0 0 '+str(falling_speed)+' 0 0 0 1')
node.createObject('TSphereModel',template='Rigid',name='sphere_model',radius=str(r))
node.createObject('UniformMass',name='mass',totalMass=1)
#SurfNode.createObject('RigidMapping',template='Rigid,Vec3d',name='rigid_mapping',input='@../rigidDOF',output='@falling_particle')
return node
| 34.216931 | 256 | 0.66043 | 894 | 6,467 | 4.709172 | 0.12528 | 0.010926 | 0.008551 | 0.042755 | 0.777672 | 0.755107 | 0.703563 | 0.678385 | 0.678385 | 0.663895 | 0 | 0.03228 | 0.099428 | 6,467 | 188 | 257 | 34.398936 | 0.690591 | 0.117984 | 0 | 0.546218 | 0 | 0 | 0.156303 | 0.003945 | 0 | 0 | 0 | 0 | 0 | 1 | 0.067227 | false | 0 | 0.02521 | 0 | 0.176471 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
b7c6df93916a72fa3dc3b5903a942a8fbc2d13cd | 350 | py | Python | examples/tensorboard/nested.py | dwolfschlaeger/guildai | f82102ad950d7c89c8f2c2eafe596b2d7109dc57 | [
"Apache-2.0"
] | 694 | 2018-11-30T01:06:30.000Z | 2022-03-31T14:46:26.000Z | examples/tensorboard/nested.py | dwolfschlaeger/guildai | f82102ad950d7c89c8f2c2eafe596b2d7109dc57 | [
"Apache-2.0"
] | 323 | 2018-11-05T17:44:34.000Z | 2022-03-31T16:56:41.000Z | examples/tensorboard/nested.py | dwolfschlaeger/guildai | f82102ad950d7c89c8f2c2eafe596b2d7109dc57 | [
"Apache-2.0"
] | 68 | 2019-04-01T04:24:47.000Z | 2022-02-24T17:22:04.000Z | import tensorboardX
with tensorboardX.SummaryWriter("foo") as w:
w.add_scalar("a", 1.0, 1)
w.add_scalar("a", 2.0, 2)
with tensorboardX.SummaryWriter("foo/bar") as w:
w.add_scalar("a", 3.0, 3)
w.add_scalar("a", 4.0, 4)
with tensorboardX.SummaryWriter("foo/bar/baz") as w:
w.add_scalar("a", 5.0, 5)
w.add_scalar("a", 6.0, 6)
| 25 | 52 | 0.634286 | 65 | 350 | 3.323077 | 0.292308 | 0.111111 | 0.277778 | 0.305556 | 0.518519 | 0.194444 | 0 | 0 | 0 | 0 | 0 | 0.061856 | 0.168571 | 350 | 13 | 53 | 26.923077 | 0.680412 | 0 | 0 | 0 | 0 | 0 | 0.077143 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.1 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
b7da43e450c1cde9be925061435a5d471ad6ae05 | 640 | py | Python | Wrapping/Python/vtkmodules/__init__.py | cads-build/VTK | ee0c9688a082c88bfe070afc08f4eb0f0a546487 | [
"BSD-3-Clause"
] | 1 | 2019-09-11T12:30:57.000Z | 2019-09-11T12:30:57.000Z | Wrapping/Python/vtkmodules/__init__.py | AndyJMR/VTK | 3cc9e5f7539107e5dbaeadc2d28f7a8db6de8571 | [
"BSD-3-Clause"
] | null | null | null | Wrapping/Python/vtkmodules/__init__.py | AndyJMR/VTK | 3cc9e5f7539107e5dbaeadc2d28f7a8db6de8571 | [
"BSD-3-Clause"
] | null | null | null | r"""
Currently, this package is experimental and may change in the future.
"""
from __future__ import absolute_import
#------------------------------------------------------------------------------
# this little trick is for static builds of VTK. In such builds, if
# the user imports this Python package in a non-statically linked Python
# interpreter i.e. not of the of the VTK-python executables, then we import the
# static components importer module.
try:
from . import vtkCommonCore
except ImportError:
from . import _vtkpythonmodules_importer
#------------------------------------------------------------------------------
| 37.647059 | 79 | 0.582813 | 71 | 640 | 5.15493 | 0.647887 | 0.027322 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132813 | 640 | 16 | 80 | 40 | 0.659459 | 0.74375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4d0095e3df86b0354c6a7f3fe8432d1caf5ff121 | 3,807 | py | Python | osnexus_flocker_driver/osnexusdriver.py | OSNEXUS/flocker-driver | 22a6ecf57c6841359df82657659f8e945b206f1b | [
"Apache-2.0"
] | 2 | 2016-04-29T22:38:05.000Z | 2016-04-29T22:39:06.000Z | osnexus_flocker_driver/osnexusdriver.py | OSNEXUS/flocker-driver | 22a6ecf57c6841359df82657659f8e945b206f1b | [
"Apache-2.0"
] | null | null | null | osnexus_flocker_driver/osnexusdriver.py | OSNEXUS/flocker-driver | 22a6ecf57c6841359df82657659f8e945b206f1b | [
"Apache-2.0"
] | 2 | 2016-05-08T07:39:12.000Z | 2019-07-05T18:35:12.000Z | # Copyright 2016 OSNEXUS Corporation
"""
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 socket
from zope.interface import implementer
from flocker.node.agents.blockdevice import (
AlreadyAttachedVolume, IBlockDeviceAPI, IProfiledBlockDeviceAPI,
BlockDeviceVolume, UnknownVolume, UnattachedVolume
)
from osnexusutil import osnexusAPI
import logging
from eliot import Message, Logger
#_logger = Logger()
@implementer(IProfiledBlockDeviceAPI)
@implementer(IBlockDeviceAPI)
class OsnexusBlockDeviceAPI(object):
defaultVolumeBlkSize_ = 4096
defaultCreatedBy_ = "osnexus_flocker_driver"
defaultExportedBlkSize_ = 4096
def __init__(self, ipaddress, username, password, gold_tier, silver_tier, bronze_tier, default_pool):
"""
:returns: A ``BlockDeviceVolume``.
"""
logging.basicConfig(filename='/var/log/flocker/qs_flocker.log', format='%(asctime)s : %(message)s', level=logging.ERROR)
self._logger = logging.getLogger("QuantastorLogger")
self._instance_id = self.compute_instance_id()
self._osnexusApi = osnexusAPI(ipaddress, username, password, gold_tier, silver_tier, bronze_tier, default_pool, self._logger)
def compute_instance_id(self):
"""
Return current node's hostname
"""
#socket.getfqdn - Return a fully qualified domain name for name. If name is omitted or empty, it is interpreted
#as the local host. In case no fully qualified domain name is available, the hostname as returned by
# gethostname() is returned.
#socket.gethostbyname - Translate a host name to IPv4 address format.
return unicode(socket.gethostbyname(socket.getfqdn()))
def allocation_unit(self):
"""
return int: 1 GB
"""
return 1024*1024*1024
def _cleanup(self):
"""
Remove all volumes
"""
volumes = self.list_volumes()
for volume in volumes:
self._logger.debug("Deleting volume '%s'", volume.blockdevice_id)
self.destroy_volume(volume.blockdevice_id)
def list_volumes(self):
"""
List all the block devices available via the back end API.
:returns: A ``list`` of ``BlockDeviceVolume``s.
"""
return self._osnexusApi.listOsnexusVolumes()
def create_volume(self, dataset_id, size):
return self._osnexusApi.createOsnexusVolume(dataset_id, size)
def create_volume_with_profile(self, dataset_id, size, profile_name):
return self._osnexusApi.createOsnexusVolumeWithProfile(dataset_id, size, profile_name.lower())
def destroy_volume(self, blockdevice_id):
return self._osnexusApi.deleteOsnexusVolume(blockdevice_id)
def attach_volume(self, blockdevice_id, attach_to):
return self._osnexusApi.attachOsnexusVolume(blockdevice_id, attach_to)
def detach_volume(self, blockdevice_id):
return self._osnexusApi.detachOsnexusvolume(blockdevice_id)
def get_device_path(self, blockdevice_id):
return self._osnexusApi.getOsNexusDevicePath(blockdevice_id)
def GetOsnexusStorageApi(ipaddress, username, password, gold_tier, silver_tier, bronze_tier, default_pool ):
return OsnexusBlockDeviceAPI(ipaddress, username, password, gold_tier, silver_tier, bronze_tier, default_pool)
| 36.961165 | 133 | 0.727607 | 445 | 3,807 | 6.053933 | 0.41573 | 0.048255 | 0.051967 | 0.043059 | 0.1585 | 0.140683 | 0.126949 | 0.095026 | 0.095026 | 0.095026 | 0 | 0.009743 | 0.191227 | 3,807 | 102 | 134 | 37.323529 | 0.865216 | 0.285001 | 0 | 0 | 0 | 0 | 0.044084 | 0.020495 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0.088889 | 0.133333 | 0.155556 | 0.711111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 3 |
4d09a5a4cc57e4e453dca3ac3e67a8ff83298706 | 340 | py | Python | tests/resources/mlflow-test-plugin/mlflow_test_plugin/default_experiment_provider.py | Sohamkayal4103/mlflow | 4e444efdf73c710644ee039b44fa36a31d716f69 | [
"Apache-2.0"
] | 1 | 2022-01-11T02:51:17.000Z | 2022-01-11T02:51:17.000Z | tests/resources/mlflow-test-plugin/mlflow_test_plugin/default_experiment_provider.py | Sohamkayal4103/mlflow | 4e444efdf73c710644ee039b44fa36a31d716f69 | [
"Apache-2.0"
] | null | null | null | tests/resources/mlflow-test-plugin/mlflow_test_plugin/default_experiment_provider.py | Sohamkayal4103/mlflow | 4e444efdf73c710644ee039b44fa36a31d716f69 | [
"Apache-2.0"
] | 2 | 2019-05-11T08:13:38.000Z | 2019-05-14T13:33:54.000Z | from mlflow.tracking.default_experiment.abstract_context import DefaultExperimentProvider
class PluginDefaultExperimentProvider(DefaultExperimentProvider):
"""DefaultExperimentProvider provided through plugin system"""
def in_context(self):
return False
def get_experiment_id(self):
return "experiment_id_1"
| 28.333333 | 89 | 0.791176 | 32 | 340 | 8.1875 | 0.71875 | 0.076336 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00346 | 0.15 | 340 | 11 | 90 | 30.909091 | 0.903114 | 0.164706 | 0 | 0 | 0 | 0 | 0.053957 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.333333 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
4d193b99e7c955296baf206f87610d82e0c31d15 | 1,568 | py | Python | lib/surface/api_gateway/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/api_gateway/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/api_gateway/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. All Rights Reserved.
#
# 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.
"""The command group for Cloud API Gateway CLI."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.ml_engine import flags
from googlecloudsdk.core import log
from googlecloudsdk.core import properties
from googlecloudsdk.core import resources
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA,
base.ReleaseTrack.GA)
class ApiGateway(base.Group):
"""Manage Cloud API Gateway resources.
Commands for managing Cloud API Gateway resources.
"""
category = base.API_PLATFORM_AND_ECOSYSTEMS_CATEGORY
def Filter(self, context, args):
# TODO(b/190524392): Determine if command group works with project number
base.RequireProjectID(args)
del context, args
base.DisableUserProjectQuota()
resources.REGISTRY.RegisterApiByName('apigateway', 'v1')
| 34.844444 | 78 | 0.769133 | 209 | 1,568 | 5.674641 | 0.598086 | 0.05059 | 0.037943 | 0.070826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014394 | 0.158163 | 1,568 | 44 | 79 | 35.636364 | 0.884091 | 0.508929 | 0 | 0 | 0 | 0 | 0.016238 | 0 | 0 | 0 | 0 | 0.022727 | 0 | 1 | 0.058824 | false | 0 | 0.470588 | 0 | 0.647059 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4d1aec75f55686cedd085e55848b278b516e591c | 166 | py | Python | Mundo2/Desafio019.py | Marcoakira/Desafios_Python_do_Curso_Guanabara | c49b774148a2232f8f3c21b83e3dc97610480757 | [
"MIT"
] | null | null | null | Mundo2/Desafio019.py | Marcoakira/Desafios_Python_do_Curso_Guanabara | c49b774148a2232f8f3c21b83e3dc97610480757 | [
"MIT"
] | null | null | null | Mundo2/Desafio019.py | Marcoakira/Desafios_Python_do_Curso_Guanabara | c49b774148a2232f8f3c21b83e3dc97610480757 | [
"MIT"
] | null | null | null | #Desafio019 ( aplicação randomica para determinar que aluno vai no quadro.
import random
al01 = str('joao'),('maria'),('pédro'),('paula')
print(random.choice(al01))
| 27.666667 | 74 | 0.722892 | 22 | 166 | 5.454545 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047297 | 0.108434 | 166 | 5 | 75 | 33.2 | 0.763514 | 0.439759 | 0 | 0 | 0 | 0 | 0.206522 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 3 |
4d24ec942e343c870cf4c7c64a35ce9e7ec32816 | 748 | py | Python | test/try_closures.py | RemuLang/sijuiacion-lang | e3b5be79fb7afadc0790311e612ddd430b3f0b9d | [
"MIT"
] | 21 | 2019-10-13T14:11:32.000Z | 2021-12-14T02:42:12.000Z | test/try_closures.py | RemuLang/sijuiacion-lang | e3b5be79fb7afadc0790311e612ddd430b3f0b9d | [
"MIT"
] | 1 | 2020-01-07T13:14:46.000Z | 2020-01-09T16:58:07.000Z | test/try_closures.py | RemuLang/sijuiacion-lang | e3b5be79fb7afadc0790311e612ddd430b3f0b9d | [
"MIT"
] | 1 | 2020-08-13T16:17:09.000Z | 2020-08-13T16:17:09.000Z | from Redy.Opt import feature, constexpr
import timeit
class Closure(tuple):
def __call__(self, a):
c, f = self
return f(c, a)
def f1(x):
def g(y):
return x + y
return g
def fc(c, y):
return c + y
@feature(constexpr)
def f2(x):
return constexpr[Closure]((x, constexpr[fc]))
print(f1(1)(2))
print(f2(1)(2))
# 3
# 3
# mk closure
print(timeit.timeit("f(1)", globals=dict(f=f1)))
print(timeit.timeit("f(1)", globals=dict(f=f2)))
# 0.15244655999958923
# 0.16590227899905585
f1_ = f1(2)
f2_ = f2(2)
print(timeit.timeit("f(1)", globals=dict(f=f1_)))
print(timeit.timeit("f(1)", globals=dict(f=f2_)))
# 0.08070355000018026
# 0.20936105600048904
# So, use builtin closures instead of making our own
| 15.914894 | 52 | 0.639037 | 122 | 748 | 3.852459 | 0.360656 | 0.093617 | 0.144681 | 0.153191 | 0.285106 | 0.285106 | 0.285106 | 0.285106 | 0.285106 | 0.285106 | 0 | 0.158416 | 0.18984 | 748 | 46 | 53 | 16.26087 | 0.617162 | 0.19385 | 0 | 0 | 0 | 0 | 0.026936 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.217391 | false | 0 | 0.086957 | 0.130435 | 0.565217 | 0.26087 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
4d293734f2f02cf252d19002878c81331dcad9c7 | 963 | py | Python | Challenges/13/tests/test_stack_and_queue_brackets.py | makkahwi/data-structures-and-algorithms | 06551786258bb7dabb9b0ab07c0f80ff78abca41 | [
"MIT"
] | null | null | null | Challenges/13/tests/test_stack_and_queue_brackets.py | makkahwi/data-structures-and-algorithms | 06551786258bb7dabb9b0ab07c0f80ff78abca41 | [
"MIT"
] | null | null | null | Challenges/13/tests/test_stack_and_queue_brackets.py | makkahwi/data-structures-and-algorithms | 06551786258bb7dabb9b0ab07c0f80ff78abca41 | [
"MIT"
] | null | null | null | import pytest
from stack_and_queue_brackets.stack_and_queue_brackets import validate_brackets
def test_a_valid():
actual = validate_brackets("[text]")
expected = True
assert actual == expected
def test_another_valid():
actual = validate_brackets("(1)[2](3)")
expected = True
assert actual == expected
def test_no_closing():
actual = validate_brackets("[{()]")
expected = False
assert actual == expected
def test_no_opening():
actual = validate_brackets("(])")
expected = False
assert actual == expected
def test_opening_dont_match_closing():
actual = validate_brackets("({])")
expected = False
assert actual == expected
def test_null():
with pytest.raises(Exception):
validate_brackets(None)
def test_no_brackets():
with pytest.raises(Exception):
validate_brackets("text")
def test_empty_string():
with pytest.raises(Exception):
validate_brackets("")
| 20.0625 | 79 | 0.688474 | 111 | 963 | 5.684685 | 0.306306 | 0.228209 | 0.174326 | 0.18225 | 0.641838 | 0.641838 | 0.440571 | 0.316957 | 0.316957 | 0.316957 | 0 | 0.003896 | 0.200415 | 963 | 47 | 80 | 20.489362 | 0.815584 | 0 | 0 | 0.419355 | 0 | 0 | 0.032191 | 0 | 0 | 0 | 0 | 0 | 0.16129 | 1 | 0.258065 | false | 0 | 0.064516 | 0 | 0.322581 | 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 | 0 | 0 | 0 | 0 | 3 |
4d2f795e5817013dda3708c8ac386c1a237e9181 | 240 | py | Python | src/base/apps.py | jhernandez18p/mobyapp | 4add7bd3b3f1e933bbb6941674bf84f4c4462685 | [
"MIT"
] | null | null | null | src/base/apps.py | jhernandez18p/mobyapp | 4add7bd3b3f1e933bbb6941674bf84f4c4462685 | [
"MIT"
] | 7 | 2020-06-05T17:31:06.000Z | 2022-03-11T23:16:34.000Z | src/base/apps.py | jhernandez18p/mobyapp | 4add7bd3b3f1e933bbb6941674bf84f4c4462685 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.db.models.signals import post_migrate
from django.utils.translation import gettext_lazy as _
class SitesConfig(AppConfig):
name = 'src.base'
verbose_name = _("Modulo de Frontend")
| 26.666667 | 54 | 0.766667 | 32 | 240 | 5.59375 | 0.75 | 0.167598 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158333 | 240 | 9 | 55 | 26.666667 | 0.886139 | 0 | 0 | 0 | 0 | 0 | 0.107884 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4d3223ccf8b9ace60c35ba3ab835c0690408e671 | 92 | py | Python | demo/demo14.py | LXG-Shadow/SongRecogn | e02363db5dc40b6128c46f19249044c94e5ba425 | [
"Apache-2.0"
] | 22 | 2019-02-25T20:58:58.000Z | 2021-07-15T01:45:00.000Z | demo/demo14.py | aynakeya/SongRecogn | e02363db5dc40b6128c46f19249044c94e5ba425 | [
"Apache-2.0"
] | 4 | 2021-04-07T13:27:44.000Z | 2021-06-15T17:32:04.000Z | demo/demo14.py | aynakeya/SongRecogn | e02363db5dc40b6128c46f19249044c94e5ba425 | [
"Apache-2.0"
] | 4 | 2020-05-16T14:08:24.000Z | 2021-06-07T08:59:07.000Z | import getopt
a = "asdf asdf"
option,args = getopt.getopt(a,"","")
print(option,type(args))
| 18.4 | 36 | 0.684783 | 14 | 92 | 4.5 | 0.571429 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108696 | 92 | 4 | 37 | 23 | 0.768293 | 0 | 0 | 0 | 0 | 0 | 0.097826 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
4d556c14bf4ff80e91105975794bd70a02997423 | 1,799 | py | Python | alice.py | Tigven/benedict | c15620e7df573ad05cd25628d7cf55f6558968b8 | [
"MIT"
] | 1 | 2019-05-08T15:33:21.000Z | 2019-05-08T15:33:21.000Z | alice.py | Tigven/benedict | c15620e7df573ad05cd25628d7cf55f6558968b8 | [
"MIT"
] | null | null | null | alice.py | Tigven/benedict | c15620e7df573ad05cd25628d7cf55f6558968b8 | [
"MIT"
] | null | null | null | import json
class AliceRequest(object):
def __init__(self, request_dict):
self._request_dict = request_dict
@property
def version(self):
return self._request_dict['version']
@property
def session(self):
return self._request_dict['session']
@property
def user_id(self):
return self.session['user_id']
@property
def is_new_session(self):
return bool(self.session['new'])
@property
def command(self):
print(self._request_dict['request']['command'])
return self._request_dict['request']['command']
@property
def tokens(self):
return self._request_dict['request']['nlu']['tokens']
def get_number(self):
for e in self._request_dict['request']['nlu'].get('entities'):
if e.get('type') == "YANDEX.NUMBER":
return e.get('value')
return None
def __str__(self):
return str(self._request_dict)
class AliceResponse(object):
def __init__(self, alice_request):
self._response_dict = {
"version": alice_request.version,
"session": alice_request.session,
"response": {
"end_session": False
}
}
def dumps(self):
return json.dumps(
self._response_dict,
ensure_ascii=False,
indent=2
)
def set_text(self, text):
self._response_dict['response']['text'] = text[:1024]
def get_text(self):
return self._response_dict['response']['text']
def set_buttons(self, buttons):
self._response_dict['response']['buttons'] = buttons
def end(self):
self._response_dict["response"]["end_session"] = True
def __str__(self):
return self.dumps()
| 24.310811 | 70 | 0.591996 | 201 | 1,799 | 5 | 0.248756 | 0.109453 | 0.134328 | 0.109453 | 0.228856 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003861 | 0.280156 | 1,799 | 73 | 71 | 24.643836 | 0.772201 | 0 | 0 | 0.145455 | 0 | 0 | 0.110617 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.290909 | false | 0 | 0.018182 | 0.163636 | 0.563636 | 0.018182 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
4d6e2c5b304d30fabd691d7b3a8dc9cf98b02a31 | 290 | py | Python | api/routes/topic.py | quyenthucdoan/CUSTOMER-EMOTION-ANALYSIS-SYSTEM-BASED-ON-VIETNAMESE-COMMENTS | 445de0d169fd2b0005726f8d12b5844ea3a69ca4 | [
"Unlicense"
] | null | null | null | api/routes/topic.py | quyenthucdoan/CUSTOMER-EMOTION-ANALYSIS-SYSTEM-BASED-ON-VIETNAMESE-COMMENTS | 445de0d169fd2b0005726f8d12b5844ea3a69ca4 | [
"Unlicense"
] | null | null | null | api/routes/topic.py | quyenthucdoan/CUSTOMER-EMOTION-ANALYSIS-SYSTEM-BASED-ON-VIETNAMESE-COMMENTS | 445de0d169fd2b0005726f8d12b5844ea3a69ca4 | [
"Unlicense"
] | null | null | null | from app import app
from services import TopicServices
from flask import jsonify, request
@app.route('/topic/terms', methods=['GET'])
def getTerms():
numOfTerms = request.args.get("numOfTerms")
results = TopicServices.getTerms(numOfTerms)
return jsonify({ 'results': results }) | 32.222222 | 48 | 0.737931 | 34 | 290 | 6.294118 | 0.558824 | 0.168224 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 290 | 9 | 49 | 32.222222 | 0.856 | 0 | 0 | 0 | 0 | 0 | 0.109966 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4d74b34c2ad769580f0628389b7964d48ab6bbb5 | 1,119 | py | Python | opsramp/monitoring.py | gauravphagrehpe/python-opsramp | 9ed8397cff70f866b9ed9bd1d7010a189481c62c | [
"Apache-2.0"
] | 6 | 2020-03-30T12:53:44.000Z | 2022-03-05T11:37:12.000Z | opsramp/monitoring.py | gauravphagrehpe/python-opsramp | 9ed8397cff70f866b9ed9bd1d7010a189481c62c | [
"Apache-2.0"
] | 20 | 2019-07-10T13:24:00.000Z | 2021-01-25T14:26:23.000Z | opsramp/monitoring.py | gauravphagrehpe/python-opsramp | 9ed8397cff70f866b9ed9bd1d7010a189481c62c | [
"Apache-2.0"
] | 21 | 2019-06-26T12:05:33.000Z | 2022-03-28T11:44:39.000Z | #!/usr/bin/env python
#
# A minimal Python language binding for the OpsRamp REST API.
#
# monitoring.py
# Classes related to monitoring templates and similar things.
#
# (c) Copyright 2019-2021 Hewlett Packard Enterprise Development LP
#
# 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.
from opsramp.api import ORapi
class Monitoring(ORapi):
def __init__(self, parent):
super(Monitoring, self).__init__(parent.api, 'monitoring')
def templates(self):
return Templates(self)
class Templates(ORapi):
def __init__(self, parent):
super(Templates, self).__init__(parent.api, 'templates')
| 31.083333 | 74 | 0.74084 | 158 | 1,119 | 5.14557 | 0.594937 | 0.073801 | 0.03198 | 0.03936 | 0.066421 | 0.066421 | 0 | 0 | 0 | 0 | 0 | 0.013001 | 0.175156 | 1,119 | 35 | 75 | 31.971429 | 0.867822 | 0.663092 | 0 | 0.222222 | 0 | 0 | 0.053221 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.111111 | 0.111111 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
4d78fa2ba57faef589529bf708bb570e9f71a9a8 | 203 | py | Python | logger/logger.py | BraunPhilipp/sentiment-analyzer | de1528c924b7015bafda56196b264523b64dc7c1 | [
"MIT"
] | 4 | 2016-09-24T22:09:49.000Z | 2017-05-17T12:51:48.000Z | logger/logger.py | BraunPhilipp/sentiment-analyzer | de1528c924b7015bafda56196b264523b64dc7c1 | [
"MIT"
] | 2 | 2016-11-29T05:50:01.000Z | 2021-02-13T18:07:20.000Z | logger/logger.py | BraunPhilipp/sentiment-analyzer | de1528c924b7015bafda56196b264523b64dc7c1 | [
"MIT"
] | null | null | null |
"""
Log multiple instances to same file.
"""
def log(msg):
f = open('error.log', 'a')
f.write(msg+'\n')
f.close()
def clear():
f = open('error.log', 'w')
f.write('')
f.close()
| 13.533333 | 36 | 0.507389 | 31 | 203 | 3.322581 | 0.548387 | 0.097087 | 0.194175 | 0.252427 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.251232 | 203 | 14 | 37 | 14.5 | 0.677632 | 0.17734 | 0 | 0.25 | 0 | 0 | 0.139241 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | 3 |
4d865dc35190b4ae2e09f8e09f56d08962508268 | 264 | py | Python | core/kryptos/scripts/strat.py | czr1803/kryptos | 2e8e20b81c7486283ab39df053146048f5496474 | [
"MIT"
] | 45 | 2019-01-27T13:47:51.000Z | 2022-03-13T00:25:21.000Z | core/kryptos/scripts/strat.py | czr1803/kryptos | 2e8e20b81c7486283ab39df053146048f5496474 | [
"MIT"
] | 64 | 2019-01-24T06:43:13.000Z | 2020-03-09T17:14:52.000Z | core/kryptos/scripts/strat.py | produvia/kryptos | 2e8e20b81c7486283ab39df053146048f5496474 | [
"MIT"
] | 4 | 2019-11-21T10:49:17.000Z | 2021-09-30T03:33:00.000Z | import click
from kryptos.scripts import build_strategy, stress_worker, kill_strat
@click.group(name="strat")
def cli():
pass
cli.add_command(build_strategy.run, "build")
cli.add_command(stress_worker.run, "stress")
cli.add_command(kill_strat.run, "kill")
| 20.307692 | 69 | 0.772727 | 40 | 264 | 4.875 | 0.475 | 0.092308 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.098485 | 264 | 12 | 70 | 22 | 0.819328 | 0 | 0 | 0 | 0 | 0 | 0.075758 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | true | 0.125 | 0.25 | 0 | 0.375 | 0 | 0 | 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 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
4daef32de5d0a4eada8ed86fdce977e9cb3a3093 | 117 | py | Python | mandaw/examples/window.py | mandaw2014/MandawEngineSDL | 597798e556751c57945b1ed6302f17cb6e9d8d22 | [
"MIT"
] | null | null | null | mandaw/examples/window.py | mandaw2014/MandawEngineSDL | 597798e556751c57945b1ed6302f17cb6e9d8d22 | [
"MIT"
] | null | null | null | mandaw/examples/window.py | mandaw2014/MandawEngineSDL | 597798e556751c57945b1ed6302f17cb6e9d8d22 | [
"MIT"
] | 1 | 2021-09-21T08:28:50.000Z | 2021-09-21T08:28:50.000Z | from mandaw import *
mandaw = Mandaw("Window!", width = 800, height = 600, bg_color = (0, 0, 0, 255))
mandaw.loop() | 23.4 | 80 | 0.641026 | 18 | 117 | 4.111111 | 0.722222 | 0.054054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0.179487 | 117 | 5 | 81 | 23.4 | 0.645833 | 0 | 0 | 0 | 0 | 0 | 0.059322 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 3 |
4dbb6e20146ebd5e06052b663dfca81bbe6df5e3 | 2,176 | pyde | Python | dice/dice.pyde | ahoefnagel/ProjectA-Digital-Components | 79d326f9beb433ded191187ef13d3b5a823057ef | [
"MIT"
] | null | null | null | dice/dice.pyde | ahoefnagel/ProjectA-Digital-Components | 79d326f9beb433ded191187ef13d3b5a823057ef | [
"MIT"
] | null | null | null | dice/dice.pyde | ahoefnagel/ProjectA-Digital-Components | 79d326f9beb433ded191187ef13d3b5a823057ef | [
"MIT"
] | null | null | null | # The shape of the numbers for the dice
dice = { 1: [[None, None, None], [None, "", None], [None, None, None]],
2: [["", None, None], [None, None, None], [None, None, ""]],
3: [["", None, None], [None, "", None], [None, None, ""]],
4: [["", None, ""], [None, None, None], ["", None, ""]],
5: [["", None, ""], [None, "", None], ["", None, ""]],
6: [["", None, ""], ["", None, ""], ["", None, ""]]}
dice_cnt = 3
def setup():
# Variable initialization
global dice_no, score, count, debug
dice_no = []
score = 0
count = 0
debug = True
size(130 * dice_cnt, 155)
def draw():
global dice_no, score, count
textAlign(TOP, LEFT)
textSize(12)
# Clear the previous draws on the screen
clear()
fill(255)
rect(0, 0, width, height)
if dice_no == []:
pushMatrix()
fill(0)
textAlign(CENTER, CENTER)
textSize(8*dice_cnt)
text("Click anywhere to roll the dice!", width/2, height/2)
popMatrix()
basex = 35 + width/2 - (dice_cnt * 130) / 2
if debug:
basey = 60
else:
basey = 30
for i in range(len(dice_no)):
bx = (basex+i*130)
# Fill the whole field with color x
fill(232, 227, 218)
# Draw a rect, this will be the dice
rect(bx-30, basey-30, 120, 120, 12, 12, 12, 12)
if dice_no != []:
for y in range(len(dice[dice_no[i]])):
for x in range(len(dice[dice_no[i]][y])):
if dice[dice_no[i]][y][x] != None:
# Draw the eye's of the dice, in the desired color
fill(0)
ellipse(bx + (x * 30), basey + (y * 30), 20, 20)
if debug and dice_no != []:
text("score: " + str(score) + " - Count: " + str(count) + " - Dice_No: " + str(dice_no), 0, 20)
def mousePressed():
global dice_no, score, count
if mouseButton == LEFT:
score = 0
count = 0
# Get a random value for the dice
dice_no = [int(random(1,7)) for x in range(dice_cnt)]
score = sum(dice_no)
| 32 | 103 | 0.483456 | 290 | 2,176 | 3.558621 | 0.324138 | 0.209302 | 0.244186 | 0.232558 | 0.218023 | 0.122093 | 0.098837 | 0 | 0 | 0 | 0 | 0.058533 | 0.348346 | 2,176 | 67 | 104 | 32.477612 | 0.669252 | 0.11489 | 0 | 0.153846 | 0 | 0 | 0.031804 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.057692 | false | 0 | 0 | 0 | 0.057692 | 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 | 0 | 0 | 0 | 0 | 3 |
4dc6f19452f1928a12cb21256eb1100495d990ef | 2,539 | py | Python | session11.py | sahanashetty31/session_11_epai3_assignment | 4b2d7f299fea2d3cb6f8cb1c90804f3cc4976647 | [
"MIT"
] | null | null | null | session11.py | sahanashetty31/session_11_epai3_assignment | 4b2d7f299fea2d3cb6f8cb1c90804f3cc4976647 | [
"MIT"
] | null | null | null | session11.py | sahanashetty31/session_11_epai3_assignment | 4b2d7f299fea2d3cb6f8cb1c90804f3cc4976647 | [
"MIT"
] | null | null | null | import math
from functools import lru_cache
class Polygon:
def __init__(self, n, R):
if n < 3:
raise ValueError('Polygon must have at least 3 vertices.')
self._n = n
self._R = R
def __repr__(self):
return f'Polygon(n={self._n}, R={self._R})'
@property
def count_vertices(self):
return self._n
@property
def count_edges(self):
return self._n
@property
def circumradius(self):
return self._R
@property
def interior_angle(self):
return (self._n - 2) * 180 / self._n
@property
def side_length(self):
return 2 * self._R * math.sin(math.pi / self._n)
@property
def apothem(self):
return self._R * math.cos(math.pi / self._n)
@property
def area(self):
return self._n / 2 * self.side_length * self.apothem
@property
def perimeter(self):
return self._n * self.side_length
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self.count_edges == other.count_edges and self.circumradius == other.circumradius)
else:
return NotImplemented
def __gt__(self, other):
if isinstance(other, self.__class__):
return self.count_vertices > other.count_vertices
else:
return NotImplemented
class Polygons:
def __init__(self, m, R):
if m < 3:
raise ValueError('m must be greater than 3')
self._m = m
self._R = R
self._polygons = [Polygon(i, R) for i in range(3, m+1)]
def __len__(self):
return self._m - 2
def __repr__(self):
return f'Polygons(m={self._m}, R={self._R})'
def __getitem__(self, s):
return self._polygons[s]
def __iter__(self):
return self.PolygonIterator(self)
@property
def max_efficiency_polygon(self):
sorted_polygons = sorted(self._polygons,
key=lambda p: p.area/p.perimeter,
reverse=True)
return sorted_polygons[0]
class PolyIterator:
def __init__(self, poly_obj):
self._poly_obj = poly_obj
self._index = 0
def __iter__(self):
return self
def __next__(self):
if self._index >= len(self._poly_obj):
raise StopIteration
else:
item = self._poly_obj._polygons[self._index]
self._index += 1
return item | 25.39 | 102 | 0.568334 | 312 | 2,539 | 4.282051 | 0.253205 | 0.097305 | 0.10479 | 0.056138 | 0.229042 | 0.146707 | 0.07485 | 0.07485 | 0.07485 | 0.07485 | 0 | 0.009479 | 0.335171 | 2,539 | 100 | 103 | 25.39 | 0.781991 | 0 | 0 | 0.307692 | 0 | 0 | 0.050787 | 0.008268 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0 | 0.025641 | 0.179487 | 0.589744 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
4dcb123bec4d3c0380f0862774b7117039deb91f | 281 | py | Python | W3Schools/dates.py | FRX-DEV/Python-Practice-Challenges | 8cddfb8f4181f987aa71cb75dee1f65d4d766954 | [
"MIT"
] | null | null | null | W3Schools/dates.py | FRX-DEV/Python-Practice-Challenges | 8cddfb8f4181f987aa71cb75dee1f65d4d766954 | [
"MIT"
] | null | null | null | W3Schools/dates.py | FRX-DEV/Python-Practice-Challenges | 8cddfb8f4181f987aa71cb75dee1f65d4d766954 | [
"MIT"
] | null | null | null | import datetime
x = datetime.datetime.now()
print(x)
# 2021-07-13 22:55:43.029046
print(x.year)
print(x.strftime("%A"))
"""
2021
Tuesday
"""
x = datetime.datetime(2020, 5, 17)
print(x)
# 2020-05-17 00:00:00
x = datetime.datetime(2018, 6, 1)
print(x.strftime("%B"))
# June | 12.217391 | 34 | 0.647687 | 49 | 281 | 3.714286 | 0.530612 | 0.164835 | 0.28022 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2125 | 0.145907 | 281 | 23 | 35 | 12.217391 | 0.545833 | 0.181495 | 0 | 0.222222 | 0 | 0 | 0.019608 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 0.555556 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 1 | 0 | 3 |
4de27831141702d223c7260054a467c2f0b9791f | 260 | py | Python | solentware_misc/core/__init__.py | RogerMarsh/solentware-misc | 3b031b26bc747193f25f7ffc9e6d24d7278ad30b | [
"BSD-3-Clause"
] | null | null | null | solentware_misc/core/__init__.py | RogerMarsh/solentware-misc | 3b031b26bc747193f25f7ffc9e6d24d7278ad30b | [
"BSD-3-Clause"
] | null | null | null | solentware_misc/core/__init__.py | RogerMarsh/solentware-misc | 3b031b26bc747193f25f7ffc9e6d24d7278ad30b | [
"BSD-3-Clause"
] | null | null | null | # __init__.py
# Copyright 2017 Roger Marsh
# Licence: See LICENCE (BSD licence)
"""Miscellaneous modules for applications available at solentware.co.uk.
These do not belong in the solentware_base or solentware_grid packages,
siblings of solentware_misc.
"""
| 26 | 72 | 0.792308 | 36 | 260 | 5.527778 | 0.861111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017857 | 0.138462 | 260 | 9 | 73 | 28.888889 | 0.870536 | 0.946154 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4dfb5ac8775c4305591fb5eb4b61c6ac65e66c47 | 390 | py | Python | src/examples/customstyle/wow_style/widgetstyle/radiobutton.py | robertkist/qtmodernredux | c7f791a1492ff855f3e4b963b8e9f20c46ba503f | [
"Apache-2.0"
] | 4 | 2021-04-12T19:30:47.000Z | 2022-02-11T18:24:16.000Z | src/examples/customstyle/wow_style/widgetstyle/radiobutton.py | robertkist/qtmodernredux | c7f791a1492ff855f3e4b963b8e9f20c46ba503f | [
"Apache-2.0"
] | null | null | null | src/examples/customstyle/wow_style/widgetstyle/radiobutton.py | robertkist/qtmodernredux | c7f791a1492ff855f3e4b963b8e9f20c46ba503f | [
"Apache-2.0"
] | null | null | null | radiobutton_style = '''
QRadioButton:disabled {
background: transparent;
}
QRadioButton::indicator {
background: palette(dark);
width: 8px;
height: 8px;
border: 3px solid palette(dark);
border-radius: 7px;
}
QRadioButton::indicator:checked {
background: palette(highlight);
}
QRadioButton::indicator:checked:disabled {
background: palette(midlight);
}
''' | 18.571429 | 42 | 0.697436 | 36 | 390 | 7.527778 | 0.555556 | 0.232472 | 0.206642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012422 | 0.174359 | 390 | 21 | 43 | 18.571429 | 0.829193 | 0 | 0 | 0 | 0 | 0 | 0.930946 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4dfc7fdfe3108af912d30eab1c90b722d5d0ec3d | 357 | py | Python | friday/models/__init__.py | alexa-infra/friday | 297f9bfd94e88490d53e460c93727c399b2efcb2 | [
"MIT"
] | 1 | 2019-03-17T08:11:18.000Z | 2019-03-17T08:11:18.000Z | friday/models/__init__.py | alexa-infra/friday | 297f9bfd94e88490d53e460c93727c399b2efcb2 | [
"MIT"
] | null | null | null | friday/models/__init__.py | alexa-infra/friday | 297f9bfd94e88490d53e460c93727c399b2efcb2 | [
"MIT"
] | null | null | null | # flake8: noqa
# pylint: disable=cyclic-import
from .base import db, Model, metadata
from .link import Link
from .user import User
from .event import Event, Repeat
from .bookmark import Bookmark
from .tag import Tag
from .doc import Doc, DocTag
from .recipe import Recipe, RecipeImage
from .pagination import paginate, Pagination
from .todo import TodoItem
| 27.461538 | 44 | 0.792717 | 52 | 357 | 5.442308 | 0.480769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003279 | 0.145658 | 357 | 12 | 45 | 29.75 | 0.92459 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1504d1248cc2e761c3fb76bb1b97319d6ca7d7fb | 140 | py | Python | semantic/semantic/model/model.py | VladimirSiv/semantic-search-system | 96b6581f191aacb1157b1408b2726e317ddc2c49 | [
"MIT"
] | 1 | 2021-07-01T08:53:46.000Z | 2021-07-01T08:53:46.000Z | semantic/semantic/model/model.py | VladimirSiv/semantic-search-system | 96b6581f191aacb1157b1408b2726e317ddc2c49 | [
"MIT"
] | null | null | null | semantic/semantic/model/model.py | VladimirSiv/semantic-search-system | 96b6581f191aacb1157b1408b2726e317ddc2c49 | [
"MIT"
] | 1 | 2021-12-29T01:18:38.000Z | 2021-12-29T01:18:38.000Z | from sentence_transformers import SentenceTransformer
from semantic.config import CONFIG
model = SentenceTransformer(CONFIG["model_name"])
| 28 | 53 | 0.857143 | 15 | 140 | 7.866667 | 0.6 | 0.186441 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085714 | 140 | 4 | 54 | 35 | 0.921875 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1519776f4ef0553b7494300ab7ab52a92881c3de | 350 | py | Python | InsertionSort/selectionSort/selectionsort/selectionSort.py | khaledshishani32/data-structures-and-algorithms-python | 6397ef2467958b100747ef430ddfb3e691a97a0f | [
"MIT"
] | null | null | null | InsertionSort/selectionSort/selectionsort/selectionSort.py | khaledshishani32/data-structures-and-algorithms-python | 6397ef2467958b100747ef430ddfb3e691a97a0f | [
"MIT"
] | null | null | null | InsertionSort/selectionSort/selectionsort/selectionSort.py | khaledshishani32/data-structures-and-algorithms-python | 6397ef2467958b100747ef430ddfb3e691a97a0f | [
"MIT"
] | null | null | null | def selection_sort(my_list):
for i in range(len(my_list)):
min_index=i
for j in range(i+1 , len(my_list)):
if my_list[min_index]>my_list[j]:
min_index= j
my_list[i],my_list[min_index]= my_list[min_index] ,my_list[i]
print(my_list)
cus_list=[8,4,23,42,16,15]
selection_sort(cus_list)
| 25 | 69 | 0.611429 | 64 | 350 | 3.046875 | 0.359375 | 0.307692 | 0.184615 | 0.287179 | 0.276923 | 0.276923 | 0 | 0 | 0 | 0 | 0 | 0.042308 | 0.257143 | 350 | 13 | 70 | 26.923077 | 0.707692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0 | 0 | 0.1 | 0.1 | 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 | 0 | 0 | 0 | 0 | 3 |
151aa06c987c92f779a676ea9b8988f697c25f28 | 2,600 | py | Python | CursoEmVideo/pythonProject/venv/Lib/site-packages/Interface/tests/unitfixtures.py | cassio645/Aprendendo-python | 17a8b5a0e7abc3342d24841ed28093db13d2c130 | [
"MIT"
] | null | null | null | CursoEmVideo/pythonProject/venv/Lib/site-packages/Interface/tests/unitfixtures.py | cassio645/Aprendendo-python | 17a8b5a0e7abc3342d24841ed28093db13d2c130 | [
"MIT"
] | null | null | null | CursoEmVideo/pythonProject/venv/Lib/site-packages/Interface/tests/unitfixtures.py | cassio645/Aprendendo-python | 17a8b5a0e7abc3342d24841ed28093db13d2c130 | [
"MIT"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from Interface import Interface
from Interface.Attribute import Attribute
class mytest(Interface):
pass
class C:
def m1(self, a, b):
"return 1"
return 1
def m2(self, a, b):
"return 2"
return 2
# testInstancesOfClassImplements
# YAGNI IC=Interface.impliedInterface(C)
class IC(Interface):
def m1(a, b):
"return 1"
def m2(a, b):
"return 2"
C.__implements__=IC
class I1(Interface):
def ma():
"blah"
class I2(I1): pass
class I3(Interface): pass
class I4(Interface): pass
class A(I1.deferred()):
__implements__=I1
class B:
__implements__=I2, I3
class D(A, B): pass
class E(A, B):
__implements__ = A.__implements__, C.__implements__
class FooInterface(Interface):
""" This is an Abstract Base Class """
foobar = Attribute("fuzzed over beyond all recognition")
def aMethod(foo, bar, bingo):
""" This is aMethod """
def anotherMethod(foo=6, bar="where you get sloshed", bingo=(1,3,)):
""" This is anotherMethod """
def wammy(zip, *argues):
""" yadda yadda """
def useless(**keywords):
""" useless code is fun! """
class Foo:
""" A concrete class """
__implements__ = FooInterface,
foobar = "yeah"
def aMethod(self, foo, bar, bingo):
""" This is aMethod """
return "barf!"
def anotherMethod(self, foo=6, bar="where you get sloshed", bingo=(1,3,)):
""" This is anotherMethod """
return "barf!"
def wammy(self, zip, *argues):
""" yadda yadda """
return "barf!"
def useless(self, **keywords):
""" useless code is fun! """
return "barf!"
foo_instance = Foo()
class Blah:
pass
new = Interface.__class__
FunInterface = new('FunInterface')
BarInterface = new('BarInterface', [FunInterface])
BobInterface = new('BobInterface')
BazInterface = new('BazInterface', [BobInterface, BarInterface])
| 22.033898 | 78 | 0.602308 | 304 | 2,600 | 5.042763 | 0.378289 | 0.007828 | 0.020874 | 0.015656 | 0.129159 | 0.097847 | 0.066536 | 0.066536 | 0.066536 | 0.066536 | 0 | 0.017353 | 0.224231 | 2,600 | 117 | 79 | 22.222222 | 0.742687 | 0.298077 | 0 | 0.181818 | 0 | 0 | 0.112401 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.236364 | false | 0.109091 | 0.036364 | 0 | 0.745455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 1 | 0 | 0 | 3 |
128eba5345a78af068fb819342cfe180d8d296fd | 53 | py | Python | Tests/TestData/HOSimulation/HOTrialWavefunction/config.py | McCoyGroup/RynLib | 8d7e119ebbd3da4c8b0efb49facba9ff1cbaa09d | [
"MIT"
] | 1 | 2019-05-04T00:34:11.000Z | 2019-05-04T00:34:11.000Z | Tests/TestData/HOSimulation/HOTrialWavefunction/config.py | McCoyGroup/RynLib | 8d7e119ebbd3da4c8b0efb49facba9ff1cbaa09d | [
"MIT"
] | null | null | null | Tests/TestData/HOSimulation/HOTrialWavefunction/config.py | McCoyGroup/RynLib | 8d7e119ebbd3da4c8b0efb49facba9ff1cbaa09d | [
"MIT"
] | 1 | 2020-03-04T22:47:09.000Z | 2020-03-04T22:47:09.000Z |
config = dict(
module="HOTrialWavefunction.py"
) | 13.25 | 35 | 0.698113 | 5 | 53 | 7.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169811 | 53 | 4 | 36 | 13.25 | 0.840909 | 0 | 0 | 0 | 0 | 0 | 0.415094 | 0.415094 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
129e3285af4caf68d1f91b717a406d9814f4383d | 222 | py | Python | tests/helper.py | blehers/PyViCare | e74b854afe6678f30c05bdef5e642ab66d1c0b6a | [
"Apache-2.0"
] | null | null | null | tests/helper.py | blehers/PyViCare | e74b854afe6678f30c05bdef5e642ab66d1c0b6a | [
"Apache-2.0"
] | null | null | null | tests/helper.py | blehers/PyViCare | e74b854afe6678f30c05bdef5e642ab66d1c0b6a | [
"Apache-2.0"
] | null | null | null | import os
import simplejson as json
def readJson(fileName):
test_filename = os.path.join(os.path.dirname(__file__), fileName)
with open(test_filename, mode='rb') as json_file:
return json.load(json_file)
| 24.666667 | 69 | 0.72973 | 33 | 222 | 4.666667 | 0.575758 | 0.077922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 222 | 8 | 70 | 27.75 | 0.832432 | 0 | 0 | 0 | 0 | 0 | 0.009009 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
12c5c79e7f95fd34c8892f6f44952e889b0051d1 | 111 | py | Python | backend/venv/src/api/ordercampproduct/apps.py | AkashSDas/camps_for_champs | 1bf7e51905b5b3efc47f94ffcfde7167dace4475 | [
"MIT"
] | null | null | null | backend/venv/src/api/ordercampproduct/apps.py | AkashSDas/camps_for_champs | 1bf7e51905b5b3efc47f94ffcfde7167dace4475 | [
"MIT"
] | null | null | null | backend/venv/src/api/ordercampproduct/apps.py | AkashSDas/camps_for_champs | 1bf7e51905b5b3efc47f94ffcfde7167dace4475 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class OrdercampproductConfig(AppConfig):
name = 'api.ordercampproduct'
| 18.5 | 40 | 0.792793 | 11 | 111 | 8 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135135 | 111 | 5 | 41 | 22.2 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0.18018 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
12cc8345dd761da772a7145052f730ec8abb45f7 | 621 | py | Python | tools/pot/openvino/tools/pot/graph/gpu_patterns.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/pot/openvino/tools/pot/graph/gpu_patterns.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/pot/openvino/tools/pot/graph/gpu_patterns.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2020-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from .pattern_utils import check_fused_scale_shift_patterns, get_fused_scale_shift_patterns, \
check_fused_op_const_patterns, get_fused_op_const_pattern, get_clamp_mult_const_pattern
def get_gpu_ignored_patterns():
return {
'blocks': [(pattern, check_fused_scale_shift_patterns) for pattern in get_fused_scale_shift_patterns()] +
[(pattern, check_fused_op_const_patterns) for pattern in get_fused_op_const_pattern()],
'activations': [get_clamp_mult_const_pattern()],
'inputs': []
}
| 41.4 | 113 | 0.756844 | 83 | 621 | 5.13253 | 0.421687 | 0.093897 | 0.140845 | 0.215962 | 0.643192 | 0.131455 | 0 | 0 | 0 | 0 | 0 | 0.01912 | 0.15781 | 621 | 14 | 114 | 44.357143 | 0.795411 | 0.123994 | 0 | 0 | 0 | 0 | 0.042514 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.111111 | 0.111111 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 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 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
12e58dae1b7214722dcef0c29dfe11fbbf4c0b51 | 358 | py | Python | libzyre.py | brettviren/wafit | 39e9f2748c095dc4c3421a5de0f10f300d8da30b | [
"BSD-3-Clause"
] | null | null | null | libzyre.py | brettviren/wafit | 39e9f2748c095dc4c3421a5de0f10f300d8da30b | [
"BSD-3-Clause"
] | null | null | null | libzyre.py | brettviren/wafit | 39e9f2748c095dc4c3421a5de0f10f300d8da30b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env waf
'''
This is a wafit tool for using zyre
'''
import util
def options(opt):
opt.load("libczmq")
util.generic_options(opt, "libzyre", libs=False)
def configure(cfg):
cfg.load("libczmq")
util.generic_configure_incs(cfg, "libzyre", "zyre.h", "libczmq")
util.generic_configure_libs(cfg, "libzyre", "zyre", "libczmq")
| 21.058824 | 68 | 0.667598 | 50 | 358 | 4.68 | 0.54 | 0.141026 | 0.230769 | 0.188034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164804 | 358 | 16 | 69 | 22.375 | 0.782609 | 0.148045 | 0 | 0 | 0 | 0 | 0.199324 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0 | 0.375 | 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 | 0 | 0 | 0 | 0 | 3 |
12f18b28f2f44fef548bff40a3b625b2e4be86b9 | 2,940 | py | Python | ucf_sub_catkin_ros/src/sub_states/src/qual/test.py | RoboticsClubatUCF/RoboSub | 47304c620f963a8762db57a7ed248d1df90190fb | [
"MIT"
] | null | null | null | ucf_sub_catkin_ros/src/sub_states/src/qual/test.py | RoboticsClubatUCF/RoboSub | 47304c620f963a8762db57a7ed248d1df90190fb | [
"MIT"
] | 19 | 2016-09-16T19:52:57.000Z | 2018-04-14T18:16:17.000Z | ucf_sub_catkin_ros/src/sub_states/src/qual/test.py | RoboticsClubatUCF/RoboSub | 47304c620f963a8762db57a7ed248d1df90190fb | [
"MIT"
] | 8 | 2016-01-06T20:56:45.000Z | 2017-02-26T02:49:17.000Z | #!/usr/bin/env python
import rospy
import smach
import gate
import pole
class SubStates:
def __init__(self):
rospy.loginfo("State Machine has started.")
self.gate = smach.StateMachine(outcomes=['preempted', 'POLE', 'GATE'])
self.pole = smach.StateMachine(outcomes=['preempted', 'GATE', 'POLE'])
self.tasks = smach.StateMachine(outcomes=['POLE', 'GATE', 'preempted', self.gate, self.pole])
with self.tasks:
smach.StateMachine.add('Start', self.pole, transitions={'POLE':self.pole, 'GATE':self.gate})
with self.gate:
smach.StateMachine.add('LOCATE', gate.locate(),
transitions={'preempted':'preempted',
'success': 'ALIGN',
'failure': 'LOCATE'})
smach.StateMachine.add('ALIGN', gate.align(),
transitions={'preempted':'preempted',
'success': 'THROUGH',
'failure': 'LOCATE'})
smach.StateMachine.add('THROUGH', gate.through(),
transitions={'preempted':'preempted',
'success': 'POLE',
'failure':'LOCATE'})
with self.pole:
smach.StateMachine.add('LOCATE', pole.locate(),
transitions={'preempted':'preempted',
'success': 'ALIGN',
'failure': 'LOCATE'})
smach.StateMachine.add('ALIGN', pole.align(),
transitions={'preempted':'preempted',
'success': 'DRIFT',
'failure': 'LOCATE'})
smach.StateMachine.add('DRIFT', pole.drift(),
transitions={'preempted':'preempted',
'success': 'GATE',
'failure': 'LOCATE'})
if __name__ == '__main__':
rospy.init_node('hippo_sm')
sm = SubStates()
outcome = sm.tasks.execute()
rospy.spin()
| 49.830508 | 116 | 0.343197 | 167 | 2,940 | 5.958084 | 0.251497 | 0.170854 | 0.140704 | 0.217085 | 0.319598 | 0.170854 | 0.170854 | 0.170854 | 0.170854 | 0.170854 | 0 | 0 | 0.554422 | 2,940 | 58 | 117 | 50.689655 | 0.759542 | 0.006803 | 0 | 0.325581 | 0 | 0 | 0.136348 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.093023 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 3 |
12f51cb5ac4eefb8f57e6dbd0a326e1ca9a0b225 | 712 | py | Python | src/snakeoil/descriptors.py | Arusekk/snakeoil | aad28a50118223766e5308452b369f2c72b971b2 | [
"BSD-3-Clause"
] | null | null | null | src/snakeoil/descriptors.py | Arusekk/snakeoil | aad28a50118223766e5308452b369f2c72b971b2 | [
"BSD-3-Clause"
] | null | null | null | src/snakeoil/descriptors.py | Arusekk/snakeoil | aad28a50118223766e5308452b369f2c72b971b2 | [
"BSD-3-Clause"
] | null | null | null | """Classes implementing the descriptor protocol."""
__all__ = ("classproperty",)
class classproperty:
"""Like the builtin :py:func:`property` but takes a single classmethod.
Essentially, it allows you to use a property on a class itself- not
just on its instances.
Used like this:
>>> from snakeoil.descriptors import classproperty
>>> class foo:
...
... @classproperty
... def test(cls):
... print("invoked")
... return True
>>> foo.test
invoked
True
>>> foo().test
invoked
True
"""
def __init__(self, getter):
self.getter = getter
def __get__(self, instance, owner):
return self.getter(owner)
| 20.342857 | 75 | 0.605337 | 79 | 712 | 5.303797 | 0.632911 | 0.071599 | 0.052506 | 0.085919 | 0.095465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.275281 | 712 | 34 | 76 | 20.941176 | 0.812016 | 0.610955 | 0 | 0 | 0 | 0 | 0.06599 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.166667 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.