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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e4e2a81cb4f3ae3050b8e1e6b3bddd9e64ef4110 | 101 | py | Python | compressor/conf.py | muhuk/django_compressor | 84921a89efb36f7354f12485d23814c9ec30bf39 | [
"BSD-3-Clause"
] | 1 | 2018-03-19T21:01:55.000Z | 2018-03-19T21:01:55.000Z | compressor/conf.py | muhuk/django_compressor | 84921a89efb36f7354f12485d23814c9ec30bf39 | [
"BSD-3-Clause"
] | null | null | null | compressor/conf.py | muhuk/django_compressor | 84921a89efb36f7354f12485d23814c9ec30bf39 | [
"BSD-3-Clause"
] | null | null | null | from compressor.settings import CompressorSettings
settings = CompressorSettings(prefix="COMPRESS")
| 25.25 | 50 | 0.851485 | 9 | 101 | 9.555556 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.079208 | 101 | 3 | 51 | 33.666667 | 0.924731 | 0 | 0 | 0 | 0 | 0 | 0.079208 | 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 |
e4ead8408991f21e61c8b194843e84c678e2062c | 384 | py | Python | tests/test_sum78.py | funcelot/micropython | 87ed68de216ab5b13930395bfd6d5b798313c9a1 | [
"MIT"
] | null | null | null | tests/test_sum78.py | funcelot/micropython | 87ed68de216ab5b13930395bfd6d5b798313c9a1 | [
"MIT"
] | null | null | null | tests/test_sum78.py | funcelot/micropython | 87ed68de216ab5b13930395bfd6d5b798313c9a1 | [
"MIT"
] | null | null | null | from itertools import takewhile, dropwhile
def sum78(nums):
i = enumerate(nums)
return sum([x[1] for x in takewhile(lambda x: x[1]!=7, i)]+[x[1] for x in dropwhile(lambda x: x[1]!=8, i)][1:])
def test_sum78():
assert sum78([1, 2, 2]) == 5
assert sum78([1, 2, 2, 7, 99, 99, 8]) == 5
assert sum78([1, 1, 7, 8, 2]) == 4
assert sum78([1, 1, 7, 2022, 8, 2]) == 4
| 32 | 115 | 0.5625 | 74 | 384 | 2.905405 | 0.351351 | 0.037209 | 0.223256 | 0.055814 | 0.334884 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164983 | 0.226563 | 384 | 11 | 116 | 34.909091 | 0.558923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 1 | 0.222222 | false | 0 | 0.111111 | 0 | 0.444444 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e4f7e34e3d2f53cfb58877452b4d806cc4ff98eb | 337 | py | Python | model/config_loader.py | estuaryoss/discovery-cli | 49b2eee58d14430aa58071aad9a368b4164ef898 | [
"Apache-2.0"
] | null | null | null | model/config_loader.py | estuaryoss/discovery-cli | 49b2eee58d14430aa58071aad9a368b4164ef898 | [
"Apache-2.0"
] | null | null | null | model/config_loader.py | estuaryoss/discovery-cli | 49b2eee58d14430aa58071aad9a368b4164ef898 | [
"Apache-2.0"
] | null | null | null | import yaml
class ConfigLoader:
def __init__(self, config):
""" Loads the yaml config """
self.config = config
def yaml(self):
return yaml.dump(self.__dict__)
@staticmethod
def load(data):
return ConfigLoader(yaml.safe_load(data))
def get_config(self):
return self.config
| 18.722222 | 49 | 0.623145 | 40 | 337 | 5 | 0.45 | 0.15 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.278932 | 337 | 17 | 50 | 19.823529 | 0.823045 | 0.062315 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0 | 0.090909 | 0.272727 | 0.818182 | 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 |
e4f93419c8deda73bb631e6bc4678348bdb35082 | 374 | py | Python | tests/0125_valid_palindrome_test.py | paulo-erichsen/leetcode | 78543363f7f938bdbda75de9cdab645daa29466a | [
"MIT"
] | null | null | null | tests/0125_valid_palindrome_test.py | paulo-erichsen/leetcode | 78543363f7f938bdbda75de9cdab645daa29466a | [
"MIT"
] | null | null | null | tests/0125_valid_palindrome_test.py | paulo-erichsen/leetcode | 78543363f7f938bdbda75de9cdab645daa29466a | [
"MIT"
] | null | null | null | import importlib
module = importlib.import_module("algorithms.0125_valid_palindrome")
def test_valid_palindrome():
s = module.Solution()
assert s.isPalindrome("A man, a plan, a canal: Panama")
assert s.isPalindrome("")
assert s.isPalindrome("s")
assert s.isPalindrome("ss")
assert s.isPalindrome("sAs")
assert not s.isPalindrome("race a car")
| 26.714286 | 68 | 0.708556 | 49 | 374 | 5.306122 | 0.469388 | 0.3 | 0.365385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012821 | 0.165775 | 374 | 13 | 69 | 28.769231 | 0.820513 | 0 | 0 | 0 | 0 | 0 | 0.208556 | 0.085562 | 0 | 0 | 0 | 0 | 0.6 | 1 | 0.1 | false | 0 | 0.2 | 0 | 0.3 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e4fbb884c574756940a1c7319ebb8f2f48b6257d | 250 | py | Python | python/simple.py | angus-ai/angus-getting-started | dcaccd4290a7567513974c27d870acfeaefc241b | [
"Apache-2.0"
] | 1 | 2015-08-25T23:04:28.000Z | 2015-08-25T23:04:28.000Z | python/simple.py | angus-ai/angus-getting-started | dcaccd4290a7567513974c27d870acfeaefc241b | [
"Apache-2.0"
] | null | null | null | python/simple.py | angus-ai/angus-getting-started | dcaccd4290a7567513974c27d870acfeaefc241b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import angus
import json
conn = angus.connect()
service = conn.services.get_service('age_and_gender_estimation', version=1)
job = service.process({'image': open("./images/macgyver.jpg")})
print json.dumps(job.result, indent=4)
| 27.777778 | 75 | 0.752 | 37 | 250 | 4.972973 | 0.810811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008734 | 0.084 | 250 | 8 | 76 | 31.25 | 0.79476 | 0.08 | 0 | 0 | 0 | 0 | 0.222707 | 0.200873 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.333333 | null | null | 0.166667 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
90044e7c27cb3aee6286b00ccccb6d4b92ff2f8a | 124 | py | Python | itlo/apps.py | varundey/itlo | a7b0d46aa1ce2a0163ba0deda44ee2f9ebac5039 | [
"MIT"
] | 1 | 2016-07-13T16:15:44.000Z | 2016-07-13T16:15:44.000Z | itlo/apps.py | varundey/itlo | a7b0d46aa1ce2a0163ba0deda44ee2f9ebac5039 | [
"MIT"
] | null | null | null | itlo/apps.py | varundey/itlo | a7b0d46aa1ce2a0163ba0deda44ee2f9ebac5039 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class ItloConfig(AppConfig):
name = 'itlo'
| 15.5 | 39 | 0.782258 | 15 | 124 | 6.133333 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16129 | 124 | 7 | 40 | 17.714286 | 0.884615 | 0 | 0 | 0 | 0 | 0 | 0.032258 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
900ca8e5625688e5c0f98d532225ceda8ee72bfc | 22 | py | Python | __init__.py | Ugrend/oszimporter | 33d5512506dddb4ba8a5265b8932ac4948566483 | [
"MIT"
] | null | null | null | __init__.py | Ugrend/oszimporter | 33d5512506dddb4ba8a5265b8932ac4948566483 | [
"MIT"
] | null | null | null | __init__.py | Ugrend/oszimporter | 33d5512506dddb4ba8a5265b8932ac4948566483 | [
"MIT"
] | null | null | null | __author__ = 'Ugrend'
| 11 | 21 | 0.727273 | 2 | 22 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 22 | 1 | 22 | 22 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 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 |
9015cd7fe564944fffd07ed9531b61eb725be89f | 1,946 | py | Python | functions.py | dwahme/physics_calc_enabler | f0fc4c9214cd024344c5f0d3684b29666339395e | [
"MIT"
] | null | null | null | functions.py | dwahme/physics_calc_enabler | f0fc4c9214cd024344c5f0d3684b29666339395e | [
"MIT"
] | 1 | 2018-12-31T17:49:59.000Z | 2018-12-31T17:49:59.000Z | functions.py | dwahme/physics_calc_enabler | f0fc4c9214cd024344c5f0d3684b29666339395e | [
"MIT"
] | null | null | null | import math
import statistics
def get_average(values):
total = sum(values)
amount = len(values)
return total / amount
def calc_uncertainty(values, version = "simple"):
if version == "stddev":
return statistics.stdev(values)
else:
max_val = max(values)
min_val = min(values)
return (max_val - min_val) / 2
def percent_diff(expected, actual):
return (expected - actual) / expected
def calc_slope(x1, y1, x2, y2):
return (y2 - y1) / (x2 - x1)
def calc_velocity(distance, time):
return distance / time
def calc_omega(time):
return 2 * math.pi / time
def calc_omega_uncertainty(time, time_d):
omega_min = 2 * math.pi / (time + time_d)
omega_max = 2 * math.pi / (time - time_d)
return get_average([omega_min, omega_max])
def calc_weight(mass):
return 9.8 * mass
def calc_momentum(mass, velocity):
return mass * velocity
def calc_ke(mass, velocity):
return mass * velocity * velocity / 2
def calc_rotational_force(mass, omega, radius):
return mass * omega * omega * radius
def calc_rotational_force_uncertainty(mass, omega, radius, d_mass, d_omega, d_radius):
mass_err = omega * omega * radius * d_mass
omega_err = 2 * d_omega * omega * radius * mass
radius_err = omega * omega * d_radius * mass
error_square_sum = mass_err * mass_err + omega_err * omega_err + radius_err * radius_err
return math.sqrt(error_square_sum)
def calc_moment_inertia_disk(mass, radius):
return mass * radius * radius / 2
def pretty_print_tables(values):
print("*===========*")
print("|trial|value|")
print("|-----------|")
for i in range(len(values)):
print(center_line(" trial", i) + "|" + center_line("value ", values[i]))
print("|===========|")
def center_line(col, val):
b_num = int(len(col)/2)
e_num = len(col) - len(str(val)) - b_num
return (" " * b_num) + str(val) + (" " * e_num)
| 26.657534 | 92 | 0.63926 | 274 | 1,946 | 4.321168 | 0.262774 | 0.065034 | 0.017736 | 0.027872 | 0.077703 | 0.027027 | 0 | 0 | 0 | 0 | 0 | 0.011881 | 0.22148 | 1,946 | 72 | 93 | 27.027778 | 0.769637 | 0 | 0 | 0 | 0 | 0 | 0.040596 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.288462 | false | 0 | 0.038462 | 0.173077 | 0.615385 | 0.115385 | 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 |
90314fd51207b3cd897a6ec2f5f91b491118152d | 85 | py | Python | oocgcm/parameters/mathematicalparameters.py | suyashbire1/oocgcm | c9616872077494b14b41915d1b6202aeea545c82 | [
"Apache-2.0"
] | 38 | 2016-04-05T06:15:42.000Z | 2021-08-31T17:10:00.000Z | oocgcm/parameters/mathematicalparameters.py | suyashbire1/oocgcm | c9616872077494b14b41915d1b6202aeea545c82 | [
"Apache-2.0"
] | 42 | 2016-04-16T07:47:40.000Z | 2022-03-10T19:42:25.000Z | oocgcm/parameters/mathematicalparameters.py | suyashbire1/oocgcm | c9616872077494b14b41915d1b6202aeea545c82 | [
"Apache-2.0"
] | 12 | 2016-05-09T15:15:01.000Z | 2020-01-12T10:24:29.000Z | #!/usr/bin/env python
import numpy as np
# Maths parameters
deg2rad = np.pi / 180.
| 12.142857 | 22 | 0.694118 | 14 | 85 | 4.214286 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057971 | 0.188235 | 85 | 6 | 23 | 14.166667 | 0.797101 | 0.435294 | 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 | 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 |
904420896e44d8894ebbf4f3562a4fede9217596 | 212 | py | Python | backend/run.py | cybergrind/poulpe | f5c93be027c7cf4f84c75308bbc33c8355c46ab8 | [
"MIT"
] | null | null | null | backend/run.py | cybergrind/poulpe | f5c93be027c7cf4f84c75308bbc33c8355c46ab8 | [
"MIT"
] | null | null | null | backend/run.py | cybergrind/poulpe | f5c93be027c7cf4f84c75308bbc33c8355c46ab8 | [
"MIT"
] | null | null | null | import asyncio
import sys
from tipsi_tools.python import rel_path
sys.path.append(rel_path('.'))
from poulpe.server import run_server # noqa
def main():
run_server()
if __name__ == '__main__':
main()
| 16.307692 | 44 | 0.721698 | 31 | 212 | 4.516129 | 0.580645 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165094 | 212 | 12 | 45 | 17.666667 | 0.79096 | 0.018868 | 0 | 0 | 0 | 0 | 0.043689 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.444444 | 0 | 0.555556 | 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 |
5f44624831100ffc8b0ea023a3f99bea808633fc | 268 | py | Python | hw1/policy/imitation.py | wryoung412/CS294_Deep_RL | a7d1ea9aa2a28cba40e6e6f38665e5156e6d837f | [
"MIT"
] | 1 | 2021-11-07T02:27:05.000Z | 2021-11-07T02:27:05.000Z | hw1/policy/imitation.py | wryoung412/CS294_Deep_RL | a7d1ea9aa2a28cba40e6e6f38665e5156e6d837f | [
"MIT"
] | null | null | null | hw1/policy/imitation.py | wryoung412/CS294_Deep_RL | a7d1ea9aa2a28cba40e6e6f38665e5156e6d837f | [
"MIT"
] | null | null | null | import random
import datetime
import numpy as np
import inspect, os
import tensorflow as tf
from .base import BasePolicy
def get_policy(env_name):
return ImitationPolicy(env_name)
class ImitationPolicy(BasePolicy):
def type(self):
return 'imitation'
| 19.142857 | 36 | 0.768657 | 36 | 268 | 5.638889 | 0.666667 | 0.128079 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175373 | 268 | 13 | 37 | 20.615385 | 0.918552 | 0 | 0 | 0 | 0 | 0 | 0.033582 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.181818 | false | 0 | 0.545455 | 0.181818 | 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 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
5fa4bc6a69864ea0d44dd898255206f77526fe91 | 530 | py | Python | pyxo/__init__.py | leocamelo/pixo | 334411803641d28b4bfadc7d6ab3dace5cb22ffd | [
"MIT"
] | null | null | null | pyxo/__init__.py | leocamelo/pixo | 334411803641d28b4bfadc7d6ab3dace5cb22ffd | [
"MIT"
] | 3 | 2020-09-18T17:15:58.000Z | 2021-07-28T18:32:43.000Z | pyxo/__init__.py | leocamelo/pyxo | 334411803641d28b4bfadc7d6ab3dace5cb22ffd | [
"MIT"
] | null | null | null | import json
from pathlib import Path
from .pix import Pix
__version__ = '0.1.0'
def _library():
return Path('library')
def _image(key):
metafile = _library() / key / 'meta.json'
with metafile.open() as f:
return Pix(key, json.load(f))
def get_images():
return [{'key': i.name} for i in _library().iterdir() if i.is_dir()]
def find_image(key):
return _image(key).as_json()
def perform_image(key, params):
image = _image(key)
return image.perform(_library(), params), image.mime()
| 16.060606 | 72 | 0.64717 | 78 | 530 | 4.192308 | 0.448718 | 0.122324 | 0.085627 | 0.116208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007126 | 0.20566 | 530 | 32 | 73 | 16.5625 | 0.769596 | 0 | 0 | 0 | 0 | 0 | 0.045283 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.176471 | 0.176471 | 0.764706 | 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 |
5fa8459a0480951f0dceec3139a8372e8e3e124c | 3,426 | py | Python | tests/api-client/test_media_perms.py | bcurnow/rfid-security-svc | d3806cb74d3d0cc2623ea425230dc8781ba4d8b4 | [
"Apache-2.0"
] | null | null | null | tests/api-client/test_media_perms.py | bcurnow/rfid-security-svc | d3806cb74d3d0cc2623ea425230dc8781ba4d8b4 | [
"Apache-2.0"
] | null | null | null | tests/api-client/test_media_perms.py | bcurnow/rfid-security-svc | d3806cb74d3d0cc2623ea425230dc8781ba4d8b4 | [
"Apache-2.0"
] | null | null | null | from unittest.mock import patch
from rfidsecuritysvc.api import RECORD_COUNT_HEADER
from rfidsecuritysvc.model.media_perm import MediaPerm as Model
api = 'media-perms'
def test_get(rh, media_perms):
rh.assert_response(rh.open('get', f'{api}/{media_perms[0].id}'), 200, media_perms[0])
def test_get_notfound(rh, media_perms):
rh.assert_response(rh.open('get', f'{api}/bogus'), 404)
def test_search(rh, media_perms):
rh.assert_response(rh.open('get', f'{api}'), 200, media_perms)
def test_search_with_media_id(rh, media_perms):
rh.assert_response(rh.open('get', f'{api}?media_id={media_perms[0].media.id}'), 200, [media_perms[0]])
@patch('rfidsecuritysvc.api.media_perms.model')
def test_search_noresults(model, rh):
""" The table is already populated so we need to patch instead """
model.list.return_value = []
rh.assert_response(rh.open('get', f'{api}'), 200, [])
model.list.assert_called_once()
def test_post(rh, creatable_media_perm):
p = creatable_media_perm
rh.assert_response(rh.open('post', f'{api}', p), 201)
rh.assert_response(rh.open('get', f'{api}/{p.id}'), 200)
rh.assert_response(rh.open('delete', f'{api}/{p.id}'), 200, headers={RECORD_COUNT_HEADER: '1'})
rh.assert_response(rh.open('get', f'{api}/{p.id}'), 404)
def test_post_duplicate(rh, media_perms):
rh.assert_response(rh.open('post', f'{api}', media_perms[0]), 409)
def test_post_media_notfound(rh, creatable_media_perm, creatable_media):
m = Model(creatable_media_perm.id, creatable_media, creatable_media_perm.permission)
rh.assert_response(rh.open('post', f'{api}', m), 400)
def test_post_permission_notfound(rh, creatable_media_perm, creatable_permission):
m = Model(creatable_media_perm.id, creatable_media_perm.media, creatable_permission)
rh.assert_response(rh.open('post', f'{api}', m), 400)
def test_delete(rh, creatable_media_perm):
p = creatable_media_perm
rh.assert_response(rh.open('post', f'{api}', p), 201)
rh.assert_response(rh.open('get', f'{api}/{p.id}'), 200)
rh.assert_response(rh.open('delete', f'{api}/{p.id}'), 200, headers={RECORD_COUNT_HEADER: '1'})
rh.assert_response(rh.open('get', f'{api}/{p.id}'), 404)
def test_delete_notfound(rh, creatable_media_perm):
rh.assert_response(rh.open('delete', f'{api}/{creatable_media_perm.id}'), 200, headers={RECORD_COUNT_HEADER: '0'})
def test_put(rh, creatable_media_perm, medias, permissions):
p = creatable_media_perm
assert p.media.id != medias[2].id
assert p.permission.id != permissions[2].id
updated_p = Model(creatable_media_perm.id, medias[2], permissions[2])
rh.assert_response(rh.open('post', f'{api}', p), 201)
rh.assert_response(rh.open('get', f'{api}/{p.id}'), 200)
rh.assert_response(rh.open('put', f'{api}/{p.id}', updated_p), 200, headers={RECORD_COUNT_HEADER: '1'})
rh.assert_response(rh.open('get', f'{api}/{p.id}'), 200, updated_p)
rh.assert_response(rh.open('delete', f'{api}/{creatable_media_perm.id}'), 200, headers={RECORD_COUNT_HEADER: '1'})
def test_put_not_found(rh, creatable_media_perm, medias, permissions):
p = creatable_media_perm
rh.assert_response(rh.open('put', f'{api}/{p.id}', p), 201, headers={RECORD_COUNT_HEADER: '1'})
rh.assert_response(rh.open('get', f'{api}/{p.id}'), 200, p)
rh.assert_response(rh.open('delete', f'{api}/{p.id}'), 200, headers={RECORD_COUNT_HEADER: '1'})
| 40.305882 | 118 | 0.702277 | 546 | 3,426 | 4.173993 | 0.122711 | 0.087758 | 0.175516 | 0.197455 | 0.71391 | 0.677051 | 0.644581 | 0.644142 | 0.582712 | 0.566477 | 0 | 0.030023 | 0.115295 | 3,426 | 84 | 119 | 40.785714 | 0.721874 | 0.016929 | 0 | 0.314815 | 0 | 0 | 0.140774 | 0.04881 | 0 | 0 | 0 | 0 | 0.518519 | 1 | 0.240741 | false | 0 | 0.055556 | 0 | 0.296296 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5fbc985182cb6475cfa3730fbac9490d0e922a82 | 128 | py | Python | personalib/__main__.py | FogaProd/PersonaLib | d473160001ba2f35ca99aa44cecf222002494ff4 | [
"MIT"
] | null | null | null | personalib/__main__.py | FogaProd/PersonaLib | d473160001ba2f35ca99aa44cecf222002494ff4 | [
"MIT"
] | null | null | null | personalib/__main__.py | FogaProd/PersonaLib | d473160001ba2f35ca99aa44cecf222002494ff4 | [
"MIT"
] | null | null | null | import os
from .bot import PersonaLib
if __name__ == "__main__":
bot = PersonaLib()
bot.run(os.environ["BOT_TOKEN"])
| 14.222222 | 36 | 0.671875 | 17 | 128 | 4.529412 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.195313 | 128 | 8 | 37 | 16 | 0.747573 | 0 | 0 | 0 | 0 | 0 | 0.132813 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 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 |
3968e281088fd5c0eac67f84f80dbd54880c9868 | 211 | py | Python | backend/treeckle/users/urls.py | CAPTxTreeckle/Treeckle-2.0 | 3a7f4c1a265b836a870ff34e6faff8b292002a52 | [
"MIT"
] | null | null | null | backend/treeckle/users/urls.py | CAPTxTreeckle/Treeckle-2.0 | 3a7f4c1a265b836a870ff34e6faff8b292002a52 | [
"MIT"
] | 5 | 2020-11-19T09:12:48.000Z | 2020-12-23T21:46:19.000Z | backend/treeckle/users/urls.py | CAPTxTreeckle/Treeckle-2.0 | 3a7f4c1a265b836a870ff34e6faff8b292002a52 | [
"MIT"
] | 4 | 2020-05-13T12:47:15.000Z | 2021-07-13T17:01:38.000Z | from django.urls import path
from .views import UserInvitesView, UsersView
urlpatterns = [
path("", UsersView.as_view(), name="users"),
path("invite", UserInvitesView.as_view(), name="user_invites"),
] | 26.375 | 67 | 0.71564 | 25 | 211 | 5.92 | 0.64 | 0.081081 | 0.135135 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132701 | 211 | 8 | 68 | 26.375 | 0.808743 | 0 | 0 | 0 | 0 | 0 | 0.108491 | 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 |
39798672ee5fb24cdc9f67f14581622ec4ef65ca | 126 | py | Python | mainapp/apps.py | muthukaruppanp/rudimentary-recruitment | cc56edfae1d5c529c8d9ee0bbe05a358edb21d3b | [
"MIT"
] | null | null | null | mainapp/apps.py | muthukaruppanp/rudimentary-recruitment | cc56edfae1d5c529c8d9ee0bbe05a358edb21d3b | [
"MIT"
] | null | null | null | mainapp/apps.py | muthukaruppanp/rudimentary-recruitment | cc56edfae1d5c529c8d9ee0bbe05a358edb21d3b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MainappConfig(AppConfig):
name = 'mainapp'
verbose_name = 'Job Application'
| 18 | 36 | 0.738095 | 14 | 126 | 6.571429 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.18254 | 126 | 6 | 37 | 21 | 0.893204 | 0 | 0 | 0 | 0 | 0 | 0.174603 | 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 |
3981769b652ee548c6909ddd722a3284813f4a78 | 688 | py | Python | erddapClient/url_operations.py | dspelaez/erddap-python | eac6052ea7168f40c84ce87b1abf955236ce20f7 | [
"MIT"
] | 6 | 2021-04-07T00:09:52.000Z | 2022-03-02T22:27:34.000Z | erddapClient/url_operations.py | dspelaez/erddap-python | eac6052ea7168f40c84ce87b1abf955236ce20f7 | [
"MIT"
] | 1 | 2022-01-06T18:14:39.000Z | 2022-01-10T18:51:43.000Z | erddapClient/url_operations.py | dspelaez/erddap-python | eac6052ea7168f40c84ce87b1abf955236ce20f7 | [
"MIT"
] | 2 | 2021-05-24T14:23:02.000Z | 2021-09-01T15:38:57.000Z | import os
from urllib.parse import quote, quote_plus, urlparse, ParseResult
def parseQueryItems(items, useSafeURL=True, safe='', item_separator='&'):
if useSafeURL:
return quote(item_separator.join(items), safe=safe)
else:
return item_separator.join(items)
def url_join(*args):
return "/".join(map(lambda x: str(x).rstrip('/'), args))
def joinURLElements(base, query):
return base + '?' + query
def joinURLElementsWithAuth(base, query, auth):
abase = base.replace("https://", "https://{}:{}@".format(auth[0],auth[1]))
abase = base.replace("http://", "http://{}:{}@".format(auth[0],auth[1]))
return joinURLElements(abase, query)
| 29.913043 | 78 | 0.651163 | 84 | 688 | 5.27381 | 0.47619 | 0.088036 | 0.076749 | 0.099323 | 0.072235 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006957 | 0.164244 | 688 | 22 | 79 | 31.272727 | 0.763478 | 0 | 0 | 0 | 0 | 0 | 0.067055 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0.133333 | 0.133333 | 0.733333 | 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 |
399baeb734c297c3b7918b5428d775eeac6f4b70 | 80 | py | Python | client/verta/verta/operations/monitoring/alert/__init__.py | houqp/modeldb | 32837d9c1446f42882ae2a7729df1a08e33ac155 | [
"Apache-2.0"
] | null | null | null | client/verta/verta/operations/monitoring/alert/__init__.py | houqp/modeldb | 32837d9c1446f42882ae2a7729df1a08e33ac155 | [
"Apache-2.0"
] | null | null | null | client/verta/verta/operations/monitoring/alert/__init__.py | houqp/modeldb | 32837d9c1446f42882ae2a7729df1a08e33ac155 | [
"Apache-2.0"
] | 1 | 2021-05-04T13:52:09.000Z | 2021-05-04T13:52:09.000Z | from ._alerter import (
_Alerter,
FixedAlerter,
ReferenceAlerter,
)
| 13.333333 | 23 | 0.675 | 6 | 80 | 8.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 80 | 5 | 24 | 16 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
39a47662ce34ba4de64333748ccd159c7100bc34 | 7,423 | py | Python | ECore_Copier_MM/transformation-Large/HEClass.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | ECore_Copier_MM/transformation-Large/HEClass.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | ECore_Copier_MM/transformation-Large/HEClass.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z |
from core.himesis import Himesis
class HEClass(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HEClass.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HEClass, self).__init__(name='HEClass', num_nodes=48, edges=[])
# Add the edges
self.add_edges([[0, 3], [3, 6], [1, 4], [4, 7], [6, 8], [8, 37], [6, 9], [9, 38], [6, 10], [10, 39], [6, 11], [11, 40], [6, 12], [12, 41], [7, 13], [13, 42], [14, 15], [15, 42], [14, 16], [16, 37], [7, 17], [17, 43], [18, 19], [19, 43], [18, 20], [20, 38], [7, 21], [21, 44], [22, 23], [23, 44], [22, 24], [24, 39], [7, 25], [25, 45], [26, 27], [27, 45], [26, 28], [28, 40], [7, 29], [29, 46], [30, 31], [31, 46], [30, 32], [32, 41], [7, 33], [33, 47], [34, 35], [35, 47], [34, 36], [36, 5], [0, 2], [2, 1]])
# Set the graph attributes
self["mm__"] = ['HimesisMM']
self["name"] = """EClass"""
self["GUID__"] = 7513848719461737483
# Set the node attributes
self.vs[0]["mm__"] = """MatchModel"""
self.vs[0]["GUID__"] = 4742423356105061334
self.vs[1]["mm__"] = """ApplyModel"""
self.vs[1]["GUID__"] = 5181436541492304252
self.vs[2]["mm__"] = """paired_with"""
self.vs[2]["GUID__"] = 4434945747091075106
self.vs[3]["mm__"] = """match_contains"""
self.vs[3]["GUID__"] = 4989009618805165137
self.vs[4]["mm__"] = """apply_contains"""
self.vs[4]["GUID__"] = 5986624910178420165
self.vs[5]["name"] = """solveRef"""
self.vs[5]["mm__"] = """Constant"""
self.vs[5]["Type"] = """'String'"""
self.vs[5]["GUID__"] = 580242660644043333
self.vs[6]["name"] = """"""
self.vs[6]["classtype"] = """EClass"""
self.vs[6]["mm__"] = """EClass"""
self.vs[6]["cardinality"] = """+"""
self.vs[6]["GUID__"] = 22786086082354646
self.vs[7]["name"] = """"""
self.vs[7]["classtype"] = """EClass"""
self.vs[7]["mm__"] = """EClass"""
self.vs[7]["cardinality"] = """1"""
self.vs[7]["GUID__"] = 1272466000560267557
self.vs[8]["mm__"] = """hasAttribute_S"""
self.vs[8]["GUID__"] = 6283651994548442189
self.vs[9]["mm__"] = """hasAttribute_S"""
self.vs[9]["GUID__"] = 9048676135290437050
self.vs[10]["mm__"] = """hasAttribute_S"""
self.vs[10]["GUID__"] = 2602803380974761347
self.vs[11]["mm__"] = """hasAttribute_S"""
self.vs[11]["GUID__"] = 8447611663646971915
self.vs[12]["mm__"] = """hasAttribute_S"""
self.vs[12]["GUID__"] = 7497873399091937712
self.vs[13]["mm__"] = """hasAttribute_T"""
self.vs[13]["GUID__"] = 2988374777112564422
self.vs[14]["name"] = """eq_"""
self.vs[14]["mm__"] = """Equation"""
self.vs[14]["GUID__"] = 6115115672666886032
self.vs[15]["mm__"] = """leftExpr"""
self.vs[15]["GUID__"] = 5370290965238461812
self.vs[16]["mm__"] = """rightExpr"""
self.vs[16]["GUID__"] = 4328026573727980470
self.vs[17]["mm__"] = """hasAttribute_T"""
self.vs[17]["GUID__"] = 5930191671046105503
self.vs[18]["name"] = """eq_"""
self.vs[18]["mm__"] = """Equation"""
self.vs[18]["GUID__"] = 4027767436937871107
self.vs[19]["mm__"] = """leftExpr"""
self.vs[19]["GUID__"] = 8198350520857470846
self.vs[20]["mm__"] = """rightExpr"""
self.vs[20]["GUID__"] = 56305781236500140
self.vs[21]["mm__"] = """hasAttribute_T"""
self.vs[21]["GUID__"] = 5816270308432200821
self.vs[22]["name"] = """eq_"""
self.vs[22]["mm__"] = """Equation"""
self.vs[22]["GUID__"] = 3018523247400060675
self.vs[23]["mm__"] = """leftExpr"""
self.vs[23]["GUID__"] = 1134675740742584747
self.vs[24]["mm__"] = """rightExpr"""
self.vs[24]["GUID__"] = 6391469163412356173
self.vs[25]["mm__"] = """hasAttribute_T"""
self.vs[25]["GUID__"] = 2231421643249516077
self.vs[26]["name"] = """eq_"""
self.vs[26]["mm__"] = """Equation"""
self.vs[26]["GUID__"] = 393270198530292226
self.vs[27]["mm__"] = """leftExpr"""
self.vs[27]["GUID__"] = 7959241052684112490
self.vs[28]["mm__"] = """rightExpr"""
self.vs[28]["GUID__"] = 9176793662181759298
self.vs[29]["mm__"] = """hasAttribute_T"""
self.vs[29]["GUID__"] = 7096832831924373997
self.vs[30]["name"] = """eq_"""
self.vs[30]["mm__"] = """Equation"""
self.vs[30]["GUID__"] = 6063714520899510436
self.vs[31]["mm__"] = """leftExpr"""
self.vs[31]["GUID__"] = 325653883320794137
self.vs[32]["mm__"] = """rightExpr"""
self.vs[32]["GUID__"] = 8495101061851008361
self.vs[33]["mm__"] = """hasAttribute_T"""
self.vs[33]["GUID__"] = 7801276425328862995
self.vs[34]["name"] = """eq_"""
self.vs[34]["mm__"] = """Equation"""
self.vs[34]["GUID__"] = 1784090817628174897
self.vs[35]["mm__"] = """leftExpr"""
self.vs[35]["GUID__"] = 1064151979311302782
self.vs[36]["mm__"] = """rightExpr"""
self.vs[36]["GUID__"] = 8886965455982764657
self.vs[37]["name"] = """name"""
self.vs[37]["mm__"] = """Attribute"""
self.vs[37]["Type"] = """'String'"""
self.vs[37]["GUID__"] = 7429345277418169462
self.vs[38]["name"] = """instanceClassName"""
self.vs[38]["mm__"] = """Attribute"""
self.vs[38]["Type"] = """'String'"""
self.vs[38]["GUID__"] = 5291727197465673332
self.vs[39]["name"] = """instanceTypeName"""
self.vs[39]["mm__"] = """Attribute"""
self.vs[39]["Type"] = """'String'"""
self.vs[39]["GUID__"] = 1532970426105482341
self.vs[40]["name"] = """abstract"""
self.vs[40]["mm__"] = """Attribute"""
self.vs[40]["Type"] = """'String'"""
self.vs[40]["GUID__"] = 3129070758137889662
self.vs[41]["name"] = """interface"""
self.vs[41]["mm__"] = """Attribute"""
self.vs[41]["Type"] = """'String'"""
self.vs[41]["GUID__"] = 1478859906853884304
self.vs[42]["name"] = """name"""
self.vs[42]["mm__"] = """Attribute"""
self.vs[42]["Type"] = """'String'"""
self.vs[42]["GUID__"] = 1918273726752043050
self.vs[43]["name"] = """instanceClassName"""
self.vs[43]["mm__"] = """Attribute"""
self.vs[43]["Type"] = """'String'"""
self.vs[43]["GUID__"] = 1539138781819746550
self.vs[44]["name"] = """instanceTypeName"""
self.vs[44]["mm__"] = """Attribute"""
self.vs[44]["Type"] = """'String'"""
self.vs[44]["GUID__"] = 4056093923231812936
self.vs[45]["name"] = """abstract"""
self.vs[45]["mm__"] = """Attribute"""
self.vs[45]["Type"] = """'String'"""
self.vs[45]["GUID__"] = 4353261615111462761
self.vs[46]["name"] = """interface"""
self.vs[46]["mm__"] = """Attribute"""
self.vs[46]["Type"] = """'String'"""
self.vs[46]["GUID__"] = 637324929847536973
self.vs[47]["name"] = """ApplyAttribute"""
self.vs[47]["mm__"] = """Attribute"""
self.vs[47]["Type"] = """'String'"""
self.vs[47]["GUID__"] = 3198182771433055588
| 47.583333 | 516 | 0.513943 | 838 | 7,423 | 4.281623 | 0.192124 | 0.220736 | 0.046823 | 0.053512 | 0.064381 | 0 | 0 | 0 | 0 | 0 | 0 | 0.236777 | 0.235888 | 7,423 | 155 | 517 | 47.890323 | 0.395804 | 0.021824 | 0 | 0 | 0 | 0 | 0.19693 | 0 | 0.007092 | 0 | 0 | 0 | 0 | 1 | 0.007092 | false | 0 | 0.007092 | 0 | 0.021277 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
39b543b413d98228496acd46887ee396691c15c1 | 86,082 | py | Python | problem_examples/chess_annealing/python_ziper.py | donRumata03/PowerfulGA | e4e2370287a7b654caf92adac8a64a39e23468c9 | [
"MIT"
] | 3 | 2020-04-11T10:48:01.000Z | 2021-02-09T11:43:12.000Z | problem_examples/chess_annealing/python_ziper.py | donRumata03/PowerfulGA | e4e2370287a7b654caf92adac8a64a39e23468c9 | [
"MIT"
] | 6 | 2020-12-03T15:37:45.000Z | 2020-12-09T11:02:37.000Z | problem_examples/chess_annealing/python_ziper.py | donRumata03/PowerfulGA | e4e2370287a7b654caf92adac8a64a39e23468c9 | [
"MIT"
] | 1 | 2021-04-25T21:50:09.000Z | 2021-04-25T21:50:09.000Z | data = {
4 : [2, 0, 3, 1],
5 : [3, 0, 2, 4, 1],
6 : [3, 0, 4, 1, 5, 2],
7 : [4, 0, 5, 3, 1, 6, 2],
8 : [2, 4, 1, 7, 0, 6, 3, 5],
9 : [3, 1, 4, 7, 0, 2, 5, 8, 6],
10 : [8, 4, 0, 7, 3, 1, 6, 9, 5, 2],
11 : [5, 7, 0, 3, 8, 2, 9, 6, 10, 1, 4],
12 : [7, 10, 0, 2, 8, 5, 3, 1, 9, 11, 6, 4],
13 : [7, 5, 2, 9, 12, 0, 4, 10, 1, 6, 11, 3, 8],
14 : [6, 11, 1, 4, 9, 5, 10, 2, 0, 12, 8, 13, 3, 7],
15 : [10, 8, 0, 3, 12, 2, 9, 1, 4, 11, 14, 6, 13, 5, 7],
16 : [8, 15, 1, 10, 2, 9, 11, 13, 3, 12, 0, 4, 6, 14, 5, 7],
17 : [9, 2, 12, 10, 7, 0, 14, 1, 4, 13, 8, 16, 5, 3, 11, 6, 15],
18 : [13, 8, 1, 5, 12, 15, 11, 0, 6, 3, 14, 17, 9, 16, 4, 10, 7, 2],
19 : [11, 8, 15, 7, 4, 2, 14, 17, 6, 18, 9, 12, 1, 3, 16, 0, 10, 5, 13],
20 : [17, 14, 9, 7, 3, 15, 6, 2, 19, 10, 12, 5, 1, 18, 0, 13, 8, 4, 11, 16],
21 : [8, 17, 14, 1, 15, 19, 6, 3, 12, 18, 7, 4, 2, 0, 9, 20, 5, 16, 10, 13, 11],
22 : [9, 4, 21, 14, 8, 11, 16, 7, 3, 1, 18, 13, 19, 12, 15, 20, 5, 10, 2, 0, 6, 17],
23 : [10, 14, 18, 8, 2, 9, 12, 21, 17, 3, 6, 19, 1, 16, 13, 22, 7, 5, 15, 0, 20, 11, 4],
24 : [11, 23, 7, 9, 4, 13, 15, 20, 2, 16, 12, 8, 22, 17, 1, 5, 19, 0, 14, 18, 21, 10, 6, 3],
25 : [17, 20, 3, 19, 8, 4, 18, 12, 15, 7, 10, 2, 21, 1, 24, 0, 9, 23, 14, 11, 22, 16, 6, 13, 5],
26 : [9, 4, 14, 16, 24, 13, 6, 0, 12, 23, 17, 22, 11, 1, 20, 2, 21, 19, 7, 10, 15, 3, 18, 8, 25, 5],
27 : [9, 11, 17, 7, 25, 23, 18, 13, 0, 4, 8, 5, 15, 21, 1, 6, 16, 24, 19, 12, 22, 26, 3, 20, 2, 10, 14],
28 : [20, 5, 10, 2, 13, 3, 21, 9, 24, 19, 15, 8, 26, 0, 27, 7, 17, 1, 6, 25, 11, 14, 12, 23, 18, 4, 22, 16],
29 : [13, 7, 10, 25, 19, 26, 16, 9, 1, 27, 11, 28, 17, 4, 23, 5, 14, 2, 0, 22, 15, 21, 18, 3, 8, 24, 12, 6, 20],
30 : [20, 13, 11, 7, 25, 22, 6, 14, 18, 27, 5, 8, 23, 26, 29, 17, 15, 1, 12, 4, 2, 24, 28, 21, 0, 3, 16, 10, 19, 9],
31 : [17, 6, 1, 21, 5, 27, 19, 22, 18, 13, 10, 20, 24, 3, 30, 4, 7, 25, 0, 14, 23, 28, 8, 11, 16, 12, 2, 29, 26, 9, 15],
32 : [14, 22, 6, 10, 27, 15, 26, 9, 25, 28, 7, 29, 17, 2, 20, 13, 8, 18, 1, 30, 5, 0, 31, 3, 24, 21, 4, 11, 23, 16, 12, 19],
33 : [21, 24, 13, 5, 30, 9, 18, 3, 28, 31, 19, 1, 20, 4, 14, 29, 2, 22, 15, 26, 7, 10, 16, 0, 25, 23, 32, 8, 27, 17, 12, 6, 11],
34 : [30, 16, 20, 28, 17, 9, 14, 4, 24, 7, 31, 1, 32, 2, 13, 22, 33, 19, 6, 29, 15, 8, 25, 3, 18, 0, 27, 12, 10, 5, 21, 23, 11, 26],
35 : [6, 32, 11, 22, 4, 16, 9, 21, 31, 13, 27, 33, 8, 23, 0, 28, 14, 2, 17, 26, 7, 10, 34, 25, 18, 1, 3, 19, 12, 30, 20, 24, 15, 5, 29],
36 : [23, 17, 34, 16, 22, 20, 9, 32, 29, 8, 1, 3, 0, 7, 19, 15, 25, 31, 35, 12, 27, 11, 33, 21, 5, 2, 28, 24, 10, 14, 26, 4, 18, 13, 6, 30],
37 : [13, 30, 12, 21, 15, 4, 1, 3, 32, 28, 24, 16, 18, 22, 35, 7, 36, 0, 25, 17, 6, 23, 26, 10, 27, 33, 2, 5, 19, 9, 11, 31, 14, 34, 8, 20, 29],
38 : [24, 12, 17, 19, 25, 30, 6, 10, 3, 27, 8, 4, 21, 26, 11, 16, 33, 29, 37, 7, 28, 0, 32, 5, 14, 31, 1, 23, 15, 36, 2, 35, 13, 9, 18, 34, 22, 20],
39 : [24, 11, 5, 25, 6, 14, 26, 18, 22, 9, 27, 37, 10, 34, 7, 28, 35, 29, 13, 16, 0, 8, 1, 15, 20, 2, 30, 32, 36, 12, 4, 38, 23, 21, 33, 17, 3, 31, 19],
40 : [39, 35, 21, 12, 20, 16, 31, 3, 14, 7, 37, 23, 32, 0, 29, 10, 34, 25, 2, 13, 8, 38, 4, 22, 24, 15, 36, 6, 1, 26, 5, 33, 9, 18, 27, 11, 17, 28, 30, 19],
41 : [27, 29, 5, 38, 15, 11, 23, 16, 13, 0, 26, 36, 33, 21, 34, 10, 30, 3, 8, 37, 22, 31, 18, 1, 39, 14, 9, 4, 25, 28, 2, 6, 17, 40, 35, 19, 7, 24, 20, 12, 32],
42 : [21, 31, 10, 0, 35, 11, 28, 26, 36, 4, 9, 37, 8, 38, 17, 2, 34, 19, 23, 39, 29, 14, 3, 6, 22, 1, 41, 13, 32, 40, 15, 25, 33, 24, 18, 12, 7, 5, 16, 27, 30, 20],
43 : [27, 18, 31, 23, 0, 37, 16, 38, 26, 11, 3, 6, 2, 19, 22, 41, 35, 20, 12, 30, 32, 8, 1, 36, 7, 25, 40, 42, 10, 34, 28, 4, 29, 14, 33, 5, 24, 9, 39, 15, 17, 21, 13],
44 : [28, 9, 21, 32, 22, 19, 30, 24, 1, 10, 7, 14, 8, 0, 26, 36, 38, 12, 27, 29, 2, 20, 35, 43, 18, 31, 42, 11, 5, 40, 34, 16, 23, 25, 3, 37, 41, 15, 6, 4, 13, 39, 17, 33],
45 : [29, 16, 21, 27, 1, 17, 19, 33, 8, 43, 0, 13, 30, 44, 42, 35, 3, 28, 9, 22, 41, 15, 31, 40, 34, 39, 12, 4, 23, 14, 38, 36, 2, 6, 26, 24, 37, 18, 10, 32, 7, 25, 20, 11, 5],
46 : [34, 31, 42, 39, 17, 14, 16, 7, 32, 6, 0, 30, 41, 5, 15, 2, 12, 29, 45, 4, 35, 26, 36, 43, 13, 1, 28, 9, 21, 23, 8, 19, 27, 24, 37, 33, 40, 11, 44, 38, 20, 10, 3, 18, 25, 22],
47 : [40, 22, 25, 21, 38, 1, 26, 29, 17, 20, 46, 30, 9, 2, 45, 13, 42, 44, 0, 18, 33, 36, 23, 11, 24, 27, 43, 39, 5, 14, 8, 34, 15, 6, 28, 19, 41, 7, 12, 31, 35, 10, 32, 3, 16, 4, 37],
48 : [28, 23, 38, 30, 18, 26, 6, 12, 33, 25, 13, 44, 24, 8, 11, 0, 31, 35, 20, 1, 39, 9, 21, 46, 3, 45, 34, 40, 4, 22, 41, 27, 5, 17, 14, 42, 37, 43, 36, 29, 2, 15, 7, 47, 19, 16, 32, 10],
49 : [19, 44, 23, 13, 38, 3, 9, 6, 43, 14, 22, 47, 28, 33, 21, 12, 34, 1, 8, 11, 37, 48, 0, 31, 15, 36, 27, 16, 32, 42, 25, 18, 5, 29, 40, 35, 45, 7, 10, 2, 26, 24, 17, 20, 46, 30, 39, 41, 4],
50 : [33, 20, 14, 11, 28, 37, 19, 27, 12, 38, 45, 48, 42, 49, 21, 24, 30, 10, 23, 4, 47, 31, 0, 7, 13, 1, 44, 17, 29, 16, 41, 25, 34, 3, 26, 15, 2, 35, 5, 22, 40, 32, 6, 8, 39, 18, 43, 46, 36, 9],
51 : [31, 39, 13, 46, 22, 42, 26, 47, 35, 8, 49, 18, 2, 28, 9, 7, 48, 50, 6, 29, 37, 21, 23, 12, 32, 0, 20, 41, 44, 15, 3, 34, 38, 30, 5, 1, 45, 16, 40, 43, 36, 11, 33, 19, 27, 10, 4, 14, 25, 17, 24],
52 : [46, 0, 12, 41, 21, 33, 15, 10, 8, 32, 44, 17, 38, 29, 6, 34, 47, 22, 16, 26, 7, 39, 43, 25, 5, 36, 48, 3, 19, 2, 50, 9, 40, 4, 28, 1, 49, 51, 20, 13, 35, 37, 11, 27, 45, 42, 23, 30, 18, 24, 14, 31],
53 : [25, 22, 13, 41, 36, 23, 30, 19, 44, 2, 47, 37, 29, 9, 33, 5, 21, 50, 15, 32, 7, 28, 38, 12, 18, 6, 48, 27, 34, 0, 8, 46, 52, 1, 11, 26, 45, 51, 17, 4, 42, 49, 43, 3, 39, 31, 20, 16, 24, 10, 14, 35, 40],
54 : [33, 29, 18, 13, 38, 45, 25, 6, 39, 14, 22, 37, 7, 51, 41, 47, 20, 4, 31, 27, 21, 19, 0, 2, 48, 1, 32, 16, 46, 9, 50, 53, 49, 30, 3, 17, 8, 40, 28, 12, 5, 34, 44, 11, 15, 26, 23, 10, 42, 24, 35, 43, 52, 36],
55 : [54, 43, 32, 3, 25, 4, 31, 0, 27, 44, 37, 5, 36, 26, 50, 7, 12, 45, 41, 23, 11, 35, 28, 1, 6, 13, 42, 14, 17, 46, 10, 49, 34, 19, 9, 30, 15, 20, 39, 48, 38, 22, 52, 40, 47, 53, 51, 2, 33, 18, 8, 21, 24, 29, 16],
56 : [20, 26, 19, 46, 32, 0, 45, 15, 18, 36, 9, 35, 53, 3, 27, 47, 13, 40, 10, 50, 24, 43, 8, 38, 31, 54, 5, 39, 11, 55, 44, 16, 6, 49, 34, 28, 17, 21, 14, 41, 51, 2, 48, 30, 4, 25, 37, 29, 12, 1, 22, 52, 7, 42, 23, 33],
57 : [37, 23, 21, 46, 32, 3, 42, 45, 20, 30, 4, 0, 13, 53, 56, 40, 25, 17, 24, 11, 33, 26, 54, 41, 55, 48, 43, 6, 52, 9, 14, 12, 27, 49, 22, 28, 38, 44, 8, 47, 51, 31, 18, 34, 10, 16, 5, 15, 35, 1, 7, 50, 19, 39, 36, 29, 2],
58 : [20, 39, 19, 43, 8, 33, 11, 16, 55, 41, 23, 38, 31, 42, 22, 36, 40, 47, 49, 13, 9, 6, 56, 46, 4, 12, 28, 45, 3, 5, 18, 10, 57, 44, 24, 0, 29, 7, 37, 54, 21, 53, 34, 27, 15, 2, 14, 50, 25, 32, 48, 51, 1, 35, 26, 52, 30, 17],
59 : [51, 26, 38, 57, 27, 19, 11, 7, 37, 30, 13, 23, 47, 3, 29, 34, 32, 44, 46, 2, 15, 53, 28, 14, 5, 58, 18, 25, 4, 1, 54, 49, 36, 0, 43, 55, 6, 17, 31, 16, 48, 40, 52, 50, 9, 42, 21, 10, 22, 33, 35, 24, 39, 12, 56, 41, 20, 45, 8],
60 : [20, 1, 33, 15, 29, 53, 23, 8, 40, 45, 52, 41, 9, 51, 54, 24, 35, 21, 14, 37, 43, 50, 55, 4, 7, 59, 16, 13, 19, 32, 46, 5, 12, 27, 49, 57, 34, 6, 48, 26, 47, 0, 31, 3, 36, 44, 39, 58, 2, 10, 28, 56, 17, 38, 42, 11, 18, 25, 30, 22],
61 : [51, 12, 9, 36, 32, 54, 3, 25, 4, 38, 50, 34, 6, 15, 23, 29, 26, 41, 30, 56, 37, 53, 21, 7, 45, 55, 14, 52, 44, 2, 57, 31, 18, 0, 47, 20, 5, 59, 8, 28, 60, 22, 35, 33, 48, 19, 24, 39, 46, 17, 58, 10, 43, 1, 49, 16, 27, 11, 40, 42, 13],
62 : [45, 37, 57, 44, 19, 31, 54, 1, 22, 26, 21, 50, 12, 20, 27, 34, 24, 52, 0, 35, 7, 30, 10, 53, 56, 18, 59, 48, 11, 49, 4, 6, 36, 29, 61, 47, 41, 9, 15, 5, 32, 43, 60, 40, 14, 25, 17, 3, 16, 8, 23, 46, 55, 38, 2, 39, 42, 33, 13, 58, 51, 28],
63 : [44, 57, 30, 0, 33, 52, 46, 6, 51, 18, 55, 23, 36, 34, 62, 15, 17, 47, 37, 10, 25, 53, 45, 1, 42, 61, 59, 9, 7, 24, 26, 8, 39, 21, 48, 38, 56, 50, 32, 4, 11, 49, 35, 58, 54, 5, 14, 2, 31, 13, 19, 43, 28, 40, 29, 41, 22, 27, 3, 16, 12, 20, 60],
64 : [8, 29, 40, 26, 36, 53, 48, 4, 58, 16, 39, 2, 27, 62, 55, 0, 10, 44, 28, 54, 23, 11, 43, 5, 12, 56, 60, 6, 3, 41, 46, 17, 30, 1, 34, 49, 19, 42, 7, 52, 32, 61, 15, 21, 9, 51, 63, 24, 35, 38, 13, 31, 47, 14, 20, 57, 37, 50, 22, 18, 59, 45, 33, 25],
65 : [13, 38, 8, 35, 16, 43, 27, 53, 19, 59, 49, 40, 3, 54, 18, 9, 33, 52, 25, 61, 6, 26, 31, 51, 1, 50, 15, 10, 36, 28, 63, 21, 34, 11, 0, 7, 56, 47, 17, 23, 32, 55, 4, 39, 29, 5, 44, 62, 64, 14, 45, 48, 2, 41, 24, 22, 30, 58, 12, 46, 60, 37, 42, 20, 57],
66 : [27, 23, 9, 35, 57, 60, 16, 51, 45, 3, 11, 44, 33, 59, 40, 49, 19, 17, 2, 55, 5, 30, 28, 10, 15, 22, 14, 52, 63, 46, 58, 12, 61, 47, 36, 48, 26, 32, 62, 38, 1, 53, 18, 13, 4, 65, 25, 43, 41, 0, 7, 56, 21, 6, 31, 29, 42, 39, 50, 8, 64, 20, 24, 34, 37, 54],
67 : [16, 21, 53, 44, 35, 29, 50, 7, 19, 39, 60, 57, 25, 49, 46, 9, 22, 2, 51, 48, 43, 0, 59, 38, 1, 27, 15, 8, 55, 11, 47, 18, 4, 32, 17, 54, 62, 41, 56, 6, 3, 63, 45, 33, 40, 13, 20, 61, 24, 42, 30, 37, 12, 26, 5, 52, 65, 58, 66, 64, 14, 10, 23, 34, 28, 31, 36],
68 : [39, 24, 9, 46, 48, 18, 21, 34, 10, 67, 43, 23, 60, 51, 8, 44, 0, 63, 37, 11, 62, 26, 38, 20, 50, 12, 40, 5, 53, 6, 3, 7, 4, 32, 22, 65, 58, 17, 19, 47, 64, 36, 28, 25, 1, 30, 49, 16, 54, 42, 61, 41, 15, 57, 33, 29, 56, 66, 59, 55, 13, 27, 45, 52, 35, 14, 31, 2],
69 : [6, 28, 43, 64, 62, 55, 22, 42, 57, 26, 14, 1, 11, 68, 39, 67, 59, 51, 4, 40, 60, 63, 33, 19, 9, 13, 36, 3, 29, 23, 48, 45, 58, 15, 17, 37, 10, 24, 31, 5, 7, 61, 50, 0, 66, 25, 41, 52, 2, 30, 21, 49, 65, 56, 54, 8, 18, 34, 47, 38, 44, 12, 53, 35, 32, 20, 27, 16, 46],
70 : [60, 66, 15, 10, 40, 28, 22, 64, 34, 48, 42, 39, 6, 35, 24, 30, 47, 51, 62, 69, 7, 5, 14, 53, 17, 36, 32, 3, 61, 11, 25, 33, 37, 21, 1, 16, 56, 54, 59, 8, 44, 12, 20, 68, 2, 63, 29, 9, 46, 38, 49, 65, 27, 50, 31, 19, 26, 58, 43, 0, 13, 57, 52, 18, 67, 45, 4, 23, 41, 55],
71 : [15, 48, 3, 26, 31, 18, 57, 24, 1, 25, 68, 59, 30, 44, 50, 5, 46, 9, 53, 58, 54, 29, 64, 21, 19, 22, 66, 41, 33, 11, 0, 51, 7, 70, 2, 38, 36, 8, 17, 65, 13, 52, 6, 47, 56, 69, 20, 34, 67, 40, 10, 32, 61, 16, 4, 39, 23, 42, 60, 28, 49, 37, 45, 12, 63, 43, 14, 55, 62, 27, 35],
72 : [33, 28, 54, 31, 18, 60, 44, 66, 5, 32, 49, 58, 27, 30, 48, 59, 20, 68, 43, 38, 70, 50, 65, 19, 40, 12, 4, 1, 7, 9, 62, 37, 23, 14, 17, 56, 71, 57, 10, 69, 39, 26, 3, 6, 8, 21, 0, 41, 61, 67, 36, 63, 53, 22, 52, 64, 45, 24, 46, 51, 16, 2, 35, 15, 34, 55, 11, 29, 25, 13, 47, 42],
73 : [57, 37, 41, 23, 54, 12, 4, 30, 56, 71, 20, 64, 15, 19, 45, 6, 62, 69, 0, 43, 46, 72, 11, 60, 26, 40, 14, 36, 33, 61, 9, 53, 50, 2, 55, 35, 32, 10, 49, 67, 1, 5, 13, 70, 58, 22, 31, 63, 47, 39, 44, 21, 65, 3, 38, 52, 48, 24, 66, 42, 16, 18, 7, 28, 59, 51, 8, 68, 17, 27, 29, 34, 25],
74 : [42, 23, 52, 1, 6, 17, 51, 73, 36, 39, 35, 21, 13, 47, 38, 32, 57, 26, 9, 14, 49, 60, 28, 43, 27, 72, 10, 63, 65, 48, 4, 8, 59, 5, 15, 53, 69, 37, 3, 24, 44, 67, 58, 18, 2, 31, 19, 62, 16, 70, 46, 11, 40, 33, 68, 12, 64, 56, 71, 0, 50, 22, 25, 55, 61, 41, 45, 34, 30, 20, 29, 7, 54, 66],
75 : [36, 50, 69, 13, 74, 1, 64, 62, 73, 59, 15, 33, 9, 22, 60, 34, 16, 44, 47, 40, 32, 46, 25, 53, 48, 41, 71, 29, 14, 24, 58, 8, 2, 65, 3, 20, 56, 4, 19, 72, 6, 49, 43, 21, 57, 0, 63, 70, 66, 28, 37, 31, 10, 68, 42, 61, 54, 51, 5, 30, 67, 52, 11, 17, 27, 55, 39, 35, 18, 26, 23, 12, 7, 45, 38],
76 : [51, 55, 29, 35, 45, 19, 17, 10, 24, 48, 15, 66, 73, 63, 58, 46, 53, 70, 28, 25, 44, 5, 31, 14, 18, 67, 26, 2, 62, 49, 43, 50, 3, 34, 60, 56, 9, 22, 68, 41, 75, 7, 40, 65, 69, 21, 33, 0, 20, 61, 39, 12, 32, 1, 16, 47, 6, 74, 13, 42, 23, 38, 57, 59, 72, 64, 54, 8, 27, 36, 4, 52, 37, 30, 71, 11],
77 : [68, 12, 10, 66, 38, 19, 26, 52, 33, 48, 37, 55, 53, 61, 70, 28, 42, 20, 22, 31, 25, 59, 65, 44, 74, 9, 75, 45, 60, 76, 24, 2, 67, 6, 4, 57, 0, 56, 62, 17, 73, 30, 41, 35, 7, 1, 18, 16, 29, 3, 5, 39, 27, 54, 40, 34, 71, 64, 15, 50, 21, 14, 8, 72, 46, 63, 51, 47, 36, 13, 32, 58, 23, 49, 69, 11, 43],
78 : [23, 60, 26, 43, 21, 11, 2, 4, 24, 35, 46, 3, 53, 55, 49, 40, 61, 67, 9, 56, 69, 16, 29, 44, 36, 54, 70, 66, 59, 0, 34, 31, 1, 20, 14, 68, 37, 45, 72, 77, 19, 6, 28, 15, 5, 12, 8, 57, 32, 76, 64, 73, 63, 41, 74, 58, 71, 75, 48, 7, 38, 13, 30, 39, 17, 42, 10, 50, 18, 51, 25, 52, 65, 27, 47, 22, 33, 62],
79 : [32, 1, 19, 63, 54, 41, 58, 37, 21, 28, 8, 74, 36, 66, 69, 26, 44, 42, 57, 11, 35, 48, 59, 0, 23, 71, 5, 16, 73, 49, 15, 2, 75, 39, 78, 22, 17, 51, 18, 55, 47, 50, 10, 33, 62, 68, 24, 7, 60, 13, 43, 72, 38, 20, 64, 56, 53, 14, 61, 4, 29, 34, 3, 65, 46, 40, 31, 25, 6, 30, 12, 76, 67, 77, 70, 45, 27, 9, 52],
80 : [31, 17, 30, 8, 29, 44, 32, 16, 50, 3, 47, 73, 53, 51, 68, 21, 45, 61, 26, 75, 67, 13, 54, 1, 24, 38, 69, 2, 27, 46, 76, 52, 20, 78, 25, 55, 60, 6, 22, 28, 7, 15, 56, 65, 59, 40, 0, 66, 33, 5, 36, 49, 10, 63, 37, 42, 18, 23, 11, 14, 71, 79, 58, 70, 35, 62, 4, 12, 9, 72, 19, 43, 74, 77, 64, 34, 41, 57, 48, 39],
81 : [44, 8, 30, 11, 26, 46, 62, 50, 42, 29, 74, 5, 7, 45, 41, 60, 19, 59, 48, 15, 0, 33, 23, 76, 12, 34, 3, 79, 75, 40, 22, 17, 72, 6, 27, 32, 35, 53, 56, 4, 65, 55, 21, 58, 49, 68, 63, 73, 67, 80, 10, 13, 36, 66, 20, 37, 14, 78, 64, 28, 2, 24, 38, 54, 1, 69, 25, 77, 57, 71, 51, 9, 39, 16, 52, 43, 47, 18, 61, 31, 70],
82 : [39, 58, 65, 29, 62, 9, 41, 53, 22, 56, 79, 7, 52, 49, 80, 36, 47, 40, 17, 25, 20, 24, 50, 72, 69, 23, 44, 61, 5, 71, 67, 19, 14, 3, 27, 8, 60, 1, 63, 48, 70, 15, 74, 59, 64, 13, 38, 2, 35, 43, 28, 73, 54, 68, 26, 0, 57, 33, 16, 76, 45, 21, 75, 10, 4, 46, 37, 18, 11, 6, 81, 51, 77, 34, 30, 66, 55, 42, 31, 12, 32, 78],
83 : [56, 40, 22, 44, 46, 13, 69, 62, 60, 68, 39, 49, 11, 19, 31, 24, 3, 78, 15, 8, 77, 5, 12, 76, 7, 37, 66, 28, 59, 55, 48, 58, 42, 52, 36, 71, 21, 51, 33, 4, 0, 32, 30, 65, 74, 79, 18, 72, 81, 64, 54, 14, 2, 10, 25, 41, 61, 26, 1, 35, 16, 82, 75, 17, 38, 47, 73, 34, 23, 80, 70, 63, 53, 9, 67, 6, 29, 43, 20, 57, 27, 45, 50],
84 : [56, 9, 45, 63, 11, 72, 39, 10, 25, 53, 68, 50, 22, 79, 65, 34, 58, 43, 77, 3, 69, 20, 13, 47, 74, 59, 62, 64, 30, 38, 27, 51, 54, 4, 29, 67, 57, 66, 14, 80, 15, 5, 82, 71, 6, 83, 26, 78, 17, 31, 18, 8, 2, 16, 81, 44, 41, 49, 32, 12, 60, 76, 21, 1, 75, 61, 70, 73, 19, 46, 40, 37, 55, 0, 7, 42, 24, 35, 33, 28, 52, 23, 36, 48],
85 : [53, 41, 80, 64, 50, 56, 54, 61, 42, 14, 23, 70, 62, 17, 3, 77, 36, 10, 59, 30, 12, 44, 82, 68, 22, 69, 84, 46, 13, 16, 48, 25, 31, 76, 4, 0, 15, 51, 45, 40, 18, 7, 75, 79, 32, 2, 72, 74, 63, 8, 78, 11, 28, 49, 60, 35, 29, 38, 6, 71, 81, 47, 57, 21, 67, 5, 27, 58, 1, 20, 37, 73, 55, 83, 26, 65, 39, 9, 34, 24, 19, 43, 66, 33, 52],
86 : [70, 48, 63, 38, 33, 79, 47, 44, 34, 10, 28, 15, 55, 62, 74, 53, 31, 68, 41, 84, 52, 11, 7, 17, 32, 3, 18, 83, 45, 75, 64, 14, 23, 58, 43, 54, 80, 2, 12, 9, 36, 22, 40, 76, 39, 66, 8, 49, 16, 20, 72, 78, 0, 13, 60, 37, 56, 85, 82, 71, 1, 77, 51, 73, 67, 42, 27, 30, 81, 26, 50, 57, 65, 5, 61, 6, 25, 29, 21, 46, 59, 19, 35, 4, 24, 69],
87 : [34, 65, 63, 71, 40, 32, 77, 19, 46, 55, 51, 68, 84, 8, 5, 75, 47, 25, 14, 66, 64, 61, 29, 48, 35, 31, 26, 81, 22, 57, 73, 60, 80, 16, 86, 12, 0, 23, 62, 6, 13, 54, 45, 30, 2, 59, 83, 79, 41, 9, 52, 21, 3, 72, 70, 20, 1, 10, 43, 56, 49, 36, 85, 15, 42, 69, 67, 76, 39, 7, 58, 50, 82, 4, 24, 18, 74, 33, 27, 78, 37, 11, 17, 44, 38, 53, 28],
88 : [59, 15, 38, 58, 5, 32, 39, 72, 23, 26, 78, 35, 70, 73, 30, 47, 16, 63, 46, 49, 14, 42, 2, 54, 67, 69, 31, 65, 21, 37, 17, 44, 9, 40, 22, 84, 12, 56, 1, 4, 87, 82, 13, 10, 66, 79, 6, 50, 77, 34, 85, 0, 51, 76, 20, 52, 11, 27, 62, 43, 80, 57, 8, 41, 75, 71, 68, 18, 3, 48, 61, 81, 29, 55, 24, 36, 45, 86, 64, 53, 33, 28, 7, 25, 74, 83, 19, 60],
89 : [6, 35, 16, 29, 54, 37, 88, 58, 4, 73, 59, 50, 60, 57, 19, 70, 31, 38, 85, 20, 8, 28, 52, 75, 32, 63, 0, 46, 84, 71, 5, 64, 67, 45, 87, 44, 27, 68, 51, 9, 86, 21, 82, 24, 22, 72, 14, 36, 65, 26, 3, 17, 62, 81, 78, 53, 15, 39, 1, 77, 33, 30, 48, 18, 43, 11, 61, 23, 79, 66, 7, 13, 34, 56, 74, 40, 25, 10, 2, 83, 12, 41, 49, 55, 76, 69, 47, 80, 42],
90 : [52, 37, 29, 11, 75, 42, 81, 26, 56, 83, 17, 12, 3, 54, 60, 70, 41, 73, 8, 25, 38, 49, 19, 5, 27, 58, 89, 72, 85, 68, 16, 51, 34, 7, 57, 46, 35, 6, 67, 23, 53, 88, 74, 64, 36, 28, 22, 1, 62, 10, 50, 18, 76, 79, 71, 0, 61, 66, 20, 39, 15, 77, 84, 2, 13, 43, 55, 44, 80, 33, 14, 65, 87, 21, 30, 47, 86, 24, 63, 45, 9, 69, 32, 78, 4, 48, 59, 40, 31, 82],
91 : [49, 63, 20, 53, 38, 65, 18, 28, 80, 39, 24, 5, 21, 52, 43, 71, 73, 41, 1, 12, 58, 11, 47, 76, 26, 14, 68, 82, 69, 66, 16, 90, 64, 79, 3, 89, 67, 56, 46, 35, 32, 42, 87, 8, 61, 30, 81, 54, 84, 6, 50, 10, 40, 23, 36, 4, 17, 85, 29, 7, 75, 59, 9, 83, 15, 2, 72, 48, 45, 33, 86, 27, 13, 57, 78, 70, 55, 74, 88, 37, 60, 0, 44, 51, 22, 25, 62, 31, 19, 34, 77],
92 : [36, 43, 55, 23, 60, 42, 65, 15, 52, 34, 7, 27, 46, 11, 28, 62, 18, 71, 82, 30, 48, 51, 89, 58, 39, 25, 35, 49, 74, 12, 73, 91, 63, 0, 86, 59, 68, 14, 10, 79, 6, 26, 33, 31, 9, 64, 20, 76, 81, 70, 2, 90, 53, 80, 16, 24, 61, 32, 29, 38, 67, 54, 22, 44, 5, 21, 50, 45, 78, 4, 87, 83, 8, 41, 66, 3, 37, 72, 84, 69, 56, 77, 19, 13, 88, 40, 85, 57, 75, 1, 47, 17],
93 : [28, 53, 42, 60, 21, 52, 33, 78, 58, 67, 7, 76, 50, 11, 35, 77, 25, 13, 34, 86, 31, 63, 9, 68, 55, 44, 89, 75, 61, 54, 8, 37, 4, 22, 90, 0, 80, 10, 74, 71, 20, 15, 57, 51, 30, 59, 72, 3, 82, 88, 32, 92, 81, 24, 46, 79, 2, 18, 39, 66, 43, 19, 85, 56, 84, 16, 5, 62, 27, 1, 70, 38, 6, 41, 49, 69, 45, 87, 91, 83, 65, 12, 26, 73, 47, 64, 36, 14, 29, 17, 23, 48, 40],
94 : [17, 4, 63, 37, 92, 77, 43, 38, 10, 72, 28, 66, 74, 39, 29, 85, 26, 33, 42, 55, 7, 25, 67, 71, 20, 83, 78, 60, 56, 24, 68, 54, 32, 23, 76, 82, 5, 87, 9, 12, 75, 90, 36, 48, 18, 88, 86, 59, 40, 27, 80, 58, 93, 1, 65, 52, 41, 13, 0, 8, 19, 81, 91, 6, 11, 46, 2, 34, 31, 51, 79, 69, 44, 30, 53, 61, 14, 35, 15, 49, 64, 21, 73, 89, 45, 84, 62, 47, 50, 16, 70, 22, 3, 57],
95 : [41, 37, 23, 36, 18, 91, 48, 19, 67, 44, 32, 6, 60, 43, 66, 4, 90, 86, 52, 69, 80, 45, 92, 61, 35, 70, 83, 13, 30, 38, 59, 54, 3, 89, 15, 88, 94, 65, 31, 7, 24, 51, 39, 0, 93, 49, 64, 10, 26, 1, 63, 25, 21, 68, 71, 22, 9, 29, 84, 53, 76, 2, 81, 5, 47, 14, 62, 87, 56, 72, 28, 16, 33, 46, 17, 74, 82, 78, 12, 77, 27, 58, 11, 34, 20, 85, 40, 57, 75, 79, 50, 55, 42, 8, 73],
96 : [79, 71, 26, 14, 27, 72, 28, 4, 59, 21, 46, 5, 43, 95, 34, 24, 65, 70, 6, 73, 45, 63, 67, 94, 37, 44, 33, 31, 55, 93, 20, 12, 17, 83, 66, 41, 8, 75, 16, 74, 23, 78, 52, 61, 30, 15, 7, 76, 40, 36, 90, 56, 0, 22, 88, 69, 1, 39, 91, 11, 81, 32, 9, 3, 38, 82, 64, 13, 57, 85, 25, 47, 10, 53, 58, 77, 29, 92, 51, 18, 80, 84, 49, 62, 19, 86, 42, 50, 48, 2, 54, 68, 35, 89, 87, 60],
97 : [68, 96, 77, 50, 95, 5, 88, 30, 54, 66, 75, 41, 36, 6, 12, 74, 61, 46, 49, 32, 45, 62, 64, 59, 1, 3, 52, 13, 63, 72, 29, 15, 34, 21, 7, 0, 92, 85, 89, 18, 80, 90, 94, 71, 27, 51, 67, 14, 58, 43, 40, 9, 24, 73, 10, 60, 65, 31, 22, 91, 57, 20, 81, 78, 82, 35, 53, 70, 2, 4, 17, 87, 83, 25, 86, 79, 33, 39, 47, 23, 76, 42, 48, 84, 55, 93, 26, 37, 56, 44, 28, 16, 19, 11, 69, 8, 38],
98 : [75, 78, 34, 22, 13, 53, 93, 31, 60, 10, 41, 85, 74, 16, 92, 79, 38, 67, 55, 44, 96, 26, 42, 82, 21, 37, 89, 87, 39, 95, 46, 0, 59, 62, 88, 84, 3, 45, 40, 32, 15, 11, 65, 94, 48, 43, 14, 91, 9, 4, 71, 50, 25, 70, 2, 47, 5, 23, 72, 30, 90, 51, 8, 27, 97, 1, 17, 61, 6, 29, 76, 86, 28, 12, 7, 33, 57, 20, 64, 56, 24, 68, 77, 35, 69, 81, 58, 52, 66, 63, 19, 73, 80, 18, 83, 36, 49, 54],
99 : [56, 49, 41, 55, 86, 47, 31, 98, 68, 73, 10, 62, 66, 48, 52, 76, 85, 21, 23, 32, 14, 92, 37, 0, 33, 7, 91, 38, 27, 24, 5, 18, 87, 78, 65, 36, 58, 25, 46, 29, 8, 82, 79, 83, 1, 69, 72, 53, 50, 28, 94, 9, 11, 89, 74, 15, 84, 75, 6, 22, 90, 13, 42, 30, 60, 88, 19, 2, 95, 20, 40, 17, 3, 64, 71, 59, 97, 80, 63, 4, 45, 93, 54, 44, 77, 12, 96, 51, 43, 81, 61, 57, 16, 67, 26, 34, 39, 70, 35],
100 : [40, 36, 93, 54, 31, 77, 25, 89, 11, 66, 12, 63, 72, 80, 28, 76, 92, 50, 47, 61, 78, 32, 56, 43, 70, 14, 95, 59, 4, 0, 22, 94, 71, 48, 83, 35, 2, 21, 69, 51, 7, 15, 1, 30, 5, 26, 18, 64, 49, 86, 29, 3, 16, 9, 84, 8, 44, 98, 55, 75, 73, 79, 10, 91, 46, 87, 62, 65, 17, 20, 13, 41, 34, 97, 67, 82, 23, 68, 53, 88, 57, 38, 45, 33, 42, 39, 19, 60, 96, 99, 85, 90, 37, 27, 74, 81, 6, 52, 58, 24],
101 : [28, 92, 32, 23, 15, 58, 61, 78, 75, 45, 93, 42, 52, 79, 27, 33, 35, 77, 63, 36, 95, 14, 11, 24, 74, 37, 30, 2, 18, 91, 44, 64, 69, 5, 68, 81, 43, 39, 85, 71, 21, 76, 96, 34, 88, 51, 20, 31, 10, 98, 7, 80, 16, 56, 70, 50, 17, 12, 99, 25, 46, 53, 83, 86, 49, 90, 9, 89, 62, 67, 41, 1, 55, 60, 13, 84, 4, 22, 47, 3, 57, 19, 40, 29, 94, 6, 82, 87, 66, 0, 38, 73, 26, 72, 59, 100, 48, 65, 54, 8, 97],
102 : [75, 61, 34, 27, 96, 50, 44, 62, 65, 43, 91, 40, 74, 82, 8, 73, 51, 10, 21, 59, 93, 35, 32, 97, 36, 3, 39, 63, 76, 60, 38, 87, 48, 72, 53, 12, 101, 86, 7, 22, 37, 29, 16, 6, 88, 1, 13, 77, 24, 70, 14, 84, 99, 57, 54, 41, 98, 100, 45, 4, 56, 89, 47, 28, 66, 80, 26, 85, 95, 5, 90, 11, 71, 25, 79, 64, 55, 2, 15, 49, 46, 0, 17, 94, 23, 9, 20, 30, 68, 33, 31, 42, 83, 19, 78, 67, 18, 52, 69, 81, 92, 58],
103 : [66, 0, 27, 87, 48, 77, 49, 10, 69, 78, 18, 8, 95, 43, 54, 52, 80, 24, 81, 100, 40, 23, 36, 85, 19, 34, 31, 5, 102, 96, 86, 6, 82, 13, 44, 74, 26, 3, 60, 71, 11, 42, 84, 32, 92, 90, 58, 64, 94, 35, 91, 2, 45, 16, 101, 83, 50, 93, 22, 4, 21, 67, 12, 39, 75, 89, 79, 51, 97, 65, 88, 98, 57, 99, 20, 30, 17, 9, 25, 70, 33, 46, 7, 37, 53, 72, 14, 1, 56, 28, 62, 73, 41, 55, 38, 29, 63, 76, 68, 47, 15, 59, 61],
104 : [34, 50, 29, 39, 78, 82, 5, 62, 69, 59, 20, 15, 40, 28, 22, 88, 57, 74, 9, 36, 38, 8, 44, 26, 48, 64, 72, 13, 53, 10, 97, 76, 67, 30, 19, 89, 79, 7, 102, 70, 46, 37, 58, 101, 3, 35, 25, 100, 6, 41, 24, 83, 94, 51, 98, 56, 86, 80, 87, 96, 60, 4, 17, 12, 32, 11, 92, 45, 16, 81, 0, 54, 85, 75, 93, 95, 65, 42, 99, 18, 14, 90, 77, 2, 91, 47, 49, 23, 68, 73, 84, 1, 61, 33, 55, 71, 43, 63, 103, 52, 31, 21, 66, 27],
105 : [29, 77, 72, 12, 40, 63, 80, 90, 24, 55, 65, 48, 100, 23, 67, 35, 66, 68, 89, 11, 50, 36, 34, 79, 30, 27, 92, 62, 101, 19, 9, 94, 17, 7, 4, 73, 54, 14, 98, 81, 87, 74, 18, 97, 39, 53, 46, 69, 93, 60, 51, 99, 59, 102, 26, 16, 13, 82, 75, 8, 31, 44, 1, 3, 58, 38, 10, 33, 91, 96, 2, 64, 22, 78, 32, 20, 104, 76, 21, 5, 83, 95, 6, 45, 103, 52, 70, 84, 56, 85, 88, 43, 57, 71, 25, 37, 0, 61, 28, 86, 47, 42, 15, 49, 41],
106 : [61, 7, 33, 23, 85, 22, 90, 96, 32, 65, 70, 52, 38, 63, 81, 60, 48, 28, 30, 74, 82, 104, 37, 98, 45, 101, 51, 105, 86, 100, 58, 18, 76, 97, 56, 69, 20, 75, 89, 4, 39, 1, 5, 91, 71, 25, 0, 26, 46, 103, 50, 55, 19, 15, 84, 78, 42, 29, 93, 8, 2, 80, 99, 3, 49, 16, 41, 44, 14, 87, 31, 72, 6, 11, 9, 83, 68, 47, 67, 12, 36, 54, 35, 77, 13, 24, 64, 94, 43, 10, 59, 57, 102, 17, 53, 27, 79, 73, 21, 40, 88, 92, 66, 34, 62, 95],
107 : [8, 96, 55, 42, 13, 51, 48, 29, 53, 14, 104, 90, 56, 64, 21, 32, 100, 95, 37, 74, 86, 88, 52, 41, 39, 99, 60, 17, 31, 66, 50, 57, 16, 5, 102, 97, 36, 2, 65, 80, 94, 77, 106, 30, 58, 78, 0, 15, 12, 105, 25, 45, 83, 103, 101, 76, 9, 34, 93, 11, 19, 89, 63, 4, 26, 35, 54, 73, 24, 20, 6, 70, 43, 84, 7, 68, 62, 40, 27, 91, 59, 1, 98, 75, 23, 81, 47, 85, 71, 10, 38, 3, 18, 33, 28, 69, 72, 79, 44, 46, 67, 61, 82, 92, 49, 22, 87],
108 : [61, 4, 15, 32, 11, 89, 41, 38, 3, 82, 90, 101, 28, 37, 99, 71, 16, 39, 56, 62, 14, 5, 49, 80, 64, 85, 40, 102, 73, 94, 22, 42, 106, 83, 100, 72, 17, 60, 1, 26, 66, 27, 86, 76, 54, 10, 93, 77, 31, 98, 9, 25, 8, 52, 18, 23, 29, 7, 75, 67, 48, 59, 33, 12, 79, 44, 36, 95, 53, 21, 88, 46, 68, 45, 19, 107, 6, 97, 87, 13, 69, 78, 103, 63, 96, 51, 91, 35, 81, 0, 47, 34, 43, 55, 20, 50, 65, 30, 74, 57, 104, 92, 2, 70, 105, 58, 24, 84],
109 : [54, 59, 40, 11, 94, 51, 58, 108, 18, 16, 43, 66, 38, 24, 90, 52, 35, 84, 71, 69, 98, 103, 26, 68, 86, 53, 95, 75, 79, 64, 57, 45, 0, 7, 105, 31, 100, 15, 1, 34, 5, 27, 48, 74, 41, 12, 102, 23, 107, 10, 73, 33, 61, 9, 83, 8, 39, 70, 47, 2, 101, 82, 13, 97, 30, 4, 96, 44, 60, 85, 49, 25, 42, 93, 72, 65, 21, 80, 14, 29, 92, 99, 81, 76, 28, 56, 20, 62, 50, 37, 19, 106, 77, 6, 22, 89, 36, 3, 55, 32, 91, 88, 104, 17, 46, 78, 87, 67, 63],
110 : [76, 43, 11, 33, 57, 61, 78, 30, 47, 40, 9, 59, 53, 28, 99, 94, 35, 108, 70, 103, 101, 82, 42, 63, 74, 17, 80, 56, 72, 66, 4, 100, 92, 14, 22, 69, 18, 16, 34, 109, 6, 106, 93, 54, 107, 45, 29, 96, 60, 87, 105, 26, 8, 88, 15, 65, 2, 104, 86, 83, 20, 41, 52, 77, 90, 97, 7, 85, 39, 36, 19, 58, 10, 37, 0, 12, 73, 62, 67, 84, 1, 79, 44, 51, 27, 38, 31, 50, 5, 75, 48, 68, 95, 3, 89, 23, 32, 81, 102, 13, 91, 49, 25, 55, 98, 64, 71, 46, 24, 21],
111 : [23, 83, 67, 80, 31, 39, 42, 20, 48, 34, 84, 91, 21, 61, 82, 50, 88, 46, 104, 69, 27, 87, 2, 19, 97, 35, 25, 5, 9, 60, 86, 92, 6, 17, 79, 68, 78, 74, 29, 47, 57, 105, 3, 98, 32, 75, 44, 65, 45, 100, 7, 40, 72, 15, 106, 93, 71, 62, 37, 81, 18, 107, 30, 110, 108, 66, 52, 4, 14, 36, 109, 54, 0, 8, 13, 99, 76, 22, 73, 90, 53, 95, 101, 24, 1, 16, 58, 77, 51, 64, 55, 103, 43, 96, 63, 33, 10, 41, 102, 11, 70, 94, 28, 12, 59, 38, 49, 89, 85, 56, 26],
112 : [43, 74, 24, 10, 88, 100, 104, 83, 65, 69, 110, 27, 68, 58, 22, 36, 71, 57, 12, 45, 89, 56, 18, 32, 28, 97, 60, 81, 5, 92, 11, 34, 64, 16, 49, 2, 67, 35, 23, 75, 20, 38, 84, 61, 4, 70, 7, 15, 87, 79, 91, 101, 17, 77, 103, 33, 0, 76, 8, 52, 59, 78, 106, 109, 6, 3, 95, 30, 26, 102, 93, 108, 46, 9, 21, 48, 62, 29, 47, 107, 13, 86, 72, 94, 96, 99, 14, 42, 19, 53, 1, 73, 105, 55, 82, 54, 31, 50, 98, 44, 66, 90, 51, 37, 41, 111, 63, 39, 80, 25, 85, 40],
113 : [42, 109, 82, 49, 78, 55, 88, 6, 48, 39, 67, 90, 13, 72, 76, 9, 91, 40, 53, 47, 112, 38, 73, 66, 89, 43, 24, 71, 30, 54, 5, 68, 1, 18, 31, 57, 0, 105, 8, 86, 27, 62, 96, 75, 102, 29, 95, 61, 28, 110, 50, 104, 100, 77, 10, 74, 87, 45, 64, 111, 21, 19, 17, 58, 97, 85, 7, 60, 94, 108, 35, 16, 99, 36, 46, 11, 2, 92, 26, 70, 56, 59, 33, 65, 51, 101, 98, 37, 93, 4, 22, 83, 52, 23, 3, 103, 69, 14, 107, 34, 79, 63, 12, 106, 81, 32, 25, 44, 20, 80, 84, 15, 41],
114 : [61, 32, 54, 66, 45, 38, 78, 74, 22, 98, 60, 20, 81, 7, 71, 37, 97, 8, 35, 59, 56, 21, 113, 51, 63, 50, 91, 87, 4, 100, 92, 49, 83, 112, 1, 9, 0, 103, 3, 47, 69, 48, 52, 12, 67, 80, 36, 85, 90, 94, 18, 14, 106, 73, 42, 104, 109, 16, 41, 39, 2, 6, 108, 55, 88, 26, 53, 25, 15, 70, 27, 17, 99, 75, 46, 30, 24, 111, 82, 65, 77, 86, 19, 102, 57, 96, 68, 43, 28, 110, 79, 107, 58, 31, 10, 13, 95, 5, 29, 76, 23, 11, 62, 33, 89, 44, 84, 105, 101, 93, 72, 40, 64, 34],
115 : [32, 75, 78, 66, 95, 8, 0, 63, 43, 59, 31, 39, 69, 52, 109, 58, 20, 3, 77, 7, 93, 111, 103, 6, 33, 104, 64, 97, 35, 101, 113, 16, 22, 25, 49, 96, 61, 48, 83, 23, 87, 36, 102, 45, 2, 15, 46, 67, 88, 57, 11, 50, 110, 107, 72, 9, 37, 76, 80, 41, 26, 91, 17, 92, 81, 40, 5, 79, 74, 18, 112, 38, 19, 30, 90, 106, 99, 12, 42, 70, 60, 108, 34, 54, 44, 27, 100, 24, 84, 68, 28, 89, 55, 29, 56, 71, 73, 94, 10, 86, 53, 114, 13, 1, 105, 14, 65, 47, 51, 98, 82, 62, 85, 4, 21],
116 : [61, 68, 112, 36, 63, 26, 52, 42, 40, 97, 28, 35, 96, 65, 91, 4, 94, 73, 6, 69, 114, 106, 98, 30, 9, 64, 10, 24, 81, 3, 102, 48, 79, 62, 20, 80, 37, 108, 111, 47, 1, 89, 8, 53, 57, 115, 82, 110, 43, 22, 87, 85, 50, 44, 5, 99, 107, 0, 14, 59, 56, 92, 100, 77, 13, 33, 21, 45, 15, 74, 11, 23, 83, 12, 19, 25, 55, 105, 2, 95, 84, 38, 88, 109, 54, 104, 49, 16, 71, 76, 27, 60, 7, 46, 32, 72, 17, 51, 31, 70, 103, 113, 66, 75, 86, 41, 18, 34, 39, 67, 90, 101, 93, 78, 58, 29],
117 : [106, 66, 50, 75, 46, 11, 24, 34, 40, 49, 2, 61, 20, 104, 109, 89, 15, 18, 35, 76, 74, 103, 55, 115, 9, 84, 86, 7, 51, 105, 25, 83, 22, 6, 98, 48, 56, 116, 67, 92, 79, 28, 87, 59, 102, 19, 95, 93, 85, 26, 38, 0, 21, 47, 110, 90, 80, 82, 96, 1, 91, 36, 8, 97, 57, 33, 71, 14, 111, 17, 4, 112, 29, 77, 81, 101, 72, 31, 13, 10, 63, 37, 44, 64, 43, 45, 39, 108, 32, 68, 23, 94, 30, 107, 16, 114, 3, 69, 65, 62, 70, 27, 100, 113, 12, 60, 5, 52, 99, 73, 88, 41, 78, 54, 42, 58, 53],
118 : [106, 65, 87, 32, 40, 72, 63, 56, 24, 71, 52, 93, 17, 20, 107, 4, 103, 73, 108, 90, 44, 54, 49, 91, 37, 68, 1, 59, 39, 113, 83, 89, 13, 67, 57, 2, 21, 6, 16, 0, 117, 11, 28, 88, 15, 60, 101, 51, 102, 43, 18, 7, 47, 29, 80, 10, 46, 50, 70, 77, 19, 112, 92, 66, 74, 86, 110, 114, 99, 115, 98, 109, 22, 5, 111, 81, 76, 94, 97, 8, 42, 3, 104, 35, 26, 31, 58, 25, 45, 14, 82, 78, 9, 34, 41, 69, 116, 105, 64, 100, 30, 38, 23, 12, 62, 85, 55, 84, 96, 36, 33, 95, 75, 27, 79, 48, 61, 53],
119 : [42, 70, 41, 43, 104, 102, 34, 57, 25, 73, 56, 33, 91, 62, 48, 105, 52, 97, 59, 32, 15, 37, 6, 110, 35, 54, 24, 7, 76, 61, 107, 85, 83, 118, 89, 93, 9, 90, 10, 17, 115, 101, 99, 20, 13, 117, 66, 38, 113, 49, 69, 45, 31, 0, 51, 44, 94, 75, 95, 58, 28, 64, 106, 86, 1, 112, 92, 5, 2, 22, 3, 30, 14, 40, 82, 19, 4, 16, 88, 60, 55, 11, 96, 23, 80, 116, 98, 72, 36, 8, 50, 47, 84, 114, 103, 78, 100, 29, 12, 81, 18, 46, 109, 79, 67, 111, 68, 108, 21, 63, 26, 77, 53, 87, 65, 39, 71, 74, 27],
120 : [36, 109, 104, 94, 77, 37, 59, 6, 83, 17, 47, 91, 15, 70, 66, 71, 34, 106, 116, 53, 62, 40, 16, 101, 84, 93, 8, 49, 111, 39, 19, 22, 90, 68, 18, 0, 52, 14, 79, 20, 64, 21, 118, 69, 56, 54, 96, 23, 115, 110, 61, 38, 4, 108, 97, 117, 13, 105, 86, 57, 60, 29, 2, 35, 9, 80, 99, 26, 98, 27, 63, 72, 78, 112, 10, 100, 114, 51, 95, 48, 50, 28, 5, 12, 1, 73, 81, 42, 119, 85, 113, 41, 43, 76, 58, 87, 30, 102, 88, 103, 7, 67, 55, 33, 75, 65, 25, 74, 46, 82, 107, 89, 44, 92, 11, 31, 24, 32, 3, 45],
121 : [7, 56, 63, 35, 62, 94, 11, 13, 106, 53, 75, 104, 58, 41, 44, 109, 68, 83, 10, 29, 108, 3, 79, 107, 19, 72, 85, 51, 70, 20, 64, 16, 59, 47, 55, 0, 117, 73, 54, 112, 27, 105, 32, 118, 17, 23, 87, 101, 4, 2, 14, 66, 69, 24, 42, 18, 116, 119, 25, 60, 99, 96, 61, 57, 15, 102, 40, 8, 1, 100, 113, 97, 65, 93, 34, 6, 84, 49, 67, 48, 76, 9, 50, 26, 86, 114, 98, 31, 110, 92, 115, 52, 71, 111, 28, 95, 82, 45, 37, 103, 80, 78, 5, 38, 30, 89, 81, 43, 21, 120, 91, 36, 88, 12, 22, 39, 33, 74, 77, 46, 90],
122 : [111, 55, 38, 102, 73, 17, 82, 20, 61, 117, 42, 105, 29, 77, 36, 33, 76, 98, 85, 89, 16, 9, 13, 47, 104, 118, 78, 70, 1, 106, 115, 120, 114, 56, 60, 83, 74, 26, 49, 94, 3, 21, 100, 37, 5, 22, 15, 112, 34, 58, 99, 44, 113, 23, 0, 30, 75, 63, 48, 25, 18, 39, 72, 64, 108, 14, 6, 4, 88, 84, 121, 52, 107, 2, 95, 57, 7, 80, 119, 116, 87, 28, 35, 110, 41, 59, 27, 12, 96, 51, 24, 10, 79, 93, 8, 90, 68, 40, 31, 103, 92, 11, 19, 86, 46, 65, 62, 45, 67, 54, 109, 50, 66, 81, 69, 43, 32, 101, 97, 71, 91, 53],
123 : [85, 116, 21, 25, 79, 8, 101, 13, 42, 36, 57, 81, 37, 82, 74, 4, 60, 72, 59, 105, 33, 104, 53, 63, 18, 15, 43, 64, 19, 68, 73, 89, 58, 75, 67, 103, 100, 121, 114, 23, 113, 98, 40, 61, 26, 20, 38, 119, 7, 17, 117, 110, 22, 118, 106, 71, 84, 56, 112, 9, 109, 122, 86, 1, 69, 29, 49, 115, 30, 3, 10, 31, 108, 83, 76, 70, 99, 16, 50, 80, 54, 96, 24, 27, 62, 78, 55, 91, 34, 11, 97, 120, 39, 107, 5, 14, 48, 32, 95, 52, 65, 87, 102, 46, 77, 90, 93, 35, 88, 45, 66, 92, 0, 44, 41, 111, 2, 47, 94, 28, 12, 6, 51],
124 : [53, 51, 31, 75, 81, 84, 36, 62, 123, 95, 3, 99, 8, 44, 101, 19, 80, 60, 29, 92, 59, 102, 113, 21, 70, 24, 88, 120, 10, 114, 45, 33, 55, 111, 100, 117, 48, 82, 86, 49, 76, 26, 23, 56, 118, 35, 54, 107, 14, 9, 6, 12, 74, 104, 28, 73, 5, 34, 37, 47, 32, 89, 4, 58, 65, 103, 87, 94, 115, 72, 79, 106, 121, 105, 66, 109, 41, 110, 42, 18, 85, 0, 27, 7, 2, 20, 69, 25, 63, 43, 96, 116, 68, 77, 91, 119, 22, 11, 98, 46, 67, 38, 57, 30, 93, 122, 1, 64, 71, 13, 90, 97, 52, 61, 16, 83, 78, 108, 112, 39, 17, 15, 50, 40],
125 : [84, 59, 98, 103, 50, 99, 39, 89, 105, 60, 55, 24, 100, 61, 25, 44, 108, 86, 97, 56, 47, 93, 87, 26, 6, 8, 27, 71, 95, 68, 64, 40, 53, 75, 52, 116, 109, 107, 18, 115, 48, 16, 83, 96, 49, 31, 121, 36, 73, 1, 29, 13, 58, 19, 94, 119, 122, 69, 0, 30, 123, 120, 88, 3, 17, 46, 33, 15, 124, 101, 85, 9, 70, 67, 21, 113, 2, 14, 102, 11, 79, 35, 37, 51, 23, 20, 63, 5, 111, 54, 106, 10, 38, 112, 72, 82, 80, 66, 62, 91, 41, 34, 92, 117, 104, 28, 78, 65, 57, 22, 12, 45, 114, 7, 77, 32, 90, 110, 43, 76, 81, 118, 42, 74, 4],
126 : [61, 116, 23, 37, 73, 55, 64, 36, 0, 32, 82, 89, 74, 76, 33, 20, 99, 41, 53, 34, 47, 114, 28, 110, 9, 56, 70, 102, 66, 105, 50, 15, 5, 121, 85, 81, 26, 8, 38, 18, 72, 54, 17, 60, 25, 124, 79, 101, 84, 29, 118, 108, 68, 113, 12, 100, 45, 106, 95, 71, 115, 125, 69, 16, 78, 42, 62, 39, 96, 112, 48, 123, 11, 98, 31, 49, 35, 27, 21, 65, 13, 122, 92, 7, 3, 87, 97, 4, 10, 88, 59, 22, 58, 119, 46, 104, 40, 44, 91, 103, 67, 1, 120, 6, 52, 93, 109, 90, 43, 107, 80, 51, 94, 14, 111, 24, 117, 30, 86, 2, 75, 63, 83, 77, 19, 57],
127 : [84, 52, 43, 22, 57, 23, 34, 30, 81, 66, 75, 77, 12, 121, 95, 86, 78, 2, 45, 58, 60, 110, 108, 24, 17, 103, 1, 59, 38, 36, 82, 33, 61, 87, 79, 46, 123, 41, 62, 100, 74, 28, 119, 73, 5, 25, 109, 26, 3, 54, 76, 89, 55, 99, 67, 4, 126, 10, 16, 32, 97, 21, 106, 122, 111, 107, 101, 29, 124, 112, 13, 85, 94, 50, 31, 125, 39, 93, 9, 0, 68, 70, 72, 116, 8, 37, 64, 56, 83, 48, 115, 7, 40, 69, 114, 63, 102, 118, 96, 98, 44, 18, 88, 15, 42, 6, 47, 53, 117, 65, 92, 14, 35, 80, 51, 20, 113, 71, 27, 91, 49, 105, 19, 104, 90, 11, 120],
128 : [69, 116, 11, 67, 102, 61, 50, 44, 34, 112, 9, 124, 82, 62, 97, 99, 22, 90, 84, 35, 109, 18, 58, 48, 75, 8, 6, 68, 113, 126, 89, 55, 100, 28, 91, 27, 14, 56, 46, 49, 86, 123, 54, 0, 72, 92, 51, 119, 12, 87, 24, 122, 3, 70, 19, 53, 98, 33, 40, 120, 29, 121, 114, 77, 93, 95, 37, 80, 45, 65, 115, 39, 103, 31, 78, 4, 15, 10, 81, 127, 66, 1, 105, 2, 36, 16, 47, 41, 30, 42, 25, 57, 73, 104, 64, 32, 117, 52, 85, 43, 101, 94, 7, 118, 63, 17, 106, 5, 83, 71, 20, 13, 96, 26, 60, 38, 76, 108, 125, 107, 110, 88, 111, 79, 21, 59, 74, 23],
129 : [77, 28, 72, 9, 23, 51, 98, 88, 103, 33, 93, 26, 78, 73, 121, 64, 124, 55, 40, 11, 109, 94, 35, 17, 74, 37, 25, 111, 82, 65, 83, 38, 125, 112, 7, 86, 66, 79, 113, 127, 15, 44, 58, 99, 118, 42, 85, 49, 2, 114, 10, 123, 107, 84, 89, 34, 70, 90, 22, 6, 3, 0, 4, 29, 59, 63, 54, 104, 126, 116, 27, 105, 12, 102, 19, 61, 80, 95, 47, 120, 101, 43, 122, 106, 21, 67, 13, 119, 60, 45, 24, 41, 30, 16, 14, 69, 48, 117, 8, 20, 18, 52, 5, 87, 115, 81, 96, 75, 71, 100, 91, 1, 53, 57, 36, 92, 62, 110, 31, 50, 68, 76, 39, 128, 56, 108, 97, 46, 32],
130 : [123, 27, 70, 83, 28, 16, 34, 71, 46, 49, 98, 58, 35, 25, 111, 89, 10, 24, 95, 109, 3, 115, 125, 54, 29, 57, 1, 36, 72, 100, 81, 65, 119, 79, 30, 14, 114, 106, 124, 99, 101, 78, 31, 38, 13, 64, 44, 37, 19, 84, 53, 23, 107, 61, 11, 75, 104, 120, 21, 33, 122, 63, 92, 102, 85, 62, 22, 4, 2, 110, 15, 55, 48, 126, 42, 117, 93, 12, 128, 112, 105, 40, 118, 74, 7, 9, 129, 97, 87, 82, 96, 6, 56, 41, 8, 108, 5, 18, 47, 69, 88, 17, 103, 32, 91, 67, 121, 59, 50, 113, 77, 127, 20, 26, 94, 66, 116, 0, 45, 51, 60, 43, 76, 73, 90, 86, 52, 80, 39, 68],
131 : [21, 65, 14, 81, 29, 49, 87, 116, 43, 9, 34, 78, 101, 63, 72, 33, 62, 57, 23, 6, 36, 2, 69, 76, 53, 107, 114, 122, 105, 31, 37, 94, 89, 84, 125, 11, 75, 20, 113, 71, 124, 83, 85, 7, 99, 130, 24, 48, 102, 19, 115, 96, 118, 12, 90, 54, 51, 106, 42, 129, 120, 35, 18, 38, 15, 47, 70, 27, 58, 121, 3, 0, 82, 111, 100, 108, 110, 68, 28, 4, 10, 92, 5, 45, 77, 30, 52, 79, 103, 16, 32, 17, 119, 41, 88, 60, 8, 1, 128, 97, 117, 86, 74, 50, 67, 127, 61, 22, 40, 98, 123, 46, 56, 26, 55, 64, 112, 126, 95, 59, 73, 39, 80, 66, 13, 104, 93, 25, 44, 109, 91],
132 : [92, 102, 95, 23, 27, 16, 63, 1, 71, 122, 52, 85, 96, 53, 68, 119, 45, 32, 100, 28, 39, 22, 19, 4, 15, 46, 76, 83, 124, 60, 125, 110, 38, 66, 72, 79, 73, 9, 115, 13, 104, 88, 31, 94, 47, 6, 99, 18, 75, 117, 109, 50, 98, 67, 84, 0, 80, 30, 5, 126, 14, 106, 78, 49, 69, 25, 128, 11, 86, 127, 62, 59, 120, 3, 10, 111, 108, 116, 44, 21, 48, 107, 37, 33, 64, 36, 121, 77, 51, 26, 131, 2, 90, 20, 101, 12, 29, 82, 91, 58, 56, 118, 24, 70, 61, 105, 81, 17, 112, 34, 89, 40, 35, 65, 97, 54, 129, 41, 114, 8, 55, 123, 130, 57, 93, 43, 113, 103, 7, 87, 42, 74],
133 : [78, 120, 98, 7, 95, 59, 61, 94, 73, 52, 25, 36, 81, 12, 121, 100, 30, 68, 31, 1, 66, 27, 60, 33, 71, 125, 50, 76, 14, 48, 106, 126, 62, 18, 115, 103, 122, 107, 88, 67, 77, 104, 20, 26, 83, 87, 91, 13, 43, 40, 47, 23, 109, 58, 0, 75, 128, 15, 110, 82, 119, 92, 3, 130, 65, 129, 132, 38, 11, 53, 37, 21, 16, 46, 22, 29, 105, 32, 96, 90, 44, 84, 123, 117, 24, 2, 45, 89, 114, 54, 97, 51, 6, 93, 127, 56, 86, 5, 79, 108, 34, 69, 64, 80, 74, 9, 57, 124, 101, 131, 10, 49, 42, 35, 19, 111, 72, 8, 116, 28, 39, 41, 17, 102, 4, 99, 113, 63, 85, 118, 55, 70, 112],
134 : [124, 56, 50, 38, 67, 76, 60, 108, 114, 45, 69, 49, 74, 95, 98, 32, 16, 46, 111, 37, 13, 71, 97, 113, 122, 93, 109, 41, 10, 66, 81, 62, 48, 25, 57, 112, 42, 47, 27, 133, 59, 86, 2, 132, 28, 43, 99, 90, 73, 82, 3, 115, 7, 118, 128, 121, 14, 129, 9, 58, 104, 87, 21, 102, 0, 89, 107, 31, 36, 40, 119, 19, 80, 77, 51, 127, 54, 63, 91, 6, 83, 53, 79, 94, 23, 70, 17, 15, 8, 117, 52, 106, 126, 30, 20, 5, 123, 84, 130, 29, 120, 4, 11, 110, 105, 96, 72, 101, 12, 131, 33, 92, 88, 26, 35, 44, 125, 24, 61, 75, 85, 116, 34, 65, 103, 1, 18, 68, 39, 64, 55, 22, 78, 100],
135 : [37, 77, 90, 105, 48, 59, 111, 75, 92, 21, 89, 76, 83, 35, 114, 106, 52, 1, 10, 40, 95, 84, 79, 119, 0, 20, 129, 45, 98, 18, 64, 36, 22, 126, 124, 55, 86, 7, 102, 67, 101, 28, 9, 110, 30, 117, 128, 73, 49, 100, 3, 14, 11, 26, 60, 6, 17, 87, 54, 44, 108, 130, 120, 118, 81, 33, 63, 80, 2, 125, 39, 112, 115, 132, 78, 32, 4, 122, 13, 23, 16, 88, 31, 5, 133, 93, 38, 85, 121, 15, 99, 47, 56, 53, 104, 69, 134, 91, 123, 61, 65, 34, 74, 58, 12, 29, 97, 24, 62, 109, 8, 43, 127, 116, 113, 131, 27, 19, 66, 94, 51, 42, 103, 50, 82, 107, 71, 68, 57, 72, 96, 25, 70, 46, 41],
136 : [125, 130, 39, 103, 91, 51, 18, 50, 121, 99, 35, 76, 43, 15, 36, 127, 89, 61, 16, 77, 95, 59, 22, 63, 85, 67, 44, 134, 108, 42, 111, 82, 88, 115, 1, 49, 133, 56, 105, 14, 3, 6, 69, 23, 38, 100, 81, 71, 114, 58, 31, 98, 0, 112, 70, 13, 5, 2, 65, 135, 4, 30, 52, 116, 48, 12, 72, 96, 11, 119, 24, 57, 60, 25, 106, 10, 46, 62, 117, 131, 41, 92, 37, 7, 118, 19, 17, 83, 47, 21, 66, 64, 74, 97, 73, 45, 132, 90, 87, 27, 126, 129, 123, 120, 78, 110, 93, 26, 109, 8, 101, 94, 84, 33, 124, 107, 113, 40, 32, 122, 80, 9, 79, 29, 53, 28, 34, 104, 55, 128, 86, 20, 54, 75, 102, 68],
137 : [125, 97, 110, 9, 19, 68, 26, 38, 64, 37, 42, 83, 51, 61, 91, 20, 121, 40, 69, 11, 1, 74, 107, 2, 103, 108, 102, 53, 30, 32, 123, 24, 76, 87, 81, 35, 31, 80, 126, 134, 16, 62, 33, 127, 106, 57, 84, 129, 65, 13, 105, 111, 12, 99, 94, 119, 86, 135, 7, 116, 101, 27, 6, 28, 72, 115, 48, 128, 56, 85, 23, 100, 44, 132, 36, 25, 0, 66, 21, 90, 117, 8, 14, 73, 88, 130, 122, 114, 59, 131, 49, 43, 67, 4, 104, 89, 120, 96, 133, 95, 118, 17, 124, 3, 45, 78, 5, 70, 18, 54, 47, 34, 109, 22, 98, 92, 63, 50, 60, 39, 46, 79, 136, 58, 93, 71, 77, 41, 82, 15, 10, 29, 112, 52, 55, 113, 75],
138 : [87, 103, 36, 67, 80, 53, 107, 20, 117, 34, 123, 130, 70, 94, 102, 125, 73, 66, 2, 5, 12, 101, 24, 77, 57, 84, 29, 48, 37, 113, 81, 98, 122, 79, 96, 88, 32, 42, 23, 18, 1, 13, 110, 106, 55, 28, 131, 136, 109, 104, 21, 75, 7, 35, 128, 82, 99, 10, 74, 58, 100, 25, 43, 40, 44, 97, 92, 64, 83, 76, 27, 93, 19, 62, 126, 135, 14, 95, 116, 31, 115, 118, 16, 41, 9, 0, 60, 52, 133, 38, 6, 89, 22, 121, 26, 61, 137, 111, 17, 3, 112, 69, 4, 134, 15, 124, 114, 108, 78, 132, 120, 33, 85, 54, 45, 51, 91, 105, 63, 56, 68, 47, 65, 50, 119, 49, 59, 86, 8, 129, 39, 71, 46, 72, 90, 30, 11, 127],
139 : [47, 76, 109, 64, 84, 59, 12, 74, 126, 94, 61, 0, 40, 35, 78, 15, 89, 57, 113, 37, 110, 45, 5, 132, 136, 48, 82, 98, 120, 77, 114, 3, 121, 13, 108, 134, 2, 28, 90, 115, 103, 91, 17, 39, 127, 56, 24, 55, 1, 68, 112, 32, 26, 85, 18, 54, 4, 43, 83, 80, 33, 138, 67, 22, 58, 25, 107, 30, 65, 129, 105, 41, 27, 63, 87, 117, 102, 111, 133, 8, 123, 119, 86, 100, 42, 122, 81, 97, 19, 104, 99, 137, 93, 72, 10, 62, 135, 128, 131, 46, 130, 23, 14, 88, 73, 16, 7, 69, 124, 49, 92, 9, 11, 38, 21, 34, 118, 101, 52, 95, 44, 29, 79, 51, 66, 71, 53, 36, 31, 116, 75, 96, 20, 125, 6, 106, 50, 60, 70],
140 : [59, 85, 64, 109, 69, 100, 45, 53, 128, 87, 98, 138, 27, 34, 50, 5, 71, 37, 74, 51, 78, 124, 0, 17, 135, 70, 97, 8, 88, 24, 44, 107, 49, 10, 2, 86, 126, 41, 120, 113, 32, 16, 65, 84, 66, 136, 129, 21, 72, 62, 139, 63, 95, 134, 101, 127, 108, 28, 77, 75, 15, 89, 14, 61, 40, 26, 73, 13, 11, 68, 33, 80, 60, 137, 9, 19, 118, 106, 131, 112, 83, 119, 117, 6, 25, 116, 58, 93, 115, 99, 3, 31, 103, 130, 79, 7, 122, 105, 20, 133, 125, 29, 23, 90, 57, 52, 48, 22, 104, 102, 46, 35, 30, 92, 39, 54, 76, 67, 47, 110, 121, 55, 18, 96, 82, 42, 91, 1, 111, 4, 56, 12, 94, 81, 114, 132, 43, 123, 36, 38],
141 : [129, 72, 59, 47, 52, 44, 38, 79, 67, 133, 57, 16, 128, 25, 93, 68, 108, 75, 98, 33, 70, 136, 106, 24, 6, 49, 10, 18, 5, 56, 13, 132, 118, 66, 12, 77, 97, 39, 60, 42, 40, 130, 138, 126, 7, 139, 2, 73, 112, 85, 65, 26, 45, 64, 4, 115, 74, 31, 50, 99, 27, 30, 1, 83, 113, 54, 122, 92, 81, 123, 34, 11, 100, 135, 62, 28, 17, 71, 101, 0, 46, 19, 61, 117, 125, 114, 76, 36, 119, 124, 127, 20, 137, 88, 140, 102, 9, 107, 41, 116, 32, 131, 110, 51, 90, 63, 105, 111, 23, 89, 91, 109, 84, 48, 69, 134, 87, 78, 35, 104, 82, 55, 29, 14, 121, 53, 96, 58, 37, 15, 8, 21, 3, 120, 22, 95, 80, 94, 103, 43, 86],
142 : [109, 28, 26, 58, 69, 64, 128, 60, 70, 89, 78, 129, 30, 87, 108, 104, 37, 67, 79, 82, 17, 122, 110, 36, 102, 77, 137, 72, 2, 52, 8, 34, 23, 97, 46, 133, 92, 19, 113, 10, 51, 0, 21, 15, 114, 47, 16, 134, 130, 90, 35, 9, 112, 101, 94, 53, 93, 22, 54, 74, 85, 91, 95, 83, 71, 123, 132, 62, 106, 25, 127, 32, 39, 65, 31, 119, 115, 126, 124, 107, 80, 6, 136, 59, 131, 111, 20, 138, 5, 103, 41, 45, 3, 57, 99, 61, 105, 24, 86, 68, 116, 118, 18, 4, 66, 140, 100, 11, 29, 7, 55, 84, 75, 1, 33, 12, 117, 27, 44, 141, 139, 96, 50, 43, 76, 48, 56, 63, 13, 42, 98, 49, 81, 88, 73, 40, 135, 120, 38, 125, 121, 14],
143 : [81, 138, 102, 90, 121, 50, 129, 85, 94, 135, 49, 32, 74, 141, 57, 45, 8, 66, 103, 108, 56, 58, 124, 47, 53, 98, 48, 125, 37, 0, 106, 6, 46, 16, 69, 63, 33, 142, 4, 99, 17, 5, 20, 113, 127, 27, 101, 67, 34, 126, 119, 116, 55, 3, 65, 29, 75, 107, 84, 31, 93, 76, 118, 131, 51, 30, 104, 133, 28, 71, 128, 9, 40, 140, 115, 24, 92, 95, 88, 21, 7, 43, 73, 82, 25, 44, 59, 110, 130, 136, 97, 70, 109, 41, 79, 100, 54, 19, 86, 18, 132, 10, 83, 38, 22, 139, 2, 23, 14, 122, 137, 117, 1, 114, 60, 111, 77, 112, 15, 13, 96, 91, 120, 123, 36, 61, 134, 35, 62, 52, 87, 78, 72, 26, 89, 80, 12, 39, 105, 64, 11, 42, 68],
144 : [79, 107, 95, 1, 57, 115, 68, 28, 123, 131, 45, 14, 101, 73, 0, 8, 129, 124, 66, 3, 106, 126, 77, 33, 97, 108, 37, 127, 100, 141, 128, 13, 86, 12, 5, 42, 110, 105, 84, 116, 52, 69, 74, 17, 7, 46, 27, 23, 104, 55, 59, 118, 75, 137, 48, 2, 121, 32, 25, 58, 119, 15, 70, 24, 26, 98, 16, 56, 117, 130, 140, 109, 62, 102, 38, 92, 49, 4, 36, 9, 93, 138, 134, 88, 54, 10, 21, 111, 113, 35, 6, 44, 64, 50, 82, 91, 139, 99, 142, 30, 87, 18, 34, 80, 53, 120, 136, 85, 31, 94, 78, 39, 112, 61, 51, 135, 96, 83, 60, 40, 103, 143, 114, 43, 67, 90, 81, 41, 132, 20, 125, 122, 65, 72, 47, 76, 133, 71, 89, 63, 11, 19, 22, 29],
145 : [82, 58, 144, 86, 65, 123, 107, 46, 143, 33, 37, 75, 110, 27, 101, 121, 57, 1, 102, 122, 16, 69, 94, 60, 36, 68, 111, 80, 95, 55, 119, 26, 136, 19, 11, 71, 41, 17, 20, 72, 137, 59, 39, 142, 98, 53, 84, 3, 134, 23, 49, 127, 73, 66, 106, 21, 130, 47, 5, 104, 35, 91, 128, 109, 74, 124, 2, 24, 93, 132, 125, 99, 141, 12, 4, 54, 38, 28, 9, 129, 138, 64, 14, 76, 85, 117, 8, 78, 29, 61, 18, 6, 112, 10, 105, 97, 83, 43, 96, 116, 131, 120, 22, 126, 63, 140, 25, 67, 115, 34, 0, 45, 81, 40, 30, 118, 42, 139, 133, 87, 44, 113, 89, 52, 31, 62, 13, 70, 7, 90, 51, 79, 103, 15, 88, 108, 114, 100, 50, 77, 92, 135, 56, 48, 32],
146 : [0, 113, 98, 107, 28, 22, 76, 51, 140, 25, 85, 122, 65, 114, 104, 57, 36, 100, 105, 127, 42, 88, 34, 60, 47, 56, 21, 124, 135, 103, 99, 14, 71, 92, 118, 101, 49, 67, 81, 5, 128, 102, 136, 11, 23, 108, 38, 45, 143, 19, 106, 109, 131, 35, 126, 117, 20, 17, 33, 144, 62, 89, 16, 44, 2, 112, 24, 41, 29, 133, 61, 139, 43, 119, 13, 53, 121, 111, 97, 66, 74, 84, 142, 15, 141, 123, 72, 54, 96, 37, 115, 79, 125, 1, 30, 26, 3, 77, 95, 50, 132, 10, 4, 93, 63, 94, 83, 134, 27, 7, 32, 46, 64, 69, 86, 58, 130, 138, 48, 68, 75, 9, 87, 39, 120, 82, 12, 137, 6, 91, 55, 73, 8, 80, 52, 59, 129, 18, 145, 40, 31, 110, 70, 116, 90, 78],
147 : [65, 142, 13, 104, 115, 99, 5, 90, 87, 81, 53, 40, 119, 1, 69, 85, 29, 59, 133, 108, 28, 123, 47, 44, 34, 12, 116, 109, 51, 30, 125, 122, 60, 73, 83, 38, 16, 23, 3, 101, 17, 36, 61, 7, 132, 26, 55, 100, 111, 32, 20, 107, 102, 128, 54, 57, 46, 88, 143, 91, 74, 96, 106, 48, 121, 129, 9, 145, 139, 63, 21, 18, 43, 118, 11, 112, 114, 146, 144, 138, 2, 127, 134, 4, 80, 33, 113, 84, 8, 140, 105, 95, 126, 117, 68, 19, 27, 41, 137, 78, 92, 64, 31, 76, 42, 62, 14, 67, 124, 0, 103, 93, 10, 89, 66, 45, 72, 79, 71, 136, 15, 141, 120, 6, 130, 75, 58, 94, 35, 98, 135, 25, 50, 37, 49, 70, 97, 24, 110, 39, 131, 52, 56, 77, 22, 86, 82],
148 : [111, 129, 10, 72, 95, 82, 60, 107, 128, 0, 76, 44, 57, 80, 110, 61, 132, 28, 23, 43, 114, 14, 48, 84, 67, 11, 64, 41, 112, 63, 78, 70, 140, 13, 3, 30, 83, 1, 68, 22, 39, 136, 122, 6, 71, 58, 104, 7, 120, 45, 143, 100, 130, 42, 73, 91, 124, 85, 141, 51, 21, 92, 18, 126, 40, 144, 31, 119, 86, 89, 4, 17, 53, 25, 15, 46, 131, 32, 118, 139, 16, 103, 133, 115, 54, 102, 59, 146, 125, 87, 33, 88, 145, 9, 138, 5, 75, 47, 20, 36, 101, 69, 109, 97, 24, 62, 121, 116, 98, 38, 55, 77, 96, 134, 35, 26, 65, 105, 2, 135, 37, 74, 99, 123, 50, 79, 49, 12, 34, 8, 29, 137, 142, 81, 27, 93, 66, 19, 56, 113, 52, 108, 117, 147, 106, 127, 90, 94],
149 : [60, 24, 110, 68, 104, 99, 63, 26, 49, 54, 74, 129, 90, 139, 109, 40, 98, 48, 108, 59, 46, 122, 124, 93, 19, 92, 15, 101, 45, 136, 83, 80, 67, 17, 85, 116, 8, 57, 72, 137, 55, 1, 130, 44, 140, 4, 114, 56, 33, 5, 25, 134, 73, 142, 70, 127, 64, 132, 10, 0, 145, 148, 28, 69, 32, 11, 102, 78, 12, 146, 51, 38, 66, 42, 3, 103, 16, 77, 75, 50, 112, 144, 52, 120, 22, 6, 113, 141, 118, 111, 89, 7, 94, 29, 133, 128, 61, 143, 41, 97, 87, 62, 65, 147, 31, 37, 30, 125, 100, 138, 20, 107, 86, 117, 119, 79, 21, 105, 95, 36, 106, 135, 9, 96, 115, 23, 84, 39, 13, 91, 43, 27, 18, 14, 82, 53, 81, 34, 131, 121, 123, 71, 2, 47, 58, 35, 88, 126, 76],
150 : [86, 96, 41, 91, 71, 16, 75, 73, 87, 84, 82, 54, 148, 94, 52, 12, 119, 104, 78, 133, 44, 50, 34, 116, 145, 123, 117, 60, 98, 93, 81, 53, 74, 101, 111, 37, 5, 144, 11, 80, 149, 77, 56, 36, 128, 142, 66, 23, 76, 122, 1, 72, 6, 109, 45, 59, 90, 32, 121, 18, 9, 24, 0, 110, 114, 100, 65, 124, 33, 143, 62, 126, 43, 138, 29, 134, 147, 67, 4, 46, 8, 127, 112, 132, 92, 28, 131, 40, 20, 39, 64, 14, 69, 17, 15, 63, 42, 3, 146, 30, 47, 19, 38, 135, 89, 130, 95, 49, 25, 57, 7, 120, 115, 129, 2, 27, 61, 97, 102, 85, 10, 108, 137, 118, 125, 107, 48, 106, 88, 21, 55, 103, 113, 70, 139, 35, 31, 99, 136, 68, 140, 51, 22, 83, 13, 141, 79, 58, 105, 26],
151 : [43, 101, 75, 82, 114, 31, 120, 90, 47, 77, 32, 8, 68, 139, 33, 51, 5, 98, 66, 60, 29, 48, 137, 112, 64, 103, 37, 62, 148, 122, 134, 78, 143, 20, 49, 3, 124, 74, 55, 25, 131, 24, 100, 129, 97, 147, 88, 110, 50, 21, 96, 39, 149, 125, 109, 99, 38, 127, 34, 72, 0, 45, 6, 44, 58, 30, 46, 142, 19, 79, 11, 116, 84, 18, 81, 1, 69, 128, 130, 54, 23, 80, 115, 133, 17, 119, 28, 146, 89, 7, 121, 76, 61, 117, 86, 10, 145, 126, 52, 94, 73, 22, 132, 135, 26, 12, 106, 36, 87, 57, 118, 13, 9, 111, 85, 138, 63, 53, 56, 83, 136, 16, 27, 4, 70, 150, 140, 35, 40, 59, 14, 108, 93, 65, 92, 113, 2, 141, 104, 144, 67, 91, 95, 15, 42, 102, 105, 107, 71, 123, 41],
152 : [113, 105, 96, 121, 66, 27, 148, 33, 87, 13, 54, 82, 92, 40, 32, 60, 99, 93, 107, 109, 21, 38, 127, 29, 81, 133, 55, 130, 91, 36, 43, 71, 7, 52, 101, 103, 67, 74, 108, 5, 68, 136, 47, 128, 1, 106, 80, 131, 94, 72, 12, 31, 144, 34, 132, 114, 0, 22, 151, 10, 57, 11, 14, 111, 75, 23, 102, 88, 145, 53, 26, 143, 58, 120, 35, 150, 126, 76, 51, 104, 56, 2, 142, 98, 16, 48, 137, 139, 24, 42, 9, 3, 125, 147, 86, 65, 20, 46, 100, 90, 138, 6, 141, 45, 30, 146, 70, 85, 15, 119, 110, 59, 95, 19, 83, 69, 4, 28, 77, 8, 17, 61, 25, 116, 39, 63, 115, 135, 37, 123, 97, 41, 122, 78, 18, 112, 64, 149, 84, 118, 79, 49, 89, 44, 129, 140, 62, 134, 73, 117, 124, 50],
153 : [103, 132, 53, 95, 25, 76, 150, 135, 130, 110, 85, 37, 100, 55, 151, 89, 84, 98, 67, 30, 102, 75, 12, 50, 139, 115, 20, 34, 15, 22, 36, 46, 143, 129, 52, 39, 122, 134, 4, 112, 146, 77, 87, 93, 149, 69, 51, 6, 43, 71, 152, 106, 131, 116, 45, 7, 104, 74, 5, 16, 48, 23, 40, 9, 18, 79, 64, 27, 121, 101, 83, 141, 11, 117, 111, 26, 142, 144, 1, 62, 119, 127, 66, 148, 107, 94, 2, 68, 145, 147, 57, 41, 108, 17, 73, 31, 21, 125, 63, 10, 138, 81, 35, 136, 124, 8, 70, 96, 56, 78, 140, 38, 137, 113, 133, 92, 126, 49, 28, 54, 3, 14, 97, 72, 0, 86, 118, 128, 24, 114, 58, 65, 105, 91, 47, 90, 99, 80, 82, 109, 32, 13, 42, 61, 120, 60, 88, 33, 29, 19, 44, 59, 123],
154 : [57, 42, 138, 142, 13, 31, 95, 148, 128, 36, 110, 74, 97, 52, 44, 59, 81, 132, 66, 79, 86, 58, 39, 68, 145, 12, 5, 65, 104, 33, 88, 37, 82, 94, 87, 11, 123, 149, 108, 112, 118, 63, 135, 35, 38, 153, 23, 9, 2, 140, 16, 119, 121, 0, 103, 117, 21, 152, 70, 54, 56, 19, 137, 84, 75, 46, 4, 139, 147, 20, 18, 111, 80, 32, 107, 8, 26, 151, 64, 77, 6, 106, 85, 71, 130, 99, 14, 47, 73, 131, 25, 3, 126, 15, 43, 105, 109, 22, 62, 127, 24, 133, 29, 92, 67, 7, 141, 136, 144, 114, 53, 55, 143, 129, 50, 76, 115, 27, 101, 34, 120, 90, 28, 98, 69, 10, 49, 134, 102, 122, 60, 113, 30, 124, 45, 125, 93, 41, 72, 78, 48, 96, 1, 40, 146, 91, 116, 61, 100, 89, 51, 17, 83, 150],
155 : [17, 125, 52, 78, 30, 34, 36, 77, 86, 88, 99, 59, 95, 98, 61, 119, 2, 63, 106, 25, 28, 115, 37, 138, 131, 128, 39, 139, 1, 6, 151, 51, 118, 114, 29, 107, 72, 101, 94, 112, 117, 121, 16, 136, 56, 69, 10, 84, 5, 67, 104, 149, 19, 145, 116, 7, 153, 58, 21, 46, 35, 27, 23, 3, 48, 62, 110, 141, 129, 76, 55, 31, 14, 113, 127, 18, 13, 100, 133, 8, 60, 126, 91, 45, 87, 154, 105, 65, 81, 103, 90, 143, 82, 44, 12, 93, 137, 148, 132, 49, 89, 32, 144, 152, 42, 15, 54, 22, 124, 140, 0, 64, 123, 134, 102, 109, 43, 150, 4, 146, 85, 66, 147, 79, 20, 97, 9, 96, 130, 111, 122, 135, 24, 92, 80, 71, 83, 120, 26, 33, 108, 41, 70, 40, 74, 50, 142, 38, 73, 47, 53, 75, 68, 57, 11],
156 : [55, 36, 67, 60, 115, 86, 108, 24, 82, 21, 95, 50, 84, 133, 72, 18, 35, 87, 113, 92, 132, 25, 51, 74, 8, 41, 58, 140, 147, 20, 76, 44, 85, 117, 40, 91, 105, 125, 106, 70, 94, 4, 29, 142, 59, 2, 124, 129, 68, 139, 39, 130, 135, 100, 47, 57, 98, 144, 154, 80, 32, 27, 121, 127, 97, 42, 16, 65, 111, 7, 93, 123, 6, 101, 13, 54, 22, 152, 138, 90, 1, 61, 149, 64, 52, 0, 62, 46, 114, 151, 37, 131, 66, 15, 5, 83, 49, 38, 146, 137, 23, 9, 11, 81, 73, 150, 143, 112, 78, 12, 45, 53, 56, 120, 148, 10, 43, 34, 128, 102, 75, 116, 119, 141, 110, 126, 122, 88, 71, 31, 26, 104, 96, 155, 3, 89, 107, 145, 69, 153, 33, 30, 136, 14, 109, 63, 79, 19, 99, 134, 48, 118, 28, 77, 103, 17],
157 : [60, 16, 49, 15, 77, 105, 93, 85, 92, 120, 84, 46, 149, 39, 47, 20, 140, 70, 133, 67, 118, 152, 138, 31, 128, 66, 72, 29, 122, 3, 88, 54, 10, 90, 109, 23, 139, 51, 97, 7, 108, 113, 73, 5, 45, 101, 28, 102, 80, 62, 131, 55, 115, 43, 9, 76, 121, 150, 74, 135, 104, 42, 151, 106, 144, 4, 64, 117, 134, 35, 8, 100, 110, 24, 156, 99, 127, 0, 27, 58, 22, 130, 71, 36, 6, 124, 155, 98, 34, 52, 82, 153, 53, 145, 13, 32, 87, 11, 65, 40, 21, 25, 132, 125, 146, 12, 38, 91, 1, 56, 37, 2, 112, 44, 86, 75, 96, 137, 83, 59, 154, 114, 18, 129, 69, 17, 111, 61, 63, 41, 116, 141, 89, 103, 143, 33, 95, 81, 107, 136, 26, 14, 119, 19, 147, 78, 94, 57, 142, 30, 123, 48, 68, 148, 79, 126, 50],
158 : [72, 10, 118, 134, 93, 69, 128, 97, 32, 38, 55, 2, 138, 147, 108, 0, 83, 43, 68, 111, 80, 13, 41, 59, 42, 136, 82, 126, 140, 112, 37, 102, 71, 106, 49, 123, 139, 79, 85, 141, 62, 46, 63, 86, 57, 143, 23, 127, 30, 114, 77, 5, 153, 78, 154, 66, 96, 27, 3, 113, 137, 110, 6, 148, 7, 75, 119, 22, 74, 26, 36, 67, 21, 34, 16, 1, 120, 11, 156, 142, 18, 122, 44, 29, 135, 24, 60, 157, 104, 87, 152, 90, 124, 17, 54, 92, 48, 132, 150, 107, 47, 88, 133, 81, 52, 117, 94, 58, 146, 84, 35, 4, 145, 12, 64, 109, 20, 103, 155, 95, 8, 28, 51, 31, 89, 65, 130, 39, 100, 14, 131, 115, 101, 116, 45, 91, 33, 151, 53, 98, 129, 99, 105, 19, 50, 125, 40, 70, 9, 76, 121, 61, 25, 56, 144, 15, 149, 73],
159 : [141, 29, 32, 148, 111, 42, 97, 138, 96, 143, 129, 44, 81, 26, 91, 142, 128, 27, 33, 90, 43, 125, 80, 151, 74, 88, 134, 84, 22, 45, 139, 37, 63, 23, 108, 40, 56, 9, 99, 114, 19, 140, 85, 89, 20, 67, 147, 54, 30, 11, 38, 31, 78, 137, 13, 36, 123, 0, 106, 7, 10, 100, 66, 131, 17, 103, 69, 4, 1, 86, 121, 83, 136, 46, 59, 15, 21, 133, 150, 39, 120, 35, 117, 34, 52, 2, 130, 12, 153, 144, 149, 93, 75, 94, 154, 53, 107, 3, 68, 41, 65, 122, 71, 77, 158, 5, 101, 14, 155, 105, 49, 135, 112, 127, 156, 62, 109, 115, 126, 118, 6, 110, 48, 98, 58, 18, 104, 152, 157, 113, 8, 47, 87, 16, 61, 76, 145, 25, 50, 57, 72, 51, 64, 92, 28, 132, 55, 124, 79, 73, 70, 24, 82, 116, 146, 119, 102, 95, 60],
160 : [7, 143, 93, 16, 56, 31, 102, 94, 55, 49, 123, 66, 33, 15, 113, 140, 145, 42, 37, 107, 21, 125, 152, 92, 70, 36, 147, 58, 62, 41, 146, 148, 105, 114, 87, 72, 29, 47, 110, 118, 96, 139, 78, 153, 101, 53, 85, 124, 122, 91, 18, 115, 35, 69, 28, 26, 151, 149, 120, 64, 98, 136, 50, 13, 46, 60, 22, 57, 74, 27, 156, 48, 117, 20, 23, 3, 127, 34, 65, 155, 84, 10, 126, 144, 133, 54, 116, 157, 14, 106, 150, 141, 121, 39, 137, 9, 76, 86, 130, 0, 5, 159, 99, 81, 52, 132, 82, 142, 8, 68, 89, 30, 6, 79, 45, 2, 100, 135, 51, 104, 119, 61, 43, 12, 67, 111, 25, 40, 1, 138, 128, 73, 77, 17, 19, 90, 97, 75, 103, 83, 131, 80, 134, 95, 158, 108, 44, 71, 38, 11, 112, 59, 63, 32, 88, 109, 129, 24, 154, 4],
161 : [90, 16, 149, 35, 38, 88, 121, 66, 11, 94, 37, 30, 58, 142, 87, 101, 97, 91, 41, 119, 6, 3, 18, 103, 60, 157, 114, 143, 59, 29, 141, 20, 140, 84, 116, 44, 9, 146, 105, 68, 106, 111, 34, 76, 45, 55, 51, 67, 19, 128, 148, 152, 112, 147, 48, 108, 78, 118, 8, 12, 73, 2, 100, 15, 22, 27, 153, 144, 63, 80, 5, 95, 102, 36, 158, 151, 56, 132, 123, 43, 40, 129, 54, 137, 83, 122, 154, 1, 150, 107, 64, 21, 156, 17, 75, 134, 62, 14, 82, 24, 104, 117, 159, 50, 26, 13, 0, 28, 125, 135, 46, 4, 25, 72, 33, 71, 130, 145, 61, 57, 69, 39, 70, 93, 115, 160, 31, 81, 126, 136, 113, 96, 138, 120, 124, 7, 32, 65, 131, 85, 74, 109, 49, 52, 86, 89, 77, 155, 99, 110, 127, 10, 47, 53, 139, 42, 79, 133, 23, 98, 92],
162 : [80, 67, 104, 72, 79, 60, 94, 29, 134, 112, 8, 85, 46, 17, 97, 28, 19, 90, 100, 58, 116, 35, 141, 86, 138, 56, 87, 63, 84, 64, 117, 140, 153, 65, 6, 11, 96, 135, 129, 13, 133, 33, 127, 59, 121, 144, 36, 160, 2, 111, 7, 48, 103, 125, 95, 126, 15, 147, 47, 143, 106, 89, 73, 4, 161, 110, 53, 20, 122, 69, 149, 14, 71, 81, 49, 151, 55, 119, 66, 5, 9, 98, 131, 34, 26, 37, 124, 108, 51, 44, 40, 77, 24, 21, 109, 128, 1, 27, 10, 30, 148, 120, 145, 22, 114, 132, 130, 159, 32, 25, 88, 45, 68, 75, 158, 82, 146, 42, 136, 101, 57, 150, 107, 93, 3, 74, 152, 31, 105, 154, 16, 78, 123, 156, 118, 18, 12, 39, 102, 83, 61, 52, 115, 137, 50, 38, 155, 92, 113, 43, 41, 157, 0, 91, 76, 62, 139, 70, 54, 23, 99, 142],
163 : [87, 121, 50, 42, 9, 85, 160, 76, 92, 111, 65, 68, 143, 58, 117, 11, 39, 47, 62, 119, 56, 156, 148, 120, 95, 137, 86, 30, 155, 10, 93, 105, 97, 154, 133, 113, 33, 123, 71, 19, 104, 73, 153, 102, 38, 130, 48, 59, 131, 103, 77, 159, 78, 51, 14, 40, 29, 134, 12, 94, 142, 60, 24, 63, 136, 69, 81, 31, 5, 80, 151, 22, 145, 45, 3, 141, 15, 20, 112, 28, 108, 127, 140, 124, 122, 18, 139, 37, 13, 110, 25, 101, 135, 23, 16, 162, 0, 106, 138, 161, 118, 72, 70, 152, 57, 36, 157, 82, 49, 54, 7, 74, 27, 132, 115, 128, 17, 34, 147, 46, 8, 88, 91, 109, 26, 44, 52, 55, 4, 67, 89, 83, 66, 41, 125, 2, 150, 21, 96, 100, 64, 129, 98, 43, 84, 35, 116, 126, 6, 32, 61, 99, 158, 146, 149, 1, 79, 114, 90, 53, 144, 107, 75],
164 : [103, 25, 46, 85, 36, 77, 129, 88, 113, 83, 145, 118, 64, 84, 90, 30, 57, 150, 69, 143, 137, 42, 53, 117, 43, 45, 123, 154, 92, 160, 7, 116, 153, 35, 60, 141, 79, 24, 94, 139, 67, 127, 5, 131, 157, 68, 106, 87, 4, 96, 66, 142, 26, 31, 3, 14, 126, 2, 6, 21, 50, 78, 56, 140, 109, 34, 23, 97, 86, 54, 28, 158, 125, 13, 11, 16, 133, 49, 114, 40, 148, 159, 132, 105, 17, 8, 100, 63, 95, 1, 10, 74, 104, 48, 20, 22, 15, 72, 89, 147, 98, 130, 41, 55, 138, 0, 73, 37, 51, 115, 27, 19, 161, 38, 149, 9, 155, 39, 156, 12, 18, 122, 82, 61, 124, 162, 119, 91, 99, 108, 81, 128, 136, 75, 120, 59, 70, 58, 163, 71, 76, 151, 110, 93, 152, 80, 112, 135, 102, 144, 52, 29, 65, 62, 134, 101, 121, 33, 111, 32, 47, 44, 146, 107],
165 : [93, 86, 56, 2, 130, 119, 28, 57, 10, 79, 47, 118, 78, 155, 53, 88, 50, 113, 159, 3, 111, 80, 110, 32, 68, 18, 153, 70, 90, 116, 49, 107, 73, 37, 92, 158, 115, 26, 36, 21, 114, 58, 9, 43, 139, 147, 69, 22, 138, 97, 103, 30, 24, 83, 87, 106, 48, 160, 65, 108, 141, 46, 75, 126, 84, 142, 149, 15, 23, 105, 154, 98, 150, 12, 102, 120, 34, 163, 109, 140, 40, 156, 134, 52, 71, 17, 8, 41, 33, 25, 122, 74, 27, 128, 151, 164, 0, 157, 51, 72, 146, 11, 61, 54, 95, 123, 96, 20, 1, 89, 6, 29, 31, 101, 38, 162, 117, 64, 55, 14, 5, 145, 127, 161, 132, 137, 13, 152, 104, 143, 42, 60, 129, 136, 77, 99, 82, 133, 100, 67, 16, 112, 63, 66, 59, 85, 4, 124, 62, 35, 144, 45, 7, 148, 135, 121, 44, 131, 39, 19, 76, 81, 125, 94, 91],
166 : [65, 40, 120, 54, 39, 90, 63, 20, 25, 105, 114, 35, 82, 18, 69, 49, 136, 112, 92, 164, 30, 58, 111, 154, 2, 122, 97, 126, 78, 75, 102, 31, 140, 16, 94, 26, 34, 158, 151, 115, 12, 143, 51, 107, 117, 27, 88, 79, 95, 93, 153, 9, 133, 28, 43, 48, 157, 33, 106, 142, 119, 101, 13, 155, 38, 165, 47, 44, 70, 147, 67, 11, 149, 72, 104, 129, 138, 113, 134, 7, 148, 160, 76, 32, 57, 3, 50, 99, 141, 59, 135, 21, 108, 156, 146, 22, 163, 42, 83, 137, 96, 17, 109, 46, 52, 71, 139, 132, 130, 110, 10, 24, 161, 81, 5, 36, 14, 103, 124, 80, 55, 150, 60, 144, 68, 19, 152, 64, 116, 41, 37, 56, 74, 128, 145, 98, 23, 121, 125, 1, 87, 91, 73, 100, 29, 86, 0, 127, 45, 85, 15, 66, 131, 4, 162, 8, 159, 53, 77, 118, 62, 123, 61, 6, 84, 89],
167 : [157, 101, 124, 82, 9, 132, 71, 24, 33, 48, 119, 114, 116, 126, 77, 83, 162, 105, 99, 51, 139, 106, 70, 149, 26, 53, 41, 61, 6, 0, 60, 78, 166, 107, 10, 125, 15, 121, 113, 72, 76, 112, 22, 30, 42, 56, 54, 100, 144, 65, 102, 36, 138, 165, 94, 27, 161, 88, 47, 148, 122, 134, 58, 92, 20, 84, 75, 40, 3, 37, 96, 5, 164, 31, 128, 8, 68, 17, 52, 2, 63, 118, 21, 13, 104, 136, 110, 159, 98, 46, 18, 146, 39, 81, 1, 155, 23, 158, 12, 62, 127, 32, 103, 141, 153, 7, 156, 97, 152, 25, 151, 35, 55, 135, 66, 160, 38, 130, 79, 64, 45, 90, 143, 109, 147, 69, 133, 93, 163, 44, 59, 137, 4, 108, 111, 73, 89, 34, 129, 87, 16, 50, 142, 85, 57, 140, 150, 28, 145, 14, 43, 19, 29, 11, 86, 115, 120, 49, 123, 95, 154, 131, 80, 67, 74, 91, 117],
168 : [107, 32, 39, 95, 97, 84, 22, 89, 106, 48, 155, 57, 23, 146, 86, 72, 93, 128, 51, 120, 124, 110, 134, 79, 49, 54, 132, 63, 144, 30, 13, 148, 4, 33, 121, 21, 126, 88, 119, 127, 70, 165, 157, 161, 42, 131, 26, 38, 167, 91, 15, 64, 115, 60, 6, 44, 11, 59, 152, 104, 77, 14, 1, 58, 28, 71, 16, 111, 92, 166, 141, 34, 31, 153, 20, 142, 136, 50, 140, 73, 118, 3, 103, 147, 24, 45, 109, 19, 29, 138, 112, 101, 133, 154, 160, 37, 74, 151, 56, 5, 47, 159, 81, 65, 7, 114, 80, 75, 12, 143, 87, 35, 108, 25, 162, 130, 100, 149, 62, 55, 9, 125, 67, 52, 10, 17, 61, 8, 163, 78, 18, 2, 137, 90, 43, 96, 102, 27, 164, 158, 68, 0, 145, 66, 156, 116, 113, 123, 53, 139, 41, 99, 122, 69, 129, 98, 83, 94, 150, 46, 36, 117, 82, 40, 85, 76, 135, 105],
169 : [82, 145, 140, 96, 50, 73, 142, 49, 133, 22, 30, 23, 77, 119, 168, 148, 70, 103, 40, 5, 15, 45, 152, 72, 86, 164, 16, 100, 24, 1, 110, 134, 141, 123, 71, 32, 150, 139, 79, 106, 153, 138, 60, 159, 122, 167, 121, 54, 166, 6, 9, 78, 129, 84, 14, 160, 104, 55, 130, 144, 33, 93, 132, 17, 127, 48, 89, 4, 19, 12, 34, 114, 97, 137, 10, 53, 67, 76, 99, 113, 146, 157, 69, 128, 124, 46, 143, 20, 0, 47, 36, 44, 8, 68, 39, 83, 154, 62, 26, 155, 21, 43, 102, 162, 35, 13, 90, 63, 3, 135, 28, 125, 147, 163, 61, 94, 105, 111, 81, 11, 37, 101, 161, 2, 25, 107, 74, 57, 136, 98, 65, 116, 165, 109, 126, 151, 51, 27, 42, 80, 7, 75, 41, 120, 18, 95, 112, 149, 158, 88, 117, 56, 156, 108, 64, 58, 118, 131, 85, 31, 92, 87, 91, 115, 66, 52, 59, 38, 29],
170 : [64, 85, 120, 104, 129, 83, 95, 13, 4, 100, 149, 137, 155, 125, 16, 112, 146, 14, 106, 61, 71, 82, 7, 46, 19, 3, 70, 55, 39, 115, 80, 123, 24, 52, 139, 35, 6, 36, 68, 141, 92, 147, 152, 126, 113, 84, 49, 37, 77, 90, 159, 0, 99, 12, 48, 166, 42, 66, 114, 133, 15, 79, 122, 73, 164, 161, 121, 30, 102, 162, 107, 143, 135, 74, 18, 111, 69, 58, 1, 8, 28, 72, 150, 160, 29, 9, 144, 25, 23, 54, 105, 27, 63, 21, 34, 51, 128, 118, 151, 165, 157, 20, 148, 130, 45, 32, 119, 59, 26, 142, 40, 65, 87, 167, 134, 2, 10, 81, 163, 11, 158, 89, 94, 97, 138, 50, 38, 132, 117, 109, 33, 110, 136, 75, 156, 44, 67, 154, 96, 108, 60, 124, 140, 168, 78, 91, 153, 5, 98, 88, 47, 17, 103, 86, 131, 57, 62, 169, 145, 22, 53, 56, 31, 116, 41, 127, 76, 93, 43, 101],
171 : [71, 159, 81, 30, 1, 79, 38, 87, 95, 73, 86, 62, 41, 6, 104, 50, 25, 90, 101, 111, 105, 107, 76, 93, 91, 26, 115, 129, 134, 138, 163, 59, 139, 151, 52, 75, 156, 84, 74, 13, 154, 37, 67, 121, 22, 60, 158, 12, 113, 80, 20, 100, 82, 169, 131, 150, 167, 161, 68, 64, 39, 7, 120, 157, 5, 110, 108, 165, 149, 77, 43, 46, 29, 15, 162, 132, 11, 72, 98, 135, 128, 10, 65, 126, 48, 0, 14, 8, 49, 148, 109, 51, 153, 61, 160, 106, 99, 42, 102, 143, 2, 21, 164, 66, 44, 54, 140, 144, 55, 31, 40, 118, 56, 146, 17, 96, 168, 27, 94, 145, 136, 142, 16, 103, 57, 63, 9, 125, 119, 28, 35, 97, 117, 147, 133, 127, 47, 69, 122, 34, 32, 89, 3, 114, 130, 33, 85, 19, 170, 92, 137, 88, 45, 166, 4, 36, 24, 112, 152, 141, 83, 18, 116, 23, 70, 124, 78, 155, 53, 58, 123],
172 : [95, 163, 66, 141, 135, 76, 142, 81, 77, 65, 124, 122, 147, 92, 102, 28, 10, 83, 58, 99, 35, 27, 98, 69, 158, 41, 19, 5, 42, 86, 157, 164, 114, 25, 151, 93, 85, 112, 145, 131, 152, 8, 144, 48, 46, 107, 55, 162, 167, 61, 103, 11, 78, 89, 139, 39, 140, 30, 123, 84, 156, 108, 49, 14, 134, 73, 160, 57, 161, 50, 32, 51, 153, 23, 40, 143, 47, 9, 129, 62, 111, 119, 171, 0, 126, 12, 22, 159, 1, 17, 150, 136, 169, 166, 15, 36, 60, 97, 59, 100, 137, 44, 120, 170, 138, 109, 71, 128, 63, 56, 2, 18, 64, 88, 149, 20, 31, 116, 113, 7, 168, 16, 45, 67, 115, 79, 148, 33, 104, 82, 72, 90, 52, 121, 38, 43, 26, 3, 127, 118, 80, 110, 165, 74, 6, 117, 29, 154, 13, 94, 53, 133, 54, 21, 91, 125, 130, 87, 106, 155, 70, 75, 4, 34, 132, 24, 105, 101, 37, 146, 68, 96],
173 : [85, 63, 117, 21, 62, 126, 115, 6, 74, 129, 112, 123, 81, 59, 82, 148, 71, 90, 94, 86, 97, 41, 70, 77, 147, 36, 122, 23, 2, 45, 137, 149, 47, 155, 25, 19, 134, 136, 113, 37, 9, 160, 66, 156, 26, 146, 7, 110, 138, 141, 95, 73, 89, 93, 114, 22, 162, 151, 43, 69, 53, 88, 142, 27, 4, 91, 49, 109, 38, 150, 16, 10, 165, 92, 157, 164, 42, 168, 64, 35, 118, 52, 111, 170, 143, 17, 130, 100, 67, 40, 120, 132, 51, 11, 32, 101, 153, 106, 12, 0, 105, 46, 57, 8, 139, 169, 31, 158, 15, 18, 54, 24, 145, 127, 108, 119, 14, 107, 161, 1, 167, 33, 84, 124, 60, 58, 68, 99, 104, 163, 133, 152, 80, 39, 5, 78, 56, 125, 28, 131, 121, 166, 154, 34, 102, 29, 65, 144, 13, 48, 3, 103, 76, 140, 171, 135, 79, 87, 75, 159, 128, 98, 55, 44, 172, 20, 116, 83, 96, 61, 72, 50, 30],
174 : [81, 105, 63, 144, 66, 74, 70, 33, 140, 173, 155, 42, 110, 95, 58, 34, 22, 114, 162, 35, 150, 71, 108, 16, 118, 121, 29, 126, 60, 75, 145, 153, 45, 167, 30, 84, 57, 89, 4, 165, 158, 17, 27, 168, 36, 73, 40, 77, 160, 87, 93, 12, 51, 3, 139, 90, 112, 97, 132, 147, 169, 59, 79, 47, 137, 98, 159, 122, 32, 136, 149, 143, 43, 11, 88, 85, 9, 92, 31, 120, 2, 104, 166, 7, 23, 82, 53, 157, 146, 67, 37, 151, 65, 117, 133, 131, 6, 99, 54, 170, 14, 91, 19, 171, 152, 86, 101, 172, 135, 127, 56, 156, 154, 100, 161, 49, 1, 18, 20, 39, 61, 125, 129, 10, 113, 107, 69, 138, 111, 163, 25, 52, 141, 124, 15, 123, 8, 41, 78, 48, 0, 68, 55, 106, 103, 28, 116, 76, 148, 72, 38, 102, 83, 21, 5, 24, 164, 46, 13, 96, 26, 80, 142, 128, 64, 134, 94, 109, 44, 62, 119, 115, 50, 130],
175 : [123, 18, 116, 99, 115, 41, 62, 59, 101, 162, 100, 19, 15, 98, 87, 70, 117, 77, 75, 126, 49, 110, 52, 61, 145, 138, 13, 94, 166, 83, 34, 95, 6, 28, 82, 37, 4, 69, 153, 86, 118, 147, 3, 161, 8, 33, 88, 20, 120, 129, 36, 170, 72, 156, 146, 167, 93, 97, 64, 71, 106, 104, 121, 173, 11, 149, 141, 108, 92, 44, 12, 25, 81, 152, 54, 45, 21, 142, 74, 137, 24, 17, 107, 9, 73, 135, 131, 53, 2, 140, 57, 14, 47, 51, 165, 128, 158, 160, 133, 168, 79, 63, 30, 125, 172, 10, 78, 151, 127, 39, 171, 27, 68, 23, 32, 109, 139, 148, 134, 40, 159, 105, 150, 130, 84, 143, 111, 119, 1, 48, 42, 65, 80, 29, 22, 7, 31, 96, 55, 91, 103, 132, 169, 58, 26, 5, 124, 144, 50, 164, 56, 90, 163, 60, 136, 0, 154, 114, 16, 38, 85, 102, 89, 76, 157, 155, 66, 113, 43, 46, 35, 122, 112, 67, 174],
176 : [107, 137, 51, 35, 69, 43, 117, 58, 100, 97, 135, 0, 93, 130, 86, 74, 98, 143, 84, 24, 114, 71, 48, 27, 109, 31, 54, 63, 90, 156, 52, 175, 116, 89, 1, 7, 19, 76, 115, 40, 111, 94, 87, 118, 146, 29, 145, 38, 121, 150, 105, 50, 32, 151, 44, 8, 147, 73, 66, 113, 17, 173, 170, 139, 164, 144, 60, 30, 23, 96, 46, 154, 21, 103, 167, 88, 124, 138, 141, 122, 82, 102, 128, 163, 28, 59, 106, 155, 15, 10, 104, 68, 39, 47, 2, 9, 133, 171, 80, 168, 56, 132, 75, 18, 162, 12, 131, 77, 148, 169, 78, 120, 81, 14, 33, 157, 41, 11, 79, 129, 53, 140, 67, 134, 55, 159, 13, 142, 4, 136, 165, 123, 64, 16, 92, 153, 45, 166, 37, 91, 26, 70, 101, 3, 108, 126, 34, 20, 6, 65, 85, 149, 95, 5, 125, 57, 61, 174, 62, 36, 22, 161, 25, 158, 112, 127, 83, 49, 119, 172, 110, 42, 72, 160, 152, 99],
177 : [29, 127, 97, 107, 23, 92, 145, 74, 125, 52, 137, 90, 43, 153, 14, 147, 60, 41, 17, 121, 26, 173, 128, 71, 110, 45, 88, 141, 120, 63, 47, 129, 84, 140, 32, 118, 27, 83, 159, 67, 165, 172, 102, 93, 77, 98, 103, 25, 20, 34, 30, 148, 136, 16, 50, 154, 69, 106, 13, 132, 116, 3, 12, 139, 51, 58, 101, 168, 49, 36, 163, 122, 82, 150, 15, 166, 158, 53, 167, 104, 2, 56, 87, 155, 111, 123, 144, 162, 5, 75, 135, 81, 37, 94, 33, 176, 79, 119, 11, 78, 161, 131, 55, 76, 146, 164, 113, 91, 10, 149, 48, 100, 73, 46, 24, 4, 64, 7, 86, 22, 156, 1, 9, 170, 28, 99, 138, 124, 54, 61, 133, 96, 134, 151, 105, 117, 19, 8, 175, 39, 6, 66, 0, 152, 42, 160, 169, 68, 72, 21, 112, 59, 44, 174, 114, 143, 18, 80, 89, 115, 130, 95, 157, 40, 108, 35, 62, 171, 126, 109, 85, 65, 57, 70, 38, 31, 142],
178 : [141, 153, 117, 84, 23, 87, 156, 114, 177, 52, 124, 61, 13, 162, 19, 140, 126, 57, 53, 88, 20, 99, 95, 166, 145, 91, 72, 76, 100, 70, 118, 59, 2, 44, 7, 170, 159, 12, 171, 41, 111, 167, 125, 102, 176, 17, 147, 137, 150, 42, 31, 5, 172, 110, 105, 89, 54, 122, 68, 24, 63, 92, 94, 21, 25, 36, 108, 130, 50, 33, 103, 175, 4, 77, 62, 55, 85, 45, 163, 158, 49, 149, 15, 169, 139, 29, 14, 37, 155, 164, 3, 116, 119, 146, 86, 0, 35, 157, 106, 40, 113, 67, 6, 109, 134, 47, 80, 161, 128, 123, 132, 148, 69, 34, 51, 112, 142, 66, 96, 30, 71, 107, 11, 83, 16, 78, 165, 151, 9, 173, 28, 143, 168, 127, 43, 98, 58, 1, 64, 27, 136, 93, 133, 160, 74, 144, 75, 154, 48, 8, 129, 97, 79, 46, 22, 138, 32, 65, 174, 104, 18, 120, 82, 38, 81, 121, 101, 73, 115, 60, 56, 90, 10, 135, 26, 152, 131, 39],
179 : [105, 116, 38, 96, 59, 76, 157, 30, 13, 68, 94, 86, 124, 133, 14, 177, 40, 79, 150, 57, 145, 72, 3, 1, 35, 88, 103, 15, 41, 118, 90, 130, 16, 6, 141, 115, 70, 176, 17, 64, 22, 142, 138, 97, 48, 132, 18, 0, 178, 65, 108, 101, 28, 169, 87, 52, 167, 109, 106, 123, 26, 171, 21, 4, 121, 131, 67, 140, 137, 164, 60, 2, 63, 155, 20, 156, 12, 46, 81, 31, 119, 73, 8, 166, 54, 170, 129, 163, 98, 111, 139, 24, 159, 32, 122, 114, 152, 51, 144, 146, 49, 162, 172, 23, 100, 62, 95, 136, 11, 149, 29, 113, 153, 80, 75, 7, 56, 34, 9, 83, 173, 50, 10, 19, 151, 134, 47, 110, 160, 66, 165, 168, 174, 58, 44, 82, 33, 143, 158, 55, 154, 84, 104, 27, 74, 125, 161, 37, 99, 107, 85, 36, 5, 148, 117, 89, 127, 112, 126, 71, 61, 42, 147, 25, 77, 45, 53, 69, 43, 92, 135, 93, 128, 39, 78, 102, 175, 91, 120],
180 : [82, 86, 163, 95, 11, 125, 75, 31, 66, 110, 153, 42, 147, 84, 48, 57, 134, 115, 12, 97, 70, 151, 101, 113, 117, 174, 148, 87, 127, 26, 175, 78, 145, 9, 99, 30, 53, 56, 171, 136, 104, 132, 142, 96, 47, 18, 37, 32, 128, 108, 1, 3, 58, 139, 15, 157, 161, 43, 120, 162, 156, 45, 105, 7, 24, 81, 38, 140, 35, 92, 138, 14, 6, 54, 141, 46, 25, 79, 166, 107, 72, 68, 176, 144, 114, 73, 137, 98, 17, 59, 160, 100, 10, 89, 170, 4, 49, 154, 124, 65, 8, 41, 135, 80, 62, 88, 172, 40, 20, 22, 146, 149, 5, 27, 83, 169, 90, 34, 2, 50, 23, 13, 177, 164, 123, 143, 165, 167, 67, 52, 131, 158, 28, 122, 179, 103, 173, 0, 102, 94, 64, 121, 69, 133, 76, 150, 159, 77, 152, 178, 21, 36, 51, 112, 74, 130, 118, 85, 60, 116, 106, 71, 39, 119, 129, 29, 44, 33, 63, 19, 168, 109, 91, 16, 61, 111, 155, 93, 126, 55],
181 : [126, 150, 140, 133, 84, 48, 29, 180, 74, 131, 109, 161, 170, 94, 154, 47, 143, 105, 81, 32, 177, 69, 38, 17, 61, 55, 95, 146, 101, 3, 14, 93, 132, 77, 33, 153, 127, 56, 66, 118, 76, 162, 91, 25, 160, 46, 114, 103, 145, 5, 59, 111, 78, 155, 11, 89, 151, 98, 141, 39, 1, 22, 2, 159, 174, 30, 119, 122, 40, 54, 43, 26, 20, 16, 4, 104, 168, 136, 71, 7, 97, 19, 120, 73, 44, 60, 28, 152, 123, 163, 115, 80, 51, 13, 148, 173, 135, 117, 67, 35, 147, 116, 72, 134, 62, 107, 124, 34, 12, 166, 171, 42, 164, 57, 23, 142, 45, 139, 110, 102, 15, 6, 10, 100, 92, 75, 129, 178, 106, 9, 144, 27, 165, 65, 50, 130, 83, 88, 52, 8, 138, 108, 53, 24, 36, 157, 0, 49, 58, 128, 121, 64, 149, 90, 37, 21, 137, 18, 112, 125, 156, 79, 172, 82, 169, 99, 87, 68, 41, 176, 63, 96, 158, 179, 86, 175, 70, 85, 113, 31, 167],
182 : [80, 49, 104, 168, 30, 24, 147, 42, 123, 62, 72, 121, 90, 57, 105, 128, 152, 22, 20, 172, 127, 129, 166, 155, 125, 35, 118, 150, 39, 132, 46, 65, 114, 31, 102, 146, 126, 4, 71, 36, 3, 82, 177, 139, 33, 164, 0, 145, 9, 138, 154, 106, 21, 34, 181, 7, 59, 94, 64, 101, 74, 124, 108, 133, 52, 77, 67, 140, 1, 100, 43, 122, 148, 142, 44, 162, 19, 8, 63, 13, 55, 73, 131, 6, 10, 45, 5, 38, 23, 16, 156, 37, 120, 15, 103, 176, 153, 117, 54, 107, 130, 175, 141, 14, 17, 157, 99, 56, 144, 75, 2, 26, 91, 178, 173, 171, 180, 167, 11, 151, 165, 68, 58, 53, 92, 41, 97, 113, 83, 79, 18, 93, 32, 50, 110, 159, 161, 111, 137, 134, 25, 98, 86, 160, 51, 27, 87, 169, 135, 149, 179, 116, 66, 78, 158, 170, 109, 29, 95, 40, 119, 174, 12, 47, 136, 61, 143, 69, 96, 81, 28, 89, 70, 115, 60, 76, 85, 48, 88, 84, 112, 163],
183 : [140, 47, 112, 68, 98, 131, 66, 173, 35, 77, 81, 87, 148, 22, 51, 147, 172, 101, 12, 118, 32, 110, 104, 144, 181, 91, 67, 48, 156, 55, 59, 27, 88, 50, 79, 82, 103, 17, 96, 89, 154, 122, 65, 134, 16, 24, 123, 80, 163, 149, 175, 138, 21, 2, 111, 7, 100, 49, 113, 46, 162, 97, 18, 1, 160, 127, 182, 85, 129, 143, 33, 38, 6, 8, 167, 180, 62, 125, 168, 15, 120, 115, 141, 13, 75, 5, 26, 61, 142, 30, 74, 9, 19, 86, 109, 164, 139, 54, 176, 44, 170, 0, 39, 135, 72, 3, 126, 102, 150, 108, 121, 64, 165, 152, 178, 137, 179, 136, 119, 28, 41, 29, 11, 45, 159, 174, 177, 43, 128, 105, 42, 90, 25, 20, 40, 145, 166, 69, 63, 146, 153, 52, 4, 124, 95, 10, 36, 132, 71, 34, 94, 117, 56, 161, 157, 133, 84, 76, 60, 114, 31, 53, 116, 57, 78, 169, 130, 155, 107, 93, 58, 14, 73, 37, 151, 158, 23, 92, 83, 70, 106, 171, 99],
184 : [162, 139, 161, 90, 60, 44, 91, 87, 32, 81, 165, 77, 157, 67, 140, 171, 54, 30, 73, 114, 173, 82, 103, 130, 144, 146, 53, 68, 76, 37, 101, 36, 120, 5, 143, 71, 69, 102, 84, 133, 75, 51, 56, 11, 21, 62, 177, 26, 2, 6, 19, 137, 48, 46, 181, 147, 72, 168, 1, 17, 172, 63, 61, 154, 38, 129, 100, 107, 111, 58, 159, 18, 104, 117, 176, 138, 175, 0, 123, 41, 39, 15, 158, 3, 180, 110, 183, 149, 166, 163, 88, 10, 115, 113, 95, 13, 40, 35, 98, 174, 50, 12, 131, 42, 34, 152, 23, 78, 136, 179, 169, 148, 127, 28, 105, 119, 89, 9, 112, 141, 170, 142, 106, 64, 57, 22, 96, 122, 29, 155, 94, 116, 124, 65, 153, 25, 178, 74, 99, 43, 80, 150, 16, 118, 66, 52, 128, 20, 79, 55, 59, 97, 164, 160, 7, 121, 24, 8, 45, 14, 86, 109, 83, 92, 27, 47, 49, 132, 70, 93, 167, 182, 108, 151, 134, 126, 156, 31, 145, 4, 125, 33, 85, 135],
185 : [96, 106, 11, 157, 147, 103, 124, 119, 84, 136, 18, 176, 126, 116, 153, 64, 149, 61, 72, 3, 86, 184, 73, 76, 21, 4, 172, 164, 105, 111, 155, 74, 117, 50, 36, 69, 51, 35, 15, 127, 25, 141, 94, 66, 179, 156, 140, 109, 2, 120, 62, 12, 63, 95, 59, 165, 28, 5, 138, 134, 92, 131, 110, 38, 52, 81, 107, 7, 142, 90, 161, 177, 17, 163, 169, 39, 42, 123, 182, 89, 48, 168, 6, 151, 148, 166, 46, 115, 53, 139, 91, 33, 8, 132, 67, 22, 125, 79, 135, 113, 23, 174, 97, 0, 40, 57, 13, 170, 49, 55, 45, 31, 68, 160, 154, 16, 181, 178, 104, 1, 77, 180, 158, 112, 30, 9, 85, 114, 183, 121, 47, 43, 162, 133, 152, 128, 58, 10, 75, 32, 175, 54, 145, 20, 102, 144, 108, 167, 173, 98, 80, 65, 146, 87, 29, 60, 34, 82, 26, 129, 78, 14, 27, 101, 93, 118, 37, 88, 137, 19, 44, 56, 70, 83, 100, 171, 143, 41, 122, 150, 99, 159, 71, 130, 24],
186 : [65, 70, 23, 140, 147, 80, 11, 134, 55, 141, 163, 105, 90, 66, 161, 164, 98, 115, 59, 99, 20, 10, 126, 142, 43, 13, 0, 17, 87, 22, 16, 123, 2, 178, 143, 38, 117, 75, 5, 124, 84, 86, 8, 78, 26, 157, 125, 146, 139, 172, 102, 82, 174, 92, 33, 160, 36, 32, 71, 129, 44, 88, 170, 119, 35, 93, 169, 15, 6, 14, 25, 167, 63, 95, 111, 89, 108, 151, 12, 150, 45, 50, 77, 107, 62, 182, 120, 153, 137, 177, 1, 180, 4, 37, 7, 103, 24, 159, 156, 185, 61, 168, 21, 171, 18, 155, 3, 48, 106, 30, 34, 165, 138, 130, 113, 122, 152, 39, 133, 76, 114, 132, 109, 69, 96, 64, 118, 42, 144, 9, 148, 116, 28, 181, 40, 175, 67, 46, 101, 74, 83, 58, 184, 19, 145, 149, 176, 31, 158, 52, 179, 91, 60, 112, 53, 104, 162, 154, 135, 49, 97, 94, 56, 136, 41, 127, 51, 85, 29, 121, 128, 173, 73, 100, 183, 47, 54, 72, 131, 79, 68, 110, 27, 81, 57, 166],
187 : [131, 12, 50, 132, 75, 61, 79, 76, 112, 164, 17, 165, 53, 38, 150, 97, 22, 52, 42, 71, 113, 118, 186, 161, 83, 149, 111, 13, 67, 32, 158, 51, 77, 121, 68, 145, 10, 126, 91, 34, 90, 166, 148, 31, 116, 87, 107, 63, 162, 147, 49, 127, 36, 140, 64, 20, 155, 124, 169, 174, 82, 23, 0, 137, 8, 102, 183, 185, 60, 96, 30, 135, 142, 99, 37, 41, 11, 139, 18, 40, 159, 98, 65, 104, 144, 168, 181, 74, 6, 25, 92, 129, 29, 48, 46, 108, 125, 115, 88, 69, 180, 167, 93, 33, 153, 86, 163, 19, 7, 106, 95, 44, 117, 85, 43, 62, 128, 21, 9, 182, 5, 130, 177, 47, 26, 172, 119, 35, 160, 173, 176, 28, 81, 109, 24, 175, 151, 94, 157, 70, 171, 58, 14, 143, 1, 101, 2, 72, 156, 55, 73, 184, 78, 120, 123, 103, 136, 84, 154, 66, 105, 100, 141, 152, 178, 27, 170, 4, 56, 110, 138, 114, 3, 59, 89, 146, 122, 45, 39, 57, 133, 54, 15, 134, 80, 179, 16],
188 : [109, 126, 5, 74, 159, 58, 119, 139, 45, 47, 101, 85, 40, 158, 173, 22, 97, 44, 110, 105, 59, 87, 52, 15, 99, 177, 55, 103, 21, 75, 142, 31, 90, 155, 128, 41, 80, 121, 83, 93, 100, 120, 157, 17, 27, 153, 129, 174, 43, 108, 86, 115, 16, 102, 65, 35, 167, 162, 77, 141, 170, 187, 134, 166, 178, 34, 168, 0, 7, 25, 94, 122, 137, 30, 164, 37, 169, 11, 6, 64, 26, 60, 20, 181, 184, 67, 171, 2, 145, 29, 130, 9, 180, 92, 112, 165, 118, 186, 3, 104, 156, 82, 32, 123, 147, 182, 54, 13, 150, 1, 63, 33, 113, 81, 12, 18, 68, 78, 151, 10, 183, 71, 163, 42, 23, 91, 152, 114, 51, 133, 50, 144, 69, 84, 146, 39, 14, 73, 116, 111, 148, 135, 107, 127, 53, 8, 136, 89, 179, 28, 61, 185, 95, 124, 24, 49, 56, 172, 79, 161, 72, 106, 132, 76, 140, 125, 143, 96, 154, 66, 19, 57, 160, 98, 48, 138, 117, 4, 175, 36, 38, 62, 149, 70, 131, 46, 88, 176],
189 : [59, 185, 81, 50, 3, 43, 118, 137, 144, 110, 70, 79, 30, 61, 135, 12, 51, 87, 57, 32, 123, 121, 112, 40, 132, 141, 11, 90, 16, 126, 108, 140, 165, 48, 54, 180, 159, 131, 160, 25, 14, 175, 177, 67, 129, 68, 72, 23, 44, 133, 2, 161, 71, 47, 52, 13, 33, 174, 178, 27, 101, 122, 107, 91, 146, 163, 157, 154, 63, 96, 106, 128, 73, 104, 17, 85, 21, 130, 115, 35, 53, 4, 103, 58, 95, 139, 158, 29, 184, 19, 82, 168, 181, 173, 76, 145, 152, 10, 167, 187, 20, 45, 38, 117, 134, 24, 31, 94, 98, 113, 153, 15, 78, 155, 120, 124, 183, 100, 164, 89, 171, 176, 188, 80, 102, 127, 66, 149, 162, 169, 179, 8, 64, 18, 60, 46, 69, 142, 182, 93, 172, 34, 83, 114, 6, 39, 28, 42, 156, 84, 41, 151, 136, 5, 9, 105, 22, 7, 55, 148, 125, 109, 0, 170, 92, 65, 88, 37, 75, 150, 119, 143, 99, 111, 77, 166, 86, 116, 49, 62, 97, 56, 36, 186, 74, 26, 1, 138, 147],
190 : [40, 130, 111, 158, 92, 129, 79, 125, 168, 147, 51, 62, 80, 116, 28, 59, 186, 2, 90, 53, 110, 82, 118, 156, 81, 146, 20, 38, 58, 149, 183, 96, 69, 1, 126, 145, 119, 21, 137, 181, 134, 70, 77, 52, 97, 170, 41, 107, 0, 19, 148, 136, 29, 91, 128, 44, 66, 133, 127, 176, 9, 131, 167, 49, 179, 160, 155, 171, 46, 175, 154, 31, 3, 48, 76, 32, 112, 16, 45, 60, 10, 71, 141, 139, 165, 83, 161, 114, 185, 180, 14, 25, 99, 56, 15, 33, 189, 115, 121, 7, 108, 37, 135, 43, 105, 12, 94, 11, 54, 101, 177, 61, 35, 144, 117, 162, 132, 122, 6, 98, 74, 68, 184, 151, 173, 78, 88, 172, 23, 87, 103, 124, 13, 153, 100, 187, 27, 30, 39, 4, 188, 123, 57, 164, 63, 157, 150, 143, 104, 24, 8, 120, 18, 65, 169, 138, 85, 182, 93, 22, 36, 152, 113, 163, 89, 178, 84, 26, 142, 166, 72, 55, 34, 73, 106, 174, 140, 86, 50, 5, 102, 64, 109, 47, 95, 42, 75, 159, 17, 67],
191 : [117, 99, 7, 105, 126, 92, 106, 163, 119, 169, 60, 121, 104, 138, 41, 127, 146, 172, 47, 82, 1, 103, 26, 59, 34, 81, 70, 22, 46, 66, 125, 165, 48, 44, 27, 96, 143, 107, 134, 168, 65, 80, 122, 32, 158, 18, 79, 112, 11, 40, 42, 152, 61, 190, 36, 68, 188, 12, 2, 123, 154, 120, 64, 142, 116, 63, 19, 186, 167, 114, 136, 174, 148, 140, 97, 161, 164, 77, 147, 28, 137, 38, 53, 31, 62, 100, 118, 0, 109, 29, 144, 45, 150, 83, 90, 185, 145, 5, 171, 21, 9, 89, 37, 50, 178, 153, 166, 124, 183, 156, 55, 57, 115, 133, 182, 149, 157, 33, 20, 10, 72, 98, 86, 88, 155, 76, 181, 16, 71, 130, 58, 173, 91, 15, 3, 175, 189, 8, 94, 13, 51, 111, 180, 162, 74, 132, 108, 30, 25, 17, 176, 75, 69, 139, 129, 67, 56, 4, 52, 39, 101, 160, 24, 187, 84, 35, 135, 128, 95, 87, 184, 177, 179, 141, 73, 159, 54, 78, 110, 151, 14, 6, 85, 93, 49, 43, 23, 113, 102, 131, 170],
192 : [116, 126, 26, 83, 34, 82, 106, 63, 125, 130, 104, 153, 95, 89, 103, 143, 147, 114, 179, 79, 154, 139, 0, 66, 60, 174, 176, 24, 112, 120, 135, 21, 172, 189, 16, 94, 39, 107, 100, 87, 81, 8, 18, 129, 71, 49, 88, 148, 33, 156, 111, 72, 15, 25, 23, 182, 96, 190, 168, 98, 175, 110, 131, 29, 149, 117, 43, 69, 102, 85, 124, 185, 4, 163, 127, 157, 19, 68, 28, 191, 40, 37, 180, 150, 159, 3, 70, 122, 9, 155, 186, 5, 50, 31, 65, 169, 115, 54, 77, 14, 30, 99, 51, 22, 141, 64, 151, 80, 158, 164, 78, 184, 56, 67, 178, 123, 108, 2, 105, 144, 177, 7, 10, 167, 17, 136, 53, 132, 146, 38, 46, 84, 57, 166, 73, 75, 47, 152, 12, 90, 6, 140, 1, 35, 52, 74, 121, 128, 58, 13, 27, 160, 183, 32, 161, 97, 92, 55, 187, 181, 86, 42, 109, 62, 101, 188, 162, 91, 142, 134, 61, 20, 133, 44, 76, 145, 138, 165, 113, 173, 36, 11, 45, 59, 170, 137, 48, 41, 119, 93, 118, 171],
193 : [60, 109, 157, 87, 104, 151, 101, 30, 34, 158, 163, 126, 66, 82, 135, 1, 41, 98, 93, 12, 27, 175, 140, 115, 53, 176, 149, 18, 47, 56, 25, 134, 102, 84, 70, 133, 76, 123, 46, 155, 168, 2, 124, 71, 183, 29, 189, 146, 96, 91, 6, 54, 24, 28, 55, 31, 191, 188, 99, 42, 170, 162, 36, 69, 78, 144, 112, 83, 120, 156, 161, 50, 185, 166, 141, 165, 187, 20, 117, 111, 16, 186, 147, 128, 114, 58, 192, 118, 173, 132, 57, 81, 0, 148, 92, 169, 23, 48, 160, 182, 26, 125, 39, 43, 180, 171, 100, 178, 8, 61, 67, 13, 51, 130, 11, 49, 94, 85, 174, 3, 122, 14, 172, 127, 90, 88, 59, 145, 5, 10, 107, 17, 154, 103, 37, 45, 68, 15, 137, 159, 63, 79, 129, 64, 72, 179, 181, 136, 7, 32, 19, 184, 190, 164, 22, 62, 97, 139, 116, 65, 152, 142, 38, 110, 106, 153, 80, 167, 21, 113, 119, 131, 77, 138, 86, 4, 121, 35, 40, 143, 89, 150, 73, 105, 95, 74, 52, 75, 44, 33, 9, 108, 177],
194 : [35, 192, 75, 143, 20, 171, 130, 56, 99, 157, 1, 77, 167, 36, 175, 136, 105, 160, 111, 129, 177, 128, 91, 16, 147, 57, 112, 140, 61, 23, 145, 127, 100, 185, 9, 55, 65, 94, 85, 81, 138, 53, 88, 62, 10, 71, 188, 156, 22, 18, 95, 165, 134, 120, 116, 180, 108, 24, 76, 110, 11, 42, 159, 142, 144, 43, 31, 170, 152, 96, 6, 173, 30, 174, 69, 119, 19, 83, 0, 151, 191, 78, 70, 166, 7, 37, 39, 46, 193, 73, 146, 172, 25, 49, 15, 148, 117, 182, 59, 13, 161, 126, 150, 106, 103, 155, 68, 181, 32, 92, 51, 121, 14, 41, 115, 186, 79, 158, 21, 64, 137, 107, 133, 183, 187, 153, 2, 45, 162, 86, 169, 80, 87, 63, 139, 124, 90, 44, 3, 52, 28, 154, 40, 113, 12, 93, 4, 190, 184, 164, 67, 123, 47, 72, 34, 132, 29, 179, 189, 74, 54, 125, 176, 60, 104, 66, 82, 98, 141, 33, 97, 109, 8, 27, 84, 135, 163, 89, 149, 118, 26, 101, 178, 168, 58, 5, 38, 131, 114, 50, 122, 102, 48, 17],
195 : [121, 40, 186, 159, 127, 166, 32, 37, 126, 119, 0, 82, 64, 125, 58, 48, 98, 168, 29, 31, 183, 111, 138, 61, 28, 118, 27, 97, 150, 101, 114, 25, 50, 106, 75, 91, 117, 53, 158, 143, 169, 20, 187, 132, 13, 136, 66, 55, 173, 116, 65, 139, 112, 133, 94, 4, 79, 151, 103, 134, 62, 88, 24, 148, 7, 129, 179, 96, 160, 184, 181, 23, 19, 38, 51, 174, 113, 8, 78, 54, 154, 6, 10, 108, 11, 22, 59, 33, 191, 157, 141, 45, 63, 172, 83, 102, 161, 69, 12, 18, 163, 99, 115, 70, 170, 46, 92, 47, 104, 167, 193, 93, 71, 149, 5, 165, 60, 194, 74, 107, 130, 2, 52, 177, 145, 105, 110, 189, 14, 95, 17, 140, 180, 39, 3, 44, 178, 192, 152, 100, 135, 73, 76, 41, 36, 80, 109, 21, 153, 1, 147, 72, 176, 188, 182, 15, 85, 156, 84, 81, 42, 144, 57, 43, 128, 67, 86, 137, 123, 87, 155, 16, 175, 190, 124, 162, 34, 56, 89, 185, 171, 35, 90, 30, 122, 142, 131, 120, 146, 26, 164, 68, 9, 77, 49],
196 : [74, 91, 123, 164, 37, 43, 18, 162, 50, 140, 160, 38, 77, 85, 76, 35, 143, 182, 158, 98, 48, 97, 115, 4, 131, 120, 146, 82, 39, 99, 55, 194, 183, 161, 71, 116, 180, 84, 141, 16, 90, 23, 167, 40, 168, 32, 25, 135, 83, 112, 72, 24, 54, 44, 150, 177, 64, 124, 172, 139, 5, 78, 51, 87, 2, 195, 155, 171, 58, 186, 101, 8, 178, 134, 79, 63, 192, 109, 17, 179, 47, 163, 42, 191, 170, 92, 145, 121, 193, 15, 103, 49, 10, 69, 94, 57, 181, 154, 138, 118, 153, 73, 6, 176, 59, 128, 174, 165, 28, 105, 156, 189, 53, 19, 108, 144, 80, 68, 93, 185, 136, 119, 13, 187, 33, 166, 169, 75, 36, 159, 104, 88, 11, 1, 41, 89, 190, 29, 67, 125, 52, 0, 26, 96, 113, 130, 102, 9, 30, 127, 149, 22, 188, 70, 56, 147, 157, 3, 129, 142, 107, 34, 111, 20, 132, 100, 60, 95, 45, 175, 184, 81, 152, 62, 27, 31, 110, 65, 137, 21, 66, 46, 148, 14, 7, 86, 61, 133, 151, 173, 122, 12, 106, 114, 117, 126],
197 : [21, 112, 190, 121, 135, 36, 136, 87, 38, 109, 75, 67, 133, 158, 100, 48, 141, 151, 164, 131, 83, 196, 129, 176, 139, 72, 170, 89, 195, 149, 106, 88, 56, 180, 42, 168, 91, 17, 70, 171, 101, 115, 29, 172, 104, 3, 71, 76, 43, 134, 39, 47, 166, 22, 105, 15, 31, 150, 97, 155, 32, 113, 4, 11, 61, 78, 160, 59, 194, 92, 74, 6, 81, 152, 73, 156, 19, 147, 126, 28, 0, 34, 23, 57, 9, 79, 10, 94, 64, 60, 162, 159, 183, 44, 161, 184, 24, 63, 124, 117, 127, 99, 65, 25, 116, 86, 52, 165, 46, 186, 2, 182, 68, 20, 119, 153, 95, 181, 167, 125, 26, 143, 90, 54, 14, 84, 140, 5, 187, 145, 40, 108, 169, 144, 1, 30, 33, 173, 50, 37, 107, 49, 51, 177, 179, 188, 111, 189, 110, 13, 120, 103, 193, 55, 132, 148, 157, 114, 122, 82, 142, 12, 146, 154, 41, 185, 93, 96, 85, 130, 27, 18, 174, 62, 58, 192, 8, 53, 128, 7, 163, 191, 118, 77, 138, 98, 16, 175, 102, 123, 137, 45, 178, 80, 35, 66, 69],
198 : [194, 48, 116, 126, 23, 77, 134, 179, 142, 60, 170, 61, 72, 75, 10, 91, 2, 103, 67, 171, 188, 22, 52, 102, 144, 113, 130, 92, 33, 147, 98, 172, 32, 64, 118, 127, 107, 78, 71, 122, 120, 58, 129, 178, 100, 36, 105, 184, 0, 168, 37, 149, 34, 186, 42, 140, 14, 159, 79, 20, 190, 17, 125, 166, 174, 139, 160, 9, 81, 180, 38, 192, 185, 80, 6, 51, 99, 62, 114, 154, 54, 8, 11, 191, 46, 151, 183, 112, 157, 5, 197, 31, 90, 182, 136, 89, 150, 135, 69, 25, 181, 73, 95, 119, 143, 195, 138, 35, 39, 63, 167, 117, 57, 68, 196, 16, 19, 4, 161, 123, 148, 12, 44, 104, 164, 30, 15, 153, 165, 187, 53, 145, 121, 132, 109, 13, 84, 70, 55, 85, 162, 29, 83, 146, 111, 28, 43, 66, 158, 49, 110, 86, 115, 1, 24, 59, 21, 137, 108, 193, 74, 45, 177, 175, 27, 189, 156, 87, 176, 128, 41, 101, 141, 50, 82, 26, 3, 124, 93, 40, 131, 7, 88, 76, 94, 97, 65, 18, 47, 173, 169, 155, 56, 163, 96, 152, 133, 106],
199 : [60, 56, 82, 26, 141, 33, 94, 54, 41, 127, 99, 109, 57, 77, 63, 110, 128, 162, 182, 148, 192, 23, 112, 80, 126, 195, 161, 28, 71, 69, 9, 152, 166, 149, 180, 129, 167, 17, 7, 34, 92, 44, 79, 73, 111, 42, 32, 125, 174, 131, 177, 35, 91, 6, 115, 84, 38, 133, 66, 76, 184, 138, 18, 150, 90, 36, 122, 186, 8, 197, 178, 85, 55, 39, 147, 159, 95, 158, 146, 12, 50, 191, 175, 119, 22, 20, 37, 59, 88, 181, 196, 137, 124, 156, 48, 1, 53, 155, 62, 3, 165, 142, 193, 78, 0, 65, 68, 173, 117, 120, 30, 2, 46, 16, 176, 96, 101, 113, 189, 198, 118, 31, 29, 171, 61, 114, 75, 10, 67, 121, 145, 143, 43, 100, 187, 13, 83, 49, 154, 157, 21, 163, 64, 108, 87, 170, 123, 47, 172, 107, 188, 185, 11, 4, 104, 190, 40, 5, 164, 19, 45, 139, 93, 183, 72, 27, 98, 135, 58, 168, 144, 89, 116, 74, 102, 134, 15, 153, 151, 103, 97, 169, 105, 25, 194, 52, 179, 106, 136, 130, 51, 70, 81, 14, 24, 140, 132, 160, 86],
200 : [23, 119, 161, 146, 59, 89, 33, 144, 173, 45, 99, 81, 110, 115, 93, 114, 72, 17, 154, 56, 177, 25, 39, 164, 49, 122, 108, 127, 148, 195, 101, 147, 172, 125, 42, 145, 102, 31, 92, 80, 47, 65, 37, 41, 131, 140, 168, 52, 120, 112, 12, 62, 196, 83, 199, 136, 44, 153, 9, 176, 14, 43, 137, 34, 6, 178, 128, 88, 158, 113, 175, 27, 179, 38, 157, 8, 26, 13, 111, 60, 79, 29, 95, 74, 162, 171, 133, 55, 197, 85, 193, 71, 20, 187, 123, 1, 142, 174, 149, 156, 66, 87, 16, 5, 124, 107, 90, 46, 61, 135, 50, 4, 152, 51, 69, 191, 76, 151, 3, 183, 139, 190, 170, 182, 130, 15, 24, 86, 181, 103, 40, 189, 167, 116, 75, 163, 10, 198, 64, 118, 192, 117, 2, 77, 57, 70, 21, 18, 0, 194, 166, 138, 129, 185, 19, 169, 73, 54, 104, 36, 48, 91, 28, 98, 58, 109, 84, 134, 68, 106, 159, 186, 67, 96, 126, 165, 188, 150, 22, 63, 53, 184, 160, 94, 141, 132, 155, 180, 30, 97, 105, 82, 121, 32, 143, 11, 7, 100, 78, 35],
}
# print(data[4])
output_file = open("zipped_data.txt", "w")
lines = []
for i in range(4, 201):
this_str = ",".join(map(str, data[i]))
print(this_str)
lines.append(this_str)
lines.append("\n")
output_file.writelines(lines)
output_file.close()
# n = int(input())
# print(*(map(lambda x: x + 1, data[n])))
| 382.586667 | 901 | 0.510931 | 20,344 | 86,082 | 2.161571 | 0.011158 | 0.0005 | 0.000273 | 0.000182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.676316 | 0.247938 | 86,082 | 224 | 902 | 384.294643 | 0.00295 | 0.000825 | 0 | 0 | 0 | 0 | 0.000221 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.004808 | 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 |
39cd7761c53d35de2f08e137e2ae1c6a5176fe49 | 244 | py | Python | MyPortfolio/urls.py | samwendo/Portfolio | cf3580f5bbefc1f8d1814b602267f0051706ebf4 | [
"MIT"
] | 1 | 2020-01-05T18:35:57.000Z | 2020-01-05T18:35:57.000Z | MyPortfolio/urls.py | IreneMercy/MyWork | 629fb7ec085cddce649548c5b9c1a75a74e55ffc | [
"MIT"
] | 10 | 2020-06-06T00:35:37.000Z | 2022-02-10T09:37:19.000Z | MyPortfolio/urls.py | IreneMercy/MyWork | 629fb7ec085cddce649548c5b9c1a75a74e55ffc | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from . import views
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('',views.home, name="home"),
]
| 22.181818 | 51 | 0.762295 | 37 | 244 | 4.972973 | 0.432432 | 0.217391 | 0.163043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.143443 | 244 | 10 | 52 | 24.4 | 0.880383 | 0 | 0 | 0 | 0 | 0 | 0.016393 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.625 | 0 | 0.625 | 0 | 0 | 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 | 1 | 0 | 0 | 3 |
39d49a8558b4aab78ed55b7598852389e0650c4c | 768 | py | Python | tests.py | MichaelisTrofficus/hampel_filter | f8970569c847aeac6f24124116bfee9af09d5d3f | [
"MIT"
] | 10 | 2020-09-18T11:21:46.000Z | 2022-03-16T20:55:22.000Z | tests.py | MichaelisTrofficus/hampel_filter | f8970569c847aeac6f24124116bfee9af09d5d3f | [
"MIT"
] | 2 | 2021-02-22T16:07:49.000Z | 2021-06-08T15:04:55.000Z | tests.py | MichaelisTrofficus/hampel_filter | f8970569c847aeac6f24124116bfee9af09d5d3f | [
"MIT"
] | 3 | 2020-12-15T04:55:34.000Z | 2022-02-28T08:08:24.000Z | import pytest
import pandas as pd
from src.hampel import hampel
@pytest.fixture
def ts_data():
return pd.Series([1, 2, 1, 1, 40, 2, 1, 1, 30, 40, 1, 1, 2, 1])
def test_str_ts():
with pytest.raises(ValueError):
hampel("a", -1, 3)
def test_negative_window_size(ts_data):
with pytest.raises(ValueError):
hampel(ts_data, -1, 3)
def test_zero_window_size(ts_data):
with pytest.raises(ValueError):
hampel(ts_data, 0, 3)
def test_str_window_key(ts_data):
with pytest.raises(ValueError):
hampel(ts_data, "a", 3)
def test_negative_sigma(ts_data):
with pytest.raises(ValueError):
hampel(ts_data, 3, -1)
def test_str_sigma(ts_data):
with pytest.raises(ValueError):
hampel(ts_data, 1, "a")
| 19.692308 | 67 | 0.66276 | 123 | 768 | 3.926829 | 0.260163 | 0.136646 | 0.198758 | 0.322981 | 0.587992 | 0.521739 | 0.521739 | 0.521739 | 0.521739 | 0.430642 | 0 | 0.044408 | 0.208333 | 768 | 38 | 68 | 20.210526 | 0.75 | 0 | 0 | 0.25 | 0 | 0 | 0.003906 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.291667 | false | 0 | 0.125 | 0.041667 | 0.458333 | 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 |
39d9a0b3397e47691d341692af857702c8290df3 | 3,367 | py | Python | services/turn_commands.py | dev-11/mars-rover-challenge | 67569fcc4b93e5ec4cbe466d7a2fd5b3e9a316b0 | [
"MIT"
] | null | null | null | services/turn_commands.py | dev-11/mars-rover-challenge | 67569fcc4b93e5ec4cbe466d7a2fd5b3e9a316b0 | [
"MIT"
] | null | null | null | services/turn_commands.py | dev-11/mars-rover-challenge | 67569fcc4b93e5ec4cbe466d7a2fd5b3e9a316b0 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from services.command import Command
from data_objects import Rover
import copy
class TurnCommand(Command):
@abstractmethod
def get_cardinal_direction(self):
pass
@abstractmethod
def get_turning_direction(self):
pass
class TurnLeftCommand(TurnCommand):
def get_turning_direction(self):
return 'L'
class TurnRightCommand(TurnCommand):
def get_turning_direction(self):
return 'R'
class TurnLeftFromNorthCommand(TurnLeftCommand):
def get_cardinal_direction(self):
return 'N'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'W'
return updated_rover
class TurnLeftFromSouthCommand(TurnLeftCommand):
def get_cardinal_direction(self):
return 'S'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'E'
return updated_rover
class TurnLeftFromEastCommand(TurnLeftCommand):
def get_cardinal_direction(self):
return 'E'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'N'
return updated_rover
class TurnLeftFromWestCommand(TurnLeftCommand):
def get_cardinal_direction(self):
return 'W'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'S'
return updated_rover
class TurnRightFromNorthCommand(TurnRightCommand):
def get_cardinal_direction(self):
return 'N'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'E'
return updated_rover
class TurnRightFromSouthCommand(TurnRightCommand):
def get_cardinal_direction(self):
return 'S'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'W'
return updated_rover
class TurnRightFromEastCommand(TurnRightCommand):
def get_cardinal_direction(self):
return 'E'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'S'
return updated_rover
class TurnRightFromWestCommand(TurnRightCommand):
def get_cardinal_direction(self):
return 'W'
def execute(self, rover: Rover):
updated_rover = copy.copy(rover)
updated_rover.cardinal_direction = 'N'
return updated_rover
def get_turn_commands():
return [
# left commands
TurnLeftFromNorthCommand(),
TurnLeftFromWestCommand(),
TurnLeftFromEastCommand(),
TurnLeftFromSouthCommand(),
# right commands
TurnRightFromNorthCommand(),
TurnRightFromWestCommand(),
TurnRightFromEastCommand(),
TurnRightFromSouthCommand()
]
class TurnCommandSelector:
def __init__(self):
self._strategies = get_turn_commands()
def select(self, cardinal_direction: chr, turning_direction: chr):
return list(filter(lambda s: s.get_turning_direction() == turning_direction
and s.get_cardinal_direction() == cardinal_direction,
self._strategies))[0]
| 24.223022 | 90 | 0.67924 | 334 | 3,367 | 6.622754 | 0.155689 | 0.130199 | 0.122966 | 0.09358 | 0.606239 | 0.582278 | 0.582278 | 0.487342 | 0.487342 | 0.487342 | 0 | 0.000393 | 0.24354 | 3,367 | 138 | 91 | 24.398551 | 0.86808 | 0.008316 | 0 | 0.615385 | 0 | 0 | 0.005396 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.252747 | false | 0.021978 | 0.043956 | 0.131868 | 0.648352 | 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 |
39ef2f5ab25dc3aa6af35fd9e28fb38c21fbadef | 308 | py | Python | src/medium_to_various/docjson_utils.py | nuuuwan/medium_to_various | acb3006efaf581e87d651f232434ebec6ee83062 | [
"MIT"
] | null | null | null | src/medium_to_various/docjson_utils.py | nuuuwan/medium_to_various | acb3006efaf581e87d651f232434ebec6ee83062 | [
"MIT"
] | null | null | null | src/medium_to_various/docjson_utils.py | nuuuwan/medium_to_various | acb3006efaf581e87d651f232434ebec6ee83062 | [
"MIT"
] | null | null | null | from utils import jsonx
def docjson_merge(docjson_files, merged_docjson_file):
all_docjson = []
for docjson_file in docjson_files:
docjson = jsonx.read(docjson_file)
all_docjson += docjson
jsonx.write(merged_docjson_file, all_docjson)
print(f'Wrote {merged_docjson_file}')
| 25.666667 | 54 | 0.730519 | 41 | 308 | 5.146341 | 0.439024 | 0.260664 | 0.241706 | 0.298578 | 0.255924 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.191558 | 308 | 11 | 55 | 28 | 0.84739 | 0 | 0 | 0 | 0 | 0 | 0.087662 | 0.068182 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0 | 0.25 | 0.125 | 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 |
39f2b73d146555b96002c0664cd8ba152cf72208 | 442 | py | Python | model/loss.py | jinchenglee/pytorch-visual-perception | b23484fd4f1bc9bb91297c256e3159d38a5fe2ea | [
"MIT"
] | null | null | null | model/loss.py | jinchenglee/pytorch-visual-perception | b23484fd4f1bc9bb91297c256e3159d38a5fe2ea | [
"MIT"
] | null | null | null | model/loss.py | jinchenglee/pytorch-visual-perception | b23484fd4f1bc9bb91297c256e3159d38a5fe2ea | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
def nll_loss(output, target):
# Convert to datatype that avoid runtime error:
# Expected object of type torch.cuda.LongTensor but found type torch.cuda.FloatTensor for argument #2 'target'
target_as_LongTensor = target.type(torch.cuda.LongTensor)
return F.nll_loss(output, target_as_LongTensor)
def bce_loss(output, target):
return F.binary_cross_entropy(output, target)
| 31.571429 | 116 | 0.766968 | 65 | 442 | 5.076923 | 0.538462 | 0.145455 | 0.145455 | 0.115152 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002681 | 0.156109 | 442 | 13 | 117 | 34 | 0.882038 | 0.350679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.285714 | 0.142857 | 0.857143 | 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 |
f2ce53a4a9790995b8079327d1ab1d69526c77c1 | 44 | py | Python | generators/__init__.py | kenetec/dlish | b37e87f431edf98dbd3f2500dc843a22bc9d71f1 | [
"MIT"
] | 2 | 2019-11-18T04:47:29.000Z | 2020-11-06T04:11:26.000Z | generators/__init__.py | kenetec/dlish | b37e87f431edf98dbd3f2500dc843a22bc9d71f1 | [
"MIT"
] | null | null | null | generators/__init__.py | kenetec/dlish | b37e87f431edf98dbd3f2500dc843a22bc9d71f1 | [
"MIT"
] | 1 | 2020-11-06T04:11:32.000Z | 2020-11-06T04:11:32.000Z | __all__ = ['unitg', 'strg', 'listg', 'intg'] | 44 | 44 | 0.568182 | 5 | 44 | 4.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113636 | 44 | 1 | 44 | 44 | 0.538462 | 0 | 0 | 0 | 0 | 0 | 0.4 | 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 |
f2d07c3609fcf236a1cb897c61c85d32f7554c61 | 4,436 | py | Python | curtir.py | mestrecalendo/Instebot | 50bf902691be47fa6a3c3adc5fcd51af58df30cd | [
"MIT"
] | 1 | 2021-05-15T14:31:15.000Z | 2021-05-15T14:31:15.000Z | curtir.py | mestrecalendo/Instebot | 50bf902691be47fa6a3c3adc5fcd51af58df30cd | [
"MIT"
] | null | null | null | curtir.py | mestrecalendo/Instebot | 50bf902691be47fa6a3c3adc5fcd51af58df30cd | [
"MIT"
] | 1 | 2021-05-04T09:31:17.000Z | 2021-05-04T09:31:17.000Z | # Generated by Selenium IDE
import pytest
import time
from time import sleep
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
ref_arquivo = open("users.txt","r")
valores = ref_arquivo.readlines()
perfil1 = valores[0].split(',')
perfil2 = valores[1].split(',')
perfil = [perfil1[0],perfil2[0]]
senha = [perfil1[1],perfil2[1]]
class TestDefaultSuite():
def setup_method(self, method):
self.driver = webdriver.Chrome('C:/Users/Calendoscopio/Desktop/Instebot/chromedriver/chromedriver.exe')
self.driver.maximize_window()
self.vars = {}
def teardown_method(self, method):
self.driver.quit()
def wait_for_window(self,timeout = 2):
time.sleep(round(2/1000))
wh_now = self.driver.window_handles
wh_then = self.vars["window_handles"]
if len(wh_now) > len(wh_then):
return set(wh_now).difference(set(wh_then)).pop()
def test_aaaaaaaa(self):
self.driver.get("https://instelikes.com.br/")
self.driver.find_element(By.LINK_TEXT, "Entrar").click()
self.driver.find_element(By.NAME, "email").click()
self.driver.find_element(By.NAME, "email").send_keys(perfil1[0])
self.driver.find_element(By.NAME, "email").send_keys(Keys.ENTER)
sleep(5)
self.driver.find_element(By.NAME, "password").click()
self.driver.find_element(By.NAME, "password").send_keys(perfil1[1])
self.driver.find_element(By.NAME, "password").send_keys(Keys.ENTER)
sleep(3)
self.driver.find_element(By.CSS_SELECTOR, ".icon-menu > li:nth-child(2) svg").click()
sleep(5)
self.driver.find_element(By.CSS_SELECTOR, "body > main > x-active-template > div > div > div.requests-wrapper > form > div > div > div.select-box").click()
sleep(3)
self.driver.find_element(By.CSS_SELECTOR, ".option-row:nth-child(4) > .has-custom-validation").click()
self.driver.find_element(By.CSS_SELECTOR, ".is-sm").click()
sleep(3)
if self.driver.find_element(By.XPATH, "/html/body/main/x-active-template/div/div/div[2]/div/div[1]/div/div[3]/div/div[1]/div/span[1]").text != "Curtir":
print(self.driver.find_element(By.XPATH, "/html/body/main/x-active-template/div/div/div[2]/div/div[1]/div/div[3]/div/div[1]/div/span[1]").text)
else:
pass
sleep(5)
self.vars["window_handles"] = self.driver.window_handles
self.driver.find_element(By.CSS_SELECTOR, ".column:nth-child(3) .button").click()
self.vars["win9368"] = self.wait_for_window(2000)
element = self.driver.find_element(By.CSS_SELECTOR, ".column:nth-child(3) .button")
actions = ActionChains(self.driver)
actions.move_to_element(element).perform()
element = self.driver.find_element(By.CSS_SELECTOR, "body")
sleep(5)
actions = ActionChains(self.driver)
#actions.move_to_element(element, 0, 0).perform()
self.vars["root"] = self.driver.current_window_handle
self.driver.switch_to.window(self.vars["win9368"])
self.driver.execute_script("window.scrollTo(0, 160)")
sleep(5)
#self.driver.execute_script("document.body.style.zoom='95%'")
self.driver.find_element(By.CSS_SELECTOR, ".QBdPU > span > .\\_8-yf5").click()
#self.driver.find_element(By.CSS_SELECTOR, "p > .sqdOP:nth-child(1)").click()
self.driver.find_element(By.NAME, "username").click()
self.driver.find_element(By.NAME, "username").send_keys(perfil1[0])
self.driver.find_element(By.NAME, "password").send_keys(perfil1[1])
self.driver.find_element(By.NAME, "password").send_keys(Keys.ENTER)
sleep(4)
self.driver.execute_script('document.querySelector("#react-root > section > main > div > div > div > div > button").click()')
sleep(6)
self.driver.execute_script("window.scrollTo(0, 140)")
self.driver.find_element(By.CSS_SELECTOR, ".fr66n .\\_8-yf5").click()
self.driver.close()
self.driver.switch_to.window(self.vars["root"])
self.driver.find_element(By.LINK_TEXT, "Confirmar").click()
try:
robot1 = TestDefaultSuite()
except Exception as e:
raise print('Algo deu Errado ao iniciar, cheque sua conexão')
robot1.setup_method('')
robot1.test_aaaaaaaa()
robot1.wait_for_window('')
| 43.490196 | 159 | 0.717087 | 645 | 4,436 | 4.80155 | 0.272868 | 0.129157 | 0.108492 | 0.162738 | 0.524701 | 0.469164 | 0.469164 | 0.365192 | 0.262512 | 0.187601 | 0 | 0.021789 | 0.120604 | 4,436 | 101 | 160 | 43.920792 | 0.77211 | 0.047115 | 0 | 0.162791 | 1 | 0.046512 | 0.216011 | 0.079583 | 0 | 0 | 0 | 0 | 0 | 1 | 0.046512 | false | 0.069767 | 0.127907 | 0 | 0.197674 | 0.023256 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
8411d7a4f3d1235eea9b00611e4db9e01c554c4d | 230 | py | Python | aschedule/__init__.py | eightnoteight/aschedule | f2e201a425f8b214bd76fc4eb715f1c4632d37e4 | [
"MIT"
] | 25 | 2016-09-06T22:51:23.000Z | 2017-11-26T08:52:52.000Z | aschedule/__init__.py | eightnoteight/aschedule | f2e201a425f8b214bd76fc4eb715f1c4632d37e4 | [
"MIT"
] | null | null | null | aschedule/__init__.py | eightnoteight/aschedule | f2e201a425f8b214bd76fc4eb715f1c4632d37e4 | [
"MIT"
] | 5 | 2016-09-10T15:11:50.000Z | 2021-10-30T17:53:48.000Z | # -*- coding: utf-8 -*-
from .api import every, once_at, cancel, \
JobSchedule, ScheduleManager, AScheduleException
__all__ = ['every', 'once_at', 'cancel',
'ScheduleManager', 'JobSchedule', 'AScheduleException']
| 28.75 | 66 | 0.669565 | 21 | 230 | 7.047619 | 0.666667 | 0.121622 | 0.148649 | 0.22973 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005263 | 0.173913 | 230 | 7 | 67 | 32.857143 | 0.773684 | 0.091304 | 0 | 0 | 0 | 0 | 0.299517 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 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 |
84178a0ece7f70b8a176b3ad1fcbafd91f457b19 | 422 | py | Python | kubails/conftest.py | DevinSit/kubails | b3b2f9487d815868f0fbe9fae649789a40b50ad8 | [
"MIT"
] | 2 | 2019-05-28T00:26:52.000Z | 2019-08-02T23:02:19.000Z | kubails/conftest.py | DevinSit/kubails | b3b2f9487d815868f0fbe9fae649789a40b50ad8 | [
"MIT"
] | 51 | 2019-12-23T04:34:40.000Z | 2022-02-12T02:28:44.000Z | kubails/conftest.py | DevinSit/kubails | b3b2f9487d815868f0fbe9fae649789a40b50ad8 | [
"MIT"
] | 1 | 2019-09-11T20:12:18.000Z | 2019-09-11T20:12:18.000Z | """
The first-run configuration file for PyTest. PyTest runs the code in this file before any tests.
So far, this is just used to set a flag so that code can check whether or not it's running in a test
(used to disable the file logger when testing).
For more information about conftest.py, see https://docs.pytest.org/en/2.7.3/plugins.html.
"""
import sys
def pytest_configure(config):
sys._called_from_test = True
| 32.461538 | 100 | 0.755924 | 77 | 422 | 4.090909 | 0.779221 | 0.038095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008523 | 0.165877 | 422 | 12 | 101 | 35.166667 | 0.886364 | 0.796209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
8418518d67edf447bd7d5341ac0226540ad97dfd | 355 | py | Python | thinker/core/questionscreator/creatormodquestion.py | julianandres-eb/guess-number | 8807674858d76b0ed28c2279eb387a1ea979ffe2 | [
"MIT"
] | null | null | null | thinker/core/questionscreator/creatormodquestion.py | julianandres-eb/guess-number | 8807674858d76b0ed28c2279eb387a1ea979ffe2 | [
"MIT"
] | null | null | null | thinker/core/questionscreator/creatormodquestion.py | julianandres-eb/guess-number | 8807674858d76b0ed28c2279eb387a1ea979ffe2 | [
"MIT"
] | 1 | 2019-11-22T19:11:43.000Z | 2019-11-22T19:11:43.000Z | from thinker.model.question.questionmod import QuestionMod
from .questioncreator import QuestionCreator
class CreatorModQuestion(QuestionCreator):
# Override the factory method to return an instance of a
# QuestionMod.
def _createQuestion(self, values):
return QuestionMod(values['value'], [], values['key'], values['reiterable'])
| 29.583333 | 84 | 0.752113 | 37 | 355 | 7.189189 | 0.702703 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15493 | 355 | 11 | 85 | 32.272727 | 0.886667 | 0.188732 | 0 | 0 | 0 | 0 | 0.063158 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0.2 | 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 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
8436d482e0c537f2d87398e23e165433053c2929 | 1,331 | py | Python | create_tournament_directory.py | greent12/major_pool | c529d6fd35f5533ebcb96d3bf73a573e2578e960 | [
"MIT"
] | null | null | null | create_tournament_directory.py | greent12/major_pool | c529d6fd35f5533ebcb96d3bf73a573e2578e960 | [
"MIT"
] | null | null | null | create_tournament_directory.py | greent12/major_pool | c529d6fd35f5533ebcb96d3bf73a573e2578e960 | [
"MIT"
] | null | null | null | import os
import sys
def create_dir(tournament_name,output_dir):
#Replace spaces with underscores for file naming
tournament_name=tournament_name.replace(" ","_")
#Replace any & with nothing
tournament_name=tournament_name.replace("&","")
#See if output_dir directory exists, if not, exit
if not os.path.isdir(output_dir):
print("'Output Directory' in 'inputs.txt' does not exist")
sys.exit()
#See if tournament directory exists, if not create it
if not os.path.isdir(output_dir+"/"+tournament_name):
print("Directory for tournament: {} has not been created yet, creating now".format(tournament_name))
os.mkdir(output_dir+"/"+tournament_name)
#Create subdirectories for tracking the scores,keeping the entries, and tracking the competion between entries
if not os.path.isdir(output_dir+"/"+tournament_name+"/scores"):
os.mkdir(output_dir+"/"+tournament_name+"/scores")
if not os.path.isdir(output_dir+"/"+tournament_name+"/entries"):
os.mkdir(output_dir+"/"+tournament_name+"/entries")
if not os.path.isdir(output_dir+"/"+tournament_name+"/pool_results"):
os.mkdir(output_dir+"/"+tournament_name+"/pool_results")
#tournament directory path
tournament_dir=output_dir+"/"+tournament_name
return tournament_name, tournament_dir
| 36.972222 | 113 | 0.722765 | 179 | 1,331 | 5.184358 | 0.296089 | 0.241379 | 0.18319 | 0.22306 | 0.459052 | 0.363147 | 0.210129 | 0.18319 | 0.18319 | 0.099138 | 0 | 0 | 0.152517 | 1,331 | 35 | 114 | 38.028571 | 0.822695 | 0.231405 | 0 | 0 | 0 | 0 | 0.18146 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.052632 | false | 0 | 0.105263 | 0 | 0.210526 | 0.105263 | 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 |
845cda7de4ff11c3557bc7b0dfedd1f233ba8091 | 359 | py | Python | unique_chars_problem/test_unique_chars.py | MichaelLenghel/Python-Algorithm-Problems | 604be4cb20434108284b00303d2ed3c1cdf1a871 | [
"MIT"
] | null | null | null | unique_chars_problem/test_unique_chars.py | MichaelLenghel/Python-Algorithm-Problems | 604be4cb20434108284b00303d2ed3c1cdf1a871 | [
"MIT"
] | null | null | null | unique_chars_problem/test_unique_chars.py | MichaelLenghel/Python-Algorithm-Problems | 604be4cb20434108284b00303d2ed3c1cdf1a871 | [
"MIT"
] | null | null | null | import unittest
import unique_chars as uc
class test_str_compression(unittest.TestCase):
def test_sentence_reversal(self):
self.assertEqual(uc.uni_chars(''), True)
self.assertEqual(uc.uni_chars('goo'), False)
self.assertEqual(uc.uni_chars('abcdefg'), True)
print("ALL TEST CASES PASSED")
if __name__ == '__main__':
unittest.main()
| 25.642857 | 50 | 0.724234 | 48 | 359 | 5.083333 | 0.583333 | 0.184426 | 0.209016 | 0.245902 | 0.307377 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147632 | 359 | 13 | 51 | 27.615385 | 0.797386 | 0 | 0 | 0 | 0 | 0 | 0.113043 | 0 | 0 | 0 | 0 | 0 | 0.3 | 1 | 0.1 | false | 0.1 | 0.2 | 0 | 0.4 | 0.1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
ffc19f97add2455e05c53f32f7216ba8dd96434e | 411 | py | Python | users/forms.py | jobscry/vz-blog | de968541a0412d5ce8f09c1ba638261a9f9151f1 | [
"MIT"
] | 3 | 2016-01-29T09:31:15.000Z | 2016-05-08T19:33:23.000Z | users/forms.py | jobscry/vz-blog | de968541a0412d5ce8f09c1ba638261a9f9151f1 | [
"MIT"
] | null | null | null | users/forms.py | jobscry/vz-blog | de968541a0412d5ce8f09c1ba638261a9f9151f1 | [
"MIT"
] | null | null | null | # -*- mode: python; coding: utf-8; -*-
from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm
from models import Profile
class UserForm(ModelForm):
class Meta:
model = User
fields = [ 'first_name', 'last_name', 'email']
class LoginForm(forms.Form):
username = forms.CharField(max_length=255)
password = forms.CharField(widget=forms.PasswordInput)
| 27.4 | 58 | 0.742092 | 54 | 411 | 5.592593 | 0.62963 | 0.099338 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011364 | 0.143552 | 411 | 14 | 59 | 29.357143 | 0.846591 | 0.087591 | 0 | 0 | 0 | 0 | 0.064343 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.090909 | 0.363636 | 0 | 0.818182 | 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 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
ffdd2ae09376fdceea4a7c7c3dc66401a31414f9 | 2,279 | py | Python | examples/logistic_example.py | Yangruipis/simple_ml | 09657f6b017b973a5201aa611774d6ac8f0fc0a2 | [
"MIT"
] | 25 | 2018-04-17T04:38:51.000Z | 2021-10-09T04:07:53.000Z | examples/logistic_example.py | Yangruipis/simple_ml | 09657f6b017b973a5201aa611774d6ac8f0fc0a2 | [
"MIT"
] | null | null | null | examples/logistic_example.py | Yangruipis/simple_ml | 09657f6b017b973a5201aa611774d6ac8f0fc0a2 | [
"MIT"
] | 5 | 2018-04-17T05:27:00.000Z | 2020-12-01T02:55:15.000Z | # -*- coding:utf-8 -*-
from simple_ml.logistic import *
from simple_ml.classify_data import *
from simple_ml.data_handle import train_test_split
def iris_example():
x, y = get_iris()
x = x[(y==0)|(y==1)]
y = y[(y==0)|(y==1)]
x_train, y_train, x_test, y_test = train_test_split(x, y, 0.3, 918)
logistic = LogisticRegression()
logistic.fit(x_train, y_train)
print(logistic.w)
logistic.predict(x_test)
logistic.score(x_test, y_test)
logistic.classify_plot(x_test, y_test)
logistic.auc_plot(x_test, y_test)
lasso = Lasso()
lasso.fit(x_train, y_train)
print(lasso.w)
lasso.predict(x_test)
lasso.score(x_test, y_test)
lasso.classify_plot(x_test, y_test)
ridge = Ridge()
ridge.fit(x_train, y_train)
print(ridge.w)
ridge.predict(x_test)
ridge.score(x_test, y_test)
ridge.classify_plot(x_test, y_test)
def wine_example():
x, y = get_wine()
x = x[(y==0)|(y==1)]
y = y[(y==0)|(y==1)]
x_train, y_train, x_test, y_test = train_test_split(x, y, 0.5, 918)
logistic = LogisticRegression(has_intercept=True)
logistic.fit(x_train, y_train)
logistic.score(x_test, y_test)
print(logistic.w)
logistic.classify_plot(x_test, y_test)
logistic.auc_plot(x_test, y_test)
lasso = Lasso()
lasso.fit(x_train, y_train)
print(lasso.w)
lasso.classify_plot(x_test, y_test)
lasso.auc_plot(x_test, y_test)
ridge = Ridge()
ridge.fit(x_train, y_train)
print(ridge.w)
ridge.classify_plot(x_test, y_test)
ridge.auc_plot(x_test, y_test)
def multi_class_example():
x, y = get_wine()
x_train, y_train, x_test, y_test = train_test_split(x, y, 0.5, 918)
logistic = LogisticRegression(has_intercept=True)
logistic.fit(x_train, y_train)
print(logistic.predict(x_test))
logistic.classify_plot(x_test, y_test)
logistic = Lasso(has_intercept=True)
logistic.fit(x_train, y_train)
print(logistic.predict(x_test))
logistic.classify_plot(x_test, y_test)
logistic = Ridge(has_intercept=True)
logistic.fit(x_train, y_train)
print(logistic.predict(x_test))
logistic.classify_plot(x_test, y_test)
if __name__ == '__main__':
iris_example()
# wine_example()
# multi_class_example()
| 26.5 | 71 | 0.678368 | 371 | 2,279 | 3.846361 | 0.118598 | 0.0911 | 0.084093 | 0.140154 | 0.801682 | 0.766643 | 0.693062 | 0.630694 | 0.605466 | 0.602663 | 0 | 0.01298 | 0.188679 | 2,279 | 85 | 72 | 26.811765 | 0.758789 | 0.025011 | 0 | 0.692308 | 0 | 0 | 0.003607 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.046154 | false | 0 | 0.046154 | 0 | 0.092308 | 0.138462 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ffeb62d8d34baec43c3c55c9ffe34779d40da1e1 | 575 | py | Python | bin/contentctl_project/contentctl_core/application/builder/basic_builder.py | arjunkhunti-crest/security_content | 41e354485e5917d3366ef735a9c5b25a20d3b8cc | [
"Apache-2.0"
] | null | null | null | bin/contentctl_project/contentctl_core/application/builder/basic_builder.py | arjunkhunti-crest/security_content | 41e354485e5917d3366ef735a9c5b25a20d3b8cc | [
"Apache-2.0"
] | null | null | null | bin/contentctl_project/contentctl_core/application/builder/basic_builder.py | arjunkhunti-crest/security_content | 41e354485e5917d3366ef735a9c5b25a20d3b8cc | [
"Apache-2.0"
] | null | null | null | import abc
from bin.contentctl_project.contentctl_core.domain.entities.security_content_object import SecurityContentObject
from bin.contentctl_project.contentctl_core.domain.entities.enums.enums import SecurityContentType
# https://refactoring.guru/design-patterns/builder
class BasicBuilder(abc.ABC):
@abc.abstractmethod
def setObject(self, path: str, type: SecurityContentType) -> None:
pass
@abc.abstractmethod
def reset(self) -> None:
pass
@abc.abstractmethod
def getObject(self) -> SecurityContentObject:
pass
| 26.136364 | 112 | 0.751304 | 62 | 575 | 6.870968 | 0.548387 | 0.119718 | 0.140845 | 0.112676 | 0.375587 | 0.244131 | 0.244131 | 0.244131 | 0 | 0 | 0 | 0 | 0.165217 | 575 | 22 | 113 | 26.136364 | 0.8875 | 0.083478 | 0 | 0.461538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0.230769 | 0.230769 | 0 | 0.538462 | 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 |
0802c74f59358f2a9c6ac527c91777a51c3bbd18 | 83 | py | Python | NewtonSchool/contest/Newton_coding_challenge_June_2021/b.py | Akash671/Algorithms | f71be624bc49e686087c8dd22a09b9cf343b0634 | [
"MIT"
] | 1 | 2021-03-25T18:29:07.000Z | 2021-03-25T18:29:07.000Z | NewtonSchool/contest/Newton_coding_challenge_June_2021/b.py | Akash671/Algorithms | f71be624bc49e686087c8dd22a09b9cf343b0634 | [
"MIT"
] | null | null | null | NewtonSchool/contest/Newton_coding_challenge_June_2021/b.py | Akash671/Algorithms | f71be624bc49e686087c8dd22a09b9cf343b0634 | [
"MIT"
] | null | null | null | # Your code here
s=str(input())
n=len(s)
for i in range(n):
print(s[0],end="")
| 13.833333 | 22 | 0.578313 | 18 | 83 | 2.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014706 | 0.180723 | 83 | 5 | 23 | 16.6 | 0.691176 | 0.168675 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
080c8d15c20c003e6bb2c00a137f7b806c8405b7 | 54 | py | Python | 1016.py | Mateusfmelo/Uri-Python | ca61ea23d1dbf99db3776206da91af7b054beea2 | [
"MIT"
] | null | null | null | 1016.py | Mateusfmelo/Uri-Python | ca61ea23d1dbf99db3776206da91af7b054beea2 | [
"MIT"
] | null | null | null | 1016.py | Mateusfmelo/Uri-Python | ca61ea23d1dbf99db3776206da91af7b054beea2 | [
"MIT"
] | null | null | null | car = int(input())
print('{} minutos'.format(car * 2)) | 27 | 35 | 0.611111 | 8 | 54 | 4.125 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020833 | 0.111111 | 54 | 2 | 35 | 27 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
080d55a605dcc1a9361091d13fda9af59583d0cc | 3,490 | py | Python | S4/S4 Library/simulation/bucks/bucks_utils.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Library/simulation/bucks/bucks_utils.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Library/simulation/bucks/bucks_utils.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | from bucks.bucks_enums import BucksType, BucksTrackerType
import services
from sims4.localization import TunableLocalizedStringFactory
from sims4.tuning.tunable import TunableMapping, TunableEnumEntry, TunableTuple, OptionalTunable, TunableEnumSet, TunableReference
from sims4.tuning.tunable_base import ExportModes, EnumBinaryExportType
import sims4
class BucksUtils:
BUCK_TYPE_TO_TRACKER_MAP = TunableMapping(description='\n Maps a buck type to the tracker that uses that bucks type.\n ', key_type=TunableEnumEntry(tunable_type=BucksType, default=BucksType.INVALID, invalid_enums=BucksType.INVALID, pack_safe=True), key_name='Bucks Type', value_type=BucksTrackerType, value_name='Bucks Tracker')
BUCK_TYPE_TO_DISPLAY_DATA = TunableMapping(description='\n For each supplied Bucks, a set of UI display data to be used when displaying\n information related to this bucks in the UI.\n ', key_type=TunableEnumEntry(tunable_type=BucksType, default=BucksType.INVALID, invalid_enums=BucksType.INVALID, pack_safe=True), key_name='Bucks Type', value_type=TunableTuple(description='\n A set of UI display data for one bucks type.\n ', ui_name=TunableLocalizedStringFactory(), cost_string=OptionalTunable(description='\n Format for displaying interaction names on interactions that\n have this buck as a cost. 0.String is the interaction name. 1 will be the the cost\n amount.\n ', tunable=TunableLocalizedStringFactory()), gain_string=OptionalTunable(description='\n Format for displaying interaction names on interactions that\n have this buck as a gain. 0.String is the interaction name. 1 will be the the gain\n amount.\n ', tunable=TunableLocalizedStringFactory()), headline=OptionalTunable(description='\n If enabled when this buck updates we will display\n a headline update to the UI for selectable sims.\n ', tunable=TunableReference(description='\n The headline that we want to send down.\n ', manager=services.get_instance_manager(sims4.resources.Types.HEADLINE)))), value_name='Bucks UI Data')
WALLET_BUCK_TYPES = TunableEnumSet(description='\n A list of buck types whose values will be displayed in the wallet\n tooltip.\n ', enum_type=BucksType, invalid_enums=BucksType.INVALID, pack_safe=True, export_modes=ExportModes.ClientBinary, binary_type=EnumBinaryExportType.EnumUint32)
@classmethod
def get_tracker_for_bucks_type(cls, bucks_type, owner_id=None, add_if_none=False):
bucks_tracker_type = BucksUtils.BUCK_TYPE_TO_TRACKER_MAP.get(bucks_type)
if owner_id is None or bucks_tracker_type == BucksTrackerType.HOUSEHOLD:
active_household = services.active_household()
return active_household.bucks_tracker
if bucks_tracker_type == BucksTrackerType.CLUB:
club_service = services.get_club_service()
if club_service is None:
return
club = club_service.get_club_by_id(owner_id)
if club is not None:
return club.bucks_tracker
elif bucks_tracker_type == BucksTrackerType.SIM:
sim_info = services.sim_info_manager().get(owner_id)
if sim_info is not None:
return sim_info.get_bucks_tracker(add_if_none=add_if_none)
| 116.333333 | 1,547 | 0.716905 | 441 | 3,490 | 5.482993 | 0.276644 | 0.039702 | 0.016543 | 0.034739 | 0.320099 | 0.283706 | 0.243176 | 0.226634 | 0.226634 | 0.226634 | 0 | 0.004018 | 0.215473 | 3,490 | 29 | 1,548 | 120.344828 | 0.879109 | 0 | 0 | 0 | 0 | 0.148148 | 0.32235 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.037037 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
0811e33789ca4803f91b450edf3705c75e496328 | 603 | py | Python | examples/models.py | ResolveWang/minifw | 0de182c3e880a5e747c5ebe51a430db74f8ac68c | [
"MIT"
] | null | null | null | examples/models.py | ResolveWang/minifw | 0de182c3e880a5e747c5ebe51a430db74f8ac68c | [
"MIT"
] | null | null | null | examples/models.py | ResolveWang/minifw | 0de182c3e880a5e747c5ebe51a430db74f8ac68c | [
"MIT"
] | null | null | null | import time
import uuid
from minifw.db.orm import Model, StringField, BooleanField, FloatField, TextField
def next_id():
return '%015d%s000' % (int(time.time() * 1000), uuid.uuid4().hex)
class User(Model):
__table__ = 'users'
id = StringField(primary_key=True, default=next_id, column_type='varchar(50)')
email = StringField(column_type='varchar(50)')
passwd = StringField(column_type='varchar(50)')
admin = BooleanField()
name = StringField(column_type='varchar(50)')
image = StringField(column_type='varchar(500)')
created_at = FloatField(default=time.time)
| 27.409091 | 82 | 0.706468 | 76 | 603 | 5.434211 | 0.552632 | 0.121065 | 0.205811 | 0.184019 | 0.217918 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043053 | 0.15257 | 603 | 21 | 83 | 28.714286 | 0.765166 | 0 | 0 | 0 | 0 | 0 | 0.118136 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0.071429 | 0.214286 | 0.071429 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
0827238c9cf11d1569333ef977255d36866cab1c | 12,161 | py | Python | simpa/core/device_digital_twins/detection_geometries/ithera_invision_array.py | jgroehl/simpa | e56f0802e5a8555ee8bb139dd4f776025e7e9267 | [
"MIT"
] | 1 | 2021-11-12T22:45:06.000Z | 2021-11-12T22:45:06.000Z | simpa/core/device_digital_twins/detection_geometries/ithera_invision_array.py | jgroehl/simpa | e56f0802e5a8555ee8bb139dd4f776025e7e9267 | [
"MIT"
] | null | null | null | simpa/core/device_digital_twins/detection_geometries/ithera_invision_array.py | jgroehl/simpa | e56f0802e5a8555ee8bb139dd4f776025e7e9267 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 Computer Assisted Medical Interventions Group, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
import numpy as np
from simpa.core.device_digital_twins import DetectionGeometryBase
from simpa.utils import Tags
class iTheraInvision256TFDetectionGeometry(DetectionGeometryBase):
"""
This class represents a digital twin of a ultrasound detection device
with a curved detection geometry. The origin for this device is the center (focus) of the curved array.
"""
def __init__(self,
device_position_mm=None,
field_of_view_extent_mm=None):
"""
:param pitch_mm: In-plane distance between the beginning of one detector element to the next detector element.
:param radius_mm:
:param number_detector_elements:
:param detector_element_width_mm:
:param detector_element_length_mm:
:param center_frequency_hz:
:param bandwidth_percent:
:param sampling_frequency_mhz:
:param angular_origin_offset:
:param device_position_mm: Center (focus) of the curved array.
"""
super(iTheraInvision256TFDetectionGeometry, self).__init__(
number_detector_elements=256,
detector_element_width_mm=0.635,
detector_element_length_mm=15,
center_frequency_hz=5e6,
bandwidth_percent=55,
sampling_frequency_mhz=40,
device_position_mm=device_position_mm)
self.positions = (np.asarray([[0.02890019, -0.02837304, 0.],
[0.02941755, -0.02783627, 0.],
[0.02992494, -0.02729007, 0.],
[0.03042219, -0.02673463, 0.],
[0.03090913, -0.02617013, 0.],
[0.0313856, -0.02559676, 0.],
[0.03185144, -0.02501472, 0.],
[0.03230648, -0.0244242, 0.],
[0.03275058, -0.0238254, 0.],
[0.03318357, -0.02321854, 0.],
[0.03360533, -0.0226038, 0.],
[0.0340157, -0.02198141, 0.],
[0.03441454, -0.02135156, 0.],
[0.03480172, -0.02071449, 0.],
[0.03517711, -0.02007039, 0.],
[0.03554058, -0.0194195, 0.],
[0.03589201, -0.01876202, 0.],
[0.03623128, -0.01809819, 0.],
[0.03655827, -0.01742822, 0.],
[0.03687287, -0.01675235, 0.],
[0.03717498, -0.0160708, 0.],
[0.03746449, -0.01538381, 0.],
[0.03774131, -0.01469161, 0.],
[0.03800534, -0.01399442, 0.],
[0.0382565, -0.0132925, 0.],
[0.03849469, -0.01258607, 0.],
[0.03871983, -0.01187538, 0.],
[0.03893186, -0.01116066, 0.],
[0.0391307, -0.01044216, 0.],
[0.03931627, -0.00972012, 0.],
[0.03948853, -0.00899479, 0.],
[0.0396474, -0.00826641, 0.],
[0.03979284, -0.00753523, 0.],
[0.0399248, -0.0068015, 0.],
[0.04004323, -0.00606546, 0.],
[0.04014809, -0.00532737, 0.],
[0.04023935, -0.00458747, 0.],
[0.04031697, -0.00384602, 0.],
[0.04038093, -0.00310327, 0.],
[0.04043121, -0.00235946, 0.],
[0.04046779, -0.00161485, 0.],
[0.04049066, -0.0008697, 0.],
[0.04049981, -0.00012425, 0.],
[0.04049524, 0.00062124, 0.],
[0.04047694, 0.00136652, 0.],
[0.04044493, 0.00211133, 0.],
[0.04039921, 0.00285544, 0.],
[0.04033981, 0.00359857, 0.],
[0.04026674, 0.00434048, 0.],
[0.04018002, 0.00508093, 0.],
[0.04007969, 0.00581965, 0.],
[0.03996578, 0.0065564, 0.],
[0.03983833, 0.00729093, 0.],
[0.03969738, 0.00802299, 0.],
[0.03954297, 0.00875233, 0.],
[0.03937517, 0.0094787, 0.],
[0.03919403, 0.01020186, 0.],
[0.03899961, 0.01092157, 0.],
[0.03879197, 0.01163757, 0.],
[0.03857119, 0.01234963, 0.],
[0.03833734, 0.01305751, 0.],
[0.0380905, 0.01376096, 0.],
[0.03783075, 0.01445975, 0.],
[0.03755818, 0.01515364, 0.],
[0.03727289, 0.0158424, 0.],
[0.03697497, 0.01652579, 0.],
[0.03666452, 0.01720358, 0.],
[0.03634165, 0.01787554, 0.],
[0.03600646, 0.01854144, 0.],
[0.03565907, 0.01920106, 0.],
[0.0352996, 0.01985417, 0.],
[0.03492817, 0.02050056, 0.],
[0.0345449, 0.02114, 0.],
[0.03414993, 0.02177228, 0.],
[0.03374339, 0.02239718, 0.],
[0.03332542, 0.02301449, 0.],
[0.03289615, 0.023624, 0.],
[0.03245573, 0.02422551, 0.],
[0.03200432, 0.02481881, 0.],
[0.03154207, 0.0254037, 0.],
[0.03106913, 0.02597998, 0.],
[0.03058566, 0.02654746, 0.],
[0.03009182, 0.02710594, 0.],
[0.02958779, 0.02765524, 0.],
[0.02907374, 0.02819517, 0.],
[0.02854983, 0.02872555, 0.],
[0.02801625, 0.02924619, 0.],
[0.02747318, 0.02975692, 0.],
[0.02692079, 0.03025757, 0.],
[0.02635929, 0.03074797, 0.],
[0.02578886, 0.03122795, 0.],
[0.02520968, 0.03169735, 0.],
[0.02462197, 0.03215601, 0.],
[0.02402591, 0.03260377, 0.],
[0.02342171, 0.03304048, 0.],
[0.02280957, 0.033466, 0.],
[0.02218971, 0.03388018, 0.],
[0.02156233, 0.03428288, 0.],
[0.02092764, 0.03467397, 0.],
[0.02028586, 0.0350533, 0.],
[0.0196372, 0.03542076, 0.],
[0.0189819, 0.03577622, 0.],
[0.01832016, 0.03611955, 0.],
[0.01765221, 0.03645064, 0.],
[0.01697828, 0.03676939, 0.],
[0.0162986, 0.03707567, 0.],
[0.0156134, 0.0373694, 0.],
[0.01492291, 0.03765046, 0.],
[0.01422736, 0.03791876, 0.],
[0.01352699, 0.03817421, 0.],
[0.01282203, 0.03841673, 0.],
[0.01211273, 0.03864624, 0.],
[0.01139933, 0.03886265, 0.],
[0.01068206, 0.03906589, 0.],
[0.00996118, 0.03925589, 0.],
[0.00923692, 0.03943259, 0.],
[0.00850953, 0.03959593, 0.],
[0.00777926, 0.03974586, 0.],
[0.00704635, 0.03988231, 0.],
[0.00631105, 0.04000526, 0.],
[0.00557361, 0.04011465, 0.],
[0.00483429, 0.04021044, 0.],
[0.00409333, 0.04029261, 0.],
[0.00335098, 0.04036113, 0.],
[0.0026075, 0.04041597, 0.],
[0.00186313, 0.04045712, 0.],
[0.00111813, 0.04048456, 0.],
[0.00037275, 0.04049828, 0.],
[-0.00037275, 0.04049828, 0.],
[-0.00111813, 0.04048456, 0.],
[-0.00186313, 0.04045712, 0.],
[-0.0026075, 0.04041597, 0.],
[-0.00335098, 0.04036113, 0.],
[-0.00409333, 0.04029261, 0.],
[-0.00483429, 0.04021044, 0.],
[-0.00557361, 0.04011465, 0.],
[-0.00631105, 0.04000526, 0.],
[-0.00704635, 0.03988231, 0.],
[-0.00777926, 0.03974586, 0.],
[-0.00850953, 0.03959593, 0.],
[-0.00923692, 0.03943259, 0.],
[-0.00996118, 0.03925589, 0.],
[-0.01068206, 0.03906589, 0.],
[-0.01139933, 0.03886265, 0.],
[-0.01211273, 0.03864624, 0.],
[-0.01282203, 0.03841673, 0.],
[-0.01352699, 0.03817421, 0.],
[-0.01422736, 0.03791876, 0.],
[-0.01492291, 0.03765046, 0.],
[-0.0156134, 0.0373694, 0.],
[-0.0162986, 0.03707567, 0.],
[-0.01697828, 0.03676939, 0.],
[-0.01765221, 0.03645064, 0.],
[-0.01832016, 0.03611955, 0.],
[-0.0189819, 0.03577622, 0.],
[-0.0196372, 0.03542076, 0.],
[-0.02028586, 0.0350533, 0.],
[-0.02092764, 0.03467397, 0.],
[-0.02156233, 0.03428288, 0.],
[-0.02218971, 0.03388018, 0.],
[-0.02280957, 0.033466, 0.],
[-0.02342171, 0.03304048, 0.],
[-0.02402591, 0.03260377, 0.],
[-0.02462197, 0.03215601, 0.],
[-0.02520968, 0.03169735, 0.],
[-0.02578886, 0.03122795, 0.],
[-0.02635929, 0.03074797, 0.],
[-0.02692079, 0.03025757, 0.],
[-0.02747318, 0.02975692, 0.],
[-0.02801625, 0.02924619, 0.],
[-0.02854983, 0.02872555, 0.],
[-0.02907374, 0.02819517, 0.],
[-0.02958779, 0.02765524, 0.],
[-0.03009182, 0.02710594, 0.],
[-0.03058566, 0.02654746, 0.],
[-0.03106913, 0.02597998, 0.],
[-0.03154207, 0.0254037, 0.],
[-0.03200432, 0.02481881, 0.],
[-0.03245573, 0.02422551, 0.],
[-0.03289615, 0.023624, 0.],
[-0.03332542, 0.02301449, 0.],
[-0.03374339, 0.02239718, 0.],
[-0.03414993, 0.02177228, 0.],
[-0.0345449, 0.02114, 0.],
[-0.03492817, 0.02050056, 0.],
[-0.0352996, 0.01985417, 0.],
[-0.03565907, 0.01920106, 0.],
[-0.03600646, 0.01854144, 0.],
[-0.03634165, 0.01787554, 0.],
[-0.03666452, 0.01720358, 0.],
[-0.03697497, 0.01652579, 0.],
[-0.03727289, 0.0158424, 0.],
[-0.03755818, 0.01515364, 0.],
[-0.03783075, 0.01445975, 0.],
[-0.0380905, 0.01376096, 0.],
[-0.03833734, 0.01305751, 0.],
[-0.03857119, 0.01234963, 0.],
[-0.03879197, 0.01163757, 0.],
[-0.03899961, 0.01092157, 0.],
[-0.03919403, 0.01020186, 0.],
[-0.03937517, 0.0094787, 0.],
[-0.03954297, 0.00875233, 0.],
[-0.03969738, 0.00802299, 0.],
[-0.03983833, 0.00729093, 0.],
[-0.03996578, 0.0065564, 0.],
[-0.04007969, 0.00581965, 0.],
[-0.04018002, 0.00508093, 0.],
[-0.04026674, 0.00434048, 0.],
[-0.04033981, 0.00359857, 0.],
[-0.04039921, 0.00285544, 0.],
[-0.04044493, 0.00211133, 0.],
[-0.04047694, 0.00136652, 0.],
[-0.04049524, 0.00062124, 0.],
[-0.04049981, -0.00012425, 0.],
[-0.04049066, -0.0008697, 0.],
[-0.04046779, -0.00161485, 0.],
[-0.04043121, -0.00235946, 0.],
[-0.04038093, -0.00310327, 0.],
[-0.04031697, -0.00384602, 0.],
[-0.04023935, -0.00458747, 0.],
[-0.04014809, -0.00532737, 0.],
[-0.04004323, -0.00606546, 0.],
[-0.0399248, -0.0068015, 0.],
[-0.03979284, -0.00753523, 0.],
[-0.0396474, -0.00826641, 0.],
[-0.03948853, -0.00899479, 0.],
[-0.03931627, -0.00972012, 0.],
[-0.0391307, -0.01044216, 0.],
[-0.03893186, -0.01116066, 0.],
[-0.03871983, -0.01187538, 0.],
[-0.03849469, -0.01258607, 0.],
[-0.0382565, -0.0132925, 0.],
[-0.03800534, -0.01399442, 0.],
[-0.03774131, -0.01469161, 0.],
[-0.03746449, -0.01538381, 0.],
[-0.03717498, -0.0160708, 0.],
[-0.03687287, -0.01675235, 0.],
[-0.03655827, -0.01742822, 0.],
[-0.03623128, -0.01809819, 0.],
[-0.03589201, -0.01876202, 0.],
[-0.03554058, -0.0194195, 0.],
[-0.03517711, -0.02007039, 0.],
[-0.03480172, -0.02071449, 0.],
[-0.03441454, -0.02135156, 0.],
[-0.0340157, -0.02198141, 0.],
[-0.03360533, -0.0226038, 0.],
[-0.03318357, -0.02321854, 0.],
[-0.03275058, -0.0238254, 0.],
[-0.03230648, -0.0244242, 0.],
[-0.03185144, -0.02501472, 0.],
[-0.0313856, -0.02559676, 0.],
[-0.03090913, -0.02617013, 0.],
[-0.03042219, -0.02673463, 0.],
[-0.02992494, -0.02729007, 0.],
[-0.02941755, -0.02783627, 0.],
[-0.02890019, -0.02837304, 0.]]) * 1000)[:, [0, 2, 1]]
detector_positions = self.get_detector_element_positions_base_mm()
min_x_coordinate = np.min(detector_positions[:, 0])
max_x_coordinate = np.max(detector_positions[:, 0])
self.probe_width_mm = max_x_coordinate - min_x_coordinate
min_z_coordinate = np.min(detector_positions[:, 2])
max_z_coordinate = np.max(detector_positions[:, 2])
self.probe_height_mm = max_z_coordinate - min_z_coordinate
if field_of_view_extent_mm is None:
self.field_of_view_extent_mm = np.asarray([-self.probe_width_mm/2,
self.probe_width_mm/2,
0, 0, 0, 100])
else:
self.field_of_view_extent_mm = field_of_view_extent_mm
def check_settings_prerequisites(self, global_settings) -> bool:
if global_settings[Tags.DIM_VOLUME_Z_MM] < (self.probe_height_mm + 1):
self.logger.error("Volume z dimension is too small to encompass the device in simulation!"
"Must be at least {} mm but was {} mm"
.format((self.probe_height_mm + 1),
global_settings[Tags.DIM_VOLUME_Z_MM]))
return False
if global_settings[Tags.DIM_VOLUME_X_MM] < (self.probe_width_mm + 1):
self.logger.error("Volume x dimension is too small to encompass MSOT device in simulation!"
"Must be at least {} mm but was {} mm"
.format(self.probe_width_mm, global_settings[Tags.DIM_VOLUME_X_MM]))
return False
return True
def update_settings_for_use_of_model_based_volume_creator(self, global_settings):
pass
def get_detector_element_positions_base_mm(self) -> np.ndarray:
return self.positions
def get_detector_element_orientations(self) -> np.ndarray:
detector_positions = self.get_detector_element_positions_base_mm()
detector_orientations = np.subtract(0, detector_positions)
norm = np.linalg.norm(detector_orientations, axis=-1)
for dim in range(3):
detector_orientations[:, dim] = detector_orientations[:, dim] / norm
return detector_orientations
def serialize(self) -> dict:
serialized_device = self.__dict__
return {"iTheraInvision256TFDetectionGeometry": serialized_device}
@staticmethod
def deserialize(dictionary_to_deserialize):
deserialized_device = iTheraInvision256TFDetectionGeometry()
for key, value in dictionary_to_deserialize.items():
deserialized_device.__dict__[key] = value
return deserialized_device
| 34.353107 | 118 | 0.629718 | 1,789 | 12,161 | 4.182784 | 0.229178 | 0.068689 | 0.00735 | 0.011359 | 0.751303 | 0.714018 | 0.681278 | 0.0294 | 0.0294 | 0.014967 | 0 | 0.474533 | 0.158869 | 12,161 | 353 | 119 | 34.450425 | 0.257014 | 0.060439 | 0 | 0.018927 | 0 | 0 | 0.02202 | 0.003184 | 0 | 0 | 0 | 0 | 0 | 1 | 0.022082 | false | 0.009464 | 0.009464 | 0.003155 | 0.056782 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0849a2bc7b204349e97b147e449b40aa86505261 | 602 | py | Python | apps/dbc_component_gallery/__init__.py | AnnMarieW/HelloDash | 159abe2bf05f317398b20b6ab09d15b332442840 | [
"MIT"
] | 26 | 2021-02-23T21:49:53.000Z | 2022-02-26T16:57:35.000Z | apps/dbc_component_gallery/__init__.py | AnnMarieW/HelloDash | 159abe2bf05f317398b20b6ab09d15b332442840 | [
"MIT"
] | 7 | 2021-02-23T17:13:02.000Z | 2021-12-14T15:35:55.000Z | apps/dbc_component_gallery/__init__.py | AnnMarieW/HelloDash | 159abe2bf05f317398b20b6ab09d15b332442840 | [
"MIT"
] | 18 | 2021-04-21T05:18:47.000Z | 2021-11-26T20:30:19.000Z | from .about_theme_explorer import about_explorer
from .alert import alerts
from .badge import badges
from .button import buttons
from .card import cards
from .collapse import collapse
from .fade import fade
from .form import form
from .input import checklist_items, input_, input_group, radio_items
from .intro import intro
from .list_group import list_group
from .modal import modal
from .navbar import navbar
from .popover import popover
from .progress import progress
from .spinner import spinner
from .table import table
from .tabs import tabs
from .toast import toast
from .tooltip import tooltip
| 28.666667 | 68 | 0.82392 | 91 | 602 | 5.351648 | 0.351648 | 0.036961 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137874 | 602 | 20 | 69 | 30.1 | 0.938343 | 0 | 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 |
f22fdee33640cc5ab23cfbc6806b438ba422650e | 989 | py | Python | practice-exercises/section-9-conditionals/9.py | mugan86/bootcamp-basic-to-expert-from-scratch | 028aab243386e5a75d84aea319c480ec54913c53 | [
"MIT"
] | 31 | 2022-01-19T18:33:40.000Z | 2022-03-29T16:24:44.000Z | practice-exercises/section-9-conditionals/9.py | mugan86/bootcamp-basic-to-expert-from-scratch | 028aab243386e5a75d84aea319c480ec54913c53 | [
"MIT"
] | 1 | 2022-02-09T17:47:17.000Z | 2022-02-09T17:47:17.000Z | practice-exercises/section-9-conditionals/9.py | mugan86/bootcamp-basic-to-expert-from-scratch | 028aab243386e5a75d84aea319c480ec54913c53 | [
"MIT"
] | 4 | 2022-01-20T15:41:09.000Z | 2022-03-29T16:25:08.000Z | """
Vamos a crear un programa que simule un inicio de sesión solicitando el nombre de usuario y contraseña, y mostrar un mensaje en pantalla, inicio de sesión correcto / nombre de usuario y/o contraseña incorrecto. (por ejemplo el usuario vuestro nombre en minúsculas (bootcamp_python3) y el password 12345678
Datos de prueba:
Introduce usuario: bootcamp_python3 / Introduce el password: 12345678
Resultado esperado: Sesión iniciada correctamente.
=================================================
Introduce usuario: bootcamp_python3 / Introduce el password: 1234
Resultado esperado: nombre de usuario y/o contraseña incorrecto.
"""
user = input("Introduce el usuario: ")
password = input("Introduce la contraseña: ")
print("===================================")
if (user == "bootcamp_python3" and password == "12345678"):
print("Credenciales correctos. Se ha iniciado sesión \"bootcamp_python3\"")
else:
print("Los datos de sesión no son correctos. Prueba de nuevo por favor.")
| 52.052632 | 305 | 0.709808 | 123 | 989 | 5.666667 | 0.455285 | 0.107604 | 0.064562 | 0.068867 | 0.249641 | 0.249641 | 0.249641 | 0 | 0 | 0 | 0 | 0.038596 | 0.13549 | 989 | 18 | 306 | 54.944444 | 0.776608 | 0.63094 | 0 | 0 | 0 | 0 | 0.609551 | 0.098315 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.285714 | 0 | 0 | 0 | 0.428571 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 3 |
f232342a753de3f71bc534988187990a4ce16c3e | 1,989 | py | Python | Jumga/api/models.py | OsasAzamegbe/Jumga-Backend | 9dbc287399e7620bcbb0dc0df2132927190f585b | [
"BSD-3-Clause"
] | 2 | 2021-01-24T16:17:57.000Z | 2021-02-05T08:07:06.000Z | Jumga/api/models.py | OsasAzamegbe/Jumga-Backend | 9dbc287399e7620bcbb0dc0df2132927190f585b | [
"BSD-3-Clause"
] | null | null | null | Jumga/api/models.py | OsasAzamegbe/Jumga-Backend | 9dbc287399e7620bcbb0dc0df2132927190f585b | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
class Transaction(models.Model):
transaction_id = models.CharField(max_length=255, unique=True, primary_key=True)
flw_json = models.JSONField()
sender = models.ForeignKey(
User,
on_delete=models.SET_NULL,
blank=True, null=True,
related_name="outgoing_transactions"
)
receiver = models.ForeignKey(
User,
on_delete=models.SET_NULL,
blank=True,
null=True,
related_name="incoming_transactions"
)
amount_charged = models.IntegerField(default=0)
processing_fee = models.IntegerField(default=0)
jumga_fee = models.IntegerField(default=0)
amount_paid = models.IntegerField(default=0)
created = models.DateTimeField(editable=False)
def __save__(self, *args, **kwargs):
if not self.id:
self.created = timezone.now()
return super(Transaction, self).save(*args, **kwargs)
def __str__(self):
return f'transaction id: {self.tx_id}'
class Merchant(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True)
shop_name = models.CharField(max_length=255, default="", unique=True)
dispatch_rider = models.OneToOneField('DispatchRider', on_delete=models.CASCADE)
current_revenue = models.IntegerField(default=0)
total_revenue = models.IntegerField(default=0)
withdrawn_revenue = models.IntegerField(default=0)
active = models.BooleanField(default=False)
def __str__(self):
return f'{self.shop_name}'
class DispatchRider(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True)
current_revenue = models.IntegerField(default=0)
total_revenue = models.IntegerField(default=0)
withdrawn_revenue = models.IntegerField(default=0)
def __str__(self):
return f'{self.user.username} Dispath Rider'
| 34.293103 | 84 | 0.707391 | 238 | 1,989 | 5.710084 | 0.331933 | 0.13245 | 0.183959 | 0.191317 | 0.511405 | 0.416483 | 0.385578 | 0.385578 | 0.385578 | 0.385578 | 0 | 0.009901 | 0.187531 | 1,989 | 57 | 85 | 34.894737 | 0.831064 | 0 | 0 | 0.319149 | 0 | 0 | 0.066868 | 0.021116 | 0 | 0 | 0 | 0 | 0 | 1 | 0.085106 | false | 0 | 0.06383 | 0.06383 | 0.723404 | 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 | 0 | 1 | 0 | 0 | 3 |
f234210a19772d72d1eb90fe4ccc92f7a9b29fb3 | 281 | py | Python | project/nutrihacker/migrations/0023_merge_20201116_1312.py | COSC481W-2020Fall/cosc481w-581-2020-fall-nutrition-helper | a8ddb4b8c0703e376d5bb0f668ef003e2ed203e8 | [
"MIT"
] | 1 | 2021-03-18T00:12:09.000Z | 2021-03-18T00:12:09.000Z | project/nutrihacker/migrations/0023_merge_20201116_1312.py | COSC481W-2020Fall/cosc481w-581-2020-fall-nutrition-helper | a8ddb4b8c0703e376d5bb0f668ef003e2ed203e8 | [
"MIT"
] | 104 | 2020-09-09T18:52:33.000Z | 2020-12-16T15:17:56.000Z | project/nutrihacker/migrations/0023_merge_20201116_1312.py | COSC481W-2020Fall/cosc481w-581-2020-fall-nutrition-helper | a8ddb4b8c0703e376d5bb0f668ef003e2ed203e8 | [
"MIT"
] | 1 | 2021-03-17T21:35:51.000Z | 2021-03-17T21:35:51.000Z | # Generated by Django 3.1.1 on 2020-11-16 18:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('nutrihacker', '0022_auto_20201113_2022'),
('nutrihacker', '0022_auto_20201112_2152'),
]
operations = [
]
| 18.733333 | 51 | 0.658363 | 33 | 281 | 5.424242 | 0.787879 | 0.167598 | 0.212291 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.215596 | 0.224199 | 281 | 14 | 52 | 20.071429 | 0.605505 | 0.160142 | 0 | 0 | 1 | 0 | 0.290598 | 0.196581 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 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 |
f2466efa4e5e887f979a4e012bd884e6f39fce6b | 1,615 | py | Python | jacdac/e_co2/client.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-15T21:30:36.000Z | 2022-02-15T21:30:36.000Z | jacdac/e_co2/client.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | null | null | null | jacdac/e_co2/client.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-08T19:32:45.000Z | 2022-02-08T19:32:45.000Z | # Autogenerated file. Do not edit.
from jacdac.bus import Bus, SensorClient
from .constants import *
from typing import Optional
class ECO2Client(SensorClient):
"""
Measures equivalent CO₂ levels.
Implements a client for the `Equivalent CO₂ <https://microsoft.github.io/jacdac-docs/services/eco2>`_ service.
"""
def __init__(self, bus: Bus, role: str, *, missing_e_CO2_value: float = None) -> None:
super().__init__(bus, JD_SERVICE_CLASS_E_CO2, JD_E_CO2_PACK_FORMATS, role, preferred_interval = 1000)
self.missing_e_CO2_value = missing_e_CO2_value
@property
def e_CO2(self) -> Optional[float]:
"""
Equivalent CO₂ (eCO₂) readings., _: ppm
"""
self.refresh_reading()
return self.register(JD_E_CO2_REG_E_CO2).value(self.missing_e_CO2_value)
@property
def e_CO2_error(self) -> Optional[float]:
"""
(Optional) Error on the reading value., _: ppm
"""
return self.register(JD_E_CO2_REG_E_CO2_ERROR).value()
@property
def min_e_CO2(self) -> Optional[float]:
"""
Minimum measurable value, _: ppm
"""
return self.register(JD_E_CO2_REG_MIN_E_CO2).value()
@property
def max_e_CO2(self) -> Optional[float]:
"""
Minimum measurable value, _: ppm
"""
return self.register(JD_E_CO2_REG_MAX_E_CO2).value()
@property
def variant(self) -> Optional[ECO2Variant]:
"""
(Optional) Type of physical sensor and capabilities.,
"""
return self.register(JD_E_CO2_REG_VARIANT).value()
| 29.363636 | 114 | 0.643963 | 205 | 1,615 | 4.736585 | 0.346341 | 0.07827 | 0.064882 | 0.102987 | 0.397528 | 0.314109 | 0.314109 | 0.286303 | 0.222451 | 0.15036 | 0 | 0.02461 | 0.245201 | 1,615 | 54 | 115 | 29.907407 | 0.771944 | 0.237771 | 0 | 0.217391 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0.130435 | 0 | 0.652174 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f246f41e68621fe24e291f5e496398518fa5dc19 | 578 | py | Python | lights/patterns/solid.py | Chris-Johnston/Internet-Xmas-Tree | 682a0455fa0dcad8637137d28281ea324663b542 | [
"MIT"
] | 7 | 2015-12-24T09:58:36.000Z | 2021-12-26T04:52:35.000Z | lights/patterns/solid.py | Chris-Johnston/Internet-Xmas-Tree | 682a0455fa0dcad8637137d28281ea324663b542 | [
"MIT"
] | null | null | null | lights/patterns/solid.py | Chris-Johnston/Internet-Xmas-Tree | 682a0455fa0dcad8637137d28281ea324663b542 | [
"MIT"
] | 1 | 2017-12-21T04:55:40.000Z | 2017-12-21T04:55:40.000Z | """
Solid Color Pattern
Only displays color 1
"""
from .pattern import Pattern
class Solid(Pattern):
"""
Solid pattern class
"""
def __init__(self):
pass
@classmethod
def get_id(self):
"""
Gets the ID of this pattern.
This is set by the front end, and saved in the data.json. If this ID matches, then this update method will be called.
"""
return 0
@classmethod
def update(self, strip, state):
"""
Updates the LED strip
"""
strip.fill(state.color1)
| 17 | 125 | 0.565744 | 72 | 578 | 4.472222 | 0.638889 | 0.074534 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007937 | 0.346021 | 578 | 33 | 126 | 17.515152 | 0.843915 | 0.399654 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0.1 | 0.1 | 0 | 0.6 | 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 |
f24c0067cc8c7c9189d25c9bcc97828182e944cb | 196 | py | Python | feature_selection_ga/__init__.py | jnmaomao/FeatureSelectionGA | e89da30b808d200eaa7eccf7726c86e8d795c84d | [
"MIT"
] | 232 | 2017-11-14T04:07:37.000Z | 2022-03-29T02:07:14.000Z | feature_selection_ga/__init__.py | jnmaomao/FeatureSelectionGA | e89da30b808d200eaa7eccf7726c86e8d795c84d | [
"MIT"
] | 30 | 2018-12-21T13:30:14.000Z | 2022-03-07T22:04:24.000Z | feature_selection_ga/__init__.py | jnmaomao/FeatureSelectionGA | e89da30b808d200eaa7eccf7726c86e8d795c84d | [
"MIT"
] | 86 | 2017-11-20T17:25:36.000Z | 2022-03-17T03:53:02.000Z | __author__ = """Kaushal Shetty"""
__email__ = "kaushalshetty@outlook.com"
__version__ = "0.1.3"
from .feature_selection_ga import FeatureSelectionGA
from .fitness_function import FitnessFunction
| 28 | 52 | 0.806122 | 22 | 196 | 6.5 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016949 | 0.096939 | 196 | 6 | 53 | 32.666667 | 0.79096 | 0 | 0 | 0 | 0 | 0 | 0.22449 | 0.127551 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 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 |
f276af0fa1beb175e2abd7b7facc180e6b01d025 | 2,755 | py | Python | test.py | Drincann/py-functional-chaining | 18c984535c467233cf2f585d809e527fb20a27ef | [
"WTFPL"
] | 2 | 2021-11-07T10:37:19.000Z | 2021-11-07T14:16:35.000Z | test.py | Drincann/py-functional-chaining | 18c984535c467233cf2f585d809e527fb20a27ef | [
"WTFPL"
] | 2 | 2021-11-07T11:01:05.000Z | 2021-11-07T11:01:16.000Z | test.py | Drincann/py-functional-chaining | 18c984535c467233cf2f585d809e527fb20a27ef | [
"WTFPL"
] | null | null | null | import unittest
from funcChaining.Type import List
class ListTest(unittest.TestCase):
def setUp(self) -> None:
self.lst = List(range(1, 5))
def test_pack(self):
try:
self.lst.__class__.pack([])
except NotImplementedError:
self.assertTrue(False, 'pack 没有被实现')
def test_map(self):
self.assertEqual(self.lst.map(lambda x: x * 2), [2, 4, 6, 8])
def test_filter(self):
self.assertEqual(self.lst.filter(lambda x: x % 2 == 0), [2, 4])
def test_reduce(self):
self.assertEqual(self.lst.reduce(lambda x, y: x + y, initial=0), 10)
def test_zip(self):
self.assertEqual(self.lst.zip(range(1, 5)), [
(1, 1), (2, 2), (3, 3), (4, 4)])
def test_clear(self):
self.lst.clear()
self.assertEqual(self.lst, [])
def test_insert(self):
self.lst.insert(0, 0)
self.assertEqual(self.lst, [0, 1, 2, 3, 4])
def test_append(self):
self.lst.append(5)
self.assertEqual(self.lst, [1, 2, 3, 4, 5])
def test_pop(self):
self.assertEqual(self.lst.pop(), self.lst)
self.assertEqual(self.lst, [1, 2, 3])
def test_extend(self):
self.lst.extend([5])
self.assertEqual(self.lst, [1, 2, 3, 4, 5])
def test_remove(self):
self.lst.remove(2)
self.assertEqual(self.lst, [1, 3, 4])
def test_reverse(self):
self.assertEqual(self.lst.reverse(), [4, 3, 2, 1])
def test_sort(self):
self.assertEqual(self.lst.sort(key=lambda x: -x), [4, 3, 2, 1])
def test_copy(self):
newlst = self.lst.copy()
newlst[0] = 0
self.assertEqual(self.lst, [1, 2, 3, 4])
self.assertEqual(newlst, [0, 2, 3, 4])
def test_index(self):
self.assertEqual(self.lst.index(3), 2)
def test_count(self):
self.assertEqual(self.lst.count(3), 1)
def test_ladd_type(self):
self.assertIsInstance(self.lst + [5], List)
def test_ladd(self):
self.assertEqual(self.lst + [5], [1, 2, 3, 4, 5])
def test_radd_type(self):
self.assertIsInstance([5] + self.lst, List)
def test_radd(self):
self.assertEqual([5] + self.lst, [5, 1, 2, 3, 4])
def test_iadd(self):
self.lst += [5]
self.assertEqual(self.lst, [1, 2, 3, 4, 5])
def test_multiply_type(self):
self.assertIsInstance(self.lst * 2, List)
def test_lmultiply(self):
self.assertEqual(self.lst * 2, [1, 2, 3, 4, 1, 2, 3, 4])
def test_rmultiply_type(self):
self.assertIsInstance(2 * self.lst, List)
def test_rmultiply(self):
self.assertEqual(2 * self.lst, [1, 2, 3, 4, 1, 2, 3, 4])
if __name__ == "__main__":
unittest.main()
| 27.009804 | 76 | 0.572051 | 408 | 2,755 | 3.762255 | 0.156863 | 0.159609 | 0.235179 | 0.272313 | 0.457329 | 0.230619 | 0.132899 | 0.095765 | 0.068404 | 0.068404 | 0 | 0.055281 | 0.26461 | 2,755 | 101 | 77 | 27.277228 | 0.702369 | 0 | 0 | 0.042254 | 0 | 0 | 0.006534 | 0 | 0 | 0 | 0 | 0 | 0.380282 | 1 | 0.366197 | false | 0 | 0.028169 | 0 | 0.408451 | 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 |
f29b7d75413c3d999d8dfb1546b36d2f7c105f83 | 45 | py | Python | e_drone/tools/__init__.py | byrobot-python/e_drone | 52e5d437f31b4dd34fbbc8dccb7258b9a1ec1463 | [
"MIT"
] | null | null | null | e_drone/tools/__init__.py | byrobot-python/e_drone | 52e5d437f31b4dd34fbbc8dccb7258b9a1ec1463 | [
"MIT"
] | null | null | null | e_drone/tools/__init__.py | byrobot-python/e_drone | 52e5d437f31b4dd34fbbc8dccb7258b9a1ec1463 | [
"MIT"
] | null | null | null | __all__ = [
"parser",
"update",
] | 11.25 | 13 | 0.422222 | 3 | 45 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.377778 | 45 | 4 | 14 | 11.25 | 0.535714 | 0 | 0 | 0 | 0 | 0 | 0.26087 | 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 |
f2b2b99516b3a5d8cd6f2cbb692d53f8ff35656b | 1,540 | py | Python | addons/web_readonly_bypass/__openerp__.py | csokt/odoo8 | 8994f53bf4ee4ad778d76015b8457d4a1224c7a4 | [
"MIT"
] | null | null | null | addons/web_readonly_bypass/__openerp__.py | csokt/odoo8 | 8994f53bf4ee4ad778d76015b8457d4a1224c7a4 | [
"MIT"
] | null | null | null | addons/web_readonly_bypass/__openerp__.py | csokt/odoo8 | 8994f53bf4ee4ad778d76015b8457d4a1224c7a4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of web_readonly_bypass,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# web_readonly_bypass is free software:
# you can redistribute it and/or modify it under the terms of the GNU
# Affero General Public License as published by the Free Software
# Foundation,either version 3 of the License, or (at your option) any
# later version.
#
# web_readonly_bypass is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with web_readonly_bypass.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Read Only ByPass',
'version': '8.0.1.0.1',
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"maintainer": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "http://www.acsone.eu",
'category': 'Technical Settings',
'depends': [
'web',
],
'summary': 'Allow to save onchange modifications to readonly fields',
'data': [
'views/readonly_bypass.xml',
],
'installable': True,
'auto_install': False,
}
| 36.666667 | 78 | 0.592208 | 188 | 1,540 | 4.797872 | 0.601064 | 0.077605 | 0.075388 | 0.063193 | 0.192905 | 0.192905 | 0.157428 | 0 | 0 | 0 | 0 | 0.008994 | 0.205844 | 1,540 | 41 | 79 | 37.560976 | 0.728536 | 0.546753 | 0 | 0.117647 | 0 | 0 | 0.61657 | 0.04817 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.117647 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
f2b305515dc5c10f45f56b0a5696ee8447d3d605 | 183 | py | Python | tasks/forms/archive_task_form.py | salomvary/minitask | 93bef893b938e162daec5599e1d40ce823908190 | [
"MIT"
] | 3 | 2021-01-04T07:32:52.000Z | 2022-03-02T20:07:41.000Z | tasks/forms/archive_task_form.py | salomvary/minitask | 93bef893b938e162daec5599e1d40ce823908190 | [
"MIT"
] | null | null | null | tasks/forms/archive_task_form.py | salomvary/minitask | 93bef893b938e162daec5599e1d40ce823908190 | [
"MIT"
] | null | null | null | from django.forms import ModelForm
from tasks.models import Task
class ArchiveTaskForm(ModelForm):
class Meta:
model = Task
fields = ("version", "is_archived")
| 18.3 | 43 | 0.688525 | 21 | 183 | 5.952381 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.229508 | 183 | 9 | 44 | 20.333333 | 0.886525 | 0 | 0 | 0 | 0 | 0 | 0.098361 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f2b78623def5414cf3451f25fe0cc58380a3fc33 | 342 | py | Python | home/admin.py | SamrathPalSingh/stockmarketwebsite | ea91647e25066c1a5c7f48015dccd19117428e9b | [
"MIT"
] | null | null | null | home/admin.py | SamrathPalSingh/stockmarketwebsite | ea91647e25066c1a5c7f48015dccd19117428e9b | [
"MIT"
] | 9 | 2020-05-05T18:43:29.000Z | 2021-09-22T18:58:59.000Z | home/admin.py | SamrathPalSingh/stockmarketwebsite | ea91647e25066c1a5c7f48015dccd19117428e9b | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import stock
#admin.site.register(Stock)
class stockAdmin(admin.ModelAdmin):
list_display = ('stockName', 'stockSymbol', 'candle_pattern', 'candle_trend', 's_and_r_trend', 'volume','volume_trend', 'macd_trend', 'rank')
admin.site.register(stock, stockAdmin)
| 26.307692 | 145 | 0.754386 | 44 | 342 | 5.681818 | 0.613636 | 0.072 | 0.136 | 0.176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108187 | 342 | 12 | 146 | 28.5 | 0.819672 | 0.152047 | 0 | 0 | 0 | 0 | 0.317073 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.8 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
f2b848c2866cd02e12467168c28e1685f8332a2e | 4,276 | py | Python | day_04.py | zsd58697/test2 | 5b05698481e1829b0b4b2e306bd94e247962a1ec | [
"Apache-2.0"
] | null | null | null | day_04.py | zsd58697/test2 | 5b05698481e1829b0b4b2e306bd94e247962a1ec | [
"Apache-2.0"
] | null | null | null | day_04.py | zsd58697/test2 | 5b05698481e1829b0b4b2e306bd94e247962a1ec | [
"Apache-2.0"
] | null | null | null | # _*_conding:utf8-
from __future__ import print_function
'''
1.
s=0
def getPentagonalNumber(n):
global s
for i in range(1,n):
i=int(i)
i=(3*i*i-i)/2
s=s+1
print(str(i)+' ',end=' ')
if s==10:
print()
s=0
getPentagonalNumber(100)
'''
'''
2.
a=0
A=eval(raw_input("enter a number:"))
def sumDifits(n):
global A,a
while A!=0:
a=a+A%10
A=A/10
print("zhe ge shu d zi shen he shi:{}".format(a))
sumDifits(A)
'''
'''
3.
a,b,c=eval(raw_input("enter three number:"))
def displaySortedNumbers(num1,num2,num3):
global a,b,c
if a>b:
a=a
else:
a,b=b,a
if a>c:
a=a
else:
a,c=c,a
if b>c:
b=b
else:
b,c=c,b
print("the sorted numbers:{} {} {}".format(c,b,a))
displaySortedNumbers(a,b,c)
'''
'''
3.2
import math
a,b,c=eval(raw_input("enter three numbers:"))
def displaySortedNumbers(num1,num2,num3):
global a,b,c
z=[a,b,c]
z.sort()
print("the sorted numbers:{}".format(z))
displaySortedNumbers(a,b,c)
'''
'''
5.
a,b=raw_input("enter begin number and stop number :").split(',')
c= eval(raw_input("enter a number:"))
s=0
def printchars(chr1,chr2,numberperline):
global a,b,c,s
a=ord(a)+1
b=ord(b)+1
for i in range(a,b):
s=s+1
i=chr(i)
print(str(i)+' ',end='')
if s==c:
print()
s=0
printchars(a,b,c)
'''
'''
5.2
a=ord('1')
b=ord('Z')+1
def printchars(chr1,chr2):
global a,b,s
s=0
for i in range(a,b):
s=s+1
i=chr(i)
print(i+' ',end='')
if s==10:
print()
s=0
printchars(a,b)
'''
'''
6.
a,b=eval(raw_input("enter two years:"))
def numberOfDaysInAYear(year1,year2):
global a,b
for i in range(a,b+1):
if ((i%4==0)&(i%100!=0))|(i%400==0):
print("{} year de day is 366".format(i))
else:
print("{} year de day is 365".format(i))
numberOfDaysInAYear(a,b)
'''
'''
7.
import math
x1,y1=eval(raw_input("enter x1 and y1:"))
x2,y2=eval(raw_input("enter x2 and y2:"))
def distance (a,b,c,d):
global x1,y1,x2,y2
d=0
d=math.sqrt(pow((y2-y1),2)+pow((x2-x1),2))
print(d)
distance(x1,y1,x2,y2)
'''
'''
8.
print("p,pow(2,p)-1")
s=0
for i in range(2,32):
s=pow(2,i)-1
print(i,s)
'''
'''
8.2
print("p\t2^p-1:")
def s(a):
c=0
for j in range(2,int(sqrt(a)+1)):
if a%j==0:
c=0
else:
c=1
return c
print("2\t3")
for i in range(1,32):
c=pow(2,i)-1
if(s(c)):
print("%d\t%d"%(i,c))
'''
'''
9.
from time import *
print(ctime(time()))
'''
'''
10.
import random
n1=random.randint(1,6)
n2=random.randint(1,6)
if (n1+n2==2)|(n1+n2==3)|(n1+n2==12):
print("you rolled is {} + {} ={}\nyou lose".format(n1,n2,n1+n2))
elif (n1+n2==7)|(n1+n2==11):
print("you rolled is {} + {} = {}\nyou win".format(n1,n2,n1+n2))
else:
while(1)
print("you rolled {} + {} = {}\npoint is {}".format(n1,n2,n1+n2,n1+n2))
n1=random.randint(1,6)
n2=random.randint(1,6)
if(n1+n2==7):
print("you rolled {} + {} = {}\nyou lose".format(n1,n2,n1+n2))
break
elif(n1+n2==n1+n2):
print("you rolled {} + {} = {}\nyou win".format(n1,n2,n1+n2))
break
else:
continue
'''
'''
4.
import math
p=eval(raw_input("the amount invested:"))
a=eval(raw_input("annual interest rate:"))
def f(c,b):
global p,a
print("years future value ")
for i in range(1,31):
p=p*pow((1+a/12),12)
print(i,p)
f(p,a)
'''
'''
10.2
a,b=eval(rinput("Enter one and two:"))
if(a+b==2)|(a+b==3)|(a+b==12):
print("You rolled %d+%d=%d"%(a,b,a+b))
print("You lose")
elif(a+b==7)|(a+b==11):
print("You rolled %d+%d=%d"%(a,b,a+b))
print("You win")
else:
while(1):
print("You rolled %d+%d=%d"%(a,b,a+b))
print("print is %d"%(a+b))
s=a+b
a,b=eval(input("Enter one and two:"))
if(a+b==7):
print("You rolled %d+%d=%d"%(a,b,a+b))
print("You lose")
break
elif(a+b==s):
print("You rolled %d+%d=%d"%(a,b,s))
print("You win")
break
else:
continue
'''
| 18.431034 | 75 | 0.502806 | 758 | 4,276 | 2.813984 | 0.166227 | 0.038444 | 0.014065 | 0.036099 | 0.43038 | 0.343647 | 0.264416 | 0.20722 | 0.159869 | 0.118612 | 0 | 0.06463 | 0.272685 | 4,276 | 231 | 76 | 18.510823 | 0.621222 | 0.003742 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 1 | 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 | 0 | 1 | 0 | 3 |
f2bc19fc756b7f89bd791b41b1462539c5f20fff | 63 | py | Python | jira_dump/__init__.py | LatvianPython/jira-dumper | ef74e6f0c7b41bb419382acecfe97f0eb45e5b19 | [
"MIT"
] | 3 | 2019-10-09T22:33:07.000Z | 2021-07-19T07:24:00.000Z | jira_dump/__init__.py | LatvianPython/jira-dumper | ef74e6f0c7b41bb419382acecfe97f0eb45e5b19 | [
"MIT"
] | null | null | null | jira_dump/__init__.py | LatvianPython/jira-dumper | ef74e6f0c7b41bb419382acecfe97f0eb45e5b19 | [
"MIT"
] | 1 | 2020-02-16T12:11:20.000Z | 2020-02-16T12:11:20.000Z | from .base import Dumper, IssueField
__version__ = "0.1.5.3"
| 12.6 | 36 | 0.714286 | 10 | 63 | 4.1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.075472 | 0.15873 | 63 | 4 | 37 | 15.75 | 0.698113 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 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 |
4b39b0fb562782ea206a295bdfa294c1e8067cb9 | 55 | py | Python | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/E/electron gyromag. ratio.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/E/electron gyromag. ratio.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/E/electron gyromag. ratio.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | constants.physical_constants["electron gyromag. ratio"] | 55 | 55 | 0.854545 | 6 | 55 | 7.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036364 | 55 | 1 | 55 | 55 | 0.867925 | 0 | 0 | 0 | 0 | 0 | 0.410714 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4b3a8a35fc92dd999e36c1c6286f908265c0ec6a | 1,308 | py | Python | perf_test.py | aleusai/ssl-certs-validator | 4e154150dc4cdba9775a4c693be06e67e7c897fb | [
"MIT"
] | 6 | 2021-03-30T12:24:59.000Z | 2021-12-20T06:56:07.000Z | perf_test.py | aleusai/ssl-certs-validator | 4e154150dc4cdba9775a4c693be06e67e7c897fb | [
"MIT"
] | null | null | null | perf_test.py | aleusai/ssl-certs-validator | 4e154150dc4cdba9775a4c693be06e67e7c897fb | [
"MIT"
] | null | null | null | import requests
from multiprocessing import Pool
import os
import random
USERNAME = os.getenv('USERNAME')
PASSWORD = os.getenv('PASSWORD')
payloads = [ { "url": "https://facebook.com", "toPrometheus": "False"},
{ "url": "https://facebook.com", "toPrometheus": "False"},
{ "url": "https://google.com", "toPrometheus": "False"},
{ "url": "https://amazon.com", "toPrometheus": "False"},
{ "url": "https://instagram.com", "toPrometheus": "False"},
{ "url": "https://yahoo.com", "toPrometheus": "False"},
{ "url": "https://microsoft.com", "toPrometheus": "False"},
{ "url": "https://hotmail.com", "toPrometheus": "False"},
{ "url": "https://gmail.com", "toPrometheus": "False"}
]
headers = {"Accept": "application/json", "Content-type": "application/json"}
def fetch(i):
index = random.randint(0, 8)
payload = payloads[index]
print('payload=', payload)
return requests.post("http://127.0.0.1:5000/api/local", json=payload,
auth=(USERNAME, PASSWORD) ).elapsed.microseconds
if __name__ == "__main__":
with Pool(10) as p:
res_times = p.map(fetch, list(range(100)))
avg_time = sum(res_times) / len(res_times) if len(res_times) else 0
print(
f"On average each request took {round(avg_time/1000)} milliseconds.\n\n")
| 33.538462 | 81 | 0.626147 | 157 | 1,308 | 5.127389 | 0.496815 | 0.089441 | 0.223602 | 0.228571 | 0.308075 | 0.099379 | 0.099379 | 0.099379 | 0 | 0 | 0 | 0.020202 | 0.167431 | 1,308 | 38 | 82 | 34.421053 | 0.719008 | 0 | 0 | 0 | 0 | 0 | 0.407492 | 0.01682 | 0 | 0 | 0 | 0 | 0 | 1 | 0.034483 | false | 0.068966 | 0.137931 | 0 | 0.206897 | 0.068966 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
4b50f1745f15ca15f80ea3c5c7d80a74e4126188 | 1,699 | py | Python | homepage/forms.py | kenzie-se-q4/recipebox-v1-Ariesgal2017 | fc31e9279048120b2f5eafd06f2bd1c6654dcc13 | [
"MIT"
] | null | null | null | homepage/forms.py | kenzie-se-q4/recipebox-v1-Ariesgal2017 | fc31e9279048120b2f5eafd06f2bd1c6654dcc13 | [
"MIT"
] | null | null | null | homepage/forms.py | kenzie-se-q4/recipebox-v1-Ariesgal2017 | fc31e9279048120b2f5eafd06f2bd1c6654dcc13 | [
"MIT"
] | null | null | null | """
class Author(models.Model):
name = models.CharField(max_length=100)
bio = models.CharField(max_length=100)
def __str__(self):
return self.name
class Recipe(models.Model):
title = models.CharField(max_length=75)
author = models.ForeignKey(Author, on_delete=models.CASCADE)
description = models.TextField()
time_Required = models.CharField(max_length=30)
category = models.CharField(max_length=20)
"""
from django import forms
from homepage.models import Author, Recipe
#!added fields to your add recipe form that were missing.
class AddRecipeForm(forms.Form):
title = forms.CharField(max_length=75)
author = forms.ModelChoiceField(queryset=Author.objects.all())
description = forms.CharField(widget=forms.Textarea)
instructions = forms.CharField(widget=forms.Textarea)
time_required = forms.CharField(max_length=100)
class AddAuthorForm(forms.ModelForm):
class Meta:
model = Author
fields = [
"name",
"bio",
]
class SignupForm(forms.Form):
name = forms.CharField(max_length=150)
bio = forms.CharField(max_length=100)
username = forms.CharField(max_length=36)
password = forms.CharField(widget=forms.PasswordInput)
class LoginForm(forms.Form):
username = forms.CharField(max_length=36)
password = forms.CharField(widget=forms.PasswordInput)
##ADDED BY BRITT BANNISTER:
class EditRecipe(forms.ModelForm):
class Meta:
model = Recipe
fields = [
'title',
'author',
'time_required',
'instructions',
'description'
] | 30.339286 | 67 | 0.65568 | 186 | 1,699 | 5.887097 | 0.344086 | 0.120548 | 0.180822 | 0.126027 | 0.4 | 0.144292 | 0.144292 | 0.144292 | 0.144292 | 0.144292 | 0 | 0.020946 | 0.241318 | 1,699 | 56 | 68 | 30.339286 | 0.828549 | 0.306062 | 0 | 0.242424 | 0 | 0 | 0.04843 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.060606 | 0.060606 | 0 | 0.606061 | 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 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
4b53065cdf30ec6f03156b376af6209b78e7a85b | 21 | py | Python | __init__.py | Gyfis/sequence-comparison | 6506f784af4902645bb4562d507d465d57ed4366 | [
"MIT"
] | null | null | null | __init__.py | Gyfis/sequence-comparison | 6506f784af4902645bb4562d507d465d57ed4366 | [
"MIT"
] | null | null | null | __init__.py | Gyfis/sequence-comparison | 6506f784af4902645bb4562d507d465d57ed4366 | [
"MIT"
] | null | null | null | __author__ = 'Gyfis'
| 10.5 | 20 | 0.714286 | 2 | 21 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 21 | 1 | 21 | 21 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 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 |
4b5bb4ca9844073913aec2b03066d89347cb0d6f | 186 | py | Python | bviewer/api/urls.py | b7w/bviewer | 59d5baeeeffd43d69587228ebc5cce1811dc9f63 | [
"MIT"
] | null | null | null | bviewer/api/urls.py | b7w/bviewer | 59d5baeeeffd43d69587228ebc5cce1811dc9f63 | [
"MIT"
] | 3 | 2019-11-20T19:22:55.000Z | 2019-11-20T19:22:55.000Z | bviewer/api/urls.py | b7w/bviewer | 59d5baeeeffd43d69587228ebc5cce1811dc9f63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import url, include
from bviewer.api.versions import version1
urlpatterns = [
url(r'^v1/', include(version1.urls), name='api.v1'),
]
| 18.6 | 56 | 0.672043 | 26 | 186 | 4.807692 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031646 | 0.150538 | 186 | 9 | 57 | 20.666667 | 0.759494 | 0.112903 | 0 | 0 | 0 | 0 | 0.06135 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 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 |
4b5e8794caf5c94a7ccaf8188a73182bce751212 | 640 | py | Python | smoketest.py | darius/greek_to_me | 35c51a61f6dedcf1fb4879cbb37d057cb01e5e98 | [
"MIT"
] | 1 | 2015-10-22T00:02:27.000Z | 2015-10-22T00:02:27.000Z | smoketest.py | darius/greek_to_me | 35c51a61f6dedcf1fb4879cbb37d057cb01e5e98 | [
"MIT"
] | null | null | null | smoketest.py | darius/greek_to_me | 35c51a61f6dedcf1fb4879cbb37d057cb01e5e98 | [
"MIT"
] | null | null | null | import greek_to_me
pundit = greek_to_me.make_pundit('models')
def print_judgement(text):
"Print the top 2 languages for 'text', and their scores."
judgments = pundit.judge(text)
print text
print judgments[:2]
print
print_judgement('Hello, world!')
print_judgement('Hello, world! How are you?')
print_judgement('Hola a el mundo.')
print 'Candidates:', ' '.join(sorted(pundit.get_candidates()))
priors = dict(en=0.6, es=0.2, nl=0.1, it=0.1)
print pundit.best_guess('Hello, world!')
print pundit.best_guess('Hello, world!', priors)
print pundit.best_guess('Hola mundo')
print pundit.best_guess('Hola mundo', priors)
| 25.6 | 62 | 0.717188 | 99 | 640 | 4.494949 | 0.454545 | 0.125843 | 0.134831 | 0.179775 | 0.265169 | 0.265169 | 0 | 0 | 0 | 0 | 0 | 0.018083 | 0.135938 | 640 | 24 | 63 | 26.666667 | 0.786618 | 0 | 0 | 0 | 0 | 0 | 0.271875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.058824 | null | null | 0.705882 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
4b6b818abed39ba79c30f2dc610079f244ff76dd | 367 | py | Python | qfunction/fundamentals/calculus.py | gpftc/qfunction | 5c3ceed0e270d343d51ee0b69d98d4fffad47b24 | [
"MIT"
] | null | null | null | qfunction/fundamentals/calculus.py | gpftc/qfunction | 5c3ceed0e270d343d51ee0b69d98d4fffad47b24 | [
"MIT"
] | null | null | null | qfunction/fundamentals/calculus.py | gpftc/qfunction | 5c3ceed0e270d343d51ee0b69d98d4fffad47b24 | [
"MIT"
] | null | null | null | from numpy import power as pow
from numpy import pi
from sys import float_info as float_h
zero = 44e-15
inf = 1/zero
def limit(f,x,delta_x=zero):
return f(x+delta_x)
def q_exp(u,q=1):
power = lambda q_: 1/(1-q_)
power = limit(power,q)
q_exp_base = lambda q_: pow((1+u*(1-q_)),power)
return limit(q_exp_base,q)
def radian(angle):
return angle*(2*pi)/360
| 15.956522 | 48 | 0.694823 | 77 | 367 | 3.142857 | 0.402597 | 0.049587 | 0.123967 | 0.066116 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045752 | 0.166213 | 367 | 22 | 49 | 16.681818 | 0.745098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.214286 | 0.142857 | 0.642857 | 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 |
4b6c1f93aa0603aaa35412842f6f53fcc9474abe | 303 | py | Python | python/CWE-798/examples/requests-tests.py | chhajershrenik/custom-codeql-queries | b174ddfd84f5503327bd705a64b79c7d4753c4fb | [
"MIT"
] | 13 | 2021-11-15T11:22:41.000Z | 2022-03-15T17:20:29.000Z | python/CWE-798/examples/requests-tests.py | chhajershrenik/custom-codeql-queries | b174ddfd84f5503327bd705a64b79c7d4753c4fb | [
"MIT"
] | 10 | 2021-11-24T17:17:42.000Z | 2022-03-19T17:41:07.000Z | python/CWE-798/examples/requests-tests.py | chhajershrenik/custom-codeql-queries | b174ddfd84f5503327bd705a64b79c7d4753c4fb | [
"MIT"
] | 6 | 2021-11-03T10:04:53.000Z | 2022-03-31T15:55:07.000Z |
from requests import get
from requests.auth import HTTPBasicAuth
def test1():
r = get('https://api.github.com/user', auth=('user', 'mysecretpassword'))
return r.text
def test2():
r = get('https://api.github.com/user', auth=HTTPBasicAuth('user', 'mysecretpassword'))
return r.text
| 18.9375 | 90 | 0.676568 | 40 | 303 | 5.125 | 0.45 | 0.117073 | 0.087805 | 0.117073 | 0.585366 | 0.282927 | 0.282927 | 0.282927 | 0 | 0 | 0 | 0.007874 | 0.161716 | 303 | 15 | 91 | 20.2 | 0.799213 | 0 | 0 | 0.25 | 0 | 0 | 0.311258 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.75 | 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 |
4b706756ca87169aecfe88d24673bcc2c8e0aa51 | 457 | py | Python | demoslogic/blockobjects/tests/test_redirects.py | amstart/demoslogic | 059575b502c21f8f27c66a26abee9a42fcb788b7 | [
"MIT"
] | null | null | null | demoslogic/blockobjects/tests/test_redirects.py | amstart/demoslogic | 059575b502c21f8f27c66a26abee9a42fcb788b7 | [
"MIT"
] | 3 | 2021-06-08T20:04:58.000Z | 2022-03-11T23:26:36.000Z | demoslogic/blockobjects/tests/test_redirects.py | amstart/demoslogic | 059575b502c21f8f27c66a26abee9a42fcb788b7 | [
"MIT"
] | null | null | null | from .base import BlockObjectsTests
class RedirectsIfAnonymous(BlockObjectsTests):
def test_redirects_for_vote(self):
redirect = self.client.post(self.URL_detail())
self.assertRedirects(redirect, self.URL_login_redirect() + self.URL_detail())
def test_redirects_for_premise_creation(self):
redirect = self.client.post(self.URL_create())
self.assertRedirects(redirect, self.URL_login_redirect() + self.URL_create())
| 41.545455 | 85 | 0.750547 | 54 | 457 | 6.074074 | 0.407407 | 0.219512 | 0.182927 | 0.115854 | 0.530488 | 0.530488 | 0.530488 | 0.329268 | 0.329268 | 0 | 0 | 0 | 0.14442 | 457 | 10 | 86 | 45.7 | 0.838875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.125 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4b8a03af6aab0246186b10346531f45bdd139617 | 1,276 | py | Python | tests/select_test.py | stnatter/eventkit | 7cfa052b3de56eeca741474c213aabe492095ce6 | [
"BSD-2-Clause"
] | 88 | 2019-03-17T10:15:43.000Z | 2021-12-28T02:31:35.000Z | tests/select_test.py | stnatter/eventkit | 7cfa052b3de56eeca741474c213aabe492095ce6 | [
"BSD-2-Clause"
] | 4 | 2020-02-09T16:13:13.000Z | 2021-11-08T12:06:24.000Z | tests/select_test.py | stnatter/eventkit | 7cfa052b3de56eeca741474c213aabe492095ce6 | [
"BSD-2-Clause"
] | 13 | 2019-03-19T09:47:19.000Z | 2022-03-27T13:33:32.000Z | import unittest
from eventkit import Event
array = list(range(10))
class SelectTest(unittest.TestCase):
def test_select(self):
event = Event.sequence(array).filter(lambda x: x % 2)
self.assertEqual(event.run(), [x for x in array if x % 2])
def test_skip(self):
event = Event.sequence(array).skip(5)
self.assertEqual(event.run(), array[5:])
def test_take(self):
event = Event.sequence(array).take(5)
self.assertEqual(event.run(), array[:5])
def test_takewhile(self):
event = Event.sequence(array).takewhile(lambda x: x < 5)
self.assertEqual(event.run(), array[:5])
def test_dropwhile(self):
event = Event.sequence(array).dropwhile(lambda x: x < 5)
self.assertEqual(event.run(), array[5:])
def test_changes(self):
array = [1, 1, 2, 1, 2, 2, 2, 3, 1, 4, 4]
event = Event.sequence(array).changes()
self.assertEqual(event.run(), [1, 2, 1, 2, 3, 1, 4])
def test_unique(self):
array = [1, 1, 2, 1, 2, 2, 2, 3, 1, 4, 4]
event = Event.sequence(array).unique()
self.assertEqual(event.run(), [1, 2, 3, 4])
def test_last(self):
event = Event.sequence(array).last()
self.assertEqual(event.run(), [9])
| 29.674419 | 66 | 0.594828 | 184 | 1,276 | 4.081522 | 0.206522 | 0.074567 | 0.191744 | 0.245007 | 0.61518 | 0.399467 | 0.332889 | 0.332889 | 0.332889 | 0.234354 | 0 | 0.047619 | 0.242947 | 1,276 | 42 | 67 | 30.380952 | 0.729814 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.266667 | 1 | 0.266667 | false | 0 | 0.066667 | 0 | 0.366667 | 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 |
4b8c88c67346d6e1158c17e6ed6bc60357dbd23c | 31 | py | Python | ckan_cloud_operator/providers/db/web_ui/constants.py | MuhammadIsmailShahzad/ckan-cloud-operator | 35a4ca88c4908d81d1040a21fca8904e77c4cded | [
"MIT"
] | 14 | 2019-11-18T12:01:03.000Z | 2021-09-15T15:29:50.000Z | ckan_cloud_operator/providers/db/web_ui/constants.py | MuhammadIsmailShahzad/ckan-cloud-operator | 35a4ca88c4908d81d1040a21fca8904e77c4cded | [
"MIT"
] | 52 | 2019-09-09T14:22:41.000Z | 2021-09-29T08:29:24.000Z | ckan_cloud_operator/providers/db/web_ui/constants.py | MuhammadIsmailShahzad/ckan-cloud-operator | 35a4ca88c4908d81d1040a21fca8904e77c4cded | [
"MIT"
] | 8 | 2019-10-05T12:46:25.000Z | 2021-09-15T15:13:05.000Z | PROVIDER_SUBMODULE='db-web-ui'
| 15.5 | 30 | 0.806452 | 5 | 31 | 4.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032258 | 31 | 1 | 31 | 31 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.290323 | 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 |
299a8d4ebcfbdf6fbff169467fd6f22d321b5fa7 | 851 | py | Python | airflow-gen-pwd-hash-from-local.py | teamclairvoyant/airflow-utils | acafbbafd0ca8202cdcb89cd30f294b30112ef7b | [
"Apache-2.0"
] | null | null | null | airflow-gen-pwd-hash-from-local.py | teamclairvoyant/airflow-utils | acafbbafd0ca8202cdcb89cd30f294b30112ef7b | [
"Apache-2.0"
] | null | null | null | airflow-gen-pwd-hash-from-local.py | teamclairvoyant/airflow-utils | acafbbafd0ca8202cdcb89cd30f294b30112ef7b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
from sys import version_info
from flask_bcrypt import generate_password_hash
print("")
PY3 = version_info[0] == 3
args = sys.argv[1:]
REQUIRED_NUM_OF_ARGS = 1
def print_usage_str():
print("""Usage: python airflow-gen-pwd-hash-from-local.py {plain_text_password}""")
print("Argument List: " + str(str(args)))
print("Argument Length: " + str(len(args)))
if len(args) != REQUIRED_NUM_OF_ARGS:
print("Invalid number of Argument. Requires " + str(REQUIRED_NUM_OF_ARGS) + " number of Argument(s). " + str(len(args)) + " provided.")
print_usage_str()
exit(1)
pwd_plain_text = str(args[0]).strip()
print("Password Plain Text: " + str(pwd_plain_text))
pwd_hash = generate_password_hash(pwd_plain_text, 12)
if PY3:
pwd_hash = str(pwd_hash, 'utf-8')
print("")
print("Password Hash: " + str(pwd_hash))
| 23.638889 | 139 | 0.702703 | 132 | 851 | 4.287879 | 0.363636 | 0.061837 | 0.068905 | 0.090106 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015068 | 0.142186 | 851 | 35 | 140 | 24.314286 | 0.760274 | 0.018801 | 0 | 0.090909 | 1 | 0 | 0.256903 | 0.066026 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045455 | false | 0.227273 | 0.136364 | 0 | 0.181818 | 0.454545 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 3 |
299b0a5bb65d857b914119c5e913f541f67936e6 | 10,492 | py | Python | Script&Data/PythonCodeEs3.py | Bellomia/ASD_UniMib | fa800c7c58bc0931910729af88343f60d88e233b | [
"Unlicense"
] | null | null | null | Script&Data/PythonCodeEs3.py | Bellomia/ASD_UniMib | fa800c7c58bc0931910729af88343f60d88e233b | [
"Unlicense"
] | null | null | null | Script&Data/PythonCodeEs3.py | Bellomia/ASD_UniMib | fa800c7c58bc0931910729af88343f60d88e233b | [
"Unlicense"
] | null | null | null | from pylab import *
import numpy as np
import operator
## Search-Routine Parameters
n = 2
mu_exp = 2.0
mu_rifl = 1.0
mu_contr_ex = 1.0/2
mu_contr_int = -1.0/2
mu_red = 1.0/2
## Random Trial Simplex [may need a careful range-definition]
def vertici_iniziali():
import random
random.seed()
vertici=[]
for i in range(n+1):
x=random.uniform(-12,-8);
y=random.uniform(0,3);
vertici.append([x,y])
return vertici
vertex=vertici_iniziali()
x1=vertex[0]
x2=vertex[1]
x3=vertex[2]
## Target Functions [uncomment the desired one]
def f(x,y):
#return -1.0*np.cos(x)*np.cos(y)*np.exp(-((x-np.pi)**2+(y-np.pi)**2)) # EASOM
#return np.exp(0.5*(x**2+y**2-25)**2)+(np.sin(4*x-3*y))**4+0.5*(2*x+y-10)**2 # GOLDSTEIN-PRICE
return 100*abs(y-0.01*x**2)+0.01*abs(x+10) # BUKIN 6th
#return (x+2*y-7)**2+(2*x+y-5)**2 # BOOTH
data_x=[x1,x2,x3]
data_f=[f(x1[0],x1[1]),f(x2[0],x2[1]),f(x3[0],x3[1])]
data=[[f(x1[0],x1[1]),x1],[f(x2[0],x2[1]),x2],[f(x3[0],x3[1]),x3]]
print (data)
## Ordering [increasing f(x)]
data=sorted(data,key=operator.itemgetter(0))
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'f(trial simplex)')
print ( data_x ,'trial simplex')
## Plotting the Target Function and the Trial Simplex
xvec = np.linspace(-12, -8, 1000)
yvec = np.linspace(-0, 3, 1000)
X,Y = np.meshgrid(xvec, yvec)
Z = f(X, Y).T
fig, ax = subplots()
im = imshow(Z, cmap=cm.magma, vmin=Z.min(), vmax=Z.max(), extent=[-12, -8, 0, 3])
im.set_interpolation('bilinear')
cb = fig.colorbar(im)
Xvertex = np.array([])
Yvertex = np.array([])
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='green', edgecolor='black', s=200)
coord = data_x
coord.append(coord[0]) # have to repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # creates lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--') # Polytope draws up
## Evolving the Simplex
epsilon = 10**(-5) # See...
loop=1
while data_f[n]- data_f[0] > epsilon: # ...this!
loop=loop+1
## Centroid
a=np.array(data_x[0:n])
a=a/n
xc=a.sum(axis=0)
xr=(1+mu_rifl)*xc-mu_rifl*np.array(data_x[n])
fr=f(xr[0],xr[1])
print ( fr, 'fr')
## Reflection step
if data_f[0]<=fr<data_f[n-1]:
data[n][1]=xr
data[n][0]=f(xr[0],xr[1])
data=sorted(data,key=operator.itemgetter(0))
print('loop',loop,'riflessione')
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'valori funzione ')
print ( data_x ,'vertici ')
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='white', edgecolor='black')
coord = data_x
coord.append(coord[0]) # repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # create lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--')
continue
## Expansion step
if fr<data_f[0]:
a=np.array(data_x[0:n])
a=a/n
xc=a.sum(axis=0)
xe=(1+mu_exp)*xc-mu_exp*np.array(data_x[n])
fe=f(xe[0],xe[1])
if fe<fr:
data[n][1]=xe
data[n][0]=f(xe[0],xe[1])
data=sorted(data,key=operator.itemgetter(0))
print('loop' ,loop,'espansione')
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'valori funzione ')
print ( data_x ,'vertici ')
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='white', edgecolor='black')
coord = data_x
coord.append(coord[0]) # repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # create lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--')
continue
else:
data[n][1]=xr
data[n][0]=f(xr[0],xr[1])
data=sorted(data,key=operator.itemgetter(0))
print('loop',loop,'riflessione')
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'valori funzione ')
print ( data_x ,'vertici ')
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='white', edgecolor='black')
coord = data_x
coord.append(coord[0]) # repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # create lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--')
continue
## External-Contraction step
if data_f[n-1]<=fr<data_f[n]:
a=np.array(data_x[0:n])
a=a/n
xc=a.sum(axis=0)
xoc=(1+mu_contr_ex)*xc-mu_contr_ex*np.array(data_x[n])
foc=f(xoc[0],xoc[1])
if foc<fr:
data[n][1]=xoc
data[n][0]=f(xoc[0],xoc[1])
data=sorted(data,key=operator.itemgetter(0))
print( 'loop' ,loop,'contrazione esterna')
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'valori funzione ')
print ( data_x ,'vertici ')
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='white', edgecolor='black')
coord = data_x
coord.append(coord[0]) # repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # create lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--')
continue
## Reduction step [!]
else:
a=np.array(data_x)
for i in range(1,n+1):
data[i][1]=a[0]+mu_red*(a[i]-a[0])
data[i][0]=f(data[i][1][0],data[i][1][1])
data=sorted(data,key=operator.itemgetter(0))
print('loop',loop,'riduzione')
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'valori funzione ')
print ( data_x ,'vertici ')
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='white', edgecolor='black')
coord = data_x
coord.append(coord[0]) # repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # create lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--')
continue
## Internal-Contraction step
if fr>=data_f[n]:
a=np.array(data_x[0:n])
a=a/n
xc=a.sum(axis=0)
xic=(1+mu_contr_int)*xc-mu_contr_int*np.array(data_x[n])
fic=f(xic[0],xic[1])
if fic<data_f[n]:
data[n][1]=xic
data[n][0]=f(xic[0],xic[1])
data=sorted(data,key=operator.itemgetter(0))
print('loop',loop ,'contrazione interna')
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'valori funzione ')
print ( data_x ,'vertici ')
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='white', edgecolor='black')
coord = data_x
coord.append(coord[0]) # repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # create lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--')
continue
## Reduction step [!]
else:
a=np.array(data_x)
for i in range(1,n+1):
data[i][1]=a[0]+mu_red*(a[i]-a[0])
data[i][0]=f(data[i][1][0],data[i][1][1])
data=sorted(data,key=operator.itemgetter(0))
print('loop',loop, 'riduzione')
data_f= [item[0] for item in data]
data_x= [item[1] for item in data]
print (data_f, 'valori funzione ')
print ( data_x ,'vertici ')
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='white', edgecolor='black')
coord = data_x
coord.append(coord[0]) # repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) # create lists of x and y values
plt.plot(xs,ys, color='white', alpha=0.3, ls='--')
continue
## Plotting the Final Simplex [a single point if the routine has converged!]
Xvertex = np.array([])
Yvertex = np.array([])
for i in range(n+1):
Xvertex = np.append(Xvertex, data_x[i][0])
Yvertex = np.append(Yvertex, data_x[i][1])
plt.scatter(Xvertex,Yvertex, color='red', edgecolor='black', s=100)
## Showing all the plots...
plt.show()
| 30.323699 | 97 | 0.501048 | 1,527 | 10,492 | 3.375246 | 0.121807 | 0.051416 | 0.020955 | 0.040357 | 0.741366 | 0.708964 | 0.708964 | 0.69286 | 0.69286 | 0.69286 | 0 | 0.03845 | 0.345597 | 10,492 | 345 | 98 | 30.411594 | 0.712205 | 0.135055 | 0 | 0.680556 | 0 | 0 | 0.051785 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009259 | false | 0 | 0.018519 | 0.00463 | 0.037037 | 0.115741 | 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 |
29ba66d9be22808cb28070a02f5e28c8bc9c2caa | 2,608 | py | Python | foiamachine/apps/requests/management/commands/set_request_stats.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | 9 | 2017-08-02T16:28:10.000Z | 2021-07-19T09:51:46.000Z | foiamachine/apps/requests/management/commands/set_request_stats.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | null | null | null | foiamachine/apps/requests/management/commands/set_request_stats.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | 5 | 2017-10-10T23:15:02.000Z | 2021-07-19T09:51:48.000Z | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User, Group
from apps.mail.models import MailBox
from django.core.cache import cache
from apps.requests.models import Request
import logging
from datetime import datetime
import os
import pytz
import workdays
logger = logging.getLogger('default')
class Command(BaseCommand):
'''
Find messages and set the stats where someone responded who was part of the initial request
'''
def handle(self, *args, **options):
therequests = Request.objects.filter(government__isnull=False)
for req in therequests.filter(status__in=['R','P','F']):
mb = MailBox.objects.get(usr=req.author)
messages = mb.get_threads(req.id)
contacts = req.contacts.all()
for msg in messages:
for contact in contacts:
for email in contact.emails.all():
if(msg.email_from == email.content):
holidays = req.government.get_holiday_dates
req.first_response_time = workdays.networkdays(req.scheduled_send_date, msg.dated, holidays)
req.save()
print "HERE %s %s %s" % (msg.email_from, msg.dated, req.first_response_time)
'''
TODO
add logic to find the last contact date
set whether it was overdue
add UI element to mark a message as the agency's response
(how would this work bc users can forward a message so the date needs to be accurately counted)
add a UI field for date input, so you can scroll down to the message click mark this and add the date of the response
add UI element to mark a request as part of the official stats
can we use groups instead of a flag? that way we can do periodic studies to see how things improve / degrade...
would need more of an admin interaface to create a stats group, add requests to it and view stats by group
'''
for req in therequests.filter(status__in=['F']).filter(scheduled_send_date__isnull=False):
now = datetime.now(tz=pytz.utc)
holidays = req.government.get_holiday_dates
req.lifetime = workdays.networkdays(req.scheduled_send_date, now, holidays)
req.save()
| 53.22449 | 149 | 0.595859 | 325 | 2,608 | 4.704615 | 0.464615 | 0.028777 | 0.033355 | 0.024853 | 0.170046 | 0.170046 | 0.094179 | 0 | 0 | 0 | 0 | 0 | 0.340491 | 2,608 | 48 | 150 | 54.333333 | 0.888953 | 0 | 0 | 0.129032 | 0 | 0 | 0.015287 | 0 | 0 | 0 | 0 | 0.020833 | 0 | 0 | null | null | 0 | 0.322581 | null | null | 0.032258 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
29dc3f0536cdbab196ab32232035af8a48ed7ca4 | 1,519 | py | Python | nylas/client/errors.py | Tesorio/nylas-python | 6f390610b95c807655db8da5286005241f5061fa | [
"MIT"
] | null | null | null | nylas/client/errors.py | Tesorio/nylas-python | 6f390610b95c807655db8da5286005241f5061fa | [
"MIT"
] | null | null | null | nylas/client/errors.py | Tesorio/nylas-python | 6f390610b95c807655db8da5286005241f5061fa | [
"MIT"
] | null | null | null | import json
class APIClientError(Exception):
def __init__(self, **kwargs):
if 'message' in kwargs:
Exception.__init__(self, kwargs['message'])
else:
Exception.__init__(self, '')
self.attrs = kwargs.keys()
for key, value in kwargs.items():
setattr(self, key, value)
def as_dict(self):
resp = {}
for attr in self.attrs:
resp[attr] = getattr(self, attr)
return resp
def __str__(self):
return json.dumps(self.as_dict())
class ConnectionError(APIClientError):
pass
class NotAuthorizedError(APIClientError):
pass
class InvalidRequestError(APIClientError):
pass
class MessageRejectedError(APIClientError):
pass
class ConflictError(APIClientError):
pass
class SendingQuotaExceededError(APIClientError):
pass
class NotFoundError(APIClientError):
pass
class MethodNotSupportedError(APIClientError):
pass
class ServerError(APIClientError):
pass
class ServiceUnavailableError(APIClientError):
pass
class ServerTimeoutError(APIClientError):
pass
class FileUploadError(APIClientError):
pass
STATUS_MAP = {
400: InvalidRequestError,
401: NotAuthorizedError,
402: MessageRejectedError,
403: NotAuthorizedError,
404: NotFoundError,
405: MethodNotSupportedError,
409: ConflictError,
429: SendingQuotaExceededError,
500: ServerError,
503: ServiceUnavailableError,
504: ServerTimeoutError,
}
| 17.662791 | 55 | 0.684003 | 134 | 1,519 | 7.61194 | 0.402985 | 0.211765 | 0.248039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028351 | 0.233706 | 1,519 | 85 | 56 | 17.870588 | 0.847938 | 0 | 0 | 0.222222 | 0 | 0 | 0.009217 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | false | 0.222222 | 0.018519 | 0.018519 | 0.351852 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
4b1b1806e6824c2eeb2707c238d81fc988d1e53f | 2,612 | py | Python | src/abaqus/Material/Plastic/Concrete/FailureRatios.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | 7 | 2022-01-21T09:15:45.000Z | 2022-02-15T09:31:58.000Z | src/abaqus/Material/Plastic/Concrete/FailureRatios.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | src/abaqus/Material/Plastic/Concrete/FailureRatios.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | from abaqusConstants import *
class FailureRatios:
"""The FailureRatios object specifies the shape of the failure surface for a Concrete
model.
Notes
-----
This object can be accessed by:
.. code-block:: python
import material
mdb.models[name].materials[name].concrete.failureRatios
import odbMaterial
session.odbs[name].materials[name].concrete.failureRatios
The table data for this object are:
- Ratio of the ultimate biaxial compressive stress to the uniaxial compressive ultimate stress. The default value is 1.16.
- Absolute value of the ratio of the uniaxial tensile stress at failure to the uniaxial compressive stress at failure. The default value is 0.09.
- Ratio of the magnitude of a principal component of Plastic strain at ultimate stress in biaxial compression to the Plastic strain at ultimate stress in uniaxial compression. The default value is 1.28.
- Ratio of the tensile principal stress value at shear in plane stress, when the other nonzero principal stress component is at the ultimate compressive stress value, to the tensile cracking stress under uniaxial tension. The default value is 1/3.
- Temperature, if the data depend on temperature.
- Value of the first field variable, if the data depend on field variables.
- Value of the second field variable.
- Etc.
The corresponding analysis keywords are:
- FAILURE RATIOS
"""
def __init__(self, table: tuple, temperatureDependency: Boolean = OFF, dependencies: int = 0):
"""This method creates a FailureRatios object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].materials[name].concrete.FailureRatios
session.odbs[name].materials[name].concrete.FailureRatios
Parameters
----------
table
A sequence of sequences of Floats specifying the items described below.
temperatureDependency
A Boolean specifying whether the data depend on temperature. The default value is OFF.
dependencies
An Int specifying the number of field variable dependencies. The default value is 0.
Returns
-------
A FailureRatios object.
Raises
------
RangeError
"""
pass
def setValues(self):
"""This method modifies the FailureRatios object.
Raises
------
RangeError
"""
pass
| 34.826667 | 251 | 0.652374 | 308 | 2,612 | 5.519481 | 0.366883 | 0.023529 | 0.052941 | 0.06 | 0.325294 | 0.184706 | 0.148235 | 0 | 0 | 0 | 0 | 0.006985 | 0.287519 | 2,612 | 74 | 252 | 35.297297 | 0.906502 | 0.784074 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.333333 | 0.166667 | 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 |
d9a71c3f7029848ff9c31a76ba94e6b3728abca0 | 1,548 | py | Python | ToOptix/FEMPy/Material.py | joha2/ToOptixCore | 8ad17dcee349173a1b000c28de66e567ba2ad7a1 | [
"MIT"
] | null | null | null | ToOptix/FEMPy/Material.py | joha2/ToOptixCore | 8ad17dcee349173a1b000c28de66e567ba2ad7a1 | [
"MIT"
] | null | null | null | ToOptix/FEMPy/Material.py | joha2/ToOptixCore | 8ad17dcee349173a1b000c28de66e567ba2ad7a1 | [
"MIT"
] | null | null | null |
class Elasticity(object):
def __init__(self, young_module, contraction, temperature):
self.__temperature = temperature
self.__contraction = contraction
self.__young_module = young_module
def get_temperature(self):
return self.__temperature
def get_contraction(self):
return self.__contraction
def get_young_module(self):
return self.__young_module
class Conductivity(object):
def __init__(self, conductivity, temperature):
self.__temperature = temperature
self.__conductivity = conductivity
def get_temperature(self):
return self.__temperature
def get_conductivity(self):
return self.__conductivity
class Material(object):
def __init__(self, name):
self.__name = name
self.__elasticity = []
self.__conductivity = []
def add_elasticity(self, young_module=70000, contraction=0.3, temperature=0.0):
self.__elasticity.append(Elasticity(young_module, contraction, temperature))
def add_conductivity(self, conductivity=250, temperature=0.0):
self.__conductivity.append(Conductivity(conductivity, temperature))
def get_name(self):
return self.__name
def __str__(self):
return ('Name: {} Elasticity entrys: {} Conductivity entrys: {} '.format(
self.__name, len(self.__elasticity), len(self.__conductivity)))
def get_elasticity(self):
return self.__elasticity
def get_conductivity(self):
return self.__conductivity
| 25.8 | 84 | 0.687984 | 161 | 1,548 | 6.149068 | 0.15528 | 0.090909 | 0.113131 | 0.051515 | 0.262626 | 0.179798 | 0.179798 | 0.09697 | 0.09697 | 0 | 0 | 0.011638 | 0.222868 | 1,548 | 59 | 85 | 26.237288 | 0.811305 | 0 | 0 | 0.27027 | 0 | 0 | 0.035599 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.378378 | false | 0 | 0 | 0.243243 | 0.702703 | 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 |
d9c3e1450ed2e1353b4c2d9bd36d48facc535f44 | 125 | py | Python | demosite/quotes/urls.py | nathan-gilbert/django-template | bdacb16a1a04f635aff14d3fcb7d36ccca53d5f6 | [
"MIT"
] | null | null | null | demosite/quotes/urls.py | nathan-gilbert/django-template | bdacb16a1a04f635aff14d3fcb7d36ccca53d5f6 | [
"MIT"
] | 5 | 2021-03-19T01:32:07.000Z | 2021-09-22T18:49:58.000Z | demosite/quotes/urls.py | nathan-gilbert/django-template | bdacb16a1a04f635aff14d3fcb7d36ccca53d5f6 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('api/quotes/', views.QuoteListCreate.as_view())
]
| 17.857143 | 56 | 0.72 | 16 | 125 | 5.5625 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152 | 125 | 6 | 57 | 20.833333 | 0.839623 | 0 | 0 | 0 | 0 | 0 | 0.088 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 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 |
d9ea787b37dffbeca4e871e5fa8329525794bc49 | 8,698 | py | Python | entmax/losses.py | cifkao/entmax | f18bab9318f9d2471a36545ee0b4c97be6d48a87 | [
"MIT"
] | 298 | 2019-06-27T10:25:27.000Z | 2022-03-17T19:01:19.000Z | entmax/losses.py | cifkao/entmax | f18bab9318f9d2471a36545ee0b4c97be6d48a87 | [
"MIT"
] | 20 | 2019-08-06T19:07:13.000Z | 2022-03-30T09:37:25.000Z | entmax/losses.py | cifkao/entmax | f18bab9318f9d2471a36545ee0b4c97be6d48a87 | [
"MIT"
] | 29 | 2019-08-05T20:48:07.000Z | 2022-03-30T09:07:54.000Z | import torch
import torch.nn as nn
from torch.autograd import Function
from entmax.activations import sparsemax, entmax15
from entmax.root_finding import entmax_bisect, sparsemax_bisect
class _GenericLoss(nn.Module):
def __init__(self, ignore_index=-100, reduction="elementwise_mean"):
assert reduction in ["elementwise_mean", "sum", "none"]
self.reduction = reduction
self.ignore_index = ignore_index
super(_GenericLoss, self).__init__()
def forward(self, X, target):
loss = self.loss(X, target)
if self.ignore_index >= 0:
ignored_positions = target == self.ignore_index
size = float((target.size(0) - ignored_positions.sum()).item())
loss.masked_fill_(ignored_positions, 0.0)
else:
size = float(target.size(0))
if self.reduction == "sum":
loss = loss.sum()
elif self.reduction == "elementwise_mean":
loss = loss.sum() / size
return loss
class _GenericLossFunction(Function):
@classmethod
def forward(cls, ctx, X, target, alpha, proj_args):
"""
X (FloatTensor): n x num_classes
target (LongTensor): n, the indices of the target classes
"""
assert X.shape[0] == target.shape[0]
p_star = cls.project(X, alpha, **proj_args)
loss = cls.omega(p_star, alpha)
p_star.scatter_add_(1, target.unsqueeze(1), torch.full_like(p_star, -1))
loss += torch.einsum("ij,ij->i", p_star, X)
ctx.save_for_backward(p_star)
return loss
@classmethod
def backward(cls, ctx, grad_output):
p_star, = ctx.saved_tensors
grad = grad_output.unsqueeze(1) * p_star
ret = (grad,)
# pad with as many Nones as needed
return ret + (None,) * (1 + cls.n_fwd_args)
class SparsemaxLossFunction(_GenericLossFunction):
n_fwd_args = 1
@classmethod
def project(cls, X, alpha, k):
return sparsemax(X, dim=-1, k=k)
@classmethod
def omega(cls, p_star, alpha):
return (1 - (p_star ** 2).sum(dim=1)) / 2
@classmethod
def forward(cls, ctx, X, target, k=None):
return super().forward(ctx, X, target, alpha=2, proj_args=dict(k=k))
class SparsemaxBisectLossFunction(_GenericLossFunction):
n_fwd_args = 1
@classmethod
def project(cls, X, alpha, n_iter):
return sparsemax_bisect(X, n_iter=n_iter)
@classmethod
def omega(cls, p_star, alpha):
return (1 - (p_star ** 2).sum(dim=1)) / 2
@classmethod
def forward(cls, ctx, X, target, n_iter=50):
return super().forward(
ctx, X, target, alpha=2, proj_args=dict(n_iter=n_iter)
)
class Entmax15LossFunction(_GenericLossFunction):
n_fwd_args = 1
@classmethod
def project(cls, X, alpha, k=None):
return entmax15(X, dim=-1, k=k)
@classmethod
def omega(cls, p_star, alpha):
return (1 - (p_star * torch.sqrt(p_star)).sum(dim=1)) / 0.75
@classmethod
def forward(cls, ctx, X, target, k=None):
return super().forward(ctx, X, target, alpha=1.5, proj_args=dict(k=k))
class EntmaxBisectLossFunction(_GenericLossFunction):
n_fwd_args = 2
@classmethod
def project(cls, X, alpha, n_iter):
return entmax_bisect(X, alpha=alpha, n_iter=n_iter, ensure_sum_one=True)
@classmethod
def omega(cls, p_star, alpha):
return (1 - (p_star ** alpha).sum(dim=1)) / (alpha * (alpha - 1))
@classmethod
def forward(cls, ctx, X, target, alpha=1.5, n_iter=50):
return super().forward(
ctx, X, target, alpha, proj_args=dict(n_iter=n_iter)
)
def sparsemax_loss(X, target, k=None):
"""sparsemax loss: sparse alternative to cross-entropy
Computed using a partial sorting strategy.
Parameters
----------
X : torch.Tensor, shape=(n_samples, n_classes)
The input 2D tensor of predicted scores
target : torch.LongTensor, shape=(n_samples,)
The ground truth labels, 0 <= target < n_classes.
k : int or None
number of largest elements to partial-sort over. For optimal
performance, should be slightly bigger than the expected number of
nonzeros in the solution. If the solution is more than k-sparse,
this function is recursively called with a 2*k schedule.
If `None`, full sorting is performed from the beginning.
Returns
-------
losses, torch.Tensor, shape=(n_samples,)
The loss incurred at each sample.
"""
return SparsemaxLossFunction.apply(X, target, k)
def sparsemax_bisect_loss(X, target, n_iter=50):
"""sparsemax loss: sparse alternative to cross-entropy
Computed using bisection.
Parameters
----------
X : torch.Tensor, shape=(n_samples, n_classes)
The input 2D tensor of predicted scores
target : torch.LongTensor, shape=(n_samples,)
The ground truth labels, 0 <= target < n_classes.
n_iter : int
Number of bisection iterations. For float32, 24 iterations should
suffice for machine precision.
Returns
-------
losses, torch.Tensor, shape=(n_samples,)
The loss incurred at each sample.
"""
return SparsemaxBisectLossFunction.apply(X, target, n_iter)
def entmax15_loss(X, target, k=None):
"""1.5-entmax loss: sparse alternative to cross-entropy
Computed using a partial sorting strategy.
Parameters
----------
X : torch.Tensor, shape=(n_samples, n_classes)
The input 2D tensor of predicted scores
target : torch.LongTensor, shape=(n_samples,)
The ground truth labels, 0 <= target < n_classes.
k : int or None
number of largest elements to partial-sort over. For optimal
performance, should be slightly bigger than the expected number of
nonzeros in the solution. If the solution is more than k-sparse,
this function is recursively called with a 2*k schedule.
If `None`, full sorting is performed from the beginning.
Returns
-------
losses, torch.Tensor, shape=(n_samples,)
The loss incurred at each sample.
"""
return Entmax15LossFunction.apply(X, target, k)
def entmax_bisect_loss(X, target, alpha=1.5, n_iter=50):
"""alpha-entmax loss: sparse alternative to cross-entropy
Computed using bisection, supporting arbitrary alpha > 1.
Parameters
----------
X : torch.Tensor, shape=(n_samples, n_classes)
The input 2D tensor of predicted scores
target : torch.LongTensor, shape=(n_samples,)
The ground truth labels, 0 <= target < n_classes.
alpha : float or torch.Tensor
Tensor of alpha parameters (> 1) to use for each row of X. If scalar
or python float, the same value is used for all rows. A value of
alpha=2 corresponds to sparsemax, and alpha=1 would in theory recover
softmax. For numeric reasons, this algorithm does not work with `alpha=1`:
if you want softmax, we recommend `torch.nn.softmax`
n_iter : int
Number of bisection iterations. For float32, 24 iterations should
suffice for machine precision.
Returns
-------
losses, torch.Tensor, shape=(n_samples,)
The loss incurred at each sample.
"""
return EntmaxBisectLossFunction.apply(X, target, alpha, n_iter)
class SparsemaxBisectLoss(_GenericLoss):
def __init__(
self, n_iter=50, ignore_index=-100, reduction="elementwise_mean"
):
self.n_iter = n_iter
super(SparsemaxBisectLoss, self).__init__(ignore_index, reduction)
def loss(self, X, target):
return sparsemax_bisect_loss(X, target, self.n_iter)
class SparsemaxLoss(_GenericLoss):
def __init__(self, k=None, ignore_index=-100, reduction="elementwise_mean"):
self.k = k
super(SparsemaxLoss, self).__init__(ignore_index, reduction)
def loss(self, X, target):
return sparsemax_loss(X, target, self.k)
class EntmaxBisectLoss(_GenericLoss):
def __init__(
self,
alpha=1.5,
n_iter=50,
ignore_index=-100,
reduction="elementwise_mean",
):
self.alpha = alpha
self.n_iter = n_iter
super(EntmaxBisectLoss, self).__init__(ignore_index, reduction)
def loss(self, X, target):
return entmax_bisect_loss(X, target, self.alpha, self.n_iter)
class Entmax15Loss(_GenericLoss):
def __init__(self, k=100, ignore_index=-100, reduction="elementwise_mean"):
self.k = k
super(Entmax15Loss, self).__init__(ignore_index, reduction)
def loss(self, X, target):
return entmax15_loss(X, target, self.k)
| 30.30662 | 82 | 0.648655 | 1,155 | 8,698 | 4.726407 | 0.170563 | 0.034622 | 0.028577 | 0.024913 | 0.642425 | 0.591317 | 0.570251 | 0.564389 | 0.545888 | 0.509984 | 0 | 0.017525 | 0.245574 | 8,698 | 286 | 83 | 30.412587 | 0.814386 | 0.35215 | 0 | 0.333333 | 0 | 0 | 0.02457 | 0 | 0 | 0 | 0 | 0 | 0.015504 | 1 | 0.217054 | false | 0 | 0.03876 | 0.124031 | 0.542636 | 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 |
d9ecd53612e6e48d1e9fed86b3d505b4508c87a3 | 199 | py | Python | minette/datastore/storeset.py | uezo/minette-python | dd8cd7d244b6e6e4133c8e73d637ded8a8c6846f | [
"Apache-2.0"
] | 31 | 2017-12-18T15:35:42.000Z | 2021-12-16T07:27:33.000Z | minette/datastore/storeset.py | uezo/minette-python | dd8cd7d244b6e6e4133c8e73d637ded8a8c6846f | [
"Apache-2.0"
] | 17 | 2017-07-13T22:25:08.000Z | 2020-11-02T14:19:32.000Z | minette/datastore/storeset.py | uezo/minette-python | dd8cd7d244b6e6e4133c8e73d637ded8a8c6846f | [
"Apache-2.0"
] | 2 | 2017-09-14T09:28:35.000Z | 2021-01-17T12:31:54.000Z | """ Base class for set of data stores and connection provider for them """
class StoreSet:
connection_provider = None
context_store = None
user_store = None
messagelog_store = None
| 22.111111 | 74 | 0.713568 | 26 | 199 | 5.307692 | 0.653846 | 0.195652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.231156 | 199 | 8 | 75 | 24.875 | 0.901961 | 0.331658 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 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 |
d9f089053fa322ad9ec933d7f5a7bc26f2e22c23 | 350 | py | Python | SubtleMonkey/End.py | Ingener74/Olive-Moon | d86336587a58fecc6920e886df23c2db6dfcfecc | [
"MIT"
] | null | null | null | SubtleMonkey/End.py | Ingener74/Olive-Moon | d86336587a58fecc6920e886df23c2db6dfcfecc | [
"MIT"
] | null | null | null | SubtleMonkey/End.py | Ingener74/Olive-Moon | d86336587a58fecc6920e886df23c2db6dfcfecc | [
"MIT"
] | null | null | null | # encoding: utf8
class End(object):
def __init__(self, connection=None):
self.connection = connection
self.__point = None
def paint(self, painter, point):
self.connection.paint(painter, self, point)
def set_point(self, point):
self.__point = point
def get_point(self):
return self.__point
| 20.588235 | 51 | 0.637143 | 42 | 350 | 5.02381 | 0.380952 | 0.21327 | 0.132701 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003876 | 0.262857 | 350 | 16 | 52 | 21.875 | 0.813953 | 0.04 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.1 | 0.6 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8a082e533082f71e393661098ec6a2598c1c2404 | 112 | py | Python | Python_Basics/04_Nested_Conditional_Statements/05_Invalid_Number.py | Dochko0/Python | e9612c4e842cfd3d9a733526cc7485765ef2238f | [
"MIT"
] | null | null | null | Python_Basics/04_Nested_Conditional_Statements/05_Invalid_Number.py | Dochko0/Python | e9612c4e842cfd3d9a733526cc7485765ef2238f | [
"MIT"
] | null | null | null | Python_Basics/04_Nested_Conditional_Statements/05_Invalid_Number.py | Dochko0/Python | e9612c4e842cfd3d9a733526cc7485765ef2238f | [
"MIT"
] | null | null | null | num = float(input())
if (100 > num or num > 200) and num != 0:
print("invalid")
elif num == 0:
print()
| 16 | 41 | 0.544643 | 18 | 112 | 3.388889 | 0.666667 | 0.131148 | 0.295082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097561 | 0.267857 | 112 | 6 | 42 | 18.666667 | 0.646341 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8a253e5f248c367cc578526f2dcd7e6e214a9973 | 73 | py | Python | module-1/fichier7.py | sven-borden/python-academy-21 | e4657faae5cfb819e6a3eac67aa848ddc74065f7 | [
"MIT"
] | null | null | null | module-1/fichier7.py | sven-borden/python-academy-21 | e4657faae5cfb819e6a3eac67aa848ddc74065f7 | [
"MIT"
] | null | null | null | module-1/fichier7.py | sven-borden/python-academy-21 | e4657faae5cfb819e6a3eac67aa848ddc74065f7 | [
"MIT"
] | null | null | null | i = 0
while True:
print(i)
i = i + 1
| 2.212121 | 13 | 0.273973 | 9 | 73 | 2.222222 | 0.666667 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 0.643836 | 73 | 32 | 14 | 2.28125 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8a3958e1f1ad3c9bb8f7defc99e992c656fc7ac1 | 26 | py | Python | jasper_erpnext_report/utils/__init__.py | Zyten/jasper_erpnext_report | 499fc07d9e1b7e7393d392e1544366ab176ca8ef | [
"MIT"
] | 27 | 2015-07-07T11:43:24.000Z | 2022-03-12T03:46:10.000Z | jasper_erpnext_report/utils/__init__.py | Zyten/jasper_erpnext_report | 499fc07d9e1b7e7393d392e1544366ab176ca8ef | [
"MIT"
] | 13 | 2015-11-10T14:25:18.000Z | 2021-12-20T06:23:30.000Z | jasper_erpnext_report/utils/__init__.py | Zyten/jasper_erpnext_report | 499fc07d9e1b7e7393d392e1544366ab176ca8ef | [
"MIT"
] | 27 | 2015-05-21T21:16:56.000Z | 2021-09-05T17:40:10.000Z | __author__ = 'luissaguas'
| 13 | 25 | 0.769231 | 2 | 26 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 26 | 1 | 26 | 26 | 0.695652 | 0 | 0 | 0 | 0 | 0 | 0.384615 | 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 |
8a3c4092e252bc763369e63217e7ccff8363bf89 | 22,298 | py | Python | our_scripts/deprecated/run_all_Tiger.py | shrivats-pu/Prescient | 3d4238e98ddd767e2b81adc4091bb723dbf563d3 | [
"BSD-3-Clause"
] | 1 | 2021-10-14T20:39:50.000Z | 2021-10-14T20:39:50.000Z | our_scripts/deprecated/run_all_Tiger.py | shrivats-pu/Prescient | 3d4238e98ddd767e2b81adc4091bb723dbf563d3 | [
"BSD-3-Clause"
] | null | null | null | our_scripts/deprecated/run_all_Tiger.py | shrivats-pu/Prescient | 3d4238e98ddd767e2b81adc4091bb723dbf563d3 | [
"BSD-3-Clause"
] | null | null | null | # run_all_Tiger.py: version of script to run on tiger with many runs and Gurobi
# authors: Ethan Reese, Arvind Shrivats
# email: ereese@princeton.edu, shrivats@princeton.edu
# created: June 8, 2021
# first, we'll use the built-in function to download the RTS-GMLC system to Prescicent/downloads/rts_gmlc
import prescient.downloaders.rts_gmlc as rts_downloader
import prescient.scripts.runner as runner
import os
import pandas as pd
import shutil
import numpy as np
import time
os.chdir("..")
os.chdir("..")
# the download function has the path Prescient/downloads/rts_gmlc hard-coded.
# We don't need the code below as long as we've already downloaded the RTS data into the repo (or run rts_gmlc.py)
# All it does is a 'git clone' of the RTS-GMLC repo
# rts_downloader.download()
# did_download = rts_downloader.download()
# if did_download:
# rts_downloader.copy_templates()
# rts_downloader.populate_input_data()
# variables to adjust:
runs = 750
directory_out = "--output-directory=output"
dir_path = "./rts_gmlc"
path_template = "./scenario_"
# all zone 1 file paths
file_paths_combined = ['./timeseries_data_files/101_PV_1_forecasts_actuals.csv','./timeseries_data_files/101_PV_2_forecasts_actuals.csv',
'./timeseries_data_files/101_PV_3_forecasts_actuals.csv','./timeseries_data_files/101_PV_4_forecasts_actuals.csv',
'./timeseries_data_files/102_PV_1_forecasts_actuals.csv','./timeseries_data_files/102_PV_2_forecasts_actuals.csv',
'./timeseries_data_files/103_PV_1_forecasts_actuals.csv','./timeseries_data_files/104_PV_1_forecasts_actuals.csv',
'./timeseries_data_files/113_PV_1_forecasts_actuals.csv','./timeseries_data_files/118_RTPV_1_forecasts_actuals.csv',
'./timeseries_data_files/118_RTPV_2_forecasts_actuals.csv','./timeseries_data_files/118_RTPV_3_forecasts_actuals.csv',
'./timeseries_data_files/118_RTPV_4_forecasts_actuals.csv','./timeseries_data_files/118_RTPV_5_forecasts_actuals.csv',
'./timeseries_data_files/118_RTPV_6_forecasts_actuals.csv','./timeseries_data_files/118_RTPV_7_forecasts_actuals.csv',
'./timeseries_data_files/118_RTPV_8_forecasts_actuals.csv','./timeseries_data_files/118_RTPV_9_forecasts_actuals.csv',
'./timeseries_data_files/118_RTPV_10_forecasts_actuals.csv','./timeseries_data_files/119_PV_1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_101_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_102_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_103_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_104_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_105_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_106_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_107_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_108_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_109_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_110_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_111_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_112_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_113_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_114_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_115_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_116_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_117_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_118_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_119_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_120_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_121_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_122_Load_zone1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_123_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_124_Load_zone1_forecasts_actuals.csv','./timeseries_data_files/Bus_214_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_223_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/215_PV_1_forecasts_actuals.csv', './timeseries_data_files/Bus_210_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/213_RTPV_1_forecasts_actuals.csv', './timeseries_data_files/Bus_218_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/222_HYDRO_2_forecasts_actuals.csv', './timeseries_data_files/Bus_207_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/201_HYDRO_4_forecasts_actuals.csv', './timeseries_data_files/Bus_203_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_204_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/RTPV_zone2_forecasts_actuals.csv',
'./timeseries_data_files/215_HYDRO_3_forecasts_actuals.csv', './timeseries_data_files/Hydro_zone2_forecasts_actuals.csv',
'./timeseries_data_files/222_HYDRO_4_forecasts_actuals.csv', './timeseries_data_files/215_HYDRO_1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_217_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_220_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_208_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/222_HYDRO_6_forecasts_actuals.csv',
'./timeseries_data_files/Bus_213_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_224_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_202_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_219_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_206_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/222_HYDRO_1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_211_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/222_HYDRO_3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_222_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_215_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/222_HYDRO_5_forecasts_actuals.csv', './timeseries_data_files/Bus_212_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_221_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_216_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/PV_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_209_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/215_HYDRO_2_forecasts_actuals.csv', './timeseries_data_files/Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_201_Load_zone2_forecasts_actuals.csv', './timeseries_data_files/Bus_205_Load_zone2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_309_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/320_RTPV_2_forecasts_actuals.csv',
'./timeseries_data_files/Bus_316_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_321_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/313_PV_2_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_7_forecasts_actuals.csv',
'./timeseries_data_files/313_RTPV_10_forecasts_actuals.csv', './timeseries_data_files/310_PV_1_forecasts_actuals.csv',
'./timeseries_data_files/Bus_312_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_325_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_305_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/309_WIND_1_forecasts_actuals.csv',
'./timeseries_data_files/313_RTPV_5_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_12_forecasts_actuals.csv',
'./timeseries_data_files/314_PV_2_forecasts_actuals.csv', './timeseries_data_files/Bus_301_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/314_PV_4_forecasts_actuals.csv', './timeseries_data_files/PV_zone3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_306_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_319_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/322_HYDRO_1_forecasts_actuals.csv',
'./timeseries_data_files/320_RTPV_6_forecasts_actuals.csv', './timeseries_data_files/324_PV_3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_302_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_315_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_322_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_1_forecasts_actuals.csv',
'./timeseries_data_files/308_RTPV_1_forecasts_actuals.csv', './timeseries_data_files/322_HYDRO_3_forecasts_actuals.csv',
'./timeseries_data_files/324_PV_1_forecasts_actuals.csv', './timeseries_data_files/317_WIND_1_forecasts_actuals.csv',
'./timeseries_data_files/313_RTPV_9_forecasts_actuals.csv', './timeseries_data_files/Bus_311_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/320_RTPV_4_forecasts_actuals.csv', './timeseries_data_files/Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/322_HYDRO_4_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_6_forecasts_actuals.csv',
'./timeseries_data_files/314_PV_1_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_11_forecasts_actuals.csv',
'./timeseries_data_files/303_WIND_1_forecasts_actuals.csv', './timeseries_data_files/320_RTPV_3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_304_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_324_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/WIND_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_313_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/310_PV_2_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_4_forecasts_actuals.csv',
'./timeseries_data_files/313_RTPV_13_forecasts_actuals.csv', './timeseries_data_files/314_PV_3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_308_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_320_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_317_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/320_RTPV_1_forecasts_actuals.csv',
'./timeseries_data_files/313_PV_1_forecasts_actuals.csv', './timeseries_data_files/324_PV_2_forecasts_actuals.csv',
'./timeseries_data_files/Hydro_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_310_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_323_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/Bus_314_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/313_RTPV_2_forecasts_actuals.csv', './timeseries_data_files/RTPV_zone3_forecasts_actuals.csv',
'./timeseries_data_files/312_PV_1_forecasts_actuals.csv', './timeseries_data_files/319_PV_1_forecasts_actuals.csv',
'./timeseries_data_files/320_PV_1_forecasts_actuals.csv', './timeseries_data_files/313_RTPV_8_forecasts_actuals.csv',
'./timeseries_data_files/320_RTPV_5_forecasts_actuals.csv', './timeseries_data_files/Bus_303_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_307_Load_zone3_forecasts_actuals.csv',
'./timeseries_data_files/Bus_318_Load_zone3_forecasts_actuals.csv', './timeseries_data_files/322_HYDRO_2_forecasts_actuals.csv']
# smaller set for testing
file_paths_test = ['./timeseries_data_files/101_PV_1_forecasts_actuals.csv','./timeseries_data_files/101_PV_2_forecasts_actuals.csv']
def read_files(file_paths):
# file_paths: list of strings indicating file paths that are to be read in
# output: data_lst - list of data frames containing all the information in each file
# Note: we add to a list and then concatenate as this is faster and takes less memory than growing the dataframe
# each time
data_lst = []
i = 0
bus_names = []
# iterate across file paths
for path in file_paths:
data = pd.read_csv(path) # read in the file
# rename the columns to be useful
# the numbers below are hard coded for this particular case - they will have to change if the file structure
# changes too
data.columns = ['Time', path[24:-22]+'_forecasts', path[24:-22]+'_actuals']
bus_names.append(path[24:-22]) # gives us a list of bus_names which we can use later on
# if this is our first one, append all columns (including date/time), otherwise, just append forecasts/actuals
# note: this assumes that all files have the exact same dates and times, which is supported in this case, but
# may not be true generally
if i == 0:
data_lst.append(data)
else:
data_lst.append(data[[path[24:-22]+'_forecasts', path[24:-22]+'_actuals']])
i += 1
return data_lst, bus_names
def filter_no_solar(combined_data, determining_solar_plant):
# combined_data: data frame of all forecasts and actuals for a list of buses
# output: two data frames called s_data and ns_data.
# This function filters all data into two parts - one where solars are active and one where solars are inactive
# we will do this in a pretty naive way, simply based on one of the solar plants, which we are going to hard code
# this is not ideal, but it should do for now
ns_data = combined_data[combined_data[determining_solar_plant + '_forecasts'] == 0]
#ns_data.to_csv('zz_no_solar_data.csv') # print out results as a test
s_data = combined_data[combined_data[determining_solar_plant + '_forecasts'] != 0]
#s_data.to_csv("zz_solar_data.csv")
return ns_data, s_data
def compute_actual_forecast_quotient(data, bus_names):
# data: data frame of forecasts and actuals, in the pattern of: forecast, actual
# output: modified version of data containing additional columns with the quotient of actual / forecasts
# iterate across bus names and take the relevant quotients
for name in bus_names:
temp_nm = name + '_quotient'
data = data.assign(temp_nm=np.minimum(data[name+'_actuals'] / data[name+'_forecasts'], 1.5))
data.rename(columns={'temp_nm':temp_nm}, inplace=True)
# get rid of NaNs and Infs
# NaNs arise when we have 0/0, Infs arrive when we have x / 0, where x > 0
data.fillna(0, inplace=True)
data.replace(np.inf, 0, inplace=True)
return data
def sample_quotients(pre_sunrise_hrs, post_sunset_hrs, s_data, ns_data):
# pre_sunrise_hrs: number of hours before sunrise for the day we want to sample
# post_sunset_hrs: number of hours after sunset for the day we want to sample
# s_data: data frame of the active solar hours
# ns_data: data frame of the inactive solar hours
ns_quotients = ns_data.filter(regex='quotient$', axis=1)
s_quotients = s_data.filter(regex='quotient$', axis=1)
pre_sunrise_sample = ns_quotients.sample(pre_sunrise_hrs, replace=True) # samples quotients for pre sunrise hours
post_sunset_sample = ns_quotients.sample(post_sunset_hrs, replace=True) # samples quotients for post sunset hours
# samples quotients for daylight hours
daylight_sample = s_quotients.sample(24 - pre_sunrise_hrs - post_sunset_hrs, replace=True)
frames = [pre_sunrise_sample, daylight_sample, post_sunset_sample]
day_sample = pd.concat(frames)
return day_sample
def apply_day_quotients(quotients, day, file_paths):
# quotients: dataframe with all the quotients to apply
# day: string version of what day to modify with the quotients in form YYYY-MM-DD
# output: None - directly modify the time series files to apply the quotients and writes to file
# if (day == "2020-07-09"):
# beg = 4561
# end = 4585
# elif (day == "2020-07-10"):
# beg = 4585
# end = 4609
# elif (day == "2020-07-11"):
# beg = 4609
# end = 4633
for path in file_paths:
file_data = pd.read_csv(path)
count = 0
file_data = file_data.set_index('datetime')
dts = pd.Series(pd.date_range(day, periods=24, freq='H'))
t = dts.dt.strftime('%Y-%m-%d %H:%M:%S')
file_data.loc[t, 'actuals'] = file_data.loc[t, 'forecasts'] * quotients[path[24:-22] + "_quotient"].tolist()
file_data = file_data.truncate(before = '2020-07-09', after = '2020-07-12')
# for index, row in file_data.iterrows():
# if(row['datetime'].startswith(day)):
# row['actuals'] = row['forecasts'] * quotients.iloc[count, : ].loc[path[24:-22] + "_quotient"]
# count += 1
# file_data.iloc[index,:] = row
# for index in range(beg, end):
# file_data["actuals"].iat[index] = file_data['forecasts'].iat[index] * quotients.iloc[count, : ].loc[path[24:-22] + "_quotient"]
# count += 1
# file_data.to_csv(path, index=False)
file_data.to_csv(path, index=True)
# run all the data perturbation functions as a function call -> should be in working directory when called and will remain.
def perturb_data(file_paths, solar_path, no_solar_path):
# file_paths: list of strings that tell us where the timeseries data files are located
# solar_path: file path of the forecast, actuals, and quotients for the active solar hours for the year
# no_solar_path: file path of the the forecast, actuals, and quotients for the non-active solar hours for the year
# output: None - modifies the timeseries data files in place via apply_day_quotients
path = os.getcwd()
os.chdir("..")
solar_data_1 = pd.read_csv(solar_path)
no_solar_data_1 = pd.read_csv(no_solar_path)
os.chdir(path)
quotients_0710_1 = sample_quotients(6, 5, solar_data_1, no_solar_data_1) # sampling the day in question
quotients_0709_1 = sample_quotients(6, 5, solar_data_1, no_solar_data_1) # sampling the day before
quotients_0711_1 = sample_quotients(6, 5, solar_data_1, no_solar_data_1) # sampling the day after
# need to apply the quotients to the proper forecasts and write to file in the format that is readable to prescient
# only need to write 1 day on either end of July 10 for now.
apply_day_quotients(quotients_0709_1, "2020-07-09", file_paths)
apply_day_quotients(quotients_0710_1, "2020-07-10", file_paths)
apply_day_quotients(quotients_0711_1, "2020-07-11", file_paths)
# should be in directory "/downloads" when called and will stay at that directory
def save_quotients(file_paths):
# file_paths: list of strings that tell us where the timeseries data files are located
# output: None - saves quotients to csv for potential manual / programmatic use later
os.chdir("./rts_gmlc")
temp, bus_names_1 = read_files(file_paths)
all_data_1 = pd.concat(temp, axis=1) # read in the data into a the data frame
#all_data.to_csv('zz_all_data.csv') # print out results as a test
no_solar_data_1, solar_data_1 = filter_no_solar(all_data_1, "101_PV_1")
solar_data_1 = compute_actual_forecast_quotient(solar_data_1, bus_names_1)
no_solar_data_1 = compute_actual_forecast_quotient(no_solar_data_1, bus_names_1)
os.chdir("..")
solar_data_1.to_csv("./solar_quotients.csv", index=False)
no_solar_data_1.to_csv("./no_solar_quotients.csv", index=False)
def run_prescient(populate='populate_with_network_deterministic.txt',
simulate='simulate_with_network_deterministic.txt'):
with open(simulate, "r") as file:
lines = file.readlines()
with open(simulate, "w") as file:
for line in lines:
if (line.startswith("--output-directory=")):
file.write(directory_out + "\n")
elif (line.startswith("--num-days")):
file.write("--num-days=1 \n")
elif (line.startswith("--random-seed") or line.startswith("--output-sced-solutions") or line.startswith(
"--output-ruc-dispatches")):
continue
elif (line.startswith("--deterministic-ruc-solver=cbc")):
file.write("--deterministic-ruc-solver=gurobi \n")
elif (line.startswith("--sced-solver=cbc")):
file.write("--sced-solver=gurobi \n")
else:
file.write(line)
runner.run(populate)
runner.run(simulate)
shutil.rmtree("./RTS-GMLC")
def set_actual_equal_forecasts(path):
# path: file path for a timeseries file
# output: None - modifies the actuals of the timeseries data file to be the same as its forecast
data = pd.read_csv(path)
# placeholder modification -> could easily be replaced
data['actuals'].values[:] = data['forecasts'].values[:]
data.to_csv(path, index=False)
def copy_directory(index):
# index: integer to count the run number. used to write the correct directory name
# output: None - this copies the rts_gmlc folder to each scenario folder. extraneous items such as the
# RTS-GMLC subfolder are later deleted
new_path = path_template + str(index)
if os.path.exists(new_path):
shutil.rmtree(new_path)
shutil.copytree(dir_path, new_path)
else:
shutil.copytree(dir_path, new_path)
def run(i):
# i: counter
copy_directory(i)
os.chdir(path_template+str(i))
perturb_data(file_paths_combined, "./solar_quotients.csv", "./no_solar_quotients.csv")
run_prescient()
os.chdir("..")
os.chdir("downloads")
# check for the quotients data and if not then recalculate it
if (not os.path.exists("./solar_quotients.csv") or not os.path.exists("./no_solar_quotients.csv")):
save_quotients(file_paths_combined)
# go through the process of sampling and applying the quotients for each run
for i in range(runs):
run(i)
| 67.981707 | 283 | 0.744417 | 3,206 | 22,298 | 4.768871 | 0.148472 | 0.147426 | 0.198836 | 0.294002 | 0.5986 | 0.577605 | 0.540258 | 0.517431 | 0.338675 | 0.114592 | 0 | 0.043753 | 0.156427 | 22,298 | 327 | 284 | 68.189602 | 0.769059 | 0.234595 | 0 | 0.069307 | 0 | 0 | 0.594367 | 0.570738 | 0 | 0 | 0 | 0 | 0 | 1 | 0.054455 | false | 0 | 0.034653 | 0 | 0.108911 | 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 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8a43882e94bb408209e6ff924a3f362382ae640d | 687 | py | Python | venv/lib/python3.9/site-packages/libfuturize/fixes/fix_input.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 908 | 2015-01-01T21:20:45.000Z | 2022-03-29T20:47:16.000Z | venv/lib/python3.9/site-packages/libfuturize/fixes/fix_input.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 402 | 2015-01-04T01:30:19.000Z | 2022-03-24T11:56:38.000Z | venv/lib/python3.9/site-packages/libfuturize/fixes/fix_input.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 305 | 2015-01-18T19:29:37.000Z | 2022-03-24T09:40:09.000Z | """
Fixer for input.
Does a check for `from builtins import input` before running the lib2to3 fixer.
The fixer will not run when the input is already present.
this:
a = input()
becomes:
from builtins import input
a = eval(input())
and this:
from builtins import input
a = input()
becomes (no change):
from builtins import input
a = input()
"""
import lib2to3.fixes.fix_input
from lib2to3.fixer_util import does_tree_import
class FixInput(lib2to3.fixes.fix_input.FixInput):
def transform(self, node, results):
if does_tree_import('builtins', 'input', node):
return
return super(FixInput, self).transform(node, results)
| 20.818182 | 79 | 0.692868 | 95 | 687 | 4.936842 | 0.421053 | 0.102345 | 0.153518 | 0.196162 | 0.17484 | 0.123667 | 0 | 0 | 0 | 0 | 0 | 0.014898 | 0.218341 | 687 | 32 | 80 | 21.46875 | 0.858473 | 0.534207 | 0 | 0 | 0 | 0 | 0.041667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.857143 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
8a4b82b64692c1c7bc73007133f94c50d7d183b3 | 25,600 | py | Python | packages/python/plotly/plotly/validators/layout/template/data/__init__.py | miriad/plotly.py | f083bea25691ff64a30008f46f77fc1edc11ad63 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/template/data/__init__.py | miriad/plotly.py | f083bea25691ff64a30008f46f77fc1edc11ad63 | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | packages/python/plotly/plotly/validators/layout/template/data/__init__.py | miriad/plotly.py | f083bea25691ff64a30008f46f77fc1edc11ad63 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class WaterfallsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="waterfall", parent_name="layout.template.data", **kwargs
):
super(WaterfallsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Waterfall"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class VolumesValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="volume", parent_name="layout.template.data", **kwargs
):
super(VolumesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Volume"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ViolinsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="violin", parent_name="layout.template.data", **kwargs
):
super(ViolinsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Violin"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class TreemapsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="treemap", parent_name="layout.template.data", **kwargs
):
super(TreemapsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Treemap"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class TablesValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="table", parent_name="layout.template.data", **kwargs
):
super(TablesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Table"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class SurfacesValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="surface", parent_name="layout.template.data", **kwargs
):
super(SurfacesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Surface"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class SunburstsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="sunburst", parent_name="layout.template.data", **kwargs
):
super(SunburstsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Sunburst"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class StreamtubesValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="streamtube", parent_name="layout.template.data", **kwargs
):
super(StreamtubesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Streamtube"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class SplomsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="splom", parent_name="layout.template.data", **kwargs
):
super(SplomsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Splom"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScatterternarysValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scatterternary", parent_name="layout.template.data", **kwargs
):
super(ScatterternarysValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scatterternary"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScattersValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scatter", parent_name="layout.template.data", **kwargs
):
super(ScattersValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scatter"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScatterpolarsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scatterpolar", parent_name="layout.template.data", **kwargs
):
super(ScatterpolarsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scatterpolar"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScatterpolarglsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scatterpolargl", parent_name="layout.template.data", **kwargs
):
super(ScatterpolarglsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scatterpolargl"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScattermapboxsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scattermapbox", parent_name="layout.template.data", **kwargs
):
super(ScattermapboxsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scattermapbox"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScatterglsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scattergl", parent_name="layout.template.data", **kwargs
):
super(ScatterglsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scattergl"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScattergeosValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scattergeo", parent_name="layout.template.data", **kwargs
):
super(ScattergeosValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scattergeo"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ScattercarpetsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scattercarpet", parent_name="layout.template.data", **kwargs
):
super(ScattercarpetsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scattercarpet"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class Scatter3dsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="scatter3d", parent_name="layout.template.data", **kwargs
):
super(Scatter3dsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Scatter3d"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class SankeysValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="sankey", parent_name="layout.template.data", **kwargs
):
super(SankeysValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Sankey"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class PointcloudsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="pointcloud", parent_name="layout.template.data", **kwargs
):
super(PointcloudsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Pointcloud"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class PiesValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="pie", parent_name="layout.template.data", **kwargs):
super(PiesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Pie"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ParcoordssValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="parcoords", parent_name="layout.template.data", **kwargs
):
super(ParcoordssValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Parcoords"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ParcatssValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="parcats", parent_name="layout.template.data", **kwargs
):
super(ParcatssValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Parcats"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class OhlcsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="ohlc", parent_name="layout.template.data", **kwargs
):
super(OhlcsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Ohlc"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class Mesh3dsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="mesh3d", parent_name="layout.template.data", **kwargs
):
super(Mesh3dsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Mesh3d"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class IsosurfacesValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="isosurface", parent_name="layout.template.data", **kwargs
):
super(IsosurfacesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Isosurface"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class IndicatorsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="indicator", parent_name="layout.template.data", **kwargs
):
super(IndicatorsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Indicator"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class HistogramsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="histogram", parent_name="layout.template.data", **kwargs
):
super(HistogramsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Histogram"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class Histogram2dsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="histogram2d", parent_name="layout.template.data", **kwargs
):
super(Histogram2dsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Histogram2d"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class Histogram2dContoursValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="histogram2dcontour",
parent_name="layout.template.data",
**kwargs
):
super(Histogram2dContoursValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Histogram2dContour"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class HeatmapsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="heatmap", parent_name="layout.template.data", **kwargs
):
super(HeatmapsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Heatmap"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class HeatmapglsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="heatmapgl", parent_name="layout.template.data", **kwargs
):
super(HeatmapglsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Heatmapgl"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class FunnelsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="funnel", parent_name="layout.template.data", **kwargs
):
super(FunnelsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Funnel"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class FunnelareasValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="funnelarea", parent_name="layout.template.data", **kwargs
):
super(FunnelareasValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Funnelarea"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class DensitymapboxsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="densitymapbox", parent_name="layout.template.data", **kwargs
):
super(DensitymapboxsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Densitymapbox"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ContoursValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="contour", parent_name="layout.template.data", **kwargs
):
super(ContoursValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Contour"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ContourcarpetsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="contourcarpet", parent_name="layout.template.data", **kwargs
):
super(ContourcarpetsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Contourcarpet"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ConesValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="cone", parent_name="layout.template.data", **kwargs
):
super(ConesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Cone"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ChoroplethsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="choropleth", parent_name="layout.template.data", **kwargs
):
super(ChoroplethsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Choropleth"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class ChoroplethmapboxsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="choroplethmapbox",
parent_name="layout.template.data",
**kwargs
):
super(ChoroplethmapboxsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Choroplethmapbox"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class CarpetsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="carpet", parent_name="layout.template.data", **kwargs
):
super(CarpetsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Carpet"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class CandlesticksValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="candlestick", parent_name="layout.template.data", **kwargs
):
super(CandlesticksValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Candlestick"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class BoxsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="box", parent_name="layout.template.data", **kwargs):
super(BoxsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Box"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class BarsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="bar", parent_name="layout.template.data", **kwargs):
super(BarsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Bar"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class BarpolarsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="barpolar", parent_name="layout.template.data", **kwargs
):
super(BarpolarsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Barpolar"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
import _plotly_utils.basevalidators
class AreasValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="area", parent_name="layout.template.data", **kwargs
):
super(AreasValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Area"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
| 27.856366 | 88 | 0.599141 | 2,300 | 25,600 | 6.188696 | 0.048261 | 0.096951 | 0.161585 | 0.100183 | 0.824083 | 0.821554 | 0.821554 | 0.69334 | 0.69334 | 0.473584 | 0 | 0.000886 | 0.294844 | 25,600 | 918 | 89 | 27.88671 | 0.787614 | 0 | 0 | 0.6 | 0 | 0 | 0.109581 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.066667 | 0 | 0.2 | 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 |
8a61c4fdf67c8e865af316af591d3737949dc492 | 427 | py | Python | py/g1/operations/databases/clients/setup.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | 3 | 2016-01-04T06:28:52.000Z | 2020-09-20T13:18:40.000Z | py/g1/operations/databases/clients/setup.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | py/g1/operations/databases/clients/setup.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='g1.operations.databases.clients',
packages=[
'g1.operations.databases.clients',
],
install_requires=[
'g1.messaging[reqrep]',
'g1.operations.databases.bases[capnps]',
],
extras_require={
'parts': [
'g1.apps',
'g1.bases',
'g1.messaging[parts.clients]',
],
},
zip_safe=False,
)
| 20.333333 | 48 | 0.540984 | 39 | 427 | 5.846154 | 0.589744 | 0.157895 | 0.276316 | 0.245614 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023729 | 0.309133 | 427 | 20 | 49 | 21.35 | 0.749153 | 0 | 0 | 0.157895 | 0 | 0 | 0.388759 | 0.295082 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.052632 | 0 | 0.052632 | 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 |
8a665e7f6180ff46a8e1a6823d054b7b8c50e878 | 638 | py | Python | easy/155. Min Stack.py | junyinglucn/leetcode | 1fbd0962e4b7dc46b4ed4f0f86778cfedbda72e7 | [
"MIT"
] | null | null | null | easy/155. Min Stack.py | junyinglucn/leetcode | 1fbd0962e4b7dc46b4ed4f0f86778cfedbda72e7 | [
"MIT"
] | null | null | null | easy/155. Min Stack.py | junyinglucn/leetcode | 1fbd0962e4b7dc46b4ed4f0f86778cfedbda72e7 | [
"MIT"
] | null | null | null | class MinStack:
def __init__(self):
"""
initialize your data structure here.
"""
self.l = []
self.min_stack = [math.inf]
def push(self, x: int) -> None:
self.l.append(x)
self.min_stack.append(min(x, self.min_stack[-1]))
def pop(self) -> None:
self.l.pop()
self.min_stack.pop()
def top(self) -> int:
return self.l[-1]
def getMin(self) -> int:
return self.min_stack[-1]
# Your MinStack object will be instantiated and called as such:
# obj = MinStack()
# obj.push(x)
# obj.pop()
# param_3 = obj.top()
# param_4 = obj.getMin()
| 21.266667 | 63 | 0.557994 | 90 | 638 | 3.833333 | 0.411111 | 0.101449 | 0.173913 | 0.075362 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011038 | 0.289969 | 638 | 29 | 64 | 22 | 0.750552 | 0.283699 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.357143 | false | 0 | 0 | 0.142857 | 0.571429 | 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 |
8a75419ab507deeefe93d686bfd8dd4812db507c | 766 | py | Python | qhub/render/jinja.py | viniciusdc/qhub-cloud | be7256f26d140eb8edb3b5f19dc222458f5284b7 | [
"BSD-3-Clause"
] | 8 | 2020-05-07T09:32:24.000Z | 2020-11-19T07:22:16.000Z | qhub/render/jinja.py | viniciusdc/qhub-cloud | be7256f26d140eb8edb3b5f19dc222458f5284b7 | [
"BSD-3-Clause"
] | 81 | 2020-04-28T14:55:06.000Z | 2020-08-18T04:15:04.000Z | qhub/render/jinja.py | viniciusdc/qhub-cloud | be7256f26d140eb8edb3b5f19dc222458f5284b7 | [
"BSD-3-Clause"
] | 5 | 2020-06-12T12:50:44.000Z | 2021-04-17T15:22:47.000Z | import yaml
import json
from jinja2.ext import Extension
class YamlifyExtension(Extension):
"""Jinja2 extension to convert a Python object to YAML."""
def __init__(self, environment):
"""Initialize the extension with the given environment."""
super().__init__(environment)
def yamlify(obj):
return yaml.dump(obj)
environment.filters["yamlify"] = yamlify
class JsonifyExtension(Extension):
"""Jinja2 extension to convert a Python object to JSON."""
def __init__(self, environment):
"""Initialize the extension with the given environment."""
super().__init__(environment)
def jsonify(obj):
return json.dumps(obj)
environment.filters["jsonify"] = jsonify
| 25.533333 | 66 | 0.664491 | 83 | 766 | 5.939759 | 0.373494 | 0.060852 | 0.097363 | 0.105477 | 0.559838 | 0.559838 | 0.559838 | 0.559838 | 0.559838 | 0.365112 | 0 | 0.005119 | 0.234987 | 766 | 29 | 67 | 26.413793 | 0.836177 | 0.275457 | 0 | 0.266667 | 0 | 0 | 0.026217 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0.2 | 0.133333 | 0.733333 | 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 |
8a8e58b7e5b36ba04ccde1095b3e3a0e8f6203d5 | 324 | py | Python | backend/diem_utils/types/liquidity/lp.py | tanshuai/reference-wallet | e8efec4acc6af6e319cf075c10693ddf7754cc83 | [
"Apache-2.0"
] | 14 | 2020-12-17T08:03:51.000Z | 2022-03-26T04:21:18.000Z | backend/diem_utils/types/liquidity/lp.py | tanshuai/reference-wallet | e8efec4acc6af6e319cf075c10693ddf7754cc83 | [
"Apache-2.0"
] | 20 | 2020-12-15T12:02:56.000Z | 2021-05-19T23:37:34.000Z | backend/diem_utils/types/liquidity/lp.py | tanshuai/reference-wallet | e8efec4acc6af6e319cf075c10693ddf7754cc83 | [
"Apache-2.0"
] | 12 | 2020-12-10T16:35:27.000Z | 2022-02-01T04:06:10.000Z | # Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass
from typing import Type
from dataclasses_json import dataclass_json
from .currency import CurrencyPairs
@dataclass_json
@dataclass
class LPDetails:
sub_address: str
vasp: str
IBAN_number: str
| 18 | 43 | 0.787037 | 43 | 324 | 5.813953 | 0.674419 | 0.12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00738 | 0.16358 | 324 | 17 | 44 | 19.058824 | 0.915129 | 0.234568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.8 | 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 |
8a95cc763ca83978a7cdc5a3d1a9c8c3b8e633c6 | 12,937 | py | Python | pybind/slxos/v17s_1_02/routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17s_1_02/routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17s_1_02/routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
import route_target
class evpn_bd(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-common-def - based on the path /routing-system/evpn-config/evpn/evpn-instance/bridge-domain/evpn-bd. Each member element of
the container is represented as a class variable - with a specific
YANG type.
YANG Description: EVPN instance bridge domain config
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__bd_number','__rd','__route_target',)
_yang_name = 'evpn-bd'
_rest_name = 'evpn-bd'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__rd = YANGDynClass(base=unicode, is_leaf=True, yang_name="rd", rest_name="rd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure RD for the bridge domain.', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rd-type', is_config=True)
self.__route_target = YANGDynClass(base=route_target.route_target, is_container='container', presence=False, yang_name="route-target", rest_name="route-target", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'configure target vpn extended communities', u'cli-incomplete-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='container', is_config=True)
self.__bd_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4096']}), is_leaf=True, yang_name="bd-number", rest_name="bd-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-range': None, u'cli-full-no': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='bridge-domain:bridge-domain-id-type', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'routing-system', u'evpn-config', u'evpn', u'evpn-instance', u'bridge-domain', u'evpn-bd']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'evpn', u'evpn-instance', u'bridge-domain', u'evpn-bd']
def _get_bd_number(self):
"""
Getter method for bd_number, mapped from YANG variable /routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/bd_number (bridge-domain:bridge-domain-id-type)
"""
return self.__bd_number
def _set_bd_number(self, v, load=False):
"""
Setter method for bd_number, mapped from YANG variable /routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/bd_number (bridge-domain:bridge-domain-id-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_bd_number is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_bd_number() directly.
"""
parent = getattr(self, "_parent", None)
if parent is not None and load is False:
raise AttributeError("Cannot set keys directly when" +
" within an instantiated list")
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4096']}), is_leaf=True, yang_name="bd-number", rest_name="bd-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-range': None, u'cli-full-no': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='bridge-domain:bridge-domain-id-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """bd_number must be of a type compatible with bridge-domain:bridge-domain-id-type""",
'defined-type': "bridge-domain:bridge-domain-id-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4096']}), is_leaf=True, yang_name="bd-number", rest_name="bd-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-range': None, u'cli-full-no': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='bridge-domain:bridge-domain-id-type', is_config=True)""",
})
self.__bd_number = t
if hasattr(self, '_set'):
self._set()
def _unset_bd_number(self):
self.__bd_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4096']}), is_leaf=True, yang_name="bd-number", rest_name="bd-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-range': None, u'cli-full-no': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='bridge-domain:bridge-domain-id-type', is_config=True)
def _get_rd(self):
"""
Getter method for rd, mapped from YANG variable /routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/rd (rd-type)
"""
return self.__rd
def _set_rd(self, v, load=False):
"""
Setter method for rd, mapped from YANG variable /routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/rd (rd-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_rd is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_rd() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="rd", rest_name="rd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure RD for the bridge domain.', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rd-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """rd must be of a type compatible with rd-type""",
'defined-type': "brocade-bgp:rd-type",
'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="rd", rest_name="rd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure RD for the bridge domain.', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rd-type', is_config=True)""",
})
self.__rd = t
if hasattr(self, '_set'):
self._set()
def _unset_rd(self):
self.__rd = YANGDynClass(base=unicode, is_leaf=True, yang_name="rd", rest_name="rd", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure RD for the bridge domain.', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rd-type', is_config=True)
def _get_route_target(self):
"""
Getter method for route_target, mapped from YANG variable /routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/route_target (container)
"""
return self.__route_target
def _set_route_target(self, v, load=False):
"""
Setter method for route_target, mapped from YANG variable /routing_system/evpn_config/evpn/evpn_instance/bridge_domain/evpn_bd/route_target (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_route_target is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_route_target() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=route_target.route_target, is_container='container', presence=False, yang_name="route-target", rest_name="route-target", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'configure target vpn extended communities', u'cli-incomplete-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='container', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """route_target must be of a type compatible with container""",
'defined-type': "container",
'generated-type': """YANGDynClass(base=route_target.route_target, is_container='container', presence=False, yang_name="route-target", rest_name="route-target", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'configure target vpn extended communities', u'cli-incomplete-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='container', is_config=True)""",
})
self.__route_target = t
if hasattr(self, '_set'):
self._set()
def _unset_route_target(self):
self.__route_target = YANGDynClass(base=route_target.route_target, is_container='container', presence=False, yang_name="route-target", rest_name="route-target", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'configure target vpn extended communities', u'cli-incomplete-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='container', is_config=True)
bd_number = __builtin__.property(_get_bd_number, _set_bd_number)
rd = __builtin__.property(_get_rd, _set_rd)
route_target = __builtin__.property(_get_route_target, _set_route_target)
_pyangbind_elements = {'bd_number': bd_number, 'rd': rd, 'route_target': route_target, }
| 64.363184 | 617 | 0.726907 | 1,817 | 12,937 | 4.940561 | 0.10842 | 0.04233 | 0.043667 | 0.026735 | 0.7566 | 0.725855 | 0.706583 | 0.687089 | 0.687089 | 0.676395 | 0 | 0.006998 | 0.13844 | 12,937 | 200 | 618 | 64.685 | 0.798403 | 0.149416 | 0 | 0.37594 | 0 | 0.022556 | 0.345015 | 0.136125 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090226 | false | 0 | 0.067669 | 0 | 0.285714 | 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 |
8a9710cb2478ecc91eb85a68d129ba14d7785d82 | 22,042 | py | Python | tests/paddle/test_paddle_model_export.py | tahesse/mlflow | 14c98f936923511a4c1ad8b1e7f72248cf4067cf | [
"Apache-2.0"
] | null | null | null | tests/paddle/test_paddle_model_export.py | tahesse/mlflow | 14c98f936923511a4c1ad8b1e7f72248cf4067cf | [
"Apache-2.0"
] | null | null | null | tests/paddle/test_paddle_model_export.py | tahesse/mlflow | 14c98f936923511a4c1ad8b1e7f72248cf4067cf | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
import pytest
import numpy as np
import pandas as pd
import os
from unittest import mock
import yaml
import paddle
from paddle.nn import Linear
import paddle.nn.functional as F
from sklearn.datasets import load_diabetes
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
import mlflow.pyfunc as pyfunc
import mlflow.pyfunc.scoring_server as pyfunc_scoring_server
import mlflow.paddle
from mlflow.models import Model
from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
from mlflow.tracking.artifact_utils import _download_artifact_from_uri
from mlflow.utils.environment import _mlflow_conda_env
from mlflow.utils.model_utils import _get_flavor_configuration
from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
from tests.helper_functions import mock_s3_bucket # pylint: disable=unused-import
from tests.helper_functions import set_boto_credentials # pylint: disable=unused-import
from tests.helper_functions import (
pyfunc_serve_and_score_model,
_assert_pip_requirements,
_compare_logged_code_paths,
)
ModelWithData = namedtuple("ModelWithData", ["model", "inference_dataframe"])
def get_dataset():
X, y = load_diabetes(return_X_y=True)
min_max_scaler = preprocessing.MinMaxScaler()
X_min_max = min_max_scaler.fit_transform(X)
X_normalized = preprocessing.scale(X_min_max, with_std=False)
X_train, X_test, y_train, y_test = train_test_split(
X_normalized, y, test_size=0.2, random_state=42
)
y_train = y_train.reshape(-1, 1)
y_test = y_test.reshape(-1, 1)
return np.concatenate((X_train, y_train), axis=1), np.concatenate((X_test, y_test), axis=1)
@pytest.fixture
def pd_model():
class Regressor(paddle.nn.Layer):
def __init__(self, in_features):
super(Regressor, self).__init__()
self.fc_ = Linear(in_features=in_features, out_features=1)
@paddle.jit.to_static
def forward(self, inputs): # pylint: disable=arguments-differ
return self.fc_(inputs)
training_data, test_data = get_dataset()
model = Regressor(training_data.shape[1] - 1)
model.train()
opt = paddle.optimizer.SGD(learning_rate=0.01, parameters=model.parameters())
EPOCH_NUM = 10
BATCH_SIZE = 10
for epoch_id in range(EPOCH_NUM):
np.random.shuffle(training_data)
mini_batches = [
training_data[k : k + BATCH_SIZE] for k in range(0, len(training_data), BATCH_SIZE)
]
for iter_id, mini_batch in enumerate(mini_batches):
x = np.array(mini_batch[:, :-1]).astype("float32")
y = np.array(mini_batch[:, -1:]).astype("float32")
house_features = paddle.to_tensor(x)
prices = paddle.to_tensor(y)
predicts = model(house_features)
loss = F.square_error_cost(predicts, label=prices)
avg_loss = paddle.mean(loss)
if iter_id % 20 == 0:
print(
"epoch: {}, iter: {}, loss is: {}".format(epoch_id, iter_id, avg_loss.numpy())
)
avg_loss.backward()
opt.step()
opt.clear_grad()
np_test_data = np.array(test_data).astype("float32")
return ModelWithData(model=model, inference_dataframe=np_test_data[:, :-1])
@pytest.fixture
def model_path(tmpdir):
return os.path.join(str(tmpdir), "model")
@pytest.fixture
def pd_custom_env(tmpdir):
conda_env = os.path.join(str(tmpdir), "conda_env.yml")
_mlflow_conda_env(conda_env, additional_pip_deps=["paddle", "pytest"])
return conda_env
@pytest.mark.large
def test_model_save_load(pd_model, model_path):
mlflow.paddle.save_model(pd_model=pd_model.model, path=model_path)
reloaded_pd_model = mlflow.paddle.load_model(model_uri=model_path)
reloaded_pyfunc = pyfunc.load_model(model_uri=model_path)
np.testing.assert_array_almost_equal(
pd_model.model(pd_model.inference_dataframe),
reloaded_pyfunc.predict(pd_model.inference_dataframe),
decimal=5,
)
np.testing.assert_array_almost_equal(
reloaded_pd_model(pd_model.inference_dataframe),
reloaded_pyfunc.predict(pd_model.inference_dataframe),
decimal=5,
)
def test_model_load_from_remote_uri_succeeds(pd_model, model_path, mock_s3_bucket):
mlflow.paddle.save_model(pd_model=pd_model.model, path=model_path)
artifact_root = "s3://{bucket_name}".format(bucket_name=mock_s3_bucket)
artifact_path = "model"
artifact_repo = S3ArtifactRepository(artifact_root)
artifact_repo.log_artifacts(model_path, artifact_path=artifact_path)
model_uri = artifact_root + "/" + artifact_path
reloaded_model = mlflow.paddle.load_model(model_uri=model_uri)
np.testing.assert_array_almost_equal(
pd_model.model(pd_model.inference_dataframe),
reloaded_model(pd_model.inference_dataframe),
decimal=5,
)
@pytest.mark.large
def test_model_log(pd_model, model_path, tmpdir):
model = pd_model.model
try:
artifact_path = "model"
conda_env = os.path.join(tmpdir, "conda_env.yaml")
_mlflow_conda_env(conda_env, additional_pip_deps=["paddle"])
model_info = mlflow.paddle.log_model(
pd_model=model, artifact_path=artifact_path, conda_env=conda_env
)
model_uri = "runs:/{run_id}/{artifact_path}".format(
run_id=mlflow.active_run().info.run_id, artifact_path=artifact_path
)
assert model_info.model_uri == model_uri
reloaded_pd_model = mlflow.paddle.load_model(model_uri=model_uri)
np.testing.assert_array_almost_equal(
model(pd_model.inference_dataframe),
reloaded_pd_model(pd_model.inference_dataframe),
decimal=5,
)
model_path = _download_artifact_from_uri(artifact_uri=model_uri)
model_config = Model.load(os.path.join(model_path, "MLmodel"))
assert pyfunc.FLAVOR_NAME in model_config.flavors
assert pyfunc.ENV in model_config.flavors[pyfunc.FLAVOR_NAME]
env_path = model_config.flavors[pyfunc.FLAVOR_NAME][pyfunc.ENV]
assert os.path.exists(os.path.join(model_path, env_path))
finally:
mlflow.end_run()
def test_log_model_calls_register_model(pd_model):
artifact_path = "model"
register_model_patch = mock.patch("mlflow.register_model")
with mlflow.start_run(), register_model_patch:
mlflow.paddle.log_model(
pd_model=pd_model.model,
artifact_path=artifact_path,
registered_model_name="AdsModel1",
)
model_uri = "runs:/{run_id}/{artifact_path}".format(
run_id=mlflow.active_run().info.run_id, artifact_path=artifact_path
)
mlflow.register_model.assert_called_once_with(
model_uri, "AdsModel1", await_registration_for=DEFAULT_AWAIT_MAX_SLEEP_SECONDS
)
def test_log_model_no_registered_model_name(pd_model):
artifact_path = "model"
register_model_patch = mock.patch("mlflow.register_model")
with mlflow.start_run(), register_model_patch:
mlflow.paddle.log_model(pd_model=pd_model.model, artifact_path=artifact_path)
mlflow.register_model.assert_not_called()
@pytest.mark.large
def test_model_save_persists_specified_conda_env_in_mlflow_model_directory(
pd_model, model_path, pd_custom_env
):
mlflow.paddle.save_model(pd_model=pd_model.model, path=model_path, conda_env=pd_custom_env)
pyfunc_conf = _get_flavor_configuration(model_path=model_path, flavor_name=pyfunc.FLAVOR_NAME)
saved_conda_env_path = os.path.join(model_path, pyfunc_conf[pyfunc.ENV])
assert os.path.exists(saved_conda_env_path)
assert saved_conda_env_path != pd_custom_env
with open(pd_custom_env, "r") as f:
pd_custom_env_parsed = yaml.safe_load(f)
with open(saved_conda_env_path, "r") as f:
saved_conda_env_parsed = yaml.safe_load(f)
assert saved_conda_env_parsed == pd_custom_env_parsed
@pytest.mark.large
def test_model_save_accepts_conda_env_as_dict(pd_model, model_path):
conda_env = dict(mlflow.paddle.get_default_conda_env())
conda_env["dependencies"].append("pytest")
mlflow.paddle.save_model(pd_model=pd_model.model, path=model_path, conda_env=conda_env)
pyfunc_conf = _get_flavor_configuration(model_path=model_path, flavor_name=pyfunc.FLAVOR_NAME)
saved_conda_env_path = os.path.join(model_path, pyfunc_conf[pyfunc.ENV])
assert os.path.exists(saved_conda_env_path)
with open(saved_conda_env_path, "r") as f:
saved_conda_env_parsed = yaml.safe_load(f)
assert saved_conda_env_parsed == conda_env
@pytest.mark.large
def test_model_log_persists_specified_conda_env_in_mlflow_model_directory(pd_model, pd_custom_env):
artifact_path = "model"
with mlflow.start_run():
mlflow.paddle.log_model(
pd_model=pd_model.model, artifact_path=artifact_path, conda_env=pd_custom_env
)
model_uri = "runs:/{run_id}/{artifact_path}".format(
run_id=mlflow.active_run().info.run_id, artifact_path=artifact_path
)
model_path = _download_artifact_from_uri(artifact_uri=model_uri)
pyfunc_conf = _get_flavor_configuration(model_path=model_path, flavor_name=pyfunc.FLAVOR_NAME)
saved_conda_env_path = os.path.join(model_path, pyfunc_conf[pyfunc.ENV])
assert os.path.exists(saved_conda_env_path)
assert saved_conda_env_path != pd_custom_env
with open(pd_custom_env, "r") as f:
pd_custom_env_parsed = yaml.safe_load(f)
with open(saved_conda_env_path, "r") as f:
saved_conda_env_parsed = yaml.safe_load(f)
assert saved_conda_env_parsed == pd_custom_env_parsed
@pytest.mark.large
def test_model_save_without_specified_conda_env_uses_default_env_with_expected_dependencies(
pd_model, model_path
):
mlflow.paddle.save_model(pd_model=pd_model.model, path=model_path)
_assert_pip_requirements(model_path, mlflow.paddle.get_default_pip_requirements())
@pytest.mark.large
def test_model_log_without_specified_conda_env_uses_default_env_with_expected_dependencies(
pd_model,
):
artifact_path = "model"
with mlflow.start_run():
mlflow.paddle.log_model(pd_model=pd_model.model, artifact_path=artifact_path)
model_uri = mlflow.get_artifact_uri(artifact_path)
_assert_pip_requirements(model_uri, mlflow.paddle.get_default_pip_requirements())
@pytest.fixture(scope="module")
def get_dataset_built_in_high_level_api():
train_dataset = paddle.text.datasets.UCIHousing(mode="train")
eval_dataset = paddle.text.datasets.UCIHousing(mode="test")
return train_dataset, eval_dataset
class UCIHousing(paddle.nn.Layer):
def __init__(self):
super(UCIHousing, self).__init__()
self.fc_ = paddle.nn.Linear(13, 1, None)
def forward(self, inputs): # pylint: disable=arguments-differ
pred = self.fc_(inputs)
return pred
@pytest.fixture
def pd_model_built_in_high_level_api(get_dataset_built_in_high_level_api):
train_dataset, test_dataset = get_dataset_built_in_high_level_api
model = paddle.Model(UCIHousing())
optim = paddle.optimizer.Adam(learning_rate=0.01, parameters=model.parameters())
model.prepare(optim, paddle.nn.MSELoss())
model.fit(train_dataset, epochs=6, batch_size=8, verbose=1)
return ModelWithData(model=model, inference_dataframe=test_dataset)
@pytest.mark.large
def test_model_save_load_built_in_high_level_api(pd_model_built_in_high_level_api, model_path):
model = pd_model_built_in_high_level_api.model
test_dataset = pd_model_built_in_high_level_api.inference_dataframe
mlflow.paddle.save_model(pd_model=model, path=model_path)
reloaded_pd_model = mlflow.paddle.load_model(model_uri=model_path)
reloaded_pyfunc = pyfunc.load_model(model_uri=model_path)
low_level_test_dataset = [x[0] for x in test_dataset]
np.testing.assert_array_almost_equal(
np.array(model.predict(test_dataset)).squeeze(),
np.array(reloaded_pyfunc.predict(np.array(low_level_test_dataset))).squeeze(),
decimal=5,
)
np.testing.assert_array_almost_equal(
np.array(reloaded_pd_model(np.array(low_level_test_dataset))).squeeze(),
np.array(reloaded_pyfunc.predict(np.array(low_level_test_dataset))).squeeze(),
decimal=5,
)
def test_model_built_in_high_level_api_load_from_remote_uri_succeeds(
pd_model_built_in_high_level_api, model_path, mock_s3_bucket
):
model = pd_model_built_in_high_level_api.model
test_dataset = pd_model_built_in_high_level_api.inference_dataframe
mlflow.paddle.save_model(pd_model=model, path=model_path)
artifact_root = "s3://{bucket_name}".format(bucket_name=mock_s3_bucket)
artifact_path = "model"
artifact_repo = S3ArtifactRepository(artifact_root)
artifact_repo.log_artifacts(model_path, artifact_path=artifact_path)
model_uri = artifact_root + "/" + artifact_path
reloaded_model = mlflow.paddle.load_model(model_uri=model_uri)
low_level_test_dataset = [x[0] for x in test_dataset]
np.testing.assert_array_almost_equal(
np.array(model.predict(test_dataset)).squeeze(),
np.array(reloaded_model(np.array(low_level_test_dataset))).squeeze(),
decimal=5,
)
@pytest.mark.large
def test_model_built_in_high_level_api_log(pd_model_built_in_high_level_api, model_path, tmpdir):
model = pd_model_built_in_high_level_api.model
test_dataset = pd_model_built_in_high_level_api.inference_dataframe
try:
artifact_path = "model"
conda_env = os.path.join(tmpdir, "conda_env.yaml")
_mlflow_conda_env(conda_env, additional_pip_deps=["paddle"])
mlflow.paddle.log_model(pd_model=model, artifact_path=artifact_path, conda_env=conda_env)
model_uri = "runs:/{run_id}/{artifact_path}".format(
run_id=mlflow.active_run().info.run_id, artifact_path=artifact_path
)
reloaded_pd_model = mlflow.paddle.load_model(model_uri=model_uri)
low_level_test_dataset = [x[0] for x in test_dataset]
np.testing.assert_array_almost_equal(
np.array(model.predict(test_dataset)).squeeze(),
np.array(reloaded_pd_model(np.array(low_level_test_dataset))).squeeze(),
decimal=5,
)
model_path = _download_artifact_from_uri(artifact_uri=model_uri)
model_config = Model.load(os.path.join(model_path, "MLmodel"))
assert pyfunc.FLAVOR_NAME in model_config.flavors
assert pyfunc.ENV in model_config.flavors[pyfunc.FLAVOR_NAME]
env_path = model_config.flavors[pyfunc.FLAVOR_NAME][pyfunc.ENV]
assert os.path.exists(os.path.join(model_path, env_path))
finally:
mlflow.end_run()
@pytest.fixture
def model_retrain_path(tmpdir):
return os.path.join(str(tmpdir), "model_retrain")
@pytest.mark.large
@pytest.mark.allow_infer_pip_requirements_fallback
def test_model_retrain_built_in_high_level_api(
pd_model_built_in_high_level_api,
model_path,
model_retrain_path,
get_dataset_built_in_high_level_api,
):
model = pd_model_built_in_high_level_api.model
mlflow.paddle.save_model(pd_model=model, path=model_path, training=True)
training_dataset, test_dataset = get_dataset_built_in_high_level_api
model_retrain = paddle.Model(UCIHousing())
model_retrain = mlflow.paddle.load_model(model_uri=model_path, model=model_retrain)
optim = paddle.optimizer.Adam(learning_rate=0.015, parameters=model.parameters())
model_retrain.prepare(optim, paddle.nn.MSELoss())
model_retrain.fit(training_dataset, epochs=6, batch_size=8, verbose=1)
mlflow.paddle.save_model(pd_model=model_retrain, path=model_retrain_path, training=False)
with pytest.raises(TypeError, match="This model can't be loaded"):
mlflow.paddle.load_model(model_uri=model_retrain_path, model=model_retrain)
error_model = 0
error_model_type = type(error_model)
with pytest.raises(
TypeError,
match="Invalid object type `{}` for `model`, must be `paddle.Model`".format(
error_model_type
),
):
mlflow.paddle.load_model(model_uri=model_retrain_path, model=error_model)
reloaded_pd_model = mlflow.paddle.load_model(model_uri=model_retrain_path)
reloaded_pyfunc = pyfunc.load_model(model_uri=model_retrain_path)
low_level_test_dataset = [x[0] for x in test_dataset]
np.testing.assert_array_almost_equal(
np.array(model_retrain.predict(test_dataset)).squeeze(),
np.array(reloaded_pyfunc.predict(np.array(low_level_test_dataset))).squeeze(),
decimal=5,
)
np.testing.assert_array_almost_equal(
np.array(reloaded_pd_model(np.array(low_level_test_dataset))).squeeze(),
np.array(reloaded_pyfunc.predict(np.array(low_level_test_dataset))).squeeze(),
decimal=5,
)
@pytest.mark.large
def test_log_model_built_in_high_level_api(
pd_model_built_in_high_level_api, model_path, tmpdir, get_dataset_built_in_high_level_api
):
model = pd_model_built_in_high_level_api.model
test_dataset = get_dataset_built_in_high_level_api[1]
try:
artifact_path = "model"
conda_env = os.path.join(tmpdir, "conda_env.yaml")
_mlflow_conda_env(conda_env, additional_pip_deps=["paddle"])
mlflow.paddle.log_model(
pd_model=model, artifact_path=artifact_path, conda_env=conda_env, training=True
)
model_uri = "runs:/{run_id}/{artifact_path}".format(
run_id=mlflow.active_run().info.run_id, artifact_path=artifact_path
)
model_retrain = paddle.Model(UCIHousing())
optim = paddle.optimizer.Adam(learning_rate=0.015, parameters=model.parameters())
model_retrain.prepare(optim, paddle.nn.MSELoss())
model_retrain = mlflow.paddle.load_model(model_uri=model_uri, model=model_retrain)
np.testing.assert_array_almost_equal(
np.array(model.predict(test_dataset)).squeeze(),
np.array(model_retrain.predict(test_dataset)).squeeze(),
decimal=5,
)
model_path = _download_artifact_from_uri(artifact_uri=model_uri)
model_config = Model.load(os.path.join(model_path, "MLmodel"))
assert pyfunc.FLAVOR_NAME in model_config.flavors
assert pyfunc.ENV in model_config.flavors[pyfunc.FLAVOR_NAME]
env_path = model_config.flavors[pyfunc.FLAVOR_NAME][pyfunc.ENV]
assert os.path.exists(os.path.join(model_path, env_path))
finally:
mlflow.end_run()
@pytest.mark.large
def test_log_model_with_pip_requirements(pd_model, tmpdir):
# Path to a requirements file
req_file = tmpdir.join("requirements.txt")
req_file.write("a")
with mlflow.start_run():
mlflow.paddle.log_model(pd_model.model, "model", pip_requirements=req_file.strpath)
_assert_pip_requirements(mlflow.get_artifact_uri("model"), ["mlflow", "a"], strict=True)
# List of requirements
with mlflow.start_run():
mlflow.paddle.log_model(
pd_model.model, "model", pip_requirements=[f"-r {req_file.strpath}", "b"]
)
_assert_pip_requirements(
mlflow.get_artifact_uri("model"), ["mlflow", "a", "b"], strict=True
)
# Constraints file
with mlflow.start_run():
mlflow.paddle.log_model(
pd_model.model, "model", pip_requirements=[f"-c {req_file.strpath}", "b"]
)
_assert_pip_requirements(
mlflow.get_artifact_uri("model"),
["mlflow", "b", "-c constraints.txt"],
["a"],
strict=True,
)
@pytest.mark.large
def test_log_model_with_extra_pip_requirements(pd_model, tmpdir):
default_reqs = mlflow.paddle.get_default_pip_requirements()
# Path to a requirements file
req_file = tmpdir.join("requirements.txt")
req_file.write("a")
with mlflow.start_run():
mlflow.paddle.log_model(pd_model.model, "model", extra_pip_requirements=req_file.strpath)
_assert_pip_requirements(mlflow.get_artifact_uri("model"), ["mlflow", *default_reqs, "a"])
# List of requirements
with mlflow.start_run():
mlflow.paddle.log_model(
pd_model.model, "model", extra_pip_requirements=[f"-r {req_file.strpath}", "b"]
)
_assert_pip_requirements(
mlflow.get_artifact_uri("model"), ["mlflow", *default_reqs, "a", "b"]
)
# Constraints file
with mlflow.start_run():
mlflow.paddle.log_model(
pd_model.model, "model", extra_pip_requirements=[f"-c {req_file.strpath}", "b"]
)
_assert_pip_requirements(
mlflow.get_artifact_uri("model"),
["mlflow", *default_reqs, "b", "-c constraints.txt"],
["a"],
)
@pytest.mark.large
def test_pyfunc_serve_and_score(pd_model):
model, inference_dataframe = pd_model
artifact_path = "model"
with mlflow.start_run():
mlflow.paddle.log_model(model, artifact_path)
model_uri = mlflow.get_artifact_uri(artifact_path)
resp = pyfunc_serve_and_score_model(
model_uri,
data=pd.DataFrame(inference_dataframe),
content_type=pyfunc_scoring_server.CONTENT_TYPE_JSON_SPLIT_ORIENTED,
)
scores = pd.read_json(resp.content.decode("utf-8"), orient="records").values.squeeze()
np.testing.assert_array_almost_equal(scores, model(inference_dataframe).squeeze())
def test_log_model_with_code_paths(pd_model):
artifact_path = "model"
with mlflow.start_run(), mock.patch(
"mlflow.paddle._add_code_from_conf_to_system_path"
) as add_mock:
mlflow.paddle.log_model(pd_model.model, artifact_path, code_paths=[__file__])
model_uri = mlflow.get_artifact_uri(artifact_path)
_compare_logged_code_paths(__file__, model_uri, mlflow.paddle.FLAVOR_NAME)
mlflow.paddle.load_model(model_uri)
add_mock.assert_called()
| 38.134948 | 99 | 0.725751 | 3,067 | 22,042 | 4.816433 | 0.097163 | 0.039331 | 0.036556 | 0.028161 | 0.781275 | 0.745667 | 0.714866 | 0.682034 | 0.642838 | 0.602694 | 0 | 0.004614 | 0.174122 | 22,042 | 577 | 100 | 38.20104 | 0.806856 | 0.01166 | 0 | 0.49011 | 0 | 0 | 0.044319 | 0.011022 | 0 | 0 | 0 | 0 | 0.092308 | 1 | 0.065934 | false | 0 | 0.054945 | 0.006593 | 0.145055 | 0.002198 | 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 |
8aa00c2b5b71cdea77ec4f0b50c0232d0ba172b0 | 1,102 | py | Python | rebootArch4/homework2/myftp.py | pelucky/python-test | 1fefc6649899dfffe200125cc44611471b571600 | [
"MIT"
] | 1 | 2015-12-21T10:57:11.000Z | 2015-12-21T10:57:11.000Z | rebootArch4/homework2/myftp.py | pelucky/python-test | 1fefc6649899dfffe200125cc44611471b571600 | [
"MIT"
] | null | null | null | rebootArch4/homework2/myftp.py | pelucky/python-test | 1fefc6649899dfffe200125cc44611471b571600 | [
"MIT"
] | null | null | null | #!/usr/local/python2.7.9/bin/python
#coding:utf-8
"""
Des: Use for ftp upload
"""
import os
from ftplib import FTP
# my ftp client to upload data
class Myftp:
'''My ftp'''
def __init__(self,config):
'''Set the configure'''
self.ftp_ip = config[0]
self.ftp_username = config[1]
self.ftp_passwd = config[2]
self.ftp_url = config[3]
def login_ftp(self):
self.ftp = FTP(self.ftp_ip)
self.ftp.login(self.ftp_username, self.ftp_passwd)
self.ftp.cwd(self.ftp_url)
# self.ftp.retrlines('LIST')
def upload_file(self, dir_name, sub_dir_name):
try:
self.ftp.mkd(dir_name)
except:
print "The dir is exists!"
finally:
self.ftp.cwd(dir_name)
try:
self.ftp.mkd(sub_dir_name)
except:
print "The sub dir is exists!"
finally:
self.ftp.cwd(sub_dir_name)
files = os.listdir("./")
for f in files:
fh = open(f, 'rb')
self.ftp.storbinary('STOR %s' % f, fh)
fh.close()
self.ftp.cwd("../../")
def download_file(self):
pass
def logout_ftp(self):
self.ftp.quit()
| 21.192308 | 54 | 0.6098 | 170 | 1,102 | 3.805882 | 0.411765 | 0.205564 | 0.061824 | 0.043277 | 0.213292 | 0.148377 | 0.086553 | 0 | 0 | 0 | 0 | 0.009592 | 0.243194 | 1,102 | 51 | 55 | 21.607843 | 0.766187 | 0.092559 | 0 | 0.171429 | 0 | 0 | 0.061356 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.085714 | 0.057143 | null | null | 0.057143 | 0 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
8aa060d283b50908658aaeaabfd14799593e3d0a | 326 | py | Python | quickvision/models/classification/cnn/__init__.py | Quick-AI/quickvision | dc3c083356f3afa12c8992254249d3a1a3ea0d7d | [
"Apache-2.0"
] | 47 | 2020-11-15T03:36:48.000Z | 2021-04-08T05:28:02.000Z | quickvision/models/classification/cnn/__init__.py | oke-aditya/quickvision | dc3c083356f3afa12c8992254249d3a1a3ea0d7d | [
"Apache-2.0"
] | 78 | 2020-11-14T17:55:28.000Z | 2021-04-06T08:55:24.000Z | quickvision/models/classification/cnn/__init__.py | Quick-AI/quickvision | dc3c083356f3afa12c8992254249d3a1a3ea0d7d | [
"Apache-2.0"
] | 15 | 2020-11-14T18:01:04.000Z | 2021-02-16T14:50:12.000Z | from quickvision.models.classification.cnn.engine import (
train_step,
val_step,
fit,
train_sanity_fit,
val_sanity_fit,
sanity_fit,
)
from quickvision.models.classification.cnn.model_factory import (
CNN,
create_cnn,
)
from quickvision.models.classification.cnn.lightning_trainer import LitCNN
| 23.285714 | 74 | 0.760736 | 40 | 326 | 5.95 | 0.45 | 0.189076 | 0.264706 | 0.441176 | 0.478992 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165644 | 326 | 13 | 75 | 25.076923 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.230769 | 0 | 0.230769 | 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 |
8aa627e32aa8f7e07da78d8e6b704039db59c2b5 | 452 | py | Python | backend/app/app/errors/__init__.py | bigSAS/fast-api-backend-starter | 21d92632e9c9668de461dd7f40156ae098765242 | [
"MIT"
] | 1 | 2021-06-23T14:38:24.000Z | 2021-06-23T14:38:24.000Z | backend/app/app/errors/__init__.py | bigSAS/fast-api-backend-starter | 21d92632e9c9668de461dd7f40156ae098765242 | [
"MIT"
] | null | null | null | backend/app/app/errors/__init__.py | bigSAS/fast-api-backend-starter | 21d92632e9c9668de461dd7f40156ae098765242 | [
"MIT"
] | null | null | null | from pydantic import BaseModel
class ErrorMessage(BaseModel):
message: str
class AppError(Exception):
"""
Base app error class. Use for inheritance.
"""
def __init__(self, message: str):
self._message = message
@property
def message(self):
return self._message
def __str__(self):
return self.__repr__()
def __repr__(self):
return f'[{self.__class__.__name__}] {self.message}'
| 18.08 | 60 | 0.639381 | 50 | 452 | 5.26 | 0.48 | 0.1673 | 0.106464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.256637 | 452 | 24 | 61 | 18.833333 | 0.782738 | 0.09292 | 0 | 0 | 0 | 0 | 0.106599 | 0.068528 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.076923 | 0.230769 | 0.846154 | 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 |
8aab75ba7b2f69e3c72816e7b2e05daa76893066 | 21,190 | py | Python | tests/components/config/test_config_entries.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | null | null | null | tests/components/config/test_config_entries.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | null | null | null | tests/components/config/test_config_entries.py | pcaston/Open-Peer-Power | 81805d455c548e0f86b0f7fedc793b588b2afdfd | [
"Apache-2.0"
] | 1 | 2019-04-24T14:10:08.000Z | 2019-04-24T14:10:08.000Z | """Test config entries API."""
from collections import OrderedDict
from unittest.mock import patch
import pytest
import voluptuous as vol
from openpeerpower import config_entries as core_ce, data_entry_flow
from openpeerpower.components.config import config_entries
from openpeerpower.config_entries import HANDLERS
from openpeerpower.core import callback
from openpeerpower.generated import config_flows
from openpeerpower.setup import async_setup_component
from tests.common import (
MockConfigEntry,
MockModule,
mock_coro_func,
mock_entity_platform,
mock_integration,
)
@pytest.fixture(autouse=True)
def mock_test_component(opp):
"""Ensure a component called 'test' exists."""
mock_integration(opp, MockModule("test"))
@pytest.fixture
def client(opp, opp_client):
"""Fixture that can interact with the config manager API."""
opp.loop.run_until_complete(async_setup_component(opp, "http", {}))
opp.loop.run_until_complete(config_entries.async_setup(opp))
yield opp.loop.run_until_complete(opp_client())
async def test_get_entries(opp, client):
"""Test get entries."""
with patch.dict(HANDLERS, clear=True):
@HANDLERS.register("comp1")
class Comp1ConfigFlow:
"""Config flow with options flow."""
@staticmethod
@callback
def async_get_options_flow(config, options):
"""Get options flow."""
pass
opp.helpers.config_entry_flow.register_discovery_flow(
"comp2", "Comp 2", lambda: None, core_ce.CONN_CLASS_ASSUMED
)
MockConfigEntry(
domain="comp1",
title="Test 1",
source="bla",
connection_class=core_ce.CONN_CLASS_LOCAL_POLL,
).add_to_opp(opp)
MockConfigEntry(
domain="comp2",
title="Test 2",
source="bla2",
state=core_ce.ENTRY_STATE_LOADED,
connection_class=core_ce.CONN_CLASS_ASSUMED,
).add_to_opp(opp)
resp = await client.get("/api/config/config_entries/entry")
assert resp.status == 200
data = await resp.json()
for entry in data:
entry.pop("entry_id")
assert data == [
{
"domain": "comp1",
"title": "Test 1",
"source": "bla",
"state": "not_loaded",
"connection_class": "local_poll",
"supports_options": True,
},
{
"domain": "comp2",
"title": "Test 2",
"source": "bla2",
"state": "loaded",
"connection_class": "assumed",
"supports_options": False,
},
]
async def test_remove_entry(opp, client):
"""Test removing an entry via the API."""
entry = MockConfigEntry(domain="demo", state=core_ce.ENTRY_STATE_LOADED)
entry.add_to_opp(opp)
resp = await client.delete(
"/api/config/config_entries/entry/{}".format(entry.entry_id)
)
assert resp.status == 200
data = await resp.json()
assert data == {"require_restart": True}
assert len(opp.config_entries.async_entries()) == 0
async def test_remove_entry_unauth(opp, client, opp_admin_user):
"""Test removing an entry via the API."""
opp_admin_user.groups = []
entry = MockConfigEntry(domain="demo", state=core_ce.ENTRY_STATE_LOADED)
entry.add_to_opp(opp)
resp = await client.delete(
"/api/config/config_entries/entry/{}".format(entry.entry_id)
)
assert resp.status == 401
assert len(opp.config_entries.async_entries()) == 1
async def test_available_flows(opp, client):
"""Test querying the available flows."""
with patch.object(config_flows, "FLOWS", ["hello", "world"]):
resp = await client.get("/api/config/config_entries/flow_handlers")
assert resp.status == 200
data = await resp.json()
assert set(data) == set(["hello", "world"])
############################
# FLOW MANAGER API TESTS #
############################
async def test_initialize_flow(opp, client):
"""Test we can initialize a flow."""
mock_entity_platform(opp, "config_flow.test", None)
class TestFlow(core_ce.ConfigFlow):
async def async_step_user(self, user_input=None):
schema = OrderedDict()
schema[vol.Required("username")] = str
schema[vol.Required("password")] = str
return self.async_show_form(
step_id="user",
data_schema=schema,
description_placeholders={"url": "https://example.com"},
errors={"username": "Should be unique."},
)
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 200
data = await resp.json()
data.pop("flow_id")
assert data == {
"type": "form",
"handler": "test",
"step_id": "user",
"data_schema": [
{"name": "username", "required": True, "type": "string"},
{"name": "password", "required": True, "type": "string"},
],
"description_placeholders": {"url": "https://example.com"},
"errors": {"username": "Should be unique."},
}
async def test_initialize_flow_unauth(opp, client, opp_admin_user):
"""Test we can initialize a flow."""
opp_admin_user.groups = []
class TestFlow(core_ce.ConfigFlow):
async def async_step_user(self, user_input=None):
schema = OrderedDict()
schema[vol.Required("username")] = str
schema[vol.Required("password")] = str
return self.async_show_form(
step_id="user",
data_schema=schema,
description_placeholders={"url": "https://example.com"},
errors={"username": "Should be unique."},
)
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 401
async def test_abort(opp, client):
"""Test a flow that aborts."""
mock_entity_platform(opp, "config_flow.test", None)
class TestFlow(core_ce.ConfigFlow):
async def async_step_user(self, user_input=None):
return self.async_abort(reason="bla")
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 200
data = await resp.json()
data.pop("flow_id")
assert data == {
"description_placeholders": None,
"handler": "test",
"reason": "bla",
"type": "abort",
}
async def test_create_account(opp, client):
"""Test a flow that creates an account."""
mock_entity_platform(opp, "config_flow.test", None)
mock_integration(opp, MockModule("test", async_setup_entry=mock_coro_func(True)))
class TestFlow(core_ce.ConfigFlow):
VERSION = 1
async def async_step_user(self, user_input=None):
return self.async_create_entry(
title="Test Entry", data={"secret": "account_token"}
)
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 200
entries = opp.config_entries.async_entries("test")
assert len(entries) == 1
data = await resp.json()
data.pop("flow_id")
assert data == {
"handler": "test",
"title": "Test Entry",
"type": "create_entry",
"version": 1,
"result": entries[0].entry_id,
"description": None,
"description_placeholders": None,
}
async def test_two_step_flow(opp, client):
"""Test we can finish a two step flow."""
mock_integration(opp, MockModule("test", async_setup_entry=mock_coro_func(True)))
mock_entity_platform(opp, "config_flow.test", None)
class TestFlow(core_ce.ConfigFlow):
VERSION = 1
async def async_step_user(self, user_input=None):
return self.async_show_form(
step_id="account", data_schema=vol.Schema({"user_title": str})
)
async def async_step_account(self, user_input=None):
return self.async_create_entry(
title=user_input["user_title"], data={"secret": "account_token"}
)
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 200
data = await resp.json()
flow_id = data.pop("flow_id")
assert data == {
"type": "form",
"handler": "test",
"step_id": "account",
"data_schema": [{"name": "user_title", "type": "string"}],
"description_placeholders": None,
"errors": None,
}
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow/{}".format(flow_id),
json={"user_title": "user-title"},
)
assert resp.status == 200
entries = opp.config_entries.async_entries("test")
assert len(entries) == 1
data = await resp.json()
data.pop("flow_id")
assert data == {
"handler": "test",
"type": "create_entry",
"title": "user-title",
"version": 1,
"result": entries[0].entry_id,
"description": None,
"description_placeholders": None,
}
async def test_continue_flow_unauth(opp, client, opp_admin_user):
"""Test we can't finish a two step flow."""
mock_integration(opp, MockModule("test", async_setup_entry=mock_coro_func(True)))
mock_entity_platform(opp, "config_flow.test", None)
class TestFlow(core_ce.ConfigFlow):
VERSION = 1
async def async_step_user(self, user_input=None):
return self.async_show_form(
step_id="account", data_schema=vol.Schema({"user_title": str})
)
async def async_step_account(self, user_input=None):
return self.async_create_entry(
title=user_input["user_title"], data={"secret": "account_token"}
)
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 200
data = await resp.json()
flow_id = data.pop("flow_id")
assert data == {
"type": "form",
"handler": "test",
"step_id": "account",
"data_schema": [{"name": "user_title", "type": "string"}],
"description_placeholders": None,
"errors": None,
}
opp_admin_user.groups = []
resp = await client.post(
"/api/config/config_entries/flow/{}".format(flow_id),
json={"user_title": "user-title"},
)
assert resp.status == 401
async def test_get_progress_index(opp, opp_ws_client):
"""Test querying for the flows that are in progress."""
assert await async_setup_component(opp, "config", {})
mock_entity_platform(opp, "config_flow.test", None)
ws_client = await opp_ws_client(opp)
class TestFlow(core_ce.ConfigFlow):
VERSION = 5
async def async_step_oppio(self, info):
return await self.async_step_account()
async def async_step_account(self, user_input=None):
return self.async_show_form(step_id="account")
with patch.dict(HANDLERS, {"test": TestFlow}):
form = await opp.config_entries.flow.async_init(
"test", context={"source": "oppio"}
)
await ws_client.send_json({"id": 5, "type": "config_entries/flow/progress"})
response = await ws_client.receive_json()
assert response["success"]
assert response["result"] == [
{"flow_id": form["flow_id"], "handler": "test", "context": {"source": "oppio"}}
]
async def test_get_progress_index_unauth(opp, opp_ws_client, opp_admin_user):
"""Test we can't get flows that are in progress."""
assert await async_setup_component(opp, "config", {})
opp_admin_user.groups = []
ws_client = await opp_ws_client(opp)
await ws_client.send_json({"id": 5, "type": "config_entries/flow/progress"})
response = await ws_client.receive_json()
assert not response["success"]
assert response["error"]["code"] == "unauthorized"
async def test_get_progress_flow(opp, client):
"""Test we can query the API for same result as we get from init a flow."""
mock_entity_platform(opp, "config_flow.test", None)
class TestFlow(core_ce.ConfigFlow):
async def async_step_user(self, user_input=None):
schema = OrderedDict()
schema[vol.Required("username")] = str
schema[vol.Required("password")] = str
return self.async_show_form(
step_id="user",
data_schema=schema,
errors={"username": "Should be unique."},
)
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 200
data = await resp.json()
resp2 = await client.get(
"/api/config/config_entries/flow/{}".format(data["flow_id"])
)
assert resp2.status == 200
data2 = await resp2.json()
assert data == data2
async def test_get_progress_flow_unauth(opp, client, opp_admin_user):
"""Test we can can't query the API for result of flow."""
mock_entity_platform(opp, "config_flow.test", None)
class TestFlow(core_ce.ConfigFlow):
async def async_step_user(self, user_input=None):
schema = OrderedDict()
schema[vol.Required("username")] = str
schema[vol.Required("password")] = str
return self.async_show_form(
step_id="user",
data_schema=schema,
errors={"username": "Should be unique."},
)
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/flow", json={"handler": "test"}
)
assert resp.status == 200
data = await resp.json()
opp_admin_user.groups = []
resp2 = await client.get(
"/api/config/config_entries/flow/{}".format(data["flow_id"])
)
assert resp2.status == 401
async def test_options_flow(opp, client):
"""Test we can change options."""
class TestFlow(core_ce.ConfigFlow):
@staticmethod
@callback
def async_get_options_flow(config_entry):
class OptionsFlowHandler(data_entry_flow.FlowHandler):
async def async_step_init(self, user_input=None):
schema = OrderedDict()
schema[vol.Required("enabled")] = bool
return self.async_show_form(
step_id="user",
data_schema=schema,
description_placeholders={"enabled": "Set to true to be true"},
)
return OptionsFlowHandler()
MockConfigEntry(
domain="test",
entry_id="test1",
source="bla",
connection_class=core_ce.CONN_CLASS_LOCAL_POLL,
).add_to_opp(opp)
entry = opp.config_entries._entries[0]
with patch.dict(HANDLERS, {"test": TestFlow}):
url = "/api/config/config_entries/options/flow"
resp = await client.post(url, json={"handler": entry.entry_id})
assert resp.status == 200
data = await resp.json()
data.pop("flow_id")
assert data == {
"type": "form",
"handler": "test1",
"step_id": "user",
"data_schema": [{"name": "enabled", "required": True, "type": "boolean"}],
"description_placeholders": {"enabled": "Set to true to be true"},
"errors": None,
}
async def test_two_step_options_flow(opp, client):
"""Test we can finish a two step options flow."""
mock_integration(opp, MockModule("test", async_setup_entry=mock_coro_func(True)))
class TestFlow(core_ce.ConfigFlow):
@staticmethod
@callback
def async_get_options_flow(config_entry):
class OptionsFlowHandler(data_entry_flow.FlowHandler):
async def async_step_init(self, user_input=None):
return self.async_show_form(
step_id="finish", data_schema=vol.Schema({"enabled": bool})
)
async def async_step_finish(self, user_input=None):
return self.async_create_entry(
title="Enable disable", data=user_input
)
return OptionsFlowHandler()
MockConfigEntry(
domain="test",
entry_id="test1",
source="bla",
connection_class=core_ce.CONN_CLASS_LOCAL_POLL,
).add_to_opp(opp)
entry = opp.config_entries._entries[0]
with patch.dict(HANDLERS, {"test": TestFlow}):
url = "/api/config/config_entries/options/flow"
resp = await client.post(url, json={"handler": entry.entry_id})
assert resp.status == 200
data = await resp.json()
flow_id = data.pop("flow_id")
assert data == {
"type": "form",
"handler": "test1",
"step_id": "finish",
"data_schema": [{"name": "enabled", "type": "boolean"}],
"description_placeholders": None,
"errors": None,
}
with patch.dict(HANDLERS, {"test": TestFlow}):
resp = await client.post(
"/api/config/config_entries/options/flow/{}".format(flow_id),
json={"enabled": True},
)
assert resp.status == 200
data = await resp.json()
data.pop("flow_id")
assert data == {
"handler": "test1",
"type": "create_entry",
"title": "Enable disable",
"version": 1,
"description": None,
"description_placeholders": None,
}
async def test_list_system_options(opp, opp_ws_client):
"""Test that we can list an entries system options."""
assert await async_setup_component(opp, "config", {})
ws_client = await opp_ws_client(opp)
entry = MockConfigEntry(domain="demo")
entry.add_to_opp(opp)
await ws_client.send_json(
{
"id": 5,
"type": "config_entries/system_options/list",
"entry_id": entry.entry_id,
}
)
response = await ws_client.receive_json()
assert response["success"]
assert response["result"] == {"disable_new_entities": False}
async def test_update_system_options(opp, opp_ws_client):
"""Test that we can update system options."""
assert await async_setup_component(opp, "config", {})
ws_client = await opp_ws_client(opp)
entry = MockConfigEntry(domain="demo")
entry.add_to_opp(opp)
await ws_client.send_json(
{
"id": 5,
"type": "config_entries/system_options/update",
"entry_id": entry.entry_id,
"disable_new_entities": True,
}
)
response = await ws_client.receive_json()
assert response["success"]
assert response["result"]["disable_new_entities"]
assert entry.system_options.disable_new_entities
async def test_ignore_flow(opp, opp_ws_client):
"""Test we can ignore a flow."""
assert await async_setup_component(opp, "config", {})
mock_integration(opp, MockModule("test", async_setup_entry=mock_coro_func(True)))
mock_entity_platform(opp, "config_flow.test", None)
class TestFlow(core_ce.ConfigFlow):
VERSION = 1
async def async_step_user(self, user_input=None):
await self.async_set_unique_id("mock-unique-id")
return self.async_show_form(step_id="account", data_schema=vol.Schema({}))
ws_client = await opp_ws_client(opp)
with patch.dict(HANDLERS, {"test": TestFlow}):
result = await opp.config_entries.flow.async_init(
"test", context={"source": "user"}
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
await ws_client.send_json(
{
"id": 5,
"type": "config_entries/ignore_flow",
"flow_id": result["flow_id"],
}
)
response = await ws_client.receive_json()
assert response["success"]
assert len(opp.config_entries.flow.async_progress()) == 0
entry = opp.config_entries.async_entries("test")[0]
assert entry.source == "ignore"
assert entry.unique_id == "mock-unique-id"
| 32.15478 | 87 | 0.595611 | 2,444 | 21,190 | 4.948036 | 0.084697 | 0.041925 | 0.018854 | 0.034565 | 0.799223 | 0.760357 | 0.721823 | 0.691805 | 0.65542 | 0.642769 | 0 | 0.006879 | 0.272817 | 21,190 | 658 | 88 | 32.203647 | 0.777922 | 0.009155 | 0 | 0.618952 | 0 | 0 | 0.161946 | 0.05048 | 0 | 0 | 0 | 0 | 0.110887 | 1 | 0.010081 | false | 0.012097 | 0.022177 | 0 | 0.108871 | 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 |
8aac79a19a9370a019dcf0ec42e7416bcdc21368 | 321 | py | Python | env/lib/python3.8/site-packages/plotly/validators/layout/uniformtext/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/uniformtext/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/uniformtext/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import sys
if sys.version_info < (3, 7):
from ._mode import ModeValidator
from ._minsize import MinsizeValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._mode.ModeValidator", "._minsize.MinsizeValidator"]
)
| 26.75 | 76 | 0.719626 | 34 | 321 | 6.058824 | 0.617647 | 0.135922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007663 | 0.186916 | 321 | 11 | 77 | 29.181818 | 0.781609 | 0 | 0 | 0 | 0 | 0 | 0.143302 | 0.080997 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.555556 | 0 | 0.555556 | 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 |
8ab88b6e5262b684b962e1e9c85002d3c3b25c78 | 322 | py | Python | sandbox/sandbox_002_test.py | daviddoret/pyxag | 6884c7e100d28c3ce6273248caa40eaeab920bc5 | [
"MIT"
] | 1 | 2019-10-27T15:56:27.000Z | 2019-10-27T15:56:27.000Z | sandbox/sandbox_002_test.py | daviddoret/pynag | 6884c7e100d28c3ce6273248caa40eaeab920bc5 | [
"MIT"
] | 11 | 2019-11-04T18:21:16.000Z | 2019-11-07T03:22:41.000Z | sandbox/sandbox_002_test.py | daviddoret/pynag | 6884c7e100d28c3ce6273248caa40eaeab920bc5 | [
"MIT"
] | null | null | null | import unittest
from functions.get_nag_sample import get_nag_sample_constant_0
from functions.get_nag_sample import get_nag_sample_binary_xor
import numpy as np
#nag = get_nag_sample_constant_0()
#print(nag.execute([]))
#print(nag.execute_output_only([]))
a = [1, 1, 1]
b = np.repeat([0], 5)
c = np.append(a,b)
print(c)
| 23 | 62 | 0.767081 | 58 | 322 | 3.948276 | 0.431034 | 0.131004 | 0.262009 | 0.165939 | 0.50655 | 0.375546 | 0.375546 | 0.375546 | 0.375546 | 0 | 0 | 0.024306 | 0.10559 | 322 | 13 | 63 | 24.769231 | 0.770833 | 0.276398 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0.125 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
8aceaa92b2272b8286a19088efa3b3e61ad3735b | 2,000 | py | Python | _object.py | omar659/Monkey-Compiler | 7b6bfd224772f085da3a4925a49523d7c8ba2a30 | [
"Apache-2.0"
] | 1 | 2020-07-18T18:37:30.000Z | 2020-07-18T18:37:30.000Z | _object.py | omar-3/Monkey-Compiler | 7b6bfd224772f085da3a4925a49523d7c8ba2a30 | [
"Apache-2.0"
] | null | null | null | _object.py | omar-3/Monkey-Compiler | 7b6bfd224772f085da3a4925a49523d7c8ba2a30 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import List
import enum
class obj(enum.Enum):
INTEGER_OBJ = "INTEGER"
BOOLEAN_OBJ = "BOOLEAN"
NULL_OBJ = "NULL"
RETURN_VALUE_OBJ = "RETURN_VALUE"
ERROR_OBJ = "ERROR"
class Object(ABC):
@abstractmethod
def Type(self):
pass
def Inspect(self):
pass
################################################################################
class Integer(Object):
def __init__(self, Value: int):
self.Value = Value
def Inspect(self):
return f'{self.Value}'
def Type(self):
return obj.INTEGER_OBJ
def __eq__(self, other):
if type(self) is type(other):
return self.__dict__ == other.__dict__
return False
################################################################################
class Boolean(Object):
def __init__(self, Value: bool):
self.Value = Value
def Inspect(self):
return f'{self.Value}'
def Type(self):
return obj.BOOLEAN_OBJ
def __eq__(self, other):
if type(self) is type(other):
return self.__dict__ == other.__dict__
return False
################################################################################
class Null(Object):
def __init__(self):
self.Value = None
def Inspect(self):
return 'null'
def Type(self):
return obj.NULL_OBJ
#################################################################################
class ReturnValue(Object):
def __init__(self, Value: Object):
self.Value = Value
def Type(self):
return obj.RETURN_VALUE_OBJ
def Inspect(self):
return self.Value.Inspect()
#################################################################################
class Error(Object):
def __init__(self, Message: str):
self.Message = Message
def Type(self):
return obj.ERROR_OBJ
def Inspect(self):
return "ERROR " + self.Message
| 25.316456 | 81 | 0.4875 | 200 | 2,000 | 4.59 | 0.175 | 0.098039 | 0.071895 | 0.092593 | 0.5 | 0.334423 | 0.30719 | 0.30719 | 0.30719 | 0.30719 | 0 | 0 | 0.232 | 2,000 | 78 | 82 | 25.641026 | 0.597656 | 0 | 0 | 0.465517 | 0 | 0 | 0.043206 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.327586 | false | 0.034483 | 0.051724 | 0.172414 | 0.827586 | 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 |
8ad3e5f120ff26c3b43d46da4024b0515da83b8a | 124 | py | Python | Chapter09/exceptiontype.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | 12 | 2018-07-09T16:20:31.000Z | 2022-03-21T22:52:15.000Z | Chapter09/exceptiontype.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | null | null | null | Chapter09/exceptiontype.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | 19 | 2018-01-09T12:49:06.000Z | 2021-11-23T08:05:55.000Z | try:
num = int(raw_input("Enter the number "))
re = 100/num
print re
except Exception as e :
print e, type(e)
| 17.714286 | 44 | 0.612903 | 21 | 124 | 3.571429 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033333 | 0.274194 | 124 | 6 | 45 | 20.666667 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.144068 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
76e384d02079947fc4fc84b94ba4db112bda08a5 | 397 | py | Python | projects/olds/sqlNewsFilter/news/forms.py | Bingwen-Hu/hackaway | 69727d76fd652390d9660e9ea4354ba5cc76dd5c | [
"BSD-2-Clause"
] | null | null | null | projects/olds/sqlNewsFilter/news/forms.py | Bingwen-Hu/hackaway | 69727d76fd652390d9660e9ea4354ba5cc76dd5c | [
"BSD-2-Clause"
] | null | null | null | projects/olds/sqlNewsFilter/news/forms.py | Bingwen-Hu/hackaway | 69727d76fd652390d9660e9ea4354ba5cc76dd5c | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django import forms
class CompanyForm(forms.Form):
"""公司FOrm,包括公司名, 公司ID, 系统ID和关键词"""
Name = forms.CharField(max_length=32)
CompanyID = forms.CharField(max_length=64)
SystemID = forms.CharField(max_length=64)
Keywords = forms.CharField(max_length=1000)
class DeleteForm(forms.Form):
"""只能通过name来删除"""
Name = forms.CharField(max_length=32) | 30.538462 | 47 | 0.702771 | 50 | 397 | 5.48 | 0.52 | 0.255474 | 0.310219 | 0.419708 | 0.394161 | 0.211679 | 0 | 0 | 0 | 0 | 0 | 0.03869 | 0.153652 | 397 | 13 | 48 | 30.538462 | 0.776786 | 0.15869 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0a0a8f901551d767819936885ab30ddffd0837e2 | 73 | py | Python | Configuration/Eras/python/Modifier_run2_common_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Eras/python/Modifier_run2_common_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Eras/python/Modifier_run2_common_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
run2_common = cms.Modifier()
| 14.6 | 40 | 0.780822 | 10 | 73 | 5.6 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015873 | 0.136986 | 73 | 4 | 41 | 18.25 | 0.873016 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 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 |
0a0a9ec49c1d947018066f668b76cb45fb89d85e | 169 | py | Python | buffer/in-vicinity-python/hci/PySide/speech-coding-project/qml/qmltxt/wget/addition.py | zaqwes8811/coordinator-tasks | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | null | null | null | buffer/in-vicinity-python/hci/PySide/speech-coding-project/qml/qmltxt/wget/addition.py | zaqwes8811/coordinator-tasks | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | 15 | 2015-03-07T12:46:41.000Z | 2015-04-11T09:08:36.000Z | buffer/in-vicinity-python/hci/PySide/speech-coding-project/qml/qmltxt/wget/addition.py | zaqwes8811/micro-apps | 7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# file : addition.py
from PySide import QtCore
# _TEST_
class Console(QtCore.QObject):
@QtCore.Slot(str)
def outputStr(self, s):
print s | 18.777778 | 30 | 0.668639 | 24 | 169 | 4.625 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007246 | 0.183432 | 169 | 9 | 31 | 18.777778 | 0.797101 | 0.278107 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.2 | null | null | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0a12bf33a0ccf8a8cb81887e7a150b253a4eab08 | 1,151 | py | Python | core/admin.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 3 | 2018-02-27T13:48:28.000Z | 2018-03-03T21:57:50.000Z | core/admin.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 6 | 2020-02-12T00:07:46.000Z | 2022-03-11T23:25:59.000Z | core/admin.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 1 | 2019-03-26T20:19:57.000Z | 2019-03-26T20:19:57.000Z | from django.contrib import admin
from .models import *
class UserProfileAdmin(admin.ModelAdmin):
list_display = ('name', 'roll_no', 'programme', 'department', 'hall', 'room_no')
admin.site.register(UserProfile, UserProfileAdmin)
class NominationAdmin(admin.ModelAdmin):
list_display = ('name', 'status', 'opening_date', 'deadline')
admin.site.register(Nomination, NominationAdmin)
class NominationInstanceAdmin(admin.ModelAdmin):
list_display = ('nomination', 'user', 'status')
admin.site.register(NominationInstance, NominationInstanceAdmin)
class PostAdmin(admin.ModelAdmin):
list_display = ('post_name', 'pk', 'club', 'parent')
admin.site.register(Post, PostAdmin)
class ClubAdmin(admin.ModelAdmin):
list_display = ('pk', 'club_name', 'club_parent')
admin.site.register(Club, ClubAdmin)
class PostHistoryAdmin(admin.ModelAdmin):
list_display = ('post', 'user', 'start', 'end')
admin.site.register(PostHistory, PostHistoryAdmin)
admin.site.register(Deratification)
admin.site.register(GroupNomination)
admin.site.register(ReopenNomination)
admin.site.register(Session)
admin.site.register(ClubCreate)
| 23.02 | 84 | 0.754996 | 124 | 1,151 | 6.91129 | 0.362903 | 0.115519 | 0.218203 | 0.18203 | 0.203034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105126 | 1,151 | 49 | 85 | 23.489796 | 0.832039 | 0 | 0 | 0 | 0 | 0 | 0.130321 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.08 | 0 | 0.56 | 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 | 0 | 1 | 0 | 0 | 3 |
0a406f57ae9961d2ee158a7d93257e7fcae7541b | 530 | py | Python | terrarium/data_sources/yahoo_weather.py | dredington/terrarium | 691d4c4eca24df6ead69bd76badce30161a43050 | [
"MIT"
] | null | null | null | terrarium/data_sources/yahoo_weather.py | dredington/terrarium | 691d4c4eca24df6ead69bd76badce30161a43050 | [
"MIT"
] | null | null | null | terrarium/data_sources/yahoo_weather.py | dredington/terrarium | 691d4c4eca24df6ead69bd76badce30161a43050 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from weather import Weather, Unit
from sentinel import DataSource
class YahooWeather(DataSource):
def __init__(self):
self.weather = Weather(unit=Unit.FAHRENHEIT)
self.lookup = self.weather.lookup_by_location(80031)
self.condition = self.lookup.condition
def report(self):
return { 'temperature': self.temperature(), 'humidity': self.humidity() }
def temperature(self):
return int(self.condition.temp)
def humidity(self):
return int(self.lookup.atmosphere['humidity'])
| 25.238095 | 77 | 0.730189 | 65 | 530 | 5.861538 | 0.430769 | 0.07874 | 0.068241 | 0.089239 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013304 | 0.149057 | 530 | 20 | 78 | 26.5 | 0.831486 | 0.039623 | 0 | 0 | 0 | 0 | 0.05315 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.153846 | 0.230769 | 0.769231 | 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.