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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7534cc247cdd257c75cdcb6703e6ed88916ebebf
| 157
|
py
|
Python
|
_test_project/posts/moder.py
|
mpyatishev/djmoderator
|
0d532bef4b40cecbcc297f0cda1dc0aeba3d676c
|
[
"MIT"
] | null | null | null |
_test_project/posts/moder.py
|
mpyatishev/djmoderator
|
0d532bef4b40cecbcc297f0cda1dc0aeba3d676c
|
[
"MIT"
] | null | null | null |
_test_project/posts/moder.py
|
mpyatishev/djmoderator
|
0d532bef4b40cecbcc297f0cda1dc0aeba3d676c
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from moderator import moderator
from models import Post, PostWithImage
moderator.register(Post)
moderator.register(PostWithImage)
| 17.444444
| 38
| 0.77707
| 18
| 157
| 6.777778
| 0.555556
| 0.278689
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007246
| 0.121019
| 157
| 8
| 39
| 19.625
| 0.876812
| 0.133758
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
754c55f2b2bf4d512d371deb4909cfe1701d826f
| 381
|
py
|
Python
|
service/espnet/test_model.py
|
airenas/espnet-tts-serving
|
2588f91f6a088df1ada8c36cdbd18c36ee3dab07
|
[
"BSD-3-Clause"
] | 5
|
2020-11-17T08:06:26.000Z
|
2022-02-12T07:55:34.000Z
|
service/espnet/test_model.py
|
airenas/espnet-tts-serving
|
2588f91f6a088df1ada8c36cdbd18c36ee3dab07
|
[
"BSD-3-Clause"
] | null | null | null |
service/espnet/test_model.py
|
airenas/espnet-tts-serving
|
2588f91f6a088df1ada8c36cdbd18c36ee3dab07
|
[
"BSD-3-Clause"
] | 1
|
2021-06-22T00:40:13.000Z
|
2021-06-22T00:40:13.000Z
|
from service.espnet.model import check_alpha
def test_alpha():
assert check_alpha(None) == 1
assert check_alpha(0) == 1
assert check_alpha(0.2) == 0.2
assert check_alpha(0.999) == 0.999
assert check_alpha(2) == 2
assert check_alpha(2, None) == 2
assert check_alpha(2, 10) == 1
assert check_alpha(2, 0.5) == 1
assert check_alpha(1, 1.5) == 1.5
| 27.214286
| 44
| 0.643045
| 66
| 381
| 3.545455
| 0.257576
| 0.42735
| 0.615385
| 0.290598
| 0.307692
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107744
| 0.220472
| 381
| 13
| 45
| 29.307692
| 0.680135
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.818182
| 1
| 0.090909
| true
| 0
| 0.090909
| 0
| 0.181818
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
755a0ce16e883f553ef2a52d4de02960e560cde5
| 113
|
py
|
Python
|
armstrong/core/arm_wells/tests/__init__.py
|
cirlabs/armstrong.core.arm_wells
|
2b2f29de1a5896369723ff531d5b1fbad1414ea2
|
[
"Apache-2.0"
] | 3
|
2015-03-18T13:36:38.000Z
|
2021-11-17T11:02:46.000Z
|
armstrong/core/arm_wells/tests/__init__.py
|
cirlabs/armstrong.core.arm_wells
|
2b2f29de1a5896369723ff531d5b1fbad1414ea2
|
[
"Apache-2.0"
] | 1
|
2019-01-14T19:55:17.000Z
|
2019-01-14T19:55:17.000Z
|
armstrong/core/arm_wells/tests/__init__.py
|
cirlabs/armstrong.core.arm_wells
|
2b2f29de1a5896369723ff531d5b1fbad1414ea2
|
[
"Apache-2.0"
] | null | null | null |
from .managers import *
from .models import *
from .query import *
from .querysets import *
from .views import *
| 18.833333
| 24
| 0.734513
| 15
| 113
| 5.533333
| 0.466667
| 0.481928
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176991
| 113
| 5
| 25
| 22.6
| 0.892473
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f332c252495e5b851e3d6927f88b986a7fd1bcf9
| 168
|
py
|
Python
|
SchoolApp/apps/home/admin.py
|
Ceres445/Team-10-Python-Project
|
8a97642f019548d137dff564f9fdcc8f92761cc8
|
[
"MIT"
] | 4
|
2021-06-25T04:17:08.000Z
|
2022-02-13T14:48:38.000Z
|
SchoolApp/apps/home/admin.py
|
Ceres445/Team-10-Python-Project
|
8a97642f019548d137dff564f9fdcc8f92761cc8
|
[
"MIT"
] | 20
|
2021-07-05T08:59:41.000Z
|
2022-02-07T02:06:33.000Z
|
SchoolApp/apps/home/admin.py
|
Ceres445/Team-10-Python-Project
|
8a97642f019548d137dff564f9fdcc8f92761cc8
|
[
"MIT"
] | 1
|
2021-07-22T07:38:00.000Z
|
2021-07-22T07:38:00.000Z
|
from django.contrib import admin
# Register your models here.
from apps.home.models import Profile, Classes
admin.site.register(Profile)
admin.site.register(Classes)
| 21
| 45
| 0.809524
| 24
| 168
| 5.666667
| 0.583333
| 0.132353
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 168
| 7
| 46
| 24
| 0.906667
| 0.154762
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f3490f9501a95e02d7f08d1103c070ea7a58f679
| 33,227
|
py
|
Python
|
pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/vxlan/nxos/modify.py
|
kecorbin/genielibs
|
5d3951b8911013691822e73e9c3d0f557ca10f43
|
[
"Apache-2.0"
] | null | null | null |
pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/vxlan/nxos/modify.py
|
kecorbin/genielibs
|
5d3951b8911013691822e73e9c3d0f557ca10f43
|
[
"Apache-2.0"
] | null | null | null |
pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/vxlan/nxos/modify.py
|
kecorbin/genielibs
|
5d3951b8911013691822e73e9c3d0f557ca10f43
|
[
"Apache-2.0"
] | null | null | null |
'''Implementation for vxlan modify triggers'''
import socket, struct
import logging
import re
# Genie Libs
from genie.libs.sdk.libs.utils.mapping import Mapping
from genie.libs.sdk.triggers.modify.modify import TriggerModify
from genie.libs.sdk.libs.utils.triggeractions import Configure
from functools import partial
from genie.libs.conf.base import IPv4Address
from ats import aetest
# Which key to exclude for VXLAN Ops comparison
vxlan_exclude = ['maker', 'uptime','up_time']
interface_exclude = ['maker', 'last_change','in_rate','in_rate_pkts',
'out_rate', 'out_rate_pkts', 'in_octets',
'in_pkts', 'in_unicast_pkts', 'out_octets',
'out_pkts', 'out_unicast_pkts', 'out_multicast_pkts',
'in_multicast_pkts', 'last_clear', 'in_broadcast_pkts',
'out_broadcast_pkts']
multisite_exclude = ['multisite_bgw_if', 'multisite_bgw_if_admin_state',
'multisite_bgw_if_ip', 'multisite_bgw_if_oper_state',
'multisite_bgw_if_oper_state_down_reason', 'vip_rmac_ro']
vxlan_base_exclude = ['maker','uptime','up_time']
log = logging.getLogger(__name__)
class TriggerModifyNveMultisiteBgwInterface(TriggerModify):
"""Modify and revert the multisite bgw interface dynamically learned vxlan(s)."""
__description__ = """Modify and revert the multisite bgw interface dynamically learned vxlan(s).
trigger_datafile:
Mandatory:
timeout:
max_time (`int`): Maximum wait time for the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
method (`str`): Method to recover the device configuration,
Support methods:
'checkpoint': Rollback the configuration by
checkpoint (nxos),
archive file (iosxe),
load the saved running-config file on disk (iosxr)
Optional:
tgn_timeout (`int`): Maximum wait time for all traffic threads to be
restored to the reference rate,
in second. Default: 60
tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed,
in second. Default: 10
timeout_recovery:
Buffer recovery timeout make sure devices are recovered at the end
of the trigger execution. Used when previous timeouts have been exhausted.
max_time (`int`): Maximum wait time for the last step of the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
steps:
1. Learn Vxlan Ops object and store the vni state which is active and has source interface
and multisite bgw interface. SKIP the trigger if there is no VXLAN(s) found
2. Save the current device configurations through "method" which user uses
3. Modify the multisite bgw interface of the learned VXLAN from step 1 with Interface Conf object
4. Verify the multisite bgw interface of the learned VXLAN group(s) from step 3
changes to the modified value in step 3.
5. Recover the device configurations to the one in step 2
6. Learn VXLAN Ops again and verify it is the same as the Ops in step 1
"""
# configuration steps callable
# adding new value for multisite bgw interface
def configure_multisite_bgw_interface(self, conf_obj, **kwargs):
ret = ""
for key in self.keys:
if key['intf_name']!= key['source_if'] \
and key['intf_name'] != key['multisite_bgw_if']:
ret = key['intf_name']
if ret:
self.keys[0]['multisite_bgw_intf'] = ret
conf_obj.nve_multisite_bgw_intf = ret
conf_obj.build_config()
else:
self.failed('Failed to find the '
'attribute', from_exception=self.keys)
@aetest.test
def verify_configuration(self, uut, abstract, steps):
# modify self.keys to modify the multisite bgw interface value
for item in self.mapping.keys:
try:
ret = item['multisite_bgw_intf']
req = ['nve', '(?P<nve_name>.*)', 'multisite_bgw_if']
req.insert(len(req), ret)
self.mapping._verify_ops_dict['ops.vxlan.vxlan.Vxlan']['requirements'].append(req)
log.info("\n\nVerifying the following requirements: {req}".format(req=req))
except Exception as e:
self.failed('Failed to verify the '
'added feature', from_exception=e)
super().verify_configuration(uut, abstract, steps)
mapping = Mapping(requirements={'ops.vxlan.vxlan.Vxlan': {
'requirements': [['nve', '(?P<nve_name>.*)', 'source_if', '(?P<source_if>.*)'],
['nve', '(?P<nve_name>.*)', 'multisite_bgw_if', '(?P<multisite_bgw_if>.*)'],
['nve', '(?P<nve_name>.*)', 'vni', '(?P<vni>.*)', 'vni_state', 'up']],
'all_keys': True,
'kwargs': {'attributes': ['nve[(.*)][vni][(.*)]',
'nve[(.*)][source_if]',
'nve[(.*)][multisite_bgw_if]','l2route']},
'exclude': vxlan_exclude +['peer_id','tx_id']},
'ops.interface.interface.Interface': {
'requirements': [['info', '(?P<intf_name>loopback.*)', 'oper_status', 'up']],
'kwargs': {'attributes': ['info']},
'exclude': interface_exclude}},
config_info={'conf.interface.Interface': {
'requirements': [[partial(configure_multisite_bgw_interface, \
nve_multisite_bgw_intf='(?P<source_if>.*)')]],
'verify_conf': False,
'kwargs': {'mandatory': {'name': '(?P<nve_name>.*)', 'attach': False}}}},
verify_ops={'ops.vxlan.vxlan.Vxlan': {
'requirements': [['nve', '(?P<nve_name>.*)', 'vni', '(?P<vni>.*)', 'vni_state', 'down']],
'kwargs': {'attributes': ['nve[(.*)][vni][(.*)]',
'nve[(.*)][source_if]',
'nve[(.*)][multisite_bgw_if]','l2route']},
'exclude': vxlan_exclude + multisite_exclude +['l2route']}},
num_values={'nve_name': 'all', 'source_if': 'all', 'intf_name': 'all'})
class TriggerModifyNveVniMcastGroup(TriggerModify):
"""Modify and revert the mcast group dynamically learned vxlan(s)."""
__description__ = """Modify and revert the mcast group dynamically learned vxlan(s).
trigger_datafile:
Mandatory:
timeout:
max_time (`int`): Maximum wait time for the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
method (`str`): Method to recover the device configuration,
Support methods:
'checkpoint': Rollback the configuration by
checkpoint (nxos),
archive file (iosxe),
load the saved running-config file on disk (iosxr)
Optional:
tgn_timeout (`int`): Maximum wait time for all traffic threads to be
restored to the reference rate,
in second. Default: 60
tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed,
in second. Default: 10
timeout_recovery:
Buffer recovery timeout make sure devices are recovered at the end
of the trigger execution. Used when previous timeouts have been exhausted.
max_time (`int`): Maximum wait time for the last step of the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
steps:
1. Learn Vxlan Ops object and store the vni state which is active.
SKIP the trigger if there is no VXLAN(s) found
2. Save the current device configurations through "method" which user uses
3. Modify the mcast group of the learned VXLAN from step 1 with Interface Conf object
4. Verify the mcast group of the learned VXLAN(s) from step 3
changes to the modified value in step 3.
5. Recover the device configurations to the one in step 2
6. Learn VXLAN Ops again and verify it is the same as the Ops in step 1
"""
# configuration steps callable
# adding new value for mcast group
def configure_mcast_group(self, conf_obj, **kwargs):
for x in self.__dict__['keys']:
mcast_group = IPv4Address(x['mcast'])
mcast_group_value = mcast_group.__dict__['_ip']+1
t = struct.pack("!L", mcast_group_value)
new_mcast_group = socket.inet_ntoa(t)
self.keys[0]['mcast'] = new_mcast_group
conf_obj.nve_vni_mcast_group = new_mcast_group
conf_obj.build_config()
@aetest.test
def verify_modification(self, uut, abstract, steps):
# modify self.keys to modify the mcast group value
for item in self.mapping.keys:
try:
ret = item['mcast']
req = ['nve', '(?P<nve_name>.*)', 'vni', '(?P<nve_vni>.*)', 'mcast']
req.insert(len(req),ret)
self.mapping._verify_ops_dict['ops.vxlan.vxlan.Vxlan']['requirements'].append(req)
except Exception as e:
log.warning('Cannot modify mcast group information.'
'Mismatch is expected {}'.format(e))
super().verify_modification(uut, abstract, steps)
# Mapping of Information between Ops and Conf
# Also permit to dictates which key to verify
mapping = Mapping(requirements={'ops.vxlan.vxlan.Vxlan':{
'requirements':[['nve','(?P<nve_name>.*)','vni','(?P<nve_vni>.*)','mcast','(?P<mcast>[\d+\.\d+\.\d+\.\d+].*)'],
['nve','(?P<nve_name>.*)','vni','(?P<nve_vni>.*)','vni_state','up']],
'kwargs':{'attributes':['nve[(.*)][vni][(.*)][mcast]',
'nve[(.*)][vni][(.*)][vni_state]']},
'all_keys': True,
'exclude': vxlan_base_exclude}},
config_info={'conf.interface.Interface': {
'requirements':[[partial(configure_mcast_group, mcast='(?P<mcast>.*)')]],
'verify_conf':False,
'kwargs': {'mandatory': {'name': '(?P<nve_name>.*)',
'nve_vni': '(?P<nve_vni>.*)',
'nve_vni_associate_vrf': False,
'attach': False}}}},
verify_ops={'ops.vxlan.vxlan.Vxlan':{
'requirements':[['nve', '(?P<nve_name>.*)', 'vni', '(?P<nve_vni>.*)', 'vni_state', 'up']],
'kwargs':{'attributes':['nve[(.*)][vni][(.*)][mcast]',
'nve[(.*)][vni][(.*)][vni_state]']},
'exclude': vxlan_base_exclude}},
num_values={'nve_name':1 ,'nve_vni':1})
class TriggerModifyEvpnMsiteBgwDelayRestoreTime(TriggerModify):
"""Modify and revert the msite bgw delay restore time dynamically learned vxlan(s)."""
__description__ = """Modify and revert the multisite bgw delay restore time dynamically learned vxlan(s).
trigger_datafile:
Mandatory:
timeout:
max_time (`int`): Maximum wait time for the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
method (`str`): Method to recover the device configuration,
Support methods:
'checkpoint': Rollback the configuration by
checkpoint (nxos),
archive file (iosxe),
load the saved running-config file on disk (iosxr)
Optional:
tgn_timeout (`int`): Maximum wait time for all traffic threads to be
restored to the reference rate,
in second. Default: 60
tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed,
in second. Default: 10
timeout_recovery:
Buffer recovery timeout make sure devices are recovered at the end
of the trigger execution. Used when previous timeouts have been exhausted.
max_time (`int`): Maximum wait time for the last step of the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
steps:
1. Learn Vxlan Ops object and store the the multisite bgw delay restore time.
SKIP the trigger if there is no VXLAN(s) found
2. Save the current device configurations through "method" which user uses
3. Modify the multisite bgw delay restore time of the learned VXLAN from step 1
with Vxlan Conf object
4. Verify the multisite bgw delay restore time of the learned VXLAN(s) from step 3
changes to the modified value in step 3.
5. Recover the device configurations to the one in step 2
6. Learn VXLAN Ops again and verify it is the same as the Ops in step 1
"""
mapping = Mapping(requirements={'ops.vxlan.vxlan.Vxlan': {
'requirements': [[['nve', 'evpn_multisite_border_gateway', '(?P<border_gateway>.*)']],
[['nve','(?P<nve_name>.*)', 'multisite_convergence_time',
'(?P<multisite_convergence_time>.*)']]],
'kwargs': {'attributes': ['nve[(.*)][multisite_convergence_time]',
'nve[(.*)][vni][(.*)]',
'nve[evpn_multisite_border_gateway]']},
'exclude': vxlan_base_exclude}},
config_info={'conf.vxlan.Vxlan': {
'requirements': [['device_attr', '{uut}', 'evpn_msite_attr', '(?P<border_gateway>.*)',\
'evpn_msite_bgw_delay_restore_time', 101]],
'verify_conf': False,
'kwargs': {}}},
verify_ops={'ops.vxlan.vxlan.Vxlan': {
'requirements': [['nve', 'evpn_multisite_border_gateway', '(?P<border_gateway>.*)'],
['nve', '(?P<nve_name>.*)', 'multisite_convergence_time', 101]],
'kwargs': {'attributes': ['nve[(.*)][multisite_convergence_time]',
'nve[(.*)][vni][(.*)]',
'nve[evpn_multisite_border_gateway]']},
'exclude': vxlan_base_exclude}},
num_values={'nve_name': 'all' , 'border_gateway':'all', 'delay_time':'all' })
class TriggerModifyNveSourceInterfaceLoopback(TriggerModify):
"""Modify and revert nve source interface dynamically learned Vxlan(s)."""
__description__ = """Unconfigure nve source interface and reapply the whole configurations of dynamically learned Vxlan(s).
trigger_datafile:
Mandatory:
timeout:
max_time (`int`): Maximum wait time for the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
method (`str`): Method to recover the device configuration,
Support methods:
'checkpoint': Rollback the configuration by
checkpoint (nxos),
archive file (iosxe),
load the saved running-config file on disk (iosxr)
Optional:
tgn_timeout (`int`): Maximum wait time for all traffic threads to be
restored to the reference rate,
in second. Default: 60
tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed,
in second. Default: 10
timeout_recovery:
Buffer recovery timeout when the previous timeout has been exhausted,
to make sure the devices are recovered before ending the trigger
max_time (`int`): Maximum wait time for the last step of the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
steps:
1. Learn Vxlan Ops object and store the nve source interface under nve
if has any, otherwise, SKIP the trigger
2. Save the current device configurations through "method" which user uses
3. Unconfigure the nve source interface with Interface Conf object
4. Verify the nve source interface from step 3 are no longer existed
5. Recover the device configurations to the one in step 2
6. Learn Vxlan Ops again and verify it is the same as the Ops in step 1
"""
@aetest.test
def modify_configuration(self, uut, abstract, steps):
new_source_if = ""
values = "(?P<intf_name>.*)\n"\
"(?P<source_if>.*)\n"\
"(?P<multisite_bgw_if>.*)"
found_values = re.findall(r'\S+|\n', values)
req_values = self.mapping._path_population([found_values], uut)
for key in req_values:
# new source interface must be different with multisite bgw_if
if key[0] != key[2] and key[0] != key[4]:
new_source_if = key[0]
self.__dict__['new_source_if'] = new_source_if
break
if new_source_if:
cmd = "interface (?P<nve_name>.*)\n" \
" shutdown\n" \
" source-interface %s\n" \
" no shutdown" %new_source_if
x = re.findall(r'\S+|\n', cmd)
req = self.mapping._path_population([x], uut)
req_str = []
for item in req[0]:
req_str.append(str(item))
cmd = ' '.join(req_str)
try:
uut.configure(cmd)
except Exception as e:
self.failed("Unable to configure: '{c}'".format(c=cmd),
from_exception=e)
else:
# new source interface must be different with multisite bgw_if
self.failed("Not found any 'up' loopback and different with multisite bgw_if")
@aetest.test
def verify_modification(self, uut, abstract, steps):
try:
ret = self.__dict__['new_source_if']
req = ['nve', '(?P<nve_name>.*)', 'source_if']
req.insert(len(req), ret)
self.mapping._verify_ops_dict['ops.vxlan.vxlan.Vxlan']['requirements'].append(req)
log.info("\n\nVerifying the following requirements: {req}".format(req=req))
except Exception as e:
log.warning('Cannot verify source_if information.'
'Mismatch is expected {}'.format(e))
super().verify_modification(uut, abstract, steps)
@aetest.test
def restore_configuration(self, uut, method, abstract):
"""exceptional rollback"""
try:
cmd = "interface (?P<nve_name>.*)\n" \
" shutdown\n" \
" source-interface (?P<source_if>.*)\n" \
" no shutdown"
x = re.findall(r'\S+|\n', cmd)
req = self.mapping._path_population([x], uut)
req_str = []
for item in req[0]:
req_str.append(str(item))
cmd = ' '.join(req_str)
try:
uut.configure(cmd)
except Exception as e:
self.failed("Unable to configure: '{c}'".format(c=cmd),
from_exception=e)
except Exception as e:
self.failed('Failed to restore the configuration', from_exception=e)
mapping = Mapping(requirements={'ops.vxlan.vxlan.Vxlan':{
'requirements': [['nve', '(?P<nve_name>.*)', 'source_if', '(?P<source_if>.*)'],
['nve', '(?P<nve_name>.*)', 'src_if_state', 'up'],
['nve', '(?P<nve_name>.*)', 'multisite_bgw_if', '(?P<multisite_bgw_if>.*)']],
'all_keys': True,
'kwargs': {'attributes': ['nve']},
'exclude': vxlan_exclude},
'ops.interface.interface.Interface':{
'requirements': [['info', '(?P<intf_name>loopback.*)', 'oper_status', 'up']],
'kwargs': {'attributes': ['info']},
'all_keys': True,
'exclude': interface_exclude}},
config_info={'conf.interface.Interface': {
'requirements': [],
'verify_conf': False,
'kwargs': {'mandatory': {'name': '(?P<nve_name>.*)', 'attach': False}}}},
verify_ops={'ops.vxlan.vxlan.Vxlan': {
'requirements': [['nve', '(?P<nve_name>.*)', 'vni', '(?P<vni>.*)', 'vni_state', 'down'],
['nve', '(?P<nve_name>.*)', 'if_state', 'down'],
['nve', '(?P<nve_name>.*)', 'multisite_bgw_if_oper_state', 'down'],
['nve', '(?P<nve_name>.*)', 'multisite_bgw_if_oper_state_down_reason', 'NVE not up.'],
['nve', 'vni', 'summary', 'cp_vni_up', 0]],
'kwargs': {'attributes': ['nve']},
'exclude': vxlan_exclude + ['primary_ip','scondary_ip','vip_rmac',\
'ethernet_segment','cp_vni_down','sm_state']}},
num_values={'nve_name':1, 'source_if': 1, 'intf_name':'all', 'multisite_bgw_if':1 })
class TriggerModifyEvpnRd(TriggerModify):
"""Modify and revert the rd under evpn vni that dynamically learned vxlan(s)."""
__description__ = """Modify and revert the rd under evpn vni dynamically learned vxlan(s).
trigger_datafile:
Mandatory:
timeout:
max_time (`int`): Maximum wait time for the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
method (`str`): Method to recover the device configuration,
Support methods:
'checkpoint': Rollback the configuration by
checkpoint (nxos),
archive file (iosxe),
load the saved running-config file on disk (iosxr)
Optional:
tgn_timeout (`int`): Maximum wait time for all traffic threads to be
restored to the reference rate,
in second. Default: 60
tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed,
in second. Default: 10
timeout_recovery:
Buffer recovery timeout make sure devices are recovered at the end
of the trigger execution. Used when previous timeouts have been exhausted.
max_time (`int`): Maximum wait time for the last step of the trigger,
in second. Default: 180
interval (`int`): Wait time between iteration when looping is needed,
in second. Default: 15
steps:
1. Learn Vxlan Ops object and store the rd and it's vni .
SKIP the trigger if there is no VXLAN(s) found
2. Save the current device configurations through "method" which user uses
3. Modify the rd of the learned VXLAN from step 1 with Vxlan Conf object
4. Verify the rd of the learned VXLAN(s) from step 3
changes to the modified value in step 3.
5. Recover the device configurations to the one in step 2
6. Learn VXLAN Ops again and verify it is the same as the Ops in step 1
"""
# configuration steps callable
# adding new value for rd
def configure_rd(self, conf_obj, path, **kwargs):
paths = self._path_population([path], kwargs['device'])
for path in paths:
rd_index = int(path.index('evpn_vni_rd'))
rd_attr_val = path[rd_index+1]
new_rd_scond_portion = int(rd_attr_val.split(':')[1]) + 1
new_rd = "{}:{}".format(rd_attr_val.split(':')[0], new_rd_scond_portion)
self.keys[0]['new_rd'] = new_rd
path[-1] = new_rd
log.info('With following configuration:\n{c}'
.format(c=paths))
Configure.conf_configure(device=kwargs['device'],
conf=conf_obj,
conf_structure=paths,
unconfig=False)
@aetest.test
def verify_modification(self, uut, abstract, steps):
for item in self.mapping.keys:
try:
ret = item['new_rd']
req = ['bgp_l2vpn_evpn', 'instance', '(?P<instance>.*)',
'vrf', '(?P<vrf>.*)', 'address_family',
'(?P<af>.*)', 'rd', ret,'rd']
req.insert(len(req),ret)
req_2 = ['bgp_l2vpn_evpn', 'instance', '(?P<instance>.*)',
'vrf', '(?P<vrf>.*)', 'address_family',
'(?P<af>.*)', 'rd', ret, 'rd_vniid', '(?P<rd_vniid>.*)']
self.mapping._verify_ops_dict['ops.vxlan.vxlan.Vxlan']['requirements'].append(req)
self.mapping._verify_ops_dict['ops.vxlan.vxlan.Vxlan']['requirements'].append(req_2)
except Exception as e:
log.warning('Cannot verify rd information.'
'Mismatch is expected {}'.format(e))
super().verify_modification(uut, abstract, steps)
# Mapping of Information between Ops and Conf
# Also permit to dictates which key to verify
mapping = Mapping(requirements={'ops.vxlan.vxlan.Vxlan':{
'requirements':[['bgp_l2vpn_evpn', 'instance', '(?P<instance>.*)',
'vrf', '(?P<vrf>.*)', 'address_family',
'(?P<af>.*)', 'rd', '(?P<rd>.*)','rd','(?P<rd>.*)'],
['bgp_l2vpn_evpn', 'instance', '(?P<instance>.*)',
'vrf', '(?P<vrf>.*)', 'address_family',
'(?P<af>.*)', 'rd', '(?P<rd>.*)', 'rd_vniid', '(?P<rd_vniid>.*)'],
['bgp_l2vpn_evpn', 'instance', '(?P<instance>.*)',
'vrf', '(?P<vrf>.*)', 'address_family',
'(?P<af>.*)', 'rd', '(?P<rd>.*)', 'rd_vrf', 'l2']],
'kwargs':{'attributes':['bgp_l2vpn_evpn[instance][(.*)][vrf][(.*)][address_family][(.*)][rd][(.*)][rd]',
'bgp_l2vpn_evpn[instance][(.*)][vrf][(.*)][address_family][(.*)][rd][(.*)][rd_vniid]',
'bgp_l2vpn_evpn[instance][(.*)][vrf][(.*)][address_family][(.*)][rd][(.*)][rd_vrf]',
]},
'all_keys':True,
'exclude': vxlan_exclude}},
config_info={'conf.vxlan.Vxlan': {
'requirements':[[partial(configure_rd, path=['device_attr', '{uut}', 'evpn_attr',
'*', 'vni_attr', '(?P<rd_vniid>.*)',
'evpn_vni_rd', '(?P<rd>.*)'])]],
'verify_conf':False,
'kwargs': {}}},
verify_ops={'ops.vxlan.vxlan.Vxlan':{
'requirements':[],
'kwargs':{'attributes':['bgp_l2vpn_evpn[instance][(.*)][vrf][(.*)][address_family][(.*)][rd][(.*)][rd]',
'bgp_l2vpn_evpn[instance][(.*)][vrf][(.*)][address_family][(.*)][rd][(.*)][rd_vniid]',
'bgp_l2vpn_evpn[instance][(.*)][vrf][(.*)][address_family][(.*)][rd][(.*)][rd_vrf]']},
'exclude': vxlan_exclude}},
num_values={'rd': 1, 'instance':1, 'vrf':1, 'af':1, 'rd_vniid':1})
| 59.333929
| 153
| 0.469167
| 3,213
| 33,227
| 4.696234
| 0.097106
| 0.029425
| 0.029823
| 0.013851
| 0.788919
| 0.757373
| 0.736563
| 0.722646
| 0.700577
| 0.662602
| 0
| 0.009063
| 0.418876
| 33,227
| 559
| 154
| 59.440072
| 0.772386
| 0.032534
| 0
| 0.637895
| 0
| 0
| 0.546908
| 0.056894
| 0
| 0
| 0
| 0
| 0
| 1
| 0.018947
| false
| 0
| 0.018947
| 0
| 0.069474
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
f35036e91b1a3f5c6554a76c125e1bb79f9c2575
| 74
|
py
|
Python
|
application/flask/resources/__init__.py
|
agu3rra/sauron
|
fd262af858af7d06d8b9c54319be207a2adaf92b
|
[
"MIT"
] | null | null | null |
application/flask/resources/__init__.py
|
agu3rra/sauron
|
fd262af858af7d06d8b9c54319be207a2adaf92b
|
[
"MIT"
] | null | null | null |
application/flask/resources/__init__.py
|
agu3rra/sauron
|
fd262af858af7d06d8b9c54319be207a2adaf92b
|
[
"MIT"
] | null | null | null |
from .status import status
from .scan import scan
from .scans import scans
| 24.666667
| 26
| 0.810811
| 12
| 74
| 5
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148649
| 74
| 3
| 27
| 24.666667
| 0.952381
| 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
| 1
| 0
|
0
| 5
|
f352e80c3743656abcd189512a025b0a3ff052d7
| 38
|
py
|
Python
|
tests/__init__.py
|
actuarial-tools/pyactsci
|
fb8a4318b12df9252274040961b5f94c82008311
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
actuarial-tools/pyactsci
|
fb8a4318b12df9252274040961b5f94c82008311
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
actuarial-tools/pyactsci
|
fb8a4318b12df9252274040961b5f94c82008311
|
[
"MIT"
] | null | null | null |
"""Unit test package for pyactsci."""
| 19
| 37
| 0.684211
| 5
| 38
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131579
| 38
| 1
| 38
| 38
| 0.787879
| 0.815789
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f3ba47eab3faf7a9d7ef2ed58afa6ac62a43a9aa
| 82
|
py
|
Python
|
models/__init__.py
|
hbin0701/c3vqg-official
|
2600940d9a3255f9f4b616313aed968b17d71432
|
[
"MIT"
] | 13
|
2020-05-30T11:45:33.000Z
|
2021-12-22T13:52:01.000Z
|
models/__init__.py
|
hbin0701/c3vqg-official
|
2600940d9a3255f9f4b616313aed968b17d71432
|
[
"MIT"
] | 6
|
2020-08-08T05:39:35.000Z
|
2022-03-12T00:46:20.000Z
|
models/__init__.py
|
hbin0701/c3vqg-official
|
2600940d9a3255f9f4b616313aed968b17d71432
|
[
"MIT"
] | 6
|
2020-07-01T04:06:53.000Z
|
2022-03-29T10:13:39.000Z
|
from .iq import IQ
from .gen_ques_rnn import genQLSTM
from .iq_try_cl import IQ_CL
| 27.333333
| 34
| 0.829268
| 17
| 82
| 3.705882
| 0.529412
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134146
| 82
| 3
| 35
| 27.333333
| 0.887324
| 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
| 1
| 0
|
0
| 5
|
45fef68d346ae91b3cf94e810d3dae5f70468409
| 217
|
py
|
Python
|
backend/src/graphql_get.py
|
mRcSchwering/prevailing-winds
|
5515f05fa7012a47bc665883b30a47f1ab251835
|
[
"MIT"
] | 3
|
2021-05-12T12:14:11.000Z
|
2021-10-02T13:06:41.000Z
|
backend/src/graphql_get.py
|
mRcSchwering/prevailing-winds
|
5515f05fa7012a47bc665883b30a47f1ab251835
|
[
"MIT"
] | 14
|
2021-03-18T18:01:03.000Z
|
2021-10-03T16:57:11.000Z
|
backend/src/graphql_get.py
|
mRcSchwering/prevailing-winds
|
5515f05fa7012a47bc665883b30a47f1ab251835
|
[
"MIT"
] | null | null | null |
from ariadne.constants import PLAYGROUND_HTML # type: ignore
def lambda_handler(*_):
return {
"statusCode": 200,
"body": PLAYGROUND_HTML,
"headers": {"Content-Type": "text/html"},
}
| 21.7
| 61
| 0.612903
| 22
| 217
| 5.863636
| 0.818182
| 0.217054
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018405
| 0.248848
| 217
| 9
| 62
| 24.111111
| 0.773006
| 0.0553
| 0
| 0
| 0
| 0
| 0.206897
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| true
| 0
| 0.142857
| 0.142857
| 0.428571
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
340d9fefe4a3fb1df50742f9accc5ea72712e00e
| 56,299
|
py
|
Python
|
cla_backend/apps/cla_provider/tests/api/test_csvupload_api.py
|
uk-gov-mirror/ministryofjustice.cla_backend
|
4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6
|
[
"MIT"
] | 3
|
2019-10-02T15:31:03.000Z
|
2022-01-13T10:15:53.000Z
|
cla_backend/apps/cla_provider/tests/api/test_csvupload_api.py
|
uk-gov-mirror/ministryofjustice.cla_backend
|
4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6
|
[
"MIT"
] | 206
|
2015-01-02T16:50:11.000Z
|
2022-02-16T20:16:05.000Z
|
cla_backend/apps/cla_provider/tests/api/test_csvupload_api.py
|
uk-gov-mirror/ministryofjustice.cla_backend
|
4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6
|
[
"MIT"
] | 6
|
2015-03-23T23:08:42.000Z
|
2022-02-15T17:04:44.000Z
|
import datetime
import re
import unittest
from decimal import Decimal
from django.conf import settings
from django.contrib.auth.models import User
from django.test import override_settings
from provider.oauth2.models import AccessToken
from rest_framework import serializers
from rest_framework.test import APITestCase
import legalaid.utils.csvupload.validators as v
from legalaid.utils.csvupload.contracts import (
CONTRACT_EIGHTEEN_DISCRIMINATION,
CONTRACT_EIGHTEEN_EDUCATION,
contract_2018_category_spec,
get_applicable_contract,
)
from cla_provider.models import Staff
from core.tests.mommy_utils import make_recipe
from core.tests.test_base import SimpleResourceAPIMixin
from legalaid.tests.views.test_base import CLAProviderAuthBaseApiTestMixin
class CSVUploadAPIMixin(SimpleResourceAPIMixin):
RESOURCE_RECIPE = "cla_provider.csvupload_case"
API_URL_BASE_NAME = "csvupload"
@property
def response_keys(self):
return ["id", "provider", "created_by", "comment", "rows", "month", "created", "modified"]
@property
def response_keys_details(self):
keys = self.response_keys[:]
keys.remove("rows")
keys.append("body")
return keys
def make_resource(self, **kwargs):
kwargs.update({"created_by": self.user.staff, "provider": self.provider})
return super(CSVUploadAPIMixin, self).make_resource(**kwargs)
class CSVUploadTestCase(CSVUploadAPIMixin, CLAProviderAuthBaseApiTestMixin, APITestCase):
def setUp(self):
super(CSVUploadTestCase, self).setUp()
self.wrong_user = User.objects.create_user("wrong user", "wr@ng.user", "password")
self.wrong_provider = make_recipe("cla_provider.provider")
self.wrong_provider.staff_set.add(Staff(user=self.wrong_user, is_manager=True))
self.wrong_provider.save()
# Create an access token from wrong user
self.wrong_staff_token = AccessToken.objects.create(
user=self.wrong_user, client=self.staff_api_client, token="wrong_stafF_token", scope=0
)
def assertResponseKeys(self, response, detail=False, paginated=False):
return super(CSVUploadTestCase, self).assertResponseKeys(
response, keys=self.response_keys_details if detail else None, paginated=paginated
)
def test_get(self):
response = self.client.get(self.detail_url, HTTP_AUTHORIZATION=self.get_http_authorization())
self.assertResponseKeys(response, detail=True)
def test_get_list(self):
response = self.client.get(self.list_url, HTTP_AUTHORIZATION=self.get_http_authorization())
self.assertResponseKeys(response, paginated=True)
def test_get_list_with_wrong_provider(self):
response = self.client.get(
self.list_url, HTTP_AUTHORIZATION=self.get_http_authorization(token=self.wrong_staff_token)
)
self.assertListEqual(response.data["results"], [])
def test_methods_not_authorized(self):
self._test_get_not_authorized(self.list_url, self.invalid_token)
self._test_get_not_authorized(self.detail_url, self.invalid_token)
def test_methods_not_allowed(self):
self._test_patch_not_allowed(self.detail_url, data={"anything": "it doesn't matter"})
class ProviderCSVValidatorTestCase(unittest.TestCase):
def setUp(self):
contract_2013_format_data = v.contract_2013_validators_for_original_field_order.copy()
contract_2013_format_data["CLA Reference Number"] = u"3333333"
contract_2013_format_data["Client Ref"] = u"0001"
contract_2013_format_data["Account Number"] = u"2B222B"
contract_2013_format_data["First Name"] = u"A N Other"
contract_2013_format_data["Surname"] = u"Corgi"
contract_2013_format_data["DOB"] = u"02/01/2014"
contract_2013_format_data["Age Range"] = u"E"
contract_2013_format_data["Gender"] = u"M"
contract_2013_format_data["Ethnicity"] = u"1"
contract_2013_format_data["Unused1"] = u""
contract_2013_format_data["Unused2"] = u""
contract_2013_format_data["Postcode"] = u"SW1A 1AA"
contract_2013_format_data["Eligibility Code"] = u"X"
contract_2013_format_data["Matter Type 1"] = u""
contract_2013_format_data["Matter Type 2"] = u""
contract_2013_format_data["Stage Reached"] = u""
contract_2013_format_data["Outcome Code"] = u""
contract_2013_format_data["Unused3"] = u""
contract_2013_format_data["Date Opened"] = u"01/01/2014"
contract_2013_format_data["Date Closed"] = u"01/01/2015"
contract_2013_format_data["Time Spent"] = u"99"
contract_2013_format_data["Case Costs"] = u"99.5"
contract_2013_format_data["Unused4"] = u""
contract_2013_format_data["Disability Code"] = u"ILL"
contract_2013_format_data["Disbursements"] = u"0"
contract_2013_format_data["Travel Costs"] = u"0"
contract_2013_format_data["Determination"] = u""
contract_2013_format_data["Suitable for Telephone Advice"] = u"N"
contract_2013_format_data["Exceptional Cases (ref)"] = u""
contract_2013_format_data["Exempted Reason Code"] = u""
contract_2013_format_data["Adjustments / Adaptations"] = u"NAR"
contract_2013_format_data["Signposting / Referral"] = u""
contract_2013_format_data["Media Code"] = u"DK"
contract_2013_format_data["Telephone / Online"] = u"TA"
self.contract_2013_data = contract_2013_format_data
contract_2018_format_data = v.contract_2018_validators_for_new_field_order.copy()
contract_2018_format_data["CLA Reference Number"] = u"3333333"
contract_2018_format_data["Client Ref"] = u"0001"
contract_2018_format_data["Account Number"] = u"2B222B"
contract_2018_format_data["First Name"] = u"A N Other"
contract_2018_format_data["Surname"] = u"Corgi"
contract_2018_format_data["DOB"] = u"02/01/2014"
contract_2018_format_data["Age Range"] = u"E"
contract_2018_format_data["Gender"] = u"M"
contract_2018_format_data["Ethnicity"] = u"1"
contract_2018_format_data["Postcode"] = u"SW1A 1AA"
contract_2018_format_data["Eligibility Code"] = u"X"
contract_2018_format_data["Matter Type 1"] = u""
contract_2018_format_data["Matter Type 2"] = u""
contract_2018_format_data["Stage Reached"] = u""
contract_2018_format_data["Outcome Code"] = u""
contract_2018_format_data["Date Opened"] = u"01/09/2018"
contract_2018_format_data["Date Closed"] = u"01/10/2018"
contract_2018_format_data["Time Spent"] = u"18"
contract_2018_format_data["Case Costs"] = u"99.5"
contract_2018_format_data["Fixed Fee Amount"] = u"65"
contract_2018_format_data["Fixed Fee Code"] = u"LF"
contract_2018_format_data["Disability Code"] = u"ILL"
contract_2018_format_data["Disbursements"] = u"0"
contract_2018_format_data["Travel Costs"] = u"0"
contract_2018_format_data["Determination"] = u""
contract_2018_format_data["Suitable for Telephone Advice"] = u"N"
contract_2018_format_data["Exceptional Cases (ref)"] = u""
contract_2018_format_data["Exempted Reason Code"] = u""
contract_2018_format_data["Adjustments / Adaptations"] = u"NAR"
contract_2018_format_data["Signposting / Referral"] = u""
contract_2018_format_data["Media Code"] = u"DK"
contract_2018_format_data["Telephone / Online"] = u"TA"
self.contract_2018_data = contract_2018_format_data
@staticmethod
def get_provider_csv_validator(data=None):
data_in_2013_format = [
[
u"3333333",
u"0001",
u"2B222B",
u"A N Other",
u"Corgi",
u"02/01/2014",
u"E",
u"M",
u"1",
u"",
u"",
u"SW1A 1AA",
u"X",
u"EPRO",
u"ESOS",
u"EA",
u"EB",
u"",
u"01/01/2014",
u"01/01/2015",
u"99",
u"99.5",
u"",
u"ILL",
u"0",
u"0",
u"",
u"N",
u"",
u"",
u"NAR",
u"",
u"DK",
u"TA",
],
[
u"2222222",
u"0000",
u"1A111A",
u"A",
u"Corgi",
u"01/01/2014",
u"D",
u"F",
u"1",
u"",
u"",
u"SW1A 1AA",
u"",
u"EPRO",
u"ESOS",
u"",
u"",
u"",
u"",
u"",
u"18",
u"99.5",
u"",
u"MOB",
u"",
u"",
u"FINI",
u"",
u"",
u"",
u"NAR",
u"",
u"",
u"TA",
],
]
data_in_2018_format = [
[
u"3333333",
u"0001",
u"2B222B",
u"A N Other",
u"Corgi",
u"02/01/2014",
u"E",
u"M",
u"1",
u"SW1A 1AA",
u"X",
u"EPRO",
u"ESOS",
u"EA",
u"EB",
u"01/01/2014",
u"01/01/2015",
u"99",
u"99.5",
u"",
u"NA",
u"ILL",
u"0",
u"0",
u"",
u"N",
u"",
u"",
u"NAR",
u"",
u"DK",
u"TA",
],
[
u"2222222",
u"0000",
u"1A111A",
u"A",
u"Corgi",
u"01/01/2014",
u"D",
u"F",
u"1",
u"SW1A 1AA",
u"",
u"EPRO",
u"ESOS",
u"",
u"",
u"",
u"",
u"18",
u"99.5",
u"",
u"NA",
u"MOB",
u"",
u"",
u"FINI",
u"",
u"",
u"",
u"NAR",
u"",
u"",
u"TA",
],
]
if data is None:
data = data_in_2018_format if settings.CONTRACT_2018_ENABLED else data_in_2013_format
return v.ProviderCSVValidator(data)
@staticmethod
def get_dummy_cleaned_data_copy():
data_in_2013_format = {
"DOB": datetime.datetime(2014, 1, 2, 0, 0),
"Media Code": u"DK",
"Exempted Reason Code": u"",
"Telephone / Online": u"TA",
"First Name": u"A N Other",
"Unused1": u"",
"Stage Reached": u"EB",
"Unused3": u"",
"Unused2": u"",
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Exceptional Cases (ref)": u"",
"Time Spent": 99,
"CLA Reference Number": 3333333,
"Client Ref": u"0001",
"Determination": u"",
"Travel Costs": Decimal("0"),
"Outcome Code": u"EB",
"Date Opened": datetime.datetime(2014, 1, 1, 0, 0),
"Signposting / Referral": u"",
"Eligibility Code": u"X",
"Gender": u"M",
"Case Costs": Decimal("99.5"),
"Disbursements": Decimal("0"),
"Disability Code": u"ILL",
"Suitable for Telephone Advice": u"N",
"Adjustments / Adaptations": u"",
"Date Closed": datetime.datetime(2014, 1, 2, 0, 0),
"Age Range": u"E",
"Surname": u"Corgi",
"Account Number": u"2B222B",
"Unused4": u"",
"Postcode": u"SW1A 1AA",
"Ethnicity": u"1",
}
data_in_2018_format = {
"DOB": datetime.datetime(2014, 1, 2, 0, 0),
"Media Code": u"DK",
"Exempted Reason Code": u"",
"Telephone / Online": u"TA",
"First Name": u"A N Other",
"Stage Reached": u"EB",
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Exceptional Cases (ref)": u"",
"Time Spent": 99,
"CLA Reference Number": 3333333,
"Client Ref": u"0001",
"Determination": u"",
"Travel Costs": Decimal("0"),
"Outcome Code": u"EB",
"Date Opened": datetime.datetime(2014, 1, 1, 0, 0),
"Signposting / Referral": u"",
"Eligibility Code": u"X",
"Gender": u"M",
"Case Costs": Decimal("99.5"),
"Disbursements": Decimal("0"),
"Disability Code": u"ILL",
"Suitable for Telephone Advice": u"N",
"Adjustments / Adaptations": u"",
"Date Closed": datetime.datetime(2014, 1, 2, 0, 0),
"Age Range": u"E",
"Surname": u"Corgi",
"Account Number": u"2B222B",
"Postcode": u"SW1A 1AA",
"Ethnicity": u"1",
"Fixed Fee Amount": u"LF",
"Fixed Fee Code": u"65",
}
data = data_in_2018_format if settings.CONTRACT_2018_ENABLED else data_in_2013_format
return data.copy()
@override_settings(CONTRACT_2018_ENABLED=False)
def test_validator_valid_2013(self):
validator = self.get_provider_csv_validator()
self.assertEqual(len(validator.validate()), 2)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_valid_2018(self):
validator = self.get_provider_csv_validator()
self.assertEqual(len(validator.validate()), 2)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_is_2018_discrimination(self):
for matter_type in contract_2018_category_spec["discrimination"]["MATTER_TYPE1"]:
if get_applicable_contract(datetime.datetime(2019, 9, 1), matter_type) != CONTRACT_EIGHTEEN_DISCRIMINATION:
self.fail("Applicable contract is not 2018 discrimination contract")
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_is_2018_education(self):
for matter_type in contract_2018_category_spec["education"]["MATTER_TYPE1"]:
if get_applicable_contract(datetime.datetime(2019, 9, 1), matter_type) != CONTRACT_EIGHTEEN_EDUCATION:
self.fail("Applicable contract is not 2018 education contract")
def test_invalid_field_count(self):
validator = self.get_provider_csv_validator([[], []])
with self.assertRaisesRegexp(serializers.ValidationError, r"Row: 1 - Incorrect number of columns"):
validator.validate()
def test_closed_date_after_opened_date_invariant(self):
test_values = {
"Matter Type 1": u"EADM",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EB",
"Outcome Code": u"EB",
"Date Opened": u"02/01/2014",
"Date Closed": u"01/01/2014",
}
data = [self._generate_contract_data_row(override=test_values)]
validator = self.get_provider_csv_validator(data)
with self.assertRaisesRegexp(serializers.ValidationError, "Row: 1 - .*must be after"):
validator.validate()
def test_invalid_account_number(self):
test_values = {
"Account Number": u"22222B",
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EB",
"Outcome Code": u"EB",
}
data = [self._generate_contract_data_row(override=test_values)]
validator = self.get_provider_csv_validator(data)
with self.assertRaises(serializers.ValidationError):
validator.validate()
def test_service_adapation_validation_valid(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EB",
"Outcome Code": u"EB",
"Adjustments / Adaptations": u"LOL",
}
data = [self._generate_contract_data_row(override=test_values)]
validator = self.get_provider_csv_validator(data)
with self.assertRaisesRegexp(serializers.ValidationError, r"Adjustments / Adaptations - LOL must be one of"):
validator.validate()
@override_settings(CONTRACT_2018_ENABLED=False)
def test_allowed_no_outcome_code_and_dates_if_determination_code_2013(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Date Opened": u"",
"Date Closed": u"",
"Time Spent": u"18",
"Determination": u"FINI",
}
data = [self._generate_contract_data_row(override=test_values)]
validator = self.get_provider_csv_validator(data)
try:
validator.validate()
except serializers.ValidationError:
self.fail("Should not need outcome code or closed and opened dated if determination code present")
@override_settings(CONTRACT_2018_ENABLED=True)
def test_allowed_no_outcome_code_and_dates_if_determination_code_2018(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Date Opened": u"",
"Date Closed": u"",
"Fixed Fee Code": u"NA",
"Time Spent": u"18",
"Determination": u"FINI",
}
data = [self._generate_contract_data_row(override=test_values)]
validator = self.get_provider_csv_validator(data)
try:
validator.validate()
except serializers.ValidationError:
self.fail("Should not need outcome code or closed and opened dated if determination code present")
def test_service_adapation_validation_required(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Adjustments / Adaptations "] = u""
with self.assertRaisesRegexp(serializers.ValidationError, r"Adjustments / Adaptations field is required"):
validator._validate_service_adaptation(cleaned_data)
@override_settings(CONTRACT_2018_ENABLED=False)
def test_eligibility_code_validation_required(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Eligibility Code"] = u""
with self.assertRaisesRegexp(serializers.ValidationError, r"Eligibility Code field is required"):
validator._validate_eligibility_code_against_time_spent(cleaned_data)
@override_settings(CONTRACT_2018_ENABLED=False)
def test_validate_ta_oa_ff_not_valid_for_edu_and_dis(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Telephone / Online"] = u"FF"
validator._validate_telephone_or_online_advice(cleaned_data, u"education")
validator._validate_telephone_or_online_advice(cleaned_data, u"discrimination")
with self.assertRaisesRegexp(serializers.ValidationError, r".*code FF only valid for.*"):
validator._validate_telephone_or_online_advice(cleaned_data, u"ssss")
@override_settings(CONTRACT_2018_ENABLED=False)
def test_eligibility_code_validation_time_spent_less_than_132(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Eligibility Code"] = u"S"
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Time Spent"] = 999
with self.assertRaisesRegexp(
serializers.ValidationError, r"The eligibility code .* you have entered is not valid"
):
validator._validate_eligibility_code_against_time_spent(cleaned_data)
@override_settings(CONTRACT_2018_ENABLED=False)
def test_validation_time_spent_less_than_18(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Eligibility Code"] = u"S"
cleaned_data["Determination"] = False
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Time Spent"] = 999
with self.assertRaisesRegexp(
serializers.ValidationError, r"The eligibility code .* you have entered is not valid with"
):
validator._validate_eligibility_code_against_time_spent(cleaned_data)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_eligibility_code_validation_required_2018(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Eligibility Code"] = u""
with self.assertRaisesRegexp(serializers.ValidationError, r"Eligibility Code field is required"):
validator._validate_eligibility_code_against_time_spent(cleaned_data)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validate_ta_oa_ff_not_valid_for_edu_and_dis_2018(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Telephone / Online"] = u"FF"
validator._validate_telephone_or_online_advice(cleaned_data, u"education")
validator._validate_telephone_or_online_advice(cleaned_data, u"discrimination")
with self.assertRaisesRegexp(serializers.ValidationError, r".*code FF only valid for.*"):
validator._validate_telephone_or_online_advice(cleaned_data, u"ssss")
@override_settings(CONTRACT_2018_ENABLED=True)
def test_eligibility_code_validation_time_spent_less_than_132_2018(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Eligibility Code"] = u"S"
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Time Spent"] = 999
with self.assertRaisesRegexp(
serializers.ValidationError, r"The eligibility code .* you have entered is not valid"
):
validator._validate_eligibility_code_against_time_spent(cleaned_data)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validation_time_spent_less_than_18_2018(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Eligibility Code"] = u"S"
cleaned_data["Determination"] = False
validator._validate_eligibility_code_against_time_spent(cleaned_data)
cleaned_data["Time Spent"] = 999
with self.assertRaisesRegexp(
serializers.ValidationError, r"The eligibility code .* you have entered is not valid with"
):
validator._validate_eligibility_code_against_time_spent(cleaned_data)
def test_validation_time_spent_more_than_18_with_determination_not_valid(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Eligibility Code"] = u"S"
cleaned_data["Determination"] = True
cleaned_data["Time Spent"] = 12
validator._validate_time_spent(cleaned_data, u"welfare")
cleaned_data["Time Spent"] = 999
with self.assertRaisesRegexp(
serializers.ValidationError, "[u'Time spent (999) must not be greater than 42 minutes']"
):
validator._validate_time_spent(cleaned_data, u"discrimination")
with self.assertRaisesRegexp(
serializers.ValidationError, "[u'Time spent (999) must not be greater than 18 minutes']"
):
validator._validate_time_spent(cleaned_data, u"welfare")
cleaned_data["Time Spent"] = 9
with self.assertRaisesRegexp(serializers.ValidationError, "[u'Time spent (9) must be in 6 minute intervals']"):
validator._validate_time_spent(cleaned_data, u"welfare")
def test_validation_exemption_code_or_cla_ref_required(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Date Opened"] = datetime.datetime(2014, 1, 1)
cleaned_data["Exempted Code Reason"] = u"aa"
cleaned_data["Determination"] = False
validator._validate_exemption(cleaned_data, u"debt")
cleaned_data["Date Opened"] = datetime.datetime(2014, 1, 2)
with self.assertRaisesRegexp(
serializers.ValidationError,
"[u'An Exemption Reason can only be entered for Debt, Discrimination and Education matter]",
):
validator._validate_exemption(cleaned_data, u"welfare")
cleaned_data["Exempted Code Reason"] = u""
cleaned_data["CLA Reference Number"] = u""
cleaned_data["Date Opened"] = datetime.datetime(2011, 1, 1)
cleaned_data["Exceptional Cases (ref)"] = u"foo"
validator._validate_exemption(cleaned_data, u"debt")
cleaned_data["Exempted Code Reason"] = u"aa"
with self.assertRaisesRegexp(
serializers.ValidationError,
"[u'An Exemption Reason can only be entered for Debt, Discrimination and Education matter]",
):
validator._validate_exemption(cleaned_data, u"welfare")
def test_category_consistency_validation(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Matter Type 1"] = u"S"
cleaned_data["Matter Type 2"] = u"P"
with self.assertRaisesRegexp(serializers.ValidationError, r"fields must be of the same category"):
validator._validate_category_consistency(cleaned_data)
def test_staged_reached_validate_required_mt1s(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Matter Type 1"] = u"DMCA"
cleaned_data["Stage Reached"] = u""
with self.assertRaisesRegexp(
serializers.ValidationError, r".*is required because Matter Type 1: DMCA was specified.*"
):
validator._validate_stage_reached(cleaned_data)
def test_staged_reached_validate_not_allowed_mt1s(self):
validator = self.get_provider_csv_validator()
cleaned_data = self.get_dummy_cleaned_data_copy()
cleaned_data["Matter Type 1"] = u"WBAA"
with self.assertRaisesRegexp(
serializers.ValidationError, r".*is not allowed because Matter Type 1: WBAA was specified.*"
):
validator._validate_stage_reached(cleaned_data)
def test_gte_validator(self):
gte_0 = v.validate_gte(0)
self.assertEqual(1, gte_0(1))
with self.assertRaisesRegexp(serializers.ValidationError, ".*must be >= 0"):
gte_0(-1)
def test_validate_not_current_month(self):
d = datetime.datetime(2014, 1, 1)
self.assertEqual(d, v.validate_not_current_month(d))
with self.assertRaisesRegexp(serializers.ValidationError, r".*must not be from current month"):
v.validate_not_current_month(datetime.datetime.now())
def test_decimal_validator(self):
self.assertEqual(Decimal("1.0"), v.validate_decimal("1.0"))
with self.assertRaisesRegexp(serializers.ValidationError, r"Invalid literal"):
v.validate_decimal("QQ")
def test_integer_validator(self):
self.assertEqual(1, v.validate_integer("1"))
with self.assertRaises(serializers.ValidationError):
v.validate_integer("Q")
def test_present_validator(self):
val = "123"
self.assertEqual(val, v.validate_present(val))
with self.assertRaises(serializers.ValidationError):
v.validate_present("")
def test_date_validator(self):
val = "10/12/2014"
self.assertEqual(datetime.datetime(2014, 12, 10), v.validate_date(val))
with self.assertRaisesRegexp(serializers.ValidationError, r"is not a valid date"):
v.validate_date("FOO BAR BAZ")
def test_not_present_validator(self):
self.assertEqual("", v.validate_not_present(""))
with self.assertRaisesRegexp(serializers.ValidationError, "Field should not be present"):
v.validate_not_present("qqq")
def test_regex_validator(self):
validator = v.validate_regex("foo", re.I)
val = "FOO"
self.assertEqual(val, validator(val))
with self.assertRaisesRegexp(
serializers.ValidationError, '[u"Field value (BAR) doesn\'t match pattern: foo"]'
):
validator("BAR")
def test_validate_in_iterable(self):
test_in = v.validate_in({"a", "b", "c"})
self.assertEqual("a", test_in("a"))
with self.assertRaisesRegexp(serializers.ValidationError, r".*must be one of"):
test_in("q")
def _generate_contract_data_row(self, override=None):
row = self.contract_2018_data.copy() if settings.CONTRACT_2018_ENABLED else self.contract_2013_data.copy()
if override:
row.update(override)
return [val for key, val in row.items()]
def _test_generated_contract_row_validates(self, override):
data = [self._generate_contract_data_row(override)]
validator = v.ProviderCSVValidator(data)
try:
validator.validate()
except (serializers.ValidationError, Exception) as e:
self.fail("{}".format(e))
def _test_generated_2018_contract_row_validate_fails(self, override, expected_error):
data = [self._generate_contract_data_row(override)]
validator = v.ProviderCSVValidator(data)
try:
validator.validate()
except (serializers.ValidationError, Exception) as e:
if expected_error not in e.messages:
self.fail("{}".format(e))
else:
self.fail("Expected error missing: {}".format(expected_error))
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_for_debt_outcome_code_DAA_is_valid(self):
test_values = {
"Matter Type 1": u"DPDE",
"Matter Type 2": u"DVAL",
"Stage Reached": u"DA",
"Outcome Code": u"DAA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_for_family_outcome_code_FAA_is_valid(self):
test_values = {"Matter Type 1": u"FAMA", "Matter Type 2": u"FADV", "Outcome Code": u"FAA"}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_for_family_outcome_code_FAB_is_valid(self):
test_values = {"Matter Type 1": u"FAMA", "Matter Type 2": u"FADV", "Outcome Code": u"FAB"}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_for_family_outcome_code_FAC_is_valid(self):
test_values = {"Matter Type 1": u"FAMA", "Matter Type 2": u"FADV", "Outcome Code": u"FAC"}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_discrimination_outcome_code_QAA_is_valid(self):
test_values = {
"Matter Type 1": u"QPRO",
"Matter Type 2": u"QAGE",
"Stage Reached": u"QA",
"Outcome Code": u"QAA",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_fafa_determination_code_is_valid(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EA",
"Determination": u"FAFA",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_exem_determination_code_is_valid(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EA",
"Determination": u"EXEM",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_housing_outcome_code_haa_is_valid(self):
test_values = {
"Matter Type 1": u"HRNT",
"Matter Type 2": u"HPRI",
"Stage Reached": u"HA",
"Outcome Code": u"HAA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_housing_outcome_code_hac_is_valid(self):
test_values = {
"Matter Type 1": u"HRNT",
"Matter Type 2": u"HPRI",
"Stage Reached": u"HA",
"Outcome Code": u"HAC",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_housing_outcome_code_hab_is_valid(self):
test_values = {
"Matter Type 1": u"HRNT",
"Matter Type 2": u"HPRI",
"Stage Reached": u"HA",
"Outcome Code": u"HAB",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_education_outcome_code_eaa_is_valid(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EA",
"Outcome Code": u"EAA",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_education_matter_type1_code_edjr_is_valid(self):
test_values = {
"Matter Type 1": u"EDJR",
"Matter Type 2": u"ENUR",
"Stage Reached": u"EA",
"Outcome Code": u"EZ",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_invalid_outcome_code(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EA",
"Outcome Code": u"INVALID",
"Fixed Fee Code": u"NA",
}
expected_error = u"Row: 1 - You have not selected a valid Outcome Code."
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_fixed_fee_amount_present(self):
test_values = {
"Matter Type 1": u"DMAP",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"130",
"Fixed Fee Code": u"LF",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_fixed_fee_amount_missing(self):
test_values = {
"Matter Type 1": u"DMAP",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"",
"Fixed Fee Code": u"HF",
}
expected_error = u"Row: 1 - Fixed Fee Amount must be entered for Fixed Fee Code (HF)"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_lower_fixed_fee_time_spent(self):
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"65",
"Fixed Fee Code": u"LF",
"Time Spent": u"132",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_lower_fixed_fee_excess_time_spent(self):
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"65",
"Fixed Fee Code": u"LF",
"Time Spent": u"133",
}
expected_error = u"Row: 1 - The Fixed Fee code you have entered is not valid with time spent on the case"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_higher_fixed_fee_time_spent_bounds(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"DMAP",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"130",
"Fixed Fee Code": u"HF",
}
lower_bound = "133"
upper_bound = "899"
for time_spent in [lower_bound, upper_bound]:
test_values["Time Spent"] = time_spent
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_higher_fixed_fee_excess_time_spent(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"DMAP",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"130",
"Fixed Fee Code": u"HF",
"Time Spent": u"900",
}
expected_error = u"Row: 1 - The Fixed Fee code you have entered is not valid with time spent on the case"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_higher_fixed_fee_insufficient_time_spent(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"DMAP",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"130",
"Fixed Fee Code": u"HF",
"Time Spent": u"132",
}
expected_error = u"Row: 1 - The Fixed Fee code you have entered is not valid with time spent on the case"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_hourly_rate_fixed_fee_time_spent(self):
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Code": u"HR",
"Time Spent": u"900",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_hourly_rate_fixed_fee_insufficient_time_spent(self):
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Code": u"HR",
"Time Spent": u"899",
}
expected_error = u"Row: 1 - The Fixed Fee code you have entered is not valid with time spent on the case"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_fixed_fee_code_df_is_valid(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"HRNT",
"Matter Type 2": u"HPRI",
"Stage Reached": u"HA",
"Fixed Fee Code": u"DF",
"Fixed Fee Amount": u"40.0",
"Determination": u"FINI",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_df_fixed_fee_amount_is_valid(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"HRNT",
"Matter Type 2": u"HPRI",
"Stage Reached": u"HA",
"Fixed Fee Code": u"DF",
"Determination": u"FINI",
}
valid_amounts = [0, 0.50, 10, 20.50, 40]
for amount in valid_amounts:
test_values["Fixed Fee Amount"] = u"{}".format(amount)
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_df_fixed_fee_amount_invalid(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"HRNT",
"Matter Type 2": u"HPRI",
"Stage Reached": u"HA",
"Fixed Fee Code": u"DF",
"Determination": u"FINI",
}
invalid_amounts = [40.01, 100]
for amount in invalid_amounts:
test_values["Fixed Fee Amount"] = u"{}".format(amount)
expected_error = u"Row: 1 - The value you have entered exceeds the Fixed Fee"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_df_fixed_fee_negative_amount_fails(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"HRNT",
"Matter Type 2": u"HPRI",
"Stage Reached": u"HA",
"Fixed Fee Code": u"DF",
"Fixed Fee Amount": u"-1",
"Determination": u"FINI",
}
expected_error = u"Row: 1 Field (20 / T): Fixed Fee Amount - Field must be >= 0"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
# TODO enable when Matter Type 1 MSCB added
# @override_settings(CONTRACT_2018_ENABLED=True)
# def test_validator_misc_rate_fixed_fee(self):
# test_values = {"Matter Type 1": u"MSCB", "Fixed Fee Amount": u"", "Fixed Fee Code": u"MR"}
# self._test_generated_2018_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_hwfm_rate_fixed_fee(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"FAMY",
"Matter Type 2": u"FMEC",
"Fixed Fee Amount": u"119.6",
"Fixed Fee Code": u"HM",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_hwfm_rate_fixed_fee_mt1_incorrect(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"FAMZ",
"Matter Type 2": u"FMEC",
"Fixed Fee Amount": u"119.6",
"Fixed Fee Code": u"HM",
}
expected_error = (
u"Row: 1 - The Fixed Fee code you have entered is not valid with the Matter Type 1 Code entered"
)
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_validator_mt1_fixed_fee_code_mismatch(self):
test_values = {
"Matter Type 1": u"FAMY",
"Matter Type 2": u"FMEC",
"Fixed Fee Amount": u"119.6",
"Fixed Fee Code": u"LF",
}
expected_error = u"Row: 1 - The HM fee code should be used where Matter Type 1 Code - FAMY is used"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_hourly_rate_hr_fixed_fee_code(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"DMAP",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"119.6",
"Fixed Fee Code": u"HR",
"Time Spent": u"900",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_eligibility_codes_with_lf_fixed_fee(self):
lf_eligibility_codes = {u"S", u"T", u"V", u"W", u"X", u"Z"}
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Code": u"LF",
}
for eligibility_code in lf_eligibility_codes:
test_values["Eligibility Code"] = eligibility_code
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_eligibility_codes_missing_lf_fixed_fee(self):
lf_eligibility_codes = {u"S", u"W", u"X", u"Z"}
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"65",
"Fixed Fee Code": u"HF",
"Time Spent": u"133",
}
for eligibility_code in lf_eligibility_codes:
test_values["Eligibility Code"] = eligibility_code
expected_error = (
u"Row: 1 - The Fixed Fee code you have entered is not valid with the Eligibility Code entered"
)
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_eligibility_codes_with_hf_fixed_fee(self):
hf_eligibility_codes = {u"T", u"V"}
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Code": u"HF",
"Time Spent": u"133",
}
for eligibility_code in hf_eligibility_codes:
test_values["Eligibility Code"] = eligibility_code
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_eligibility_codes_missing_hf_fixed_fee(self):
lf_eligibility_codes = {u"S", u"W", u"X", u"Z"}
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Amount": u"65",
"Fixed Fee Code": u"HF",
"Time Spent": u"133",
}
for eligibility_code in lf_eligibility_codes:
test_values["Eligibility Code"] = eligibility_code
expected_error = (
u"Row: 1 - The Fixed Fee code you have entered is not valid with the Eligibility Code entered"
)
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_fixed_fee_invalid_error_message(self):
test_values = {
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Code": u"NA",
"Time Spent": u"133",
}
expected_error = u"Row: 1 - The Fixed Fee code you have entered is not valid for this case"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_discrimination_eligibility_codes(self):
code = u"S"
time = u"135"
test_values = {
"Matter Type 1": u"QPRO",
"Matter Type 2": u"QAGE",
"Stage Reached": u"QA",
"Fixed Fee Code": u"NA",
"Eligibility Code": code,
"Time Spent": time,
}
expected_error = u"Row: 1 - The eligibility code ({code}) you have entered is not valid with the time spent ({time}) on this case, please review the eligibility code.".format(
code=code, time=time
)
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_education_eligibility_codes(self):
code = u"Z"
time = u"135"
test_values = {
"Matter Type 1": u"ESEN",
"Matter Type 2": u"ECOL",
"Stage Reached": u"ED",
"Fixed Fee Code": u"NA",
"Eligibility Code": code,
"Time Spent": time,
}
expected_error = u"Row: 1 - The eligibility code ({code}) you have entered is not valid with the time spent ({time}) on this case, please review the eligibility code.".format(
code=code, time=time
)
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_discrimination_fixed_fee_invalid_error_message(self):
test_values = {
"Matter Type 1": u"HHOM",
"Matter Type 2": u"HHLS",
"Stage Reached": u"HB",
"Fixed Fee Amount": u"130",
"Fixed Fee Code": u"HF",
"Time Spent": u"90",
"Date Opened": u"24/07/2018",
"Date Closed": u"17/01/2019",
}
expected_error = u"Row: 1 - Fixed Fee Code NA must be entered for 2013 cases (pre-01/09/18), 2018 Discrimination cases or 2018 Education cases"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_education_fixed_fee_invalid_error_message(self):
test_values = {
"Matter Type 1": u"ESEN",
"Matter Type 2": u"ENUR",
"Stage Reached": u"EA",
"Fixed Fee Amount": u"130",
"Fixed Fee Code": u"HF",
"Time Spent": u"90",
"Date Opened": u"24/09/2018",
"Date Closed": u"17/01/2019",
}
expected_error = u"Row: 1 - Fixed Fee Code NA must be entered for 2013 cases (pre-01/09/18), 2018 Discrimination cases or 2018 Education cases"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_signposting_code(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EA",
"Signposting / Referral": u"OOSC",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_signposting_lrep_code(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EA",
"Signposting / Referral": u"LREP",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_signposting_code_invalid(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EA",
"Signposting / Referral": u"FOO",
"Fixed Fee Code": u"NA",
}
expected_error = (
u"Row: 1 - The Signposting / Referral code you have entered is invalid. Please enter a valid code."
)
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_signposting_code_present_for_outcome_codes(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EB",
"Outcome Code": u"EU",
"Signposting / Referral": u"OOSC",
"Fixed Fee Code": u"NA",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_signposting_code_missing_for_outcome_codes(self):
test_values = {
"Matter Type 1": u"EPRO",
"Matter Type 2": u"ESOS",
"Stage Reached": u"EB",
"Outcome Code": u"EV",
"Signposting / Referral": u"",
}
expected_error = (
u"Row: 1 - A Signposting / Referral reason code must be entered for matters with outcome code EV."
)
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_df_fixed_fee_has_determination_code(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Fixed Fee Code": u"DF",
"Fixed Fee Amount": u"40.0",
"Determination": u"FINI",
}
self._test_generated_contract_row_validates(override=test_values)
@override_settings(CONTRACT_2018_ENABLED=True)
def test_df_fixed_fee_missing_determination_code(self):
test_values = {
"Eligibility Code": u"V",
"Matter Type 1": u"DTOT",
"Matter Type 2": u"DOTH",
"Stage Reached": u"DB",
"Fixed Fee Code": u"DF",
}
expected_error = u"Row: 1 - The Fixed Fee code you have entered is not valid with Determination Code entered"
self._test_generated_2018_contract_row_validate_fails(override=test_values, expected_error=expected_error)
class DependsOnDecoratorTestCase(unittest.TestCase):
def test_method_called(self):
class Test1(object):
@v.depends_on("a", check=v.value_is_truthy)
def do_something(self, d):
return 1
inst = Test1()
self.assertEqual(1, inst.do_something({"a": True}))
def test_method_called_default_check_is_TRUTHY(self):
class Test1(object):
@v.depends_on("a")
def do_something(self, d):
return 1
inst = Test1()
self.assertEqual(1, inst.do_something({"a": True}))
def test_method_not_called(self):
class Test1(object):
@v.depends_on("a", check=v.value_is_falsey)
def do_something(self, d):
return 1
inst = Test1()
self.assertEqual(None, inst.do_something({"a": True}))
| 41.672095
| 183
| 0.61589
| 6,773
| 56,299
| 4.833161
| 0.067179
| 0.03788
| 0.021506
| 0.052788
| 0.823247
| 0.794287
| 0.756957
| 0.708263
| 0.67686
| 0.656514
| 0
| 0.039317
| 0.278975
| 56,299
| 1,350
| 184
| 41.702963
| 0.767103
| 0.006092
| 0
| 0.642623
| 0
| 0
| 0.201344
| 0.000858
| 0
| 0
| 0
| 0.000741
| 0.040164
| 1
| 0.082787
| false
| 0.00082
| 0.013115
| 0.004098
| 0.111475
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 5
|
3417e03c0aa2c4c4cb41cc1a2b92b03790a29956
| 225
|
py
|
Python
|
Nuh/nuh/admin.py
|
Nuh-Help/Web-App
|
b060dae2f2885e80b93c7698d3db0ea39eb124bf
|
[
"Apache-2.0"
] | null | null | null |
Nuh/nuh/admin.py
|
Nuh-Help/Web-App
|
b060dae2f2885e80b93c7698d3db0ea39eb124bf
|
[
"Apache-2.0"
] | null | null | null |
Nuh/nuh/admin.py
|
Nuh-Help/Web-App
|
b060dae2f2885e80b93c7698d3db0ea39eb124bf
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
# Registering custom user from .models and making it capable of being user admin
admin.site.register(User, UserAdmin)
| 32.142857
| 80
| 0.817778
| 34
| 225
| 5.411765
| 0.558824
| 0.108696
| 0.184783
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128889
| 225
| 6
| 81
| 37.5
| 0.938776
| 0.346667
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
344e6721ebe781e59692e26e16093227ed64e135
| 21
|
py
|
Python
|
LIVE/mayapp/sys.py
|
ProgressBG-Python-Course/ProgressBG-VC-Python
|
37f8be60fb73d558ebd9e3c2700c88dcb64e7f4f
|
[
"MIT"
] | null | null | null |
LIVE/mayapp/sys.py
|
ProgressBG-Python-Course/ProgressBG-VC-Python
|
37f8be60fb73d558ebd9e3c2700c88dcb64e7f4f
|
[
"MIT"
] | null | null | null |
LIVE/mayapp/sys.py
|
ProgressBG-Python-Course/ProgressBG-VC-Python
|
37f8be60fb73d558ebd9e3c2700c88dcb64e7f4f
|
[
"MIT"
] | null | null | null |
print("sys.py fired")
| 21
| 21
| 0.714286
| 4
| 21
| 3.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047619
| 21
| 1
| 21
| 21
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 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
| 1
|
0
| 5
|
345c38fa7b0568e6ccccc44a8b954523cee743e7
| 199
|
py
|
Python
|
store/urls.py
|
Jeffmusa/smartFridge
|
89c5dfca68ca80a36c062aa1bb195e6cf8f1a10f
|
[
"MIT"
] | null | null | null |
store/urls.py
|
Jeffmusa/smartFridge
|
89c5dfca68ca80a36c062aa1bb195e6cf8f1a10f
|
[
"MIT"
] | null | null | null |
store/urls.py
|
Jeffmusa/smartFridge
|
89c5dfca68ca80a36c062aa1bb195e6cf8f1a10f
|
[
"MIT"
] | null | null | null |
from django.conf.urls import url,include
from . import views as d
from django.conf.urls.static import static
from django.conf import settings
urlpatterns=[
url(r'^$',d.store,name='store'),
]
| 16.583333
| 42
| 0.733668
| 31
| 199
| 4.709677
| 0.516129
| 0.205479
| 0.287671
| 0.246575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145729
| 199
| 11
| 43
| 18.090909
| 0.858824
| 0
| 0
| 0
| 0
| 0
| 0.035176
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.571429
| 0
| 0.571429
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
cab5003260a0d9585170be6d5d2925c36898815d
| 7,687
|
py
|
Python
|
tetra/dos.py
|
tflovorn/tetra
|
c5a1e1938f8720c9023b45a7a001220a3e06fa1d
|
[
"MIT"
] | 10
|
2018-03-30T19:56:45.000Z
|
2021-12-29T13:53:26.000Z
|
tetra/dos.py
|
tflovorn/tetra
|
c5a1e1938f8720c9023b45a7a001220a3e06fa1d
|
[
"MIT"
] | null | null | null |
tetra/dos.py
|
tflovorn/tetra
|
c5a1e1938f8720c9023b45a7a001220a3e06fa1d
|
[
"MIT"
] | 2
|
2018-03-30T19:57:08.000Z
|
2022-01-26T22:31:35.000Z
|
from multiprocessing import Pool
import numpy as np
from tetra.ksample import OptimizeGs, MakeEks
from tetra.submesh import MakeSubmesh, MakeTetra
from tetra.fermi import _minimum_E, _maximum_E
from tetra.numstates import _tetra_Es
def DosValues_AllE(num_Es, n, Efn, R):
'''Return a list of D(E) values giving the density of states at energy E
summed over all tetrahedra and band indices; E ranges over num_Es equally
spaced values from the minimum energy eigenvalue to the maximum energy
eigenvalue.
Also returns the list of energy values used and lists of tetrahedra and
E(k) values so that these can be used in further calculations (such as
FindFermi()).
The calculation of D(E) is implemented as described in BJA94 Appendix C.
n = Brillouin zone submesh density (the total number of k-points sampled
is (n+1)**3).
Efn = a function E(k) which returns a list of the band energies at the
Brillouin zone point k, with the returned list sorted in ascending order;
k is expressed in the reciprocal lattice basis.
R = a numpy matrix with rows given by the reciprocal lattice vectors.
'''
# Get E(k) values and tetras.
tetras, Eks = _dos_setup(n, Efn, R)
Emin, Emax = _minimum_E(Eks), _maximum_E(Eks)
# Get D(E) values.
E_vals = np.linspace(Emin, Emax, num_Es)
dos_args, dos_vals = [], None
for E in E_vals:
dos_args.append([E, tetras, Eks])
with Pool() as pool:
dos_vals = pool.starmap(Dos, dos_args)
return dos_vals, E_vals, tetras, Eks
def DosValues(Emin, Emax, num_Es, n, Efn, R):
'''Return a list of D(E) values giving the density of states at energy E
summed over all tetrahedra and band indices; E ranges over num_Es equally
spaced values from Emin to Emax.
Also returns the list of energy values used and lists of tetrahedra and
E(k) values so that these can be used in further calculations (such as
FindFermi()).
The calculation of D(E) is implemented as described in BJA94 Appendix C.
n = Brillouin zone submesh density (the total number of k-points sampled
is (n+1)**3).
Efn = a function E(k) which returns a list of the band energies at the
Brillouin zone point k, with the returned list sorted in ascending order;
k is expressed in the reciprocal lattice basis.
R = a numpy matrix with rows given by the reciprocal lattice vectors.
'''
tetras, Eks = _dos_setup(n, Efn, R)
# Get D(E) values.
E_vals = np.linspace(Emin, Emax, num_Es)
dos_vals = []
for E in E_vals:
dos_vals.append(Dos(E, tetras, Eks))
return dos_vals, E_vals, tetras, Eks
def _dos_setup(n, Efn, R):
# Get optimal reciprocal lattice orientation.
G_order, G_neg = OptimizeGs(R)
# Generate submesh and tetrahedra.
submesh = MakeSubmesh(n)
tetras = MakeTetra(n)
# Sample E(k).
Eks = MakeEks(Efn, submesh, G_order, G_neg)
return tetras, Eks
def DosValuesPerBand(Emin, Emax, num_Es, n, Efn, R):
'''Return a list of D_i(E) values giving the density of states at energy E
summed over all tetrahedra separated by band index i; E ranges over num_Es
equally spaced values from Emin to Emax.
Also returns the list of energy values used and lists of tetrahedra and
E(k) values so that these can be used in further calculations (such as
FindFermi()).
The calculation of D(E) is implemented as described in BJA94 Appendix C.
n = Brillouin zone submesh density (the total number of k-points sampled
is (n+1)**3).
Efn = a function E(k) which returns a list of the band energies at the
Brillouin zone point k, with the returned list sorted in ascending order;
k is expressed in the reciprocal lattice basis.
R = a numpy matrix with rows given by the reciprocal lattice vectors.
'''
tetras, Eks = _dos_setup(n, Efn, R)
# Get D(E) values.
E_vals = np.linspace(Emin, Emax, num_Es)
dos_vals = []
for E in E_vals:
dos_vals.append(DosPerBand(E, tetras, Eks))
return dos_vals, E_vals, tetras, Eks
def DosPerBand(E, tetras, Eks):
'''Return a list with elements D_i(E), the density of states at energy E
summed over all tetrahedra separated by band index i.
The calculation of D_T(E) is implemented as described in BJA94 Appendix C.
tetras = a list of tuples of the form (kN1, kN2, kN3, kN4) denoting the
vertices of tetrahedra to include in the summation, where the kN's are
indices of submesh (i.e. submesh[kN1] = k1, etc.). The tetrahedra must be
constructed as described in BJA94 Section III.
Eks = a list in which each element is a sorted list of eigenstate energies
E_n(k), with k being the k-point at the corresponding element of submesh
(i.e. Eks[kN][band_index] = E_n(k)).
'''
num_bands = len(Eks[0])
num_tetra = len(tetras)
Dis = [0.0]*num_bands
for tet in tetras:
for band_index in range(num_bands):
Dis[band_index] += DosContrib(E, tet, num_tetra, Eks, band_index)
return Dis
def Dos(E, tetras, Eks):
'''Return D(E), the density of states at energy E summed over all
tetrahedra and band indices.
The calculation of D_T(E) is implemented as described in BJA94 Appendix C.
tetras = a list of tuples of the form (kN1, kN2, kN3, kN4) denoting the
vertices of tetrahedra to include in the summation, where the kN's are
indices of submesh (i.e. submesh[kN1] = k1, etc.). The tetrahedra must be
constructed as described in BJA94 Section III.
Eks = a list in which each element is a sorted list of eigenstate energies
E_n(k), with k being the k-point at the corresponding element of submesh
(i.e. Eks[kN][band_index] = E_n(k)).
'''
num_bands = len(Eks[0])
num_tetra = len(tetras)
D = 0.0
for tet in tetras:
for band_index in range(num_bands):
D += DosContrib(E, tet, num_tetra, Eks, band_index)
return D
def DosContrib(E, tetra, num_tetra, Eks, band_index):
'''Return the contribution to the density of states at energy E from the
specified band index and tetrahedron.
The calculation of D_T(E) is implemented as described in BJA94 Appendix C.
tetra = a tuple of the form (kN1, kN2, kN3, kN4) denoting the
vertices of a tetrahedron to include in the Brillouin zone summation,
where the kN's are indices of submesh (i.e. submesh[kN1] = k1, etc.).
The tetrahedra must be constructed as described in BJA94 Section III.
num_tetra = total number of tetrahedra in the full Brillouin zone.
Equal to (volume of tetrahedron) / (volume of full BZ).
Eks = a list in which each element is a sorted list of eigenstate energies
E_n(k), with k being the k-point at the corresponding element of submesh
(i.e. Eks[kN][band_index] = E_n(k)).
band_index = the band index n to consider, corresponding to n in E_n(k).
'''
E1, E2, E3, E4 = _tetra_Es(tetra, band_index, Eks)
if E <= E1:
return 0.0
elif E1 <= E <= E2:
if E1 == E2:
return 0.0
return (1/num_tetra) * 3*(E - E1)**2/((E2 - E1)*(E3 - E1)*(E4 - E1))
elif E2 <= E <= E3:
if E2 == E3:
return (1.0 / num_tetra) * 3.0 * (E2 - E1) / ((E3 - E1) * (E4 - E1))
fac = (1/num_tetra) / ((E3 - E1)*(E4 - E1))
elin = 3*(E2 - E1) + 6*(E - E2)
esq = -3*(((E3 - E1) + (E4 - E2))/((E3 - E2)*(E4 - E2))) * (E - E2)**2
return fac * (elin + esq)
elif E3 <= E <= E4:
if E3 == E4:
return 0.0
return (1/num_tetra) * 3*(E4 - E)**2/((E4 - E1)*(E4 - E2)*(E4 - E3))
else:
# E >= E4
return 0.0
| 39.623711
| 80
| 0.664629
| 1,276
| 7,687
| 3.931034
| 0.140282
| 0.026914
| 0.023325
| 0.032297
| 0.774123
| 0.76256
| 0.746611
| 0.736842
| 0.721292
| 0.705343
| 0
| 0.021608
| 0.247431
| 7,687
| 193
| 81
| 39.829016
| 0.845462
| 0.602576
| 0
| 0.356164
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.09589
| false
| 0
| 0.082192
| 0
| 0.369863
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
caf13a7c7708852198d3ebf8e4b6c21c7e40292e
| 55
|
py
|
Python
|
shiva/lyrics/__init__.py
|
tooxie/shiva-server
|
4d169aae8d4cb01133f62701b14610695e48c297
|
[
"MIT"
] | 70
|
2015-01-09T15:15:15.000Z
|
2022-01-14T09:51:55.000Z
|
shiva/lyrics/__init__.py
|
thinkbox/shiva-server
|
2407650f365806debc892471e9d59ec1bc67f9d4
|
[
"MIT"
] | 14
|
2015-01-04T10:08:26.000Z
|
2021-12-13T19:35:07.000Z
|
shiva/lyrics/__init__.py
|
thinkbox/shiva-server
|
2407650f365806debc892471e9d59ec1bc67f9d4
|
[
"MIT"
] | 19
|
2015-01-02T22:42:01.000Z
|
2022-01-14T09:51:59.000Z
|
from shiva.lyrics.base import get_lyrics, LyricScraper
| 27.5
| 54
| 0.854545
| 8
| 55
| 5.75
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 55
| 1
| 55
| 55
| 0.92
| 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
| 1
| 0
|
0
| 5
|
cafbe4cc263bda7af456530c160abd3cebf69240
| 83
|
py
|
Python
|
gifusion_back/key.py
|
Piwit/gifusion
|
f3f9b56dab444ada705856dfeb568ac476f8ee9c
|
[
"MIT"
] | 1
|
2019-11-05T18:07:24.000Z
|
2019-11-05T18:07:24.000Z
|
gifusion_back/key.py
|
Piwit/gifusion
|
f3f9b56dab444ada705856dfeb568ac476f8ee9c
|
[
"MIT"
] | 1
|
2021-06-02T00:38:02.000Z
|
2021-06-02T00:38:02.000Z
|
gifusion_back/key.py
|
Piwit/gifusion
|
f3f9b56dab444ada705856dfeb568ac476f8ee9c
|
[
"MIT"
] | null | null | null |
import os
GIPHY_KEY = os.environ['GIPHY_KEY']
TENOR_KEY = os.environ['TENOR_KEY']
| 16.6
| 35
| 0.746988
| 14
| 83
| 4.142857
| 0.428571
| 0.275862
| 0.413793
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108434
| 83
| 4
| 36
| 20.75
| 0.783784
| 0
| 0
| 0
| 0
| 0
| 0.216867
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 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
| 1
| 0
| 0
| 0
|
0
| 5
|
1b3ea22336dc5979e0cd25f95117370dccdc6c6b
| 125
|
py
|
Python
|
targpg/__init__.py
|
spslater/targpg
|
1b9dcd53f3127f400ec9e873e210be1c0ddfe02a
|
[
"MIT"
] | null | null | null |
targpg/__init__.py
|
spslater/targpg
|
1b9dcd53f3127f400ec9e873e210be1c0ddfe02a
|
[
"MIT"
] | 4
|
2021-11-01T05:15:06.000Z
|
2021-11-01T05:22:32.000Z
|
targpg/__init__.py
|
spslater/targpg
|
1b9dcd53f3127f400ec9e873e210be1c0ddfe02a
|
[
"MIT"
] | null | null | null |
"""Targpg - secure a compressed tarfile with gpg password"""
from .targpg import *
from .meta import *
from .parser import *
| 25
| 60
| 0.728
| 17
| 125
| 5.352941
| 0.705882
| 0.21978
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168
| 125
| 4
| 61
| 31.25
| 0.875
| 0.432
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1b4d1146b549ddf46c548afa421ffb31143d5dd9
| 132
|
py
|
Python
|
strongr/clouddomain/command/__init__.py
|
bigr-erasmusmc/StrongR
|
48573e170771a251f629f2d13dba7173f010a38c
|
[
"Apache-2.0"
] | null | null | null |
strongr/clouddomain/command/__init__.py
|
bigr-erasmusmc/StrongR
|
48573e170771a251f629f2d13dba7173f010a38c
|
[
"Apache-2.0"
] | null | null | null |
strongr/clouddomain/command/__init__.py
|
bigr-erasmusmc/StrongR
|
48573e170771a251f629f2d13dba7173f010a38c
|
[
"Apache-2.0"
] | null | null | null |
from .runjob import RunJob
from .deployvms import DeployVms
from .destroyvms import DestroyVms
from .jobfinished import JobFinished
| 26.4
| 36
| 0.848485
| 16
| 132
| 7
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 132
| 4
| 37
| 33
| 0.965517
| 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
| 1
| 0
|
0
| 5
|
1b615289f8276081ff1164f4031bb84c0ce614c9
| 183
|
py
|
Python
|
fython/test/imp.py
|
nicolasessisbreton/fython
|
988f5a94cee8b16b0000501a22239195c73424a1
|
[
"Apache-2.0"
] | 41
|
2016-01-21T05:14:45.000Z
|
2021-11-24T20:37:21.000Z
|
fython/test/imp.py
|
nicolasessisbreton/fython
|
988f5a94cee8b16b0000501a22239195c73424a1
|
[
"Apache-2.0"
] | 5
|
2016-01-21T05:36:37.000Z
|
2016-08-22T19:26:51.000Z
|
fython/test/imp.py
|
nicolasessisbreton/fython
|
988f5a94cee8b16b0000501a22239195c73424a1
|
[
"Apache-2.0"
] | 3
|
2016-01-23T04:03:44.000Z
|
2016-08-21T15:58:38.000Z
|
from importlib import import_module
from fython.config import *
def imp(url):
url = Url(
url = url,
cwd = get_frame_dir(1),
ext = exts.py,
)
return import_module(url.dotted)
| 18.3
| 35
| 0.704918
| 29
| 183
| 4.310345
| 0.655172
| 0.192
| 0.216
| 0.192
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006711
| 0.185792
| 183
| 10
| 36
| 18.3
| 0.832215
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| false
| 0
| 0.333333
| 0
| 0.555556
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1b697b89664b45825603ded310bc1eabda882931
| 952
|
py
|
Python
|
cd_core/datasets/pipelines/transformers.py
|
shinianzhihou/change_detection.pytorch
|
e365eb1d97ebbce400ffc4230ac0fa063638fe05
|
[
"Apache-2.0"
] | 1
|
2021-02-12T16:29:08.000Z
|
2021-02-12T16:29:08.000Z
|
cd_core/datasets/pipelines/transformers.py
|
shinianzhihou/change_detection.pytorch
|
e365eb1d97ebbce400ffc4230ac0fa063638fe05
|
[
"Apache-2.0"
] | null | null | null |
cd_core/datasets/pipelines/transformers.py
|
shinianzhihou/change_detection.pytorch
|
e365eb1d97ebbce400ffc4230ac0fa063638fe05
|
[
"Apache-2.0"
] | null | null | null |
import random
from torchvision import transforms
from torchvision.transforms import functional as tvF
from ..builder import PIPELINES
# TODO(snian) add more transformers
# @PIPELINES.register_module()
# class ToTensor(transforms.ToTensor):
# def __call__(self,pics):
# return [tvF.to_tensor(pic) for pic in pics]
# @PIPELINES.register_module()
# class ToPILImage(transforms.ToPILImage):
# def __call__(self,imgs):
# return [tvF.to_pil_image(img,self.mode) for img in imgs]
# @PIPELINES.register_module()
# class RandomHorizontalFlip(transforms.RandomHorizontalFlip):
# def __call__(self,imgs):
# if random.random() < self.p:
# return [tvF.hflip(img) for img in imgs]
# return imgs
# @PIPELINES.register_module()
# class RandomVerticalFlip(transforms.RandomVerticalFlip):
# def __call__(self,imgs):
# if random.random() < self.p:
# return [tvF.vflip(img) for img in imgs]
# return imgs
| 27.2
| 62
| 0.714286
| 117
| 952
| 5.615385
| 0.350427
| 0.103501
| 0.14003
| 0.170472
| 0.298326
| 0.207002
| 0.207002
| 0.130898
| 0.130898
| 0.130898
| 0
| 0
| 0.172269
| 952
| 34
| 63
| 28
| 0.833756
| 0.789916
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029412
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1b6fca9f6264f0b9a42c1b9b51d9872802f713e0
| 34
|
py
|
Python
|
config.py
|
ericpiper/beerapplication
|
19350f16f552eb64ac455b08a6a1b712e1e3735c
|
[
"CC0-1.0"
] | null | null | null |
config.py
|
ericpiper/beerapplication
|
19350f16f552eb64ac455b08a6a1b712e1e3735c
|
[
"CC0-1.0"
] | null | null | null |
config.py
|
ericpiper/beerapplication
|
19350f16f552eb64ac455b08a6a1b712e1e3735c
|
[
"CC0-1.0"
] | null | null | null |
pw = "YOUR POSTGRES PASSWORD HERE"
| 34
| 34
| 0.764706
| 5
| 34
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 34
| 1
| 34
| 34
| 0.896552
| 0
| 0
| 0
| 0
| 0
| 0.771429
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 1
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
1b7751b8318b9aa3319a0f134bea1f449242e38a
| 61
|
py
|
Python
|
BatchLabelMap/automatic/pydicom/overlays/__init__.py
|
weras2/BatchLabelMap
|
56af3d20df79f6b10a5d932278a33d02020d1e59
|
[
"MIT"
] | null | null | null |
BatchLabelMap/automatic/pydicom/overlays/__init__.py
|
weras2/BatchLabelMap
|
56af3d20df79f6b10a5d932278a33d02020d1e59
|
[
"MIT"
] | 1
|
2020-11-26T19:53:16.000Z
|
2020-11-26T19:53:16.000Z
|
BatchLabelMap/automatic/pydicom/overlays/__init__.py
|
weras2/BatchLabelMap
|
56af3d20df79f6b10a5d932278a33d02020d1e59
|
[
"MIT"
] | null | null | null |
from pydicom.overlays.numpy_handler import get_overlay_array
| 30.5
| 60
| 0.901639
| 9
| 61
| 5.777778
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065574
| 61
| 1
| 61
| 61
| 0.912281
| 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
| 1
| 0
|
0
| 5
|
1b7f54e93286aa5aa08b38c824ed45bd00007e31
| 90
|
py
|
Python
|
Transformers-from-scratch/tfb/__init__.py
|
shreyansh26/DL-Code-Repository
|
f1974eedc1fef54b2d274703390a22721e46f502
|
[
"MIT"
] | null | null | null |
Transformers-from-scratch/tfb/__init__.py
|
shreyansh26/DL-Code-Repository
|
f1974eedc1fef54b2d274703390a22721e46f502
|
[
"MIT"
] | null | null | null |
Transformers-from-scratch/tfb/__init__.py
|
shreyansh26/DL-Code-Repository
|
f1974eedc1fef54b2d274703390a22721e46f502
|
[
"MIT"
] | null | null | null |
from .modules import SelfAttention
from .transformer import GTransformer, CTransformer
| 22.5
| 51
| 0.833333
| 9
| 90
| 8.333333
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 90
| 4
| 51
| 22.5
| 0.961538
| 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
| 1
| 0
|
0
| 5
|
1b898c28f525b026700556aac6c70ef8f5552d5d
| 82
|
py
|
Python
|
mvvm/mvvm/models/entities/note.py
|
2110521-2563-1-Software-Architecture/four-guys-one-cup-assignment3
|
fb771f7521a15aea5c5b563ff87dbcd83edbec77
|
[
"MIT"
] | null | null | null |
mvvm/mvvm/models/entities/note.py
|
2110521-2563-1-Software-Architecture/four-guys-one-cup-assignment3
|
fb771f7521a15aea5c5b563ff87dbcd83edbec77
|
[
"MIT"
] | null | null | null |
mvvm/mvvm/models/entities/note.py
|
2110521-2563-1-Software-Architecture/four-guys-one-cup-assignment3
|
fb771f7521a15aea5c5b563ff87dbcd83edbec77
|
[
"MIT"
] | null | null | null |
class Note:
def __init__(self, content: str):
self.content = content
| 16.4
| 37
| 0.634146
| 10
| 82
| 4.8
| 0.7
| 0.458333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.268293
| 82
| 4
| 38
| 20.5
| 0.8
| 0
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
1bda578752d521fc558317c2fa8f437052ee7f21
| 165
|
py
|
Python
|
scripts/rewards/polygon/approve_polygon.py
|
gosuto-ai/badger-rewards
|
45a7cefce2035bc385bebf5f103780c7ff614304
|
[
"MIT"
] | 3
|
2022-01-05T20:33:35.000Z
|
2022-02-09T16:07:30.000Z
|
scripts/rewards/polygon/approve_polygon.py
|
gosuto-ai/badger-rewards
|
45a7cefce2035bc385bebf5f103780c7ff614304
|
[
"MIT"
] | 341
|
2021-08-04T13:01:21.000Z
|
2022-03-31T19:46:30.000Z
|
scripts/rewards/polygon/approve_polygon.py
|
gosuto-ai/badger-rewards
|
45a7cefce2035bc385bebf5f103780c7ff614304
|
[
"MIT"
] | 3
|
2021-09-07T12:54:27.000Z
|
2021-12-22T13:27:23.000Z
|
from helpers.enums import Network
from scripts.rewards.utils.approve_rewards import approve_rewards
if __name__ == "__main__":
approve_rewards(Network.Polygon)
| 27.5
| 65
| 0.818182
| 21
| 165
| 5.904762
| 0.619048
| 0.33871
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109091
| 165
| 5
| 66
| 33
| 0.843537
| 0
| 0
| 0
| 0
| 0
| 0.048485
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
59fb6e1a0a1d0b6cd803ca0a4d7f32ceeb353bb3
| 63
|
py
|
Python
|
pymongo_smart_auth/__init__.py
|
PLPeeters/PyMongo-Smart-Auth
|
41bfd16cfa9338f03214d4c9488f6190a14628ae
|
[
"MIT"
] | 1
|
2017-06-02T07:58:41.000Z
|
2017-06-02T07:58:41.000Z
|
pymongo_smart_auth/__init__.py
|
PLPeeters/PyMongo-Smart-Auth
|
41bfd16cfa9338f03214d4c9488f6190a14628ae
|
[
"MIT"
] | null | null | null |
pymongo_smart_auth/__init__.py
|
PLPeeters/PyMongo-Smart-Auth
|
41bfd16cfa9338f03214d4c9488f6190a14628ae
|
[
"MIT"
] | null | null | null |
from pymongo_smart_auth.MongoConnection import MongoConnection
| 31.5
| 62
| 0.920635
| 7
| 63
| 8
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.063492
| 63
| 1
| 63
| 63
| 0.949153
| 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
| 1
| 0
|
0
| 5
|
940432f56eda8624b9f94ece7b7d6926c730b945
| 57
|
py
|
Python
|
services/Telegram-bot/config.py
|
vadimkholodilo/COVID_19_bot
|
0021ee5604ddd7fa10ea16babcd6470e3a393705
|
[
"MIT"
] | null | null | null |
services/Telegram-bot/config.py
|
vadimkholodilo/COVID_19_bot
|
0021ee5604ddd7fa10ea16babcd6470e3a393705
|
[
"MIT"
] | null | null | null |
services/Telegram-bot/config.py
|
vadimkholodilo/COVID_19_bot
|
0021ee5604ddd7fa10ea16babcd6470e3a393705
|
[
"MIT"
] | null | null | null |
token = "1250452288:AAF96rdBNqy9MPM_DO-k_foif_ZicW9yEls"
| 28.5
| 56
| 0.859649
| 7
| 57
| 6.571429
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.259259
| 0.052632
| 57
| 1
| 57
| 57
| 0.592593
| 0
| 0
| 0
| 0
| 0
| 0.807018
| 0.807018
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
940ad9f8fcfdb34016a473dbb080610cb5c8fafc
| 97
|
py
|
Python
|
localstack/utils/generic/singleton_utils.py
|
matt-mercer/localstack
|
b69ba25e495c6ef889d33a050b216d0cd1035041
|
[
"Apache-2.0"
] | 1
|
2022-03-17T07:22:23.000Z
|
2022-03-17T07:22:23.000Z
|
localstack/utils/generic/singleton_utils.py
|
matt-mercer/localstack
|
b69ba25e495c6ef889d33a050b216d0cd1035041
|
[
"Apache-2.0"
] | null | null | null |
localstack/utils/generic/singleton_utils.py
|
matt-mercer/localstack
|
b69ba25e495c6ef889d33a050b216d0cd1035041
|
[
"Apache-2.0"
] | null | null | null |
# DEPRECATED: use localstack.utils.objects
from ..objects import SubtypesInstanceManager # noqa
| 32.333333
| 53
| 0.814433
| 10
| 97
| 7.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113402
| 97
| 2
| 54
| 48.5
| 0.918605
| 0.463918
| 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
| 1
| 0
|
0
| 5
|
940e11770793512a67a62b81179b26dc7892efcb
| 103
|
py
|
Python
|
src/pricecypher/collections/__init__.py
|
marketredesign/pricecypher_python_api
|
613818da8c5e87e99c45dcee710a839169135a8f
|
[
"MIT"
] | null | null | null |
src/pricecypher/collections/__init__.py
|
marketredesign/pricecypher_python_api
|
613818da8c5e87e99c45dcee710a839169135a8f
|
[
"MIT"
] | null | null | null |
src/pricecypher/collections/__init__.py
|
marketredesign/pricecypher_python_api
|
613818da8c5e87e99c45dcee710a839169135a8f
|
[
"MIT"
] | null | null | null |
from .scope_collection import ScopeCollection
from .scope_value_collection import ScopeValueCollection
| 34.333333
| 56
| 0.902913
| 11
| 103
| 8.181818
| 0.636364
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07767
| 103
| 2
| 57
| 51.5
| 0.947368
| 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
| 1
| 0
|
0
| 5
|
94257f0386e8daf5627d2ac31b01b3424d479dd2
| 1,067
|
py
|
Python
|
src/isle/meas/__init__.py
|
chelseajohn/isle
|
f610b55a1e8b6d2584896eb649092b0524cc1f8c
|
[
"MIT"
] | 2
|
2021-01-14T17:47:01.000Z
|
2021-07-16T22:31:25.000Z
|
src/isle/meas/__init__.py
|
chelseajohn/isle
|
f610b55a1e8b6d2584896eb649092b0524cc1f8c
|
[
"MIT"
] | 21
|
2018-06-04T07:09:02.000Z
|
2020-12-11T09:37:08.000Z
|
src/isle/meas/__init__.py
|
chelseajohn/isle
|
f610b55a1e8b6d2584896eb649092b0524cc1f8c
|
[
"MIT"
] | 3
|
2021-01-18T19:18:29.000Z
|
2021-03-26T03:27:15.000Z
|
"""!
General measurements that can be useful in various contexts.
"""
## \defgroup meas Measurements
# Perform measurements on configurations.
from .chiralCondensate import ChiralCondensate # (unused import) pylint: disable=W0611
from .collectWeights import CollectWeights # (unused import) pylint: disable=W0611
from .determinantCorrelators import DeterminantCorrelators # (unused import) pylint: disable=W0611
from .logdet import Logdet # (unused import) pylint: disable=W0611
from .measurement import Measurement # (unused import) pylint: disable=W0611
from .onePointFunctions import OnePointFunctions # (unused import) pylint: disable=W0611
from .polyakov import Polyakov # (unused import) pylint: disable=W0611
from .propagator import AllToAll # (unused import) pylint: disable=W0611
from .singleParticleCorrelator import SingleParticleCorrelator # (unused import) pylint: disable=W0611
from .spinSpinCorrelator import SpinSpinCorrelator # (unused import) pylint: disable=W0611
from .totalPhi import TotalPhi # (unused import) pylint: disable=W0611
| 56.157895
| 103
| 0.802249
| 115
| 1,067
| 7.443478
| 0.278261
| 0.154206
| 0.231308
| 0.321262
| 0.432243
| 0.397196
| 0
| 0
| 0
| 0
| 0
| 0.047059
| 0.123711
| 1,067
| 18
| 104
| 59.277778
| 0.868449
| 0.514527
| 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
| 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
| 5
|
9448d1b467d2b4d42ee501b7c462a28e9cad0f37
| 65
|
py
|
Python
|
chai/python2.py
|
paolostivanin/chai
|
066fba05fcab35bf08fc87b388482ebc0ab0ccb9
|
[
"BSD-3-Clause"
] | 14
|
2015-02-12T03:22:35.000Z
|
2020-06-03T15:13:43.000Z
|
chai/python2.py
|
paolostivanin/chai
|
066fba05fcab35bf08fc87b388482ebc0ab0ccb9
|
[
"BSD-3-Clause"
] | 10
|
2015-01-16T21:32:00.000Z
|
2021-12-31T09:39:59.000Z
|
chai/python2.py
|
paolostivanin/chai
|
066fba05fcab35bf08fc87b388482ebc0ab0ccb9
|
[
"BSD-3-Clause"
] | 8
|
2015-01-20T11:48:52.000Z
|
2020-04-30T11:25:24.000Z
|
def reraise(exc, msg, traceback):
raise exc, msg, traceback
| 16.25
| 33
| 0.692308
| 9
| 65
| 5
| 0.666667
| 0.266667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 65
| 3
| 34
| 21.666667
| 0.865385
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
84676fb45437f287e05424494281ae5651f5e863
| 46
|
py
|
Python
|
src/discovery/disc_exceptions.py
|
biswajit-mandal/contrail-controller
|
80c4a7e8515f7296b18ba4c21a439bd3daefcc4a
|
[
"Apache-2.0"
] | 5
|
2015-01-08T17:34:41.000Z
|
2017-09-28T16:00:25.000Z
|
src/discovery/disc_exceptions.py
|
biswajit-mandal/contrail-controller
|
80c4a7e8515f7296b18ba4c21a439bd3daefcc4a
|
[
"Apache-2.0"
] | null | null | null |
src/discovery/disc_exceptions.py
|
biswajit-mandal/contrail-controller
|
80c4a7e8515f7296b18ba4c21a439bd3daefcc4a
|
[
"Apache-2.0"
] | 18
|
2017-01-12T09:28:44.000Z
|
2019-04-18T20:47:42.000Z
|
class ServiceUnavailable(Exception):
pass
| 15.333333
| 36
| 0.782609
| 4
| 46
| 9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152174
| 46
| 2
| 37
| 23
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 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
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
8492c43b43c798fce030a921360eb11b26a6667d
| 1,907
|
py
|
Python
|
tests/meta.py
|
bigmlcom/slumber
|
b5f7f4e9524a8ef170a403b523b23fc614ae7579
|
[
"BSD-2-Clause"
] | null | null | null |
tests/meta.py
|
bigmlcom/slumber
|
b5f7f4e9524a8ef170a403b523b23fc614ae7579
|
[
"BSD-2-Clause"
] | null | null | null |
tests/meta.py
|
bigmlcom/slumber
|
b5f7f4e9524a8ef170a403b523b23fc614ae7579
|
[
"BSD-2-Clause"
] | null | null | null |
import unittest
import slumber
class MetaTestCase(unittest.TestCase):
def test_init_kwargs_to_attributes(self):
m = slumber.Meta(item1="test", item2=41, item3="example")
self.assertEqual(m.item1, "test")
self.assertEqual(m.item2, 41)
self.assertEqual(m.item3, "example")
class MetaMixinTestCase(unittest.TestCase):
def test_init_kwargs_to_meta(self):
class MetaMixinTest(slumber.MetaMixin, object):
class Meta:
item1 = None
item2 = None
item3 = None
mmt = MetaMixinTest(item1="test", item2=41, item3="example")
self.assertTrue(hasattr(mmt, "_meta"))
self.assertTrue(isinstance(mmt._meta, slumber.Meta))
self.assertEqual(mmt._meta.item1, "test")
self.assertEqual(mmt._meta.item2, 41)
self.assertEqual(mmt._meta.item3, "example")
def test_meta_to_meta_defaults(self):
class MetaMixinTest(slumber.MetaMixin, object):
class Meta:
item1 = None
item2 = None
item3 = None
mmt = MetaMixinTest()
self.assertTrue(hasattr(mmt, "_meta"))
self.assertTrue(isinstance(mmt._meta, slumber.Meta))
self.assertEqual(mmt._meta.item1, None)
self.assertEqual(mmt._meta.item2, None)
self.assertEqual(mmt._meta.item3, None)
def test_meta_to_meta_defaults_with_init_kwargs(self):
class MetaMixinTest(slumber.MetaMixin, object):
class Meta:
item1 = None
item2 = None
item3 = None
mmt = MetaMixinTest(item2=41)
self.assertTrue(hasattr(mmt, "_meta"))
self.assertTrue(isinstance(mmt._meta, slumber.Meta))
self.assertEqual(mmt._meta.item1, None)
self.assertEqual(mmt._meta.item2, 41)
self.assertEqual(mmt._meta.item3, None)
| 29.796875
| 68
| 0.618249
| 210
| 1,907
| 5.452381
| 0.152381
| 0.091703
| 0.141485
| 0.172926
| 0.825328
| 0.821834
| 0.747598
| 0.634061
| 0.634061
| 0.634061
| 0
| 0.028923
| 0.274777
| 1,907
| 63
| 69
| 30.269841
| 0.798988
| 0
| 0
| 0.6
| 0
| 0
| 0.030939
| 0
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0.088889
| false
| 0
| 0.044444
| 0
| 0.311111
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 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
| 5
|
849b95f399a56e4599f27c23529b8c0adb8aea2d
| 24
|
py
|
Python
|
labml/__init__.py
|
adrien1018/labml
|
90068255149eca8cc26867e7b0a54012c2078a20
|
[
"MIT"
] | null | null | null |
labml/__init__.py
|
adrien1018/labml
|
90068255149eca8cc26867e7b0a54012c2078a20
|
[
"MIT"
] | null | null | null |
labml/__init__.py
|
adrien1018/labml
|
90068255149eca8cc26867e7b0a54012c2078a20
|
[
"MIT"
] | null | null | null |
__version__ = '0.4.119'
| 12
| 23
| 0.666667
| 4
| 24
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.238095
| 0.125
| 24
| 1
| 24
| 24
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0.291667
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
84a753c06c16763a5106698a1f7760a010758b3a
| 70
|
py
|
Python
|
flags/forms.py
|
9dev/django-flags
|
b4553ebd3f7750594da5abac4d73b6bc15c6bc30
|
[
"MIT"
] | null | null | null |
flags/forms.py
|
9dev/django-flags
|
b4553ebd3f7750594da5abac4d73b6bc15c6bc30
|
[
"MIT"
] | null | null | null |
flags/forms.py
|
9dev/django-flags
|
b4553ebd3f7750594da5abac4d73b6bc15c6bc30
|
[
"MIT"
] | null | null | null |
from django import forms
class FlagCreateForm(forms.Form):
pass
| 11.666667
| 33
| 0.757143
| 9
| 70
| 5.888889
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.185714
| 70
| 5
| 34
| 14
| 0.929825
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 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
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
84ac9a48e349c6139ec3eee865e01a2385c24d35
| 230
|
py
|
Python
|
recursive2.py
|
Jiar/python3-test
|
028b5382b6604458c741b507831832327afba422
|
[
"MIT"
] | null | null | null |
recursive2.py
|
Jiar/python3-test
|
028b5382b6604458c741b507831832327afba422
|
[
"MIT"
] | null | null | null |
recursive2.py
|
Jiar/python3-test
|
028b5382b6604458c741b507831832327afba422
|
[
"MIT"
] | null | null | null |
#!git python3
# -*- coding: utf-8 -*-
def fact(n):
return fact_iter(n, 1)
def fact_iter(num, product):
if num == 1:
return product
return fact_iter(num - 1, num * product)
# 栈溢出 python没有针对尾递归进行优化
print(fact_iter(1000, 1))
| 17.692308
| 41
| 0.669565
| 37
| 230
| 4.054054
| 0.486486
| 0.213333
| 0.186667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05291
| 0.178261
| 230
| 13
| 42
| 17.692308
| 0.740741
| 0.247826
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0.142857
| 0.714286
| 0.142857
| 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
| 1
| 0
|
0
| 5
|
84bf0a94350320b8d334766199902edb1f906925
| 172
|
py
|
Python
|
tests/fixtures/cover.py
|
kuc2477/news
|
215f87e6ce1a7fc99175596e6fd5b4b50a3179c6
|
[
"MIT"
] | 2
|
2016-01-21T04:16:57.000Z
|
2016-04-27T04:46:13.000Z
|
tests/fixtures/cover.py
|
kuc2477/news
|
215f87e6ce1a7fc99175596e6fd5b4b50a3179c6
|
[
"MIT"
] | null | null | null |
tests/fixtures/cover.py
|
kuc2477/news
|
215f87e6ce1a7fc99175596e6fd5b4b50a3179c6
|
[
"MIT"
] | null | null | null |
import pytest
from news.cover import Cover
@pytest.fixture
def cover(django_backend, django_schedule):
return Cover(schedule=django_schedule, backend=django_backend)
| 21.5
| 66
| 0.819767
| 23
| 172
| 5.956522
| 0.478261
| 0.189781
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.110465
| 172
| 7
| 67
| 24.571429
| 0.895425
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 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
| 1
| 1
| 1
| 0
|
0
| 5
|
04793ac64c8d8b9f02fd198ea762c43e8c9d4f8c
| 73
|
py
|
Python
|
viadot/utils.py
|
Lauralicja/viadot
|
480df8ce8c7f9b9eab7d5f9646227316fc9eff49
|
[
"MIT"
] | null | null | null |
viadot/utils.py
|
Lauralicja/viadot
|
480df8ce8c7f9b9eab7d5f9646227316fc9eff49
|
[
"MIT"
] | null | null | null |
viadot/utils.py
|
Lauralicja/viadot
|
480df8ce8c7f9b9eab7d5f9646227316fc9eff49
|
[
"MIT"
] | null | null | null |
def slugify(name: str) -> str:
return name.replace(" ", "_").lower()
| 24.333333
| 41
| 0.589041
| 9
| 73
| 4.666667
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178082
| 73
| 2
| 42
| 36.5
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0.027397
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 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
| 1
| 0
|
0
| 5
|
04ab4e8b5d2838e3ff02308c6235898e7e884649
| 125
|
py
|
Python
|
deploy/find_cluster.py
|
sun4343lee/pay
|
73580c84639248895fe53f95d719259b438252d4
|
[
"MIT"
] | null | null | null |
deploy/find_cluster.py
|
sun4343lee/pay
|
73580c84639248895fe53f95d719259b438252d4
|
[
"MIT"
] | null | null | null |
deploy/find_cluster.py
|
sun4343lee/pay
|
73580c84639248895fe53f95d719259b438252d4
|
[
"MIT"
] | null | null | null |
#!/bin/env python
import sys
print str([x.split(".")[1] for x in sys.argv[1].split("_") if x.split(".")[0] == "cluster"][0])
| 31.25
| 95
| 0.584
| 23
| 125
| 3.130435
| 0.695652
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036036
| 0.112
| 125
| 3
| 96
| 41.666667
| 0.612613
| 0.128
| 0
| 0
| 0
| 0
| 0.092593
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| 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
| 1
| 0
| 0
| 1
|
0
| 5
|
8e111dfc57effccb165da6b6ef2b096aaa1f4e0f
| 179
|
py
|
Python
|
examples/custom_model/model.py
|
felixnext/tf-argonaut
|
b853df665eba67a6d4989af9df23c05c9a9ce5b3
|
[
"Apache-2.0"
] | null | null | null |
examples/custom_model/model.py
|
felixnext/tf-argonaut
|
b853df665eba67a6d4989af9df23c05c9a9ce5b3
|
[
"Apache-2.0"
] | 2
|
2020-04-05T15:18:11.000Z
|
2021-06-02T01:16:00.000Z
|
examples/custom_model/model.py
|
felixnext/tf-argonaut
|
b853df665eba67a6d4989af9df23c05c9a9ce5b3
|
[
"Apache-2.0"
] | null | null | null |
'''Contains a customly defined model.'''
import tensorflow as tf
from tensorflow import keras
class CustomNet(keras.Model):
def __init__(self, layers):
pass
| 19.888889
| 41
| 0.687151
| 22
| 179
| 5.409091
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.22905
| 179
| 8
| 42
| 22.375
| 0.862319
| 0.189944
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
8e286a23e107d8cf0bb8b3b51dce87eb19c89ffc
| 158
|
py
|
Python
|
surgeo/utility/surgeo_exception.py
|
TheCleric/surgeo
|
018ff69a817ea115d6d42dc0d7d5b7b09db331e4
|
[
"MIT"
] | 20
|
2018-05-09T13:31:06.000Z
|
2022-03-23T20:50:35.000Z
|
surgeo/utility/surgeo_exception.py
|
TheCleric/surgeo
|
018ff69a817ea115d6d42dc0d7d5b7b09db331e4
|
[
"MIT"
] | 17
|
2019-12-13T01:45:48.000Z
|
2021-07-21T16:34:53.000Z
|
surgeo/utility/surgeo_exception.py
|
AlgorexHealth/surgeo
|
3ef2ab06ffbe875dc1bb1503802a256cee923b33
|
[
"MIT"
] | 10
|
2018-05-09T21:31:30.000Z
|
2021-07-26T21:28:48.000Z
|
"""Module containing an exception class for Surgeo"""
class SurgeoException(Exception):
"""This is an application specific Exception class."""
pass
| 22.571429
| 58
| 0.727848
| 18
| 158
| 6.388889
| 0.722222
| 0.243478
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170886
| 158
| 6
| 59
| 26.333333
| 0.877863
| 0.607595
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
8e2b5edea611a06bed749840ea1013358c95cf34
| 80
|
py
|
Python
|
0x00-python-hello_world/2-print.py
|
oluwaseun-ebenezer/holbertonschool-higher_level_programming
|
e830f969d3ca71abf0a2f6d4f7c64a82337eccd7
|
[
"MIT"
] | 1
|
2022-02-07T12:13:18.000Z
|
2022-02-07T12:13:18.000Z
|
0x00-python-hello_world/2-print.py
|
oluwaseun-ebenezer/holbertonschool-higher_level_programming
|
e830f969d3ca71abf0a2f6d4f7c64a82337eccd7
|
[
"MIT"
] | null | null | null |
0x00-python-hello_world/2-print.py
|
oluwaseun-ebenezer/holbertonschool-higher_level_programming
|
e830f969d3ca71abf0a2f6d4f7c64a82337eccd7
|
[
"MIT"
] | 4
|
2018-05-01T05:04:15.000Z
|
2020-04-28T22:22:54.000Z
|
#!/usr/bin/python3
print('"Programming is like building a multilingual puzzle')
| 26.666667
| 60
| 0.775
| 11
| 80
| 5.636364
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013889
| 0.1
| 80
| 2
| 61
| 40
| 0.847222
| 0.2125
| 0
| 0
| 0
| 0
| 0.822581
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
8e44d29d8aedcb2f53ffa579d6db1f9a112c5010
| 90
|
py
|
Python
|
lambdaconda/lambdaconda.py
|
RileyMathews/lambdaconda
|
4cd9563e706b194d839a9b6ad3b4bef88f4b4bc3
|
[
"MIT"
] | null | null | null |
lambdaconda/lambdaconda.py
|
RileyMathews/lambdaconda
|
4cd9563e706b194d839a9b6ad3b4bef88f4b4bc3
|
[
"MIT"
] | null | null | null |
lambdaconda/lambdaconda.py
|
RileyMathews/lambdaconda
|
4cd9563e706b194d839a9b6ad3b4bef88f4b4bc3
|
[
"MIT"
] | null | null | null |
def handle_invocation(event, context):
return { "message": "hello from lambdaconda" }
| 30
| 50
| 0.722222
| 10
| 90
| 6.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155556
| 90
| 2
| 51
| 45
| 0.842105
| 0
| 0
| 0
| 0
| 0
| 0.322222
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 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
| 1
| 0
|
0
| 5
|
f3d3864544f4503311c4d94d296c8fa9f9e20fdf
| 56
|
py
|
Python
|
modernlab/__init__.py
|
AlexZades/modernlab
|
dc771fed240864ed3a62bbb1170b353a8531da09
|
[
"MIT"
] | 1
|
2020-11-14T21:25:00.000Z
|
2020-11-14T21:25:00.000Z
|
modernlab/__init__.py
|
AlexZades/modernlab
|
dc771fed240864ed3a62bbb1170b353a8531da09
|
[
"MIT"
] | null | null | null |
modernlab/__init__.py
|
AlexZades/modernlab
|
dc771fed240864ed3a62bbb1170b353a8531da09
|
[
"MIT"
] | null | null | null |
from quick_plot import *
from variational_error import *
| 28
| 31
| 0.839286
| 8
| 56
| 5.625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 56
| 2
| 31
| 28
| 0.918367
| 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
| 1
| 0
|
0
| 5
|
f3ebe1444a1b32af35079144bf6f1de8ee3a2733
| 89
|
py
|
Python
|
scripts/utils/json_utils.py
|
RobinHackintosh/OpenCore
|
74ec0435e232e1495a04ce8f5027edf7072bba2d
|
[
"BSD-3-Clause"
] | null | null | null |
scripts/utils/json_utils.py
|
RobinHackintosh/OpenCore
|
74ec0435e232e1495a04ce8f5027edf7072bba2d
|
[
"BSD-3-Clause"
] | null | null | null |
scripts/utils/json_utils.py
|
RobinHackintosh/OpenCore
|
74ec0435e232e1495a04ce8f5027edf7072bba2d
|
[
"BSD-3-Clause"
] | null | null | null |
import json
def pretty_json(origin_data):
print(json.dumps(origin_data, indent=2))
| 14.833333
| 44
| 0.752809
| 14
| 89
| 4.571429
| 0.714286
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012987
| 0.134831
| 89
| 5
| 45
| 17.8
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
6d1220af75db03c0163af89458e1905a69659c84
| 354
|
py
|
Python
|
PYTHONG/superTools/superToolsMenu.py
|
roadkillsanta/JAPY
|
1a5383d7fc3a1c08c689f609cdcbb7d58fb84956
|
[
"Apache-2.0"
] | 1
|
2016-10-03T23:00:44.000Z
|
2016-10-03T23:00:44.000Z
|
PYTHONG/superTools/superToolsMenu.py
|
roadkillsanta/JAPY
|
1a5383d7fc3a1c08c689f609cdcbb7d58fb84956
|
[
"Apache-2.0"
] | null | null | null |
PYTHONG/superTools/superToolsMenu.py
|
roadkillsanta/JAPY
|
1a5383d7fc3a1c08c689f609cdcbb7d58fb84956
|
[
"Apache-2.0"
] | null | null | null |
g=open(accountList, r)
pickle.load(adminUsers)
print("Welcome to AdminTools!")
print("Please enter your official AdminTools account credentials:")
print("NOTE: You may enter your PythonG Live account credentials if you have access.")
print("Please enter your admin username:")
adminu = input()
print("Please enter your admin password:")
adminp = input()
| 35.4
| 86
| 0.771186
| 49
| 354
| 5.571429
| 0.632653
| 0.131868
| 0.175824
| 0.21978
| 0.18315
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118644
| 354
| 9
| 87
| 39.333333
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0.629944
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.111111
| 0
| 0
| 0
| 0.555556
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
|
0
| 5
|
6d1545a215455fae49f087be176d897122f725cd
| 173
|
py
|
Python
|
modules/intensity/__init__.py
|
RealAllenDa/EEWMap
|
4031c951fac97a099fb715c38a1dd77c52390a15
|
[
"Apache-2.0"
] | null | null | null |
modules/intensity/__init__.py
|
RealAllenDa/EEWMap
|
4031c951fac97a099fb715c38a1dd77c52390a15
|
[
"Apache-2.0"
] | 7
|
2021-11-20T06:52:50.000Z
|
2022-01-13T10:01:21.000Z
|
modules/intensity/__init__.py
|
RealAllenDa/EEWMap
|
4031c951fac97a099fb715c38a1dd77c52390a15
|
[
"Apache-2.0"
] | null | null | null |
"""
EEWMap - Modules - Intensity
Used to get intensities from a gif (usually fetched with the EEW).
"""
from .intensity2color import init_intensity2color, intensity2color
| 28.833333
| 67
| 0.774566
| 21
| 173
| 6.333333
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020408
| 0.150289
| 173
| 5
| 68
| 34.6
| 0.884354
| 0.549133
| 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
| 1
| 0
|
0
| 5
|
6d1c77633c753559981f53beb2054a637a5a75e2
| 202
|
py
|
Python
|
4.DataStructure/5.py
|
olzlgur/Python_study
|
8dd346d07f64839cc8832e7bd4b7a57adf342312
|
[
"MIT"
] | null | null | null |
4.DataStructure/5.py
|
olzlgur/Python_study
|
8dd346d07f64839cc8832e7bd4b7a57adf342312
|
[
"MIT"
] | null | null | null |
4.DataStructure/5.py
|
olzlgur/Python_study
|
8dd346d07f64839cc8832e7bd4b7a57adf342312
|
[
"MIT"
] | null | null | null |
#자료구조의 변경
number={1,2,3,4}
print(number, type(number))
number=list(number)
print(number, type(number))
number=tuple(number)
print(number, type(number))
number=set(number)
print(number, type(number))
| 15.538462
| 27
| 0.737624
| 32
| 202
| 4.65625
| 0.375
| 0.295302
| 0.402685
| 0.563758
| 0.805369
| 0.442953
| 0
| 0
| 0
| 0
| 0
| 0.021622
| 0.084158
| 202
| 13
| 28
| 15.538462
| 0.783784
| 0.039604
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| null | 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
6d2f37a889419df934812b529e3a4de1b3fa0812
| 83
|
py
|
Python
|
Darlington/phase1/python Basic 1/day 6 solution/qtn4.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 6
|
2020-05-23T19:53:25.000Z
|
2021-05-08T20:21:30.000Z
|
Darlington/phase1/python Basic 1/day 6 solution/qtn4.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 8
|
2020-05-14T18:53:12.000Z
|
2020-07-03T00:06:20.000Z
|
Darlington/phase1/python Basic 1/day 6 solution/qtn4.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 39
|
2020-05-10T20:55:02.000Z
|
2020-09-12T17:40:59.000Z
|
#program to locate Python site-packages
import site;
print(site.getsitepackages())
| 27.666667
| 39
| 0.807229
| 11
| 83
| 6.090909
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096386
| 83
| 3
| 40
| 27.666667
| 0.893333
| 0.457831
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
edaf0ff0369a004dee78a3a491900d43e3b4bf20
| 97
|
py
|
Python
|
wivaprec/testsystems/__init__.py
|
maxentile/wivaprec
|
fb7958c72cbe5faa1e499fcef7eb3b59a9d3590a
|
[
"MIT"
] | null | null | null |
wivaprec/testsystems/__init__.py
|
maxentile/wivaprec
|
fb7958c72cbe5faa1e499fcef7eb3b59a9d3590a
|
[
"MIT"
] | null | null | null |
wivaprec/testsystems/__init__.py
|
maxentile/wivaprec
|
fb7958c72cbe5faa1e499fcef7eb3b59a9d3590a
|
[
"MIT"
] | null | null | null |
from mixture import perturbed_bimodal_distribution
__all__ = ["perturbed_bimodal_distribution"]
| 24.25
| 50
| 0.865979
| 10
| 97
| 7.6
| 0.7
| 0.421053
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.082474
| 97
| 3
| 51
| 32.333333
| 0.853933
| 0
| 0
| 0
| 0
| 0
| 0.309278
| 0.309278
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 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
| 1
| 0
| 0
| 0
|
0
| 5
|
edb8f13e852f93f26514459b019aacb4dd7d1817
| 56
|
py
|
Python
|
helloworld.py
|
jtaejune1159/HYCUBE_Git_Study-1
|
6e34fca651163a41e94815cdf6a6bb8a30931693
|
[
"MIT"
] | 1
|
2020-08-29T04:58:25.000Z
|
2020-08-29T04:58:25.000Z
|
helloworld.py
|
jtaejune1159/HYCUBE_Git_Study-1
|
6e34fca651163a41e94815cdf6a6bb8a30931693
|
[
"MIT"
] | 11
|
2020-08-29T05:34:36.000Z
|
2020-08-31T06:38:34.000Z
|
helloworld.py
|
jtaejune1159/HYCUBE_Git_Study-1
|
6e34fca651163a41e94815cdf6a6bb8a30931693
|
[
"MIT"
] | 10
|
2020-08-30T05:29:46.000Z
|
2020-10-20T04:18:30.000Z
|
print("Hello, world!")
print("hello")
print("HYU ERICA")
| 18.666667
| 22
| 0.678571
| 8
| 56
| 4.75
| 0.625
| 0.526316
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 56
| 3
| 23
| 18.666667
| 0.730769
| 0
| 0
| 0
| 0
| 0
| 0.473684
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
ede946b76f9e84e15ca8313c56d8f8f29e8ca991
| 75
|
py
|
Python
|
hibot.py
|
NgLamVN/HiBot
|
022e9419d1a92546ffdccc928318a3b8836444f0
|
[
"MIT"
] | null | null | null |
hibot.py
|
NgLamVN/HiBot
|
022e9419d1a92546ffdccc928318a3b8836444f0
|
[
"MIT"
] | null | null | null |
hibot.py
|
NgLamVN/HiBot
|
022e9419d1a92546ffdccc928318a3b8836444f0
|
[
"MIT"
] | null | null | null |
# Statup File
from bot.bot_manager import bot_manager
bot_manager()
| 12.5
| 40
| 0.746667
| 11
| 75
| 4.818182
| 0.545455
| 0.566038
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 75
| 5
| 41
| 15
| 0.883333
| 0.146667
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
61175dc7368265163b36c4105e4505ef05c64b3f
| 30
|
py
|
Python
|
pcdet/version.py
|
rayguan97/M3DETR
|
cb76890a28c1555f2c0138030e0a432df6ee731b
|
[
"Apache-2.0"
] | 21
|
2022-01-21T11:02:15.000Z
|
2022-03-08T14:55:30.000Z
|
pcdet/version.py
|
rayguan97/M3DETR
|
cb76890a28c1555f2c0138030e0a432df6ee731b
|
[
"Apache-2.0"
] | 2
|
2022-01-21T08:10:49.000Z
|
2022-01-21T23:44:40.000Z
|
pcdet/version.py
|
rayguan97/M3DETR
|
cb76890a28c1555f2c0138030e0a432df6ee731b
|
[
"Apache-2.0"
] | 3
|
2022-01-21T11:41:55.000Z
|
2022-01-24T14:20:19.000Z
|
__version__ = "0.5.2+738cfad"
| 15
| 29
| 0.7
| 5
| 30
| 3.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 0.1
| 30
| 1
| 30
| 30
| 0.407407
| 0
| 0
| 0
| 0
| 0
| 0.433333
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b655a8e8d07c399639c9ebf5734f015f1a715be5
| 40
|
py
|
Python
|
test_serial.py
|
dawsonjon/chips_v
|
ed2cb9f7da76c4d4a05812575d062cdb0511656b
|
[
"MIT"
] | 6
|
2020-09-16T07:38:52.000Z
|
2021-05-13T20:26:25.000Z
|
test_serial.py
|
dawsonjon/chips_v
|
ed2cb9f7da76c4d4a05812575d062cdb0511656b
|
[
"MIT"
] | null | null | null |
test_serial.py
|
dawsonjon/chips_v
|
ed2cb9f7da76c4d4a05812575d062cdb0511656b
|
[
"MIT"
] | 2
|
2020-10-12T14:52:07.000Z
|
2021-03-29T16:49:46.000Z
|
from chips_v.serial import test
test()
| 10
| 31
| 0.775
| 7
| 40
| 4.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 40
| 3
| 32
| 13.333333
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
b677f1183b85cb7b633f7e11e7fac48192635085
| 404
|
py
|
Python
|
src/renault_api/cli/charge/commands.py
|
slater0013/renault-api
|
13c784b6af09331368341c93888f1eb32c46cb19
|
[
"MIT"
] | null | null | null |
src/renault_api/cli/charge/commands.py
|
slater0013/renault-api
|
13c784b6af09331368341c93888f1eb32c46cb19
|
[
"MIT"
] | null | null | null |
src/renault_api/cli/charge/commands.py
|
slater0013/renault-api
|
13c784b6af09331368341c93888f1eb32c46cb19
|
[
"MIT"
] | null | null | null |
"""Command-line interface."""
import click
from . import control
from . import history
from . import schedule
@click.group()
def charge() -> None:
"""Charge functionality."""
pass
charge.add_command(control.start)
charge.add_command(control.stop)
charge.add_command(control.mode)
charge.add_command(history.history)
charge.add_command(history.sessions)
charge.add_command(schedule.schedule)
| 19.238095
| 37
| 0.767327
| 52
| 404
| 5.846154
| 0.384615
| 0.177632
| 0.315789
| 0.226974
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106436
| 404
| 20
| 38
| 20.2
| 0.842105
| 0.111386
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.076923
| true
| 0.076923
| 0.307692
| 0
| 0.384615
| 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
| 1
| 0
| 0
| 0
|
0
| 5
|
1e20508264e6735aba14f9b7e79333ec97dca097
| 109
|
py
|
Python
|
src/githubinfo/api/__init__.py
|
Cutewarriorlover/github-info
|
d926f44433139ee2a06a5eea0c8bb85b9df2acb2
|
[
"MIT"
] | null | null | null |
src/githubinfo/api/__init__.py
|
Cutewarriorlover/github-info
|
d926f44433139ee2a06a5eea0c8bb85b9df2acb2
|
[
"MIT"
] | null | null | null |
src/githubinfo/api/__init__.py
|
Cutewarriorlover/github-info
|
d926f44433139ee2a06a5eea0c8bb85b9df2acb2
|
[
"MIT"
] | null | null | null |
"""
This module is a wrapper around GitHub's API.
"""
from src.githubinfo.api.github_user import GitHubUser
| 18.166667
| 53
| 0.761468
| 17
| 109
| 4.823529
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137615
| 109
| 5
| 54
| 21.8
| 0.87234
| 0.412844
| 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
| 1
| 0
|
0
| 5
|
1e3af9c11b1e4581d2f2a6d969d603e95faeea3f
| 38
|
py
|
Python
|
neutron-beam/nbeam/__init__.py
|
pcallday/Super-Neutron-Drive
|
d3cbeeae113722099032fb651dd4148670cb86e9
|
[
"MIT"
] | 24
|
2015-01-21T21:45:48.000Z
|
2021-02-11T21:10:43.000Z
|
neutron-beam/nbeam/__init__.py
|
pcallday/Super-Neutron-Drive
|
d3cbeeae113722099032fb651dd4148670cb86e9
|
[
"MIT"
] | 14
|
2015-01-04T00:45:05.000Z
|
2017-11-21T14:33:09.000Z
|
neutron-beam/nbeam/__init__.py
|
ColleenKeegan/Super-Neutron-Drive
|
d3cbeeae113722099032fb651dd4148670cb86e9
|
[
"MIT"
] | 15
|
2015-03-05T21:56:04.000Z
|
2019-09-26T15:48:25.000Z
|
from nbeam.version import __version__
| 19
| 37
| 0.868421
| 5
| 38
| 5.8
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 38
| 1
| 38
| 38
| 0.852941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 0
| 0
|
0
| 5
|
1e40f21793082ca5f03b96afd667f9e59fd4b794
| 54,943
|
py
|
Python
|
python_extra/selection_weird.py
|
all-hack/push_swap
|
745d28dd0b3c6f4b339e57ab2b460904a4c270a0
|
[
"MIT"
] | 1
|
2019-07-01T07:22:24.000Z
|
2019-07-01T07:22:24.000Z
|
python_extra/selection_weird.py
|
all-hack/push_swap
|
745d28dd0b3c6f4b339e57ab2b460904a4c270a0
|
[
"MIT"
] | null | null | null |
python_extra/selection_weird.py
|
all-hack/push_swap
|
745d28dd0b3c6f4b339e57ab2b460904a4c270a0
|
[
"MIT"
] | null | null | null |
import random
from fractions import Fraction as ff
import sys
import pprint
prp = pprint.PrettyPrinter(indent=4, width=200)
op =0
def rt(stack):
global op
stack.append(stack.pop(0))
op += 1
def rrt(stack):
global op
stack.insert(0, stack.pop())
op += 1
def trr(stack0, stack1):
global op
stack0.append(stack0.pop(0))
stack1.append(stack1.pop(0))
op += 1
def trrr(stack0, stack1):
global op
stack0.insert(0, stack0.pop())
stack1.insert(0, stack1.pop())
op += 1
def st(stack):
global op
stack.insert(1, stack.pop(0))
op += 1
def pt(stack0, stack1):
global op
stack0.insert(0, stack1.pop(0))
op += 1
def frt(stack):
stack.append(stack.pop(0))
def frrt(stack):
stack.insert(0, stack.pop())
def fpt(stack0, stack1):
stack0.insert(0, stack1.pop(0))
def ra():
global op
a.append(a.pop(0))
op += 1
def rb():
global op
b.append(b.pop(0))
op += 1
def rra():
global op
a.insert(0, a.pop())
op += 1
def rrb():
global op
b.insert(0, b.pop())
op += 1
def rr():
global op
a.append(a.pop(0))
b.append(b.pop(0))
op += 1
def rrr():
global op
a.insert(0, a.pop())
b.insert(0, b.pop())
op += 1
def sa():
global op
a.insert(1, a.pop(0))
op += 1
def sb():
global op
b.insert(1, b.pop(0))
op += 1
def ss():
global op
a.insert(1, a.pop(0))
b.insert(1, b.pop(0))
op += 1
def pa():
global op
a.insert(0, b.pop(0))
op += 1
def pb():
global op
b.insert(0, a.pop(0))
op += 1
## 12 list_sorts 10
# mA 67; sA: 73, sB: 59, sC: 49
# a = [91, 29, 53, 28, 14, 13, 2, 35, 83, 99, 72, 65]
# sA: , sB: 80, sC: 50
# a = [15, 10, 1, 87, 86, 43, 59, 47, 22, 9, 39, 78]
# 13
# a = [91, 29, 53, 28, 14, 13, 2, 35, 83, 72, 99, 65, 27]
#16
# 104 op 6n + 1/2n
# mA 104; sA: 171; sB: 136; sC: 67; sE: 60; sF: 60;
# a = [6, 11, 7, 15, 16, 14, 13, 1, 9, 8, 3, 5, 4, 10, 12, 2]
# mA 109; sA: 152; sB: 108; sC: 66; sE: 52; sF: 52;
# a = [8, 6, 11, 14, 5, 7, 10, 13, 3, 4, 15, 1, 0, 2, 9, 12]
# sE: 52; sF: 52;
# a = [81, 50, 94, 35, 66, 69, 31, 97, 38, 33, 87, 72, 64, 46, 34, 71]
# 19
# a = [111, 9, 960, 181, 815, 658, 715, 461, 441, 931, 865, 130, 743, 907, 443, 828, 116, 446, 803]
# 20
# sB: 230; sC: 104; sE: 75;
# a = [229, 501, 356, 62, 494, 86, 410, 300, 567, 119, 615, 671, 976, 817, 605, 979, 985, 813, 794, 908]
# sB: 40; sC: 42; sE: 40;
# a = [14, 46, 218, 228, 276, 328, 345, 382, 393, 434, 472, 485, 587, 661, 694, 766, 885, 889, 914, 944]
# sB: 208; sC: 106; sE: 75;
# a = [451, 226, 534, 869, 84, 341, 778, 503, 415, 186, 537, 287, 677, 548, 803, 558, 335, 991, 193, 203]
# sB: 222; sC: 96; sE: 78;
# a = [18, 720, 606, 356, 96, 907, 996, 625, 56, 517, 926, 74, 679, 430, 617, 184, 899, 839, 891, 674]# sB: 222;
# sB: 224; sC: 102; sE: 75;
# a = [229, 9849, 6354, 3914, 2246, 6945, 5547, 6855, 5802, 3073, 7292, 2580, 9503, 1404, 1579, 3710, 3745, 7446, 1653, 7900]
# sB: 228; sC: 100; sE: 78;
# a = [3452, 9778, 1023, 9659, 569, 2513, 4212, 2240, 915, 7224, 926, 8872, 8055, 1608, 5352, 2530, 1794, 6806, 3279, 8763]
# mA 152; sA: 302, sB: 230; sC: 87; sE: 77;
# a = [437, 8567, 9443, 9184, 1355, 8702, 9913, 2725, 4004, 365, 4172, 3671, 5000, 7398, 8362, 1942, 1912, 3822, 8376, 2532]
# mA 166; sA: 268, sB: 206; sC: 92; sE: 81;
# a = [5, 2, 13, 15, 3, 7, 18, 6, 19, 4, 10, 14, 0, 20, 16, 8, 9, 1, 11, 12]
# 40
# a = [771, 735, 572, 146, 206, 487, 997, 627, 241, 210, 826, 831, 946, 491, 922, 310, 212, 990, 232, 762, 292, 166, 567, 361, 359, 848, 628, 504, 185, 335, 563, 670, 688, 861, 265, 678, 235, 693, 211, 184]
# break
# a = [52, 504, 320, 430, 689, 438, 333, 620, 987, 632, 563, 270, 666, 0, 650, 274, 760, 963, 19, 217, 407, 397, 378, 739, 384, 834, 887, 170, 928, 379, 726, 710, 172, 119, 688, 755, 356, 686, 241, 369]
# a = [421, 589, 1227, 5759, 1131, 2992, 7534, 6130, 2204, 6194, 3633, 7789, 7676, 1816, 1103, 8293, 2247, 8629, 3770, 1153, 9490, 280, 9009, 6159, 592, 8520, 1996, 9524, 2296, 4108, 6913, 8652, 5621, 6785, 9821, 3439, 2831, 5054, 3276, 2982]
## 100 list_sorts 102
# mA 1415; sA: 8419, sB: 5234; sC: 662; sD: 662; sE: 660; sE: 673;
# a = [685, 947, 280, 597, 528, 127, 28, 37, 111, 288, 25, 398, 849, 356, 577, 362, 573, 238, 920, 931, 775, 777, 555, 308, 959, 866, 940, 142, 756, 333, 64, 100, 904, 908, 571, 512, 781, 774, 826, 18, 927, 704, 518, 523, 843, 600, 980, 538, 445, 163, 567, 421, 877, 106, 510, 590, 563, 601, 353, 806, 545, 673, 278, 816, 498, 693, 454, 252, 773, 957, 57, 249, 971, 144, 486, 948, 490, 945, 318, 731, 811, 77, 164, 507, 262, 792, 307, 917, 711, 823, 295, 875, 926, 489, 44, 611, 314, 659, 427, 384]
# mA 1430; sA: 9124, sB: 5338; sC: 701; sD: 701; sE: 696; sE: 595;
# a = [855, 579, 497, 642, 350, 668, 148, 676, 11, 307, 416, 145, 34, 870, 653, 908, 837, 991, 473, 552, 759, 90, 968, 21, 60, 465, 64, 175, 874, 12, 838, 705, 489, 921, 539, 184, 464, 183, 330, 171, 766, 74, 271, 418, 43, 248, 268, 681, 213, 810, 872, 355, 432, 701, 17, 383, 836, 819, 386, 813, 289, 806, 671, 724, 385, 493, 182, 112, 255, 265, 200, 612, 427, 103, 441, 887, 282, 53, 250, 591, 292, 957, 462, 412, 522, 805, 210, 390, 707, 764, 648, 958, 608, 199, 414, 401, 994, 454, 177, 929]
# mA 1388; sA: 8691, sB: 5237; sC: 898; sD: 806; sE: 806; sE: 615;
# a = [29, 63, 28, 89, 24, 4, 99, 40, 30, 77, 16, 91, 19, 34, 94, 68, 48, 90, 20, 54, 73, 10, 35, 80, 41, 26, 60, 11, 18, 2, 45, 42, 74, 53, 50, 23, 39, 12, 43, 3, 38, 22, 47, 58, 72, 25, 81, 57, 88, 17, 37, 27, 64, 86, 75, 78, 76, 8, 14, 33, 31, 84, 7, 52, 93, 95, 1, 85, 36, 5, 71, 69, 98, 6, 87, 62, 65, 13, 32, 82, 59, 55, 67, 56, 21, 66, 46, 15, 79, 51, 92, 97, 70, 96, 49, 9, 83, 44, 61, 0]
# sC: 808; sD: 750; sE: 750; sE: 654;
# a = [-5085, 711, 8503, -6336, 8546, -2475, 7374, -7291, -5429, 9875, 933, 6212, -8331, 4972, -8529, -4079, 9028, 4753, 3138, 8508, -9960, 694, -6494, 8231, 668, 9732, 3472, -865, -1744, -3205, 7798, -75, 6210, -691, 8507, 9375, 8509, -2234, 8850, -797, 8087, 5018, -5163, -3599, 2779, 9188, 9692, -4407, 1606, 9874, 29, 3133, -2527, 1046, 4579, -6768, 9943, 2285, -9966, 2695, -9831, 4634, 4974, -7610, -5821, -4577, -3614, -7484, -768, 4380, 5743, -7232, 5379, -4402, -9163, 5182, 4373, -2293, 4416, -4396, -8460, -5151, 8976, 3083, -8931, -1966, -870, -9700, -6261, 5655, -2055, -5680, 5242, -5176, -5624, -7813, -5188, 558, 6128, -5855]
# sC: 728; sD: 728; sE: 728; sE: 603;
# a = [987, 4639, -8566, 8133, -9993, -8271, -7190, -795, 9330, 8102, -6819, -1250, -9159, -7828, 3732, 7656, 4222, 3206, -5514, 4914, 3386, -5683, -7983, -3634, -1274, 1312, 3800, -5013, 1618, -3086, 1493, 4631, -401, -5460, -5578, -4874, 1392, -2858, 3336, -2152, -9067, 8382, -1555, -9117, 258, -5485, 8548, -490, 8105, -424, 5701, -9919, 1373, -7164, -8954, -7958, 549, -4996, 916, -781, 2586, -5709, -1871, -665, 3735, 3859, -6778, 6385, 2594, -6029, -6629, 2524, 8999, 9323, 5515, 9643, -9651, -1470, -8131, 9608, -5605, -5719, 8247, -8523, 4822, -3294, 4001, -3330, -7013, 8593, 1136, 5316, 7997, -6658, -3126, -7024, -2320, -4210, 4610, 1914]
# sC: 817; sD: 727; sE: 727; sE: 589;
# a = [5642, -6222, -2059, 7251, -1445, -7468, 245, -1845, 9009, -2088, -5984, 1122, -4046, 1275, 5129, 5474, 9902, -1517, 9181, 9601, 4699, -8424, -5653, 7257, -4458, -4365, 2316, -1342, 1849, 895, 5568, -6740, 37, 7774, 5166, 4198, -7508, 8031, 2039, 3856, -1521, 5527, -7088, -8383, 7392, -128, 5719, -4809, 5698, 9847, 7869, -7097, -3512, -5583, -8805, 6836, 631, 7503, 3171, 5661, 3473, -7925, 8325, 5689, -7090, -1699, 7542, 7283, 1718, -2823, -9442, -4667, 1654, 2013, -1431, 8750, -5581, -4058, 3598, -2038, -6099, 2128, 9296, 7324, 8704, 6554, 3149, 3480, 2356, 6977, 2429, -5801, 3593, -3649, -7224, 385, 590, -5652, -3736, 8143]
# sC: 703; sD: 703; sE: 703; sE: 601;
# a = [6333, 7479, 6979, -2786, -3584, 2685, 3730, -5364, 8584, -1899, 9074, -8097, 5722, -4267, -8007, -5641, -8407, -9030, 7818, -6444, -6283, -4119, 2250, -4410, -6664, -6837, -3720, -3442, 4660, -8414, -2852, -9522, 7801, -7032, 2462, -6734, -8059, -7939, 4501, 6421, -8361, -4360, 4598, -934, -3815, -2438, -5127, 8224, -5887, 8362, 5795, -2763, -3216, -9182, -7994, 4029, -6210, 8626, -6966, -5795, -2827, 321, -7954, -7501, 1976, -979, 8246, -4210, -6567, -3071, 9917, 5866, -2842, -7258, -8401, -6501, -6502, -9563, -2946, -238, 5626, 4624, 9568, -2591, -1604, -196, 1017, -205, -9290, 1211, 424, 4280, 1811, -9900, 1474, -1651, -3300, -3972, 8219, 2844]
# sC: 784; sD: 712; sE: 712; sE: 609;
# a = [-8758, 1404, 1309, 9544, -4991, -4307, -2666, -5311, 2595, -6312, -8095, 9135, -7001, 8551, -7289, -1187, -6131, -2263, -3991, -3540, 7249, -398, -7002, -4363, 3284, -8272, 2527, 4237, 3791, 1597, -2868, -3598, 9772, -5132, -5436, 5287, 7757, -7480, 4158, 5320, -1973, -6509, 6758, -9982, -44, 2965, -6283, -9894, -5101, 9897, -5207, -5182, -5456, 9972, 577, 6191, 7961, -9712, -8648, -9373, -6201, 1506, -8210, 4219, -2078, -7892, 9307, -1862, 5052, -6362, -8309, 5503, 1721, 9283, 9983, 5611, -9873, 5024, 8542, -566, 4967, 6903, 2672, 5904, -420, -720, -4558, -4295, 6086, -7310, 9055, 5504, 35, 7673, -9875, -5425, 6778, 5440, -1725, -3940]
a = [543, 175, 219, 365, 325, 145, 521, 619, 401, 56, 803, 245, 586, 425, 726, 289, 480, 372, 431, 982, 689, 255, 90, 370, 49, 502, 284, 692, 125, 620, 593, 162, 117, 551, 417, 173, 22, 35, 600, 207, 894, 308, 61, 398, 119, 186, 466, 5, 815, 782, 445, 874, 749, 236, 220, 195, 109, 176, 639, 350, 642, 872, 585, 719, 939, 270, 960, 323, 476, 317, 489, 451, 702, 974, 663, 131, 426, 826, 694, 787, 269, 122, 864, 419, 187, 596, 802, 92, 514, 807, 561, 604, 984, 884, 416, 673, 571, 636, 153, 177]
# 500
# mA 10529; sA: 244,143, sB: 131,992; sC: 7,198; sD: 6,878; sE: 6,878; sE: 5,656;
# a = [731, 527, 216, 231, 75, 327, 638, 388, 567, 268, 986, 853, 851, 393, 666, 613, 956, 889, 708, 494, 923, 817, 915, 714, 221, 349, 448, 673, 668, 185, 305, 559, 650, 396, 826, 840, 617, 140, 394, 517, 310, 691, 405, 989, 304, 116, 228, 450, 438, 688, 841, 382, 972, 303, 451, 820, 934, 203, 728, 212, 964, 201, 440, 242, 262, 724, 146, 877, 992, 298, 744, 536, 678, 28, 474, 957, 281, 542, 540, 172, 730, 287, 469, 659, 890, 104, 119, 325, 982, 592, 968, 409, 634, 881, 62, 694, 752, 486, 187, 376, 143, 981, 359, 726, 908, 188, 364, 902, 99, 642, 777, 507, 155, 452, 476, 514, 152, 753, 321, 50, 329, 535, 114, 835, 518, 130, 702, 633, 522, 158, 277, 495, 415, 742, 245, 97, 411, 358, 3, 599, 808, 453, 274, 818, 395, 790, 44, 266, 523, 995, 17, 920, 822, 836, 427, 319, 180, 598, 655, 263, 347, 235, 556, 265, 308, 685, 340, 113, 627, 250, 532, 800, 632, 953, 587, 546, 294, 942, 355, 237, 76, 88, 397, 624, 93, 124, 880, 206, 444, 585, 511, 208, 631, 318, 901, 58, 849, 120, 630, 811, 719, 362, 462, 186, 761, 350, 105, 161, 785, 83, 129, 824, 295, 657, 870, 525, 249, 741, 506, 533, 225, 315, 163, 482, 812, 67, 19, 927, 352, 258, 156, 554, 784, 921, 344, 108, 49, 142, 53, 162, 398, 690, 966, 255, 101, 110, 707, 607, 139, 566, 736, 1, 846, 204, 472, 565, 264, 246, 770, 945, 983, 441, 959, 131, 169, 718, 636, 626, 656, 31, 184, 33, 788, 772, 301, 706, 439, 722, 117, 333, 621, 154, 858, 339, 797, 725, 900, 591, 512, 937, 939, 32, 695, 513, 470, 222, 484, 865, 832, 984, 334, 946, 178, 63, 179, 941, 903, 531, 699, 771, 605, 11, 390, 326, 384, 270, 545, 392, 342, 645, 769, 442, 936, 229, 654, 389, 681, 692, 115, 103, 209, 420, 869, 137, 758, 177, 647, 729, 710, 320, 508, 564, 230, 550, 94, 491, 367, 779, 682, 883, 283, 463, 118, 660, 748, 765, 144, 401, 299, 36, 670, 15, 855, 716, 931, 919, 847, 379, 477, 181, 153, 160, 595, 52, 418, 426, 850, 378, 743, 434, 432, 575, 286, 403, 102, 133, 833, 505, 547, 136, 663, 87, 980, 791, 783, 322, 260, 572, 999, 686, 417, 138, 218, 529, 580, 387, 259, 300, 971, 289, 430, 671, 804, 106, 9, 973, 930, 926, 879, 499, 868, 569, 806, 987, 429, 767, 419, 84, 109, 288, 537, 314, 338, 735, 39, 747, 867, 404, 56, 437, 402, 323, 555, 551, 309, 988, 198, 875, 485, 190, 948, 433, 738, 345, 679, 746, 369, 929, 904, 293, 302, 65, 781, 563, 145, 490, 576, 341, 175, 475, 481, 194, 365, 704, 337, 95, 202, 616, 243, 648, 285, 479, 501, 732, 81, 70, 794, 733, 112, 872, 147, 313, 422, 468, 871, 168, 574, 935, 754, 330]
# mA 10192; sA: 245,990; sB: 132,383; sC: 7,622; sD: 7,194; sE: 7,194; sE: 5,522;
# a = [486, 204, 34, 388, 38, 472, 164, 402, 272, 275, 434, 492, 96, 188, 175, 153, 215, 157, 237, 433, 468, 332, 474, 108, 3, 291, 238, 186, 65, 350, 339, 235, 103, 342, 456, 59, 483, 246, 244, 119, 304, 54, 16, 425, 174, 106, 477, 358, 78, 165, 9, 203, 336, 211, 394, 380, 335, 373, 4, 18, 32, 452, 428, 280, 233, 166, 25, 437, 220, 107, 135, 40, 368, 145, 143, 227, 0, 283, 397, 137, 234, 122, 163, 146, 348, 427, 30, 401, 307, 423, 15, 101, 384, 23, 190, 377, 286, 493, 14, 189, 140, 374, 347, 183, 29, 160, 436, 406, 248, 125, 305, 115, 412, 82, 310, 317, 285, 355, 111, 21, 236, 100, 408, 269, 424, 31, 219, 460, 77, 410, 498, 455, 61, 254, 364, 43, 370, 387, 301, 242, 60, 431, 5, 326, 70, 270, 71, 314, 224, 420, 369, 328, 112, 206, 192, 362, 405, 453, 92, 64, 149, 147, 81, 19, 207, 300, 294, 120, 133, 318, 282, 41, 485, 75, 277, 481, 274, 414, 7, 407, 159, 357, 36, 131, 168, 68, 365, 446, 473, 89, 196, 247, 259, 390, 138, 441, 8, 497, 375, 2, 379, 470, 57, 44, 191, 478, 260, 256, 319, 417, 262, 312, 162, 124, 24, 482, 287, 399, 199, 439, 293, 464, 449, 480, 360, 389, 338, 86, 185, 170, 366, 471, 201, 372, 261, 354, 187, 109, 398, 154, 496, 155, 263, 454, 48, 356, 308, 97, 156, 217, 346, 290, 432, 239, 253, 225, 47, 265, 281, 391, 53, 84, 341, 313, 443, 367, 479, 393, 302, 94, 144, 200, 476, 345, 371, 73, 381, 142, 419, 223, 99, 161, 74, 255, 429, 67, 458, 459, 444, 337, 91, 212, 51, 359, 28, 116, 426, 121, 306, 457, 484, 181, 325, 257, 385, 104, 55, 289, 333, 171, 180, 22, 141, 303, 251, 27, 451, 382, 69, 296, 327, 442, 130, 49, 76, 316, 158, 216, 102, 177, 148, 179, 386, 95, 210, 126, 279, 88, 278, 229, 226, 264, 232, 445, 90, 26, 418, 132, 110, 221, 105, 118, 413, 85, 6, 322, 152, 46, 268, 194, 494, 114, 411, 42, 299, 228, 129, 205, 403, 330, 392, 361, 288, 1, 329, 241, 127, 273, 209, 63, 351, 52, 117, 298, 252, 324, 245, 353, 340, 173, 62, 17, 309, 430, 343, 35, 45, 422, 469, 490, 475, 80, 499, 240, 202, 150, 409, 396, 66, 139, 292, 462, 184, 72, 98, 323, 151, 438, 193, 178, 113, 383, 284, 271, 487, 83, 222, 466, 87, 334, 37, 13, 491, 315, 93, 376, 195, 218, 395, 176, 465, 249, 321, 276, 20, 488, 467, 231, 267, 297, 58, 50, 11, 172, 440, 182, 79, 404, 400, 123, 489, 12, 243, 363, 10, 230, 435, 349, 447, 495, 213, 352, 415, 461, 266, 198, 136, 258, 448, 134, 197, 416, 250, 463, 344, 378, 39, 331, 311, 167, 128, 295, 56, 208, 33, 214, 450, 320, 169, 421]
# mA 10192; sA: 245,990; sB: 132,383; sC: 7,622; sD: 6,656; sE: 6,656; sE: 5,445;
# a = [4003, -8790, 4488, -3156, -8499, -4777, -8340, -616, -682, 7864, -3116, -8624, -7257, -730, 823, 6107, 940, -6287, 5468, -8311, -3793, -1606, -9684, -8609, -364, 1035, 6950, -1062, 8097, 1066, -7938, 1781, -8875, 9919, 1848, 3250, -8519, 2884, -188, -7015, 9387, 5210, -2132, -227, 7006, -2310, 5955, 8421, 1874, -8264, 2734, 9546, 5514, -4528, 4932, 8935, 5616, -8025, 7909, 1000, 4726, 8407, 586, -3438, -1895, 9254, 3399, -7012, 1524, -5411, -1402, -998, 5335, 3778, 4107, -7342, -3893, -9777, 468, -41, 1123, 5966, -1111, -6966, -2141, -5841, 8387, -9162, -9298, 7354, -880, -8904, -5578, -5312, -46, -2025, -5547, 2452, 49, -355, 2902, 70, -3445, -4432, 6948, 3649, 9476, -6401, 3537, -8963, -8752, -8092, 650, -7701, 4895, 8556, -6806, 5065, -492, 439, -4916, 3457, -7221, -7549, 4769, -3784, 6965, -9802, 3552, -2629, 2168, -8659, -4862, -27, -8101, 4505, 1447, -8381, -12, 7831, 340, 9272, 8922, 6615, 6914, -1141, -5609, -9074, 4894, 582, -6835, 4870, -4759, 6141, -2338, -2237, 1152, -5438, 233, -6775, 5741, -9530, -884, 7511, 153, 8736, -3440, -3490, 7839, 8801, 7551, 1195, 9179, 9989, -3089, -1535, -5554, 1397, -1436, -8817, 5760, -376, -9200, -9413, 8203, 8236, -414, -6754, -8594, 8256, -5568, -6257, -8683, -8826, 8655, 3826, -3293, 7151, 1496, -2842, 656, -7438, -3223, 3647, -5350, 7903, -2163, -4280, -4823, -3179, -2083, 6474, -472, 3507, -9962, 9376, 6780, -4035, -2019, 8933, -6189, 1301, -8401, 1086, 1951, -8625, 7137, -3614, 519, -8786, 5123, -4786, -8947, -7553, 8948, 5116, -9186, -6729, 7422, -6369, -8246, 3473, -4249, 360, -6825, 5454, 5239, -4882, 7749, 6550, 6009, -2321, 2472, -1686, 1806, -9772, -461, 8470, -2420, 350, 9426, 1508, 8198, -4636, 8430, 1314, 1585, 6624, -5253, 335, -1527, -2508, 3214, 4019, -6486, -9054, 9371, 80, -918, -1553, 4976, -9571, 3788, 4681, 6399, 9177, 7764, -6060, 8188, -4299, 3662, 1320, -9035, 8630, -3408, -9984, 1110, -6009, -4601, -5527, -1539, 5005, 4294, 2666, -4011, 481, -2698, 934, 2917, 2243, -7333, -3903, 4808, -4208, 9940, -8215, 1922, 9979, -5982, 9129, 4667, 8724, 8930, 5120, 784, -4004, -2785, -8543, -4205, -7721, 3612, -9344, 4603, -3717, -4284, 962, -399, -9402, -7615, -3400, 7666, -2173, 9991, -7550, 2439, -8344, 6505, 5665, 5913, 7341, -1411, 9969, 8459, -4201, 685, -7570, -8750, 5167, -1217, -2494, -305, 8636, 830, 3642, 8194, -4619, -2463, -3682, -5900, -6218, 3230, -5667, -4554, 2529, -5204, -5298, 8574, 1789, -6727, -413, -272, 5039, 9561, 1994, -5983, -9912, 1560, 2138, 8436, 4592, 26, 246, -2209, -4788, 1262, -7996, -8553, 9593, 1814, 3221, 3123, -5314, 6915, 3948, -2539, -7131, -4048, -4095, -8236, 7225, -7540, -5271, 6499, 7730, -2822, -4930, 9074, -4562, 6402, 8872, -3022, 3752, 2975, 2581, 8714, -5097, 3707, -3549, -2308, 6485, -5996, 1039, -2583, 8762, 1151, -115, 8956, -1196, 5412, 3154, 273, -885, 6781, -8568, -1830, 3484, -7855, -2597, -5688, 2664, 668, 1495, 4724, 3344, 6508, -2682, 8293, 2625, -6860, 9237, -3049, 3825, -1334, -3410, -6640, 4563, 4672, -9281, -4107, -7398, -7906, 9867, -86, -9538, 2200, -5971, 817, -7151, 4095, 3066, -7425, -1664, -4701, -7112, -714, -2464, 1265, -2714, -7791, -3359, -1698, 3506, 1643, -1595, -9879, 5688, -2091, 1161, -6867, 3312]
# sE: 5,801;
# a = [621, -28, 681, 599, -763, -59, -519, -762, 633, 961, 369, 211, -798, -517, -564, -897, -347, 332, -836, 882, 792, -128, -292, 163, 15, 706, 746, -534, -837, 537, 322, 822, 605, 166, -264, 762, -593, 714, 304, 954, 379, 206, 345, 204, 622, -959, 42, -511, -968, 157, -323, -556, -225, -68, 754, 520, 270, 136, -26, -415, 840, -788, -694, -418, -208, -133, 428, 378, -805, 802, -73, -980, -271, 667, -768, -779, 56, 657, 69, 184, 341, -711, 118, 168, 950, 405, -844, 486, -77, -514, 827, 438, -776, 222, -311, 150, 106, -720, -650, -930, -979, 218, -535, -651, -561, 298, 784, -993, 458, -731, 1000, 593, -30, 454, 350, -672, 213, -316, -877, -628, 239, 676, 80, 176, -584, -344, 810, 979, 838, -696, -929, -428, -923, -714, 857, 696, 177, -734, 990, 208, 665, 439, -881, 508, 370, -659, -643, 186, 825, -900, 445, -815, -43, -111, 503, 375, -387, -826, -145, -905, -107, -746, -110, -399, 103, -732, 479, 846, -125, -926, -602, -228, -9, 334, -343, 25, 49, -471, 600, 547, 619, -283, -745, -824, 339, 658, -971, 779, -326, 459, -525, -200, 145, 582, -102, -355, -248, 10, -484, -633, -630, -394, -368, -655, 731, -769, -975, -845, -903, -195, 648, -748, 953, -819, -704, 178, -119, -383, 349, -419, -970, 780, 399, 4, -348, 758, 854, 807, 943, -506, -509, -371, 564, -936, -504, -237, 959, -613, 773, 647, -855, 423, -654, -715, 521, 31, -773, -141, 934, 433, -646, 735, -357, -486, -210, -426, 427, 874, -951, -319, -617, -334, -268, 666, -723, 967, 446, 576, -190, -810, 690, 29, 638, -23, -516, -558, 820, 429, 511, 734, 128, 782, -656, 718, 276, 354, 730, 677, 244, -69, 791, 652, -55, 365, 627, 993, 739, -361, 286, 788, -188, 845, 859, 297, 881, 396, 37, -45, -304, -242, 327, -891, -701, 76, 733, 441, -187, -173, 592, -246, -395, -832, -51, -557, -755, 542, 553, 868, -7, 209, 413, -198, -444, -363, 295, -78, -638, 745, -199, 804, -3, 608, 617, -95, 36, 38, 360, -658, -159, -144, 548, -488, -708, 13, 391, 717, 724, -606, 23, 755, -215, 705, -713, -15, 921, 847, 789, 397, 72, 101, 535, 61, 980, -239, 274, -432, -294, 533, 316, -194, 133, 697, 139, -475, -595, -661, 99, -247, -170, 122, 589, 629, 923, 484, 278, -793, 526, 917, -417, -436, -751, -629, -143, -991, 3, 144, -477, -86, -641, -730, -766, -829, 313, -446, -677, -254, 886, 430, 357, -366, 664, -274, -263, 723, 35, -295, -285, 384, -942, 125, -378, 843, 670, -635, -16, 44, 615, 691, 574, 749, -4, -896, 920, 243, 161, 828, 964, 444, 400, -843, 299, -462, 634, 321, 987, -65, 580, 30, -667, -333, -24, -728, 434, -546, 306, 195, 678, 26, 266, -298, -848, 443, 60, -13, 476, -345, -370, -53, 162, 584, 406, -916, 351, 932, 386, 637, 245, 799, -912, -803, -342, 164, -423, -156, -781, 312, -282, -530, -698, 606]
# sE: 5,695;
# a = [-643, 43, 386, 944, 522, 709, 404, -877, 955, 847, 954, 748, -904, 55, 637, -535, 485, -329, 213, -705, 997, -637, -446, -459, -47, 920, -418, 767, -269, -464, -542, 289, 838, 376, 413, 68, 607, 331, 890, -664, -661, 176, -475, 35, -74, -665, 676, -648, 942, 540, 913, 781, 379, -26, 897, 31, -389, -939, 624, -293, 708, -340, 12, 504, 455, -304, -835, -917, 227, -491, -512, 516, 81, -731, 892, -774, 51, -219, -27, 754, 551, 382, 215, 74, -395, -783, 131, 63, 210, 226, 542, 90, 682, 179, -766, -256, -499, -68, -558, 932, 92, -141, -73, -41, 592, 423, 947, -773, 875, -517, -521, 294, -912, 119, 359, -548, -882, -118, -392, 977, -723, -530, 677, -372, -37, 282, 880, 284, -746, -670, -945, 863, 689, 199, -444, -221, 112, 78, 963, -349, -375, 707, 114, -683, 927, 83, -980, 283, 401, -333, -901, -662, 230, -188, 630, -991, -507, 120, -616, 323, -387, 360, -646, 447, -971, 496, 319, 653, -266, -794, -857, -366, -740, -278, -443, -997, -39, 238, 212, 345, 815, 979, -666, 366, 718, 116, -92, -493, 835, 291, 562, 799, 841, -481, -920, 111, -308, -956, 938, 948, -202, 548, 490, 185, -19, -50, -225, -900, -555, 716, 869, -701, 845, -182, 552, 198, 77, -194, -781, -38, -268, 628, 975, 191, -878, 531, 613, -167, 187, -738, -59, -238, 472, -635, 652, -656, 422, -852, -708, 272, 614, 978, -82, 915, 571, -711, 414, -120, 929, 463, -218, -48, 438, -361, 383, 881, -260, -130, 598, -356, 904, -762, -240, 826, -938, -577, 911, 433, -16, 41, 483, -153, -815, 34, -614, -214, 590, 734, -947, 189, -161, -573, -506, 293, -186, -984, 821, -896, -946, 842, -276, -913, 950, -728, -359, -591, -139, -641, 70, -540, 818, -972, 133, 148, 684, 544, -223, -778, -283, -286, 367, 742, 900, 577, -959, -49, 866, -207, 893, 528, -923, 833, 644, -496, 501, 556, -720, 717, -969, -955, 559, -181, -630, -915, 899, 894, -765, 305, -456, 372, -458, -271, -1000, -553, 872, -742, 933, 406, -710, -819, -914, 310, -51, 533, 13, 325, -838, -233, -724, -339, 93, 280, 254, 375, -488, -990, 118, 495, -173, 139, 451, 222, -743, -149, 462, 765, 930, 5, 801, 387, -388, 902, -933, -583, 346, 608, -869, -850, 195, 594, -294, -482, -125, 901, -751, 362, 465, -515, -200, 193, -150, -846, 639, 865, -370, -698, 40, -539, 50, 843, -729, -243, -113, -437, -83, -234, -587, -135, -452, 943, 982, 796, -217, -354, -328, 625, -407, -33, 477, -109, 856, 0, 301, -324, -213, -691, 545, -478, -341, 122, -966, 473, -229, -259, 715, 888, 570, -533, 666, -245, -590, -870, 109, 788, -203, 808, -290, 972, -655, -679, -755, 529, 269, 976, 752, -342, -453, 188, -509, 751, -727, 844, 137, -307, 757, -700, 740, -138, -142, -157, -686, -146, -201, 813, 54, 749, 806, -954, 961, 515, -7, -382, -274, 996, 817, -8, 798, 876, 728, -645]
# sE: 5,494;
# a = [-731, 469, -130, -805, 797, 394, -417, -22, -499, -782, 956, -421, -625, -54, -229, -437, -131, 52, 235, -298, 608, -180, 881, -992, -921, 996, 566, -156, -934, -801, 336, -249, -891, 430, -585, -581, 338, 369, 640, -910, -943, -81, 178, 203, 558, 246, -815, 260, -278, 320, -267, 84, 740, -983, 10, -763, -446, 72, 833, -52, -333, 447, -485, -777, 690, 981, -784, -343, 648, -609, -996, 554, 160, -73, -362, -348, 122, -975, -265, 603, 486, -31, 890, 934, -893, -460, 652, 403, -457, -436, -236, 42, 751, 858, 305, 819, 35, -41, 840, -238, 225, -242, 826, -377, 523, 61, 715, -632, -566, 9, -279, 527, 354, 17, -879, 590, -518, 683, -596, 270, 182, 226, 616, -848, -732, -778, 596, 278, -284, -366, -707, -199, -613, 895, -865, 230, 534, 13, -253, -26, -655, -823, 735, -412, 649, 485, 356, 90, -458, -544, -237, -112, 658, -100, -210, 297, -140, 467, 325, -633, -379, -472, -492, 505, -275, 931, -986, -844, -136, -963, -79, -537, 986, 464, 582, -629, 733, 984, 747, 524, -802, -603, -443, -913, 319, 978, 83, -774, 572, -510, 153, 630, 634, 152, -86, -255, 509, 363, -587, 67, 968, 943, 688, -329, -496, -314, -479, -355, -967, 396, -999, -576, 81, 809, 891, 576, -671, -594, -423, 117, -646, -159, 130, 892, 927, 212, -204, -693, 435, -447, 459, 920, 277, 518, 54, 41, -102, 334, 229, -240, -962, -688, 48, 661, 925, -591, 150, 76, -855, 373, -274, 6, 323, 251, 861, -569, -122, -507, 814, 958, -394, -110, -885, 653, 189, 964, 949, 695, 495, -645, 592, 111, -941, -336, 259, 704, -178, 503, -511, -292, -37, -94, -462, 849, 713, -208, -389, 184, -474, 536, -142, -331, -987, 86, 197, 374, 699, -640, -263, 37, -201, 314, 779, -433, -438, -151, 155, 66, 335, 289, -874, 492, -868, -18, -125, -679, 216, 421, -290, -84, -455, 744, 200, -231, 706, -468, 888, 391, -809, -410, 91, -692, 900, -369, 763, 790, 180, 912, -74, 170, 220, 49, 109, 114, -834, -842, 504, 726, 610, 597, -592, 673, 475, -158, -858, 549, 698, 897, -197, 96, -682, 346, -945, -528, 657, -836, -352, 348, -59, -709, -375, -392, 474, 460, 748, -991, -770, 671, -508, 742, -749, -38, -837, -78, 454, -516, -648, 77, 785, 144, -174, -272, 455, -97, -6, -881, -8, -800, -220, -428, -195, -906, 431, 976, 734, 308, 738, -243, 316, 945, 770, -523, -667, 830, 168, 507, -262, -250, -672, 975, 195, 798, 651, 358, -680, 773, 791, -134, -861, -305, 873, -118, 843, 381, -192, -251, 283, -311, -702, -138, -271, -599, -958, 187, 458, -409, 306, -153, -40, -109, -445, -358, -325, -931, -34, 502, 914, -657, 245, 521, 724, -225, 636, 544, 237, -63, -548, -765, -685, 594, 718, 233, 171, -964, 0, 166, 3, 491, 32, -398, 133, -21, 56, -10, 420, -161, 828, -873, -819, 578, 821, -269, 151, -206, -25, -196, -519, -889, -65, -980]
# sE: 5,888;
# a = [-213, 400, -462, -287, 701, -386, -959, 13, -351, -9, 1000, 770, 832, 975, 276, -431, 799, -790, -788, -904, 798, -770, -132, 156, 514, -921, 42, -424, -511, -882, 939, 117, 616, 45, -782, 402, -620, 325, 370, 488, -658, -47, -317, 200, -845, -936, -910, 412, 509, 11, 653, -506, -338, -713, 827, -899, -322, 938, 708, -427, -878, -347, -136, 471, -233, 106, -914, 751, -703, -907, 621, 116, 367, 873, -783, 216, -879, -719, 615, 458, 710, 255, -872, -92, 882, -917, 457, -404, -887, 493, 250, 388, 813, 36, 189, 282, 162, -490, 663, -898, 809, 636, 139, -692, -198, -247, -997, -521, -358, 557, -466, -617, -591, 299, 107, 104, -989, -94, 223, 10, -298, -412, -848, 555, -171, 132, 674, -906, 407, 303, -762, -758, 740, 834, 816, -798, -890, -212, 126, 909, 844, 196, -612, -355, -809, -234, 924, -158, 251, -793, -893, 583, -838, -441, -789, -71, 193, 625, 737, -140, 469, 646, 375, 597, 147, -664, -875, -765, 903, 642, 67, 743, -18, -418, 429, -939, 504, 521, -902, -560, -152, 566, 657, -382, 526, -269, 766, 397, -276, 214, -96, -229, 647, 304, -509, -877, 292, -881, 160, -220, -11, -592, -517, 95, -934, -979, 561, -208, 753, -687, 467, 934, 779, 240, 794, -111, 637, 826, 919, 944, -706, -682, -443, -969, 662, -377, 596, 87, -290, 733, 518, -163, -811, 415, -846, -65, 536, 123, 718, -426, -128, 180, -420, -984, -144, 28, -864, 443, -84, 632, 91, -912, -206, 648, 656, 39, -453, 94, 861, 920, 666, 295, -77, 427, 707, 77, 435, 931, -114, -704, -842, 499, -883, -248, -622, -600, 562, -586, -523, 50, -995, -807, -633, 112, -528, -929, 645, -251, -619, -160, 30, -433, -693, -381, 868, -825, -651, -486, 752, 848, 174, -357, -865, -529, 203, 454, 328, 69, -482, 99, 434, 483, -874, 506, 234, -80, 135, 441, 394, -416, 811, -297, -319, 605, -192, 265, -742, 659, -943, 102, 603, 613, 553, -361, 998, 490, -631, 496, 72, 308, 428, -73, -648, -246, 257, -897, 461, -530, 672, -312, -951, -421, 279, -748, 860, 305, 796, 793, -372, -660, -579, -727, 638, -66, -15, 62, 202, -281, -575, 337, 822, -259, 302, 453, 588, -999, -263, 378, 805, -691, 60, 885, -722, 972, -806, -172, -360, 943, -484, -49, -718, -324, 814, 173, 98, 617, 694, 114, -582, 131, -423, -827, -757, 529, -129, -203, 287, -458, 213, -315, 111, 1, -89, 312, 315, -885, 65, -122, -241, -686, -72, -37, 534, -127, 639, -155, -743, 408, 933, 788, 989, 353, 830, 341, -483, 243, 819, -70, 286, -761, 184, -562, -701, 220, 475, 964, -325, 176, 371, -808, -694, 136, -775, -46, 855, -944, -228, 133, -559, 560, 891, -526, -202, -226, -721, 790, 918, 877, -414, -451, -855, -296, -634, 664, 289, -343, 163, 306, 993, -590, 742, -224, -185, 301, 190, 667, 297, 567, -710, 425, -754, 465, -63, 439, -271, 172, 389, 459, -434, -644]
# sE: 5,744;
# a = [332, -870, 775, 538, -801, 146, -71, 417, -104, -686, 270, -712, -372, 427, -775, 701, 44, 420, -680, 276, 419, 396, -142, -250, -214, 808, 508, 647, -511, -311, -526, 605, 825, -218, -959, -886, -601, -889, 328, -301, -764, -124, -964, -398, 612, -765, 27, -340, 32, 681, 455, 155, 145, -548, 144, 552, -778, -312, -816, 847, -33, -497, 755, -459, 425, 336, 5, -282, 579, -269, -853, 0, 513, 671, -951, 347, -154, -634, -500, -736, 412, -35, -491, -268, 977, -78, 638, -348, -535, -216, 461, -637, 516, 98, -840, 441, 324, 319, -937, 947, 66, 852, -704, -233, -112, 563, 414, -915, -912, -534, -553, 62, -723, -954, 119, 798, -857, -612, -848, 928, -9, -948, -152, 401, -195, 711, 277, -353, 80, -259, -693, -478, 522, -7, -424, 153, 663, -906, 335, -27, -976, -567, 136, -58, -823, 677, 59, -91, -6, -90, -947, 708, 170, -400, 603, 799, -961, -621, -547, -467, 97, -644, -74, 596, 384, 537, 83, 980, 466, 696, -796, -539, -192, 614, -465, 475, -768, -36, -898, 593, 26, 505, 606, -708, -572, 876, -725, 183, 662, -381, -321, 590, -878, -519, 715, -320, 330, 182, -469, -153, -605, 234, 654, -622, -273, 301, 134, -641, 984, 570, -364, 194, 881, 102, 364, 867, -272, 250, -405, 525, 468, -226, 292, 96, -355, -325, -515, -672, -900, 530, 805, 111, -562, 816, 921, -540, -434, -707, 172, -939, 198, -551, -342, 949, 498, -518, 184, -118, -864, -521, 604, 855, -950, -70, 291, 550, -168, 228, -99, -217, -5, 365, 883, -573, 349, -650, 320, -600, 823, -713, 827, 996, 310, -897, -584, -918, 290, 953, 772, 84, 568, 699, 235, 397, 39, -327, 854, 567, -983, 987, 141, 872, 201, 975, 686, -930, -821, -389, -454, 515, 774, 539, -59, -531, 966, 343, -359, 457, 985, -626, -117, -960, 725, 600, -919, 555, -137, 535, -839, -828, 368, -694, -590, 961, -122, 969, -728, -863, 53, -285, 334, 94, 56, 186, -928, 683, 13, 147, -699, 163, 302, 918, -769, 571, 375, -461, 48, 768, -435, -77, 423, -777, -262, 637, -135, 710, 737, -749, -932, 507, 920, 602, -949, 565, 138, 306, 263, -464, -444, 804, 661, 254, 700, -425, -549, 514, -175, -189, -498, -160, -556, 834, -978, 864, 1000, -371, -474, 666, -252, 116, -489, 788, 838, -25, -731, -895, 697, 529, -390, 828, -84, -40, -810, -123, -544, -378, 859, -887, 744, 674, -595, -829, -759, 206, 821, -617, -561, 286, -517, 189, -148, 61, 591, -451, -114, -303, -698, -161, 149, 574, -261, -120, -334, -909, -156, -811, 362, 899, 317, -416, -820, -28, -602, -171, 965, 922, 490, -504, -45, 780, 885, 95, 462, -944, 991, 954, -541, 756, -559, -420, -307, 374, -593, -56, 188, -2, 181, 403, 518, -241, 358, -65, 329, 727, 30, -564, 656, 222, -314, -619, -524, 259, -817, 886, 338, 481, -791, 107, -674, -184, 73, -422, -86, -647, 668, 652, -288, 613, -322, -794]
# sE: 5,815;
# a = [4685, 2932, 604, 6690, 2293, 9811, 9590, 8610, 4231, 7773, 8874, 8551, 1445, 7303, 9398, 2452, 6278, 2479, 3722, 6383, 9402, 9684, 2572, 8194, 5473, 9963, 6702, 1942, 9132, 7068, 9783, 6111, 7723, 7471, 6716, 2143, 8574, 302, 5189, 8793, 9459, 4983, 6169, 1792, 8001, 7111, 8931, 153, 487, 3594, 2832, 2183, 1676, 8621, 4136, 4494, 4186, 5492, 2253, 4319, 8928, 7224, 771, 5590, 2956, 5839, 7897, 2284, 9730, 5320, 3598, 2819, 3078, 5548, 5265, 8857, 9782, 2165, 245, 9792, 2082, 8810, 7356, 890, 1331, 2118, 2139, 1712, 3076, 7369, 6524, 4372, 5994, 6439, 3306, 7158, 1783, 5595, 192, 3578, 6008, 8340, 3760, 3643, 5713, 7799, 6332, 9907, 3567, 2045, 4116, 6679, 2636, 7439, 6451, 4528, 7360, 3969, 6891, 9372, 3664, 2454, 4246, 3986, 520, 956, 6437, 5672, 8084, 4543, 7239, 7908, 6185, 7614, 2424, 9008, 9278, 9013, 75, 827, 2914, 3938, 4663, 8202, 9618, 7863, 6656, 5906, 6052, 6043, 5880, 9181, 2226, 1834, 6384, 8763, 5000, 3278, 1423, 2486, 3526, 3198, 2326, 4866, 2198, 1732, 9415, 4169, 9236, 4636, 490, 4010, 3408, 5196, 7400, 698, 7967, 9926, 2517, 125, 9853, 8475, 9508, 225, 9448, 7101, 4367, 1364, 7452, 3462, 4758, 7836, 8097, 843, 4926, 2386, 57, 5698, 2449, 2581, 27, 8959, 1845, 7788, 8415, 8116, 9361, 6390, 1890, 1434, 3852, 3983, 9400, 5673, 5981, 8274, 833, 579, 4612, 9437, 1274, 3411, 2265, 6861, 3714, 3639, 1402, 4846, 1722, 1187, 6605, 628, 3199, 2596, 6462, 4068, 8355, 7792, 5035, 1973, 8379, 3736, 2497, 229, 3450, 4909, 2568, 4868, 1220, 4570, 2103, 8075, 6535, 2394, 9572, 305, 1134, 9982, 227, 9965, 7647, 4120, 6474, 6803, 1820, 5754, 2142, 5336, 7532, 1337, 2531, 9826, 2831, 8935, 3721, 4953, 9685, 7857, 6339, 6387, 1707, 6673, 7995, 7512, 1818, 9343, 4650, 712, 3457, 2925, 9304, 7206, 989, 2942, 4458, 2659, 1176, 4128, 3651, 1623, 2399, 5476, 4973, 1427, 7867, 6994, 6176, 6800, 2267, 9034, 4718, 8391, 7522, 4898, 1832, 4420, 1182, 5458, 4941, 6531, 1214, 6279, 8911, 7398, 8048, 4133, 2325, 855, 6597, 2791, 9326, 333, 9713, 350, 3444, 9084, 3358, 5524, 8754, 388, 52, 3477, 9716, 1968, 2536, 1438, 320, 5283, 5166, 7733, 191, 2578, 6285, 4490, 3692, 8112, 4196, 685, 2317, 6074, 700, 9536, 7737, 2867, 5420, 5962, 5809, 2690, 8892, 8532, 9512, 4193, 4259, 9108, 2642, 3081, 9957, 7743, 7463, 6117, 7595, 9210, 8819, 8009, 6269, 4609, 2177, 5314, 5451, 3600, 9576, 6961, 9182, 8461, 3357, 7141, 7676, 2879, 8731, 3812, 799, 9421, 9643, 5735, 5380, 6012, 1838, 1499, 4028, 8182, 3601, 8136, 6016, 3678, 5862, 5857, 3673, 5845, 8577, 271, 565, 6218, 246, 8795, 4401, 4462, 6623, 9196, 7146, 2820, 6992, 9758, 7952, 94, 5132, 8440, 5216, 8976, 3483, 73, 7405, 5635, 2387, 5608, 644, 1199, 4003, 2686, 522, 6388, 288, 2090, 2166, 9586, 2936, 3777, 3766, 6010, 4814, 9475, 4240, 1906, 8307, 7603, 3382, 9707, 881, 9836, 3284, 4257, 7690, 9986, 1379, 9153, 7651, 7094, 5907, 7091, 2391, 4157, 5118, 7348, 7436, 6726, 7567, 1356, 7508, 3732, 4840, 3434, 6276, 7923, 9634, 8173, 2853, 2466, 8067, 3123, 9610, 6308]
# sE: 5,556;
# a = [4610, 9699, 9731, 289, 3805, 5239, 2538, 2167, 3258, 4825, 8409, 1974, 5482, 6154, 9617, 8500, 3373, 2481, 8384, 8773, 5420, 4236, 753, 4638, 6810, 5991, 8849, 9224, 4943, 327, 1265, 4984, 3202, 4087, 6231, 3972, 4543, 1707, 1237, 8308, 7643, 3199, 4720, 2743, 8431, 5485, 3610, 9853, 5635, 7169, 5687, 3815, 9018, 2202, 1036, 8522, 8718, 757, 7484, 5280, 6569, 7654, 8366, 7431, 7828, 2418, 5697, 7501, 7218, 4359, 199, 1959, 6677, 234, 6777, 5070, 9414, 1780, 6773, 7419, 2350, 9431, 4040, 707, 9516, 4184, 356, 3874, 2501, 5780, 317, 4837, 7773, 6124, 8485, 510, 5694, 7850, 7223, 3228, 1041, 3442, 5476, 8915, 3612, 8927, 8014, 9256, 8942, 3752, 4260, 3190, 3367, 32, 2444, 2450, 8000, 5913, 675, 1332, 204, 4007, 1208, 4570, 10000, 7566, 8120, 1476, 364, 9432, 4527, 131, 6738, 6116, 6014, 7273, 2640, 1223, 3736, 9720, 2796, 2477, 8048, 2115, 4185, 6969, 1967, 5431, 1172, 3186, 270, 6510, 7503, 2856, 8341, 8326, 618, 2101, 4539, 8777, 1725, 5760, 5432, 2591, 1333, 4673, 6368, 4251, 983, 6066, 7350, 5717, 41, 7664, 5046, 1518, 7235, 5801, 7607, 3084, 9586, 9368, 3533, 3764, 9034, 775, 7081, 4826, 9308, 3465, 4072, 3929, 7849, 7154, 5394, 8553, 6519, 4871, 951, 5656, 2143, 1986, 9033, 4651, 8434, 5389, 427, 5858, 5529, 8245, 2571, 8410, 5217, 5862, 7385, 5412, 2181, 4232, 4017, 1869, 1917, 9497, 1155, 7135, 5224, 2471, 646, 8731, 551, 6571, 4983, 602, 8586, 7556, 866, 50, 2457, 7392, 2916, 4116, 9874, 3271, 9534, 7315, 1060, 7719, 5879, 3836, 5974, 5253, 9779, 9430, 1065, 5369, 475, 1071, 4002, 1216, 7823, 8399, 3509, 2052, 4421, 7016, 3466, 5186, 1899, 8067, 6170, 46, 488, 6246, 9331, 8829, 8225, 3842, 1560, 4450, 9052, 5705, 8324, 6349, 6541, 4468, 8454, 988, 1275, 1519, 3765, 7427, 2191, 6069, 7170, 5148, 2598, 3251, 851, 7398, 4346, 1287, 8674, 8547, 7250, 6731, 7885, 2073, 2263, 5561, 2936, 1310, 7836, 6716, 1876, 37, 4066, 8668, 78, 400, 7104, 140, 1775, 1732, 7635, 5457, 9287, 3869, 8169, 9872, 3631, 2699, 9384, 5292, 3876, 4948, 610, 7465, 1703, 740, 5179, 8233, 6356, 8865, 5266, 6095, 6277, 1829, 2116, 8759, 1570, 2218, 5917, 8998, 0, 8268, 5822, 3605, 6939, 7713, 8929, 4223, 4560, 9870, 9735, 3831, 7034, 3704, 6600, 2989, 9390, 2992, 8260, 7971, 839, 3132, 3087, 9433, 4127, 7260, 9681, 8806, 6048, 8057, 2311, 6394, 5998, 8856, 7125, 4505, 8166, 8751, 2961, 4733, 5249, 9057, 5161, 8037, 1378, 5782, 1896, 2219, 5201, 5926, 4669, 1655, 6265, 1955, 6455, 5853, 2671, 5057, 6424, 5466, 1233, 6467, 526, 5311, 2403, 6659, 3970, 1042, 8969, 7867, 8851, 2811, 8237, 1929, 6049, 8965, 5496, 2147, 1817, 2498, 4808, 1987, 12, 2805, 4785, 3826, 4263, 6227, 1058, 7036, 6551, 2820, 9335, 5205, 1020, 542, 8404, 7801, 2745, 810, 9496, 9638, 4335, 4128, 3157, 1134, 7291, 1787, 8488, 1671, 9260, 8240, 2546, 9526, 3050, 6399, 7132, 72, 5750, 5447, 2082, 1091, 9940, 917, 5949, 9121, 2702, 9462, 2486, 9983, 1920, 631, 9212, 7666, 4020, 824, 7940, 1121, 3650, 2928, 5162, 2316, 8862, 4490, 8344, 2641, 829, 9108]
# sE: 5,764;
# a = [8969, 6582, 6331, 1690, 725, 2067, 956, 6387, 2448, 8210, 4033, 8823, 6216, 3976, 6304, 362, 2070, 8213, 9939, 3131, 8966, 5620, 3728, 9619, 8657, 2876, 2736, 3937, 5987, 5501, 9686, 8260, 4845, 3564, 2164, 8377, 6444, 6723, 3502, 5941, 8087, 9324, 7577, 6145, 7829, 9044, 2174, 6332, 7738, 7900, 2840, 2426, 2670, 284, 3141, 7841, 6771, 2468, 2680, 4764, 1963, 8004, 1231, 5125, 3918, 5909, 8890, 6831, 5306, 3371, 8112, 367, 3942, 8421, 1025, 4848, 2216, 7959, 5669, 41, 5160, 7540, 9917, 4236, 4199, 4511, 4056, 8319, 6024, 4965, 4013, 2608, 2382, 6761, 7815, 4392, 7167, 6987, 8414, 2520, 4035, 5076, 1489, 194, 5888, 7499, 763, 6290, 2428, 4343, 6454, 9816, 4128, 5548, 6329, 4925, 1888, 8407, 3774, 6327, 3219, 6586, 4577, 8217, 4179, 484, 1332, 436, 9250, 7626, 2338, 2590, 5794, 2105, 3314, 5524, 306, 7156, 8978, 4015, 4267, 9298, 841, 2144, 7563, 2904, 5401, 5295, 9887, 3762, 3060, 8905, 7910, 7726, 7697, 3263, 1638, 5490, 667, 3276, 6546, 5737, 8199, 9982, 1774, 1401, 8913, 4874, 9339, 1169, 7846, 7339, 7988, 2327, 1727, 127, 9696, 8135, 1874, 6254, 7325, 8271, 3707, 5782, 5593, 6865, 6697, 8369, 8643, 6281, 1361, 3856, 4282, 311, 9628, 3613, 5836, 9022, 4762, 6214, 1760, 3772, 2432, 8448, 1284, 4679, 5918, 323, 9679, 2559, 1737, 1908, 1535, 2279, 5535, 3073, 8296, 469, 2199, 3208, 7155, 5873, 9154, 5255, 4802, 7044, 4661, 5380, 8658, 379, 8832, 3135, 8754, 1531, 8036, 2268, 6505, 4293, 552, 5165, 3724, 2131, 7765, 1320, 1130, 76, 7062, 6092, 859, 9885, 4042, 2595, 6566, 9956, 4632, 2433, 8462, 7445, 4200, 9709, 9062, 8278, 7789, 5027, 5262, 4541, 6814, 6557, 7344, 1482, 4458, 4629, 9263, 6787, 5866, 7734, 8234, 4386, 9112, 5564, 1881, 9070, 4513, 842, 222, 6705, 3855, 5001, 3880, 1817, 7702, 6376, 9230, 7202, 97, 1712, 4834, 5368, 8007, 9106, 103, 7473, 5711, 4108, 3445, 715, 7441, 9207, 5115, 3409, 1616, 2596, 6573, 4835, 4666, 8548, 713, 5871, 9744, 2973, 7614, 4279, 3515, 282, 9067, 6206, 3974, 9525, 4111, 1372, 7343, 2287, 6313, 5693, 6253, 4091, 3007, 5458, 6844, 9014, 8311, 2922, 9049, 525, 9773, 7095, 8297, 6518, 661, 9373, 3585, 7521, 5256, 5875, 6792, 2479, 1285, 8120, 3599, 143, 3430, 3406, 518, 954, 1068, 302, 1701, 7355, 8909, 3701, 264, 5612, 5712, 8523, 5667, 5624, 942, 3055, 5079, 885, 4116, 8660, 9778, 7525, 1913, 8499, 9568, 102, 2612, 736, 706, 6031, 7632, 3399, 3908, 2049, 3429, 6003, 5286, 2630, 2574, 3865, 8655, 8820, 8854, 6418, 955, 1572, 8348, 3978, 421, 4494, 3361, 7756, 9876, 1716, 2653, 2741, 581, 622, 3348, 399, 7757, 1594, 2004, 3155, 64, 1237, 4459, 2609, 9905, 1586, 4442, 8646, 5797, 3451, 9575, 5929, 2400, 1841, 3330, 4249, 8693, 6390, 2854, 3165, 1767, 7153, 389, 2099, 8327, 2146, 4791, 2933, 4711, 6344, 6448, 8321, 8802, 1992, 1083, 2377, 8038, 6058, 6877, 7449, 7237, 1534, 4268, 1102, 9209, 4432, 994, 2528, 7613, 8498, 5953, 131, 2245, 166, 5615, 7889, 2277, 6301, 9032, 5559, 9920, 3439, 4353, 2281, 6220, 6502, 6461, 1087, 669, 618, 5970, 6403, 8994, 4849]
# sE: 5,847;
# a = [7588, 3555, 1048, 9347, 7288, 2169, 1990, 473, 6331, 7705, 3982, 1767, 8185, 4519, 1209, 3546, 7658, 7882, 5790, 7919, 8863, 4822, 4250, 8736, 4485, 8917, 2472, 2441, 1812, 9593, 9634, 6462, 7691, 620, 5122, 2455, 2214, 5204, 7026, 3945, 9150, 9484, 5137, 6148, 566, 3258, 7550, 5110, 1172, 9695, 1208, 788, 3103, 1977, 828, 7863, 5772, 6984, 8282, 2221, 3265, 9882, 4708, 9089, 508, 9356, 4450, 5531, 5669, 3298, 107, 1827, 205, 8763, 8967, 6017, 7615, 5949, 1304, 272, 4776, 6214, 9487, 2912, 2492, 5904, 2033, 4319, 6731, 5558, 7202, 851, 4174, 5349, 8968, 8377, 6932, 2828, 4372, 2267, 7439, 9165, 1824, 7307, 3230, 471, 281, 9192, 8624, 3711, 8386, 8295, 8343, 5140, 5543, 4891, 6842, 2190, 7493, 8752, 4627, 822, 1909, 2288, 3565, 7216, 1722, 7345, 8913, 4917, 6685, 7051, 2748, 1485, 954, 1102, 4289, 647, 5764, 1467, 2098, 7474, 1743, 5363, 7019, 6570, 8902, 493, 9822, 5480, 390, 7146, 4405, 4959, 4666, 4771, 67, 4565, 9714, 6826, 8669, 4411, 5554, 5645, 5327, 6871, 1971, 562, 517, 3062, 8495, 5407, 2654, 2541, 6796, 7965, 2775, 6166, 8161, 4041, 9955, 3511, 4353, 2052, 4647, 7922, 1199, 1559, 4300, 4129, 6049, 7347, 7066, 3932, 2677, 2545, 6558, 155, 8866, 7764, 5842, 1645, 3760, 9500, 8241, 4048, 2783, 7981, 6088, 4576, 6150, 6458, 5405, 8513, 6364, 5318, 5550, 5495, 1646, 8278, 4673, 6425, 5660, 2621, 5634, 4182, 283, 1215, 601, 7735, 93, 5036, 4543, 7241, 4122, 186, 2954, 1025, 3313, 4975, 2843, 9797, 3175, 847, 4220, 4667, 2520, 7707, 4054, 1358, 2738, 8896, 5396, 2156, 1237, 5603, 1216, 9289, 4839, 2245, 3729, 2652, 7804, 5147, 1252, 2607, 2225, 6605, 1401, 9994, 1121, 3923, 7812, 2617, 1, 7645, 7918, 1342, 3694, 4746, 800, 9860, 9720, 6934, 9272, 5921, 2549, 8215, 4693, 2640, 8678, 2160, 8918, 2139, 2987, 4789, 4564, 6969, 1589, 2512, 3949, 7420, 9307, 4020, 2624, 8594, 4827, 4205, 5591, 2144, 4692, 8517, 8856, 4219, 2464, 1718, 9794, 5047, 9536, 8997, 1725, 4973, 779, 9019, 8312, 4234, 5271, 274, 2697, 1438, 9231, 898, 472, 2686, 6040, 3432, 4261, 8376, 101, 9045, 4057, 5787, 2566, 2522, 9898, 6368, 8286, 2383, 1195, 53, 3366, 9440, 5538, 7563, 6024, 8793, 5342, 1422, 6841, 6345, 8677, 597, 830, 3878, 721, 2850, 8723, 1201, 5702, 8576, 2407, 5152, 8855, 7430, 4524, 9340, 1610, 8252, 7443, 5032, 5574, 191, 9858, 2985, 6522, 1437, 1309, 431, 8465, 6767, 5970, 68, 8303, 697, 4728, 3811, 4592, 8769, 6995, 6716, 1104, 1472, 7852, 6074, 3935, 8733, 9140, 535, 6412, 2170, 3509, 2470, 372, 6369, 559, 6335, 7268, 3485, 7073, 7761, 7958, 4212, 5230, 9060, 5474, 329, 8548, 5377, 6431, 6315, 6367, 38, 501, 6373, 8400, 6922, 9237, 6495, 1499, 665, 4345, 9825, 2003, 9643, 5361, 3217, 7219, 2048, 2415, 5415, 8339, 8694, 2860, 2797, 6291, 4005, 4213, 9497, 5365, 6920, 6065, 8645, 862, 1473, 4643, 1488, 5463, 8243, 1144, 5816, 8232, 9034, 1833, 522, 1717, 4081, 2483, 8971, 5553, 7688, 9115, 2010, 4738, 2784, 419, 7750, 5058, 8679, 8402, 7094, 322, 7626, 4505, 2953, 8954, 5843, 5952, 7871, 4445, 1397]
# sE: 5,480;
# a = [7246, 4974, 6083, 4085, 256, 6962, 6019, 6261, 4438, 7943, 9976, 7004, 768, 7990, 8468, 8122, 8494, 3987, 1550, 7171, 8994, 7119, 366, 9228, 5996, 4937, 5974, 2443, 5351, 7920, 4791, 1245, 3231, 7419, 971, 6807, 1432, 5798, 7868, 387, 3034, 4530, 3316, 46, 6108, 7820, 266, 2437, 6666, 4537, 7482, 2316, 3047, 4259, 4459, 9185, 7253, 468, 6899, 736, 5848, 7145, 1797, 7151, 3666, 5162, 2911, 1442, 9097, 8216, 7357, 1480, 7978, 122, 2659, 5648, 5709, 316, 7368, 5642, 7292, 4706, 5183, 4672, 2542, 4296, 3839, 2252, 2614, 5750, 7160, 8528, 8025, 3905, 6978, 1716, 1745, 559, 8162, 105, 7502, 8526, 3352, 612, 1493, 8132, 1614, 1860, 226, 7630, 8812, 9265, 1693, 9336, 8385, 3254, 6817, 6515, 8718, 8628, 8558, 2880, 4192, 6782, 1345, 3033, 4740, 6037, 3068, 3767, 5690, 8156, 3242, 278, 3152, 1924, 7103, 7418, 4221, 6095, 5661, 3336, 3098, 113, 1319, 8095, 1334, 3293, 18, 9672, 6667, 5558, 9357, 4968, 6434, 3142, 3041, 5610, 9804, 6117, 4602, 2555, 7805, 7950, 8817, 4108, 3252, 5749, 2018, 7777, 6910, 2603, 9409, 5864, 7744, 2490, 1735, 5414, 5569, 5209, 3096, 5004, 7688, 6295, 3300, 244, 5434, 2231, 1391, 3678, 1568, 8411, 9858, 6566, 8364, 3949, 8687, 3299, 8057, 7914, 8478, 7327, 6643, 9559, 8371, 9256, 2107, 9485, 829, 4449, 5949, 281, 8642, 1968, 7570, 4420, 7258, 5083, 352, 1426, 2464, 7332, 4524, 5758, 6759, 9658, 6247, 2416, 787, 6267, 3371, 6568, 1970, 4977, 4037, 8379, 7192, 3581, 9637, 1823, 1665, 8124, 3407, 9021, 6508, 7959, 2141, 9348, 6343, 697, 4102, 9671, 8905, 1022, 8756, 3575, 648, 2564, 4836, 5025, 7362, 3846, 1718, 133, 995, 5375, 3523, 4053, 2144, 255, 7497, 7698, 6995, 6531, 6021, 2197, 7176, 2593, 6740, 4955, 2569, 2871, 8366, 3765, 2959, 5024, 218, 4567, 322, 4940, 1557, 367, 7861, 7622, 6109, 1070, 1372, 4954, 2683, 5726, 1001, 5529, 1631, 7113, 4875, 3218, 8554, 1128, 1259, 7974, 5084, 4987, 4634, 9085, 5538, 2596, 293, 8225, 3677, 7299, 3966, 7781, 490, 2206, 5449, 8737, 6510, 950, 7792, 2998, 8547, 4216, 3779, 1769, 708, 8582, 8332, 9275, 7409, 9143, 9043, 9648, 8464, 3455, 8309, 1471, 4669, 1129, 8193, 1035, 4289, 2995, 826, 9014, 5427, 2941, 8235, 6975, 8056, 595, 5406, 6786, 2456, 5139, 260, 3687, 8655, 2859, 5108, 6007, 2519, 2571, 1146, 3631, 9604, 4864, 1773, 4100, 6358, 9674, 4831, 8977, 1347, 6879, 4244, 8784, 3412, 7911, 9377, 9463, 333, 3958, 915, 3069, 6456, 1794, 6402, 8344, 9894, 1654, 5328, 3269, 4751, 9962, 6586, 3074, 9791, 6901, 8168, 57, 5992, 9927, 3838, 1910, 4305, 10000, 6400, 9402, 7830, 7580, 9010, 8911, 4755, 421, 4049, 4531, 238, 9714, 9628, 3159, 693, 7584, 704, 7656, 6347, 8863, 1997, 4309, 50, 8634, 5457, 8835, 5020, 7707, 5490, 1009, 5415, 77, 377, 5177, 6028, 4708, 3999, 166, 224, 4088, 3303, 6863, 6263, 7971, 4897, 9753, 2653, 7561, 5685, 7941, 4734, 2484, 2682, 9649, 3686, 3514, 3820, 9059, 7318, 6045, 9327, 2420, 7783, 5751, 4563, 5632, 4542, 30, 3549, 2093, 662, 5535, 696, 5556, 5218, 4732, 8604, 7604, 9789, 221, 8789, 3816, 6227, 9217]
maxx = 100000
# maxx = 6
stack_fix_split = False
stack_fix_split = True
def print_it():
print "\na: ", a
# print "s: ", s
print "b: ", b
# print "sr: ", sr
# print "ar: ", sorted(a, reverse=True)
def rotate_push(stack, index):
size = len(stack)
if size - index < index:
return (size - index) * -1
else:
return index
def find_spot(stack, num, minimum, maximum):
maxi = b.index(maximum)
mini = b.index(minimum)
size = len(stack)
# print "maximum: ", maximum
# print "minimum: ", minimum
# print "size: ", size
if (num >= maximum):
# maximum = num
return (maxi)
if (num <= minimum):
# minimum = num
return (mini + 1)
if maxi == 0:
for i, e in enumerate(stack):
if e < num:
return i
return (size)
# print "\n\n"
for i, e in enumerate(range(maxi, size)):
# print "b[", i, "+", maxi, "]: ", b[i + maxi]
if b[i + maxi] < num:
return i + maxi
for i, e in enumerate(range(0, mini + 1)):
# print "b[", i, "]: ", b[i]
if b[i] < num:
return i
return (0)
def rotate_spot(stack, num, minimum, maximum):
spot = find_spot(stack, num, minimum, maximum)
size = len(stack)
# print ""
# print "size: ", size
# print "spot: ", spot
# print "spot - size: ", spot - size
# print "size - spot: ", size - spot
# print "0 - spot: ", 0 - spot
if size - spot == 0:
# print "rotate_spot: size - spot == 0 -> ", spot
return 0
elif size - spot < spot:
# print "rotate_spot: size - spot < spot -> ", spot
return spot - size
# else:
# print "rotate_spot: size - spot"
# return spot
# print "rotate_spot: default -> ", spot
return spot
def rotate_db_path(rot_push, rot_spot):
size_a = len(a)
size_b = len(b)
# if rot_push * rot_spot <= 0:
# if rot_spot < 0:
# if size_b + rot_spot <= rot_push:
# rot_spot = size_b + rot_spot
# else:
# if rot_spot - size_b >= rot_push:
# rot_spot = rot_spot - size_b
# if rot_push < 0:
# if size_a + rot_push <= rot_spot:
# rot_push = size_a + rot_push
# else:
# if rot_push - size_a >= rot_spot:
# rot_push = rot_push - size_a
if (rot_push > 0 and rot_spot > 0) or (rot_push < 0 and rot_spot < 0):
return 1 + max(abs(rot_push), abs(rot_spot))
else:
return 1 + abs(rot_push) + abs(rot_spot)
def prep_stack_push(rot_push, rot_spot):
size_a = len(a)
size_b = len(b)
while rot_push != 0 or rot_spot != 0:
# if rot_push * rot_spot <= 0:
# if rot_spot < 0:
# if size_b + rot_spot <= rot_push:
# rot_spot = size_b + rot_spot
# else:
# if rot_spot - size_b >= rot_push:
# rot_spot = rot_spot - size_b
# if rot_push < 0:
# if size_a + rot_push <= rot_spot:
# rot_push = size_a + rot_push
# else:
# if rot_push - size_a >= rot_spot:
# rot_push = rot_push - size_a
if (rot_push > 0 and rot_spot > 0):
rr()
rot_push -= 1
rot_spot -= 1
elif(rot_push < 0 and rot_spot < 0):
rrr()
rot_push += 1
rot_spot += 1
if rot_push > 0:
ra()
rot_push -= 1
elif rot_push < 0:
rra()
rot_push += 1
if rot_spot > 0:
rb()
rot_spot -= 1
elif rot_spot < 0:
rrb()
rot_spot += 1
# print "pre push a: ", a
# print "pre push b: ", b
def merge_b():
while len(b) > 0:
pa()
n = len(a)
# n = 100; a = random.sample(range(10000), n)
b = []
past = list(a)
s = sorted(a)
sr = sorted(s, reverse=True)
og = list(a)
print_it()
# pb();
# # pb();
# # pb();
# # rb()
# # rb();
# # pb();
# # stack_fix()
# # rb();
# print_it()
# short_index = 0
# short_value = 2147483647
# for i, e in enumerate(a):
# push = rotate_push(a, i)
# spot = find_spot(b, e)
# rot_spot = rotate_spot(b, e)
# total = rotate_db_opt(push, rot_spot)
# print "\ni: ", i, " e: ", e
# print "push: ", push
# print "spot: ", spot
# print "rot_spot: ", rot_spot
# print "total: ", total
# if total < short_value:
# short_value = total
# short_index = i
# print short_index
# print short_value
# maxx = 100000
# # maxx = 6
iteri = 0
pb()
# pb()
# if b[0] != min(b):
# sb()
total_push = 0
num_push = 0
push_array = []
total_spot = 0
num_spot = 0
spot_array = []
num_array = []
total_total = 0
num_total = 0
total_array = []
len_a_array = []
len_b_array = []
stats_iter = 0
push_iter = []
spot_iter = []
total_iter = []
num_iter = []
fake_a = []
fake_b = []
chosen_i = 0
# while b != sr and iteri < maxx:
# while len(a) > 0 and iteri < maxx:
while len(a) > 0:
# if a == sorted(a, reverse=True) and min(a) > max(b):
# break;
short_index = 0
short_value = 2147483647
minimum = min(b)
maximum = max(b)
for i, e in enumerate(a):
# print "\ni: ", i, "e: ", e
push = rotate_push(a, i)
rot_spot = rotate_spot(b, e, minimum, maximum)
total = rotate_db_path(push, rot_spot)
if total < short_value:
short_value = total
short_index = i
# if iteri == stats_iter:
# num_iter.append(e)
# push_iter.append(push)
# spot_iter.append(rot_spot)
# total_iter.append(total)
# fake_b = list(b)
# fake_a = list(a)
rot_push = rotate_push(a, short_index)
rot_spot = rotate_spot(b, a[short_index], minimum, maximum)
# total_push += abs(rot_push)
# total_spot += abs(rot_spot)
# total_total += short_value
# num_push += 1
# num_spot += 1
# num_total += 1
# len_a_array.append(len(a))
# len_b_array.append(len(b))
# num_array.append(a[short_index])
# push_array.append(rot_push)
# spot_array.append(rot_spot)
# total_array.append(short_value)
# if iteri == stats_iter:
# chosen_i = short_index
# print "action:"
# print "num: ", a[short_index]
# print "rot_push: ", rot_push
# print "rot_spot: ", rot_spot
# print "spot: ", find_spot(b, a[short_index], minimum, maximum)
# print "short_value: ", short_value
# print "short_index: ", short_index
# print "op: ", op
prep_stack_push(rot_push, rot_spot)
pb()
# print_it()
# iteri += 1
if len(b) / 2 > b.index(max(b)):
while b[0] != max(b):
rb()
else:
while b[0] != max(b):
rrb()
merge_b()
# print ""
# print "stats: "
# print "total push path: ", total_push
# print "count push path: ", num_push
# print "avg push path: ", total_push / num_push
# print "median push path: ", push_array[len(push_array)/2]
# print "push paths: ", push_array
# print ""
# print "total spot path: ", total_spot
# print "count spot path: ", num_spot
# print "avg spot path: ", total_spot / num_spot
# print "median spot path: ", spot_array[len(spot_array)/2]
# print "spot paths: ", spot_array
# print ""
# print "total total path: ", total_total
# print "count total path: ", num_total
# print "avg total path: ", total_total / num_total
# print "median total path: ", total_array[len(total_array)/2]
# print "total paths: ", total_array
# print ""
# for i, e in enumerate(push_array):
# if i % 3 == 0 and i != 0:
# print ""
# print "i: %3d -> " % i, "%5d" % num_array[i], "(%4d" % e, ", %4d" % spot_array[i], ", %4d" % total_array[i], ", %3d" % len_a_array[i], ", %3d)" % len_b_array[i], " ",
# print ""
# print ""
# print "stat_iter: ", stats_iter, " choose: ", chosen_i
# for i, e in enumerate(push_iter):
# if i % 4 == 0 and i != 0:
# print ""
# print "i: %3d -> " % i, "%5d" % num_iter[i], "(%4d" % e, ", %4d" % spot_iter[i], ", %4d)" % total_iter[i], " ",
# print ""
# print ""
# print "fake_a: ", fake_a
# print ""
# print ""
# print "fake_b: ", fake_b
print ""
print "original: ", og
print_it()
print "\nopts: ", op
print "sorted: ", a == sorted(a)
| 91.419301
| 3,195
| 0.580165
| 9,585
| 54,943
| 3.298696
| 0.409077
| 0.010627
| 0.003036
| 0.002657
| 0.069328
| 0.054842
| 0.038902
| 0.028528
| 0.024923
| 0.023721
| 0
| 0.610019
| 0.210891
| 54,943
| 600
| 3,196
| 91.571667
| 0.119245
| 0.88297
| 0
| 0.37788
| 0
| 0
| 0.006478
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.018433
| null | null | 0.050691
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1e98286d5ba881d7caf0900b014028237ba3828d
| 179
|
py
|
Python
|
pagesext/tests/urls.py
|
dlancer/django-pages-cms-extensions
|
4aa6f2780abef9543ced20258ede01a9662167b3
|
[
"BSD-3-Clause"
] | 1
|
2016-07-08T07:23:20.000Z
|
2016-07-08T07:23:20.000Z
|
pagesext/tests/urls.py
|
dlancer/django-pages-cms-extensions
|
4aa6f2780abef9543ced20258ede01a9662167b3
|
[
"BSD-3-Clause"
] | null | null | null |
pagesext/tests/urls.py
|
dlancer/django-pages-cms-extensions
|
4aa6f2780abef9543ced20258ede01a9662167b3
|
[
"BSD-3-Clause"
] | null | null | null |
from django.conf.urls import url, include
from django.conf.urls.i18n import i18n_patterns
urlpatterns = i18n_patterns(url(r'^page/', include('pages.urls', namespace='pages')), )
| 35.8
| 87
| 0.765363
| 26
| 179
| 5.192308
| 0.538462
| 0.148148
| 0.207407
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03681
| 0.089385
| 179
| 4
| 88
| 44.75
| 0.791411
| 0
| 0
| 0
| 0
| 0
| 0.117318
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1ead3048b7789305eb7eb19d9e3250b6f4b9f962
| 47
|
py
|
Python
|
pytest_cache_assert/_check_assert/__init__.py
|
KyleKing/pytest_cache_assert
|
eecfeff3824117cc4606f37c88e1735e31a82540
|
[
"MIT"
] | 3
|
2021-11-05T04:48:38.000Z
|
2022-02-28T10:01:39.000Z
|
pytest_cache_assert/_check_assert/__init__.py
|
KyleKing/pytest_cache_assert
|
eecfeff3824117cc4606f37c88e1735e31a82540
|
[
"MIT"
] | 2
|
2022-03-03T15:33:02.000Z
|
2022-03-08T12:30:26.000Z
|
pytest_cache_assert/_check_assert/__init__.py
|
KyleKing/pytest_cache_assert
|
eecfeff3824117cc4606f37c88e1735e31a82540
|
[
"MIT"
] | null | null | null |
"""Private package for pytest_check_assert."""
| 23.5
| 46
| 0.765957
| 6
| 47
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085106
| 47
| 1
| 47
| 47
| 0.790698
| 0.851064
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1eca92230c88a904d4621cf4fcae3d265e9e4bc4
| 154
|
py
|
Python
|
mulfile/__init__.py
|
matkrin/mulfile
|
844c32ddba05ad6b3ed90c97a43002abd8706b05
|
[
"BSD-3-Clause"
] | 2
|
2022-02-17T09:16:59.000Z
|
2022-02-26T18:28:43.000Z
|
mulfile/__init__.py
|
matkrin/mulfile
|
844c32ddba05ad6b3ed90c97a43002abd8706b05
|
[
"BSD-3-Clause"
] | null | null | null |
mulfile/__init__.py
|
matkrin/mulfile
|
844c32ddba05ad6b3ed90c97a43002abd8706b05
|
[
"BSD-3-Clause"
] | null | null | null |
from typing import Callable, Union
from . import mul
def load(file: str) -> Union[mul.Mul, mul.MulImage]:
""" """
return mul.read_mul(file)
| 19.25
| 52
| 0.642857
| 22
| 154
| 4.454545
| 0.590909
| 0.122449
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.214286
| 154
| 7
| 53
| 22
| 0.809917
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1ed3a9cf4678b175edb2058f4a1aa71f4a689128
| 22
|
py
|
Python
|
manager.py
|
ty251314/test01
|
66a252d4cf67774b31274ba6eac57a90fa654a61
|
[
"MIT"
] | null | null | null |
manager.py
|
ty251314/test01
|
66a252d4cf67774b31274ba6eac57a90fa654a61
|
[
"MIT"
] | null | null | null |
manager.py
|
ty251314/test01
|
66a252d4cf67774b31274ba6eac57a90fa654a61
|
[
"MIT"
] | null | null | null |
manager22222
ssssss
| 4.4
| 12
| 0.818182
| 2
| 22
| 9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277778
| 0.181818
| 22
| 4
| 13
| 5.5
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1eda96095286a0bf411cda8b8812acabbe4f201d
| 28
|
py
|
Python
|
soil/build/lib/soil/api/v1/openstack/compute/__init__.py
|
JackDan9/soil
|
ae612a4634634aace834491fbdefbc69e6167674
|
[
"MIT"
] | 1
|
2020-08-06T11:58:35.000Z
|
2020-08-06T11:58:35.000Z
|
soil/build/lib/soil/api/v1/openstack/compute/__init__.py
|
JackDan9/soil
|
ae612a4634634aace834491fbdefbc69e6167674
|
[
"MIT"
] | 4
|
2019-12-13T11:27:28.000Z
|
2022-02-27T11:58:38.000Z
|
soil/build/lib/soil/api/v1/openstack/compute/__init__.py
|
JackDan9/soil
|
ae612a4634634aace834491fbdefbc69e6167674
|
[
"MIT"
] | null | null | null |
# Copyright 2020 Hamal, Inc.
| 28
| 28
| 0.75
| 4
| 28
| 5.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 0.142857
| 28
| 1
| 28
| 28
| 0.708333
| 0.928571
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a20cb1c3a3de8ea63d54b5356ca205febfe63adf
| 233
|
py
|
Python
|
pik/core/shortcuts/request.py
|
paulanti/pik-django-utils
|
fbc67aa98545f692ef9553cd3f4d8b141ba3b0b1
|
[
"MIT"
] | 7
|
2018-06-14T07:19:46.000Z
|
2022-02-11T04:20:07.000Z
|
pik/core/shortcuts/request.py
|
paulanti/pik-django-utils
|
fbc67aa98545f692ef9553cd3f4d8b141ba3b0b1
|
[
"MIT"
] | 14
|
2018-08-09T07:00:46.000Z
|
2021-12-22T14:21:40.000Z
|
pik/core/shortcuts/request.py
|
paulanti/pik-django-utils
|
fbc67aa98545f692ef9553cd3f4d8b141ba3b0b1
|
[
"MIT"
] | 3
|
2020-06-09T10:59:41.000Z
|
2022-03-28T07:11:47.000Z
|
from typing import Optional
from django.http import HttpRequest
from simple_history.models import HistoricalRecords
def get_current_request() -> Optional[HttpRequest]:
return getattr(HistoricalRecords.thread, 'request', None)
| 25.888889
| 61
| 0.815451
| 27
| 233
| 6.925926
| 0.703704
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11588
| 233
| 8
| 62
| 29.125
| 0.907767
| 0
| 0
| 0
| 0
| 0
| 0.030043
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.6
| 0.2
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 0
|
0
| 5
|
a20e3d8e654969bd4e2c7f849c5fd5147cae8fe4
| 37
|
py
|
Python
|
tests/api/test_wolproxypyapi.py
|
bateman/wolproxypyapi
|
41e955cf08bc5c677a7b97513082827211998889
|
[
"MIT"
] | null | null | null |
tests/api/test_wolproxypyapi.py
|
bateman/wolproxypyapi
|
41e955cf08bc5c677a7b97513082827211998889
|
[
"MIT"
] | 2
|
2021-12-28T07:56:06.000Z
|
2022-01-17T12:20:37.000Z
|
tests/api/test_wolproxypyapi.py
|
bateman/wolproxypyapi
|
41e955cf08bc5c677a7b97513082827211998889
|
[
"MIT"
] | null | null | null |
"""Unit tests for the api module."""
| 18.5
| 36
| 0.648649
| 6
| 37
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162162
| 37
| 1
| 37
| 37
| 0.774194
| 0.810811
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bfcbaee2899299daee1ed9d73503d9ef04af2d2a
| 209
|
py
|
Python
|
orttraining/orttraining/test/python/orttraining_test_bert_postprocess.py
|
dennyac/onnxruntime
|
d5175795d2b7f2db18b0390f394a49238f814668
|
[
"MIT"
] | 6,036
|
2019-05-07T06:03:57.000Z
|
2022-03-31T17:59:54.000Z
|
orttraining/orttraining/test/python/orttraining_test_bert_postprocess.py
|
dennyac/onnxruntime
|
d5175795d2b7f2db18b0390f394a49238f814668
|
[
"MIT"
] | 5,730
|
2019-05-06T23:04:55.000Z
|
2022-03-31T23:55:56.000Z
|
orttraining/orttraining/test/python/orttraining_test_bert_postprocess.py
|
dennyac/onnxruntime
|
d5175795d2b7f2db18b0390f394a49238f814668
|
[
"MIT"
] | 1,566
|
2019-05-07T01:30:07.000Z
|
2022-03-31T17:06:50.000Z
|
from orttraining_test_model_transform import add_name, fix_transpose, add_expand_shape
from orttraining_test_layer_norm_transform import layer_norm_transform
def postprocess_model(model):
add_name(model)
| 34.833333
| 86
| 0.880383
| 30
| 209
| 5.633333
| 0.533333
| 0.177515
| 0.224852
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086124
| 209
| 5
| 87
| 41.8
| 0.884817
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
44c4feead8dcbaed553a9c609e06bb0b932b167a
| 119
|
py
|
Python
|
src/resource_identifier/syntax.py
|
gxagxagxa/zam-core
|
071c51d08d7bca364a5aa2048e4f53f829c032c6
|
[
"MIT"
] | null | null | null |
src/resource_identifier/syntax.py
|
gxagxagxa/zam-core
|
071c51d08d7bca364a5aa2048e4f53f829c032c6
|
[
"MIT"
] | null | null | null |
src/resource_identifier/syntax.py
|
gxagxagxa/zam-core
|
071c51d08d7bca364a5aa2048e4f53f829c032c6
|
[
"MIT"
] | null | null | null |
class ZamResourceIdentifierSyntax(object):
@staticmethod
def validate(resource_id) -> bool:
return True
| 29.75
| 42
| 0.722689
| 11
| 119
| 7.727273
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.201681
| 119
| 4
| 43
| 29.75
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.25
| 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
| 1
| 1
| 0
|
0
| 5
|
44d78b6cee4244888af9c6313f15bb1bd710d144
| 3,539
|
py
|
Python
|
tests/pipelines/test_validate.py
|
open-contracting/kingfisher-collect
|
2fbbd6361a0ec959e0603343a4b363f97fae3815
|
[
"BSD-3-Clause"
] | 7
|
2020-07-24T13:15:37.000Z
|
2021-12-11T22:40:07.000Z
|
tests/pipelines/test_validate.py
|
open-contracting/kingfisher-collect
|
2fbbd6361a0ec959e0603343a4b363f97fae3815
|
[
"BSD-3-Clause"
] | 418
|
2020-04-27T22:15:27.000Z
|
2022-03-31T23:49:34.000Z
|
tests/pipelines/test_validate.py
|
open-contracting/kingfisher-collect
|
2fbbd6361a0ec959e0603343a4b363f97fae3815
|
[
"BSD-3-Clause"
] | 6
|
2020-05-28T16:06:53.000Z
|
2021-03-16T02:54:15.000Z
|
import pytest
from jsonschema import ValidationError
from scrapy.exceptions import DropItem
from kingfisher_scrapy.items import File, FileError, FileItem
from kingfisher_scrapy.pipelines import Validate
from tests import spider_with_crawler
def test_process_item():
pipeline = Validate()
item = File({
'file_name': 'test',
'data': 'data',
'data_type': 'release_package',
'url': 'http://test.com',
})
assert pipeline.process_item(item, None) == item
item['data'] = item['data'].encode('ascii')
item['file_name'] = 'test2'
assert pipeline.process_item(item, None) == item
def test_process_item_error():
pipeline = Validate()
item = File({
'data': 'data',
'data_type': 'release_package',
'url': 'http://test.com',
})
with pytest.raises(ValidationError):
pipeline.process_item(item, None)
item['file_name'] = 'test'
item['data_type'] = 'not a valid data type'
with pytest.raises(ValidationError):
pipeline.process_item(item, None)
def test_process_file_item():
pipeline = Validate()
item = FileItem({
'file_name': 'test',
'data': 'data',
'data_type': 'release_package',
'url': 'http://test.com',
'number': 1
})
assert pipeline.process_item(item, None) == item
def test_process_file_item_error():
pipeline = Validate()
item = FileItem({
'file_name': 'test',
'data': 'data',
'data_type': 'release_package',
'url': 'http://test.com',
'number': "2"
})
with pytest.raises(ValidationError):
pipeline.process_item(item, None)
item['number'] = None
with pytest.raises(ValidationError):
pipeline.process_item(item, None)
def test_process_file_error():
pipeline = Validate()
item = FileError({
'file_name': 'test',
'url': 'http://test.com',
'errors': 'Error'
})
assert pipeline.process_item(item, None) == item
def test_process_file_item_error_error():
pipeline = Validate()
item = FileError({
'file_name': 'test',
'url': 'http://test.com'
})
with pytest.raises(ValidationError):
pipeline.process_item(item, None)
item['errors'] = 'Error'
item['url'] = 'not an url'
with pytest.raises(ValidationError):
pipeline.process_item(item, None)
def test_process_item_duplicate_file(caplog):
pipeline = Validate()
spider = spider_with_crawler()
item = File({
'file_name': 'test1',
'data': 'data',
'data_type': 'release_package',
'url': 'http://example.com',
})
pipeline.process_item(item, spider)
with pytest.raises(DropItem) as excinfo:
pipeline.process_item(item, spider)
item2 = item.copy()
item2['file_name'] = 'file2'
pipeline.process_item(item2, spider)
assert str(excinfo.value) == "Duplicate File: 'test1'"
def test_process_item_duplicate_file_item(caplog):
pipeline = Validate()
spider = spider_with_crawler()
item = FileItem({
'file_name': 'test1',
'data': 'data',
'data_type': 'release_package',
'url': 'http://example.com',
'number': 1
})
pipeline.process_item(item, spider)
with pytest.raises(DropItem) as excinfo:
pipeline.process_item(item, spider)
item2 = item.copy()
item2['number'] = 2
pipeline.process_item(item2, spider)
assert str(excinfo.value) == "Duplicate FileItem: ('test1', 1)"
| 26.410448
| 67
| 0.619667
| 400
| 3,539
| 5.2925
| 0.145
| 0.103921
| 0.143599
| 0.152102
| 0.785546
| 0.769957
| 0.747284
| 0.729806
| 0.683514
| 0.683514
| 0
| 0.006292
| 0.236507
| 3,539
| 133
| 68
| 26.609023
| 0.777202
| 0
| 0
| 0.740741
| 0
| 0
| 0.180842
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 1
| 0.074074
| false
| 0
| 0.055556
| 0
| 0.12963
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 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
| 5
|
44da5fc217ed601c45e371efbdb7bb4a686698d2
| 143
|
py
|
Python
|
app/auth/__init__.py
|
Joey-Wondersign/Staffjoy-suite-Joey
|
b6d0d87b8e60e6b866810ebeed631fb02fadad48
|
[
"MIT"
] | 890
|
2017-02-25T07:11:09.000Z
|
2022-03-08T05:49:20.000Z
|
app/auth/__init__.py
|
Joey-Wondersign/Staffjoy-suite-Joey
|
b6d0d87b8e60e6b866810ebeed631fb02fadad48
|
[
"MIT"
] | 11
|
2017-02-25T18:07:11.000Z
|
2020-10-19T13:09:41.000Z
|
app/auth/__init__.py
|
nfriedly/suite
|
c58c772d98d1476cad0531b8a296f27ad2ab945c
|
[
"MIT"
] | 276
|
2017-02-25T09:01:23.000Z
|
2022-03-19T02:24:02.000Z
|
from flask import Blueprint
auth = Blueprint(
'auth', __name__, template_folder='templates', static_folder='static')
from . import views
| 20.428571
| 74
| 0.748252
| 17
| 143
| 5.941176
| 0.647059
| 0.257426
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146853
| 143
| 6
| 75
| 23.833333
| 0.827869
| 0
| 0
| 0
| 0
| 0
| 0.132867
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
44e64a97847417bb075c70f589ec0dce044f2b25
| 70
|
py
|
Python
|
leetcode/count_and_say.py
|
callmekungfu/daily
|
aacea65ba5d276ea54e171a59e9fd05365a3bf44
|
[
"MIT"
] | null | null | null |
leetcode/count_and_say.py
|
callmekungfu/daily
|
aacea65ba5d276ea54e171a59e9fd05365a3bf44
|
[
"MIT"
] | null | null | null |
leetcode/count_and_say.py
|
callmekungfu/daily
|
aacea65ba5d276ea54e171a59e9fd05365a3bf44
|
[
"MIT"
] | null | null | null |
class Solution:
def countAndSay(self, n: int) -> str:
pass
| 23.333333
| 41
| 0.6
| 9
| 70
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 70
| 3
| 42
| 23.333333
| 0.84
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.333333
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
44f42be2507f664beb44543f7c1b769bf70b45d7
| 121
|
py
|
Python
|
src/main/switch/model.py
|
dennisschroeder/jetson-detectify
|
4a6800ae5aefa1fb9167e2fd4743015b7d751b09
|
[
"MIT"
] | 1
|
2021-02-16T08:46:58.000Z
|
2021-02-16T08:46:58.000Z
|
src/main/switch/model.py
|
dennisschroeder/jetson-detectify
|
4a6800ae5aefa1fb9167e2fd4743015b7d751b09
|
[
"MIT"
] | null | null | null |
src/main/switch/model.py
|
dennisschroeder/jetson-detectify
|
4a6800ae5aefa1fb9167e2fd4743015b7d751b09
|
[
"MIT"
] | null | null | null |
from peewee import CharField
from .. import BaseModel
class Switch(BaseModel):
name: str = CharField(unique=True)
| 15.125
| 38
| 0.743802
| 15
| 121
| 6
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173554
| 121
| 7
| 39
| 17.285714
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7818fde10e58378ab58ac0ce1d14ae7eb2f5914d
| 44
|
py
|
Python
|
list-app/app.py
|
Els-Socis/prison-wods
|
450117947654cd4878f6ca0dbea92884e71ebaa0
|
[
"MIT"
] | null | null | null |
list-app/app.py
|
Els-Socis/prison-wods
|
450117947654cd4878f6ca0dbea92884e71ebaa0
|
[
"MIT"
] | null | null | null |
list-app/app.py
|
Els-Socis/prison-wods
|
450117947654cd4878f6ca0dbea92884e71ebaa0
|
[
"MIT"
] | null | null | null |
from src.server import main
main(__name__)
| 11
| 27
| 0.795455
| 7
| 44
| 4.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 44
| 3
| 28
| 14.666667
| 0.815789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
782f38dd145796e06a5b0133124ff7aea3ee04a9
| 4,836
|
py
|
Python
|
tools/genesis/bitcoin_genesis.py
|
obulpathi/bitcoinpy
|
8f41e0221f2ff2d35697b6d4e5397deb7de09c3d
|
[
"MIT"
] | 21
|
2016-01-03T14:52:07.000Z
|
2021-08-09T18:05:08.000Z
|
tools/genesis/bitcoin_genesis.py
|
obulpathi/bitcoinpy
|
8f41e0221f2ff2d35697b6d4e5397deb7de09c3d
|
[
"MIT"
] | null | null | null |
tools/genesis/bitcoin_genesis.py
|
obulpathi/bitcoinpy
|
8f41e0221f2ff2d35697b6d4e5397deb7de09c3d
|
[
"MIT"
] | 15
|
2015-02-07T20:08:11.000Z
|
2019-10-03T04:45:45.000Z
|
#!/usr/bin/env python
import binascii
from bitcoin.core import COutPoint, CTxIn, CTxOut, CTransaction, CBlock
coinbase = "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73"
scriptPubKeyHex = "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac"
# construct previous out point
previousOut = COutPoint()
previousOut.hash = 0
previousOut.n = 4294967295
# construct txin
txin = CTxIn()
txin.coinbase = binascii.unhexlify(coinbase)
txin.scriptSig = binascii.unhexlify(coinbase)
txin.prevout = previousOut
# construct txout
txout = CTxOut()
txout.nValue = 5000000000
txout.scriptPubKey = binascii.unhexlify(scriptPubKeyHex)
# create transaction
tx = CTransaction()
tx.vin.append(txin)
tx.vout.append(txout)
tx.calc_sha256()
print tx
print "Transaction: ", tx.is_valid()
print "hash: ", hex(tx.sha256)
print "Hash: ", "0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
block = CBlock()
block.nVersion = 1
block.hashPrevBlock = 0
block.hashMerkleRoot = 0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
block.nTime = 1231006505
block.nBits = 486604799 # 0x1d00ffff
block.nNonce = 2083236893
block.vtx = [tx]
block.calc_sha256()
print "Calculated hash: ", hex(block.sha256)
print " >>>>>>>>>>>>>>: ", "0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
#
#print block.is_valid()
genesis = binascii.hexlify(block.serialize())
print "Version: ", genesis[:8]
print "Previous block: ", genesis[8:72]
print "Merkle root: ", genesis[72:136]
print "Match : ", "3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A"
print "Time stamp: ", genesis[136:144]
print "Match: : ", "29AB5F49"
print "nBits: ", genesis[144:152]
print "Match: ", "FFFF001D"
print "Nonce: ", genesis[152:160]
print "Match: ", "1DAC2B7C"
print "# transactions: ", genesis[160:162]
print "Match : ", "01"
print "Version: ", genesis[162:170]
print "Input: ", genesis[170:172]
print "previous out:", genesis[172:244]
print "Match :", "0000000000000000000000000000000000000000000000000000000000000000FFFFFFFF"
print "Script length: ", genesis[244:246]
print "scriptSig: ", genesis[246:400]
print "match : ", "04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73"
print "sequence: ", genesis[400:408]
print "match : ", "ffffffff"
print "outputs: ", genesis[408:410]
print "nValue:", genesis[410:426]
print "match: ", "00F2052A01000000"
print "script length: ", genesis[426:428]
print "out put script: ", genesis[428:562]
print "match: ", "4104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC"
print "lock time : ", genesis[562:570]
blkchain = open('genesis.dat', 'wb')
magic = "bef9d9b4011d0000"
magic = 'f9beb4d91d010000'
blkchain.write(binascii.unhexlify(magic + genesis))
blkchain.close()
"""
4D - script length
04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73 - scriptsig
FFFFFFFF - sequence
01 - outputs
00F2052A01000000 - 50 BTC
43 - pk_script length
4104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC - pk_script
00000000 - lock time
"""
"""
{
"hash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"ver":1,
"prev_block":"0000000000000000000000000000000000000000000000000000000000000000",
"mrkl_root":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"time":1231006505,
"bits":486604799,
"nonce":2083236893,
"n_tx":1,
"size":285,
"tx":[
{
"hash":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"ver":1,
"vin_sz":1,
"vout_sz":1,
"lock_time":0,
"size":204,
"in":[
{
"prev_out":{
"hash":"0000000000000000000000000000000000000000000000000000000000000000",
"n":4294967295
},
"coinbase":"04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73"
}
],
"out":[
{
"value":"50.00000000",
"scriptPubKey":"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG"
}
]
}
],
"mrkl_tree":[
"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
]
}
"""
| 34.542857
| 177
| 0.770058
| 358
| 4,836
| 10.360335
| 0.388268
| 0.026961
| 0.013481
| 0.015638
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.388718
| 0.123863
| 4,836
| 139
| 178
| 34.791367
| 0.486665
| 0.027295
| 0
| 0
| 0
| 0
| 0.438438
| 0.281615
| 0
| 0
| 0.066066
| 0
| 0
| 0
| null | null | 0
| 0.029851
| null | null | 0.507463
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
786d4f11ae92980f1b3df75c3c71a81d9016630f
| 95
|
py
|
Python
|
src/oolongt/io/__init__.py
|
schmamps/textteaser
|
e948ac6c0a4a4a44c7011206d7df236529d7813d
|
[
"MIT"
] | 2
|
2020-02-18T09:13:13.000Z
|
2021-06-12T13:16:13.000Z
|
src/oolongt/io/__init__.py
|
schmamps/textteaser
|
e948ac6c0a4a4a44c7011206d7df236529d7813d
|
[
"MIT"
] | null | null | null |
src/oolongt/io/__init__.py
|
schmamps/textteaser
|
e948ac6c0a4a4a44c7011206d7df236529d7813d
|
[
"MIT"
] | 1
|
2019-05-05T14:43:53.000Z
|
2019-05-05T14:43:53.000Z
|
"""Initialize I/O subpackage"""
from .io import read_file, get_stream, load_json # noqa: F401
| 31.666667
| 62
| 0.736842
| 15
| 95
| 4.466667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036585
| 0.136842
| 95
| 2
| 63
| 47.5
| 0.780488
| 0.389474
| 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
| 1
| 0
|
0
| 5
|
152588d90124e759666110e8d39f94721ff68c5d
| 131
|
py
|
Python
|
opentuner/search/__init__.py
|
rdturnermtl/opentuner
|
340f291b7934196a141c1454814f6c072fcd0d77
|
[
"MIT"
] | 29
|
2020-06-19T18:07:38.000Z
|
2022-01-03T23:06:53.000Z
|
opentuner/search/__init__.py
|
rdturnermtl/opentuner
|
340f291b7934196a141c1454814f6c072fcd0d77
|
[
"MIT"
] | 4
|
2020-07-14T16:20:23.000Z
|
2021-05-15T13:56:24.000Z
|
opentuner/search/__init__.py
|
rdturnermtl/opentuner
|
340f291b7934196a141c1454814f6c072fcd0d77
|
[
"MIT"
] | 2
|
2020-06-20T00:43:23.000Z
|
2020-12-26T00:38:31.000Z
|
from __future__ import absolute_import
from . import driver
from . import objective
from . import plugin
from . import technique
| 16.375
| 38
| 0.801527
| 17
| 131
| 5.882353
| 0.470588
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.167939
| 131
| 7
| 39
| 18.714286
| 0.917431
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1557fa4f62eb920c96afd1aa9ae04c4a344801c1
| 143
|
py
|
Python
|
docs/tutorial/rl_policy_gradient_tutorial/pong_model2.py
|
yuhonghong66/minpy
|
2e44927ad0fbff9295e2acf6db636e588fdc5b42
|
[
"Apache-2.0"
] | 1,271
|
2015-11-05T10:53:40.000Z
|
2022-02-20T08:33:35.000Z
|
docs/tutorial/rl_policy_gradient_tutorial/pong_model2.py
|
yuhonghong66/minpy
|
2e44927ad0fbff9295e2acf6db636e588fdc5b42
|
[
"Apache-2.0"
] | 140
|
2016-04-07T02:55:19.000Z
|
2019-08-02T06:01:53.000Z
|
docs/tutorial/rl_policy_gradient_tutorial/pong_model2.py
|
yuhonghong66/minpy
|
2e44927ad0fbff9295e2acf6db636e588fdc5b42
|
[
"Apache-2.0"
] | 144
|
2015-11-05T10:53:45.000Z
|
2022-03-25T05:38:09.000Z
|
def loss(self, ps, ys, rs):
step_losses = ys * np.log(ps) + (1.0 - ys) * np.log(1.0 - ps)
return -np.sum(step_losses * rs)
| 35.75
| 69
| 0.517483
| 26
| 143
| 2.769231
| 0.538462
| 0.277778
| 0.194444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.039604
| 0.293706
| 143
| 3
| 70
| 47.666667
| 0.673267
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
15a2bb709d3def6a56fb669f6f984dd8fb440e03
| 44
|
py
|
Python
|
tests/__init__.py
|
treyhunner/countdown
|
bee05652893aa3472c001a3eb270c9139bafe32c
|
[
"MIT"
] | 1
|
2022-01-12T07:28:25.000Z
|
2022-01-12T07:28:25.000Z
|
tests/__init__.py
|
treyhunner/countdown
|
bee05652893aa3472c001a3eb270c9139bafe32c
|
[
"MIT"
] | 33
|
2021-12-30T00:16:08.000Z
|
2022-03-31T07:33:26.000Z
|
tests/__init__.py
|
treyhunner/countdown-cli
|
bee05652893aa3472c001a3eb270c9139bafe32c
|
[
"MIT"
] | null | null | null |
"""Test suite for the countdown package."""
| 22
| 43
| 0.704545
| 6
| 44
| 5.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 44
| 1
| 44
| 44
| 0.815789
| 0.840909
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
15adda9242fec7efa295f670e72081b55d4c30c3
| 1,195
|
py
|
Python
|
terminusdb_client/tests/woqljson/woqlAndJson.py
|
KarenImmanuel/terminusdb-client-python
|
b96212dbe5c72a0d6ffefdcc6994b2078c05b31d
|
[
"Apache-2.0"
] | 1
|
2020-10-05T15:41:22.000Z
|
2020-10-05T15:41:22.000Z
|
terminusdb_client/tests/woqljson/woqlAndJson.py
|
KarenImmanuel/terminusdb-client-python
|
b96212dbe5c72a0d6ffefdcc6994b2078c05b31d
|
[
"Apache-2.0"
] | null | null | null |
terminusdb_client/tests/woqljson/woqlAndJson.py
|
KarenImmanuel/terminusdb-client-python
|
b96212dbe5c72a0d6ffefdcc6994b2078c05b31d
|
[
"Apache-2.0"
] | null | null | null |
WOQL_AND_JSON = {
"@type": "woql:And",
"woql:query_list": [
{
"@type": "woql:QueryListElement",
"woql:index": {"@type": "xsd:nonNegativeInteger", "@value": 0},
"woql:query": {
"@type": "woql:Triple",
"woql:subject": {"@type": "woql:Node", "woql:node": "doc:a"},
"woql:predicate": {"@type": "woql:Node", "woql:node": "scm:b"},
"woql:object": {
"@type": "woql:Datatype",
"woql:datatype": {"@type": "xsd:string", "@value": "c"},
},
},
},
{
"@type": "woql:QueryListElement",
"woql:index": {"@type": "xsd:nonNegativeInteger", "@value": 1},
"woql:query": {
"@type": "woql:Triple",
"woql:subject": {"@type": "woql:Node", "woql:node": "doc:1"},
"woql:predicate": {"@type": "woql:Node", "woql:node": "scm:2"},
"woql:object": {
"@type": "woql:Datatype",
"woql:datatype": {"@type": "xsd:string", "@value": "3"},
},
},
},
],
}
| 37.34375
| 79
| 0.393305
| 99
| 1,195
| 4.717172
| 0.272727
| 0.188437
| 0.102784
| 0.137045
| 0.907923
| 0.907923
| 0.907923
| 0.907923
| 0.753747
| 0.48394
| 0
| 0.006775
| 0.382427
| 1,195
| 31
| 80
| 38.548387
| 0.626016
| 0
| 0
| 0.322581
| 0
| 0
| 0.426778
| 0.071967
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 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
| 5
|
15b35c13bdc7aefc9813bddf8aa7bab5782d9014
| 3,128
|
py
|
Python
|
measures/entropy_plots.py
|
NMVRodrigues/TFNE
|
44538844f115ee11bbc58d4b7ba33526f17e2264
|
[
"MIT"
] | 2
|
2020-07-17T22:13:40.000Z
|
2020-08-07T14:57:01.000Z
|
measures/entropy_plots.py
|
NMVRodrigues/TFNE
|
44538844f115ee11bbc58d4b7ba33526f17e2264
|
[
"MIT"
] | null | null | null |
measures/entropy_plots.py
|
NMVRodrigues/TFNE
|
44538844f115ee11bbc58d4b7ba33526f17e2264
|
[
"MIT"
] | null | null | null |
import numpy as np
import sys
import matplotlib.pyplot as plt
import pandas as pd
import os
dsets = ['MNIST', 'FMNIST','CIFAR10', 'SVHN']
#dsetname = 'SVHN'
#walktype = 'SelectiveWalk'
#maindir = os.path.join('results', dsetname, walktype)
learning, params, topology = [],[],[]
for dset in dsets:
maindir = os.path.join('results', dset, 'SelectiveWalk')
learning.append(pd.read_csv(os.path.join(maindir, 'learning', 'loss', 'csvsEntropy.csv'), sep=';').iloc[11])
params.append(pd.read_csv(os.path.join(maindir, 'params', 'loss', 'csvsEntropy.csv'), sep=';').iloc[11])
topology.append(pd.read_csv(os.path.join(maindir, 'topology', 'loss', 'csvsEntropy.csv'), sep=';').iloc[11])
#learning = pd.read_csv(os.path.join(maindir, 'learning', 'loss', 'csvsEntropy.csv'), sep=';')
#params = pd.read_csv(os.path.join(maindir, 'params', 'loss', 'csvsEntropy.csv'), sep=';')
#topology = pd.read_csv(os.path.join(maindir, 'topology', 'loss', 'csvsEntropy.csv'), sep=';')
#ticks = ['0', '$\u03B5^*/128$', '$\u03B5^*/64$', '$\u03B5^*/32$', '$\u03B5^*/16$', '$\u03B5^*/8$', '$\u03B5^*/4$', '$\u03B5^*/2$', '$\u03B5^*$']
ticks = ['0', r'$\frac{ε^*}{128}$', r'$\frac{ε^*}{64}$', r'$\frac{ε^*}{32}$', r'$\frac{ε^*}{16}$', r'$\frac{ε^*}{8}$', r'$\frac{ε^*}{4}$', r'$\frac{ε^*}{2}$', r'$ε^*$']
plt.figure(dpi=1000)
plt.ylabel('H(ε)', fontsize=20)
plt.xlabel('ε', fontsize=20)
plt.xticks([1,2,3,4,5,6,7,8,9],ticks)
plt.ylim(0, 1)
plt.plot([1,2,3,4,5,6,7,8,9], learning[0], marker='.', linestyle=':', linewidth=1, label='MNIST')
plt.plot([1,2,3,4,5,6,7,8,9], learning[1], marker='1', linestyle=':', linewidth=1, label='FMNIST')
plt.plot([1,2,3,4,5,6,7,8,9], learning[2], marker='+', linestyle=':', linewidth=1, label='CIFAR10')
plt.plot([1,2,3,4,5,6,7,8,9], learning[3], marker='x', linestyle=':', linewidth=1, label='SVHN')
plt.legend(fontsize='x-large')
plt.tight_layout()
plt.xticks(fontsize=20)
plt.savefig('learning.png')
plt.figure(dpi=1000)
plt.ylabel('H(ε)', fontsize=20)
plt.xlabel('ε', fontsize=20)
plt.xticks([1,2,3,4,5,6,7,8,9],ticks)
plt.ylim(0, 1)
plt.plot([1,2,3,4,5,6,7,8,9], params[0], marker='.', linestyle=':', linewidth=1, label='MNIST')
plt.plot([1,2,3,4,5,6,7,8,9], params[1], marker='1', linestyle=':', linewidth=1, label='FMNIST')
plt.plot([1,2,3,4,5,6,7,8,9], params[2], marker='+', linestyle=':', linewidth=1, label='CIFAR10')
plt.plot([1,2,3,4,5,6,7,8,9], params[3], marker='x', linestyle=':', linewidth=1, label='SVHN')
plt.tight_layout()
plt.xticks(fontsize=20)
plt.savefig('params.png')
plt.figure(dpi=1000)
plt.ylabel('H(ε)', fontsize=20)
plt.xlabel('ε', fontsize=20)
plt.xticks([1,2,3,4,5,6,7,8,9],ticks)
plt.ylim(0, 1)
plt.plot([1,2,3,4,5,6,7,8,9], topology[0], marker='.', linestyle=':', linewidth=1, label='MNIST')
plt.plot([1,2,3,4,5,6,7,8,9], topology[1], marker='1', linestyle=':', linewidth=1, label='FMNIST')
plt.plot([1,2,3,4,5,6,7,8,9], topology[2], marker='+', linestyle=':', linewidth=1, label='CIFAR10')
plt.plot([1,2,3,4,5,6,7,8,9], topology[3], marker='x', linestyle=':', linewidth=1, label='SVHN')
plt.tight_layout()
plt.xticks(fontsize=20)
plt.savefig('topology.png')
| 43.444444
| 168
| 0.626918
| 548
| 3,128
| 3.562044
| 0.142336
| 0.015369
| 0.023053
| 0.030738
| 0.788422
| 0.763832
| 0.754611
| 0.754611
| 0.745389
| 0.703381
| 0
| 0.090846
| 0.078005
| 3,128
| 71
| 169
| 44.056338
| 0.585992
| 0.164642
| 0
| 0.42
| 0
| 0
| 0.14812
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.1
| 0
| 0.1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
ecba06b03404e61d8f284d0168420019867c55f4
| 33,871
|
py
|
Python
|
pyart/graph/gridmapdisplay.py
|
josephhardinee/pyart
|
909cd4a36bb4cae34349294d2013bc7ad71d0969
|
[
"OLDAP-2.6",
"Python-2.0"
] | null | null | null |
pyart/graph/gridmapdisplay.py
|
josephhardinee/pyart
|
909cd4a36bb4cae34349294d2013bc7ad71d0969
|
[
"OLDAP-2.6",
"Python-2.0"
] | null | null | null |
pyart/graph/gridmapdisplay.py
|
josephhardinee/pyart
|
909cd4a36bb4cae34349294d2013bc7ad71d0969
|
[
"OLDAP-2.6",
"Python-2.0"
] | null | null | null |
"""
pyart.graph.gridmapdisplay
==========================
A class for plotting grid objects with a basemap.
.. autosummary::
:toctree: generated/
:template: dev_template.rst
GridMapDisplay
"""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.basemap import pyproj
from . import common
class GridMapDisplay():
"""
A class for creating plots from a grid object on top of a Basemap.
Parameters
----------
grid : Grid
Grid with data which will be used to create plots.
debug : bool
True to print debugging messages, False to supress them.
Attributes
----------
grid : Grid
Grid object.
debug : bool
True to print debugging messages, False to supressed them.
proj : Proj
Object for performing cartographic transformations specific to the
grid.
grid_lons : array
Grid longitudes in degrees.
grid_lats : array
Grid latitudes in degress.
basemap : Basemap
Last plotted basemap, None when no basemap has been plotted.
mappables : list
List of ContourSet, etc. which have been plotted, useful
when adding colorbars.
fields : list
List of fields which have been plotted.
"""
def __init__(self, grid, debug=False):
""" initalize the object. """
self.grid = grid
self.debug = debug
# set up the projection
lat0 = grid.axes['lat']['data'][0]
lon0 = grid.axes['lon']['data'][0]
self.proj = pyproj.Proj(proj='aeqd', datum='NAD83',
lat_0=lat0, lon_0=lon0)
# determine grid latitudes and longitudes.
x_1d = grid.axes['x_disp']['data']
y_1d = grid.axes['y_disp']['data']
x_2d, y_2d = np.meshgrid(x_1d, y_1d)
self.grid_lons, self.grid_lats = self.proj(x_2d, y_2d, inverse=True)
# set attributes
self.mappables = []
self.fields = []
self.origin = 'origin'
self.basemap = None
def plot_basemap(self, lat_lines=None, lon_lines=None,
resolution='l', area_thresh=10000,
auto_range=True,
min_lon=-92, max_lon=-86, min_lat=40, max_lat=44,
ax=None, **kwargs):
"""
Plot a basemap.
Parameters
----------
lat_lines, lon_lines : array or None
Locations at which to draw latitude and longitude lines.
None will use default values which are resonable for maps of
North America.
auto_range : bool
True to determine map ranges from the grid_lats and grid_lons
attribute. False will use the min_lon, max_lon, min_lat, and
max_lat parameters for the map range.
min_lat, max_lat, min_lon, max_lon : float
Latitude and longitude ranges for the map projection region in
degrees. These parameter are not used if auto_range is True.
resolution : 'c', 'l', 'i', 'h', or 'f'.
Resolution of boundary database to use. See Basemap documentation
for details.
area_thresh : int
Basemap area_thresh parameter. See Basemap documentation.
ax : axes or None.
Axis to add the basemap to, if None the current axis is used.
kwargs: Basemap options
Options to be passed to Basemap. If projection is not specified
here it uses proj='merc' (mercator).
"""
# make basemap
self._make_basemap(resolution, area_thresh, auto_range,
min_lon, max_lon, min_lat, max_lat, ax, **kwargs)
# parse the parameters
if lat_lines is None:
lat_lines = np.arange(30, 46, 1)
if lon_lines is None:
lon_lines = np.arange(-110, -75, 1)
self.basemap.drawcoastlines(linewidth=1.25)
self.basemap.drawstates()
self.basemap.drawparallels(lat_lines,
labels=[True, False, False, False])
self.basemap.drawmeridians(lon_lines,
labels=[False, False, False, True])
def plot_grid(self, field, level=0, vmin=None, vmax=None, cmap='jet',
mask_outside=False, title=None, title_flag=True,
axislabels=(None, None), axislabels_flag=False,
colorbar_flag=True, colorbar_label=None,
colorbar_orient='vertical', edges=True, ax=None, fig=None):
"""
Plot the grid onto the current basemap.
Parameters
----------
field : str
Field to be plotted.
level : int
Index corresponding to the height level to be plotted.
vmin, vmax : float
Lower and upper range for the colormesh. If either parameter is
None, a value will be determined from the field attributes (if
available) or the default values of -8, 64 will be used.
cmap : str
Matplotlib colormap name or colormap object.
mask_outside : bool
True to mask data outside of vmin, vmax. False performs no
masking.
title : str
Title to label plot with, None to use default title generated from
the field and level parameters. Parameter is ignored if title_flag
is False.
title_flag : bool
True to add a title to the plot, False does not add a title.
axislabels : (str, str)
2-tuple of x-axis, y-axis labels. None for either label will use
the default axis label. Parameter is ignored if axislabels_flag is
False.
axislabel_flag : bool
True to add label the axes, False does not label the axes.
colorbar_flag : bool
True to add a colorbar with label to the axis. False leaves off
the colorbar.
colorbar_label : str
Colorbar label, None will use a default label generated from the
field information.
colorbar_orient : 'vertical' or 'horizontal'
Colorbar orientation.
edges : bool
True will interpolate and extrapolate the gate edges from the
range, azimuth and elevations in the radar, treating these
as specifying the center of each gate. False treats these
coordinates themselved as the gate edges, resulting in a plot
in which the last gate in each ray and the entire last ray are not
not plotted.
ax : Axis
Axis to plot on. None will use the current axis.
fig : Figure
Figure to add the colorbar to. None will use the current figure.
"""
# parse parameters
ax, fig = common.parse_ax_fig(ax, fig)
vmin, vmax = common.parse_vmin_vmax(self.grid, field, vmin, vmax)
basemap = self.get_basemap()
data = self.grid.fields[field]['data'][level]
# mask the data where outside the limits
if mask_outside:
data = np.ma.masked_invalid(data)
data = np.ma.masked_outside(data, vmin, vmax)
# plot the grid
x_1d = self.grid.axes['x_disp']['data']
y_1d = self.grid.axes['y_disp']['data']
if edges:
if len(x_1d) > 1:
x_1d = common._interpolate_axes_edges(x_1d)
if len(y_1d) > 1:
y_1d = common._interpolate_axes_edges(y_1d)
x_2d, y_2d = np.meshgrid(x_1d, y_1d)
grid_lons, grid_lats = self.proj(x_2d, y_2d, inverse=True)
xd, yd = basemap(grid_lons, grid_lats)
pm = basemap.pcolormesh(xd, yd, data, vmin=vmin, vmax=vmax, cmap=cmap)
self.mappables.append(pm)
self.fields.append(field)
if title_flag:
if title is None:
ax.set_title(self.generate_grid_title(field, level))
else:
ax.set_title(title)
if axislabels_flag:
self._label_axes_grid(axislabels, ax)
if colorbar_flag:
self.plot_colorbar(mappable=pm, label=colorbar_label,
orientation=colorbar_orient,
field=field, ax=ax, fig=fig)
return
def plot_crosshairs(self, lon=None, lat=None,
line_style='r--', linewidth=2, ax=None):
"""
Plot crosshairs at a given longitude and latitude.
Parameters
----------
lon, lat : float
Longitude and latitude (in degrees) where the crosshairs should
be placed. If None the center of the grid is used.
line_style : str
Matplotlib string describing the line style.
linewidth : float
Width of markers in points.
ax : axes or None.
Axis to add the crosshairs to, if None the current axis is used.
"""
# parse the parameters
ax = common.parse_ax(ax)
lon, lat = common.parse_lon_lat(self.grid, lon, lat)
basemap = self.get_basemap()
# add crosshairs.
x_lon, y_lon = basemap(
np.array([lon, lon]),
np.array([basemap.latmin, basemap.latmax]))
x_lat, y_lat = basemap(
np.array([basemap.lonmin, basemap.lonmax]),
np.array([lat, lat]))
ax.plot(x_lon, y_lon, line_style, linewidth=linewidth)
ax.plot(x_lat, y_lat, line_style, linewidth=linewidth)
return
def plot_latitude_slice(self, field, lon=None, lat=None,
vmin=None, vmax=None, cmap='jet',
mask_outside=False, title=None, title_flag=True,
axislabels=(None, None), axislabels_flag=True,
colorbar_flag=True, colorbar_label=None,
colorbar_orient='vertical', edges=True, ax=None,
fig=None):
"""
Plot a slice along a given latitude.
Parameters
----------
field : str
Field to be plotted.
lon, lat : float
Longitude and latitude (in degrees) specifying the slice. If
None the center of the grid is used.
vmin, vmax : float
Lower and upper range for the colormesh. If either parameter is
None, a value will be determined from the field attributes (if
available) or the default values of -8, 64 will be used.
cmap : str
Matplotlib colormap name or colormap object.
mask_outside : bool
True to mask data outside of vmin, vmax. False performs no
masking.
title : str
Title to label plot with, None to use default title generated from
the field and lat,lon parameters. Parameter is ignored if
title_flag is False.
title_flag : bool
True to add a title to the plot, False does not add a title.
axislabels : (str, str)
2-tuple of x-axis, y-axis labels. None for either label will use
the default axis label. Parameter is ignored if axislabels_flag is
False.
axislabel_flag : bool
True to add label the axes, False does not label the axes.
colorbar_flag : bool
True to add a colorbar with label to the axis. False leaves off
the colorbar.
colorbar_label : str
Colorbar label, None will use a default label generated from the
field information.
colorbar_orient : 'vertical' or 'horizontal'
Colorbar orientation.
edges : bool
True will interpolate and extrapolate the gate edges from the
range, azimuth and elevations in the radar, treating these
as specifying the center of each gate. False treats these
coordinates themselved as the gate edges, resulting in a plot
in which the last gate in each ray and the entire last ray are not
not plotted.
ax : Axis
Axis to plot on. None will use the current axis.
fig : Figure
Figure to add the colorbar to. None will use the current figure.
"""
# parse parameters
x_index, y_index = self._find_nearest_grid_indices(lon, lat)
self.plot_latitudinal_level(
field=field, y_index=y_index, vmin=vmin, vmax=vmax, cmap=cmap,
mask_outside=mask_outside, title=title, title_flag=title_flag,
axislabels=axislabels, axislabels_flag=axislabels_flag,
colorbar_flag=colorbar_flag, colorbar_label=colorbar_label,
colorbar_orient=colorbar_orient, edges=edges, ax=ax, fig=fig)
def plot_latitudinal_level(self, field, y_index,
vmin=None, vmax=None, cmap='jet',
mask_outside=False, title=None, title_flag=True,
axislabels=(None, None), axislabels_flag=True,
colorbar_flag=True, colorbar_label=None,
colorbar_orient='vertical', edges=True,
ax=None, fig=None):
"""
Plot a slice along a given latitude.
Parameters
----------
field : str
Field to be plotted.
y_index : float
Index of the latitudinal level to plot.
vmin, vmax : float
Lower and upper range for the colormesh. If either parameter is
None, a value will be determined from the field attributes (if
available) or the default values of -8, 64 will be used.
cmap : str
Matplotlib colormap name or colormap object.
mask_outside : bool
True to mask data outside of vmin, vmax. False performs no
masking.
title : str
Title to label plot with, None to use default title generated from
the field and lat,lon parameters. Parameter is ignored if
title_flag is False.
title_flag : bool
True to add a title to the plot, False does not add a title.
axislabels : (str, str)
2-tuple of x-axis, y-axis labels. None for either label will use
the default axis label. Parameter is ignored if axislabels_flag is
False.
axislabel_flag : bool
True to add label the axes, False does not label the axes.
colorbar_flag : bool
True to add a colorbar with label to the axis. False leaves off
the colorbar.
colorbar_label : str
Colorbar label, None will use a default label generated from the
field information.
colorbar_orient : 'vertical' or 'horizontal'
Colorbar orientation.
edges : bool
True will interpolate and extrapolate the gate edges from the
range, azimuth and elevations in the radar, treating these
as specifying the center of each gate. False treats these
coordinates themselved as the gate edges, resulting in a plot
in which the last gate in each ray and the entire last ray are not
not plotted.
ax : Axis
Axis to plot on. None will use the current axis.
fig : Figure
Figure to add the colorbar to. None will use the current figure.
"""
# parse parameters
ax, fig = common.parse_ax_fig(ax, fig)
vmin, vmax = common.parse_vmin_vmax(self.grid, field, vmin, vmax)
basemap = self.get_basemap()
data = self.grid.fields[field]['data'][:, y_index, :]
# mask the data where outside the limits
if mask_outside:
data = np.ma.masked_invalid(data)
data = np.ma.masked_outside(data, vmin, vmax)
# plot the grid
x_1d = self.grid.axes['x_disp']['data'] / 1000.
z_1d = self.grid.axes['z_disp']['data'] / 1000.
if edges:
if len(x_1d) > 1:
x_1d = common._interpolate_axes_edges(x_1d)
if len(z_1d) > 1:
z_1d = common._interpolate_axes_edges(z_1d)
xd, yd = np.meshgrid(x_1d, z_1d)
pm = ax.pcolormesh(xd, yd, data, vmin=vmin, vmax=vmax, cmap=cmap)
self.mappables.append(pm)
self.fields.append(field)
if title_flag:
if title is None:
ax.set_title(
common.generate_latitudinal_level_title(self.grid, field,
y_index))
else:
ax.set_title(title)
if axislabels_flag:
self._label_axes_latitude(axislabels, ax)
if colorbar_flag:
self.plot_colorbar(mappable=pm, label=colorbar_label,
orientation=colorbar_orient,
field=field, ax=ax, fig=fig)
return
def plot_longitude_slice(self, field, lon=None, lat=None,
vmin=None, vmax=None, cmap='jet',
mask_outside=False, title=None, title_flag=True,
axislabels=(None, None), axislabels_flag=True,
colorbar_flag=True, colorbar_label=None,
colorbar_orient='vertical', edges=True, ax=None,
fig=None):
"""
Plot a slice along a given longitude.
Parameters
----------
field : str
Field to be plotted.
lon, lat : float
Longitude and latitude (in degrees) specifying the slice. If
None the center of the grid is used.
vmin, vmax : float
Lower and upper range for the colormesh. If either parameter is
None, a value will be determined from the field attributes (if
available) or the default values of -8, 64 will be used.
cmap : str
Matplotlib colormap name or colormap object.
mask_outside : bool
True to mask data outside of vmin, vmax. False performs no
masking.
title : str
Title to label plot with, None to use default title generated from
the field and lat,lon parameters. Parameter is ignored if
title_flag is False.
title_flag : bool
True to add a title to the plot, False does not add a title.
axislabels : (str, str)
2-tuple of x-axis, y-axis labels. None for either label will use
the default axis label. Parameter is ignored if axislabels_flag is
False.
axislabel_flag : bool
True to add label the axes, False does not label the axes.
colorbar_flag : bool
True to add a colorbar with label to the axis. False leaves off
the colorbar.
colorbar_label : str
Colorbar label, None will use a default label generated from the
field information.
colorbar_orient : 'vertical' or 'horizontal'
Colorbar orientation.
edges : bool
True will interpolate and extrapolate the gate edges from the
range, azimuth and elevations in the radar, treating these
as specifying the center of each gate. False treats these
coordinates themselved as the gate edges, resulting in a plot
in which the last gate in each ray and the entire last ray are not
not plotted.
ax : Axis
Axis to plot on. None will use the current axis.
fig : Figure
Figure to add the colorbar to. None will use the current figure.
"""
x_index, y_index = self._find_nearest_grid_indices(lon, lat)
self.plot_longitudinal_level(
field=field, x_index=x_index, vmin=vmin, vmax=vmax, cmap=cmap,
mask_outside=mask_outside, title=title, title_flag=title_flag,
axislabels=axislabels, axislabels_flag=axislabels_flag,
colorbar_flag=colorbar_flag, colorbar_label=colorbar_label,
colorbar_orient=colorbar_orient, edges=edges, ax=ax, fig=fig)
def plot_longitudinal_level(self, field, x_index,
vmin=None, vmax=None, cmap='jet',
mask_outside=False, title=None,
title_flag=True, axislabels=(None, None),
axislabels_flag=True, colorbar_flag=True,
colorbar_label=None,
colorbar_orient='vertical', edges=True,
ax=None, fig=None):
"""
Plot a slice along a given longitude.
Parameters
----------
field : str
Field to be plotted.
x_index : float
Index of the longitudinal level to plot.
vmin, vmax : float
Lower and upper range for the colormesh. If either parameter is
None, a value will be determined from the field attributes (if
available) or the default values of -8, 64 will be used.
cmap : str
Matplotlib colormap name or colormap object.
mask_outside : bool
True to mask data outside of vmin, vmax. False performs no
masking.
title : str
Title to label plot with, None to use default title generated from
the field and lat,lon parameters. Parameter is ignored if
title_flag is False.
title_flag : bool
True to add a title to the plot, False does not add a title.
axislabels : (str, str)
2-tuple of x-axis, y-axis labels. None for either label will use
the default axis label. Parameter is ignored if axislabels_flag is
False.
axislabel_flag : bool
True to add label the axes, False does not label the axes.
colorbar_flag : bool
True to add a colorbar with label to the axis. False leaves off
the colorbar.
colorbar_label : str
Colorbar label, None will use a default label generated from the
field information.
colorbar_orient : 'vertical' or 'horizontal'
Colorbar orientation.
edges : bool
True will interpolate and extrapolate the gate edges from the
range, azimuth and elevations in the radar, treating these
as specifying the center of each gate. False treats these
coordinates themselved as the gate edges, resulting in a plot
in which the last gate in each ray and the entire last ray are not
not plotted.
ax : Axis
Axis to plot on. None will use the current axis.
fig : Figure
Figure to add the colorbar to. None will use the current figure.
"""
# parse parameters
ax, fig = common.parse_ax_fig(ax, fig)
vmin, vmax = common.parse_vmin_vmax(self.grid, field, vmin, vmax)
basemap = self.get_basemap()
data = self.grid.fields[field]['data'][:, :, x_index]
# mask the data where outside the limits
if mask_outside:
data = np.ma.masked_invalid(data)
data = np.ma.masked_outside(data, vmin, vmax)
# plot the grid
y_1d = self.grid.axes['y_disp']['data'] / 1000.
z_1d = self.grid.axes['z_disp']['data'] / 1000.
if edges:
if len(y_1d) > 1:
y_1d = common._interpolate_axes_edges(y_1d)
if len(z_1d) > 1:
z_1d = common._interpolate_axes_edges(z_1d)
xd, yd = np.meshgrid(y_1d, z_1d)
pm = ax.pcolormesh(xd, yd, data, vmin=vmin, vmax=vmax, cmap=cmap)
self.mappables.append(pm)
self.fields.append(field)
if title_flag:
if title is None:
ax.set_title(
common.generate_longitudinal_level_title(self.grid, field,
x_index))
else:
ax.set_title(title)
if axislabels_flag:
self._label_axes_longitude(axislabels, ax)
if colorbar_flag:
self.plot_colorbar(mappable=pm, label=colorbar_label,
orientation=colorbar_orient,
field=field, ax=ax, fig=fig)
return
def plot_colorbar(self, mappable=None, orientation='horizontal',
label=None, cax=None, ax=None, fig=None, field=None):
"""
Plot a colorbar.
Parameters
----------
mappable : Image, ContourSet, etc.
Image, ContourSet, etc to which the colorbar applied. If None the
last mappable object will be used.
field : str
Field to label colorbar with.
label : str
Colorbar label. None will use a default value from the last field
plotted.
orient : str
Colorbar orientation, either 'vertical' [default] or 'horizontal'.
cax : Axis
Axis onto which the colorbar will be drawn. None is also valid.
ax : Axes
Axis onto which the colorbar will be drawn. None is also valid.
fig : Figure
Figure to place colorbar on. None will use the current figure.
"""
if fig is None:
fig = plt.gcf()
if mappable is None:
if len(self.mappables) == 0:
raise ValueError('mappable must be specified.')
else:
mappable = self.mappables[-1]
if label is None:
if len(self.fields) == 0:
raise ValueError('field must be specified.')
field = self.grid.fields[self.fields[-1]]
if 'long_name' in field and 'units' in field:
label = field['long_name'] + '(' + field['units'] + ')'
else:
label = ''
# plot the colorbar and set the label.
cb = fig.colorbar(mappable, orientation=orientation, ax=ax, cax=cax)
cb.set_label(label)
return
def _make_basemap(self, resolution='l', area_thresh=10000,
auto_range=True, min_lon=-92, max_lon=-86,
min_lat=40, max_lat=44, ax=None, **kwargs):
"""
Make a basemap.
Parameters
----------
auto_range : bool
True to determine map ranges from the grid_lats and grid_lons
attribute. False will use the min_lon, max_lon, min_lat, and
max_lat parameters for the map range.
min_lat, max_lat, min_lon, max_lon : float
Latitude and longitude ranges for the map projection region in
degrees. These parameter are not used if auto_range is True.
resolution : 'c', 'l', 'i', 'h', or 'f'.
Resolution of boundary database to use. See Basemap documentation
for details.
area_thresh : int
Basemap area_thresh parameter. See Basemap documentation.
ax : axes or None.
Axis to add the basemap to, if None the current axis is used.
kwargs: Basemap options
Options to be passed to Basemap. If projection is not specified
here it uses proj='merc' (mercator).
"""
# parse the parameters
ax = common.parse_ax(ax)
# determine map region
if auto_range:
max_lat = self.grid_lats.max()
max_lon = self.grid_lons.max()
min_lat = self.grid_lats.min()
min_lon = self.grid_lons.min()
if self.debug:
print("Maximum latitude: ", max_lat)
print("Maximum longitude: ", max_lon)
print("Minimum latitude: ", min_lat)
print("Minimum longitute: ", min_lon)
# determine plot center
lat_0 = self.grid.axes['lat']['data'][0]
lon_0 = self.grid.axes['lon']['data'][0]
default_args = {
'lat_0': lat_0, 'lon_0': lon_0, 'lat_ts':lat_0,
'projection': 'merc', 'area_thresh': area_thresh,
'resolution': resolution, 'ax': ax}
using_corners = (None not in [min_lon, min_lat, max_lon, max_lat])
if using_corners:
default_args['llcrnrlon'] = min_lon
default_args['llcrnrlat'] = min_lat
default_args['urcrnrlon'] = max_lon
default_args['urcrnrlat'] = max_lat
else:
# determine width and height of the plot
x = self.grid.axes['x_disp']['data'][0]
y = self.grid.axes['y_disp']['data'][0]
default_args['width'] = (x.max() - x.min())
default_args['height'] = (y.max() - y.min())
for key in default_args.keys():
if key not in kwargs:
kwargs[key] = default_args[key]
# plot the basemap
self.basemap = Basemap(**kwargs)
return self.basemap
def _find_nearest_grid_indices(self, lon, lat):
"""
Find the nearest x, y grid indices for a given latitude and longitude.
"""
lon, lat = common.parse_lon_lat(self.grid, lon, lat)
x_cut, y_cut = self.proj(lon, lat)
if self.debug:
print("x_cut: ", x_cut)
print("y_cut: ", y_cut)
x_index = np.abs(self.grid.axes['x_disp']['data'] - x_cut).argmin()
y_index = np.abs(self.grid.axes['y_disp']['data'] - y_cut).argmin()
if self.debug:
print("x_index", x_index)
print("y_index", y_index)
return x_index, y_index
##########################
# Plot adjusting methods #
##########################
def _get_label_x(self):
""" Get default label for x units. """
return ('East West distance from ' + self.origin + ' (km)')
def _get_label_y(self):
""" Get default label for y units. """
return ('North South distance from ' + self.origin + ' (km)')
def _get_label_z(self):
""" Get default label for z units. """
return ('Distance Above ' + self.origin + ' (km)')
def _label_axes_grid(self, axis_labels, ax):
""" Set the x and y axis labels for a grid plot. """
x_label, y_label = axis_labels
if x_label is None:
x_label = self._get_label_x()
if y_label is None:
y_label = self._get_label_y()
ax.set_xlabel(x_label)
ax.set_ylabel(y_label)
def _label_axes_longitude(self, axis_labels, ax):
""" Set the x and y axis labels for a longitude slice. """
x_label, y_label = axis_labels
if x_label is None:
x_label = self._get_label_y()
if y_label is None:
y_label = self._get_label_z()
ax.set_xlabel(x_label)
ax.set_ylabel(y_label)
def _label_axes_latitude(self, axis_labels, ax):
""" Set the x and y axis labels for a latitude slice. """
x_label, y_label = axis_labels
if x_label is None:
x_label = self._get_label_x()
if y_label is None:
y_label = self._get_label_z()
ax.set_xlabel(x_label)
ax.set_ylabel(y_label)
##########################
# name generator methods #
##########################
def generate_filename(self, field, level, ext='png'):
"""
Generate a filename for a grid plot.
Generated filename has form:
grid_name_field_level_time.ext
Parameters
----------
field : str
Field plotted.
level : int
Level plotted.
ext : str
Filename extension.
Returns
-------
filename : str
Filename suitable for saving a plot.
"""
return common.generate_grid_filename(self.grid, field, level, ext)
def generate_grid_title(self, field, level):
"""
Generate a title for a plot.
Parameters
----------
field : str
Field plotted.
level : int
Verical level plotted.
Returns
-------
title : str
Plot title.
"""
return common.generate_grid_title(self.grid, field, level)
def generate_longitudinal_level_title(self, field, level):
"""
Generate a title for a plot.
Parameters
----------
field : str
Field plotted.
level : int
Longitudinal level plotted.
Returns
-------
title : str
Plot title.
"""
return common.generate_longitudinal_level_title(self.grid, field,
level)
def generate_latitudinal_level_title(self, field, level):
"""
Generate a title for a plot.
Parameters
----------
field : str
Field plotted.
level : int
Longitudinal level plotted.
Returns
-------
title : str
Plot title.
"""
return common.generate_latitudinal_level_title(self.grid, field,
level)
##########################
# get methods #
##########################
def get_basemap(self):
""" get basemap of the plot """
if self.basemap is None:
self._make_basemap()
return self.basemap
| 37.971973
| 79
| 0.566
| 4,208
| 33,871
| 4.428707
| 0.081511
| 0.015025
| 0.012878
| 0.011269
| 0.749302
| 0.731487
| 0.723117
| 0.715497
| 0.693496
| 0.685018
| 0
| 0.0069
| 0.353902
| 33,871
| 891
| 80
| 38.01459
| 0.844681
| 0.443713
| 0
| 0.472492
| 1
| 0
| 0.039833
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.071197
| false
| 0
| 0.019417
| 0
| 0.142395
| 0.029126
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ece8b7c3b764685108b96a45a7e7763068d36a14
| 63
|
py
|
Python
|
packages/vaex-ml/vaex/ml/_version.py
|
ankishb/vaex
|
1af7541c64e10261f77bd9f3e6c36cc875fe25f1
|
[
"MIT"
] | 1
|
2019-12-23T12:02:13.000Z
|
2019-12-23T12:02:13.000Z
|
packages/vaex-ml/vaex/ml/_version.py
|
ankishb/vaex
|
1af7541c64e10261f77bd9f3e6c36cc875fe25f1
|
[
"MIT"
] | null | null | null |
packages/vaex-ml/vaex/ml/_version.py
|
ankishb/vaex
|
1af7541c64e10261f77bd9f3e6c36cc875fe25f1
|
[
"MIT"
] | null | null | null |
__version__ = '0.7.1-dev'
__version_tuple__ = (0, 7, 1, "dev")
| 21
| 36
| 0.634921
| 11
| 63
| 2.818182
| 0.545455
| 0.129032
| 0.193548
| 0.387097
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 0.142857
| 63
| 2
| 37
| 31.5
| 0.462963
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
01c44707fb0757897aaa55972cebb36a015d08f7
| 207
|
py
|
Python
|
.idea/VirtualEnvironment/Lib/site-packages/hstest/stage/__init__.py
|
Vladpetr/NewsPortal
|
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
|
[
"Apache-2.0"
] | null | null | null |
.idea/VirtualEnvironment/Lib/site-packages/hstest/stage/__init__.py
|
Vladpetr/NewsPortal
|
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
|
[
"Apache-2.0"
] | 5
|
2021-04-08T22:02:15.000Z
|
2022-02-10T14:53:45.000Z
|
.idea/VirtualEnvironment/Lib/site-packages/hstest/stage/__init__.py
|
Vladpetr/NewsPortal
|
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
|
[
"Apache-2.0"
] | null | null | null |
__all__ = [
'StageTest',
'DjangoTest',
'FlaskTest',
]
from hstest.stage.django_test import DjangoTest
from hstest.stage.flask_test import FlaskTest
from hstest.stage.stage_test import StageTest
| 20.7
| 47
| 0.758454
| 25
| 207
| 6
| 0.44
| 0.2
| 0.3
| 0.32
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154589
| 207
| 9
| 48
| 23
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0.135266
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.375
| 0
| 0.375
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
01e2732ea0a119a0f5f40154931cfc91398fccaf
| 99
|
py
|
Python
|
flashCardApiImpl/admin.py
|
Ara225/FlashCards-Api-Django
|
1ddfdfc828afe35a6cc0d54deae3be4dcea079bf
|
[
"MIT"
] | 1
|
2020-12-08T01:40:26.000Z
|
2020-12-08T01:40:26.000Z
|
flashCardApiImpl/admin.py
|
Ara225/FlashCards-Api-Django
|
1ddfdfc828afe35a6cc0d54deae3be4dcea079bf
|
[
"MIT"
] | null | null | null |
flashCardApiImpl/admin.py
|
Ara225/FlashCards-Api-Django
|
1ddfdfc828afe35a6cc0d54deae3be4dcea079bf
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import FlashCard
admin.site.register(FlashCard)
| 19.8
| 33
| 0.79798
| 13
| 99
| 6.076923
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141414
| 99
| 4
| 34
| 24.75
| 0.929412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
01e54358b562af98b0383a71e69cc1512224b3a8
| 110
|
py
|
Python
|
enthought/permissions/default/user_storage.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/permissions/default/user_storage.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/permissions/default/user_storage.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from __future__ import absolute_import
from apptools.permissions.default.user_storage import *
| 27.5
| 55
| 0.854545
| 14
| 110
| 6.285714
| 0.785714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 110
| 3
| 56
| 36.666667
| 0.888889
| 0.109091
| 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
| 1
| 0
|
0
| 5
|
bf1ce55205cceecf82f8bc2698869b5ee59d4a07
| 15,866
|
py
|
Python
|
test/commands/test_upload.py
|
dafnifacility/cli
|
11457820b288bda0178d6153789e0902ad871213
|
[
"MIT"
] | 2
|
2021-03-23T09:39:43.000Z
|
2021-05-04T16:33:14.000Z
|
test/commands/test_upload.py
|
dafnifacility/cli
|
11457820b288bda0178d6153789e0902ad871213
|
[
"MIT"
] | 36
|
2021-03-03T10:29:58.000Z
|
2021-03-30T12:29:53.000Z
|
test/commands/test_upload.py
|
dafnifacility/cli
|
11457820b288bda0178d6153789e0902ad871213
|
[
"MIT"
] | 1
|
2021-03-03T09:41:18.000Z
|
2021-03-03T09:41:18.000Z
|
import pytest
from mock import patch, call
from click.testing import CliRunner
from requests import HTTPError, Response
import json
from dafni_cli.commands import upload
from test.fixtures.jwt_fixtures import processed_jwt_fixture
from test.fixtures.model_fixtures import get_model_upload_urls_fixture
from test.fixtures.dataset_fixtures import upload_metadata_fixture
class TestUpload:
"""test class to test the upload() command functionality"""
@patch("dafni_cli.commands.upload.model_version_ingest")
@patch("dafni_cli.commands.upload.upload_file_to_minio")
@patch("dafni_cli.commands.upload.get_model_upload_urls")
@patch("dafni_cli.commands.upload.validate_model_definition")
@patch("dafni_cli.commands.upload.argument_confirmation")
@patch("dafni_cli.commands.upload.check_for_jwt_file")
class TestInit:
"""Test class to test the get() group processing of the
JWT
"""
@pytest.mark.parametrize("version_message_flag", ["--version-message", "-m"])
def test_jwt_retrieved_and_set_on_context(
self,
mock_jwt,
mock_confirm,
mock_validate,
mock_urls,
mock_minio,
mock_ingest,
version_message_flag,
processed_jwt_fixture,
get_model_upload_urls_fixture,
):
# SETUP
mock_jwt.return_value = processed_jwt_fixture, False
mock_validate.return_value = (True, "")
mock_urls.return_value = get_model_upload_urls_fixture
runner = CliRunner()
ctx = {}
# CALL
with runner.isolated_filesystem():
with open("test_definition.yaml", "w") as f:
f.write("test definition file")
with open("test_image.txt", "w") as f:
f.write("test image file")
result = runner.invoke(
upload.upload,
[
"model",
"test_definition.yaml",
"test_image.txt",
version_message_flag,
"version message",
],
obj=ctx,
)
# ASSERT
mock_jwt.assert_called_once()
assert ctx["jwt"] == processed_jwt_fixture["jwt"]
assert result.exit_code == 0
@patch("dafni_cli.commands.upload.check_for_jwt_file")
@patch("dafni_cli.commands.upload.argument_confirmation")
@patch("dafni_cli.commands.upload.click")
@patch("dafni_cli.commands.upload.validate_model_definition")
class TestModel:
"""test class to test the upload.model() command functionality"""
@pytest.mark.parametrize("version_message_flag", ["--version-message", "-m"])
def test_method_aborted_and_500_error_printed_if_500_response_from_validation_method(
self,
mock_validate,
mock_click,
mock_confirm,
mock_jwt,
version_message_flag,
processed_jwt_fixture,
):
# SETUP
mock_jwt.return_value = processed_jwt_fixture, False
error_response = Response()
error_response.status_code = 500
mock_validate.side_effect = HTTPError(response=error_response)
runner = CliRunner()
# CALL
with runner.isolated_filesystem():
with open("test_definition.yaml", "w") as f:
f.write("test definition file")
with open("test_image.txt", "w") as f:
f.write("test image file")
result = runner.invoke(
upload.upload,
[
"model",
"test_definition.yaml",
"test_image.txt",
version_message_flag,
"version message",
],
)
# ASSERT
assert result.exit_code == 1
assert mock_click.echo.call_args_list == [
call("Validating model definition"),
call(
"Error validating the model definition. "
"See https://docs.secure.dafni.rl.ac.uk/docs/how-to/models/how-to-write-a-model-definition-file/"
" for guidance"
),
]
@pytest.mark.parametrize("version_message_flag", ["--version-message", "-m"])
def test_method_aborted_and_standard_error_printed_if_non_200_or_500_response_from_validation_method(
self,
mock_validate,
mock_click,
mock_confirm,
mock_jwt,
version_message_flag,
processed_jwt_fixture,
):
# SETUP
mock_jwt.return_value = processed_jwt_fixture, False
error_response = Response()
error_response.status_code = 400
error = HTTPError("error message", response=error_response)
mock_validate.side_effect = error
runner = CliRunner()
# CALL
with runner.isolated_filesystem():
with open("test_definition.yaml", "w") as f:
f.write("test definition file")
with open("test_image.txt", "w") as f:
f.write("test image file")
result = runner.invoke(
upload.upload,
[
"model",
"test_definition.yaml",
"test_image.txt",
version_message_flag,
"version message",
],
)
# ASSERT
assert result.exit_code == 1
assert mock_click.echo.call_args_list == [
call("Validating model definition"),
call(error),
]
@pytest.mark.parametrize("version_message_flag", ["--version-message", "-m"])
def test_method_aborted_and_error_printed_if_model_definition_is_not_valid(
self,
mock_validate,
mock_click,
mock_confirm,
mock_jwt,
version_message_flag,
processed_jwt_fixture,
):
# SETUP
mock_jwt.return_value = processed_jwt_fixture, False
mock_validate.return_value = (False, "Test validation error")
runner = CliRunner()
# CALL
with runner.isolated_filesystem():
with open("test_definition.yaml", "w") as f:
f.write("test definition file")
with open("test_image.txt", "w") as f:
f.write("test image file")
result = runner.invoke(
upload.upload,
[
"model",
"test_definition.yaml",
"test_image.txt",
version_message_flag,
"version message",
],
)
# ASSERT
assert result.exit_code == 1
mock_confirm.assert_called_once_with(
["Model definition file path", "Image file path", "Version message"],
["test_definition.yaml", "test_image.txt", "version message"],
"Confirm model upload?",
["No parent model: new model to be created"],
)
mock_validate.assert_called_once_with(
processed_jwt_fixture["jwt"], "test_definition.yaml"
)
assert mock_click.echo.call_args_list == [
call("Validating model definition"),
call(
"Definition validation failed with the following errors: Test validation error"
),
]
@patch("dafni_cli.commands.upload.get_model_upload_urls")
@patch("dafni_cli.commands.upload.upload_file_to_minio")
@patch("dafni_cli.commands.upload.model_version_ingest")
@pytest.mark.parametrize(
"upload_options, expected_argument, confirm_arg_1, confirm_arg_2, confirm_arg_3",
[
(
[
"model",
"test_definition.yaml",
"test_image.txt",
"--version-message",
"version message",
],
None,
[
"Model definition file path",
"Image file path",
"Version message",
],
["test_definition.yaml", "test_image.txt", "version message"],
["No parent model: new model to be created"],
),
(
[
"model",
"test_definition.yaml",
"test_image.txt",
"--version-message",
"version message",
"--parent-model",
"parent-model-id",
],
"parent-model-id",
[
"Model definition file path",
"Image file path",
"Version message",
"Parent model ID",
],
[
"test_definition.yaml",
"test_image.txt",
"version message",
"parent-model-id",
],
None,
),
],
ids=["Case 1 - without parent model", "Case 2 - with parent model"],
)
def test_models_api_functions_called_with_expected_arguments(
self,
mock_ingest,
mock_minio,
mock_urls,
mock_validate,
mock_click,
mock_confirm,
mock_jwt,
upload_options,
expected_argument,
confirm_arg_1,
confirm_arg_2,
confirm_arg_3,
processed_jwt_fixture,
get_model_upload_urls_fixture,
):
# SETUP
mock_jwt.return_value = processed_jwt_fixture, False
mock_validate.return_value = (True, "")
mock_urls.return_value = get_model_upload_urls_fixture
upload_id, urls_dict = get_model_upload_urls_fixture
runner = CliRunner()
# CALL
with runner.isolated_filesystem():
with open("test_definition.yaml", "w") as f:
f.write("test definition file")
with open("test_image.txt", "w") as f:
f.write("test image file")
result = runner.invoke(upload.upload, upload_options)
# ASSERT
assert result.exit_code == 0
mock_confirm.assert_called_once_with(
confirm_arg_1, confirm_arg_2, "Confirm model upload?", confirm_arg_3
)
mock_validate.assert_called_once_with(
processed_jwt_fixture["jwt"], "test_definition.yaml"
)
mock_urls.assert_called_once_with(processed_jwt_fixture["jwt"])
assert mock_minio.call_args_list == [
call(
processed_jwt_fixture["jwt"],
urls_dict["definition"],
"test_definition.yaml",
),
call(
processed_jwt_fixture["jwt"], urls_dict["image"], "test_image.txt"
),
]
mock_ingest.assert_called_once_with(
processed_jwt_fixture["jwt"],
upload_id,
"version message",
expected_argument,
)
assert mock_click.echo.call_args_list == [
call("Validating model definition"),
call("Getting urls"),
call("Uploading model definition and image"),
call("Ingesting model"),
call("Model upload complete"),
]
@patch("dafni_cli.commands.upload.upload_new_dataset_files")
@patch("dafni_cli.commands.upload.argument_confirmation")
@patch("dafni_cli.commands.upload.check_for_jwt_file")
class TestDataset:
"""Test class to test the upload.dataset command"""
@pytest.mark.parametrize(
"files", [["file_1.txt"], ["file_1.txt", "file_2.txt", "file_3.txt"]]
)
def test_upload_does_not_take_place_if_confirmation_cancelled(
self,
mock_jwt,
mock_confirm,
mock_upload,
files,
processed_jwt_fixture,
upload_metadata_fixture,
):
# SETUP
mock_jwt.return_value = processed_jwt_fixture, True
mock_confirm.side_effect = SystemExit(1)
# setup data for call
definition = "meta_data.json"
runner = CliRunner()
# setup expected call values
argument_names = ["Dataset definition file path"] + [
"Dataset file path" for file_path in files
]
arguments = [definition, *files]
# CALL
with runner.isolated_filesystem():
with open(definition, "w") as f:
f.write(json.dumps(upload_metadata_fixture))
for file_name in files:
with open(file_name, "w") as f:
f.write(f"{file_name} content")
result = runner.invoke(upload.upload, ["dataset", definition, *files])
# ASSERT
assert result.exit_code == 1
mock_upload.assert_not_called()
mock_confirm.assert_called_once_with(
argument_names, arguments, "Confirm Dataset upload?"
)
@pytest.mark.parametrize(
"files", [("file_1.txt",), ("file_1.txt", "file_2.txt", "file_3.txt")]
)
def test_upload_take_place_if_details_confirmed(
self,
mock_jwt,
mock_confirm,
mock_upload,
files,
processed_jwt_fixture,
upload_metadata_fixture,
):
# SETUP
mock_jwt.return_value = processed_jwt_fixture, True
mock_confirm.return_value = None
# setup data for call
definition = "meta_data.json"
runner = CliRunner()
# setup expected call values
argument_names = ["Dataset definition file path"] + [
"Dataset file path" for file_path in files
]
arguments = [definition, *files]
# CALL
with runner.isolated_filesystem():
with open(definition, "w") as f:
f.write(json.dumps(upload_metadata_fixture))
for file_name in files:
with open(file_name, "w") as f:
f.write(f"{file_name} content")
result = runner.invoke(upload.upload, ["dataset", definition, *files])
# ASSERT
assert result.exit_code == 0
mock_upload.assert_called_once_with(
processed_jwt_fixture["jwt"], definition, files
)
mock_confirm.assert_called_once_with(
argument_names, arguments, "Confirm Dataset upload?"
)
| 37.508274
| 117
| 0.511534
| 1,491
| 15,866
| 5.142186
| 0.111335
| 0.056606
| 0.056998
| 0.043824
| 0.793531
| 0.77814
| 0.751663
| 0.727925
| 0.674579
| 0.66258
| 0
| 0.00475
| 0.402937
| 15,866
| 423
| 118
| 37.508274
| 0.804603
| 0.027543
| 0
| 0.717877
| 0
| 0.002793
| 0.204191
| 0.047762
| 0
| 0
| 0
| 0
| 0.067039
| 1
| 0.019553
| false
| 0
| 0.02514
| 0
| 0.055866
| 0.00838
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 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
| 5
|
170d299af3ba6e1ec66533d43d1f735996eaa48c
| 779
|
py
|
Python
|
libconda/run_test.py
|
nikicc/anaconda-recipes
|
9c611a5854bf41bbc5e7ed9853dc71c0851a62ef
|
[
"BSD-3-Clause"
] | 130
|
2015-07-28T03:41:21.000Z
|
2022-03-16T03:07:41.000Z
|
libconda/run_test.py
|
nikicc/anaconda-recipes
|
9c611a5854bf41bbc5e7ed9853dc71c0851a62ef
|
[
"BSD-3-Clause"
] | 119
|
2015-08-01T00:54:06.000Z
|
2021-01-05T13:00:46.000Z
|
libconda/run_test.py
|
nikicc/anaconda-recipes
|
9c611a5854bf41bbc5e7ed9853dc71c0851a62ef
|
[
"BSD-3-Clause"
] | 72
|
2015-07-29T02:35:56.000Z
|
2022-02-26T14:31:15.000Z
|
import libconda
# used in constructor
from libconda.fetch import fetch_index, fetch_pkg
from libconda.resolve import Resolve, NoPackagesFound
from libconda.config import subdir
# used in cas-mirror
from libconda.config import normalize_urls
from libconda.fetch import fetch_pkg, fetch_index
from libconda.fetch import download
# used in cas-installer
from libconda.utils import md5_file
from libconda.fetch import fetch_index, fetch_pkg
from libconda.resolve import Resolve
from libconda.config import subdir
# internal Anaconda build system
from libconda.fetch import fetch_index, fetch_pkg
from libconda.resolve import Resolve, MatchSpec
from libconda.resolve import Package
print('libconda.__version__: %s' % libconda.__version__)
assert libconda.__version__ == '4.0.3'
| 28.851852
| 56
| 0.830552
| 110
| 779
| 5.681818
| 0.318182
| 0.2496
| 0.136
| 0.184
| 0.4912
| 0.3504
| 0.3504
| 0.3504
| 0.3504
| 0.3504
| 0
| 0.005814
| 0.116816
| 779
| 26
| 57
| 29.961538
| 0.902616
| 0.116816
| 0
| 0.3125
| 0
| 0
| 0.04246
| 0.030747
| 0
| 0
| 0
| 0
| 0.0625
| 1
| 0
| true
| 0
| 0.875
| 0
| 0.875
| 0.0625
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
17352f0572956891e9ef36dfb8033a47acffb23a
| 59
|
py
|
Python
|
dynamic_import/imported/__main__.py
|
seflorentino/python-scratches
|
0bf0b1b00da6dd810433b7b0e9159ea95fa9b1c0
|
[
"MIT"
] | null | null | null |
dynamic_import/imported/__main__.py
|
seflorentino/python-scratches
|
0bf0b1b00da6dd810433b7b0e9159ea95fa9b1c0
|
[
"MIT"
] | null | null | null |
dynamic_import/imported/__main__.py
|
seflorentino/python-scratches
|
0bf0b1b00da6dd810433b7b0e9159ea95fa9b1c0
|
[
"MIT"
] | null | null | null |
from dynamic_import.imported.a_lib import run_me
run_me()
| 14.75
| 48
| 0.830508
| 11
| 59
| 4.090909
| 0.727273
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101695
| 59
| 3
| 49
| 19.666667
| 0.849057
| 0
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
175157f27dc3cb6853c6130c962b6b8809a95c19
| 282
|
py
|
Python
|
bot/chk/has.py
|
VoxelPrismatic/prizai
|
632a5dfed23807d78064d292d474ac4cc8988b12
|
[
"Unlicense"
] | 2
|
2019-11-08T21:34:44.000Z
|
2020-07-05T15:31:19.000Z
|
bot/chk/has.py
|
VoxelPrismatic/prizai
|
632a5dfed23807d78064d292d474ac4cc8988b12
|
[
"Unlicense"
] | null | null | null |
bot/chk/has.py
|
VoxelPrismatic/prizai
|
632a5dfed23807d78064d292d474ac4cc8988b12
|
[
"Unlicense"
] | 2
|
2020-07-05T15:39:51.000Z
|
2020-07-05T16:15:47.000Z
|
def has_attachment(ctx):
return bool(len(ctx.message.attachments))
def has_embed(ctx):
return bool(len(ctx.message.embeds))
def file_type(ctx, filetype, attnum = 0):
if not has_attachment(ctx): return False
return ctx.message.attachments[attnum].endswith(filetype)
| 31.333333
| 61
| 0.744681
| 41
| 282
| 5.02439
| 0.487805
| 0.131068
| 0.15534
| 0.213592
| 0.252427
| 0.252427
| 0
| 0
| 0
| 0
| 0
| 0.004098
| 0.134752
| 282
| 9
| 61
| 31.333333
| 0.840164
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0
| 0
| 0.285714
| 0.857143
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
175584daed04b8f0e95341d66e63f82f08fc34c7
| 64
|
py
|
Python
|
glue_genomics_viewers/network/qt/__init__.py
|
gluesolutions/glue-genomics-viewers
|
c134d513aa1435728370c237dba624c5b9d42428
|
[
"BSD-3-Clause"
] | null | null | null |
glue_genomics_viewers/network/qt/__init__.py
|
gluesolutions/glue-genomics-viewers
|
c134d513aa1435728370c237dba624c5b9d42428
|
[
"BSD-3-Clause"
] | 17
|
2021-07-22T14:25:01.000Z
|
2021-09-17T16:22:18.000Z
|
glue_genomics_viewers/network/qt/__init__.py
|
gluesolutions/glue-genomics-viewers
|
c134d513aa1435728370c237dba624c5b9d42428
|
[
"BSD-3-Clause"
] | 1
|
2021-08-15T06:33:09.000Z
|
2021-08-15T06:33:09.000Z
|
from .layer_style_editor import *
from .options_widget import *
| 21.333333
| 33
| 0.8125
| 9
| 64
| 5.444444
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 64
| 2
| 34
| 32
| 0.875
| 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
| 1
| 0
|
0
| 5
|
bd64196beaf5f3568b52fd63e28299734b0aff5f
| 144
|
py
|
Python
|
NekoGram/__init__.py
|
lyteloli/NekoGram
|
f077471000b40a74e0eb4e98dfb570b5e34d23ab
|
[
"MIT"
] | 8
|
2020-08-21T07:43:52.000Z
|
2022-01-27T06:48:01.000Z
|
NekoGram/__init__.py
|
lyteloli/NekoGram
|
f077471000b40a74e0eb4e98dfb570b5e34d23ab
|
[
"MIT"
] | null | null | null |
NekoGram/__init__.py
|
lyteloli/NekoGram
|
f077471000b40a74e0eb4e98dfb570b5e34d23ab
|
[
"MIT"
] | 1
|
2022-01-27T06:48:02.000Z
|
2022-01-27T06:48:02.000Z
|
from aiogram import Bot, Dispatcher, types
from .neko import Neko
from .neko_router import NekoRouter
from .build_response import BuildResponse
| 28.8
| 42
| 0.840278
| 20
| 144
| 5.95
| 0.6
| 0.134454
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 144
| 4
| 43
| 36
| 0.944444
| 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
| 1
| 0
|
0
| 5
|
bd7a5f6e1edca371b601f353008bc0a14e5fbb4d
| 187
|
py
|
Python
|
src/arcfutil/aff/generator/__init__.py
|
inuEbisu/arcfutil
|
4ef575322113db4bb09d5ac2870516fb2b265216
|
[
"MIT"
] | 16
|
2020-09-26T09:00:49.000Z
|
2022-03-15T10:45:16.000Z
|
src/arcfutil/aff/generator/__init__.py
|
inuEbisu/arcfutil
|
4ef575322113db4bb09d5ac2870516fb2b265216
|
[
"MIT"
] | 4
|
2020-08-14T09:14:27.000Z
|
2022-02-28T02:17:45.000Z
|
src/arcfutil/aff/generator/__init__.py
|
feightwywx/arc.py
|
55caa1c0dee856cf7c18dad2254d22b5e4d7994d
|
[
"MIT"
] | 3
|
2021-11-25T10:22:14.000Z
|
2022-02-17T08:19:24.000Z
|
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# (c)2021 .direwolf <kururinmiracle@outlook.com>
# Licensed under the MIT License.
from .arc_sample import *
from .timing_sample import *
| 20.777778
| 48
| 0.705882
| 26
| 187
| 5
| 0.884615
| 0.184615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0375
| 0.144385
| 187
| 8
| 49
| 23.375
| 0.775
| 0.652406
| 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
| 1
| 0
|
0
| 5
|
bdffc7b949bc2f25e5f1c39ee62aff3ca506123e
| 74
|
py
|
Python
|
src/galaxies_datasets/scripts/documentation/__init__.py
|
autogalmorph/galaxies_datasets-1
|
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
|
[
"MIT"
] | null | null | null |
src/galaxies_datasets/scripts/documentation/__init__.py
|
autogalmorph/galaxies_datasets-1
|
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
|
[
"MIT"
] | 16
|
2021-09-21T21:25:05.000Z
|
2022-03-01T14:10:08.000Z
|
src/galaxies_datasets/scripts/documentation/__init__.py
|
autogalmorph/galaxies_datasets-1
|
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
|
[
"MIT"
] | 2
|
2022-03-05T14:56:55.000Z
|
2022-03-09T23:58:56.000Z
|
"""Documentation scripts."""
from .build_catalog import app # noqa: F401
| 24.666667
| 44
| 0.72973
| 9
| 74
| 5.888889
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.046875
| 0.135135
| 74
| 2
| 45
| 37
| 0.78125
| 0.459459
| 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
| 1
| 0
|
0
| 5
|
da0d8825c52e15ba2c018d1419f033ce836fcdb1
| 597
|
py
|
Python
|
src/server/MhmServer/models/__init__.py
|
jbrr/mosquito_heat_map
|
2cce46a5e26526bd04a83486a62733ab343376ba
|
[
"MIT"
] | null | null | null |
src/server/MhmServer/models/__init__.py
|
jbrr/mosquito_heat_map
|
2cce46a5e26526bd04a83486a62733ab343376ba
|
[
"MIT"
] | 2
|
2020-07-07T20:31:40.000Z
|
2022-02-10T19:17:35.000Z
|
src/server/MhmServer/models/__init__.py
|
jbrr/mosquito_heat_map
|
2cce46a5e26526bd04a83486a62733ab343376ba
|
[
"MIT"
] | null | null | null |
from MhmServer.models.laboratory import Laboratory
from MhmServer.models.location import Location
from MhmServer.models.nlcd_class import NlcdClass
from MhmServer.models.sample import Sample
from MhmServer.models.scientist import Scientist
from MhmServer.models.specimen import Specimen
from MhmServer.models.sub_sample import SubSample
#
#
# def Laboratory:
# return Laboratory
#
#
# def Location:
# return Location
#
#
# def NlcdClass:
# return NlcdClass
#
#
# def Sample:
# return Sample
#
#
# def Scientist:
# return Scientist
#
#
# def Specimen:
# return Specimen
#
#
| 17.558824
| 50
| 0.752094
| 68
| 597
| 6.573529
| 0.235294
| 0.203579
| 0.297539
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170854
| 597
| 33
| 51
| 18.090909
| 0.90303
| 0.346734
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
da164172d5ad59050043a52b0200d1db365df406
| 43
|
py
|
Python
|
item_engine/bnf_2/v_0_0_9/__init__.py
|
GabrielAmare/ItemEngine
|
10277626c3724ad9ae7b934f53e11e305dc34da5
|
[
"MIT"
] | null | null | null |
item_engine/bnf_2/v_0_0_9/__init__.py
|
GabrielAmare/ItemEngine
|
10277626c3724ad9ae7b934f53e11e305dc34da5
|
[
"MIT"
] | null | null | null |
item_engine/bnf_2/v_0_0_9/__init__.py
|
GabrielAmare/ItemEngine
|
10277626c3724ad9ae7b934f53e11e305dc34da5
|
[
"MIT"
] | null | null | null |
from .build import *
from .engine import *
| 14.333333
| 21
| 0.72093
| 6
| 43
| 5.166667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186047
| 43
| 2
| 22
| 21.5
| 0.885714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 0
| 0
|
0
| 5
|
da35203411b114b4f268dba189100452edfa9e55
| 53
|
py
|
Python
|
evaluation/engine/__init__.py
|
sinistro14/mindefuse
|
c7371a81731d0b9a03d3ef18f91c336e4135c17d
|
[
"MIT"
] | null | null | null |
evaluation/engine/__init__.py
|
sinistro14/mindefuse
|
c7371a81731d0b9a03d3ef18f91c336e4135c17d
|
[
"MIT"
] | 1
|
2019-08-22T19:51:12.000Z
|
2019-08-22T19:51:12.000Z
|
evaluation/engine/__init__.py
|
sinistro14/mindefuse
|
c7371a81731d0b9a03d3ef18f91c336e4135c17d
|
[
"MIT"
] | null | null | null |
#! usr/bin/env python3.7
from .engine import Engine
| 13.25
| 26
| 0.735849
| 9
| 53
| 4.333333
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044444
| 0.150943
| 53
| 3
| 27
| 17.666667
| 0.822222
| 0.433962
| 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
| 1
| 0
|
0
| 5
|
da43318a04eabc44d81ebd5b6b4681d423fa413f
| 84
|
py
|
Python
|
cone/sql/__init__.py
|
cone387/cone
|
07800a67e351add2d1dec43fa85c1850b3b94ba6
|
[
"MIT"
] | 1
|
2020-01-10T09:03:30.000Z
|
2020-01-10T09:03:30.000Z
|
cone/sql/__init__.py
|
cone387/spider
|
07800a67e351add2d1dec43fa85c1850b3b94ba6
|
[
"MIT"
] | null | null | null |
cone/sql/__init__.py
|
cone387/spider
|
07800a67e351add2d1dec43fa85c1850b3b94ba6
|
[
"MIT"
] | null | null | null |
from .sqliter import Sqliter
from .mysql import MySql
# from .mongodb import Mongodb
| 28
| 30
| 0.809524
| 12
| 84
| 5.666667
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 84
| 3
| 30
| 28
| 0.944444
| 0.333333
| 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
| 1
| 0
|
0
| 5
|
da4d276607cc7665da52846ea77389172b7437e2
| 313
|
py
|
Python
|
stardist/geometry/__init__.py
|
ianbgroves/stardist
|
6524c27d01c625dabfd75b1443dd46ccb1cb3dcd
|
[
"BSD-3-Clause"
] | 1
|
2021-02-05T11:59:39.000Z
|
2021-02-05T11:59:39.000Z
|
stardist/geometry/__init__.py
|
ianbgroves/stardist
|
6524c27d01c625dabfd75b1443dd46ccb1cb3dcd
|
[
"BSD-3-Clause"
] | 1
|
2020-06-17T09:06:29.000Z
|
2020-06-17T09:06:29.000Z
|
stardist/geometry/__init__.py
|
ianbgroves/stardist
|
6524c27d01c625dabfd75b1443dd46ccb1cb3dcd
|
[
"BSD-3-Clause"
] | null | null | null |
from __future__ import absolute_import, print_function
# TODO: rethink naming for 2D/3D functions
from .geom2d import star_dist, polygons_to_label, relabel_image_stardist, ray_angles, dist_to_coord
from .geom3d import star_dist3D, polyhedron_to_label, relabel_image_stardist3D#, dist_to_volume, dist_to_centroid
| 52.166667
| 113
| 0.859425
| 47
| 313
| 5.234043
| 0.659574
| 0.073171
| 0.113821
| 0.154472
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021127
| 0.092652
| 313
| 6
| 113
| 52.166667
| 0.84507
| 0.236422
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.333333
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e516dc6bd053cc022c5f7612df858c180b7a8895
| 99
|
py
|
Python
|
liasis/__init__.py
|
johnnywell/liasis
|
42bddabd9025dfa5812693e904ee168121ef39ac
|
[
"MIT"
] | 6
|
2019-03-25T18:34:12.000Z
|
2020-03-04T14:20:29.000Z
|
liasis/__init__.py
|
johnnywell/liasis
|
42bddabd9025dfa5812693e904ee168121ef39ac
|
[
"MIT"
] | 5
|
2019-03-25T20:29:19.000Z
|
2019-12-24T15:01:37.000Z
|
liasis/__init__.py
|
johnnywell/liasis
|
42bddabd9025dfa5812693e904ee168121ef39ac
|
[
"MIT"
] | 1
|
2019-07-25T17:58:30.000Z
|
2019-07-25T17:58:30.000Z
|
from .cli import cli
from .core import *
from .base import *
if __name__ == "__main__":
cli()
| 14.142857
| 26
| 0.656566
| 14
| 99
| 4.071429
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 99
| 7
| 27
| 14.142857
| 0.74026
| 0
| 0
| 0
| 0
| 0
| 0.08
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e53821860c0ad9dff2774bb56f46bfe446e4f68c
| 166
|
py
|
Python
|
augmentation/__init__.py
|
tunahansalih/VPE
|
97a47820ebe167120af096c8eb746195790e9e4d
|
[
"MIT"
] | null | null | null |
augmentation/__init__.py
|
tunahansalih/VPE
|
97a47820ebe167120af096c8eb746195790e9e4d
|
[
"MIT"
] | null | null | null |
augmentation/__init__.py
|
tunahansalih/VPE
|
97a47820ebe167120af096c8eb746195790e9e4d
|
[
"MIT"
] | null | null | null |
from .augmentations import RandomRotate, RandomSized, CenterPadding, RandomSizedCrop, RandomHorizontallyFlip, \
CenterCrop, FreeScale, RandomCrop, Compose, Scale
| 55.333333
| 111
| 0.825301
| 13
| 166
| 10.538462
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108434
| 166
| 2
| 112
| 83
| 0.925676
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e55f588d8518725ce9442c7cbd1789d5d9c4ca7d
| 37
|
py
|
Python
|
serv/exceptions.py
|
nir0s/serv
|
7af724ed49c0eb766c37c4b5287b043a8cf99e9c
|
[
"Apache-2.0"
] | 13
|
2015-12-30T08:15:32.000Z
|
2022-02-09T21:10:32.000Z
|
serv/exceptions.py
|
nir0s/serv
|
7af724ed49c0eb766c37c4b5287b043a8cf99e9c
|
[
"Apache-2.0"
] | 9
|
2016-04-05T11:19:08.000Z
|
2016-11-23T09:35:02.000Z
|
serv/exceptions.py
|
nir0s/serv
|
7af724ed49c0eb766c37c4b5287b043a8cf99e9c
|
[
"Apache-2.0"
] | 3
|
2017-01-15T22:55:07.000Z
|
2020-10-20T11:51:42.000Z
|
class ServError(Exception):
pass
| 12.333333
| 27
| 0.72973
| 4
| 37
| 6.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.189189
| 37
| 2
| 28
| 18.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 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
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.