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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8d908b560f3ea402a52cf0b2d3361aec7cd9c64c | 380 | py | Python | ex12.py | BjornChrisnach/Learn_python_3_The_hard_way | ab187c4755d4878724761bbe5f28678fce27cfc7 | [
"MIT"
] | null | null | null | ex12.py | BjornChrisnach/Learn_python_3_The_hard_way | ab187c4755d4878724761bbe5f28678fce27cfc7 | [
"MIT"
] | null | null | null | ex12.py | BjornChrisnach/Learn_python_3_The_hard_way | ab187c4755d4878724761bbe5f28678fce27cfc7 | [
"MIT"
] | null | null | null | # store the input from the user into age
age = input("How old are you? ")
# store the input from the user into height
height = input(f"You're {age}? Nice. How tall are you? ")
# store the input from the user into weight
weight = input("How much do you weigh? ")
# print the f-string with the age, height and weight
print(f"So you're {age} old. {height} tall and {weight} heavy.") | 42.222222 | 64 | 0.702632 | 70 | 380 | 3.814286 | 0.371429 | 0.089888 | 0.146067 | 0.191011 | 0.359551 | 0.359551 | 0.359551 | 0.254682 | 0.254682 | 0 | 0 | 0 | 0.186842 | 380 | 9 | 64 | 42.222222 | 0.864078 | 0.455263 | 0 | 0 | 0 | 0 | 0.650246 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8d9c963d152fdb2f5e9ffccc8d9bf3fae55f3c6d | 39 | py | Python | backend/src/config.py | Rutvij-1/ASeniorIsAsking | 8ad48aff6897325df1f67ba06530a8647c28a7a0 | [
"MIT"
] | null | null | null | backend/src/config.py | Rutvij-1/ASeniorIsAsking | 8ad48aff6897325df1f67ba06530a8647c28a7a0 | [
"MIT"
] | 6 | 2020-05-23T06:12:06.000Z | 2022-02-27T05:18:56.000Z | backend/src/config.py | Rutvij-1/ASeniorIsAsking | 8ad48aff6897325df1f67ba06530a8647c28a7a0 | [
"MIT"
] | 4 | 2020-05-23T04:29:12.000Z | 2020-05-23T05:18:25.000Z | REDIS_HOST = "redis"
REDIS_PORT = 6379
| 13 | 20 | 0.74359 | 6 | 39 | 4.5 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 0.153846 | 39 | 2 | 21 | 19.5 | 0.69697 | 0 | 0 | 0 | 0 | 0 | 0.128205 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a5cbf9cd9de3702a31c91f74c271678a8b32f558 | 499 | py | Python | Remark/Macros/Copy_Macro.py | kaba2/remark | 42a0f91f1f6da49f09dcdfa272542c63c87932e0 | [
"MIT"
] | null | null | null | Remark/Macros/Copy_Macro.py | kaba2/remark | 42a0f91f1f6da49f09dcdfa272542c63c87932e0 | [
"MIT"
] | null | null | null | Remark/Macros/Copy_Macro.py | kaba2/remark | 42a0f91f1f6da49f09dcdfa272542c63c87932e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Description: Copy macro
# Detail: Copies the input to output.
from Remark.Macro_Registry import registerMacro
class Copy_Macro(object):
def name(self):
return 'Copy'
def expand(self, parameter, remark):
text = parameter
return text
def expandOutput(self):
return True
def htmlHead(self, remark):
return []
def postConversion(self, remark):
None
registerMacro('Copy', Copy_Macro())
| 19.192308 | 47 | 0.617234 | 55 | 499 | 5.545455 | 0.563636 | 0.088525 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002801 | 0.284569 | 499 | 25 | 48 | 19.96 | 0.851541 | 0.162325 | 0 | 0 | 0 | 0 | 0.019324 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.357143 | false | 0 | 0.071429 | 0.214286 | 0.785714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
a5d594e5e839378d46ea91566835e36f7ffff043 | 2,558 | py | Python | nesi/devices/softbox/api/models/service_port_models.py | inexio/NESi | 920b23ccaf293733b4b571e4df27929c036257f7 | [
"BSD-2-Clause"
] | 30 | 2020-09-03T06:02:38.000Z | 2022-03-11T16:34:18.000Z | nesi/devices/softbox/api/models/service_port_models.py | inexio/NESi | 920b23ccaf293733b4b571e4df27929c036257f7 | [
"BSD-2-Clause"
] | 2 | 2021-01-15T10:33:23.000Z | 2021-02-21T21:04:37.000Z | nesi/devices/softbox/api/models/service_port_models.py | inexio/NESi | 920b23ccaf293733b4b571e4df27929c036257f7 | [
"BSD-2-Clause"
] | 3 | 2020-12-19T09:11:19.000Z | 2022-02-07T22:15:34.000Z | from nesi.devices.softbox.api import db
class ServicePort(db.Model):
id = db.Column(db.Integer(), primary_key=True)
name = db.Column(db.String(64))
box_id = db.Column(db.Integer, db.ForeignKey('box.id'))
admin_state = db.Column(db.Enum('0', '1', '2'), default='0') # Alcatel: 0 => down, 1 => up, 2 => not-appl; Huawei: 0 => down, 1 => up
operational_state = db.Column(db.Enum('0', '1'), default='0') # Alcatel: 0 => down, 1 => up; Huawei: 0 => down, 1 => up
connected_id = db.Column(db.Integer(), nullable=False)
connected_type = db.Column(db.Enum('port', 'ont', 'cpe'), nullable=False)
# Alcatel data
pvid = db.Column(db.Integer(), default=None, nullable=True)
max_unicast_mac = db.Column(db.Integer(), default=None, nullable=True)
qos_profile_id = db.Column(db.Integer(), default=None, nullable=True)
pvc = db.Column(db.Boolean(), default=False)
# Huawei Data
vpi = db.Column(db.String(), default='-')
vci = db.Column(db.String(), default='-')
flow_type = db.Column(db.Enum('vlan', 'encap', '-'), default='vlan')
flow_para = db.Column(db.Enum('untag', 'pppoe', '-'), default='untag')
rx = db.Column(db.Integer(), default=560)
tx = db.Column(db.Integer(), default=520)
rx_cttr = db.Column(db.String(), default='-')
tx_cttr = db.Column(db.String(), default='-')
max_mac_count = db.Column(db.Integer(), default=600)
support_down_multicast_stream = db.Column(db.String(), default='disable')
support_igmp_packet = db.Column(db.String(), default='disable')
bytes_us = db.Column(db.Integer(), default=448203129)
packets_us = db.Column(db.Integer(), default=6386689)
bytes_ds = db.Column(db.Integer(), default=430667320)
packets_ds = db.Column(db.Integer(), default=6493472)
inbound_table_name = db.Column(db.String(), default='ip-traffic-table_520')
outbound_table_name = db.Column(db.String(), default='ip-traffic-table_560')
label = db.Column(db.String(), default='-')
priority = db.Column(db.String(), default='-')
pvc_bundle = db.Column(db.Enum('yes', 'no'), default='no')
tag_transforms = db.Column(db.String(), default='default')
description = db.Column(db.String(), nullable=True, default='')
remote_description = db.Column(db.String(), nullable=True, default='')
service_port_bundle = db.Column(db.String(), default='-')
cos = db.Column(db.String(), default='-')
static_mac = db.Column(db.String(), nullable=True, default='')
ip_address = db.Column(db.String(), nullable=True, default='')
| 54.425532 | 138 | 0.657154 | 363 | 2,558 | 4.526171 | 0.272727 | 0.185027 | 0.231284 | 0.175289 | 0.642727 | 0.413877 | 0.281193 | 0.185027 | 0.055995 | 0.055995 | 0 | 0.02983 | 0.148163 | 2,558 | 46 | 139 | 55.608696 | 0.724185 | 0.05903 | 0 | 0 | 0 | 0 | 0.053705 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.025 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
a5e5696b49ccf6e3c053ea59721569f03e3ffa06 | 201 | py | Python | Oldcrap/picture.py | dwu9/mazefun | 031111928c6e080e633910fb37d7fa4e7c05da33 | [
"MIT"
] | null | null | null | Oldcrap/picture.py | dwu9/mazefun | 031111928c6e080e633910fb37d7fa4e7c05da33 | [
"MIT"
] | 1 | 2018-11-22T16:16:11.000Z | 2018-11-22T16:16:11.000Z | Oldcrap/picture.py | dwu9/mazefun | 031111928c6e080e633910fb37d7fa4e7c05da33 | [
"MIT"
] | null | null | null | import numpy as np
from PIL import Image
def image_to_array(filename):
picture = Image.open(filename)
nparray = np.asarray(picture, dtype = int)
lines = nparray[:, :, 0]
return lines
| 20.1 | 46 | 0.681592 | 28 | 201 | 4.821429 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006369 | 0.218905 | 201 | 9 | 47 | 22.333333 | 0.853503 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a5e6eda98316bcdbf0e7556a1b7968c3b5a0ba19 | 1,924 | py | Python | tests/test_advanced_grammar.py | latera/hyaml | 4dc020434d25c182f8477ddd5582398e51501274 | [
"Apache-2.0"
] | 3 | 2020-04-12T15:55:11.000Z | 2021-08-02T16:26:21.000Z | tests/test_advanced_grammar.py | latera/hyaml | 4dc020434d25c182f8477ddd5582398e51501274 | [
"Apache-2.0"
] | null | null | null | tests/test_advanced_grammar.py | latera/hyaml | 4dc020434d25c182f8477ddd5582398e51501274 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from unittest import main
from tests import TranslationCase as TestCase
class TestLists(TestCase):
def test_list_of_expressions(self):
self.assertTranslated(
"[1, true, not false, $cdr.Attr:3]",
"[1, True, not False, get(get(variables, 'cdr'), 'Attr:3')]",
)
def test_empty_list(self):
self.assertTranslated("[]", "[]")
class TestSubscription(TestCase):
def test_subscription(self):
self.assertTranslated("$var[0]", "get(variables, 'var')[0]")
def test_list_subscription(self):
self.assertTranslated("[1, 2, 3][1]", "[1, 2, 3][1]")
def test_nested_subscriptions(self):
self.assertTranslated("[[1, 2], [2, 3]][1][0]", "[[1, 2], [2, 3]][1][0]")
class TestDict(TestCase):
def test_empty_dict(self):
self.assertTranslated("{}", "{}")
def test_simple_dict(self):
self.assertTranslated("{abc: 123}", '{"abc": 123}')
def test_complex_dict(self):
self.assertTranslated(
"{abc: 123, bcd: 2 + 4, abyr:1: [1, 2, 3]}",
'{"abc": 123, "bcd": 2 + 4, "abyr:1": [1, 2, 3]}',
)
class TestPrecedence(TestCase):
def test_method_call_precedence(self):
self.assertTranslated("6 + 'abc'.length()", "6 + length('abc')")
def test_subscription_precedence(self):
self.assertTranslated("6 + [1, 2, 3][1]", "6 + [1, 2, 3][1]")
def test_negation_precedence(self):
self.assertTranslated(
"$a.like?('a') or $b.like?('b')",
"is_like(get(variables, 'a'), 'a') or is_like(get(variables, 'b'), 'b')",
)
def test_float_precedence(self):
self.assertTranslated("0.1 == 0.1", "0.1 == 0.1")
self.assertTranslated("0.1 != 0.1", "0.1 != 0.1")
class TestEscaping(TestCase):
def test_strings_with_backslash_are_escaped(self):
self.assertTranslated("'\\s'", "'\\\\s'")
| 30.0625 | 85 | 0.579522 | 247 | 1,924 | 4.384615 | 0.271255 | 0.258541 | 0.288089 | 0.022161 | 0.290859 | 0.175439 | 0.086796 | 0.086796 | 0.086796 | 0.086796 | 0 | 0.052209 | 0.223493 | 1,924 | 63 | 86 | 30.539683 | 0.672691 | 0.010395 | 0 | 0.069767 | 0 | 0.093023 | 0.276931 | 0.023121 | 0 | 0 | 0 | 0 | 0.325581 | 1 | 0.302326 | false | 0 | 0.046512 | 0 | 0.465116 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9388c3bb6df98bd29b6eb7ae0de6063167edac44 | 600 | py | Python | segment_double_line/train.py | hushukai/Chinese-ancient-book-recognition-HSK | de5b6474dc4346524d95b405223c721aae5b500b | [
"Apache-2.0"
] | 2 | 2020-04-12T08:33:50.000Z | 2020-07-03T09:15:56.000Z | segment_double_line/train.py | yufish/Chinese-ancient-book-recognition-HSK | c7302fdd6e86b57223cfa1906e8bb365702c8240 | [
"Apache-2.0"
] | null | null | null | segment_double_line/train.py | yufish/Chinese-ancient-book-recognition-HSK | c7302fdd6e86b57223cfa1906e8bb365702c8240 | [
"Apache-2.0"
] | 4 | 2020-07-03T09:15:58.000Z | 2020-07-17T09:24:08.000Z | # -*- encoding: utf-8 -*-
# Author: hushukai
from segment_base.train import main as train
from config import SEGMENT_DOUBLE_LINE_TAGS_FILE_H, SEGMENT_DOUBLE_LINE_TAGS_FILE_V
from config import SEGMENT_DOUBLE_LINE_TFRECORDS_H, SEGMENT_DOUBLE_LINE_TFRECORDS_V
def main():
train(data_file=SEGMENT_DOUBLE_LINE_TFRECORDS_V,
src_type="tfrecords",
text_type="vertical",
segment_task="double_line",
epochs=100,
init_epochs=0,
model_struc="densenet_gru",
weights_path="")
if __name__ == '__main__':
main()
print("Done !")
| 26.086957 | 83 | 0.693333 | 78 | 600 | 4.820513 | 0.525641 | 0.159574 | 0.226064 | 0.207447 | 0.406915 | 0.175532 | 0 | 0 | 0 | 0 | 0 | 0.010593 | 0.213333 | 600 | 22 | 84 | 27.272727 | 0.786017 | 0.066667 | 0 | 0 | 0 | 0 | 0.096948 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | true | 0 | 0.2 | 0 | 0.266667 | 0.066667 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93c6e110daf86696d346ae281db88f2ce460a615 | 1,016 | py | Python | is_palindrome.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | is_palindrome.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | is_palindrome.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | #another way of doing recursive palindrome
def is_palindrome(s):
ln = len(s)
if s != '':
if s[ln-1] == s[0]:
return True and is_palindrome(s[1:ln-1])
return False
return True
assert is_palindrome('abab') == False
assert is_palindrome('abba') == True
assert is_palindrome('madam') == True
assert is_palindrome('madame') == False
assert is_palindrome('') == True
#non recursive loop method
def is_palindrome_loop(s):
ln = len(s)
for i in xrange(ln/2):
if not (s[i] == s[ln-i-1]): return False
return True
assert is_palindrome_loop('abab') == False
assert is_palindrome_loop('abba') == True
assert is_palindrome_loop('madam') == True
assert is_palindrome_loop('madame') == False
assert is_palindrome_loop('') == True
#easier pythonic way
def is_pal_easy(s): return s == s[::-1]
assert is_pal_easy('abab') == False
assert is_pal_easy('abba') == True
assert is_pal_easy('madam') == True
assert is_pal_easy('madame') == False
assert is_pal_easy('') == True
| 27.459459 | 52 | 0.673228 | 158 | 1,016 | 4.132911 | 0.227848 | 0.183767 | 0.275651 | 0.202144 | 0.606432 | 0.122511 | 0.122511 | 0.122511 | 0 | 0 | 0 | 0.008403 | 0.180118 | 1,016 | 36 | 53 | 28.222222 | 0.77551 | 0.083661 | 0 | 0.142857 | 0 | 0 | 0.061422 | 0 | 0 | 0 | 0 | 0 | 0.535714 | 1 | 0.107143 | false | 0 | 0 | 0.035714 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93c86a2ae89d65dbe5f20d98ba57392a628a5ac5 | 138 | py | Python | cliente_vip/vip.py | rafael-ds/controle-de-estacionamento | 8efae352f77d82881bdfc91e25f3e814ddfa2bc8 | [
"MIT"
] | null | null | null | cliente_vip/vip.py | rafael-ds/controle-de-estacionamento | 8efae352f77d82881bdfc91e25f3e814ddfa2bc8 | [
"MIT"
] | null | null | null | cliente_vip/vip.py | rafael-ds/controle-de-estacionamento | 8efae352f77d82881bdfc91e25f3e814ddfa2bc8 | [
"MIT"
] | null | null | null | lista_cadastro = []
def placa_v():
if len(lista_cadastro) > 0:
print('tem placa ')
else:
print('não tem placa')
| 15.333333 | 31 | 0.557971 | 18 | 138 | 4.111111 | 0.666667 | 0.351351 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010417 | 0.304348 | 138 | 8 | 32 | 17.25 | 0.760417 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.166667 | 0.333333 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93ca72083942c213d0db02c732d799de02c72391 | 765 | py | Python | SparseMeasurements/Analysis.py | danielfreeman11/thermal-toric-code | 3718f1b16737dfae09443466f6cfb65036faaa89 | [
"MIT"
] | 6 | 2017-11-15T00:54:13.000Z | 2021-11-21T02:08:21.000Z | SparseMeasurements/Analysis.py | danielfreeman11/thermal-toric-code | 3718f1b16737dfae09443466f6cfb65036faaa89 | [
"MIT"
] | null | null | null | SparseMeasurements/Analysis.py | danielfreeman11/thermal-toric-code | 3718f1b16737dfae09443466f6cfb65036faaa89 | [
"MIT"
] | null | null | null | import os
import numpy
import sys
os.chdir('../Runs/')
files = os.listdir('.')
datadict = {}
for j in [1.0,1.5,2.0]:
for i in xrange(20):
datadict[str(7*2*i),j]=[]
chi = float(sys.argv[1])
for ff in files:
with open(ff) as f:
lines = f.readlines()
for line in lines:
l = line.split("\t")
datadict[l[2],float(l[3])].append(float(l[4]))
for i in [2,3,4,5,6,7,8,9,10,11,12,13]:
print 7*i*2,"\t",numpy.mean(datadict[str(7*2*i),chi]),"\t",numpy.std(datadict[str(7*2*i),chi]),"\t",(numpy.std(datadict[str(7*2*i),chi]/numpy.sqrt(len(datadict[str(7*2*i),chi]))))/numpy.mean(datadict[str(7*2*i),chi]),"\t",len(datadict[str(7*2*i),chi])
#os.chdir('../bin/')
#with open("hist.out","a+") as f:
# for i in datadict["56",1.0]:
# f.write(str(i) + "\n")
| 23.181818 | 252 | 0.596078 | 161 | 765 | 2.832298 | 0.354037 | 0.16886 | 0.184211 | 0.199561 | 0.359649 | 0.328947 | 0.328947 | 0.230263 | 0.230263 | 0.151316 | 0 | 0.071217 | 0.118954 | 765 | 32 | 253 | 23.90625 | 0.605341 | 0.135948 | 0 | 0 | 0 | 0 | 0.028919 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.166667 | null | null | 0.055556 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93efad6e758ab13e658529c37547bad2224488d8 | 23 | py | Python | view/__init__.py | allspatial/vertex-tools | b885fdb226fbff5af07f13e6727fb03032db6a3d | [
"MIT"
] | null | null | null | view/__init__.py | allspatial/vertex-tools | b885fdb226fbff5af07f13e6727fb03032db6a3d | [
"MIT"
] | null | null | null | view/__init__.py | allspatial/vertex-tools | b885fdb226fbff5af07f13e6727fb03032db6a3d | [
"MIT"
] | null | null | null | __author__ = 'mwagner'
| 11.5 | 22 | 0.73913 | 2 | 23 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 23 | 1 | 23 | 23 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0.304348 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93fc012788abe7b656aa36b1575951c76e46b675 | 530 | py | Python | util.py | davleop/claude | 09ee880d502dcad8cc1a8d2fd681978b812d32dd | [
"MIT"
] | null | null | null | util.py | davleop/claude | 09ee880d502dcad8cc1a8d2fd681978b812d32dd | [
"MIT"
] | null | null | null | util.py | davleop/claude | 09ee880d502dcad8cc1a8d2fd681978b812d32dd | [
"MIT"
] | null | null | null | import numpy as np
import claude_low_level_library as low_level
import claude_top_level_library as top_level
def grid_lat(mul, xx, yy, rad):
return (mul * np.arccos(((xx**2 + yy**2)**0.5)/rad)*180.0/np.pi).flatten()
def grid_lon(xx, yy):
return (180.0 - np.arctan2(yy,xx)*180.0/np.pi).flatten()
def cos_mul_sin(rad, lat, lon, i, j):
return rad * np.cos(lat[i]*np.pi/180.0) * np.sin(lon[j]*np.pi/180.0)
def cos_mul_cos(rad, lat, lon, i, j):
return rad * np.cos(lat[i]*np.pi/180.0) * np.cos(lon[j]*np.pi/180.0)
| 31.176471 | 78 | 0.660377 | 114 | 530 | 2.947368 | 0.263158 | 0.083333 | 0.089286 | 0.095238 | 0.410714 | 0.410714 | 0.232143 | 0.232143 | 0.232143 | 0.232143 | 0 | 0.072527 | 0.141509 | 530 | 16 | 79 | 33.125 | 0.665934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0 | 0.272727 | 0.363636 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
93fc3920d71a496ef97501796851e7cb0fe7ecbe | 230 | py | Python | core/management/commands/init_envs.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 97 | 2016-11-15T14:44:23.000Z | 2022-03-13T18:09:15.000Z | core/management/commands/init_envs.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 334 | 2016-11-17T19:56:57.000Z | 2022-03-18T10:45:53.000Z | core/management/commands/init_envs.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 33 | 2017-01-02T16:04:13.000Z | 2022-02-07T19:20:24.000Z | from ._base import DanubeCloudCommand, CommandError
class Command(DanubeCloudCommand):
help = 'Initialize the virtual environments.'
def handle(self, *args, **options):
raise CommandError('Use ctl.sh directly')
| 25.555556 | 51 | 0.730435 | 24 | 230 | 6.958333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 230 | 8 | 52 | 28.75 | 0.878947 | 0 | 0 | 0 | 0 | 0 | 0.23913 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 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 | 0 | 1 | 0 | 0 | 3 |
9e2050f407617d9fa74e0130e228c464faee6fe3 | 303 | py | Python | vui/__init__.py | eterevsky/pygui | 48bf4175c645d7d043effbada59beae2fb937f2e | [
"MIT"
] | 1 | 2020-08-03T15:26:16.000Z | 2020-08-03T15:26:16.000Z | vui/__init__.py | eterevsky/pygui | 48bf4175c645d7d043effbada59beae2fb937f2e | [
"MIT"
] | null | null | null | vui/__init__.py | eterevsky/pygui | 48bf4175c645d7d043effbada59beae2fb937f2e | [
"MIT"
] | null | null | null | from .image import Image
from .layout import (RootLayout, StackLayout, HStackLayout, VStackLayout,
LayersLayout, Spacer)
from .observable import Attribute, MaybeObservable, Observable, make_observable
from .pane import Pane
from .view import View, HAlign, VAlign
from . import event | 43.285714 | 79 | 0.762376 | 34 | 303 | 6.764706 | 0.558824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178218 | 303 | 7 | 80 | 43.285714 | 0.923695 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.857143 | 0 | 0.857143 | 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 | 0 | 0 | 0 | 3 |
9e240cd0602172d398940287f55aa431bcee10e2 | 12,308 | py | Python | tensorflow_checkpoint_reader/pb/tensorflow/core/protobuf/trackable_object_graph_pb2.py | shawwn/tensorflow-checkpoint-reader | f0e65548411e3bd66a07e36bb1850907a05952d0 | [
"MIT"
] | 1 | 2021-12-02T15:06:09.000Z | 2021-12-02T15:06:09.000Z | tensorflow_checkpoint_reader/pb/tensorflow/core/protobuf/trackable_object_graph_pb2.py | shawwn/tensorflow-checkpoint-reader | f0e65548411e3bd66a07e36bb1850907a05952d0 | [
"MIT"
] | null | null | null | tensorflow_checkpoint_reader/pb/tensorflow/core/protobuf/trackable_object_graph_pb2.py | shawwn/tensorflow-checkpoint-reader | f0e65548411e3bd66a07e36bb1850907a05952d0 | [
"MIT"
] | null | null | null |
'Generated protocol buffer code.'
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(name='tensorflow/core/protobuf/trackable_object_graph.proto', package='tensorflow', syntax='proto3', serialized_options=b'ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01', create_key=_descriptor._internal_create_key, serialized_pb=b'\n5tensorflow/core/protobuf/trackable_object_graph.proto\x12\ntensorflow"\x83\x05\n\x14TrackableObjectGraph\x12?\n\x05nodes\x18\x01 \x03(\x0b20.tensorflow.TrackableObjectGraph.TrackableObject\x1a\xa9\x04\n\x0fTrackableObject\x12R\n\x08children\x18\x01 \x03(\x0b2@.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference\x12U\n\nattributes\x18\x02 \x03(\x0b2A.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor\x12^\n\x0eslot_variables\x18\x03 \x03(\x0b2F.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference\x1a6\n\x0fObjectReference\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x12\n\nlocal_name\x18\x02 \x01(\t\x1ae\n\x10SerializedTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfull_name\x18\x02 \x01(\t\x12\x16\n\x0echeckpoint_key\x18\x03 \x01(\t\x12\x18\n\x10optional_restore\x18\x04 \x01(\x08\x1al\n\x15SlotVariableReference\x12!\n\x19original_variable_node_id\x18\x01 \x01(\x05\x12\x11\n\tslot_name\x18\x02 \x01(\t\x12\x1d\n\x15slot_variable_node_id\x18\x03 \x01(\x05BZZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01b\x06proto3')
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_OBJECTREFERENCE = _descriptor.Descriptor(name='ObjectReference', full_name='tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[_descriptor.FieldDescriptor(name='node_id', full_name='tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.node_id', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='local_name', full_name='tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference.local_name', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b''.decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key)], extensions=[], nested_types=[], enum_types=[], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[], serialized_start=446, serialized_end=500)
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SERIALIZEDTENSOR = _descriptor.Descriptor(name='SerializedTensor', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[_descriptor.FieldDescriptor(name='name', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b''.decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='full_name', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.full_name', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b''.decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='checkpoint_key', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.checkpoint_key', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b''.decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='optional_restore', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor.optional_restore', index=3, number=4, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key)], extensions=[], nested_types=[], enum_types=[], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[], serialized_start=502, serialized_end=603)
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SLOTVARIABLEREFERENCE = _descriptor.Descriptor(name='SlotVariableReference', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[_descriptor.FieldDescriptor(name='original_variable_node_id', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.original_variable_node_id', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='slot_name', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.slot_name', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b''.decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='slot_variable_node_id', full_name='tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference.slot_variable_node_id', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key)], extensions=[], nested_types=[], enum_types=[], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[], serialized_start=605, serialized_end=713)
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT = _descriptor.Descriptor(name='TrackableObject', full_name='tensorflow.TrackableObjectGraph.TrackableObject', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[_descriptor.FieldDescriptor(name='children', full_name='tensorflow.TrackableObjectGraph.TrackableObject.children', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='attributes', full_name='tensorflow.TrackableObjectGraph.TrackableObject.attributes', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor(name='slot_variables', full_name='tensorflow.TrackableObjectGraph.TrackableObject.slot_variables', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key)], extensions=[], nested_types=[_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_OBJECTREFERENCE, _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SERIALIZEDTENSOR, _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SLOTVARIABLEREFERENCE], enum_types=[], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[], serialized_start=160, serialized_end=713)
_TRACKABLEOBJECTGRAPH = _descriptor.Descriptor(name='TrackableObjectGraph', full_name='tensorflow.TrackableObjectGraph', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[_descriptor.FieldDescriptor(name='nodes', full_name='tensorflow.TrackableObjectGraph.nodes', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key)], extensions=[], nested_types=[_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT], enum_types=[], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[], serialized_start=70, serialized_end=713)
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_OBJECTREFERENCE.containing_type = _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SERIALIZEDTENSOR.containing_type = _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SLOTVARIABLEREFERENCE.containing_type = _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT.fields_by_name['children'].message_type = _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_OBJECTREFERENCE
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT.fields_by_name['attributes'].message_type = _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SERIALIZEDTENSOR
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT.fields_by_name['slot_variables'].message_type = _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SLOTVARIABLEREFERENCE
_TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT.containing_type = _TRACKABLEOBJECTGRAPH
_TRACKABLEOBJECTGRAPH.fields_by_name['nodes'].message_type = _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT
DESCRIPTOR.message_types_by_name['TrackableObjectGraph'] = _TRACKABLEOBJECTGRAPH
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
TrackableObjectGraph = _reflection.GeneratedProtocolMessageType('TrackableObjectGraph', (_message.Message,), {'TrackableObject': _reflection.GeneratedProtocolMessageType('TrackableObject', (_message.Message,), {'ObjectReference': _reflection.GeneratedProtocolMessageType('ObjectReference', (_message.Message,), {'DESCRIPTOR': _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_OBJECTREFERENCE, '__module__': 'tensorflow.core.protobuf.trackable_object_graph_pb2'}), 'SerializedTensor': _reflection.GeneratedProtocolMessageType('SerializedTensor', (_message.Message,), {'DESCRIPTOR': _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SERIALIZEDTENSOR, '__module__': 'tensorflow.core.protobuf.trackable_object_graph_pb2'}), 'SlotVariableReference': _reflection.GeneratedProtocolMessageType('SlotVariableReference', (_message.Message,), {'DESCRIPTOR': _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT_SLOTVARIABLEREFERENCE, '__module__': 'tensorflow.core.protobuf.trackable_object_graph_pb2'}), 'DESCRIPTOR': _TRACKABLEOBJECTGRAPH_TRACKABLEOBJECT, '__module__': 'tensorflow.core.protobuf.trackable_object_graph_pb2'}), 'DESCRIPTOR': _TRACKABLEOBJECTGRAPH, '__module__': 'tensorflow.core.protobuf.trackable_object_graph_pb2'})
_sym_db.RegisterMessage(TrackableObjectGraph)
_sym_db.RegisterMessage(TrackableObjectGraph.TrackableObject)
_sym_db.RegisterMessage(TrackableObjectGraph.TrackableObject.ObjectReference)
_sym_db.RegisterMessage(TrackableObjectGraph.TrackableObject.SerializedTensor)
_sym_db.RegisterMessage(TrackableObjectGraph.TrackableObject.SlotVariableReference)
DESCRIPTOR._options = None
| 397.032258 | 2,190 | 0.853754 | 1,446 | 12,308 | 6.910788 | 0.112725 | 0.175123 | 0.051336 | 0.051336 | 0.715701 | 0.605824 | 0.517762 | 0.489042 | 0.469929 | 0.452317 | 0 | 0.025864 | 0.035587 | 12,308 | 30 | 2,191 | 410.266667 | 0.816007 | 0.002519 | 0 | 0 | 1 | 0.068966 | 0.275128 | 0.22995 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.137931 | 0 | 0.137931 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f50b9664584a5342a68acf9860b815e8973f978a | 161 | py | Python | aiocloudflare/api/accounts/workers/scripts/schedules/schedules.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 2 | 2021-09-14T13:20:55.000Z | 2022-02-24T14:18:24.000Z | aiocloudflare/api/accounts/workers/scripts/schedules/schedules.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 46 | 2021-09-08T08:39:45.000Z | 2022-03-29T12:31:05.000Z | aiocloudflare/api/accounts/workers/scripts/schedules/schedules.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 1 | 2021-12-30T23:02:23.000Z | 2021-12-30T23:02:23.000Z | from aiocloudflare.commons.auth import Auth
class Schedules(Auth):
_endpoint1 = "accounts"
_endpoint2 = "workers/scripts"
_endpoint3 = "schedules"
| 20.125 | 43 | 0.726708 | 16 | 161 | 7.125 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022727 | 0.180124 | 161 | 7 | 44 | 23 | 0.840909 | 0 | 0 | 0 | 0 | 0 | 0.198758 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f51a83bcfdb65ee913246a677a4451dadc38dd3d | 468 | py | Python | Core/Rcon_Plugins/Rcon_AdminWarn.py | ChenjianS47/SquadPy | 80b1f1129efa33c15ebdad9ce822a5dfc940b28c | [
"MIT"
] | 1 | 2021-09-27T07:32:32.000Z | 2021-09-27T07:32:32.000Z | Core/Rcon_Plugins/Rcon_AdminWarn.py | ChenjianS47/SquadPy | 80b1f1129efa33c15ebdad9ce822a5dfc940b28c | [
"MIT"
] | null | null | null | Core/Rcon_Plugins/Rcon_AdminWarn.py | ChenjianS47/SquadPy | 80b1f1129efa33c15ebdad9ce822a5dfc940b28c | [
"MIT"
] | 1 | 2021-09-27T07:33:07.000Z | 2021-09-27T07:33:07.000Z | import Core.Base.Pyscrds_modified as rcon
def Rcon_AdminWarn(server_rcon_info, server_name, steam_64id, warning_info):
conn = rcon.RconConnection(server=server_rcon_info[server_name]['Server_IP'],
port=server_rcon_info[server_name]['RCON_Port'],
password=server_rcon_info[server_name]['Server_pw'])
warning = 'AdminWarn ' + steam_64id + ' ' + warning_info
conn.exec_command(warning)
pass
| 42.545455 | 83 | 0.673077 | 57 | 468 | 5.140351 | 0.421053 | 0.136519 | 0.191126 | 0.273038 | 0.532423 | 0.204778 | 0 | 0 | 0 | 0 | 0 | 0.01108 | 0.228632 | 468 | 10 | 84 | 46.8 | 0.800554 | 0 | 0 | 0 | 0 | 0 | 0.081197 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0.25 | 0.125 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
f52deb05a7cb7ce8fa146cd4f0b7c1a0ecf77c3e | 99 | py | Python | python/alphabetize.py | hsadler/programming-language-examples | 7c5f8e0acc05ed9f995e98b824f96c6bc332e83f | [
"MIT"
] | null | null | null | python/alphabetize.py | hsadler/programming-language-examples | 7c5f8e0acc05ed9f995e98b824f96c6bc332e83f | [
"MIT"
] | null | null | null | python/alphabetize.py | hsadler/programming-language-examples | 7c5f8e0acc05ed9f995e98b824f96c6bc332e83f | [
"MIT"
] | null | null | null |
# alphabetize a list of strings
import sys
strings = sys.argv[1:]
strings.sort()
print strings
| 9.9 | 31 | 0.727273 | 15 | 99 | 4.8 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012346 | 0.181818 | 99 | 9 | 32 | 11 | 0.876543 | 0.292929 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.25 | null | null | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f53e6beda7aedc4c9b3c0618f7da1703b18caf16 | 1,012 | py | Python | spacy/en/language_data.py | yuukos/spaCy | e4125383ed7221910ea955eae9b623c02bda64d8 | [
"MIT"
] | 1 | 2017-11-18T08:53:26.000Z | 2017-11-18T08:53:26.000Z | spacy/en/language_data.py | yuukos/spaCy | e4125383ed7221910ea955eae9b623c02bda64d8 | [
"MIT"
] | null | null | null | spacy/en/language_data.py | yuukos/spaCy | e4125383ed7221910ea955eae9b623c02bda64d8 | [
"MIT"
] | 1 | 2018-08-25T03:09:50.000Z | 2018-08-25T03:09:50.000Z | # coding: utf8
from __future__ import unicode_literals
from .. import language_data as base
from ..language_data import update_exc, strings_to_exc, expand_exc
from ..symbols import ORTH, LEMMA
from .tag_map import TAG_MAP
from .word_sets import STOP_WORDS, NUM_WORDS
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS, ORTH_ONLY
from .morph_rules import MORPH_RULES
from .lemmatizer import RULES as LEMMA_RULES
from .lemmatizer import INDEX as LEMMA_INDEX
from .lemmatizer import EXC as LEMMA_EXC
TAG_MAP = dict(TAG_MAP)
STOP_WORDS = set(STOP_WORDS)
TOKENIZER_EXCEPTIONS = dict(TOKENIZER_EXCEPTIONS)
update_exc(TOKENIZER_EXCEPTIONS, strings_to_exc(ORTH_ONLY))
update_exc(TOKENIZER_EXCEPTIONS, expand_exc(TOKENIZER_EXCEPTIONS, "'", "’"))
update_exc(TOKENIZER_EXCEPTIONS, strings_to_exc(base.EMOTICONS))
update_exc(TOKENIZER_EXCEPTIONS, strings_to_exc(base.ABBREVIATIONS))
__all__ = ["TOKENIZER_EXCEPTIONS", "TAG_MAP", "STOP_WORDS", "MORPH_RULES",
"LEMMA_RULES", "LEMMA_INDEX", "LEMMA_EXC"]
| 33.733333 | 76 | 0.813241 | 143 | 1,012 | 5.34965 | 0.265734 | 0.248366 | 0.143791 | 0.146405 | 0.216993 | 0.216993 | 0.216993 | 0.216993 | 0.154248 | 0 | 0 | 0.001105 | 0.105731 | 1,012 | 29 | 77 | 34.896552 | 0.844199 | 0.011858 | 0 | 0 | 0 | 0 | 0.081162 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.55 | 0 | 0.55 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
f567baf32fe36048a71c93b05f026b4544448a8c | 389 | py | Python | fast_transformers/events/__init__.py | SamuelCahyawijaya/fast-transformers | 6ae8ed4cc50bd037968db4f5062e4d328aae73fe | [
"MIT"
] | 3 | 2021-03-08T05:20:30.000Z | 2021-07-12T15:56:33.000Z | fast_transformers/events/__init__.py | SamuelCahyawijaya/fast-transformers | 6ae8ed4cc50bd037968db4f5062e4d328aae73fe | [
"MIT"
] | null | null | null | fast_transformers/events/__init__.py | SamuelCahyawijaya/fast-transformers | 6ae8ed4cc50bd037968db4f5062e4d328aae73fe | [
"MIT"
] | null | null | null | #
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>
#
"""This module implements a basic event system that allows the transformer
internal components to make available any tensor with minimal overhead."""
from .event import Event, AttentionEvent, QKVEvent
from .event_dispatcher import EventDispatcher
| 35.363636 | 74 | 0.799486 | 50 | 389 | 6.2 | 0.8 | 0.045161 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011765 | 0.125964 | 389 | 10 | 75 | 38.9 | 0.9 | 0.709512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
f56940076aee3364d0a0c9b67ec6ed642e5c6c3e | 2,784 | py | Python | src/sima/simo/blueprints/simplewirecoupling.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/simo/blueprints/simplewirecoupling.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/simo/blueprints/simplewirecoupling.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | #
# Generated with SimpleWireCouplingBlueprint
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 .simplecoupling import SimpleCouplingBlueprint
class SimpleWireCouplingBlueprint(SimpleCouplingBlueprint):
""""""
def __init__(self, name="SimpleWireCoupling", package_path="sima/simo", 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("_id","string","",default=""))
self.attributes.append(BlueprintAttribute("scriptableValues","sima/sima/ScriptableValue","",True,Dimension("*")))
self.attributes.append(BlueprintAttribute("endPoint1","sima/simo/SIMOBodyPoint","",False))
self.attributes.append(BlueprintAttribute("endPoint2","sima/simo/SIMOBodyPoint","",False))
self.attributes.append(EnumAttribute("failureMode","sima/simo/ActivationFailureMode","Failure mode of coupling element"))
self.attributes.append(Attribute("failureTime","number","Earliest possible time of failure",default=0.0))
self.attributes.append(Attribute("breakingStrength","number","Breaking strength",default=0.0))
self.attributes.append(Attribute("ea","number","Wire cross section stiffness",default=0.0))
self.attributes.append(Attribute("length","number","Initial, unstretched wire length",default=0.0))
self.attributes.append(Attribute("damping","number","Material damping",default=0.0))
self.attributes.append(Attribute("flexibility","number","Connection flexibility",default=0.0))
self.attributes.append(BlueprintAttribute("guidePointSpecifications","sima/simo/GuidePointSpecification","",True,Dimension("*")))
self.attributes.append(Attribute("constantTensionControl","boolean","Enable constant tension control for this wire",default=True))
self.attributes.append(Attribute("tensionLevel","number","Desired tension level",default=0.0))
self.attributes.append(Attribute("tensionDeadband","number","Tension level deadband",default=0.0))
self.attributes.append(Attribute("maxSpeed","number","Max wire length rate of change",default=0.0))
self.attributes.append(Attribute("activationTime","number","Activation time for constant tension control",default=0.0))
self.attributes.append(Attribute("deactivationTime","number","Deactivation time for constant tension control. If value is less then or equal to activation time, controller will remain active throughout simulation",default=0.0)) | 81.882353 | 235 | 0.752155 | 298 | 2,784 | 6.983221 | 0.345638 | 0.134551 | 0.192215 | 0.209034 | 0.338299 | 0.262854 | 0.208554 | 0 | 0 | 0 | 0 | 0.009639 | 0.105603 | 2,784 | 34 | 235 | 81.882353 | 0.826104 | 0.015086 | 0 | 0 | 1 | 0.034483 | 0.356385 | 0.066228 | 0 | 0 | 0 | 0 | 0 | 1 | 0.034483 | false | 0 | 0.206897 | 0 | 0.275862 | 0.275862 | 0 | 0 | 0 | null | 0 | 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 | 3 |
f57d34f82a3f8a248815bc66308669158bb1278d | 227 | py | Python | marmot/exceptions/no_data_error.py | qe-team/marmot | 38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff | [
"0BSD"
] | 19 | 2015-08-21T13:06:37.000Z | 2021-07-26T09:56:29.000Z | marmot/exceptions/no_data_error.py | qe-team/marmot | 38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff | [
"0BSD"
] | 36 | 2015-01-13T13:01:07.000Z | 2016-06-22T06:59:59.000Z | marmot/exceptions/no_data_error.py | qe-team/marmot | 38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff | [
"0BSD"
] | 8 | 2015-12-11T16:41:47.000Z | 2019-04-08T16:28:40.000Z | class NoDataError(Exception):
def __init__(self, field, obj, module):
message = "Missing field '" + field + "' in the object " + str(obj) + " needed in " + module
super(NoDataError, self).__init__(message)
| 37.833333 | 100 | 0.634361 | 26 | 227 | 5.230769 | 0.653846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.229075 | 227 | 5 | 101 | 45.4 | 0.777143 | 0 | 0 | 0 | 0 | 0 | 0.185022 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f587471d470bf8d72639d5cb5555851da11bbf34 | 91 | py | Python | searchRequestion/searchIssue/qywechat/apps.py | jiangwenfan/pythonScripts | c9004944f162af575e111522f98d4de4f59885e6 | [
"Apache-2.0"
] | null | null | null | searchRequestion/searchIssue/qywechat/apps.py | jiangwenfan/pythonScripts | c9004944f162af575e111522f98d4de4f59885e6 | [
"Apache-2.0"
] | null | null | null | searchRequestion/searchIssue/qywechat/apps.py | jiangwenfan/pythonScripts | c9004944f162af575e111522f98d4de4f59885e6 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class QywechatConfig(AppConfig):
name = 'qywechat'
| 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 | 0 | 0 | 0 | 3 |
19285b29382a4c573150ed6c479279f14e02cd1e | 169 | py | Python | tests/tests/class_update.py | yu-i9/mini_python | d62b9040f8427057a20d18340a27bdf2dfc8c22e | [
"MIT"
] | 2 | 2018-06-22T07:07:03.000Z | 2018-08-03T04:26:43.000Z | tests/tests/class_update.py | yu-i9/mini_python | d62b9040f8427057a20d18340a27bdf2dfc8c22e | [
"MIT"
] | null | null | null | tests/tests/class_update.py | yu-i9/mini_python | d62b9040f8427057a20d18340a27bdf2dfc8c22e | [
"MIT"
] | null | null | null | class Test:
def initialize(self):
self.x = 42
t = Test()
t.initialize()
def calc(self, n):
return self.x + n
Test.calc = calc
assert t.calc(4) == 46
| 12.071429 | 25 | 0.585799 | 28 | 169 | 3.535714 | 0.5 | 0.10101 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040323 | 0.266272 | 169 | 13 | 26 | 13 | 0.758065 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 1 | 0.222222 | false | 0 | 0 | 0.111111 | 0.444444 | 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 | 0 | 0 | 0 | 3 |
197a9e8026a673b56d11f6fb0405561c3f24f4f0 | 159 | py | Python | bmi_calculator/apps.py | MrMohammadY/bmi | cabfdfb9d580f6e4cdea9b0629d4dfcf7090ba22 | [
"MIT"
] | 2 | 2021-12-16T10:56:45.000Z | 2022-01-27T17:21:47.000Z | bmi_calculator/apps.py | MrMohammadY/bmi | cabfdfb9d580f6e4cdea9b0629d4dfcf7090ba22 | [
"MIT"
] | null | null | null | bmi_calculator/apps.py | MrMohammadY/bmi | cabfdfb9d580f6e4cdea9b0629d4dfcf7090ba22 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class BmiCalculatorConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'bmi_calculator'
| 22.714286 | 56 | 0.779874 | 18 | 159 | 6.722222 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138365 | 159 | 6 | 57 | 26.5 | 0.883212 | 0 | 0 | 0 | 0 | 0 | 0.27044 | 0.18239 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
198e136ab5756fa00e40cbbd60203f4cad60c812 | 113 | py | Python | python/Algorithms/Implementation/Viral Advertising.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | 1 | 2020-10-06T01:20:07.000Z | 2020-10-06T01:20:07.000Z | python/Algorithms/Implementation/Viral Advertising.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | python/Algorithms/Implementation/Viral Advertising.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | def viralAdvertising(n):
return
if __name__ == '__main__':
n = int(input())
viralAdvertising(n)
| 10.272727 | 26 | 0.619469 | 12 | 113 | 5.166667 | 0.75 | 0.548387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.247788 | 113 | 10 | 27 | 11.3 | 0.729412 | 0 | 0 | 0 | 0 | 0 | 0.070796 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0.2 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
19a5b9eedf30eb9512c04956641d412b3c00d22f | 735 | py | Python | testing/run_all_tests.py | denkovarik/EC-Scrape | e6340fe852b204f4813ec6ede4d20138a85644b6 | [
"MIT"
] | null | null | null | testing/run_all_tests.py | denkovarik/EC-Scrape | e6340fe852b204f4813ec6ede4d20138a85644b6 | [
"MIT"
] | null | null | null | testing/run_all_tests.py | denkovarik/EC-Scrape | e6340fe852b204f4813ec6ede4d20138a85644b6 | [
"MIT"
] | null | null | null | import os, io, sys, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
print("Running Tests for Uniprot Class")
os.system(currentdir + "\\Uniprot_tests.py")
print("")
print("Running Tests for NCBI Class")
os.system(currentdir + "\\NCBI_tests.py")
print("")
print("Running Tests for Annot_Reader Class")
os.system(currentdir + "\\Annot_Reader_Tests.py")
print("")
print("Running Tests for BLAST_Rslts_Itr class")
os.system(currentdir + "\\BLAST_Rslts_Itr_tests.py")
print("")
print("Running Tests for Utility Functions")
os.system(currentdir + "\\utils_testing.py")
os.system(currentdir + "\\run_blast_utils_testing.py") | 35 | 86 | 0.756463 | 104 | 735 | 5.211538 | 0.317308 | 0.088561 | 0.199262 | 0.184502 | 0.236162 | 0.236162 | 0.236162 | 0 | 0 | 0 | 0 | 0.001484 | 0.082993 | 735 | 21 | 87 | 35 | 0.802671 | 0 | 0 | 0.210526 | 0 | 0 | 0.403533 | 0.10462 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.052632 | 0 | 0.052632 | 0.473684 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
19aadb7ed793f3775bccc5d77c697ce7730c883f | 763 | py | Python | dali/activation.py | JonathanRaiman/dali-cython-stub | e258469aeb1d4cb3e4cdf5c07e8948f461a038f1 | [
"MIT"
] | 7 | 2016-06-20T17:50:06.000Z | 2019-12-13T17:27:46.000Z | dali/activation.py | JonathanRaiman/dali-cython | e258469aeb1d4cb3e4cdf5c07e8948f461a038f1 | [
"MIT"
] | 6 | 2015-08-04T07:25:38.000Z | 2015-08-13T22:06:22.000Z | dali/activation.py | JonathanRaiman/dali-cython | e258469aeb1d4cb3e4cdf5c07e8948f461a038f1 | [
"MIT"
] | 2 | 2016-07-04T21:38:14.000Z | 2016-08-31T02:53:19.000Z | """
The point of this file is to make those
functions pickle friendly
"""
from dali.core import MatOps as ops
class tanh_object(object):
def __call__(self, *args, **kwargs):
return ops.tanh(*args, **kwargs)
class relu_object(object):
def __call__(self, *args, **kwargs):
return ops.relu(*args, **kwargs)
class sigmoid_object(object):
def __call__(self, *args, **kwargs):
return ops.sigmoid(*args, **kwargs)
class identity_object(object):
def __call__(self, *args, **kwargs):
assert len(args) == 1
assert len(kwargs) == 0
return args[0]
tanh = tanh_object()
relu = relu_object()
sigmoid = sigmoid_object()
identity = identity_object()
__all__ = ["tanh", "relu", "sigmoid", "identity"]
| 24.612903 | 49 | 0.648755 | 98 | 763 | 4.765306 | 0.367347 | 0.149893 | 0.12848 | 0.162741 | 0.340471 | 0.340471 | 0.340471 | 0.269807 | 0.269807 | 0 | 0 | 0.004975 | 0.209699 | 763 | 30 | 50 | 25.433333 | 0.769486 | 0.08519 | 0 | 0.2 | 0 | 0 | 0.033333 | 0 | 0 | 0 | 0 | 0 | 0.1 | 1 | 0.2 | false | 0 | 0.05 | 0.15 | 0.65 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5fe2c9fcbfca9d2c86dd2a8d54c70b0cf333213b | 562 | py | Python | OOP_exam_23_08_21/project/astronaut/astronaut_repository.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | OOP_exam_23_08_21/project/astronaut/astronaut_repository.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | OOP_exam_23_08_21/project/astronaut/astronaut_repository.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | from OOP_exam_23_08_21.project.astronaut.astronaut import Astronaut
# from project.astronaut.astronaut import Astronaut
class AstronautRepository:
def __init__(self):
self.astronauts = [] # objects
def add(self, astronaut: Astronaut):
self.astronauts.append(astronaut)
def remove(self, astronaut: Astronaut):
self.astronauts.remove(astronaut)
def find_by_name(self, name: str):
for astronaut in self.astronauts:
if astronaut.name == name:
return astronaut
return None
| 23.416667 | 67 | 0.676157 | 63 | 562 | 5.873016 | 0.444444 | 0.194595 | 0.135135 | 0.167568 | 0.410811 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014151 | 0.245552 | 562 | 23 | 68 | 24.434783 | 0.858491 | 0.101423 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.076923 | 0 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
5fe7b20a84b90f8ee2b9d58310ff415f2dd0a835 | 3,885 | py | Python | facility/test/facility_grader_test.py | mike715/assignment | f69378420ce2bb845abaef0f448eab303aa7a7e7 | [
"MIT"
] | 101 | 2016-08-08T05:41:27.000Z | 2022-03-09T15:04:42.000Z | facility/test/facility_grader_test.py | sthagen/assignment | 57d18b188177269c8fe07f3d9bef416720c7b465 | [
"MIT"
] | 44 | 2016-08-07T20:57:56.000Z | 2022-02-01T08:07:50.000Z | facility/test/facility_grader_test.py | sthagen/assignment | 57d18b188177269c8fe07f3d9bef416720c7b465 | [
"MIT"
] | 88 | 2016-10-05T23:38:45.000Z | 2022-02-28T09:28:46.000Z | import sys, os, pytest
sys.path.append(os.getcwd())
from do_grader_lib import PartQuality
from facility import grader
with open('facility/data/fl_3_1', 'r') as input_data_file:
input_data = input_data_file.read()
quality = PartQuality('test', 4052, 2546)
greedy_submission = '2550.013 0\n1 1 0 2\n123\n'
opt_submission = '2545.771 0\n0 0 1 2\n123\n'
# Score Test
def test_full_credit():
result = grader.grade(input_data, quality, opt_submission)
assert(result['score'] == 1.0)
def test_full_credit_opt():
result = grader.grade(input_data, quality, '2545.771 1\n0 0 1 2\n123\n')
assert(result['score'] == 1.0)
def test_full_credit_opt_big():
result = grader.grade(input_data, quality, '2545.771 99\n0 0 1 2\n123\n')
assert(result['score'] == 1.0)
def test_full_credit_opt_neg():
result = grader.grade(input_data, quality, '2545.771 -99\n0 0 1 2\n123\n')
assert(result['score'] == 1.0)
def test_partial_credit():
result = grader.grade(input_data, quality, greedy_submission)
assert(result['score'] == 0.7)
def test_feasible_credit():
result = grader.grade(input_data, quality, '6859.940 0\n2 2 2 2\n123\n')
assert(result['score'] == 0.3)
def test_partial_credit_timelimit():
result = grader.grade(input_data, quality, '2545.771 0\n0 0 1 2\n99999\n')
assert(result['score'] == 0.7)
assert('runtime exceeded' in result['feedback'])
def test_objective_value_warning():
result = grader.grade(input_data, quality, '2000 0\n0 0 1 2\n123\n')
assert(result['score'] == 1.0)
assert('Warning' in result['feedback'])
# Not implementable without the leader board
# passed += testGrade(grade, metadata, db, 'Opt Flag Warning (7/10): ' , '2545.771 1\n1 1 0 2\n123\n', 7)
# Constraint Tests
def test_capacity_one_violated():
result = grader.grade(input_data, quality, '4.0 0\n0 0 0 0\n123\n')
assert(result['score'] == 0.0)
def test_capacity_two_violated():
result = grader.grade(input_data, quality, '4.0 0\n0 1 0 1\n123\n')
assert(result['score'] == 0.0)
# I/O Tests
def test_objective_line_long():
result = grader.grade(input_data, quality, '2545.771 0 0\n0 0 1 2\n123\n')
assert(result['score'] == 0.0)
def test_objective_line_short():
result = grader.grade(input_data, quality, '0\n0 0 1 2\n123\n')
assert(result['score'] == 0.0)
def test_solution_line_long():
result = grader.grade(input_data, quality, '2545.771 0\n0 0 1 2 2\n123\n')
assert(result['score'] == 0.0)
def test_solution_line_short():
result = grader.grade(input_data, quality, '2545.771 0\n0 0 1 2 2\n123\n')
assert(result['score'] == 0.0)
def test_line_count_long():
result = grader.grade(input_data, quality, '0\n702.788 0\n0 0 1 2\n123\n')
assert(result['score'] == 0.0)
def test_line_count_short():
result = grader.grade(input_data, quality, '0 0 1 2\n123\n')
assert(result['score'] == 0.0)
# Type Tests
def test_nan_objective():
result = grader.grade(input_data, quality, 'NaN 0\n0 0 1 2\n123\n')
assert(result['score'] == 0.0)
def test_inf_objective():
result = grader.grade(input_data, quality, 'Inf 0\n0 0 1 2\n123\n')
assert(result['score'] == 0.0)
def test_alpha_objective():
result = grader.grade(input_data, quality, 'a 0\n0 0 1 2\n123\n')
assert(result['score'] == 0.0)
def test_alpha_optflag():
result = grader.grade(input_data, quality, '2545.771 b\n0 0 1 2\n123\n')
assert(result['score'] == 0.0)
def test_alpha_solution():
result = grader.grade(input_data, quality, '2545.771 0\n0 c 1 2\n123\n')
assert(result['score'] == 0.0)
def test_alpha_time():
result = grader.grade(input_data, quality, '19 0\n0 0 1 1\n123d\n')
assert(result['score'] == 0.0)
def test_range_solution():
result = grader.grade(input_data, quality, '2545.771 0\n0 0 1 4\n123d\n')
assert(result['score'] == 0.0)
| 32.107438 | 106 | 0.676963 | 657 | 3,885 | 3.855403 | 0.162861 | 0.092381 | 0.154362 | 0.199763 | 0.728385 | 0.712989 | 0.679037 | 0.539676 | 0.453612 | 0.441374 | 0 | 0.114084 | 0.162934 | 3,885 | 120 | 107 | 32.375 | 0.664822 | 0.05045 | 0 | 0.3 | 0 | 0 | 0.199402 | 0 | 0 | 0 | 0 | 0 | 0.3125 | 1 | 0.2875 | false | 0 | 0.0375 | 0 | 0.325 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5ff3eeb8be9ede8dc03d0fb54259c6c059f57e36 | 473 | py | Python | tests/integration/schema/test_empty.py | sthagen/p1c2u-openapi-core | 16278893f1be570b7e643a088c81d6c9bd7d76b2 | [
"BSD-3-Clause"
] | 1 | 2021-11-05T19:02:04.000Z | 2021-11-05T19:02:04.000Z | tests/integration/schema/test_empty.py | sthagen/openapi-core | 16278893f1be570b7e643a088c81d6c9bd7d76b2 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/schema/test_empty.py | sthagen/openapi-core | 16278893f1be570b7e643a088c81d6c9bd7d76b2 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from jsonschema.exceptions import ValidationError
from openapi_core.spec import OpenAPIv30Spec as Spec
class TestEmpty:
@pytest.fixture
def spec_dict(self, factory):
return factory.spec_from_file("data/v3.0/empty.yaml")
@pytest.fixture
def spec(self, spec_dict):
return Spec.create(spec_dict)
def test_raises_on_invalid(self, spec_dict):
with pytest.raises(ValidationError):
Spec.create(spec_dict)
| 24.894737 | 61 | 0.723044 | 62 | 473 | 5.33871 | 0.5 | 0.120846 | 0.096677 | 0.120846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010526 | 0.196617 | 473 | 18 | 62 | 26.277778 | 0.860526 | 0 | 0 | 0.153846 | 0 | 0 | 0.042283 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.230769 | 0.153846 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
270e28aef1680ab2186f73546d9a005c6d71482b | 594 | py | Python | built_in_functions/count_of_a.py | magicalcarpet/the_complete_python_course | 0ac0c5015a93607d7d29258ac0a3fc38dda81bd2 | [
"MIT"
] | null | null | null | built_in_functions/count_of_a.py | magicalcarpet/the_complete_python_course | 0ac0c5015a93607d7d29258ac0a3fc38dda81bd2 | [
"MIT"
] | null | null | null | built_in_functions/count_of_a.py | magicalcarpet/the_complete_python_course | 0ac0c5015a93607d7d29258ac0a3fc38dda81bd2 | [
"MIT"
] | null | null | null | # Declare a count_of_a function that accepts a list of strings.
# It should return a list with counts of how many “a” characters appear per string.
# Do NOT use list comprehension.
#
# EXAMPLES:
# count_of_a(["alligator", "aardvark", "albatross"]) => [2, 3, 2]
# count_of_a(["plywood"]) => [0]
# count_of_a([]) => []
def count_of_a(strings):
return list(map(lambda string: string.count("a") , strings))
print(count_of_a(["alligator", "aardvark", "albatross"]))
print(count_of_a(["plywood"]))
print(count_of_a([]))
| 33 | 83 | 0.60101 | 80 | 594 | 4.2625 | 0.45 | 0.164223 | 0.187683 | 0.11437 | 0.199413 | 0.199413 | 0 | 0 | 0 | 0 | 0 | 0.008909 | 0.244108 | 594 | 17 | 84 | 34.941176 | 0.750557 | 0.626263 | 0 | 0 | 0 | 0 | 0.160377 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0.2 | 0.4 | 0.6 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 3 |
2710bfb4e50c7078830c6b22e20e373c5888b564 | 157 | py | Python | ex046.py | vinisantos7/PythonExercicios | bc8f38e03a606d6b0216632a93affeab0792e534 | [
"MIT"
] | 2 | 2021-11-04T21:09:11.000Z | 2021-11-08T09:42:10.000Z | ex046.py | vinisantos7/PythonExercicios | bc8f38e03a606d6b0216632a93affeab0792e534 | [
"MIT"
] | null | null | null | ex046.py | vinisantos7/PythonExercicios | bc8f38e03a606d6b0216632a93affeab0792e534 | [
"MIT"
] | null | null | null | print("-"*20)
print("Festa de Ano Novo")
print("-"*20)
from time import sleep
for c in range(10, -1, -1):
print(c)
sleep(1)
print("Feliz Ano Novo!") | 17.444444 | 27 | 0.611465 | 28 | 157 | 3.428571 | 0.607143 | 0.145833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.070313 | 0.184713 | 157 | 9 | 28 | 17.444444 | 0.679688 | 0 | 0 | 0.25 | 0 | 0 | 0.21519 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0.625 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
2760db754dea8c385d2debb39f13d790d470af1f | 56 | py | Python | code/twostones.py | kkirigaya/Kattis | 29b7180aef70f51ea5b4d064204f70fc6d29d312 | [
"MIT"
] | 1 | 2021-06-05T20:52:43.000Z | 2021-06-05T20:52:43.000Z | code/twostones.py | kkirigaya/Kattis | 29b7180aef70f51ea5b4d064204f70fc6d29d312 | [
"MIT"
] | null | null | null | code/twostones.py | kkirigaya/Kattis | 29b7180aef70f51ea5b4d064204f70fc6d29d312 | [
"MIT"
] | null | null | null | n = int(input())
print("Alice" if n%2 == 1 else "Bob")
| 14 | 37 | 0.553571 | 11 | 56 | 2.818182 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044444 | 0.196429 | 56 | 3 | 38 | 18.666667 | 0.644444 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
27696f206f7eafefa1ab7a6485c096bd7461f6a9 | 3,525 | py | Python | wow/query/query.py | mjsmagalhaes/examples-datascience | bd7e9cb5cc5c42e3896ad134db8765c7d6f27303 | [
"MIT"
] | null | null | null | wow/query/query.py | mjsmagalhaes/examples-datascience | bd7e9cb5cc5c42e3896ad134db8765c7d6f27303 | [
"MIT"
] | null | null | null | wow/query/query.py | mjsmagalhaes/examples-datascience | bd7e9cb5cc5c42e3896ad134db8765c7d6f27303 | [
"MIT"
] | null | null | null | from __future__ import annotations
import pandas as pd
import datatable as dt
import datetime as date
from typing import Union, Dict, Set, List, Tuple
from functools import reduce
from more_itertools import ilen, islice_extended, groupby_transform
from .predicate import MapFunction, FilterPredicate
class Query:
"""
A class to create a chain of iterators to help the analysis.
"""
def __init__(self, data):
# print('New Query')
self.data = data
def __iter__(self):
return self.iter()
def iter(self):
return iter(self.data)
def apply(self, fn1, fn2: MapFunction, data) -> Query:
"""
This function should'nt be called directly.
"""
return Query(fn1(fn2, data))
def map(self, fn):
"""
A wrapper around default map function to create a chainable interface.
Args:
fn: function | tuple / list - function or group of funcions that will be
called to map each entry.
"""
if type(fn) in [list, tuple]:
def new_fn(x):
return tuple(map(lambda f: f(x), fn))
return self.apply(map, new_fn, self.iter())
else:
return self.apply(map, fn, self.iter())
def filter(self, fn: FilterPredicate) -> Query:
"""
A wrapper around default filter function to create a chainable interface.
Args:
fn: function - function that will be called to filter entries.
Returns:
The iterator wrapped in a Query object.
"""
return self.apply(filter, fn, self.iter())
def groupby(self, keyfn, valuefn=None, reducefn=list) -> Query:
"""
A wrapper around itertools.groupby function to create a chainable interface.
Args:
key: A function that will be called to determine by which value entries will be grouped by.
Returns:
The iterator wrapped in a Query object.
"""
return Query(groupby_transform(self.sort(keyfn).iter(), keyfn, valuefn, reducefn))
def slice(self, start=0, stop=None, step=1):
return Query(islice_extended(self.iter(), start, stop, step))
def sort(self, key=None, reverse=False):
return Query(sorted(self.iter(), key=key, reverse=reverse))
# --- Semi-Finalizers ---
def qlist(self):
return Query(self.list())
def qset(self):
return Query(self.set())
def reduce(self, fn):
return reduce(fn, self.iter())
# --- Finalizers ---
def set(self) -> Set:
return set(self.iter())
def list(self) -> List:
return list(self.iter())
def tuple(self) -> Tuple:
return tuple(self.iter())
def dict(self) -> Dict:
return dict(self.iter())
def pandas(self, columns: Union[List[str], None] = None) -> pd.DataFrame:
"""
Transform the iterator in this object into a Pandas DataFrame
Args:
columns: columns names or None.
Returns:
A Pandas DataFrame
"""
return pd.DataFrame(self.iter(), columns=columns)
def datatable(self, columns: Union[List[str], None] = None) -> dt.Frame:
"""
Transform the iterator in this object into a Datatable Frame.
Args:
columns: columns names or None.
Returns:
A Datatable Frame
"""
return dt.Frame(self.pandas(columns=columns))
def len(self):
return ilen(self.iter())
| 25.919118 | 101 | 0.597163 | 441 | 3,525 | 4.730159 | 0.265306 | 0.049856 | 0.036913 | 0.024449 | 0.243049 | 0.23442 | 0.209492 | 0.161074 | 0.090125 | 0 | 0 | 0.002428 | 0.299007 | 3,525 | 135 | 102 | 26.111111 | 0.841764 | 0.297305 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.384615 | false | 0 | 0.153846 | 0.25 | 0.942308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
27967813434214733a86b49ae7849642392fed1c | 12,960 | py | Python | test/test_player.py | furgerf/pyjass | a4270d2a93ec65fc5101e4595c3c0a1361c5ffbe | [
"Apache-2.0"
] | null | null | null | test/test_player.py | furgerf/pyjass | a4270d2a93ec65fc5101e4595c3c0a1361c5ffbe | [
"Apache-2.0"
] | 6 | 2020-01-28T22:35:11.000Z | 2022-02-10T00:06:37.000Z | test/test_player.py | furgerf/pyjass | a4270d2a93ec65fc5101e4595c3c0a1361c5ffbe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from config import Config
from itertools import permutations
from unittest import TestCase
from unittest.mock import MagicMock
import numpy as np
from baseline_players import RandomCardPlayer
from card import Card
from const import Const
from encoding import Encoding
from game_type import GameType
from parameterized import parameterized
from player import Player
from utils import flatten
class PlayerTest(TestCase):
# pylint: disable=invalid-name,protected-access,line-too-long
@classmethod
def setUpClass(cls):
Config.ENCODING = Encoding("better", [1, 2, 3, 4], 5, [10, 15, 20], 50, 0, 0,
relative_in_play_encoding=True, trump_code_offset=100)
def verify_card_permutations(self, all_cards_by_suit, correct_order, cards_by_suit):
all_permutations = PlayerTest.get_permutations_by_suit(all_cards_by_suit) if cards_by_suit \
else PlayerTest.get_permutations_by_value(all_cards_by_suit)
for permutation in all_permutations:
self.assertTrue(np.array_equal(Player._sort_decision_state(permutation, cards_by_suit), correct_order))
@staticmethod
def get_permutations_by_suit(cards_by_suit):
return [flatten(permutation) for permutation in permutations(cards_by_suit)]
@staticmethod
def get_permutations_by_value(cards_by_suit):
return [flatten(zip(*permutation)) for permutation in permutations(cards_by_suit)]
@staticmethod
def get_correct_decision_state(cards, order, cards_by_suit):
ordered_cards = [cards[i] for i in order]
if cards_by_suit:
return flatten(ordered_cards)
return flatten(zip(*ordered_cards))
@parameterized.expand([
[True],
[False]
])
def test_sort_decision_state(self, cards_by_suit):
all_cards = [
[1] * Const.CARDS_PER_SUIT,
[2] * Const.CARDS_PER_SUIT,
[3] * Const.CARDS_PER_SUIT,
[4] * Const.CARDS_PER_SUIT
]
correct_state = PlayerTest.get_correct_decision_state(all_cards, range(Const.SUIT_COUNT), cards_by_suit)
self.verify_card_permutations(all_cards, correct_state, cards_by_suit)
all_cards = [
[0] * Const.CARDS_PER_SUIT,
[100] * Const.CARDS_PER_SUIT,
[10] * Const.CARDS_PER_SUIT,
[255] * Const.CARDS_PER_SUIT
]
correct_state = PlayerTest.get_correct_decision_state(all_cards, [0, 2, 1, 3], cards_by_suit)
self.verify_card_permutations(all_cards, correct_state, cards_by_suit)
all_cards = [
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT
]
all_cards[0][3] = 1
all_cards[1][2] = 1
all_cards[2][1] = 1
all_cards[3][0] = 1
correct_state = PlayerTest.get_correct_decision_state(all_cards, range(Const.SUIT_COUNT), cards_by_suit)
self.verify_card_permutations(all_cards, correct_state, cards_by_suit)
all_cards = [
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT
]
all_cards[0][0] = 1
all_cards[1][0] = 2
all_cards[2][0] = 3
all_cards[3][0] = 4
correct_state = PlayerTest.get_correct_decision_state(all_cards, range(Const.SUIT_COUNT), cards_by_suit)
self.verify_card_permutations(all_cards, correct_state, cards_by_suit)
all_cards = [
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT,
[0] * Const.CARDS_PER_SUIT
]
all_cards[3][-1] = 1
all_cards[1][-1] = 2
all_cards[0][-1] = 3
all_cards[2][-1] = 4
correct_state = PlayerTest.get_correct_decision_state(all_cards, [3, 1, 0, 2], cards_by_suit)
self.verify_card_permutations(all_cards, correct_state, cards_by_suit)
all_cards = [range(i*Const.CARDS_PER_SUIT, (i+1)*Const.CARDS_PER_SUIT) for i in range(Const.SUIT_COUNT)]
correct_state = PlayerTest.get_correct_decision_state(all_cards, range(Const.SUIT_COUNT), cards_by_suit)
self.verify_card_permutations(all_cards, correct_state, cards_by_suit)
all_cards = [range(i*Const.CARDS_PER_SUIT, (i+1)*Const.CARDS_PER_SUIT) for i in range(Const.SUIT_COUNT-1, -1, -1)]
correct_state = PlayerTest.get_correct_decision_state(all_cards, range(Const.SUIT_COUNT-1, -1, -1), cards_by_suit)
self.verify_card_permutations(all_cards, correct_state, cards_by_suit)
@parameterized.expand([
[True],
[False]
])
def test_sort_decision_state_randomized(self, cards_by_suit):
np.random.seed(42)
for _ in range(int(1e2)):
all_cards = [
list(np.random.randint(0, 255, Const.CARDS_PER_SUIT)),
list(np.random.randint(0, 255, Const.CARDS_PER_SUIT)),
list(np.random.randint(0, 255, Const.CARDS_PER_SUIT)),
list(np.random.randint(0, 255, Const.CARDS_PER_SUIT))
]
first_order = Player._sort_decision_state(
PlayerTest.get_correct_decision_state(all_cards, range(Const.SUIT_COUNT), cards_by_suit), cards_by_suit)
self.verify_card_permutations(all_cards, first_order, cards_by_suit)
@parameterized.expand([
[GameType.OBENABE],
[GameType.UNNENUFE]
])
def test_get_valid_cards_to_play_non_trump(self, game_type):
testee = RandomCardPlayer("testee", 0, MagicMock())
testee.hand = [
Card(Card.SPADES, 5), # J
Card(Card.HEARTS, 0), # 6
Card(Card.HEARTS, 7), # K
Card(Card.CLUBS, 3), # 9
]
# no cards played yet
self.assertEqual(testee.get_valid_cards_to_play([], game_type), testee.hand)
# can't match suit
self.assertEqual(testee.get_valid_cards_to_play([Card(Card.DIAMONDS, 1)], game_type), testee.hand)
self.assertEqual(testee.get_valid_cards_to_play([
Card(Card.DIAMONDS, 1), Card(Card.SPADES, 1), Card(Card.HEARTS, 1)], game_type), testee.hand)
# can match suit
self.assertEqual(testee.get_valid_cards_to_play([Card(Card.SPADES, 1)], game_type), [Card(Card.SPADES, 5)])
self.assertEqual(testee.get_valid_cards_to_play([Card(Card.HEARTS, 1)], game_type),
[Card(Card.HEARTS, 0), Card(Card.HEARTS, 7)])
self.assertEqual(testee.get_valid_cards_to_play([Card(Card.CLUBS, 1)], game_type), [Card(Card.CLUBS, 3)])
def test_get_valid_cards_to_play_trump(self):
testee = RandomCardPlayer("testee", 0, MagicMock())
testee.hand = [
Card(Card.SPADES, 5), # J
Card(Card.HEARTS, 5), # J
Card(Card.HEARTS, 7), # K
Card(Card.CLUBS, 3), # 9
]
# non-trump is played without any trump in play
game_type = GameType.TRUMP_HEARTS
played_cards = [Card(Card.SPADES, 1)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.SPADES, 5), Card(Card.HEARTS, 5), Card(Card.HEARTS, 7)])
game_type = GameType.TRUMP_CLUBS
played_cards = [Card(Card.SPADES, 1), Card(Card.DIAMONDS, 3)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.SPADES, 5), Card(Card.CLUBS, 3)])
# non-trump is played which can't be matched without any trump in play
game_type = GameType.TRUMP_HEARTS
played_cards = [Card(Card.DIAMONDS, 1), Card(Card.CLUBS, 8)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.SPADES, 5), Card(Card.HEARTS, 5), Card(Card.HEARTS, 7), Card(Card.CLUBS, 3)])
# non-trump is played with a trump in play
game_type = GameType.TRUMP_HEARTS
played_cards = [Card(Card.SPADES, 1), Card(Card.HEARTS, 8)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.SPADES, 5), Card(Card.HEARTS, 5)]) # not allowed to play K (undertrump)
# non-trump is played with two trumps in play
game_type = GameType.TRUMP_HEARTS
played_cards = [Card(Card.SPADES, 1), Card(Card.HEARTS, 0), Card(Card.HEARTS, 8)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.SPADES, 5), Card(Card.HEARTS, 5)]) # not allowed to play K (undertrump)
# non-trump is played which can't be matched with a trump in play
game_type = GameType.TRUMP_HEARTS
played_cards = [Card(Card.DIAMONDS, 1), Card(Card.HEARTS, 8)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.SPADES, 5), Card(Card.HEARTS, 5), Card(Card.CLUBS, 3)]) # STILL not allowed to play K (undertrump)
# trump is played
game_type = GameType.TRUMP_HEARTS
played_cards = [Card(Card.HEARTS, 1), Card(Card.HEARTS, 2)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.HEARTS, 5), Card(Card.HEARTS, 7)])
game_type = GameType.TRUMP_SPADES
played_cards = [Card(Card.SPADES, 1), Card(Card.SPADES, 2)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), testee.hand)
testee.hand = [
Card(Card.HEARTS, 5), # J
Card(Card.HEARTS, 7), # K
]
# untertrumping is allowed if there are only trumps in the hand
played_cards = [Card(Card.DIAMONDS, 1), Card(Card.HEARTS, 8)]
for card in testee.hand + played_cards:
card.set_game_type(game_type)
self.assertEqual(testee.get_valid_cards_to_play(played_cards, game_type), [Card(Card.HEARTS, 5), Card(Card.HEARTS, 7)])
def test_convert_to_relative_invalid(self):
testee = RandomCardPlayer("testee", 0, MagicMock())
# the player number must be among the valid codes and specifically, among the player codes
self.assertRaises(AssertionError, lambda: testee.convert_to_relative(6))
self.assertRaises(AssertionError, lambda: testee.convert_to_relative(106))
self.assertRaises(AssertionError, lambda: testee.convert_to_relative(10))
self.assertRaises(AssertionError, lambda: testee.convert_to_relative(50))
# unknown cards are ok and stay unknown
self.assertEqual(testee.convert_to_relative(0), 0)
def test_convert_to_relative_non_trump(self):
# non-trump in -> non-trump out
testee = RandomCardPlayer("testee", 1, MagicMock())
self.assertEqual(testee.convert_to_relative(1), 1)
self.assertEqual(testee.convert_to_relative(2), 2)
self.assertEqual(testee.convert_to_relative(3), 3)
self.assertEqual(testee.convert_to_relative(4), 4)
testee = RandomCardPlayer("testee", 2, MagicMock())
self.assertEqual(testee.convert_to_relative(1), 4)
self.assertEqual(testee.convert_to_relative(2), 1)
self.assertEqual(testee.convert_to_relative(3), 2)
self.assertEqual(testee.convert_to_relative(4), 3)
testee = RandomCardPlayer("testee", 3, MagicMock())
self.assertEqual(testee.convert_to_relative(1), 3)
self.assertEqual(testee.convert_to_relative(2), 4)
self.assertEqual(testee.convert_to_relative(3), 1)
self.assertEqual(testee.convert_to_relative(4), 2)
testee = RandomCardPlayer("testee", 4, MagicMock())
self.assertEqual(testee.convert_to_relative(1), 2)
self.assertEqual(testee.convert_to_relative(2), 3)
self.assertEqual(testee.convert_to_relative(3), 4)
self.assertEqual(testee.convert_to_relative(4), 1)
def test_convert_to_relative_trump(self):
# trump in -> trump out
testee = RandomCardPlayer("testee", 1, MagicMock())
self.assertEqual(testee.convert_to_relative(101), 101)
self.assertEqual(testee.convert_to_relative(102), 102)
self.assertEqual(testee.convert_to_relative(103), 103)
self.assertEqual(testee.convert_to_relative(104), 104)
testee = RandomCardPlayer("testee", 2, MagicMock())
self.assertEqual(testee.convert_to_relative(101), 104)
self.assertEqual(testee.convert_to_relative(102), 101)
self.assertEqual(testee.convert_to_relative(103), 102)
self.assertEqual(testee.convert_to_relative(104), 103)
testee = RandomCardPlayer("testee", 3, MagicMock())
self.assertEqual(testee.convert_to_relative(101), 103)
self.assertEqual(testee.convert_to_relative(102), 104)
self.assertEqual(testee.convert_to_relative(103), 101)
self.assertEqual(testee.convert_to_relative(104), 102)
testee = RandomCardPlayer("testee", 4, MagicMock())
self.assertEqual(testee.convert_to_relative(101), 102)
self.assertEqual(testee.convert_to_relative(102), 103)
self.assertEqual(testee.convert_to_relative(103), 104)
self.assertEqual(testee.convert_to_relative(104), 101)
| 43.489933 | 187 | 0.717361 | 1,889 | 12,960 | 4.650079 | 0.089465 | 0.053734 | 0.114754 | 0.096881 | 0.811703 | 0.767304 | 0.749317 | 0.621357 | 0.576275 | 0.548156 | 0 | 0.030239 | 0.165586 | 12,960 | 297 | 188 | 43.636364 | 0.782042 | 0.062191 | 0 | 0.414226 | 0 | 0 | 0.005939 | 0 | 0 | 0 | 0 | 0 | 0.221757 | 1 | 0.050209 | false | 0 | 0.054393 | 0.008368 | 0.125523 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
27a105b3877ad7b768063e08e01ceaa3c091d05e | 350 | py | Python | tests/plugins/matcher/matcher_permission.py | mobyw/nonebot2 | 36663f1a8a51bd89f4a60110047e73719adcc73d | [
"MIT"
] | 1 | 2022-01-26T12:52:33.000Z | 2022-01-26T12:52:33.000Z | tests/plugins/matcher/matcher_permission.py | mobyw/nonebot2 | 36663f1a8a51bd89f4a60110047e73719adcc73d | [
"MIT"
] | null | null | null | tests/plugins/matcher/matcher_permission.py | mobyw/nonebot2 | 36663f1a8a51bd89f4a60110047e73719adcc73d | [
"MIT"
] | null | null | null | from nonebot.matcher import Matcher
from nonebot.permission import Permission
default_permission = Permission()
test_permission_updater = Matcher.new(permission=default_permission)
test_custom_updater = Matcher.new(permission=default_permission)
@test_custom_updater.permission_updater
async def _() -> Permission:
return default_permission
| 25 | 68 | 0.84 | 40 | 350 | 7.05 | 0.325 | 0.241135 | 0.287234 | 0.191489 | 0.407801 | 0.407801 | 0.407801 | 0.407801 | 0.407801 | 0 | 0 | 0 | 0.097143 | 350 | 13 | 69 | 26.923077 | 0.892405 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
27b29d1c44aa39618aa218b2a1932a0614265d22 | 126 | py | Python | pyclimb/grading_system.py | ilias-ant/pyclimb | 0ef3f8483ca331965d9e03ac271f164c8efa240f | [
"MIT"
] | 5 | 2022-01-24T09:15:14.000Z | 2022-01-26T20:33:42.000Z | pyclimb/grading_system.py | ilias-ant/pyclimb | 0ef3f8483ca331965d9e03ac271f164c8efa240f | [
"MIT"
] | 2 | 2022-01-30T15:32:32.000Z | 2022-01-30T15:36:52.000Z | pyclimb/grading_system.py | ilias-ant/pyclimb | 0ef3f8483ca331965d9e03ac271f164c8efa240f | [
"MIT"
] | null | null | null | import enum
class GradingSystem(enum.Enum):
"""The supported grading systems."""
FRENCH = "French"
YDS = "YDS"
| 14 | 40 | 0.634921 | 14 | 126 | 5.714286 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.230159 | 126 | 8 | 41 | 15.75 | 0.824742 | 0.238095 | 0 | 0 | 0 | 0 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
27bfc5448f37e23d7f68ab7dc0c87a24440ebd18 | 2,061 | py | Python | stin/tests/test_unit.py | SoftwareDevEngResearch/Gas-liquid-flows | 10db5551da534341c5f1eb6f781759f68381f0ea | [
"MIT"
] | 1 | 2020-06-28T19:45:12.000Z | 2020-06-28T19:45:12.000Z | stin/tests/test_unit.py | SoftwareDevEngResearch/Gas-liquid-flows | 10db5551da534341c5f1eb6f781759f68381f0ea | [
"MIT"
] | null | null | null | stin/tests/test_unit.py | SoftwareDevEngResearch/Gas-liquid-flows | 10db5551da534341c5f1eb6f781759f68381f0ea | [
"MIT"
] | 2 | 2019-04-18T22:27:20.000Z | 2019-04-26T15:37:04.000Z | from ..functions import single_v_L, single_p, derivative_p, α_L, ρ_G, \
BC_v_G, derivative_v_G, derivative_α_G, \
derivative_v_L, cond
# tests for single_v_l function:
def test_single_v_L_internal():
assert single_v_L(0.8, 150) == 0.8
# tests for single_p function:
def test_single_p_internal():
assert single_p(1, 200, 10000000) <= 11000000
def test_single_p_edge():
assert single_p(0.8, 0, 10000000) == 10000000
# tests for derivative_p function:
def test_derivative_p_edge_left():
assert derivative_p(0.1, 0.9, 10, 0.5, 0.6) < 0
def test_derivative_p_internal():
assert derivative_p(0.5, 0.5, 10, 0.5, 0.6) < 0
def test_derivative_p_edge_right():
assert derivative_p(0.9, 0.1, 10, 0.5, 0.6) < 0
# tests for ρ_G function:
def test_ρ_G_internal():
assert ρ_G(50000000) == 260
def test_ρ_G_edge_left():
assert ρ_G(0) == 0
# tests for derivative_v_G function:
def test_derivative_v_G_edge_left():
assert derivative_v_G(0.1, 0.9, 10, -2) > 0
def test_derivative_v_G_internal():
assert derivative_v_G(0.5, 0.5, 10, -2) > 0
def test_derivative_v_G_edge_right():
assert derivative_v_G(0.8, 0.1, 10, -2) > 0
# tests for derivative_α_G function:
def test_derivative_α_G_edge_left():
assert derivative_α_G(0.2, 10, -2, 0.8, 1) > 0
def test_derivative_α_G_edge_right():
assert derivative_α_G(0.9, 10, 2, 0.8, -1) > 0
# tests for α_L function:
def test_α_L_internal():
assert α_L(0.3) == 0.7
def test_α_L_edge_left():
assert α_L(0) == 1
def test_α_L_edge_right():
assert α_L(1) == 0
# tests for derivative_v_L function:
def test_derivative_v_L_edge_left():
assert derivative_v_L(0.8, 0.2, -1) < 0
def test_derivative_v_L_internal():
assert derivative_v_L(0.8, 0.2, 0) == 0
def test_derivative_v_L_edge_right():
assert derivative_v_L(0.8, 0.2, 1) > 0
# tests for BC_v_G function:
def test_BC_v_G_internal():
assert BC_v_G(0.8, 0.5, 0.2) >= 0.8
# tests for cond function:
def test_cond_internal():
assert cond(0.8) > 0.6
| 31.227273 | 71 | 0.688986 | 401 | 2,061 | 3.189526 | 0.097257 | 0.114934 | 0.146208 | 0.098514 | 0.487099 | 0.254887 | 0.129789 | 0.129789 | 0.076622 | 0.076622 | 0 | 0.102625 | 0.186803 | 2,061 | 65 | 72 | 31.707692 | 0.660501 | 0.144105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.466667 | 1 | 0.466667 | true | 0 | 0.022222 | 0 | 0.488889 | 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 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
27dc0ffa26ebd73881d11c7c2ee88f066515deae | 424 | py | Python | src/core/search_service.py | atul94/similarity-search-service | 5e1f915f82f4ec74145cf1ef4d9a3021d46818ea | [
"Apache-2.0"
] | null | null | null | src/core/search_service.py | atul94/similarity-search-service | 5e1f915f82f4ec74145cf1ef4d9a3021d46818ea | [
"Apache-2.0"
] | null | null | null | src/core/search_service.py | atul94/similarity-search-service | 5e1f915f82f4ec74145cf1ef4d9a3021d46818ea | [
"Apache-2.0"
] | null | null | null | """Define the abstract class for similarity search service controllers"""
class SearchService:
"""Search Service handles all controllers in the search service"""
def __init__(self):
pass
def load_index(self):
pass
def load_labels(self):
pass
def similar_search_vectors(self):
pass
def refresh_index(self):
pass
def health_check(self):
pass
| 17.666667 | 73 | 0.639151 | 50 | 424 | 5.22 | 0.5 | 0.183908 | 0.210728 | 0.114943 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.287736 | 424 | 23 | 74 | 18.434783 | 0.864238 | 0.301887 | 0 | 0.461538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.461538 | false | 0.461538 | 0 | 0 | 0.538462 | 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 | 0 | 0 | 0 | 3 |
7e09fae4252b49e8420935c9e2d156fb2c2457ae | 947 | py | Python | src/exco/extractor/locator/locator_factory.py | thegangtechnology/excel_comment_orm | b38156b406ccb3ce87737b8ed049bbf3b8a39050 | [
"MIT"
] | 2 | 2020-11-10T04:53:07.000Z | 2020-11-12T03:53:46.000Z | src/exco/extractor/locator/locator_factory.py | thegangtechnology/excel_comment_orm | b38156b406ccb3ce87737b8ed049bbf3b8a39050 | [
"MIT"
] | 50 | 2020-11-09T06:30:31.000Z | 2022-01-06T05:00:50.000Z | src/exco/extractor/locator/locator_factory.py | thegangtechnology/excel_comment_orm | b38156b406ccb3ce87737b8ed049bbf3b8a39050 | [
"MIT"
] | null | null | null | from typing import Dict, Type
from exco import LocatorSpec
from exco.extractor.base_factory import BaseFactory
from exco.extractor.locator.built_in.at_comment_cell_locator import AtCommentCellLocator
from exco.extractor.locator.built_in.right_of_locator import RightOfLocator
from exco.extractor.locator.built_in.right_of_regex_locator import RightOfRegexLocator
from exco.extractor.locator.built_in.below_of_locator import BelowOfLocator
from exco.extractor.locator.locator import Locator
class LocatorFactory(BaseFactory[Locator, LocatorSpec]):
def __init__(self, class_map: Dict[str, Type[Locator]]):
super().__init__(class_map)
@classmethod
def suffix(cls):
return 'Locator'
@classmethod
def default(cls) -> 'LocatorFactory':
return cls(cls.build_class_dict([
AtCommentCellLocator,
RightOfLocator,
RightOfRegexLocator,
BelowOfLocator
]))
| 33.821429 | 88 | 0.756072 | 108 | 947 | 6.37963 | 0.361111 | 0.081277 | 0.148041 | 0.174165 | 0.20029 | 0.20029 | 0.110305 | 0.110305 | 0 | 0 | 0 | 0 | 0.173178 | 947 | 27 | 89 | 35.074074 | 0.879949 | 0 | 0 | 0.090909 | 0 | 0 | 0.022175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.136364 | false | 0 | 0.363636 | 0.090909 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
7e0f2adcfa456e7d98de1b99c1956f1512cdb215 | 106 | py | Python | frontend/api/test.py | Besutodesuka/facelink | 51895cdd3349c27eff71dffdb397d63a48c5b9c5 | [
"MIT"
] | null | null | null | frontend/api/test.py | Besutodesuka/facelink | 51895cdd3349c27eff71dffdb397d63a48c5b9c5 | [
"MIT"
] | null | null | null | frontend/api/test.py | Besutodesuka/facelink | 51895cdd3349c27eff71dffdb397d63a48c5b9c5 | [
"MIT"
] | 1 | 2021-07-18T03:21:57.000Z | 2021-07-18T03:21:57.000Z | txt = 'asdf;lkajsdf,as;lfkja'
for i in txt:
txt = txt[1:]
if i == ",":
break
print(txt) | 11.777778 | 29 | 0.5 | 17 | 106 | 3.117647 | 0.705882 | 0.226415 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013889 | 0.320755 | 106 | 9 | 30 | 11.777778 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0.205607 | 0.196262 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fd659bd5c74f2b83e12b09dad413e1f3754ae82f | 324 | py | Python | fslks/datasets/summarization/__init__.py | amoldwin/fslks-misinformation | 065ffd8c10a7d1cb7038f46875dbe8414a15752f | [
"MIT"
] | null | null | null | fslks/datasets/summarization/__init__.py | amoldwin/fslks-misinformation | 065ffd8c10a7d1cb7038f46875dbe8414a15752f | [
"MIT"
] | null | null | null | fslks/datasets/summarization/__init__.py | amoldwin/fslks-misinformation | 065ffd8c10a7d1cb7038f46875dbe8414a15752f | [
"MIT"
] | null | null | null | from .bioasq import Bioasq
from .duc import Duc
from .medlineplus_references import MedlineplusReferences
from .medlineplus_reviews import MedlineplusReviews
from .medinfo import Medinfo
from .ebm import EBM
from .pubmed import PubmedSumm
from .chiqa import Chiqa
from .cochrane_summ import CochraneSumm
from .tac import Tac | 32.4 | 57 | 0.848765 | 43 | 324 | 6.325581 | 0.418605 | 0.110294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12037 | 324 | 10 | 58 | 32.4 | 0.954386 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
fdba2414d1deddc2503216621dc63c9cbb84823c | 304 | py | Python | katas/kyu_7/interactive_dictionary.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/kyu_7/interactive_dictionary.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/kyu_7/interactive_dictionary.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | class Dictionary(object):
def __init__(self):
self.my_dict = {}
def look(self, key):
return self.my_dict.get(key, "Can't find entry for {}".format(key))
def newentry(self, key, value):
""" new_entry == PEP8 (forced by Codewars) """
self.my_dict[key] = value
| 27.636364 | 75 | 0.592105 | 42 | 304 | 4.095238 | 0.595238 | 0.104651 | 0.174419 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004425 | 0.256579 | 304 | 10 | 76 | 30.4 | 0.756637 | 0.125 | 0 | 0 | 0 | 0 | 0.089147 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0 | 0 | 0.142857 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
fdd4ba1e3f788ef6b36041898d0225577346650f | 395 | py | Python | censor_swear/censor_app/dialog/urls.py | vuluc88/censor_swear | 057a35f3169f6673c502bda2559cb54be66fc46d | [
"BSD-3-Clause"
] | null | null | null | censor_swear/censor_app/dialog/urls.py | vuluc88/censor_swear | 057a35f3169f6673c502bda2559cb54be66fc46d | [
"BSD-3-Clause"
] | null | null | null | censor_swear/censor_app/dialog/urls.py | vuluc88/censor_swear | 057a35f3169f6673c502bda2559cb54be66fc46d | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from .project_views import *
from .project_import_views import *
urlpatterns = [
path('<int:project_id>/upload-raw-masking-data', UploadRawMaskingDataView.as_view()),
path('<int:project_id>/masking/system_verify_count', get_masking_csv_system_verify_count),
path('<int:project_id>/masking/manual_verify_count', get_masking_csv_manually_verify_count),
]
| 39.5 | 96 | 0.794937 | 54 | 395 | 5.425926 | 0.444444 | 0.150171 | 0.143345 | 0.163823 | 0.320819 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088608 | 395 | 9 | 97 | 43.888889 | 0.813889 | 0 | 0 | 0 | 0 | 0 | 0.324051 | 0.324051 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
fde6771e1925ab6cfba7aac283ef3a3dd554a088 | 803 | py | Python | leetcode/0867_transpose_matrix.py | chaosWsF/Python-Practice | ff617675b6bcd125933024bb4c246b63a272314d | [
"BSD-2-Clause"
] | null | null | null | leetcode/0867_transpose_matrix.py | chaosWsF/Python-Practice | ff617675b6bcd125933024bb4c246b63a272314d | [
"BSD-2-Clause"
] | null | null | null | leetcode/0867_transpose_matrix.py | chaosWsF/Python-Practice | ff617675b6bcd125933024bb4c246b63a272314d | [
"BSD-2-Clause"
] | null | null | null | """
Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it's
main diagonal, switching the row and column indices of the matrix.
https://assets.leetcode.com/uploads/2019/10/20/hint_transpose.png
Example 1:
Input: [[1,2,3],[4,5,6],[7,8,9]]
Output: [[1,4,7],[2,5,8],[3,6,9]]
Example 2:
Input: [[1,2,3],[4,5,6]]
Output: [[1,4],[2,5],[3,6]]
Note:
1. 1 <= A.length <= 1000
2. 1 <= A[0].length <= 1000
"""
import numpy as np
class Solution:
def transpose1(self, A):
C = len(A[0])
A = sum(A, [])
return [A[i::C] for i in range(C)]
def transpose2(self, A):
return np.array(A).T.tolist()
def transpose3(self, A):
return [[row[i] for row in A] for i in range(len(A[0]))]
| 22.305556 | 103 | 0.569116 | 147 | 803 | 3.102041 | 0.44898 | 0.061404 | 0.061404 | 0.065789 | 0.048246 | 0.048246 | 0.048246 | 0 | 0 | 0 | 0 | 0.095552 | 0.244085 | 803 | 35 | 104 | 22.942857 | 0.655684 | 0.587796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.2 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
8bf61763ae2916b8f468302c1c2a66d6b273fc38 | 136 | py | Python | inventario/apps.py | mariobp/geoactivos | 02234dee8ae9d95f3b9187104b75e2bb68957f71 | [
"MIT"
] | null | null | null | inventario/apps.py | mariobp/geoactivos | 02234dee8ae9d95f3b9187104b75e2bb68957f71 | [
"MIT"
] | null | null | null | inventario/apps.py | mariobp/geoactivos | 02234dee8ae9d95f3b9187104b75e2bb68957f71 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class InventarioConfig(AppConfig):
name = 'inventario'
| 17 | 39 | 0.801471 | 15 | 136 | 6.933333 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 136 | 7 | 40 | 19.428571 | 0.896552 | 0 | 0 | 0 | 0 | 0 | 0.073529 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
8bf866c3dcb9fb79a1545227f846ae16e36c3836 | 354 | py | Python | baekjoon/9012/valid_parenthesis_string.py | ucyang/AlgoEx | 465c88f04b9449c06ee5c9a684ded5aba8ccf399 | [
"MIT"
] | null | null | null | baekjoon/9012/valid_parenthesis_string.py | ucyang/AlgoEx | 465c88f04b9449c06ee5c9a684ded5aba8ccf399 | [
"MIT"
] | null | null | null | baekjoon/9012/valid_parenthesis_string.py | ucyang/AlgoEx | 465c88f04b9449c06ee5c9a684ded5aba8ccf399 | [
"MIT"
] | null | null | null | import sys
input = lambda: sys.stdin.readline().rstrip()
for _ in range(int(input())):
left_paren_count = 0
for c in input():
if c == "(":
left_paren_count += 1
elif c == ")":
left_paren_count -= 1
if left_paren_count < 0:
break
print("NO" if left_paren_count else "YES")
| 23.6 | 46 | 0.528249 | 47 | 354 | 3.744681 | 0.510638 | 0.255682 | 0.397727 | 0.170455 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017316 | 0.347458 | 354 | 14 | 47 | 25.285714 | 0.744589 | 0 | 0 | 0 | 0 | 0 | 0.019774 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0.083333 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e302285e4a28c0820b57ed3dffce9df164d326d5 | 291 | py | Python | model/lstm_network.py | Kirichenkov9/Network_ML | f3b1b1c85394563574fd2cef77ed6fe6887bc790 | [
"MIT"
] | 30 | 2017-12-28T08:38:15.000Z | 2022-03-04T07:56:41.000Z | model/lstm_network.py | keaideii/ML-IDS | acd4c66c1eac3e1b42fe8f064869779d0d4de2cc | [
"MIT"
] | null | null | null | model/lstm_network.py | keaideii/ML-IDS | acd4c66c1eac3e1b42fe8f064869779d0d4de2cc | [
"MIT"
] | 18 | 2017-09-03T10:15:29.000Z | 2022-02-25T16:03:14.000Z | import tensorflow as tf
from base_model import BaseModel
class LSTMNN(object):
"""
LSTM neural network class, inherits from BaseModel
"""
def train(self):
"""
Fit the LSTM neural network to the data
"""
raise NotImplementedError()
| 18.1875 | 58 | 0.608247 | 32 | 291 | 5.5 | 0.75 | 0.113636 | 0.193182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.319588 | 291 | 15 | 59 | 19.4 | 0.888889 | 0.309278 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
e30754ef129e99cc1da4eedd5d5f7ccc6895d9a9 | 1,685 | py | Python | helpers/logger.py | ivanshamilov/bsc_thesis | e2646c8ea640264983d8af69403e2c95eee8aa7c | [
"MIT"
] | null | null | null | helpers/logger.py | ivanshamilov/bsc_thesis | e2646c8ea640264983d8af69403e2c95eee8aa7c | [
"MIT"
] | null | null | null | helpers/logger.py | ivanshamilov/bsc_thesis | e2646c8ea640264983d8af69403e2c95eee8aa7c | [
"MIT"
] | null | null | null | from datetime import datetime
class bcolors:
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
class Logger(object):
@staticmethod
def write_logs(to_write):
with open("nn_diploma.logs", "a") as f:
f.write(f"{to_write}\n")
@staticmethod
def info(toprint, log=True, console=True):
time = datetime.now().strftime("%m/%d/%Y %H:%M:%S")
if console:
print(f"{bcolors.OKCYAN}[{time}] [INFO] {toprint}{bcolors.ENDC}")
if log:
Logger.write_logs(f"{bcolors.OKCYAN}[{time}] [INFO] {toprint}{bcolors.ENDC}")
@staticmethod
def ok(toprint, log=True, console=True):
time = datetime.now().strftime("%m/%d/%Y %H:%M:%S")
if console:
print(f"{bcolors.OKGREEN}[{time}] [OK] {toprint}{bcolors.ENDC}")
if log:
Logger.write_logs(f"{bcolors.OKGREEN}[{time}] [OK] {toprint}{bcolors.ENDC}")
@staticmethod
def warning(toprint, log=True, console=True):
time = datetime.now().strftime("%m/%d/%Y %H:%M:%S")
if console:
print(f"{bcolors.WARNING}[{time}] [WARN] {toprint}{bcolors.ENDC}")
if log:
Logger.write_logs(f"{bcolors.WARNING}[{time}] [WARN] {toprint}{bcolors.ENDC}")
@staticmethod
def fail(toprint, log=True, console=True):
time = datetime.now().strftime("%m/%d/%Y %H:%M:%S")
if console:
print(f"{bcolors.FAIL}[{time}] [FAIL] {toprint}{bcolors.ENDC}")
if log:
Logger.write_logs(f"{bcolors.FAIL}[{time}] [FAIL] {toprint}{bcolors.ENDC}")
| 32.403846 | 90 | 0.567953 | 218 | 1,685 | 4.353211 | 0.238532 | 0.067439 | 0.151739 | 0.088514 | 0.751317 | 0.703899 | 0.703899 | 0.703899 | 0.514226 | 0.514226 | 0 | 0.025761 | 0.239763 | 1,685 | 51 | 91 | 33.039216 | 0.715066 | 0 | 0 | 0.404762 | 0 | 0 | 0.347774 | 0.223145 | 0 | 0 | 0 | 0 | 0 | 1 | 0.119048 | false | 0 | 0.02381 | 0 | 0.357143 | 0.285714 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e30a3a95d35fc909de3e39f9291b411a51df178c | 62 | py | Python | files/sum_of_10.py | AjayRajNelapudi/Script-Evaluation-Assistant | 200a3fc11e15f22b812c829d133707393be39c23 | [
"MIT"
] | 1 | 2018-09-22T10:10:42.000Z | 2018-09-22T10:10:42.000Z | files/sum_of_10.py | AjayRajNelapudi/Script-Evaluation-Assistant | 200a3fc11e15f22b812c829d133707393be39c23 | [
"MIT"
] | 1 | 2018-09-16T14:44:47.000Z | 2018-09-16T14:44:47.000Z | files/sum_of_10.py | AjayRajNelapudi/Script-Evaluation-Assistant | 200a3fc11e15f22b812c829d133707393be39c23 | [
"MIT"
] | 3 | 2018-09-16T14:37:55.000Z | 2018-09-30T06:44:49.000Z | numbers = list(map(int, input().split()))
print(sum(numbers))
| 20.666667 | 41 | 0.677419 | 9 | 62 | 4.666667 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.080645 | 62 | 2 | 42 | 31 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
e30f53801be36af85c6a87c3788203b4fcdb5382 | 34 | py | Python | data.py | pysg/pyther | 6a47fc41533cc50bc64134e42ddd3ed8d54d75c7 | [
"MIT"
] | 9 | 2017-07-10T19:21:35.000Z | 2022-01-24T16:41:34.000Z | data.py | NERD-cpu/pyther | 6a47fc41533cc50bc64134e42ddd3ed8d54d75c7 | [
"MIT"
] | 1 | 2017-05-28T01:45:00.000Z | 2018-01-08T14:54:31.000Z | data.py | NERD-cpu/pyther | 6a47fc41533cc50bc64134e42ddd3ed8d54d75c7 | [
"MIT"
] | 3 | 2017-08-18T18:47:21.000Z | 2021-03-01T02:25:24.000Z | name = input("What's your name? ") | 34 | 34 | 0.647059 | 6 | 34 | 3.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 34 | 1 | 34 | 34 | 0.758621 | 0 | 0 | 0 | 0 | 0 | 0.514286 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e3326ad8d4355735bdab5e8755d4a05edef9141b | 65 | py | Python | plugins/s3/kpireport_s3/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 9 | 2021-05-17T05:32:46.000Z | 2022-03-16T22:49:26.000Z | plugins/s3/kpireport_s3/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 4 | 2020-10-10T23:38:20.000Z | 2020-11-08T22:41:24.000Z | plugins/s3/kpireport_s3/__init__.py | diurnalist/kpireporter | b3ce9ca52567405557ea12f45c1a7fda076d746a | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 1 | 2021-01-12T02:49:04.000Z | 2021-01-12T02:49:04.000Z | from .output import S3OutputDriver
__all__ = ["S3OutputDriver"]
| 16.25 | 34 | 0.784615 | 6 | 65 | 7.833333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035088 | 0.123077 | 65 | 3 | 35 | 21.666667 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0.215385 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
e33decdf79ad48289a3f736f72be7a7f60672fc4 | 202 | py | Python | Chapter04/receipts_make.py | PacktPublishing/Secret-Recipes-of-the-Python-Ninja | 805d00c7a54927ba94c9077e9a580508ee3c5e56 | [
"MIT"
] | 13 | 2018-06-21T01:44:49.000Z | 2021-12-01T10:49:53.000Z | Chapter04/receipts_make.py | PacktPublishing/Secret-Recipes-of-the-Python-Ninja | 805d00c7a54927ba94c9077e9a580508ee3c5e56 | [
"MIT"
] | null | null | null | Chapter04/receipts_make.py | PacktPublishing/Secret-Recipes-of-the-Python-Ninja | 805d00c7a54927ba94c9077e9a580508ee3c5e56 | [
"MIT"
] | 6 | 2018-10-05T08:29:24.000Z | 2022-01-11T14:49:50.000Z | In [18]: my_list = [27, "11-13-2017", 84.98, 5]
In [19]: store27 = salesReceipt._make(my_list)
In [20]: print(store27)
salesReceipt(storeID=27, saleDate='11-13-2017', saleAmount=84.98, totalGuests=5)
| 28.857143 | 80 | 0.693069 | 34 | 202 | 4.029412 | 0.617647 | 0.087591 | 0.116788 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 0.108911 | 202 | 6 | 81 | 33.666667 | 0.538889 | 0 | 0 | 0 | 0 | 0 | 0.09901 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8b51acd1f58c8c904d102f8b2859eb1508c6dbb2 | 1,624 | py | Python | part6/func_mapping.py | tls1403/PythonTest | 069f23b25ec655aa199d13aef9c14d2e33366861 | [
"MIT"
] | null | null | null | part6/func_mapping.py | tls1403/PythonTest | 069f23b25ec655aa199d13aef9c14d2e33366861 | [
"MIT"
] | null | null | null | part6/func_mapping.py | tls1403/PythonTest | 069f23b25ec655aa199d13aef9c14d2e33366861 | [
"MIT"
] | null | null | null | import seaborn as sns
titanic = sns.load_dataset('titanic')
df = titanic.loc[:,['age','fare']]
df['ten'] = 10
def add_10(n):
return n+10
def add_two_obj(a,b):
return a+b
#시리즈 변수에 적용
# print(df['age'].head())
# print('\n')
sr1 = df['age'].apply(add_10) #모든행에 add_10 함수 적용
# print(sr1.head())
# print('\n')
sr2 = df['age'].apply(add_two_obj,b = 10) #모든행에 add_two_obj('age',10)
# print(sr2.head())
# print('\n')
#lambda 함수 활용: 시리즈 객체에 적용
sr3 = df['age'].apply(lambda x: add_10(x)) # x = df['age']
# print(sr3.head())
#데이터프레임에 적용
#데이터프레임에 add_10() 함수를 매핑 적용
df_map = df.applymap(add_10)
# print(df_map.head())
#시리즈객체에 함수 매핑
#데이터 프레임의 각 열에 함수 매핑
def missing_value(series): #시리즈를 인자로 전달
return series.isnull()
result = df.apply(missing_value,axis =0) #각 열 age, fare 을 매핑함수에 전달하고 각 열의 리턴값은 시리즈 형태로 반환된다. 시리즈가 합쳐져서 데이터프레임이된다.
# print(result.head())
def min_max(x): #최대값 - 최소값
return x.max() - x.min()
result1 =df.apply(min_max) #기본값 axis = 0
# print(result1)
def add_two_obj(a,b):
return a + b
# x = df , a = df['age'] , b = df['ten']
df['add'] = df.apply(lambda x : add_two_obj(x['age'],x['ten']),axis = 1)
# print(df.head())
#각 열의 NaN 찾기 = 데이터프레임 반환
def missing_value(x):
return x.isnull()
#각 열의 NaN 개수 반환 = 시리즈 반환
def missing_count(x):
return missing_value(x).sum()
# 데이터프레임의 총 NaN 개수 - 데이터프레임을 전달하면 값 반환
def total_number_missing(x):
return missing_count(x).sum()
df.drop(['ten','add'],inplace= True,axis = 1)
result_df = df.pipe(missing_value)
result_series = df.pipe(missing_count)
# print(result_series)
result_value = df.pipe(total_number_missing)
print(result_value) | 21.090909 | 113 | 0.653941 | 298 | 1,624 | 3.436242 | 0.308725 | 0.029297 | 0.043945 | 0.023438 | 0.042969 | 0.042969 | 0.042969 | 0.042969 | 0.042969 | 0 | 0 | 0.023669 | 0.167488 | 1,624 | 77 | 114 | 21.090909 | 0.733728 | 0.364532 | 0 | 0.125 | 0 | 0 | 0.040837 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.03125 | 0.25 | 0.53125 | 0.03125 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
8ba95763c3841808434e7398e5ed16b10e00bfd6 | 114 | py | Python | qmhub/embedtools/embed_none_none.py | QCMM/dynqmprop | 0f668072f623a2f5f209ab715bc264a83926309b | [
"MIT"
] | null | null | null | qmhub/embedtools/embed_none_none.py | QCMM/dynqmprop | 0f668072f623a2f5f209ab715bc264a83926309b | [
"MIT"
] | null | null | null | qmhub/embedtools/embed_none_none.py | QCMM/dynqmprop | 0f668072f623a2f5f209ab715bc264a83926309b | [
"MIT"
] | null | null | null | from .embed_base import EmbedBase
class EmbedNoneNone(EmbedBase):
EMBEDNEAR = 'None'
EMBEDFAR = 'None'
| 14.25 | 33 | 0.710526 | 12 | 114 | 6.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.201754 | 114 | 7 | 34 | 16.285714 | 0.879121 | 0 | 0 | 0 | 0 | 0 | 0.070175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8baeb567af30f12a10d229eef9f41bd0a63b5684 | 143 | py | Python | robustredirects/apps.py | spothero/django-robust-redirects | 14e13c2765315d0eb214791ba03a5588a0dd9953 | [
"Apache-2.0"
] | 2 | 2015-09-02T11:01:19.000Z | 2020-07-02T19:01:27.000Z | robustredirects/apps.py | spothero/django-robust-redirects | 14e13c2765315d0eb214791ba03a5588a0dd9953 | [
"Apache-2.0"
] | 1 | 2017-06-14T21:47:36.000Z | 2017-06-14T21:47:36.000Z | robustredirects/apps.py | spothero/django-robust-redirects | 14e13c2765315d0eb214791ba03a5588a0dd9953 | [
"Apache-2.0"
] | 3 | 2015-05-30T12:12:23.000Z | 2020-07-02T19:47:21.000Z | from django.apps import AppConfig
class RobustRedirectsConfig(AppConfig):
name = 'robustredirects'
verbose_name = "Robust Redirects"
| 20.428571 | 39 | 0.769231 | 14 | 143 | 7.785714 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.160839 | 143 | 6 | 40 | 23.833333 | 0.908333 | 0 | 0 | 0 | 0 | 0 | 0.216783 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8bb283ad9e28e42fafbaa4c2c8e7340230403f25 | 205 | py | Python | nekomata/__init__.py | amane-katagiri/nekomata | 54dfdc238160c36a7ad335391bb7bd0f98b8a355 | [
"MIT"
] | null | null | null | nekomata/__init__.py | amane-katagiri/nekomata | 54dfdc238160c36a7ad335391bb7bd0f98b8a355 | [
"MIT"
] | null | null | null | nekomata/__init__.py | amane-katagiri/nekomata | 54dfdc238160c36a7ad335391bb7bd0f98b8a355 | [
"MIT"
] | null | null | null | __author__ = "Amane Katagiri"
__contact__ = "amane@ama.ne.jp"
__copyright__ = "Copyright (C) 2016 Amane Katagiri"
__credits__ = ""
__date__ = "2016-12-07"
__license__ = "MIT License"
__version__ = "0.1.0"
| 25.625 | 51 | 0.721951 | 26 | 205 | 4.615385 | 0.730769 | 0.216667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08427 | 0.131707 | 205 | 7 | 52 | 29.285714 | 0.589888 | 0 | 0 | 0 | 0 | 0 | 0.429268 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8bb4edcc2a41159d312e4d314c4f089d62d7ba6e | 179 | py | Python | language/python/formmating/example2.py | choisungwook/portfolio | a15485673969dcb2e1290c37afae3acf91f1487b | [
"MIT"
] | 4 | 2021-09-28T16:32:46.000Z | 2022-01-04T03:57:28.000Z | language/python/formmating/example2.py | choisungwook/portfolio | a15485673969dcb2e1290c37afae3acf91f1487b | [
"MIT"
] | 15 | 2021-05-13T14:18:32.000Z | 2021-12-22T12:36:35.000Z | language/python/formmating/example2.py | choisungwook/portfolio | a15485673969dcb2e1290c37afae3acf91f1487b | [
"MIT"
] | 8 | 2021-03-03T06:46:17.000Z | 2022-01-03T02:13:48.000Z | example_dict = {}
for idx in range(0, 10):
example_dict[idx] = idx
for key, value in example_dict.items():
formmating = f'key is {key}, value is {value}'
print(formmating) | 22.375 | 48 | 0.681564 | 29 | 179 | 4.103448 | 0.517241 | 0.277311 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020408 | 0.178771 | 179 | 8 | 49 | 22.375 | 0.789116 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8bb69d447bb75fe809ea1db3725c283459c4f37d | 140 | py | Python | src/solutions/188.py | bshankar/euler | c866a661a94d15d3744c74d85149534efac2ca23 | [
"MIT"
] | null | null | null | src/solutions/188.py | bshankar/euler | c866a661a94d15d3744c74d85149534efac2ca23 | [
"MIT"
] | null | null | null | src/solutions/188.py | bshankar/euler | c866a661a94d15d3744c74d85149534efac2ca23 | [
"MIT"
] | null | null | null | def hyperpower(n, k):
n_ = n
for i in range(k-1):
n_ = n**n_ % 100
return n_
print hyperpower(1777, 1855)
| 15.555556 | 28 | 0.5 | 22 | 140 | 3 | 0.636364 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139535 | 0.385714 | 140 | 8 | 29 | 17.5 | 0.627907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.166667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8bcf159620975105a047ea4540ad08a7d4d44486 | 21 | py | Python | inventoryanalytics/utils/__init__.py | vishalbelsare/inventoryanalytics | 85feff8f1abaf2c29414e066eed096ac3a74973b | [
"MIT"
] | 7 | 2018-06-17T02:45:33.000Z | 2021-06-11T09:13:06.000Z | inventoryanalytics/utils/__init__.py | vishalbelsare/inventoryanalytics | 85feff8f1abaf2c29414e066eed096ac3a74973b | [
"MIT"
] | 1 | 2021-02-07T03:33:22.000Z | 2021-06-02T21:11:59.000Z | inventoryanalytics/utils/__init__.py | vishalbelsare/inventoryanalytics | 85feff8f1abaf2c29414e066eed096ac3a74973b | [
"MIT"
] | 7 | 2018-07-14T19:45:43.000Z | 2021-10-12T09:45:04.000Z | __all__ = ["memoize"] | 21 | 21 | 0.666667 | 2 | 21 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 21 | 1 | 21 | 21 | 0.526316 | 0 | 0 | 0 | 0 | 0 | 0.318182 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8bd7621e0c1c65552ca2f0a5ca84632707ff77eb | 103 | py | Python | tests/if_leap_year.py | dstang2000/py2flowchart | 0c489bfabc3d3d17a160095b7c3b0589c7c0db4d | [
"MIT"
] | 1 | 2020-08-28T01:13:58.000Z | 2020-08-28T01:13:58.000Z | tests/if_leap_year.py | dstang2000/py2flowchart | 0c489bfabc3d3d17a160095b7c3b0589c7c0db4d | [
"MIT"
] | null | null | null | tests/if_leap_year.py | dstang2000/py2flowchart | 0c489bfabc3d3d17a160095b7c3b0589c7c0db4d | [
"MIT"
] | null | null | null | year = 2022
if year%4==0 and year%100!=0 or year%400==0:
print(year,"是闰年")
else:
print(year,"不是闰年")
| 17.166667 | 45 | 0.640777 | 21 | 103 | 3.142857 | 0.619048 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159091 | 0.145631 | 103 | 5 | 46 | 20.6 | 0.590909 | 0 | 0 | 0 | 0 | 0 | 0.067961 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8bea5af13c70952cc9014e8507771c85ec15f2da | 1,681 | py | Python | xueqiu/__init__.py | 1dot75cm/xueqiu | 36aec473a9156fdceb87608f2a2b61cbebd342ea | [
"MIT"
] | 25 | 2019-02-12T06:01:28.000Z | 2021-12-29T03:22:26.000Z | xueqiu/__init__.py | 1dot75cm/xueqiu | 36aec473a9156fdceb87608f2a2b61cbebd342ea | [
"MIT"
] | 2 | 2019-04-07T06:23:57.000Z | 2019-04-17T05:27:11.000Z | xueqiu/__init__.py | 1dot75cm/xueqiu | 36aec473a9156fdceb87608f2a2b61cbebd342ea | [
"MIT"
] | 16 | 2019-02-26T15:54:02.000Z | 2022-03-09T00:27:38.000Z | # -*- coding: utf-8 -*-
"""
xueqiu.api
~~~~~~~~~~
This module implements a humanize XueQiu API wrappers.
:copyright: (c) 2019 by 1dot75cm.
:license: MIT, see LICENSE for more details.
"""
# xueqiu api
from .model import news
from .model import search
from .model import Selector
from .model import Stock
from .model import Fund
from .model import Post
from .model import Comment
from .model import User
# funds api
from .fund import get_all_funds
from .fund import get_all_funds_ranking
# economic api
from .economic import get_economic
from .economic import get_economic_of_china
# others
from .stock import get_data_invest
from .stock import get_data_csindex
from .stock import get_data_sseindex
from .stock import get_data_netease
from .stock import get_data_spindices
from .stock import get_data_yahoo
from .stock import get_quote_yahoo
from .stock import get_stock_margin
from .stock import get_hsgt_history
from .stock import get_hsgt_top10
from .stock import get_hsgt_holding
# baidu search index
from .baidu import BaiduIndex
from .baidu import SogouIndex
from .baidu import ToutiaoIndex
# maoyan movie api
from .movie import get_movie_id
from .movie import get_movie_boxinfo_byid
from .movie import get_movie_boxinfo_live
__pkgname__ = "xueqiu"
__version__ = "0.1.5"
__license__ = "MIT"
__url__ = "https://github.com/1dot75cm/xueqiu"
__descript__ = "A humanize XueQiu API wrappers."
__author__ = "1dot75cm"
__email__ = "sensor.wen@gmail.com"
def about():
me = f"""{__pkgname__} {__version__} - {__descript__}
:copyright: (c) 2019 by {__author__}.
:license: {__license__}, see LICENSE for more details."""
print(me)
if __name__ == '__main__':
about() | 24.720588 | 57 | 0.773944 | 245 | 1,681 | 4.922449 | 0.359184 | 0.134328 | 0.136816 | 0.164179 | 0.443615 | 0.091211 | 0 | 0 | 0 | 0 | 0 | 0.015928 | 0.140988 | 1,681 | 68 | 58 | 24.720588 | 0.819252 | 0.152885 | 0 | 0 | 0 | 0 | 0.179305 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.023256 | false | 0 | 0.674419 | 0 | 0.697674 | 0.023256 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
47491da947cd5d9dae1f697a3b4f488f3c32c78e | 4,713 | py | Python | tests/test_05_schedule.py | RKrahl/archive-tools | a126896ab00bfa9fe206a547e65e23953881a56b | [
"Apache-2.0"
] | 1 | 2021-12-21T04:13:15.000Z | 2021-12-21T04:13:15.000Z | tests/test_05_schedule.py | RKrahl/archive-tools | a126896ab00bfa9fe206a547e65e23953881a56b | [
"Apache-2.0"
] | 45 | 2019-02-23T22:45:07.000Z | 2021-12-05T22:00:50.000Z | tests/test_05_schedule.py | RKrahl/archive-tools | a126896ab00bfa9fe206a547e65e23953881a56b | [
"Apache-2.0"
] | 1 | 2020-02-01T00:59:25.000Z | 2020-02-01T00:59:25.000Z | """Test class archive.bt.schedule.ScheduleDate.
"""
import datetime
import pytest
from archive.bt.schedule import ScheduleDate
test_schedules = [
{
'schedule' : "Sat,Thu,Mon..Wed,Sat..Sun *",
'dates': [
( datetime.datetime(2021, 7, 1, 5, 13, 21), True ),
( datetime.datetime(2021, 7, 2, 6, 24, 36), False ),
( datetime.datetime(2021, 7, 3, 3, 57, 42), True ),
( datetime.datetime(2021, 7, 4, 8, 8, 48), True ),
( datetime.datetime(2021, 7, 5, 19, 50, 14), True ),
( datetime.datetime(2021, 7, 6, 22, 48, 56), True ),
( datetime.datetime(2021, 7, 7, 1, 11, 49), True ),
],
},
{
'schedule' : "Mon,Sun 2012-*-* 2,1:23",
'dates': [
( datetime.datetime(2012, 10, 20, 1, 23, 48), False ),
( datetime.datetime(2012, 10, 21, 1, 23, 7), True ),
( datetime.datetime(2012, 10, 21, 2, 24, 30), False ),
( datetime.datetime(2012, 10, 21, 3, 23, 26), False ),
( datetime.datetime(2012, 10, 22, 1, 23, 39), True ),
],
},
{
'schedule' : "Wed *-1",
'dates': [
( datetime.datetime(2002, 4, 1, 13, 52, 43), False ),
( datetime.datetime(2002, 5, 1, 17, 11, 44), True ),
( datetime.datetime(2002, 6, 1, 2, 11, 24), False ),
( datetime.datetime(2003, 9, 1, 6, 5, 23), False ),
( datetime.datetime(2003, 9, 3, 2, 37, 36), False ),
( datetime.datetime(2003, 10, 1, 15, 30, 6), True ),
( datetime.datetime(2003, 11, 1, 20, 29, 54), False ),
],
},
{
'schedule' : "Wed..Wed,Wed *-1",
'dates': [
( datetime.datetime(2002, 4, 1, 13, 52, 43), False ),
( datetime.datetime(2002, 5, 1, 17, 11, 44), True ),
( datetime.datetime(2002, 6, 1, 2, 11, 24), False ),
( datetime.datetime(2003, 9, 1, 6, 5, 23), False ),
( datetime.datetime(2003, 9, 3, 2, 37, 36), False ),
( datetime.datetime(2003, 10, 1, 15, 30, 6), True ),
( datetime.datetime(2003, 11, 1, 20, 29, 54), False ),
],
},
{
'schedule' : "10-15",
'dates': [
( datetime.datetime(2017, 9, 15, 3, 8, 17), False ),
( datetime.datetime(2017, 10, 14, 23, 48, 51), False ),
( datetime.datetime(2017, 10, 15, 4, 12, 36), True ),
( datetime.datetime(2018, 10, 15, 11, 14, 43), True ),
],
},
{
'schedule' : "Fri 1..7 4,10,16,22:30",
'dates': [
( datetime.datetime(2021, 7, 1, 4, 30, 45), False ),
( datetime.datetime(2021, 7, 2, 4, 30, 45), True ),
( datetime.datetime(2021, 7, 2, 5, 30, 45), False ),
( datetime.datetime(2021, 7, 2, 16, 30, 45), True ),
( datetime.datetime(2021, 7, 9, 16, 30, 45), False ),
],
},
{
'schedule' : "Mon *-*-2..8",
'dates': [
( datetime.datetime(2021, 3, 1, 3, 0), False ),
( datetime.datetime(2021, 3, 5, 3, 0), False ),
( datetime.datetime(2021, 3, 8, 3, 0), True ),
( datetime.datetime(2021, 3, 15, 3, 0), False ),
( datetime.datetime(2021, 7, 5, 3, 0), True ),
( datetime.datetime(2021, 7, 9, 3, 0), False ),
( datetime.datetime(2021, 7, 12, 3, 0), False ),
],
},
{
'schedule' : "Mon *",
'dates': [
( datetime.datetime(2021, 3, 1, 3, 0), True ),
( datetime.datetime(2021, 3, 5, 3, 0), False ),
( datetime.datetime(2021, 3, 8, 3, 0), True ),
( datetime.datetime(2021, 3, 15, 3, 0), True ),
( datetime.datetime(2021, 7, 5, 3, 0), True ),
( datetime.datetime(2021, 7, 9, 3, 0), False ),
( datetime.datetime(2021, 7, 12, 3, 0), True ),
],
},
{
'schedule' : "*",
'dates': [
( datetime.datetime(2021, 3, 1, 3, 0), True ),
( datetime.datetime(2021, 3, 5, 3, 0), True ),
( datetime.datetime(2021, 3, 8, 3, 0), True ),
( datetime.datetime(2021, 3, 15, 3, 0), True ),
( datetime.datetime(2021, 7, 5, 3, 0), True ),
( datetime.datetime(2021, 7, 9, 3, 0), True ),
( datetime.datetime(2021, 7, 12, 3, 0), True ),
],
},
]
@pytest.mark.parametrize("schedule,dates", [
(s['schedule'], s['dates']) for s in test_schedules
])
def test_schedule_parse(schedule, dates):
"""Various parsing examples for ScheduleDate.
"""
sd = ScheduleDate(schedule)
for d in dates:
assert (d[0] in sd) == d[1]
| 38.631148 | 67 | 0.472523 | 590 | 4,713 | 3.767797 | 0.137288 | 0.403059 | 0.296896 | 0.198381 | 0.7148 | 0.622132 | 0.547458 | 0.51327 | 0.45749 | 0.45749 | 0 | 0.198071 | 0.340123 | 4,713 | 121 | 68 | 38.950413 | 0.51672 | 0.01952 | 0 | 0.424779 | 0 | 0 | 0.056845 | 0.005424 | 0 | 0 | 0 | 0 | 0.00885 | 1 | 0.00885 | false | 0 | 0.026549 | 0 | 0.035398 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4757118cf4fa15f2912d20431e30d6ac139689aa | 251 | bzl | Python | scala/private/phases/phase_unused_deps_checker.bzl | psilospore/rules_scala-rebloopy | 69327c55e8095882e59e5c0fe948cb31693b4e6f | [
"Apache-2.0"
] | null | null | null | scala/private/phases/phase_unused_deps_checker.bzl | psilospore/rules_scala-rebloopy | 69327c55e8095882e59e5c0fe948cb31693b4e6f | [
"Apache-2.0"
] | null | null | null | scala/private/phases/phase_unused_deps_checker.bzl | psilospore/rules_scala-rebloopy | 69327c55e8095882e59e5c0fe948cb31693b4e6f | [
"Apache-2.0"
] | null | null | null | #
# PHASE: unused deps checker
#
# DOCUMENT THIS
#
load(
"@io_bazel_rules_scala//scala/private:rule_impls.bzl",
"get_unused_dependency_checker_mode",
)
def phase_unused_deps_checker(ctx, p):
return get_unused_dependency_checker_mode(ctx)
| 19.307692 | 58 | 0.76494 | 35 | 251 | 5.057143 | 0.628571 | 0.124294 | 0.169492 | 0.248588 | 0.338983 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131474 | 251 | 12 | 59 | 20.916667 | 0.811927 | 0.159363 | 0 | 0 | 0 | 0 | 0.414634 | 0.414634 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0.166667 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
47778d2cdb6d592fe17c85abb14686cdbbf4ef40 | 642 | py | Python | gerador_senha.py | fabiobarretopro/Aprendendo-Python | a47acf6b9fdfdad55853e620db451a6a2e61bc6f | [
"MIT"
] | null | null | null | gerador_senha.py | fabiobarretopro/Aprendendo-Python | a47acf6b9fdfdad55853e620db451a6a2e61bc6f | [
"MIT"
] | null | null | null | gerador_senha.py | fabiobarretopro/Aprendendo-Python | a47acf6b9fdfdad55853e620db451a6a2e61bc6f | [
"MIT"
] | null | null | null | """
Security = chave
5ecur1ty = senha
"""
"""hexadecimal:
1= 1
2=2
3=3
até 9=9
10 = A
11 = B
12 = C
13 = D
14 = E
15 = F
"""
chave = input("Digite a base da sua senha: ")
senha = ""
for letra in chave:
if letra in "Aa": senha = senha + "1"
elif letra in "Bb": senha = senha + "@"
elif letra in "Cc": senha = senha + "2"
elif letra in "Dd": senha = senha + "3"
elif letra in "Ee": senha = senha + "4"
elif letra in "Ff": senha = senha + "5"
elif letra in "Rr": senha = senha + "#"
elif letra in "Ss": senha = senha + "%"
elif letra in "Mn": senha = senha + "$"
else: senha = senha + letra
print(senha)
| 20.0625 | 45 | 0.554517 | 104 | 642 | 3.423077 | 0.432692 | 0.308989 | 0.247191 | 0.160112 | 0.176966 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058315 | 0.278816 | 642 | 31 | 46 | 20.709677 | 0.710583 | 0.051402 | 0 | 0 | 0 | 0 | 0.105973 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.071429 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
477b9c3705be5e84c3231f54314bd89dd796202b | 676 | gyp | Python | binding.gyp | bitdefender/simpletracer | f8307f72d821ea50adbd27efe6d9d9fb744285f5 | [
"MIT"
] | 9 | 2018-09-20T12:32:44.000Z | 2021-02-24T20:42:31.000Z | binding.gyp | AGAPIA/simpletracer | 4b7373bbb794a7cb03b86d92b614a340a875ce82 | [
"MIT"
] | 3 | 2018-10-15T23:00:15.000Z | 2019-11-19T12:25:04.000Z | binding.gyp | bitdefender/simpletracer | f8307f72d821ea50adbd27efe6d9d9fb744285f5 | [
"MIT"
] | 8 | 2018-10-15T22:13:55.000Z | 2022-01-11T15:37:24.000Z | {
"targets": [
{
"target_name" : "libtracer",
"type" : "static_library",
"sources" : [
"./libtracer/basic.observer.cpp",
"./libtracer/simple.tracer/simple.tracer.cpp",
"./libtracer/annotated.tracer/TrackingExecutor.cpp",
"./libtracer/annotated.tracer/BitMap.cpp",
"./libtracer/annotated.tracer/annotated.tracer.cpp"
],
"include_dirs": [
"./include",
"./river.format/include",
"<!(echo $RIVER_SDK_DIR)/include/"
],
"conditions": [
["OS==\"linux\"", {
"cflags": [
"-g",
"-m32",
"-std=c++11",
"-D__cdecl=''",
"-D__stdcall=''"
]
}
]
]
}
]
}
| 20.484848 | 60 | 0.507396 | 58 | 676 | 5.758621 | 0.603448 | 0.143713 | 0.188623 | 0.242515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008114 | 0.27071 | 676 | 32 | 61 | 21.125 | 0.669371 | 0 | 0 | 0.0625 | 0 | 0 | 0.591716 | 0.378698 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
479a994094a62083ebe4c1fc218b35e9ed2432dd | 108 | py | Python | python/testData/codeInsight/mlcompletion/numOfPrevQualifiersIs4.py | Sajaki/intellij-community | 6748af2c40567839d11fd652ec77ba263c074aad | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/codeInsight/mlcompletion/numOfPrevQualifiersIs4.py | Sajaki/intellij-community | 6748af2c40567839d11fd652ec77ba263c074aad | [
"Apache-2.0"
] | 1 | 2020-07-30T19:04:47.000Z | 2020-07-30T19:04:47.000Z | python/testData/codeInsight/mlcompletion/numOfPrevQualifiersIs4.py | bradleesand/intellij-community | 750ff9c10333c9c1278c00dbe8d88c877b1b9749 | [
"Apache-2.0"
] | 1 | 2020-10-15T05:56:42.000Z | 2020-10-15T05:56:42.000Z | class Clzz:
def b(self):
return Clzz()
def c(self):
return "123"
a = Clzz()
a.b().c().<caret> | 10.8 | 17 | 0.527778 | 18 | 108 | 3.166667 | 0.555556 | 0.245614 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0375 | 0.259259 | 108 | 10 | 18 | 10.8 | 0.675 | 0 | 0 | 0 | 0 | 0 | 0.027523 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
479c134e0e42a2cd04738776c6f3038e5464b7dd | 102 | py | Python | admin_list_charts/apps.py | foorilla/django-admin-list-charts | dd65d2ad4d6a34243afc97f6d4a34389c53c04e1 | [
"MIT"
] | 4 | 2021-11-19T12:47:09.000Z | 2022-01-20T13:53:32.000Z | admin_list_charts/apps.py | foorilla/django-admin-list-charts | dd65d2ad4d6a34243afc97f6d4a34389c53c04e1 | [
"MIT"
] | null | null | null | admin_list_charts/apps.py | foorilla/django-admin-list-charts | dd65d2ad4d6a34243afc97f6d4a34389c53c04e1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ListchartsConfig(AppConfig):
name = 'admin_list_charts'
| 17 | 34 | 0.784314 | 12 | 102 | 6.5 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 102 | 5 | 35 | 20.4 | 0.896552 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
479fc67fd43170a02d34b2d31f6ed580e4a36bb7 | 138 | py | Python | pycorrel/__init__.py | maximegodin/pycorrel | 5d4efcae129f1322eb95e5fc235f037325b6e8c5 | [
"MIT"
] | null | null | null | pycorrel/__init__.py | maximegodin/pycorrel | 5d4efcae129f1322eb95e5fc235f037325b6e8c5 | [
"MIT"
] | null | null | null | pycorrel/__init__.py | maximegodin/pycorrel | 5d4efcae129f1322eb95e5fc235f037325b6e8c5 | [
"MIT"
] | null | null | null | """Top-level package for pycorrel."""
__author__ = """Maxime Godin"""
__email__ = 'maxime.godin@polytechnique.org'
__version__ = '0.1.1'
| 23 | 44 | 0.702899 | 17 | 138 | 5 | 0.823529 | 0.258824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02439 | 0.108696 | 138 | 5 | 45 | 27.6 | 0.666667 | 0.224638 | 0 | 0 | 0 | 0 | 0.465347 | 0.29703 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
47c0e4ddb58875e7da7db66ad533602c5cb20865 | 1,992 | py | Python | tests/test_assert.py | lunjon/asserty | 95fa2702731495ada1d9c1572119cc8ccf06506c | [
"MIT"
] | 2 | 2019-06-04T11:01:53.000Z | 2020-07-28T08:58:29.000Z | tests/test_assert.py | lunjon/asserty | 95fa2702731495ada1d9c1572119cc8ccf06506c | [
"MIT"
] | null | null | null | tests/test_assert.py | lunjon/asserty | 95fa2702731495ada1d9c1572119cc8ccf06506c | [
"MIT"
] | null | null | null | from asserty import assert_that
def test_equals_str():
assert_that("str").equals("str")
assert_that("str").not_equals("yo")
def test_equals_int():
assert_that(1).equals(1)
assert_that(2).not_equals(3)
def test_equals_float():
assert_that(1.2).equals(1.2)
assert_that(0.1).not_equals(-0.1)
def test_equals_with_same_class():
class Tmp:
def __init__(self, var):
self.var = var
def __eq__(self, other):
return self.var == other.var
t1 = Tmp(1)
t2 = Tmp(2)
t3 = Tmp(1)
assert_that(t1).equals(t1)
assert_that(t1).equals(t3)
assert_that(t1).not_equals(t2)
assert_that(t3).not_equals(t2)
def test_equals_with_list():
a = [1]
b = [1]
assert_that(a).equals(b)
assert_that(a).not_equals([3])
def test_equals_with_dict():
a = {"a": 1}
b = {"a": 1}
assert_that(a).equals(b)
assert_that(a).not_equals({"c": 2})
def test_is_none():
assert_that(None).is_none()
assert_that("str").is_not_none()
def test_has_type_on_str():
assert_that("str").has_type(str)
assert_that("str").has_type("string")
assert_that("str").not_has_type(int)
assert_that("str").not_has_same_type_as(int)
def test_is_in():
assert_that(1).is_in(range(10))
assert_that(10).is_not_in(range(10))
def test_greater():
assert_that(1).is_greater_than(0)
assert_that(1).is_greater_or_equal_to(0)
assert_that(1).is_greater_or_equal_to(1)
def test_less():
assert_that(1).is_less_than(2)
assert_that(1).is_less_or_equal_to(1)
assert_that(1).is_less_or_equal_to(2)
def test_has_attribute():
assert_that("str").has_attribute("__str__")
class MyClass:
name = "MyClass"
assert_that("str").has_attribute("__str__")
assert_that(MyClass()).has_attribute("name")
def test_has_attribute_with_value():
class MyClass:
name = "MyClass"
assert_that(MyClass()).has_attribute_with_value("name", "MyClass")
| 20.536082 | 70 | 0.661647 | 321 | 1,992 | 3.707165 | 0.17134 | 0.277311 | 0.098319 | 0.076471 | 0.463866 | 0.323529 | 0.159664 | 0.159664 | 0.115966 | 0.065546 | 0 | 0.031443 | 0.185743 | 1,992 | 96 | 71 | 20.75 | 0.702219 | 0 | 0 | 0.129032 | 0 | 0 | 0.042169 | 0 | 0 | 0 | 0 | 0 | 0.532258 | 1 | 0.241935 | false | 0 | 0.016129 | 0.016129 | 0.354839 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
47c8e0091d9218f66b6710518fd01d76e9a19d74 | 63 | py | Python | berth/settings/test.py | joealcorn/berth.cc | 9cba1355d49705a13ae58cfdffa26ee6a3fb9e31 | [
"MIT"
] | null | null | null | berth/settings/test.py | joealcorn/berth.cc | 9cba1355d49705a13ae58cfdffa26ee6a3fb9e31 | [
"MIT"
] | null | null | null | berth/settings/test.py | joealcorn/berth.cc | 9cba1355d49705a13ae58cfdffa26ee6a3fb9e31 | [
"MIT"
] | null | null | null | from berth.settings.common import *
CELERY_ALWAYS_EAGER = True
| 21 | 35 | 0.825397 | 9 | 63 | 5.555556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 63 | 2 | 36 | 31.5 | 0.892857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
47dda0386a31c84db371895320fc16b2e17673c0 | 1,009 | py | Python | ermaket/api/erd/er_entities/relation.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | ermaket/api/erd/er_entities/relation.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | ermaket/api/erd/er_entities/relation.py | SqrtMinusOne/ERMaket_Experiment | c4a7b61651edd15a619d9b690e2aaeaab4de282d | [
"Apache-2.0"
] | null | null | null | from magic_repr import make_repr
from .side import Side
from ermaket.utils.xml import XMLObject
__all__ = ['Relation']
class Relation(XMLObject):
def __init__(self, name, sides):
self.name = name
self.sides = sides
@property
def _tag_name(self):
return 'relation'
@classmethod
def make(cls, name, *sides):
return cls(name, [Side(*args) for args in sides])
@classmethod
def _from_xml(cls, tag):
return cls._make_args(
tag.find('name').text,
[Side.from_xml(t) for t in tag.find_all('side')]
)
def __len__(self):
return len(self.sides)
def invert(self):
assert len(self.sides) == 2
return Relation(self.name, self.sides[::-1])
def to_xml(self):
tag = self.soup.new_tag(self._tag_name)
tag.append(self.new_tag('name', self.name))
[tag.append(s.to_xml()) for s in self.sides]
return tag
Relation.__repr__ = make_repr('name', 'sides')
| 22.931818 | 60 | 0.608523 | 139 | 1,009 | 4.179856 | 0.280576 | 0.077453 | 0.04475 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002699 | 0.26561 | 1,009 | 43 | 61 | 23.465116 | 0.781377 | 0 | 0 | 0.064516 | 0 | 0 | 0.03667 | 0 | 0 | 0 | 0 | 0 | 0.032258 | 1 | 0.225806 | false | 0 | 0.096774 | 0.129032 | 0.548387 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
47df1f90deb717c5115c92eef13bc53988ba254d | 137 | py | Python | models/chars_conv_dilated_conv/__init__.py | haofengrushui204/tf_ner | 68098aa14ed7d369315a08255e5f7bb708fbf9b2 | [
"Apache-2.0"
] | null | null | null | models/chars_conv_dilated_conv/__init__.py | haofengrushui204/tf_ner | 68098aa14ed7d369315a08255e5f7bb708fbf9b2 | [
"Apache-2.0"
] | null | null | null | models/chars_conv_dilated_conv/__init__.py | haofengrushui204/tf_ner | 68098aa14ed7d369315a08255e5f7bb708fbf9b2 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
"""
@file name: __init__.py.py
Created on 2019/5/14
@author: kyy_b
@desc:
"""
if __name__ == "__main__":
pass | 13.7 | 26 | 0.605839 | 21 | 137 | 3.333333 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.070796 | 0.175182 | 137 | 10 | 27 | 13.7 | 0.548673 | 0.664234 | 0 | 0 | 0 | 0 | 0.205128 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
47e9eb6fc699e47f2c3bae32188b7d1e89d8ff88 | 198 | py | Python | Exercicios/ex013.py | GabrielMazzuchello/Curso-Em-Video | 2bf7847f23980e0ce63312997318a43000246bfa | [
"MIT"
] | 2 | 2021-11-13T13:52:56.000Z | 2022-03-29T18:10:27.000Z | Exercicios/ex013.py | GabrielMazzuchello/Curso-Em-Video | 2bf7847f23980e0ce63312997318a43000246bfa | [
"MIT"
] | null | null | null | Exercicios/ex013.py | GabrielMazzuchello/Curso-Em-Video | 2bf7847f23980e0ce63312997318a43000246bfa | [
"MIT"
] | null | null | null | s = float(input('qual erá o salario do funcionario? R$'))
aul = s * 15 / 100
print('o salario do funcionari que andes custava R${:.2f} agora com 15% de aumento custará R${:.2f}'.format(s, (s+aul)))
| 49.5 | 120 | 0.666667 | 36 | 198 | 3.666667 | 0.694444 | 0.121212 | 0.151515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054217 | 0.161616 | 198 | 3 | 121 | 66 | 0.740964 | 0 | 0 | 0 | 0 | 0.333333 | 0.651515 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
47f03e23340c151e0178f6dba9343ffd42306492 | 1,337 | py | Python | tests/__init__.py | thewchan/abbr-cli | 76e7864ee1e2aa99f4597bce792ad4b781d7a894 | [
"MIT"
] | 20 | 2021-07-08T21:40:28.000Z | 2022-02-02T15:44:58.000Z | tests/__init__.py | thewchan/abbr-cli | 76e7864ee1e2aa99f4597bce792ad4b781d7a894 | [
"MIT"
] | 1 | 2021-07-18T12:59:13.000Z | 2022-01-27T10:04:13.000Z | tests/__init__.py | thewchan/abbr-cli | 76e7864ee1e2aa99f4597bce792ad4b781d7a894 | [
"MIT"
] | 1 | 2021-07-15T17:36:05.000Z | 2021-07-15T17:36:05.000Z | from docopt import docopt
from abbr import __main__
from abbr.core import main
_mocked_html = """
<html>
<table class="no-margin">
<tbody>
<tr>
<dir>
<span class="sf" />
<span class="sf" />
</dir>
<p class="desc">term1</p>
<td>
<a>abbr1</a>
</td>
<p class="path">
<a>category1</a>
</p>
</tr>
<tr>
<dir>
<span class="sf" />
<span class="sf" />
<span class="sf" />
</dir>
<p class="desc">TERM2</p>
<td>
<a>ABBR2</a>
</td>
<p class="path">
<a>category2</a>
</p>
</tr>
<tr>
<dir>
<span class="sf" />
<span class="sf" />
<span class="sf" />
<span class="sf" />
</dir>
<p class="desc">Term3</p>
<td>
<a>Abbr3</a>
</td>
<p class="path">
<a>category3</a>
</p>
</tr>
</tbody>
</table>
</html>
"""
def abbr_cli(args: str):
args = docopt(__main__.__doc__, args.split())
return main(args)
| 21.918033 | 49 | 0.344802 | 128 | 1,337 | 3.484375 | 0.296875 | 0.181614 | 0.221973 | 0.201794 | 0.455157 | 0.455157 | 0.360987 | 0.360987 | 0.349776 | 0.349776 | 0 | 0.013255 | 0.492147 | 1,337 | 60 | 50 | 22.283333 | 0.643594 | 0 | 0 | 0.589286 | 0 | 0 | 0.848915 | 0.049364 | 0 | 0 | 0 | 0 | 0 | 1 | 0.017857 | false | 0 | 0.053571 | 0 | 0.089286 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
47f114e87a2710656c3ec137ca21aae174103218 | 431 | py | Python | lib/include_torch.py | DWRex/HuBMAP-Kidney-My-U-Net | 7affe4c683fd50f263db5af3bc92abd43fae86c5 | [
"MIT"
] | null | null | null | lib/include_torch.py | DWRex/HuBMAP-Kidney-My-U-Net | 7affe4c683fd50f263db5af3bc92abd43fae86c5 | [
"MIT"
] | null | null | null | lib/include_torch.py | DWRex/HuBMAP-Kidney-My-U-Net | 7affe4c683fd50f263db5af3bc92abd43fae86c5 | [
"MIT"
] | null | null | null | # torch libs
import torch
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader
from torch.utils.data.sampler import *
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn.parallel.data_parallel import data_parallel
from torch.nn.utils.rnn import *
def seed_torch(seed):
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
return seed
| 21.55 | 57 | 0.788863 | 70 | 431 | 4.771429 | 0.314286 | 0.134731 | 0.125749 | 0.161677 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139211 | 431 | 19 | 58 | 22.684211 | 0.90027 | 0.023202 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.076923 | false | 0 | 0.692308 | 0 | 0.846154 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
47f63e99b122eac1d65f45f14504d2a75197ab7f | 1,430 | py | Python | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/i/invalid/invalid_hash_returned.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/i/invalid/invalid_hash_returned.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/i/invalid/invalid_hash_returned.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """Check invalid value returned by __hash__ """
# pylint: disable=too-few-public-methods,missing-docstring,no-self-use,import-error, useless-object-inheritance
import six
from missing import Missing
class FirstGoodHash(object):
"""__hash__ returns <type 'int'>"""
def __hash__(self):
return 1
class SecondGoodHash(object):
"""__hash__ returns <type 'int'>"""
def __hash__(self):
return 0
class HashMetaclass(type):
def __hash__(cls):
return 1
@six.add_metaclass(HashMetaclass)
class ThirdGoodHash(object):
"""Hash through the metaclass."""
class FirstBadHash(object):
""" __hash__ returns a dict """
def __hash__(self): # [invalid-hash-returned]
return {}
class SecondBadHash(object):
""" __hash__ returns str """
def __hash__(self): # [invalid-hash-returned]
return "True"
class ThirdBadHash(object):
""" __hash__ returns a float"""
def __hash__(self): # [invalid-hash-returned]
return 1.11
class FourthBadHash(object):
""" __hash__ returns node which does not have 'value' in AST """
def __hash__(self): # [invalid-hash-returned]
return lambda: 3
class AmbigousHash(object):
""" Uninferable return value """
__hash__ = lambda self: Missing
class AnotherAmbiguousHash(object):
"""Potential uninferable return value"""
def __hash__(self):
return hash(Missing)
| 19.861111 | 111 | 0.665734 | 160 | 1,430 | 5.54375 | 0.4 | 0.063134 | 0.086809 | 0.081172 | 0.254791 | 0.254791 | 0.254791 | 0.092446 | 0.092446 | 0 | 0 | 0.006211 | 0.211888 | 1,430 | 71 | 112 | 20.140845 | 0.780834 | 0.368531 | 0 | 0.3 | 0 | 0 | 0.004745 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0.066667 | 0.266667 | 0.966667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
47fdafa169533f703e4d5dd1984bdba6e515a2c1 | 408 | py | Python | python-flask/tests/test_api.py | PinZhang/Boilerplates | af423d3ce8b1d1b722a7fcebab5d4f89e9170648 | [
"Apache-2.0"
] | null | null | null | python-flask/tests/test_api.py | PinZhang/Boilerplates | af423d3ce8b1d1b722a7fcebab5d4f89e9170648 | [
"Apache-2.0"
] | null | null | null | python-flask/tests/test_api.py | PinZhang/Boilerplates | af423d3ce8b1d1b722a7fcebab5d4f89e9170648 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Acadine Technologies
# All rights reserved.
import unittest
from app import app
class APITestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_index(self):
with app.test_client() as client:
resp = client.get('/')
self.assertEqual('Hello, world!', resp.data, msg='unexpected index response')
| 21.473684 | 89 | 0.642157 | 49 | 408 | 5.306122 | 0.693878 | 0.061538 | 0.084615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013158 | 0.254902 | 408 | 18 | 90 | 22.666667 | 0.842105 | 0.147059 | 0 | 0.181818 | 0 | 0 | 0.113372 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 1 | 0.272727 | false | 0.181818 | 0.181818 | 0 | 0.545455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
9a026e17f906676e6c9edfe05f8e931ed9f425f0 | 163 | py | Python | src/dataset/__init__.py | JonasFrey96/DenseFusion | 0875483a0f7570dbc1842fdb51206fd7dc2b2ac1 | [
"MIT"
] | 2 | 2020-12-15T07:56:08.000Z | 2021-06-15T14:14:32.000Z | src/dataset/__init__.py | JonasFrey96/DenseFusion | 0875483a0f7570dbc1842fdb51206fd7dc2b2ac1 | [
"MIT"
] | 1 | 2021-01-12T10:36:43.000Z | 2021-01-12T10:36:43.000Z | src/dataset/__init__.py | JonasFrey96/DenseFusion | 0875483a0f7570dbc1842fdb51206fd7dc2b2ac1 | [
"MIT"
] | 1 | 2020-12-16T08:43:17.000Z | 2020-12-16T08:43:17.000Z | from .backend import Backend
from .dataset_ycb import YCB
from .dataset_generic import GenericDataset
__all__ = (
'GenericDataset',
'YCB',
'Backend'
) | 18.111111 | 43 | 0.723926 | 18 | 163 | 6.222222 | 0.444444 | 0.196429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.190184 | 163 | 9 | 44 | 18.111111 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0.146341 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9a54cb26f7194295437e52cc17eff62e8c775fdc | 251 | py | Python | bookworm/ocr_engines/__init__.py | xingkong0113/bookworm | 7214067f48e7a951198806a1f9170e3fd8fc0cce | [
"MIT"
] | 36 | 2020-11-15T03:21:39.000Z | 2022-03-05T01:11:26.000Z | bookworm/ocr_engines/__init__.py | xingkong0113/bookworm | 7214067f48e7a951198806a1f9170e3fd8fc0cce | [
"MIT"
] | 90 | 2020-10-06T14:46:07.000Z | 2022-03-31T03:03:34.000Z | bookworm/ocr_engines/__init__.py | xingkong0113/bookworm | 7214067f48e7a951198806a1f9170e3fd8fc0cce | [
"MIT"
] | 20 | 2020-09-30T17:40:44.000Z | 2022-03-17T19:59:53.000Z | # coding: utf-8
from .base import OcrRequest, OcrResult, BaseOcrEngine
from .tesseract_ocr_engine import TesseractOcrEngine
# from .tesseract_ocr_engine.tesseract_alt import TesseractOcrEngineAlt
GENERIC_OCR_ENGINES = [
TesseractOcrEngine,
]
| 19.307692 | 71 | 0.816733 | 27 | 251 | 7.333333 | 0.62963 | 0.131313 | 0.161616 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004566 | 0.12749 | 251 | 12 | 72 | 20.916667 | 0.899543 | 0.330677 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9a6d230b66eab68f7c6c74ac1d10cb5ce470207a | 200 | py | Python | conf/implicit/cse/more_comp_layers.py | edvisees/DDSemantics | 9044e4afa6f9d6d7504de028633295f30679278d | [
"Apache-2.0"
] | null | null | null | conf/implicit/cse/more_comp_layers.py | edvisees/DDSemantics | 9044e4afa6f9d6d7504de028633295f30679278d | [
"Apache-2.0"
] | null | null | null | conf/implicit/cse/more_comp_layers.py | edvisees/DDSemantics | 9044e4afa6f9d6d7504de028633295f30679278d | [
"Apache-2.0"
] | null | null | null | import os
c.ArgModelPara.arg_composition_layer_sizes = 600, 300, 300
c.ArgModelPara.event_composition_layer_sizes = 400, 200, 200
c.Basic.model_name = os.path.basename(__file__).replace('.py', '')
| 25 | 66 | 0.775 | 30 | 200 | 4.8 | 0.7 | 0.180556 | 0.291667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.099448 | 0.095 | 200 | 7 | 67 | 28.571429 | 0.696133 | 0 | 0 | 0 | 0 | 0 | 0.015075 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
d08ccda9dbf1cb21bc17958b11ceacec2eadb75e | 53 | py | Python | Aula011/prova.py | FlaYukari/Exerc-cios-Python-3--Mundo-01 | 4b7e3149806d851209edc9bf643b5abd072e9bc8 | [
"MIT"
] | null | null | null | Aula011/prova.py | FlaYukari/Exerc-cios-Python-3--Mundo-01 | 4b7e3149806d851209edc9bf643b5abd072e9bc8 | [
"MIT"
] | null | null | null | Aula011/prova.py | FlaYukari/Exerc-cios-Python-3--Mundo-01 | 4b7e3149806d851209edc9bf643b5abd072e9bc8 | [
"MIT"
] | null | null | null | x = 'curso de python no cursoemvideo'
print(19 // 2) | 26.5 | 38 | 0.679245 | 9 | 53 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069767 | 0.188679 | 53 | 2 | 39 | 26.5 | 0.767442 | 0 | 0 | 0 | 0 | 0 | 0.584906 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
d0aec0e2d1e72839da0a9e3d7c34c203c231cc92 | 517 | py | Python | django_docutils/lib/roles/pypi.py | tony/django-docutils | ed3e089728507a0f579a62bcb182f283bc59929c | [
"MIT"
] | 10 | 2017-04-28T00:19:10.000Z | 2020-07-22T15:27:09.000Z | django_docutils/lib/roles/pypi.py | tony/django-docutils | ed3e089728507a0f579a62bcb182f283bc59929c | [
"MIT"
] | 231 | 2017-01-17T04:47:51.000Z | 2022-03-30T03:03:42.000Z | django_docutils/lib/roles/pypi.py | tony/django-docutils | ed3e089728507a0f579a62bcb182f283bc59929c | [
"MIT"
] | 1 | 2019-01-25T14:42:15.000Z | 2019-01-25T14:42:15.000Z | from .common import generic_url_role
def pypi_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
"""Role for linking to pypi page.
:pypi:`libsass` ->
link: https://pypi.python.org/pypi/libsass
text: libsass
:pypi:`a pypi package <libsass>` ->
link: https://pypi.python.org/pypi/libsass
text: a pypi package
"""
def url_handler(target):
return f'https://pypi.python.org/pypi/{target}'
return generic_url_role(name, text, url_handler)
| 24.619048 | 76 | 0.644101 | 69 | 517 | 4.724638 | 0.434783 | 0.101227 | 0.138037 | 0.165644 | 0.337423 | 0.269939 | 0.269939 | 0.269939 | 0.269939 | 0 | 0 | 0 | 0.2147 | 517 | 20 | 77 | 25.85 | 0.802956 | 0.427466 | 0 | 0 | 0 | 0 | 0.141762 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0.2 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
d0bfb478791a7b9159269b823f23d355f7073d10 | 430 | py | Python | commonsub.py | boddulurisrisai/python-practice | bb9dfd8ea4d1fe3e4a3f7950ba63b0469e0bca28 | [
"bzip2-1.0.6"
] | 1 | 2021-04-16T07:12:36.000Z | 2021-04-16T07:12:36.000Z | commonsub.py | boddulurisrisai/python-practice | bb9dfd8ea4d1fe3e4a3f7950ba63b0469e0bca28 | [
"bzip2-1.0.6"
] | null | null | null | commonsub.py | boddulurisrisai/python-practice | bb9dfd8ea4d1fe3e4a3f7950ba63b0469e0bca28 | [
"bzip2-1.0.6"
] | null | null | null | x=input('enter str1')
y=input('enter str2')
a=[]
b=[];c=[];max=-1
for i in range(len(x)+1):
for j in range(i+1,len(x)+1):
a.append(x[i:j])
for i in range(len(y)+1):
for j in range(i+1,len(y)+1):
b.append(y[i:j])
for i in range(len(a)):
for j in range(len(b)):
if a[i]==b[j]:
if len(a[i])>max:
max=len(a[i])
c=a[i]
print(c)
| 22.631579 | 34 | 0.437209 | 86 | 430 | 2.186047 | 0.232558 | 0.223404 | 0.212766 | 0.175532 | 0.425532 | 0.351064 | 0.351064 | 0.180851 | 0 | 0 | 0 | 0.03169 | 0.339535 | 430 | 18 | 35 | 23.888889 | 0.630282 | 0 | 0 | 0 | 0 | 0 | 0.048544 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.058824 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d0c0dc242fba4562538130ad6689edaf8d155824 | 159 | py | Python | mmdet3d/models/necks/__init__.py | Discover304/MMDetection3D-Explainable | 265be9eba643a253a0d0bd24fb1f74a3f43a0b45 | [
"Apache-2.0"
] | null | null | null | mmdet3d/models/necks/__init__.py | Discover304/MMDetection3D-Explainable | 265be9eba643a253a0d0bd24fb1f74a3f43a0b45 | [
"Apache-2.0"
] | null | null | null | mmdet3d/models/necks/__init__.py | Discover304/MMDetection3D-Explainable | 265be9eba643a253a0d0bd24fb1f74a3f43a0b45 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from mmdet.models.necks.fpn import FPN
from .second_fpn import SECONDFPN
__all__ = [
'FPN', 'SECONDFPN'
]
| 19.875 | 47 | 0.72956 | 21 | 159 | 5.285714 | 0.666667 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.163522 | 159 | 7 | 48 | 22.714286 | 0.834586 | 0.283019 | 0 | 0 | 0 | 0 | 0.107143 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d0cca564a6be1fa204b84208966067a7a6219bf7 | 225 | py | Python | day3_assignment.py | AMAN-0228/letsupdgrade-python | 67283cd53dab4e645a990619125df027c7bac771 | [
"Apache-2.0"
] | null | null | null | day3_assignment.py | AMAN-0228/letsupdgrade-python | 67283cd53dab4e645a990619125df027c7bac771 | [
"Apache-2.0"
] | null | null | null | day3_assignment.py | AMAN-0228/letsupdgrade-python | 67283cd53dab4e645a990619125df027c7bac771 | [
"Apache-2.0"
] | null | null | null | altitude = int(input("CURRENT ALTITUDE:"))
if altitude <=1000:
print("You can land the plan")
elif altitude > 1000 and altitude < 5000:
print("Come down to 1000")
else:
print("Turn around")
| 22.5 | 43 | 0.604444 | 29 | 225 | 4.689655 | 0.724138 | 0.176471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09816 | 0.275556 | 225 | 9 | 44 | 25 | 0.736196 | 0 | 0 | 0 | 0 | 0 | 0.306977 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
ef9d1e116cf0b25c7cf7813a92adc624d37519be | 167 | py | Python | keg_apps/logging.py | level12/keg | 6f148a9bd0b8e167007ed5c2a0000daf7de3aee2 | [
"BSD-3-Clause"
] | 15 | 2015-06-26T09:01:53.000Z | 2020-08-28T16:29:14.000Z | keg_apps/logging.py | level12/keg | 6f148a9bd0b8e167007ed5c2a0000daf7de3aee2 | [
"BSD-3-Clause"
] | 165 | 2015-03-27T06:49:38.000Z | 2022-03-11T21:39:52.000Z | keg_apps/logging.py | level12/keg | 6f148a9bd0b8e167007ed5c2a0000daf7de3aee2 | [
"BSD-3-Clause"
] | 9 | 2015-04-22T17:03:32.000Z | 2018-06-25T17:48:15.000Z | from __future__ import absolute_import
import logging
from keg.app import Keg
log = logging.getLogger(__name__)
class LoggingApp(Keg):
import_name = __name__
| 13.916667 | 38 | 0.784431 | 22 | 167 | 5.318182 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.161677 | 167 | 11 | 39 | 15.181818 | 0.835714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
efa84be12c256277c148685ec8c375de5b02b490 | 1,264 | py | Python | reserved/settings/dev_jay.py | Strangemother/coffee | e5ee7a62e3cb0fc5d4638decaded9905bf3cae74 | [
"MIT"
] | null | null | null | reserved/settings/dev_jay.py | Strangemother/coffee | e5ee7a62e3cb0fc5d4638decaded9905bf3cae74 | [
"MIT"
] | null | null | null | reserved/settings/dev_jay.py | Strangemother/coffee | e5ee7a62e3cb0fc5d4638decaded9905bf3cae74 | [
"MIT"
] | null | null | null | from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'reserved_dev',
#'USER': 'reserved',
#'PASSWORD': get_env_variable('RESERVED_DB_PASS'),
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
# 'OPTIONS': {'init_command': 'SET storage_engine=MYISAM'},
}
}
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'dfoihjehrp'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
| 32.410256 | 127 | 0.699367 | 139 | 1,264 | 6.18705 | 0.604317 | 0.181395 | 0.272093 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006724 | 0.176424 | 1,264 | 38 | 128 | 33.263158 | 0.819404 | 0.268987 | 0 | 0 | 0 | 0 | 0.615468 | 0.568627 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.038462 | 0 | 0.038462 | 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 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
efe08d9a28d33a25508a834211749d2a0fd273be | 253 | py | Python | remote_kernel_provider/__init__.py | datalayer-contrib/jupyter-kernel-provider-remote | 166aac497435c7d6ea27ddef3dd616045abe1b57 | [
"BSD-3-Clause"
] | 3 | 2019-07-24T00:31:18.000Z | 2021-02-28T16:38:47.000Z | remote_kernel_provider/__init__.py | kevin-bates/remote_kernel_provider | 855875a8259ba84ba5cdc9dba8fa2eeb29d19b12 | [
"BSD-3-Clause"
] | 13 | 2019-06-12T08:11:46.000Z | 2020-02-03T17:19:17.000Z | remote_kernel_provider/__init__.py | kevin-bates/remote_kernel_provider | 855875a8259ba84ba5cdc9dba8fa2eeb29d19b12 | [
"BSD-3-Clause"
] | 3 | 2019-07-03T18:34:46.000Z | 2020-01-15T21:11:13.000Z | from .provider import RemoteKernelProviderBase
from .manager import RemoteKernelManager
__author__ = """Jupyter Development Team"""
__email__ = 'jupyter@googlegroups.com'
__version__ = '0.1.0'
__all__ = [RemoteKernelProviderBase, RemoteKernelManager]
| 28.111111 | 57 | 0.810277 | 23 | 253 | 8.217391 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013158 | 0.098814 | 253 | 8 | 58 | 31.625 | 0.815789 | 0 | 0 | 0 | 0 | 0 | 0.209486 | 0.094862 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
4bea5c90f16bafd0ed85ef3266af20789e882aea | 890 | py | Python | app/auth/forms.py | goalong/flask-demo | 33fc1b8a72e6c67581ac949a55773ffad9ee7af7 | [
"MIT"
] | 45 | 2016-02-20T15:20:49.000Z | 2022-03-03T18:07:51.000Z | app/auth/forms.py | goalong/flask-demo | 33fc1b8a72e6c67581ac949a55773ffad9ee7af7 | [
"MIT"
] | null | null | null | app/auth/forms.py | goalong/flask-demo | 33fc1b8a72e6c67581ac949a55773ffad9ee7af7 | [
"MIT"
] | 13 | 2017-02-04T13:45:55.000Z | 2020-07-15T07:07:56.000Z | # encoding: utf-8
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired, Length, Email
class LoginForm(FlaskForm):
email = StringField(u'邮箱', validators=[DataRequired(), Length(1, 64),
Email()])
password = PasswordField(u'密码', validators=[DataRequired()])
remember_me = BooleanField(u'记住我')
submit = SubmitField(u'登录')
class RegisterForm(FlaskForm):
email = StringField(u'邮箱', validators=[DataRequired(), Length(1, 64),
Email()])
username = StringField(u'名称', validators=[DataRequired(), Length(1, 128)])
password = PasswordField(u'密码', validators=[DataRequired()])
password_confirm = PasswordField(u'密码确认', validators=[DataRequired()])
submit = SubmitField(u'注册')
| 42.380952 | 78 | 0.653933 | 89 | 890 | 6.505618 | 0.41573 | 0.227979 | 0.145078 | 0.150259 | 0.379965 | 0.379965 | 0.221071 | 0.221071 | 0.221071 | 0.221071 | 0 | 0.015805 | 0.217978 | 890 | 20 | 79 | 44.5 | 0.816092 | 0.016854 | 0 | 0.375 | 0 | 0 | 0.024055 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 0.1875 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
4bf393670003fcf8cb91cbdc5729e2c65540fa4d | 65 | py | Python | ssz/sedes/__init__.py | jannikluhn/py-ssz | ebbc50b0ed266b654e0be2e9bf806a962ddf5271 | [
"MIT"
] | null | null | null | ssz/sedes/__init__.py | jannikluhn/py-ssz | ebbc50b0ed266b654e0be2e9bf806a962ddf5271 | [
"MIT"
] | null | null | null | ssz/sedes/__init__.py | jannikluhn/py-ssz | ebbc50b0ed266b654e0be2e9bf806a962ddf5271 | [
"MIT"
] | null | null | null | from .boolean import ( # noqa: F401
boolean,
Boolean,
)
| 13 | 36 | 0.6 | 7 | 65 | 5.571429 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065217 | 0.292308 | 65 | 4 | 37 | 16.25 | 0.782609 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4bfa4d4ae0f9f8bf302baca5e6b3672f589737c8 | 171 | py | Python | forum/urls.py | AngeloZan/CodeZone | a9ed4e3d3c5b69e9f385fa2108059db1565022a0 | [
"MIT"
] | null | null | null | forum/urls.py | AngeloZan/CodeZone | a9ed4e3d3c5b69e9f385fa2108059db1565022a0 | [
"MIT"
] | null | null | null | forum/urls.py | AngeloZan/CodeZone | a9ed4e3d3c5b69e9f385fa2108059db1565022a0 | [
"MIT"
] | null | null | null | from django.urls import path
from forum.views import (
new_post_view,
)
app_name = 'forum'
urlpatterns = [
path('new-post/', new_post_view, name='new_post'),
]
| 14.25 | 54 | 0.684211 | 25 | 171 | 4.44 | 0.52 | 0.252252 | 0.198198 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181287 | 171 | 11 | 55 | 15.545455 | 0.792857 | 0 | 0 | 0 | 0 | 0 | 0.128655 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ef1be57ae19b6f49453be6d2cf52f93a0c1b02eb | 143 | py | Python | PairPlot.py | bhavyatrivedi7/Seaborn | 4562dd5b7104a10a642726660189ec2146b61e12 | [
"MIT"
] | null | null | null | PairPlot.py | bhavyatrivedi7/Seaborn | 4562dd5b7104a10a642726660189ec2146b61e12 | [
"MIT"
] | null | null | null | PairPlot.py | bhavyatrivedi7/Seaborn | 4562dd5b7104a10a642726660189ec2146b61e12 | [
"MIT"
] | null | null | null | import seaborn as sns
import matplotlib.pyplot as plt
df=sns.load_dataset("tips")
sns.pairplot(df,hue="sex",palette="hot",height=2)
plt.show()
| 23.833333 | 49 | 0.762238 | 25 | 143 | 4.32 | 0.76 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007576 | 0.076923 | 143 | 5 | 50 | 28.6 | 0.810606 | 0 | 0 | 0 | 0 | 0 | 0.06993 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ef2ce2be7216993c60d5312409b1f25ca405508f | 133 | py | Python | Q3/Rec_Task/tab_script.py | vs666/Data-Scraping-and-Analysis | ed9df3990fcd02ad362347992bba7bdef6f5e712 | [
"MIT"
] | null | null | null | Q3/Rec_Task/tab_script.py | vs666/Data-Scraping-and-Analysis | ed9df3990fcd02ad362347992bba7bdef6f5e712 | [
"MIT"
] | null | null | null | Q3/Rec_Task/tab_script.py | vs666/Data-Scraping-and-Analysis | ed9df3990fcd02ad362347992bba7bdef6f5e712 | [
"MIT"
] | null | null | null | from tabula import read_pdf
fn = input('Enter filename : ')
df = read_pdf(fn,pages="all",guess=True,multiple_tables=True,)
print(df) | 26.6 | 62 | 0.744361 | 22 | 133 | 4.363636 | 0.772727 | 0.145833 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 133 | 5 | 63 | 26.6 | 0.806723 | 0 | 0 | 0 | 0 | 0 | 0.149254 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ef3036776e0d5402a07b20fc113b54435e875fd6 | 220 | py | Python | Voetbal_club.py | LuckyLuuk035/Monte-Carlo_Luuk-Bouwman | f82a700ac002593eafd02cdcd242c167181f86ea | [
"MIT"
] | null | null | null | Voetbal_club.py | LuckyLuuk035/Monte-Carlo_Luuk-Bouwman | f82a700ac002593eafd02cdcd242c167181f86ea | [
"MIT"
] | null | null | null | Voetbal_club.py | LuckyLuuk035/Monte-Carlo_Luuk-Bouwman | f82a700ac002593eafd02cdcd242c167181f86ea | [
"MIT"
] | null | null | null | class VoetbalClub:
"""
VoetbalClub is een simpele class.
Gemaakt om het aantal punten van de clubs bij te kunnen houden.
"""
def __init__(self, naam):
self.naam = naam
self.punten = 0
| 24.444444 | 67 | 0.622727 | 29 | 220 | 4.586207 | 0.758621 | 0.120301 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006494 | 0.3 | 220 | 8 | 68 | 27.5 | 0.857143 | 0.440909 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ef30b99f38deafadb9d35a801c70a3a4c3d33fc3 | 1,830 | py | Python | readme.py | 25prajwal/wifimangement_linux | 766f825114fefa3b3d5bfbc71be88dd2fa5b07db | [
"MIT"
] | 1 | 2022-02-14T09:49:48.000Z | 2022-02-14T09:49:48.000Z | readme.py | 25prajwal/wifimangement_linux | 766f825114fefa3b3d5bfbc71be88dd2fa5b07db | [
"MIT"
] | 1 | 2021-12-21T09:31:40.000Z | 2021-12-21T09:31:43.000Z | readme.py | 25prajwal/wifimangement_linux | 766f825114fefa3b3d5bfbc71be88dd2fa5b07db | [
"MIT"
] | 1 | 2021-12-27T09:49:50.000Z | 2021-12-27T09:49:50.000Z | import wifimangement-linux as wifi
# to disable(off) the wifi
# wifi.off()
# to enable(on) the wifi
# wifi.on()
# connect the wifi to network(name as wifi-name or your wifi name ) if the password
# wifi.connect("wifi-name")
# connect the wifi to network(name as wifi-name with password)
# wifi.connect("wifi-name","wifi-password")
# to scan local wi-fi network
# wifi.scan()
# get list of scan network
# wifi.list()
# share a connect wifi (information and password)
# wifi.share()
# share a connect wifi (information and password) with qr code
# wifi.share("qr")
# it return connect wifi password (pass=wifi.share("psk")) it store password in pass)
# wifi.share("psk")
# it create hostop (with name as hostop-name and password as password ) =>note:- to off hostop and turn on wifi use (wifi.on())
# wifi.hostop("hostop-name","password")
# it return list out all interface in pc (inter_list=wifi.interface_list()) its store list of interface in inter_list
# wifi.interface_list()
# it return interfac stutus in pc (inter_stutas=wifi.interface_status()) its store interface status in inter_status
# wifi.interface_status()
# it return interfac configration in pc (inter_conf=wifi.interface_status()) its store interface config in inter_conf
# wifi.interface_config()
# it return interfac configration at certain interface in pc (inter_conf_wlan0=wifi.interface_status("wlan0")) its store interface config of wlan0 in inter_conf_wlan
# wifi.interface_config("interface")
# return gateway of router (its an ip address of router)
# wifi.gateway()
# return ip addres of pc
# wifi.ip()
# its return wifi they password in dictory (dic=wifi.store()) its store all saved wifi and password in dictory name as div
# wifi.store()
# its print all saved wifi and password in nice table format
# wifi.printpsk() | 32.678571 | 168 | 0.74153 | 290 | 1,830 | 4.617241 | 0.262069 | 0.07767 | 0.026886 | 0.023898 | 0.31068 | 0.20463 | 0.113518 | 0.055265 | 0.055265 | 0 | 0 | 0.001948 | 0.15847 | 1,830 | 56 | 169 | 32.678571 | 0.867532 | 0.931148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 1 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ef4acbe844fa7468574e22788a17bdf1a95ae1fe | 246 | py | Python | month01/all_code/day02/exercise04.py | chaofan-zheng/tedu-python-demo | abe983ddc52690f4726cf42cc6390cba815026d8 | [
"Apache-2.0"
] | 4 | 2021-01-07T14:25:15.000Z | 2021-02-01T10:36:10.000Z | month01/all_code/day02/exercise04.py | chaofan-zheng/tedu-python-demo | abe983ddc52690f4726cf42cc6390cba815026d8 | [
"Apache-2.0"
] | null | null | null | month01/all_code/day02/exercise04.py | chaofan-zheng/tedu-python-demo | abe983ddc52690f4726cf42cc6390cba815026d8 | [
"Apache-2.0"
] | null | null | null | """
画出下列代码内存图,说出终端显示结果
"""
# insert 键:切换插入或者改写模式
name_of_beijing, region = "北京", "市"
name_of_beijing_region = name_of_beijing + region
region = "省"
print(name_of_beijing_region) # 北京市
del name_of_beijing
print(name_of_beijing_region) # 北京市
| 22.363636 | 49 | 0.756098 | 37 | 246 | 4.621622 | 0.405405 | 0.210526 | 0.45614 | 0.555556 | 0.315789 | 0.315789 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134146 | 246 | 10 | 50 | 24.6 | 0.802817 | 0.191057 | 0 | 0.333333 | 0 | 0 | 0.021622 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ef5b176184c9eeadd35333e33ddaad112fa1db0a | 623 | py | Python | setup.py | chrisvoncsefalvay/processpathway | d10ad6af2f469155a530cac6bff7a9704ccfec0f | [
"MIT"
] | null | null | null | setup.py | chrisvoncsefalvay/processpathway | d10ad6af2f469155a530cac6bff7a9704ccfec0f | [
"MIT"
] | null | null | null | setup.py | chrisvoncsefalvay/processpathway | d10ad6af2f469155a530cac6bff7a9704ccfec0f | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='processpathway',
version='0.3.11',
packages=['processpathway'],
url='https://www.github.com/chrisvoncsefalvay/processpathway',
license='MIT',
author='Chris von Csefalvay',
author_email='chris@chrisvoncsefalvay.com',
download_url='https://github.com/chrisvoncsefalvay/processpathway/tarball/0.3.11',
description='A nifty little toolkit to create stress-free, frustrationless image processing pathways from your webcam for computer vision experiments. Or observing your cat.',
keywords=['image processing', 'computer vision', 'opencv']
)
| 41.533333 | 179 | 0.741573 | 73 | 623 | 6.30137 | 0.69863 | 0.008696 | 0.017391 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014842 | 0.134831 | 623 | 14 | 180 | 44.5 | 0.83859 | 0 | 0 | 0 | 0 | 0.076923 | 0.64366 | 0.043339 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.076923 | 0 | 0.076923 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3237604f4db0f37db932f148f6d237d4ff2aa979 | 90 | py | Python | djangocms_navigation/__init__.py | chaosk/djangocms-navigation | 0b0cbdf58dd98670094365e5c64e5088656bf77d | [
"BSD-3-Clause"
] | null | null | null | djangocms_navigation/__init__.py | chaosk/djangocms-navigation | 0b0cbdf58dd98670094365e5c64e5088656bf77d | [
"BSD-3-Clause"
] | null | null | null | djangocms_navigation/__init__.py | chaosk/djangocms-navigation | 0b0cbdf58dd98670094365e5c64e5088656bf77d | [
"BSD-3-Clause"
] | null | null | null | __version__ = "0.0.14"
default_app_config = "djangocms_navigation.apps.NavigationConfig"
| 22.5 | 65 | 0.811111 | 11 | 90 | 6 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.048193 | 0.077778 | 90 | 3 | 66 | 30 | 0.746988 | 0 | 0 | 0 | 0 | 0 | 0.533333 | 0.466667 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.