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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d05e84dc9aff4e779540be30d4ef0d0ace895b44 | 158 | py | Python | nombredelproyecto/nombreapp/apps.py | engelpain/AprendiendoDjango | e0f04302fd79e8002910b8ccba916aa0ede29fb7 | [
"MIT"
] | null | null | null | nombredelproyecto/nombreapp/apps.py | engelpain/AprendiendoDjango | e0f04302fd79e8002910b8ccba916aa0ede29fb7 | [
"MIT"
] | null | null | null | nombredelproyecto/nombreapp/apps.py | engelpain/AprendiendoDjango | e0f04302fd79e8002910b8ccba916aa0ede29fb7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class NombreappConfig(AppConfig):
name = 'nombreapp'
| 17.555556 | 39 | 0.740506 | 18 | 158 | 6.222222 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007519 | 0.158228 | 158 | 8 | 40 | 19.75 | 0.834586 | 0.132911 | 0 | 0 | 0 | 0 | 0.066667 | 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 | 1 | 0 | 0 | 4 |
d06e7c8dc134148cb706897bafa8bbbaa7f4791c | 177 | py | Python | packages/core/minos-microservice-networks/minos/networks/brokers/subscribers/queued/queues/database/__init__.py | minos-framework/minos-python | 9a6ad6783361f3d8a497a088808b55ea7a938c6c | [
"MIT"
] | 247 | 2022-01-24T14:55:30.000Z | 2022-03-25T12:06:17.000Z | packages/core/minos-microservice-networks/minos/networks/brokers/subscribers/queued/queues/database/__init__.py | minos-framework/minos-python | 9a6ad6783361f3d8a497a088808b55ea7a938c6c | [
"MIT"
] | 168 | 2022-01-24T14:54:31.000Z | 2022-03-31T09:31:09.000Z | packages/core/minos-microservice-networks/minos/networks/brokers/subscribers/queued/queues/database/__init__.py | minos-framework/minos-python | 9a6ad6783361f3d8a497a088808b55ea7a938c6c | [
"MIT"
] | 21 | 2022-02-06T17:25:58.000Z | 2022-03-27T04:50:29.000Z | from .factories import (
BrokerSubscriberQueueDatabaseOperationFactory,
)
from .impl import (
DatabaseBrokerSubscriberQueue,
DatabaseBrokerSubscriberQueueBuilder,
)
| 22.125 | 50 | 0.80791 | 9 | 177 | 15.888889 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141243 | 177 | 7 | 51 | 25.285714 | 0.940789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 1 | 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 | 4 |
d08c9e38a3842963f3a335b7123900468483a24d | 78 | py | Python | benchmarks/Fibonacci/Fibonacci.py | Qlova/ilang | 17188f6b2fd678928ad341cd218e807520279f1a | [
"Artistic-2.0"
] | 6 | 2017-09-03T07:08:34.000Z | 2018-08-09T14:14:49.000Z | benchmarks/Fibonacci/Fibonacci.py | qlova/ilang | 17188f6b2fd678928ad341cd218e807520279f1a | [
"Artistic-2.0"
] | 14 | 2016-07-20T12:25:14.000Z | 2018-06-13T04:14:43.000Z | benchmarks/Fibonacci/Fibonacci.py | qlova/ilang | 17188f6b2fd678928ad341cd218e807520279f1a | [
"Artistic-2.0"
] | 1 | 2017-09-26T02:02:04.000Z | 2017-09-26T02:02:04.000Z | def fib(n):
if n < 2:
return n
return fib(n-1) + fib(n-2)
print(fib(30))
| 11.142857 | 27 | 0.564103 | 18 | 78 | 2.444444 | 0.5 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 0.230769 | 78 | 6 | 28 | 13 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.6 | 0.2 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
d0a8ae299d5eb3533fa545c4fa09af8b902d9e90 | 747 | py | Python | scripts/cosine.py | skoulouzis/E-COCO | d2657f283b9e715033c2aeb9a43958c43b2cc2b2 | [
"Apache-2.0"
] | 1 | 2017-12-19T16:27:26.000Z | 2017-12-19T16:27:26.000Z | scripts/cosine.py | skoulouzis/E-CO-2 | d2657f283b9e715033c2aeb9a43958c43b2cc2b2 | [
"Apache-2.0"
] | 22 | 2016-07-01T12:27:01.000Z | 2021-11-10T10:56:39.000Z | scripts/cosine.py | skoulouzis/E-COCO | d2657f283b9e715033c2aeb9a43958c43b2cc2b2 | [
"Apache-2.0"
] | 3 | 2017-09-18T09:56:53.000Z | 2021-03-18T00:05:08.000Z | from scipy import spatial
cv = [0.1523230959, 0.1723340427, 0.1436187823, 0.0937464038, 0.0770848655, 0.0296825692, 0.076575456, 0.1581296577, 0.1031274647, 0.0454623065, 0.1055528533, 0.0559519702, 0.0836470141, 0.2134543524, 0.1665261675, 0.1039377815, 0.0843013781, 0.0621802636, 0.0772685446, 0.1037510024, 0.0422574617, 0.2743938044, 0.1893437829]
jobs = [0.2407257174, 0.0447829943, 0.2361261648, 0.0348669893, 0.1424850219, 0.0472701375, 0.0555587367, 0.2269497742, 0.0767076683, 0.0206122116, 0.0926937554, 0.0422161878, 0.0525557046, 0.1500645831, 0.2376042255, 0.0563189083, 0.0650523254, 0.0583425591, 0.1253678009, 0.0637731625, 0.0728895656, 0.0749859927, 0.0897501389]
result = 1 - spatial.distance.cosine(cv, jobs)
print result
| 74.7 | 329 | 0.773762 | 107 | 747 | 5.401869 | 0.542056 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.743025 | 0.088353 | 747 | 9 | 330 | 83 | 0.105727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.2 | null | null | 0.2 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d0d92d916115d67a5bbadfedd227bf8fcfa10392 | 51 | py | Python | atcoder/abc186/a.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | atcoder/abc186/a.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | atcoder/abc186/a.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | print((lambda a,b:a//b)(*map(int,input().split()))) | 51 | 51 | 0.607843 | 10 | 51 | 3.1 | 0.8 | 0.129032 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019608 | 51 | 1 | 51 | 51 | 0.62 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 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 | 1 | 0 | 4 |
190c0a796e69cd9a5fd4ca92bc039719abebbea4 | 1,050 | py | Python | zilean/system/zilean_partitions.py | A-Hilaly/zilean | 2b2e87969a0d8064e8b92b07c346a4006f93c795 | [
"Apache-2.0"
] | null | null | null | zilean/system/zilean_partitions.py | A-Hilaly/zilean | 2b2e87969a0d8064e8b92b07c346a4006f93c795 | [
"Apache-2.0"
] | null | null | null | zilean/system/zilean_partitions.py | A-Hilaly/zilean | 2b2e87969a0d8064e8b92b07c346a4006f93c795 | [
"Apache-2.0"
] | null | null | null | from zilean.datasets.sys.machines import ZileanMachines
from zilean.datasets.sys.linked import ZLinkedDatabases
from .zilean_users import ZileanUsers
class Partition(object):
def __init__(self, mn, *args):
self.front = '{0}_zdb'.format(mn)
self.other = list(args)
def dump(self):
r = self.other + [self.front]
return r
class ZileanPartition(object):
def __init__(object):
pass
def all_partitions(self):
pass
def all_databases(self):
pass
def all_linked(self):
pass
def new_database(self):
pass
def remove_database(self):
pass
def link_database(self):
pass
def add_machine_database(self):
pass
def remove_machine_database(self):
pass
def machine_partitions(self):
pass
def is_partition_of(self):
pass
def check_machine_partitions(self):
pass
def make_machine_partitions(self):
pass
def remove_machine_partitions(self):
pass
| 17.79661 | 55 | 0.631429 | 125 | 1,050 | 5.072 | 0.344 | 0.143533 | 0.208202 | 0.149842 | 0.283912 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00134 | 0.289524 | 1,050 | 58 | 56 | 18.103448 | 0.848525 | 0 | 0 | 0.358974 | 0 | 0 | 0.006667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.410256 | false | 0.358974 | 0.076923 | 0 | 0.564103 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
190d346bf20a93be207aa699647d7f3db2dfe246 | 88 | py | Python | eb_anno/apps.py | kulits/ElephantBook | 729aaf64b8f039cfc2a636e2d2745292aa4ea98e | [
"Apache-2.0"
] | null | null | null | eb_anno/apps.py | kulits/ElephantBook | 729aaf64b8f039cfc2a636e2d2745292aa4ea98e | [
"Apache-2.0"
] | null | null | null | eb_anno/apps.py | kulits/ElephantBook | 729aaf64b8f039cfc2a636e2d2745292aa4ea98e | [
"Apache-2.0"
] | 2 | 2021-08-17T20:26:22.000Z | 2021-09-18T11:44:36.000Z | from django.apps import AppConfig
class EbAnnoConfig(AppConfig):
name = 'eb_anno'
| 14.666667 | 33 | 0.75 | 11 | 88 | 5.909091 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170455 | 88 | 5 | 34 | 17.6 | 0.890411 | 0 | 0 | 0 | 0 | 0 | 0.079545 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
ef85f11fa012293f928b263dc08ba7b1cab75a25 | 44 | py | Python | mmdet/datasets/mmcocotools/__init__.py | VIRC-lab-csust/AGMNet | ead95466da343cf9436774138c642d2ca12da4e4 | [
"Apache-2.0"
] | 47 | 2020-06-07T16:53:02.000Z | 2022-03-18T03:26:38.000Z | mmdet/datasets/pycoco/__init__.py | lh0515/cas-dc-template | 5b0400ca5dc98d09beca36d46cc55bfabb9ce4e0 | [
"Apache-2.0"
] | 12 | 2020-06-25T15:59:03.000Z | 2021-10-16T11:00:20.000Z | mmdet/datasets/pycoco/__init__.py | lh0515/cas-dc-template | 5b0400ca5dc98d09beca36d46cc55bfabb9ce4e0 | [
"Apache-2.0"
] | 38 | 2020-05-24T11:27:36.000Z | 2022-01-24T07:37:25.000Z | __author__ = 'tylin'
__version__ = '12.0.2'
| 14.666667 | 22 | 0.681818 | 6 | 44 | 3.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 0.136364 | 44 | 2 | 23 | 22 | 0.473684 | 0 | 0 | 0 | 0 | 0 | 0.25 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
efa544d560acdebd0d00a774d0f671edb30aac31 | 67 | py | Python | TermTk/TTkAbstract/__init__.py | ceccopierangiolieugenio/py-ttk | 117d61844bb7344bbe22a7797b7e3763d5fe4de5 | [
"MIT"
] | 1 | 2022-02-28T16:33:25.000Z | 2022-02-28T16:33:25.000Z | TermTk/TTkAbstract/__init__.py | ceccopierangiolieugenio/py-ttk | 117d61844bb7344bbe22a7797b7e3763d5fe4de5 | [
"MIT"
] | null | null | null | TermTk/TTkAbstract/__init__.py | ceccopierangiolieugenio/py-ttk | 117d61844bb7344bbe22a7797b7e3763d5fe4de5 | [
"MIT"
] | null | null | null | from .abstractscrollarea import *
from .abstractitemmodel import *
| 22.333333 | 33 | 0.820896 | 6 | 67 | 9.166667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119403 | 67 | 2 | 34 | 33.5 | 0.932203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
5602ddbae5a3c0103098a6fb7b4c6ecd67d11f13 | 167 | py | Python | requests/requests-utils.urldefragauth.py | all3g/pieces | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 34 | 2016-10-31T02:05:24.000Z | 2018-11-08T14:33:13.000Z | requests/requests-utils.urldefragauth.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 2 | 2017-05-11T03:00:31.000Z | 2017-11-01T23:37:37.000Z | requests/requests-utils.urldefragauth.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 21 | 2016-08-19T09:05:45.000Z | 2018-11-08T14:33:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
url = "http://user:pass@demo.com/index.php?id=1&p=x"
print(url)
print(requests.utils.urldefragauth(url))
| 15.181818 | 52 | 0.676647 | 27 | 167 | 4.185185 | 0.851852 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013333 | 0.101796 | 167 | 10 | 53 | 16.7 | 0.74 | 0.227545 | 0 | 0 | 0 | 0.25 | 0.346457 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 0.25 | 0 | 0.25 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 4 |
ef092c0ff291b181f1d1a1ebb8f5907eb202c1be | 624 | py | Python | doc/source/image/contrast.py | ppawlak/pystacia | 854053a2872c9374e2c121c4af549f6bba640116 | [
"MIT"
] | 9 | 2015-02-11T21:33:33.000Z | 2021-06-14T14:55:24.000Z | doc/source/image/contrast.py | ppawlak/pystacia | 854053a2872c9374e2c121c4af549f6bba640116 | [
"MIT"
] | 1 | 2016-08-01T12:31:17.000Z | 2016-08-01T12:31:17.000Z | doc/source/image/contrast.py | ppawlak/pystacia | 854053a2872c9374e2c121c4af549f6bba640116 | [
"MIT"
] | 2 | 2015-08-21T08:23:25.000Z | 2018-10-31T02:52:50.000Z | from os.path import dirname, join
from pystacia import lena
dest = join(dirname(__file__), '../_static/generated')
image = lena(128)
image.contrast(-1)
image.write(join(dest, 'lena_contrast-1.jpg'))
image.close()
image = lena(128)
image.contrast(-0.6)
image.write(join(dest, 'lena_contrast-0.6.jpg'))
image.close()
image = lena(128)
image.contrast(-0.25)
image.write(join(dest, 'lena_contrast-0.25.jpg'))
image.close()
image = lena(128)
image.contrast(0.25)
image.write(join(dest, 'lena_contrast0.25.jpg'))
image.close()
image = lena(128)
image.contrast(1)
image.write(join(dest, 'lena_contrast1.jpg'))
image.close()
| 20.129032 | 54 | 0.725962 | 100 | 624 | 4.43 | 0.24 | 0.10158 | 0.13544 | 0.191874 | 0.735892 | 0.735892 | 0.717833 | 0.62754 | 0.62754 | 0.501129 | 0 | 0.061511 | 0.088141 | 624 | 30 | 55 | 20.8 | 0.717047 | 0 | 0 | 0.434783 | 1 | 0 | 0.19391 | 0.102564 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.086957 | 0 | 0.086957 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ef1626154dd6387a915ea1ca609b4fe7d18ca37f | 83 | py | Python | mycelyso/misc/__init__.py | csachs/mycelyso | b7b383cd1fa55be7b084821e5b38b72bf9df7f59 | [
"BSD-2-Clause"
] | 2 | 2019-04-19T03:11:06.000Z | 2021-10-06T03:11:22.000Z | mycelyso/misc/__init__.py | csachs/mycelyso | b7b383cd1fa55be7b084821e5b38b72bf9df7f59 | [
"BSD-2-Clause"
] | 1 | 2020-05-27T08:24:32.000Z | 2020-06-09T07:53:46.000Z | mycelyso/misc/__init__.py | csachs/mycelyso | b7b383cd1fa55be7b084821e5b38b72bf9df7f59 | [
"BSD-2-Clause"
] | 3 | 2017-05-29T07:52:55.000Z | 2021-01-15T19:44:45.000Z | # -*- coding: utf-8 -*-
"""
The misc package contains various helper functions.
""" | 20.75 | 51 | 0.650602 | 10 | 83 | 5.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014286 | 0.156627 | 83 | 4 | 52 | 20.75 | 0.757143 | 0.891566 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ef3a197c06a63860f1fdf3f65a8982ccbf755a35 | 116 | py | Python | basic-concepts-and-functions/complex-type.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | 1 | 2021-01-16T21:42:42.000Z | 2021-01-16T21:42:42.000Z | basic-concepts-and-functions/complex-type.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | null | null | null | basic-concepts-and-functions/complex-type.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | null | null | null | """
This module shows the complex Python numbers
"""
z = 1 + 1j
print(z + 2) # 3 + 1j
print(z.conjugate()) # 1 - 1j
| 16.571429 | 44 | 0.603448 | 20 | 116 | 3.5 | 0.7 | 0.085714 | 0.228571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077778 | 0.224138 | 116 | 6 | 45 | 19.333333 | 0.7 | 0.508621 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.666667 | 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 | 1 | 0 | 4 |
ef4ac63f9bee0140eaf04088871051143d630c7c | 1,314 | py | Python | tests/test_tools.py | PTank/trashtalk | 1fc539f1fbe02342fce8f18d5365cfad1902ead8 | [
"MIT"
] | null | null | null | tests/test_tools.py | PTank/trashtalk | 1fc539f1fbe02342fce8f18d5365cfad1902ead8 | [
"MIT"
] | null | null | null | tests/test_tools.py | PTank/trashtalk | 1fc539f1fbe02342fce8f18d5365cfad1902ead8 | [
"MIT"
] | null | null | null | from trashtalk.tools import human_readable_from_bytes, print_files
def test_human_readable_from_bytes():
b = human_readable_from_bytes(500)
k = human_readable_from_bytes(1024)
m = human_readable_from_bytes(1024**2)
g = human_readable_from_bytes(1024**3)
t = human_readable_from_bytes(1024**4)
p = human_readable_from_bytes(1024**5)
e = human_readable_from_bytes(1024**6)
z = human_readable_from_bytes(1024**7)
y = human_readable_from_bytes(1024**8)
assert b == '500'
assert k == "1K"
assert m == "1M"
assert g == "1G"
assert t == "1T"
assert p == "1P"
assert e == "1E"
assert z == "1Z"
assert y == "1Y"
assert "test error" == human_readable_from_bytes("test error")
def test_print_files(capsys):
l = [["un", 2, 3, 432], ["deux", 2, 3], ["trois", 2, 3, 4]]
print_files(l, 4)
out, err = capsys.readouterr()
assert bool(err) == False
s = out.split('\n')
assert s[0] == "un 2 3 432"
assert s[1] == "deux 2 3 "
assert s[2] == "trois 2 3 4"
print_files([], 4)
out, err = capsys.readouterr()
assert bool(err) == False
assert bool(out) == False
l = [[None, "error"]]
print_files(l, 4)
out, err = capsys.readouterr()
assert bool(out) == False
assert err == "error\n"
| 27.957447 | 66 | 0.611111 | 200 | 1,314 | 3.8 | 0.28 | 0.205263 | 0.268421 | 0.347368 | 0.488158 | 0.214474 | 0.180263 | 0.180263 | 0.180263 | 0.115789 | 0 | 0.078921 | 0.238204 | 1,314 | 46 | 67 | 28.565217 | 0.68032 | 0 | 0 | 0.230769 | 0 | 0 | 0.075342 | 0 | 0 | 0 | 0 | 0 | 0.461538 | 1 | 0.051282 | false | 0 | 0.025641 | 0 | 0.076923 | 0.128205 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ef4e92fc86e8906b500c1a08fea35b40a5b6ca6e | 85 | py | Python | utils/__init__.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 5 | 2017-02-28T16:16:06.000Z | 2020-07-13T06:49:34.000Z | utils/__init__.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 1 | 2018-08-19T19:08:14.000Z | 2018-08-19T19:08:14.000Z | utils/__init__.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 4 | 2017-10-25T20:17:15.000Z | 2021-07-26T11:39:50.000Z | """__init__.py - various utility functions
Chris R. Coughlin (TRI/Austin, Inc.)
"""
| 17 | 42 | 0.694118 | 11 | 85 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141176 | 85 | 4 | 43 | 21.25 | 0.753425 | 0.905882 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
322f52a09af1b0d08c0ded63fce5a8eca4ddf88d | 270 | py | Python | examples/config.py | dhurley94/pritunl-api-python | ae1d24fccff2cf128fb54fd2449ff1378c587518 | [
"MIT"
] | 1 | 2021-09-22T10:04:22.000Z | 2021-09-22T10:04:22.000Z | examples/config.py | dhurley94/pritunl-api-python | ae1d24fccff2cf128fb54fd2449ff1378c587518 | [
"MIT"
] | null | null | null | examples/config.py | dhurley94/pritunl-api-python | ae1d24fccff2cf128fb54fd2449ff1378c587518 | [
"MIT"
] | null | null | null | from pritunl_api import *
import os
pritunl = Pritunl(url=os.getenv("PRITUNL_BASE_URL", "https://yoursite.com"),
token=os.getenv("PRITUNL_API_TOKEN", "<your api token>"),
secret=os.getenv("PRITUNL_API_SECRET", "<your api secret>"))
| 33.75 | 78 | 0.640741 | 35 | 270 | 4.742857 | 0.4 | 0.180723 | 0.271084 | 0.216867 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.207407 | 270 | 7 | 79 | 38.571429 | 0.775701 | 0 | 0 | 0 | 0 | 0 | 0.385185 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
3230502c01bb4ccede15e5922dc5a55238eb5eb6 | 140 | py | Python | helpers/decorators.py | oasisvali/Cowin-Notification-Service | 72d8851de469b529011b79c9672ddfb7f8f151bf | [
"MIT"
] | 14 | 2021-05-07T13:09:03.000Z | 2022-01-10T23:24:42.000Z | helpers/decorators.py | oasisvali/Cowin-Notification-Service | 72d8851de469b529011b79c9672ddfb7f8f151bf | [
"MIT"
] | 16 | 2021-05-10T16:41:21.000Z | 2021-06-09T14:49:03.000Z | helpers/decorators.py | oasisvali/Cowin-Notification-Service | 72d8851de469b529011b79c9672ddfb7f8f151bf | [
"MIT"
] | 5 | 2021-05-09T12:14:03.000Z | 2021-06-08T13:56:55.000Z | def validate_args(func, *args):
def inner(*args, **kwargs):
# Add validation here
func(*args, **kwargs)
return inner | 28 | 31 | 0.6 | 17 | 140 | 4.882353 | 0.588235 | 0.192771 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.264286 | 140 | 5 | 32 | 28 | 0.805825 | 0.135714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
324a375ed88a3e083a2d73a7d7ff6b725f46d92f | 4,000 | py | Python | tests/TestSaving.py | manuSrep/easyScriptingPy | 66fddb4b0bab8eb65b51c7cd0615ba2e68189dd2 | [
"BSD-2-Clause"
] | null | null | null | tests/TestSaving.py | manuSrep/easyScriptingPy | 66fddb4b0bab8eb65b51c7cd0615ba2e68189dd2 | [
"BSD-2-Clause"
] | null | null | null | tests/TestSaving.py | manuSrep/easyScriptingPy | 66fddb4b0bab8eb65b51c7cd0615ba2e68189dd2 | [
"BSD-2-Clause"
] | null | null | null |
import unittest
import sys
import os
import shutil
sys.path.append("../miscpy/")
from miscpy import prepareSaving, extractFromFilename
class TestExtractFromFilename(unittest.TestCase):
def test_filename_including_path_name_ext(self):
test_file = ["path/file.ext"]
expected_name = ["file"]
expected_path = ["path"]
expected_ext = ["ext"]
for f, file in enumerate(test_file):
fname, path, ext = extractFromFilename(file)
self.assertEqual(fname, expected_name[f])
self.assertEqual(path, expected_path[f])
self.assertEqual(ext, expected_ext[f])
def test_filename_including_extension(self):
test_file = ["file.ext"]
expected_name = ["file"]
expected_path = [""]
expected_ext = ["ext"]
for f, file in enumerate(test_file):
fname, path, ext = extractFromFilename(file)
self.assertEqual(fname, expected_name[f])
self.assertEqual(path, expected_path[f])
self.assertEqual(ext, expected_ext[f])
def test_filename_including_path_only(self):
test_file = ["path/"]
expected_name = [""]
expected_path = ["path"]
expected_ext = [""]
for f, file in enumerate(test_file):
fname, path, ext = extractFromFilename(file)
self.assertEqual(fname, expected_name[f])
self.assertEqual(path, expected_path[f])
self.assertEqual(ext, expected_ext[f])
class TestPrepareSaving(unittest.TestCase):
def setUp(self):
if not os.path.exists("delete_me"):
os.makedirs("delete_me/")
def test_filename_from_name_path_and_extension(self):
test_name = ["file"]
test_path = ["path", "path/path", "path//path"]
test_ext = ["ext", ".ext"]
for name in test_name:
for path in test_path:
for ext in test_ext:
control = os.path.abspath(os.path.join("delete_me", os.path.join(path, "{n}.ext".format(n=name))))
new = prepareSaving(name, os.path.join("delete_me", path), ext)
self.assertEqual(control, new)
self.assertTrue(os.path.exists(os.path.abspath(os.path.join("delete_me", path))))
def test_filename_from_name_including_path_and_extension(self):
test_name = ["path/file.ext"]
test_path = ["path", "path/path", "path//path"]
for name in test_name:
for path in test_path:
control = os.path.abspath(os.path.join("delete_me", os.path.join(path, "{n}".format(n=name))))
new = prepareSaving(name, os.path.join("delete_me", path))
self.assertEqual(control, new)
self.assertTrue(os.path.exists(os.path.abspath(os.path.join("delete_me", path+"/path/"))))
def test_filename_from_name_overwriting_extension(self):
test_name = ["file.foo"]
test_path = ["path", "path/path", "path//path"]
test_ext = ["ext", ".ext"]
for name in test_name:
for path in test_path:
for ext in test_ext:
control = os.path.abspath(os.path.join("delete_me", os.path.join(path, "file.ext")))
new = prepareSaving(name, os.path.join("delete_me", path), ext)
self.assertEqual(control, new)
self.assertTrue(os.path.exists(os.path.abspath(os.path.join("delete_me", path))))
def test_filename_including_path_only(self):
test_name = ["path/path/"]
for name in test_name:
control = os.path.abspath(os.path.join("delete_me",name)) + "/"
new = prepareSaving(os.path.join("delete_me", name))
self.assertEqual(control, new)
self.assertTrue(os.path.exists(os.path.abspath(os.path.join("delete_me", name))))
def doCleanups(self):
shutil.rmtree("delete_me/")
if __name__ == '__main__':
unittest.main() | 39.215686 | 118 | 0.6025 | 492 | 4,000 | 4.697154 | 0.105691 | 0.072696 | 0.064907 | 0.083081 | 0.812203 | 0.7672 | 0.718304 | 0.666811 | 0.64907 | 0.629165 | 0 | 0 | 0.26325 | 4,000 | 102 | 119 | 39.215686 | 0.784187 | 0 | 0 | 0.542169 | 0 | 0 | 0.0865 | 0 | 0 | 0 | 0 | 0 | 0.204819 | 1 | 0.108434 | false | 0 | 0.060241 | 0 | 0.192771 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 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 | 4 |
326759e701a251ba0e385aed4d4ed208ec38cf10 | 133 | py | Python | linprog_solver/simplex/exceptions.py | apirobot/django-linprog-solver-website | a90018c257b1d0a4c064baea1bb7c6e22bac1ab9 | [
"MIT"
] | 2 | 2017-04-22T11:25:00.000Z | 2020-04-05T20:22:41.000Z | linprog_solver/simplex/exceptions.py | apirobot/django-linprog-solver-website | a90018c257b1d0a4c064baea1bb7c6e22bac1ab9 | [
"MIT"
] | null | null | null | linprog_solver/simplex/exceptions.py | apirobot/django-linprog-solver-website | a90018c257b1d0a4c064baea1bb7c6e22bac1ab9 | [
"MIT"
] | null | null | null | class SimplexInitException(Exception):
"""
Error raised when a ``SimplexSolveForm`` can not be initialized.
"""
pass
| 22.166667 | 68 | 0.669173 | 13 | 133 | 6.846154 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225564 | 133 | 5 | 69 | 26.6 | 0.864078 | 0.481203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
326bd081192c10fc0ddb1821d78a545fe17e537d | 223 | py | Python | attendees/persons/serializers/registration_serializer.py | xjlin0/-attendees30 | 48a2f2cbec11ec471d7a40d24903b48890feebf9 | [
"MIT"
] | null | null | null | attendees/persons/serializers/registration_serializer.py | xjlin0/-attendees30 | 48a2f2cbec11ec471d7a40d24903b48890feebf9 | [
"MIT"
] | null | null | null | attendees/persons/serializers/registration_serializer.py | xjlin0/-attendees30 | 48a2f2cbec11ec471d7a40d24903b48890feebf9 | [
"MIT"
] | null | null | null | from attendees.persons.models import Registration
from rest_framework import serializers
class RegistrationSerializer(serializers.ModelSerializer):
class Meta:
model = Registration
fields = '__all__'
| 22.3 | 58 | 0.766816 | 21 | 223 | 7.904762 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183857 | 223 | 9 | 59 | 24.777778 | 0.912088 | 0 | 0 | 0 | 0 | 0 | 0.03139 | 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 | 1 | 0 | 0 | 4 |
32c728da267b9b16ceec95af6e5739382851d024 | 1,293 | py | Python | src/firs/trecdata/TrecCollection/TrecCollection.py | guglielmof/pyRe | 69a128678eddac8870ff9670411e8b5cdc0e7966 | [
"MIT"
] | null | null | null | src/firs/trecdata/TrecCollection/TrecCollection.py | guglielmof/pyRe | 69a128678eddac8870ff9670411e8b5cdc0e7966 | [
"MIT"
] | null | null | null | src/firs/trecdata/TrecCollection/TrecCollection.py | guglielmof/pyRe | 69a128678eddac8870ff9670411e8b5cdc0e7966 | [
"MIT"
] | null | null | null | import pandas as pd
from ... import configuration
from ...utils import Logger
class TrecCollection:
def __init__(self, **kwargs):
self.configs = configuration().get_config()
self.logger = Logger().logger
self.topics = None
# the name of the collection is one of the predefined; it can be imported directly
if 'collectionName' in kwargs and f"collections.{kwargs['collectionName']}" in self.configs.sections():
self._import_paths(kwargs['collectionName'])
self.collection_name = kwargs['collectionName']
def get_name(self):
return self.collection_name
def get_paths(self):
return self.cpaths
def __str__(self):
return f"collection: {self.collection_name}\n\t* topics: {len(self.qrel)}\n\t* runs: {len(self.runs)}"
from .import_collection import import_collection, _import_collection, _import_runs, _import_qrels, _import_runs_list
from .evaluate import evaluate, import_measures
from .parallel_evaluate import parallel_evaluate
from .misc import remove_shorter_runs
from .get_topics import get_topics, _import_topics
def _import_paths(self, collectionName):
self.cpaths = dict(self.configs.items(f'collections.{collectionName}'))
| 30.785714 | 120 | 0.699923 | 158 | 1,293 | 5.487342 | 0.360759 | 0.038062 | 0.062284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.206497 | 1,293 | 41 | 121 | 31.536585 | 0.845029 | 0.061872 | 0 | 0 | 0 | 0.041667 | 0.165289 | 0.094215 | 0 | 0 | 0 | 0 | 0 | 1 | 0.208333 | false | 0 | 0.416667 | 0.125 | 0.791667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
08a9d56427015e0094e7d057f2ff8e668898ffad | 42 | py | Python | DEV ARDUINO/__libraries/teensy4_i2c-master/examples/test_harness/raspberry_pi/wire/multiple_slave_addresses.py | clockdiv/MechanicalTheatre | 10964a9f25fbed7e4e85573867357e72a7166fb1 | [
"MIT"
] | 50 | 2019-11-25T19:46:04.000Z | 2022-03-26T03:34:51.000Z | DEV ARDUINO/__libraries/teensy4_i2c-master/examples/test_harness/raspberry_pi/wire/multiple_slave_addresses.py | clockdiv/MechanicalTheatre | 10964a9f25fbed7e4e85573867357e72a7166fb1 | [
"MIT"
] | 35 | 2020-12-31T19:59:45.000Z | 2021-09-10T16:40:52.000Z | DEV ARDUINO/__libraries/teensy4_i2c-master/examples/test_harness/raspberry_pi/wire/multiple_slave_addresses.py | clockdiv/MechanicalTheatre | 10964a9f25fbed7e4e85573867357e72a7166fb1 | [
"MIT"
] | 12 | 2020-01-13T19:06:19.000Z | 2022-02-23T12:50:51.000Z | Use ../raw/raw_multiple_slave_addresses.py | 42 | 42 | 0.857143 | 7 | 42 | 4.714286 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02381 | 42 | 1 | 42 | 42 | 0.804878 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
08ad922154aac5aebca8254dcf4ffe0d0a56dac6 | 590 | py | Python | tests/test_848.py | sungho-joo/leetcode2github | ce7730ef40f6051df23681dd3c0e1e657abba620 | [
"MIT"
] | null | null | null | tests/test_848.py | sungho-joo/leetcode2github | ce7730ef40f6051df23681dd3c0e1e657abba620 | [
"MIT"
] | null | null | null | tests/test_848.py | sungho-joo/leetcode2github | ce7730ef40f6051df23681dd3c0e1e657abba620 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import pytest
"""
Test 848. Shifting Letters
"""
@pytest.fixture(scope="session")
def init_variables_848():
from src.leetcode_848_shifting_letters import Solution
solution = Solution()
def _init_variables_848():
return solution
yield _init_variables_848
class TestClass848:
def test_solution_0(self, init_variables_848):
assert init_variables_848().shiftingLetters("abc", [3, 5, 9]) == "rpl"
def test_solution_1(self, init_variables_848):
assert init_variables_848().shiftingLetters("aaa", [1, 2, 3]) == "gfd"
| 21.071429 | 78 | 0.701695 | 76 | 590 | 5.144737 | 0.486842 | 0.232737 | 0.286445 | 0.097187 | 0.29156 | 0.29156 | 0.29156 | 0.29156 | 0.29156 | 0 | 0 | 0.078512 | 0.179661 | 590 | 27 | 79 | 21.851852 | 0.729339 | 0.033898 | 0 | 0 | 0 | 0 | 0.035514 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 1 | 0.307692 | false | 0 | 0.153846 | 0.076923 | 0.615385 | 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 | 1 | 0 | 0 | 4 |
08c98ef2ae881d53136576cf11ec30cde85d7dc2 | 52 | py | Python | lib/muck/__main__.py | likebike/muck | b48c8b0b64c9a23a1e23511613174c641042f6ea | [
"MIT"
] | null | null | null | lib/muck/__main__.py | likebike/muck | b48c8b0b64c9a23a1e23511613174c641042f6ea | [
"MIT"
] | null | null | null | lib/muck/__main__.py | likebike/muck | b48c8b0b64c9a23a1e23511613174c641042f6ea | [
"MIT"
] | null | null | null | import muck
if __name__ == '__main__': muck.main()
| 13 | 38 | 0.692308 | 7 | 52 | 4 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 52 | 3 | 39 | 17.333333 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
08da428500fe9792ec67b663b318b1a3524bcddd | 1,746 | py | Python | test/model/bii_type_test.py | Manu343726/biicode-common | 91b32c6fd1e4a72ce5451183f1766d313cd0e420 | [
"MIT"
] | 17 | 2015-04-15T09:40:23.000Z | 2017-05-17T20:34:49.000Z | test/model/bii_type_test.py | Manu343726/biicode-common | 91b32c6fd1e4a72ce5451183f1766d313cd0e420 | [
"MIT"
] | 2 | 2015-04-22T11:29:36.000Z | 2018-09-25T09:31:09.000Z | test/model/bii_type_test.py | bowlofstew/common | 45e9ca902be7bbbdd73dafe3ab8957bc4a006020 | [
"MIT"
] | 22 | 2015-04-15T09:46:00.000Z | 2020-09-29T17:03:31.000Z | import unittest
from biicode.common.model.bii_type import BiiType, CPP, TEXT, XML, HTML, IMAGE, PYTHON, UNKNOWN, \
SOUND
class BiiTypeTest(unittest.TestCase):
def test_bii_types_from_name(self):
self.assertEqual(CPP, BiiType.from_extension(".cpp"))
self.assertEqual(CPP, BiiType.from_extension(".c"))
self.assertEqual(CPP, BiiType.from_extension(".ino"))
self.assertEqual(CPP, BiiType.from_extension(".h"))
self.assertEqual(CPP, BiiType.from_extension(".hh"))
self.assertEqual(CPP, BiiType.from_extension(".cc"))
self.assertEqual(CPP, BiiType.from_extension(".inl"))
self.assertEqual(CPP, BiiType.from_extension(".ipp"))
self.assertEqual(TEXT, BiiType.from_extension(".txt"))
self.assertEqual(XML, BiiType.from_extension(".xml"))
self.assertEqual(HTML, BiiType.from_extension(".html"))
self.assertEqual(HTML, BiiType.from_extension(".htm"))
self.assertEqual(SOUND, BiiType.from_extension(".wav"))
self.assertEqual(IMAGE, BiiType.from_extension(".jpg"))
self.assertEqual(IMAGE, BiiType.from_extension(".gif"))
self.assertEqual(IMAGE, BiiType.from_extension(".png"))
self.assertEqual(IMAGE, BiiType.from_extension(".bmp"))
self.assertEqual(PYTHON, BiiType.from_extension(".py"))
self.assertEqual(TEXT, BiiType.from_extension(".bii"))
self.assertEqual(UNKNOWN, BiiType.from_extension(".unknow"))
def test_set_of_types(self):
self.assertFalse(BiiType.from_extension(".cpp").is_binary())
self.assertTrue(BiiType.from_extension(".wav").is_binary())
self.assertTrue(BiiType.from_extension(".cpp") == CPP)
if __name__ == "__main__":
unittest.main()
| 47.189189 | 98 | 0.690149 | 203 | 1,746 | 5.73399 | 0.251232 | 0.217354 | 0.395189 | 0.171821 | 0.604811 | 0.604811 | 0.072165 | 0 | 0 | 0 | 0 | 0 | 0.158076 | 1,746 | 36 | 99 | 48.5 | 0.791837 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 0 | 0 | 0 | 0 | 0 | 0.741935 | 1 | 0.064516 | false | 0 | 0.064516 | 0 | 0.16129 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
08e5c7cf85774a8ae5b87b7d8e09b124fc7f92dd | 490 | py | Python | amnesia/modules/file/validation/file.py | silenius/amnesia | ba5e3ac79a89da599c22206ad1fd17541855f74c | [
"BSD-2-Clause"
] | 4 | 2015-05-08T10:57:56.000Z | 2021-05-17T04:32:11.000Z | amnesia/modules/file/validation/file.py | silenius/amnesia | ba5e3ac79a89da599c22206ad1fd17541855f74c | [
"BSD-2-Clause"
] | 6 | 2019-12-26T16:43:41.000Z | 2022-02-28T11:07:54.000Z | amnesia/modules/file/validation/file.py | silenius/amnesia | ba5e3ac79a89da599c22206ad1fd17541855f74c | [
"BSD-2-Clause"
] | 1 | 2019-09-23T14:08:11.000Z | 2019-09-23T14:08:11.000Z | # -*- coding: utf-8 -*-
from marshmallow.fields import String
from marshmallow.fields import Integer
from marshmallow.fields import Raw
from marshmallow.fields import Float
from amnesia.modules.content.validation import ContentSchema
class FileSchema(ContentSchema):
''' Schema for the File model '''
content_id = Integer()
mime_id = Integer(dump_only=True)
original_name = String(dump_only=True)
file_size = Float(dump_only=True)
content = Raw(load_only=True)
| 25.789474 | 60 | 0.75102 | 64 | 490 | 5.625 | 0.5 | 0.166667 | 0.233333 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002427 | 0.159184 | 490 | 18 | 61 | 27.222222 | 0.871359 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.454545 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
3ecc1e9cfa0e9f0d53b65b9067ce6c2b6d34664b | 232 | py | Python | main.py | sungkuk5420/python-web-scraper | ac0647a4ea759dbb9280dd76c12cb63b6a18d38f | [
"MIT"
] | null | null | null | main.py | sungkuk5420/python-web-scraper | ac0647a4ea759dbb9280dd76c12cb63b6a18d38f | [
"MIT"
] | null | null | null | main.py | sungkuk5420/python-web-scraper | ac0647a4ea759dbb9280dd76c12cb63b6a18d38f | [
"MIT"
] | null | null | null | from indeed import extract_indeed_pages, extract_indeed_jobs
from save import save_to_file
# jobs = []
# save_to_file(jobs)
max_indeed_pages = extract_indeed_pages()
jobs = extract_indeed_jobs(max_indeed_pages)
save_to_file(jobs)
| 23.2 | 60 | 0.827586 | 37 | 232 | 4.702703 | 0.27027 | 0.298851 | 0.172414 | 0.241379 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103448 | 232 | 9 | 61 | 25.777778 | 0.836538 | 0.12069 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
41081c0bbe0f47b636227bee0b90af344ee3f901 | 318 | py | Python | p2c_backend/exercise/serializers.py | nvbr-m/p2c | 902351a4604c964731ce93e674b7057f83bb85d7 | [
"MIT"
] | 2 | 2021-08-24T21:14:51.000Z | 2021-09-17T06:45:22.000Z | p2c_backend/exercise/serializers.py | nvbr-m/p2c | 902351a4604c964731ce93e674b7057f83bb85d7 | [
"MIT"
] | null | null | null | p2c_backend/exercise/serializers.py | nvbr-m/p2c | 902351a4604c964731ce93e674b7057f83bb85d7 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from exercise.models import Task
class TaskSerializer(serializers.ModelSerializer):
class Meta:
model = Task
fields = ["id", "title"]
class TaskDetailSerializer(serializers.ModelSerializer):
class Meta:
model = Task
fields = "__all__"
| 21.2 | 56 | 0.694969 | 31 | 318 | 6.967742 | 0.580645 | 0.240741 | 0.287037 | 0.324074 | 0.462963 | 0.462963 | 0.462963 | 0 | 0 | 0 | 0 | 0 | 0.22956 | 318 | 14 | 57 | 22.714286 | 0.881633 | 0 | 0 | 0.4 | 0 | 0 | 0.044025 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.6 | 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 | 1 | 0 | 0 | 4 |
f5ae94d9f84c33c3e9e0b12e9bb1432136136418 | 736 | py | Python | fpc_api/serializers.py | samwel2000/FiddyPolyClinic-backend | 0be68076bebfa0d4eeb5dd5868de968d98bea4f4 | [
"MIT"
] | 1 | 2021-08-18T14:56:18.000Z | 2021-08-18T14:56:18.000Z | fpc_api/serializers.py | samwel2000/FiddyPolyClinic-backend | 0be68076bebfa0d4eeb5dd5868de968d98bea4f4 | [
"MIT"
] | null | null | null | fpc_api/serializers.py | samwel2000/FiddyPolyClinic-backend | 0be68076bebfa0d4eeb5dd5868de968d98bea4f4 | [
"MIT"
] | null | null | null | from django.db.models import fields
from rest_framework import serializers
from .models import *
class NewsSerializer(serializers.ModelSerializer):
class Meta:
model = News
fields = '__all__'
class JobsSerializer(serializers.ModelSerializer):
class Meta:
model = Jobs
fields = '__all__'
class TeamMembersSerializer(serializers.ModelSerializer):
class Meta:
model = TeamMembers
fields = '__all__'
class ContactUsSerializer(serializers.ModelSerializer):
class Meta:
model = ContactUs
exclude = ['created_date']
class SubscribersSerializer(serializers.ModelSerializer):
class Meta:
model = Subscribers
exclude = ['created_date']
| 21.647059 | 57 | 0.694293 | 66 | 736 | 7.515152 | 0.409091 | 0.262097 | 0.3125 | 0.352823 | 0.403226 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.233696 | 736 | 33 | 58 | 22.30303 | 0.879433 | 0 | 0 | 0.434783 | 0 | 0 | 0.061141 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.130435 | 0 | 0.565217 | 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 | 1 | 0 | 0 | 4 |
f5f4c4cf1713c9e2679321c5c0dc48037f043968 | 312 | py | Python | pytorch_pretrained_biggan/__init__.py | RicardoYangxx/pytorch-pretrained-BigGAN | 51994885efb7c236c279cc7a812dbe6672b6a956 | [
"MIT"
] | null | null | null | pytorch_pretrained_biggan/__init__.py | RicardoYangxx/pytorch-pretrained-BigGAN | 51994885efb7c236c279cc7a812dbe6672b6a956 | [
"MIT"
] | null | null | null | pytorch_pretrained_biggan/__init__.py | RicardoYangxx/pytorch-pretrained-BigGAN | 51994885efb7c236c279cc7a812dbe6672b6a956 | [
"MIT"
] | null | null | null | from .config import BigGANConfig
from .model import BigGAN
from .file_utils import PYTORCH_PRETRAINED_BIGGAN_CACHE, cached_path
from .utils import (truncated_noise_sample, save_as_images,
convert_to_images, display_in_terminal,
one_hot_from_int, one_hot_from_names)
| 44.571429 | 69 | 0.74359 | 41 | 312 | 5.195122 | 0.682927 | 0.103286 | 0.093897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.217949 | 312 | 6 | 70 | 52 | 0.872951 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
f5fe7a8d40155a20b309b5d551ad57add5f334ff | 238 | py | Python | auth0/v2/authentication/__init__.py | maronnax/auth0-python | 855e275da1f9fddc851f34df4a6b304eed8abb96 | [
"MIT"
] | null | null | null | auth0/v2/authentication/__init__.py | maronnax/auth0-python | 855e275da1f9fddc851f34df4a6b304eed8abb96 | [
"MIT"
] | null | null | null | auth0/v2/authentication/__init__.py | maronnax/auth0-python | 855e275da1f9fddc851f34df4a6b304eed8abb96 | [
"MIT"
] | null | null | null | from .database import Database
from .delegated import Delegated
from .enterprise import Enterprise
from .link import Link
from .passwordless import Passwordless
from .social import Social
from .users import Users
from .oauth import Oauth
| 26.444444 | 38 | 0.831933 | 32 | 238 | 6.1875 | 0.3125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134454 | 238 | 8 | 39 | 29.75 | 0.961165 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.125 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 4 |
eb0145778d78b929d4ccc448aa784f37714106ab | 1,996 | py | Python | tests/utils.py | sys-git/certifiable | a3c33c0d4f3ac2c53be9eded3fae633fa5f697f8 | [
"MIT"
] | null | null | null | tests/utils.py | sys-git/certifiable | a3c33c0d4f3ac2c53be9eded3fae633fa5f697f8 | [
"MIT"
] | 311 | 2017-09-14T22:34:21.000Z | 2022-03-27T18:30:17.000Z | tests/utils.py | sys-git/certifiable | a3c33c0d4f3ac2c53be9eded3fae633fa5f697f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: latin-1 -*-
#
from collections import Iterable, Mapping, MutableMapping, MutableSequence, MutableSet, Sequence, \
Set
class aIterable(Iterable):
def __init__(self, i=None):
self.iter = i or []
def __iter__(self):
for i in self.iter:
yield i
class aSet(Set):
def __init__(self, i=None):
self.iter = i or []
def __contains__(self):
pass
def __iter__(self):
return iter([])
def __len__(self):
return len(self.iter)
class mSet(MutableSet):
def __init__(self, i=None):
self.iter = i or []
def add(self, value):
pass
def discard(self, value):
pass
def __contains__(self):
pass
def __iter__(self):
return iter([])
def __len__(self):
return len(self.iter)
class aSequence(Sequence):
def __init__(self, i=None):
self.iter = i or []
def __iter__(self):
for i in self.iter:
yield i
def __getitem__(self, index):
pass
def __contains__(self, x):
pass
def __len__(self):
pass
class mSequence(MutableSequence):
def __init__(self, i=None):
self.iter = i or []
def __iter__(self):
for i in self.iter:
yield i
def __getitem__(self, index):
pass
def __contains__(self, x):
pass
def __len__(self):
pass
def __delitem__(self):
pass
def __setitem__(self):
pass
def insert(self):
pass
class aMapping(Mapping):
def __getitem__(self, index):
pass
def __iter__(self):
return iter([])
def __len__(self):
pass
class mMapping(MutableMapping):
def __getitem__(self, index):
pass
def __iter__(self):
return iter([])
def __len__(self):
pass
def __delitem__(self, item):
pass
def __setitem__(self, item, value):
pass
| 16.360656 | 99 | 0.561122 | 234 | 1,996 | 4.273504 | 0.209402 | 0.105 | 0.077 | 0.06 | 0.643 | 0.633 | 0.633 | 0.605 | 0.605 | 0.605 | 0 | 0.000751 | 0.333166 | 1,996 | 121 | 100 | 16.495868 | 0.750563 | 0.022044 | 0 | 0.794872 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.423077 | false | 0.24359 | 0.012821 | 0.076923 | 0.602564 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
eb3f12f7ff2554b586198fbf551a7ed12153cf5f | 1,005 | py | Python | insights/parsers/netconsole.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 1 | 2020-02-19T06:36:22.000Z | 2020-02-19T06:36:22.000Z | insights/parsers/netconsole.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | null | null | null | insights/parsers/netconsole.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | null | null | null | '''
NetConsole - file ``/etc/sysconfig/netconsole``
===============================================
This parser reads the ``/etc/sysconfig/netconsole`` file. It uses the
``SysconfigOptions`` parser class to convert the file into a dictionary of
options.
Sample data::
# This is the configuration file for the netconsole service. By starting
# this service you allow a remote syslog daemon to record console output
# from this system.
# The local port number that the netconsole module will use
LOCALPORT=6666
Examples:
>>> config = shared[NetConsole]
>>> 'LOCALPORT' in config.data
True
>>> 'DEV' in config # Direct access to options
False
'''
from .. import parser, SysconfigOptions, LegacyItemAccess
from insights.specs import Specs
@parser(Specs.netconsole)
class NetConsole(SysconfigOptions, LegacyItemAccess):
'''
Contents of the ``/etc/sysconfig/netconsole`` file. Uses the
``SysconfigOptions`` shared parser class.
'''
pass
| 25.125 | 77 | 0.674627 | 116 | 1,005 | 5.844828 | 0.525862 | 0.061947 | 0.097345 | 0.073746 | 0.085546 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004926 | 0.19204 | 1,005 | 39 | 78 | 25.769231 | 0.830049 | 0.78408 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.2 | 0.4 | 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 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 4 |
de372c3f37f9f9823a6c076a318703d50ef500b3 | 161 | py | Python | src/Helpers/CheckingValueHelpers/CheckingValueHelper.py | hirohio/Hello-World-ML | 398b7b9f492d563226e9ba0374bb2844ad0dbf18 | [
"MIT"
] | null | null | null | src/Helpers/CheckingValueHelpers/CheckingValueHelper.py | hirohio/Hello-World-ML | 398b7b9f492d563226e9ba0374bb2844ad0dbf18 | [
"MIT"
] | null | null | null | src/Helpers/CheckingValueHelpers/CheckingValueHelper.py | hirohio/Hello-World-ML | 398b7b9f492d563226e9ba0374bb2844ad0dbf18 | [
"MIT"
] | null | null | null |
#class ValueChecker:
# @classmethod
# def is_num(val):
# if val.isdigit() == True:
# return True
# else:
# return False
| 17.888889 | 34 | 0.503106 | 16 | 161 | 5 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.378882 | 161 | 8 | 35 | 20.125 | 0.8 | 0.906832 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
de5baa85239dcae789979f3c8769165cc7a8c4aa | 222 | py | Python | klab/git.py | Kortemme-Lab/klab | 68f028a4d7f97b9009bff45799b5602824052dd1 | [
"MIT"
] | 2 | 2016-06-14T00:32:19.000Z | 2021-07-04T01:56:17.000Z | klab/git.py | Kortemme-Lab/klab | 68f028a4d7f97b9009bff45799b5602824052dd1 | [
"MIT"
] | 2 | 2019-01-17T18:52:17.000Z | 2019-01-17T18:52:56.000Z | klab/git.py | Kortemme-Lab/klab | 68f028a4d7f97b9009bff45799b5602824052dd1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
def get_git_root():
import shlex
from . import process
command = shlex.split('git rev-parse --show-toplevel')
directory = process.check_output(command)
return directory.strip()
| 22.2 | 58 | 0.693694 | 29 | 222 | 5.206897 | 0.793103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005556 | 0.189189 | 222 | 9 | 59 | 24.666667 | 0.833333 | 0.094595 | 0 | 0 | 0 | 0 | 0.145729 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | 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 | 1 | 0 | 0 | 4 |
de630c2aad5fb84fd3c889e5a0e586ce3cd62c81 | 87 | py | Python | david/scorer/apps.py | rising-entropy/Model-o-Department | 42147e02209709ffd6450b04189890e9c57236aa | [
"MIT"
] | null | null | null | david/scorer/apps.py | rising-entropy/Model-o-Department | 42147e02209709ffd6450b04189890e9c57236aa | [
"MIT"
] | null | null | null | david/scorer/apps.py | rising-entropy/Model-o-Department | 42147e02209709ffd6450b04189890e9c57236aa | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ScorerConfig(AppConfig):
name = 'scorer'
| 14.5 | 33 | 0.747126 | 10 | 87 | 6.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172414 | 87 | 5 | 34 | 17.4 | 0.902778 | 0 | 0 | 0 | 0 | 0 | 0.068966 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
de6dd2505b20dc3982c3741cd0a5d91865739371 | 81 | py | Python | zeus/god/apps.py | nightwarrior-xxx/Zeus | 429fe0dcbdbcc4024d2d58a6d897108df1bbfffd | [
"MIT"
] | null | null | null | zeus/god/apps.py | nightwarrior-xxx/Zeus | 429fe0dcbdbcc4024d2d58a6d897108df1bbfffd | [
"MIT"
] | 4 | 2020-06-06T00:42:50.000Z | 2022-02-10T08:51:36.000Z | zeus/god/apps.py | nightwarrior-xxx/Zeus | 429fe0dcbdbcc4024d2d58a6d897108df1bbfffd | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class GodConfig(AppConfig):
name = 'god'
| 13.5 | 33 | 0.728395 | 10 | 81 | 5.9 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.185185 | 81 | 5 | 34 | 16.2 | 0.893939 | 0 | 0 | 0 | 0 | 0 | 0.037037 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
de8f74c81d0dd2f908c6f3bafa7584972d70ab6c | 239 | py | Python | build/utils/common.py | arm61/fitbenchmarking | c745c684e3ca4895a666eb863426746d8f06636c | [
"BSD-3-Clause"
] | null | null | null | build/utils/common.py | arm61/fitbenchmarking | c745c684e3ca4895a666eb863426746d8f06636c | [
"BSD-3-Clause"
] | null | null | null | build/utils/common.py | arm61/fitbenchmarking | c745c684e3ca4895a666eb863426746d8f06636c | [
"BSD-3-Clause"
] | null | null | null | """
Script to hold common varibales used in building the project
"""
import os
from build.utils.build_logger import BuildLogger
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
BUILD_LOGGER = BuildLogger(ROOT_DIR)
| 23.9 | 71 | 0.790795 | 36 | 239 | 5.027778 | 0.638889 | 0.099448 | 0.198895 | 0.165746 | 0.176796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108787 | 239 | 9 | 72 | 26.555556 | 0.849765 | 0.251046 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
de9fe70cb30f02ec07532adafd3ce14bca4068f3 | 17,337 | py | Python | ztlearn/objectives.py | jefkine/zeta-learn | 04388f90093b52f5df2f334c898f3a1224f5a13f | [
"MIT"
] | 30 | 2018-03-12T19:16:27.000Z | 2021-12-16T05:32:38.000Z | ztlearn/objectives.py | jefkine/zeta-learn | 04388f90093b52f5df2f334c898f3a1224f5a13f | [
"MIT"
] | 4 | 2018-06-13T03:47:15.000Z | 2018-11-05T21:33:34.000Z | ztlearn/objectives.py | jefkine/zeta-learn | 04388f90093b52f5df2f334c898f3a1224f5a13f | [
"MIT"
] | 4 | 2018-04-30T07:42:47.000Z | 2022-01-31T11:35:53.000Z | # -*- coding: utf-8 -*-
import math as mt
import numpy as np
class Objective(object):
def clip(self, predictions, epsilon = 1e-15):
clipped_predictions = np.clip(predictions, epsilon, 1 - epsilon)
clipped_divisor = np.maximum(np.multiply(predictions, 1 - predictions), epsilon)
return clipped_predictions, clipped_divisor
def error(self, predictions, targets):
error = targets - predictions
abs_error = np.absolute(error)
return error, abs_error
def add_fuzz_factor(self, np_array, epsilon = 1e-05):
return np.add(np_array, epsilon)
@property
def objective_name(self):
return self.__class__.__name__
class MeanSquaredError:
"""
**Mean Squared error (MSE)**
MSE measures the average squared difference between the predictions and the
targets. The closer the predictions are to the targets the more efficient
the estimator.
References:
[1] Mean Squared error
* [Wikipedia Article] https://en.wikipedia.org/wiki/Mean_squared_error
"""
def loss(self, predictions, targets, np_type):
"""
Applies the MeanSquaredError Loss to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of MeanSquaredError Loss to prediction and targets
"""
return 0.5 * np.mean(np.sum(np.square(predictions - targets), axis = 1))
def derivative(self, predictions, targets, np_type):
"""
Applies the MeanSquaredError Derivative to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of MeanSquaredError Derivative to prediction and targets
"""
return predictions - targets
def accuracy(self, predictions, targets, threshold = 0.5):
return 0
@property
def objective_name(self):
return self.__class__.__name__
class HellingerDistance:
"""
**Hellinger Distance**
Hellinger Distance is used to quantify the similarity between two probability
distributions.
References:
[1] Hellinger Distance
* [Wikipedia Article] https://en.wikipedia.org/wiki/Hellinger_distance
"""
SQRT_2 = np.sqrt(2)
def sqrt_difference(self, predictions, targets):
return np.sqrt(predictions) - np.sqrt(targets)
def loss(self, predictions, targets, np_type):
"""
Applies the HellingerDistance Loss to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of HellingerDistance Loss to prediction and targets
"""
root_difference = self.sqrt_difference(predictions, targets)
return np.mean(np.true_divide(np.sum(np.square(root_difference), axis = 1), HellingerDistance.SQRT_2))
def derivative(self, predictions, targets, np_type):
"""
Applies the HellingerDistance Derivative to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of HellingerDistance Derivative to prediction and targets
"""
root_difference = self.sqrt_difference(predictions, targets)
return np.true_divide(root_difference, np.multiply(HellingerDistance.SQRT_2, np.sqrt(predictions)))
def accuracy(self, predictions, targets, threshold = 0.5):
return 0
@property
def objective_name(self):
return self.__class__.__name__
class HingeLoss:
"""
**Hinge Loss**
Hinge Loss also known as SVM Loss is used "maximum-margin" classification,
most notably for support vector machines (SVMs)
References:
[1] Hinge loss
* [Wikipedia Article] https://en.wikipedia.org/wiki/Hinge_loss
"""
def loss(self, predictions, targets, np_type):
"""
Applies the Hinge-Loss to Loss prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of Hinge-Loss Loss to prediction and targets
"""
correct_class = predictions[np.arange(predictions.shape[0]), np.argmax(targets, axis = 1)]
margins = np.maximum(0, predictions - correct_class[:, np.newaxis] + 1.0) # delta = 1.0
margins[np.arange(predictions.shape[0]), np.argmax(targets, axis = 1)] = 0
return np.mean(np.sum(margins, axis = 0))
def derivative(self, predictions, targets, np_type):
"""
Applies the Hinge-Loss Derivative to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of Hinge-Loss Derivative to prediction and targets
"""
correct_class = predictions[np.arange(predictions.shape[0]), np.argmax(targets, axis = 1)]
binary = np.maximum(0, predictions - correct_class[:, np.newaxis] + 1.0) # delta = 1.0
binary[binary > 0] = 1
incorrect_class = np.sum(binary, axis = 1)
binary[np.arange(predictions.shape[0]), np.argmax(targets, axis = 1)] = -incorrect_class
return binary
def accuracy(self, predictions, targets, threshold = 0.5):
"""
Calculates the Hinge-Loss Accuracy Score given prediction and targets
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.float32: the output of Hinge-Loss Accuracy Score
"""
return np.mean(np.argmax(predictions, axis = 1) == np.argmax(targets, axis = 1))
@property
def objective_name(self):
return self.__class__.__name__
class BinaryCrossEntropy(Objective):
"""
**Binary Cross Entropy**
Binary CrossEntropy measures the performance of a classification model whose
output is a probability value between 0 & 1. 'Binary' is meant for discrete
classification tasks in which the classes are independent and not mutually
exclusive. Targets here could be either 0 or 1 scalar
References:
[1] Cross Entropy
* [Wikipedia Article] https://en.wikipedia.org/wiki/Cross_entropy
"""
def loss(self, predictions, targets, np_type):
"""
Applies the BinaryCrossEntropy Loss to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of BinaryCrossEntropy Loss to prediction and targets
"""
clipped_predictions, _ = super(BinaryCrossEntropy, self).clip(predictions)
return np.mean(
-np.sum(
(
np.multiply(targets, np.log(clipped_predictions)),
np.multiply((1 - targets), np.log(1 - clipped_predictions))
), axis = 1
)
)
def derivative(self, predictions, targets, np_type):
"""
Applies the BinaryCrossEntropy Derivative to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of BinaryCrossEntropy Derivative to prediction and targets
"""
clipped_predictions, clipped_divisor = super(BinaryCrossEntropy, self).clip(predictions)
return np.true_divide((clipped_predictions - targets), clipped_divisor)
def accuracy(self, predictions, targets, threshold = 0.5):
"""
Calculates the BinaryCrossEntropy Accuracy Score given prediction and targets
Args:
predictions (numpy.array) : the predictions numpy array
targets (numpy.array) : the targets numpy array
threshold (numpy.float32): the threshold value
Returns:
numpy.float32: the output of BinaryCrossEntropy Accuracy Score
"""
return 1 - np.true_divide(np.count_nonzero((predictions > threshold) == targets), float(targets.size))
@property
def objective_name(self):
return self.__class__.__name__
class CategoricalCrossEntropy(Objective):
"""
**Categorical Cross Entropy**
Categorical Cross Entropy measures the performance of a classification model
whose output is a probability value between 0 and 1. 'Categorical' is
meant for discrete classification tasks in which the classes are mutually
exclusive.
References:
[1] Cross Entropy
* [Wikipedia Article] https://en.wikipedia.org/wiki/Cross_entropy
"""
def loss(self, predictions, targets, np_type):
"""
Applies the CategoricalCrossEntropy Loss to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of CategoricalCrossEntropy Loss to prediction and targets
"""
clipped_predictions, _ = super(CategoricalCrossEntropy, self).clip(predictions)
return np.mean(-np.sum(np.multiply(targets, np.log(clipped_predictions)), axis = 1))
def derivative(self, predictions, targets, np_type):
"""
Applies the CategoricalCrossEntropy Derivative to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of CategoricalCrossEntropy Derivative to prediction and targets
"""
clipped_predictions, _ = super(CategoricalCrossEntropy, self).clip(predictions)
return clipped_predictions - targets
def accuracy(self, predictions, targets):
"""
Calculates the CategoricalCrossEntropy Accuracy Score given prediction and targets
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.float32: the output of CategoricalCrossEntropy Accuracy Score
"""
return np.mean(np.argmax(predictions, axis = 1) == np.argmax(targets, axis = 1))
@property
def objective_name(self):
return self.__class__.__name__
class KLDivergence(Objective):
"""
**KL Divergence**
Kullback–Leibler divergence (also called relative entropy) is a measure of
divergence between two probability distributions.
"""
def loss(self, predictions, targets, np_type):
"""
Applies the KLDivergence Loss to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of KLDivergence Loss to prediction and targets
"""
targets = super(KLDivergence, self).add_fuzz_factor(targets)
predictions = super(KLDivergence, self).add_fuzz_factor(predictions)
return np.sum(np.multiply(targets, np.log(np.true_divide(targets, predictions))), axis = 1)
def derivative(self, predictions, targets, np_type):
"""
Applies the KLDivergence Derivative to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of KLDivergence Derivative to prediction and targets
"""
targets = super(KLDivergence, self).add_fuzz_factor(targets)
predictions = super(KLDivergence, self).add_fuzz_factor(predictions)
d_log_diff = np.multiply((predictions - targets), (np.log(np.true_divide(targets, predictions))))
return np.multiply((1 + np.log(np.true_divide(targets, predictions))), d_log_diff)
def accuracy(self, predictions, targets):
"""
Calculates the KLDivergence Accuracy Score given prediction and targets
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.float32: the output of KLDivergence Accuracy Score
"""
return np.mean(np.argmax(predictions, axis = 1) == np.argmax(targets, axis = 1))
@property
def objective_name(self):
return self.__class__.__name__
class HuberLoss(Objective):
"""
**Huber Loss**
Huber Loss: is a loss function used in robust regression where it is found
to be less sensitive to outliers in data than the squared error loss.
References:
[1] Huber Loss
* [Wikipedia Article] https://en.wikipedia.org/wiki/Huber_loss
[2] Huber loss
* [Wikivisually Article] https://wikivisually.com/wiki/Huber_loss
"""
def loss(self, predictions, targets, np_type, delta = 1.):
"""
Applies the HuberLoss Loss to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of KLDivergence Loss to prediction and targets
"""
error, abs_error = super(HuberLoss, self).error(predictions, targets)
return np.sum(np.where(abs_error < delta,
0.5 * (np.square(error)),
delta * abs_error - 0.5 * (mt.pow(delta, 2))))
def derivative(self, predictions, targets, np_type, delta = 1.):
"""
Applies the HuberLoss Derivative to prediction and targets provided
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.array: the output of KLDivergence Derivative to prediction and targets
"""
error, abs_error = super(HuberLoss, self).error(predictions, targets)
return np.sum(np.where(abs_error > delta, delta * np.sign(error), error))
def accuracy(self, predictions, targets):
"""
Calculates the HuberLoss Accuracy Score given prediction and targets
Args:
predictions (numpy.array): the predictions numpy array
targets (numpy.array): the targets numpy array
Returns:
numpy.float32: the output of KLDivergence Accuracy Score
"""
return np.mean(predictions - targets)
@property
def objective_name(self):
return self.__class__.__name__
class ObjectiveFunction:
_functions = {
'svm' : HingeLoss,
'hinge' : HingeLoss,
'hinge_loss' : HingeLoss,
'huber' : HuberLoss,
'huber_loss' : HuberLoss,
'kld' : KLDivergence,
'kullback_leibler_divergence' : KLDivergence,
'mse' : MeanSquaredError,
'mean_squared_error' : MeanSquaredError,
'hld' : HellingerDistance,
'hellinger_distance' : HellingerDistance,
'bce' : BinaryCrossEntropy,
'binary_crossentropy' : BinaryCrossEntropy,
'cce' : CategoricalCrossEntropy,
'categorical_crossentropy' : CategoricalCrossEntropy
}
def __init__(self, name):
if name not in self._functions.keys():
raise Exception('Objective function must be either one of the following: {}.'.format(', '.join(self._functions.keys())))
self.objective_func = self._functions[name]()
@property
def name(self):
return self.objective_func.objective_name
def forward(self, predictions, targets, np_type = np.float32):
return self.objective_func.loss(predictions, targets, np_type)
def backward(self, predictions, targets, np_type = np.float32):
return self.objective_func.derivative(predictions, targets, np_type)
def accuracy(self, predictions, targets):
return self.objective_func.accuracy(predictions, targets)
| 31.987085 | 132 | 0.629982 | 1,866 | 17,337 | 5.754019 | 0.106109 | 0.083822 | 0.06296 | 0.055323 | 0.71519 | 0.702245 | 0.692745 | 0.651765 | 0.613207 | 0.585266 | 0 | 0.008032 | 0.289035 | 17,337 | 541 | 133 | 32.046211 | 0.862973 | 0.434447 | 0 | 0.413333 | 0 | 0 | 0.025798 | 0.00612 | 0 | 0 | 0 | 0 | 0 | 1 | 0.253333 | false | 0 | 0.013333 | 0.106667 | 0.586667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 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 | 4 |
720b99e812e5823ff1bc46d04176a6e1f6d8b396 | 86 | py | Python | backend/wsgi.py | arontaupe/KommunikationsKrake | 145bf9a2b4b3d70635987d18a6a0d4d8438bfb96 | [
"MIT"
] | null | null | null | backend/wsgi.py | arontaupe/KommunikationsKrake | 145bf9a2b4b3d70635987d18a6a0d4d8438bfb96 | [
"MIT"
] | null | null | null | backend/wsgi.py | arontaupe/KommunikationsKrake | 145bf9a2b4b3d70635987d18a6a0d4d8438bfb96 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from webhook import app
if __name__ == "__main__":
app.run()
| 12.285714 | 26 | 0.662791 | 12 | 86 | 4.083333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014286 | 0.186047 | 86 | 6 | 27 | 14.333333 | 0.685714 | 0.197674 | 0 | 0 | 0 | 0 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
7211bf547dca684ec853c854a775abf83f0de871 | 171 | py | Python | tests/conftest.py | ahmedhindi/datapipe | 96bd764814b285d2744d7577f24fa9f5db5a9b25 | [
"MIT"
] | 1 | 2021-04-26T14:32:13.000Z | 2021-04-26T14:32:13.000Z | tests/conftest.py | ahmedhindi/dukto | 96bd764814b285d2744d7577f24fa9f5db5a9b25 | [
"MIT"
] | null | null | null | tests/conftest.py | ahmedhindi/dukto | 96bd764814b285d2744d7577f24fa9f5db5a9b25 | [
"MIT"
] | null | null | null | import pandas as pd
import pytest
@pytest.fixture(scope="module")
def simple_data():
rng = list(range(1, 10))
return pd.DataFrame({"first": rng, "second": rng})
| 19 | 54 | 0.672515 | 25 | 171 | 4.56 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020979 | 0.163743 | 171 | 8 | 55 | 21.375 | 0.776224 | 0 | 0 | 0 | 0 | 0 | 0.099415 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | 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 | 1 | 0 | 0 | 4 |
724305ac15706d7be6682c2c3eb6fa7d502e4695 | 172 | py | Python | app/authentication.py | CrowdClick/CrowdLink | beb4b7822b787d53b104138d4b2612cf3a6713d1 | [
"BSD-3-Clause"
] | 2 | 2021-12-16T19:43:57.000Z | 2021-12-18T08:15:39.000Z | app/authentication.py | CrowdClick/CrowdLink | beb4b7822b787d53b104138d4b2612cf3a6713d1 | [
"BSD-3-Clause"
] | 5 | 2020-06-25T20:44:25.000Z | 2021-09-22T19:01:54.000Z | app/authentication.py | CrowdClick/CrowdLink | beb4b7822b787d53b104138d4b2612cf3a6713d1 | [
"BSD-3-Clause"
] | null | null | null | from rest_framework.authentication import SessionAuthentication
class CustomSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, *args):
pass
| 24.571429 | 63 | 0.80814 | 15 | 172 | 9.133333 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139535 | 172 | 6 | 64 | 28.666667 | 0.925676 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
a0d2b3b8622367e6ebfa52e5e99ad5368a7ed924 | 2,720 | py | Python | eos_pure.py | pysg/pyther | 6a47fc41533cc50bc64134e42ddd3ed8d54d75c7 | [
"MIT"
] | 9 | 2017-07-10T19:21:35.000Z | 2022-01-24T16:41:34.000Z | eos_pure.py | NERD-cpu/pyther | 6a47fc41533cc50bc64134e42ddd3ed8d54d75c7 | [
"MIT"
] | 1 | 2017-05-28T01:45:00.000Z | 2018-01-08T14:54:31.000Z | eos_pure.py | NERD-cpu/pyther | 6a47fc41533cc50bc64134e42ddd3ed8d54d75c7 | [
"MIT"
] | 3 | 2017-08-18T18:47:21.000Z | 2021-03-01T02:25:24.000Z | import numpy as np
def func_zc_d1(del1):
d1 = (1 + del1 ** 2) / (1 + del1)
y = 1 + (2 * (1 + del1)) ** (1.0 / 3) + (4 / (1 + del1)) ** (1.0 / 3)
Zc = y / (3 * y + d1 - 1.0)
return Zc
def get_del_1(Zcin, del1):
# del1 = del_1_init
# d1 = (1 + del1 ** 2) / (1 + del1)
# y = 1 + (2 * (1 + del1)) ** (1.0 / 3) + (4 / (1 + del1)) ** (1.0 / 3)
# Zc = y / (3 * y + d1 - 1.0)
# dold = del_1_init
# Zc = func_zc_d1(del_1_init)
# if Zc > Zcin:
# del1 = 1.01 * del1
# else:
# del1 = 0.99 * del1
# error_Z_critico = abs(Zc - Zcin)
while True:
Zc = func_zc_d1(del1)
aux = del1
del1 = del1 - (Zc - Zcin) * (del1 - dold) / (Zc - Zold)
dold = aux
error_Z_critico = abs(Zc - Zcin)
if error_Z_critico <= 1e-6:
break
while True:
d1 = (1 + del1 ** 2) / (1 + del1)
y = 1 + (2 * (1 + del1)) ** (1.0 / 3) + (4 / (1 + del1)) ** (1.0 / 3)
Zold = Zc
Zc = y / (3 * y + d1 - 1.0)
aux = del1
del1 = del1 - (Zc - Zcin) * (del1 - dold) / (Zc - Zold)
dold = aux
error_Z_critico = abs(Zc - Zcin)
if error_Z_critico <= 1e-6:
break
return del1, error_Z_critico
def getdel1(Zcin, del_1_init):
del1 = del_1_init
d1 = (1 + del1 ** 2) / (1 + del1)
y = 1 + (2 * (1 + del1)) ** (1.0 / 3) + (4 / (1 + del1)) ** (1.0 / 3)
Zc = y / (3 * y + d1 - 1.0)
dold = del_1_init
if Zc > Zcin:
del1 = 1.01 * del1
else:
del1 = 0.99 * del1
error_Z_critico = abs(Zc - Zcin)
while True:
d1 = (1 + del1 ** 2) / (1 + del1)
y = 1 + (2 * (1 + del1)) ** (1.0 / 3) + (4 / (1 + del1)) ** (1.0 / 3)
Zold = Zc
Zc = y / (3 * y + d1 - 1.0)
aux = del1
del1 = del1 - (Zc - Zcin) * (del1 - dold) / (Zc - Zold)
dold = aux
error_Z_critico = abs(Zc - Zcin)
if error_Z_critico <= 1e-6:
break
return del1, error_Z_critico
def acentric_factor_cal(*arg):
al, be, ga = arg[0], arg[1], arg[2]
try:
OM = 0.5 * (- be + np.sqrt(be ** 2 - 4 * al * ga)) / (2 * al)
except RuntimeWarning:
raise RuntimeWarning
else:
OM = 0
return OM
def compressibility_factor_cal(del1):
d1 = (1 + del1 ** 2) / (1 + del1)
y = 1 + (2 * (1 + del1)) ** (1.0 / 3) + (4 / (1 + del1)) ** (1.0 / 3)
# numerator_OMa = (3 * y * y + 3 * y * d1 + d1 ** 2 + d1 - 1.0)
numerator_OMa = (3 * y **2 + 3 * y * d1 + d1 ** 2 + d1 - 1.0)
denominator_OMa = (3 * y + d1 - 1.0) ** 2
OMa = numerator_OMa / denominator_OMa
OMb = 1 / (3 * y + d1 - 1.0)
Zc = y / (3 * y + d1 - 1.0)
return Zc, OMa, OMb
| 24.070796 | 77 | 0.439338 | 436 | 2,720 | 2.62844 | 0.12844 | 0.104712 | 0.062827 | 0.073298 | 0.724258 | 0.713787 | 0.713787 | 0.713787 | 0.69459 | 0.672775 | 0 | 0.136606 | 0.378309 | 2,720 | 112 | 78 | 24.285714 | 0.5411 | 0.130147 | 0 | 0.632353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.073529 | false | 0 | 0.014706 | 0 | 0.161765 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
a0e7544e69192fd9372b3a7e0f454cfcf7d7e67f | 798 | py | Python | src/marmo/report/blueprints/paragraph.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/marmo/report/blueprints/paragraph.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/marmo/report/blueprints/paragraph.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | #
# Generated with ParagraphBlueprint
from dmt.blueprint import Blueprint
from dmt.dimension import Dimension
from dmt.attribute import Attribute
from dmt.enum_attribute import EnumAttribute
from dmt.blueprint_attribute import BlueprintAttribute
from .reportitem import ReportItemBlueprint
class ParagraphBlueprint(ReportItemBlueprint):
""""""
def __init__(self, name="Paragraph", package_path="marmo/report", description=""):
super().__init__(name,package_path,description)
self.attributes.append(Attribute("name","string","",default=""))
self.attributes.append(Attribute("description","string","",default=""))
self.attributes.append(Attribute("text","string","",default=""))
self.attributes.append(Attribute("markup","boolean","",default=False)) | 44.333333 | 86 | 0.746867 | 82 | 798 | 7.121951 | 0.414634 | 0.059932 | 0.136986 | 0.19863 | 0.215753 | 0.215753 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115288 | 798 | 18 | 87 | 44.333333 | 0.827195 | 0.041353 | 0 | 0 | 1 | 0 | 0.093915 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.076923 | false | 0 | 0.461538 | 0 | 0.615385 | 0.307692 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
a0f05e0bc909a6549d803ac271d4a527da38475a | 156 | py | Python | awardApp/apps.py | Kerrykogei24/K-Awards | 67d02ce19970c6ad8066f7e460159c5f79e39ffb | [
"MIT"
] | null | null | null | awardApp/apps.py | Kerrykogei24/K-Awards | 67d02ce19970c6ad8066f7e460159c5f79e39ffb | [
"MIT"
] | null | null | null | awardApp/apps.py | Kerrykogei24/K-Awards | 67d02ce19970c6ad8066f7e460159c5f79e39ffb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class AwardappConfig(AppConfig):
name = 'awardApp'
| 17.333333 | 39 | 0.737179 | 18 | 156 | 6.111111 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007634 | 0.160256 | 156 | 8 | 40 | 19.5 | 0.832061 | 0.134615 | 0 | 0 | 0 | 0 | 0.06015 | 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 | 1 | 0 | 0 | 4 |
9d4c8b38f4f94cc6d7519999e49af7735718a857 | 4,016 | py | Python | mod_safe/consts.py | Guymer/fortranlib | 30e27b010cf4bc5acf0f3a63d50f11789640e0e3 | [
"Apache-2.0"
] | 3 | 2020-05-28T02:05:59.000Z | 2021-10-16T16:50:21.000Z | mod_safe/consts.py | Guymer/fortranlib | 30e27b010cf4bc5acf0f3a63d50f11789640e0e3 | [
"Apache-2.0"
] | 2 | 2019-06-17T16:49:20.000Z | 2022-02-11T18:47:36.000Z | mod_safe/consts.py | Guymer/fortranlib | 30e27b010cf4bc5acf0f3a63d50f11789640e0e3 | [
"Apache-2.0"
] | 1 | 2019-09-11T04:51:33.000Z | 2019-09-11T04:51:33.000Z | #!/usr/bin/env python3
# Use the proper idiom in the main module ...
# NOTE: See https://docs.python.org/3.8/library/multiprocessing.html#multiprocessing-programming
if __name__ == "__main__":
# Import standard modules ...
import math
# Import special modules ...
try:
import scipy
import scipy.constants
except:
raise Exception("\"scipy\" is not installed; run \"pip install --user scipy\"") from None
# Open output file ...
with open("consts.f90", "wt", encoding = "utf-8") as fobj:
# Write documentation ...
fobj.write("!> @cite scipy\n")
fobj.write("!>\n")
fobj.write("\n")
# Write declarations ...
fobj.write("REAL(kind = REAL64), PARAMETER :: const_1sigma = {:.15e}_REAL64\n".format(math.erf(1.0 / math.sqrt(2.0))))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_2sigma = {:.15e}_REAL64\n".format(math.erf(2.0 / math.sqrt(2.0))))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_3sigma = {:.15e}_REAL64\n".format(math.erf(3.0 / math.sqrt(2.0))))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_4sigma = {:.15e}_REAL64\n".format(math.erf(4.0 / math.sqrt(2.0))))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_5sigma = {:.15e}_REAL64\n".format(math.erf(5.0 / math.sqrt(2.0))))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_6sigma = {:.15e}_REAL64\n".format(math.erf(6.0 / math.sqrt(2.0))))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_amu = {:.15e}_REAL64\n".format(scipy.constants.atomic_mass))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_c = {:.15e}_REAL64\n".format(scipy.constants.c))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_e = {:.15e}_REAL64\n".format(scipy.constants.e))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_eps0 = {:.15e}_REAL64\n".format(scipy.constants.epsilon_0))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_g = {:.15e}_REAL64\n".format(scipy.constants.g))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_h = {:.15e}_REAL64\n".format(scipy.constants.h))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_kb = {:.15e}_REAL64\n".format(scipy.constants.k))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_me = {:.15e}_REAL64\n".format(scipy.constants.m_e))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_mn = {:.15e}_REAL64\n".format(scipy.constants.m_n))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_mp = {:.15e}_REAL64\n".format(scipy.constants.m_p))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_mu0 = {:.15e}_REAL64\n".format(scipy.constants.mu_0))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_na = {:.15e}_REAL64\n".format(scipy.constants.N_A))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_pi = {:.15e}_REAL64\n".format(scipy.constants.pi))
fobj.write("REAL(kind = REAL64), PARAMETER :: const_sig = {:.15e}_REAL64\n".format(scipy.constants.sigma))
| 91.272727 | 175 | 0.484811 | 421 | 4,016 | 4.494062 | 0.249406 | 0.114165 | 0.137421 | 0.179704 | 0.72463 | 0.72463 | 0.477273 | 0.232558 | 0.15222 | 0.15222 | 0 | 0.063191 | 0.369522 | 4,016 | 43 | 176 | 93.395349 | 0.684044 | 0.070219 | 0 | 0 | 0 | 0 | 0.616644 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.096774 | 0 | 0.096774 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
9d52028a42707c5461dfa999e00bb04b39daa9ed | 300 | py | Python | nbtest/nbtest.py | StevenBorg/nbtest | 1c3a77207b4de45306e8bfd9749ae0ba6eb2f319 | [
"Apache-2.0"
] | null | null | null | nbtest/nbtest.py | StevenBorg/nbtest | 1c3a77207b4de45306e8bfd9749ae0ba6eb2f319 | [
"Apache-2.0"
] | 4 | 2020-09-23T17:25:08.000Z | 2022-02-26T08:56:30.000Z | nbtest/nbtest.py | StevenBorg/nbtest | 1c3a77207b4de45306e8bfd9749ae0ba6eb2f319 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_nbtest.ipynb (unless otherwise specified).
__all__ = ['say_hello', 'do_something']
# Cell
def say_hello(name):
"Say Hello generically"
print('Hello!')
# Cell
def do_something():
"Do something"
print('Doing something!')
do_something() | 20 | 89 | 0.693333 | 39 | 300 | 5.076923 | 0.564103 | 0.222222 | 0.20202 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008065 | 0.173333 | 300 | 15 | 90 | 20 | 0.790323 | 0.443333 | 0 | 0 | 1 | 0 | 0.38 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 0 | 0 | null | 1 | 1 | 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 | 0 | 0 | 0 | 4 |
19e38da55b1426036c544fef27e67c7cf09be63a | 205 | py | Python | python_crash_course/chapter_05/5-03_alien_colors_2.py | valdsonmota/python-studies | 1abf5ba4337006f77b2a162b37f341b116414f59 | [
"MIT"
] | null | null | null | python_crash_course/chapter_05/5-03_alien_colors_2.py | valdsonmota/python-studies | 1abf5ba4337006f77b2a162b37f341b116414f59 | [
"MIT"
] | null | null | null | python_crash_course/chapter_05/5-03_alien_colors_2.py | valdsonmota/python-studies | 1abf5ba4337006f77b2a162b37f341b116414f59 | [
"MIT"
] | null | null | null | #Exercise 5-3 Alien Colors - 2
alien_color = 'yellow'
if alien_color == 'green':
print('You have earned 5 points.')
if alien_color == 'yellow':
print('\n')
if alien_color == 'red':
print('\n')
| 22.777778 | 38 | 0.629268 | 31 | 205 | 4.032258 | 0.548387 | 0.32 | 0.288 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024242 | 0.195122 | 205 | 8 | 39 | 25.625 | 0.733333 | 0.141463 | 0 | 0.285714 | 0 | 0 | 0.28 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
c20f3be8879b22de458d3ac814b81a309d2cb9d8 | 2,162 | py | Python | mlcomp/parallelm/extra/sagemaker/monitor/job_monitor_transformer.py | mlpiper/mlpiper | 0fd2b6773f970c831038db47bf4920ada21a5f51 | [
"Apache-2.0"
] | 7 | 2019-04-08T02:31:55.000Z | 2021-11-15T14:40:49.000Z | mlcomp/parallelm/extra/sagemaker/monitor/job_monitor_transformer.py | mlpiper/mlpiper | 0fd2b6773f970c831038db47bf4920ada21a5f51 | [
"Apache-2.0"
] | 31 | 2019-02-22T22:23:26.000Z | 2021-08-02T17:17:06.000Z | mlcomp/parallelm/extra/sagemaker/monitor/job_monitor_transformer.py | mlpiper/mlpiper | 0fd2b6773f970c831038db47bf4920ada21a5f51 | [
"Apache-2.0"
] | 8 | 2019-03-15T23:46:08.000Z | 2020-02-06T09:16:02.000Z | from parallelm.common.cached_property import cached_property
from parallelm.extra.sagemaker.monitor.job_monitor_base import JobMonitorBase
from parallelm.extra.sagemaker.monitor.sm_api_constants import SMApiConstants
class JobMonitorTransformer(JobMonitorBase):
def __init__(self, sagemaker_client, job_name, logger):
super(self.__class__, self).__init__(sagemaker_client, job_name, logger)
def _describe_job(self):
return self._sagemaker_client.describe_transform_job(TransformJobName=self._job_name)
def _job_status(self, describe_response):
return describe_response[SMApiConstants.Transformer.JOB_STATUS]
def _job_start_time(self, describe_response):
return describe_response.get(SMApiConstants.Transformer.START_TIME)
def _job_end_time(self, describe_response):
return describe_response.get(SMApiConstants.Transformer.END_TIME)
@cached_property
def _host_metrics_defs(self):
return [
JobMonitorBase.MetricMeta('cpuavg_{}', SMApiConstants.METRIC_CPU_UTILIZATION,
SMApiConstants.STAT_AVG),
JobMonitorBase.MetricMeta('cpumin_{}', SMApiConstants.METRIC_CPU_UTILIZATION,
SMApiConstants.STAT_MIN),
JobMonitorBase.MetricMeta('cpumax_{}', SMApiConstants.METRIC_CPU_UTILIZATION,
SMApiConstants.STAT_MAX),
JobMonitorBase.MetricMeta('memavg_{}', SMApiConstants.METRIC_MEMORY_UTILIZATION,
SMApiConstants.STAT_AVG),
JobMonitorBase.MetricMeta('memmin_{}', SMApiConstants.METRIC_MEMORY_UTILIZATION,
SMApiConstants.STAT_MIN),
JobMonitorBase.MetricMeta('memmax_{}', SMApiConstants.METRIC_MEMORY_UTILIZATION,
SMApiConstants.STAT_MAX),
]
def _metrics_namespace(self):
return SMApiConstants.Transformer.NAMESPACE
def _report_extended_online_metrics(self, describe_response):
pass
def _report_extended_final_metrics(self, describe_response):
pass
| 45.041667 | 93 | 0.692877 | 201 | 2,162 | 7.019901 | 0.298507 | 0.090716 | 0.123317 | 0.05528 | 0.570517 | 0.438696 | 0.10489 | 0.10489 | 0.10489 | 0.10489 | 0 | 0 | 0.235893 | 2,162 | 47 | 94 | 46 | 0.854116 | 0 | 0 | 0.222222 | 0 | 0 | 0.024977 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.055556 | 0.083333 | 0.166667 | 0.527778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 4 |
c20f3cdea33ba0009e09a954a5111ba43eb0cd9d | 173 | py | Python | sparkdq/profiling/ProfilerSuite.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | 1 | 2021-02-08T07:49:54.000Z | 2021-02-08T07:49:54.000Z | sparkdq/profiling/ProfilerSuite.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | sparkdq/profiling/ProfilerSuite.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | from sparkdq.profiling.ProfilerRunBuilder import ProfilerRunBuilder
class ProfilerSuite:
@staticmethod
def on_data(data):
return ProfilerRunBuilder(data)
| 19.222222 | 67 | 0.774566 | 16 | 173 | 8.3125 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.17341 | 173 | 8 | 68 | 21.625 | 0.93007 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0.2 | 0.8 | 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 | 1 | 1 | 0 | 0 | 4 |
dfadb8238ef58dc6bbf139bf4e4863b52edfdfd0 | 153 | py | Python | old/python.py | naeimnb/pythonexersices | 94761d5a954c5f6a710baf4ea5f2be57f110c13e | [
"Apache-2.0"
] | null | null | null | old/python.py | naeimnb/pythonexersices | 94761d5a954c5f6a710baf4ea5f2be57f110c13e | [
"Apache-2.0"
] | null | null | null | old/python.py | naeimnb/pythonexersices | 94761d5a954c5f6a710baf4ea5f2be57f110c13e | [
"Apache-2.0"
] | null | null | null | name = input('what is your name? ')
if name == 'naeim':
print('hey nimi')
elif name == 'jadi':
print('Hey jadi')
else :
print('hey gharibeh') | 21.857143 | 35 | 0.588235 | 22 | 153 | 4.090909 | 0.636364 | 0.266667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 153 | 7 | 36 | 21.857143 | 0.756303 | 0 | 0 | 0 | 0 | 0 | 0.363636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
dfafe91697ce152bd5531fd9278988ebcb74b6dc | 204 | py | Python | python_exercises/Curso_em_video/ex007.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_exercises/Curso_em_video/ex007.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_exercises/Curso_em_video/ex007.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | n1 = float(input('\033[1;32mDigite a primeira nota: \033[m'))
n2 = float(input('\033[1;31mDigite a segunda nota: \033[m'))
print('\033[1;33mA média entre as duas notas é {}\033[m'.format((n1 + n2)/2))
| 51 | 78 | 0.651961 | 38 | 204 | 3.5 | 0.605263 | 0.090226 | 0.195489 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180791 | 0.132353 | 204 | 3 | 79 | 68 | 0.570621 | 0 | 0 | 0 | 0 | 0 | 0.631841 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
dfb2d220b1401238e378c18e70e92c345da09741 | 839 | py | Python | webapp/migrations/0001_initial.py | mchrh/hungry | 9ba450249d0ef1c7e0b3ba360d19ef604f0b7c92 | [
"MIT"
] | null | null | null | webapp/migrations/0001_initial.py | mchrh/hungry | 9ba450249d0ef1c7e0b3ba360d19ef604f0b7c92 | [
"MIT"
] | 3 | 2021-03-30T12:50:06.000Z | 2021-06-04T22:33:43.000Z | webapp/migrations/0001_initial.py | mchrh/hungry | 9ba450249d0ef1c7e0b3ba360d19ef604f0b7c92 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-22 19:06
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='results',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('ING1', models.CharField(max_length=100)),
('ING2', models.CharField(max_length=100)),
('ING3', models.CharField(max_length=100)),
('ING4', models.CharField(max_length=100)),
('ING5', models.CharField(max_length=100)),
],
options={
'verbose_name_plural': 'recipes',
},
),
]
| 27.966667 | 79 | 0.531585 | 80 | 839 | 5.4625 | 0.5625 | 0.20595 | 0.24714 | 0.329519 | 0.370709 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067979 | 0.333731 | 839 | 29 | 80 | 28.931034 | 0.713775 | 0.053635 | 0 | 0 | 1 | 0 | 0.074495 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.045455 | 0 | 0.227273 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
dfbc9d88ff5818d0cf1335cd7e19f0f3a9422e3b | 190 | py | Python | DesignPatterns/03_decorator/2_decorator/cars/luxury.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | DesignPatterns/03_decorator/2_decorator/cars/luxury.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | DesignPatterns/03_decorator/2_decorator/cars/luxury.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | from .abstract_car import AbstractCar
class Luxury(AbstractCar):
@property
def description(self):
return 'Luxury'
@property
def cost(self):
return 18000.00
| 17.272727 | 37 | 0.657895 | 21 | 190 | 5.904762 | 0.714286 | 0.177419 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0.263158 | 190 | 10 | 38 | 19 | 0.835714 | 0 | 0 | 0.25 | 0 | 0 | 0.031579 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.25 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
dfbeac91f89647e20b6ddba347ec4e22b2e3a5fb | 106 | py | Python | metadata-ingestion/src/datahub/metadata/com/linkedin/pegasus2avro/mxe/__init__.py | john-bodley/datahub | 28c008f939f709eb8b401c26a954be529a52752f | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/metadata/com/linkedin/pegasus2avro/mxe/__init__.py | john-bodley/datahub | 28c008f939f709eb8b401c26a954be529a52752f | [
"Apache-2.0"
] | 3 | 2022-02-14T13:39:45.000Z | 2022-02-27T17:32:49.000Z | metadata-ingestion/src/datahub/metadata/com/linkedin/pegasus2avro/mxe/__init__.py | john-bodley/datahub | 28c008f939f709eb8b401c26a954be529a52752f | [
"Apache-2.0"
] | null | null | null | from .....schema_classes import MetadataChangeEventClass
MetadataChangeEvent = MetadataChangeEventClass
| 21.2 | 56 | 0.858491 | 7 | 106 | 12.857143 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084906 | 106 | 4 | 57 | 26.5 | 0.927835 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 1 | 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 | 4 |
dfd80291378fd3b7d704ee5652a1c41e8c96d72a | 116 | py | Python | comparing_lists/target_list.py | William-Lake/comparing_lists | d9d53c89d4a36b1843bc536655cf8831afd4a2d4 | [
"MIT"
] | null | null | null | comparing_lists/target_list.py | William-Lake/comparing_lists | d9d53c89d4a36b1843bc536655cf8831afd4a2d4 | [
"MIT"
] | 1 | 2018-10-25T22:38:47.000Z | 2018-10-25T22:38:47.000Z | comparing_lists/target_list.py | William-Lake/comparing_lists | d9d53c89d4a36b1843bc536655cf8831afd4a2d4 | [
"MIT"
] | null | null | null | class Target_List(object):
def __init__(self,name,items):
self.name = name
self.items = items | 16.571429 | 34 | 0.62069 | 15 | 116 | 4.466667 | 0.6 | 0.238806 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.275862 | 116 | 7 | 35 | 16.571429 | 0.797619 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
dfda441071f6c8e910568e68d8201a4a49dea163 | 194 | py | Python | main.py | Blackth01/Panasonic-Viera-Voice-Contro | 6c5d30544c718ba6865c4f072b66793bf43431f8 | [
"MIT"
] | 2 | 2020-10-22T23:55:02.000Z | 2020-11-21T16:58:32.000Z | main.py | Blackth01/Panasonic-Viera-Voice-Contro | 6c5d30544c718ba6865c4f072b66793bf43431f8 | [
"MIT"
] | null | null | null | main.py | Blackth01/Panasonic-Viera-Voice-Contro | 6c5d30544c718ba6865c4f072b66793bf43431f8 | [
"MIT"
] | null | null | null | from app import app
if __name__ == "__main__":
#app.run(host='0.0.0.0', port='5050', ssl_context=('server.crt', 'server.key'))
app.run(host='0.0.0.0', port='5050', ssl_context='adhoc')
| 32.333333 | 83 | 0.634021 | 34 | 194 | 3.323529 | 0.5 | 0.106195 | 0.106195 | 0.19469 | 0.566372 | 0.566372 | 0.566372 | 0.566372 | 0.566372 | 0.566372 | 0 | 0.094118 | 0.123711 | 194 | 5 | 84 | 38.8 | 0.570588 | 0.402062 | 0 | 0 | 0 | 0 | 0.208696 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
dfeed89df1a35828195ea860e982cfe190caa03a | 253 | py | Python | schemas/__init__.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | schemas/__init__.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | 56 | 2021-08-05T02:49:38.000Z | 2022-03-31T19:35:13.000Z | schemas/__init__.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | from .lease import LeaseSchema
from .tenant import TenantSchema
from .property import PropertySchema
from .property_assignment import PropertyAssignSchema
from .user import *
from .staff_tenants import StaffTenantSchema
from .ticket import TicketSchema
| 31.625 | 53 | 0.857708 | 29 | 253 | 7.413793 | 0.551724 | 0.111628 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.110672 | 253 | 7 | 54 | 36.142857 | 0.955556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
5f04925ee1767c7d6437f6b0e2bc3cf10a05b20b | 252 | py | Python | Chapter14/ABQ_Data_Entry/abq_data_entry/images/__init__.py | JTamarit/Tkinter_libro | 1d0672235d10ad9011d2f7526f9fef363197b8da | [
"MIT"
] | 173 | 2018-07-26T00:46:28.000Z | 2022-03-09T13:54:30.000Z | Chapter14/ABQ_Data_Entry/abq_data_entry/images/__init__.py | my01chap/Python-GUI-Programming-with-Tkinter | 1d0672235d10ad9011d2f7526f9fef363197b8da | [
"MIT"
] | 1 | 2021-03-06T12:29:33.000Z | 2021-03-06T15:08:24.000Z | Chapter14/ABQ_Data_Entry/abq_data_entry/images/__init__.py | my01chap/Python-GUI-Programming-with-Tkinter | 1d0672235d10ad9011d2f7526f9fef363197b8da | [
"MIT"
] | 105 | 2018-05-15T02:47:48.000Z | 2022-03-17T05:52:08.000Z | from os import path
IMAGE_DIRECTORY = path.dirname(__file__)
ABQ_LOGO_16 = path.join(IMAGE_DIRECTORY, 'abq_logo-16x10.png')
ABQ_LOGO_32 = path.join(IMAGE_DIRECTORY, 'abq_logo-32x20.png')
ABQ_LOGO_64 = path.join(IMAGE_DIRECTORY, 'abq_logo-64x40.png')
| 31.5 | 62 | 0.793651 | 42 | 252 | 4.357143 | 0.428571 | 0.229508 | 0.213115 | 0.360656 | 0.47541 | 0.47541 | 0 | 0 | 0 | 0 | 0 | 0.077922 | 0.083333 | 252 | 7 | 63 | 36 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
a027dbd60785b7bfb61b2488dc2836c9157991d8 | 21 | py | Python | deep_classifier/__init__.py | joonilahn/Deep-Classifier | 1f764bf3e5038d337bd862fb2a2cb735a3edfef8 | [
"MIT"
] | null | null | null | deep_classifier/__init__.py | joonilahn/Deep-Classifier | 1f764bf3e5038d337bd862fb2a2cb735a3edfef8 | [
"MIT"
] | null | null | null | deep_classifier/__init__.py | joonilahn/Deep-Classifier | 1f764bf3e5038d337bd862fb2a2cb735a3edfef8 | [
"MIT"
] | null | null | null | """deep_classifier""" | 21 | 21 | 0.714286 | 2 | 21 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 1 | 21 | 21 | 0.666667 | 0.714286 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
a03fb3ffb9cb6e969c900ae7f7d0d1b271343d00 | 1,674 | py | Python | djorm_pgfulltext/tests/models.py | uk-gov-mirror/ministryofjustice.djorm-ext-pgfulltext | a6dbbd8e57a376a02f59123d4180da2e336302c7 | [
"BSD-3-Clause"
] | 1 | 2016-07-23T14:56:17.000Z | 2016-07-23T14:56:17.000Z | djorm_pgfulltext/tests/models.py | Fry-IT/djorm-ext-pgfulltext | 7ff0327a0dcb433cce89108d6fedf84d96b7c820 | [
"BSD-3-Clause"
] | null | null | null | djorm_pgfulltext/tests/models.py | Fry-IT/djorm-ext-pgfulltext | 7ff0327a0dcb433cce89108d6fedf84d96b7c820 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
from ..fields import VectorField
from ..models import SearchManager
class Person(models.Model):
name = models.CharField(max_length=32)
description = models.TextField()
search_index = VectorField()
objects = SearchManager(
fields=('name', 'description'),
search_field = 'search_index',
config = 'names',
)
def __unicode__(self):
return self.name
def save(self, *args, **kwargs):
super(Person, self).save(*args, **kwargs)
self.update_search_field()
class Person2(models.Model):
name = models.CharField(max_length=32)
description = models.TextField()
search_index = VectorField()
objects = SearchManager(
fields=(('name', 'A'), ('description', 'B')),
search_field = 'search_index',
config = 'names',
)
def __unicode__(self):
return self.name
class Person3(models.Model):
name = models.CharField(max_length=32)
description = models.TextField()
search_index = VectorField()
objects = SearchManager(
fields=('name', 'description'),
search_field = 'search_index',
auto_update_search_field = True,
config = 'names'
)
def __unicode__(self):
return self.name
class Book(models.Model):
author = models.ForeignKey(Person)
name = models.CharField(max_length=32)
search_index = VectorField()
objects = SearchManager(
fields=('name',),
search_field = 'search_index',
auto_update_search_field = True,
config = 'names'
)
def __unicode__(self):
return self.name
| 23.577465 | 53 | 0.628435 | 175 | 1,674 | 5.782857 | 0.257143 | 0.086957 | 0.075099 | 0.086957 | 0.755929 | 0.755929 | 0.726285 | 0.674901 | 0.674901 | 0.66502 | 0 | 0.008751 | 0.249104 | 1,674 | 70 | 54 | 23.914286 | 0.79634 | 0.012545 | 0 | 0.673077 | 0 | 0 | 0.072078 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.096154 | false | 0 | 0.057692 | 0.076923 | 0.615385 | 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 | 1 | 0 | 0 | 4 |
a04c5be23ff85e54c6b16b41281f30ceae8c59c2 | 157 | py | Python | conda/run_test.py | 0just0/ibench | 72b5c42d202b71ba11a09e1f3323186cc6aa5275 | [
"MIT"
] | null | null | null | conda/run_test.py | 0just0/ibench | 72b5c42d202b71ba11a09e1f3323186cc6aa5275 | [
"MIT"
] | null | null | null | conda/run_test.py | 0just0/ibench | 72b5c42d202b71ba11a09e1f3323186cc6aa5275 | [
"MIT"
] | 1 | 2021-11-24T04:24:00.000Z | 2021-11-24T04:24:00.000Z | # Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: MIT
import subprocess
subprocess.run('python -m pytest tests', shell=True, check=True)
| 19.625 | 64 | 0.757962 | 21 | 157 | 5.666667 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029197 | 0.127389 | 157 | 7 | 65 | 22.428571 | 0.839416 | 0.414013 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
a0590e973355185cc588f0bb6823f35a8dfb4961 | 6,998 | py | Python | tests/test_client.py | bachya/aioridwell | 2eba18727ec7ce3ff4e0b6a1317aa0e6afdd05a6 | [
"MIT"
] | 2 | 2021-12-20T20:21:34.000Z | 2021-12-20T20:21:42.000Z | tests/test_client.py | bachya/aioridwell | 2eba18727ec7ce3ff4e0b6a1317aa0e6afdd05a6 | [
"MIT"
] | 20 | 2021-10-12T21:10:33.000Z | 2022-03-20T14:59:25.000Z | tests/test_client.py | bachya/aioridwell | 2eba18727ec7ce3ff4e0b6a1317aa0e6afdd05a6 | [
"MIT"
] | null | null | null | """Define tests for the client."""
import logging
from time import time
import aiohttp
import pytest
from aioridwell import async_get_client
from aioridwell.errors import InvalidCredentialsError, RequestError
from .common import generate_jwt
@pytest.mark.asyncio
async def test_expired_token_successful(
aresponses, authentication_response, caplog, token_expired_response
):
"""Test that getting a new access token successfully retries the request."""
caplog.set_level(logging.INFO)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(token_expired_response, status=200),
)
# Simulate a JWT that's generated at some point in the future from the original one:
authentication_response["data"]["createAuthentication"][
"authenticationToken"
] = generate_jwt(issued_at=round(time()) + 1000)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response({}, status=200),
)
async with aiohttp.ClientSession() as session:
client = await async_get_client(
"user",
"password",
session=session,
# We set this parameter low so that this test doesn't take longer than
# necessary:
request_retry_delay=0,
)
# Perform a fake request that has an expired token:
await client.async_request()
assert any(
"Token failed; refreshing and trying again" in e.message
for e in caplog.records
)
# Verify that the token actually changed between retries:
token_1 = aresponses.history[1].request.headers["Authorization"]
token_2 = aresponses.history[3].request.headers["Authorization"]
assert token_1 != token_2
aresponses.assert_plan_strictly_followed()
@pytest.mark.asyncio
async def test_expired_token_failure(
aresponses, authentication_response, token_expired_response
):
"""Test that failing to get a new access token is handled correctly."""
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(token_expired_response, status=200),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(token_expired_response, status=200),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(token_expired_response, status=200),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
async with aiohttp.ClientSession() as session:
client = await async_get_client(
"user",
"password",
session=session,
# We set this parameter low so that this test doesn't take longer than
# necessary:
request_retry_delay=0,
)
# Perform a fake request that has an expired token:
with pytest.raises(InvalidCredentialsError):
await client.async_request()
aresponses.assert_plan_strictly_followed()
@pytest.mark.asyncio
async def test_http_error(aresponses, authentication_response):
"""Test that a repeated HTTP error is handled."""
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aresponses.Response(text="Not Found", status=404),
)
async with aiohttp.ClientSession() as session:
client = await async_get_client(
"user",
"password",
session=session,
# We set this parameter low so that this test doesn't take longer than
# necessary:
request_retry_delay=0,
)
# Perform a fake request that has an expired token:
with pytest.raises(RequestError):
await client.async_request()
aresponses.assert_plan_strictly_followed()
@pytest.mark.asyncio
async def test_invalid_credentials(aresponses, invalid_credentials_response):
"""Test that invalid credentials on login are dealt with immediately (no retry)."""
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
invalid_credentials_response, status=200
),
)
async with aiohttp.ClientSession() as session:
with pytest.raises(InvalidCredentialsError):
await async_get_client("user", "password", session=session)
aresponses.assert_plan_strictly_followed()
@pytest.mark.asyncio
async def test_create_client(aresponses, authentication_response):
"""Test the successful creation of a client."""
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
async with aiohttp.ClientSession() as session:
client = await async_get_client("user", "password", session=session)
assert client.user_id == "userId1"
aresponses.assert_plan_strictly_followed()
@pytest.mark.asyncio
async def test_create_client_no_session(aresponses, authentication_response):
"""Test the successful creation of a client without an explicit ClientSession."""
aresponses.add(
"api.ridwell.com",
"/",
"post",
response=aiohttp.web_response.json_response(
authentication_response, status=200
),
)
client = await async_get_client("user", "password")
assert client.user_id == "userId1"
aresponses.assert_plan_strictly_followed()
| 28.798354 | 88 | 0.628894 | 735 | 6,998 | 5.813605 | 0.195918 | 0.048678 | 0.059911 | 0.086122 | 0.734145 | 0.706529 | 0.706529 | 0.69787 | 0.674936 | 0.662064 | 0 | 0.012392 | 0.273507 | 6,998 | 242 | 89 | 28.917355 | 0.828088 | 0.079737 | 0 | 0.726316 | 0 | 0 | 0.087253 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 1 | 0 | false | 0.031579 | 0.036842 | 0 | 0.036842 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
a085486a97ce5a97cd97744bff9c46f3b5d03d4c | 2,365 | py | Python | tests/three/test_tv_episodes.py | Cologler/ezapi-tmdb | 6a8a1a0a3da99cb18d11f47f1b40bbffb2a16be6 | [
"MIT"
] | 4 | 2017-05-16T02:30:52.000Z | 2021-07-01T13:21:27.000Z | tests/three/test_tv_episodes.py | Cologler/ezapi-tmdb | 6a8a1a0a3da99cb18d11f47f1b40bbffb2a16be6 | [
"MIT"
] | 4 | 2020-09-03T03:19:49.000Z | 2021-12-21T05:24:04.000Z | tests/three/test_tv_episodes.py | Cologler/ezapi-tmdb | 6a8a1a0a3da99cb18d11f47f1b40bbffb2a16be6 | [
"MIT"
] | 3 | 2021-02-15T18:13:08.000Z | 2021-04-10T03:53:58.000Z | import pytest
from . import polite
tv_id = 1418 # The Big Bang Theory
season_number = 12
episode_number = 1
@polite
def test_get_tv_episode_details(tmdb):
assert tmdb.get_tv_episode_details(tv_id, season_number, episode_number) is not None
@polite
def test_get_tv_episode_changes(tmdb):
episode_id = tmdb.get_tv_episode_details(tv_id, season_number, episode_number).get(
"id"
)
assert tmdb.get_tv_episode_changes(episode_id) is not None
@polite
@pytest.mark.parametrize("with_guest_session", [True, False])
def test_post_tv_episode_rating(tmdb, with_guest_session):
rating = 10
if with_guest_session:
guest_session_id = tmdb.create_guest_session().get("guest_session_id")
assert tmdb.post_tv_episode_rating(
tv_id,
season_number,
episode_number,
rating,
guest_session_id=guest_session_id,
)
else:
with pytest.raises(RuntimeError):
assert tmdb.post_tv_episode_rating(
tv_id, season_number, episode_number, rating
)
@polite
@pytest.mark.parametrize("with_guest_session", [True, False])
def test_delete_tv_episode_rating(tmdb, with_guest_session):
if with_guest_session:
guest_session_id = tmdb.create_guest_session().get("guest_session_id")
assert tmdb.delete_tv_episode_rating(
tv_id, season_number, episode_number, guest_session_id=guest_session_id
)
else:
with pytest.raises(RuntimeError):
assert tmdb.delete_tv_episode_rating(tv_id, season_number, episode_number)
@polite
def test_get_tv_episode_credits(tmdb):
assert tmdb.get_tv_episode_credits(tv_id, season_number, episode_number) is not None
@polite
def test_get_tv_episode_external_ids(tmdb):
assert (
tmdb.get_tv_episode_external_ids(tv_id, season_number, episode_number)
is not None
)
@polite
def test_get_tv_episode_images(tmdb):
assert tmdb.get_tv_episode_images(tv_id, season_number, episode_number) is not None
@polite
def test_get_tv_episode_translations(tmdb):
assert (
tmdb.get_tv_episode_translations(tv_id, season_number, episode_number)
is not None
)
@polite
def test_get_tv_episode_videos(tmdb):
assert tmdb.get_tv_episode_videos(tv_id, season_number, episode_number) is not None
| 27.183908 | 88 | 0.727696 | 334 | 2,365 | 4.721557 | 0.143713 | 0.119848 | 0.114141 | 0.111604 | 0.862397 | 0.834496 | 0.714014 | 0.669626 | 0.669626 | 0.645529 | 0 | 0.004757 | 0.2 | 2,365 | 86 | 89 | 27.5 | 0.828753 | 0.008034 | 0 | 0.390625 | 0 | 0 | 0.029863 | 0 | 0 | 0 | 0 | 0 | 0.171875 | 1 | 0.140625 | false | 0 | 0.03125 | 0 | 0.171875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 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 | 4 |
a0a009ca1e7ab186ff8520ca9887c616e454ce41 | 46,226 | py | Python | optimization/pre_optimization/no_ma_cuts/ma_files/Output/Histos/MadAnalysis5job_0/selection_7.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | optimization/pre_optimization/no_ma_cuts/ma_files/Output/Histos/MadAnalysis5job_0/selection_7.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | optimization/pre_optimization/no_ma_cuts/ma_files/Output/Histos/MadAnalysis5job_0/selection_7.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | def selection_7():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.linspace(0.0,8000.0,161,endpoint=True)
# Creating data sequence: middle of each bin
xData = numpy.array([25.0,75.0,125.0,175.0,225.0,275.0,325.0,375.0,425.0,475.0,525.0,575.0,625.0,675.0,725.0,775.0,825.0,875.0,925.0,975.0,1025.0,1075.0,1125.0,1175.0,1225.0,1275.0,1325.0,1375.0,1425.0,1475.0,1525.0,1575.0,1625.0,1675.0,1725.0,1775.0,1825.0,1875.0,1925.0,1975.0,2025.0,2075.0,2125.0,2175.0,2225.0,2275.0,2325.0,2375.0,2425.0,2475.0,2525.0,2575.0,2625.0,2675.0,2725.0,2775.0,2825.0,2875.0,2925.0,2975.0,3025.0,3075.0,3125.0,3175.0,3225.0,3275.0,3325.0,3375.0,3425.0,3475.0,3525.0,3575.0,3625.0,3675.0,3725.0,3775.0,3825.0,3875.0,3925.0,3975.0,4025.0,4075.0,4125.0,4175.0,4225.0,4275.0,4325.0,4375.0,4425.0,4475.0,4525.0,4575.0,4625.0,4675.0,4725.0,4775.0,4825.0,4875.0,4925.0,4975.0,5025.0,5075.0,5125.0,5175.0,5225.0,5275.0,5325.0,5375.0,5425.0,5475.0,5525.0,5575.0,5625.0,5675.0,5725.0,5775.0,5825.0,5875.0,5925.0,5975.0,6025.0,6075.0,6125.0,6175.0,6225.0,6275.0,6325.0,6375.0,6425.0,6475.0,6525.0,6575.0,6625.0,6675.0,6725.0,6775.0,6825.0,6875.0,6925.0,6975.0,7025.0,7075.0,7125.0,7175.0,7225.0,7275.0,7325.0,7375.0,7425.0,7475.0,7525.0,7575.0,7625.0,7675.0,7725.0,7775.0,7825.0,7875.0,7925.0,7975.0])
# Creating weights for histo: y8_M_0
y8_M_0_weights = numpy.array([0.0,0.0,3.15653883439,12.0325134577,23.2462076328,36.1221003516,50.492355761,63.9905439346,74.9094543679,85.6236849806,94.3563573295,102.495390198,109.348904194,115.166579097,119.485855312,122.093773027,123.760051567,123.94021141,125.401770129,124.722170724,121.925893174,120.574854358,117.885056715,115.588258727,113.213700808,109.267024265,105.16474786,101.160711368,97.9100342159,94.7329969995,89.8282812968,86.0822045789,81.6442084673,77.9718116848,74.7538945042,70.5369781989,67.097941212,62.5780651721,59.4010679556,56.7726702585,52.3346741469,48.7605572783,46.684839097,43.7739616474,40.5068845098,37.5673150853,35.491612904,33.5264546257,31.4548484408,28.9206066612,27.0864602681,24.9411581478,23.803003145,21.9647607555,20.4663260684,18.5953277077,17.7437604538,16.5851334689,15.1562987208,13.9812957503,12.8677047259,11.9711015115,11.1768502074,10.3785029069,9.42048774622,8.39287264657,8.09809690484,7.5822453568,6.6037582141,6.18616257998,5.67439902836,5.29774335837,4.69181988925,4.49120806502,3.77474549275,3.62326442547,3.52091211515,3.09922168461,2.67343685766,2.44826225495,2.4318858693,2.32953355897,1.99791304952,1.71951529344,1.83824358942,1.5475638441,1.40017677323,1.2650720916,1.1381554028,1.18319016335,1.04808548172,0.855663650309,0.859757646722,0.790158107701,0.720558568681,0.69190019379,0.573171897814,0.491289969555,0.425784826948,0.462631594664,0.487195973142,0.360279364341,0.393032055644,0.311150367385,0.274303639668,0.2210805263,0.270209523255,0.18013968217,0.196516027822,0.192421951409,0.139198838041,0.126916608802,0.131010685215,0.155575183693,0.106446186737,0.102352110324,0.0900698410851,0.118728415976,0.0695994190203,0.0573171897814,0.0655053426074,0.0695994190203,0.0409408441296,0.0409408441296,0.0409408441296,0.0245645024778,0.0286585868907,0.0204704180648,0.0122822532389,0.0122822532389,0.0122822532389,0.00818816882592,0.0204704180648,0.0163763336518,0.00818816882592,0.0122822532389,0.00818816882592,0.00409408441296,0.0122822532389,0.0286585868907,0.00818816882592,0.00409408441296,0.00818816882592,0.0,0.0122822532389,0.00409408441296,0.00818816882592,0.0,0.0,0.0,0.00818816882592,0.0122822532389,0.0122822532389,0.00409408441296,0.0,0.0,0.00409408441296,0.0,0.0,0.0])
# Creating weights for histo: y8_M_1
y8_M_1_weights = numpy.array([267.83091033,7530.97135106,853.176362185,554.158001598,438.435098903,352.091334661,292.489066756,240.245983785,205.719341418,174.753964541,148.792048311,131.962739585,113.202626199,100.529382316,87.1302340709,76.85196987,66.2192454715,56.9381884823,50.6823204968,44.3007551332,39.4904871102,34.3889801044,32.575424901,28.7717132828,24.3992350481,21.7157562495,18.7256968189,16.7208356535,16.5981785656,14.169351119,12.6615033154,11.1062045513,8.6281997079,7.07265659893,6.26907862765,5.56606256459,5.73535746556,5.01735625617,4.75228219617,3.99824213045,3.72962386904,3.57263032717,2.87953906953,3.01368236621,2.50337344236,2.16263500838,2.00513955824,2.0056530829,1.91982596773,1.84681613971,1.48236985032,1.61569519274,1.40922903746,1.28787819288,1.14228874392,1.16646766407,0.984174420457,0.959565293219,0.789930712912,0.814151291849,0.486153236485,0.66844567897,0.631789952139,0.558899092,0.570715366569,0.522381560184,0.449392962122,0.425067835653,0.473901146915,0.255509442857,0.303559809265,0.170192006922,0.25523453492,0.255162753626,0.243287115286,0.218735108654,0.206661030285,0.0850923983735,0.121557215801,0.133799611692,0.0970914508696,0.133603534998,0.145920436027,0.133686772459,0.0606814708255,0.109398578106,0.0363869154965,0.0487009244443,0.0486194494707,0.0121482870889,0.0364733694963,0.0243191820811,0.0242483621433,0.0242720515727,0.0,0.0,0.0485322864704,0.0243438769293,0.0121541834096,0.0,0.0,0.0607646682297,0.0,0.0,0.0121482870889,0.0121216535049,0.0121482870889,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0121636527723,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0121874623713,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_2
y8_M_2_weights = numpy.array([6.73631230172,655.847885019,771.548096302,935.937740541,808.433754886,699.377557049,610.563307514,530.137646634,468.796531128,408.764838734,362.46682088,317.016421957,285.9524877,256.374954661,229.29032125,208.242901501,186.422984511,170.179096817,154.415690425,140.262731075,125.841845964,115.650956578,106.617594082,99.1459197773,90.3930033244,83.1215708825,76.8249435978,69.398557176,63.5830310081,60.2913539435,52.8838925678,50.9141588965,47.4000092379,43.4946317708,39.3366627881,35.1414222082,31.0926399979,27.0990709897,24.6184519806,19.7978708552,18.2719295144,17.7103886876,15.9946142591,13.3938955853,12.9606938428,11.8067164317,11.2243787147,10.6323718694,9.8394868167,8.72535943708,8.20261908684,6.84751967401,6.59620084705,6.12480604759,5.13046429258,4.75883093142,4.7993958173,3.93555630416,3.32310462414,3.01215909251,3.12251649057,2.84132253629,2.42939204973,2.44956085975,2.23889575896,2.07850558024,1.73750724072,1.80718859924,1.647050479,1.47578459695,1.47552634032,1.4858549528,1.30534141723,0.893691500674,1.10451279508,1.10456609925,0.793187522896,0.893567950701,0.873431371106,0.692702966017,0.672964308243,0.652716161782,0.51209769769,0.552210531162,0.471797679811,0.532081389358,0.462100039934,0.461945912375,0.431858808008,0.391732379907,0.341455391776,0.361382556232,0.361468751966,0.250997225138,0.291146916996,0.230909941569,0.210960918272,0.331240040321,0.21085377276,0.21089777969,0.180769767472,0.120483454698,0.080279508286,0.160568850985,0.120490190031,0.0802931442362,0.140578547947,0.130570710862,0.100405674973,0.0903324679696,0.070289604542,0.100370386787,0.0200760277115,0.0703055544716,0.070211466415,0.0301293675489,0.0602513964772,0.0200668709643,0.0602766023246,0.0602232568345,0.0501861644384,0.0301488297687,0.0200793292643,0.0501891808759,0.0401948970993,0.0200843539053,0.0200817672069,0.0,0.0100330883852,0.0200897876249,0.0100459020463,0.0,0.0,0.0,0.0201029277224,0.0,0.040178881056,0.0100534183474,0.0100698393372,0.0,0.0301235949966,0.0100155310663,0.0100704591531,0.0,0.0100548232635,0.0,0.0100273282293,0.0,0.0,0.0,0.0,0.0,0.0100155310663,0.0,0.0,0.0200557266741,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_3
y8_M_3_weights = numpy.array([0.385018944747,50.4219555325,10.599199331,35.9829376697,208.551322405,304.306749052,337.847203639,343.275318483,318.500619561,290.025533398,266.156867701,244.885602875,224.49818967,204.580490218,189.344612437,171.69561173,159.488985469,148.292759725,135.423163497,124.642619394,115.607353173,105.712935727,99.2430979907,91.5091931852,84.402507775,79.5910496579,72.9294588585,66.3720322232,63.698417635,59.3822268053,54.1831187452,50.1367634763,47.6932119386,45.4172005774,42.7773865292,38.7575638717,35.9167503623,33.2513502804,31.5065355305,29.3445969292,27.7345699577,25.9301858187,24.4114812436,23.1009303065,21.6165747177,19.7513008559,18.4820824541,17.3698821858,16.1377712518,15.3016263312,14.6357110051,13.3115626632,12.826098345,11.5175786904,10.9179928615,9.71386487454,9.44378149723,8.48759184631,8.06983423479,7.64067300358,6.75992112034,5.85868984742,5.45112114868,4.86210611367,4.7738306409,4.62067600663,3.87221870565,3.58099658439,3.12944208918,2.57429462649,2.4478387625,2.25501602575,2.12878400909,2.08447970754,1.78210218931,1.78224762913,1.56756991823,1.38053105513,1.3363563494,1.1549449512,1.23208127727,1.14387771189,1.08349296595,0.940452899514,0.945857735861,0.753688665801,0.670954937811,0.65448814349,0.759022407262,0.599519609072,0.659983168778,0.572059920381,0.483988794622,0.467603657856,0.423600392367,0.46747934337,0.401529492891,0.429052760723,0.341020107454,0.363129479419,0.302449466256,0.291604327371,0.242012881981,0.214576146782,0.231051716243,0.186899598376,0.142981728002,0.148494425446,0.154002085311,0.120986067228,0.0880650725375,0.142969987189,0.120994232983,0.154076714628,0.0605041853545,0.0990183162746,0.0384792781758,0.0880580849259,0.0604757067745,0.0660383331421,0.0495184410981,0.0604602284022,0.0384825891662,0.054998272393,0.0385421423052,0.0495469196781,0.0440159406911,0.0275112832655,0.0219813280449,0.0219860649956,0.0164966460476,0.0550408886988,0.0110186957203,0.0330224044353,0.0274859247354,0.0219985858206,0.0385004847646,0.0164807939193,0.0109727724866,0.010982656707,0.016526623714,0.0110185535305,0.0055097114597,0.0110137597039,0.0219946166947,0.0,0.0109727724866,0.0109987810271,0.00551628468972,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0109941903288,0.0,0.0,0.0])
# Creating weights for histo: y8_M_4
y8_M_4_weights = numpy.array([0.00296148985659,2.84410811646,0.387818414842,0.48556466238,0.905995676435,1.51078109762,2.56777672151,5.91308236158,28.5749591588,43.0020125596,49.9172117907,52.3432493947,49.0885310568,45.3870450174,43.1575354989,40.7946690683,37.9192543445,36.0258186746,33.4983704942,31.6324559713,29.4555156113,27.9167804679,26.2393172592,24.6388739804,23.2718674269,21.7283423372,20.1517044897,18.8291782985,17.8352343999,16.4727332016,15.6129158132,14.7722341597,13.6774889497,12.9721042367,12.3948616074,11.3105620877,10.8711256093,10.2453662363,9.57747537828,8.85702738678,8.40213882252,7.91960886162,7.40546525581,6.8952818733,6.54883448431,6.28832955261,5.78193804382,5.44932337813,5.23024847479,4.88675521999,4.66487849876,4.33519792563,4.0351749357,3.76680847974,3.58217589499,3.3671101165,3.15314823021,3.01896359932,2.68123551575,2.43660354382,2.22631528573,2.11787491212,1.93917464567,1.86219600152,1.8029549891,1.54546311392,1.55135013817,1.48227470484,1.33126072824,1.26519153729,1.16351641154,1.11127753888,1.06381418245,0.99584103799,0.943392129196,0.861501685822,0.76481892659,0.751941787546,0.643417239146,0.654320679857,0.563569437265,0.520058688327,0.505241921697,0.467714797601,0.421417061557,0.400640599775,0.397681094439,0.375970533024,0.333551851736,0.287170942987,0.285203577804,0.267430752996,0.242763892904,0.19638194199,0.204313692062,0.19738197854,0.175636825295,0.16776123183,0.171698407273,0.138172030624,0.140136108982,0.138169264881,0.120370546306,0.114477790151,0.100669677965,0.087808532131,0.0779601221641,0.0917724831721,0.0818959347765,0.0592266225398,0.0730181001841,0.0582059832088,0.063158426829,0.0601990016597,0.049343300078,0.0384869571646,0.035532786907,0.0355321095003,0.0306010943758,0.0197423745267,0.0256413676323,0.0256504064011,0.0256555410631,0.019739240018,0.0207324864684,0.0187557618512,0.00986137689239,0.0108594934554,0.0147995949737,0.0108605195862,0.00789217990611,0.0167743595208,0.0128346067267,0.00790004423619,0.0069055712389,0.0128299731051,0.0128323500408,0.010852318557,0.00789612810444,0.00888522193202,0.00295480838268,0.00098629882383,0.00887323704572,0.00197196753926,0.00296166502031,0.000986374981971,0.0,0.00691087825879,0.00296224622717,0.0,0.00493845858067,0.00296126659299,0.0,0.0,0.0,0.0,0.000986802670054,0.00295690233071,0.0,0.000985643863823])
# Creating weights for histo: y8_M_5
y8_M_5_weights = numpy.array([0.0,0.172418129509,0.0370535696054,0.0458799088969,0.0715933093876,0.113677759436,0.177712639164,0.245014487011,0.327958724175,0.459279207732,0.718428511144,1.51447342155,6.83352634743,10.3662602078,11.9708771273,12.8463816929,11.6817776154,10.7657470252,10.2143946422,9.67066014348,9.09538984409,8.66258278453,8.21311160292,7.76236810659,7.40678414901,6.95685285359,6.58696535787,6.27500819186,5.86262218367,5.54624392405,5.25861277534,4.9414663257,4.69501736386,4.36726028957,4.20387587464,3.93485332898,3.69799113853,3.60171092256,3.40330224401,3.16056019911,2.97641824959,2.79859426288,2.6523820957,2.49563252198,2.35541783835,2.20943212718,2.07030331215,2.01007641437,1.88733085191,1.77227599184,1.63878297088,1.56393605668,1.46436622699,1.39674349977,1.2943745777,1.2220874967,1.15098670914,1.08190041989,0.993390926103,0.952349974175,0.900651586014,0.855533225494,0.799561780345,0.744877453579,0.710887845878,0.664715624675,0.630229494154,0.564647671773,0.546733640542,0.523591916183,0.491039463978,0.448726597428,0.424028488081,0.395259851844,0.364750865113,0.369289667836,0.306030620019,0.29595320726,0.280314698905,0.271505759917,0.252318453727,0.245029730782,0.214255278385,0.201664043805,0.189805750527,0.182006461287,0.177968142365,0.158067379694,0.148478727836,0.145944580987,0.123513072308,0.117725520694,0.116209665731,0.104608836139,0.0899989822319,0.0932662704314,0.0857046799893,0.080164349528,0.0703271561907,0.0710851036773,0.0564614863658,0.0599975210426,0.0549531532631,0.0456267262694,0.0461232090799,0.0418455909643,0.0342866131685,0.0342828402352,0.0332723902894,0.0312526186768,0.0239461313373,0.0254630225569,0.0211765182432,0.0181538145444,0.0191580389503,0.0138627611055,0.0184042284871,0.0168915543106,0.0136135954716,0.0131082864779,0.0108440824023,0.00907853767552,0.0105871948584,0.0113438060144,0.0083183096248,0.00932460254235,0.00730947207781,0.00806697945554,0.00655365711872,0.00554361127284,0.00680537538398,0.00378331864522,0.00579946656144,0.0047894847314,0.00605200903058,0.00327664531403,0.00277244059348,0.00201775711428,0.00201706094207,0.00226745768044,0.00226796060484,0.00126152005077,0.00176456088342,0.000252040304924,0.00201700252762,0.00226813944908,0.00100770086582,0.000504528400614,0.000252009497304,0.000252077834207,0.000251636365005,0.000252212107421,0.00075509358065,0.000252350061546,0.00151265457164,0.000252441284111,0.0,0.000252178219039,0.00050424673094,0.0])
# Creating weights for histo: y8_M_6
y8_M_6_weights = numpy.array([0.0,0.0168984400821,0.00687219517873,0.00831114936776,0.0143085790557,0.0234689654798,0.0355188323991,0.045533762099,0.0518195230435,0.0669750179344,0.0967594144035,0.116820403358,0.143726975421,0.183537317894,0.267691281793,0.526822135858,2.21724704915,3.40355200935,4.16067297326,4.41691499661,4.63771791081,4.82043760304,4.76836907355,4.71213494173,4.37561585367,4.10678405456,3.87657729562,3.65238351915,3.48320628303,3.25264864182,3.10932573082,2.98436066024,2.83010941601,2.6644629952,2.53838929659,2.41265848294,2.2667004561,2.17823713811,2.07541863671,1.92207108927,1.86441343509,1.77264822499,1.65491872666,1.5603294641,1.48626631444,1.36725724544,1.3000328012,1.21788736338,1.20028926806,1.12467663829,1.05503900374,0.977389957254,0.937176450055,0.872525542314,0.838325317484,0.792226984815,0.739314538479,0.732857804901,0.663942927845,0.629830473566,0.601862057782,0.571422771048,0.508836670504,0.486205863798,0.472662008155,0.460110419578,0.387985419612,0.38016634314,0.374773052745,0.332379077157,0.317545354302,0.30035242303,0.276511422379,0.271459817339,0.249025744623,0.249635540019,0.219316113068,0.207579750959,0.202504853734,0.182351415799,0.157740573452,0.166048585872,0.146558725287,0.135969878153,0.131374719962,0.118509836505,0.113604882259,0.1099225178,0.0961775096494,0.0838908621768,0.0839287394679,0.080463862035,0.0807336115262,0.0655626918108,0.0638522057287,0.0586968954851,0.0578315858217,0.0463726306343,0.0486606129497,0.0486765575998,0.0418027839507,0.0377761150152,0.0392342757599,0.0283598944309,0.0334873940058,0.0323437677256,0.0286264649888,0.0248971862702,0.0260224587086,0.0229178703882,0.0220534404296,0.018605857194,0.0171680296269,0.0160298015356,0.0154619320723,0.0103145791588,0.0123100496205,0.0080224282421,0.00772660150057,0.0083051503806,0.00830043696209,0.00686764670487,0.00801431696366,0.00801623232101,0.00601087417696,0.00487151946359,0.00544337358991,0.00572330566456,0.00429545075139,0.00457448912591,0.00400743338959,0.00400385658971,0.00372335770524,0.00342957027947,0.0022939892999,0.00143265130384,0.00343798045761,0.000855258935763,0.00229207094356,0.00257508598379,0.00171731579063,0.000861006407319,0.000572159523846,0.00200202726165,0.000570381620384,0.000860475485459,0.000859723137893,0.000858643200244,0.000572915070338,0.00057356505225,0.00057356505225,0.0,0.0,0.000283554259302,0.00028617058145,0.000287115464415,0.000286437092028,0.000858461561189,0.0,0.0])
# Creating weights for histo: y8_M_7
y8_M_7_weights = numpy.array([0.0,0.000648125465779,0.000194369788245,0.000366939718819,0.000756012685422,0.00120945676579,0.00254892435981,0.00293715222125,0.00354131922632,0.00410439815269,0.00513968949304,0.00519868550324,0.00708396363119,0.00762138178673,0.00839786014073,0.0107316663641,0.0117473893184,0.0136239963698,0.0161109399244,0.0192601668138,0.0240975965749,0.029384853626,0.0433431034439,0.0869525837016,0.377149083786,0.607702910011,0.731939027556,0.80283440351,0.844751452227,0.876990338953,0.884933447436,0.886046144794,0.794257204215,0.726774938349,0.6937167208,0.648392848421,0.611649947192,0.58998901953,0.55608506817,0.525337321632,0.501119914164,0.474624725099,0.44918062642,0.427977769647,0.407747967762,0.38566115571,0.365274025542,0.344657566564,0.330056714115,0.311020075837,0.29574251061,0.280591931184,0.265250076777,0.250739371673,0.239369239146,0.226013308543,0.212758715123,0.200360081434,0.193136768698,0.177463410107,0.170653283181,0.159652499122,0.151533496445,0.145162203947,0.135642459885,0.125317843779,0.118051950986,0.111408833438,0.102774260032,0.101685995915,0.0941800873874,0.0899373367386,0.0853814801779,0.0794303723766,0.0727419925631,0.0698431959209,0.0653630279262,0.0632577877612,0.0581222808368,0.054394220819,0.0507421846432,0.0482582082815,0.0463009505787,0.0431284429592,0.0390452795146,0.0339011308502,0.032414994657,0.0302974959618,0.0278971164897,0.0267401710764,0.0241400383306,0.0247053807893,0.0221542779735,0.0202096559864,0.0197098138931,0.0183982726977,0.0171707097685,0.0159322252222,0.015332889964,0.0121600512594,0.0115516425934,0.0120718443242,0.0111887146619,0.00965135248072,0.00982168109096,0.00915738609996,0.00842402005376,0.00784264301841,0.0070807282174,0.00622038475293,0.00630587176124,0.00650254049539,0.00518219830397,0.00440698980797,0.00427661352885,0.00414756075189,0.00362712474687,0.00375678311617,0.00308713125224,0.00308772008079,0.00276536264566,0.00280655046899,0.00220010526322,0.00224422800919,0.0021811927609,0.00159850898718,0.00166234386883,0.00144702289039,0.00131607287014,0.00127523541027,0.00151056272912,0.00110162319031,0.00094884376619,0.000884159378879,0.00114455654452,0.000583367736834,0.000756140928507,0.000691239449959,0.000691306505167,0.000454020755153,0.000410416387855,0.000323955779833,0.000259358899568,0.000453633092232,0.000302462993105,0.000345290022904,0.000237592318043,0.00017284623994,0.000151176301734,0.000194554357705,0.000172760535002,0.000215996392023,0.000108063952025,8.64731808738e-05,0.000194468862315,0.00010796362067,8.64285891605e-05,6.48603234136e-05,0.0,0.000151259953106])
# Creating weights for histo: y8_M_8
y8_M_8_weights = numpy.array([0.0,0.0,0.0,2.8370686899e-05,0.000113474402088,8.52134690097e-05,0.000113356956145,0.00031244674808,0.000340859340713,0.000426073507657,0.000482336336384,0.000595195368656,0.000593898845039,0.00116144474497,0.000906109483561,0.00113271630012,0.00127962247916,0.00107555165168,0.00124988871247,0.00149849529697,0.00169901171038,0.00237754900113,0.00203897086484,0.00249287144312,0.00292309721208,0.00326346621709,0.00323247349642,0.00441960413988,0.00585979225574,0.00651577588632,0.0104038974111,0.0201581282359,0.0960970504598,0.155871214407,0.189802385345,0.207602224586,0.22095132441,0.23063523171,0.238495898034,0.237312677305,0.240444321626,0.2365840046,0.233809197555,0.236297257709,0.228145389597,0.221901851001,0.214098652853,0.212011384961,0.199703840132,0.197518416002,0.187068563355,0.177487415686,0.17550275893,0.169530226587,0.163628824106,0.153618521328,0.147431411431,0.138380307445,0.133394802154,0.129456227432,0.12040279205,0.118148554606,0.111659090829,0.105669303184,0.100109606177,0.0956027647523,0.0897188848668,0.0866596771768,0.0815517661564,0.0769339829392,0.0738706321948,0.0716862029925,0.0671139191267,0.0613705467027,0.0599727632694,0.0535337586287,0.0546045822978,0.047135531148,0.0473017433671,0.0434184836203,0.0400475222158,0.0384313151669,0.035828927498,0.0350723225865,0.0335948707396,0.0290316303153,0.0293518334851,0.02868780134,0.0253998049733,0.0237866866532,0.022284034937,0.0219584116422,0.0191948606378,0.0173504291991,0.0171813806954,0.0160012189963,0.0154286607429,0.0144317616399,0.0136607124664,0.0121660721406,0.0117064782036,0.0108741593422,0.00964568576668,0.00963589390237,0.00797100522051,0.00857623717584,0.00731290848363,0.00773785519926,0.00679897370904,0.00627245384952,0.00536454874535,0.0044467285247,0.00442463223399,0.00442019218632,0.00456728992594,0.0039394716412,0.0032018000434,0.00343304782349,0.00277582573146,0.00266738610583,0.00229703118694,0.00218147560532,0.00218070342312,0.00186932540491,0.00147192450739,0.00147618502269,0.00136093846245,0.00130570634846,0.00127280232835,0.000879293526128,0.00110236879708,0.000623352992666,0.00096334585585,0.000708347384675,0.000566163545295,0.000509159421653,0.000877839299145,0.000453035140232,0.000620745986753,0.000423707808682,0.000426082268955,0.000283627423321,0.000453900578285,0.000511072800053,0.000282431431887,0.000226896533382,0.000142022349352,0.000141935196711,0.000170185541983,8.47584309477e-05,0.000141579859251,8.52821932257e-05,0.000170187026949,0.000142122421195,8.49620346049e-05,0.000170287262139,5.67041160068e-05,5.67227374776e-05,0.0,0.000198719159327])
# Creating weights for histo: y8_M_9
y8_M_9_weights = numpy.array([263613.774479,1429376.51294,563738.176175,216174.237787,100909.486142,53316.9867832,30200.0405353,18019.1866252,11380.1378045,7618.93658001,4804.06976578,3307.71767667,2231.18927393,1684.04589358,1146.86854232,834.103725808,620.395501519,471.742552865,346.729603565,242.36919047,182.416169515,135.530305378,99.0132181995,104.251862667,57.3034753289,52.139389587,33.8885210475,20.8545061398,15.6411708799,15.6327190966,18.2533102513,15.6315001634,7.8257361059,7.81884932524,7.80639082756,13.0185686776,5.21991057812,2.60341880751,5.2083710869,0.0,0.0,2.61208515383,0.0,0.0,2.60341880751,0.0,0.0,0.0,2.61294148329,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_10
y8_M_10_weights = numpy.array([15935.4170009,72221.6124727,385509.980289,280766.803178,135684.567411,72520.0329886,42689.3703131,26929.1310799,17629.9422644,11920.5991212,8391.26478798,6248.93560814,4455.25747336,3346.18970726,2498.24758784,1863.10322844,1400.77920711,1078.54007067,882.583293104,659.37005686,482.396225396,433.953295223,323.294343077,280.173540422,220.144729982,188.515695089,149.543499357,122.166264247,88.4770658542,69.517320832,53.7184246762,52.6839951285,45.2939319411,38.9722342085,43.1932146473,25.2821814956,11.5918055837,6.31554925426,13.6908068441,10.5256794371,7.37203329391,8.42535075176,11.5905320253,6.31779625763,5.2644403237,3.16008742461,4.2174329438,5.26728370639,3.15636909574,3.15892660112,1.05322703905,4.21418171461,2.10784883618,0.0,0.0,0.0,2.10384116716,0.0,1.05322703905,0.0,1.05409890714,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.05314700879,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_11
y8_M_11_weights = numpy.array([766.753736097,2839.40325198,4201.07779211,10882.9867448,48161.7723606,46775.1992915,36196.0313893,26753.5060591,16898.4092494,11349.9076469,8017.72131349,5828.80937287,4395.2295287,3338.9276598,2527.03796754,1987.99198151,1592.72970743,1247.48388695,1000.12581409,797.928288141,669.121501855,533.430455399,459.282397171,384.428123048,301.511153417,257.517438068,205.005406532,172.755085574,146.02254698,124.153292298,105.712642782,96.7296380725,76.0060054318,68.6233212896,55.2806437533,51.3706744546,37.7707391433,32.7033019723,31.3283979874,23.0353869555,21.1947916066,19.3469919333,15.8945298863,14.5118029658,11.9747242835,10.3665923071,7.3732512803,8.52273484006,7.37306300729,4.60759763938,3.45456763091,4.60775517394,4.14597911999,1.84197896345,3.45638388909,2.07232714639,2.76429077488,0.459414572507,0.921726243954,2.99377828121,2.07326351643,0.92188877351,1.6118451812,0.920890926567,0.460782817775,0.460084670723,0.230527695492,0.230498955041,0.0,0.461037946913,0.0,0.0,0.460495413265,0.22999665034,0.23081494631,0.229679813764,0.0,0.460333652171,0.230162714818,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.23081494631,0.0,0.23072864811,0.0,0.0,0.230341189945,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_12
y8_M_12_weights = numpy.array([3.68283786851,118.548712143,147.261208916,171.129223014,219.47236964,261.126441529,346.940579056,725.430926552,3795.28692746,4487.6212243,4104.88000907,3476.28295237,2353.78749379,1669.17519246,1271.31660908,986.29641603,778.668530305,625.601282538,516.521940535,418.304636257,350.572979275,288.957402804,242.404872753,203.861566283,168.969934244,146.927199525,122.645193828,104.311917702,90.6345755273,76.7067455446,66.3730751295,57.9294315945,50.811207496,42.0903769461,38.3803066556,32.5906258776,30.3783272549,23.7603555079,22.2360308245,18.6347501858,16.724822009,14.8992848712,13.348249439,11.7680141534,11.186779336,8.77755674751,7.67132087532,7.03274431665,6.06454796264,5.23297922346,4.23689104628,4.68025177289,3.51697000513,3.04630260658,2.68672699316,2.10426801325,2.38175472104,2.1317047188,1.91074838875,1.68918536346,1.41223148567,0.830778534973,1.19039108101,0.609248979872,1.02469518515,0.664601745607,0.775558880559,0.415400808931,0.443287630795,0.498713877058,0.360060623369,0.36001803544,0.221452612141,0.332241126595,0.276862815796,0.276993811187,0.166051026097,0.138279849502,0.110728999074,0.110729037546,0.0830820084172,0.0830896257702,0.0554073952375,0.110799209525,0.0276650376283,0.0829973711607,0.0277335399459,0.0276724433882,0.0,0.0,0.0276925101123,0.027641354585,0.0,0.027641354585,0.0276409737174,0.0276605249236,0.027723379628,0.0276901556577,0.0277086912169,0.0276859430306,0.0276936488681,0.0,0.0276262506819,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0276409737174,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_13
y8_M_13_weights = numpy.array([0.0,9.57745849872,17.0470174622,19.2266201224,20.8602389247,25.2760736937,26.9885258826,28.4705037412,32.1709032251,37.5649552803,53.4855916529,121.996289154,691.673005423,900.556903469,887.104071899,810.432823293,560.11464093,408.162028938,318.060037402,259.137860925,210.835708568,175.324638815,147.109374169,121.659255339,103.141753393,88.509060737,75.5702755213,66.9442973446,56.3092238203,48.242306705,42.9280711023,36.5975395819,32.1714857826,28.704042567,24.6808030397,21.5951838194,18.9837482392,16.786541418,14.2453647056,12.9247674247,11.7354640515,10.0416294309,8.92264560855,8.36795372884,7.56193074483,6.55343260264,5.45461316028,4.87934304197,4.38531724904,3.88108941702,3.44844880533,3.08534007812,2.38958128105,2.48050395054,2.13729927292,1.71428178375,1.54283691752,1.40142532029,1.19999451788,1.189508482,1.13920038981,0.836907029748,0.82685427104,0.917319390115,0.766498881626,0.594828699136,0.494082410249,0.453465648359,0.393125490397,0.423333830059,0.443668911558,0.302442094291,0.363097379477,0.262123953829,0.201567157278,0.191567981729,0.232049784452,0.252108333165,0.211650075475,0.191618591416,0.141113279228,0.141271722745,0.0907781223909,0.100839801511,0.100880337807,0.0704537211136,0.060508365386,0.0504474569411,0.0503439073368,0.0807049741693,0.0503856633628,0.070658526502,0.0201427768248,0.0302693504283,0.0302264535605,0.0201284980965,0.0,0.0201631724073,0.0201653569981,0.0101024278068,0.0503901539106,0.020173318618,0.0100987746855,0.0,0.0,0.0201365568093,0.0,0.0201573832417,0.0100787796113,0.0,0.0,0.0100786036304,0.0100787796113,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_14
y8_M_14_weights = numpy.array([0.0,1.11174586198,3.50519751325,4.21001040631,4.6457685906,4.99932676071,5.16887078249,5.58211774362,5.62437389882,5.97805903361,6.36300825992,6.90874094483,7.729175189,9.63917033273,14.2958424965,32.8411390944,191.036334132,260.553961488,272.069735252,260.331696343,244.949809484,226.146224397,203.997697007,179.920191328,140.029041917,112.474281344,94.3191779987,78.8691919002,67.5458273427,58.0432902467,49.6551568068,43.5836286815,37.6480528005,33.2847729365,29.6779986746,25.960303448,22.8313203756,19.9540197805,18.0273191623,16.0217311539,14.1399183226,12.6519114661,11.5740005381,10.0344575622,8.9686082792,7.99857501085,7.40974743433,6.52957823017,5.93000482451,5.28223100801,4.61712843588,4.20950639498,3.63828843537,3.28750694442,3.08101427596,2.76984153419,2.52083185581,2.22079737948,1.91256059983,1.83615479212,1.58727130894,1.46554641921,1.37500867271,1.15726231636,1.03840490478,0.797823757696,0.789384453641,0.746874369072,0.763998057495,0.650742096915,0.560157027214,0.472480987736,0.472424045999,0.393183463162,0.367884210958,0.322541121079,0.294283053106,0.319590961992,0.223468731588,0.251804632759,0.183900841957,0.178272574474,0.158434881276,0.186771898198,0.138571718193,0.124473713606,0.141509834871,0.132977615753,0.118824092972,0.0849248686772,0.0848685810007,0.059448558451,0.0622360873199,0.0565857741514,0.0537433426754,0.01979692984,0.0565881210743,0.0226221749147,0.0226384918003,0.0282886780041,0.0197986496343,0.0113217601856,0.0254695387764,0.0198234231373,0.0254745173309,0.0113217486434,0.0113298589935,0.00566534501753,0.00849217137971,0.0084776281523,0.00283039137661,0.00564846640942,0.0113323636604,0.0,0.00283439114889,0.00283014668104,0.00282798289503,0.00283100696296,0.00566127830023,0.00565841582372,0.0028300989731,0.00283014668104,0.00564986686835,0.00565940460929,0.0,0.00282876776763,0.0,0.0,0.00283011859491,0.0028292871686,0.0,0.0,0.00283620558964,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00283095579234,0.0,0.0,0.0028292871686,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_15
y8_M_15_weights = numpy.array([0.0,0.0259825854279,0.144752947926,0.255908707027,0.254294582397,0.271285075668,0.357925992009,0.353495066287,0.328960726415,0.335091445898,0.347366473762,0.360954189071,0.396051237627,0.388263263537,0.411528518599,0.358203678164,0.385298402551,0.462946186888,0.533129294719,0.655299504703,0.738637964592,1.0466701354,1.60404875765,4.09290604518,25.949830278,37.7943618863,40.2470750712,41.3672137552,40.5238040953,38.969754207,35.8741325826,33.5015348075,25.8781636171,21.2483909761,17.9114541746,15.4263166999,13.5888378704,11.6677601469,10.1501970377,8.99203661998,7.99264887428,7.04644216304,6.46413784068,5.71796914573,5.12036372541,4.53786797685,4.10818351028,3.81122120942,3.31481289553,3.110168834,2.70426139216,2.41437713415,2.23136895985,2.03370131985,1.79908369657,1.63762751284,1.51746030627,1.35572525474,1.21425183938,1.12117108569,0.972025379124,0.904828638186,0.78120146212,0.78578576513,0.738638437249,0.621535940513,0.605001443359,0.539376878716,0.452437006643,0.393042419514,0.376363880051,0.383929941546,0.3275608337,0.274391261183,0.280376874879,0.234642437789,0.201143679843,0.164501987278,0.16743718902,0.173557391879,0.162880300132,0.156938407234,0.129433416323,0.118829822785,0.109733143387,0.103672873472,0.0807533199484,0.0746530514106,0.0821685267592,0.0655598342272,0.0670754334454,0.0593471205212,0.0441263861075,0.0487343810642,0.0350138845069,0.0365717747357,0.03657172747,0.0167314061797,0.0273961852039,0.0243489991348,0.0274695179817,0.0121587896209,0.0152248110828,0.0121596167711,0.00455374807999,0.0212869007284,0.00761697022913,0.0106546417071,0.0106827459092,0.00758521120448,0.00456303106908,0.0045645163946,0.00611834886061,0.00305150733832,0.00153596956556,0.00303111808467,0.00455404585408,0.00612734707368,0.00455955940132,0.00305183347184,0.00306720428676,0.00304453446171,0.00304112542104,0.00459040147083,0.0,0.0,0.00152160551066,0.0,0.0,0.00153120636177,0.0,0.0,0.0,0.0,0.00152776423509,0.0,0.00302948269046,0.0,0.0,0.0,0.0,0.00154508239802,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0])
# Creating weights for histo: y8_M_16
y8_M_16_weights = numpy.array([0.0,0.000180614037165,0.0122783293619,0.0213020238349,0.0202251163832,0.0242037514719,0.0269018663287,0.0288945248495,0.0310566045778,0.0312387349754,0.0330407826027,0.033225920842,0.0315896318646,0.033042242234,0.0301520876625,0.0319555833673,0.0334023012939,0.0377340670082,0.0307024110018,0.0420758922392,0.0355634528662,0.0393590525089,0.0483809985054,0.0572467370009,0.0695098731037,0.0740175147536,0.0796482636871,0.103450227591,0.135602321997,0.20585160038,0.32301462052,0.860942494007,5.39138096492,8.24408193806,9.30286916562,9.59857350806,9.63868448247,9.37501885306,9.04877009026,8.67838577615,8.15266049681,7.69095487447,7.25237612696,6.7813927958,6.36440811776,5.97222946816,5.5740620941,5.09686666484,4.78844542969,4.45125906081,4.10101303621,3.78401887461,3.59551732147,3.24648829811,3.02133575129,2.79797982181,2.56124458123,2.38919526732,2.21814343227,2.03509643247,1.92480376946,1.75344383283,1.60208585076,1.47863994618,1.34684988056,1.2684734602,1.15215895181,1.07270263541,0.997024799753,0.916187803145,0.850068819003,0.781638687886,0.695307469857,0.655451064373,0.607071413812,0.561545169007,0.516228818403,0.478298047792,0.459375604144,0.401015002907,0.39055803529,0.348121125025,0.3154412141,0.303343143419,0.272842126866,0.25098828925,0.242864960024,0.197878855801,0.188877899224,0.173331132023,0.16684332152,0.155117129445,0.130908625506,0.11953520974,0.117909242166,0.103646565323,0.0942557447103,0.0830550969053,0.0814388730433,0.0688014320338,0.0642786163811,0.0622878180235,0.0586837997943,0.0480187095603,0.049113548524,0.0433391087162,0.0408064752179,0.0339427268698,0.0339442519727,0.0315974075782,0.0310651466941,0.019497626933,0.0231147664383,0.0193229602962,0.0211233711339,0.0185970806768,0.0126373524303,0.0135410990916,0.0097496626715,0.0106510793147,0.00975099135956,0.0101098411208,0.00794428754715,0.00541555538512,0.00523548541684,0.00613883154614,0.00433405721987,0.00379327655683,0.00379211770976,0.00360996381942,0.00379246355379,0.00288942514094,0.00324885297774,0.00288929342751,0.00162540528907,0.00162530823708,0.00144453233104,0.00162545805147,0.00144435016599,0.00180611341276,0.00162595216938,0.000903742039831,0.000902174958171,0.00126351109913,0.000542116283388,0.00162293315902,0.000541613692686,0.00108366257885,0.000902798478743,0.000721144098082,0.000361716993024,0.000180614037165,0.000722044910075,0.000541377224723,0.000181235555077,0.000180221323189,0.0,0.000180752990977,0.000180269772162,0.000180822005731])
# Creating a new Canvas
fig = plt.figure(figsize=(12,6),dpi=80)
frame = gridspec.GridSpec(1,1,right=0.7)
pad = fig.add_subplot(frame[0])
# Creating a new Stack
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights+y8_M_12_weights+y8_M_13_weights+y8_M_14_weights+y8_M_15_weights+y8_M_16_weights,\
label="$bg\_dip\_1600\_inf$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#e5e5e5", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights+y8_M_12_weights+y8_M_13_weights+y8_M_14_weights+y8_M_15_weights,\
label="$bg\_dip\_1200\_1600$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#f2f2f2", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights+y8_M_12_weights+y8_M_13_weights+y8_M_14_weights,\
label="$bg\_dip\_800\_1200$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#ccc6aa", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights+y8_M_12_weights+y8_M_13_weights,\
label="$bg\_dip\_600\_800$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#ccc6aa", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights+y8_M_12_weights,\
label="$bg\_dip\_400\_600$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#c1bfa8", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights,\
label="$bg\_dip\_200\_400$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#bab5a3", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights,\
label="$bg\_dip\_100\_200$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#b2a596", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights,\
label="$bg\_dip\_0\_100$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#b7a39b", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights,\
label="$bg\_vbf\_1600\_inf$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#ad998c", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights,\
label="$bg\_vbf\_1200\_1600$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#9b8e82", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights,\
label="$bg\_vbf\_800\_1200$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#876656", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights,\
label="$bg\_vbf\_600\_800$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#afcec6", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights,\
label="$bg\_vbf\_400\_600$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#84c1a3", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights,\
label="$bg\_vbf\_200\_400$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#89a8a0", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights+y8_M_2_weights,\
label="$bg\_vbf\_100\_200$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#829e8c", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights+y8_M_1_weights,\
label="$bg\_vbf\_0\_100$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#adbcc6", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
pad.hist(x=xData, bins=xBinning, weights=y8_M_0_weights,\
label="$signal$", histtype="step", rwidth=1.0,\
color=None, edgecolor="#7a8e99", linewidth=1, linestyle="solid",\
bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical")
# Axis
plt.rc('text',usetex=False)
plt.xlabel(r"M [ j_{1} , j_{2} ] ( GeV ) ",\
fontsize=16,color="black")
plt.ylabel(r"$\mathrm{Events}$ $(\mathcal{L}_{\mathrm{int}} = 40.0\ \mathrm{fb}^{-1})$ ",\
fontsize=16,color="black")
# Boundary of y-axis
ymax=(y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights+y8_M_12_weights+y8_M_13_weights+y8_M_14_weights+y8_M_15_weights+y8_M_16_weights).max()*1.1
ymin=0 # linear scale
#ymin=min([x for x in (y8_M_0_weights+y8_M_1_weights+y8_M_2_weights+y8_M_3_weights+y8_M_4_weights+y8_M_5_weights+y8_M_6_weights+y8_M_7_weights+y8_M_8_weights+y8_M_9_weights+y8_M_10_weights+y8_M_11_weights+y8_M_12_weights+y8_M_13_weights+y8_M_14_weights+y8_M_15_weights+y8_M_16_weights) if x])/100. # log scale
plt.gca().set_ylim(ymin,ymax)
# Log/Linear scale for X-axis
plt.gca().set_xscale("linear")
#plt.gca().set_xscale("log",nonposx="clip")
# Log/Linear scale for Y-axis
plt.gca().set_yscale("linear")
#plt.gca().set_yscale("log",nonposy="clip")
# Legend
plt.legend(bbox_to_anchor=(1.05,1), loc=2, borderaxespad=0.)
# Saving the image
plt.savefig('../../HTML/MadAnalysis5job_0/selection_7.png')
plt.savefig('../../PDF/MadAnalysis5job_0/selection_7.png')
plt.savefig('../../DVI/MadAnalysis5job_0/selection_7.eps')
# Running!
if __name__ == '__main__':
selection_7()
| 238.278351 | 2,622 | 0.807554 | 7,560 | 46,226 | 4.841138 | 0.350265 | 0.064537 | 0.090084 | 0.111806 | 0.194595 | 0.185224 | 0.18036 | 0.171043 | 0.16924 | 0.168502 | 0 | 0.68155 | 0.035846 | 46,226 | 193 | 2,623 | 239.512953 | 0.139626 | 0.027019 | 0 | 0.185841 | 0 | 0.00885 | 0.023208 | 0.00445 | 0 | 0 | 0 | 0 | 0 | 1 | 0.00885 | false | 0 | 0.035398 | 0 | 0.044248 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
a0ad6e56e90608421833f0eb9a2f2deb7aece724 | 176 | py | Python | Linked_Lists/Reverse_a_doubly_lined_list.py | NikolayVaklinov10/Interview_Preparation_Kit | 517c4c7e83a7bcc99a4f570dff6959b5229b1a29 | [
"MIT"
] | null | null | null | Linked_Lists/Reverse_a_doubly_lined_list.py | NikolayVaklinov10/Interview_Preparation_Kit | 517c4c7e83a7bcc99a4f570dff6959b5229b1a29 | [
"MIT"
] | null | null | null | Linked_Lists/Reverse_a_doubly_lined_list.py | NikolayVaklinov10/Interview_Preparation_Kit | 517c4c7e83a7bcc99a4f570dff6959b5229b1a29 | [
"MIT"
] | null | null | null | def Reverse(head):
if not head:
return head
head.next, head.prev = head.prev, head.next
if not head.prev:
return head
return Reverse(head.prev)
| 22 | 47 | 0.619318 | 26 | 176 | 4.192308 | 0.307692 | 0.293578 | 0.165138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.289773 | 176 | 7 | 48 | 25.142857 | 0.872 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
a0b1807059bab4d3e653994341175fe3e5efa35d | 1,850 | py | Python | smp_manifold_learning/data/synthetic/synthetic_noisy_quaternion_dataset_generator.py | gsutanto/smp_manifold_learning | 60ef8278942c784c8d3bcd0a09031475f80d96fb | [
"MIT"
] | 11 | 2020-09-26T12:13:01.000Z | 2022-03-23T07:34:14.000Z | smp_manifold_learning/data/synthetic/synthetic_noisy_quaternion_dataset_generator.py | gsutanto/smp_manifold_learning | 60ef8278942c784c8d3bcd0a09031475f80d96fb | [
"MIT"
] | 1 | 2021-04-10T10:42:28.000Z | 2021-04-16T07:04:26.000Z | smp_manifold_learning/data/synthetic/synthetic_noisy_quaternion_dataset_generator.py | gsutanto/smp_manifold_learning | 60ef8278942c784c8d3bcd0a09031475f80d96fb | [
"MIT"
] | 5 | 2020-09-24T18:52:46.000Z | 2022-03-23T07:26:15.000Z | import numpy as np
def generate_synth_noisy_quat_dataset(N_data=1000000,
rand_seed=38,
sampling_magnitude=50000.0,
dataset_save_path_prefix_name='quaternion_random'):
"""
Generate a (noisy) dataset on a unit quaternion:
"""
np.random.seed(rand_seed)
random_4d_dataset = np.random.uniform(low=-sampling_magnitude,
high=sampling_magnitude,
size=(N_data, 4))
random_quaternion_dataset = (random_4d_dataset/
np.expand_dims(
np.linalg.norm(random_4d_dataset, axis=1),
axis=1))
norm_random_quaternion_dataset = np.linalg.norm(random_quaternion_dataset,
axis=1)
np.save(dataset_save_path_prefix_name+'.npy', random_quaternion_dataset)
noisy_random_quaternion_dataset = (random_quaternion_dataset *
np.expand_dims(
np.fabs(np.random.normal(1.0, 0.5,
N_data)),
axis=1))
norm_noisy_random_quaternion_dataset = np.linalg.norm(
noisy_random_quaternion_dataset,
axis=1)
np.save(dataset_save_path_prefix_name+'_noisy.npy', noisy_random_quaternion_dataset)
np.save(dataset_save_path_prefix_name+'_diff.npy',
random_quaternion_dataset - noisy_random_quaternion_dataset)
return None
if __name__ == '__main__':
generate_synth_noisy_quat_dataset()
| 45.121951 | 89 | 0.509189 | 174 | 1,850 | 4.954023 | 0.287356 | 0.204176 | 0.293503 | 0.162413 | 0.573086 | 0.37935 | 0.298144 | 0.262181 | 0.136891 | 0.136891 | 0 | 0.026341 | 0.425405 | 1,850 | 40 | 90 | 46.25 | 0.784572 | 0.025946 | 0 | 0.2 | 1 | 0 | 0.026876 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.033333 | false | 0 | 0.033333 | 0 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
260684df0c67042c1c9c18118063a6f29765e982 | 238 | py | Python | programme/tasks.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | programme/tasks.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | programme/tasks.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | from celery import shared_task
@shared_task(ignore_result=True)
def programme_apply_state_async(programme_pk):
from .models import Programme
programme = Programme.objects.get(pk=programme_pk)
programme._apply_state_async()
| 23.8 | 54 | 0.802521 | 32 | 238 | 5.625 | 0.53125 | 0.111111 | 0.211111 | 0.266667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12605 | 238 | 9 | 55 | 26.444444 | 0.865385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
26530bf4dc728709bda11542b41eb6b09fba9d2c | 58 | py | Python | view/modes/__init__.py | jlchamaa/wf-cli | bd4271ffa457fa9fbbbdfd7f908f8580b0a7283d | [
"MIT"
] | null | null | null | view/modes/__init__.py | jlchamaa/wf-cli | bd4271ffa457fa9fbbbdfd7f908f8580b0a7283d | [
"MIT"
] | null | null | null | view/modes/__init__.py | jlchamaa/wf-cli | bd4271ffa457fa9fbbbdfd7f908f8580b0a7283d | [
"MIT"
] | null | null | null | from .normal import NormalMode
from .edit import EditMode
| 19.333333 | 30 | 0.827586 | 8 | 58 | 6 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 58 | 2 | 31 | 29 | 0.96 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
26653179eb20a92cd71527de72ec803a6e29d370 | 72 | py | Python | mysign_app/routes/__init__.py | mindhashnl/roomsignage | 7508a14f0d350bad874f69ae75044baa87267cbe | [
"MIT"
] | null | null | null | mysign_app/routes/__init__.py | mindhashnl/roomsignage | 7508a14f0d350bad874f69ae75044baa87267cbe | [
"MIT"
] | 11 | 2020-06-06T00:27:01.000Z | 2022-02-10T09:38:26.000Z | mysign_app/routes/__init__.py | mindhashnl/roomsignage | 7508a14f0d350bad874f69ae75044baa87267cbe | [
"MIT"
] | null | null | null | from .screen import index as screen_index
__all__ = ['screen_index', ]
| 18 | 41 | 0.75 | 10 | 72 | 4.8 | 0.6 | 0.458333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152778 | 72 | 3 | 42 | 24 | 0.786885 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 4 |
2677ca5a2aa26f2fca3bc248b22e0ae047142210 | 19 | py | Python | boneless/__init__.py | jakeelkins/boneless | 7b94c1ed15687ea219fad1c1bbab0a956e1cec44 | [
"MIT"
] | 2 | 2019-09-09T18:38:11.000Z | 2019-09-10T01:36:05.000Z | boneless/__init__.py | jakeelkins/boneless | 7b94c1ed15687ea219fad1c1bbab0a956e1cec44 | [
"MIT"
] | null | null | null | boneless/__init__.py | jakeelkins/boneless | 7b94c1ed15687ea219fad1c1bbab0a956e1cec44 | [
"MIT"
] | null | null | null | name = 'boneless'
| 9.5 | 18 | 0.631579 | 3 | 19 | 4.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157895 | 19 | 1 | 19 | 19 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
26785d0d535b6a776418ab7c4cee741f7d86ee16 | 92 | py | Python | cms_perf/__main__.py | maxfischer2781/cms_perf | 193128dbf46d334485a02bdeec2638764afae4c7 | [
"MIT"
] | null | null | null | cms_perf/__main__.py | maxfischer2781/cms_perf | 193128dbf46d334485a02bdeec2638764afae4c7 | [
"MIT"
] | 8 | 2020-07-14T14:01:27.000Z | 2020-08-24T15:25:04.000Z | cms_perf/__main__.py | maxfischer2781/cms_perf | 193128dbf46d334485a02bdeec2638764afae4c7 | [
"MIT"
] | null | null | null | """This is executed by `python -m cms_perf` and similar"""
from .report import main
main()
| 18.4 | 58 | 0.706522 | 15 | 92 | 4.266667 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.163043 | 92 | 4 | 59 | 23 | 0.831169 | 0.565217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
cd0276b8bc3e4d504a5bf937baf723ce3104465d | 598 | py | Python | tests/unit/assets/fund.py | amaas-fintech/amaas-core-sdk-python | bd77884de6e5ab05d864638addeb4bb338a51183 | [
"Apache-2.0"
] | null | null | null | tests/unit/assets/fund.py | amaas-fintech/amaas-core-sdk-python | bd77884de6e5ab05d864638addeb4bb338a51183 | [
"Apache-2.0"
] | 8 | 2017-06-06T09:42:41.000Z | 2018-01-16T10:16:16.000Z | tests/unit/assets/fund.py | amaas-fintech/amaas-core-sdk-python | bd77884de6e5ab05d864638addeb4bb338a51183 | [
"Apache-2.0"
] | 8 | 2017-01-18T04:14:01.000Z | 2017-12-01T08:03:10.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from decimal import Decimal
import unittest
from amaascore.assets.fund import Fund
from amaascore.tools.generate_asset import generate_fund
class FundTest(unittest.TestCase):
def setUp(self):
self.longMessage = True # Print complete error message on failure
self.fund = generate_fund()
self.asset_id = self.fund.asset_id
def tearDown(self):
pass
def test_Fund(self):
self.assertEqual(type(self.fund), Fund)
if __name__ == '__main__':
unittest.main()
| 23.92 | 82 | 0.725753 | 76 | 598 | 5.434211 | 0.513158 | 0.058111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197324 | 598 | 24 | 83 | 24.916667 | 0.860417 | 0.065217 | 0 | 0 | 1 | 0 | 0.014363 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 1 | 0.1875 | false | 0.0625 | 0.3125 | 0 | 0.5625 | 0.0625 | 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 | 1 | 0 | 1 | 0 | 0 | 4 |
cd48d49ce60fc7f8ae1188a53304e6b1649236b6 | 186 | py | Python | venv/bin/django-admin.py | Maxcutex/waitressappv2 | ecc237015f152c61208fc1355195afe183a6e7bb | [
"MIT"
] | null | null | null | venv/bin/django-admin.py | Maxcutex/waitressappv2 | ecc237015f152c61208fc1355195afe183a6e7bb | [
"MIT"
] | null | null | null | venv/bin/django-admin.py | Maxcutex/waitressappv2 | ecc237015f152c61208fc1355195afe183a6e7bb | [
"MIT"
] | null | null | null | #!/Users/andeladeveloper/Projects/Python/AndelaEats/waitress/venv/bin/python2.7
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 31 | 79 | 0.806452 | 23 | 186 | 6.043478 | 0.913043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011696 | 0.080645 | 186 | 5 | 80 | 37.2 | 0.80117 | 0.419355 | 0 | 0 | 0 | 0 | 0.074766 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
cd651230f141a4db606dbb166e86752e274cee10 | 157 | py | Python | frequentlyasked/urls.py | Pesenin-Team/pesenin-2.0 | 883468e6b6d7e3a24bc2ee60bbc7063117745424 | [
"MIT"
] | null | null | null | frequentlyasked/urls.py | Pesenin-Team/pesenin-2.0 | 883468e6b6d7e3a24bc2ee60bbc7063117745424 | [
"MIT"
] | null | null | null | frequentlyasked/urls.py | Pesenin-Team/pesenin-2.0 | 883468e6b6d7e3a24bc2ee60bbc7063117745424 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'frequentlyasked'
urlpatterns = [
path('', views.frequentlyasked, name='frequentlyasked')
] | 19.625 | 59 | 0.738854 | 17 | 157 | 6.764706 | 0.588235 | 0.330435 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.146497 | 157 | 8 | 60 | 19.625 | 0.858209 | 0 | 0 | 0 | 0 | 0 | 0.189873 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
cd7003a472e195bbd5ef3165324086a2be4ccb89 | 298 | py | Python | pagral/graph/attribute.py | mazzalab/pagral | c824ca453591a135716b59958d4f8b5f985b77cb | [
"MIT"
] | null | null | null | pagral/graph/attribute.py | mazzalab/pagral | c824ca453591a135716b59958d4f8b5f985b77cb | [
"MIT"
] | null | null | null | pagral/graph/attribute.py | mazzalab/pagral | c824ca453591a135716b59958d4f8b5f985b77cb | [
"MIT"
] | null | null | null | class Attribute:
def __init__(self):
self.__attr = {}
def __getitem__(self, attr_key):
return self.__attr[attr_key]
def __setitem__(self, attr_key, attr_value):
self.__attr[attr_key] = attr_value
def get_attributes_names(self):
self.__attr.keys()
| 22.923077 | 48 | 0.651007 | 38 | 298 | 4.368421 | 0.394737 | 0.289157 | 0.144578 | 0.180723 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.244966 | 298 | 12 | 49 | 24.833333 | 0.737778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.444444 | false | 0 | 0 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 4 |
cd7aae402e42c02dc864055bc9334ee038fdb42b | 217 | py | Python | Zad_Strategia/PodatekPolska.py | Paarzivall/Wzorce-Projektowe | aa4136f140ad02c0fc0de45709b5a01ca42b417f | [
"MIT"
] | null | null | null | Zad_Strategia/PodatekPolska.py | Paarzivall/Wzorce-Projektowe | aa4136f140ad02c0fc0de45709b5a01ca42b417f | [
"MIT"
] | null | null | null | Zad_Strategia/PodatekPolska.py | Paarzivall/Wzorce-Projektowe | aa4136f140ad02c0fc0de45709b5a01ca42b417f | [
"MIT"
] | null | null | null | from ObliczPodatek import ObliczPodatek
class PodatekPolska(ObliczPodatek):
def __init__(self):
self.VAT = 0.23
def kwotaPodatku(self, ilosc, cena):
return ilosc * (cena + (cena * self.VAT)) | 24.111111 | 49 | 0.672811 | 25 | 217 | 5.68 | 0.6 | 0.098592 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017857 | 0.225806 | 217 | 9 | 49 | 24.111111 | 0.827381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.166667 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 4 |
cd8807692e564a264a96e5af10e5127f8cbb1935 | 108 | py | Python | py_tdlib/constructors/supergroup_members_filter_restricted.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/supergroup_members_filter_restricted.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/supergroup_members_filter_restricted.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Type
class supergroupMembersFilterRestricted(Type):
query = None # type: "string"
| 18 | 46 | 0.759259 | 11 | 108 | 7.454545 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 108 | 5 | 47 | 21.6 | 0.891304 | 0.12963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
26a5c7fb940145c44e6ed3c54956b00c82b7966f | 274 | py | Python | Ekeopara_Praise/Phase 1/Python Basic 1/Day10 Tasks/Task7.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Ekeopara_Praise/Phase 1/Python Basic 1/Day10 Tasks/Task7.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Ekeopara_Praise/Phase 1/Python Basic 1/Day10 Tasks/Task7.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | '''7. Write a Python program to get the size of a file.'''
import os
file_size = os.path.getsize('c:/Users/Sir_Praise/Documents/python-challenges-solutions/Ekeopara_Praise/Phase 1/Python Basic 1/Day10 Tasks/Task3.py')
print('\nThe size of abc.txt is : ', file_size, 'Bytes') | 68.5 | 148 | 0.751825 | 48 | 274 | 4.208333 | 0.75 | 0.059406 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02449 | 0.105839 | 274 | 4 | 149 | 68.5 | 0.8 | 0.189781 | 0 | 0 | 0 | 0.333333 | 0.686636 | 0.364055 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 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 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
26aefa271f54640c4c088758474d573cb1eabc66 | 296 | py | Python | db/default_data/dados_buddies.py | LeandroLFE/capmon | 9d1200301628ea4fec0e8ed09d5e9b67a426d923 | [
"MIT"
] | null | null | null | db/default_data/dados_buddies.py | LeandroLFE/capmon | 9d1200301628ea4fec0e8ed09d5e9b67a426d923 | [
"MIT"
] | null | null | null | db/default_data/dados_buddies.py | LeandroLFE/capmon | 9d1200301628ea4fec0e8ed09d5e9b67a426d923 | [
"MIT"
] | null | null | null | from db.default_data.default_create_table_with_underline_structure import default_create_table_structure_buddies
script_create_table_buddies = lambda dados = {} : f"""
DROP TABLE IF EXISTS Buddies;
CREATE TABLE Buddies (
{default_create_table_structure_buddies()}
);
""" | 32.888889 | 112 | 0.763514 | 36 | 296 | 5.805556 | 0.5 | 0.263158 | 0.258373 | 0.258373 | 0.325359 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165541 | 296 | 9 | 113 | 32.888889 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0.420875 | 0.141414 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
26c3026bfbcfcf7ef95bbb2b496e25f6e33094a8 | 305 | py | Python | app/api/v1/api.py | VangelisTsiatouras/311-chicago-incidents-nosql | f03ba8c3bacfc66a29ba8cfac7f7db537b22d1f3 | [
"MIT"
] | 2 | 2020-12-31T16:55:20.000Z | 2021-01-10T21:02:03.000Z | app/api/v1/api.py | VangelisTsiatouras/311-chicago-incidents-nosql | f03ba8c3bacfc66a29ba8cfac7f7db537b22d1f3 | [
"MIT"
] | null | null | null | app/api/v1/api.py | VangelisTsiatouras/311-chicago-incidents-nosql | f03ba8c3bacfc66a29ba8cfac7f7db537b22d1f3 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from app.api.v1.endpoints import queries, incidents, citizens
api_router = APIRouter()
api_router.include_router(queries.router, tags=['queries'])
api_router.include_router(incidents.router, tags=['incidents'])
api_router.include_router(citizens.router, tags=['citizens'])
| 33.888889 | 63 | 0.806557 | 40 | 305 | 5.975 | 0.35 | 0.150628 | 0.200837 | 0.276151 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003521 | 0.068852 | 305 | 8 | 64 | 38.125 | 0.838028 | 0 | 0 | 0 | 0 | 0 | 0.078689 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
26e0467192d5959f8fe801cc55601b0aab877f08 | 212 | py | Python | neural-architecture-search/utils.py | volodymyrlut/masters-project | d725f5d0f4d623e024bd0835f1c611b719fef93f | [
"MIT"
] | null | null | null | neural-architecture-search/utils.py | volodymyrlut/masters-project | d725f5d0f4d623e024bd0835f1c611b719fef93f | [
"MIT"
] | 8 | 2020-09-26T01:06:18.000Z | 2022-03-12T00:30:45.000Z | neural-architecture-search/utils.py | volodymyrlut/masters-project | d725f5d0f4d623e024bd0835f1c611b719fef93f | [
"MIT"
] | null | null | null | import hashlib
import json
from datetime import datetime
def timestamp():
now = datetime.now()
timestamp = datetime.timestamp(now)
return timestamp
def calculate_hash(cell):
return hash(json.dumps(cell)) | 19.272727 | 36 | 0.768868 | 28 | 212 | 5.785714 | 0.464286 | 0.148148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141509 | 212 | 11 | 37 | 19.272727 | 0.89011 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0.111111 | 0.777778 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 4 |
26fdd9b049e69b6d399a686bc86dbf96ff862862 | 1,000 | py | Python | src/015-lattice-paths/python/test/test_solver.py | xfbs/ProjectEulerRust | e26768c56ff87b029cb2a02f56dc5cd32e1f7c87 | [
"MIT"
] | 1 | 2018-01-26T21:18:12.000Z | 2018-01-26T21:18:12.000Z | src/015-lattice-paths/python/test/test_solver.py | xfbs/ProjectEulerRust | e26768c56ff87b029cb2a02f56dc5cd32e1f7c87 | [
"MIT"
] | 3 | 2017-12-09T14:49:30.000Z | 2017-12-09T14:59:39.000Z | src/015-lattice-paths/python/test/test_solver.py | xfbs/ProjectEulerRust | e26768c56ff87b029cb2a02f56dc5cd32e1f7c87 | [
"MIT"
] | null | null | null | import unittest
import solver
class TestSolution(unittest.TestCase):
def test_solve(self):
self.assertEqual(solver.solve(4), 70)
def test_collatz(self):
c = solver.LatticePaths(12, 12)
self.assertEqual(c.count(0, 1), 1)
self.assertEqual(c.count(0, 5), 1)
self.assertEqual(c.count(9, 0), 1)
self.assertEqual(c.count(7, 0), 1)
self.assertEqual(c.count(2, 0), 1)
self.assertEqual(c.count(1, 1), 2)
self.assertEqual(c.count(1, 5), 6)
self.assertEqual(c.count(9, 1), 10)
self.assertEqual(c.count(7, 1), 8)
self.assertEqual(c.count(2, 1), 3)
self.assertEqual(c.count(2, 2), 6)
self.assertEqual(c.count(2, 3), 10)
self.assertEqual(c.count(3, 2), 10)
self.assertEqual(c.count(5, 3), 56)
self.assertEqual(c.count(4, 4), 70)
self.assertEqual(c.count(4, 6), 210)
self.assertEqual(c.count(5, 5), 252)
self.assertEqual(c.count(8, 4), 495)
self.assertEqual(c.count(5, 7), 792)
| 31.25 | 43 | 0.616 | 160 | 1,000 | 3.8375 | 0.20625 | 0.488599 | 0.495114 | 0.649837 | 0.669381 | 0.112378 | 0 | 0 | 0 | 0 | 0 | 0.097468 | 0.21 | 1,000 | 31 | 44 | 32.258065 | 0.679747 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.769231 | 1 | 0.076923 | false | 0 | 0.076923 | 0 | 0.192308 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f8446517c6a1ce85a2ff418ae078cfdac7da8c1b | 56 | py | Python | pathfinder/__init__.py | MichaelCurrin/path-finder | fd79ef00fb1f71007ab79d76cf651e9157f84fbb | [
"MIT"
] | 1 | 2019-08-16T03:13:41.000Z | 2019-08-16T03:13:41.000Z | pathfinder/__init__.py | MichaelCurrin/path-finder | fd79ef00fb1f71007ab79d76cf651e9157f84fbb | [
"MIT"
] | 3 | 2018-01-18T11:35:01.000Z | 2018-01-18T11:35:19.000Z | pathfinder/__init__.py | MichaelCurrin/path-finder | fd79ef00fb1f71007ab79d76cf651e9157f84fbb | [
"MIT"
] | null | null | null | """Initialisation file for pathfinder app directory."""
| 28 | 55 | 0.767857 | 6 | 56 | 7.166667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107143 | 56 | 1 | 56 | 56 | 0.86 | 0.875 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f84836e1a1238ef0226dc690ff5d94f11790af01 | 371 | py | Python | src/dictionaries.py | getsadzeg/python-codes | cd31412e34648c8bdb52299a770c41bf95bc2bf8 | [
"MIT"
] | 2 | 2016-01-18T20:54:21.000Z | 2016-09-29T18:33:38.000Z | src/dictionaries.py | getsadzeg/python-codes | cd31412e34648c8bdb52299a770c41bf95bc2bf8 | [
"MIT"
] | null | null | null | src/dictionaries.py | getsadzeg/python-codes | cd31412e34648c8bdb52299a770c41bf95bc2bf8 | [
"MIT"
] | null | null | null | personinfo = {'Name': 'John', 'Surname': 'Reese', 'Occupation': 'Killer'};
personinfo['Occupation'] = "Agent"; # Update
personinfo['Employer'] = "Harold Finch"; # Add
print personinfo['Name']
print "personinfo keys:", personinfo.keys();
print "personinfo values:", personinfo.values();
personinfo.clear();
print "personinfo's length after clearing:", len(personinfo);
| 33.727273 | 74 | 0.703504 | 39 | 371 | 6.692308 | 0.564103 | 0.229885 | 0.199234 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105121 | 371 | 10 | 75 | 37.1 | 0.786145 | 0.02965 | 0 | 0 | 0 | 0 | 0.405634 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.5 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
f8804113ee4ec8984da421d69e845bbfc8c19f07 | 72 | py | Python | decrement or increment.py | Tanuka-Mondal/Competi | b244ade867862b4e33e63dabd2cdd136340c0bf8 | [
"MIT"
] | 1 | 2021-09-08T05:36:48.000Z | 2021-09-08T05:36:48.000Z | decrement or increment.py | Tanuka-Mondal/Competi | b244ade867862b4e33e63dabd2cdd136340c0bf8 | [
"MIT"
] | null | null | null | decrement or increment.py | Tanuka-Mondal/Competi | b244ade867862b4e33e63dabd2cdd136340c0bf8 | [
"MIT"
] | null | null | null | n = int(input())
if(n%4 == 0):
print(n+1)
else:
print(n-1)
| 10.285714 | 16 | 0.444444 | 14 | 72 | 2.285714 | 0.642857 | 0.375 | 0.4375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08 | 0.305556 | 72 | 6 | 17 | 12 | 0.56 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f8b9ad3e904a1ce6ecd69e77772a514226e6e47b | 40 | py | Python | ploo/real_book_tunes.py | MRGRAVITY817/ploo | 4cbb754a5600747f391c82732a1983d39de6bac9 | [
"MIT"
] | null | null | null | ploo/real_book_tunes.py | MRGRAVITY817/ploo | 4cbb754a5600747f391c82732a1983d39de6bac9 | [
"MIT"
] | null | null | null | ploo/real_book_tunes.py | MRGRAVITY817/ploo | 4cbb754a5600747f391c82732a1983d39de6bac9 | [
"MIT"
] | null | null | null | import json
alice_in_wonder_land = {
} | 8 | 24 | 0.75 | 6 | 40 | 4.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175 | 40 | 5 | 25 | 8 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 4 |
f8bb5c057a6d69df3d3303cc9fdea1b6d1cb80ba | 1,350 | py | Python | seven23/models/stats/migrations/0001_initial.py | niwo/seven23_server | f97c26e38908a6a7900024d1ea8af3422858ed30 | [
"MIT"
] | null | null | null | seven23/models/stats/migrations/0001_initial.py | niwo/seven23_server | f97c26e38908a6a7900024d1ea8af3422858ed30 | [
"MIT"
] | 1 | 2019-07-30T08:23:15.000Z | 2019-07-30T17:02:49.000Z | seven23/models/stats/migrations/0001_initial.py | niwo/seven23_server | f97c26e38908a6a7900024d1ea8af3422858ed30 | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2019-03-09 06:20
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='DailyActiveUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('year', models.IntegerField(default=2019, editable=False, verbose_name='Year')),
('month', models.IntegerField(default=3, editable=False, verbose_name='Month')),
('day', models.IntegerField(default=9, editable=False, verbose_name='Day')),
('counter', models.IntegerField(default=0, editable=False, verbose_name='Counter')),
],
),
migrations.CreateModel(
name='MonthlyActiveUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('year', models.IntegerField(default=2019, editable=False, verbose_name='Year')),
('month', models.IntegerField(default=3, editable=False, verbose_name='Month')),
('counter', models.IntegerField(default=0, editable=False, verbose_name='Counter')),
],
),
]
| 39.705882 | 114 | 0.601481 | 133 | 1,350 | 6.007519 | 0.345865 | 0.135169 | 0.180225 | 0.210263 | 0.660826 | 0.660826 | 0.660826 | 0.660826 | 0.660826 | 0.660826 | 0 | 0.026946 | 0.257778 | 1,350 | 33 | 115 | 40.909091 | 0.770459 | 0.031852 | 0 | 0.615385 | 1 | 0 | 0.084291 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.038462 | 0 | 0.192308 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 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 | 4 |
f8bb81be402cb2ebf693b83f8031b0d7cc48d6fd | 296 | py | Python | Incident-Response/Tools/dfirtrack/dfirtrack_artifacts/admin.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_artifacts/admin.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_artifacts/admin.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | from django.contrib import admin
from dfirtrack_artifacts.models import Artifact, Artifactpriority, Artifactstatus, Artifacttype
# Register your models here.
admin.site.register(Artifact)
admin.site.register(Artifactpriority)
admin.site.register(Artifactstatus)
admin.site.register(Artifacttype)
| 37 | 95 | 0.85473 | 34 | 296 | 7.411765 | 0.470588 | 0.142857 | 0.269841 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067568 | 296 | 7 | 96 | 42.285714 | 0.913043 | 0.087838 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
3e3363a28c884cd59d2992204ba2bbb19ce35376 | 54 | py | Python | tests/models.py | JamesRitchie/django-rest-framework-session-endpoint | a968129be88a1981d9904c3679e5fdd9490e890d | [
"BSD-2-Clause"
] | 21 | 2015-03-04T09:25:47.000Z | 2019-11-08T14:19:24.000Z | tests/models.py | JamesRitchie/django-rest-framework-session-endpoint | a968129be88a1981d9904c3679e5fdd9490e890d | [
"BSD-2-Clause"
] | 1 | 2015-03-04T09:26:17.000Z | 2015-03-11T13:10:20.000Z | tests/models.py | JamesRitchie/django-rest-framework-session-endpoint | a968129be88a1981d9904c3679e5fdd9490e890d | [
"BSD-2-Clause"
] | 1 | 2020-05-17T04:16:27.000Z | 2020-05-17T04:16:27.000Z | """Blank file required to run tests on Django 1.4."""
| 27 | 53 | 0.685185 | 10 | 54 | 3.7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044444 | 0.166667 | 54 | 1 | 54 | 54 | 0.777778 | 0.87037 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
3e69d1eaf9701ceeff1155290dacd214bc48ac73 | 134 | py | Python | CodeArena/hello.py | SaberSz/WeByte | 3f88d572990b8342d2f28065fbb1d092449bf0ea | [
"MIT"
] | null | null | null | CodeArena/hello.py | SaberSz/WeByte | 3f88d572990b8342d2f28065fbb1d092449bf0ea | [
"MIT"
] | null | null | null | CodeArena/hello.py | SaberSz/WeByte | 3f88d572990b8342d2f28065fbb1d092449bf0ea | [
"MIT"
] | null | null | null | a = input().split()
print(a)
for i in a:
print(i)
print("\nlook heres the output\n")
b = input().split()
for i in b:
print(i)
| 14.888889 | 34 | 0.589552 | 26 | 134 | 3.038462 | 0.5 | 0.253165 | 0.151899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216418 | 134 | 8 | 35 | 16.75 | 0.752381 | 0 | 0 | 0.25 | 0 | 0 | 0.186567 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
e44937e13d8b45578c75da5bfa7eee47e5fcbb88 | 91 | py | Python | agro_site/agroblog/apps.py | LukoninDmitryPy/agro_site-2 | eab7694d42104774e5ce6db05a79f11215db6ae3 | [
"MIT"
] | null | null | null | agro_site/agroblog/apps.py | LukoninDmitryPy/agro_site-2 | eab7694d42104774e5ce6db05a79f11215db6ae3 | [
"MIT"
] | null | null | null | agro_site/agroblog/apps.py | LukoninDmitryPy/agro_site-2 | eab7694d42104774e5ce6db05a79f11215db6ae3 | [
"MIT"
] | 1 | 2022-03-13T11:32:48.000Z | 2022-03-13T11:32:48.000Z | from django.apps import AppConfig
class AgroblogConfig(AppConfig):
name = 'agroblog'
| 15.166667 | 33 | 0.758242 | 10 | 91 | 6.9 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164835 | 91 | 5 | 34 | 18.2 | 0.907895 | 0 | 0 | 0 | 0 | 0 | 0.087912 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
e4727f0e6870efbd102956d5a4279b733fe867a0 | 225 | py | Python | example/example/routes.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | example/example/routes.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | example/example/routes.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | from mvc.router import Router
Router.get('/', 'HomeController@index')
Router.get('/profile/<username>', 'ProfileController@show')
Router.get('/contact', 'Contact@index')
Router.get('/auth/signup', 'RegisterController@form')
| 32.142857 | 59 | 0.742222 | 26 | 225 | 6.423077 | 0.615385 | 0.215569 | 0.167665 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057778 | 225 | 6 | 60 | 37.5 | 0.787736 | 0 | 0 | 0 | 0 | 0 | 0.524444 | 0.2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e4bdbeef9824e566949f7f6d4bd53af264666231 | 409 | py | Python | bandits/normal.py | XiaoMutt/ucbc | f8aeb65dc5a11ecd82fd969d120f3a848d61c064 | [
"MIT"
] | null | null | null | bandits/normal.py | XiaoMutt/ucbc | f8aeb65dc5a11ecd82fd969d120f3a848d61c064 | [
"MIT"
] | null | null | null | bandits/normal.py | XiaoMutt/ucbc | f8aeb65dc5a11ecd82fd969d120f3a848d61c064 | [
"MIT"
] | null | null | null | from .basis import Bandit
import numpy as np
class NormalBandit(Bandit):
def __init__(self, thetas: list):
self.thetas = thetas
self._narms = len(self.thetas)
self._qstar = max(theta[0] for theta in self.thetas)
def reward(self, action):
return np.random.normal(*self.thetas[action])
def regret(self, action):
return self.Qstar - self.thetas[action][0]
| 25.5625 | 60 | 0.655257 | 56 | 409 | 4.678571 | 0.5 | 0.229008 | 0.122137 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006369 | 0.232274 | 409 | 15 | 61 | 27.266667 | 0.828025 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.181818 | 0.181818 | 0.727273 | 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 | 1 | 1 | 0 | 0 | 4 |
e4dea4f52d0e175b433830b3901e62afd1973263 | 180 | py | Python | src/test/datascience/serverConfigFiles/remoteNoAuth.py | ChaseKnowlden/vscode-jupyter | 9bdaf87f0b6dcd717c508e9023350499a6093f97 | [
"MIT"
] | 615 | 2020-11-11T22:55:28.000Z | 2022-03-30T21:48:08.000Z | src/test/datascience/serverConfigFiles/remoteNoAuth.py | ChaseKnowlden/vscode-jupyter | 9bdaf87f0b6dcd717c508e9023350499a6093f97 | [
"MIT"
] | 8,428 | 2020-11-11T22:06:43.000Z | 2022-03-31T23:42:34.000Z | src/test/datascience/serverConfigFiles/remoteNoAuth.py | ChaseKnowlden/vscode-jupyter | 9bdaf87f0b6dcd717c508e9023350499a6093f97 | [
"MIT"
] | 158 | 2020-11-12T07:49:02.000Z | 2022-03-27T20:50:20.000Z | # With these settings you can connect to a server with no token and no password
c.NotebookApp.token = ''
c.NotebookApp.open_browser = False
c.NotebookApp.disable_check_xsrf = True | 45 | 79 | 0.794444 | 29 | 180 | 4.827586 | 0.758621 | 0.257143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138889 | 180 | 4 | 80 | 45 | 0.903226 | 0.427778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
901d839400134a929cc48b1941f993e9eac06d6d | 850 | py | Python | specs/merge/suffix.py | ultratwo/eth2.0-specs | e4b5be67dd362619eb68e8173cf37183e7fe04e4 | [
"CC0-1.0"
] | null | null | null | specs/merge/suffix.py | ultratwo/eth2.0-specs | e4b5be67dd362619eb68e8173cf37183e7fe04e4 | [
"CC0-1.0"
] | null | null | null | specs/merge/suffix.py | ultratwo/eth2.0-specs | e4b5be67dd362619eb68e8173cf37183e7fe04e4 | [
"CC0-1.0"
] | null | null | null | ExecutionState = Any
def get_pow_block(hash: Bytes32) -> PowBlock:
return PowBlock(block_hash=hash, is_valid=True, is_processed=True,
total_difficulty=uint256(0), difficulty=uint256(0))
def get_execution_state(execution_state_root: Bytes32) -> ExecutionState:
pass
def get_pow_chain_head() -> PowBlock:
pass
class NoopExecutionEngine(ExecutionEngine):
def on_payload(self, execution_payload: ExecutionPayload) -> bool:
return True
def set_head(self, block_hash: Hash32) -> bool:
return True
def finalize_block(self, block_hash: Hash32) -> bool:
return True
def assemble_block(self, block_hash: Hash32, timestamp: uint64, random: Bytes32) -> ExecutionPayload:
raise NotImplementedError("no default block production")
EXECUTION_ENGINE = NoopExecutionEngine()
| 26.5625 | 105 | 0.721176 | 98 | 850 | 6.030612 | 0.459184 | 0.076142 | 0.071066 | 0.086294 | 0.170897 | 0.121827 | 0.121827 | 0.121827 | 0 | 0 | 0 | 0.031977 | 0.190588 | 850 | 31 | 106 | 27.419355 | 0.827035 | 0 | 0 | 0.277778 | 0 | 0 | 0.031765 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.388889 | false | 0.111111 | 0 | 0.222222 | 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 | 1 | 1 | 0 | 0 | 4 |
5f6de640ac9c7ffd73a9508d7679ae20329d3133 | 820 | py | Python | informatiom/day07_macro.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | informatiom/day07_macro.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | informatiom/day07_macro.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
return "hello python!!!"
@app.route("/demo1")
# 宏
def demo1():
my_srt="宏的使用!"
return render_template('day07_macro.html',my_srt=my_srt)
# 继承
@app.route('/demo2')
def demo2():
my_srt="继承的使用!"
return render_template('day08_extend.html',my_srt=my_srt)
# 抽取模版
@app.route('/news_index')
def demo3():
return render_template('index.html')
# 抽取模版
@app.route('/news_detail')
def demo4():
return render_template('detail.html')
# 包含
@app.route('/demo5')
def demo5():
my_srt="包含的使用"
return render_template('day09_include.html',my_srt=my_srt)
if __name__ == '__main__':
# app.run(host='192.168.1.6',port='5000',debug=True)
app.run(debug=True) | 19.52381 | 62 | 0.665854 | 122 | 820 | 4.213115 | 0.442623 | 0.087549 | 0.194553 | 0.064202 | 0.081712 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038516 | 0.145122 | 820 | 42 | 63 | 19.52381 | 0.694722 | 0.135366 | 0 | 0 | 0 | 0 | 0.21826 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.24 | false | 0 | 0.04 | 0.12 | 0.52 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
5fb885b56fa9143e796acd262bd8db1935ae1ae9 | 99 | py | Python | plugin/src/test/resources/refactoring/extractmethod/DuplicateSingleLine.after.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | null | null | null | plugin/src/test/resources/refactoring/extractmethod/DuplicateSingleLine.after.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | 11 | 2017-02-27T22:35:32.000Z | 2021-12-24T08:07:40.000Z | plugin/src/test/resources/refactoring/extractmethod/DuplicateSingleLine.after.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | null | null | null | def foo():
a = 1
return a
def bar():
a = foo()
print a
a = foo()
print a
| 9 | 13 | 0.414141 | 16 | 99 | 2.5625 | 0.4375 | 0.195122 | 0.439024 | 0.487805 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018519 | 0.454545 | 99 | 10 | 14 | 9.9 | 0.740741 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.25 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
397e34ebc62565273dd1980523d12a63c9a9d0ac | 183 | py | Python | tests/unit/output/test_ssh.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | 3 | 2020-01-31T05:33:14.000Z | 2021-05-20T08:19:25.000Z | tests/unit/output/test_ssh.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | null | null | null | tests/unit/output/test_ssh.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | 1 | 2019-12-01T07:43:48.000Z | 2019-12-01T07:43:48.000Z | from dvc.output.ssh import OutputSSH
from tests.unit.output.test_local import TestOutputLOCAL
class TestOutputSSH(TestOutputLOCAL):
def _get_cls(self):
return OutputSSH
| 22.875 | 56 | 0.786885 | 23 | 183 | 6.130435 | 0.782609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153005 | 183 | 7 | 57 | 26.142857 | 0.909677 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0.2 | 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 | 1 | 0 | 0 | 0 | 4 |
399b3164aa89ed08f15e1338945cb29f85e82b62 | 158 | py | Python | examples/miniapps/bundles/bundles/users/entities.py | kinow/python-dependency-injector | ebd98bebe9a8fc0b57e68cfc12c4979833baa6a5 | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/bundles/bundles/users/entities.py | kinow/python-dependency-injector | ebd98bebe9a8fc0b57e68cfc12c4979833baa6a5 | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/bundles/bundles/users/entities.py | kinow/python-dependency-injector | ebd98bebe9a8fc0b57e68cfc12c4979833baa6a5 | [
"BSD-3-Clause"
] | null | null | null | """Users bundle entities module."""
class User:
"""User entity."""
def __init__(self, id):
"""Initialize instance."""
self.id = id
| 15.8 | 35 | 0.550633 | 17 | 158 | 4.882353 | 0.764706 | 0.144578 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.272152 | 158 | 9 | 36 | 17.555556 | 0.721739 | 0.398734 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.