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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40e70b9686412d0723cd23f536473c204625ea82
| 16,835
|
py
|
Python
|
boardfarm/lib/wifi_snmp.py
|
mattsm/boardfarm
|
100521fde1fb67536682cafecc2f91a6e2e8a6f8
|
[
"BSD-3-Clause-Clear"
] | 40
|
2018-03-23T14:17:13.000Z
|
2022-02-05T05:59:41.000Z
|
boardfarm/lib/wifi_snmp.py
|
mattsm/boardfarm
|
100521fde1fb67536682cafecc2f91a6e2e8a6f8
|
[
"BSD-3-Clause-Clear"
] | 1
|
2020-04-17T01:20:12.000Z
|
2020-04-20T20:42:00.000Z
|
boardfarm/lib/wifi_snmp.py
|
mattsm/boardfarm
|
100521fde1fb67536682cafecc2f91a6e2e8a6f8
|
[
"BSD-3-Clause-Clear"
] | 9
|
2018-04-11T08:31:14.000Z
|
2020-08-06T14:55:35.000Z
|
import pexpect
from . import SnmpHelper
from .common import retry_on_exception, snmp_mib_get, snmp_mib_set
from .wifi import wifi_stub
class wifi_snmp(wifi_stub):
"""Class for wifi settings via SNMP
Inherits wifi_stub from lib/wifi.py
"""
def __init__(self, device, board):
""" Constructor method to get the mib names for wifi
This mib name has to be provided via a vendor specific json file
and initialised in the board method
"""
self.device = device
self.board = board
self.mib_value = self.board.wifi_snmp_file
self.parser = SnmpHelper.SnmpMibs.default_mibs
self.iface_ip = None
def enable_wifi(self, wifi_mode):
"""To enable wifi network via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_5
:type wifi_mode: string
:raises assertion: Mib query return value for enable wifi
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Wifi_enable"],
index, "i", "1")
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Wifi_enable"],
index)
assert mib_out == "1", "Mib query return value for enable wifi: %s" % mib_out
def set_ssid(self, wifi_mode, ssid_name):
"""To set wifi ssid via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_5
:type wifi_mode: string
:param ssid_name: Name for wifi ssid
:type ssid_name: string
:raises assertion: Mib query return value for setting the SSID
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["SSID_set"], index,
"s", ssid_name)
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["SSID_set"],
index)
assert mib_out == ssid_name, "Mib query return value for setting the SSID: %s" % mib_out
def set_security(self, wifi_mode, security):
"""To set wifi security via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_5
:type wifi_mode: string
:param security: security string eg:WPA-PSK/WPA2-PSK
:type security: string
:raises assertion: Mib query return value for setting the security mode
"""
index = self.mib_value["mib_index"][wifi_mode]
security_mode = self.mib_value["security_mode"][security]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Security_mode"],
index, "i", security_mode)
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Security_mode"],
index)
assert mib_out == security_mode, "Mib query return value for setting the security mode: %s" % mib_out
def set_password(self, wifi_mode, password):
"""To set wifi password via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_5
:type wifi_mode: string
:param password: wifi password
:type password: string
:raises assertion: Mib query return value for setting the password
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Password_set"],
index, "s", password)
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Password_set"],
index)
assert mib_out == password, "Mib query return value for setting the password: %s" % mib_out
def enable_channel_utilization(self, wifi_mode):
"""To enable channel utilization via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:raises assertion: Mib query return value for setting the channel utilisation
"""
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Channel_Util"], "0",
"i", "2")
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Channel_Util"],
"0")
assert mib_out == "2", "Mib query return value for setting the channel utilisation: %s" % mib_out
def set_operating_mode(self, wifi_mode, operating_mode):
"""To set wifi operating mode via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:param operating_mode: wifi operating mode eg:802.11b/g mixed
:type operating_mode: string
:raises assertion: Mib query return value for setting the operating mode
"""
index = self.mib_value["mib_index"][wifi_mode]
operating_mode = self.mib_value["operating_mode"][operating_mode]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Operating_mode"],
index, "i", operating_mode)
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(
self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Operating_mode"], index)
assert mib_out == operating_mode, "Mib query return value for setting the operating mode: %s" % mib_out
def set_bandwidth(self, wifi_mode, bandwidth, channel_number=0):
"""To set wifi bandwidth via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:param bandwidth: wifi bandwidth eg:20/40 MHz
:type bandwidth: string
:param channel_number: Always 0 in snmp, defaults to 0
:type channel_number: Integer, optional
:raises assertion: Mib query return value for setting the bandwidth
"""
index = self.mib_value["mib_index"][wifi_mode]
bandwidth = self.mib_value["bandwidth"][bandwidth]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Bandwidth"], index,
"i", bandwidth)
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Bandwidth"],
index)
assert mib_out == bandwidth, "Mib query return value for setting the bandwidth: %s" % mib_out
def set_channel_number(self, wifi_mode, channel_number):
"""To set wifi channel number via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:param channel_number: Wifi channel number
:type channel_number: string
:raises assertion: Mib query return value for setting the channel number
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Channel_mode"],
index, "u", channel_number)
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Channel_mode"],
index)
assert mib_out == channel_number, "Mib query return value for setting the channel number: %s" % mib_out
def set_broadcast(self, wifi_mode, broadcast="enable"):
"""To set wifi broadcast via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:param broadcast: enable or disable, defaults to enable
:type broadcast: string, optional
:raises assertion: Mib query return value for setting the broadcast for SSID
"""
if broadcast == "enable":
broadcast_value = "2"
elif broadcast == "disable":
broadcast_value = "1"
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_set(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Broadcast"], index,
"i", broadcast_value)
if self.apply_changes_no_delay:
self.apply_changes()
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Broadcast"],
index)
assert mib_out == broadcast_value, "Mib query return value for setting the broadcast for SSID: %s" % mib_out
def apply_changes(self):
"""To apply changes to the wifi settings
:return: True or False
:rtype: boolean
"""
retry_on_exception(snmp_mib_set, (
self.device,
self.parser,
self.iface_ip,
self.mib_value["mib_name"]["Wifi_Apply_setting"],
'0',
'i',
'1',
))
for _ in range(4):
self.board.expect(pexpect.TIMEOUT, timeout=20)
try:
mib_out = snmp_mib_set(
self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Wifi_diag_command"], '0', 's',
'"echo 1"')
mib_out = snmp_mib_get(
self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Wifi_diag_result"], '0')
if mib_out != '1':
continue
wifi_2G_channel = snmp_mib_get(
self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Current_channel"], '32')
wifi_5G_channel = snmp_mib_get(
self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Current_channel"], '92')
if wifi_2G_channel != '0' and wifi_5G_channel != '0':
return True
break
except:
pass
return False
def get_wifi_enabled(self, wifi_mode):
"""To verify wifi enabled via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: mib output wifi enabled or not
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Wifi_enable"],
index)
return mib_out
def get_ssid(self, wifi_mode):
"""To get ssid via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi ssid
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["SSID_set"], index)
return mib_out
def get_security(self, wifi_mode):
"""To get security via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi security
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Security_mode"],
index)
return mib_out
def get_password(self, wifi_mode):
"""To get password via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi password
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Password_set"],
index)
return mib_out
def get_channel_utilization(self):
"""To get channel utilization via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi channel utilization
:rtype: string
"""
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Channel_Util"], "0")
return mib_out
def get_operating_mode(self, wifi_mode):
"""To get operating mode via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi operating mode
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Operating_mode"],
index)
return mib_out
def get_bandwidth(self, wifi_mode):
"""To get bandwidth via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi bandwidth
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Bandwidth"], index)
return mib_out
def get_broadcast(self, wifi_mode):
"""To get broadcast via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi broadcast
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Broadcast"], index)
return mib_out
def get_channel_number(self, wifi_mode):
"""To get channel number via SNMP
:param wifi_mode: wifi network mode eg:private_2.4, guest_2.4,
private_5, guest_5
:type wifi_mode: string
:return: wifi channel number
:rtype: string
"""
index = self.mib_value["mib_index"][wifi_mode]
mib_out = snmp_mib_get(self.device, self.parser, self.iface_ip,
self.mib_value["mib_name"]["Current_channel"],
index)
return mib_out
| 44.186352
| 116
| 0.559014
| 2,062
| 16,835
| 4.304559
| 0.06547
| 0.06219
| 0.070302
| 0.081118
| 0.773209
| 0.72589
| 0.718905
| 0.702456
| 0.682289
| 0.649392
| 0
| 0.012547
| 0.351411
| 16,835
| 380
| 117
| 44.302632
| 0.800348
| 0.287615
| 0
| 0.507538
| 0
| 0
| 0.124805
| 0
| 0
| 0
| 0
| 0
| 0.045226
| 1
| 0.100503
| false
| 0.040201
| 0.020101
| 0
| 0.180905
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
40faaf11bb458ed5c34242dacca78b4d5694f0a2
| 124
|
py
|
Python
|
python/kyu-7/vowel-count/test_vowel_count.py
|
ledwindra/codewars
|
0552669a69e801cfe5f9a3696a4d98be63a96951
|
[
"WTFPL"
] | 1
|
2020-11-13T16:55:04.000Z
|
2020-11-13T16:55:04.000Z
|
python/kyu-7/vowel-count/test_vowel_count.py
|
ledwindra/codewars
|
0552669a69e801cfe5f9a3696a4d98be63a96951
|
[
"WTFPL"
] | 1
|
2020-01-28T15:48:17.000Z
|
2020-01-28T15:48:17.000Z
|
python/kyu-7/vowel-count/test_vowel_count.py
|
ledwindra/codewars
|
0552669a69e801cfe5f9a3696a4d98be63a96951
|
[
"WTFPL"
] | null | null | null |
from vowel_count import get_count
class TestVowelCount:
def test_0(self):
assert get_count("abracadabra") == 5
| 20.666667
| 44
| 0.717742
| 17
| 124
| 5
| 0.823529
| 0.188235
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020202
| 0.201613
| 124
| 6
| 44
| 20.666667
| 0.838384
| 0
| 0
| 0
| 0
| 0
| 0.088
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
90512c695003191c56855e231758b9ee2a796aeb
| 213
|
py
|
Python
|
src/slowo.py
|
grzegorzwojdyga/SDA_excercises2
|
4106e95884a7aceb7f9bd74b91997b5e1a08d83c
|
[
"MIT"
] | null | null | null |
src/slowo.py
|
grzegorzwojdyga/SDA_excercises2
|
4106e95884a7aceb7f9bd74b91997b5e1a08d83c
|
[
"MIT"
] | null | null | null |
src/slowo.py
|
grzegorzwojdyga/SDA_excercises2
|
4106e95884a7aceb7f9bd74b91997b5e1a08d83c
|
[
"MIT"
] | null | null | null |
"""
Napisz program, który pobiera od użytkownika słowo, a następnie wyświetla słowo złożone z co drugiego znaku pobranego.
W drugiej kolejności program powinien wyświetlić słowo z pozostałych liter.
"""
| 53.25
| 123
| 0.769953
| 27
| 213
| 6.074074
| 0.851852
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183099
| 213
| 4
| 124
| 53.25
| 0.942529
| 0.910798
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9061956f3c16655b653349e4912ec3097eaa7460
| 412
|
py
|
Python
|
CodeSignal/Arcade/The_Core/Level_03_Corner_Of_Zeros_And_Ones/020_Mirror_Bits.py
|
Zubieta/CPP
|
fb4a3cbf2e4edcc590df15663cd28fb9ecab679c
|
[
"MIT"
] | 8
|
2017-03-02T07:56:45.000Z
|
2021-08-07T20:20:19.000Z
|
CodeSignal/Arcade/The_Core/Level_03_Corner_Of_Zeros_And_Ones/020_Mirror_Bits.py
|
zubie7a/Algorithms
|
fb4a3cbf2e4edcc590df15663cd28fb9ecab679c
|
[
"MIT"
] | null | null | null |
CodeSignal/Arcade/The_Core/Level_03_Corner_Of_Zeros_And_Ones/020_Mirror_Bits.py
|
zubie7a/Algorithms
|
fb4a3cbf2e4edcc590df15663cd28fb9ecab679c
|
[
"MIT"
] | 1
|
2021-08-07T20:20:20.000Z
|
2021-08-07T20:20:20.000Z
|
# https://app.codesignal.com/arcade/code-arcade/corner-of-0s-and-1s/e3zfPNTwTa9qTQzcX
def mirrorBits(a):
# Reverse the order of the bits in a given integer.
# 1. Convert to a binary string with bin(), but mind that it
# will start with "0b" so remove that.
# 2. Reverse the string.
# 3. Convert the result back to int giving source base as 2.
return int("".join(reversed(bin(a)[2:])), 2)
| 45.777778
| 85
| 0.682039
| 69
| 412
| 4.072464
| 0.724638
| 0.071174
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033233
| 0.196602
| 412
| 8
| 86
| 51.5
| 0.81571
| 0.754854
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
9063f3d367d9d5baaed65072d31d98c424492368
| 190
|
py
|
Python
|
borges/delivery/delivery/app.py
|
thcborges/curso-flask
|
5cfe24c8525f3c23844e2b9f5e2b60ad647d5d54
|
[
"Unlicense"
] | null | null | null |
borges/delivery/delivery/app.py
|
thcborges/curso-flask
|
5cfe24c8525f3c23844e2b9f5e2b60ad647d5d54
|
[
"Unlicense"
] | null | null | null |
borges/delivery/delivery/app.py
|
thcborges/curso-flask
|
5cfe24c8525f3c23844e2b9f5e2b60ad647d5d54
|
[
"Unlicense"
] | null | null | null |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return '<h1>Hello, Codeshow</h1>'
@app.route('/sobre')
def sobre():
return '<h1>site de delivery</h1>'
| 14.615385
| 38
| 0.631579
| 27
| 190
| 4.296296
| 0.592593
| 0.137931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025316
| 0.168421
| 190
| 13
| 38
| 14.615385
| 0.708861
| 0
| 0
| 0
| 0
| 0
| 0.293194
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.125
| 0.25
| 0.625
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
907d672cc3562c5ddfa983851a11aa9b90e5f44f
| 119
|
py
|
Python
|
run.py
|
MeghanaAnvekar/project_52
|
a621730af7333f3c5fab2f96c54f97ce4ec9db1e
|
[
"MIT"
] | 8
|
2020-03-19T17:52:19.000Z
|
2021-06-04T17:33:03.000Z
|
run.py
|
MeghanaAnvekar/project_52
|
a621730af7333f3c5fab2f96c54f97ce4ec9db1e
|
[
"MIT"
] | 10
|
2020-03-23T07:26:49.000Z
|
2021-06-10T18:44:23.000Z
|
run.py
|
MeghanaAnvekar/project_52
|
a621730af7333f3c5fab2f96c54f97ce4ec9db1e
|
[
"MIT"
] | 9
|
2020-03-21T06:23:48.000Z
|
2020-04-03T17:59:18.000Z
|
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from app import app
if __name__ == '__main__':
app.run(debug=True)
| 14.875
| 26
| 0.621849
| 18
| 119
| 3.666667
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010309
| 0.184874
| 119
| 7
| 27
| 17
| 0.670103
| 0.352941
| 0
| 0
| 0
| 0
| 0.106667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
909265a39f7a04332f1af9a5be567cbe555620bd
| 259
|
py
|
Python
|
wagtail_localize_git/test/apps.py
|
kaedroho/wagtail-localize-pontoo
|
24319685a2fa4df5515fda872032088faaf07415
|
[
"BSD-3-Clause"
] | 5
|
2021-02-10T01:32:30.000Z
|
2022-03-03T05:57:30.000Z
|
wagtail_localize_git/test/apps.py
|
kaedroho/wagtail-localize-pontoon
|
24319685a2fa4df5515fda872032088faaf07415
|
[
"BSD-3-Clause"
] | 9
|
2020-11-17T13:41:16.000Z
|
2022-03-25T13:12:43.000Z
|
wagtail_localize_git/test/apps.py
|
kaedroho/wagtail-localize-pontoon
|
24319685a2fa4df5515fda872032088faaf07415
|
[
"BSD-3-Clause"
] | 1
|
2021-11-29T10:12:59.000Z
|
2021-11-29T10:12:59.000Z
|
from django.apps import AppConfig
class WagtailLocalizeGitTestAppConfig(AppConfig):
label = "wagtail_localize_git_test"
name = "wagtail_localize_git.test"
verbose_name = "Localize Git tests"
default_auto_field = "django.db.models.AutoField"
| 28.777778
| 53
| 0.776062
| 30
| 259
| 6.433333
| 0.7
| 0.170984
| 0.186529
| 0.227979
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146718
| 259
| 8
| 54
| 32.375
| 0.873303
| 0
| 0
| 0
| 0
| 0
| 0.362934
| 0.293436
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
90c7d2bbda443232ee00aeb7b402bd20b09b1af1
| 9,780
|
bzl
|
Python
|
k8s/kustomize/assets.bzl
|
f110/rules_k8s_controller
|
f7c59a6616ab7c24d83fde97d96bc05c07cb1c7c
|
[
"MIT"
] | null | null | null |
k8s/kustomize/assets.bzl
|
f110/rules_k8s_controller
|
f7c59a6616ab7c24d83fde97d96bc05c07cb1c7c
|
[
"MIT"
] | null | null | null |
k8s/kustomize/assets.bzl
|
f110/rules_k8s_controller
|
f7c59a6616ab7c24d83fde97d96bc05c07cb1c7c
|
[
"MIT"
] | null | null | null |
KUSTOMIZE_ASSETS = {
"3.8.1": {
"linux": (
"https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.8.1/kustomize_v3.8.1_linux_amd64.tar.gz",
"9d5b68f881ba89146678a0399469db24670cba4813e0299b47cb39a240006f37",
),
"darwin": (
"https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.8.1/kustomize_v3.8.1_darwin_amd64.tar.gz",
"db8a283c7edfc10c0e661b31916f4e60096eae558657730177e4f103c84ddc00",
),
},
"v3.9.1": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.1/kustomize_v3.9.1_darwin_amd64.tar.gz", "a15ced11ef9e26061c9f9204f3dec1e15e96e566cc99f443a45a1eeb638f5ce7"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.1/kustomize_v3.9.1_linux_amd64.tar.gz", "0fb2c3299ca3668205eac3a3a5be9a8e4a79d7c4fba18542a6c444e0d33ddbdd"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.1/kustomize_v3.9.1_windows_amd64.tar.gz", "35adf766750ac2f9fe15128218cfe53f59d3e984ab04ed2555a875496368e00b")},
"v3.9.2": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.2/kustomize_v3.9.2_darwin_amd64.tar.gz", "6d01be3adee9cb0b118988ddd4879fcae575baa0b6210836c1d0aa83c9199678"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.2/kustomize_v3.9.2_linux_amd64.tar.gz", "f5c76a726cbd27b74587fcd2816e86b3f6279d84043b7ed3725bf48b1bc8ca4a"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.2/kustomize_v3.9.2_windows_amd64.tar.gz", "f2de820ff6c00d5e93141bd887c577b962e249cf395466d304b7bff1f8bb5860")},
"v3.9.3": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.3/kustomize_v3.9.3_darwin_amd64.tar.gz", "5909b9515339d6fcb5f1d6ddd406ab5c6cef697425a6abbc9ad4659d585fa4d7"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.3/kustomize_v3.9.3_linux_amd64.tar.gz", "16b42caddcde36cfeaffbd459bedc0349e66f52e7afa12083d4630b1358f0aa5"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.3/kustomize_v3.9.3_windows_amd64.tar.gz", "42f9837c72f010461688a61217f885474bf5c439a64f83db8898d62ab3f9c478")},
"v3.9.4": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.4/kustomize_v3.9.4_darwin_amd64.tar.gz", "d7579f24a7ccc3bcadf13ff0578bd2f6dedfcbe12699914c1331ac2993b11904"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.4/kustomize_v3.9.4_linux_amd64.tar.gz", "439c6bda9086399477e4f847b16b9b45ee695391b4f5d6e4107374ad149050b0"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.9.4/kustomize_v3.9.4_windows_amd64.tar.gz", "8b0fc48843ee66b4ca8115f07fa92d536d773c04a76567176cb5e5e83f5cadf5")},
"v3.10.0": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.10.0/kustomize_v3.10.0_darwin_amd64.tar.gz", "8fc809455a282f1c9a8574304f61dcaf1f709012739cbddf5d122b1e953588b3"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.10.0/kustomize_v3.10.0_linux_amd64.tar.gz", "bab4ab8881718c29ba174bdf677fd89986ad25c40eb363fec9e78c1aff2ff0ea"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.10.0/kustomize_v3.10.0_windows_amd64.tar.gz", "aa1db87c2ef85bb4780e96299873a6b7960385f1599a2193dbd449e90a58c20d")},
"v4.0.0": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.0/kustomize_v4.0.0_darwin_amd64.tar.gz", "334985ae01bdbac329005207f57400db04394b846eb29f75a223c57541bd6b5b"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.0/kustomize_v4.0.0_linux_amd64.tar.gz", "6d8da061bbd9e7c57b2f39f34ef5f4cce76321e94bfe6cae4e972a7483f3bf30"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.0/kustomize_v4.0.0_windows_amd64.tar.gz", "b7494313d0b45ab57d2bb4a26c44c18180565e30661dcf53b78314fac761db5b")},
"v4.0.1": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.1/kustomize_v4.0.1_darwin_amd64.tar.gz", "0d72f74369d91acda33b08a3c979b1f2fc5f76f603c1e04545bbef84d39e1858"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.1/kustomize_v4.0.1_linux_amd64.tar.gz", "914c006a4c00e92e09c050e5be594ef1270d47ea41b84dd7bdcab6b3b05b9297"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.1/kustomize_v4.0.1_windows_amd64.tar.gz", "2a6793b6809bb99e4e9c93914c62233d018ec170acbf2ec086d87091f7f0cbff")},
"v4.0.2": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.2/kustomize_v4.0.2_darwin_amd64.tar.gz", "3f0b46728a16d844439de36f9766d8b1eb8dda37503d3eff1f0c3eb5160b0feb"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.2/kustomize_v4.0.2_linux_amd64.tar.gz", "94f31d5c1d1b4bc025a920f7460c3ad2e2b41b8bc21e101aa918c8820f523f27"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.2/kustomize_v4.0.2_windows_amd64.tar.gz", "661b8c970c98c9e86bb645216423807631d214576f82cfb5e30be1b64e404c30")},
"v4.0.3": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.3/kustomize_v4.0.3_darwin_amd64.tar.gz", "9e7c69c83eef4bd2641e4a8a79ffb900fa8fd05e125392086def5f78707f9b84"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.3/kustomize_v4.0.3_linux_amd64.tar.gz", "7cfaa86f8323d9deaa8233c31f3843dbce71e56875b7bf22292e5bc56b13e259"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.3/kustomize_v4.0.3_windows_amd64.tar.gz", "3824c30bb16b9515978ae7d0a2b6a2e87f69b71d8fa6b8dfc2d08fcd265d37d0")},
"v4.0.4": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.4/kustomize_v4.0.4_darwin_amd64.tar.gz", "46520fcd13aed85e944b7562702fcad69a6d024fd1de65234ecd2edbbf41ac99"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.4/kustomize_v4.0.4_linux_amd64.tar.gz", "df1e23bb1f801faadbd1e2d2c4ba6839979dd58d26aeb2a6d46baf62039e25f0"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.4/kustomize_v4.0.4_windows_amd64.tar.gz", "04ef445997b3220fa023eef2455a64c144d9811208ae6b74c251aa1e95a29373")},
"v4.0.5": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.5/kustomize_v4.0.5_darwin_amd64.tar.gz", "a0d50c943105684bb809970a9d2677fca7affbf4c2acff7c0f7663de980674a5"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.5/kustomize_v4.0.5_linux_amd64.tar.gz", "3ef93195ede4b7664b7ec65284461dd8eeb9f5404e7db5eb5bf59003085a0c98"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.0.5/kustomize_v4.0.5_windows_amd64.tar.gz", "ba54b5e707d172b79e2cd9fcaabdb3688a56f3d8cde0ddff4b0c4e1c47f1a30d")},
"v4.1.0": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.0/kustomize_v4.1.0_darwin_amd64.tar.gz", "9f969a393a63af80e78d63f6a7afab441c14fb8a44f15fd4e2c1b498cb7e4987"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.0/kustomize_v4.1.0_linux_amd64.tar.gz", "77263c66afd04106348bebd019096933e26c0054d5b0ade8265f3426cf440ae6"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.0/kustomize_v4.1.0_windows_amd64.tar.gz", "87077b1719473a1711c1e406f06bf648ee07ab9f54e2e374f14ac53d0a4d203d")},
"v4.1.1": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.1/kustomize_v4.1.1_darwin_amd64.tar.gz", "12d418e190b0523b2ca300254d3e17c201aee87db24d04ad1db91c3b742fb654"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.1/kustomize_v4.1.1_linux_amd64.tar.gz", "0405346be25f5282a00b43344d57185be339804c8a1071658c7d6f9912c10d1c"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.1/kustomize_v4.1.1_windows_amd64.tar.gz", "a68d179749453cdfbe5dc29c9747801f48728345888f752ba584d83a50127625")},
"v4.1.2": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.2/kustomize_v4.1.2_darwin_amd64.tar.gz", "08bf3888391a526d247aead55b6bd940574bba238d9d32aa40c0adb4998f812e"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.2/kustomize_v4.1.2_linux_amd64.tar.gz", "4efb7d0dadba7fab5191c680fcb342c2b6f252f230019cf9cffd5e4b0cad1d12"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.2/kustomize_v4.1.2_windows_amd64.tar.gz", "6074f536a4ded829cc56e75078932836a1a8a5bd154d82c1470999128022b2ed")},
"v4.1.3": {"darwin": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.3/kustomize_v4.1.3_darwin_amd64.tar.gz", "f1e54fdb659a68e5ec0a65aa52868bcc32b18fd3bc2b545db890ba261d3781c4"), "linux": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.3/kustomize_v4.1.3_linux_amd64.tar.gz", "f028cd2b675d215572d54634311777aa475eb5612fb8a70d84b957c4a27a861e"), "windows": ("https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.1.3/kustomize_v4.1.3_windows_amd64.tar.gz", "67a21b674a8dad5e027224c3426e496028e10a65e779e950d07e5d6d8c1d9d2d")},
}
| 349.285714
| 622
| 0.81636
| 1,084
| 9,780
| 7.234317
| 0.068266
| 0.084162
| 0.083907
| 0.143841
| 0.602015
| 0.512369
| 0.512369
| 0.512369
| 0.512369
| 0.512369
| 0
| 0.245747
| 0.032209
| 9,780
| 27
| 623
| 362.222222
| 0.582779
| 0
| 0
| 0.074074
| 0
| 1.740741
| 0.904499
| 0.307566
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
90e90d45d713ef64f7220850b039861f4d214924
| 2,023
|
py
|
Python
|
nonebot1_qqbot/plugins/hyly/ecysj.py
|
freesrz93/nonebot1_qqbot
|
ec8dfb5f7dcf222185b0215db97e4557861c93dd
|
[
"MIT"
] | null | null | null |
nonebot1_qqbot/plugins/hyly/ecysj.py
|
freesrz93/nonebot1_qqbot
|
ec8dfb5f7dcf222185b0215db97e4557861c93dd
|
[
"MIT"
] | null | null | null |
nonebot1_qqbot/plugins/hyly/ecysj.py
|
freesrz93/nonebot1_qqbot
|
ec8dfb5f7dcf222185b0215db97e4557861c93dd
|
[
"MIT"
] | null | null | null |
ecysj = """呐呐呐,米娜桑,扣祢起哇,瓦达西二刺猿の烧酒嚏!历布布,迁我仞一起守折,最好の二刺猿肥!呐呐,不憧我的,愚蠢の人们呵,果畔那塞,我二刺猿の烧酒是不会和祢有共同语言的jio豆麻袋,迅祥子拼活有什幺错喝?呐,告诉我呵。
搜嚆祢仞已经不喜炊了呵..真是冷酷の人昵,果鲜纳塞,止祢看到不愉快の龙西了。像我送祥的人,果然消失就好了昵。也午只有在二次元的世界里,才有真正的美好存在的肥,呐?权元权元标元,果然灰惠了呵,带jio不,瓦达西,二刺猿の烧酒!博古哇zeidei不会人输!米娜桑!呐!瓦达西- _刺猿拓拓!哦晦吻扣赛伊弓斯!
呐呐呐!米娜桑!我要幵劫了~一十打去鄂死!诶多诶多~「多洗忒」?为什么要「妄.图.抹.杀」这样的「自己」呢?★(笑)呐、「中二病的你」也好、「二次元的你」也好...「全部」daisuki~呐~二次元民那赛高desuwa!
今后也.请.多.多.指.教.喔?~啊啊... .是C鲜V血γσγ味V道V呐凹~! ( 眯眼笑) kukuku-汝の「血」、会是什么样的「气味」呢★?诶多多~说着说着有些期待了呢J品尝「挚:爱:之:人」 の) 「鲜血」什么的~嘛.... .如果是「你」的话,-定可以的!是的呢,那些可恶的三元狗怎么呢理解我们高贵的二★次仑元女人众呢。
喵呜,要将那些人全部杀掉呐呐呐_..同类真是可爱得很.... w≌)不得不说万恶的三次元有点可取的,比如表情包。我们可以接受他们,他们排斥我们呢...抹 爱小姐有错吗?
呐呐呐呐呐呐呐--遇到同类了啊啊啊啊美子式尖叫。(≥w≌)喵呜~果然万恶的三次元中也有★清流★呢。君果然是可爱得很呢.... .芽衣本甜子们会开心的要死吧.. .. 呐呐呐呐呐
嗦嘎,二次元的美好,一定得守护的说, 呐,三次元的愚蠢的人类最讨厌了的说,金木的痛,也许只有我明白的吧,啊啊啊啊,我也有要守护的事物,我即将化生恶魔8.(■n▲)&.
诶多...★是V同V类呢V喵」(由乃逆光捧脸.jpg)那群八嘎是不会懂的呀.. ... .关于 「二次元の美好」V呐,如果说吾の存在有意义的话、那-定是因为「二次元」吧★?
所以呢--妄图污染这份「爱」的人类、都会被吾「抹」「杀」「掉」 喔小(小声)...过厌二次元的八嘎三次元最恶心了啊魂淡!★呐、二次元の民那....都:是:最最:善良0)存.在呐★多洗.... .要「嘲笑」这样的孩子呢?吾辈不明白啊--? ....说到底,你们都只是污秽の「来自三次元的大人」吧?大人什么的、最讨厌了★」
啊嘞啊嘞QAQ?多洗忒....欧尼酱ww?呐、桥豆麻袋...已经「厌烦」吾辈了嘛?哼唧..真是「冷酷の人」呢QuQ--★(向° o°)嘛.....即便是这样的哇达西,-定也是有「存在の意义」的吧、内~★快来「肯定」啊?不然.... .咱可就要「黑化」了哦」
呐? 呐。。。(伸出的小手又迅速垂下去)嗦嘎(表情有点失落),米娜桑已经不喜欢了呀(紧咬嘴唇),得磨,米娜桑忘了当初吗(握紧小手),莫以得丝(强忍住眼泪),已经大丈夫了呦(挤出笑脸),瓦大喜瓦,滋多滋多,滋多滋多(语气越来越用力了)滋多戴斯给! ! ! - 滋嘛迭磨瓦撕裂嘛赛! ! !至死都不会瓦斯裂嘛斯(认真的表情)
诶多..看起来阁下对于「二次元」の理解、似乎满是谬误:哦~!嘛,连最为基本の)「礼 义 廉 耻」都早已失去了啊... (笑)呐,我说啊一- -这样Okimino、也会有自称「二次V元」の资格吗★?fufufu--说到底、阁下已经「二次元失格」了吧?呐~
唔噗噗~汝等「劣等生物」...他配去「妄想」吗?呐、「真正的二次元」什么的--吾辈看汝是一-点都不懂啊★(笑 )嘛嘛.... .不过看 着汝试图伪装成「二次元」の可笑姿态,倒是让吾辈对于「三次元の白痴」稍微有了些许兴趣哦?
诶多...★是V同类V呢Y喵)那群八嘎是不会懂的呀... .关于「二次元の美好」V呐,如果说吾の存在有意义的话、那一定是因为「二次元」吧★?所以呢--妄图污染这份「爱」的人类、都会被吾「抹」 「杀」「掉」喔」(小声)
讨厌二次元的八嘎三次元最恶心了啊魂淡!★呐、二次元0民那...都:是最最善良の存在:呐★多....要「嘲笑」这样的孩子呢? 吾辈不明白啊--? ....说到底,你们都只是污秽の「来自三次元的大人」吧?大人什么的、最讨厌了★」
啊嘞啊嘞QAQ?多洗....欧尼酱ww?呐、桥豆麻...已经「厌烦」吾辈了嘛?哼唧...真是「冷酷叨人呢QuQ--你(o° o°●)....即便是这样的哇达西,一定也是有「存在の意义」的吧、内~★快来「肯定」啊?不然... .咱可就要「黑化」了哦」呐?的呐。。。(伸出的小手又迅速垂下去)嗦嘎(有点失落)"""
if __name__ == '__main__':
print(len(ecysj.split('\n')))
| 106.473684
| 166
| 0.708354
| 367
| 2,023
| 3.959128
| 0.6703
| 0.004129
| 0.024776
| 0.027529
| 0.200964
| 0.140399
| 0.140399
| 0.140399
| 0.140399
| 0.140399
| 0
| 0.001536
| 0.034602
| 2,023
| 19
| 167
| 106.473684
| 0.727087
| 0
| 0
| 0
| 0
| 0.833333
| 0.966897
| 0.830534
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.055556
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2916a4bbe14feab8580a0b3bbc3de05322ec648f
| 306
|
py
|
Python
|
run_spyder_infoworld.py
|
hack-learning/DataScience-Scrapers
|
6c2af7867b7c64085268808c1ec69b7df4aea026
|
[
"MIT"
] | 3
|
2021-02-18T16:10:22.000Z
|
2021-07-20T15:45:04.000Z
|
run_spyder_infoworld.py
|
hack-learning/DataScience-Scrapers
|
6c2af7867b7c64085268808c1ec69b7df4aea026
|
[
"MIT"
] | null | null | null |
run_spyder_infoworld.py
|
hack-learning/DataScience-Scrapers
|
6c2af7867b7c64085268808c1ec69b7df4aea026
|
[
"MIT"
] | null | null | null |
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from news_scraper.spiders.infoworld import InfoworldSpider
from news_scraper.spiders.devmozilla import MozillaDev
process = CrawlerProcess(get_project_settings())
process.crawl(InfoworldSpider)
process.start()
| 38.25
| 58
| 0.872549
| 37
| 306
| 7.054054
| 0.513514
| 0.076628
| 0.137931
| 0.168582
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068627
| 306
| 8
| 59
| 38.25
| 0.915789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.571429
| 0
| 0.571429
| 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
| 1
| 0
|
0
| 4
|
2929e4a4ae593e878d77a64992ded57ef5c4dd14
| 136
|
py
|
Python
|
kivyMD/docs/_templates/sphinx_theme_pd/__init__.py
|
We8Punk/ValutoPy
|
792bcc0083a8ac1c4227a545e1e0c3b3a6ab5b87
|
[
"MIT"
] | 64
|
2018-09-17T20:14:39.000Z
|
2022-02-19T21:39:33.000Z
|
kivymd/docs/_templates/sphinx_theme_pd/__init__.py
|
elizabwth/kivy-widget-background-blur
|
592c8f3d253f22a6c48e40b8eeb3024ce144bbb7
|
[
"MIT"
] | 13
|
2018-09-22T17:09:22.000Z
|
2020-09-02T14:11:17.000Z
|
kivymd/docs/_templates/sphinx_theme_pd/__init__.py
|
elizabwth/kivy-widget-background-blur
|
592c8f3d253f22a6c48e40b8eeb3024ce144bbb7
|
[
"MIT"
] | 34
|
2018-09-20T20:19:47.000Z
|
2022-02-20T10:35:18.000Z
|
import os
def get_html_theme_path():
theme_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
return theme_dir
| 19.428571
| 75
| 0.742647
| 22
| 136
| 4.181818
| 0.545455
| 0.195652
| 0.282609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139706
| 136
| 6
| 76
| 22.666667
| 0.786325
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
293b9da7cdc158335a1c31dd676666dc839bceac
| 284
|
py
|
Python
|
tornado_hello_word/hello_handler.py
|
Normanno2/MicroservicesExample
|
4588be17828b7113c5ca90dabfd45f8cccb9cb47
|
[
"Apache-2.0"
] | null | null | null |
tornado_hello_word/hello_handler.py
|
Normanno2/MicroservicesExample
|
4588be17828b7113c5ca90dabfd45f8cccb9cb47
|
[
"Apache-2.0"
] | null | null | null |
tornado_hello_word/hello_handler.py
|
Normanno2/MicroservicesExample
|
4588be17828b7113c5ca90dabfd45f8cccb9cb47
|
[
"Apache-2.0"
] | null | null | null |
from tornado.web import RequestHandler
class SimpleHelloHandler(RequestHandler):
def get(self):
print("Get")
self.write("Hello Word")
class HelloMateHandler(RequestHandler):
def get(self, mate):
print("Get")
self.write("Hello "+str(mate))
| 18.933333
| 41
| 0.651408
| 31
| 284
| 5.967742
| 0.548387
| 0.151351
| 0.216216
| 0.259459
| 0.237838
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225352
| 284
| 14
| 42
| 20.285714
| 0.840909
| 0
| 0
| 0.222222
| 0
| 0
| 0.077465
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.111111
| 0
| 0.555556
| 0.222222
| 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
| 1
| 0
|
0
| 4
|
29403ee20e48e6a58b3bf2ba97b74e8711d66ecf
| 844
|
py
|
Python
|
utils/progress/setup.py
|
djzgroup/wau
|
565a7d90e28b71970c0c5f8b8430ff45e3afc8d5
|
[
"MIT"
] | null | null | null |
utils/progress/setup.py
|
djzgroup/wau
|
565a7d90e28b71970c0c5f8b8430ff45e3afc8d5
|
[
"MIT"
] | null | null | null |
utils/progress/setup.py
|
djzgroup/wau
|
565a7d90e28b71970c0c5f8b8430ff45e3afc8d5
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
from setuptools import setup
import progress
setup(
name='progress',
version=progress.__version__,
description='Easy to use progress bars',
long_description=open('README.rst').read(),
author='Giorgos Verigakis',
author_email='verigak@gmail.com',
url='http://github.com/verigak/progress/',
license='ISC',
packages=['progress'],
classifiers=[
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]
)
| 28.133333
| 56
| 0.612559
| 88
| 844
| 5.806818
| 0.579545
| 0.223092
| 0.293542
| 0.203523
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018576
| 0.234597
| 844
| 29
| 57
| 29.103448
| 0.772446
| 0.023697
| 0
| 0
| 0
| 0
| 0.538275
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.083333
| 0
| 0.083333
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
29638593dc9f5f16ef7b5fac20ce66049db61f69
| 46
|
py
|
Python
|
textractplus/__init__.py
|
VaibhavHaswani/textract2
|
333bc3a2ed646a6e8ddd8dbb57ea7524fe503f0c
|
[
"MIT"
] | null | null | null |
textractplus/__init__.py
|
VaibhavHaswani/textract2
|
333bc3a2ed646a6e8ddd8dbb57ea7524fe503f0c
|
[
"MIT"
] | null | null | null |
textractplus/__init__.py
|
VaibhavHaswani/textract2
|
333bc3a2ed646a6e8ddd8dbb57ea7524fe503f0c
|
[
"MIT"
] | null | null | null |
from .parsers import process
VERSION = "0.1"
| 11.5
| 28
| 0.717391
| 7
| 46
| 4.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 0.173913
| 46
| 3
| 29
| 15.333333
| 0.815789
| 0
| 0
| 0
| 0
| 0
| 0.065217
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
4632709f6ab4728ae7c38a8588a1852c7a0be232
| 341
|
py
|
Python
|
app/home/views/contact_us.py
|
ThanlonSmith/computer-bysj
|
760005980f1fb8f83ca369ae40061ec38f5058ef
|
[
"Apache-2.0"
] | 1
|
2019-10-20T16:22:49.000Z
|
2019-10-20T16:22:49.000Z
|
app/home/views/contact_us.py
|
ThanlonSmith/computer-bysj
|
760005980f1fb8f83ca369ae40061ec38f5058ef
|
[
"Apache-2.0"
] | 1
|
2021-09-29T17:42:36.000Z
|
2021-09-29T17:42:36.000Z
|
app/home/views/contact_us.py
|
ThanlonSmith/computer-bysj
|
760005980f1fb8f83ca369ae40061ec38f5058ef
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# @Time : 2019/12/25 下午3:46
# @Author : Thanlon
# @Wechat:18512152005
# @Email : thanlon@sina.com
# @File : about_website.py
# @Software: PyCharm
from .. import home_bp
from flask import render_template
@home_bp.route('/v1/contact-us')
def contact_us():
return render_template('/home/contact_us.html')
| 22.733333
| 51
| 0.680352
| 48
| 341
| 4.6875
| 0.75
| 0.12
| 0.16
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083916
| 0.16129
| 341
| 14
| 52
| 24.357143
| 0.702797
| 0.480938
| 0
| 0
| 0
| 0
| 0.207101
| 0.12426
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.4
| 0.2
| 0.8
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
465b73d767abc4adda75bce921dd19d40a7799b0
| 368
|
py
|
Python
|
pyezviz/exceptions.py
|
Shamshala/pyEzviz
|
2008c76fa249154c3244c3ce05f456833737334d
|
[
"Apache-2.0"
] | 46
|
2020-03-27T10:32:47.000Z
|
2022-03-28T19:34:47.000Z
|
pyezviz/exceptions.py
|
Shamshala/pyEzviz
|
2008c76fa249154c3244c3ce05f456833737334d
|
[
"Apache-2.0"
] | 59
|
2020-01-14T12:54:59.000Z
|
2022-02-17T13:59:12.000Z
|
pyezviz/exceptions.py
|
Shamshala/pyEzviz
|
2008c76fa249154c3244c3ce05f456833737334d
|
[
"Apache-2.0"
] | 39
|
2020-03-22T17:37:51.000Z
|
2022-03-22T10:48:37.000Z
|
"""PyEzviz Exceptions."""
class PyEzvizError(Exception):
"""Ezviz api exception."""
class InvalidURL(PyEzvizError):
"""Invalid url exception."""
class HTTPError(PyEzvizError):
"""Invalid host exception."""
class InvalidHost(PyEzvizError):
"""Invalid host exception."""
class AuthTestResultFailed(PyEzvizError):
"""Authentication failed"""
| 17.52381
| 41
| 0.69837
| 31
| 368
| 8.290323
| 0.516129
| 0.217899
| 0.178988
| 0.249027
| 0.287938
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149457
| 368
| 20
| 42
| 18.4
| 0.821086
| 0.361413
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
46860c3ecd47fe076400100ba25e64236900feff
| 60
|
py
|
Python
|
hydra_notebook/exceptions.py
|
lordoftheflies/hydra-notebook
|
eab70f082a1dbbc85e27c3114994b61031cf3cd8
|
[
"Apache-2.0"
] | null | null | null |
hydra_notebook/exceptions.py
|
lordoftheflies/hydra-notebook
|
eab70f082a1dbbc85e27c3114994b61031cf3cd8
|
[
"Apache-2.0"
] | 4
|
2020-02-11T22:59:43.000Z
|
2021-06-10T20:32:57.000Z
|
hydra_notebook/exceptions.py
|
lordoftheflies/hydra-notebook
|
eab70f082a1dbbc85e27c3114994b61031cf3cd8
|
[
"Apache-2.0"
] | null | null | null |
#python
class NotebookNotFindException(Exception):
pass
| 15
| 42
| 0.8
| 5
| 60
| 9.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 60
| 4
| 43
| 15
| 0.923077
| 0.1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
468b2a9b2d9628ae2406bb50afe8056e9ec1a300
| 723
|
py
|
Python
|
test/test_pythoscope_generator_method_call_context.py
|
h4ck3rm1k3/pythoscope
|
0cefb34b86e2e81e29c0b93d27e3d4657db79912
|
[
"MIT"
] | null | null | null |
test/test_pythoscope_generator_method_call_context.py
|
h4ck3rm1k3/pythoscope
|
0cefb34b86e2e81e29c0b93d27e3d4657db79912
|
[
"MIT"
] | null | null | null |
test/test_pythoscope_generator_method_call_context.py
|
h4ck3rm1k3/pythoscope
|
0cefb34b86e2e81e29c0b93d27e3d4657db79912
|
[
"MIT"
] | null | null | null |
import unittest
class TestMethodCallContext(unittest.TestCase):
def test___getattr__(self):
# method_call_context = MethodCallContext(call, user_object)
# self.assertEqual(expected, method_call_context.__getattr__(name))
assert False # TODO: implement your test here
def test___init__(self):
# method_call_context = MethodCallContext(call, user_object)
assert False # TODO: implement your test here
def test___repr__(self):
# method_call_context = MethodCallContext(call, user_object)
# self.assertEqual(expected, method_call_context.__repr__())
assert False # TODO: implement your test here
if __name__ == '__main__':
unittest.main()
| 34.428571
| 75
| 0.715076
| 80
| 723
| 5.9125
| 0.35
| 0.105708
| 0.179704
| 0.133192
| 0.756871
| 0.756871
| 0.756871
| 0.680761
| 0.570825
| 0.389006
| 0
| 0
| 0.204703
| 723
| 20
| 76
| 36.15
| 0.822609
| 0.544952
| 0
| 0.3
| 0
| 0
| 0.025
| 0
| 0
| 0
| 0
| 0.05
| 0.3
| 1
| 0.3
| false
| 0
| 0.1
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 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
| 0
| 0
|
0
| 4
|
d3c12d855bdd7ce4f49d338bfb717ff30899067b
| 204
|
py
|
Python
|
tests/test_.py
|
ChristophRaab/prototorch_models
|
75a39f5b03110a56b3d93ee00b3397858f4222a3
|
[
"MIT"
] | 4
|
2021-05-05T07:27:11.000Z
|
2021-12-24T08:01:45.000Z
|
tests/test_.py
|
ChristophRaab/prototorch_models
|
75a39f5b03110a56b3d93ee00b3397858f4222a3
|
[
"MIT"
] | 6
|
2021-05-06T09:49:37.000Z
|
2021-11-15T10:43:09.000Z
|
tests/test_.py
|
ChristophRaab/prototorch_models
|
75a39f5b03110a56b3d93ee00b3397858f4222a3
|
[
"MIT"
] | 5
|
2021-05-12T14:16:35.000Z
|
2021-10-20T14:21:42.000Z
|
"""prototorch.models test suite."""
import unittest
class TestDummy(unittest.TestCase):
def setUp(self):
pass
def test_dummy(self):
pass
def tearDown(self):
pass
| 12.75
| 35
| 0.612745
| 23
| 204
| 5.391304
| 0.652174
| 0.193548
| 0.177419
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.284314
| 204
| 15
| 36
| 13.6
| 0.849315
| 0.142157
| 0
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.375
| false
| 0.375
| 0.125
| 0
| 0.625
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
d3f2542bd10eebc273dfef4d78d3a5fb13f804c8
| 1,141
|
py
|
Python
|
utest/test_templates/test_protocol.py
|
dedie/Rammbock
|
ace46d50db1f41de570cdcb93987c99c7f79107f
|
[
"Apache-2.0"
] | 37
|
2015-06-01T03:47:19.000Z
|
2021-11-15T09:39:11.000Z
|
utest/test_templates/test_protocol.py
|
dedie/Rammbock
|
ace46d50db1f41de570cdcb93987c99c7f79107f
|
[
"Apache-2.0"
] | 55
|
2015-02-24T09:25:29.000Z
|
2022-02-04T13:11:55.000Z
|
utest/test_templates/test_protocol.py
|
dedie/Rammbock
|
ace46d50db1f41de570cdcb93987c99c7f79107f
|
[
"Apache-2.0"
] | 38
|
2015-02-05T15:31:25.000Z
|
2020-04-03T03:40:04.000Z
|
from unittest import TestCase
from Rammbock.templates.containers import Protocol
from Rammbock.templates.primitives import UInt, PDU
class TestProtocol(TestCase):
def setUp(self):
self._protocol = Protocol('Test')
def test_header_length(self):
self._protocol.add(UInt(1, 'name1', None))
self.assertEquals(self._protocol.header_length(), 1)
def test_header_length_with_pdu(self):
self._protocol.add(UInt(1, 'name1', None))
self._protocol.add(UInt(2, 'name2', 5))
self._protocol.add(UInt(2, 'length', None))
self._protocol.add(PDU('length'))
self.assertEquals(self._protocol.header_length(), 5)
def test_verify_undefined_length(self):
self._protocol.add(UInt(1, 'name1', None))
self._protocol.add(UInt(2, 'name2', 5))
self.assertRaises(Exception, self._protocol.add, PDU('length'))
def test_verify_calculated_length(self):
self._protocol.add(UInt(1, 'name1', 1))
self._protocol.add(UInt(2, 'length', None))
self._protocol.add(PDU('length-8'))
self.assertEquals(self._protocol.header_length(), 3)
| 35.65625
| 71
| 0.674847
| 147
| 1,141
| 5.034014
| 0.238095
| 0.243243
| 0.222973
| 0.205405
| 0.613514
| 0.581081
| 0.424324
| 0.424324
| 0.377027
| 0.377027
| 0
| 0.022556
| 0.184049
| 1,141
| 31
| 72
| 36.806452
| 0.772288
| 0
| 0
| 0.291667
| 0
| 0
| 0.057844
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 1
| 0.208333
| false
| 0
| 0.125
| 0
| 0.375
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
311bd5765475274f6d8a77122d6eb291b6c7ffc1
| 226
|
py
|
Python
|
LeetCode/Weekly Contests/Biweekly Contest 50/Queries on Number of Points Inside a Circle.py
|
UtkarshPathrabe/Competitive-Coding
|
ba322fbb1b88682d56a9b80bdd92a853f1caa84e
|
[
"MIT"
] | 13
|
2021-09-02T07:30:02.000Z
|
2022-03-22T19:32:03.000Z
|
LeetCode/Weekly Contests/Biweekly Contest 50/Queries on Number of Points Inside a Circle.py
|
UtkarshPathrabe/Competitive-Coding
|
ba322fbb1b88682d56a9b80bdd92a853f1caa84e
|
[
"MIT"
] | null | null | null |
LeetCode/Weekly Contests/Biweekly Contest 50/Queries on Number of Points Inside a Circle.py
|
UtkarshPathrabe/Competitive-Coding
|
ba322fbb1b88682d56a9b80bdd92a853f1caa84e
|
[
"MIT"
] | 3
|
2021-08-24T16:06:22.000Z
|
2021-09-17T15:39:53.000Z
|
class Solution:
def countPoints(self, points: List[List[int]], queries: List[List[int]]) -> List[int]:
return [len([p for p in points if pow(p[0] - q[0], 2) + pow(p[1] - q[1], 2) <= pow(q[2], 2)]) for q in queries]
| 75.333333
| 119
| 0.584071
| 43
| 226
| 3.069767
| 0.465116
| 0.159091
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043956
| 0.19469
| 226
| 3
| 119
| 75.333333
| 0.681319
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
315ad1915bde379e6d517b854ca96943f4d2f961
| 450
|
py
|
Python
|
app/service/interfaces/i_contact_svc.py
|
a6n1/caldera
|
a9a37ca1b54c1a4e0ecbd5144a2745fce3bdc36b
|
[
"Apache-2.0"
] | 1
|
2021-04-04T02:30:11.000Z
|
2021-04-04T02:30:11.000Z
|
app/service/interfaces/i_contact_svc.py
|
TylerJThomas/caldera
|
93b2d1b761d1e0eea87e6667206088610b7c1822
|
[
"Apache-2.0"
] | null | null | null |
app/service/interfaces/i_contact_svc.py
|
TylerJThomas/caldera
|
93b2d1b761d1e0eea87e6667206088610b7c1822
|
[
"Apache-2.0"
] | null | null | null |
import abc
class ContactServiceInterface(abc.ABC):
@abc.abstractmethod
def register(self, contact):
pass
@abc.abstractmethod
def handle_heartbeat(self):
"""
Accept all components of an agent profile and save a new agent or register an updated heartbeat.
:return: the agent object, instructions to execute
"""
pass
@abc.abstractmethod
def build_filename(self):
pass
| 21.428571
| 104
| 0.648889
| 51
| 450
| 5.686275
| 0.647059
| 0.175862
| 0.206897
| 0.165517
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.284444
| 450
| 20
| 105
| 22.5
| 0.900621
| 0.326667
| 0
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0.272727
| 0.090909
| 0
| 0.454545
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
317ffd193d6a27adc970871a46d76c0db6f63947
| 35,777
|
py
|
Python
|
code/asphericity_stats.py
|
astroandes/SatelliteShapeLG
|
8715e8779ce89fe720b979b148183a99ae06ec23
|
[
"MIT"
] | 1
|
2015-05-01T04:41:51.000Z
|
2015-05-01T04:41:51.000Z
|
code/asphericity_stats.py
|
VeronicaArias/AlineacionesIllustris
|
8715e8779ce89fe720b979b148183a99ae06ec23
|
[
"MIT"
] | 2
|
2016-06-29T21:06:24.000Z
|
2016-12-15T19:26:33.000Z
|
code/asphericity_stats.py
|
VeronicaArias/AlineacionesIllustris
|
8715e8779ce89fe720b979b148183a99ae06ec23
|
[
"MIT"
] | null | null | null |
import numpy as np
import glob
import os
import matplotlib.pyplot as plt
import corner
def load_summary(filename):
dtype=[('minr', 'f8'),
('maxr', 'f8'),
('ca_ratio', 'f8'),
('ba_ratio', 'f8'),
('a', 'f8'),
('center', 'f8'),
('width', 'f8'),
('mu', 'f8')]
summary = np.loadtxt(filename, dtype=dtype)
return summary
def load_experiment(input_path="../data/mstar_selected_summary/vmax_sorted/", n_sat=11, full_data=False):
files = glob.glob(input_path+"M31_group_*_nsat_{}.dat".format(n_sat))
group_id = []
for f in files:
i = int(f.split("_")[-3])
if i not in group_id:
group_id.append(i)
#print(group_id, len(group_id))
n_groups = len(group_id)
fields = ['width','mu', 'a', 'ba_ratio', 'ca_ratio']
M31_all = {}
MW_all = {}
if full_data:
for field in fields:
M31_all[field] = np.empty((0))
MW_all[field] = np.empty((0))
M31_all[field+'_random'] = np.empty((0))
MW_all[field+'_random'] = np.empty((0))
else:
for field in fields:
M31_all[field] = np.ones(n_groups)
MW_all[field] = np.ones(n_groups)
M31_all[field+'_sigma'] = np.ones(n_groups)
MW_all[field+'_sigma'] = np.ones(n_groups)
M31_all[field+'_random'] = np.ones(n_groups)
MW_all[field+'_random'] = np.ones(n_groups)
M31_all[field+'_random_sigma'] = np.ones(n_groups)
MW_all[field+'_random_sigma'] = np.ones(n_groups)
M31_all[field+'_normed'] = np.ones(n_groups)
MW_all[field+'_normed'] = np.ones(n_groups)
MW_summary = {}
M31_summary = {}
for g in range(n_groups):
filename_MW = os.path.join(input_path,"MW_group_{}_nsat_{}.dat".format(group_id[g],n_sat))
filename_M31 = os.path.join(input_path,"M31_group_{}_nsat_{}.dat".format(group_id[g],n_sat))
MW_summary[g] = load_summary(filename_MW)
M31_summary[g] = load_summary(filename_M31)
for field in fields:
a = np.empty((0))
b = np.empty((0))
a_random = np.empty((0))
b_random = np.empty((0))
for g in range(n_groups):
data = M31_summary[g]
a = data[field][0]
a_random = data[field][1:]
data = MW_summary[g]
b = data[field][0]
b_random = data[field][1:]
#print('a_random {} iter: {} {}'.format(field, i, a_random))
if full_data:
M31_all[field] = np.append(M31_all[field], a)
MW_all[field] = np.append(MW_all[field], b)
M31_all[field+'_random'] = np.append(M31_all[field+'_random'], a_random)
MW_all[field+'_random'] = np.append(MW_all[field+'_random'], b_random)
else:
M31_all[field][g] = np.average(a)
MW_all[field][g] = np.average(b)
M31_all[field+'_sigma'][g] = np.std(a)
MW_all[field+'_sigma'][g] = np.std(b)
M31_all[field+'_random'][g] = np.average(a_random)
MW_all[field+'_random'][g] = np.average(b_random)
M31_all[field+'_random_sigma'][g] = np.std(a_random)
MW_all[field+'_random_sigma'][g] = np.std(b_random)
M31_all[field+'_normed'][g] = (M31_all[field][g] - M31_all[field+'_random'][g])/M31_all[field+'_random_sigma'][g]
MW_all[field+'_normed'][g] = (MW_all[field][g] - MW_all[field+'_random'][g])/MW_all[field+'_random_sigma'][g]
return M31_all, MW_all
def points_in_experiment(experiment):
keys = list(experiment.keys())
n_points = len(experiment[keys[0]])
return n_points
def copy_experiment(experiment, id_to_remove=None):
copy = {}
n_points = points_in_experiment(experiment)
for k in experiment.keys():
if id_to_remove is None:
copy[k] = experiment[k].copy()
else:
ii = np.arange(n_points)
copy[k] = experiment[k][ii!=id_to_remove]
return copy
def get_data_obs(obs_data, normed=True):
fields = {0:'width', 1:'ca_ratio', 2:'ba_ratio'}
n_fields = len(fields)
data_obs = np.zeros((n_fields, len(obs_data['width'])))
for i in range(n_fields):
field = fields[i]
if normed:
x_obs = (obs_data[field] - obs_data[field+'_random'])/obs_data[field+'_random_sigma']
else:
x_obs = obs_data[field]
data_obs[i,:] = x_obs[:]
return {'data_obs': data_obs, 'fields':fields}
def covariance_and_mean(experiment):
fields = {0:'width', 1:'ca_ratio', 2:'ba_ratio'}
n_fields = len(fields)
n_points = points_in_experiment(experiment)
data_sim = np.zeros((n_fields, n_points))
for i in range(n_fields):
field = fields[i]
x_sim = (experiment[field] - experiment[field+'_random'])/experiment[field+'_random_sigma']
data_sim[i,:] = x_sim[:]
data_cov = np.cov(data_sim)
data_mean = np.mean(data_sim, axis=1)
return {'covariance':data_cov, 'mean':data_mean, 'fields':fields}
def jacknife_covariance(experiment):
cov_and_mean = {}
n_points = points_in_experiment(experiment)
for i in range(n_points):
tmp = copy_experiment(experiment, id_to_remove=i)
cov_and_mean[i] = covariance_and_mean(tmp)
covariance_avg = cov_and_mean[0]['covariance'] - cov_and_mean[0]['covariance']
for i in range(n_points):
covariance_avg += cov_and_mean[i]['covariance']
covariance_avg = covariance_avg/n_points
covariance_std = cov_and_mean[0]['covariance'] - cov_and_mean[0]['covariance']
for i in range(n_points):
covariance_std += (cov_and_mean[i]['covariance']-covariance_avg)**2
covariance_std = np.sqrt(covariance_std/n_points)
mean_avg = cov_and_mean[0]['mean'] - cov_and_mean[0]['mean']
for i in range(n_points):
mean_avg += cov_and_mean[i]['mean']
mean_avg = mean_avg/n_points
mean_std = cov_and_mean[0]['mean'] - cov_and_mean[0]['mean']
for i in range(n_points):
mean_std += (cov_and_mean[i]['mean'] - mean_avg)**2
mean_std = np.sqrt(mean_std/20)
return {'covariance': covariance_avg, 'covariance_error': covariance_std, 'mean': mean_avg, 'mean_error': mean_std}
def print_table_obs_shape():
fields = ['width','ca_ratio', 'ba_ratio']
names = {'width':'Plane width (kpc)', 'ca_ratio':'$c/a$ ratio', 'ba_ratio':'$b/a$ ratio'}
for n_sat in range(11,16):
print("OBSERVATIONS - NSAT = {}".format(n_sat))
in_path = "../data/obs_summary/"
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
print("M31(phys) - MW(phys) | M31(rand) | MW (rand) | M31(norm) | MW (norm)|")
for field in fields:
print("{} & ${:.2f}$ & ${:.2f}$ & ${:.2f}\pm{:.2f}$ & ${:.2f}\pm{:.2f}$ & ${:.2f}$ & ${:.2f}$\\\\\\hline".format(
names[field],
M31_obs_stats[field][0], MW_obs_stats[field][0],
M31_obs_stats[field+'_random'][0], M31_obs_stats[field+'_random_sigma'][0],
MW_obs_stats[field+'_random'][0],MW_obs_stats[field+'_random_sigma'][0],
(M31_obs_stats[field][0]-M31_obs_stats[field+'_random'][0])/M31_obs_stats[field+'_random_sigma'][0],
(MW_obs_stats[field][0]-MW_obs_stats[field+'_random'][0])/MW_obs_stats[field+'_random_sigma'][0]))
print()
def print_table_sim_shape():
fields = ['width','ca_ratio', 'ba_ratio']
names = {'width':'Plane width (kpc)', 'ca_ratio':'$c/a$ ratio', 'ba_ratio':'$b/a$ ratio'}
for n_sat in range(11,16):
print("IllustrisDark / Illustris / Elvis - NSAT = {}".format(n_sat))
in_path = "../data/illustris1_mstar_selected_summary/"
M31_illu_stats, MW_illu_stats = load_experiment(input_path=in_path, n_sat=n_sat)
in_path = "../data/illustris1dark_mstar_selected_summary/"
M31_illudark_stats, MW_illudark_stats = load_experiment(input_path=in_path, n_sat=n_sat)
in_path = "../data/elvis_mstar_selected_summary/"
M31_elvis_stats, MW_elvis_stats = load_experiment(input_path=in_path, n_sat=n_sat)
print("M31(phys) - MW(phys)|")
for field in fields:
print("{} & ${:.2f}\pm {:.2f}$ & ${:.2f} \pm {:.2f}$ & ${:.2f}\pm {:.2f}$ & ${:.2f}\pm {:.2f}$ & ${:.2f}\pm {:.2f}$ & ${:.2f}\pm {:.2f}$\\\\\\hline".format(
names[field],
np.mean(M31_illudark_stats[field]), np.std(M31_illudark_stats[field]),
np.mean(MW_illudark_stats[field]), np.std(MW_illudark_stats[field]),
np.mean(M31_illu_stats[field]), np.std(M31_illu_stats[field]),
np.mean(MW_illu_stats[field]), np.std(MW_illu_stats[field]),
np.mean(M31_elvis_stats[field]), np.std(M31_elvis_stats[field]),
np.mean(MW_elvis_stats[field]), np.std(MW_elvis_stats[field])))
print()
def plot_covariance(simulation, n_sat):
simulation_name = {'illustris1':'Illustris1', 'illustris1dark':'Illustris1Dark', 'elvis':'ELVIS'}
print('simulation {}'.format(simulation))
in_path = "../data/{}_mstar_selected_summary/".format(simulation)
M31_sim_stats, MW_sim_stats = load_experiment(input_path=in_path, n_sat=n_sat)
in_path = "../data/obs_summary/"
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
M31_obs = get_data_obs(M31_obs_stats)
MW_obs = get_data_obs(MW_obs_stats)
cov_illustris_M31 = jacknife_covariance(M31_sim_stats)
cov_illustris_MW = jacknife_covariance(MW_sim_stats)
data_random_illustris_M31 = np.random.multivariate_normal(
cov_illustris_M31['mean'], cov_illustris_M31['covariance'], size=100000)
data_random_illustris_MW = np.random.multivariate_normal(
cov_illustris_MW['mean'], cov_illustris_MW['covariance'], size=100000)
s = np.array([1.0,2.0,3.0])
levels = 1-np.exp(-(s**2)/2.0)
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
figure = corner.corner( data_random_illustris_M31,
quantiles=[0.16, 0.5, 0.84],levels=levels,
labels=[r"$w$ M31", r"$c/a$ M31", r"$b/a$ M31"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=M31_obs['data_obs'])
min_w = -4; max_w = 4; min_ac = -4; max_ac = 4 ; min_ab = -4; max_ab = 4
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab);
ax.scatter(M31_sim_stats['ca_ratio_normed'], M31_sim_stats['ba_ratio_normed'])
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax.scatter(M31_sim_stats['width_normed'], M31_sim_stats['ca_ratio_normed'])
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
ax.scatter(M31_sim_stats['width_normed'], M31_sim_stats['ba_ratio_normed'])
children = ax.get_children()
ax.legend([children[5], children[7], children[4]], [simulation_name[simulation], 'Observations', 'Gaussian Model'],
loc='upper right', bbox_to_anchor=(3.0, 3.0), fontsize=20, markerscale=2)
filename = "../paper/gaussian_model_{}_M31_n_{}.pdf".format(simulation, n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
figure = corner.corner(data_random_illustris_MW,
quantiles=[0.16, 0.5, 0.84],levels=levels,
labels=[r"$w$ MW", r"$c/a$ MW", r"$b/a$ MW"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=MW_obs['data_obs'])
min_w = -4; max_w = 4; min_ac = -4; max_ac = 4 ; min_ab = -4; max_ab = 4
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab);
ax.scatter(MW_sim_stats['ca_ratio_normed'], MW_sim_stats['ba_ratio_normed'])
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax.scatter(MW_sim_stats['width_normed'], MW_sim_stats['ca_ratio_normed'])
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
ax.scatter(MW_sim_stats['width_normed'], MW_sim_stats['ba_ratio_normed'])
children = ax.get_children()
ax.legend([children[5], children[7], children[4]], [simulation_name[simulation], 'Observations', 'Gaussian Model'],
loc='upper right', bbox_to_anchor=(3.0, 3.0), fontsize=20, markerscale=2)
filename = "../paper/gaussian_model_{}_MW_n_{}.pdf".format(simulation, n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.close('all')
def plot_asphericity_obs(field):
plt.figure(figsize=(7,7))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
for n_sat in range(11,16):
in_path = "../data/obs_summary/"
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
M31_obs = get_data_obs(M31_obs_stats)
MW_obs = get_data_obs(MW_obs_stats)
print(n_sat, M31_obs['fields'][field], MW_obs['fields'][field],M31_obs['data_obs'][field], MW_obs['data_obs'][field])
if n_sat==11:
plt.scatter(n_sat, M31_obs['data_obs'][field], marker='*', s=300, color='black', alpha=0.9, label='M31')
plt.scatter(n_sat, MW_obs['data_obs'][field], marker='o', s=300, color='black', alpha=0.9, label='MW')
else:
plt.scatter(n_sat, M31_obs['data_obs'][field], marker='*', s=300, color='black', alpha=0.9)
plt.scatter(n_sat, MW_obs['data_obs'][field], marker='o', s=300, color='black', alpha=0.9)
ylabel = {'width': 'Normalized Plane Width', 'ca_ratio':'Normalized $c/a$ ratio', 'ba_ratio':'Normalized $b/a$ ratio'}
plt.legend()
plt.xlabel("$N_s$")
plt.ylabel(ylabel[M31_obs['fields'][field]])
plt.grid()
filename = "../paper/normalized_{}_n_dependence.pdf".format(M31_obs['fields'][field])
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
def number_LG(sim_cov_M31, sim_mean_M31, sim_cov_MW, sim_mean_MW, obs_M31, obs_MW, n_sample=20):
n_try = 1000
n_out = np.ones(n_try)
n_MW = np.ones(n_try)
n_M31 = np.ones(n_try)
for i in range(n_try):
sim_M31 = np.random.multivariate_normal(sim_mean_M31, sim_cov_M31, size=n_sample)
sim_MW = np.random.multivariate_normal(sim_mean_MW, sim_cov_MW, size=n_sample)
like_M31_from_M31 = sim_M31[:,0]<1E6
like_MW_from_MW = sim_MW[:,0]<1E6
for j in range(3):
like_M31_from_M31 &= (np.abs(sim_M31[:,j]-sim_mean_M31[j]) > np.abs(obs_M31[j]-sim_mean_M31[j]))
like_MW_from_MW &= (np.abs(sim_MW[:,j]-sim_mean_MW[j]) > np.abs(obs_MW[j]-sim_mean_MW[j]))
#print(sim_M31[like_M31_from_M31,:])
n_out[i] = np.count_nonzero(like_M31_from_M31 & like_MW_from_MW)
n_MW[i] = np.count_nonzero(like_MW_from_MW)
n_M31[i] = np.count_nonzero(like_M31_from_M31)
#print(n_M31[i])
return {'n_LG': n_out, 'n_MW':n_MW, 'n_M31':n_M31}
def get_numbers(simulation, n_sat):
print('simulation {}'.format(simulation))
in_path = "../data/{}_mstar_selected_summary/".format(simulation)
M31_sim_stats, MW_sim_stats = load_experiment(input_path=in_path, n_sat=n_sat)
in_path = "../data/obs_summary/"
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
M31_obs = get_data_obs(M31_obs_stats)
MW_obs = get_data_obs(MW_obs_stats)
cov_sim_M31 = jacknife_covariance(M31_sim_stats)
cov_sim_MW = jacknife_covariance(MW_sim_stats)
n_out_list_sim = number_LG(cov_sim_M31['covariance'], cov_sim_M31['mean'],
cov_sim_MW['covariance'], cov_sim_MW['mean'],
M31_obs['data_obs'], MW_obs['data_obs'], n_sample=10000)
return {'mean_n_M31':np.mean(n_out_list_sim['n_M31']), 'std_n_M31':np.std(n_out_list_sim['n_M31']),
'mean_n_MW':np.mean(n_out_list_sim['n_MW']), 'std_n_MW':np.std(n_out_list_sim['n_MW']),
'mean_n_LG':np.mean(n_out_list_sim['n_LG']), 'std_n_LG':np.std(n_out_list_sim['n_LG'])}
print()
def print_numbers():
LG_out = open('../data/numbers/LG_numbers.txt', 'w')
M31_out = open('../data/numbers/M31_numbers.txt', 'w')
MW_out = open('../data/numbers/MW_numbers.txt', 'w')
for i in range(11,16):
a = get_numbers('illustris1dark', i)
b = get_numbers('illustris1', i)
c = get_numbers('elvis', i)
LG_out.write("{} {} {} {} {} {} {}\n".format(i,
a['mean_n_LG'], a['std_n_LG'],
b['mean_n_LG'], b['std_n_LG'],
c['mean_n_LG'], c['std_n_LG']))
M31_out.write("{} {} {} {} {} {} {}\n".format(i,
a['mean_n_M31'], a['std_n_M31'],
b['mean_n_M31'], b['std_n_M31'],
c['mean_n_M31'], c['std_n_M31']))
MW_out.write("{} {} {} {} {} {} {}\n".format(i,
a['mean_n_MW'], a['std_n_MW'],
b['mean_n_MW'], b['std_n_MW'],
c['mean_n_MW'], c['std_n_MW']))
MW_out.close()
M31_out.close()
LG_out.close()
def plot_numbers():
LG_data = np.loadtxt('../data/numbers/LG_numbers.txt')
M31_data = np.loadtxt('../data/numbers/M31_numbers.txt')
MW_data = np.loadtxt('../data/numbers/MW_numbers.txt')
LG_data[:,1:] = LG_data[:,1:]/1E2
M31_data[:,1:] = M31_data[:,1:]/1E2
MW_data[:,1:] = MW_data[:,1:]/1E2
plt.figure(figsize=(7,7))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
plt.errorbar(LG_data[:,0], LG_data[:,1], yerr=LG_data[:,2],
fmt='*', markersize=20, color='black', alpha=0.5, label='Illustris1Dark')
plt.errorbar(LG_data[:,0], LG_data[:,3], yerr=LG_data[:,4],
fmt='o', markersize=20, color='black', alpha=0.5, label='Illustris1')
plt.errorbar(LG_data[:,0], LG_data[:,5], yerr=LG_data[:,6],
fmt='>', markersize=20, color='black', alpha=0.5, label='ELVIS')
plt.legend()
plt.xlabel("$N_s$")
plt.ylabel("Local Group Systems $(\%)$")
plt.grid()
filename = "../paper/LG_numbers.pdf"
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.figure(figsize=(7,7))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
plt.errorbar(MW_data[:,0], MW_data[:,1], yerr=MW_data[:,2],
fmt='*', markersize=20, color='black', alpha=0.5, label='Illustris1Dark')
plt.errorbar(MW_data[:,0], MW_data[:,3], yerr=MW_data[:,4],
fmt='o', markersize=20, color='black', alpha=0.5, label='Illustris1')
plt.errorbar(MW_data[:,0], MW_data[:,5], yerr=MW_data[:,6],
fmt='>', markersize=20, color='black', alpha=0.5, label='ELVIS')
plt.xlabel("$N_s$")
plt.ylabel("MW Galaxies $(\%)$")
plt.grid()
filename = "../paper/MW_numbers.pdf"
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.figure(figsize=(7,7))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
plt.errorbar(M31_data[:,0], M31_data[:,1], yerr=M31_data[:,2],
fmt='*', markersize=20, color='black', alpha=0.5, label='Illustris1Dark')
plt.errorbar(M31_data[:,0], M31_data[:,3], yerr=M31_data[:,4],
fmt='o', markersize=20, color='black', alpha=0.5, label='Illustris1')
plt.errorbar(M31_data[:,0], M31_data[:,5], yerr=M31_data[:,6],
fmt='>', markersize=20, color='black', alpha=0.5, label='ELVIS')
plt.xlabel("$N_s$")
plt.ylabel("M31 Galaxies $(\%)$")
plt.grid()
filename = "../paper/M31_numbers.pdf"
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
def plot_shape_obs_randoms(n_sat):
in_path = "../data/obs_summary/"
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
M31_obs = get_data_obs(M31_obs_stats, normed=False)
MW_obs = get_data_obs(MW_obs_stats, normed=False)
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=True)
data_random_obs_M31 = np.array([M31_obs_stats['width_random'],
M31_obs_stats['ca_ratio_random'],
M31_obs_stats['ba_ratio_random']]).T
data_random_obs_MW = np.array([MW_obs_stats['width_random'],
MW_obs_stats['ca_ratio_random'],
MW_obs_stats['ba_ratio_random']]).T
print(np.shape(data_random_obs_MW))
print(MW_obs)
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
figure = corner.corner(data_random_obs_M31,
quantiles=[0.16, 0.5, 0.84],
labels=[r"$w$ M31", r"$c/a$ M31", r"$b/a$ M31"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=M31_obs['data_obs'])
min_w = 10; max_w = 90; min_ac = 0.0; max_ac = 1.0 ; min_ab = 0.6; max_ab = 1.0
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab)
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
filename = "../paper/input_obs_M31_n_{}.pdf".format(n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
figure = corner.corner(data_random_obs_MW,
quantiles=[0.16, 0.5, 0.84],
labels=[r"$w$ MW", r"$c/a$ MW", r"$b/a$ MW"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=MW_obs['data_obs'])
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab)
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
filename = "../paper/input_obs_MW_n_{}.pdf".format(n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.close('all')
def plot_shape_obs_sims(simulation, n_sat):
print('simulation {}'.format(simulation))
simulation_name = {'illustris1':'Illustris1', 'illustris1dark':'Illustris1Dark', 'elvis':'ELVIS'}
in_path = "../data/{}_mstar_selected_summary/".format(simulation)
M31_sim_stats, MW_sim_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=True)
in_path = "../data/obs_summary/"
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
M31_obs = get_data_obs(M31_obs_stats, normed=False)
MW_obs = get_data_obs(MW_obs_stats, normed=False)
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=True)
data_random_obs_M31 = np.array([M31_obs_stats['width_random'],
M31_obs_stats['ca_ratio_random'],
M31_obs_stats['ba_ratio_random']]).T
data_random_obs_MW = np.array([MW_obs_stats['width_random'],
MW_obs_stats['ca_ratio_random'],
MW_obs_stats['ba_ratio_random']]).T
print(np.shape(data_random_obs_MW))
print(MW_obs)
s = np.array([1.0,2.0,3.0])
levels = 1-np.exp(-(s**2)/2.0)
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
plt.title("Physical Quantities")
figure = corner.corner(data_random_obs_M31,
levels = levels,
quantiles=[0.16, 0.5, 0.84],
labels=[r"$w$ (kpc) M31", r"$c/a$ M31", r"$b/a$ M31"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=M31_obs['data_obs'])
min_w = 10; max_w = 90; min_ac = 0.0; max_ac = 1.0 ; min_ab = 0.6; max_ab = 1.0
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab);
ax.scatter(M31_sim_stats['ca_ratio'], M31_sim_stats['ba_ratio'])
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax.scatter(M31_sim_stats['width'], M31_sim_stats['ca_ratio'])
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
ax.scatter(M31_sim_stats['width'], M31_sim_stats['ba_ratio'])
children = ax.get_children()
ax.legend([children[5], children[7], children[4]], [simulation_name[simulation], 'Observations', 'Randomized Obs.'],
loc='upper right', bbox_to_anchor=(3.0, 3.0), fontsize=20, markerscale=2)
filename = "../paper/input_{}_obs_M31_n_{}.pdf".format(simulation, n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
figure = corner.corner(data_random_obs_MW,
quantiles=[0.16, 0.5, 0.84],
levels = levels,
labels=[r"$w$ (kpc) MW", r"$c/a$ MW", r"$b/a$ MW"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=MW_obs['data_obs'])
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab);
ax.scatter(MW_sim_stats['ca_ratio'], MW_sim_stats['ba_ratio'])
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax.scatter(MW_sim_stats['width'], MW_sim_stats['ca_ratio'])
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
ax.scatter(MW_sim_stats['width'], MW_sim_stats['ba_ratio'])
children = ax.get_children()
ax.legend([children[5], children[7], children[4]], [simulation_name[simulation], 'Observations', 'Randomized Obs.'],
loc='upper right', bbox_to_anchor=(3.0, 3.0), fontsize=20, markerscale=2)
filename = "../paper/input_{}_obs_MW_n_{}.pdf".format(simulation, n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.close('all')
def plot_shape_obs_sims_normed(simulation, n_sat):
print('simulation {}'.format(simulation))
simulation_name = {'illustris1':'Illustris1', 'illustris1dark':'Illustris1Dark', 'elvis':'ELVIS'}
in_path = "../data/{}_mstar_selected_summary/".format(simulation)
M31_sim_stats, MW_sim_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
in_path = "../data/obs_summary/"
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=False)
M31_obs = get_data_obs(M31_obs_stats, normed=True)
MW_obs = get_data_obs(MW_obs_stats, normed=True)
M31_obs_stats, MW_obs_stats = load_experiment(input_path=in_path, n_sat=n_sat, full_data=True)
data_random_obs_M31 = np.array([
(M31_obs_stats['width_random'] - np.mean(M31_obs_stats['width_random']))/np.std(M31_obs_stats['width_random']),
(M31_obs_stats['ca_ratio_random'] - np.mean(M31_obs_stats['ca_ratio_random']))/np.std(M31_obs_stats['ca_ratio_random']),
(M31_obs_stats['ba_ratio_random'] - np.mean(M31_obs_stats['ba_ratio_random']))/np.std(M31_obs_stats['ba_ratio_random'])]).T
data_random_obs_MW = np.array([
(MW_obs_stats['width_random'] - np.mean(MW_obs_stats['width_random']))/np.std(MW_obs_stats['width_random']),
(MW_obs_stats['ca_ratio_random'] - np.mean(MW_obs_stats['ca_ratio_random']))/np.std(MW_obs_stats['ca_ratio_random']),
(MW_obs_stats['ba_ratio_random'] - np.mean(MW_obs_stats['ba_ratio_random']))/np.std(MW_obs_stats['ba_ratio_random'])]).T
s = np.array([1.0,2.0,3.0])
levels = 1-np.exp(-(s**2)/2.0)
print(np.shape(data_random_obs_MW))
print(MW_obs)
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
figure = corner.corner(data_random_obs_M31,
quantiles=[0.16, 0.5, 0.84],levels=levels,
labels=[r"$w$ M31", r"$c/a$ M31", r"$b/a$ M31"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=M31_obs['data_obs'])
min_w = -4; max_w = 4; min_ac = -4; max_ac = 4 ; min_ab = -4; max_ab = 4
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab);
ax.scatter(M31_sim_stats['ca_ratio_normed'], M31_sim_stats['ba_ratio_normed'])
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax.scatter(M31_sim_stats['width_normed'], M31_sim_stats['ca_ratio_normed'])
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
ax.scatter(M31_sim_stats['width_normed'], M31_sim_stats['ba_ratio_normed'])
children = ax.get_children()
ax.legend([children[5], children[7], children[4]], [simulation_name[simulation], 'Observations', 'Randomized Obs.'],
loc='upper right', bbox_to_anchor=(3.0, 3.0), fontsize=20, markerscale=2)
filename = "../paper/input_{}_obs_M31_n_{}_normed.pdf".format(simulation, n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.figure(figsize=(8,5))
plt.rc('text', usetex=True,)
plt.rc('font', family='serif', size=25)
figure = corner.corner(data_random_obs_MW,
quantiles=[0.16, 0.5, 0.84],levels=levels,
labels=[r"$w$ MW", r"$c/a$ MW", r"$b/a$ MW"],
show_titles=True, title_kwargs={"fontsize": 12},
truths=MW_obs['data_obs'])
ndim = 3
axes = np.array(figure.axes).reshape(ndim,ndim)
ax = axes[1,1];ax.set_xlim(min_ac, max_ac)
ax = axes[2,1];ax.set_xlim(min_ac, max_ac);ax.set_ylim(min_ab, max_ab);
ax.scatter(MW_sim_stats['ca_ratio_normed'], MW_sim_stats['ba_ratio_normed'])
ax = axes[2,2];ax.set_xlim(min_ab, max_ab)
ax = axes[0,0];ax.set_xlim(min_w, max_w)
ax = axes[1,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ac, max_ac)
ax.scatter(MW_sim_stats['width_normed'], MW_sim_stats['ca_ratio_normed'])
ax = axes[2,0];ax.set_xlim(min_w, max_w);ax.set_ylim(min_ab, max_ab)
ax.scatter(MW_sim_stats['width_normed'], MW_sim_stats['ba_ratio_normed'])
children = ax.get_children()
ax.legend([children[5], children[7], children[4]], [simulation_name[simulation], 'Observations', 'Randomized Obs.'],
loc='upper right', bbox_to_anchor=(3.0, 3.0), fontsize=20, markerscale=2)
filename = "../paper/input_{}_obs_MW_n_{}_normed.pdf".format(simulation, n_sat)
print('saving figure to {}'.format(filename))
plt.savefig(filename, bbox_inches='tight')
plt.clf()
plt.close('all')
def print_covariance(simulation, n_sat):
def print_ab(a, b, c, d, e, f):
print("{:.2f} \\pm {:.2f} & {:.2f} \\pm {:.2f} & {:.2f} \\pm {:.2f}\\\\".format(a,b,c,d,e,f))
simulation_name = {'illustris1':'Illustris-1', 'illustris1dark':'Illustris-1-Dark', 'elvis':'ELVIS'}
print()
in_path = "../data/{}_mstar_selected_summary/".format(simulation)
M31_sim_stats, MW_sim_stats = load_experiment(input_path=in_path, n_sat=n_sat)
cov_sim_M31 = jacknife_covariance(M31_sim_stats)
cov_sim_MW = jacknife_covariance(MW_sim_stats)
print('\\subsection{'+'{}'.format(simulation_name[simulation])+', M31, ' + '$N_s={}$'.format(n_sat) + '}')
print('\\[')
print('\\Sigma=')
print('\\begin{bmatrix}')
for i in range(3):
print_ab(cov_sim_M31['covariance'][i][0], cov_sim_M31['covariance_error'][i][0],
cov_sim_M31['covariance'][i][1], cov_sim_M31['covariance_error'][i][1],
cov_sim_M31['covariance'][i][2], cov_sim_M31['covariance_error'][i][2])
print('\\end{bmatrix}')
print('\\]')
print('\\[')
print('\\mu=')
print('\\begin{bmatrix}')
print_ab(cov_sim_M31['mean'][0], cov_sim_M31['mean_error'][0],
cov_sim_M31['mean'][1], cov_sim_M31['mean_error'][1],
cov_sim_M31['mean'][2], cov_sim_M31['mean_error'][2])
print('\\end{bmatrix}')
print('\\]')
print('\\subsection{'+'{}'.format(simulation_name[simulation])+', MW, ' + '$N_s={}$'.format(n_sat) + '}')
print('\\[')
print('\\Sigma=')
print('\\begin{bmatrix}')
for i in range(3):
print_ab(cov_sim_MW['covariance'][i][0], cov_sim_MW['covariance_error'][i][0],
cov_sim_MW['covariance'][i][1], cov_sim_MW['covariance_error'][i][1],
cov_sim_MW['covariance'][i][2], cov_sim_MW['covariance_error'][i][2])
print('\\end{bmatrix}')
print('\\]')
print('\\[')
print('\\mu=')
print('\\begin{bmatrix}')
print_ab(cov_sim_MW['mean'][0], cov_sim_MW['mean_error'][0],
cov_sim_MW['mean'][1], cov_sim_MW['mean_error'][1],
cov_sim_MW['mean'][2], cov_sim_MW['mean_error'][2])
print('\\end{bmatrix}')
print('\\]')
| 46.463636
| 169
| 0.604634
| 5,480
| 35,777
| 3.637591
| 0.045985
| 0.029698
| 0.021672
| 0.028895
| 0.826477
| 0.76061
| 0.708438
| 0.659928
| 0.63028
| 0.622203
| 0
| 0.038867
| 0.220449
| 35,777
| 769
| 170
| 46.524057
| 0.675869
| 0.003885
| 0
| 0.568992
| 0
| 0.006202
| 0.163496
| 0.027642
| 0
| 0
| 0
| 0
| 0
| 1
| 0.031008
| false
| 0
| 0.007752
| 0
| 0.052713
| 0.100775
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
319c579643cee83e15cc503481391b13ae5f2e49
| 324
|
py
|
Python
|
DRL/log_analysis/tracks/class_pointer.py
|
EXYNOS-999/AWS_JPL_DRL
|
ea9df7f293058b0ca2dc63753e68182fcc5380f5
|
[
"Apache-2.0"
] | null | null | null |
DRL/log_analysis/tracks/class_pointer.py
|
EXYNOS-999/AWS_JPL_DRL
|
ea9df7f293058b0ca2dc63753e68182fcc5380f5
|
[
"Apache-2.0"
] | 1
|
2020-01-08T06:52:03.000Z
|
2020-01-08T07:05:44.000Z
|
DRL/log_analysis/tracks/class_pointer.py
|
EXYNOS-999/AWS_JPL_DRL
|
ea9df7f293058b0ca2dc63753e68182fcc5380f5
|
[
"Apache-2.0"
] | null | null | null |
def some_global_function(a):
print(type(a))
def some_global_function_with_self(self, a):
print(type(a))
class Object():
def __init__(self):
#self.fp = some_global_function
self.fp = some_global_function_with_self
def call(self):
self.fp('Hello')
if __name__ == "__main__":
o = Object()
o.call()
| 17.052632
| 44
| 0.685185
| 49
| 324
| 4.040816
| 0.387755
| 0.20202
| 0.363636
| 0.212121
| 0.414141
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175926
| 324
| 18
| 45
| 18
| 0.741573
| 0.092593
| 0
| 0.166667
| 0
| 0
| 0.044369
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.416667
| 0.166667
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
31c559a76cd2ba048ad26c83f4055662a2b6a23c
| 992
|
py
|
Python
|
redescendl/__init__.py
|
harry-zuzan/Redescend-Likelihood
|
c203f1430e0200226b3dd0ec19621a2408ee1648
|
[
"MIT"
] | null | null | null |
redescendl/__init__.py
|
harry-zuzan/Redescend-Likelihood
|
c203f1430e0200226b3dd0ec19621a2408ee1648
|
[
"MIT"
] | null | null | null |
redescendl/__init__.py
|
harry-zuzan/Redescend-Likelihood
|
c203f1430e0200226b3dd0ec19621a2408ee1648
|
[
"MIT"
] | null | null | null |
from .redescend_likelihood \
import redescend_residuals_normal_1d as redescend_normal1
from .redescend_likelihood \
import redescend_residuals_normal_2d as redescend_normal2
from .redescend_likelihood \
import redescend_residuals_normal_3d as redescend_normal3
#from .redescend_likelihood \
# import get_redescend_weights_normal_1d as get_weights_normal1
from .redescend_likelihood \
import get_redescend_weights_normal_1d as normal_weights1
from .redescend_likelihood \
import get_redescend_weights_normal_2d as normal_weights2
from .redescend_likelihood \
import get_redescend_weights_normal_3d as normal_weights3
from .redescend_likelihood \
import redescend_residuals_logistic_2d as redescend_logistic2
from .redescend_likelihood \
import get_redescend_weights_logistic_2d as get_weights_logistic2
del redescend_likelihood
__all__ = ["redescend_normal2", "redescend_normal1"]
__all__ += ["get_weights_normal2", "get_weights_normal1"]
__all__ += ["redescend_logistic2"]
| 29.176471
| 66
| 0.859879
| 124
| 992
| 6.298387
| 0.177419
| 0.243278
| 0.265045
| 0.334187
| 0.629962
| 0.612036
| 0.551857
| 0.286812
| 0.148528
| 0.148528
| 0
| 0.02567
| 0.096774
| 992
| 33
| 67
| 30.060606
| 0.845982
| 0.090726
| 0
| 0.4
| 0
| 0
| 0.101224
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
31c703509bb56a8a815db6055d6e71b40f47e5c5
| 44
|
py
|
Python
|
pyVulkan/__init__.py
|
realitix/pyVulkan
|
a0fc720fe993d3f31d09088566ce711f613e3c50
|
[
"MIT"
] | null | null | null |
pyVulkan/__init__.py
|
realitix/pyVulkan
|
a0fc720fe993d3f31d09088566ce711f613e3c50
|
[
"MIT"
] | null | null | null |
pyVulkan/__init__.py
|
realitix/pyVulkan
|
a0fc720fe993d3f31d09088566ce711f613e3c50
|
[
"MIT"
] | null | null | null |
__version__ = '0.6'
from ._vulkan import *
| 11
| 22
| 0.681818
| 6
| 44
| 4.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0.181818
| 44
| 3
| 23
| 14.666667
| 0.638889
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
31d98462b341b544d2603f78bcc49a983b7964bd
| 6,012
|
py
|
Python
|
scripts/crio/communication.py
|
nowireless/lib_crio
|
9a0be3d8d790f799527120c6710560a2b7e42d77
|
[
"MIT"
] | null | null | null |
scripts/crio/communication.py
|
nowireless/lib_crio
|
9a0be3d8d790f799527120c6710560a2b7e42d77
|
[
"MIT"
] | null | null | null |
scripts/crio/communication.py
|
nowireless/lib_crio
|
9a0be3d8d790f799527120c6710560a2b7e42d77
|
[
"MIT"
] | null | null | null |
import crio
import logging
import network as net
import time
import socket
from packets import DriverStation2RobotPacket
from packets import Robot2DriverStationPacket
from threading import Thread
from threading import RLock
import ds.joysticks.joysticks as joystick
class RobotState:
def __init__(self, team):
self.team = team
self.reset = False
self.enabled = False
self.estoped = False
self.auto = False
self.test = False
self.joystick_axis = [
[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]
self.buttons = [
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]]
def reset_robot(self):
self.reset = True
def no_reset(self):
self.reset = False
def enable(self):
if not self.estoped:
self.enabled = True
def disable(self):
self.enabled = False
def estop(self):
self.estoped = True
self.disable()
def teleop(self):
self.auto = False
self.test = False
def auto(self):
self.auto = True
self.test = False
def test(self):
self.auto = False
self.test = True
def make_packet(self, index):
pkt = DriverStation2RobotPacket.make_packet(index, self.team)
pkt.control_byte.reset = self.reset
pkt.control_byte.enabled = self.enabled
pkt.control_byte.not_estop = not self.estoped
pkt.control_byte.autonmous = self.auto
pkt.control_byte.test = self.test
return pkt
class DSException(RuntimeError):
pass
class DS(Thread):
def __init__(self, team, joystick_thread=None):
super(DS, self).__init__()
self.running = True
self.team = team
self.joystick_thread = joystick_thread
self.log = crio.make_logger("DS", logging.INFO)
if net.check_interfaces(team):
self.log.info("Interfaces look ok")
else:
self.log.fatal("Network does not seem to configured correctly")
raise DSException
self.state_lock = RLock()
self.state = RobotState(team)
def run(self):
if self.joystick_thread is not None:
self.log.info("Starting Joystick Update Thread")
self.joystick_thread.start()
send = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
receive = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
receive.settimeout(crio.SOCKET_TIME_OUT)
self.log.info("Binding to socket")
receive.bind((crio.team_to_ds(self.team), crio.TO_DS_PORT))
crio_ip = crio.team_to_ip(self.team)
packet_number = 0
# Start out with not being connected to the crio
alive = False
while self.running:
if not alive:
self.log.info("Pinging robot")
if net.is_host_alive(crio_ip):
self.log.info("Robot is alive, restarting communication")
alive = True
packet_number = 0 # Reset packet index
self.state_lock.acquire()
self.state.disable()
self.state_lock.release()
time.sleep(1)
# Send DS->Robot Packet
self.state_lock.acquire()
to_robot_packet = self.state.make_packet(packet_number)
if self.state.reset:
# Do this so only one packet is sent with the reset flag
self.state.reset = False
self.state_lock.release()
# Populate Joystick Data
if self.joystick_thread is not None:
self.joystick_thread.lock()
if len(self.joystick_thread.joysticks) > 0:
to_robot_packet.joystick_1_axis_1 = self.joystick_thread.joysticks[0].axis[0]
to_robot_packet.joystick_1_axis_2 = self.joystick_thread.joysticks[0].axis[1]
print to_robot_packet.joystick_1_axis_1, to_robot_packet.joystick_1_axis_2
self.joystick_thread.unlock()
send.sendto(to_robot_packet.pack(), (crio_ip, crio.TO_ROBOT_PORT))
# Wait for Robot Packet
data = None
try:
data, addr = receive.recvfrom(1024)
except socket.timeout:
self.log.warn("Received timeout, robot is not alive")
alive = False
continue
from_crio_packet = Robot2DriverStationPacket.from_data(data)
self.log.info("Sent %i | Got %i | %s | Enabled %s", packet_number, from_crio_packet.packet_index, str(from_crio_packet.packet_index == packet_number), from_crio_packet.control_byte.enabled)
# Increment packet index
packet_number = (packet_number + 1) % 65535
time.sleep(crio.LOOP_TIME)
receive.close()
send.close()
if self.joystick_thread is not None:
self.log.info("Stopping Joystick Update Thread & joining")
self.joystick_thread.stop()
self.joystick_thread.join()
def stop(self):
self.running = False
if __name__ == "__main__":
ds = DS(3081)
ds.start()
| 34.751445
| 201
| 0.597305
| 749
| 6,012
| 4.639519
| 0.194927
| 0.273381
| 0.405755
| 0.535252
| 0.319137
| 0.286043
| 0.249496
| 0.233381
| 0.223885
| 0.19741
| 0
| 0.016766
| 0.305556
| 6,012
| 172
| 202
| 34.953488
| 0.815569
| 0.03493
| 0
| 0.227273
| 0
| 0
| 0.049189
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.007576
| 0.075758
| null | null | 0.007576
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
31d9bc3e81f5c545c2092f105f2f70f5c9c94695
| 513
|
py
|
Python
|
abm/agent.py
|
OOP-Group-3/abm
|
78a6b05643f5ec0dde21b892d7b10d65354d57ab
|
[
"MIT"
] | null | null | null |
abm/agent.py
|
OOP-Group-3/abm
|
78a6b05643f5ec0dde21b892d7b10d65354d57ab
|
[
"MIT"
] | 1
|
2020-10-25T08:46:54.000Z
|
2020-10-25T13:40:08.000Z
|
abm/agent.py
|
OOP-Group-3/abm
|
78a6b05643f5ec0dde21b892d7b10d65354d57ab
|
[
"MIT"
] | 1
|
2020-10-09T08:43:14.000Z
|
2020-10-09T08:43:14.000Z
|
from model import Model
from random import Random
class Agent:
""" Base class for a model agent. """
def __init__(self, unique_id: int, model: Model) -> None:
""" Create a new agent. """
self.unique_id = unique_id
self.model = model
self.pos = None
def step(self) -> None:
""" A single step of the agent. """
pass
# TODO: what does advance do that step() doesn't?
def advance(self) -> None:
pass
# TODO: what is this for?
@property
def random(self) -> Random:
return self.model.random
| 21.375
| 58
| 0.662768
| 79
| 513
| 4.21519
| 0.455696
| 0.072072
| 0.072072
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.212476
| 513
| 24
| 59
| 21.375
| 0.824257
| 0.298246
| 0
| 0.142857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041667
| 0
| 1
| 0.285714
| false
| 0.142857
| 0.142857
| 0.071429
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
31eafa552ca00b18866736fe4f0c9f67f321c41b
| 261
|
py
|
Python
|
gaia/db/mongo_client.py
|
caiyunapp/gaia
|
6e12b5beda095164f46e567fa04d7f13ad8a6965
|
[
"MIT"
] | null | null | null |
gaia/db/mongo_client.py
|
caiyunapp/gaia
|
6e12b5beda095164f46e567fa04d7f13ad8a6965
|
[
"MIT"
] | null | null | null |
gaia/db/mongo_client.py
|
caiyunapp/gaia
|
6e12b5beda095164f46e567fa04d7f13ad8a6965
|
[
"MIT"
] | 1
|
2019-05-06T06:28:47.000Z
|
2019-05-06T06:28:47.000Z
|
# -*- coding: utf-8 -*-
from pymongo import MongoClient
import gaia.config as cfg
config = cfg.load_config('app.yaml') or cfg.load_config('mongo.yaml') or cfg.load_config('mongo.json') or cfg.load_config('mongo.cfg')
client = MongoClient(**config['mongo'])
| 26.1
| 134
| 0.720307
| 40
| 261
| 4.6
| 0.45
| 0.152174
| 0.282609
| 0.244565
| 0.369565
| 0.26087
| 0
| 0
| 0
| 0
| 0
| 0.00431
| 0.111111
| 261
| 9
| 135
| 29
| 0.788793
| 0.08046
| 0
| 0
| 0
| 0
| 0.176471
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
9ec5db9dc8db71f59ae8083f6621a7334097664d
| 83
|
py
|
Python
|
q/qapp/apps.py
|
llennox/projects
|
b52e9a56260a67a290492479a8792fad690b327a
|
[
"MIT"
] | 2
|
2018-01-03T08:15:02.000Z
|
2018-01-03T08:15:03.000Z
|
qapp/apps.py
|
llennox/anonAPI
|
3ea2032919521e2d701f57f552bba475bd87dba2
|
[
"MIT"
] | null | null | null |
qapp/apps.py
|
llennox/anonAPI
|
3ea2032919521e2d701f57f552bba475bd87dba2
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class QappConfig(AppConfig):
name = 'qapp'
| 13.833333
| 33
| 0.73494
| 10
| 83
| 6.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180723
| 83
| 5
| 34
| 16.6
| 0.897059
| 0
| 0
| 0
| 0
| 0
| 0.048193
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
9ec86ebca9801574b960b3466fc268270d1b8f64
| 8
|
py
|
Python
|
python/testData/inspections/PyArgumentListInspection/unfilledSentinelInBuiltinIter.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/inspections/PyArgumentListInspection/unfilledSentinelInBuiltinIter.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/inspections/PyArgumentListInspection/unfilledSentinelInBuiltinIter.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
iter([])
| 8
| 8
| 0.5
| 1
| 8
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 8
| 1
| 8
| 8
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9ecc8f8cfe83f7f123a535ee4998cf01fe4683a3
| 18,932
|
py
|
Python
|
kinetics.py
|
kaustubhhakim/chili
|
f3301c3173a39614f1e55c6a5caa1e61f6b56301
|
[
"BSD-3-Clause"
] | null | null | null |
kinetics.py
|
kaustubhhakim/chili
|
f3301c3173a39614f1e55c6a5caa1e61f6b56301
|
[
"BSD-3-Clause"
] | null | null | null |
kinetics.py
|
kaustubhhakim/chili
|
f3301c3173a39614f1e55c6a5caa1e61f6b56301
|
[
"BSD-3-Clause"
] | null | null | null |
# %%
#!/usr/bin/env python
#
# Copyright (c) 2021, Kaustubh Hakim
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#
# CHILI 1.0
#
# kinetics.py (generates all figures (+ additional) from the published paper)
#
# Minerals included: kaolinite: kaol, wollastonite: woll, enstatite: enst,
# forsterite: fors, fayalite: faya, anorthite: anor,
# albite: albi, K-feldspar: kfel, muscovite: musc,
# phlogopite: phlo, quartz: quar
#
# If you are using this code, please cite the following publication
# Hakim et al. (2021) Lithologic Controls on Silicate Weathering Regimes of
# Temperate Planets. The Planetary Science Journal 2. doi:10.3847/PSJ/abe1b8
# %%
# Import packages
import numpy as np
import csv
import pandas as pd
pd.options.mode.chained_assignment = None
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from scipy.optimize import curve_fit
from scipy.optimize import newton
from scipy.interpolate import interp1d
from scipy.interpolate import interp2d
from scipy.interpolate import RegularGridInterpolator as interpnd
import astropy.units as u
u.imperial.enable()
from astropy.constants import R
from parameters import *
# %%
def import_kinetics_data():
'''Import mineral dissolution rates from Palandri & Kharaka (2004).
Column names: Mineral, A_acid, log10(k_acid), E_acid, n_acid, A_neut,
log10(k_neut), A_base, log10(k_base), E_base, n_base
Note
----
Units of A, k, and E are in mol/m2/s, mol/m2/s and kJ/mol, respectively.
Imports a csv file with a specific format and a predefined path.
Returns
-------
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
'''
logkDict = {}
df = pd.read_csv('./database/kinetics_data.csv', \
skiprows=lambda x: x in [1, 1], \
usecols=['Mineral','log10(k_acid)','E_acid', \
'n_acid','log10(k_neut)','E_neut', \
'log10(k_base)','E_base','n_base'])
logkDict['quar'] = df.loc[df['Mineral'] == 'quartz']
logkDict['albi'] = df.loc[df['Mineral'] == 'albite']
logkDict['anor'] = df.loc[df['Mineral'] == 'anorthite']
logkDict['kfel'] = df.loc[df['Mineral'] == 'K-feldspar']
logkDict['fors'] = df.loc[df['Mineral'] == 'forsterite']
logkDict['faya'] = df.loc[df['Mineral'] == 'fayalite']
logkDict['enst'] = df.loc[df['Mineral'] == 'enstatite']
logkDict['woll'] = df.loc[df['Mineral'] == 'wollastonite']
logkDict['anth'] = df.loc[df['Mineral'] == 'anthophyllite']
logkDict['musc'] = df.loc[df['Mineral'] == 'muscovite']
logkDict['phlo'] = df.loc[df['Mineral'] == 'phlogopite']
return logkDict
# %%
def get_keff(Temp, pHall, logkDict):
'''Import mineral dissolution rates from Palandri & Kharaka (2004).
Column names: Mineral, A_acid, log10(k_acid), E_acid, n_acid, A_neut,
log10(k_neut), A_base, log10(k_base), E_base, n_base
Note
----
Units of A, k, and E are in mol/m2/s, mol/m2/s and kJ/mol, respectively.
Imports a csv file with a specific format and a predefined path.
Parameters
----------
Temp : float
Temperature of the reactions (K)
pH : float
pH of the reactions
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : dict of {str : float}
Kinetics data with 4-letter keys (mol/m2/yr)
'''
kFuncs = {}
names = np.array(['quar','albi','anor','kfel','fors','faya','enst','ferr',\
'woll','anth','grun','musc','phlo','anni','albh','anoh',\
'kfeh','mush','phlh','annh'])
f_names = np.array([quar_ki,albi_ki,anor_ki,kfel_ki,fors_ki,faya_ki,enst_ki,ferr_ki,\
woll_ki,anth_ki,grun_ki,musc_ki,phlo_ki,anni_ki,albi_ki,anor_ki,\
kfel_ki,musc_ki,phlo_ki,anni_ki])
k_eff = np.zeros((len(names), len(Temp), len(pHall)))
# Points for interpolation
points = (Temp, pHall)
# Make a 2D grid for each of the parameters
Temp, pHall = np.meshgrid(Temp, pHall, indexing='ij')
for i, func in enumerate(f_names):
# Ellipsis notation is equivalent to doing :, :, : (and so on)
k_eff[i, ...] = func(Temp, pHall, logkDict)
kFuncs[names[i]] = interpnd(points=points, values=k_eff[i])
return kFuncs
# %%
def quar_ki(Temp, pH, logkDict):
'''Calculate k_eff for quartz dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_n = 10**(logkDict['quar']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
k_b = 10**(logkDict['quar']['log10(k_base)'].values[0])*u.mol/u.m/u.m/u.s
E_n = logkDict['quar']['E_neut'].values[0] * u.kJ/u.mol
E_b = logkDict['quar']['E_base'].values[0] * u.kJ/u.mol
n_b = logkDict['quar']['n_base'].values[0]
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
base = k_b * 10**(-pH*n_b) * np.exp(-E_b/R*(1/Temp-1/T0)/u.K)
return (neut + base).to(u.mol/(u.m)**2/u.a)
# %%
def kfel_ki(Temp, pH, logkDict):
'''Calculate k_eff for K-feldspar dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['kfel']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['kfel']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
k_b = 10**(logkDict['kfel']['log10(k_base)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['kfel']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['kfel']['E_neut'].values[0] * u.kJ/u.mol
E_b = logkDict['kfel']['E_base'].values[0] * u.kJ/u.mol
n_a = logkDict['kfel']['n_acid'].values[0]
n_b = logkDict['kfel']['n_base'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
base = k_b * 10**(-pH*n_b) * np.exp(-E_b/R*(1/Temp-1/T0)/u.K)
return (acid + neut + base).to(u.mol/(u.m)**2/u.a)
# %%
def albi_ki(Temp, pH, logkDict):
'''Calculate k_eff for albite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['albi']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['albi']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
k_b = 10**(logkDict['albi']['log10(k_base)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['albi']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['albi']['E_neut'].values[0] * u.kJ/u.mol
E_b = logkDict['albi']['E_base'].values[0] * u.kJ/u.mol
n_a = logkDict['albi']['n_acid'].values[0]
n_b = logkDict['albi']['n_base'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
base = k_b * 10**(-pH*n_b) * np.exp(-E_b/R*(1/Temp-1/T0)/u.K)
return (acid + neut + base).to(u.mol/(u.m)**2/u.a)
# %%
def musc_ki(Temp, pH, logkDict):
'''Calculate k_eff for muscovite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['musc']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['musc']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
k_b = 10**(logkDict['musc']['log10(k_base)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['musc']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['musc']['E_neut'].values[0] * u.kJ/u.mol
E_b = logkDict['musc']['E_base'].values[0] * u.kJ/u.mol
n_a = logkDict['musc']['n_acid'].values[0]
n_b = logkDict['musc']['n_base'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
base = k_b * 10**(-pH*n_b) * np.exp(-E_b/R*(1/Temp-1/T0)/u.K)
return (acid + neut + base).to(u.mol/(u.m)**2/u.a)
# %%
def kaol_ki(Temp, pH, logkDict):
'''Calculate k_eff for kaolinite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['kaol']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['kaol']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
k_b = 10**(logkDict['kaol']['log10(k_base)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['kaol']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['kaol']['E_neut'].values[0] * u.kJ/u.mol
E_b = logkDict['kaol']['E_base'].values[0] * u.kJ/u.mol
n_a = logkDict['kaol']['n_acid'].values[0]
n_b = logkDict['kaol']['n_base'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
base = k_b * 10**(-pH*n_b) * np.exp(-E_b/R*(1/Temp-1/T0)/u.K)
return (acid + neut + base).to(u.mol/(u.m)**2/u.a)
# %%
def woll_ki(Temp, pH, logkDict):
'''Calculate k_eff for wollastonite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['woll']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['woll']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['woll']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['woll']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['woll']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def enst_ki(Temp, pH, logkDict):
'''Calculate k_eff for enstatite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['enst']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['enst']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['enst']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['enst']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['enst']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def ferr_ki(Temp, pH, logkDict):
'''Calculate k_eff for ferrosilite dissolution.
Calculations based on enstatite due to lack of data.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['enst']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['enst']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['enst']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['enst']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['enst']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def fors_ki(Temp, pH, logkDict):
'''Calculate k_eff for forsterite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['fors']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['fors']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['fors']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['fors']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['fors']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def faya_ki(Temp, pH, logkDict):
'''Calculate k_eff for fayalite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['faya']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['faya']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['faya']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['faya']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['faya']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def anor_ki(Temp, pH, logkDict):
'''Calculate k_eff for anorthite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['anor']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['anor']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['anor']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['anor']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['anor']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def anth_ki(Temp, pH, logkDict):
'''Calculate k_eff for anthophyllite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['anth']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['anth']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['anth']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['anth']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['anth']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def grun_ki(Temp, pH, logkDict):
'''Calculate k_eff for grunerite dissolution.
Calculations based on anthophyllite due to lack of data.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_a = 10**(logkDict['anth']['log10(k_acid)'].values[0])*u.mol/u.m/u.m/u.s
k_n = 10**(logkDict['anth']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_a = logkDict['anth']['E_acid'].values[0] * u.kJ/u.mol
E_n = logkDict['anth']['E_neut'].values[0] * u.kJ/u.mol
n_a = logkDict['anth']['n_acid'].values[0]
acid = k_a * 10**(-pH*n_a) * np.exp(-E_a/R*(1/Temp-1/T0)/u.K)
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return (acid + neut).to(u.mol/(u.m)**2/u.a)
# %%
def phlo_ki(Temp, pH, logkDict):
'''Calculate k_eff for phlogopite dissolution.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_n = 10**(logkDict['phlo']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_n = logkDict['phlo']['E_neut'].values[0] * u.kJ/u.mol
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return neut.to(u.mol/(u.m)**2/u.a)
# %%
def anni_ki(Temp, pH, logkDict):
'''Calculate k_eff for annite dissolution.
Calculations based on phlogopite due to lack of data.
Parameters
----------
Temp : float
Temperature of the reaction (K)
pH : float
pH of the reaction
logkDict : dict of {str : float}
Kinetics data with 4-letter keys
Returns
-------
keff : float
Kinetic rate coefficient (mol/m2/yr)
'''
k_n = 10**(logkDict['phlo']['log10(k_neut)'].values[0])*u.mol/u.m/u.m/u.s
E_n = logkDict['phlo']['E_neut'].values[0] * u.kJ/u.mol
neut = k_n * np.exp(-E_n/R*(1/Temp-1/T0)/u.K)
return neut.to(u.mol/(u.m)**2/u.a)
| 31.765101
| 89
| 0.563807
| 3,121
| 18,932
| 3.313361
| 0.075617
| 0.05483
| 0.049512
| 0.02727
| 0.760371
| 0.751862
| 0.747026
| 0.727299
| 0.680882
| 0.678948
| 0
| 0.030746
| 0.240651
| 18,932
| 595
| 90
| 31.818487
| 0.688578
| 0.349144
| 0
| 0.364583
| 0
| 0
| 0.130718
| 0.002536
| 0
| 0
| 0
| 0
| 0
| 1
| 0.088542
| false
| 0
| 0.072917
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9ee45edef7d619770c4f741e2b2def2be3bb08d5
| 3,431
|
py
|
Python
|
src/peltak/core/templates/__init__.py
|
novopl/peltak
|
7c8ac44f994d923091a534870960fdae1e15e95e
|
[
"Apache-2.0"
] | 6
|
2015-09-10T13:20:34.000Z
|
2021-02-15T08:10:27.000Z
|
src/peltak/core/templates/__init__.py
|
novopl/peltak
|
7c8ac44f994d923091a534870960fdae1e15e95e
|
[
"Apache-2.0"
] | 41
|
2015-09-09T12:44:55.000Z
|
2021-06-01T23:25:56.000Z
|
src/peltak/core/templates/__init__.py
|
novopl/peltak
|
7c8ac44f994d923091a534870960fdae1e15e95e
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2017-2020 Mateusz Klos
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""
.. module: peltak.core.templates
:synopsis: Jinja2 templates support.
#########################
Script template reference
#########################
Using jinja filters
~~~~~~~~~~~~~~~~~~~
Let's suppose you have a scripts that runs pytest over your project and you want
to pass the verbosity flag down to the pytest command. The verbosity option
can be accessed with ``{{ opts.verbose }}`` but it is an ``int`` so we need
to somehow convert it to the appropriate flag ``-v``, or ``-vv`` etc. Thankfully
peltak already implements a filter to do just that, it's called ``count_flag``
and will convert a given number **N** to a flag that has the given letter appear
**N** times. Here's a quick example.
.. code-block:: yaml
scripts:
test:
about: Run tests with pytest
command: |
pytest {{ opts.verbose | count_flag('v') }} {{ conf.src_dir }}
This will result in the following command being invoked:
.. code-block:: bash
peltak run test
# will result in: pytest src
peltak run test -v
# will result in: pytest src -v
peltak run test -vv
# will result in: pytest src -vv
Template context
================
Peltak will inject the following context into the template.
================== ================================================================
Name Description
------------------ ----------------------------------------------------------------
``conf`` | The entire configuration object. This is the dictionary
| representation of `pelconf.yaml` and makes it easy to acess
| any global configuration values from within a script.
``opts`` | Script command line options. This will contains all command
| line options the script was called with.
``script`` | The script configuration as read from `pelconf.yaml`.
| This will only contain the configuration for the currently
| running script, not the entire **scripts:** section.
``ctx`` | Current runtime context. This is a value store that exists
| only when peltak is running and is recreated on every run.
| This is a way to share runtime information between commands
| (things like **verbosity** or **pretend**).
``proj_path`` | A helper function. Given any project relative path (relative
| to `pelconf.yaml`) it will convert it to an absolute path.
================== ================================================================
On top of all the values in the context, you can also use
`/reference/script_filters`.
Dev Reference
=============
.. autoclass:: peltak.core.templates.Engine
:members:
"""
from .engine import Engine # noqa: F401
| 36.892473
| 83
| 0.598951
| 429
| 3,431
| 4.778555
| 0.482517
| 0.029268
| 0.023415
| 0.026341
| 0.030732
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006088
| 0.234043
| 3,431
| 92
| 84
| 37.293478
| 0.773973
| 0.980472
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
7331a964b4267b5974e1e6bb7f3874c7e54e7407
| 197
|
py
|
Python
|
Python/Database/test.py
|
SahaanaIyer/SEM4-folders
|
32721985cd40a18594313b04ade62dc5e486e3e5
|
[
"MIT"
] | null | null | null |
Python/Database/test.py
|
SahaanaIyer/SEM4-folders
|
32721985cd40a18594313b04ade62dc5e486e3e5
|
[
"MIT"
] | null | null | null |
Python/Database/test.py
|
SahaanaIyer/SEM4-folders
|
32721985cd40a18594313b04ade62dc5e486e3e5
|
[
"MIT"
] | null | null | null |
import mysql.connector
mydb = mysql.connector.connect(host="localhost",user="root",passwd="")
print(mydb)
if(mydb):
print("Connection successful")
else:
print("Connection not successful")
| 21.888889
| 70
| 0.730964
| 24
| 197
| 6
| 0.666667
| 0.194444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111675
| 197
| 8
| 71
| 24.625
| 0.822857
| 0
| 0
| 0
| 0
| 0
| 0.299492
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.142857
| 0.142857
| 0
| 0.142857
| 0.428571
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
|
0
| 4
|
7338a09d01d6acfcf1188f71fb11fe7a6a4ec780
| 3,928
|
py
|
Python
|
tests/data/residues/HIS.py
|
uw-ipd/privileged_residues
|
78078c22ba537651a1b6bd1404c05246ab73a3e3
|
[
"Apache-2.0"
] | null | null | null |
tests/data/residues/HIS.py
|
uw-ipd/privileged_residues
|
78078c22ba537651a1b6bd1404c05246ab73a3e3
|
[
"Apache-2.0"
] | 20
|
2018-08-13T22:50:46.000Z
|
2018-11-03T22:29:03.000Z
|
tests/data/residues/HIS.py
|
uw-ipd/privileged_residues
|
78078c22ba537651a1b6bd1404c05246ab73a3e3
|
[
"Apache-2.0"
] | 1
|
2018-08-25T06:03:43.000Z
|
2018-08-25T06:03:43.000Z
|
from tests.util import pick_ray
from pyrosetta import Pose
from pyrosetta.rosetta.core.import_pose import pose_from_pdbstring
name = "HIS"
contents = """
ATOM 1 N ALA A 1 0.000 0.000 0.000 1.00 0.00 N
ATOM 2 CA ALA A 1 1.458 0.000 0.000 1.00 0.00 C
ATOM 3 C ALA A 1 2.009 1.420 0.000 1.00 0.00 C
ATOM 4 O ALA A 1 1.251 2.390 0.000 1.00 0.00 O
ATOM 5 CB ALA A 1 1.988 -0.773 -1.199 1.00 0.00 C
ATOM 6 1H ALA A 1 -0.334 -0.943 -0.000 1.00 0.00 H
ATOM 7 2H ALA A 1 -0.334 0.471 0.816 1.00 0.00 H
ATOM 8 3H ALA A 1 -0.334 0.471 -0.816 1.00 0.00 H
ATOM 9 HA ALA A 1 1.797 -0.490 0.913 1.00 0.00 H
ATOM 10 1HB ALA A 1 3.078 -0.764 -1.185 1.00 0.00 H
ATOM 11 2HB ALA A 1 1.633 -1.802 -1.154 1.00 0.00 H
ATOM 12 3HB ALA A 1 1.633 -0.307 -2.117 1.00 0.00 H
ATOM 13 N HIS A 2 3.332 1.536 0.000 1.00 0.00 N
ATOM 14 CA HIS A 2 3.988 2.839 0.000 1.00 0.00 C
ATOM 15 C HIS A 2 5.504 2.693 0.000 1.00 0.00 C
ATOM 16 O HIS A 2 6.030 1.580 0.000 1.00 0.00 O
ATOM 17 CB HIS A 2 3.548 3.665 1.213 1.00 0.00 C
ATOM 18 CG HIS A 2 2.569 2.960 2.099 1.00 0.00 C
ATOM 19 ND1 HIS A 2 2.113 1.685 1.837 1.00 0.00 N
ATOM 20 CD2 HIS A 2 1.959 3.351 3.242 1.00 0.00 C
ATOM 21 CE1 HIS A 2 1.264 1.322 2.782 1.00 0.00 C
ATOM 22 NE2 HIS A 2 1.153 2.315 3.646 1.00 0.00 N
ATOM 23 H HIS A 2 3.899 0.700 0.000 1.00 0.00 H
ATOM 24 HA HIS A 2 3.702 3.361 -0.913 1.00 0.00 H
ATOM 25 1HB HIS A 2 4.422 3.927 1.810 1.00 0.00 H
ATOM 26 2HB HIS A 2 3.093 4.595 0.874 1.00 0.00 H
ATOM 27 HD2 HIS A 2 2.083 4.309 3.748 1.00 0.00 H
ATOM 28 HE1 HIS A 2 0.744 0.366 2.840 1.00 0.00 H
ATOM 29 HE2 HIS A 2 0.571 2.317 4.472 1.00 0.00 H
ATOM 30 N ALA A 3 6.202 3.823 0.000 1.00 0.00 N
ATOM 31 CA ALA A 3 7.660 3.823 0.000 1.00 0.00 C
ATOM 32 C ALA A 3 8.211 5.243 0.000 1.00 0.00 C
ATOM 33 O ALA A 3 8.260 5.868 1.023 1.00 0.00 O
ATOM 34 OXT ALA A 3 8.596 5.737 -1.023 1.00 0.00 O
ATOM 35 CB ALA A 3 8.190 3.050 -1.199 1.00 0.00 C
ATOM 36 H ALA A 3 5.710 4.705 -0.000 1.00 0.00 H
ATOM 37 HA ALA A 3 7.999 3.333 0.913 1.00 0.00 H
ATOM 38 1HB ALA A 3 9.280 3.059 -1.185 1.00 0.00 H
ATOM 39 2HB ALA A 3 7.835 2.021 -1.154 1.00 0.00 H
ATOM 40 3HB ALA A 3 7.835 3.516 -2.117 1.00 0.00 H
TER
"""
pose = Pose()
pose_from_pdbstring(pose, contents)
n_rays = {
1: pick_ray(pose.residue(1), "1H", "N"),
2: pick_ray(pose.residue(2), "H", "N"),
3: pick_ray(pose.residue(3), "H", "N")
}
c_rays = {
1: pick_ray(pose.residue(1), "O", "C"),
2: pick_ray(pose.residue(2), "O", "C"),
3: pick_ray(pose.residue(3), "O", "C")
}
sc_donor = {
2: [
pick_ray(pose.residue(2), "HE2", "NE2")
]
}
sc_acceptor = {
2: [
pick_ray(pose.residue(2), "ND1", "CG")
]
}
cat_pi = [
(pick_ray(pose.residue(2), "CD2", "ND1"), pick_ray(pose.residue(2), "NE2", "ND1"))
]
| 47.902439
| 86
| 0.4389
| 799
| 3,928
| 2.131414
| 0.222778
| 0.070464
| 0.093952
| 0.140928
| 0.49677
| 0.453318
| 0.303582
| 0.262478
| 0.032883
| 0.032883
| 0
| 0.414692
| 0.462831
| 3,928
| 81
| 87
| 48.493827
| 0.392417
| 0
| 0
| 0.027778
| 0
| 0.555556
| 0.815682
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.041667
| 0
| 0.041667
| 0
| 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
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
734bab73024ca1e585578dd27fa564806385bafa
| 447
|
py
|
Python
|
test/arithmetic-op.py
|
yalina2787/NovPython
|
363fccc0d5b7b234e8b86668cc4b41f3a86d227e
|
[
"Apache-2.0"
] | null | null | null |
test/arithmetic-op.py
|
yalina2787/NovPython
|
363fccc0d5b7b234e8b86668cc4b41f3a86d227e
|
[
"Apache-2.0"
] | null | null | null |
test/arithmetic-op.py
|
yalina2787/NovPython
|
363fccc0d5b7b234e8b86668cc4b41f3a86d227e
|
[
"Apache-2.0"
] | null | null | null |
a=5
b=10
print("This file tests arithmetic operators")
# test + - * / % < ( ) ^
# test assignment
print("a:")
print(a)
print("b:")
print(b)
# test +
print("a + b:")
print(a + b)
# test -
print("a - b:")
print(a - b)
# test *
print("a * b:")
print(a * b)
# test /
print("a / b:")
print(a / b)
# test %
print("a % b:")
print(a % b)
# test ^
print("a ^ b:")
print(a ^ b)
d = 1
print("d:")
print(d)
print("d^=10:")
d ^= 10
print(d)
| 8.433962
| 45
| 0.498881
| 76
| 447
| 2.934211
| 0.184211
| 0.376682
| 0.376682
| 0.295964
| 0.488789
| 0.488789
| 0.488789
| 0.488789
| 0.488789
| 0.488789
| 0
| 0.023599
| 0.241611
| 447
| 52
| 46
| 8.596154
| 0.634218
| 0.178971
| 0
| 0.08
| 0
| 0
| 0.23662
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.84
| 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
| 1
|
0
| 4
|
b41327b6d79c8138998b0068d5ddfa0bc399815b
| 10,177
|
py
|
Python
|
koocook_core/migrations/0001_initial.py
|
KooCook/koocook-dj
|
33bfaf48e8363013ddd083d5d8542496c50fd5d3
|
[
"BSD-3-Clause"
] | 1
|
2020-10-19T04:44:49.000Z
|
2020-10-19T04:44:49.000Z
|
koocook_core/migrations/0001_initial.py
|
KooCook/koocook-dj
|
33bfaf48e8363013ddd083d5d8542496c50fd5d3
|
[
"BSD-3-Clause"
] | 26
|
2019-11-11T03:37:03.000Z
|
2019-12-15T23:18:18.000Z
|
koocook_core/migrations/0001_initial.py
|
KooCook/koocook-dj
|
33bfaf48e8363013ddd083d5d8542496c50fd5d3
|
[
"BSD-3-Clause"
] | 1
|
2020-11-08T14:36:21.000Z
|
2020-11-08T14:36:21.000Z
|
# Generated by Django 3.0 on 2019-12-15 22:07
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import koocook_core.models.base
import koocook_core.models.review
import koocook_core.support.markdown
import koocook_core.support.quantity
class Migration(migrations.Migration):
initial = True
dependencies = [
('koocook_auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='AggregateRating',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rating_value', models.DecimalField(decimal_places=10, max_digits=13)),
('rating_count', models.IntegerField()),
('best_rating', models.IntegerField(default=5)),
('worst_rating', models.IntegerField(default=1)),
],
),
migrations.CreateModel(
name='Author',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='koocook_auth.KoocookUser')),
],
bases=(koocook_core.models.base.SerialisableModel, models.Model),
),
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date_published', models.DateTimeField(auto_now_add=True)),
('body', koocook_core.support.markdown.FormattedField()),
('aggregate_rating', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='koocook_core.AggregateRating')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='koocook_core.Author')),
('reviewed_comment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Comment')),
],
bases=(koocook_core.models.review.ReviewerModel, koocook_core.models.base.SerialisableModel, koocook_core.models.review.ReviewableModel, models.Model),
),
migrations.CreateModel(
name='MetaIngredient',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('nutrient', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
('description', models.CharField(blank=True, max_length=255, null=True)),
],
),
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date_published', models.DateTimeField(auto_now_add=True)),
('body', koocook_core.support.markdown.FormattedField()),
('aggregate_rating', models.OneToOneField(blank=True, on_delete=django.db.models.deletion.PROTECT, to='koocook_core.AggregateRating')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='koocook_core.Author')),
],
bases=(koocook_core.models.base.SerialisableModel, koocook_core.models.review.ReviewableModel, models.Model),
),
migrations.CreateModel(
name='Recipe',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('image', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, null=True, size=None)),
('video', models.URLField(blank=True, null=True)),
('date_published', models.DateTimeField(auto_now_add=True, null=True)),
('description', models.TextField()),
('prep_time', models.DurationField(null=True)),
('cook_time', models.DurationField(null=True)),
('recipe_instructions', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None)),
('recipe_yield', koocook_core.support.quantity.QuantityField(null=True)),
('aggregate_rating', models.OneToOneField(blank=True, on_delete=django.db.models.deletion.PROTECT, to='koocook_core.AggregateRating')),
('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='koocook_core.Author')),
],
bases=(koocook_core.models.review.ReviewableModel, models.Model),
),
migrations.CreateModel(
name='RecipeEquipment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True)),
],
bases=(koocook_core.models.base.SerialisableModel, models.Model),
),
migrations.CreateModel(
name='TagLabel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('level', models.IntegerField(default=1)),
],
bases=(koocook_core.models.base.SerialisableModel, models.Model),
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('label', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='koocook_core.TagLabel')),
],
options={
'unique_together': {('name', 'label')},
},
bases=(koocook_core.models.base.SerialisableModel, models.Model),
),
migrations.CreateModel(
name='RecipeIngredient',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', koocook_core.support.quantity.QuantityField()),
('description', models.CharField(blank=True, max_length=255, null=True)),
('meta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='koocook_core.MetaIngredient')),
('recipe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Recipe')),
('substitute_set', models.ManyToManyField(blank=True, related_name='_recipeingredient_substitute_set_+', to='koocook_core.RecipeIngredient')),
],
),
migrations.AddField(
model_name='recipe',
name='equipment_set',
field=models.ManyToManyField(blank=True, to='koocook_core.RecipeEquipment'),
),
migrations.AddField(
model_name='recipe',
name='tag_set',
field=models.ManyToManyField(blank=True, to='koocook_core.Tag'),
),
migrations.CreateModel(
name='Rating',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rating_value', models.IntegerField()),
('best_rating', models.IntegerField(default=5)),
('worst_rating', models.IntegerField(default=1)),
('used', models.BooleanField(blank=True, default=False)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='koocook_core.Author')),
('reviewed_comment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Comment')),
('reviewed_post', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Post')),
('reviewed_recipe', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Recipe')),
],
bases=(koocook_core.models.review.ReviewerModel, models.Model),
),
migrations.AddField(
model_name='comment',
name='reviewed_post',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Post'),
),
migrations.AddField(
model_name='comment',
name='reviewed_recipe',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Recipe'),
),
migrations.CreateModel(
name='RecipeVisit',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ip_address', models.CharField(max_length=45)),
('date_first_visited', models.DateTimeField(auto_now_add=True)),
('date_last_visited', models.DateTimeField(auto_now=True)),
('recipe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='koocook_core.Recipe')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='koocook_auth.KoocookUser')),
],
options={
'verbose_name': 'Recipe visit count',
'db_table': 'koocook_core_recipe_visit',
'unique_together': {('ip_address', 'user', 'recipe'), ('user', 'recipe')},
},
),
]
| 55.612022
| 163
| 0.616783
| 1,036
| 10,177
| 5.892857
| 0.140927
| 0.072072
| 0.045864
| 0.072072
| 0.78231
| 0.735954
| 0.704996
| 0.689926
| 0.665356
| 0.648649
| 0
| 0.007017
| 0.243785
| 10,177
| 182
| 164
| 55.917582
| 0.786253
| 0.004225
| 0
| 0.577143
| 1
| 0
| 0.137683
| 0.029214
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.045714
| 0
| 0.068571
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b41988010feb4bbd03caeec15cac58f98225d3eb
| 481
|
py
|
Python
|
FIRMCORN/procedures/open_.py
|
mrTavas/owasp-fstm-auto
|
6e9ff36e46d885701c7419db3eca15f12063a7f3
|
[
"CC0-1.0"
] | 2
|
2021-05-05T12:03:01.000Z
|
2021-06-04T14:27:15.000Z
|
FIRMCORN/procedures/open_.py
|
mrTavas/owasp-fstm-auto
|
6e9ff36e46d885701c7419db3eca15f12063a7f3
|
[
"CC0-1.0"
] | null | null | null |
FIRMCORN/procedures/open_.py
|
mrTavas/owasp-fstm-auto
|
6e9ff36e46d885701c7419db3eca15f12063a7f3
|
[
"CC0-1.0"
] | 2
|
2021-05-05T12:03:09.000Z
|
2021-06-04T14:27:21.000Z
|
from unicorn import *
from unicorn.arm_const import *
from unicorn.arm64_const import *
from unicorn.x86_const import *
from unicorn.mips_const import *
class open_():
"""
open
"""
def __init__(self , fc ,hc , enable_debug=True):
self.fc = fc # firmcorn class, inherited from uc class
self.hc = hc # hookcode class, inherited from object
self.enable_debug = enable_debug
def run(self ):
print "open"
return 1
| 24.05
| 62
| 0.640333
| 63
| 481
| 4.698413
| 0.428571
| 0.185811
| 0.22973
| 0.222973
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014368
| 0.276507
| 481
| 20
| 63
| 24.05
| 0.836207
| 0.160083
| 0
| 0
| 0
| 0
| 0.010499
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.384615
| null | null | 0.076923
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
b45ea5676f6973a759cfcf27b1ecb2916ddb9602
| 11,274
|
py
|
Python
|
pwnlib/dynelf.py
|
alexpark07/pwntools
|
c86022e844c8264ba4c35ed1dd5d55f1c76be90b
|
[
"MIT"
] | 1
|
2015-04-21T11:30:28.000Z
|
2015-04-21T11:30:28.000Z
|
pwnlib/dynelf.py
|
alexpark07/pwntools
|
c86022e844c8264ba4c35ed1dd5d55f1c76be90b
|
[
"MIT"
] | null | null | null |
pwnlib/dynelf.py
|
alexpark07/pwntools
|
c86022e844c8264ba4c35ed1dd5d55f1c76be90b
|
[
"MIT"
] | null | null | null |
from . import elf, log, memleak
def sysv_hash(symbol):
"""sysv_hash(str) -> int
Fallback hash function used in ELF files if .gnuhash is not present
"""
h = 0
g = 0
for c in symbol:
h = (h << 4) + ord(c)
g = h & 0xf0000000
h ^= (g >> 24)
h &= ~g
return h & 0xffffffff
def gnu_hash(s):
"""gnu_hash(str) -> int
Hash function used in the .gnuhash section of ELF files
"""
h = 5381
for c in s:
h = h * 33 + ord(c)
return h & 0xffffffff
class DynELF(object):
"""DynELF is a tool for finding symbol addresses by leaking data from the .dynsym section.
Args:
path (filename/ELF object): the ELF file
leak (MemLeak object): a memory leak for the ELF file
base (int): base address for the binary
"""
def __init__(self, path, leak, base = None):
if isinstance(path, elf.ELF):
self.elf = path
else:
self.elf = elf.load(path)
if isinstance(leak, memleak.MemLeak):
self.leak = leak
else:
log.error('Leak must be a MemLeak object')
self.PIE = (self.elf.elftype == 'DYN')
self.base = base
if self.PIE is False and self.base is None:
for x in self.elf.segments:
if x['type'] == 'LOAD' and 'E' in x['flg']:
self.base = x['virtaddr']
break
if self.base is None:
log.error('Position independent ELF needs a base address')
def bases(self):
"""Resolve base addresses of all loaded libraries.
Return a dictionary mapping library path to its base address.
"""
if self.elf.elfclass == 'ELF32':
return self._bases32()
if self.elf.elfclass == 'ELF64':
return self._bases64()
def lookup (self, symb = None, lib = 'libc'):
"""Find the address of symbol, which is found in lib"""
if self.elf.elfclass == 'ELF32':
return self._lookup32(symb, lib)
if self.elf.elfclass == 'ELF64':
return self._lookup64(symb, lib)
def _gotoff(self):
sections = self.elf.sections
return (sections['.got.plt'] if '.got.plt' in sections else sections['.got'])['addr']
def _bases32(self):
bases = { }
base = self.base
leak = self.leak
gotoff = self._gotoff()
if base is None:
pass
# XXX: Read base address
# else:
# log.error('Position independent ELF needs a base address')
else:
if gotoff > base:
gotplt = gotoff
else:
gotplt = base + gotoff
link_map = leak.d(gotplt, 1)
cur = link_map
while cur:
addr = leak.d(cur + 4)
name = leak.s(addr)
bases[name] = leak.d(cur)
cur = leak.d(cur + 12)
return bases
def _bases64(self):
bases = { }
base = self.base
leak = self.leak
gotoff = self._gotoff()
if base is None:
pass
# XXX: Read base address
# else:
# log.error('Position independent ELF needs a base address')
else:
if gotoff > base:
gotplt = gotoff
else:
gotplt = base + gotoff
link_map = leak.q(gotplt, 1)
cur = link_map
while cur:
addr = leak.q(cur + 8)
name = leak.s(addr)
bases[name] = leak.q(cur)
cur = leak.q(cur + 24)
return bases
def _lookup32 (self, symb, lib):
base = self.base
leak = self.leak
gotoff = self._gotoff()
if base is None:
pass
# XXX: Read base address
# else:
# log.error('Position independent ELF needs a base address')
else:
if gotoff > base:
gotplt = gotoff
else:
gotplt = base + gotoff
log.waitfor('Resolving "%s"' % symb)
def status(s):
log.status('Leaking %s' % s)
status('link_map')
link_map = leak.d(gotplt, 1)
status('%s load address' % lib)
cur = link_map
while True:
addr = leak.d(cur + 4)
name = leak.s(addr)
if lib in name:
break
cur = leak.d(cur + 12)
libbase = leak.d(cur)
if symb is None:
return libbase
dyn = leak.d(cur, 2)
status('.gnu.hash, .strtab and .symtab offsets')
cur = dyn
hshtag = None
hshtab = None
strtab = None
symtab = None
while None in [hshtab, strtab, symtab]:
tag = leak.d(dyn)
if tag == 4:
hshtab = leak.d(dyn, 1)
hshtag = tag
elif tag == 5:
strtab = leak.d(dyn, 1)
elif tag == 6:
symtab = leak.d(dyn, 1)
elif tag == 0x6ffffef5:
hshtab = leak.d(dyn, 1)
hshtag = tag
dyn += 8
# with glibc the pointers are relocated whereas with f.x. uclibc they
# are not
if libbase > strtab:
strtab += libbase
symtab += libbase
hshtab += libbase
if hshtag == 4:
status('.hash parms')
nbuckets = leak.d(hshtab)
bucketaddr = hshtab + 8
chain = hshtab + 8 + nbuckets * 4
status('hashmap')
h = sysv_hash(symb) % nbuckets
idx = leak.d(bucketaddr, h)
while idx:
sym = symtab + (idx * 16)
symtype = leak.b(sym + 12) & 0xf
if symtype == 2:
#Function type symbol
name = leak.s(strtab + leak.d(sym))
if name == symb:
#Bingo
log.done_success()
return libbase + leak.d(sym, 1)
idx = leak.d(chain, idx)
else:
status('.gnu.hash parms')
nbuckets = leak.d(hshtab)
symndx = leak.d(hshtab, 1)
maskwords = leak.d(hshtab, 2)
buckets = hshtab + 16 + 4 * maskwords
chains = buckets + 4 * nbuckets
status('hash chain index')
hsh = gnu_hash(symb)
bucket = hsh % nbuckets
ndx = leak.d(buckets, bucket)
chain = chains + 4 * (ndx - symndx)
if ndx == 0:
log.done_failure('Empty chain')
return None
status('hash chain')
i = 0
hsh &= ~1
while True:
hsh2 = leak.d(chain + (i * 4))
if hsh == (hsh2 & ~1):
#Hash matches, but this may be a collision
#Check symbol name too.
sym = symtab + 16 * (ndx + i)
name = leak.s(strtab + leak.d(sym))
if name == symb:
break
if hsh2 & 1:
log.done_failure('No hash')
return None
i += 1
status('symbol offset')
offset = leak.d(sym, 1)
log.done_success()
return offset + libbase
def _lookup64 (self, symb, lib):
base = self.base
leak = self.leak
gotoff = self._gotoff()
if base is None:
pass
# XXX: Read base address
# else:
# log.error('Position independent ELF needs a base address')
else:
if gotoff > base:
gotplt = gotoff
else:
gotplt = base + gotoff
log.waitfor('Resolving "%s"' % symb)
def status(s):
log.status('Leaking %s' % s)
status('link_map')
link_map = leak.q(gotplt, 1)
status('%s load address' % lib)
cur = link_map
while True:
addr = leak.q(cur + 8)
name = leak.s(addr)
if lib in name:
break
cur = leak.q(cur + 24)
libbase = leak.q(cur)
if symb is None:
return libbase
dyn = leak.q(cur, 2)
status('.gnu.hash/.hash, .strtab and .symtab offsets')
cur = dyn
hshtag = None
hshtab = None
strtab = None
symtab = None
while None in [hshtab, strtab, symtab]:
tag = leak.q(cur)
if tag == 4:
hshtab = leak.q(cur, 1)
hshtag = tag
elif tag == 5:
strtab = leak.q(cur, 1)
elif tag == 6:
symtab = leak.q(cur, 1)
elif tag == 0x6ffffef5:
hshtab = leak.q(cur, 1)
hshtag = tag
cur += 16
# with glibc the pointers are relocated whereas with f.x. uclibc they
# are not
if libbase > strtab:
strtab += libbase
symtab += libbase
hshtab += libbase
if hshtag == 4:
status('.hash parms')
nbuckets = leak.d(hshtab)
bucketaddr = hshtab + 8
chain = hshtab + 8 + nbuckets * 4
status('hashmap')
h = sysv_hash(symb) % nbuckets
idx = leak.d(bucketaddr, h)
while idx:
sym = symtab + (idx * 24)
symtype = leak.b(sym + 4) & 0xf
if symtype == 2:
#Function type symbol
name = leak.s(strtab + leak.d(sym))
if name == symb:
#Bingo
log.done_success()
return libbase + leak.q(sym, 1)
idx = leak.d(chain, idx)
else:
status('.gnu.hash parms')
nbuckets = leak.d(hshtab)
symndx = leak.d(hshtab, 1)
maskwords = leak.d(hshtab, 2)
buckets = hshtab + 16 + 8 * maskwords
chains = buckets + 4 * nbuckets
status('hash chain index')
hsh = gnu_hash(symb)
bucket = hsh % nbuckets
ndx = leak.d(buckets, bucket)
chain = chains + 4 * (ndx - symndx)
if ndx == 0:
log.done_failure('Empty chain')
return None
status('hash chain')
i = 0
hsh &= ~1
while True:
hsh2 = leak.d(chain + (i * 4))
if hsh == (hsh2 & ~1):
#Hash matches, but this may be a collision
#Check symbol name too.
sym = symtab + 24 * (ndx + i)
name = leak.s(strtab + leak.d(sym))
if name == symb:
break
if hsh2 & 1:
log.done_failure('No hash')
return None
i += 1
status('symbol offset')
offset = leak.q(sym, 1)
log.done_success()
return offset + libbase
| 30.552846
| 94
| 0.452457
| 1,261
| 11,274
| 4.011102
| 0.147502
| 0.035587
| 0.01898
| 0.02669
| 0.755042
| 0.738039
| 0.719454
| 0.673982
| 0.64828
| 0.603005
| 0
| 0.023725
| 0.450417
| 11,274
| 368
| 95
| 30.63587
| 0.792608
| 0.112471
| 0
| 0.757785
| 0
| 0
| 0.050601
| 0
| 0
| 0
| 0.005656
| 0
| 0
| 1
| 0.041522
| false
| 0.013841
| 0.00346
| 0
| 0.114187
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b4613159a0905c7c24dc1fcf3cb6fb3eaa90467b
| 3,389
|
py
|
Python
|
stubs.min/System/Windows/Forms/__init___parts/DataGridViewAdvancedBorderStyle.py
|
ricardyn/ironpython-stubs
|
4d2b405eda3ceed186e8adca55dd97c332c6f49d
|
[
"MIT"
] | 1
|
2021-02-02T13:39:16.000Z
|
2021-02-02T13:39:16.000Z
|
stubs.min/System/Windows/Forms/__init___parts/DataGridViewAdvancedBorderStyle.py
|
hdm-dt-fb/ironpython-stubs
|
4d2b405eda3ceed186e8adca55dd97c332c6f49d
|
[
"MIT"
] | null | null | null |
stubs.min/System/Windows/Forms/__init___parts/DataGridViewAdvancedBorderStyle.py
|
hdm-dt-fb/ironpython-stubs
|
4d2b405eda3ceed186e8adca55dd97c332c6f49d
|
[
"MIT"
] | null | null | null |
class DataGridViewAdvancedBorderStyle(object,ICloneable):
"""
Contains border styles for the cells in a System.Windows.Forms.DataGridView control.
DataGridViewAdvancedBorderStyle()
"""
def Equals(self,other):
"""
Equals(self: DataGridViewAdvancedBorderStyle,other: object) -> bool
Determines whether the specified object is equal to the current
System.Windows.Forms.DataGridViewAdvancedBorderStyle.
other: An System.Object to be compared.
Returns: true if other is a System.Windows.Forms.DataGridViewAdvancedBorderStyle and the
values for the System.Windows.Forms.DataGridViewAdvancedBorderStyle.Top,
System.Windows.Forms.DataGridViewAdvancedBorderStyle.Bottom,
System.Windows.Forms.DataGridViewAdvancedBorderStyle.Left,and
System.Windows.Forms.DataGridViewAdvancedBorderStyle.Right properties are equal
to their counterpart in the current
System.Windows.Forms.DataGridViewAdvancedBorderStyle; otherwise,false.
"""
pass
def GetHashCode(self):
""" GetHashCode(self: DataGridViewAdvancedBorderStyle) -> int """
pass
def ToString(self):
"""
ToString(self: DataGridViewAdvancedBorderStyle) -> str
Returns a string that represents the
System.Windows.Forms.DataGridViewAdvancedBorderStyle.
Returns: A string that represents the
System.Windows.Forms.DataGridViewAdvancedBorderStyle.
"""
pass
def __eq__(self,*args):
""" x.__eq__(y) <==> x==y """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __ne__(self,*args):
pass
def __repr__(self,*args):
""" __repr__(self: object) -> str """
pass
def __str__(self,*args):
pass
All=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the border style for all of the borders of a cell.
Get: All(self: DataGridViewAdvancedBorderStyle) -> DataGridViewAdvancedCellBorderStyle
Set: All(self: DataGridViewAdvancedBorderStyle)=value
"""
Bottom=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the style for the bottom border of a cell.
Get: Bottom(self: DataGridViewAdvancedBorderStyle) -> DataGridViewAdvancedCellBorderStyle
Set: Bottom(self: DataGridViewAdvancedBorderStyle)=value
"""
Left=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the style for the left border of a cell.
Get: Left(self: DataGridViewAdvancedBorderStyle) -> DataGridViewAdvancedCellBorderStyle
Set: Left(self: DataGridViewAdvancedBorderStyle)=value
"""
Right=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the style for the right border of a cell.
Get: Right(self: DataGridViewAdvancedBorderStyle) -> DataGridViewAdvancedCellBorderStyle
Set: Right(self: DataGridViewAdvancedBorderStyle)=value
"""
Top=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the style for the top border of a cell.
Get: Top(self: DataGridViewAdvancedBorderStyle) -> DataGridViewAdvancedCellBorderStyle
Set: Top(self: DataGridViewAdvancedBorderStyle)=value
"""
| 36.44086
| 215
| 0.732665
| 365
| 3,389
| 6.627397
| 0.227397
| 0.062009
| 0.074411
| 0.182307
| 0.352212
| 0.304258
| 0.255477
| 0.255477
| 0.255477
| 0.255477
| 0
| 0
| 0.168486
| 3,389
| 92
| 216
| 36.836957
| 0.85841
| 0.421658
| 0
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.363636
| false
| 0.363636
| 0
| 0
| 0.636364
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
b47743f3b6a0989a98dbe116e1d2b7d5c2061ec2
| 353
|
py
|
Python
|
academics/admin.py
|
judeakinwale/SMS-backup
|
30636591b43bec94e7406f4c02fde402a5a2e38f
|
[
"MIT"
] | null | null | null |
academics/admin.py
|
judeakinwale/SMS-backup
|
30636591b43bec94e7406f4c02fde402a5a2e38f
|
[
"MIT"
] | null | null | null |
academics/admin.py
|
judeakinwale/SMS-backup
|
30636591b43bec94e7406f4c02fde402a5a2e38f
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from academics import models
# Register your models here.
admin.site.register(models.Faculty)
admin.site.register(models.Department)
admin.site.register(models.Specialization)
admin.site.register(models.Course)
admin.site.register(models.Level)
admin.site.register(models.Semester)
admin.site.register(models.Session)
| 27.153846
| 42
| 0.830028
| 48
| 353
| 6.104167
| 0.375
| 0.215017
| 0.406143
| 0.549488
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.062323
| 353
| 12
| 43
| 29.416667
| 0.885196
| 0.073654
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c30399fd9df446316351c0ad05bdc170e2502cba
| 191
|
py
|
Python
|
boa3_test/test_sc/built_in_methods_test/ExtendMutableSequence.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 25
|
2020-07-22T19:37:43.000Z
|
2022-03-08T03:23:55.000Z
|
boa3_test/test_sc/built_in_methods_test/ExtendMutableSequence.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 419
|
2020-04-23T17:48:14.000Z
|
2022-03-31T13:17:45.000Z
|
boa3_test/test_sc/built_in_methods_test/ExtendMutableSequence.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 15
|
2020-05-21T21:54:24.000Z
|
2021-11-18T06:17:24.000Z
|
from typing import MutableSequence
from boa3.builtin import public
@public
def Main() -> MutableSequence[int]:
a: MutableSequence[int] = [1, 2, 3]
a.extend([4, 5, 6])
return a
| 17.363636
| 39
| 0.670157
| 27
| 191
| 4.740741
| 0.703704
| 0.28125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.046053
| 0.204188
| 191
| 10
| 40
| 19.1
| 0.796053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| true
| 0
| 0.285714
| 0
| 0.571429
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
c30be8414e501be2b04fd0a0e4d0eefbf4a5f188
| 225
|
py
|
Python
|
api/keyword_analysis/serializers.py
|
gpiechnik2/senter
|
6f64f5410fe02a5215ba148553dec45feaadcc09
|
[
"CC0-1.0"
] | 2
|
2021-12-08T19:38:33.000Z
|
2022-01-26T15:02:57.000Z
|
api/keyword_analysis/serializers.py
|
gpiechnik2/senter
|
6f64f5410fe02a5215ba148553dec45feaadcc09
|
[
"CC0-1.0"
] | null | null | null |
api/keyword_analysis/serializers.py
|
gpiechnik2/senter
|
6f64f5410fe02a5215ba148553dec45feaadcc09
|
[
"CC0-1.0"
] | 1
|
2021-12-08T19:38:39.000Z
|
2021-12-08T19:38:39.000Z
|
from rest_framework import serializers
#from accounts.models import User
class KeywordAnalysisSerializer(serializers.Serializer):
keyword = serializers.CharField(max_length = 60, allow_null = False, allow_blank = False)
| 37.5
| 93
| 0.817778
| 26
| 225
| 6.923077
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01005
| 0.115556
| 225
| 5
| 94
| 45
| 0.894472
| 0.142222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c30f38601dc3996d4cb650cb32b340641846e026
| 137
|
py
|
Python
|
gym_poly_reactor/envs/__init__.py
|
cu-rie/gym-poly-reactor-rl
|
393b6023d3594222869b00e64be172c70ff9e0d1
|
[
"MIT"
] | 2
|
2020-07-12T12:38:35.000Z
|
2020-12-29T11:45:27.000Z
|
gym_poly_reactor/envs/__init__.py
|
Junyoungpark/gym-poly-reactor
|
57e93cf8e5d84477846364434c09397ca62f7db4
|
[
"MIT"
] | null | null | null |
gym_poly_reactor/envs/__init__.py
|
Junyoungpark/gym-poly-reactor
|
57e93cf8e5d84477846364434c09397ca62f7db4
|
[
"MIT"
] | null | null | null |
from gym.envs.registration import register
register(
id='poly-reactor-v0',
entry_point='gym_poly_reactor.envs:PolyReactor',
)
| 15.222222
| 52
| 0.744526
| 18
| 137
| 5.5
| 0.722222
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008475
| 0.138686
| 137
| 8
| 53
| 17.125
| 0.830508
| 0
| 0
| 0
| 0
| 0
| 0.355556
| 0.244444
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.2
| 0
| 0.2
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c316d6dea2ba8ac8d3c53151855a4cff64e68a07
| 90
|
py
|
Python
|
bala.py
|
Jonathan339/Asteroid
|
e134fb1a06d20230212e4c0a0965345d414acdec
|
[
"MIT"
] | null | null | null |
bala.py
|
Jonathan339/Asteroid
|
e134fb1a06d20230212e4c0a0965345d414acdec
|
[
"MIT"
] | null | null | null |
bala.py
|
Jonathan339/Asteroid
|
e134fb1a06d20230212e4c0a0965345d414acdec
|
[
"MIT"
] | null | null | null |
class Bala:
def __init__(self):
self.image
self.rect = self.image.get_rect(x=x, y=y)
| 18
| 43
| 0.688889
| 17
| 90
| 3.352941
| 0.588235
| 0.315789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155556
| 90
| 4
| 44
| 22.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c33dbcbfcdcd1fbf5208ee4c7d9047f62a25372f
| 2,232
|
py
|
Python
|
passwordlock_1.py
|
Anabella1109/Password-Lock
|
3b4dcad6b64d8392504e68e28bb98c8f318def66
|
[
"Unlicense"
] | null | null | null |
passwordlock_1.py
|
Anabella1109/Password-Lock
|
3b4dcad6b64d8392504e68e28bb98c8f318def66
|
[
"Unlicense"
] | null | null | null |
passwordlock_1.py
|
Anabella1109/Password-Lock
|
3b4dcad6b64d8392504e68e28bb98c8f318def66
|
[
"Unlicense"
] | null | null | null |
import random
class Credentials:
'''
Class that generates new instances for acount credentials
'''
credentials_list=[]
# password_list=[a,,b,c,d,e,f]
def __init__(self,account_name,username,password):
'''
__init__ method that helps us define properties for our objects.
Args:
account_name: New account name
username : New account username
password: New account password
'''
self.account_name=account_name
self.username=username
self.password=password
def save_credentials(self):
'''
save_credentials method saves credentials objects into credentials_list
'''
Credentials.credentials_list.append(self)
def delete_credentials(self):
'''
delete_credentials method deletes saved credentials from the credentials_list
'''
Credentials.credentials_list.remove(self)
# def generate_password(self):
# '''
# generate_password methods generates a random password for the user
# '''
@classmethod
def find_by_accountname(cls,accountname):
'''
Method that takes in a name of an account and returns credentials that matches that account name.
Args:
accountname: account to search for
Returns :
Credentials of person that matches the account name.
'''
for account in cls.credentials_list:
if account.account_name == accountname:
return account
@classmethod
def credentials_exist(cls,accountname):
'''
Method that checks if a credentials exists from the credentials list.
Args:
number: Account name to search if it exists
Returns :
Boolean: True or false depending if the credentials exist
'''
for account in cls.credentials_list:
if account.account_name == accountname:
return True
return False
@classmethod
def display_credentials(cls):
'''
method that returns the credentials list
'''
return cls.credentials_list
| 27.555556
| 105
| 0.610663
| 233
| 2,232
| 5.708155
| 0.313305
| 0.112782
| 0.058647
| 0.055639
| 0.162406
| 0.100752
| 0.100752
| 0.100752
| 0.100752
| 0.100752
| 0
| 0
| 0.327957
| 2,232
| 81
| 106
| 27.555556
| 0.886667
| 0.439964
| 0
| 0.28
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.24
| false
| 0.08
| 0.04
| 0
| 0.52
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
c357f6ae7bee9431ac3ff6ba1f0174bf1561f36f
| 150
|
py
|
Python
|
tests/fixtures/bar_buc_command.py
|
rominf/cleo
|
72f6a8a19f26eefc32c3fcf9844484fc9a38583f
|
[
"MIT"
] | null | null | null |
tests/fixtures/bar_buc_command.py
|
rominf/cleo
|
72f6a8a19f26eefc32c3fcf9844484fc9a38583f
|
[
"MIT"
] | null | null | null |
tests/fixtures/bar_buc_command.py
|
rominf/cleo
|
72f6a8a19f26eefc32c3fcf9844484fc9a38583f
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from cleo.commands import Command
class BarBucCommand(Command):
def configure(self):
self.set_name('bar:buc')
| 15
| 33
| 0.653333
| 19
| 150
| 5.105263
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008333
| 0.2
| 150
| 9
| 34
| 16.666667
| 0.8
| 0.14
| 0
| 0
| 0
| 0
| 0.055118
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
c369221081db946d5f163231d9fc70c357679ed1
| 67
|
py
|
Python
|
rouse/response.py
|
baifei2014/crawl
|
2f6c1bb210b5f98f3ab60952184565aac6efc12e
|
[
"MIT"
] | 14
|
2019-11-29T03:18:23.000Z
|
2020-04-07T20:25:19.000Z
|
rouse/response.py
|
baifei2014/crawl
|
2f6c1bb210b5f98f3ab60952184565aac6efc12e
|
[
"MIT"
] | null | null | null |
rouse/response.py
|
baifei2014/crawl
|
2f6c1bb210b5f98f3ab60952184565aac6efc12e
|
[
"MIT"
] | null | null | null |
from dss.Serializer import serializer
class Response(object):
| 11.166667
| 37
| 0.776119
| 8
| 67
| 6.5
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164179
| 67
| 5
| 38
| 13.4
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
5eda8eabc5de0cf904805a2cf5c45813647c66a4
| 29
|
py
|
Python
|
mysql-utilities-1.6.0/mysql/utilities/common/__init__.py
|
bopopescu/mysql-dbcompare
|
1e912fd87282be3b3bed48487e6beb0ecb1de339
|
[
"Apache-2.0"
] | 2
|
2018-03-20T07:42:58.000Z
|
2018-03-20T07:43:49.000Z
|
mysql-utilities-1.6.0/mysql/utilities/common/__init__.py
|
bopopescu/mysql-dbcompare
|
1e912fd87282be3b3bed48487e6beb0ecb1de339
|
[
"Apache-2.0"
] | null | null | null |
mysql-utilities-1.6.0/mysql/utilities/common/__init__.py
|
bopopescu/mysql-dbcompare
|
1e912fd87282be3b3bed48487e6beb0ecb1de339
|
[
"Apache-2.0"
] | 1
|
2020-07-23T23:07:08.000Z
|
2020-07-23T23:07:08.000Z
|
"""mysql.utilities.common"""
| 14.5
| 28
| 0.689655
| 3
| 29
| 6.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 29
| 1
| 29
| 29
| 0.714286
| 0.758621
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5edbd9d64db4ed4794a28a03ca8ca3b9f03c79fe
| 199
|
py
|
Python
|
src/app/server.py
|
procrastination-team/boombox.api
|
7ace839bfdd4c5fe0eaa5b7cbcef4f627673859b
|
[
"MIT"
] | null | null | null |
src/app/server.py
|
procrastination-team/boombox.api
|
7ace839bfdd4c5fe0eaa5b7cbcef4f627673859b
|
[
"MIT"
] | 11
|
2021-11-24T18:49:17.000Z
|
2021-12-21T14:31:57.000Z
|
src/app/server.py
|
procrastination-team/boombox.api
|
7ace839bfdd4c5fe0eaa5b7cbcef4f627673859b
|
[
"MIT"
] | null | null | null |
import uvicorn
from utils.log import get_uvicorn_config
from .main import app
def run_server(port: int):
uvicorn.run(app, host="0.0.0.0", port=port, log_config=get_uvicorn_config())
| 19.9
| 81
| 0.718593
| 33
| 199
| 4.151515
| 0.484848
| 0.043796
| 0.233577
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024242
| 0.170854
| 199
| 9
| 82
| 22.111111
| 0.806061
| 0
| 0
| 0
| 0
| 0
| 0.036842
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.6
| 0
| 0.8
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
5ee18efbf67a1e63a606f38350d5d23249cfaaef
| 183
|
py
|
Python
|
Save Model/load_model.py
|
Shubbair/machine-learning
|
93292911dd9fa526106b355e7c220153af263535
|
[
"MIT"
] | null | null | null |
Save Model/load_model.py
|
Shubbair/machine-learning
|
93292911dd9fa526106b355e7c220153af263535
|
[
"MIT"
] | null | null | null |
Save Model/load_model.py
|
Shubbair/machine-learning
|
93292911dd9fa526106b355e7c220153af263535
|
[
"MIT"
] | null | null | null |
"""
*** Hussain Salih Mahdi ***
_________Shubbair__________
TODO Load a model
"""
import joblib
house_model = joblib.load('house_model')
print(house_model.predict([[5000]]))
| 13.071429
| 40
| 0.704918
| 21
| 183
| 5.095238
| 0.666667
| 0.280374
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025641
| 0.147541
| 183
| 13
| 41
| 14.076923
| 0.660256
| 0.415301
| 0
| 0
| 0
| 0
| 0.114583
| 0
| 0
| 0
| 0
| 0.076923
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
5ef50aeb84019d260900de58d8452a1e5bb7e665
| 49
|
py
|
Python
|
fibonacci_serie.py
|
bssayla/something
|
beb550fa9867567dd77d009aa7766d1d5abb2f5e
|
[
"Unlicense"
] | 2
|
2021-01-27T06:11:52.000Z
|
2021-05-10T22:46:53.000Z
|
fibonacci_serie.py
|
bssayla/something
|
beb550fa9867567dd77d009aa7766d1d5abb2f5e
|
[
"Unlicense"
] | null | null | null |
fibonacci_serie.py
|
bssayla/something
|
beb550fa9867567dd77d009aa7766d1d5abb2f5e
|
[
"Unlicense"
] | null | null | null |
a=0
b=1
while (True):
a,b=b,a+b
print(a)
| 8.166667
| 13
| 0.489796
| 13
| 49
| 1.846154
| 0.538462
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057143
| 0.285714
| 49
| 5
| 14
| 9.8
| 0.628571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.2
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6f0aa528b4b8a3288c90ecba6ebb50d2787533dc
| 261
|
py
|
Python
|
app/views/models/sessions.py
|
zhiyong-lv/flask-login
|
d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63
|
[
"MIT"
] | null | null | null |
app/views/models/sessions.py
|
zhiyong-lv/flask-login
|
d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63
|
[
"MIT"
] | null | null | null |
app/views/models/sessions.py
|
zhiyong-lv/flask-login
|
d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63
|
[
"MIT"
] | null | null | null |
from flask_restplus import Model, fields
session_json = Model('Session Input', {
'username': fields.String(required=True, description='The user name', attribute='username'),
'password': fields.String(required=True, description='The user password'),
})
| 37.285714
| 96
| 0.739464
| 31
| 261
| 6.16129
| 0.612903
| 0.125654
| 0.209424
| 0.251309
| 0.439791
| 0.439791
| 0.439791
| 0
| 0
| 0
| 0
| 0
| 0.118774
| 261
| 6
| 97
| 43.5
| 0.830435
| 0
| 0
| 0
| 0
| 0
| 0.256705
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.2
| 0.2
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
6f0d0757698c480899eb52326f372a63d0e95c72
| 32
|
py
|
Python
|
Taekwon/Python/baseGrammar/codeup052.py
|
sonnysorry/codingtest
|
478e0168e3209eb97b6b16910027bf12ccc3ccd0
|
[
"MIT"
] | 2
|
2021-09-27T19:10:36.000Z
|
2021-11-09T05:40:39.000Z
|
Taekwon/Python/baseGrammar/codeup052.py
|
sonnysorry/codingtest
|
478e0168e3209eb97b6b16910027bf12ccc3ccd0
|
[
"MIT"
] | 1
|
2021-11-15T14:56:54.000Z
|
2021-11-15T14:56:54.000Z
|
Taekwon/Python/baseGrammar/codeup052.py
|
sonnysorry/codingtest
|
478e0168e3209eb97b6b16910027bf12ccc3ccd0
|
[
"MIT"
] | null | null | null |
n = int(input())
print(bool(n))
| 10.666667
| 16
| 0.59375
| 6
| 32
| 3.166667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 32
| 2
| 17
| 16
| 0.678571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 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
| 1
|
0
| 4
|
6f321d32c1a1f9716efb1fce076593f7c41533b0
| 230
|
py
|
Python
|
lib/eco/__init__.py
|
Existever/PyCFTrackers
|
3221e47aecca40de21ad9be875b2f8d960b4e09c
|
[
"MIT"
] | 231
|
2019-04-01T08:04:40.000Z
|
2020-02-19T10:16:12.000Z
|
lib/eco/__init__.py
|
Existever/PyCFTrackers
|
3221e47aecca40de21ad9be875b2f8d960b4e09c
|
[
"MIT"
] | 18
|
2020-04-17T03:52:02.000Z
|
2021-10-15T13:36:46.000Z
|
lib/eco/__init__.py
|
Existever/PyCFTrackers
|
3221e47aecca40de21ad9be875b2f8d960b4e09c
|
[
"MIT"
] | 63
|
2020-02-24T15:21:12.000Z
|
2022-03-26T21:44:40.000Z
|
from .tracker import ECOTracker
from .scale_filter import ScaleFilter
from .optimize_score import optimize_score
from .sample_space_model import GMM
from .train import *
from .config import gpu_config
from .fourier_tools import *
| 28.75
| 42
| 0.83913
| 33
| 230
| 5.636364
| 0.545455
| 0.139785
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121739
| 230
| 7
| 43
| 32.857143
| 0.920792
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6f402c1af305c7924e0cf51ca3dfe345f4e42f5f
| 226
|
py
|
Python
|
src/python/competition/client/__init__.py
|
miyamotok0105/Mario_AI_Competition2009
|
2fb527b45c9590deabb781f2959e458bc3882b72
|
[
"MIT"
] | 1
|
2020-12-22T03:46:18.000Z
|
2020-12-22T03:46:18.000Z
|
src/python/competition/client/__init__.py
|
miyamotok0105/Mario_AI_Competition2009
|
2fb527b45c9590deabb781f2959e458bc3882b72
|
[
"MIT"
] | null | null | null |
src/python/competition/client/__init__.py
|
miyamotok0105/Mario_AI_Competition2009
|
2fb527b45c9590deabb781f2959e458bc3882b72
|
[
"MIT"
] | 3
|
2020-11-22T11:49:41.000Z
|
2020-12-07T02:21:27.000Z
|
__author__="Sergey Karakovskiy, sergey at idsia fullstop ch"
__date__ ="$May 13, 2009 12:17:14 AM$"
from environment import Environment
from tcpenvironment import TCPEnvironment
from marioenvironment import MarioEnvironment
| 28.25
| 60
| 0.827434
| 28
| 226
| 6.392857
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.060302
| 0.119469
| 226
| 7
| 61
| 32.285714
| 0.839196
| 0
| 0
| 0
| 0
| 0
| 0.324444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6f4cbfe6639dc5c70fe6ae80c7ce86c5afa38295
| 93
|
py
|
Python
|
session02/redsocial/apps.py
|
Ngynx/Django-Projects
|
b9117eecb08b8517017c16b0303426c59b7fb482
|
[
"MIT"
] | null | null | null |
session02/redsocial/apps.py
|
Ngynx/Django-Projects
|
b9117eecb08b8517017c16b0303426c59b7fb482
|
[
"MIT"
] | null | null | null |
session02/redsocial/apps.py
|
Ngynx/Django-Projects
|
b9117eecb08b8517017c16b0303426c59b7fb482
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class RedsocialConfig(AppConfig):
name = 'redsocial'
| 15.5
| 33
| 0.763441
| 10
| 93
| 7.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16129
| 93
| 5
| 34
| 18.6
| 0.910256
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6f5798fcd7a673d7a8e11ee3893164b7a7d82bd6
| 41
|
py
|
Python
|
5_Sorting_And_Searching/merge_sort.py
|
AnthonyRChao/Problem-Solving-With-Algorithms-And-Data-Structures
|
be29b46b9f4e579644ca2d44675c0ce7dcb29b3b
|
[
"MIT"
] | 6
|
2020-09-28T08:18:01.000Z
|
2022-01-15T19:38:38.000Z
|
5_Sorting_And_Searching/merge_sort.py
|
AnthonyRChao/Problem-Solving-With-Algorithms-And-Data-Structures
|
be29b46b9f4e579644ca2d44675c0ce7dcb29b3b
|
[
"MIT"
] | null | null | null |
5_Sorting_And_Searching/merge_sort.py
|
AnthonyRChao/Problem-Solving-With-Algorithms-And-Data-Structures
|
be29b46b9f4e579644ca2d44675c0ce7dcb29b3b
|
[
"MIT"
] | 3
|
2020-09-28T08:18:05.000Z
|
2021-04-24T21:22:28.000Z
|
"""
Implement a merge sort function.
"""
| 10.25
| 32
| 0.658537
| 5
| 41
| 5.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170732
| 41
| 3
| 33
| 13.666667
| 0.794118
| 0.780488
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6f5f58af266018bfe6619ca4e0e9b965c1a0e583
| 1,028
|
py
|
Python
|
credentials.py
|
Vector254/Password-locker
|
fd2b60d175a585bd9c73c117071a0434827facf0
|
[
"MIT"
] | null | null | null |
credentials.py
|
Vector254/Password-locker
|
fd2b60d175a585bd9c73c117071a0434827facf0
|
[
"MIT"
] | null | null | null |
credentials.py
|
Vector254/Password-locker
|
fd2b60d175a585bd9c73c117071a0434827facf0
|
[
"MIT"
] | null | null | null |
class Credentials:
"""Class that generates new instances of credentials"""
credentials_list=[]
def __init__(self,account,username,password):
"""define properties for our objects."""
"""object instantiaton"""
self.account= account
self.username = username
self.password = password
"""function to add a new account to the credentials list"""
def save_credential(self):
Credentials.credentials_list.append(self)
"""function to display all available accounts"""
def display_credential():
"""
method that returns the credential array
"""
return Credentials.credentials_list
def del_account(credential):
Credentials.credentials_list.remove(credential)
return credential
def find_account(account):
for credential in Credentials.credentials_list:
if credential.account == account:
return credential
| 26.358974
| 67
| 0.618677
| 98
| 1,028
| 6.357143
| 0.428571
| 0.144462
| 0.208668
| 0.093098
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.303502
| 1,028
| 39
| 68
| 26.358974
| 0.870112
| 0.121595
| 0
| 0.117647
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.294118
| false
| 0.117647
| 0
| 0
| 0.588235
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
6f734b89eab0829dfdfcbda44b3e3cc9d7ed2e07
| 161
|
py
|
Python
|
dqn_zoo/constants.py
|
amarack/dqn_zoo
|
8d960fd37bd6dcf9dfd9fa87316630e78eb42350
|
[
"Apache-2.0"
] | null | null | null |
dqn_zoo/constants.py
|
amarack/dqn_zoo
|
8d960fd37bd6dcf9dfd9fa87316630e78eb42350
|
[
"Apache-2.0"
] | null | null | null |
dqn_zoo/constants.py
|
amarack/dqn_zoo
|
8d960fd37bd6dcf9dfd9fa87316630e78eb42350
|
[
"Apache-2.0"
] | 1
|
2021-11-18T10:23:11.000Z
|
2021-11-18T10:23:11.000Z
|
NO_PENALTY = 'no_penalty'
HARD_CODED_PENALTY = 'hard_coded_penalty'
UNCERTAINTY_PENALTY = 'uncertainty_penalty'
POLICY_ENTROPY_PENALTY = 'policy_entropy_penalty'
| 40.25
| 49
| 0.857143
| 20
| 161
| 6.3
| 0.35
| 0.142857
| 0.253968
| 0.365079
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068323
| 161
| 4
| 49
| 40.25
| 0.84
| 0
| 0
| 0
| 0
| 0
| 0.425926
| 0.135802
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 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
| 4
|
488a71ce7275702b27474b80f62b6ac1df62d39b
| 50
|
py
|
Python
|
databases/seeds/__init__.py
|
vaibhavmule/sponsors
|
70256e14404e920087f291b0577477652ed4ab26
|
[
"MIT"
] | 95
|
2018-02-22T23:54:00.000Z
|
2021-04-17T03:39:21.000Z
|
databases/seeds/__init__.py
|
vaibhavmule/sponsors
|
70256e14404e920087f291b0577477652ed4ab26
|
[
"MIT"
] | 840
|
2018-01-27T04:26:20.000Z
|
2021-01-24T12:28:58.000Z
|
databases/seeds/__init__.py
|
vaibhavmule/sponsors
|
70256e14404e920087f291b0577477652ed4ab26
|
[
"MIT"
] | 100
|
2018-02-23T00:19:55.000Z
|
2020-08-28T07:59:31.000Z
|
import os
import sys
sys.path.append(os.getcwd())
| 12.5
| 28
| 0.76
| 9
| 50
| 4.222222
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 50
| 3
| 29
| 16.666667
| 0.844444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
488d6f444d0deb176644334d8077164b7b4e1aae
| 614
|
py
|
Python
|
SVM/svm_solution.py
|
AxoyTO/ML-DL-DS-Python-Studies
|
ffef653190d1106e01244a4ea7f3f953b9d97882
|
[
"Unlicense"
] | null | null | null |
SVM/svm_solution.py
|
AxoyTO/ML-DL-DS-Python-Studies
|
ffef653190d1106e01244a4ea7f3f953b9d97882
|
[
"Unlicense"
] | null | null | null |
SVM/svm_solution.py
|
AxoyTO/ML-DL-DS-Python-Studies
|
ffef653190d1106e01244a4ea7f3f953b9d97882
|
[
"Unlicense"
] | 1
|
2021-12-08T13:00:41.000Z
|
2021-12-08T13:00:41.000Z
|
import numpy as np
from sklearn.svm import SVC
def train_svm_and_predict(train_features, train_target, test_features):
"""
train_features: np.array, (num_elements_train x num_features) - train data description, the same features and the same order as in train data
train_target: np.array, (num_elements_train) - train data target
test_features: np.array, (num_elements_test x num_features) -- some test data, features are in the same order as train features
return: np.array, (num_elements_test) - test data predicted target, 1d array
"""
return np.ones(test_features.shape[0])
| 40.933333
| 145
| 0.750814
| 95
| 614
| 4.642105
| 0.347368
| 0.063492
| 0.090703
| 0.163265
| 0.240363
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003945
| 0.174267
| 614
| 14
| 146
| 43.857143
| 0.865878
| 0.67101
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
4890bdfff154ea5a8a8d6bb68bcb66dfc8039907
| 147
|
py
|
Python
|
Week1/7. Euclid's division to get greatest common denominator.py
|
HawkingLaugh/Data-Processing-Using-Python
|
6c4d7e09317aee41684731d5611f2f0dab217b2b
|
[
"MIT"
] | null | null | null |
Week1/7. Euclid's division to get greatest common denominator.py
|
HawkingLaugh/Data-Processing-Using-Python
|
6c4d7e09317aee41684731d5611f2f0dab217b2b
|
[
"MIT"
] | null | null | null |
Week1/7. Euclid's division to get greatest common denominator.py
|
HawkingLaugh/Data-Processing-Using-Python
|
6c4d7e09317aee41684731d5611f2f0dab217b2b
|
[
"MIT"
] | null | null | null |
x = eval(input('x = '))
y = eval(input('y = '))
if x < y:
x, y = y, x
while x % y != 0:
r = x % y
x = y
y = r
print('result = ', y)
| 16.333333
| 23
| 0.387755
| 29
| 147
| 1.965517
| 0.344828
| 0.210526
| 0.105263
| 0.140351
| 0.175439
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01087
| 0.37415
| 147
| 9
| 24
| 16.333333
| 0.608696
| 0
| 0
| 0
| 0
| 0
| 0.114865
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.111111
| 1
| 0
| 1
| 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
| 4
|
48b69695bf08e6464bb695b2fb4086569ec20b88
| 142
|
py
|
Python
|
Desafios/desafio_014.py
|
romulogoleniesky/Python_C_E_V
|
2dcf5fb3505a20443788a284c52114c6434118ce
|
[
"MIT"
] | null | null | null |
Desafios/desafio_014.py
|
romulogoleniesky/Python_C_E_V
|
2dcf5fb3505a20443788a284c52114c6434118ce
|
[
"MIT"
] | null | null | null |
Desafios/desafio_014.py
|
romulogoleniesky/Python_C_E_V
|
2dcf5fb3505a20443788a284c52114c6434118ce
|
[
"MIT"
] | null | null | null |
# Conversão de temperatura:
temp = float(input("Digite uma temperatura em °C: "))
print(f'A temperatura de {temp}°C é {(temp * 9/5) + 32}°F')
| 35.5
| 59
| 0.661972
| 27
| 142
| 3.592593
| 0.666667
| 0.041237
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 0.15493
| 142
| 3
| 60
| 47.333333
| 0.75
| 0.176056
| 0
| 0
| 0
| 0
| 0.686957
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
48c9b934eb1e8a48f0cb3886aeb4a8eeb6361100
| 4,335
|
py
|
Python
|
app/utility/terminal.py
|
venturiscm/hcp
|
74ad18180822301274daa9218d7bd9fbdb7807f7
|
[
"Apache-2.0"
] | 1
|
2020-06-22T21:25:52.000Z
|
2020-06-22T21:25:52.000Z
|
app/utility/terminal.py
|
venturiscm/hcp
|
74ad18180822301274daa9218d7bd9fbdb7807f7
|
[
"Apache-2.0"
] | 1
|
2020-05-21T02:46:24.000Z
|
2020-05-25T07:19:23.000Z
|
app/utility/terminal.py
|
venturiscm/hcp
|
74ad18180822301274daa9218d7bd9fbdb7807f7
|
[
"Apache-2.0"
] | null | null | null |
from zoneinfo import ZoneInfo
from django.conf import settings
from .runtime import Runtime
import sys
import re
import colorful
def colorize_data(data):
if isinstance(data, dict):
for key, value in data.items():
data[key] = colorize_data(value)
elif isinstance(data, (list, tuple)):
data = list(data)
for index, value in enumerate(data):
data[index] = colorize_data(value)
elif isinstance(data, str):
try:
return colorful.format(data)
except Exception as e:
pass
return data
class TerminalMixin(object):
def exit(self, code = 0):
sys.exit(code)
def format_time(self, date_time, format = "%Y-%m-%d %I:%M:%S %p"):
return date_time.astimezone(ZoneInfo(settings.TIME_ZONE)).strftime(format)
def print(self, message = '', stream = sys.stdout):
with settings.DISPLAY_LOCK:
plain_text = self.raw_text(message)
if Runtime.color() and plain_text != message:
try:
colorful.print(message, file = stream)
except Exception:
stream.write(plain_text + "\n")
else:
stream.write(plain_text + "\n")
def raw_text(self, message):
message = re.sub(r'\{c\.[^\}]+\}', '', message)
return message
def style(self, style, message = None, func = True):
def _format(output):
if Runtime.color():
output = re.sub(r'([\{\}])', r'\1\1', str(output))
lines = []
for line in output.split("\n"):
lines.append('{c.' + style + '}' + line + '{c.reset}')
return "\n".join(lines)
else:
return output
if not func or message is not None:
return _format(str(message))
else:
return _format
def yellow(self, message = None, func = True):
return self.style('yellow', message, func)
def orange(self, message = None, func = True):
return self.style('orange', message, func)
def red(self, message = None, func = True):
return self.style('red', message, func)
def magenta(self, message = None, func = True):
return self.style('magenta', message, func)
def violet(self, message = None, func = True):
return self.style('violet', message, func)
def blue(self, message = None, func = True):
return self.style('blue', message, func)
def cyan(self, message = None, func = True):
return self.style('cyan', message, func)
def green(self, message = None, func = True):
return self.style('green', message, func)
def command_color(self, message = None, func = True):
return self.style(settings.COMMAND_COLOR, message, func)
def header_color(self, message = None, func = True):
return self.style(settings.HEADER_COLOR, message, func)
def key_color(self, message = None, func = True):
return self.style(settings.KEY_COLOR, message, func)
def value_color(self, message = None, func = True):
return self.style(settings.VALUE_COLOR, message, func)
def encrypted_color(self, message = None, func = True):
return self.style(settings.ENCRYPTED_COLOR, message, func)
def dynamic_color(self, message = None, func = True):
return self.style(settings.DYNAMIC_COLOR, message, func)
def relation_color(self, message = None, func = True):
return self.style(settings.RELATION_COLOR, message, func)
def prefix_color(self, message = None, func = True):
return self.style(settings.PREFIX_COLOR, message, func)
def success_color(self, message = None, func = True):
return self.style(settings.SUCCESS_COLOR, message, func)
def notice_color(self, message = None, func = True):
return self.style(settings.NOTICE_COLOR, message, func)
def warning_color(self, message = None, func = True):
return self.style(settings.WARNING_COLOR, message, func)
def error_color(self, message = None, func = True):
return self.style(settings.ERROR_COLOR, message, func)
def traceback_color(self, message = None, func = True):
return self.style(settings.TRACEBACK_COLOR, message, func)
| 32.350746
| 82
| 0.609919
| 535
| 4,335
| 4.861682
| 0.198131
| 0.09727
| 0.126874
| 0.160707
| 0.41484
| 0.398693
| 0.37178
| 0.37178
| 0.254902
| 0.254902
| 0
| 0.000949
| 0.27105
| 4,335
| 133
| 83
| 32.593985
| 0.822152
| 0
| 0
| 0.074468
| 0
| 0
| 0.024683
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.297872
| false
| 0.010638
| 0.06383
| 0.234043
| 0.680851
| 0.021277
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
48da3edc55edf95801a409e24f82cd03c46fa499
| 180
|
py
|
Python
|
mininetlab/test_ovs_afxdp.py
|
bobuhiro11/mininetlab
|
07c90ee8cdd6a0db66661ad103507a1aaef8f43a
|
[
"MIT"
] | 5
|
2021-07-12T15:50:40.000Z
|
2022-03-04T15:23:56.000Z
|
mininetlab/test_ovs_afxdp.py
|
bobuhiro11/mininetlab
|
07c90ee8cdd6a0db66661ad103507a1aaef8f43a
|
[
"MIT"
] | null | null | null |
mininetlab/test_ovs_afxdp.py
|
bobuhiro11/mininetlab
|
07c90ee8cdd6a0db66661ad103507a1aaef8f43a
|
[
"MIT"
] | null | null | null |
import unittest
from mininetlab.ovs_afxdp import run
class TestRun(unittest.TestCase):
def test_run(self):
loss_rate = run()
self.assertEqual(0.0, loss_rate)
| 20
| 40
| 0.705556
| 25
| 180
| 4.92
| 0.68
| 0.113821
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013986
| 0.205556
| 180
| 8
| 41
| 22.5
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
48e9bed1a31581adb6fb010b800dd2c01d010a95
| 89
|
py
|
Python
|
pymba/__init__.py
|
sudheerExperiments/pymba
|
3284016df2b110e69493f45a19daef902005d9c3
|
[
"MIT"
] | null | null | null |
pymba/__init__.py
|
sudheerExperiments/pymba
|
3284016df2b110e69493f45a19daef902005d9c3
|
[
"MIT"
] | null | null | null |
pymba/__init__.py
|
sudheerExperiments/pymba
|
3284016df2b110e69493f45a19daef902005d9c3
|
[
"MIT"
] | null | null | null |
from .vimba import Vimba, VimbaException
from .frame import Frame
__version__ = '0.3.4'
| 17.8
| 40
| 0.764045
| 13
| 89
| 4.923077
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.039474
| 0.146067
| 89
| 4
| 41
| 22.25
| 0.802632
| 0
| 0
| 0
| 0
| 0
| 0.05618
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
48f084f5d73a645d904ad689de7aa76d307971a7
| 224
|
py
|
Python
|
evalml/preprocessing/data_splitters/__init__.py
|
RG4421/evalml
|
33c62abe6d107d1da2f54e9e44a90f18aaf916a9
|
[
"BSD-3-Clause"
] | null | null | null |
evalml/preprocessing/data_splitters/__init__.py
|
RG4421/evalml
|
33c62abe6d107d1da2f54e9e44a90f18aaf916a9
|
[
"BSD-3-Clause"
] | 13
|
2021-03-04T19:29:09.000Z
|
2022-03-07T01:00:43.000Z
|
evalml/preprocessing/data_splitters/__init__.py
|
RG4421/evalml
|
33c62abe6d107d1da2f54e9e44a90f18aaf916a9
|
[
"BSD-3-Clause"
] | null | null | null |
from .training_validation_split import TrainingValidationSplit
from .time_series_split import TimeSeriesSplit
from .balanced_classification_splitter import BalancedClassificationSampler
from .sampler_base import SamplerBase
| 44.8
| 75
| 0.910714
| 23
| 224
| 8.565217
| 0.695652
| 0.111675
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 224
| 4
| 76
| 56
| 0.947115
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d29faec739bdc00ea40569f3eb3d5e7531ca08d1
| 114
|
py
|
Python
|
eb_sqs/apps.py
|
rebotics/django-eb-sqs
|
10de0ebfca1de0bce3a300a4280f92649f10c97e
|
[
"MIT"
] | null | null | null |
eb_sqs/apps.py
|
rebotics/django-eb-sqs
|
10de0ebfca1de0bce3a300a4280f92649f10c97e
|
[
"MIT"
] | null | null | null |
eb_sqs/apps.py
|
rebotics/django-eb-sqs
|
10de0ebfca1de0bce3a300a4280f92649f10c97e
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class EbSqsConfig(AppConfig):
name = 'eb_sqs'
verbose_name = 'EB SQS'
| 16.285714
| 33
| 0.710526
| 15
| 114
| 5.266667
| 0.733333
| 0.151899
| 0.227848
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.201754
| 114
| 6
| 34
| 19
| 0.868132
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 1
| 0
| 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
| 1
| 0
|
0
| 4
|
d2bc237a95b3258f1a7bede6065ddf5da53dcd8a
| 413
|
py
|
Python
|
tests/test_colmet_collector.py
|
oar-team/colmet-collector
|
b962a84574093adfd4a1c1877277b96119d5fe77
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_colmet_collector.py
|
oar-team/colmet-collector
|
b962a84574093adfd4a1c1877277b96119d5fe77
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_colmet_collector.py
|
oar-team/colmet-collector
|
b962a84574093adfd4a1c1877277b96119d5fe77
|
[
"BSD-3-Clause"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_colmet_collector
----------------------------------
Tests for `colmet_collector` module.
"""
import unittest
from colmet_collector import colmet_collector
class TestColmetCollector(object):
@classmethod
def setup_class(cls):
pass
def test_something(self):
pass
@classmethod
def teardown_class(cls):
pass
| 14.241379
| 45
| 0.615012
| 43
| 413
| 5.72093
| 0.627907
| 0.243902
| 0.097561
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003077
| 0.213075
| 413
| 28
| 46
| 14.75
| 0.753846
| 0.331719
| 0
| 0.454545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0.272727
| 0.181818
| 0
| 0.545455
| 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
| 1
| 0
|
0
| 4
|
d2ff509e87d8b7f52defaee619e29e7278e5f322
| 56
|
py
|
Python
|
src/atomate2/vasp/sets/__init__.py
|
Zhuoying/atomate2
|
4501c8ff2a72243dee51afb17d93ecff426b3e8c
|
[
"BSD-3-Clause-LBNL"
] | 14
|
2021-09-24T05:18:02.000Z
|
2022-03-31T23:12:47.000Z
|
src/atomate2/vasp/sets/__init__.py
|
Zhuoying/atomate2
|
4501c8ff2a72243dee51afb17d93ecff426b3e8c
|
[
"BSD-3-Clause-LBNL"
] | 83
|
2021-11-02T17:19:57.000Z
|
2022-03-31T17:27:00.000Z
|
src/atomate2/vasp/sets/__init__.py
|
Zhuoying/atomate2
|
4501c8ff2a72243dee51afb17d93ecff426b3e8c
|
[
"BSD-3-Clause-LBNL"
] | 11
|
2021-11-19T09:50:45.000Z
|
2022-03-31T05:56:39.000Z
|
"""Module defining VASP input sets used in atomate2."""
| 28
| 55
| 0.732143
| 8
| 56
| 5.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020833
| 0.142857
| 56
| 1
| 56
| 56
| 0.833333
| 0.875
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
960007724a367b039c3b131b8d6eacc11c38786a
| 149
|
py
|
Python
|
news_crawler/news_crawler/items.py
|
guimaraescca/scrapy-examples
|
1d6d5d222f598719f37b1dea4347873ad719ad2d
|
[
"MIT"
] | null | null | null |
news_crawler/news_crawler/items.py
|
guimaraescca/scrapy-examples
|
1d6d5d222f598719f37b1dea4347873ad719ad2d
|
[
"MIT"
] | null | null | null |
news_crawler/news_crawler/items.py
|
guimaraescca/scrapy-examples
|
1d6d5d222f598719f37b1dea4347873ad719ad2d
|
[
"MIT"
] | null | null | null |
import scrapy
class NewsItem(scrapy.Item):
date = scrapy.Field()
title = scrapy.Field()
url = scrapy.Field()
text = scrapy.Field()
| 16.555556
| 28
| 0.637584
| 18
| 149
| 5.277778
| 0.555556
| 0.463158
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.228188
| 149
| 8
| 29
| 18.625
| 0.826087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
960f832fd3ae8fb15c7f803fd4847e0262718280
| 706
|
py
|
Python
|
Shishkin_Anatoliy_lesson_11/checker/__init__.py
|
amilykh/2074_GB_Python_1-
|
0112ad710154623ad1dafffbdb413caeff424813
|
[
"MIT"
] | 3
|
2022-01-17T20:38:22.000Z
|
2022-01-19T04:19:50.000Z
|
Shishkin_Anatoliy_lesson_11/checker/__init__.py
|
amilykh/2074_GB_Python_1-
|
0112ad710154623ad1dafffbdb413caeff424813
|
[
"MIT"
] | 5
|
2022-01-24T11:08:42.000Z
|
2022-03-03T00:15:22.000Z
|
Shishkin_Anatoliy_lesson_11/checker/__init__.py
|
amilykh/2074_GB_Python_1-
|
0112ad710154623ad1dafffbdb413caeff424813
|
[
"MIT"
] | 18
|
2022-01-18T05:56:00.000Z
|
2022-02-28T10:30:18.000Z
|
"""
Модуль checker предназначен для проверки доступности внешних сайтов
* Импортируйте через 'from checker import Checker'
* Инициализируйте объект `checker = Checker()
* Подготовьте словарь с данными по проверяемым ресурсами.
Формат словаря: data = {'Название': 'Адрес проверяемого ресурса', ...}
* Подготовьте чекер к работе с ресурсами 'cheker.prepare_app(data)'
* Запускайте автоматическую проверку всех ресурсов 'checker.get_info()'
* Лог ошибок отсматривайте в файле checker.log, который создаётся автоматически
на одном уровне местом хранения корневой директории модуля checker
"""
from .component.models import SiteInfo, Storage
from .models import Checker
| 47.066667
| 83
| 0.756374
| 79
| 706
| 6.734177
| 0.78481
| 0.048872
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175637
| 706
| 14
| 84
| 50.428571
| 0.914089
| 0.878187
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
825795a59164d2d424dfa95ff34576a76dedb07b
| 42
|
py
|
Python
|
examples/bool_op.py
|
doboy/Underscore
|
d98273db3144cda79191d2c90f45d81b6d700b1f
|
[
"MIT"
] | 7
|
2016-09-23T00:44:05.000Z
|
2021-10-04T21:19:12.000Z
|
examples/bool_op.py
|
jameswu1991/Underscore
|
d98273db3144cda79191d2c90f45d81b6d700b1f
|
[
"MIT"
] | 1
|
2016-09-23T00:45:05.000Z
|
2019-02-16T19:05:37.000Z
|
examples/bool_op.py
|
jameswu1991/Underscore
|
d98273db3144cda79191d2c90f45d81b6d700b1f
|
[
"MIT"
] | 3
|
2016-09-23T01:13:15.000Z
|
2018-07-20T21:22:17.000Z
|
x = False
y = 3
z = 9
print(x or y and z)
| 8.4
| 19
| 0.547619
| 12
| 42
| 1.916667
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 0.333333
| 42
| 4
| 20
| 10.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
82736a429b0e32268f61930af81df864ed824453
| 93
|
py
|
Python
|
deprecated/goal_util.py
|
djp42/IntentionPrediction
|
9f260133f4b649e446166775b54885147d78393c
|
[
"MIT"
] | 25
|
2019-02-21T18:47:11.000Z
|
2022-03-21T02:53:33.000Z
|
lib/goal_util.py
|
zhangzhangzf/IntentionPrediction
|
558a2c0487e23151624ff4b1f284f654860579cc
|
[
"MIT"
] | 6
|
2020-01-28T22:48:39.000Z
|
2022-02-10T00:12:09.000Z
|
lib/goal_util.py
|
zhangzhangzf/IntentionPrediction
|
558a2c0487e23151624ff4b1f284f654860579cc
|
[
"MIT"
] | 6
|
2018-07-11T08:38:42.000Z
|
2021-09-28T08:02:30.000Z
|
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 1 11:15:21 2016
@author: LordPhillips
"""
s
| 11.625
| 35
| 0.591398
| 15
| 93
| 3.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162162
| 0.204301
| 93
| 8
| 36
| 11.625
| 0.581081
| 0.870968
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
828127f6dc54c67f460746b06b25a1040daf6bc5
| 44
|
py
|
Python
|
text/_elisp/window/_op/display.py
|
jedhsu/text
|
8525b602d304ac571a629104c48703443244545c
|
[
"Apache-2.0"
] | null | null | null |
text/_elisp/window/_op/display.py
|
jedhsu/text
|
8525b602d304ac571a629104c48703443244545c
|
[
"Apache-2.0"
] | null | null | null |
text/_elisp/window/_op/display.py
|
jedhsu/text
|
8525b602d304ac571a629104c48703443244545c
|
[
"Apache-2.0"
] | null | null | null |
"""
Operators for displaying buffers.
"""
| 7.333333
| 33
| 0.659091
| 4
| 44
| 7.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 44
| 5
| 34
| 8.8
| 0.805556
| 0.75
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
829cb6816126c1d26b1b14b6403804c992c47ad6
| 43
|
py
|
Python
|
pepperbot/__init__.py
|
SSmJaE/PepperBot
|
0f34c90fc8f6d90fd8881193992d0dde756c2dde
|
[
"MIT"
] | 27
|
2021-03-26T16:17:38.000Z
|
2022-03-30T21:39:07.000Z
|
pepperbot/__init__.py
|
SSmJaE/PepperBot
|
0f34c90fc8f6d90fd8881193992d0dde756c2dde
|
[
"MIT"
] | null | null | null |
pepperbot/__init__.py
|
SSmJaE/PepperBot
|
0f34c90fc8f6d90fd8881193992d0dde756c2dde
|
[
"MIT"
] | 7
|
2021-05-27T17:28:37.000Z
|
2021-12-22T11:22:08.000Z
|
__version__ = "0.1.0"
from .main import *
| 10.75
| 21
| 0.651163
| 7
| 43
| 3.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085714
| 0.186047
| 43
| 3
| 22
| 14.333333
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0.116279
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
82bb10cb289063a12ba7730b3efa772eb7b9c4d1
| 2,145
|
py
|
Python
|
lenstools/utils/fft.py
|
asabyr/LensTools
|
e155d6d39361e550906cec00dbbc57686a4bca5c
|
[
"MIT"
] | 1
|
2021-04-27T02:03:11.000Z
|
2021-04-27T02:03:11.000Z
|
lenstools/utils/fft.py
|
asabyr/LensTools
|
e155d6d39361e550906cec00dbbc57686a4bca5c
|
[
"MIT"
] | null | null | null |
lenstools/utils/fft.py
|
asabyr/LensTools
|
e155d6d39361e550906cec00dbbc57686a4bca5c
|
[
"MIT"
] | null | null | null |
from __future__ import division
from abc import ABCMeta,abstractproperty,abstractmethod
import numpy as np
##############################################
###########FFTEngine abstract class###########
##############################################
class FFTEngine(object):
__metaclass__ = ABCMeta
"""
Class handler of Fourier transforms needed for lenstools computations
"""
#####################################################################
######################Abstract methods###############################
#####################################################################
@abstractmethod
def fft2(self,x):
pass
@abstractmethod
def ifft2(self,x):
pass
@abstractmethod
def rfft2(self,x):
pass
@abstractmethod
def irfft2(self,x):
pass
@abstractmethod
def rfftn(self,x):
pass
@abstractmethod
def irfftn(self,x):
pass
###################################################################################
######################Default, non--abstract methods###############################
###################################################################################
def fftfreq(self,n):
return np.fft.fftfreq(n)
def rfftfreq(self,n,d=1.0):
if not (isinstance(n,int)):
raise ValueError("n should be an integer")
val = 1.0/(n*d)
n_half = n//2 + 1
results = np.arange(0, n_half, dtype=int)
return results * val
##############################################
###########NUMPYFFTPack class#################
##############################################
class NUMPYFFTPack(FFTEngine):
###############################################################################################
#########################Abstract methods implementation#######################################
###############################################################################################
def fft2(self,x):
return np.fft.fft2(x)
def ifft2(self,x):
return np.fft.ifft2(x)
def rfft2(self,x):
return np.fft.rfft2(x)
def irfft2(self,x):
return np.fft.irfft2(x)
def rfftn(self,x):
return np.fft.rfftn(x)
def irfftn(self,x):
return np.fft.irfftn(x)
| 22.819149
| 96
| 0.402797
| 184
| 2,145
| 4.641304
| 0.342391
| 0.070258
| 0.090164
| 0.091335
| 0.264637
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009995
| 0.113753
| 2,145
| 93
| 97
| 23.064516
| 0.439243
| 0.055478
| 0
| 0.533333
| 0
| 0
| 0.020992
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.311111
| false
| 0.133333
| 0.066667
| 0.155556
| 0.622222
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 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
| 1
| 0
| 1
| 0
| 1
| 0
| 0
|
0
| 4
|
82d43e30f0a28b08269b15a6371c30a6607c5fb1
| 140
|
py
|
Python
|
pyalp/apps/music/admin.py
|
Mause/pyalp
|
fb0f723070e11f8c9ed57e2475eb963599f442a6
|
[
"MIT"
] | null | null | null |
pyalp/apps/music/admin.py
|
Mause/pyalp
|
fb0f723070e11f8c9ed57e2475eb963599f442a6
|
[
"MIT"
] | 2
|
2021-06-08T19:32:48.000Z
|
2022-03-11T23:17:45.000Z
|
pyalp/apps/music/admin.py
|
Mause/pyalp
|
fb0f723070e11f8c9ed57e2475eb963599f442a6
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from apps.music.models import Song, Vote
admin.site.register([Song, Vote])
| 17.5
| 40
| 0.771429
| 21
| 140
| 5.142857
| 0.666667
| 0.148148
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135714
| 140
| 7
| 41
| 20
| 0.892562
| 0.185714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
82dfd077d5358e7730a873236fe831a809a644f6
| 799
|
py
|
Python
|
app/models/__init__.py
|
Anioko/landingpage_cms
|
b2d68d28287dd163de7d420b2c20b19050a2326a
|
[
"MIT"
] | null | null | null |
app/models/__init__.py
|
Anioko/landingpage_cms
|
b2d68d28287dd163de7d420b2c20b19050a2326a
|
[
"MIT"
] | null | null | null |
app/models/__init__.py
|
Anioko/landingpage_cms
|
b2d68d28287dd163de7d420b2c20b19050a2326a
|
[
"MIT"
] | null | null | null |
"""
These imports enable us to make all defined models members of the models
module (as opposed to just their python files)
"""
from .user import * # noqa
from .miscellaneous import * # noqa
from .services import * # noqa
from .team import * # noqa
from .portfolio import * # noqa
from .about import * # noqa
from .contact import * # noqa
from .organisation import * # noqa
from .photo import * # noqa
from .logo import * # noqa
from .call2action import * # noqa
from .testimonial import * # noqa
from .social import * # noqa
from .tracking import * # noqa
from .html import * # noqa
from .brands import * # noqa
from .newslink import * # noqa
from .blog import * # noqa
from .orgstaff import * # noqa
from .teamsection import * # noqa
from .testimonialsection import * # noqa
| 29.592593
| 72
| 0.697121
| 105
| 799
| 5.304762
| 0.409524
| 0.37702
| 0.502693
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.001592
| 0.214018
| 799
| 26
| 73
| 30.730769
| 0.88535
| 0.281602
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
7d57a03d5d0b9eb620b5f123e03ecfc8fe13daf4
| 662
|
py
|
Python
|
env/lib/python3.5/site-packages/terminado/uimodule.py
|
riordan/who-owns-what
|
62538fdb6d40ed1e0cdafb0df388be95fb388907
|
[
"Apache-2.0"
] | 4
|
2018-01-19T17:15:06.000Z
|
2018-01-24T00:06:42.000Z
|
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/terminado/uimodule.py
|
nitin-cherian/LifeLongLearning
|
84084792058358365162c645742c70064a2d5fd6
|
[
"MIT"
] | 10
|
2017-07-13T00:24:03.000Z
|
2017-07-17T07:39:03.000Z
|
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/terminado/uimodule.py
|
nitin-cherian/LifeLongLearning
|
84084792058358365162c645742c70064a2d5fd6
|
[
"MIT"
] | 7
|
2017-08-01T04:02:07.000Z
|
2018-10-06T21:07:20.000Z
|
import os.path
import tornado.web
class Terminal(tornado.web.UIModule):
def render(self, ws_url, cols=80, rows=25):
return ('<div class="terminado-container" '
'data-ws-url="{ws_url}" '
'data-rows="{rows}" data-cols="{cols}"/>').format(
ws_url=ws_url, rows=rows, cols=cols)
def javascript_files(self):
# TODO: Can we calculate these dynamically?
return ['/xstatic/termjs/term.js', '/static/terminado.js']
def embedded_javascript(self):
file = os.path.join(os.path.dirname(__file__), 'uimod_embed.js')
with open(file) as f:
return f.read()
| 34.842105
| 72
| 0.595166
| 86
| 662
| 4.453488
| 0.546512
| 0.065274
| 0.036554
| 0.052219
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008114
| 0.255287
| 662
| 18
| 73
| 36.777778
| 0.768763
| 0.061934
| 0
| 0
| 0
| 0
| 0.245557
| 0.116317
| 0
| 0
| 0
| 0.055556
| 0
| 1
| 0.214286
| false
| 0
| 0.142857
| 0.142857
| 0.642857
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
7d9b8e0c84f08776bba6b7718f6f08413f10857f
| 10,717
|
py
|
Python
|
catkin_ws/devel/lib/python2.7/dist-packages/duckietown_msgs/msg/_LEDDetection.py
|
bendychua/final
|
35fd0477ec5950479f0e082a65db2aa05a92db82
|
[
"CC-BY-2.0"
] | 1
|
2019-05-13T00:40:11.000Z
|
2019-05-13T00:40:11.000Z
|
catkin_ws/devel/lib/python2.7/dist-packages/duckietown_msgs/msg/_LEDDetection.py
|
bendychua/final
|
35fd0477ec5950479f0e082a65db2aa05a92db82
|
[
"CC-BY-2.0"
] | null | null | null |
catkin_ws/devel/lib/python2.7/dist-packages/duckietown_msgs/msg/_LEDDetection.py
|
bendychua/final
|
35fd0477ec5950479f0e082a65db2aa05a92db82
|
[
"CC-BY-2.0"
] | null | null | null |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from duckietown_msgs/LEDDetection.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import duckietown_msgs.msg
import genpy
class LEDDetection(genpy.Message):
_md5sum = "d1ac8691d7a30e838dc372a724aee94b"
_type = "duckietown_msgs/LEDDetection"
_has_header = False #flag to mark the presence of a Header object
_full_text = """time timestamp1 # initial timestamp of the camera stream used
time timestamp2 # final timestamp of the camera stream used
Vector2D pixels_normalized
float32 frequency
string color # will be ‘r’, ‘g’ or ‘b’
float32 confidence # some value of confidence for the detection (TBD)
# for debug/visualization
float64[] signal_ts
float32[] signal
float32[] fft_fs
float32[] fft
================================================================================
MSG: duckietown_msgs/Vector2D
float32 x
float32 y
"""
__slots__ = ['timestamp1','timestamp2','pixels_normalized','frequency','color','confidence','signal_ts','signal','fft_fs','fft']
_slot_types = ['time','time','duckietown_msgs/Vector2D','float32','string','float32','float64[]','float32[]','float32[]','float32[]']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
timestamp1,timestamp2,pixels_normalized,frequency,color,confidence,signal_ts,signal,fft_fs,fft
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(LEDDetection, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.timestamp1 is None:
self.timestamp1 = genpy.Time()
if self.timestamp2 is None:
self.timestamp2 = genpy.Time()
if self.pixels_normalized is None:
self.pixels_normalized = duckietown_msgs.msg.Vector2D()
if self.frequency is None:
self.frequency = 0.
if self.color is None:
self.color = ''
if self.confidence is None:
self.confidence = 0.
if self.signal_ts is None:
self.signal_ts = []
if self.signal is None:
self.signal = []
if self.fft_fs is None:
self.fft_fs = []
if self.fft is None:
self.fft = []
else:
self.timestamp1 = genpy.Time()
self.timestamp2 = genpy.Time()
self.pixels_normalized = duckietown_msgs.msg.Vector2D()
self.frequency = 0.
self.color = ''
self.confidence = 0.
self.signal_ts = []
self.signal = []
self.fft_fs = []
self.fft = []
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_struct_4I3f.pack(_x.timestamp1.secs, _x.timestamp1.nsecs, _x.timestamp2.secs, _x.timestamp2.nsecs, _x.pixels_normalized.x, _x.pixels_normalized.y, _x.frequency))
_x = self.color
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
if python3:
buff.write(struct.pack('<I%sB'%length, length, *_x))
else:
buff.write(struct.pack('<I%ss'%length, length, _x))
buff.write(_struct_f.pack(self.confidence))
length = len(self.signal_ts)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.signal_ts))
length = len(self.signal)
buff.write(_struct_I.pack(length))
pattern = '<%sf'%length
buff.write(struct.pack(pattern, *self.signal))
length = len(self.fft_fs)
buff.write(_struct_I.pack(length))
pattern = '<%sf'%length
buff.write(struct.pack(pattern, *self.fft_fs))
length = len(self.fft)
buff.write(_struct_I.pack(length))
pattern = '<%sf'%length
buff.write(struct.pack(pattern, *self.fft))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
if self.timestamp1 is None:
self.timestamp1 = genpy.Time()
if self.timestamp2 is None:
self.timestamp2 = genpy.Time()
if self.pixels_normalized is None:
self.pixels_normalized = duckietown_msgs.msg.Vector2D()
end = 0
_x = self
start = end
end += 28
(_x.timestamp1.secs, _x.timestamp1.nsecs, _x.timestamp2.secs, _x.timestamp2.nsecs, _x.pixels_normalized.x, _x.pixels_normalized.y, _x.frequency,) = _struct_4I3f.unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
start = end
end += length
if python3:
self.color = str[start:end].decode('utf-8')
else:
self.color = str[start:end]
start = end
end += 4
(self.confidence,) = _struct_f.unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.signal_ts = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sf'%length
start = end
end += struct.calcsize(pattern)
self.signal = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sf'%length
start = end
end += struct.calcsize(pattern)
self.fft_fs = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sf'%length
start = end
end += struct.calcsize(pattern)
self.fft = struct.unpack(pattern, str[start:end])
self.timestamp1.canon()
self.timestamp2.canon()
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_struct_4I3f.pack(_x.timestamp1.secs, _x.timestamp1.nsecs, _x.timestamp2.secs, _x.timestamp2.nsecs, _x.pixels_normalized.x, _x.pixels_normalized.y, _x.frequency))
_x = self.color
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
if python3:
buff.write(struct.pack('<I%sB'%length, length, *_x))
else:
buff.write(struct.pack('<I%ss'%length, length, _x))
buff.write(_struct_f.pack(self.confidence))
length = len(self.signal_ts)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.signal_ts.tostring())
length = len(self.signal)
buff.write(_struct_I.pack(length))
pattern = '<%sf'%length
buff.write(self.signal.tostring())
length = len(self.fft_fs)
buff.write(_struct_I.pack(length))
pattern = '<%sf'%length
buff.write(self.fft_fs.tostring())
length = len(self.fft)
buff.write(_struct_I.pack(length))
pattern = '<%sf'%length
buff.write(self.fft.tostring())
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
if self.timestamp1 is None:
self.timestamp1 = genpy.Time()
if self.timestamp2 is None:
self.timestamp2 = genpy.Time()
if self.pixels_normalized is None:
self.pixels_normalized = duckietown_msgs.msg.Vector2D()
end = 0
_x = self
start = end
end += 28
(_x.timestamp1.secs, _x.timestamp1.nsecs, _x.timestamp2.secs, _x.timestamp2.nsecs, _x.pixels_normalized.x, _x.pixels_normalized.y, _x.frequency,) = _struct_4I3f.unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
start = end
end += length
if python3:
self.color = str[start:end].decode('utf-8')
else:
self.color = str[start:end]
start = end
end += 4
(self.confidence,) = _struct_f.unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.signal_ts = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sf'%length
start = end
end += struct.calcsize(pattern)
self.signal = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sf'%length
start = end
end += struct.calcsize(pattern)
self.fft_fs = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sf'%length
start = end
end += struct.calcsize(pattern)
self.fft = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
self.timestamp1.canon()
self.timestamp2.canon()
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
_struct_4I3f = struct.Struct("<4I3f")
_struct_f = struct.Struct("<f")
| 35.963087
| 189
| 0.632826
| 1,402
| 10,717
| 4.697575
| 0.139087
| 0.060735
| 0.043425
| 0.036137
| 0.721379
| 0.71652
| 0.684634
| 0.672335
| 0.655481
| 0.639994
| 0
| 0.019156
| 0.230382
| 10,717
| 297
| 190
| 36.084175
| 0.77934
| 0.123915
| 0
| 0.753036
| 1
| 0
| 0.104625
| 0.020362
| 0
| 0
| 0.001083
| 0
| 0
| 1
| 0.024292
| false
| 0
| 0.020243
| 0
| 0.08502
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7d9fb9312f0da12407b3b0f16de2751d5031c5bc
| 264
|
py
|
Python
|
game/khet/strategies/human_strategy.py
|
xelahalo/khet
|
c4aca94703c24c01d106959849240b890fa6744b
|
[
"MIT"
] | null | null | null |
game/khet/strategies/human_strategy.py
|
xelahalo/khet
|
c4aca94703c24c01d106959849240b890fa6744b
|
[
"MIT"
] | null | null | null |
game/khet/strategies/human_strategy.py
|
xelahalo/khet
|
c4aca94703c24c01d106959849240b890fa6744b
|
[
"MIT"
] | 1
|
2022-03-19T22:25:54.000Z
|
2022-03-19T22:25:54.000Z
|
from game.khet.strategies.strategy import Strategy
class HumanStrategy(Strategy):
def __init__(self, color, ui):
super().__init__(color)
self._ui = ui
def get_action(self, game):
return self._ui.get_action(self._color, game.board)
| 29.333333
| 59
| 0.689394
| 35
| 264
| 4.828571
| 0.514286
| 0.106509
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.200758
| 264
| 9
| 59
| 29.333333
| 0.800948
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 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
| 1
| 1
| 0
|
0
| 4
|
7dc51192c0f03a5b378a5cecc37357c4f3aa7d49
| 321
|
py
|
Python
|
rqalpha_backtest/test_update_bundle.py
|
stevenchen521/quant_ml
|
f7d5efc49c934724f97fcafacc560f4a35b24551
|
[
"MIT"
] | 5
|
2019-02-14T03:12:22.000Z
|
2022-01-24T18:43:07.000Z
|
rqalpha_backtest/test_update_bundle.py
|
stevenchen521/quant_ml
|
f7d5efc49c934724f97fcafacc560f4a35b24551
|
[
"MIT"
] | null | null | null |
rqalpha_backtest/test_update_bundle.py
|
stevenchen521/quant_ml
|
f7d5efc49c934724f97fcafacc560f4a35b24551
|
[
"MIT"
] | 2
|
2019-11-13T18:56:13.000Z
|
2021-12-31T01:25:22.000Z
|
import os
def test_update_bundle():
# os.system("activate python3.5")
# os.system("rqalpha update-bundle")
import rqalpha.utils.bundle_helper
rqalpha.utils.bundle_helper.update_bundle(data_bundle_path='D:\\rqalpha\data_bundle', locale="zh_Hans_CN")
if __name__ == '__main__':
test_update_bundle()
| 24.692308
| 110
| 0.735202
| 44
| 321
| 4.909091
| 0.522727
| 0.222222
| 0.148148
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007194
| 0.133956
| 321
| 12
| 111
| 26.75
| 0.769784
| 0.205607
| 0
| 0
| 0
| 0
| 0.162698
| 0.09127
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0.333333
| 0
| 0.5
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
7dcce6ea158df7d2bc5aa68e596ea5004bffabb4
| 490
|
py
|
Python
|
badge_earning/api/views.py
|
andela-Taiwo/Badge-Earning
|
8d9073b552410391b2b54b6c7b4a2e71ae0632eb
|
[
"MIT"
] | null | null | null |
badge_earning/api/views.py
|
andela-Taiwo/Badge-Earning
|
8d9073b552410391b2b54b6c7b4a2e71ae0632eb
|
[
"MIT"
] | null | null | null |
badge_earning/api/views.py
|
andela-Taiwo/Badge-Earning
|
8d9073b552410391b2b54b6c7b4a2e71ae0632eb
|
[
"MIT"
] | null | null | null |
from django.contrib.auth import get_user_model
# from rest_framework import status
# from rest_framework.decorators import action
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin, UpdateModelMixin
# from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
# from users.serializers import UserSerializer
User = get_user_model()
class UserViewSet(RetrieveModelMixin, ListModelMixin, UpdateModelMixin, GenericViewSet):
pass
| 28.823529
| 88
| 0.846939
| 55
| 490
| 7.381818
| 0.472727
| 0.098522
| 0.20936
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108163
| 490
| 16
| 89
| 30.625
| 0.929062
| 0.342857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.166667
| 0.5
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
7de103a6cb46bbd75ba4bc2d9428f101fdbedcdf
| 142
|
py
|
Python
|
lib/iana/ripe/__init__.py
|
sschwetz/network_tech
|
fc65166e71bfdb5a0e99ca7e7ce9f7814b92869b
|
[
"Apache-2.0"
] | 73
|
2017-05-04T06:35:20.000Z
|
2022-02-03T13:57:00.000Z
|
lib/iana/ripe/__init__.py
|
sschwetz/network_tech
|
fc65166e71bfdb5a0e99ca7e7ce9f7814b92869b
|
[
"Apache-2.0"
] | 35
|
2017-11-09T16:28:48.000Z
|
2022-01-12T08:15:48.000Z
|
lib/iana/ripe/__init__.py
|
sschwetz/network_tech
|
fc65166e71bfdb5a0e99ca7e7ce9f7814b92869b
|
[
"Apache-2.0"
] | 20
|
2017-11-08T05:07:59.000Z
|
2021-12-09T17:41:06.000Z
|
"""
Copyright 2019 Glen Harmon
Ripe REST API Wiki
https://github.com/RIPE-NCC/whois/wiki/WHOIS-REST-API-search
"""
from .ripe import Ripe
| 12.909091
| 60
| 0.732394
| 23
| 142
| 4.521739
| 0.695652
| 0.134615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03252
| 0.133803
| 142
| 11
| 61
| 12.909091
| 0.813008
| 0.760563
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 4
|
8187f32f636a41836e6bcddf20b893841022962a
| 92
|
py
|
Python
|
2015/misc/test-table-1/graphic_config.py
|
nprapps/graphics-archive
|
97b0ef326b46a959df930f5522d325e537f7a655
|
[
"FSFAP"
] | 14
|
2015-05-08T13:41:51.000Z
|
2021-02-24T12:34:55.000Z
|
2015/misc/test-table-1/graphic_config.py
|
nprapps/graphics-archive
|
97b0ef326b46a959df930f5522d325e537f7a655
|
[
"FSFAP"
] | null | null | null |
2015/misc/test-table-1/graphic_config.py
|
nprapps/graphics-archive
|
97b0ef326b46a959df930f5522d325e537f7a655
|
[
"FSFAP"
] | 7
|
2015-04-04T04:45:54.000Z
|
2021-02-18T11:12:48.000Z
|
#!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1yUpR-uFHjHoZvh9fOAmiF_-3KXZw01F1Ysi2qUhe0Ns'
| 23
| 68
| 0.826087
| 11
| 92
| 6.545455
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093023
| 0.065217
| 92
| 3
| 69
| 30.666667
| 0.744186
| 0.217391
| 0
| 0
| 0
| 0
| 0.619718
| 0.619718
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
81bd109523b2f67861ad007e571124bea0e9f0a3
| 115
|
py
|
Python
|
tensor__cpu/http/download_from_ftp.py
|
Zhang-O/small
|
bfb41b2267159bd5e408dba524713d3bc0b28074
|
[
"MIT"
] | 1
|
2017-09-25T03:16:00.000Z
|
2017-09-25T03:16:00.000Z
|
tensor__cpu/http/download_from_ftp.py
|
Zhang-O/small
|
bfb41b2267159bd5e408dba524713d3bc0b28074
|
[
"MIT"
] | null | null | null |
tensor__cpu/http/download_from_ftp.py
|
Zhang-O/small
|
bfb41b2267159bd5e408dba524713d3bc0b28074
|
[
"MIT"
] | null | null | null |
# -*- coding:utf-8 -*-
# Filename: try.py
# Author:zhang
# Date: 2018/3/4 22:41
"""
直接从服务器下载文件,需要服务器搭建了 文件服务器
"""
| 14.375
| 26
| 0.617391
| 17
| 115
| 4.176471
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113402
| 0.156522
| 115
| 7
| 27
| 16.428571
| 0.618557
| 0.86087
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
81cbb1594f40f65be1c2dd74214d0e8ff41f0dc9
| 236
|
py
|
Python
|
thenewboston_node/business_logic/tests/fixtures/settings.py
|
AbhayAysola/thenewboston-node
|
8a24cfd814eed590a7a1066e45b8b4877501aa35
|
[
"MIT"
] | null | null | null |
thenewboston_node/business_logic/tests/fixtures/settings.py
|
AbhayAysola/thenewboston-node
|
8a24cfd814eed590a7a1066e45b8b4877501aa35
|
[
"MIT"
] | null | null | null |
thenewboston_node/business_logic/tests/fixtures/settings.py
|
AbhayAysola/thenewboston-node
|
8a24cfd814eed590a7a1066e45b8b4877501aa35
|
[
"MIT"
] | null | null | null |
from django.test import override_settings
import pytest
@pytest.fixture(autouse=True)
def unittest_settings():
with override_settings(SIGNING_KEY='46a23fd52b2690f5acf56654489fd67b3734a52f35a2b7827f5caeaa06c0c0a5'):
yield
| 23.6
| 107
| 0.822034
| 22
| 236
| 8.636364
| 0.772727
| 0.168421
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.191388
| 0.114407
| 236
| 9
| 108
| 26.222222
| 0.717703
| 0
| 0
| 0
| 0
| 0
| 0.271186
| 0.271186
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0.333333
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
81e0a59447326ba3a02566bc459d0fa3b787f9a7
| 984
|
py
|
Python
|
sdk/test/test_categories_api.py
|
yapily/yapily-sdk-python
|
c09930c44e8795e270e2846a2c0fb783200df76a
|
[
"MIT"
] | 11
|
2018-05-18T14:38:49.000Z
|
2021-09-08T13:24:37.000Z
|
sdk/test/test_categories_api.py
|
yapily/yapily-sdk-python
|
c09930c44e8795e270e2846a2c0fb783200df76a
|
[
"MIT"
] | 5
|
2019-10-23T15:06:33.000Z
|
2021-08-03T21:18:50.000Z
|
sdk/test/test_categories_api.py
|
yapily/yapily-sdk-python
|
c09930c44e8795e270e2846a2c0fb783200df76a
|
[
"MIT"
] | 8
|
2019-04-27T00:02:18.000Z
|
2021-11-21T02:54:12.000Z
|
# coding: utf-8
"""
Yapily API
To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501
The version of the OpenAPI document: 1.154.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import yapily
from yapily.api.categories_api import CategoriesApi # noqa: E501
from yapily.rest import ApiException
class TestCategoriesApi(unittest.TestCase):
"""CategoriesApi unit test stubs"""
def setUp(self):
self.api = yapily.api.categories_api.CategoriesApi() # noqa: E501
def tearDown(self):
pass
def test_get_categories_using_get(self):
"""Test case for get_categories_using_get
Retrieves a list of categories returned by the Yapily Categorisation engine for a given locale # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 24
| 158
| 0.711382
| 126
| 984
| 5.380952
| 0.563492
| 0.047198
| 0.056047
| 0.064897
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023166
| 0.210366
| 984
| 40
| 159
| 24.6
| 0.849421
| 0.480691
| 0
| 0.142857
| 0
| 0
| 0.017467
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.214286
| false
| 0.142857
| 0.357143
| 0
| 0.642857
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
c48f9428e7fa15750e78147958a8a1213dfb089a
| 89
|
py
|
Python
|
build/python_loader/cv2/config-2.7.py
|
pat4life360/LEAP-Camera-Face-Tracker-
|
be31183f9047f432ae400888aef1e0b0c58ff72b
|
[
"Apache-2.0"
] | null | null | null |
build/python_loader/cv2/config-2.7.py
|
pat4life360/LEAP-Camera-Face-Tracker-
|
be31183f9047f432ae400888aef1e0b0c58ff72b
|
[
"Apache-2.0"
] | null | null | null |
build/python_loader/cv2/config-2.7.py
|
pat4life360/LEAP-Camera-Face-Tracker-
|
be31183f9047f432ae400888aef1e0b0c58ff72b
|
[
"Apache-2.0"
] | null | null | null |
PYTHON_EXTENSIONS_PATHS = [
'/home/pi/opencv/build/lib/'
] + PYTHON_EXTENSIONS_PATHS
| 22.25
| 32
| 0.741573
| 11
| 89
| 5.636364
| 0.727273
| 0.516129
| 0.677419
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123596
| 89
| 3
| 33
| 29.666667
| 0.794872
| 0
| 0
| 0
| 0
| 0
| 0.292135
| 0.292135
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c4968a72cf0e6dc648c4d866d40a6bf802c814b8
| 143
|
py
|
Python
|
src/process_builtins/say.py
|
matthewlucock/mysh
|
efee6e951419fb56072b20ed5b36bedfbde9fa5e
|
[
"0BSD"
] | null | null | null |
src/process_builtins/say.py
|
matthewlucock/mysh
|
efee6e951419fb56072b20ed5b36bedfbde9fa5e
|
[
"0BSD"
] | null | null | null |
src/process_builtins/say.py
|
matthewlucock/mysh
|
efee6e951419fb56072b20ed5b36bedfbde9fa5e
|
[
"0BSD"
] | null | null | null |
import sys
if len(sys.argv) > 1:
print(' '.join(sys.argv[1:]))
else:
try:
print(input())
except EOFError:
print()
| 14.3
| 33
| 0.524476
| 19
| 143
| 3.947368
| 0.684211
| 0.186667
| 0.213333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.300699
| 143
| 9
| 34
| 15.888889
| 0.73
| 0
| 0
| 0
| 0
| 0
| 0.006993
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.125
| 0
| 0.125
| 0.375
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c49a283b8c9d66f083305855859c3f8ce222c3de
| 119
|
py
|
Python
|
bdd/features/steps/python.py
|
dunossauro/qaninja-liveclass
|
89bdb42a771a1a4f9d5fc63e12e3584e8334a72a
|
[
"MIT"
] | 7
|
2018-05-03T12:04:18.000Z
|
2020-05-02T13:11:03.000Z
|
bdd/features/steps/python.py
|
dunossauro/qaninja-liveclass
|
89bdb42a771a1a4f9d5fc63e12e3584e8334a72a
|
[
"MIT"
] | null | null | null |
bdd/features/steps/python.py
|
dunossauro/qaninja-liveclass
|
89bdb42a771a1a4f9d5fc63e12e3584e8334a72a
|
[
"MIT"
] | 4
|
2018-05-02T23:55:20.000Z
|
2020-05-02T13:07:40.000Z
|
from behave import given, then
@given('que o usuário acesse a página "{link}"')
def acessa_link(context, link):
| 17
| 48
| 0.697479
| 18
| 119
| 4.555556
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184874
| 119
| 6
| 49
| 19.833333
| 0.845361
| 0
| 0
| 0
| 0
| 0
| 0.319328
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
c4a7c5961656993da9eb95d8d70f04ef69911565
| 61
|
py
|
Python
|
emol/emol/views/user/__init__.py
|
lrt512/emol
|
e1dd3462632a525c3b9701d4fd9a332d19c93b85
|
[
"MIT"
] | null | null | null |
emol/emol/views/user/__init__.py
|
lrt512/emol
|
e1dd3462632a525c3b9701d4fd9a332d19c93b85
|
[
"MIT"
] | null | null | null |
emol/emol/views/user/__init__.py
|
lrt512/emol
|
e1dd3462632a525c3b9701d4fd9a332d19c93b85
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Module for user-related views."""
| 20.333333
| 36
| 0.57377
| 8
| 61
| 4.375
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019231
| 0.147541
| 61
| 2
| 37
| 30.5
| 0.653846
| 0.868852
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c4cd3244c8fe3d13e32af31e2ab9664a34f18c0e
| 8,800
|
py
|
Python
|
tests/python/relay/test_op_qnn_mul.py
|
wjj19950828/tvm
|
9c63f4fc318652f6fff68342da2d11b26592a3e0
|
[
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 90
|
2019-01-26T00:38:49.000Z
|
2022-03-11T23:12:34.000Z
|
tests/python/relay/test_op_qnn_mul.py
|
wjj19950828/tvm
|
9c63f4fc318652f6fff68342da2d11b26592a3e0
|
[
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 91
|
2019-02-27T00:17:01.000Z
|
2022-02-21T18:08:21.000Z
|
tests/python/relay/test_op_qnn_mul.py
|
wjj19950828/tvm
|
9c63f4fc318652f6fff68342da2d11b26592a3e0
|
[
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 41
|
2019-01-28T14:37:03.000Z
|
2022-03-31T03:58:57.000Z
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import tvm
from tvm import te
import numpy as np
from tvm import relay
from tvm.contrib import graph_executor
import tvm.topi.testing
# "unquantize" a quantized tensor
def recover(data, scale, zp):
return scale * (np.asarray(data) - zp)
def generate_golden_output(x_recovered, y_recovered, scale, zp):
mul = x_recovered * y_recovered
output = np.around(mul / scale + zp)
q_min = np.iinfo(np.uint8).min
q_max = np.iinfo(np.uint8).max
return np.clip(output, q_min, q_max)
def test_tflite_same_io_qnn_params():
data_dtype = "uint8"
lhs_scale = rhs_scale = output_scale = 0.00784314
lhs_zero_point = rhs_zero_point = output_zero_point = 127
x = relay.var("x", shape=(1, 4), dtype=data_dtype)
y = relay.var("y", shape=(1, 4), dtype=data_dtype)
z = relay.qnn.op.mul(
lhs=x,
rhs=y,
lhs_scale=relay.const(lhs_scale, "float32"),
lhs_zero_point=relay.const(lhs_zero_point, "int32"),
rhs_scale=relay.const(rhs_scale, "float32"),
rhs_zero_point=relay.const(rhs_zero_point, "int32"),
output_scale=relay.const(output_scale, "float32"),
output_zero_point=relay.const(output_zero_point, "int32"),
)
func = relay.Function([x, y], z)
mod = tvm.IRModule.from_expr(func)
mod = relay.transform.InferType()(mod)
mod = relay.qnn.transform.CanonicalizeOps()(mod)
func = mod["main"]
x_datas = [
np.array((1, 153, 2, 178)).reshape((1, 4)),
np.array((25, 1, 178, 216)).reshape((1, 4)),
np.array((25, 153, 1, 165)).reshape((1, 4)),
]
y_datas = [
np.array((204, 178, 1, 8)).reshape((1, 4)),
np.array((204, 178, 191, 1)).reshape((1, 4)),
np.array((204, 178, 1, 191)).reshape((1, 4)),
]
for i in range(0, 3):
x_data = x_datas[i]
y_data = y_datas[i]
x_rec = recover(x_data, lhs_scale, lhs_zero_point)
y_rec = recover(y_data, rhs_scale, rhs_zero_point)
golden = generate_golden_output(x_rec, y_rec, output_scale, output_zero_point)
intrp = relay.create_executor("graph", device=tvm.cpu(0), target="llvm")
op_res = intrp.evaluate(func)(x_data, y_data)
np.testing.assert_equal(op_res.numpy(), np.uint8(golden))
def test_tflite_different_io_qnn_params():
data_dtype = "uint8"
lhs_scale = 0.0156863
lhs_zero_point = 127
rhs_scale = 0.0117647
rhs_zero_point = 85
output_scale = 0.0235294
output_zero_point = 128
x = relay.var("x", shape=(1, 4), dtype=data_dtype)
y = relay.var("y", shape=(1, 4), dtype=data_dtype)
z = relay.qnn.op.mul(
lhs=x,
rhs=y,
lhs_scale=relay.const(lhs_scale, "float32"),
lhs_zero_point=relay.const(lhs_zero_point, "int32"),
rhs_scale=relay.const(rhs_scale, "float32"),
rhs_zero_point=relay.const(rhs_zero_point, "int32"),
output_scale=relay.const(output_scale, "float32"),
output_zero_point=relay.const(output_zero_point, "int32"),
)
func = relay.Function([x, y], z)
mod = tvm.IRModule.from_expr(func)
mod = relay.transform.InferType()(mod)
mod = relay.qnn.transform.CanonicalizeOps()(mod)
func = mod["main"]
x_datas = [
np.array((76, 140, 153, 172)).reshape((1, 4)),
np.array((133, 140, 146, 153)).reshape((1, 4)),
np.array((76, 140, 172, 146)).reshape((1, 4)),
]
y_datas = [
np.array((136, 119, 128, 17)).reshape((1, 4)),
np.array((136, 119, 111, 94)).reshape((1, 4)),
np.array((136, 119, 17, 128)).reshape((1, 4)),
]
for i in range(0, 3):
x_data = x_datas[i]
y_data = y_datas[i]
x_rec = recover(x_data, lhs_scale, lhs_zero_point)
y_rec = recover(y_data, rhs_scale, rhs_zero_point)
golden = generate_golden_output(x_rec, y_rec, output_scale, output_zero_point)
intrp = relay.create_executor("graph", device=tvm.cpu(0), target="llvm")
op_res = intrp.evaluate(func)(x_data, y_data)
np.testing.assert_equal(op_res.numpy(), np.uint8(golden))
def test_saturation():
# Same params
data_dtype = "uint8"
lhs_scale = rhs_scale = output_scale = 0.125
lhs_zero_point = rhs_zero_point = output_zero_point = 0
x = relay.var("x", shape=(1, 4), dtype=data_dtype)
y = relay.var("y", shape=(1, 4), dtype=data_dtype)
z = relay.qnn.op.mul(
lhs=x,
rhs=y,
lhs_scale=relay.const(lhs_scale, "float32"),
lhs_zero_point=relay.const(lhs_zero_point, "int32"),
rhs_scale=relay.const(rhs_scale, "float32"),
rhs_zero_point=relay.const(rhs_zero_point, "int32"),
output_scale=relay.const(output_scale, "float32"),
output_zero_point=relay.const(output_zero_point, "int32"),
)
func = relay.Function([x, y], z)
mod = tvm.IRModule.from_expr(func)
mod = relay.transform.InferType()(mod)
mod = relay.qnn.transform.CanonicalizeOps()(mod)
func = mod["main"]
x_data = np.array((255, 1, 1, 0)).reshape((1, 4))
y_data = np.array((255, 255, 128, 0)).reshape((1, 4))
x_rec = recover(x_data, lhs_scale, lhs_zero_point)
y_rec = recover(y_data, rhs_scale, rhs_zero_point)
golden = generate_golden_output(x_rec, y_rec, output_scale, output_zero_point)
intrp = relay.create_executor("graph", device=tvm.cpu(0), target="llvm")
op_res = intrp.evaluate(func)(x_data, y_data)
np.testing.assert_equal(op_res.numpy(), np.uint8(golden))
# Same params, different scale
lhs_scale = rhs_scale = 0.125
output_scale = 0.25
z = relay.qnn.op.mul(
lhs=x,
rhs=y,
lhs_scale=relay.const(lhs_scale, "float32"),
lhs_zero_point=relay.const(lhs_zero_point, "int32"),
rhs_scale=relay.const(rhs_scale, "float32"),
rhs_zero_point=relay.const(rhs_zero_point, "int32"),
output_scale=relay.const(output_scale, "float32"),
output_zero_point=relay.const(output_zero_point, "int32"),
)
func = relay.Function([x, y], z)
mod = tvm.IRModule.from_expr(func)
mod = relay.transform.InferType()(mod)
mod = relay.qnn.transform.CanonicalizeOps()(mod)
func = mod["main"]
x_data = np.array((255, 1, 1, 0)).reshape((1, 4))
y_data = np.array((255, 255, 127, 0)).reshape((1, 4))
x_rec = recover(x_data, lhs_scale, lhs_zero_point)
y_rec = recover(y_data, rhs_scale, rhs_zero_point)
golden = generate_golden_output(x_rec, y_rec, output_scale, output_zero_point)
intrp = relay.create_executor("graph", device=tvm.cpu(0), target="llvm")
op_res = intrp.evaluate(func)(x_data, y_data)
np.testing.assert_equal(op_res.numpy(), np.uint8(golden))
# All params different
lhs_scale = 0.5
rhs_scale = 0.25
output_scale = 0.125
z = relay.qnn.op.mul(
lhs=x,
rhs=y,
lhs_scale=relay.const(lhs_scale, "float32"),
lhs_zero_point=relay.const(lhs_zero_point, "int32"),
rhs_scale=relay.const(rhs_scale, "float32"),
rhs_zero_point=relay.const(rhs_zero_point, "int32"),
output_scale=relay.const(output_scale, "float32"),
output_zero_point=relay.const(output_zero_point, "int32"),
)
func = relay.Function([x, y], z)
mod = tvm.IRModule.from_expr(func)
mod = relay.transform.InferType()(mod)
mod = relay.qnn.transform.CanonicalizeOps()(mod)
func = mod["main"]
x_data = np.array((255, 0, 1, 0)).reshape((1, 4))
y_data = np.array((0, 128, 64, 0)).reshape((1, 4))
x_rec = recover(x_data, lhs_scale, lhs_zero_point)
y_rec = recover(y_data, rhs_scale, rhs_zero_point)
golden = generate_golden_output(x_rec, y_rec, output_scale, output_zero_point)
intrp = relay.create_executor("graph", device=tvm.cpu(0), target="llvm")
op_res = intrp.evaluate(func)(x_data, y_data)
np.testing.assert_equal(op_res.numpy(), np.uint8(golden))
if __name__ == "__main__":
test_tflite_same_io_qnn_params()
test_tflite_different_io_qnn_params()
test_saturation()
| 34.782609
| 86
| 0.655341
| 1,340
| 8,800
| 4.071642
| 0.140299
| 0.089076
| 0.039589
| 0.052236
| 0.759714
| 0.752383
| 0.730389
| 0.706195
| 0.69923
| 0.680718
| 0
| 0.051663
| 0.20375
| 8,800
| 252
| 87
| 34.920635
| 0.726987
| 0.096136
| 0
| 0.664835
| 0
| 0
| 0.034539
| 0
| 0
| 0
| 0
| 0
| 0.027473
| 1
| 0.027473
| false
| 0
| 0.032967
| 0.005495
| 0.071429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c4d839170925b51f58f58a79861c1d008abd7f8b
| 228
|
py
|
Python
|
profiles/serializers.py
|
BookShareBG/BackEnd
|
07a114313501fa3a8a5d2d8462179b69a6b56c06
|
[
"MIT"
] | null | null | null |
profiles/serializers.py
|
BookShareBG/BackEnd
|
07a114313501fa3a8a5d2d8462179b69a6b56c06
|
[
"MIT"
] | 4
|
2020-11-05T12:18:41.000Z
|
2021-06-10T20:22:16.000Z
|
profiles/serializers.py
|
BookShareBG/BackEnd
|
07a114313501fa3a8a5d2d8462179b69a6b56c06
|
[
"MIT"
] | null | null | null |
from rest_framework import serializers
from .models import Profile
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = ('id', 'user_id', 'city', 'country', 'address')
| 25.333333
| 64
| 0.701754
| 24
| 228
| 6.583333
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192982
| 228
| 8
| 65
| 28.5
| 0.858696
| 0
| 0
| 0
| 0
| 0
| 0.118421
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c4f4bbe694333d65b69ac0e37b34b451d787eb9e
| 412
|
py
|
Python
|
lizard/util/cl/mux.py
|
cornell-brg/lizard
|
7f9a78a913e64b5cfdee3a26223539ad225bd6da
|
[
"BSD-3-Clause"
] | 50
|
2019-05-22T08:43:15.000Z
|
2022-03-21T23:58:50.000Z
|
lizard/util/cl/mux.py
|
cornell-brg/lizard
|
7f9a78a913e64b5cfdee3a26223539ad225bd6da
|
[
"BSD-3-Clause"
] | 1
|
2019-07-27T18:51:52.000Z
|
2019-08-02T01:20:22.000Z
|
lizard/util/cl/mux.py
|
cornell-brg/lizard
|
7f9a78a913e64b5cfdee3a26223539ad225bd6da
|
[
"BSD-3-Clause"
] | 11
|
2019-12-26T06:00:48.000Z
|
2022-03-27T02:29:35.000Z
|
from pymtl import *
from lizard.model.hardware_model import HardwareModel
from lizard.model.clmodel import CLModel
from lizard.util.rtl.mux import MuxInterface
class MuxCL(CLModel):
@HardwareModel.validate
def __init__(s, dtype, nports):
super(MuxCL, s).__init__(MuxInterface(dtype, nports))
@s.model_method
def mux(in_, select):
return in_[select]
def line_trace(s):
return ''
| 20.6
| 57
| 0.73301
| 55
| 412
| 5.254545
| 0.490909
| 0.103806
| 0.103806
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169903
| 412
| 19
| 58
| 21.684211
| 0.845029
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.230769
| false
| 0
| 0.307692
| 0.153846
| 0.769231
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
f2245ca62a7234bff395ffed52d098a69322f89a
| 264
|
py
|
Python
|
hackerrank/regex/backreferences/01-failed-groups.py
|
everarch/psets
|
7fddb2a01ce8c4e601d63c3be3b11cd2113be035
|
[
"MIT"
] | null | null | null |
hackerrank/regex/backreferences/01-failed-groups.py
|
everarch/psets
|
7fddb2a01ce8c4e601d63c3be3b11cd2113be035
|
[
"MIT"
] | null | null | null |
hackerrank/regex/backreferences/01-failed-groups.py
|
everarch/psets
|
7fddb2a01ce8c4e601d63c3be3b11cd2113be035
|
[
"MIT"
] | null | null | null |
#
# Backreferences To Failed Groups
#
# https://www.hackerrank.com/challenges/backreferences-to-failed-groups/problem
#
Regex_Pattern = r"^\d{2}(-?)\d{2}\1\d{2}\1\d{2}$" # Do not delete 'r'.
import re
print(str(bool(re.search(Regex_Pattern, input()))).lower())
| 22
| 79
| 0.685606
| 42
| 264
| 4.261905
| 0.642857
| 0.044693
| 0.24581
| 0.312849
| 0.044693
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025105
| 0.094697
| 264
| 11
| 80
| 24
| 0.723849
| 0.484848
| 0
| 0
| 0
| 0.333333
| 0.232558
| 0.232558
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 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
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
480cecff9bb3a538c96ea9d2e5f3ef760f853af3
| 53
|
py
|
Python
|
OcCo_TF/pc_distance/__init__.py
|
sun-pyo/OcCo
|
e2e12dbaa8f9b98fb8c42fc32682f49e99be302f
|
[
"MIT"
] | 158
|
2020-08-19T18:13:28.000Z
|
2022-03-30T13:55:32.000Z
|
OcCo_TF/pc_distance/__init__.py
|
sun-pyo/OcCo
|
e2e12dbaa8f9b98fb8c42fc32682f49e99be302f
|
[
"MIT"
] | 28
|
2020-05-30T04:02:33.000Z
|
2022-03-30T15:46:38.000Z
|
OcCo_TF/pc_distance/__init__.py
|
sun-pyo/OcCo
|
e2e12dbaa8f9b98fb8c42fc32682f49e99be302f
|
[
"MIT"
] | 18
|
2020-08-19T19:52:38.000Z
|
2022-02-06T11:42:26.000Z
|
# Copyright (c) 2020. Hanchen Wang, hw501@cam.ac.uk
| 26.5
| 52
| 0.698113
| 9
| 53
| 4.111111
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155556
| 0.150943
| 53
| 1
| 53
| 53
| 0.666667
| 0.924528
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4840ded7b02799a486e7fe66da3dd9ffca709f04
| 86
|
py
|
Python
|
draw_table/__init__.py
|
pedrudehuere/py_draw_table
|
d8971e5fcac24f8429742e568bd01059b0696d85
|
[
"MIT"
] | null | null | null |
draw_table/__init__.py
|
pedrudehuere/py_draw_table
|
d8971e5fcac24f8429742e568bd01059b0696d85
|
[
"MIT"
] | null | null | null |
draw_table/__init__.py
|
pedrudehuere/py_draw_table
|
d8971e5fcac24f8429742e568bd01059b0696d85
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .draw_table import draw_table
__all__ = ['draw_table']
| 14.333333
| 34
| 0.662791
| 12
| 86
| 4.166667
| 0.666667
| 0.54
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013889
| 0.162791
| 86
| 5
| 35
| 17.2
| 0.680556
| 0.244186
| 0
| 0
| 0
| 0
| 0.15873
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.