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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b82265145d6c0acedfe302f7771feb2bf99c6496
| 150
|
py
|
Python
|
Day 1/odd_even.py
|
vikask1/MarchCode
|
1c299e1c1a76cd36670cd9e9f4ce4df4b33f0b57
|
[
"MIT"
] | null | null | null |
Day 1/odd_even.py
|
vikask1/MarchCode
|
1c299e1c1a76cd36670cd9e9f4ce4df4b33f0b57
|
[
"MIT"
] | null | null | null |
Day 1/odd_even.py
|
vikask1/MarchCode
|
1c299e1c1a76cd36670cd9e9f4ce4df4b33f0b57
|
[
"MIT"
] | null | null | null |
num = int(input("Enter Any Number : "))
if num % 2 == 1:
print(num, " is odd!")
elif num % 2 == 0:
print(num, " is even!")
else:
print("Error")
| 18.75
| 39
| 0.546667
| 25
| 150
| 3.28
| 0.68
| 0.097561
| 0.243902
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034783
| 0.233333
| 150
| 7
| 40
| 21.428571
| 0.678261
| 0
| 0
| 0
| 0
| 0
| 0.273333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.428571
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
62d9052747c12258a7a4393089fe761513866829
| 35
|
py
|
Python
|
edge_device/__init__.py
|
RLashofRegas/w251-hw03-iot-facial-detection
|
2a6abd32701550dcc36b6856af504bcd2716fc2e
|
[
"MIT"
] | 1
|
2020-08-15T15:40:19.000Z
|
2020-08-15T15:40:19.000Z
|
edge_device/__init__.py
|
RLashofRegas/w251-hw03-iot-facial-detection
|
2a6abd32701550dcc36b6856af504bcd2716fc2e
|
[
"MIT"
] | null | null | null |
edge_device/__init__.py
|
RLashofRegas/w251-hw03-iot-facial-detection
|
2a6abd32701550dcc36b6856af504bcd2716fc2e
|
[
"MIT"
] | null | null | null |
"""Modules for the edge device."""
| 17.5
| 34
| 0.657143
| 5
| 35
| 4.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 35
| 1
| 35
| 35
| 0.766667
| 0.8
| 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
|
62d9655b62266d77783ef37cc32483ba5f830972
| 106
|
py
|
Python
|
frequencia/relatorios/apps.py
|
andersonqueiroz/frequencia
|
7dae9bb6115759edb8e8297565d0dd1b638ac94a
|
[
"MIT"
] | 1
|
2021-11-22T17:17:03.000Z
|
2021-11-22T17:17:03.000Z
|
frequencia/relatorios/apps.py
|
andersonqueiroz/frequencia
|
7dae9bb6115759edb8e8297565d0dd1b638ac94a
|
[
"MIT"
] | 11
|
2019-06-18T11:19:23.000Z
|
2021-08-23T12:04:54.000Z
|
frequencia/relatorios/apps.py
|
andersonqueiroz/frequencia
|
7dae9bb6115759edb8e8297565d0dd1b638ac94a
|
[
"MIT"
] | 2
|
2019-04-09T16:23:22.000Z
|
2022-01-27T19:13:19.000Z
|
from django.apps import AppConfig
class RelatoriosConfig(AppConfig):
name = 'frequencia.relatorios'
| 17.666667
| 34
| 0.783019
| 11
| 106
| 7.545455
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141509
| 106
| 5
| 35
| 21.2
| 0.912088
| 0
| 0
| 0
| 0
| 0
| 0.198113
| 0.198113
| 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
|
1a1e859d708e8e2fe354501713d1d983a289bb11
| 166
|
py
|
Python
|
mopo/env/__init__.py
|
Yizhao111/mopo
|
89bd21544ff76b4d39bc86038ef10f81eeda16b3
|
[
"MIT"
] | 107
|
2020-09-07T01:06:37.000Z
|
2022-03-31T04:16:51.000Z
|
mopo/env/__init__.py
|
Yizhao111/mopo
|
89bd21544ff76b4d39bc86038ef10f81eeda16b3
|
[
"MIT"
] | 9
|
2020-09-09T06:49:03.000Z
|
2022-03-25T18:19:57.000Z
|
mopo/env/__init__.py
|
Yizhao111/mopo
|
89bd21544ff76b4d39bc86038ef10f81eeda16b3
|
[
"MIT"
] | 29
|
2020-09-10T16:26:33.000Z
|
2022-03-16T08:15:41.000Z
|
import sys
from .ant import AntEnv
from .humanoid import HumanoidEnv
env_overwrite = {'Ant': AntEnv, 'Humanoid': HumanoidEnv}
sys.modules[__name__] = env_overwrite
| 20.75
| 56
| 0.777108
| 21
| 166
| 5.857143
| 0.52381
| 0.195122
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126506
| 166
| 8
| 57
| 20.75
| 0.848276
| 0
| 0
| 0
| 0
| 0
| 0.065868
| 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
|
a7f2444d25c2ea0deca86222b6b20965747ec248
| 81
|
py
|
Python
|
project/ALM/apps.py
|
KshitizSharmaV/Quant_Platform_Python
|
d784aa0604d8de5ba5ca0c3a171e3556c0cd6b39
|
[
"BSD-3-Clause"
] | null | null | null |
project/ALM/apps.py
|
KshitizSharmaV/Quant_Platform_Python
|
d784aa0604d8de5ba5ca0c3a171e3556c0cd6b39
|
[
"BSD-3-Clause"
] | null | null | null |
project/ALM/apps.py
|
KshitizSharmaV/Quant_Platform_Python
|
d784aa0604d8de5ba5ca0c3a171e3556c0cd6b39
|
[
"BSD-3-Clause"
] | null | null | null |
from django.apps import AppConfig
class AlmConfig(AppConfig):
name = 'ALM'
| 13.5
| 33
| 0.728395
| 10
| 81
| 5.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.185185
| 81
| 5
| 34
| 16.2
| 0.893939
| 0
| 0
| 0
| 0
| 0
| 0.037037
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c5046af6adbb16f51441f8bbca16e33e26449ef1
| 1,854
|
py
|
Python
|
meter_mon/meter_mon.py
|
ridale/pump_control
|
5a938063dd7f609991afb5798ee6ab6eb408de4f
|
[
"MIT"
] | 1
|
2016-02-22T01:02:33.000Z
|
2016-02-22T01:02:33.000Z
|
meter_mon/meter_mon.py
|
ridale/pump_control
|
5a938063dd7f609991afb5798ee6ab6eb408de4f
|
[
"MIT"
] | null | null | null |
meter_mon/meter_mon.py
|
ridale/pump_control
|
5a938063dd7f609991afb5798ee6ab6eb408de4f
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from pymodbus.payload import BinaryPayloadDecoder as PayloadDecoder
svr_addr = '192.168.1.203'
client = ModbusClient(svr_addr, port=502)
client.connect()
result = client.read_holding_registers(46100, 6, unit=0x01)
print "Firmware V(%d.%d) RF(%d.%d) BootLoader(%d.%d)" %(
rr.registers[0], rr.registers[1], rr.registers[2],
rr.registers[3], rr.registers[4], rr.registers[5])
result = client.read_holding_registers(13312, 30, unit=0x01)
decoder = BinaryPayloadDecoder.fromRegisters(result.registers, endian=Endian.Little)
decoded = {
'V1 Voltage': decoder.decode_32bit_uint(),
'V2 Voltage': decoder.decode_32bit_uint(),
'V3 Voltage': decoder.decode_32bit_uint(),
'I1 Voltage': decoder.decode_32bit_uint(),
'I2 Voltage': decoder.decode_32bit_uint(),
'I3 Voltage': decoder.decode_32bit_uint(),
'kW L1': decoder.decode_32bit_int(),
'kW L2': decoder.decode_32bit_int(),
'kW L3': decoder.decode_32bit_int(),
'kvar L1': decoder.decode_32bit_int(),
'kvar L2': decoder.decode_32bit_int(),
'kvar L3': decoder.decode_32bit_int(),
'kVA L1': decoder.decode_32bit_uint(),
'kVA L2': decoder.decode_32bit_uint(),
'kVA L3': decoder.decode_32bit_uint(),
'Power factor L1': decoder.decode_32bit_int(),
'Power factor L2': decoder.decode_32bit_int(),
'Power factor L3': decoder.decode_32bit_int(),
}
for name, value in decoded.iteritems():
print"%s = %d\n" %(name, value)
result = client.read_holding_registers(14720, 4, unit=0x01)
decoder = BinaryPayloadDecoder.fromRegisters(result.registers, endian=Endian.Little)
decoded = {
'KWh import': decoder.decode_32bit_uint(),
'KWh export': decoder.decode_32bit_uint(),
}
for name, value in decoded.iteritems():
print"%s = %d\n" %(name, value)
| 35.653846
| 84
| 0.714132
| 253
| 1,854
| 5.043478
| 0.312253
| 0.203762
| 0.282132
| 0.189655
| 0.654389
| 0.261755
| 0.211599
| 0.211599
| 0.211599
| 0.211599
| 0
| 0.065543
| 0.135922
| 1,854
| 51
| 85
| 36.352941
| 0.730961
| 0.00863
| 0
| 0.195122
| 0
| 0
| 0.138889
| 0
| 0
| 0
| 0.006536
| 0
| 0
| 0
| null | null | 0
| 0.073171
| null | null | 0.073171
| 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
|
c52388ddfd148788cb5154f5547700980b599c7e
| 58
|
py
|
Python
|
config.py
|
PunchThrough/FacebookFlagger
|
568a852fef376494eb14bfb9f3742b23df1d95a9
|
[
"MIT"
] | 7
|
2015-06-26T04:33:08.000Z
|
2020-08-09T18:12:16.000Z
|
config.py
|
PunchThrough/FacebookFlagger
|
568a852fef376494eb14bfb9f3742b23df1d95a9
|
[
"MIT"
] | null | null | null |
config.py
|
PunchThrough/FacebookFlagger
|
568a852fef376494eb14bfb9f3742b23df1d95a9
|
[
"MIT"
] | 4
|
2017-05-27T21:41:21.000Z
|
2021-03-29T18:21:49.000Z
|
email = 'my.email.address@gmail.com'
password = 'rosebud'
| 19.333333
| 36
| 0.724138
| 8
| 58
| 5.25
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103448
| 58
| 2
| 37
| 29
| 0.807692
| 0
| 0
| 0
| 0
| 0
| 0.568966
| 0.448276
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.5
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
c5308f90f1da9436d434b6c5ae3195182768bbcc
| 104
|
py
|
Python
|
sklearn_ts/models/base.py
|
lady-pandas/sklearn-ts
|
f2bb033bc86cb39597aed647039603cc6a0bdce3
|
[
"MIT"
] | 1
|
2021-07-11T04:39:20.000Z
|
2021-07-11T04:39:20.000Z
|
sklearn_ts/models/base.py
|
lady-pandas/sklearn-ts
|
f2bb033bc86cb39597aed647039603cc6a0bdce3
|
[
"MIT"
] | null | null | null |
sklearn_ts/models/base.py
|
lady-pandas/sklearn-ts
|
f2bb033bc86cb39597aed647039603cc6a0bdce3
|
[
"MIT"
] | null | null | null |
import abc
class TimeSeriesModel:
@abc.abstractmethod
def get_features(self):
return
| 11.555556
| 27
| 0.682692
| 11
| 104
| 6.363636
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.259615
| 104
| 8
| 28
| 13
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
c5319fc62bc7049331089b9b7521508caa55e83f
| 127
|
py
|
Python
|
utils/cli/core/__init__.py
|
gitibharatibiswal/cvat-adas-team
|
a33c1ae38d79ed6e35a61a97b74cd2978853e4c2
|
[
"Intel",
"MIT"
] | 3,142
|
2020-09-08T13:24:43.000Z
|
2022-03-31T23:53:50.000Z
|
utils/cli/core/__init__.py
|
nav13n/cvat
|
9bdcc7f8f2d86a763ab5f306ea049ce1432da557
|
[
"Intel",
"MIT"
] | 2,049
|
2020-09-08T10:01:10.000Z
|
2022-03-31T19:08:15.000Z
|
utils/cli/core/__init__.py
|
nav13n/cvat
|
9bdcc7f8f2d86a763ab5f306ea049ce1432da557
|
[
"Intel",
"MIT"
] | 1,055
|
2020-09-08T15:23:58.000Z
|
2022-03-31T10:52:48.000Z
|
# SPDX-License-Identifier: MIT
from .definition import parser, ResourceType # noqa
from .core import CLI, CVAT_API_V1 # noqa
| 31.75
| 52
| 0.771654
| 18
| 127
| 5.333333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009259
| 0.149606
| 127
| 3
| 53
| 42.333333
| 0.87963
| 0.299213
| 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
|
c54ee0bf381e0480d05e44c1163c6548ab30debb
| 2,272
|
py
|
Python
|
tests/test_tempest_testcase_xml.py
|
rcbops/tempest-zigzag
|
12f4bc528c9b88263f04394e5f31755519aa02e8
|
[
"Apache-2.0"
] | null | null | null |
tests/test_tempest_testcase_xml.py
|
rcbops/tempest-zigzag
|
12f4bc528c9b88263f04394e5f31755519aa02e8
|
[
"Apache-2.0"
] | 2
|
2019-01-14T22:48:35.000Z
|
2019-02-25T20:06:06.000Z
|
tests/test_tempest_testcase_xml.py
|
rcbops/tempest-zigzag
|
12f4bc528c9b88263f04394e5f31755519aa02e8
|
[
"Apache-2.0"
] | 2
|
2019-01-08T20:19:16.000Z
|
2019-01-10T22:12:30.000Z
|
from lxml import etree
from tempest_zigzag.tempest_testcase_xml import TempestTestcaseXml
import pytest
from lxml.etree import _Element
@pytest.fixture()
def teardown_failure(string_test_xml_teardown_failure):
"""An example of a teardown failure xml element"""
return etree.XML(string_test_xml_teardown_failure)[7]
@pytest.fixture()
def setup_failure(string_test_xml_setup_failure):
"""An example of a setup failure xml element"""
return etree.XML(string_test_xml_setup_failure)[5]
class TestTempestTestcaseXMLTeardownFailure(object):
def test_properties(self, teardown_failure):
ttcxml = TempestTestcaseXml(teardown_failure)
assert 'tempest.api.compute.admin.test_aggregates.AggregatesAdminTestJSON' == ttcxml.classname_in_wrong_place
assert not ttcxml.classname # classname should be in the wrong place ^
assert 'tearDownClass (tempest.api.compute.admin.test_aggregates.AggregatesAdminTestJSON)' == ttcxml.name
assert '0.000' == ttcxml.time
assert ttcxml.idempotent_id is None
def test_xml_elements(self, teardown_failure):
ttcxml = TempestTestcaseXml(teardown_failure)
element = ttcxml.xml_element
assert type(element) is _Element # this is the original element
assert type(ttcxml.xml_failure_elements) is list
assert 'failure' == ttcxml.xml_failure_elements[0].tag
class TestTempestTestcaseXMLSetupFailure(object):
def test_properties(self, setup_failure):
ttcxml = TempestTestcaseXml(setup_failure)
assert 'tempest.api.compute.admin.test_aggregates.AggregatesAdminTestJSON' == ttcxml.classname_in_wrong_place
assert not ttcxml.classname # classname should be in the wrong place ^
assert 'setUpClass (tempest.api.compute.admin.test_aggregates.AggregatesAdminTestJSON)' == ttcxml.name
assert '0.000' == ttcxml.time
assert ttcxml.idempotent_id is None
def test_xml_elements(self, setup_failure):
ttcxml = TempestTestcaseXml(setup_failure)
element = ttcxml.xml_element
assert type(element) is _Element # this is the original element
assert type(ttcxml.xml_failure_elements) is list
assert 'failure' == ttcxml.xml_failure_elements[0].tag
| 36.063492
| 117
| 0.74912
| 273
| 2,272
| 6.014652
| 0.227106
| 0.073082
| 0.031669
| 0.053593
| 0.82095
| 0.729598
| 0.729598
| 0.61754
| 0.61754
| 0.563946
| 0
| 0.006417
| 0.176937
| 2,272
| 62
| 118
| 36.645161
| 0.871658
| 0.099912
| 0
| 0.578947
| 0
| 0
| 0.154111
| 0.129985
| 0
| 0
| 0
| 0
| 0.421053
| 1
| 0.157895
| false
| 0
| 0.105263
| 0
| 0.368421
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c54ef12bff362437fcb2c91437dc694dfaef7bac
| 89
|
py
|
Python
|
Weather/apps.py
|
kshithijiyer/WeatherApp
|
44777cbc6a5637e4e4aab324a048e453e8621b86
|
[
"Apache-2.0"
] | null | null | null |
Weather/apps.py
|
kshithijiyer/WeatherApp
|
44777cbc6a5637e4e4aab324a048e453e8621b86
|
[
"Apache-2.0"
] | null | null | null |
Weather/apps.py
|
kshithijiyer/WeatherApp
|
44777cbc6a5637e4e4aab324a048e453e8621b86
|
[
"Apache-2.0"
] | null | null | null |
from django.apps import AppConfig
class WeatherConfig(AppConfig):
name = 'Weather'
| 14.833333
| 33
| 0.752809
| 10
| 89
| 6.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168539
| 89
| 5
| 34
| 17.8
| 0.905405
| 0
| 0
| 0
| 0
| 0
| 0.078652
| 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
|
3db1252395a2690a79910033b6af862da7b5c977
| 87
|
py
|
Python
|
src/apps/mywork/apps.py
|
ypdai2/django-project-template
|
163b9fed90b059d9be87cebf7486a731b2865362
|
[
"Apache-2.0"
] | null | null | null |
src/apps/mywork/apps.py
|
ypdai2/django-project-template
|
163b9fed90b059d9be87cebf7486a731b2865362
|
[
"Apache-2.0"
] | 3
|
2019-06-27T07:53:12.000Z
|
2019-07-02T08:50:55.000Z
|
src/apps/mywork/apps.py
|
ypdai2/django-project-template
|
163b9fed90b059d9be87cebf7486a731b2865362
|
[
"Apache-2.0"
] | 1
|
2019-06-27T06:15:23.000Z
|
2019-06-27T06:15:23.000Z
|
from django.apps import AppConfig
class MyworkConfig(AppConfig):
name = 'mywork'
| 14.5
| 33
| 0.747126
| 10
| 87
| 6.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 87
| 5
| 34
| 17.4
| 0.902778
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3ddbffbfb25e0653cd148b12e7a3f35ae806fdeb
| 8,790
|
py
|
Python
|
test/test/unit/test_base_planner.py
|
Voyz/databay
|
a13edd548bf6a9f651230134ac357d848b6d55e0
|
[
"Apache-2.0"
] | 175
|
2020-08-20T12:59:42.000Z
|
2021-12-30T05:33:32.000Z
|
test/test/unit/test_base_planner.py
|
Voyz/databay
|
a13edd548bf6a9f651230134ac357d848b6d55e0
|
[
"Apache-2.0"
] | 25
|
2020-08-23T19:56:53.000Z
|
2021-04-08T03:14:35.000Z
|
test/test/unit/test_base_planner.py
|
Voyz/databay
|
a13edd548bf6a9f651230134ac357d848b6d55e0
|
[
"Apache-2.0"
] | 11
|
2020-08-29T14:18:40.000Z
|
2021-06-29T05:34:09.000Z
|
import atexit
import logging
from datetime import timedelta
from unittest import TestCase, mock
from unittest.mock import patch, MagicMock
import databay
from databay import BasePlanner, Link
from databay.errors import MissingLinkError
from test_utils import fqname, DummyException
class TestBasePlanner(TestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
logging.getLogger('databay').setLevel(logging.WARNING)
@patch.multiple(BasePlanner, __abstractmethods__=set())
def setUp(self, *args, **kwargs):
self.planner = BasePlanner(*args, **kwargs)
self.planner._schedule = MagicMock(
side_effect=lambda link: link.set_job(object()))
self.planner._unschedule = MagicMock(
side_effect=lambda link: link.set_job(None))
self.planner._start_planner = MagicMock()
self.planner._shutdown_planner = MagicMock()
@patch(fqname(Link), spec=Link)
def test_add_links(self, link):
def set_job(job):
link.job = job
link.set_job.side_effect = set_job
link.job = None
self.planner.add_links(link)
self.assertIsNotNone(link.job, 'Link should contain a job')
self.assertTrue(link in self.planner.links,
'Planner should contain the link')
def test_add_links_invalid(self):
self.assertRaises(TypeError, self.planner.add_links, "invalid_link")
@patch(fqname(Link), spec=Link)
def test_add_links_array(self, link):
def set_job(job):
link.job = job
link.set_job.side_effect = set_job
link.job = None
self.planner.add_links([link])
self.assertIsNotNone(link.job, 'Link should contain a job')
self.assertTrue(link in self.planner.links,
'Planner should contain the link')
@patch(fqname(Link), spec=Link)
def test_remove_links(self, link):
def set_job(job):
link.job = job
link.set_job.side_effect = set_job
link.job = None
self.planner.add_links(link)
self.planner.remove_links(link)
self.assertIsNone(link.job, 'Link should not contain a job')
self.assertTrue(link not in self.planner.links,
'Planner should not contain the link')
@patch(fqname(Link), spec=Link)
def test_remove_invalid_link(self, link):
def set_job(job):
link.job = job
link.set_job.side_effect = set_job
link.job = None
self.assertRaises(MissingLinkError, self.planner.remove_links, link)
self.assertIsNone(link.job, 'Link should not contain a job')
self.assertTrue(link not in self.planner.links,
'Planner should not contain the link')
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_start(self, link):
self.planner.add_links(link)
self.planner.start()
link.on_start.assert_called()
self.planner._start_planner.assert_called()
@patch(fqname(Link), spec=Link)
def test_shutdown(self, link):
self.planner.add_links(link)
self.planner.shutdown()
link.on_shutdown.assert_called()
self.planner._shutdown_planner.assert_called()
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_start_order(self, link):
# on_start should be called before _start_planner
link.on_start.side_effect = lambda: self.planner._start_planner.assert_not_called()
self.planner.add_links(link)
self.planner.start()
# finally both should be called
link.on_start.assert_called()
self.planner._start_planner.assert_called()
@patch(fqname(Link), spec=Link)
def test_shutdown_order(self, link):
# on_shutdown should be called after _shutdown_planner
self.planner._shutdown_planner.side_effect = lambda wait: link.on_shutdown.assert_not_called()
self.planner.add_links(link)
self.planner.shutdown()
self.planner._shutdown_planner.side_effect = None
# finally both should be called
link.on_shutdown.assert_called()
self.planner._shutdown_planner.assert_called()
@patch(fqname(Link), spec=Link)
def test_purge(self, link):
self.planner.add_links(link)
self.planner.purge()
self.planner._unschedule.assert_called_with(link)
self.assertEqual(self.planner.links, [])
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_purge_while_running(self, link):
self.planner.add_links(link)
self.planner.start()
self.planner.purge()
self.planner._unschedule.assert_called_with(link)
self.assertEqual(self.planner.links, [])
self.planner.shutdown()
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_immediate_transfer(self, link):
self.planner.add_links(link)
self.planner.start()
link.transfer.assert_called()
self.planner.shutdown()
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_immediate_transfer_exception(self, link):
link.transfer.side_effect = DummyException('First transfer exception!')
self.planner.add_links(link)
with self.assertLogs(logging.getLogger('databay.BasePlanner'), level='WARNING') as cm:
self.planner.start()
self.assertTrue(
'First transfer exception!' in ';'.join(cm.output))
link.transfer.assert_called()
self.planner.shutdown()
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_link_on_start_exception(self, link):
link.on_start.side_effect = DummyException('First transfer exception!')
self.planner.add_links(link)
with self.assertLogs(logging.getLogger('databay.BasePlanner'), level='WARNING') as cm:
self.planner.start()
self.assertTrue(
'First transfer exception!' in ';'.join(cm.output))
# self.assertRaises(RuntimeError, self.planner.start)
link.on_start.assert_called()
self.planner.shutdown()
@patch(fqname(Link), spec=Link)
def test_immediate_transfer_off(self, link):
self.planner.immediate_transfer = False
self.planner.add_links(link)
self.planner.start()
link.transfer.assert_not_called()
self.planner.shutdown()
@patch(fqname(Link), spec=Link, immediate_transfer=False)
def test_immediate_transfer_link_off(self, link):
self.planner.add_links(link)
self.planner.start()
link.transfer.assert_not_called()
self.planner.shutdown()
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_immediate_transfer_override_link(self, link):
self.planner.immediate_transfer = False
self.planner.add_links(link)
self.planner.start()
link.transfer.assert_not_called()
self.planner.shutdown()
@patch(fqname(Link), spec=Link, immediate_transfer=True)
@patch(fqname(Link), spec=Link, immediate_transfer=False)
def test_immediate_transfer_two_link_off(self, link1, link2):
self.planner.add_links([link1, link2])
self.planner.start()
link1.transfer.assert_not_called()
link2.transfer.assert_called()
self.planner.shutdown()
@patch('atexit._run_exitfuncs')
@patch(fqname(Link), spec=Link, immediate_transfer=True)
def test_shutdown_at_exit(self, link, atexit_run_exitfuncs):
self.setUp(shutdown_at_exit=True)
self.planner.add_links(link)
self.planner.start()
atexit_run_exitfuncs.side_effect = lambda: self.planner._at_exit_callback()
with self.assertLogs(logging.getLogger('databay'), level='INFO') as cm:
atexit_run_exitfuncs()
self.assertTrue('Attempting to shutdown planner' in ';'.join(cm.output))
self.planner._shutdown_planner.assert_called()
link.on_shutdown.assert_called()
@patch(fqname(Link), spec=Link, immediate_transfer=False)
def test_force_transfer(self, link):
self.planner.add_links(link)
self.planner.force_transfer()
link.transfer.assert_called()
@patch(fqname(Link), spec=Link, immediate_transfer=False)
def test_force_transfer_exception(self, link):
link.transfer.side_effect = DummyException('First transfer exception!')
self.planner.add_links(link)
with self.assertLogs(logging.getLogger('databay.BasePlanner'), level='WARNING') as cm:
self.planner.force_transfer()
self.assertTrue(
'First transfer exception!' in ';'.join(cm.output))
link.transfer.assert_called()
| 37.245763
| 102
| 0.671331
| 1,073
| 8,790
| 5.294501
| 0.097856
| 0.139412
| 0.058088
| 0.070234
| 0.780672
| 0.758317
| 0.729273
| 0.711494
| 0.686499
| 0.661151
| 0
| 0.000876
| 0.220705
| 8,790
| 235
| 103
| 37.404255
| 0.828467
| 0.024118
| 0
| 0.677419
| 0
| 0
| 0.064512
| 0.00245
| 0
| 0
| 0
| 0
| 0.236559
| 1
| 0.145161
| false
| 0
| 0.048387
| 0
| 0.198925
| 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
|
9a7b0ac6f76494aaef07428ea6775f95837e9564
| 164
|
py
|
Python
|
config.py
|
henrythor/mannanofn
|
9030a90c51fb1265a922796403fae059cb2163ca
|
[
"MIT"
] | 1
|
2018-03-05T00:16:37.000Z
|
2018-03-05T00:16:37.000Z
|
config.py
|
henrythor/mannanofn
|
9030a90c51fb1265a922796403fae059cb2163ca
|
[
"MIT"
] | 3
|
2021-03-31T18:37:16.000Z
|
2021-12-13T19:44:12.000Z
|
config.py
|
henrythor/mannanofn
|
9030a90c51fb1265a922796403fae059cb2163ca
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
config = {
"consumer_key": "VALUE",
"consumer_secret": "VALUE",
"access_token": "VALUE",
"access_token_secret": "VALUE",
}
| 18.222222
| 35
| 0.573171
| 17
| 164
| 5.235294
| 0.588235
| 0.247191
| 0.359551
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007692
| 0.207317
| 164
| 8
| 36
| 20.5
| 0.676923
| 0.128049
| 0
| 0
| 0
| 0
| 0.553191
| 0
| 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
|
9ad08cba051bcd27ce870f992d39c70d0df8c039
| 356
|
py
|
Python
|
tests/test_util.py
|
fernandobrito/diff_cover
|
fc4be9767ebd5c31d29c34d1720c8fe2ad5f00ca
|
[
"Apache-2.0"
] | 276
|
2019-07-08T10:11:46.000Z
|
2022-03-30T09:36:28.000Z
|
tests/test_util.py
|
fernandobrito/diff_cover
|
fc4be9767ebd5c31d29c34d1720c8fe2ad5f00ca
|
[
"Apache-2.0"
] | 153
|
2019-06-30T19:55:51.000Z
|
2022-03-25T19:12:04.000Z
|
tests/test_util.py
|
fernandobrito/diff_cover
|
fc4be9767ebd5c31d29c34d1720c8fe2ad5f00ca
|
[
"Apache-2.0"
] | 73
|
2019-08-14T10:06:44.000Z
|
2022-03-14T00:38:55.000Z
|
import sys
from diff_cover import util
def test_to_unix_path():
"""
Ensure the _to_unix_path static function handles paths properly.
"""
assert util.to_unix_path("foo/bar") == "foo/bar"
assert util.to_unix_path("foo\\bar") == "foo/bar"
if sys.platform.startswith("win"):
assert util.to_unix_path("FOO\\bar") == "foo/bar"
| 25.428571
| 68
| 0.66573
| 54
| 356
| 4.148148
| 0.462963
| 0.160714
| 0.223214
| 0.214286
| 0.428571
| 0.428571
| 0.428571
| 0.428571
| 0.428571
| 0
| 0
| 0
| 0.188202
| 356
| 13
| 69
| 27.384615
| 0.775087
| 0.179775
| 0
| 0
| 0
| 0
| 0.17029
| 0
| 0
| 0
| 0
| 0
| 0.428571
| 1
| 0.142857
| true
| 0
| 0.285714
| 0
| 0.428571
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9ae4d2c4d43eddc055c0037267e2309a0e6f86ff
| 113
|
py
|
Python
|
axiom/__init__.py
|
AusClimateService/axiom
|
24678093065a4626549831086e4903e38f60fa81
|
[
"MIT"
] | null | null | null |
axiom/__init__.py
|
AusClimateService/axiom
|
24678093065a4626549831086e4903e38f60fa81
|
[
"MIT"
] | 8
|
2022-03-16T12:08:12.000Z
|
2022-03-29T03:17:47.000Z
|
axiom/__init__.py
|
AusClimateService/axiom
|
24678093065a4626549831086e4903e38f60fa81
|
[
"MIT"
] | null | null | null |
"""Axiom main module."""
from importlib.metadata import version
# Version handle
__version__ = version('axiom')
| 18.833333
| 38
| 0.752212
| 13
| 113
| 6.230769
| 0.692308
| 0.345679
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123894
| 113
| 5
| 39
| 22.6
| 0.818182
| 0.300885
| 0
| 0
| 0
| 0
| 0.068493
| 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
|
b10ffe879fd39b945bb8969e44b518f1e4c29d66
| 65
|
py
|
Python
|
amaretto/amaretto/__init__.py
|
the1bit/amaretto
|
de0ef68584468b6ca5acc49a665d8e746a377ba4
|
[
"MIT"
] | 1
|
2018-05-12T13:28:55.000Z
|
2018-05-12T13:28:55.000Z
|
amaretto/amaretto/__init__.py
|
the1bit/amaretto
|
de0ef68584468b6ca5acc49a665d8e746a377ba4
|
[
"MIT"
] | null | null | null |
amaretto/amaretto/__init__.py
|
the1bit/amaretto
|
de0ef68584468b6ca5acc49a665d8e746a377ba4
|
[
"MIT"
] | null | null | null |
__all__ = ['amarettocore', 'amarettorestore', 'amarettostorage']
| 32.5
| 64
| 0.753846
| 4
| 65
| 11.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 65
| 1
| 65
| 65
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0.646154
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b114d5a97f46aa26e95c4e545f42912511548c85
| 624
|
py
|
Python
|
openclean/function/value/normalize/__init__.py
|
remram44/openclean-core
|
8c09c8302cadbb3bb02c959907f91a3ae343f939
|
[
"BSD-3-Clause"
] | 4
|
2021-04-20T09:06:26.000Z
|
2021-11-20T20:31:28.000Z
|
openclean/function/value/normalize/__init__.py
|
remram44/openclean-core
|
8c09c8302cadbb3bb02c959907f91a3ae343f939
|
[
"BSD-3-Clause"
] | 14
|
2021-01-19T19:23:16.000Z
|
2021-04-28T14:31:03.000Z
|
openclean/function/value/normalize/__init__.py
|
remram44/openclean-core
|
8c09c8302cadbb3bb02c959907f91a3ae343f939
|
[
"BSD-3-Clause"
] | 5
|
2021-08-24T11:57:21.000Z
|
2022-03-17T04:39:04.000Z
|
# This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Import normalization functions. Mainly for backward compatibility."""
from openclean.function.value.normalize.numeric import NumericNormalizer
from openclean.function.value.normalize.numeric import divide_by_total, max_abs_scale, min_max_scale
from openclean.function.value.normalize.numeric import DivideByTotal, MaxAbsScale, MinMaxScale
from openclean.function.value.normalize.text import TextNormalizer
| 44.571429
| 100
| 0.825321
| 81
| 624
| 6.283951
| 0.617284
| 0.102161
| 0.165029
| 0.204322
| 0.35167
| 0.282908
| 0.282908
| 0
| 0
| 0
| 0
| 0.014337
| 0.105769
| 624
| 13
| 101
| 48
| 0.897849
| 0.429487
| 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
| 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
| 1
| 0
|
0
| 4
|
b117f0e0bf823ea00d4a353a8f622399cae25886
| 58
|
py
|
Python
|
minato_namikaze/botmain/bot/lib/data/__init__.py
|
Onii-Chan-Discord/yondaime-hokage
|
d6e75405a9d30b37bfb4fd588f02c0de813c92b1
|
[
"Apache-2.0"
] | 8
|
2021-05-20T07:32:20.000Z
|
2022-02-09T17:09:38.000Z
|
minato_namikaze/bot_files/lib/data/__init__.py
|
ooliver1/yondaime-hokage
|
3552887dc022c8ace13de9dae01392b9471e5f58
|
[
"Apache-2.0"
] | 77
|
2021-06-18T08:55:12.000Z
|
2022-03-31T07:15:12.000Z
|
minato_namikaze/bot_files/lib/data/__init__.py
|
ooliver1/yondaime-hokage
|
3552887dc022c8ace13de9dae01392b9471e5f58
|
[
"Apache-2.0"
] | 8
|
2021-08-14T11:29:49.000Z
|
2022-03-16T17:37:53.000Z
|
from .braille import *
from .periodic_table_data import *
| 19.333333
| 34
| 0.793103
| 8
| 58
| 5.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137931
| 58
| 2
| 35
| 29
| 0.88
| 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
|
b129fb011106e7483a1799d84371dfd5d3f6daec
| 22
|
py
|
Python
|
config.example.py
|
KristobalJunta/alternatives-bot
|
24e7181f95b33d09c0041358e268201be569ecc3
|
[
"WTFPL"
] | null | null | null |
config.example.py
|
KristobalJunta/alternatives-bot
|
24e7181f95b33d09c0041358e268201be569ecc3
|
[
"WTFPL"
] | null | null | null |
config.example.py
|
KristobalJunta/alternatives-bot
|
24e7181f95b33d09c0041358e268201be569ecc3
|
[
"WTFPL"
] | null | null | null |
token='your-bot-token'
| 22
| 22
| 0.772727
| 4
| 22
| 4.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 22
| 1
| 22
| 22
| 0.772727
| 0
| 0
| 0
| 0
| 0
| 0.608696
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b17c70ba91959cfd84956d20bc7fd9483adead3e
| 530
|
py
|
Python
|
__main__.py
|
Liam-Cassidy/StoveOptFiles
|
cee51758c2b08ac4a7d9b0d8b03c2d85bd6c4916
|
[
"MIT"
] | null | null | null |
__main__.py
|
Liam-Cassidy/StoveOptFiles
|
cee51758c2b08ac4a7d9b0d8b03c2d85bd6c4916
|
[
"MIT"
] | null | null | null |
__main__.py
|
Liam-Cassidy/StoveOptFiles
|
cee51758c2b08ac4a7d9b0d8b03c2d85bd6c4916
|
[
"MIT"
] | null | null | null |
# Goal is to check if this looping works in the StoveOptFiles repo
import os
import numpy as np
import iterative_case_check
from iterative_case_check import *
def main():
cases_path, length_case_directory_list, case_directory_list = navigate_to_cases()
reloc_dir, case_list_total, case_list_to_run, case_list_ran = count_cases_to_run(cases_path, length_case_directory_list, case_directory_list)
# while loop for running the cases. Going one by one for now.
if __name__ == "__main__":
main()
| 29.444444
| 146
| 0.764151
| 82
| 530
| 4.487805
| 0.52439
| 0.141304
| 0.184783
| 0.103261
| 0.266304
| 0.266304
| 0.266304
| 0.266304
| 0.266304
| 0
| 0
| 0
| 0.183019
| 530
| 17
| 147
| 31.176471
| 0.849885
| 0.233962
| 0
| 0
| 0
| 0
| 0.020725
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| true
| 0
| 0.444444
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b186d8f77bb943be649b7cf9cca7d6034285ec6d
| 188
|
py
|
Python
|
src/atom/constants.py
|
bryanlabs/staketaxcsv
|
7879b75d242d796ee6959e7d9e0b4d9dcb2966dd
|
[
"MIT"
] | 1
|
2022-01-11T11:58:29.000Z
|
2022-01-11T11:58:29.000Z
|
src/atom/constants.py
|
bryanlabs/staketaxcsv
|
7879b75d242d796ee6959e7d9e0b4d9dcb2966dd
|
[
"MIT"
] | null | null | null |
src/atom/constants.py
|
bryanlabs/staketaxcsv
|
7879b75d242d796ee6959e7d9e0b4d9dcb2966dd
|
[
"MIT"
] | null | null | null |
EXCHANGE_COSMOS_BLOCKCHAIN = "cosmos_blockchain"
CUR_ATOM = "ATOM"
MILLION = 1000000.0
CURRENCIES = {
"ibc/14F9BC3E44B8A9C1BE1FB08980FAB87034C9905EF17CF2F5008FC085218811CC": "OSMO"
}
| 23.5
| 82
| 0.803191
| 15
| 188
| 9.8
| 0.8
| 0.217687
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 0.106383
| 188
| 7
| 83
| 26.857143
| 0.589286
| 0
| 0
| 0
| 0
| 0
| 0.497326
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b1a0d59c964ffae8436f20a5a2455369ff678ff2
| 128
|
py
|
Python
|
music_app/music_app/context.py
|
DramatikMan/music-app
|
d5f3c117537d6ff87181372b4bf25ab72fefb89f
|
[
"MIT"
] | null | null | null |
music_app/music_app/context.py
|
DramatikMan/music-app
|
d5f3c117537d6ff87181372b4bf25ab72fefb89f
|
[
"MIT"
] | null | null | null |
music_app/music_app/context.py
|
DramatikMan/music-app
|
d5f3c117537d6ff87181372b4bf25ab72fefb89f
|
[
"MIT"
] | null | null | null |
import os
def export_vars(request):
data = {}
data['SCRIPT_NAME'] = os.environ.get('SCRIPT_NAME', '')
return data
| 18.285714
| 59
| 0.632813
| 17
| 128
| 4.588235
| 0.705882
| 0.25641
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.210938
| 128
| 7
| 60
| 18.285714
| 0.772277
| 0
| 0
| 0
| 0
| 0
| 0.170543
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0
| 0.6
| 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
|
4908999e935ded8db46fa967bbd973ca2d228e8b
| 546
|
py
|
Python
|
python/misc/switch.py
|
pgularski/snippets
|
0b34ac837dd768f3dfa72dbf3e3d271c51e71da9
|
[
"MIT"
] | null | null | null |
python/misc/switch.py
|
pgularski/snippets
|
0b34ac837dd768f3dfa72dbf3e3d271c51e71da9
|
[
"MIT"
] | null | null | null |
python/misc/switch.py
|
pgularski/snippets
|
0b34ac837dd768f3dfa72dbf3e3d271c51e71da9
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# −*− coding: UTF−8 −*−
def fun_a():
return 'A'
def fun_b():
return 'B'
def fun_c():
return 'C'
def fun_default():
return 'default'
switch = {'a': fun_a,
'b': fun_b,
'c': fun_c}
def test():
from simpletest import _assert
_assert(switch.get('a', fun_default)(), 'A')
_assert(switch.get('b', fun_default)(), 'B')
_assert(switch.get('c', fun_default)(), 'C')
_assert(switch.get('nonexistent', fun_default)(), 'default')
if __name__ == '__main__':
test()
| 15.6
| 64
| 0.565934
| 80
| 546
| 3.625
| 0.325
| 0.172414
| 0.206897
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.002387
| 0.232601
| 546
| 34
| 65
| 16.058824
| 0.677804
| 0.076923
| 0
| 0
| 0
| 0
| 0.089641
| 0
| 0
| 0
| 0
| 0
| 0.263158
| 1
| 0.263158
| false
| 0
| 0.052632
| 0.210526
| 0.526316
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
490fa41159bf1d68ce1461fd9064f01ae2902825
| 112
|
py
|
Python
|
solutions/2_Using_ITK_in_Python_real_world_filters_median.py
|
mikiec84/CourseInBiomedicalImageAnalysisVisualizationAndArtificialIntelligence
|
bbdb743ef814c9ddddb656fa4ddb50e24bf9f3ca
|
[
"Apache-2.0"
] | 30
|
2019-08-28T09:15:05.000Z
|
2021-04-19T17:43:35.000Z
|
solutions/2_Using_ITK_in_Python_real_world_filters_median.py
|
mikiec84/CourseInBiomedicalImageAnalysisVisualizationAndArtificialIntelligence
|
bbdb743ef814c9ddddb656fa4ddb50e24bf9f3ca
|
[
"Apache-2.0"
] | 1
|
2020-05-26T17:35:31.000Z
|
2020-06-01T21:41:00.000Z
|
solutions/2_Using_ITK_in_Python_real_world_filters_median.py
|
mikiec84/CourseInBiomedicalImageAnalysisVisualizationAndArtificialIntelligence
|
bbdb743ef814c9ddddb656fa4ddb50e24bf9f3ca
|
[
"Apache-2.0"
] | 14
|
2019-10-02T17:16:04.000Z
|
2021-02-24T17:28:24.000Z
|
median_filtered_image = itk.median_image_filter(image, radius=5)
view(median_filtered_image, ui_collapsed=True)
| 37.333333
| 64
| 0.857143
| 17
| 112
| 5.235294
| 0.647059
| 0.314607
| 0.426966
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009434
| 0.053571
| 112
| 2
| 65
| 56
| 0.830189
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
491166c8980a2f9ce38542486871e9a47d208e98
| 61
|
py
|
Python
|
tests/__init__.py
|
bellockk/amtool
|
3650697120ac384ac3a0020c84b790ca734df218
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
bellockk/amtool
|
3650697120ac384ac3a0020c84b790ca734df218
|
[
"MIT"
] | 2
|
2019-05-30T11:17:51.000Z
|
2021-11-15T17:48:34.000Z
|
tests/__init__.py
|
bellockk/amtool
|
3650697120ac384ac3a0020c84b790ca734df218
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Unit test package for amtool."""
| 15.25
| 35
| 0.557377
| 8
| 61
| 4.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.180328
| 61
| 3
| 36
| 20.333333
| 0.66
| 0.852459
| 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
|
4954ff059ebc80f7964b742296f0b665d22d6dff
| 542
|
py
|
Python
|
js_routes/utils/text.py
|
girardinsamuel/django-js-routes
|
706b9e12172ba65cd44edb733a6a2c6ef91bab23
|
[
"MIT"
] | 19
|
2019-10-17T08:32:46.000Z
|
2022-03-22T23:38:23.000Z
|
js_routes/utils/text.py
|
girardinsamuel/django-js-routes
|
706b9e12172ba65cd44edb733a6a2c6ef91bab23
|
[
"MIT"
] | 6
|
2020-05-29T17:13:26.000Z
|
2022-02-10T09:50:41.000Z
|
js_routes/utils/text.py
|
girardinsamuel/django-js-routes
|
706b9e12172ba65cd44edb733a6a2c6ef91bab23
|
[
"MIT"
] | 4
|
2020-09-23T12:11:58.000Z
|
2021-11-08T11:48:49.000Z
|
"""
JS Routes text utilities
========================
This modules defines utilities for manipulating and performing operations on strings.
"""
from functools import reduce
def replace(data, replacements):
""" Allows to performs several string substitutions.
This function performs several string substitutions on the initial ``data`` string using a list
of 2-tuples (old, new) defining substitutions and returns the resulting string.
"""
return reduce(lambda a, kv: a.replace(*kv), replacements, data)
| 27.1
| 99
| 0.695572
| 65
| 542
| 5.8
| 0.692308
| 0.079576
| 0.111406
| 0.180371
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.002283
| 0.191882
| 542
| 19
| 100
| 28.526316
| 0.858447
| 0.667897
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 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
|
4957cca4c21996b21135a879d03101c9c359646f
| 314
|
py
|
Python
|
tests/exploratory/step_match_repr/example/model.py
|
temoctzin/radish
|
1d904b9a7bf9eb5b263c86e3fc3a996956747ecc
|
[
"MIT"
] | null | null | null |
tests/exploratory/step_match_repr/example/model.py
|
temoctzin/radish
|
1d904b9a7bf9eb5b263c86e3fc3a996956747ecc
|
[
"MIT"
] | null | null | null |
tests/exploratory/step_match_repr/example/model.py
|
temoctzin/radish
|
1d904b9a7bf9eb5b263c86e3fc3a996956747ecc
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
class Hero(object):
def __init__(self, forename, surname, hero):
self.forename = forename
self.surname = surname
self.heroname = hero
def __repr__(self):
return 'Hero({0}, {1}, {2})'.format(
self.forename, self.surname, self.heroname)
| 24.153846
| 55
| 0.579618
| 36
| 314
| 4.833333
| 0.5
| 0.206897
| 0.218391
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017467
| 0.270701
| 314
| 12
| 56
| 26.166667
| 0.742358
| 0.066879
| 0
| 0
| 0
| 0
| 0.065292
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.125
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
49885f2b0fd9cd45eeadb3c9a1675f0e13dbc969
| 5,566
|
py
|
Python
|
tensorboard/compat/proto/proto_test.py
|
davidsoergel/tensorboard
|
2f6d8dc93ca83484f8f6473ab008ea43202b3a46
|
[
"Apache-2.0"
] | 2
|
2019-11-23T18:36:20.000Z
|
2019-12-07T20:58:02.000Z
|
tensorboard/compat/proto/proto_test.py
|
davidsoergel/tensorboard
|
2f6d8dc93ca83484f8f6473ab008ea43202b3a46
|
[
"Apache-2.0"
] | 4
|
2020-12-04T21:00:38.000Z
|
2022-01-22T12:49:30.000Z
|
tensorboard/compat/proto/proto_test.py
|
davidsoergel/tensorboard
|
2f6d8dc93ca83484f8f6473ab008ea43202b3a46
|
[
"Apache-2.0"
] | 1
|
2019-10-10T06:04:28.000Z
|
2019-10-10T06:04:28.000Z
|
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================
"""Proto match tests between `tensorboard.compat.proto` and TensorFlow.
These tests verify that the local copy of TensorFlow protos are the same
as those available directly from TensorFlow. Local protos are used to build
`tensorboard-notf` without a TensorFlow dependency.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import difflib
import importlib
import tensorflow as tf
from google.protobuf import descriptor_pb2
# Keep this list synced with BUILD in current directory
PROTO_IMPORTS = [
('tensorflow.core.framework.allocation_description_pb2',
'tensorboard.compat.proto.allocation_description_pb2'),
('tensorflow.core.framework.api_def_pb2',
'tensorboard.compat.proto.api_def_pb2'),
('tensorflow.core.framework.attr_value_pb2',
'tensorboard.compat.proto.attr_value_pb2'),
('tensorflow.core.protobuf.cluster_pb2',
'tensorboard.compat.proto.cluster_pb2'),
('tensorflow.core.protobuf.config_pb2',
'tensorboard.compat.proto.config_pb2'),
('tensorflow.core.framework.cost_graph_pb2',
'tensorboard.compat.proto.cost_graph_pb2'),
('tensorflow.python.framework.cpp_shape_inference_pb2',
'tensorboard.compat.proto.cpp_shape_inference_pb2'),
('tensorflow.core.protobuf.debug_pb2',
'tensorboard.compat.proto.debug_pb2'),
('tensorflow.core.util.event_pb2',
'tensorboard.compat.proto.event_pb2'),
('tensorflow.core.framework.function_pb2',
'tensorboard.compat.proto.function_pb2'),
('tensorflow.core.framework.graph_pb2',
'tensorboard.compat.proto.graph_pb2'),
('tensorflow.core.protobuf.meta_graph_pb2',
'tensorboard.compat.proto.meta_graph_pb2'),
('tensorflow.core.framework.node_def_pb2',
'tensorboard.compat.proto.node_def_pb2'),
('tensorflow.core.framework.op_def_pb2',
'tensorboard.compat.proto.op_def_pb2'),
('tensorflow.core.framework.resource_handle_pb2',
'tensorboard.compat.proto.resource_handle_pb2'),
('tensorflow.core.protobuf.rewriter_config_pb2',
'tensorboard.compat.proto.rewriter_config_pb2'),
('tensorflow.core.protobuf.saved_object_graph_pb2',
'tensorboard.compat.proto.saved_object_graph_pb2'),
('tensorflow.core.protobuf.saver_pb2',
'tensorboard.compat.proto.saver_pb2'),
('tensorflow.core.framework.step_stats_pb2',
'tensorboard.compat.proto.step_stats_pb2'),
('tensorflow.core.protobuf.struct_pb2',
'tensorboard.compat.proto.struct_pb2'),
('tensorflow.core.framework.summary_pb2',
'tensorboard.compat.proto.summary_pb2'),
('tensorflow.core.framework.tensor_pb2',
'tensorboard.compat.proto.tensor_pb2'),
('tensorflow.core.framework.tensor_description_pb2',
'tensorboard.compat.proto.tensor_description_pb2'),
('tensorflow.core.framework.tensor_shape_pb2',
'tensorboard.compat.proto.tensor_shape_pb2'),
('tensorflow.core.profiler.tfprof_log_pb2',
'tensorboard.compat.proto.tfprof_log_pb2'),
('tensorflow.core.protobuf.trackable_object_graph_pb2',
'tensorboard.compat.proto.trackable_object_graph_pb2'),
('tensorflow.core.framework.types_pb2',
'tensorboard.compat.proto.types_pb2'),
('tensorflow.core.framework.variable_pb2',
'tensorboard.compat.proto.variable_pb2'),
('tensorflow.core.framework.versions_pb2',
'tensorboard.compat.proto.versions_pb2'),
]
PROTO_REPLACEMENTS = [
('tensorflow/core/framework/', 'tensorboard/compat/proto/'),
('tensorflow/core/protobuf/', 'tensorboard/compat/proto/'),
('tensorflow/core/profiler/', 'tensorboard/compat/proto/'),
('tensorflow/python/framework/', 'tensorboard/compat/proto/'),
('tensorflow/core/util/', 'tensorboard/compat/proto/'),
('package: "tensorflow.tfprof"', 'package: "tensorboard"'),
('package: "tensorflow"', 'package: "tensorboard"'),
('type_name: ".tensorflow.tfprof', 'type_name: ".tensorboard'),
('type_name: ".tensorflow', 'type_name: ".tensorboard'),
]
class ProtoMatchTest(tf.test.TestCase):
def test_each_proto_matches_tensorflow(self):
for tf_path, tb_path in PROTO_IMPORTS:
tf_pb2 = importlib.import_module(tf_path)
tb_pb2 = importlib.import_module(tb_path)
expected = descriptor_pb2.FileDescriptorProto()
actual = descriptor_pb2.FileDescriptorProto()
tf_pb2.DESCRIPTOR.CopyToProto(expected)
tb_pb2.DESCRIPTOR.CopyToProto(actual)
# Convert expected to be actual since this matches the
# replacements done in proto/update.sh
actual = str(actual)
expected = str(expected)
for orig, repl in PROTO_REPLACEMENTS:
expected = expected.replace(orig, repl)
diff = difflib.unified_diff(actual.splitlines(1),
expected.splitlines(1))
diff = ''.join(diff)
self.assertEquals(diff, '',
'{} and {} did not match:\n{}'.format(tf_path, tb_path, diff))
if __name__ == '__main__':
tf.test.main()
| 40.926471
| 80
| 0.734998
| 672
| 5,566
| 5.870536
| 0.275298
| 0.150824
| 0.195184
| 0.183777
| 0.238023
| 0.041065
| 0
| 0
| 0
| 0
| 0
| 0.015413
| 0.125764
| 5,566
| 135
| 81
| 41.22963
| 0.795314
| 0.193317
| 0
| 0
| 0
| 0
| 0.61876
| 0.567271
| 0
| 0
| 0
| 0
| 0.010204
| 1
| 0.010204
| false
| 0
| 0.112245
| 0
| 0.132653
| 0.010204
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
770ef91e4d1607040e6b0d504b09eb4c9418fb2d
| 134
|
py
|
Python
|
code/thalesians/settings.py
|
thalesians/bayestsa
|
d54ea04ffa9903473b11c906545e95b2666afb88
|
[
"Apache-2.0"
] | 18
|
2017-03-07T19:13:18.000Z
|
2021-01-05T00:35:30.000Z
|
code/thalesians/settings.py
|
HanMeh/bayestsa
|
d54ea04ffa9903473b11c906545e95b2666afb88
|
[
"Apache-2.0"
] | null | null | null |
code/thalesians/settings.py
|
HanMeh/bayestsa
|
d54ea04ffa9903473b11c906545e95b2666afb88
|
[
"Apache-2.0"
] | 14
|
2016-12-27T00:09:40.000Z
|
2020-12-27T19:23:53.000Z
|
MIN_PRECONDITION_LEVEL = 1
MIN_POSTCONDITION_LEVEL = 1
try:
from local_thalesians_settings import *
except ImportError:
pass
| 16.75
| 43
| 0.791045
| 17
| 134
| 5.882353
| 0.823529
| 0.12
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018018
| 0.171642
| 134
| 7
| 44
| 19.142857
| 0.882883
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.166667
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
772d2b739be692dee90c471e0414fc95b339eb57
| 63
|
py
|
Python
|
tests/test_monkey.py
|
AndreLouisCaron/aiotk
|
b68eb60a9cf620952651b3db593c9120d2779edd
|
[
"MIT"
] | 5
|
2017-04-29T01:44:08.000Z
|
2019-08-05T12:20:35.000Z
|
tests/test_monkey.py
|
AndreLouisCaron/aiotk
|
b68eb60a9cf620952651b3db593c9120d2779edd
|
[
"MIT"
] | 7
|
2016-07-28T02:31:11.000Z
|
2018-05-16T01:32:17.000Z
|
tests/test_monkey.py
|
AndreLouisCaron/aiotk
|
b68eb60a9cf620952651b3db593c9120d2779edd
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
def test_readuntil(monkey):
pass
| 10.5
| 27
| 0.587302
| 8
| 63
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020408
| 0.222222
| 63
| 5
| 28
| 12.6
| 0.714286
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 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
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
77430770294e5379a11323d5f3ea796da97259ff
| 6,073
|
py
|
Python
|
Simulator/my_output.py
|
nicoladainese96/CoopVM
|
91064e8495e2bb4c6dfd27fd52801f1ba871fb44
|
[
"MIT"
] | null | null | null |
Simulator/my_output.py
|
nicoladainese96/CoopVM
|
91064e8495e2bb4c6dfd27fd52801f1ba871fb44
|
[
"MIT"
] | null | null | null |
Simulator/my_output.py
|
nicoladainese96/CoopVM
|
91064e8495e2bb4c6dfd27fd52801f1ba871fb44
|
[
"MIT"
] | 1
|
2018-10-08T11:52:59.000Z
|
2018-10-08T11:52:59.000Z
|
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 21 08:30:32 2018
@author: nicola.dainese96@gmail.com
"""
def print_matrix(A, S1, S2, C, filename, parent_dir):
import matplotlib.pyplot as plt
from ensure_dir import ensure_dir
import os
script_dir = os.getcwd()
fig = plt.figure()
ax = fig.add_subplot(111)
ax.imshow(A, cmap = 'Greys')
ax.set_title('Matrice interazioni con dati reali e connettanza = {}'.format(C))
ax.set_xlabel('Numero specie piante: S2 = {}'.format(S2))
ax.set_ylabel('Numero specie impollinatori: S1 = {}'.format(S1))
xtics = [x-0.5 for x in range(0,S2+1)]
ytics = [x-0.5 for x in range(0,S1+1)]
ax.grid()
ax.set_yticks(ytics)
ax.set_xticks(xtics)
plt.setp(ax.get_xticklabels(), visible=False)
plt.setp(ax.get_yticklabels(), visible=False)
path = parent_dir+'/'+filename+'//prova.txt'
ensure_dir(path)
directory = os.path.dirname(path)
os.chdir(directory)
fig.savefig(filename+'_matrix.png')
plt.close()
os.chdir(script_dir)
def print_matrix2(A, S1, S2, C, NODF, re, parent_dir):
import matplotlib.pyplot as plt
from ensure_dir import ensure_dir
import os
script_dir = os.getcwd()
fig = plt.figure()
ax = fig.add_subplot(111)
ax.imshow(A, cmap = 'Greys')
ax.set_title('Matrice per step {} con C = {} e NODF = {}'.format(re, C, NODF))
ax.set_xlabel('S2 = {}'.format(S2))
ax.set_ylabel('S1 = {}'.format(S1))
xtics = [x-0.5 for x in range(0,S2+1)]
ytics = [x-0.5 for x in range(0,S1+1)]
ax.grid()
ax.set_yticks(ytics)
ax.set_xticks(xtics)
plt.setp(ax.get_xticklabels(), visible=False)
plt.setp(ax.get_yticklabels(), visible=False)
path = parent_dir+'//prova.txt'
ensure_dir(path)
directory = os.path.dirname(path)
os.chdir(directory)
fig.savefig(repr(C)+'-'+repr(re)+'_matrix.png')
plt.close()
os.chdir(script_dir)
def print_list_csv(l, name, dir_name, rnd =2, d = 2):
from ensure_dir import ensure_dir
file_path = dir_name+'//data_plot//'+ name + '.csv'
ensure_dir(file_path)
with open(file_path, 'a') as f:
if d >1:
for i in range(0,d-1):
print("{},".format(round(l[i],rnd)), end ='', file = f)
print("{}".format(round(l[d-1],rnd)), file = f)
else:
print(l, file = f)
def info_p(N, rip, eps, ps, t, work_dir, parent_dir):
from ensure_dir import ensure_dir
file_path = work_dir+'/info_p.csv'
ensure_dir(file_path)
with open(file_path, 'a') as f:
print(parent_dir, N, rip, eps, sep = ',', end = '', file = f)
for i in range(len(ps)-1):
print( '',ps[i], sep = ',', end = '', file = f)
print( '',ps[-1], t, sep = ',', file = f)
def info_e( N, rip, epsilons, p, t, work_dir, parent_dir):
from ensure_dir import ensure_dir
file_path = work_dir+'/info_e.csv'
ensure_dir(file_path)
with open(file_path, 'a') as f:
print(parent_dir, N, rip, sep = ',', end = '', file = f)
for i in range(len(epsilons)-1):
print( '',epsilons[i], sep = ',', end = '', file = f)
print( '',epsilons[-1], p, t, sep = ',', file = f)
def info_NODF( N, rip, NODFs, eps, p, t, work_dir, parent_dir):
from ensure_dir import ensure_dir
file_path = work_dir+'/info_NODF.csv'
ensure_dir(file_path)
with open(file_path, 'a') as f:
print(parent_dir, N, rip, sep = ',', end = '', file = f)
for i in range(len(NODFs)-1):
print( '',NODFs[i], sep = ',', end = '', file = f)
print( '',NODFs[-1], eps, p, t, sep = ',', file = f)
def info_precision( N, rip, NODFs, eps, p, t, work_dir, parent_dir):
from ensure_dir import ensure_dir
file_path = work_dir+'/info_precision.csv'
ensure_dir(file_path)
with open(file_path, 'a') as f:
print(parent_dir, N, rip, sep = ',', end = '', file = f)
for i in range(len(NODFs)-1):
print( '',NODFs[i], sep = ',', end = '', file = f)
print( '',NODFs[-1], eps, p, t, sep = ',', file = f)
def N_print_info_csv(eps, p, rip, dir_name, parent_dir):
n1 = dir_name
n2 = dir_name
S1 = dir_name
S2 = dir_name
for i in range (rip):
file_name = repr(eps)+'-'+repr(p)+'-'+repr(rip)+'-'+repr(i)+'.csv'
n1 = n1+',N_n1_'+file_name
n2 = n2+',N_n2_'+file_name
S1 = S1+',N_S1_'+file_name
S2 = S2+',N_S2_'+file_name
print_string_csv(n1, 'N_n1_', parent_dir)
print_string_csv(n2, 'N_n2_', parent_dir)
print_string_csv(S1, 'N_S1_', parent_dir)
print_string_csv(S2, 'N_S2_', parent_dir)
def R_print_info_csv(eps, p, rip, dir_name, parent_dir):
n1 = dir_name
n2 = dir_name
S1 = dir_name
S2 = dir_name
for i in range (rip):
file_name = repr(eps)+'-'+repr(p)+'-'+repr(rip)+'-'+repr(i)+'.csv'
n1 = n1+',R_n1_'+file_name
n2 = n2+',R_n2_'+file_name
S1 = S1+',R_S1_'+file_name
S2 = S2+',R_S2_'+file_name
print_string_csv(n1, 'R_n1_', parent_dir)
print_string_csv(n2, 'R_n2_', parent_dir)
print_string_csv(S1, 'R_S1_', parent_dir)
print_string_csv(S2, 'R_S2_', parent_dir)
def NODF_print_info_csv(NODF, eps, p, rip, dir_name, parent_dir):
n1 = dir_name
n2 = dir_name
S1 = dir_name
S2 = dir_name
for i in range (rip):
file_name = repr(NODF)+'-'+repr(eps)+'-'+repr(p)+'-'+repr(rip)+'-'+repr(i)+'.csv'
n1 = n1+',n1_'+file_name
n2 = n2+',n2_'+file_name
S1 = S1+',S1_'+file_name
S2 = S2+',S2_'+file_name
print_string_csv(n1, 'n1_', parent_dir)
print_string_csv(n2, 'n2_', parent_dir)
print_string_csv(S1, 'S1_', parent_dir)
print_string_csv(S2, 'S2_', parent_dir)
def print_string_csv(string, name, dir_name):
from ensure_dir import ensure_dir
file_path = dir_name+'//'+ name + 'files.csv'
ensure_dir(file_path)
with open(file_path, 'a') as f:
print(string, file = f)
| 35.30814
| 89
| 0.588342
| 965
| 6,073
| 3.473575
| 0.135751
| 0.072494
| 0.054296
| 0.060859
| 0.808473
| 0.770883
| 0.743437
| 0.641408
| 0.641408
| 0.63395
| 0
| 0.030481
| 0.243702
| 6,073
| 172
| 90
| 35.30814
| 0.699325
| 0.015643
| 0
| 0.554054
| 0
| 0
| 0.079384
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.074324
| false
| 0
| 0.081081
| 0
| 0.155405
| 0.236486
| 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
|
91f733d205aa0965457033f9b27019e3e52b01b1
| 285
|
py
|
Python
|
portia2code/starturls.py
|
kirinse/portia2code
|
8e7cdd26c6a8b20fb293a5099e554d6fdd778e48
|
[
"BSD-3-Clause"
] | 46
|
2016-06-08T12:46:45.000Z
|
2022-01-05T09:12:35.000Z
|
portia2code/starturls.py
|
strategist922/portia2code
|
0b740a435a81e1c8b1a461cfdc8e41f750f3690b
|
[
"BSD-3-Clause"
] | 9
|
2016-10-13T02:35:10.000Z
|
2020-01-10T14:39:14.000Z
|
portia2code/starturls.py
|
strategist922/portia2code
|
0b740a435a81e1c8b1a461cfdc8e41f750f3690b
|
[
"BSD-3-Clause"
] | 23
|
2016-07-07T18:40:34.000Z
|
2020-09-04T23:47:15.000Z
|
# Mock out starturls for ../spiders.py file
class MockGenerator(object):
def __init__(self, *args, **kwargs):
pass
def __call__(self, *args, **kwargs):
return []
class FeedGenerator(MockGenerator):
pass
class FragmentGenerator(MockGenerator):
pass
| 17.8125
| 43
| 0.666667
| 30
| 285
| 6.066667
| 0.666667
| 0.087912
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.221053
| 285
| 15
| 44
| 19
| 0.81982
| 0.14386
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.333333
| 0
| 0.111111
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
620ec2ccfce845e06e670108c804b7a7c2b5f676
| 735
|
py
|
Python
|
ux/location.py
|
vahndi/ux
|
8acb3c07327e547ee948788536b6d6d1d7815bb2
|
[
"MIT"
] | null | null | null |
ux/location.py
|
vahndi/ux
|
8acb3c07327e547ee948788536b6d6d1d7815bb2
|
[
"MIT"
] | 43
|
2019-05-30T12:26:52.000Z
|
2020-08-02T21:57:24.000Z
|
ux/location.py
|
vahndi/ux
|
8acb3c07327e547ee948788536b6d6d1d7815bb2
|
[
"MIT"
] | null | null | null |
class Location(object):
"""
Represents a Location where an Action could be taken.
"""
def __init__(self, location_id: str):
"""
Create a new Location.
:param location_id: The id of the Location.
"""
self._location_id: str = location_id
@property
def location_id(self) -> str:
"""
Return the id of the Location.
"""
return self._location_id
def __repr__(self) -> str:
return 'Location({})'.format(self._location_id)
def __gt__(self, other: 'Location') -> bool:
return self._location_id > other._location_id
def __lt__(self, other: 'Location') -> bool:
return self._location_id < other._location_id
| 25.344828
| 57
| 0.6
| 88
| 735
| 4.625
| 0.329545
| 0.27027
| 0.206388
| 0.14742
| 0.363636
| 0.275184
| 0.275184
| 0.275184
| 0.275184
| 0.275184
| 0
| 0
| 0.289796
| 735
| 28
| 58
| 26.25
| 0.779693
| 0.206803
| 0
| 0
| 0
| 0
| 0.054581
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.416667
| false
| 0
| 0
| 0.25
| 0.833333
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
622a69ee473fe6af8d6e88d7e7c1c0b366837e8b
| 210
|
py
|
Python
|
tests/test_general.py
|
tpDcc/tpQtLib
|
26b6e893395633a1b189a1b73654891b7688648d
|
[
"MIT"
] | 3
|
2019-08-26T05:56:12.000Z
|
2019-10-03T11:35:53.000Z
|
tests/test_general.py
|
tpDcc/tpQtLib
|
26b6e893395633a1b189a1b73654891b7688648d
|
[
"MIT"
] | null | null | null |
tests/test_general.py
|
tpDcc/tpQtLib
|
26b6e893395633a1b189a1b73654891b7688648d
|
[
"MIT"
] | 1
|
2019-11-10T20:45:07.000Z
|
2019-11-10T20:45:07.000Z
|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains tests for tpPyUtils
"""
import pytest
from tpDcc.libs.qt import __version__
def test_version():
assert __version__.get_version()
| 14
| 40
| 0.7
| 28
| 210
| 4.892857
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005714
| 0.166667
| 210
| 14
| 41
| 15
| 0.777143
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0.25
| true
| 0
| 0.5
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
6230bb602ec3eeae7aaea90497d915edf56067c1
| 139
|
py
|
Python
|
scripts/item/consume_2434776.py
|
pantskun/swordiemen
|
fc33ffec168e6611587fdc75de8270f6827a4176
|
[
"MIT"
] | null | null | null |
scripts/item/consume_2434776.py
|
pantskun/swordiemen
|
fc33ffec168e6611587fdc75de8270f6827a4176
|
[
"MIT"
] | null | null | null |
scripts/item/consume_2434776.py
|
pantskun/swordiemen
|
fc33ffec168e6611587fdc75de8270f6827a4176
|
[
"MIT"
] | null | null | null |
# Insight Expertise Boost Potion (2434776)
from net.swordie.ms.enums import Stat
sm.consumeItem()
chr.addTraitExp(Stat.insightEXP, 93596)
| 23.166667
| 42
| 0.798561
| 19
| 139
| 5.842105
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096
| 0.100719
| 139
| 6
| 43
| 23.166667
| 0.792
| 0.28777
| 0
| 0
| 0
| 0
| 0
| 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
|
623672eb00b79a0e6e94395a50835f66895301dc
| 120
|
py
|
Python
|
modules/thread_module.py
|
akorzunin/binance_candle_plot
|
834991b2a95be045771a5560a1ccd6ac90895347
|
[
"Apache-2.0"
] | null | null | null |
modules/thread_module.py
|
akorzunin/binance_candle_plot
|
834991b2a95be045771a5560a1ccd6ac90895347
|
[
"Apache-2.0"
] | null | null | null |
modules/thread_module.py
|
akorzunin/binance_candle_plot
|
834991b2a95be045771a5560a1ccd6ac90895347
|
[
"Apache-2.0"
] | null | null | null |
class ThreadModule(object):
'''docstring for ThreadModule'''
def __init__(self, ):
super().__init__()
| 20
| 36
| 0.625
| 11
| 120
| 6.090909
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225
| 120
| 6
| 37
| 20
| 0.72043
| 0.216667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
628b74bff562cdae1e2d120cc98940e458b75d5d
| 29,982
|
py
|
Python
|
dlkit/abstract_osid/osid/query_inspectors.py
|
UOC/dlkit
|
a9d265db67e81b9e0f405457464e762e2c03f769
|
[
"MIT"
] | 2
|
2018-02-23T12:16:11.000Z
|
2020-10-08T17:54:24.000Z
|
dlkit/abstract_osid/osid/query_inspectors.py
|
UOC/dlkit
|
a9d265db67e81b9e0f405457464e762e2c03f769
|
[
"MIT"
] | 87
|
2017-04-21T18:57:15.000Z
|
2021-12-13T19:43:57.000Z
|
dlkit/abstract_osid/osid/query_inspectors.py
|
UOC/dlkit
|
a9d265db67e81b9e0f405457464e762e2c03f769
|
[
"MIT"
] | 1
|
2018-03-01T16:44:25.000Z
|
2018-03-01T16:44:25.000Z
|
"""Implementations of osid abstract base class query_inspectors."""
# pylint: disable=invalid-name
# Method names comply with OSID specification.
# pylint: disable=no-init
# Abstract classes do not define __init__.
# pylint: disable=too-few-public-methods
# Some interfaces are specified as 'markers' and include no methods.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
# pylint: disable=too-many-arguments
# Argument signature defined in specification.
# pylint: disable=duplicate-code
# All apparent duplicates have been inspected. They aren't.
import abc
class OsidQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_keyword_terms(self):
"""Gets the keyword query terms.
:return: the keyword string terms
:rtype: ``osid.search.terms.StringTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.StringTerm
keyword_terms = property(fget=get_keyword_terms)
@abc.abstractmethod
def get_any_terms(self):
"""Gets the any query terms.
:return: the any terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
any_terms = property(fget=get_any_terms)
class OsidIdentifiableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_id_terms(self):
"""Gets the ``Id`` query terms.
:return: the ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
id_terms = property(fget=get_id_terms)
class OsidExtensibleQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_record_type_terms(self):
"""Gets the record type query terms.
:return: the record type terms
:rtype: ``osid.search.terms.TypeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.TypeTerm
record_type_terms = property(fget=get_record_type_terms)
class OsidBrowsableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidTemporalQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_effective_terms(self):
"""Gets the effective query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
effective_terms = property(fget=get_effective_terms)
@abc.abstractmethod
def get_start_date_terms(self):
"""Gets the start date query terms.
:return: the query terms
:rtype: ``osid.search.terms.DateTimeRangeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.DateTimeRangeTerm
start_date_terms = property(fget=get_start_date_terms)
@abc.abstractmethod
def get_end_date_terms(self):
"""Gets the end date query terms.
:return: the query terms
:rtype: ``osid.search.terms.DateTimeRangeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.DateTimeRangeTerm
end_date_terms = property(fget=get_end_date_terms)
@abc.abstractmethod
def get_date_terms(self):
"""Gets the date query terms.
:return: the query terms
:rtype: ``osid.search.terms.DateTimeRangeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.DateTimeRangeTerm
date_terms = property(fget=get_date_terms)
class OsidSubjugateableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidAggregateableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidContainableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_sequestered_terms(self):
"""Gets the sequestered query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
sequestered_terms = property(fget=get_sequestered_terms)
class OsidSourceableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_provider_id_terms(self):
"""Gets the provider ``Id`` query terms.
:return: the provider ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
provider_id_terms = property(fget=get_provider_id_terms)
@abc.abstractmethod
def get_provider_terms(self):
"""Gets the provider query terms.
:return: the provider terms
:rtype: ``osid.resource.ResourceQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.resource.ResourceQueryInspector
provider_terms = property(fget=get_provider_terms)
@abc.abstractmethod
def get_branding_id_terms(self):
"""Gets the asset ``Id`` query terms.
:return: the asset ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
branding_id_terms = property(fget=get_branding_id_terms)
@abc.abstractmethod
def get_branding_terms(self):
"""Gets the asset query terms.
:return: the branding terms
:rtype: ``osid.repository.AssetQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.repository.AssetQueryInspector
branding_terms = property(fget=get_branding_terms)
@abc.abstractmethod
def get_license_terms(self):
"""Gets the license query terms.
:return: the license terms
:rtype: ``osid.search.terms.StringTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.StringTerm
license_terms = property(fget=get_license_terms)
class OsidFederateableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidOperableQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_active_terms(self):
"""Gets the active query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
active_terms = property(fget=get_active_terms)
@abc.abstractmethod
def get_enabled_terms(self):
"""Gets the administratively enabled query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
enabled_terms = property(fget=get_enabled_terms)
@abc.abstractmethod
def get_disabled_terms(self):
"""Gets the administratively disabled query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
disabled_terms = property(fget=get_disabled_terms)
@abc.abstractmethod
def get_operational_terms(self):
"""Gets the operational query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
operational_terms = property(fget=get_operational_terms)
class OsidObjectQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_display_name_terms(self):
"""Gets the display name query terms.
:return: the display name terms
:rtype: ``osid.search.terms.StringTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.StringTerm
display_name_terms = property(fget=get_display_name_terms)
@abc.abstractmethod
def get_description_terms(self):
"""Gets the description query terms.
:return: the description terms
:rtype: ``osid.search.terms.StringTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.StringTerm
description_terms = property(fget=get_description_terms)
@abc.abstractmethod
def get_genus_type_terms(self):
"""Gets the genus type query terms.
:return: the genus type terms
:rtype: ``osid.search.terms.TypeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.TypeTerm
genus_type_terms = property(fget=get_genus_type_terms)
@abc.abstractmethod
def get_parent_genus_type_terms(self):
"""Gets the parent genus type query terms.
:return: the parent genus type terms
:rtype: ``osid.search.terms.TypeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.TypeTerm
parent_genus_type_terms = property(fget=get_parent_genus_type_terms)
@abc.abstractmethod
def get_subject_id_terms(self):
"""Gets the subject ``Id`` query terms.
:return: the subject ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
subject_id_terms = property(fget=get_subject_id_terms)
@abc.abstractmethod
def get_subject_terms(self):
"""Gets the subject query terms.
:return: the subject query terms
:rtype: ``osid.ontology.SubjectQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.ontology.SubjectQueryInspector
subject_terms = property(fget=get_subject_terms)
@abc.abstractmethod
def get_subject_relevancy_terms(self):
"""Gets the subject relevancy query terms.
:return: the subject relevancy query terms
:rtype: ``osid.ontology.RelevancyQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.ontology.RelevancyQueryInspector
subject_relevancy_terms = property(fget=get_subject_relevancy_terms)
@abc.abstractmethod
def get_state_id_terms(self):
"""Gets the state ``Id`` query terms.
:return: the state ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
state_id_terms = property(fget=get_state_id_terms)
@abc.abstractmethod
def get_state_terms(self):
"""Gets the state query terms.
:return: the state query terms
:rtype: ``osid.process.StateQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.process.StateQueryInspector
state_terms = property(fget=get_state_terms)
@abc.abstractmethod
def get_comment_id_terms(self):
"""Gets the comment ``Id`` query terms.
:return: the comment ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
comment_id_terms = property(fget=get_comment_id_terms)
@abc.abstractmethod
def get_comment_terms(self):
"""Gets the comment query terms.
:return: the comment query terms
:rtype: ``osid.commenting.CommentQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.commenting.CommentQueryInspector
comment_terms = property(fget=get_comment_terms)
@abc.abstractmethod
def get_journal_entry_id_terms(self):
"""Gets the journal entry ``Id`` query terms.
:return: the journal entry ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
journal_entry_id_terms = property(fget=get_journal_entry_id_terms)
@abc.abstractmethod
def get_journal_entry_terms(self):
"""Gets the journal entry query terms.
:return: the journal entry query terms
:rtype: ``osid.journaling.JournalEntryQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.journaling.JournalEntryQueryInspector
journal_entry_terms = property(fget=get_journal_entry_terms)
@abc.abstractmethod
def get_statistic_terms(self):
"""Gets the statistic query terms.
:return: the statistic query terms
:rtype: ``osid.metering.StatisticQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.metering.StatisticQueryInspector
statistic_terms = property(fget=get_statistic_terms)
@abc.abstractmethod
def get_credit_id_terms(self):
"""Gets the credit ``Id`` query terms.
:return: the credit ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
credit_id_terms = property(fget=get_credit_id_terms)
@abc.abstractmethod
def get_credit_terms(self):
"""Gets the credit query terms.
:return: the credit query terms
:rtype: ``osid.acknowledgement.CreditQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.acknowledgement.CreditQueryInspector
credit_terms = property(fget=get_credit_terms)
@abc.abstractmethod
def get_relationship_id_terms(self):
"""Gets the relationship ``Id`` query terms.
:return: the relationship ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
relationship_id_terms = property(fget=get_relationship_id_terms)
@abc.abstractmethod
def get_relationship_terms(self):
"""Gets the relationship query terms.
:return: the relationship query terms
:rtype: ``osid.relationship.RelationshipQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.relationship.RelationshipQueryInspector
relationship_terms = property(fget=get_relationship_terms)
@abc.abstractmethod
def get_relationship_peer_id_terms(self):
"""Gets the relationship peer ``Id`` query terms.
:return: the relationship peer ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
relationship_peer_id_terms = property(fget=get_relationship_peer_id_terms)
class OsidRelationshipQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_end_reason_id_terms(self):
"""Gets the end reaosn state ``Id`` query terms.
:return: the state ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
end_reason_id_terms = property(fget=get_end_reason_id_terms)
@abc.abstractmethod
def get_end_reason_terms(self):
"""Gets the end reaosn state query terms.
:return: the state query terms
:rtype: ``osid.process.StateQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.process.StateQueryInspector
end_reason_terms = property(fget=get_end_reason_terms)
class OsidCatalogQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidRuleQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_rule_id_terms(self):
"""Gets the rule ``Id`` query terms.
:return: the rule ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
rule_id_terms = property(fget=get_rule_id_terms)
@abc.abstractmethod
def get_rule_terms(self):
"""Gets the rule query terms.
:return: the rule query terms
:rtype: ``osid.rules.RuleQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.rules.RuleQueryInspector
rule_terms = property(fget=get_rule_terms)
class OsidEnablerQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_schedule_id_terms(self):
"""Gets the effective schedule ``Id`` query terms.
:return: the effecive schedule ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
schedule_id_terms = property(fget=get_schedule_id_terms)
@abc.abstractmethod
def get_schedule_terms(self):
"""Gets the effective schedule query terms.
:return: the query terms
:rtype: ``osid.calendaring.ScheduleQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.calendaring.ScheduleQueryInspector
schedule_terms = property(fget=get_schedule_terms)
@abc.abstractmethod
def get_event_id_terms(self):
"""Gets the effective event ``Id`` query terms.
:return: the effecive recurring event ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
event_id_terms = property(fget=get_event_id_terms)
@abc.abstractmethod
def get_event_terms(self):
"""Gets the effective event query terms.
:return: the query terms
:rtype: ``osid.calendaring.EventQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.calendaring.EventQueryInspector
event_terms = property(fget=get_event_terms)
@abc.abstractmethod
def get_cyclic_event_id_terms(self):
"""Gets the cyclic event ``Id`` query terms.
:return: the query terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
cyclic_event_id_terms = property(fget=get_cyclic_event_id_terms)
@abc.abstractmethod
def get_cyclic_event_terms(self):
"""Gets the cyclic event query terms.
:return: the query terms
:rtype: ``osid.calendaring.cycle.CyclicEventQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.calendaring.cycle.CyclicEventQueryInspector
cyclic_event_terms = property(fget=get_cyclic_event_terms)
@abc.abstractmethod
def get_demographic_id_terms(self):
"""Gets the demographic resource ``Id`` query terms.
:return: the resource ``Id`` terms
:rtype: ``osid.search.terms.IdTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.IdTerm
demographic_id_terms = property(fget=get_demographic_id_terms)
@abc.abstractmethod
def get_demographic_terms(self):
"""Gets the demographic resource query terms.
:return: the resource query terms
:rtype: ``osid.resource.ResourceQueryInspector``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.resource.ResourceQueryInspector
demographic_terms = property(fget=get_demographic_terms)
class OsidConstrainerQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidProcessorQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidGovernatorQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
class OsidCompendiumQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get_start_date_terms(self):
"""Gets the start date query terms.
:return: the query terms
:rtype: ``osid.search.terms.DateTimeRangeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.DateTimeRangeTerm
start_date_terms = property(fget=get_start_date_terms)
@abc.abstractmethod
def get_end_date_terms(self):
"""Gets the end date query terms.
:return: the query terms
:rtype: ``osid.search.terms.DateTimeRangeTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.DateTimeRangeTerm
end_date_terms = property(fget=get_end_date_terms)
@abc.abstractmethod
def get_interpolated_terms(self):
"""Gets the interpolated query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
interpolated_terms = property(fget=get_interpolated_terms)
@abc.abstractmethod
def get_extrapolated_terms(self):
"""Gets the extrapolated query terms.
:return: the query terms
:rtype: ``osid.search.terms.BooleanTerm``
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.search.terms.BooleanTerm
extrapolated_terms = property(fget=get_extrapolated_terms)
class OsidCapsuleQueryInspector:
"""The query inspectors provide a means of accessing the match terms of a query.
These interfaces are used to examine the actual query terms used in
a search or that may be used to create a smart catalog. Query
inspectors may be converted to an ``OsidQuery`` for reuse or
modification in the search sessions.
"""
__metaclass__ = abc.ABCMeta
| 28.178571
| 84
| 0.67784
| 3,596
| 29,982
| 5.526418
| 0.054505
| 0.051326
| 0.055855
| 0.06134
| 0.830675
| 0.726513
| 0.638806
| 0.618276
| 0.618276
| 0.596085
| 0
| 0
| 0.240511
| 29,982
| 1,063
| 85
| 28.20508
| 0.872733
| 0.598592
| 0
| 0.529412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.207843
| false
| 0
| 0.003922
| 0
| 0.792157
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
62916d7b70a9cb386728e001e52d42f8d05cf329
| 1,979
|
py
|
Python
|
tests/union.py
|
suraj-testing2/Settings_Shoe
|
c7a1bdd9044b00b67e1fc21a48365e424eace0c0
|
[
"Apache-2.0"
] | 19
|
2015-01-20T21:14:19.000Z
|
2020-12-29T06:03:00.000Z
|
tests/union.py
|
suraj-testing2/Settings_Shoe
|
c7a1bdd9044b00b67e1fc21a48365e424eace0c0
|
[
"Apache-2.0"
] | null | null | null |
tests/union.py
|
suraj-testing2/Settings_Shoe
|
c7a1bdd9044b00b67e1fc21a48365e424eace0c0
|
[
"Apache-2.0"
] | 10
|
2015-07-07T00:04:01.000Z
|
2021-10-12T02:40:01.000Z
|
# -*- coding:utf-8; python-indent:2; indent-tabs-mode:nil -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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.
"""Used for tests."""
# pylint: disable=unused-argument
# pylint: disable=unused-import
# pylint: disable=g-line-too-long
import sys
from pytypedecl import checker
# some signatures use type defined in the simple module
from tests import simple
# def StrToInt(s : str or None) -> int
def StrToInt(s):
if s is None:
return 0
return int(s)
# def Add(a: int or None, b: int or None) -> int or None
# def Add(a: float or None, b: float or None) -> float or None
def Add(a, b):
if a is None or b is None:
return None
return a + b
# def AddToFloat(a: int | float, b: int | float) -> float
def IntOrFloat(a, b):
return 42.0
# def IntOrNone(a : int | None) -> int | None
def IntOrNone(a):
return a
# def AppleOrBananaOrOrange(
# f : simple.Apple | simple.Banana | simple.Orange) -> None
def AppleOrBananaOrOrange(f):
return None
class Readable(object):
def Read(self):
pass
class Writable(object):
def Write(self):
pass
# def DoSomeIOStuff(f : Readable and Writable) -> str
def DoSomeIOStuff(f):
return "cool"
# def UnionReturn() -> list | tuple
def UnionReturn():
return [42]
# def UnionReturnError() -> int | list
def UnionReturnError():
return 42,
class File(Readable, Writable):
pass
checker.CheckFromFile(sys.modules[__name__], __file__ + "td")
| 21.27957
| 74
| 0.699343
| 298
| 1,979
| 4.61745
| 0.446309
| 0.030523
| 0.015262
| 0.023256
| 0.018895
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011292
| 0.194543
| 1,979
| 92
| 75
| 21.51087
| 0.851945
| 0.637191
| 0
| 0.15625
| 0
| 0
| 0.008759
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3125
| false
| 0.09375
| 0.09375
| 0.1875
| 0.8125
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
659ef97fa838f2a2c8265ad3f4704e5bcce4a525
| 123
|
py
|
Python
|
python/two-fer/two_fer.py
|
gurupratap-matharu/Exercism
|
a083c8d4bbc10d777524d917329a34e560201c9c
|
[
"MIT"
] | null | null | null |
python/two-fer/two_fer.py
|
gurupratap-matharu/Exercism
|
a083c8d4bbc10d777524d917329a34e560201c9c
|
[
"MIT"
] | null | null | null |
python/two-fer/two_fer.py
|
gurupratap-matharu/Exercism
|
a083c8d4bbc10d777524d917329a34e560201c9c
|
[
"MIT"
] | null | null | null |
def two_fer(name="you"):
"""Returns a string in the two-fer format."""
return "One for " + name + ", one for me."
| 24.6
| 49
| 0.585366
| 20
| 123
| 3.55
| 0.75
| 0.169014
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.235772
| 123
| 4
| 50
| 30.75
| 0.755319
| 0.317073
| 0
| 0
| 0
| 0
| 0.307692
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
65a0011adbe13c286041ff6caf7984616e4ac5f7
| 99
|
py
|
Python
|
api/setup.py
|
josiah-wolf-oberholtzer/on-exactitude-in-science
|
5f31d84d790e4825874e2574ab1a2ee699d947a5
|
[
"MIT"
] | 2
|
2020-05-31T14:50:01.000Z
|
2021-02-08T21:56:15.000Z
|
api/setup.py
|
josiah-wolf-oberholtzer/on-exactitude-in-science
|
5f31d84d790e4825874e2574ab1a2ee699d947a5
|
[
"MIT"
] | 3
|
2021-12-13T20:49:08.000Z
|
2022-02-13T17:29:26.000Z
|
api/setup.py
|
josiah-wolf-oberholtzer/on-exactitude-in-science
|
5f31d84d790e4825874e2574ab1a2ee699d947a5
|
[
"MIT"
] | null | null | null |
import setuptools
if __name__ == "__main__":
setuptools.setup(name="maps", packages=["maps"])
| 19.8
| 52
| 0.69697
| 11
| 99
| 5.545455
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131313
| 99
| 4
| 53
| 24.75
| 0.709302
| 0
| 0
| 0
| 0
| 0
| 0.161616
| 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
|
65baf2db67cfec2870de68201cd2bdd726747c8b
| 1,281
|
py
|
Python
|
src/radical/saga/__init__.py
|
Abdullah-Ghani/radical.saga
|
bb9d9bd97905627b9bf45a85c6d1d6a60ca9fb39
|
[
"MIT"
] | null | null | null |
src/radical/saga/__init__.py
|
Abdullah-Ghani/radical.saga
|
bb9d9bd97905627b9bf45a85c6d1d6a60ca9fb39
|
[
"MIT"
] | null | null | null |
src/radical/saga/__init__.py
|
Abdullah-Ghani/radical.saga
|
bb9d9bd97905627b9bf45a85c6d1d6a60ca9fb39
|
[
"MIT"
] | null | null | null |
__author__ = "RADICAL-SAGA Development Team"
__copyright__ = "Copyright 2013, RADICAL"
__license__ = "MIT"
import urllib
import cgi
cgi.parse_qs = urllib.parse.parse_qs
# ------------------------------------------------------------------------------
#
from .version import *
from .constants import *
from .task import Task, Container
from .attributes import Attributes, Callback
from .session import Session, DefaultSession
from .context import Context
from .url import Url
from .exceptions import SagaException
from .exceptions import NotImplemented
from .exceptions import IncorrectURL
from .exceptions import BadParameter
from .exceptions import AlreadyExists
from .exceptions import DoesNotExist
from .exceptions import IncorrectState
from .exceptions import PermissionDenied
from .exceptions import AuthorizationFailed
from .exceptions import AuthenticationFailed
from .exceptions import Timeout
from .exceptions import NoSuccess
from . import job
from . import filesystem
from . import replica
from . import advert
from . import resource
# from . import messages
from . import utils
# ------------------------------------------------------------------------------
| 26.142857
| 80
| 0.648712
| 120
| 1,281
| 6.808333
| 0.375
| 0.20563
| 0.293758
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003857
| 0.190476
| 1,281
| 48
| 81
| 26.6875
| 0.783992
| 0.148322
| 0
| 0
| 0
| 0
| 0.050738
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.870968
| 0
| 0.870968
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
65cbcc4d1136f6e1c3df9297271faa5262424df4
| 319
|
py
|
Python
|
critiquebrainz/db/exceptions.py
|
reosarevok/critiquebrainz
|
c793a67df3c964d4d5adddb0e9f3d416cbc72975
|
[
"Apache-2.0"
] | null | null | null |
critiquebrainz/db/exceptions.py
|
reosarevok/critiquebrainz
|
c793a67df3c964d4d5adddb0e9f3d416cbc72975
|
[
"Apache-2.0"
] | null | null | null |
critiquebrainz/db/exceptions.py
|
reosarevok/critiquebrainz
|
c793a67df3c964d4d5adddb0e9f3d416cbc72975
|
[
"Apache-2.0"
] | 1
|
2019-10-20T05:48:53.000Z
|
2019-10-20T05:48:53.000Z
|
class DatabaseException(Exception):
"""Base exception for this package."""
pass
class NoDataFoundException(DatabaseException):
"""Should be used when no data has been found."""
pass
class BadDataException(DatabaseException):
"""Should be used when incorrect data is being submitted."""
pass
| 22.785714
| 64
| 0.717868
| 35
| 319
| 6.542857
| 0.657143
| 0.078603
| 0.218341
| 0.253275
| 0.28821
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188088
| 319
| 13
| 65
| 24.538462
| 0.88417
| 0.410658
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
65ddb657cda7ff4035c732e5a62e266937d8b839
| 2,697
|
py
|
Python
|
tap_nhl/schemas/live_linescore.py
|
gavh3/tap-nhl
|
36d36aac83673a9502356a5f5a2cb43f65716cc2
|
[
"MIT"
] | null | null | null |
tap_nhl/schemas/live_linescore.py
|
gavh3/tap-nhl
|
36d36aac83673a9502356a5f5a2cb43f65716cc2
|
[
"MIT"
] | null | null | null |
tap_nhl/schemas/live_linescore.py
|
gavh3/tap-nhl
|
36d36aac83673a9502356a5f5a2cb43f65716cc2
|
[
"MIT"
] | 1
|
2022-02-04T23:31:00.000Z
|
2022-02-04T23:31:00.000Z
|
import singer_sdk.typing as th
from tap_nhl.schemas.stream_schema_object import StreamSchemaObject
class LiveLinescoreObject(StreamSchemaObject):
properties = th.PropertiesList(
th.Property("gameId", th.IntegerType),
th.Property("periods", th.ArrayType(th.ObjectType(
th.Property("periodType", th.StringType),
th.Property("startTime", th.DateTimeType),
th.Property("endTime", th.DateTimeType),
th.Property("num", th.IntegerType),
th.Property("ordinalNum", th.StringType),
th.Property("home", th.ObjectType(
th.Property("goals", th.IntegerType),
th.Property("shotsOnGoal", th.IntegerType),
th.Property("rinkSide", th.StringType),
)),
th.Property("away", th.ObjectType(
th.Property("goals", th.IntegerType),
th.Property("shotsOnGoal", th.IntegerType),
th.Property("rinkSide", th.StringType),
)),
))),
th.Property("shootoutInfo", th.ObjectType(
th.Property("away", th.ObjectType(
th.Property("scores", th.IntegerType),
th.Property("attempts", th.IntegerType),
)),
th.Property("home", th.ObjectType(
th.Property("scores", th.IntegerType),
th.Property("attempts", th.IntegerType),
)),
)),
th.Property("teams", th.ObjectType(
th.Property("home", th.ObjectType(
th.Property("team", th.ObjectType(
th.Property("id", th.IntegerType),
th.Property("name", th.StringType),
)),
th.Property("goals", th.IntegerType),
th.Property("shotsOnGoal", th.IntegerType),
th.Property("goaliePulled", th.BooleanType),
th.Property("numSkaters", th.IntegerType),
th.Property("powerPlay", th.BooleanType),
)),
th.Property("away", th.ObjectType(
th.Property("team", th.ObjectType(
th.Property("id", th.IntegerType),
th.Property("name", th.StringType),
)),
th.Property("goals", th.IntegerType),
th.Property("shotsOnGoal", th.IntegerType),
th.Property("goaliePulled", th.BooleanType),
th.Property("numSkaters", th.IntegerType),
th.Property("powerPlay", th.BooleanType),
)),
th.Property("powerPlayStrength", th.StringType),
th.Property("hasShootout", th.BooleanType),
))
)
| 44.213115
| 67
| 0.538005
| 238
| 2,697
| 6.079832
| 0.205882
| 0.297167
| 0.186593
| 0.286109
| 0.66897
| 0.66897
| 0.66897
| 0.631652
| 0.631652
| 0.631652
| 0
| 0
| 0.321839
| 2,697
| 60
| 68
| 44.95
| 0.791143
| 0
| 0
| 0.694915
| 0
| 0
| 0.115313
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.033898
| 0
| 0.067797
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
02b02930134ab46f39e4b3369493db8f7349d810
| 146
|
py
|
Python
|
backend/aprs/api/urls.py
|
ruilvo/radioamadorismo-website
|
65c85a62cae367cbe235854a7c1a051fbc84b461
|
[
"Apache-2.0"
] | 7
|
2021-12-03T16:16:02.000Z
|
2021-12-16T18:13:10.000Z
|
backend/aprs/api/urls.py
|
ruilvo/radioamadorismo-website
|
65c85a62cae367cbe235854a7c1a051fbc84b461
|
[
"Apache-2.0"
] | null | null | null |
backend/aprs/api/urls.py
|
ruilvo/radioamadorismo-website
|
65c85a62cae367cbe235854a7c1a051fbc84b461
|
[
"Apache-2.0"
] | null | null | null |
from django.urls import path
from aprs.api.views import PasscodeView
urlpatterns = [
path("passcode-generator/", PasscodeView.as_view()),
]
| 18.25
| 56
| 0.746575
| 18
| 146
| 6
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136986
| 146
| 7
| 57
| 20.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0.130137
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.4
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
02b3bcb27f13de6dfc31e6e5134b81a2aa567fab
| 108
|
py
|
Python
|
app_old/bookstorePS04_app/apps.py
|
MC-WallE/bookstore
|
14740e9cbefccff021099644ae47ed0415de5ea3
|
[
"MIT"
] | 3
|
2020-07-23T15:07:43.000Z
|
2020-07-31T05:59:42.000Z
|
app_old/bookstorePS04_app/apps.py
|
DGA-WallE/bookstore
|
b1cb7975b1c46456362366a895a89cb484e5546f
|
[
"MIT"
] | 2
|
2020-07-31T11:55:22.000Z
|
2020-08-11T07:35:19.000Z
|
app_old/bookstorePS04_app/apps.py
|
DGA-WallE/bookstore
|
b1cb7975b1c46456362366a895a89cb484e5546f
|
[
"MIT"
] | 3
|
2020-07-08T20:04:27.000Z
|
2020-08-13T16:48:54.000Z
|
from django.apps import AppConfig
class Bookstoreps04AppConfig(AppConfig):
name = 'bookstorePS04_app'
| 18
| 40
| 0.796296
| 11
| 108
| 7.727273
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043011
| 0.138889
| 108
| 5
| 41
| 21.6
| 0.870968
| 0
| 0
| 0
| 0
| 0
| 0.157407
| 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
|
02b5aaeff518b5ff17499249e7eb3aa88690b9ec
| 216
|
py
|
Python
|
PycharmProjects/pythonteste/ex034.py
|
caioalexleme/Curso_Python
|
6394f60689531c7431765538f1b699aabbf4acb2
|
[
"MIT"
] | 3
|
2021-07-09T20:41:47.000Z
|
2021-11-17T10:25:01.000Z
|
PycharmProjects/pythonteste/ex034.py
|
caioalexleme/Curso_Python
|
6394f60689531c7431765538f1b699aabbf4acb2
|
[
"MIT"
] | null | null | null |
PycharmProjects/pythonteste/ex034.py
|
caioalexleme/Curso_Python
|
6394f60689531c7431765538f1b699aabbf4acb2
|
[
"MIT"
] | 1
|
2021-09-09T20:24:07.000Z
|
2021-09-09T20:24:07.000Z
|
sal = float(input('Digite o valor do seu salário: R$'))
if(sal > 1250):
print('Seu salário agora é R${:.2f}'.format(sal + (sal * 0.10)))
else:
print('Seu salário agora é R${:.2f}'.format(sal + (sal * 0.15)))
| 36
| 68
| 0.597222
| 38
| 216
| 3.394737
| 0.552632
| 0.232558
| 0.232558
| 0.310078
| 0.573643
| 0.573643
| 0.573643
| 0.573643
| 0.573643
| 0.573643
| 0
| 0.067797
| 0.180556
| 216
| 5
| 69
| 43.2
| 0.661017
| 0
| 0
| 0
| 0
| 0
| 0.412037
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.4
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
02f8d3dbfd0b1c0a15bfb09070d357ae3df75972
| 149
|
py
|
Python
|
app/services/auth.py
|
wangonya/ampleanalytics
|
54d2cbf7df55c252d3e356a07e11266229a5d821
|
[
"Apache-2.0"
] | null | null | null |
app/services/auth.py
|
wangonya/ampleanalytics
|
54d2cbf7df55c252d3e356a07e11266229a5d821
|
[
"Apache-2.0"
] | null | null | null |
app/services/auth.py
|
wangonya/ampleanalytics
|
54d2cbf7df55c252d3e356a07e11266229a5d821
|
[
"Apache-2.0"
] | null | null | null |
from fastapi_auth0 import Auth0
from app.core.env import ENV
auth = Auth0(
domain=ENV.AUTH0_DOMAIN,
api_audience=ENV.AUTH0_API_AUDIENCE,
)
| 16.555556
| 40
| 0.765101
| 23
| 149
| 4.73913
| 0.478261
| 0.201835
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04
| 0.161074
| 149
| 8
| 41
| 18.625
| 0.832
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
02f91f39a80df9ddaeb37bcdfd8777d10cc529ba
| 119
|
py
|
Python
|
TileSeqMut/__main__.py
|
RyogaLi/tilseq_mutcount
|
ba6d82851981d0849673e8858b208a5aecab4064
|
[
"MIT"
] | null | null | null |
TileSeqMut/__main__.py
|
RyogaLi/tilseq_mutcount
|
ba6d82851981d0849673e8858b208a5aecab4064
|
[
"MIT"
] | 21
|
2020-08-19T22:13:42.000Z
|
2021-08-17T14:22:35.000Z
|
TileSeqMut/__main__.py
|
RyogaLi/tilseq_mutcount
|
ba6d82851981d0849673e8858b208a5aecab4064
|
[
"MIT"
] | 1
|
2021-11-09T14:15:45.000Z
|
2021-11-09T14:15:45.000Z
|
#!/usr/bin/env python#VERSION#
# Author: Roujia Li
# email: Roujia.li@mail.utoronto.ca
import os
import pandas as pd
| 14.875
| 35
| 0.731092
| 20
| 119
| 4.35
| 0.85
| 0.183908
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 119
| 7
| 36
| 17
| 0.852941
| 0.663866
| 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
|
f32539b95dab6c6052e4b058885923283d63ca7f
| 163
|
py
|
Python
|
src/tipboard/app/applicationconfig.py
|
chriskj/tipboard2.0-ghp
|
da70592b579fc1f59a1ecde41a916bb26d7e5a02
|
[
"Apache-2.0"
] | null | null | null |
src/tipboard/app/applicationconfig.py
|
chriskj/tipboard2.0-ghp
|
da70592b579fc1f59a1ecde41a916bb26d7e5a02
|
[
"Apache-2.0"
] | 5
|
2021-03-30T13:23:57.000Z
|
2021-09-22T19:00:15.000Z
|
src/tipboard/app/applicationconfig.py
|
chriskj/tipboard2.0-ghp
|
da70592b579fc1f59a1ecde41a916bb26d7e5a02
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
import os, sys
from django.apps import AppConfig
class TipboardConfig(AppConfig):
name = 'tipboard'
verbose_name = "DjangoBoard"
| 18.111111
| 33
| 0.693252
| 19
| 163
| 5.894737
| 0.842105
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007519
| 0.184049
| 163
| 8
| 34
| 20.375
| 0.834586
| 0.128834
| 0
| 0
| 0
| 0
| 0.136691
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 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
|
b8454c27a87308a7f1fd10c1103fda4319333894
| 130
|
py
|
Python
|
paypal/standard/pdt/app.py
|
igloox/django-paypal
|
65c7002888133c904f0c80cd87d85fc91e0dd78d
|
[
"Unlicense",
"MIT"
] | null | null | null |
paypal/standard/pdt/app.py
|
igloox/django-paypal
|
65c7002888133c904f0c80cd87d85fc91e0dd78d
|
[
"Unlicense",
"MIT"
] | null | null | null |
paypal/standard/pdt/app.py
|
igloox/django-paypal
|
65c7002888133c904f0c80cd87d85fc91e0dd78d
|
[
"Unlicense",
"MIT"
] | null | null | null |
from django.apps import AppConfig
class PDTConfig(AppConfig):
name = 'paypal.standard.pdt'
label = 'paypal.standard.pdt'
| 21.666667
| 33
| 0.730769
| 16
| 130
| 5.9375
| 0.75
| 0.294737
| 0.357895
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.161538
| 130
| 5
| 34
| 26
| 0.87156
| 0
| 0
| 0
| 0
| 0
| 0.292308
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 1
| 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
|
b87d0f145d3b19057bc3c38e3d0a2cf4b5cab4dc
| 6,718
|
py
|
Python
|
stem_cell_hypothesis/en_electra_base/head/vis/dep.py
|
emorynlp/stem-cell-hypothesis
|
48a628093d93d653865fbac6409d179cddd99293
|
[
"Apache-2.0"
] | 4
|
2021-09-17T15:23:31.000Z
|
2022-02-28T10:18:04.000Z
|
stem_cell_hypothesis/en_electra_base/head/vis/dep.py
|
emorynlp/stem-cell-hypothesis
|
48a628093d93d653865fbac6409d179cddd99293
|
[
"Apache-2.0"
] | null | null | null |
stem_cell_hypothesis/en_electra_base/head/vis/dep.py
|
emorynlp/stem-cell-hypothesis
|
48a628093d93d653865fbac6409d179cddd99293
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-05-11 19:50
import os
from collections import defaultdict
import matplotlib.pyplot as plt
prop_cycle = plt.rcParams['axes.prop_cycle']
plt.rcParams["figure.figsize"] = (4, 3)
plt.rcParams.update({'font.size': 8})
def main():
table = '''
static single pos ner con srl joint
prep 67.64 69.51 ± 1.26 67.03 ± 0.68 67.32 ± 0.96 66.99 ± 0.57 70.89 ± 3.25 67.28 ± 0.55
pobj 77.51 94.93 ± 0.61 90.00 ± 1.34 86.62 ± 2.00 93.64 ± 0.33 88.97 ± 2.68 73.65 ± 1.87
nsubj 53.27 65.85 ± 1.36 56.20 ± 1.84 58.90 ± 1.56 53.53 ± 0.69 63.55 ± 1.42 50.10 ± 0.88
det 85.55 94.01 ± 0.51 88.54 ± 1.90 88.43 ± 1.28 96.56 ± 0.17 95.20 ± 0.49 84.25 ± 3.30
root 99.98 99.98 ± 0.03 99.90 ± 0.10 99.94 ± 0.08 100.00 ± 0.01 99.83 ± 0.10 99.86 ± 0.01
nn 78.22 86.11 ± 0.47 81.34 ± 0.55 81.89 ± 1.45 85.40 ± 0.86 87.32 ± 1.55 80.45 ± 1.52
amod 86.65 91.94 ± 0.74 88.93 ± 0.96 88.38 ± 1.18 90.46 ± 1.08 91.78 ± 0.66 83.41 ± 2.38
dobj 69.25 89.98 ± 1.05 86.25 ± 1.42 85.31 ± 0.95 86.23 ± 0.93 75.55 ± 2.70 73.52 ± 1.70
advmod 60.27 68.56 ± 0.58 64.97 ± 1.10 67.77 ± 2.90 64.02 ± 1.11 67.96 ± 2.69 60.23 ± 1.39
aux 78.59 87.23 ± 1.61 84.24 ± 0.25 86.41 ± 2.34 84.60 ± 0.61 83.40 ± 1.91 80.74 ± 0.49
cc 39.08 42.05 ± 1.63 46.61 ± 2.50 41.42 ± 1.57 45.63 ± 2.81 43.61 ± 4.25 39.38 ± 0.58
conj 48.33 64.68 ± 0.40 59.95 ± 0.84 60.16 ± 1.49 60.27 ± 0.62 59.67 ± 0.85 53.28 ± 0.47
dep 30.08 31.20 ± 0.77 30.96 ± 1.17 30.85 ± 0.47 29.26 ± 0.34 30.85 ± 1.36 29.17 ± 0.18
poss 67.89 77.14 ± 1.41 65.04 ± 2.41 68.64 ± 2.17 75.57 ± 2.06 76.64 ± 2.69 63.11 ± 2.57
ccomp 29.90 42.81 ± 2.20 39.74 ± 4.66 44.02 ± 3.32 37.09 ± 1.56 41.40 ± 3.13 37.07 ± 2.70
cop 72.28 87.73 ± 1.90 87.18 ± 3.72 88.51 ± 1.14 83.99 ± 1.02 82.81 ± 1.93 73.26 ± 2.59
mark 47.54 86.78 ± 0.55 81.66 ± 2.58 86.07 ± 0.80 85.67 ± 2.01 81.23 ± 0.75 74.18 ± 1.31
xcomp 51.71 66.56 ± 0.69 60.70 ± 1.88 59.63 ± 1.52 63.50 ± 2.40 57.97 ± 1.75 58.23 ± 0.53
num 81.80 88.21 ± 0.53 83.35 ± 1.03 87.61 ± 0.53 85.17 ± 1.60 87.40 ± 2.14 82.75 ± 1.08
rcmod 30.24 36.92 ± 2.31 34.77 ± 2.00 33.80 ± 1.12 36.40 ± 3.10 45.90 ± 3.22 36.33 ± 2.15
advcl 17.81 16.42 ± 1.42 16.28 ± 0.18 18.60 ± 0.46 17.25 ± 0.79 16.70 ± 0.96 16.91 ± 1.16
neg 70.27 81.20 ± 1.74 72.76 ± 2.21 81.30 ± 5.54 82.17 ± 0.72 79.80 ± 1.88 77.04 ± 3.15
auxpass 95.85 98.34 ± 0.08 97.65 ± 0.13 97.87 ± 0.43 97.87 ± 0.21 96.71 ± 0.53 94.93 ± 0.72
nsubjpass 61.51 62.59 ± 1.64 47.28 ± 1.68 48.55 ± 5.03 53.14 ± 3.64 62.05 ± 2.08 47.05 ± 1.22
possessive 99.04 98.68 ± 0.34 98.46 ± 0.19 99.01 ± 0.20 98.94 ± 0.16 99.13 ± 0.72 99.10 ± 0.05
pcomp 75.70 84.04 ± 1.12 80.96 ± 0.41 81.03 ± 0.61 82.66 ± 1.19 78.85 ± 0.12 75.70 ± 0.00
discourse 27.35 36.71 ± 3.10 38.06 ± 4.01 37.51 ± 6.79 33.20 ± 0.75 46.24 ± 0.56 37.44 ± 2.20
partmod 54.18 57.47 ± 0.57 54.37 ± 0.08 55.90 ± 1.40 57.43 ± 0.29 59.75 ± 2.30 59.19 ± 0.50
appos 27.88 39.17 ± 2.65 32.90 ± 1.06 34.99 ± 4.13 36.11 ± 3.78 36.40 ± 2.56 33.58 ± 1.03
prt 96.74 94.36 ± 0.39 93.47 ± 0.93 94.21 ± 0.51 93.67 ± 0.48 93.47 ± 1.16 92.48 ± 1.56
number 78.87 79.81 ± 0.70 78.28 ± 0.98 77.56 ± 0.22 79.16 ± 0.33 76.54 ± 1.12 76.91 ± 0.66
quantmod 70.87 83.17 ± 1.34 73.38 ± 3.73 71.28 ± 0.37 80.66 ± 2.48 80.18 ± 2.09 72.01 ± 0.14
parataxis 17.72 18.52 ± 0.53 16.40 ± 0.46 19.49 ± 0.81 17.90 ± 1.80 24.16 ± 5.36 18.52 ± 2.07
infmod 62.40 65.51 ± 1.31 67.91 ± 1.47 66.13 ± 0.71 67.11 ± 0.31 69.51 ± 1.74 64.71 ± 1.37
tmod 43.68 60.35 ± 0.16 60.81 ± 4.65 57.42 ± 2.18 63.46 ± 1.72 62.91 ± 1.38 56.04 ± 0.73
expl 83.66 83.99 ± 0.33 83.23 ± 0.38 83.22 ± 0.18 83.34 ± 0.57 83.66 ± 0.33 83.55 ± 0.19
mwe 100.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00 100.00 ± 0.00
npadvmod 75.69 79.36 ± 0.80 79.36 ± 0.46 78.14 ± 1.61 80.58 ± 0.26 80.73 ± 0.46 77.37 ± 1.15
iobj 86.41 86.05 ± 1.37 84.60 ± 1.91 82.24 ± 1.57 84.42 ± 3.62 82.79 ± 1.37 76.81 ± 1.13
predet 66.46 67.29 ± 2.00 69.98 ± 5.57 77.22 ± 7.28 66.67 ± 1.56 73.70 ± 4.41 69.98 ± 2.35
acomp 85.35 86.83 ± 2.24 88.75 ± 1.47 87.69 ± 1.60 87.68 ± 1.33 82.59 ± 0.97 83.44 ± 1.27
csubj 28.45 38.22 ± 2.64 38.79 ± 3.76 40.81 ± 4.07 35.34 ± 4.32 37.36 ± 6.70 35.06 ± 4.34
preconj 58.70 77.53 ± 3.32 74.64 ± 6.64 78.99 ± 8.78 78.99 ± 3.32 84.78 ± 4.35 85.51 ± 6.64
csubjpass 33.33 44.44 ± 19.25 55.56 ± 19.25 55.56 ± 19.25 55.56 ± 19.25 44.44 ± 19.25 66.67 ± 0.00
'''
plt.axhline(y=0, color='r', linewidth=0.5, linestyle='--')
head = True
group = defaultdict(dict)
names = ['ELECTRA', 'POS', 'NER', 'CON', 'SRL', 'MTL-5']
nmax = 20
c = 0
for line in table.splitlines():
line = line.strip()
if not line:
continue
cells = line.split('\t')
if not cells:
continue
if head:
head = False
continue
label, scores = cells[0], cells[1:]
scores = [float(x.split()[0]) for x in scores]
scores[0], scores[1] = scores[1], scores[0]
for n, s in zip(names, scores[1:]):
group[n][label] = s - scores[0]
# c += 1
# if c == nmax:
# break
texts = []
xys = defaultdict(lambda: ([], []))
for i, (n, scores) in enumerate(group.items()):
for j, (label, diff) in enumerate(scores.items()):
# plt.scatter(i + 1, diff)
xys[label][0].append(i + 1)
xys[label][1].append(diff)
# texts.append(plt.text(i + 1, diff, label))
# colors = prop_cycle.by_key()['color']
# colors.extend(['r', 'g', 'b', 'c', 'm', 'y'])
# colors = ['#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080', '#ffffff', '#000000']
colors = ['#696969', '#2e8b57', '#800000', '#191970', '#808000', '#ff0000', '#ff8c00', '#ffd700', '#ba55d3',
'#00fa9a', '#00ffff', '#0000ff', '#adff2f', '#ff00ff', '#1e90ff', '#fa8072', '#eee8aa', '#dda0dd',
'#ff1493', '#87cefa']
for i, (label, xy) in enumerate(xys.items()):
label = label[:4]
plt.scatter(*xy, label=label if i < nmax else '_nolegend_', color=colors[i % len(colors)], marker='_', s=300/(i+1))
# adjust_text(texts)
# plt.axhline(y=0, color='r', linewidth=0.5, linestyle='--')
plt.legend(bbox_to_anchor=(1, 1.01), loc='upper left', labelspacing=0.2, borderpad=0.1, handletextpad=0.1)
plt.xticks(list(range(1, 1 + len(group))), list(group.keys()))
# plt.ylabel('Δacc')
plt.tight_layout()
pdf = 'EMNLP-2021-MTL/fig/electra/dep-acc-diff.pdf'
os.makedirs(os.path.dirname(pdf), exist_ok=True)
plt.savefig(pdf)
plt.show()
if __name__ == '__main__':
main()
| 57.418803
| 257
| 0.559988
| 1,809
| 6,718
| 2.214483
| 0.176341
| 0.054418
| 0.007988
| 0.012232
| 0.044184
| 0.040939
| 0.040939
| 0.040939
| 0.040939
| 0.040939
| 0
| 0.433868
| 0.229086
| 6,718
| 116
| 258
| 57.913793
| 0.288666
| 0.084549
| 0
| 0.03125
| 0
| 0.458333
| 0.703255
| 0.007034
| 0
| 0
| 0
| 0
| 0
| 1
| 0.010417
| false
| 0.03125
| 0.03125
| 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
|
b88f02d65ba8a8139310908f0cb98142abe224b5
| 240
|
py
|
Python
|
lab1.py
|
kevuno/GradingScripts
|
2aec191f5e5fed5834a0c45bcfc533e901544f47
|
[
"MIT"
] | null | null | null |
lab1.py
|
kevuno/GradingScripts
|
2aec191f5e5fed5834a0c45bcfc533e901544f47
|
[
"MIT"
] | null | null | null |
lab1.py
|
kevuno/GradingScripts
|
2aec191f5e5fed5834a0c45bcfc533e901544f47
|
[
"MIT"
] | null | null | null |
x = input("Enter a string")
y = input("Enter a string")
z = input("Enter a string")
for i in range(10):
print("This is some output from the lab ",i)
print("Your input was " + x)
print("Your input was " + y)
print("Your input was " + z)
| 26.666667
| 45
| 0.6375
| 44
| 240
| 3.477273
| 0.5
| 0.196078
| 0.215686
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010471
| 0.204167
| 240
| 9
| 46
| 26.666667
| 0.790576
| 0
| 0
| 0
| 0
| 0
| 0.497925
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
b893ee5e9533af13d964d9aaa57db2c96171e600
| 205
|
py
|
Python
|
virtual/bin/django-admin.py
|
Nyakinyua/evaluate_it
|
6c1d84c756cbfdfa62c020ec70aa46ac9ac76688
|
[
"MIT"
] | null | null | null |
virtual/bin/django-admin.py
|
Nyakinyua/evaluate_it
|
6c1d84c756cbfdfa62c020ec70aa46ac9ac76688
|
[
"MIT"
] | 9
|
2020-02-12T02:36:51.000Z
|
2022-02-10T12:18:09.000Z
|
virtual/bin/django-admin.py
|
Nyakinyua/evaluate_it
|
6c1d84c756cbfdfa62c020ec70aa46ac9ac76688
|
[
"MIT"
] | null | null | null |
#!/home/nyakinyua/Documents/moringa-school-projects/Hello-Django/Evaluate_it/virtual/bin/python3.6
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 34.166667
| 98
| 0.809756
| 27
| 205
| 5.703704
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010526
| 0.073171
| 205
| 5
| 99
| 41
| 0.8
| 0.473171
| 0
| 0
| 0
| 0
| 0.074766
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b8b310f5e4cd3d940cca05b646a40ba694201799
| 106
|
py
|
Python
|
file_and_io/remove.py
|
daiyadong/python2_learn
|
6930ddc3dd2edfc31064b1a8001ad826a775e912
|
[
"Apache-2.0"
] | null | null | null |
file_and_io/remove.py
|
daiyadong/python2_learn
|
6930ddc3dd2edfc31064b1a8001ad826a775e912
|
[
"Apache-2.0"
] | null | null | null |
file_and_io/remove.py
|
daiyadong/python2_learn
|
6930ddc3dd2edfc31064b1a8001ad826a775e912
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
# 删除一个已经存在的文件test2.txt
os.remove("test2.txt")
| 15.142857
| 24
| 0.613208
| 14
| 106
| 4.642857
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0.179245
| 106
| 7
| 25
| 15.142857
| 0.712644
| 0.556604
| 0
| 0
| 0
| 0
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b8b3dd8db8d0c1ee74f1046d10985a26cc5bfa23
| 9,297
|
py
|
Python
|
back-flask/test/model/test_time_frame.py
|
LukasL97/shop-4-me
|
2ca983aff907246b315d6173fa87576160fa6b94
|
[
"MIT"
] | null | null | null |
back-flask/test/model/test_time_frame.py
|
LukasL97/shop-4-me
|
2ca983aff907246b315d6173fa87576160fa6b94
|
[
"MIT"
] | null | null | null |
back-flask/test/model/test_time_frame.py
|
LukasL97/shop-4-me
|
2ca983aff907246b315d6173fa87576160fa6b94
|
[
"MIT"
] | null | null | null |
from datetime import datetime
from unittest import TestCase
from bson import ObjectId
from dao.requests_dao import RequestsDAO
from dao.time_frames_dao import TimeFramesDAO
from model.exception import UserSessionIdNotFoundError, UnauthorizedAccessError, ObjectIdNotFoundError
from model.request import RequestHandler, Request
from model.request_status import RequestStatus
from model.time_frame import TimeFrameHandler, TimeFrame
from model.user import VolunteerHandler, Volunteer
from test.mongodb_integration_test_setup import get_empty_local_test_db
class TimeFrameHandlerTest(TestCase):
db = get_empty_local_test_db(['TimeFrames', 'Requests'])
dao = TimeFramesDAO(db)
volunteer_handler = VolunteerHandler(None)
requests_dao = RequestsDAO(db)
request_handler = RequestHandler(requests_dao, None, None, None, None)
time_frame_handler = TimeFrameHandler(dao, volunteer_handler, request_handler)
def setUp(self) -> None:
self.dao.clear()
self.requests_dao.clear()
self.volunteer_handler.active_user_sessions.clear()
def test_add_time_frame_correctly(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
start = '2020-10-25 12:00:00'
end = '2020-10-25 14:00:00'
id = self.time_frame_handler.add_time_frame(start, end, session_id)
time_frames = self.dao.get_time_frames_by_volunteer(volunteer_id)
self.assertEqual(len(time_frames), 1)
self.assertEqual(str(time_frames[0]['_id']), id)
self.assertEqual(str(time_frames[0]['volunteer']), volunteer_id)
self.assertEqual(str(time_frames[0]['start']), start)
self.assertEqual(str(time_frames[0]['end']), end)
self.assertEqual(time_frames[0]['requests'], [])
def test_add_time_frame_with_unknown_session_id(self):
self.assertEqual(len(self.volunteer_handler.active_user_sessions), 0)
with self.assertRaises(UserSessionIdNotFoundError):
self.time_frame_handler.add_time_frame('2020-10-25 12:00:00', '2020-10-25 14:00:00', 'sessionId')
def test_add_time_frame_incorrect_date_pattern(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
incorrect_date_pattern = '20201025,12,00,00'
with self.assertRaises(ValueError):
self.time_frame_handler.add_time_frame(incorrect_date_pattern, '2020-10-25 14:00:00', session_id)
def test_get_time_frames_correctly(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
other_volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
time_frame_1 = TimeFrame(volunteer_id, datetime.fromisoformat('2020-10-25 12:00:00'), datetime.fromisoformat('2020-10-25 14:00:00'), [])
time_frame_2 = TimeFrame(other_volunteer_id, datetime.fromisoformat('2020-10-25 12:00:00'), datetime.fromisoformat('2020-10-25 14:00:00'), [])
time_frame_1_id = self.dao.store_one(time_frame_1.to_db_object())
time_frame_2_id = self.dao.store_one(time_frame_2.to_db_object())
time_frames = self.time_frame_handler.get_time_frames(session_id)
self.assertEqual(len(time_frames), 1)
self.assertEqual(time_frames[0]['id'], time_frame_1_id)
def test_get_time_frames_with_unknown_session_id(self):
self.assertEqual(len(self.volunteer_handler.active_user_sessions), 0)
with self.assertRaises(UserSessionIdNotFoundError):
self.time_frame_handler.get_time_frames('sessionId')
def test_add_request_to_time_frame_correctly(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
time_frame = TimeFrame(volunteer_id, datetime.fromisoformat('2020-10-25 12:00:00'), datetime.fromisoformat('2020-10-25 14:00:00'), [])
time_frame.id = self.dao.store_one(time_frame.to_db_object())
request_1 = Request(
requester=str(ObjectId()),
status=RequestStatus.IN_PROGRESS,
items=[],
volunteer=volunteer_id
)
request_2 = Request(
requester=str(ObjectId()),
status=RequestStatus.IN_PROGRESS,
items=[],
volunteer=volunteer_id
)
request_1.id = self.requests_dao.store_one(request_1.to_db_object())
request_2.id = self.requests_dao.store_one(request_2.to_db_object())
self.time_frame_handler.add_request_to_time_frame(time_frame.id, request_1.id, session_id)
self.time_frame_handler.add_request_to_time_frame(time_frame.id, request_2.id, session_id)
time_frames = self.dao.get_time_frames_by_volunteer(volunteer_id)
self.assertEqual(len(time_frames), 1)
self.assertEqual(str(time_frames[0]['_id']), time_frame.id)
self.assertEqual(len(time_frames[0]['requests']), 2)
self.assertEqual(str(time_frames[0]['requests'][0]), request_1.id)
self.assertEqual(str(time_frames[0]['requests'][1]), request_2.id)
def test_add_request_to_time_frame_with_unknown_session_id(self):
self.assertEqual(len(self.volunteer_handler.active_user_sessions), 0)
with self.assertRaises(UserSessionIdNotFoundError):
self.time_frame_handler.add_request_to_time_frame(str(ObjectId()), str(ObjectId()), 'sessionId')
def test_add_request_to_time_frame_with_incorrect_time_frame_id(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
request = Request(
requester=str(ObjectId()),
status=RequestStatus.IN_PROGRESS,
items=[],
volunteer=volunteer_id
)
request.id = self.requests_dao.store_one(request.to_db_object())
self.assertEqual(len(self.dao.get_all()), 0)
with self.assertRaises(ObjectIdNotFoundError):
self.time_frame_handler.add_request_to_time_frame(str(ObjectId()), request.id, session_id)
def test_add_request_to_time_frame_with_incorrect_request_id(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
time_frame = TimeFrame(volunteer_id, datetime.fromisoformat('2020-10-25 12:00:00'), datetime.fromisoformat('2020-10-25 14:00:00'), [])
time_frame.id = self.dao.store_one(time_frame.to_db_object())
self.assertEqual(len(self.requests_dao.get_all()), 0)
with self.assertRaises(ObjectIdNotFoundError):
self.time_frame_handler.add_request_to_time_frame(time_frame.id, str(ObjectId()), session_id)
def test_add_request_to_time_frame_with_incorrect_volunteer_id_at_time_frame(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
other_volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
time_frame = TimeFrame(other_volunteer_id, datetime.fromisoformat('2020-10-25 12:00:00'), datetime.fromisoformat('2020-10-25 14:00:00'), [])
time_frame.id = self.dao.store_one(time_frame.to_db_object())
request = Request(
requester=str(ObjectId()),
status=RequestStatus.IN_PROGRESS,
items=[],
volunteer=volunteer_id
)
request.id = self.requests_dao.store_one(request.to_db_object())
with self.assertRaises(UnauthorizedAccessError):
self.time_frame_handler.add_request_to_time_frame(time_frame.id, request.id, session_id)
def test_add_request_to_time_frame_with_incorrect_volunteer_id_at_request(self):
session_id = 'someId'
volunteer_id = str(ObjectId())
other_volunteer_id = str(ObjectId())
volunteer = Volunteer('login', 'pw', 'first', 'last', volunteer_id)
self.volunteer_handler.active_user_sessions[session_id] = volunteer
time_frame = TimeFrame(volunteer_id, datetime.fromisoformat('2020-10-25 12:00:00'), datetime.fromisoformat('2020-10-25 14:00:00'), [])
time_frame.id = self.dao.store_one(time_frame.to_db_object())
request = Request(
requester=str(ObjectId()),
status=RequestStatus.IN_PROGRESS,
items=[],
volunteer=other_volunteer_id
)
request.id = self.requests_dao.store_one(request.to_db_object())
with self.assertRaises(UnauthorizedAccessError):
self.time_frame_handler.add_request_to_time_frame(time_frame.id, request.id, session_id)
| 52.230337
| 150
| 0.705066
| 1,194
| 9,297
| 5.160804
| 0.076214
| 0.087634
| 0.022071
| 0.033755
| 0.825057
| 0.807368
| 0.759007
| 0.691334
| 0.685329
| 0.666342
| 0
| 0.038163
| 0.18264
| 9,297
| 177
| 151
| 52.525424
| 0.772733
| 0
| 0
| 0.531646
| 0
| 0
| 0.066487
| 0
| 0
| 0
| 0
| 0
| 0.164557
| 1
| 0.075949
| false
| 0
| 0.06962
| 0
| 0.189873
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b215212da36815371b1ce3a1815acc7c589077be
| 338
|
py
|
Python
|
oscar/lib/python2.7/site-packages/debug_toolbar/compat.py
|
sainjusajan/django-oscar
|
466e8edc807be689b0a28c9e525c8323cc48b8e1
|
[
"BSD-3-Clause"
] | null | null | null |
oscar/lib/python2.7/site-packages/debug_toolbar/compat.py
|
sainjusajan/django-oscar
|
466e8edc807be689b0a28c9e525c8323cc48b8e1
|
[
"BSD-3-Clause"
] | null | null | null |
oscar/lib/python2.7/site-packages/debug_toolbar/compat.py
|
sainjusajan/django-oscar
|
466e8edc807be689b0a28c9e525c8323cc48b8e1
|
[
"BSD-3-Clause"
] | null | null | null |
"""
This file exists to contain all Django and Python compatibility issues.
In order to avoid circular references, nothing should be imported from
debug_toolbar.
"""
try:
from django.template.base import linebreak_iter # NOQA
except ImportError: # Django < 1.9
from django.views.debug import linebreak_iter # NOQA
| 28.166667
| 72
| 0.739645
| 46
| 338
| 5.369565
| 0.76087
| 0.080972
| 0.153846
| 0.186235
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007407
| 0.201183
| 338
| 11
| 73
| 30.727273
| 0.907407
| 0.538462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b21b095fb2d0b027f6debc622c4983689f53e1f6
| 8,708
|
py
|
Python
|
tests/test_models.py
|
condnsdmatters/twirps
|
e2a15ae21129fedb400415ad1b70f6a931b046c4
|
[
"MIT"
] | 3
|
2015-05-08T16:19:40.000Z
|
2016-05-03T07:54:04.000Z
|
tests/test_models.py
|
condnsdmatters/twirps
|
e2a15ae21129fedb400415ad1b70f6a931b046c4
|
[
"MIT"
] | null | null | null |
tests/test_models.py
|
condnsdmatters/twirps
|
e2a15ae21129fedb400415ad1b70f6a931b046c4
|
[
"MIT"
] | null | null | null |
from twirps.classes import Tweet
from twirps.data_collection import authorize_twitter
import datetime
import unittest
import json
import os
class TestTweetModel(unittest.TestCase):
def setUp(self):
self.api = authorize_twitter()
def tearDown(self):
pass
def test_parse_mention(self):
# https://twitter.com/condnsdmatters/status/715174694958272513
# Tweet: 715174694958272513 condnsdmatters || RC: 0 || FC: 0 || RT: None || @ 1 || # 0 || Url 0
# Content: platy loves @GOVUK
status = self.api.get_status(715174694958272513)
test_tweet = Tweet(status, 'twitter')
self.assertEqual(test_tweet.tweet_id, 715174694958272513)
self.assertEqual(test_tweet.user_id, 701110092675031041)
self.assertEqual(test_tweet.handle, 'condnsdmatters')
self.assertEqual(test_tweet.mentions, [(17481977, 'GOVUK')])
self.assertEqual(test_tweet.content, 'platy loves @GOVUK')
self.assertEqual(test_tweet.is_retweet, False )
self.assertEqual(test_tweet.retweeted_user, None)
self.assertEqual(test_tweet.retweet_count, 0)
self.assertEqual(test_tweet.favourite_count, 0)
self.assertEqual(test_tweet.hashtags, [])
self.assertEqual(test_tweet.date, datetime.datetime(2016, 3, 30, 13, 51, 49) )
self.assertEqual(test_tweet.urls, [])
self.assertEqual(test_tweet.in_reply_to_status_id, None)
self.assertEqual(test_tweet.in_reply_to_user, None)
self.assertEqual(test_tweet.is_reply, False )
def test_parse_mention_hash_link(self):
# https://twitter.com/GOVUK/status/673864586982854657
# Tweet: 673864586982854657 GOVUK || RC: 17 || FC: 9 || RT: None || @ 1 || # 1 || Url 1
# Content: For the latest on the floods, please follow @EnvAgency, #floodaware or visit GOV.UK: https://t.co/kZAdl7JvKb
status = self.api.get_status(673864586982854657)
test_tweet = Tweet(status, 'twitter')
self.assertEqual(test_tweet.tweet_id, 673864586982854657)
self.assertEqual(test_tweet.user_id, 17481977)
self.assertEqual(test_tweet.handle, 'GOVUK')
self.assertEqual(test_tweet.mentions, [(47331384, 'EnvAgency')])
self.assertEqual(test_tweet.content, 'For the latest on the floods, please follow @EnvAgency, #floodaware or visit GOV.UK: https://t.co/kZAdl7JvKb')
self.assertEqual(test_tweet.is_retweet, False )
self.assertEqual(test_tweet.retweeted_user, None)
self.assertEqual(test_tweet.retweet_count, 17)
self.assertEqual(test_tweet.favourite_count, 9)
self.assertEqual(test_tweet.hashtags, ['floodaware'])
self.assertEqual(test_tweet.date, datetime.datetime(2015, 12, 7, 14, 0, 11) )
self.assertEqual(test_tweet.urls, ['https://www.gov.uk/prepare-for-a-flood/find-out-if-youre-at-risk'])
self.assertEqual(test_tweet.in_reply_to_status_id, None)
self.assertEqual(test_tweet.in_reply_to_user, None)
self.assertEqual(test_tweet.is_reply, False )
def test_parse_retweet(self):
# https://twitter.com/condnsdmatters/status/715175357658374148
# Tweet: 715175357658374148 condnsdmatters || RC: 17 || FC: 0 || RT: GOVUK || @ 1 || # 1 || Url 1
# Content: For the latest on the floods, please follow @EnvAgency, #floodaware or visit GOV.UK: https://t.co/kZAdl7JvKb
status = self.api.get_status(715175357658374148)
test_tweet = Tweet(status, 'twitter')
self.assertEqual(test_tweet.tweet_id, 715175357658374148)
self.assertEqual(test_tweet.user_id, 701110092675031041)
self.assertEqual(test_tweet.handle, 'condnsdmatters')
self.assertEqual(test_tweet.mentions, [(47331384, 'EnvAgency')])
self.assertEqual(test_tweet.content, 'For the latest on the floods, please follow @EnvAgency, #floodaware or visit GOV.UK: https://t.co/kZAdl7JvKb')
self.assertEqual(test_tweet.is_retweet, True )
self.assertEqual(test_tweet.retweet_status_id, 673864586982854657)
self.assertEqual(test_tweet.retweeted_user, (17481977, 'GOVUK'))
self.assertEqual(test_tweet.retweet_count, 17)
self.assertEqual(test_tweet.favourite_count, 0)
self.assertEqual(test_tweet.hashtags, ['floodaware'])
self.assertEqual(test_tweet.date, datetime.datetime(2016, 3, 30, 13, 54, 27) )
self.assertEqual(test_tweet.urls, ['https://www.gov.uk/prepare-for-a-flood/find-out-if-youre-at-risk'])
self.assertEqual(test_tweet.in_reply_to_status_id, None)
self.assertEqual(test_tweet.in_reply_to_user, None)
self.assertEqual(test_tweet.is_reply, False )
def test_parse_reply_on_other(self):
# https://twitter.com/WhittakerTrevor/status/674157223334060032
# Tweet: 674157223334060032 WhittakerTrevor || RC: 0 || FC: 0 || RT: REPLY || @ 2 || # 0 || Url 0
# Content: @GOVUK @EnvAgency STOP CUTTING GREEN SUBSIDIES WHAT YOU TRYING TO SAVE MONEY FOR MONEY YOU WONT NEED IT WHEN YOU HAVE DESYROYED THE EARTH
status = self.api.get_status(674157223334060032)
test_tweet = Tweet(status, 'twitter')
self.assertEqual(test_tweet.tweet_id, 674157223334060032)
self.assertEqual(test_tweet.user_id, 464109437)
self.assertEqual(test_tweet.handle, 'WhittakerTrevor')
self.assertEqual(test_tweet.mentions, [(17481977, 'GOVUK'), (47331384, 'EnvAgency')])
self.assertEqual(test_tweet.content, '@GOVUK @EnvAgency STOP CUTTING GREEN SUBSIDIES WHAT YOU TRYING TO SAVE MONEY FOR MONEY YOU WONT NEED IT WHEN YOU HAVE DESYROYED THE EARTH')
self.assertEqual(test_tweet.is_retweet, False )
self.assertEqual(test_tweet.retweet_status_id, 0)
self.assertEqual(test_tweet.retweeted_user, None)
self.assertEqual(test_tweet.retweet_count, 0)
self.assertEqual(test_tweet.favourite_count, 0)
self.assertEqual(test_tweet.hashtags, [])
self.assertEqual(test_tweet.date, datetime.datetime(2015, 12, 8, 9, 23, 1) )
self.assertEqual(test_tweet.urls, [])
self.assertEqual(test_tweet.in_reply_to_status_id, 673864586982854657)
self.assertEqual(test_tweet.in_reply_to_user, (17481977, 'GOVUK'))
self.assertEqual(test_tweet.is_reply, True )
def test_parse_reply_on_self(self):
# https://twitter.com/annaturley/status/714936442384990208
# Tweet: 714936442384990208 annaturley || RC: 2 || FC: 0 || RT: REPLY || @ 1 || # 0 || Url 0
# Content: @Opensout I want them to step in and take control of the site. I am just gutted they wouldn't consider this for Redcar.
status = self.api.get_status(714936442384990208)
test_tweet = Tweet(status, 'twitter')
self.assertEqual(test_tweet.tweet_id, 714936442384990208)
self.assertEqual(test_tweet.user_id, 22398060)
self.assertEqual(test_tweet.handle, 'annaturley')
self.assertEqual(test_tweet.mentions, [(3002057294, u'Opensout')])
self.assertEqual(test_tweet.content, "@Opensout I want them to step in and take control of the site. I am just gutted they wouldn't consider this for Redcar.")
self.assertEqual(test_tweet.is_retweet, False )
self.assertEqual(test_tweet.retweet_status_id, 0)
self.assertEqual(test_tweet.retweeted_user, None)
self.assertEqual(test_tweet.retweet_count, 2)
self.assertEqual(test_tweet.favourite_count, 0)
self.assertEqual(test_tweet.hashtags, [])
self.assertEqual(test_tweet.date, datetime.datetime(2016, 3, 29, 22, 5, 5) )
self.assertEqual(test_tweet.urls, [])
self.assertEqual(test_tweet.in_reply_to_status_id, 714935890695614466)
self.assertEqual(test_tweet.in_reply_to_user, (3002057294, u'Opensout'))
self.assertEqual(test_tweet.is_reply, True )
# def test_user_timeline(self):
# tweets = self.api.user_timeline()
# print
# for t in tweets:
# print Tweet(t, 'twitter')
if __name__=='__main__':
unittest.main(verbosity=2)
def test_return_constituency_list(self):
'''ACCESS:: Test all constituencies returned in a list'''
arch = archipelago.Archipelago("sqlite:///test.db")
constituency_list = arch.get_constituencies()
start_constituencies = [u'Aberavon', u'Aberconwy', u'Aberdeen North']
end_constituencies = [u'Ynys M\xf4n', u'York Central', u'York Outer']
# Test correct
self.assertEqual(len(constituency_list), 650 )
self.assertEqual( start_constituencies, constituency_list[:3] )
self.assertEqual( end_constituencies, constituency_list[-3:] )
| 54.425
| 186
| 0.698553
| 1,095
| 8,708
| 5.367123
| 0.173516
| 0.127106
| 0.252169
| 0.31853
| 0.749022
| 0.705802
| 0.667688
| 0.618343
| 0.605751
| 0.589416
| 0
| 0.094243
| 0.192122
| 8,708
| 159
| 187
| 54.767296
| 0.741151
| 0.170763
| 0
| 0.45614
| 0
| 0.052632
| 0.122878
| 0
| 0
| 0
| 0
| 0
| 0.710526
| 1
| 0.070175
| false
| 0.008772
| 0.052632
| 0
| 0.131579
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b22728f805dc290ad2da40b5ca24b4caea0179b0
| 75
|
py
|
Python
|
weldx/tags/debug/__init__.py
|
CagtayFabry/weldx
|
463f949d4fa54b5edafa2268cb862716865a62c2
|
[
"BSD-3-Clause"
] | 13
|
2020-02-20T07:45:02.000Z
|
2021-12-10T13:15:47.000Z
|
weldx/tags/debug/__init__.py
|
BAMWelDX/weldx
|
ada4e67fa00cdb80a0b954057f4e685b846c9fe5
|
[
"BSD-3-Clause"
] | 675
|
2020-02-20T07:47:00.000Z
|
2022-03-31T15:17:19.000Z
|
weldx/tags/debug/__init__.py
|
CagtayFabry/weldx
|
463f949d4fa54b5edafa2268cb862716865a62c2
|
[
"BSD-3-Clause"
] | 5
|
2020-09-02T07:19:17.000Z
|
2021-12-05T08:57:50.000Z
|
from . import test_property_tag, test_shape_validator, test_unit_validator
| 37.5
| 74
| 0.88
| 11
| 75
| 5.454545
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 75
| 1
| 75
| 75
| 0.869565
| 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
|
b228e3297c6ca8b613b398b25d07294450f0721c
| 218
|
py
|
Python
|
Analysis/forms.py
|
psymen145/OVS-django-fe
|
1823e8b42c17276d6b50a63dddd9b04a21c2038c
|
[
"MIT"
] | null | null | null |
Analysis/forms.py
|
psymen145/OVS-django-fe
|
1823e8b42c17276d6b50a63dddd9b04a21c2038c
|
[
"MIT"
] | null | null | null |
Analysis/forms.py
|
psymen145/OVS-django-fe
|
1823e8b42c17276d6b50a63dddd9b04a21c2038c
|
[
"MIT"
] | null | null | null |
from django import forms
from .models import *
class NewAnalysisForm(forms.ModelForm):
class Meta:
model = DatapullId
fields = ('pullname','pullquery','pulltype','pullsource','pullby',)
| 21.8
| 76
| 0.651376
| 21
| 218
| 6.761905
| 0.809524
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.229358
| 218
| 9
| 77
| 24.222222
| 0.845238
| 0
| 0
| 0
| 0
| 0
| 0.196172
| 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
|
b24efecb627e26cc73ce46ad1773c2ea2bb17f98
| 255
|
py
|
Python
|
tumblelog/util.py
|
registerguard/django-tumblelog
|
d5582c0e511d56998e19efa07db1e4badfec483b
|
[
"MIT"
] | null | null | null |
tumblelog/util.py
|
registerguard/django-tumblelog
|
d5582c0e511d56998e19efa07db1e4badfec483b
|
[
"MIT"
] | null | null | null |
tumblelog/util.py
|
registerguard/django-tumblelog
|
d5582c0e511d56998e19efa07db1e4badfec483b
|
[
"MIT"
] | null | null | null |
from django.db.models import get_model
def import_model(path):
"""
Passed a string "app.Model", will return Model registered inside app.
"""
split = path.split('.')
return get_model(split[0], split[-1]) # <app>.contrib[.bla].<model>
| 25.5
| 73
| 0.65098
| 36
| 255
| 4.527778
| 0.611111
| 0.09816
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009662
| 0.188235
| 255
| 9
| 74
| 28.333333
| 0.777778
| 0.384314
| 0
| 0
| 0
| 0
| 0.007092
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b27b7b8c49b82211c68832c347ddca6ca6f7ed20
| 52
|
py
|
Python
|
TimeWrapper_JE/venv/Lib/site-packages/pip/_internal/network/__init__.py
|
JE-Chen/je_old_repo
|
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
|
[
"MIT"
] | 227
|
2021-01-20T05:34:32.000Z
|
2022-03-29T12:43:05.000Z
|
TimeWrapper_JE/venv/Lib/site-packages/pip/_internal/network/__init__.py
|
JE-Chen/je_old_repo
|
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
|
[
"MIT"
] | 55
|
2020-09-07T02:12:51.000Z
|
2022-03-23T02:37:42.000Z
|
TimeWrapper_JE/venv/Lib/site-packages/pip/_internal/network/__init__.py
|
JE-Chen/je_old_repo
|
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
|
[
"MIT"
] | 239
|
2021-01-28T02:59:53.000Z
|
2022-03-29T08:02:17.000Z
|
"""Contains purely network-related utilities.
"""
| 17.333333
| 46
| 0.711538
| 5
| 52
| 7.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134615
| 52
| 2
| 47
| 26
| 0.822222
| 0.807692
| 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
|
b27ffc7b3ba093b3f56f3dbdfbdcb465524cc362
| 229
|
py
|
Python
|
MiniOsaka/forward_reference_error.py
|
t2y/python-study
|
52a132ea600d4696164e540d8a8f8f5fc58e097a
|
[
"Apache-2.0"
] | 18
|
2016-08-15T00:24:44.000Z
|
2020-11-30T15:11:52.000Z
|
MiniOsaka/forward_reference_error.py
|
t2y/python-study
|
52a132ea600d4696164e540d8a8f8f5fc58e097a
|
[
"Apache-2.0"
] | null | null | null |
MiniOsaka/forward_reference_error.py
|
t2y/python-study
|
52a132ea600d4696164e540d8a8f8f5fc58e097a
|
[
"Apache-2.0"
] | 6
|
2016-09-28T10:47:03.000Z
|
2020-10-14T10:20:06.000Z
|
class A:
def f(self):
return B()
a = A()
a.f() # NameError: name 'B' is not defined
b = B() # NameError: name 'B' is not defined
def f():
b = B()
f() # NameError: name 'B' is not defined
class B:
pass
| 13.470588
| 45
| 0.532751
| 39
| 229
| 3.128205
| 0.333333
| 0.319672
| 0.344262
| 0.393443
| 0.655738
| 0.655738
| 0.442623
| 0
| 0
| 0
| 0
| 0
| 0.310044
| 229
| 16
| 46
| 14.3125
| 0.772152
| 0.454148
| 0
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.181818
| false
| 0.090909
| 0
| 0.090909
| 0.454545
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
a22f6e9105e3dc56548bb2a1b4bddd5049d55a2f
| 206
|
py
|
Python
|
homura/modules/functional/__init__.py
|
983632847/homura
|
81d9ffba3a8eb5172fc2bd08fec10e816138ef2e
|
[
"Apache-2.0"
] | 1
|
2020-11-24T07:41:01.000Z
|
2020-11-24T07:41:01.000Z
|
homura/modules/functional/__init__.py
|
983632847/homura
|
81d9ffba3a8eb5172fc2bd08fec10e816138ef2e
|
[
"Apache-2.0"
] | null | null | null |
homura/modules/functional/__init__.py
|
983632847/homura
|
81d9ffba3a8eb5172fc2bd08fec10e816138ef2e
|
[
"Apache-2.0"
] | null | null | null |
from .convert import *
from .discretization import *
from .grad_approximation import custom_straight_through_estimator
from .knn import k_nearest_neighbor
from .loss import *
from .sinkhorn import sinkhorn
| 29.428571
| 65
| 0.839806
| 27
| 206
| 6.185185
| 0.592593
| 0.179641
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116505
| 206
| 6
| 66
| 34.333333
| 0.917582
| 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
|
a236f1320b0fc14e225a990ff4f9430e01bb2728
| 375
|
py
|
Python
|
src/spacexpython/__init__.py
|
EmonCodingBackEndf/alshapton8
|
28baa090d88e51d1a84598f232c933ff68920d2e
|
[
"MIT"
] | 7
|
2019-09-02T11:15:16.000Z
|
2020-10-30T21:28:04.000Z
|
src/spacexpython/__init__.py
|
EmonCodingBackEndf/alshapton8
|
28baa090d88e51d1a84598f232c933ff68920d2e
|
[
"MIT"
] | 195
|
2019-08-18T23:03:17.000Z
|
2022-03-31T20:56:31.000Z
|
src/spacexpython/__init__.py
|
alshapton/SpacePY-X4
|
c3279e1b13f6f72bf1f43c55b0d130ba5da35481
|
[
"MIT"
] | 4
|
2019-08-18T23:36:10.000Z
|
2021-09-12T19:52:05.000Z
|
# Console entry point
from . import capsules
from . import cores
from . import crew
from . import dragons
from . import history
from . import info
from . import landingpads
from . import launches
from . import launchpads
from . import missions
from . import payloads
from . import roadster
from . import rockets
from . import ships
from . import urldata
from . import utils
| 19.736842
| 25
| 0.770667
| 51
| 375
| 5.666667
| 0.411765
| 0.553633
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184
| 375
| 18
| 26
| 20.833333
| 0.944444
| 0.050667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a25e3963c95a6ebcf64148b280bac990059e53f9
| 44
|
py
|
Python
|
bore/plugins/hpbandster/__init__.py
|
rafaol/bore
|
41236882c9aea088322b35afe0febb838d3eefa5
|
[
"MIT"
] | null | null | null |
bore/plugins/hpbandster/__init__.py
|
rafaol/bore
|
41236882c9aea088322b35afe0febb838d3eefa5
|
[
"MIT"
] | null | null | null |
bore/plugins/hpbandster/__init__.py
|
rafaol/bore
|
41236882c9aea088322b35afe0febb838d3eefa5
|
[
"MIT"
] | null | null | null |
from .base import BORE
__all__ = ["BORE"]
| 8.8
| 22
| 0.659091
| 6
| 44
| 4.166667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.204545
| 44
| 4
| 23
| 11
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 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
|
a26a3598a2561b63a0483f98c14044ef633abd4a
| 13,001
|
py
|
Python
|
reviewboard/scmtools/tests/test_repository.py
|
BarracudaPff/code-golf-data-pythpn
|
42e8858c2ebc6a061012bcadb167d29cebb85c5e
|
[
"MIT"
] | null | null | null |
reviewboard/scmtools/tests/test_repository.py
|
BarracudaPff/code-golf-data-pythpn
|
42e8858c2ebc6a061012bcadb167d29cebb85c5e
|
[
"MIT"
] | null | null | null |
reviewboard/scmtools/tests/test_repository.py
|
BarracudaPff/code-golf-data-pythpn
|
42e8858c2ebc6a061012bcadb167d29cebb85c5e
|
[
"MIT"
] | null | null | null |
class RepositoryTests(TestCase):
"""Unit tests for Repository operations."""
fixtures = ["test_scmtools"]
def setUp(self):
super(RepositoryTests, self).setUp()
self.local_repo_path = os.path.join(os.path.dirname(__file__), "..", "testdata", "git_repo")
self.repository = Repository.objects.create(name="Git test repo", path=self.local_repo_path, tool=Tool.objects.get(name="Git"))
self.scmtool_cls = self.repository.get_scmtool().__class__
self.old_get_file = self.scmtool_cls.get_file
self.old_file_exists = self.scmtool_cls.file_exists
def tearDown(self):
super(RepositoryTests, self).tearDown()
cache.clear()
self.scmtool_cls.get_file = self.old_get_file
self.scmtool_cls.file_exists = self.old_file_exists
def test_archive(self):
"""Testing Repository.archive"""
self.repository.archive()
self.assertTrue(self.repository.name.startswith("ar:Git test repo:"))
self.assertTrue(self.repository.archived)
self.assertFalse(self.repository.public)
self.assertIsNotNone(self.repository.archived_timestamp)
repository = Repository.objects.get(pk=self.repository.pk)
self.assertEqual(repository.name, self.repository.name)
self.assertEqual(repository.archived, self.repository.archived)
self.assertEqual(repository.public, self.repository.public)
self.assertEqual(repository.archived_timestamp, self.repository.archived_timestamp)
def test_archive_no_save(self):
"""Testing Repository.archive with save=False"""
self.repository.archive(save=False)
self.assertTrue(self.repository.name.startswith("ar:Git test repo:"))
self.assertTrue(self.repository.archived)
self.assertFalse(self.repository.public)
self.assertIsNotNone(self.repository.archived_timestamp)
repository = Repository.objects.get(pk=self.repository.pk)
self.assertNotEqual(repository.name, self.repository.name)
self.assertNotEqual(repository.archived, self.repository.archived)
self.assertNotEqual(repository.public, self.repository.public)
self.assertNotEqual(repository.archived_timestamp, self.repository.archived_timestamp)
def test_clean_without_conflict(self):
"""Testing Repository.clean without name/path conflicts"""
with self.assertNumQueries(1):
self.repository.clean()
def test_clean_with_name_conflict(self):
"""Testing Repository.clean with name conflict"""
repository = Repository(name=self.repository.name, path="path/to/repo.git", tool=self.repository.tool)
with self.assertRaises(ValidationError) as ctx:
with self.assertNumQueries(1):
repository.clean()
self.assertEqual(ctx.exception.message_dict, {"name": ["A repository with this name already exists"]})
def test_clean_with_path_conflict(self):
"""Testing Repository.clean with path conflict"""
repository = Repository(name="New test repo", path=self.repository.path, tool=self.repository.tool)
with self.assertRaises(ValidationError) as ctx:
with self.assertNumQueries(1):
repository.clean()
self.assertEqual(ctx.exception.message_dict, {"path": ["A repository with this path already exists"]})
def test_clean_with_name_and_path_conflict(self):
"""Testing Repository.clean with name and path conflict"""
repository = Repository(name=self.repository.name, path=self.repository.path, tool=self.repository.tool)
with self.assertRaises(ValidationError) as ctx:
with self.assertNumQueries(1):
repository.clean()
self.assertEqual(ctx.exception.message_dict, {"name": ["A repository with this name already exists"], "path": ["A repository with this path already exists"]})
def test_clean_with_path_conflict_with_archived(self):
"""Testing Repository.clean with archived repositories ignored for
path conflict
"""
self.repository.archive()
repository = Repository(name="New test repo", path=self.repository.path, tool=self.repository.tool)
with self.assertNumQueries(1):
repository.clean()
def test_get_file_caching(self):
"""Testing Repository.get_file caches result"""
def get_file(self, path, revision, **kwargs):
num_calls["get_file"] += 1
return b"file data"
num_calls = {"get_file": 0}
path = "readme"
revision = "e965047"
request = {}
self.scmtool_cls.get_file = get_file
data1 = self.repository.get_file(path, revision, request=request)
data2 = self.repository.get_file(path, revision, request=request)
self.assertIsInstance(data1, bytes)
self.assertIsInstance(data2, bytes)
self.assertEqual(data1, b"file data")
self.assertEqual(data1, data2)
self.assertEqual(num_calls["get_file"], 1)
def test_get_file_signals(self):
"""Testing Repository.get_file emits signals"""
def on_fetching_file(sender, path, revision, request, **kwargs):
found_signals.append(("fetching_file", path, revision, request))
def on_fetched_file(sender, path, revision, request, **kwargs):
found_signals.append(("fetched_file", path, revision, request))
found_signals = []
fetching_file.connect(on_fetching_file, sender=self.repository)
fetched_file.connect(on_fetched_file, sender=self.repository)
path = "readme"
revision = "e965047"
request = {}
self.repository.get_file(path, revision, request=request)
self.assertEqual(len(found_signals), 2)
self.assertEqual(found_signals[0], ("fetching_file", path, revision, request))
self.assertEqual(found_signals[1], ("fetched_file", path, revision, request))
def test_get_file_exists_caching_when_exists(self):
"""Testing Repository.get_file_exists caches result when exists"""
def file_exists(self, path, revision, **kwargs):
num_calls["get_file_exists"] += 1
return True
num_calls = {"get_file_exists": 0}
path = "readme"
revision = "e965047"
request = {}
self.scmtool_cls.file_exists = file_exists
exists1 = self.repository.get_file_exists(path, revision, request=request)
exists2 = self.repository.get_file_exists(path, revision, request=request)
self.assertTrue(exists1)
self.assertTrue(exists2)
self.assertEqual(num_calls["get_file_exists"], 1)
def test_get_file_exists_caching_when_not_exists(self):
"""Testing Repository.get_file_exists doesn't cache result when the
file does not exist
"""
def file_exists(self, path, revision, **kwargs):
num_calls["get_file_exists"] += 1
return False
num_calls = {"get_file_exists": 0}
path = "readme"
revision = "12345"
request = {}
self.scmtool_cls.file_exists = file_exists
exists1 = self.repository.get_file_exists(path, revision, request=request)
exists2 = self.repository.get_file_exists(path, revision, request=request)
self.assertFalse(exists1)
self.assertFalse(exists2)
self.assertEqual(num_calls["get_file_exists"], 2)
def test_get_file_exists_caching_with_fetched_file(self):
"""Testing Repository.get_file_exists uses get_file's cached result"""
def get_file(self, path, revision, **kwargs):
num_calls["get_file"] += 1
return b"file data"
def file_exists(self, path, revision, **kwargs):
num_calls["get_file_exists"] += 1
return True
num_calls = {"get_file_exists": 0, "get_file": 0}
path = "readme"
revision = "e965047"
request = {}
self.scmtool_cls.get_file = get_file
self.scmtool_cls.file_exists = file_exists
self.repository.get_file(path, revision, request=request)
exists1 = self.repository.get_file_exists(path, revision, request=request)
exists2 = self.repository.get_file_exists(path, revision, request=request)
self.assertTrue(exists1)
self.assertTrue(exists2)
self.assertEqual(num_calls["get_file"], 1)
self.assertEqual(num_calls["get_file_exists"], 0)
def test_get_file_exists_signals(self):
"""Testing Repository.get_file_exists emits signals"""
def on_checking(sender, path, revision, request, **kwargs):
found_signals.append(("checking_file_exists", path, revision, request))
def on_checked(sender, path, revision, request, **kwargs):
found_signals.append(("checked_file_exists", path, revision, request))
found_signals = []
checking_file_exists.connect(on_checking, sender=self.repository)
checked_file_exists.connect(on_checked, sender=self.repository)
path = "readme"
revision = "e965047"
request = {}
self.repository.get_file_exists(path, revision, request=request)
self.assertEqual(len(found_signals), 2)
self.assertEqual(found_signals[0], ("checking_file_exists", path, revision, request))
self.assertEqual(found_signals[1], ("checked_file_exists", path, revision, request))
def test_repository_name_with_255_characters(self):
"""Testing Repository.name with 255 characters"""
self.repository = Repository.objects.create(name="t" * 255, path=self.local_repo_path, tool=Tool.objects.get(name="Git"))
self.assertEqual(len(self.repository.name), 255)
def test_is_accessible_by_with_public(self):
"""Testing Repository.is_accessible_by with public repository"""
user = self.create_user()
repository = self.create_repository()
self.assertTrue(repository.is_accessible_by(user))
self.assertTrue(repository.is_accessible_by(AnonymousUser()))
def test_is_accessible_by_with_public_and_hidden(self):
"""Testing Repository.is_accessible_by with public hidden repository"""
user = self.create_user()
repository = self.create_repository(visible=False)
self.assertTrue(repository.is_accessible_by(user))
self.assertTrue(repository.is_accessible_by(AnonymousUser()))
def test_is_accessible_by_with_private_and_not_member(self):
"""Testing Repository.is_accessible_by with private repository and
user not a member
"""
user = self.create_user()
repository = self.create_repository(public=False)
self.assertFalse(repository.is_accessible_by(user))
self.assertFalse(repository.is_accessible_by(AnonymousUser()))
def test_is_accessible_by_with_private_and_member(self):
"""Testing Repository.is_accessible_by with private repository and
user is a member
"""
user = self.create_user()
repository = self.create_repository(public=False)
repository.users.add(user)
self.assertTrue(repository.is_accessible_by(user))
def test_is_accessible_by_with_private_and_member_by_group(self):
"""Testing Repository.is_accessible_by with private repository and
user is a member by group
"""
user = self.create_user()
group = self.create_review_group(invite_only=True)
group.users.add(user)
repository = self.create_repository(public=False)
repository.review_groups.add(group)
self.assertTrue(repository.is_accessible_by(user))
def test_is_accessible_by_with_private_and_superuser(self):
"""Testing Repository.is_accessible_by with private repository and
user is a superuser
"""
user = self.create_user(is_superuser=True)
repository = self.create_repository(public=False)
self.assertTrue(repository.is_accessible_by(user))
def test_is_accessible_by_with_private_hidden_not_member(self):
"""Testing Repository.is_accessible_by with private hidden
repository and user not a member
"""
user = self.create_user()
repository = self.create_repository(public=False, visible=False)
self.assertFalse(repository.is_accessible_by(user))
def test_is_accessible_by_with_private_hidden_and_member(self):
"""Testing Repository.is_accessible_by with private hidden
repository and user is a member
"""
user = self.create_user()
repository = self.create_repository(public=False, visible=False)
repository.users.add(user)
self.assertTrue(repository.is_accessible_by(user))
def test_is_accessible_by_with_private_hidden_and_member_by_group(self):
"""Testing Repository.is_accessible_by with private hidden
repository and user is a member
"""
user = self.create_user()
group = self.create_review_group(invite_only=True)
group.users.add(user)
repository = self.create_repository(public=False, visible=False)
repository.review_groups.add(group)
self.assertTrue(repository.is_accessible_by(user))
def test_is_accessible_by_with_private_hidden_and_superuser(self):
"""Testing Repository.is_accessible_by with private hidden
repository and superuser
"""
user = self.create_user(is_superuser=True)
repository = self.create_repository(public=False, visible=False)
self.assertTrue(repository.is_accessible_by(user))
@add_fixtures(["test_users", "test_site"])
def test_is_accessible_by_with_local_site_accessible(self):
"""Testing Repository.is_accessible_by with Local Site accessible by
user
"""
user = self.create_user()
repository = self.create_repository(with_local_site=True)
repository.local_site.users.add(user)
self.assertTrue(repository.is_accessible_by(user))
@add_fixtures(["test_users", "test_site"])
def test_is_accessible_by_with_local_site_not_accessible(self):
"""Testing Repository.is_accessible_by with Local Site not accessible
by user
"""
user = self.create_user()
repository = self.create_repository(with_local_site=True)
self.assertFalse(repository.is_accessible_by(user))
self.assertFalse(repository.is_accessible_by(AnonymousUser()))
| 47.622711
| 160
| 0.770248
| 1,726
| 13,001
| 5.554461
| 0.080533
| 0.073016
| 0.058412
| 0.070095
| 0.859289
| 0.82591
| 0.752269
| 0.700115
| 0.63899
| 0.587254
| 0
| 0.008007
| 0.116222
| 13,001
| 273
| 161
| 47.622711
| 0.826371
| 0.132374
| 0
| 0.585586
| 0
| 0
| 0.069738
| 0
| 0
| 0
| 0
| 0
| 0.292793
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.198198
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a2a3fd07b02991dc69596654ddcd0f7ab9aceb1c
| 316
|
py
|
Python
|
kamui/core/use_case/stream/__init__.py
|
thepabloaguilar/kamui
|
b740d0fd4ff722a48e1e2e71c17aa5f1453cc57a
|
[
"Apache-2.0"
] | 5
|
2020-06-22T12:29:36.000Z
|
2020-12-25T16:08:15.000Z
|
kamui/core/use_case/stream/__init__.py
|
thepabloaguilar/kamui
|
b740d0fd4ff722a48e1e2e71c17aa5f1453cc57a
|
[
"Apache-2.0"
] | 280
|
2020-06-22T14:22:06.000Z
|
2022-03-31T11:03:55.000Z
|
kamui/core/use_case/stream/__init__.py
|
thepabloaguilar/kamui
|
b740d0fd4ff722a48e1e2e71c17aa5f1453cc57a
|
[
"Apache-2.0"
] | null | null | null |
from .create_new_stream import (
CreateNewStreamFromTopicUseCase,
CreateNewStreamFromStreamUseCase,
)
from .get_ksql_streams import GetKSQLStreamsUseCase
from .get_stream_by_name import GetStreamByNameUseCase
from .get_streams import GetStreamsUseCase
from .get_stream_details import GetStreamDetailsUseCase
| 35.111111
| 55
| 0.873418
| 31
| 316
| 8.580645
| 0.548387
| 0.105263
| 0.097744
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098101
| 316
| 8
| 56
| 39.5
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.625
| 0
| 0.625
| 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
|
a2a5cf603a4a600e26ea23f0a0e06636506be85e
| 304
|
py
|
Python
|
optimizers.py
|
kakaxi314/GuideNet
|
9f53b4086d707e94d48a47bbac7dd87aaba9fdea
|
[
"MIT"
] | 142
|
2019-08-06T09:01:36.000Z
|
2022-03-30T05:30:33.000Z
|
optimizers.py
|
kakaxi314/GuideNet
|
9f53b4086d707e94d48a47bbac7dd87aaba9fdea
|
[
"MIT"
] | 19
|
2019-08-03T05:41:48.000Z
|
2022-01-17T13:24:53.000Z
|
optimizers.py
|
kakaxi314/GuideNet
|
9f53b4086d707e94d48a47bbac7dd87aaba9fdea
|
[
"MIT"
] | 14
|
2019-11-26T03:03:10.000Z
|
2021-11-22T16:29:50.000Z
|
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Filename: optimizers.py
# @Project: GuideNet
# @Author: jie
# @Time: 2021/3/15 4:59 PM
"""
This is a fixup as pytorch 1.4.0 can not import AdamW directly from torch.optim
"""
from torch.optim import *
from torch.optim.adamw import AdamW
| 25.333333
| 79
| 0.651316
| 48
| 304
| 4.125
| 0.770833
| 0.136364
| 0.212121
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058091
| 0.207237
| 304
| 12
| 80
| 25.333333
| 0.763485
| 0.730263
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a2af233f4bdde6c150740a8aea7573450a83a6e9
| 145
|
py
|
Python
|
Soluciones/Python/Entrada_salida/Ejercicio13.py
|
TheInventorist/Material-Programacion
|
5de54671169224c6c6455eeb2918e91c6ee4e250
|
[
"MIT"
] | 1
|
2020-06-11T02:20:34.000Z
|
2020-06-11T02:20:34.000Z
|
Soluciones/Python/Entrada_salida/Ejercicio13.py
|
TheInventorist/Material-Programacion
|
5de54671169224c6c6455eeb2918e91c6ee4e250
|
[
"MIT"
] | 2
|
2020-06-17T17:14:48.000Z
|
2020-06-19T18:38:04.000Z
|
Soluciones/Python/Entrada_salida/Ejercicio13.py
|
TheInventorist/Material-Programacion
|
5de54671169224c6c6455eeb2918e91c6ee4e250
|
[
"MIT"
] | 2
|
2020-01-03T14:28:53.000Z
|
2021-07-19T13:30:32.000Z
|
from math import sqrt
a = int(input("Ingrese cateto a: "))
b = int(input("Ingrese cateto b: "))
print(f"La hipotenusa es: {sqrt(a**2 + b**2)}")
| 24.166667
| 47
| 0.634483
| 26
| 145
| 3.538462
| 0.615385
| 0.108696
| 0.326087
| 0.456522
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016393
| 0.158621
| 145
| 5
| 48
| 29
| 0.737705
| 0
| 0
| 0
| 0
| 0
| 0.503448
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0.25
| 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
|
a2cce44a19170f4b23f209c9cb384ecadb9e929a
| 112
|
py
|
Python
|
__init__.py
|
taxio/photo_mosaic
|
e298927174a251f272ffe83dc08216fa4deacde4
|
[
"MIT"
] | null | null | null |
__init__.py
|
taxio/photo_mosaic
|
e298927174a251f272ffe83dc08216fa4deacde4
|
[
"MIT"
] | 3
|
2018-03-23T12:35:07.000Z
|
2018-03-25T04:15:40.000Z
|
__init__.py
|
taxio/photo_mosaic
|
e298927174a251f272ffe83dc08216fa4deacde4
|
[
"MIT"
] | null | null | null |
from .preprocess import PreProcess
from .generator import PhotoMosaicGenerator
from .dbmanager import DBManager
| 28
| 43
| 0.866071
| 12
| 112
| 8.083333
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 112
| 3
| 44
| 37.333333
| 0.97
| 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
|
a2f6fa32ca1a3f678b9591c6ba489729ebfbc30e
| 1,529
|
py
|
Python
|
src/blockmatching/__init__.py
|
duducosmos/blockmatching
|
c37949cce79b58ae658d5814ba3cff906dc4ab4e
|
[
"Apache-2.0"
] | 1
|
2021-05-17T09:20:05.000Z
|
2021-05-17T09:20:05.000Z
|
src/blockmatching/__init__.py
|
duducosmos/blockmatching
|
c37949cce79b58ae658d5814ba3cff906dc4ab4e
|
[
"Apache-2.0"
] | null | null | null |
src/blockmatching/__init__.py
|
duducosmos/blockmatching
|
c37949cce79b58ae658d5814ba3cff906dc4ab4e
|
[
"Apache-2.0"
] | 3
|
2020-11-25T04:06:16.000Z
|
2022-01-21T16:36:16.000Z
|
#!/usr/bin/env python3.6
# -*- Coding: UTF-8 -*-
"""
Block Matching Algorithm to estimate optical flux and detection of moving
objects.
According to [cuevs2013]_ in a block matching (BM) approach:
'''...image frames in a video sequence are divided into blocks. For each
block in the current frame, the best matching block is identified inside a
region of the previous frame, aiming to minimize the sum of absolute
differences...'''
License
-------
Developed by: E. S. Pereira.
e-mail: pereira.somoza@gmail.com
Copyright [2019] [E. S. Pereira]
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.
References
----------
.. [cuevs2013] CUEVAS, Erik et al. Block matching algorithm for motion
estimation based on Artificial Bee Colony (ABC).
Applied Soft Computing, v. 13, n. 6, p. 3047-3059, 2013.
"""
from .blockmatching import *
from .clustering import *
from .vectormask import *
from .background import *
from .motionlayers import *
from .dlayers import *
from .savevideo import *
from .forecast import *
| 30.58
| 78
| 0.730543
| 223
| 1,529
| 5.004484
| 0.641256
| 0.062724
| 0.039427
| 0.028674
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027222
| 0.183126
| 1,529
| 49
| 79
| 31.204082
| 0.866293
| 0.856115
| 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
|
a2fd3c60466693192c74375f7c118d1eba1797d8
| 618
|
py
|
Python
|
helpinghand/__init__.py
|
QuantMarkFramework/helpinghand
|
c0afef640210e9b1d1a94065f521a42356b8d3a3
|
[
"MIT"
] | 1
|
2021-08-12T18:20:33.000Z
|
2021-08-12T18:20:33.000Z
|
helpinghand/__init__.py
|
QuantMarkFramework/helpinghand
|
c0afef640210e9b1d1a94065f521a42356b8d3a3
|
[
"MIT"
] | null | null | null |
helpinghand/__init__.py
|
QuantMarkFramework/helpinghand
|
c0afef640210e9b1d1a94065f521a42356b8d3a3
|
[
"MIT"
] | null | null | null |
from helpinghand.compute import compute, compute_many
from helpinghand.hardware_ansatz import create_hardware_ansatz
from helpinghand.gradient import get_max_from_result, get_max_from_VQE
from helpinghand.analyse import CircuitAnalytics, CircuitAnalyser
try:
from helpinghand.tket import to_tket, from_tket
from helpinghand.architectures import select_architecture
except ModuleNotFoundError:
pass
try:
from helpinghand.psi4_helper import molecus_for_working_psi4_distances
except ModuleNotFoundError:
pass
try:
from helpinghand.pyscf_helper import pyscf_create_hamiltonians
except ModuleNotFoundError:
pass
| 29.428571
| 71
| 0.877023
| 77
| 618
| 6.766234
| 0.428571
| 0.230326
| 0.103647
| 0.122841
| 0.180422
| 0.180422
| 0
| 0
| 0
| 0
| 0
| 0.003571
| 0.093851
| 618
| 20
| 72
| 30.9
| 0.926786
| 0
| 0
| 0.529412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.176471
| 0.470588
| 0
| 0.470588
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
0c02705c90c0d20749f4ae4e263dc07c5d192c4a
| 803
|
py
|
Python
|
interpreter/lexical_analysis/__init__.py
|
Gu1nness/CInterpreter
|
49a7a68ca6ae4254c45931ced2548d532505bd45
|
[
"MIT"
] | null | null | null |
interpreter/lexical_analysis/__init__.py
|
Gu1nness/CInterpreter
|
49a7a68ca6ae4254c45931ced2548d532505bd45
|
[
"MIT"
] | null | null | null |
interpreter/lexical_analysis/__init__.py
|
Gu1nness/CInterpreter
|
49a7a68ca6ae4254c45931ced2548d532505bd45
|
[
"MIT"
] | null | null | null |
# -*- coding:utf8 -*-
""" Lexical analysis is the process of analyzing a stream of individual characters (normally arranged as lines),
into a sequence of lexical tokens (tokenization. for instance of "words" and punctuation symbols that make up source code)
to feed into the parser. Roughly the equivalent of splitting ordinary text written in a natural language (e.g. English)
into a sequence of words and punctuation symbols. Lexical analysis is often done with tools such as lex, flex and jflex.
Strictly speaking, tokenization may be handled by the parser. The reason why we tend to bother with tokenising in practice
is that it makes the parser simpler, and decouples it from the character encoding used for the source code.
"""
from . import token_type
from . import token
from . import lexer
| 66.916667
| 126
| 0.784558
| 127
| 803
| 4.952756
| 0.629921
| 0.042925
| 0.054054
| 0.047695
| 0.08903
| 0
| 0
| 0
| 0
| 0
| 0
| 0.001499
| 0.169365
| 803
| 11
| 127
| 73
| 0.941529
| 0.9066
| 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
|
0c1b4658ef2f67650a4c565110fc571164bca158
| 182
|
py
|
Python
|
WizzardApp/views.py
|
Kayarn-Mechatronics/Octello
|
45f4f73c764ca816918c31ef3ae4889740a68802
|
[
"Apache-2.0"
] | null | null | null |
WizzardApp/views.py
|
Kayarn-Mechatronics/Octello
|
45f4f73c764ca816918c31ef3ae4889740a68802
|
[
"Apache-2.0"
] | null | null | null |
WizzardApp/views.py
|
Kayarn-Mechatronics/Octello
|
45f4f73c764ca816918c31ef3ae4889740a68802
|
[
"Apache-2.0"
] | null | null | null |
from django.shortcuts import render
# Create your views here.
class WizzardsListView:
def wizzards_list(request):
return render(request, 'WizzardApp/Wizzards-list.html')
| 30.333333
| 63
| 0.763736
| 22
| 182
| 6.272727
| 0.818182
| 0.173913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 182
| 6
| 63
| 30.333333
| 0.896104
| 0.126374
| 0
| 0
| 0
| 0
| 0.183544
| 0.183544
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
0c2cd9a95f73abad6791fe9a1520c97c5699fa36
| 1,154
|
py
|
Python
|
tests/test_quiz.py
|
thiagosalvatore/poo-exercise
|
ab897d9b17b3aa63252c4fa7334f624f6d380d9a
|
[
"Apache-2.0"
] | null | null | null |
tests/test_quiz.py
|
thiagosalvatore/poo-exercise
|
ab897d9b17b3aa63252c4fa7334f624f6d380d9a
|
[
"Apache-2.0"
] | null | null | null |
tests/test_quiz.py
|
thiagosalvatore/poo-exercise
|
ab897d9b17b3aa63252c4fa7334f624f6d380d9a
|
[
"Apache-2.0"
] | null | null | null |
from poo_exercise.models import Question, Quiz
def test_create_quiz_two_questions(tst):
q1 = Question('whats your name?', ['Thiago', 'James', 'Bond'], 'Thiago')
q2 = Question('how old are you?', [20, 40, 27], 27)
assert q1.question == 'whats your name?'
assert q1.options == ['Thiago', 'James', 'Bond']
assert q1.correct_answer == 'Thiago'
quiz = Quiz(tst.teacher, tst.classroom, [q1, q2])
assert len(quiz.questions) == 2
assert quiz.questions == [q1, q2]
assert quiz.teacher.name == tst.teacher.name
def test_create_quiz_with_questions_later(tst):
q1 = Question('whats your name?', ['Thiago', 'James', 'Bond'], 'Thiago')
q2 = Question('how old are you?', [20, 40, 27], 27)
assert q1.question == 'whats your name?'
assert q1.options == ['Thiago', 'James', 'Bond']
assert q1.correct_answer == 'Thiago'
quiz = Quiz(tst.teacher, tst.classroom)
assert len(quiz.questions) == 0
assert quiz.questions == []
assert quiz.teacher.name == tst.teacher.name
quiz.add_question(q1)
quiz.add_question(q2)
assert len(quiz.questions) == 2
assert quiz.questions == [q1, q2]
| 32.055556
| 76
| 0.645581
| 158
| 1,154
| 4.626582
| 0.253165
| 0.065663
| 0.082079
| 0.103967
| 0.75513
| 0.75513
| 0.75513
| 0.659371
| 0.659371
| 0.659371
| 0
| 0.039742
| 0.193241
| 1,154
| 35
| 77
| 32.971429
| 0.745435
| 0
| 0
| 0.64
| 0
| 0
| 0.155979
| 0
| 0
| 0
| 0
| 0
| 0.56
| 1
| 0.08
| false
| 0
| 0.04
| 0
| 0.12
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0c2f2d54be3a66626ac7cde934786259822ee64d
| 473
|
py
|
Python
|
boto3_type_annotations/boto3_type_annotations/autoscaling_plans/paginator.py
|
cowboygneox/boto3_type_annotations
|
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
|
[
"MIT"
] | 119
|
2018-12-01T18:20:57.000Z
|
2022-02-02T10:31:29.000Z
|
boto3_type_annotations/boto3_type_annotations/autoscaling_plans/paginator.py
|
cowboygneox/boto3_type_annotations
|
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
|
[
"MIT"
] | 15
|
2018-11-16T00:16:44.000Z
|
2021-11-13T03:44:18.000Z
|
boto3_type_annotations/boto3_type_annotations/autoscaling_plans/paginator.py
|
cowboygneox/boto3_type_annotations
|
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
|
[
"MIT"
] | 11
|
2019-05-06T05:26:51.000Z
|
2021-09-28T15:27:59.000Z
|
from typing import List
from typing import Dict
from botocore.paginate import Paginator
class DescribeScalingPlanResources(Paginator):
def paginate(self, ScalingPlanName: str, ScalingPlanVersion: int, PaginationConfig: Dict = None) -> Dict:
pass
class DescribeScalingPlans(Paginator):
def paginate(self, ScalingPlanNames: List = None, ScalingPlanVersion: int = None, ApplicationSources: List = None, PaginationConfig: Dict = None) -> Dict:
pass
| 33.785714
| 158
| 0.758985
| 48
| 473
| 7.479167
| 0.458333
| 0.05571
| 0.089136
| 0.133705
| 0.178273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164905
| 473
| 13
| 159
| 36.384615
| 0.908861
| 0
| 0
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.222222
| 0.333333
| 0
| 0.777778
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
0c36d39aef5f845a4dfacdbdb88d178a3b5ee951
| 2,086
|
py
|
Python
|
utils/boilerplate/test_beetle.py
|
cfginn/sap-simulation-package
|
73314e5380cec5c61a9fe5ff5fbafa25b9e2beac
|
[
"MIT"
] | null | null | null |
utils/boilerplate/test_beetle.py
|
cfginn/sap-simulation-package
|
73314e5380cec5c61a9fe5ff5fbafa25b9e2beac
|
[
"MIT"
] | null | null | null |
utils/boilerplate/test_beetle.py
|
cfginn/sap-simulation-package
|
73314e5380cec5c61a9fe5ff5fbafa25b9e2beac
|
[
"MIT"
] | null | null | null |
import unittest
from pysapets.beetle import Beetle
from pysapets.animal import Animal
import pysapets.constants as constants
from unittest.mock import patch
from io import StringIO
from copy import deepcopy
class BeetleTest(unittest.TestCase):
def setUp(self):
self.beetle = Beetle()
self.friends = [self.beetle, Animal(2, 2), Animal(2, 2), Animal(2, 2), Animal(2, 2)]
# test that get_type returns the correct type
def test_get_type(self):
self.assertEqual(self.beetle.get_type(), constants.BEETLE)
# test that beetle starts with base health of 3
def test_get_health(self):
self.assertEqual(self.beetle.get_health(), 3)
# test that beetle starts with base attack of 2
def test_get_attack(self):
self.assertEqual(self.beetle.get_attack(), 2)
# test that initializing beetle with additional health increases health
def test_init_add_health(self):
newBeetle = Beetle(addHealth = 3)
self.assertEqual(newBeetle.get_health(), 3 + 3)
# test that initializing an beetle with additional attack increases attack
def test_init_add_attack(self):
newBeetle = Beetle(addAttack = 3)
self.assertEqual(newBeetle.get_attack(), 2 + 3)
# test that initializing beetle with additional health and attack increases health and attack
def test_init_add_health_attack(self):
newBeetle = Beetle(addHealth = 3, addAttack = 3)
self.assertEqual(newBeetle.get_health(), 3 + 3)
self.assertEqual(newBeetle.get_attack(), 2 + 3)
# test that beetle ability has correct trigger
def test_get_ability_trigger(self):
self.assertEqual(self.beetle.get_ability_trigger(), constants.EATS_SHOP_FOOD)
# test that beetle ability has correct triggeredBy
def test_get_ability_triggeredBy(self):
self.assertEqual(self.beetle.get_ability_triggeredBy(), constants.SELF)
# TODO add relevant tests for beetle ability
def test_run_ability(self):
pass
def test_run_ability_level_1(self):
pass
def test_run_ability_level_2(self):
pass
def test_run_ability_level_3(self):
pass
| 31.134328
| 95
| 0.741131
| 295
| 2,086
| 5.071186
| 0.210169
| 0.05615
| 0.033422
| 0.076872
| 0.528075
| 0.445856
| 0.296123
| 0.127674
| 0.080214
| 0.058824
| 0
| 0.015734
| 0.177373
| 2,086
| 67
| 96
| 31.134328
| 0.856061
| 0.243528
| 0
| 0.205128
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014925
| 0.230769
| 1
| 0.333333
| false
| 0.102564
| 0.179487
| 0
| 0.538462
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
a74320db5482ddd6b2eb4789b0be26bb9caf63db
| 358
|
py
|
Python
|
src/arcfutil/exception/__init__.py
|
inuEbisu/arcfutil
|
4ef575322113db4bb09d5ac2870516fb2b265216
|
[
"MIT"
] | null | null | null |
src/arcfutil/exception/__init__.py
|
inuEbisu/arcfutil
|
4ef575322113db4bb09d5ac2870516fb2b265216
|
[
"MIT"
] | 1
|
2020-07-22T02:28:37.000Z
|
2020-07-24T11:17:55.000Z
|
src/arcfutil/exception/__init__.py
|
feightwywx/arc.py
|
55caa1c0dee856cf7c18dad2254d22b5e4d7994d
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# (c)2021 .direwolf <kururinmiracle@outlook.com>
# Licensed under the MIT License.
class AffNoteTypeError(Exception):
pass
class AffNoteIndexError(Exception):
pass
class AffNoteValueError(Exception):
pass
class AffSceneTypeError(Exception):
pass
class AffReadError(Exception):
pass
| 14.916667
| 48
| 0.72067
| 38
| 358
| 6.789474
| 0.684211
| 0.251938
| 0.27907
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020202
| 0.170391
| 358
| 23
| 49
| 15.565217
| 0.848485
| 0.340782
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
a7a577367318818538c834291b36850c672c87f5
| 94
|
py
|
Python
|
bind_adblock/__init__.py
|
Mischback/bind-adblock-rpz
|
4566ad3b9caf2420fc29d204be9521d3bda07c4d
|
[
"MIT"
] | null | null | null |
bind_adblock/__init__.py
|
Mischback/bind-adblock-rpz
|
4566ad3b9caf2420fc29d204be9521d3bda07c4d
|
[
"MIT"
] | null | null | null |
bind_adblock/__init__.py
|
Mischback/bind-adblock-rpz
|
4566ad3b9caf2420fc29d204be9521d3bda07c4d
|
[
"MIT"
] | null | null | null |
# -*- utf-8 -*-
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
| 18.8
| 61
| 0.734043
| 10
| 94
| 6.5
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011628
| 0.085106
| 94
| 4
| 62
| 23.5
| 0.744186
| 0.138298
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
a7b38124f99a803d974dda3bca0b603c1803b433
| 1,895
|
py
|
Python
|
test/messages_test/test_dwm_response.py
|
Richard-Gemmell/decawave-1001-rjg
|
0ee70d1ca0a1a413ef4f634c0f3cd78a084e5c5f
|
[
"MIT"
] | 6
|
2019-08-05T22:16:38.000Z
|
2021-01-16T02:45:26.000Z
|
test/messages_test/test_dwm_response.py
|
Richard-Gemmell/decawave-1001-rjg
|
0ee70d1ca0a1a413ef4f634c0f3cd78a084e5c5f
|
[
"MIT"
] | null | null | null |
test/messages_test/test_dwm_response.py
|
Richard-Gemmell/decawave-1001-rjg
|
0ee70d1ca0a1a413ef4f634c0f3cd78a084e5c5f
|
[
"MIT"
] | 3
|
2021-01-16T02:45:29.000Z
|
2022-03-26T21:38:44.000Z
|
import unittest
from decawave_1001_rjg.messages.dwm_response import DwmResponse
class TestDwmResponse(unittest.TestCase):
def test_error_code(self):
response = DwmResponse(bytes([0x40, 0x01, 0xF0]))
self.assertEqual(0xF0, response.error_code())
def test_is_ok(self):
response = DwmResponse(bytes([0x40, 0x01, 0x00]))
self.assertTrue(response.is_ok())
self.assertFalse(response.error_bad_request())
self.assertFalse(response.error_busy())
self.assertFalse(response.error_internal_error())
self.assertFalse(response.error_invalid_parameter())
self.assertFalse(response.error_wrong_type())
def test_error_bad_request(self):
response = DwmResponse(bytes([0x40, 0x01, 0x01]))
self.assertFalse(response.is_ok())
self.assertTrue(response.error_bad_request())
def test_error_internal_error(self):
response = DwmResponse(bytes([0x40, 0x01, 0x02]))
self.assertFalse(response.is_ok())
self.assertTrue(response.error_internal_error())
def test_error_invalid_parameter(self):
response = DwmResponse(bytes([0x40, 0x01, 0x03]))
self.assertFalse(response.is_ok())
self.assertTrue(response.error_invalid_parameter())
def test_error_busy(self):
response = DwmResponse(bytes([0x40, 0x01, 0x04]))
self.assertFalse(response.is_ok())
self.assertTrue(response.error_busy())
def test_error_invalid_response(self):
response = DwmResponse(bytes([0x00, 0x00, 0x00]))
self.assertFalse(response.is_ok())
self.assertTrue(response.error_invalid_response())
def test_error_wrong_type(self):
response = DwmResponse(bytes([0x22, 0x01, 0x00]))
self.assertFalse(response.is_ok())
self.assertTrue(response.error_wrong_type())
| 38.673469
| 64
| 0.679683
| 213
| 1,895
| 5.802817
| 0.187793
| 0.126214
| 0.204693
| 0.18123
| 0.454693
| 0.454693
| 0.279935
| 0.279935
| 0.279935
| 0.148867
| 0
| 0.051163
| 0.205805
| 1,895
| 48
| 65
| 39.479167
| 0.7701
| 0
| 0
| 0.157895
| 0
| 0
| 0
| 0
| 0
| 0
| 0.054142
| 0
| 0.5
| 1
| 0.210526
| false
| 0
| 0.052632
| 0
| 0.289474
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a7c78786a3a10eff39b9d4efc2696a32cc84bb2d
| 185
|
py
|
Python
|
mp3_tagger/__init__.py
|
TheBengineer/mp3-tagger
|
5eb7c2f78d36d29435829b568b209d0f980759ec
|
[
"MIT"
] | 38
|
2018-04-13T19:43:27.000Z
|
2022-02-01T23:13:50.000Z
|
mp3_tagger/__init__.py
|
TheBengineer/mp3-tagger
|
5eb7c2f78d36d29435829b568b209d0f980759ec
|
[
"MIT"
] | 12
|
2017-07-10T07:53:58.000Z
|
2021-07-22T00:27:01.000Z
|
mp3_tagger/__init__.py
|
TheBengineer/mp3-tagger
|
5eb7c2f78d36d29435829b568b209d0f980759ec
|
[
"MIT"
] | 21
|
2018-02-17T14:13:09.000Z
|
2021-07-12T10:47:50.000Z
|
from .mp3 import MP3File
from .id3 import ID3FrameStream, VERSION_1, VERSION_2, VERSION_BOTH
from .exceptions import MP3OpenFileError, TagSetError, FrameInitError
__version__ = '1.0'
| 26.428571
| 69
| 0.816216
| 23
| 185
| 6.26087
| 0.652174
| 0.111111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055215
| 0.118919
| 185
| 6
| 70
| 30.833333
| 0.828221
| 0
| 0
| 0
| 0
| 0
| 0.016216
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
38f19c83125bbd431e2e430dc11e80b0182144c8
| 2,077
|
py
|
Python
|
DesignerPatterns2/aula04/operacoes.py
|
LucasBiason/PythonStudies
|
8878cecfe914c10e7cf070d6a8db84d501ef641c
|
[
"MIT"
] | null | null | null |
DesignerPatterns2/aula04/operacoes.py
|
LucasBiason/PythonStudies
|
8878cecfe914c10e7cf070d6a8db84d501ef641c
|
[
"MIT"
] | 7
|
2021-03-19T11:57:39.000Z
|
2022-02-27T14:03:25.000Z
|
DesignerPatterns2/aula04/operacoes.py
|
LucasBiason/PythonStudies
|
8878cecfe914c10e7cf070d6a8db84d501ef641c
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# Visitor
'''
Quando temos uma árvore, e precisamos navegar nessa árvore de maneira organizada,
podemos usar um Visitor
Podemos criar quantos visitors desejarmos, até mesmo um que exiba a expressão por extenso,
por exemplo. Porém, para que o novo visitor funcione, ele precisa ter os métodos visita_soma,
visita_subtracao e visita_numero. Sabemos que pela natureza dinâmica da linguagem Python
e do Duck Tying, o método aceita da expressões pode aceitar qualquer objeto que tenham esses
métodos. Porém, nada nos impede de criarmos uma classe abstrata que contenha esses métodos
como abstratos, obrigando a todos que herdarem a classe a implementarem esses métodos.
Aliás, usamos bastante classes abstratas no primeiro treinamento de Design Patterns.
'''
class Expressao(object):
def __init__(self, exp_esq, exp_dir):
self.__expressao_esquerda = exp_esq
self.__expressao_direita = exp_dir
@property
def expressao_esquerda(self):
return self.__expressao_esquerda
@property
def expressao_direita(self):
return self.__expressao_direita
class Subtracao(Expressao):
def avalia(self):
return self.__expressao_esquerda.avalia() - self.__expressao_esquerda.avalia()
def aceita(self, visitor):
visitor.visita_subtracao(self)
class Soma(Expressao):
def avalia(self):
return self.__expressao_esquerda.avalia() + self.__expressao_esquerda.avalia()
def aceita(self, visitor):
visitor.visita_soma(self)
class Numero(object):
def __init__(self, numero):
self.__numero = numero
def avalia(self):
return self.__numero
def aceita(self, visitor):
visitor.visita_numero(self)
if __name__ == 'main':
from impressao import Impressao
expressao_esquerda = Soma(Numero(10), Numero(20))
expressao_direita = Soma(Numero(5), Numero(2))
expressao_conta = Soma(expressao_esquerda, expressao_direita)
expressao_conta.avalia()
impressao = Impressao()
expressao_conta.aceita(impressao)
| 29.253521
| 93
| 0.730862
| 262
| 2,077
| 5.568702
| 0.427481
| 0.104866
| 0.086361
| 0.063057
| 0.217272
| 0.18026
| 0.157642
| 0.157642
| 0.157642
| 0.157642
| 0
| 0.004192
| 0.195956
| 2,077
| 70
| 94
| 29.671429
| 0.869461
| 0.372653
| 0
| 0.228571
| 0
| 0
| 0.003101
| 0
| 0
| 0
| 0
| 0.057143
| 0
| 1
| 0.285714
| false
| 0
| 0.028571
| 0.142857
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
ac1009cab4e68db00e535af9009eac4f46af2028
| 84
|
py
|
Python
|
django_rest_auth_embedded/serializers/__init__.py
|
Volkova-Natalia/django_rest_auth_embedded
|
43fe1d23f59332a7794365348989599cde44af6e
|
[
"MIT"
] | null | null | null |
django_rest_auth_embedded/serializers/__init__.py
|
Volkova-Natalia/django_rest_auth_embedded
|
43fe1d23f59332a7794365348989599cde44af6e
|
[
"MIT"
] | 1
|
2021-02-26T16:56:31.000Z
|
2021-03-24T09:47:43.000Z
|
django_rest_auth_embedded/serializers/__init__.py
|
Volkova-Natalia/django_rest_auth_embedded
|
43fe1d23f59332a7794365348989599cde44af6e
|
[
"MIT"
] | null | null | null |
from .registration import RegistrationSerializer
from .login import LoginSerializer
| 28
| 48
| 0.880952
| 8
| 84
| 9.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 84
| 2
| 49
| 42
| 0.973684
| 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
|
ac2bea3503e5716fd108698ce7332d8e32a814b2
| 90
|
py
|
Python
|
sleuth/error.py
|
emrob/sleuth
|
85354c1243c84f8e909079953c18a5ec1e5e7f04
|
[
"MIT"
] | 1
|
2015-04-21T12:22:43.000Z
|
2015-04-21T12:22:43.000Z
|
sleuth/error.py
|
emrob/sleuth
|
85354c1243c84f8e909079953c18a5ec1e5e7f04
|
[
"MIT"
] | null | null | null |
sleuth/error.py
|
emrob/sleuth
|
85354c1243c84f8e909079953c18a5ec1e5e7f04
|
[
"MIT"
] | null | null | null |
class SleuthError(Exception):
pass
class SleuthNotFoundError(SleuthError):
pass
| 12.857143
| 39
| 0.755556
| 8
| 90
| 8.5
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177778
| 90
| 6
| 40
| 15
| 0.918919
| 0
| 0
| 0.5
| 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
|
ac384daf71cb939f61f11213b9e47b0247d71f5a
| 302
|
py
|
Python
|
main.py
|
danyang-rainbow/nlp_novel
|
316d8a3e780759a20ea7f0ca888cf9d7ffcedeea
|
[
"Apache-2.0"
] | null | null | null |
main.py
|
danyang-rainbow/nlp_novel
|
316d8a3e780759a20ea7f0ca888cf9d7ffcedeea
|
[
"Apache-2.0"
] | null | null | null |
main.py
|
danyang-rainbow/nlp_novel
|
316d8a3e780759a20ea7f0ca888cf9d7ffcedeea
|
[
"Apache-2.0"
] | null | null | null |
import json
import codecs
import os
# 还是整理一下huameng,kuaidian这俩数据的处理吧
# 首先是huangmeng,我刚刚弄得这个,humeng的原始数据在/nas/xd/data/huameng/20200629_novels/
# 然后是image和txt的ocr数据是/nas/jiangdanyang/data/final_result.json
# 然后是模型
# 首先,肖老师说的那个,只用一个数据,带评论数的huameng数据,然后跑出来的话,无论如何都是没有评论数的,后续还是需要加上评论数。\
# ok,既然你说可以,那就再试试
| 25.166667
| 72
| 0.834437
| 35
| 302
| 7.142857
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028369
| 0.066225
| 302
| 12
| 73
| 25.166667
| 0.858156
| 0.831126
| 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
|
ac39195e67ea9301bb6deb6a218c6ea5079ba32d
| 286
|
py
|
Python
|
algorithms/implement_insertion_sort/implement_insertion_sort.py
|
JCPedroza/freeCodeCamp-coding-interview-prep-python
|
56d40d42d127e98f2d8132e043054ba72cc5faaa
|
[
"MIT"
] | null | null | null |
algorithms/implement_insertion_sort/implement_insertion_sort.py
|
JCPedroza/freeCodeCamp-coding-interview-prep-python
|
56d40d42d127e98f2d8132e043054ba72cc5faaa
|
[
"MIT"
] | null | null | null |
algorithms/implement_insertion_sort/implement_insertion_sort.py
|
JCPedroza/freeCodeCamp-coding-interview-prep-python
|
56d40d42d127e98f2d8132e043054ba72cc5faaa
|
[
"MIT"
] | null | null | null |
def insertion_sort(nums: list[float]) -> list[float]:
for start in range(1, len(nums)):
index = start
while nums[index] < nums[index - 1] and index > 0:
nums[index], nums[index - 1] = nums[index - 1], nums[index]
index -= 1
return nums
| 28.6
| 71
| 0.555944
| 40
| 286
| 3.95
| 0.425
| 0.398734
| 0.189873
| 0.227848
| 0.360759
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030151
| 0.304196
| 286
| 9
| 72
| 31.777778
| 0.763819
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ac4e25f392a02b49f2c61d0dd02e2171a99cc9f4
| 106
|
py
|
Python
|
src/conf/config.py
|
superxuu/fastapi_pony_2
|
297ef01cc009a40af891593018565fe5b06b4ee8
|
[
"MIT"
] | 2
|
2020-06-17T09:53:13.000Z
|
2020-10-23T18:20:13.000Z
|
src/conf/config.py
|
superxuu/fastapi_pony_2
|
297ef01cc009a40af891593018565fe5b06b4ee8
|
[
"MIT"
] | null | null | null |
src/conf/config.py
|
superxuu/fastapi_pony_2
|
297ef01cc009a40af891593018565fe5b06b4ee8
|
[
"MIT"
] | null | null | null |
mysql_conf = {'provider': 'mysql', 'host': 'localhost', 'user': 'root', 'passwd': 'root', 'db': 'ponydb'}
| 53
| 105
| 0.584906
| 12
| 106
| 5.083333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113208
| 106
| 1
| 106
| 106
| 0.648936
| 0
| 0
| 0
| 0
| 0
| 0.490566
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
ac5bff29164507815c24d81476edd4a6d042597f
| 163
|
py
|
Python
|
tests/__init__.py
|
open-contracting/extension-explorer
|
bd96c66d616c717fb6dee151548e14ba4c7bf8e2
|
[
"BSD-3-Clause"
] | 1
|
2019-04-11T10:17:48.000Z
|
2019-04-11T10:17:48.000Z
|
tests/__init__.py
|
open-contracting/extension-explorer
|
bd96c66d616c717fb6dee151548e14ba4c7bf8e2
|
[
"BSD-3-Clause"
] | 55
|
2018-07-11T13:52:22.000Z
|
2021-11-11T14:49:40.000Z
|
tests/__init__.py
|
open-contracting/extension-explorer
|
bd96c66d616c717fb6dee151548e14ba4c7bf8e2
|
[
"BSD-3-Clause"
] | null | null | null |
import os
os.environ['EXTENSION_EXPLORER_DATA_FILENAME'] = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'fixtures', 'extensions.json') # noqa: E501
| 40.75
| 151
| 0.760736
| 23
| 163
| 5.086957
| 0.73913
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019868
| 0.07362
| 163
| 3
| 152
| 54.333333
| 0.754967
| 0.06135
| 0
| 0
| 0
| 0
| 0.364238
| 0.211921
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
ac5ca15111f507b052e145142ee1c1de1c3bfa82
| 7,633
|
py
|
Python
|
src/nanopie/misc/errors/validation.py
|
michaelawyu/nanopie
|
32e84f072d03a6b3eff33920c929546c81969a64
|
[
"Apache-2.0"
] | 1
|
2020-09-02T22:34:10.000Z
|
2020-09-02T22:34:10.000Z
|
src/nanopie/misc/errors/validation.py
|
michaelawyu/nanopie
|
32e84f072d03a6b3eff33920c929546c81969a64
|
[
"Apache-2.0"
] | null | null | null |
src/nanopie/misc/errors/validation.py
|
michaelawyu/nanopie
|
32e84f072d03a6b3eff33920c929546c81969a64
|
[
"Apache-2.0"
] | null | null | null |
"""This module includes all the validation related exceptions.
"""
from typing import Any, List, Optional, Union
from .base import ValidationError
from .. import format_error_message
class ModelTypeNotMatchedError(ValidationError):
"""The validation exception for mismatched models, i.e. the input data
is of a model type different from the one used for validation.
"""
_message = "Input is not of the given type."
def __init__(
self, source: "ModelMetaCls", data: Any, message: Optional[str] = None
):
""""""
if not message:
message = format_error_message(
message=self._message, source=source, data=data
)
super().__init__(message, source=source, data=data)
class RequiredFieldMissingError(ValidationError):
"""The validation exception for missing required fields."""
_message = "A required field is missing."
def __init__(
self,
source: "Field",
assigned_field_name: Optional[str],
message: Optional[str] = None,
):
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
)
super().__init__(message, source=source, data=None)
class FieldTypeNotMatchedError(ValidationError):
"""The validation exception for mismatched fields, i.e. the input data
is of a data type not associated with the field used for validation.
"""
_message = "Input is not of the given field type."
def __init__(
self,
source: "Field",
assigned_field_name: Optional[str],
data: Any,
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class ListItemTypeNotMatchedError(ValidationError):
"""The validation exception for mismatched item fields, i.e. one or more
items in the input array is of a data type not associated with the
item field specified in the array field.
"""
_message = "One or more items in the list is not of the given field type."
def __init__(
self,
source: "ArrayField",
assigned_field_name: Optional[str],
data: Any,
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class StringMaxLengthExceededError(ValidationError):
"""The validation exception for strings that are too long."""
_message = "Input string is too long."
def __init__(
self,
source: "StringField",
assigned_field_name: Optional[str],
data: str,
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class StringMinLengthBelowError(ValidationError):
"""The validation exception for strings that are too short."""
_message = "Input string is too short."
def __init__(
self,
source: "StringField",
assigned_field_name: Optional[str],
data: str,
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class StringPatternNotMatchedError(ValidationError):
"""The validation exception for mismatched string patterns, i.e. the
input string does not match the pattern (regular expression) specified
in the string field.
"""
_message = "Input string does not match the given pattern."
def __init__(
self,
source: "StringField",
assigned_field_name: Optional[str],
data: str,
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class NumberMaxExceededError(ValidationError):
"""The validation exception for numbers that are too large."""
_message = "Input number is too large."
def __init__(
self,
source: Union["FloatField", "IntField"],
assigned_field_name: Optional[str],
data: Union[float, int],
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class NumberMinBelowError(ValidationError):
"""The validation exception for numbers that are too small."""
_message = "Input number is too small."
def __init__(
self,
source: Union["FloatField", "IntField"],
assigned_field_name: Optional[str],
data: Union[float, int],
message: Optional[str] = None,
):
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class ListTooManyItemsError(ValidationError):
"""The validation exception for oversized arrays/lists."""
_message = "Input list has too many items."
def __init__(
self,
source: "ArrayField",
assigned_field_name: Optional[str],
data: List[Any],
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
class ListTooLittleItemsError(ValidationError):
"""The validation exception for undersized arrays/lists."""
_message = "Input list has too little items."
def __init__(
self,
source: "ArrayField",
assigned_field_name: Optional[str],
data: List[Any],
message: Optional[str] = None,
):
""""""
if not message:
message = format_error_message(
message=self._message,
source=source,
assigned_field_name=assigned_field_name,
data=data,
)
super().__init__(message, source=source, data=data)
| 28.166052
| 78
| 0.589021
| 771
| 7,633
| 5.579767
| 0.13489
| 0.090656
| 0.11855
| 0.064156
| 0.825198
| 0.771037
| 0.696188
| 0.680846
| 0.673175
| 0.604835
| 0
| 0
| 0.319796
| 7,633
| 270
| 79
| 28.27037
| 0.828582
| 0.137692
| 0
| 0.78453
| 0
| 0
| 0.076145
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.060773
| false
| 0
| 0.016575
| 0
| 0.198895
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ac68c37ba14e9c946303185214dd653d161b02bc
| 52
|
py
|
Python
|
tests/__init__.py
|
autogalmorph/galaxies_datasets-1
|
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
autogalmorph/galaxies_datasets-1
|
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
|
[
"MIT"
] | 16
|
2021-09-21T21:25:05.000Z
|
2022-03-01T14:10:08.000Z
|
tests/__init__.py
|
autogalmorph/galaxies_datasets-1
|
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
|
[
"MIT"
] | 2
|
2022-03-05T14:56:55.000Z
|
2022-03-09T23:58:56.000Z
|
"""Test suite for the galaxies_datasets package."""
| 26
| 51
| 0.75
| 7
| 52
| 5.428571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 52
| 1
| 52
| 52
| 0.826087
| 0.865385
| 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
|
3bb161162801c6f8ef81e68dba2690d822a328fe
| 204
|
py
|
Python
|
moto/applicationautoscaling/exceptions.py
|
gtourkas/moto
|
307104417b579d23d02f670ff55217a2d4a16bee
|
[
"Apache-2.0"
] | 5,460
|
2015-01-01T01:11:17.000Z
|
2022-03-31T23:45:38.000Z
|
moto/applicationautoscaling/exceptions.py
|
gtourkas/moto
|
307104417b579d23d02f670ff55217a2d4a16bee
|
[
"Apache-2.0"
] | 4,475
|
2015-01-05T19:37:30.000Z
|
2022-03-31T13:55:12.000Z
|
moto/applicationautoscaling/exceptions.py
|
gtourkas/moto
|
307104417b579d23d02f670ff55217a2d4a16bee
|
[
"Apache-2.0"
] | 1,831
|
2015-01-14T00:00:44.000Z
|
2022-03-31T20:30:04.000Z
|
from moto.core.exceptions import JsonRESTError
class AWSValidationException(JsonRESTError):
def __init__(self, message, **kwargs):
super().__init__("ValidationException", message, **kwargs)
| 29.142857
| 66
| 0.754902
| 19
| 204
| 7.684211
| 0.789474
| 0.178082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132353
| 204
| 6
| 67
| 34
| 0.824859
| 0
| 0
| 0
| 0
| 0
| 0.093137
| 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
|
3bd439495b5145da9e5c0217658cdd1d449223a6
| 123
|
py
|
Python
|
client/python/m_etp_service_client/client/m_file_utils.py
|
magsv/m_etp_services
|
b34af0c0debe08132013ac5b4b9469918186c9cc
|
[
"Apache-2.0"
] | 3
|
2015-08-22T07:42:25.000Z
|
2019-01-25T21:51:05.000Z
|
client/python/m_etp_service_client/client/m_file_utils.py
|
magsv/m_etp_services
|
b34af0c0debe08132013ac5b4b9469918186c9cc
|
[
"Apache-2.0"
] | null | null | null |
client/python/m_etp_service_client/client/m_file_utils.py
|
magsv/m_etp_services
|
b34af0c0debe08132013ac5b4b9469918186c9cc
|
[
"Apache-2.0"
] | null | null | null |
import logging
def readFileToString(filePath):
logging.debug("Reading file:"+filePath)
return open(filePath,'r').read()
| 20.5
| 40
| 0.764228
| 15
| 123
| 6.266667
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089431
| 123
| 6
| 41
| 20.5
| 0.839286
| 0
| 0
| 0
| 0
| 0
| 0.112903
| 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
|
3becd0178c5fab9a9f0a55a2ac4bb13db785dce4
| 394
|
py
|
Python
|
layer/__init__.py
|
96-Zachary/DialogueNLP
|
303cb8dccc37fa326b13a0c24158e63282bafe80
|
[
"MIT"
] | 1
|
2021-01-25T06:54:02.000Z
|
2021-01-25T06:54:02.000Z
|
layer/__init__.py
|
96-Zachary/DialogueNLP
|
303cb8dccc37fa326b13a0c24158e63282bafe80
|
[
"MIT"
] | 1
|
2021-09-21T04:00:00.000Z
|
2021-09-21T04:00:00.000Z
|
layer/__init__.py
|
96-Zachary/DialogueNLP
|
303cb8dccc37fa326b13a0c24158e63282bafe80
|
[
"MIT"
] | null | null | null |
import layer.Constants
import layer.Models
from layer.Translator import Translator
from layer.Dataset import Dataset, IDDataSet, MultiSourceDataSet
from layer.Optim import Optim
from layer.Dict import Dict
from layer.Beam import Beam
from layer.TransModel import Encoder, EncoderLayer, Decoder, DecoderLayer
from layer.TransModel import SelectAttention, Transformer
from layer.Beam import Beam
| 35.818182
| 73
| 0.852792
| 52
| 394
| 6.461538
| 0.365385
| 0.214286
| 0.077381
| 0.113095
| 0.136905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106599
| 394
| 11
| 74
| 35.818182
| 0.954545
| 0
| 0
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3befdcd273558d13d86a48d9c26006c70540618d
| 27
|
py
|
Python
|
jupyterlabpymolpysnips/MolecularRepresentation/rmwater.py
|
MooersLab/pymolpysnips
|
50a89c85adf8006d85c1d6cd3f8aad7e440a0b92
|
[
"MIT"
] | null | null | null |
jupyterlabpymolpysnips/MolecularRepresentation/rmwater.py
|
MooersLab/pymolpysnips
|
50a89c85adf8006d85c1d6cd3f8aad7e440a0b92
|
[
"MIT"
] | null | null | null |
jupyterlabpymolpysnips/MolecularRepresentation/rmwater.py
|
MooersLab/pymolpysnips
|
50a89c85adf8006d85c1d6cd3f8aad7e440a0b92
|
[
"MIT"
] | null | null | null |
cmd.do('remove resn HOH;')
| 13.5
| 26
| 0.666667
| 5
| 27
| 3.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 27
| 1
| 27
| 27
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0.592593
| 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
|
3bf2da73aabd5d802028710955a83e96479c7d24
| 232
|
py
|
Python
|
backend/database/admin.py
|
JMSoler7/database
|
b90326a8f3929d1bad9a810fcbe91d9bb2c3d5f4
|
[
"MIT"
] | null | null | null |
backend/database/admin.py
|
JMSoler7/database
|
b90326a8f3929d1bad9a810fcbe91d9bb2c3d5f4
|
[
"MIT"
] | null | null | null |
backend/database/admin.py
|
JMSoler7/database
|
b90326a8f3929d1bad9a810fcbe91d9bb2c3d5f4
|
[
"MIT"
] | null | null | null |
from django.contrib import admin # NOQA F401
from . import models # NOQA F401
# Register Django ModelAdmins here. Remember that if it escalates, you must
# create an admin folder with an __init__ importing all the ModelAdmins 😜
| 33.142857
| 75
| 0.775862
| 35
| 232
| 5.057143
| 0.771429
| 0.090395
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.031746
| 0.185345
| 232
| 6
| 76
| 38.666667
| 0.899471
| 0.711207
| 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
|
ce0aa2c471e9a4af0e7ce5cc7afa5f7efb065ec2
| 38
|
py
|
Python
|
config/includes.chroot/usr/local/share/S0lar0S/src/ranger/doc/config/colorschemes/jungle.py
|
ddarksmith/S0lar0S
|
b91971000c089f77d1ff76a00262252a65680e5b
|
[
"WTFPL"
] | null | null | null |
config/includes.chroot/usr/local/share/S0lar0S/src/ranger/doc/config/colorschemes/jungle.py
|
ddarksmith/S0lar0S
|
b91971000c089f77d1ff76a00262252a65680e5b
|
[
"WTFPL"
] | null | null | null |
config/includes.chroot/usr/local/share/S0lar0S/src/ranger/doc/config/colorschemes/jungle.py
|
ddarksmith/S0lar0S
|
b91971000c089f77d1ff76a00262252a65680e5b
|
[
"WTFPL"
] | null | null | null |
../../../ranger/colorschemes/jungle.py
| 38
| 38
| 0.684211
| 4
| 38
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 38
| 1
| 38
| 38
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cbef0a5e1b444545fa11a83186dad6061e8794b7
| 140
|
py
|
Python
|
main.py
|
marcogx/algorithms-in-python
|
77b519ee66169a35bfabfb043bc975cc134e0ce0
|
[
"MIT"
] | null | null | null |
main.py
|
marcogx/algorithms-in-python
|
77b519ee66169a35bfabfb043bc975cc134e0ce0
|
[
"MIT"
] | null | null | null |
main.py
|
marcogx/algorithms-in-python
|
77b519ee66169a35bfabfb043bc975cc134e0ce0
|
[
"MIT"
] | null | null | null |
def f(a, b, c):
print 'a: ' + str(a)
print 'b: ' + str(b)
print 'c: ' + str(c)
if __name__ == '__main__':
f(4, b=9, c=800)
| 17.5
| 26
| 0.45
| 26
| 140
| 2.115385
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.051546
| 0.307143
| 140
| 8
| 27
| 17.5
| 0.515464
| 0
| 0
| 0
| 0
| 0
| 0.120567
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
021ed49d6d81b90aad32fa9cb97fc534a01c08bb
| 604
|
py
|
Python
|
graphs_trees/bst/dfs.py
|
rajatppn/interactive-coding-challenges
|
8e035f1dfd6e59a711dfad2c5f7fe7528ce41fad
|
[
"Apache-2.0"
] | 27,173
|
2015-07-06T12:36:05.000Z
|
2022-03-31T23:56:41.000Z
|
graphs_trees/bst/dfs.py
|
rajatppn/interactive-coding-challenges
|
8e035f1dfd6e59a711dfad2c5f7fe7528ce41fad
|
[
"Apache-2.0"
] | 143
|
2015-07-07T05:13:11.000Z
|
2021-12-07T17:05:54.000Z
|
graphs_trees/bst/dfs.py
|
rajatppn/interactive-coding-challenges
|
8e035f1dfd6e59a711dfad2c5f7fe7528ce41fad
|
[
"Apache-2.0"
] | 4,657
|
2015-07-06T13:28:02.000Z
|
2022-03-31T10:11:28.000Z
|
def in_order_traversal(node, visit_func):
if node is not None:
in_order_traversal(node.left, visit_func)
visit_func(node.data)
in_order_traversal(node.right, visit_func)
def pre_order_traversal(node, visit_func):
if node is not None:
visit_func(node.data)
pre_order_traversal(node.left, visit_func)
pre_order_traversal(node.right, visit_func)
def post_order_traversal(node, visit_func):
if node is not None:
post_order_traversal(node.left, visit_func)
post_order_traversal(node.right, visit_func)
visit_func(node.data)
| 35.529412
| 52
| 0.715232
| 90
| 604
| 4.466667
| 0.177778
| 0.268657
| 0.402985
| 0.149254
| 0.883085
| 0.883085
| 0.487562
| 0.313433
| 0.313433
| 0.313433
| 0
| 0
| 0.205298
| 604
| 17
| 53
| 35.529412
| 0.8375
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
02451ef5f93f61e61906c024fb0b430050e4684c
| 299
|
py
|
Python
|
molsysmt/tools/string_smiles/__init__.py
|
dprada/molsysmt
|
83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d
|
[
"MIT"
] | null | null | null |
molsysmt/tools/string_smiles/__init__.py
|
dprada/molsysmt
|
83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d
|
[
"MIT"
] | null | null | null |
molsysmt/tools/string_smiles/__init__.py
|
dprada/molsysmt
|
83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d
|
[
"MIT"
] | null | null | null |
from .is_string_smiles import is_string_smiles
from .to_molsysmt_MolSys import to_molsysmt_MolSys
from .to_molsysmt_Topology import to_molsysmt_Topology
from .to_nglview_NGLWidget import to_nglview_NGLWidget
from .to_openff_Molecule import to_openff_Molecule
from .to_rdkit_Mol import to_rdkit_Mol
| 37.375
| 54
| 0.896321
| 48
| 299
| 5.083333
| 0.3125
| 0.122951
| 0.114754
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083612
| 299
| 7
| 55
| 42.714286
| 0.890511
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.