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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e7b35b10fd121d0b29cd1d39fc4c75e4f568a1f4
| 25
|
py
|
Python
|
chapter2_ws/devel/lib/python3/dist-packages/mastering_ros_demo_pkg/srv/__init__.py
|
Rajat-Arora/ros_packt_book
|
a715485ea6e36d298bc6f6f306af0595d89e1174
|
[
"MIT"
] | null | null | null |
chapter2_ws/devel/lib/python3/dist-packages/mastering_ros_demo_pkg/srv/__init__.py
|
Rajat-Arora/ros_packt_book
|
a715485ea6e36d298bc6f6f306af0595d89e1174
|
[
"MIT"
] | null | null | null |
chapter2_ws/devel/lib/python3/dist-packages/mastering_ros_demo_pkg/srv/__init__.py
|
Rajat-Arora/ros_packt_book
|
a715485ea6e36d298bc6f6f306af0595d89e1174
|
[
"MIT"
] | null | null | null |
from ._demo_srv import *
| 12.5
| 24
| 0.76
| 4
| 25
| 4.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 25
| 1
| 25
| 25
| 0.809524
| 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
| 1
| 0
|
0
| 6
|
e7bf5114270c4c1ba3fa4db47d240b4427db5d56
| 31
|
py
|
Python
|
is_ipfs/__init__.py
|
Barabazs/py-is_ipfs
|
c8ac622879b2223e298d9cc4a59ae7da89eb0479
|
[
"MIT"
] | 1
|
2022-03-09T14:23:44.000Z
|
2022-03-09T14:23:44.000Z
|
is_ipfs/__init__.py
|
Barabazs/py-is_ipfs
|
c8ac622879b2223e298d9cc4a59ae7da89eb0479
|
[
"MIT"
] | null | null | null |
is_ipfs/__init__.py
|
Barabazs/py-is_ipfs
|
c8ac622879b2223e298d9cc4a59ae7da89eb0479
|
[
"MIT"
] | null | null | null |
from .is_ipfs import Validator
| 15.5
| 30
| 0.83871
| 5
| 31
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 31
| 1
| 31
| 31
| 0.925926
| 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
| 1
| 0
|
0
| 6
|
99b7f2669bc39124ccbb858ced46317dfc7b5280
| 7,789
|
py
|
Python
|
packages/dinesti/python/_grab.py
|
USEPA/Water-Security-Toolkit
|
6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb
|
[
"BSD-3-Clause"
] | 3
|
2019-06-10T18:04:14.000Z
|
2020-12-05T18:11:40.000Z
|
packages/dinesti/python/_grab.py
|
USEPA/Water-Security-Toolkit
|
6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb
|
[
"BSD-3-Clause"
] | null | null | null |
packages/dinesti/python/_grab.py
|
USEPA/Water-Security-Toolkit
|
6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb
|
[
"BSD-3-Clause"
] | 2
|
2020-09-24T19:04:14.000Z
|
2020-12-05T18:11:43.000Z
|
# Copyright (2013) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
# retains certain rights in this software.
#
# This software is released under the FreeBSD license as described
# in License.txt
import time
import string
import subprocess
import os
import tempfile
from multiprocessing import Process
import _gui
from _gui import FakeFile
import json # Python 2.6 or later
def createYmlFile(fINP, fWQM, fSCN, fTSG, fSEN, fNodes, dSampleTime, nSampleCount, sOutputPrefix):
file = tempfile.NamedTemporaryFile(delete=False, suffix='.yml')
_gui.writeLine(file,"# written using dinesti web gui")
_gui.writeLine(file,"")
_gui.writeLine(file,"network:")
_gui.writeLine(file," epanet file: " + fINP.name)
#_gui.writeLine(file," wqm file: " + fWQM.name) # moved to grabsample section
#_gui.writeLine(file," hydraulic timestep: None") # no longer available
_gui.writeLine(file," water quality timestep: None")
_gui.writeLine(file," simulation duration: None")
_gui.writeLine(file,"")
_gui.writeLine(file,"scenario:") # used to be called 'events'
_gui.writeLine(file," scn file: " + fSCN.name) # for _inversion LP (optimization)
_gui.writeLine(file," tsg file: " + fTSG.name) # for _inversion STEP (optmization)
_gui.writeLine(file," ignore merlion warnings: False") # moved from network section
_gui.writeLine(file,"")
#_gui.writeLine(file,"solver:")
#_gui.writeLine(file," cplex:")
#_gui.writeLine(file," mipgap: 0.02")
#_gui.writeLine(file," threads: 1")
_gui.writeLine(file,"")
#_gui.writeLine(file,"samplelocation:")
_gui.writeLine(file,"grabsample:")
_gui.writeLine(file," wqm file: " + fWQM.name) # moved from network section
_gui.writeLine(file," model format: PYOMO") # AMPL or PYOMO
_gui.writeLine(file," sample time: " + str(dSampleTime / 60)) # minutes
_gui.writeLine(file," threshold: 0.01") # default = 0.001
_gui.writeLine(file," fixed sensor file: " + fSEN.name)
#_gui.writeLine(file," not allowed locations file: None") # no longer available
_gui.writeLine(file," allowed locations file: " + fNodes.name) # TODO
_gui.writeLine(file," N samples: " + str(nSampleCount)) # default = 3
_gui.writeLine(file," greedy selection: True")
_gui.writeLine(file,"")
_gui.writeLine(file,"configure:")
_gui.writeLine(file," ampl executable: ampl")#" + sInstallDir + "bin/ampl")
_gui.writeLine(file," pyomo executable: pyomo")#" + sInstallDir + "bin/pyomo")
_gui.writeLine(file," output prefix: " + sOutputPrefix)
_gui.writeLine(file,"")
#_gui.writeLine(file,"internal:")
#_gui.writeLine(file," nodeNames: None")
#_gui.writeLine(file," nodeIndices: None")
return file
def createInpFile(data):
text = _gui.getFile(data["docId"], data["fileName"])
temp = tempfile.NamedTemporaryFile(delete=False, suffix='.inp')
temp.write(text)
return temp
def createScnFile(uuid):
return FakeFile()
def createTsgFile(uuid):
temp = tempfile.NamedTemporaryFile(delete=False, suffix='.tsg')
data = _gui.getView("m_ScenariosList?key=\"" + uuid + "\"")
for row in data["rows"]:
text = _gui.getFile(row["id"], row["value"]["fileName"])
temp.write(text + "\n")
return temp
def createSenFile(uuid):
temp = tempfile.NamedTemporaryFile(delete=False, suffix='.sen')
doc = _gui.getDoc(uuid)
sensors = _gui.getValue(doc, "sensors", "")
sensors = sensors.split("\n")
bFirst = True
for line in sensors:
s = line.strip()
if len(s) > 0:
if not bFirst:
temp.write("\n")
bFirst = False
temp.write(s)
return temp
def createNodesFile(Nodes):
temp = tempfile.NamedTemporaryFile(delete=False, suffix='.nodes')
for node in Nodes:
temp.write(node + "\n")
return temp
def runWst(fINP, fWQM, fSCN, fTSG, fSEN, fNodes, fYML, sUuid, sOutputPrefix):
nStart = time.time()
sInstallDir = _gui.getInstallDir()
args = [sInstallDir + "python/bin/wst", "grabsample", fYML.name]
#
p = subprocess.Popen(args, stdout=subprocess.PIPE)
doc = _gui.getDoc(sUuid)
sampleTime = doc.get("sampleTime")
inp_info = doc.get("docFile_INP")
duration = inp_info.get("duration")
bErrorOverTime = False
if sampleTime <> None and duration <> None:
if sampleTime > duration:
bErrorOverTime = True
doc["pid"] = str(p.pid)
doc["status"] = "Running"
res = _gui.setDoc(doc)
#doc = _gui.getDoc(sUuid)
com = p.communicate()
sOut = com[0]
#
sFile = sOutputPrefix + "_grabsample_results.json"
results = _gui.readJsonFile(sFile, {"Error": "output file was not created: " + sFile})
sOUT = sOutputPrefix + "_samplelocation.out"
debug_text_out_file = _gui.readFile(sOUT)
doc = _gui.getDoc(sUuid)
bError = False
if bErrorOverTime:
sError = "the sample time is after the end of the simulation."
results = {"Error": sError}
doc["Error"] = sError
bError = True
elif results.get("Error") <> None:
doc["Error"] = results["Error"]
bError = True
doc["results"] = results
doc["results"]["sampleTime"] = results.get("sampleTime", 0) * 60 # TODO - this should be changed in the grabsample executable
doc["debug_fileSCN"] = fSCN.name
doc["debug_fileTSG"] = fTSG.name
doc["debug_stdout"] = com[0]
doc["returnCode"] = p.returncode
doc["debug_text_out_file"] = debug_text_out_file
#
if com[1] == None:
doc["debug_stderr"] = "\0"
else:
doc["debug_stderr"] = com[1]
#
sKill = "Signal handler called from"
index = string.find(sOut, sKill)
doc["debug_stdout_find_error_index"] = index
#
if _gui.bDeleteTempFiles(override=None):
_gui.removeFiles([fWQM, fTSG, fSCN, fINP, fSEN, fNodes, fYML])
_gui.removeFile(sOutputPrefix + "_epanet.rpt")
_gui.removeFile(sOutputPrefix + "_samplelocation.out")
_gui.removeFile(sOutputPrefix + "_samplelocation.log")
_gui.removeFile(sOutputPrefix + "_MERLION_LABEL_MAP.txt")
_gui.removeFile(sOutputPrefix + "_GSP.dat")
_gui.removeFile(sOutputPrefix + "_ampl.run")
_gui.removeFile(sOutputPrefix + "_ampl.out")
_gui.removeFile(sOutputPrefix + "_grabsample_results.dat")
_gui.removeFile(sOutputPrefix + "_grabsample_results.json")
#
if index == -1 and p.returncode == 0:
doc["status"] = "Complete"
elif index == -1 or bError:
doc["status"] = "Error"
else:
doc["status"] = "Stopped"
#
doc["timer"] = time.time() - nStart
_gui.setDoc(sUuid, doc)
return doc
def runThreaded(doc, sOutputPrefix, bThreaded=True):
sUuid = doc["_id"]
dSampleTime = doc.get("sampleTime", 0)
nSampleCount = doc.get("sampleCount", 3)
docFile_INP = doc.get("docFile_INP")
Nodes = doc.get("Nodes" )
fWQM = _gui.createWqmFile(docFile_INP)
if fWQM == None:
fINP = createInpFile(docFile_INP)
fWQM = FakeFile()
else:
fINP = FakeFile()
fSCN = createScnFile(sUuid) # FakeFile
fTSG = createTsgFile(sUuid)
fSEN = createSenFile(sUuid)
if Nodes == None:
fNodes = FakeFile()
else:
fNodes = createNodesFile(Nodes)
fYML = createYmlFile(fINP, fWQM, fSCN, fTSG, fSEN, fNodes, dSampleTime, nSampleCount, sOutputPrefix)
_gui.closeFiles([fINP, fWQM, fSCN, fTSG, fSEN, fNodes, fYML])
#
if bThreaded:
p = Process(target=runWst, args=(fINP, fWQM, fSCN, fTSG, fSEN, fNodes, fYML, sUuid, sOutputPrefix, ))
p.start()
else:
return runWst(fINP, fWQM, fSCN, fTSG, fSEN, fNodes, fYML, sUuid, sOutputPrefix)
return
def run(sCall, sUuid, bThreaded=True):
if sCall == "delete":
return False
if sCall == "rename":
return False
sDir = tempfile.gettempdir()
os.chdir(sDir)
doc = _gui.getDoc(sUuid)
runThreaded(doc, sUuid, True)
return _gui.respondJSON(json.dumps({}))
def main():
_gui.setHost()
for req in _gui.getRequests():
sDb = _gui.getQuery(req, "db")
_gui.setDatabase(sDb)
sCall = _gui.getQuery(req, "call")
sUuid = _gui.getQuery(req, "uuid")
bRetVal = run(sCall, sUuid, True)
if bRetVal: continue
_gui.respondJSON(json.dumps({}))
if __name__ == "__main__":
main()
| 7,789
| 7,789
| 0.705867
| 999
| 7,789
| 5.374374
| 0.269269
| 0.087167
| 0.116223
| 0.01788
| 0.196685
| 0.172658
| 0.122369
| 0.070404
| 0.056994
| 0.048054
| 0
| 0.00646
| 0.145462
| 7,789
| 1
| 7,789
| 7,789
| 0.80018
| 0.993966
| 0
| 0.117021
| 0
| 0
| 0.177388
| 0.021644
| 0
| 0
| 0
| 1
| 0
| 0
| null | null | 0
| 0.047872
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
99cfce15f277b305b1d6cfb0628ad6ec4ccc88f5
| 16,919
|
py
|
Python
|
pybind/slxos/v17r_2_00/qos_mpls/map_apply/apply_traffic_class_exp_map_name/__init__.py
|
extremenetworks/pybind
|
44c467e71b2b425be63867aba6e6fa28b2cfe7fb
|
[
"Apache-2.0"
] | null | null | null |
pybind/slxos/v17r_2_00/qos_mpls/map_apply/apply_traffic_class_exp_map_name/__init__.py
|
extremenetworks/pybind
|
44c467e71b2b425be63867aba6e6fa28b2cfe7fb
|
[
"Apache-2.0"
] | null | null | null |
pybind/slxos/v17r_2_00/qos_mpls/map_apply/apply_traffic_class_exp_map_name/__init__.py
|
extremenetworks/pybind
|
44c467e71b2b425be63867aba6e6fa28b2cfe7fb
|
[
"Apache-2.0"
] | 1
|
2021-11-05T22:15:42.000Z
|
2021-11-05T22:15:42.000Z
|
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
class apply_traffic_class_exp_map_name(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-qos-mpls - based on the path /qos-mpls/map-apply/apply-traffic-class-exp-map-name. Each member element of
the container is represented as a class variable - with a specific
YANG type.
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__map_name_cmd2','__all_zero_map_cmd2','__default_map_cmd2','__All_cmd2',)
_yang_name = 'apply-traffic-class-exp-map-name'
_rest_name = 'traffic-class-exp'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__default_map_cmd2 = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="default-map-cmd2", rest_name="default-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-default-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP based on default map', u'alt-name': u'default-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
self.__map_name_cmd2 = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9_]{0,63})'}), is_leaf=True, yang_name="map-name-cmd2", rest_name="map-name-cmd2", parent=self, choice=(u'apply-traffic-class-exp', u'ca-map-name-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'<MAP NAME>;;Name for the MAP(Max 64)', u'cli-drop-node-name': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='map-name-type', is_config=True)
self.__All_cmd2 = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="All-cmd2", rest_name="All", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Apply globally on all interface', u'alt-name': u'All'}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
self.__all_zero_map_cmd2 = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="all-zero-map-cmd2", rest_name="all-zero-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-all-zero-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP 0', u'alt-name': u'all-zero-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'qos-mpls', u'map-apply', u'apply-traffic-class-exp-map-name']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'qos-mpls', u'map-apply', u'traffic-class-exp']
def _get_map_name_cmd2(self):
"""
Getter method for map_name_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/map_name_cmd2 (map-name-type)
"""
return self.__map_name_cmd2
def _set_map_name_cmd2(self, v, load=False):
"""
Setter method for map_name_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/map_name_cmd2 (map-name-type)
If this variable is read-only (config: false) in the
source YANG file, then _set_map_name_cmd2 is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_map_name_cmd2() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9_]{0,63})'}), is_leaf=True, yang_name="map-name-cmd2", rest_name="map-name-cmd2", parent=self, choice=(u'apply-traffic-class-exp', u'ca-map-name-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'<MAP NAME>;;Name for the MAP(Max 64)', u'cli-drop-node-name': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='map-name-type', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """map_name_cmd2 must be of a type compatible with map-name-type""",
'defined-type': "brocade-apply-qos-mpls:map-name-type",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9_]{0,63})'}), is_leaf=True, yang_name="map-name-cmd2", rest_name="map-name-cmd2", parent=self, choice=(u'apply-traffic-class-exp', u'ca-map-name-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'<MAP NAME>;;Name for the MAP(Max 64)', u'cli-drop-node-name': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='map-name-type', is_config=True)""",
})
self.__map_name_cmd2 = t
if hasattr(self, '_set'):
self._set()
def _unset_map_name_cmd2(self):
self.__map_name_cmd2 = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9_]{0,63})'}), is_leaf=True, yang_name="map-name-cmd2", rest_name="map-name-cmd2", parent=self, choice=(u'apply-traffic-class-exp', u'ca-map-name-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'<MAP NAME>;;Name for the MAP(Max 64)', u'cli-drop-node-name': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='map-name-type', is_config=True)
def _get_all_zero_map_cmd2(self):
"""
Getter method for all_zero_map_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/all_zero_map_cmd2 (empty)
"""
return self.__all_zero_map_cmd2
def _set_all_zero_map_cmd2(self, v, load=False):
"""
Setter method for all_zero_map_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/all_zero_map_cmd2 (empty)
If this variable is read-only (config: false) in the
source YANG file, then _set_all_zero_map_cmd2 is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_all_zero_map_cmd2() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="all-zero-map-cmd2", rest_name="all-zero-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-all-zero-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP 0', u'alt-name': u'all-zero-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """all_zero_map_cmd2 must be of a type compatible with empty""",
'defined-type': "empty",
'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="all-zero-map-cmd2", rest_name="all-zero-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-all-zero-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP 0', u'alt-name': u'all-zero-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)""",
})
self.__all_zero_map_cmd2 = t
if hasattr(self, '_set'):
self._set()
def _unset_all_zero_map_cmd2(self):
self.__all_zero_map_cmd2 = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="all-zero-map-cmd2", rest_name="all-zero-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-all-zero-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP 0', u'alt-name': u'all-zero-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
def _get_default_map_cmd2(self):
"""
Getter method for default_map_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/default_map_cmd2 (empty)
"""
return self.__default_map_cmd2
def _set_default_map_cmd2(self, v, load=False):
"""
Setter method for default_map_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/default_map_cmd2 (empty)
If this variable is read-only (config: false) in the
source YANG file, then _set_default_map_cmd2 is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_default_map_cmd2() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="default-map-cmd2", rest_name="default-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-default-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP based on default map', u'alt-name': u'default-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """default_map_cmd2 must be of a type compatible with empty""",
'defined-type': "empty",
'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="default-map-cmd2", rest_name="default-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-default-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP based on default map', u'alt-name': u'default-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)""",
})
self.__default_map_cmd2 = t
if hasattr(self, '_set'):
self._set()
def _unset_default_map_cmd2(self):
self.__default_map_cmd2 = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="default-map-cmd2", rest_name="default-map", parent=self, choice=(u'apply-traffic-class-exp', u'ca-default-map-cmd2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Map traffic-class and drop prec to EXP based on default map', u'alt-name': u'default-map', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
def _get_All_cmd2(self):
"""
Getter method for All_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/All_cmd2 (empty)
"""
return self.__All_cmd2
def _set_All_cmd2(self, v, load=False):
"""
Setter method for All_cmd2, mapped from YANG variable /qos_mpls/map_apply/apply_traffic_class_exp_map_name/All_cmd2 (empty)
If this variable is read-only (config: false) in the
source YANG file, then _set_All_cmd2 is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_All_cmd2() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="All-cmd2", rest_name="All", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Apply globally on all interface', u'alt-name': u'All'}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """All_cmd2 must be of a type compatible with empty""",
'defined-type': "empty",
'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="All-cmd2", rest_name="All", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Apply globally on all interface', u'alt-name': u'All'}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)""",
})
self.__All_cmd2 = t
if hasattr(self, '_set'):
self._set()
def _unset_All_cmd2(self):
self.__All_cmd2 = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="All-cmd2", rest_name="All", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Apply globally on all interface', u'alt-name': u'All'}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='empty', is_config=True)
map_name_cmd2 = __builtin__.property(_get_map_name_cmd2, _set_map_name_cmd2)
all_zero_map_cmd2 = __builtin__.property(_get_all_zero_map_cmd2, _set_all_zero_map_cmd2)
default_map_cmd2 = __builtin__.property(_get_default_map_cmd2, _set_default_map_cmd2)
All_cmd2 = __builtin__.property(_get_All_cmd2, _set_All_cmd2)
__choices__ = {u'apply-traffic-class-exp': {u'ca-map-name-cmd2': [u'map_name_cmd2'], u'ca-default-map-cmd2': [u'default_map_cmd2'], u'ca-all-zero-map-cmd2': [u'all_zero_map_cmd2']}}
_pyangbind_elements = {'map_name_cmd2': map_name_cmd2, 'all_zero_map_cmd2': all_zero_map_cmd2, 'default_map_cmd2': default_map_cmd2, 'All_cmd2': All_cmd2, }
| 74.20614
| 665
| 0.729594
| 2,602
| 16,919
| 4.49731
| 0.071868
| 0.035891
| 0.032473
| 0.053581
| 0.843275
| 0.803367
| 0.780636
| 0.770723
| 0.760554
| 0.749103
| 0
| 0.010823
| 0.126249
| 16,919
| 227
| 666
| 74.53304
| 0.780762
| 0.137242
| 0
| 0.422819
| 0
| 0.04698
| 0.41266
| 0.196012
| 0
| 0
| 0
| 0
| 0
| 1
| 0.100671
| false
| 0
| 0.053691
| 0
| 0.288591
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
99ef4c4300edcee0f21908e1a69183d6ec7a6f37
| 44
|
py
|
Python
|
seq2seq/seq2seq/loss/__init__.py
|
qbetterk/user-simulator
|
77caca30ff67b9112b1fe5e65e191c6b5e25532c
|
[
"Apache-2.0"
] | 20
|
2019-11-08T02:28:28.000Z
|
2022-02-07T09:20:21.000Z
|
seq2seq/seq2seq/loss/__init__.py
|
qbetterk/user-simulator
|
77caca30ff67b9112b1fe5e65e191c6b5e25532c
|
[
"Apache-2.0"
] | 21
|
2019-11-08T02:27:40.000Z
|
2022-03-12T00:02:54.000Z
|
seq2seq/seq2seq/loss/__init__.py
|
qbetterk/user-simulator
|
77caca30ff67b9112b1fe5e65e191c6b5e25532c
|
[
"Apache-2.0"
] | 8
|
2020-02-10T07:28:37.000Z
|
2021-09-23T09:42:14.000Z
|
from .loss import Loss, NLLLoss, Perplexity
| 22
| 43
| 0.795455
| 6
| 44
| 5.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 44
| 1
| 44
| 44
| 0.921053
| 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
| 1
| 0
|
0
| 6
|
416bf5d355c191581abaaf5baae4b6d02f53cd4e
| 4,338
|
py
|
Python
|
src/tools/files.py
|
cowboysmall/rosalind
|
021e4392a8fc946b97bbf86bbb8227b28bb5e462
|
[
"MIT"
] | null | null | null |
src/tools/files.py
|
cowboysmall/rosalind
|
021e4392a8fc946b97bbf86bbb8227b28bb5e462
|
[
"MIT"
] | null | null | null |
src/tools/files.py
|
cowboysmall/rosalind
|
021e4392a8fc946b97bbf86bbb8227b28bb5e462
|
[
"MIT"
] | null | null | null |
def write_lines(file_path, lines):
with open(file_path, 'w') as file:
for line in lines:
file.write(line + '\n')
def read_line(file_path):
with open(file_path) as file:
return file.readline().strip()
def read_lines(file_path):
lines = []
with open(file_path) as file:
for line in file:
line = line.strip()
if line:
lines.append(line)
return lines
def read_float(file_path):
with open(file_path) as file:
return float(file.readline().strip())
def read_floats(file_path):
floats = []
with open(file_path) as file:
for line in file:
line = line.strip()
if line:
floats.append(float(line))
return floats
def read_int(file_path):
with open(file_path) as file:
return int(file.readline().strip())
def read_ints(file_path):
ints = []
with open(file_path) as file:
for line in file:
line = line.strip()
if line:
ints.append(int(line))
return ints
def read_line_of_words(file_path):
with open(file_path) as file:
return [word for word in file.readline().split()]
def read_lines_of_words(file_path):
lines = []
with open(file_path) as file:
for line in file:
line = line.strip()
if line:
lines.append([word for word in line.split()])
return lines
def read_line_of_floats(file_path):
with open(file_path) as file:
return [float(i) for i in file.readline().split()]
def read_lines_of_floats(file_path):
lines = []
with open(file_path) as file:
for line in file:
line = line.strip()
if line:
lines.append([float(i) for i in line.split()])
return lines
def read_line_of_ints(file_path):
with open(file_path) as file:
return [int(i) for i in file.readline().split()]
def read_lines_of_ints(file_path):
lines = []
with open(file_path) as file:
for line in file:
line = line.strip()
if line:
lines.append([int(i) for i in line.split()])
return lines
def read_graph(file_path):
with open(file_path) as file:
graph = [int(i) for i in file.readline().split()]
edges = []
for line in file:
tail, head = line.strip().split()
edges.append((int(tail), int(head)))
graph.append(edges)
return graph
def read_weighted_graph(file_path):
with open(file_path) as file:
graph = [int(i) for i in file.readline().split()]
edges = []
for line in file:
tail, head, weight = line.strip().split()
edges.append((int(tail), int(head), int(weight)))
graph.append(edges)
return graph
def read_graphs(file_path):
with open(file_path) as file:
k = int(file.readline().strip())
graph_count = 0
graphs = []
while graph_count < k:
line = file.readline().strip()
while not line:
line = file.readline().strip()
graph = [int(i) for i in line.split()]
edge_count = 0
edges = []
while edge_count < graph[1]:
tail, head = file.readline().strip().split()
edges.append((int(tail), int(head)))
edge_count += 1
graph.append(edges)
graphs.append(graph)
graph_count += 1
return k, graphs
def read_weighted_graphs(file_path):
with open(file_path) as file:
k = int(file.readline().strip())
graph_count = 0
graphs = []
while graph_count < k:
line = file.readline().strip()
while not line:
line = file.readline().strip()
graph = [int(i) for i in line.split()]
edge_count = 0
edges = []
while edge_count < graph[1]:
tail, head, weight = file.readline().strip().split()
edges.append((int(tail), int(head), int(weight)))
edge_count += 1
graph.append(edges)
graphs.append(graph)
graph_count += 1
return k, graphs
| 22.59375
| 68
| 0.542416
| 562
| 4,338
| 4.049822
| 0.074733
| 0.119508
| 0.089631
| 0.119508
| 0.880492
| 0.84007
| 0.84007
| 0.808875
| 0.777241
| 0.708699
| 0
| 0.003511
| 0.343476
| 4,338
| 191
| 69
| 22.712042
| 0.795646
| 0
| 0
| 0.6875
| 0
| 0
| 0.000692
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.132813
| false
| 0
| 0
| 0
| 0.257813
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
41801ea050275d49201c9b87f491278b3faaa4f9
| 23
|
py
|
Python
|
mGdi32/__init__.py
|
SkyLined/mWindowsSDK
|
931cc9d30316893662a3dc4e200dabe97122d216
|
[
"CC-BY-4.0"
] | 2
|
2019-08-01T15:08:25.000Z
|
2021-01-30T07:29:34.000Z
|
mGdi32/__init__.py
|
SkyLined/mWindowsSDK
|
931cc9d30316893662a3dc4e200dabe97122d216
|
[
"CC-BY-4.0"
] | null | null | null |
mGdi32/__init__.py
|
SkyLined/mWindowsSDK
|
931cc9d30316893662a3dc4e200dabe97122d216
|
[
"CC-BY-4.0"
] | null | null | null |
from .mGdi32 import *;
| 11.5
| 22
| 0.695652
| 3
| 23
| 5.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 0.173913
| 23
| 1
| 23
| 23
| 0.736842
| 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
| 1
| 0
|
0
| 6
|
68c9514528013da4b21120807688c8993cf15c6d
| 28
|
py
|
Python
|
__init__.py
|
AbhiK002/Matrix
|
2d83f08877dccba9e4c710bd5fb65f613848d63f
|
[
"MIT"
] | 2
|
2022-02-11T04:39:21.000Z
|
2022-02-12T15:50:35.000Z
|
__init__.py
|
AbhiK002/Matrix
|
2d83f08877dccba9e4c710bd5fb65f613848d63f
|
[
"MIT"
] | null | null | null |
__init__.py
|
AbhiK002/Matrix
|
2d83f08877dccba9e4c710bd5fb65f613848d63f
|
[
"MIT"
] | null | null | null |
from .matrix import Matrix
| 9.333333
| 26
| 0.785714
| 4
| 28
| 5.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178571
| 28
| 2
| 27
| 14
| 0.956522
| 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
| 1
| 0
|
0
| 6
|
68d9429f6da9f4047b22ecae607eeab851aaf188
| 253,493
|
py
|
Python
|
glasses/__init__.py
|
tonyfast/metallic-glasses
|
7ce019d0c8406e990836b88b9661839c3f1928cf
|
[
"BSD-3-Clause"
] | null | null | null |
glasses/__init__.py
|
tonyfast/metallic-glasses
|
7ce019d0c8406e990836b88b9661839c3f1928cf
|
[
"BSD-3-Clause"
] | null | null | null |
glasses/__init__.py
|
tonyfast/metallic-glasses
|
7ce019d0c8406e990836b88b9661839c3f1928cf
|
[
"BSD-3-Clause"
] | null | null | null |
# coding: utf-8
# In[325]:
__version__ = "0.0.1"
__all__ = []
# In[8]:
from time import sleep
# In[22]:
get_ipython().magic('ls /Users/tfast/Desktop/SLAC_MG_0716/')
# In[23]:
get_ipython().magic('ls /Users/tfast/Desktop/SLAC_MG_0716/Sample1/')
# In[14]:
get_ipython().magic(
'cat /Users/tfast/Desktop/SLAC_MG_0716/Sample1/Sample1_24x24_t30_0001.txt*')
# * Turn metadata into a dataframe
#
# /Users/tfast/Desktop/SLAC_MG_0716/Sample1/Sample1_24x24_t30_0001.txt*
# In[15]:
from IPython import display
# In[19]:
import skimage.io
# In[ ]:
# In[27]:
# In[33]:
im = skimage.io.imread(
'/Users/tfast/Desktop/SLAC_MG_0716/Sample1/Sample1_24x24_t30_0010.tif')
skimage.io.imshow(im)
# In[29]:
get_ipython().magic('matplotlib inline')
# In[34]:
import dask.dataframe as dd
# In[38]:
from whatever import *
# In[40]:
import glob
# In[42]:
import pandas
# In[ ]:
pandas.read_csv
# In[49]:
from toolz.curried import *
# In[ ]:
# In[ ]:
for the_file in glob.glob(
"/Users/tfast/Desktop/SLAC_MG_0716/Sample1/Processed/*_1D.csv"
):
pandas.read_csv(
the_file, names=['Q', 'I'], header=None
).iloc[:1000].set_index('Q')
# In[102]:
# In[228]:
metadata = pandas.read_csv(
"/Users/tfast/Desktop/SLAC_MG_0716/Sample1/Processed/Sample1_24x24_t30_14715979master_metadata.csv")
metadata = metadata.rename(columns={'scan#.1': 'scan'}).set_index('scan')
for c in 'xy':
metadata['plate_' + c] = metadata['plate_' + c].apply(compose(
first, lambda x: x.split('e', 1)
)).astype(float)
# In[106]:
baselines = [209, 233]
# In[346]:
dfs = []
for i, the_file in enumerate(glob.glob(
"/Users/tfast/Desktop/SLAC_MG_0716/Sample[1-5]/Processed/*_1D.csv"
)):
s = pandas.read_csv(
the_file, header=None,
names=['Q', str(i) + '_' + str(the_file.split('_')[-2])]
).set_index('Q').iloc[:1000]
dfs.append(s)
signals = pandas.concat(dfs, axis=1)
signals.plot(legend=None)
# In[319]:
get_ipython().magic('matplotlib notebook')
# > _hypothesis_ - The rolling _standard deviation_. It will exentuate the
# crystalline patterns because they have larger information entropy. The
# rolling deviations are then used to identify non-crystalline patterns, by
# some thresholding technique, that can be automated later.
# In[333]:
get_ipython().magic('matplotlib notebook')
# In[353]:
roll = signals.rolling(31, center=True).std().fillna(0).sum(axis=0)
# > Identify non-crystalline states using the thresholding below.
# In[350]:
from magical import register_jinja2_magic
env = register_jinja2_magic()
# In[351]:
threshold = 13e3
# In[352]:
get_ipython().run_cell_magic('jinja2', '', '\n> The threshold we using is `{{threshold}}`. This value was identified using the image below.\n\n<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYQAAAEACAYAAACznAEdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAGT9JREFUeJzt3X+sZHd53/H347W5xga8NpV3FEx8iVAMCW02jmKcuhFXgRpCJBuprQNNUy+0+aNNCoaq9Tr9w80fUSBSFFOlqYRCWZeGgk1+2JViMJZ3+kslhtpbu/gHbqkX22Qvpv7RppVs4336x5zZOzs7c2f2zvfMnO/e90u62nPOnXPO587uznPneWbORGYiSdJZqw4gSeoGC4IkCbAgSJIaFgRJEmBBkCQ1LAiSJGCOghARn46IzYh4cGTbhRFxd0Q8FhFfjogLRr53U0Q8HhGPRMTVbQWXJJU1zzOEzwDvHtt2ELgnMy8D7gVuAoiIHwGuA94K/CzwuxER5eJKktoysyBk5n8EnhvbfC1wa7N8K/C+Zvka4POZ+f3MfAJ4HLiiTFRJUpt2OkO4ODM3ATLzGHBxs/0NwJMjt3u62SZJ6rhSQ2WvfyFJlTt7h/ttRsS+zNyMiB7w3Wb708AbR253SbPtFBFhEZGkHcjMVmaz8z5DiOZr6E7gQLN8PXDHyPb3R8SrIuJNwJuB+6YdNDM7/3XzzTevPIM5zVlzzhoy1pSzTTOfIUTE54AN4PUR8W3gZuDjwO0R8SHgKINXFpGZD0fEbcDDwMvA38+2f4KWPfHEE6uOMBdzlmXOcmrICPXkbNPMgpCZf3PKt9415fa/AfzGIqEkScvnO5VnOHDgwKojzMWcZZmznBoyQj052xSr6uhERO3dJElauoggVzxU3rX6/f6qI8zFnGWZs5waMkI9OdtkQZAkAbaMJKkqtowkSa2zIMxQS1/RnGWZs5waMkI9OdtkQeiAXm+dXm991TEk7XLOEDpg+JER3h+SZnGGIElqnQVhhlr6iuYsy5zl1JAR6snZJgtCB/V660SEcwVJS+UMoQPGZwiD9QTCuYKkkzhDkCS1zoIwQy19RXOWZc5yasgI9eRskwVBkgQ4Q+gEZwiS5uUMQZLUOgvCDLX0Fc1ZljnLqSEj1JOzTRYESRLgDKETnCFImpczBElS6ywIM9TSVzRnWeYsp4aMUE/ONlkQJEmAM4ROcIYgaV7OECRJrbMgzFBLX9GcZZmznBoyQj0522RBkCQBzhA6wRmCpHk5Q5Aktc6CMEMtfUVzlmXOcmrICPXkbJMFQZIEOEPoBGcIkublDEGS1DoLwgwl+4q93jp79pxPRNDrrRc7LtTT/zRnWTXkrCEj1JOzTWevOsBusrl5tFlKNjdbecYnSTu20AwhIj4K/B3gOPAQ8EHgfOALwKXAE8B1mfnChH133QxhOCsYnw84Q5A0r07OECLiB4B/AFyemX+JwbONDwAHgXsy8zLgXuCmEkElSe1adIawBzg/Is4GXg08DVwL3Np8/1bgfQueY6Vq6SuasyxzllNDRqgnZ5t2XBAy8zvAbwHfZlAIXsjMe4B9mbnZ3OYYcHGJoJKkdu14qBwRexk8G7gUeAG4PSJ+gUHze9TUJviBAwdYX18HYO/evezfv5+NjQ1gq1qfaeuj+v3+ie+fut4/5bbbHX98/678vLWuD7d1JU/N6xsbG53Ks936UFfyDO+7Q4cOAZx4vGzLjofKEfHXgXdn5i81678IXAn8DLCRmZsR0QMOZ+ZbJ+zvUNmhsqTT1MmhMoNW0ZURcW4MHsHeCTwM3AkcaG5zPXDHQglXbPw3h64yZ1nmLKeGjFBPzjbtuGWUmfdFxBeBB4CXmz8/BbwWuC0iPgQcBa4rEVSS1C6vZbREtowkLaqrLSNJ0hnEgjBDLX1Fc5ZlznJqyAj15GyTBWFl1k5c6E6SusAZwhKNzxDGl50hSJrFGYIkqXUWhBlq6SuasyxzllNDRqgnZ5ssCJ22VvyDdCRpGmcIS7STGcLodklyhiBJap0FYYZa+ormLMuc5dSQEerJ2SYLgiQJcIawVM4QJC3KGYIkqXUWhBm60lfs9da3fQlqV3LOYs6yashZQ0aoJ2ebdvx5CFquzc2jq44g6QznDGGJFpkhjH9mgqTdyRmCJKl1FoQZaukrmrMsc5ZTQ0aoJ2ebLAiSJMAZwlI5Q5C0KGcIkqTWWRBmqKWvaM6yzFlODRmhnpxtsiBIkgBnCEvlDEHSopwhSJJaZ0GYoZa+ojnLMmc5NWSEenK2yYKwBL3e+ki7aPZtT7Y2976StAhnCEswPhPYboYw75xB0u7kDEGS1DoLwgy19BXNWZY5y6khI9STs00WBEkS4AxhKZwhSCrFGYIkqXUWhBlq6SuasyxzllNDRqgnZ5ssCJIkYMEZQkRcAPwe8DbgOPAh4JvAF4BLgSeA6zLzhQn7OkMYW3aGIGmWLs8QPgn8SWa+Ffgx4FHgIHBPZl4G3AvctOA5JElLsOOCEBGvA346Mz8DkJnfb54JXAvc2tzsVuB9C6dcoVr6iuYsy5zl1JAR6snZpkWeIbwJ+F5EfCYi7o+IT0XEecC+zNwEyMxjwMUlgkqS2rXjGUJE/ATwVeCnMvPrEfHbwP8BfiUzLxq53f/KzNdP2N8ZwtiyMwRJs7Q5Qzh7gX2fAp7MzK8363/AYH6wGRH7MnMzInrAd6cd4MCBA6yvrwOwd+9e9u/fz8bGBrD19O1MWYc+2ztn7Kqm299+1T+P6667vpz1fr/PoUOHAE48XrZl0VcZ/TvglzLzmxFxM3Be861nM/MTEXEjcGFmHpywbxXPEPr9/siD+s7M+wxh3mcRbeVcBnOWVUPOGjJCPTm7+gwB4MPA70fEOcC3gA8Ce4DbIuJDwFHgugXPIUlaAq9ltATLeIYgaXfo8vsQJElnCAvCDMPhTteZsyxzllNDRqgnZ5ssCJIkwBnCUjhDkFSKMwRJUussCDPU0lc0Z1nmLKeGjFBPzjZZECRJgDOEpXCGIKkUZwiSpNZZEGaopa9ozrLMWU4NGaGenG2yIEiSAGcIS+EMQVIpzhAkSa2zIMxQS1/RnGWZs5waMkI9OdtkQZAkAc4QlsIZgqRSnCFIklpnQZihlr6iOcsyZzk1ZIR6crbJgiBJApwhLIUzBEmlOEOQJLXOgjBDLX1Fc5ZlznJqyAj15GyTBUGSBDhDWApnCJJKcYYgSWqdBWGGbvUV14gIer31U77TrZzTmbOsGnLWkBHqydmms1cdQKfjRSDZ3Gzl2aKkXc4ZwhKUnCEMl3fLfSfpZM4QJEmtsyDMUEtf0ZxlmbOcGjJCPTnbZEGQJAHOEJbCGYKkUpwhSJJaZ0GYoZa+ojnLMmc5NWSEenK2yYIgSQKcISyFMwRJpXR6hhARZ0XE/RFxZ7N+YUTcHRGPRcSXI+KCxWNKktpWomX0EeDhkfWDwD2ZeRlwL3BTgXOsTC19RXOWZc5yasgI9eRs00IFISIuAd4L/N7I5muBW5vlW4H3LXIOTbI28QJ3krSIhWYIEXE78OvABcA/zMxrIuK5zLxw5DbPZuZFE/Z1hrDg8m65/yRt6eQMISJ+DtjMzCNsPVpN4qOWJFVgkctfXwVcExHvBV4NvDYiPgsci4h9mbkZET3gu9MOcODAAdbX1wHYu3cv+/fvZ2NjA9jq5616fbht0ePB1vGm609ZnnLrfv/E8W+55ZZO3n9t3Z9tr3t/llsfz7rqPNPWjxw5wg033NCZPMP1fr/PoUOHAE48XrYmMxf+At4B3Nks/yZwY7N8I/DxKftkDQ4fPrzwMYCE4Z/llkvnXAZzllVDzhoyZtaTs/m/X+Sxe/yryPsQIuIdbM0QLgJuA94IHAWuy8znJ+yTJc5dA2cIkkppc4bgG9OWwIIgqZRODpV3i9H+Z5eZsyxzllNDRqgnZ5ssCJIkwJbRUtgyklSKLSNJUussCDPM21fs9dZXejmJWvqf5iyrhpw1ZIR6crZpkTemacTm5tFVR5CkhThDKGQwJ5jc13eGIKkUZwgVa6+NtEZEeNVTScVYEGZYtK/YXivpRSBPHL+W/qc5y6ohZw0ZoZ6cbbIgSJIAZwjFTJshDLe3MUPw85Wl3ccZgiSpdRaEGWrpK5qzLHOWU0NGqCdnmywIkiTAGUIxzhAkLYMzBElS6ywIM9TSVzRnWeYsp4aMUE/ONlkQJEmAM4RiVjdDOJd9+3ocO/ZEgZ9CUtf5mcoVWOVQedJ5JZ2ZHCqvUC19RXOWZc5yasgI9eRskwVBkgTYMirGlpGkZbBlJElqnQVhhlr6iuYsy5zl1JAR6snZJguCJAlwhlCMMwRJy+AMQZLUOgvCDLX0Fc1ZljnLqSEj1JOzTRYESRLgDKEYZwiSlsEZgiSpdRaEGWrpK5qzLHOWU0NGqCdnmywIkiTAGUIxzhAkLYMzBElS63ZcECLikoi4NyK+EREPRcSHm+0XRsTdEfFYRHw5Ii4oF3f5hn3FXm+diKDXW19pnmn6/T693npn8w3V0qc1Zzk1ZIR6crZpkWcI3wc+lpk/CvwU8MsR8RbgIHBPZl4G3AvctHjM1dvcPApk82c3bW4e7XQ+Sd1WbIYQEX8M/E7z9Y7M3IyIHtDPzLdMuH01M4Reb/1EQYCY2K9f7QxhDXjxxDlruV8lnb7Of6ZyRKwDfeBtwJOZeeHI957NzIsm7FNNQRh/UO9eQTh5uZb7VdLpa7MgnL3oASLiNcAXgY9k5p9HxPij0dRHpwMHDrC+vg7A3r172b9/PxsbG8BWP2/V6yfb2jZ++3EXXdTjuec2J+47XX/K8jy3v+Xk73Tk/pt0f25sbHQmz7T1W265pZP/Hmu8P8ezrjrPtPUjR45www03dCbPcL3f73Po0CGAE4+XrcnMHX8xKChfYlAMhtseAfY1yz3gkSn7Zg0OHz6cDIpaQua03MPbnLyep+zb3vLhUzJ00eHDh1cdYS7mLKeGjJn15Gz+jy/02D3ta6GWUUT8K+B7mfmxkW2fAJ7NzE9ExI3AhZl5cMK+uci5l2knLaPB+vLaRLaMpN2hkzOEiLgK+PfAQ5z4LZVfBe4DbgPeCBwFrsvM5yfsb0FoabmW+1XS6evkG9My8z9l5p7M3J+ZP56Zl2fmlzLz2cx8V2ZelplXTyoGNZk8S+ii/qoDzKWW+9Oc5dSQEerJ2SbfqXzGWev0G+gkdZfXMppDbS2j7XJKqlsnW0a72ehlLIbLklQ7C8IMk/qKo5ex2HoH86r1Vx1gLrX0ac1ZTg0ZoZ6cbbIgTDHfheLWlhFFkpbCGcIUozOB07n8hDMESW1yhrAyaxPmA7OfFfgKH0k1siBs60Xg8IRt21vNJaj7Kzjn6aulT2vOcmrICPXkbJMFQZIEOEM4xdZnHwydTv/+5M8lcIYgqbROXsto4RN3tCB0YRhcarmL96+kxThUXqn+qgPMqX/KlvGXznbhc6Fr6dOas5waMkI9Odu08AfkqLvGh9tbb6jzndWSTmXLaMyZ0zI6l+E8Y9J7Iybd98NnDseOPXHK9yR1gzOEJTpzCsLWv5d5C8K0z4WW1B3OEFaqv+oAc+rvaK/5LtFRTi19WnOWU0NGqCdnm5wh7HKreROdpC6yZTRmt7SM9u279KRiMHrNpi7+vUgacIawRLulIIzfzoIg1cEZwkr1Vx1gTv1VB5hLLX1ac5ZTQ0aoJ2ebnCGc8QZXbN2379JVB5HUcbaMxpyJLaN5bmfLSKqDLSMVsPNPd1v2S1MlrYYFYab+qgPMqT/j+7M/x2Garc+OXlwtfVpzllNDRqgnZ5ssCCP8LXhLr7fOnj3nT/jEuO33WfXF8yTtnDOEEafz2cn1LM93u/EZwqT7Ytbf16xLY0hanDMEFVZunuCzAunMYUGYqb/qAHPqn8Zty80Tti6pPd+MoZY+rTnLqSEj1JOzTRYESRLgDOEku3eGMPpZ0NM/F3rSexWmvW9jeK2k4RvihsuTPmth2ucwbPf5DKPfm7Z8uhb9PIjh53FP+zmlEryW0ZLs3oIw3/LpFIRpy6fzOQzbvVFu0gB80TfXLfrGPIfqWgaHyivVX3WAOfWXeK61CYPkaYPqk7cP+7Snvqx10jFPVnKAPetYF13Um3me0QH7IpkWeeNfDX3vGjJCPTnb5LWMgLvuuounnnpq1TEq8iKDQXKMbZt221NtDaGHzyImHXPSPmU+E3rWsZ57bnPOY5y6vLMs0urt+pbRyy+/zNraGuec8zZeeumhZmsXWj3dbhltf/vh5zlPny1sl+3kdtTgvMP+/PjPtl3LaLs5w+ixdvrZENu9b2N0hjKcJ/R66zzzzDMcP/7/Ttpe8hpSJT8Xu8RMxM/pLs8ZQotefvllzj33PCI+xiuv/GaztQsP5DUXhMWWJxWEyefdviDMWj6dWckk8x5z/OfZ7udcVPljLTYT8YKJ5VU5Q4iI90TEoxHxzYi4sa3ztK+/6gBz6rd8/LUJl7HY+RvctjvP7EtmrJ34c3wGUTpLRLBnz/knMo0uz2s4rxg/9jxzg2nzheH2ZfW9J81cunrRw2HWPXvOP618/X5/17/RspUZQkScBfwO8E7gO8DXIuKOzHy0jfO168iqA8yp7ZzjLaDhtvLnOX6cCecazzKeaVK+xbNAcvz41m/2o8vznmtSqwtenGt2MO02w+1HjhxhY2NjrhyLmDRz6ersY5j1+PE4rYxHjhwpOqeqUVvPEK4AHs/Mo5n5MvB54NqWztWy51cdYE615FRJzz/v33sp3pftFYQ3AE+OrD/VbNOutpMW005aQafTShrP1Ebrafq5J53r1LbF9i/JPbV1s3ZKy2T0Zb7jbZ/R7aPtltHjLWbPXC8pHs06aXmefXdym+HP/Gu/9uvbHuN0jj/vNb9Gt09rde20BbYjmVn8C/hrwKdG1v8W8M/GbpNd8NJLL+VZZ52da2s/lAye1yfkyPL1U7Z3bXlazq7ka2P59PfJLJ+j1DGHtvs5T74Nef3118/MMWn7+HFOJ+v4vtuZtu+02223PM++k+6/WceZ9XPOY3KGyZnmOfesfw/ZwuN2ZrbzKqOIuBL4p5n5nmb9YPNDfGLkNuVPLEm7QNb0stOI2AM8xmCo/GfAfcAHMvOR4ieTJBXRyquMMvOViPgV4G4Gc4pPWwwkqdtW9sY0SVK3rOTidst+01pEfDoiNiPiwZFtF0bE3RHxWER8OSIuGPneTRHxeEQ8EhFXj2y/PCIebHLfMrL9VRHx+Waf/xwRP7jDnJdExL0R8Y2IeCgiPtzFrBGxFhF/GhEPNDlv7mLO5jhnRcT9EXFnhzM+ERH/tbk/7+twzgsi4vbmvN+IiLd3LWdE/HBzP97f/PlCRHy4azmb43w0Iv5bc47fb4672pxtTaunfTEoQv8duBQ4h8E7qt7S8jn/CrAfeHBk2yeAf9ws3wh8vFn+EeABBu209Sbr8JnUnwI/2Sz/CfDuZvnvAb/bLP888Pkd5uwB+5vl1zCYw7ylo1nPa/7cA3yVwXtPupjzo8C/Bu7s8N/7t4ALx7Z1Mech4IPN8tnABV3MOZL3LAZvjH1j13ICP9D8vb+qWf8CcP2qc7b2ILzNHXElcNfI+kHgxiWc91JOLgiPAvua5R7w6KQ8wF3A25vbPDyy/f3Av2iWvwS8vVneAzxTKPMfA+/qclbgPODrwE92LSdwCfAVYIOtgtCpjM2+/xN4/di2TuUEXgf8jwnbO5VzLNvVwH/oYk4GBeEocCGDB/k76cD/9VW0jLryprWLM3MTIDOPARc328fzPd1sewODrEOjuU/sk5mvAM9HxEWLhIuIdQbPar7K4B9Ip7I2rZgHgGPAVzLzax3M+dvAP2Lw2u2hrmWkyfeViPhaRPzdjuZ8E/C9iPhM0475VESc18Gco34e+Fyz3Kmcmfkd4LeAbzfnfCEz71l1Tj8gZ0vOvsncFnqNcES8Bvgi8JHM/HNOzbbyrJl5PDN/nMFv4VdExI9OyLWynBHxc8BmZh6Zse/K70vgqsy8HHgv8MsR8dN06L5snA1cDvzzJuv/ZfBba9dyDnaMOAe4Bri92dSpnBGxl8HlfC5l8Gzh/Ij4hQm5lppzFQXhaWB0uHFJs23ZNiNiH0BE9IDvNtufZtBzHBrmm7b9pH1i8B6M12XmszsJFRFnMygGn83MO7qcFSAz/zeDS62+p2M5rwKuiYhvAf8G+JmI+CxwrEMZAcjMP2v+fIZBm/AKunVfwuA3zycz8+vN+h8wKBBdyzn0s8B/yczvNetdy/ku4FuZ+Wzz2/sfAX951TlXURC+Brw5Ii6NiFcx6HnduYTzBidXyDuBA83y9cAdI9vf30zo3wS8Gbivefr2QkRcEREB/O2xfa5vlv8GcO8COf8lg57gJ7uaNSL+wvDVDxHxauCvAo90KWdm/mpm/mBm/hCDf2P3ZuYvAv+2KxkBIuK85hkhEXE+g773Q3TovgRo2hhPRsQPN5veCXyjazlHfIDBLwJDXcv5beDKiDi3Of47gYdXnnORoc1Ovxj8NvkY8DhwcAnn+xyDVxu82PxFfJDBMOeeJsfdwN6R29/EYIr/CHD1yPafYPCf9XHgkyPb14Dbmu1fBdZ3mPMq4BUGr7x6ALi/ua8u6lJW4C822Y4ADwL/pNneqZwjx3oHW0PlTmVk0Jsf/n0/NPz/0LWczXF+jMEvdEeAP2TwKqMu5jwPeAZ47ci2Lua8uTnng8CtDF51udKcvjFNkgQ4VJYkNSwIkiTAgiBJalgQJEmABUGS1LAgSJIAC4IkqWFBkCQB8P8B7V9InsPpsHoAAAAASUVORK5CYII="/>')
# In[360]:
noncrystalline = signals[roll[roll < threshold].index].columns
# In[376]:
get_ipython().magic('matplotlib notebook')
# In[390]:
xtal = signals.rolling(25).sum()
xtal.plot(legend=False)
# In[380]:
xtal_threshold = 31e3
# In[381]:
get_ipython().run_cell_magic('jinja2', '', '\nThe rolling sum of the signals to find some crystalling examples. {{xtal_threshold}}\n\n')
# In[402]:
xtal_features = xtal.columns[(xtal > xtal_threshold).any(axis=0)]
# In[474]:
trainer = pandas.concat(
[
signals[xtal_features].transpose().reset_index(drop=True).set_index(
np.array([0] * len(xtal_features))),
signals[noncrystalline].transpose().reset_index(drop=True).set_index(
np.array([1] * len(noncrystalline))),
], axis=0)
# In[479]:
h = signals.rolling(25).std().fillna(0)
# In[485]:
train = trainer.transpose().rolling(25).std().fillna(0).transpose()
# In[491]:
X = pipeline.make_pipeline(
preprocessing.RobustScaler(),
ensemble.RandomForestClassifier(),
).fit(train.values, train.index)
# In[493]:
signals.transpose()[X.predict(h.transpose().values)
== 0].transpose().plot(legend=False)
# In[494]:
signals.transpose()[X.predict(h.transpose().values)
== 1].transpose().plot(legend=False)
# In[448]:
clf = tree.DecisionTreeClassifier().fit(trainer.values, trainer.index)
# In[ ]:
# In[303]:
roll.iloc[roll.rolling(25, center=True).std().fillna(0).sum(axis=0) < 3e5]
# In[199]:
model = pipeline.make_pipeline(
preprocessing.MaxAbsScaler(),
decomposition.PCA(), a
).fit(roll[(roll != 0).all(axis=1)].transpose().values)
pandas.DataFrame(
model.transform(roll[(roll != 0).all(axis=1)].transpose().values)
).plot(x=0, y=1, kind='scatter')
# In[146]:
r = signals.rolling(20, center=True)
# In[161]:
(signals.rolling(50, center=True).std().fillna(0) * signals).plot(legend=False)
# In[142]:
get_ipython().magic('matplotlib notebook')
# In[134]:
signals[baselines].plot()
# In[89]:
pandas.concat(l, axis=1, join='inner').plot(legend=None)
# In[36]:
df = dd.read_csv(
"/Users/tfast/Desktop/SLAC_MG_0716/Sample1/Processed/*_1D.csv")
| 823.029221
| 239,848
| 0.962326
| 8,194
| 253,493
| 29.75958
| 0.908103
| 0.00041
| 0.000627
| 0.000775
| 0.004429
| 0.003678
| 0.003018
| 0.002661
| 0.001993
| 0.001649
| 0
| 0.1506
| 0.003089
| 253,493
| 307
| 239,849
| 825.710098
| 0.814341
| 0.003511
| 0
| 0.065934
| 0
| 0.021978
| 0.987337
| 0.985979
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.098901
| 0
| 0.098901
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
68ef832af775f775cdb4bb4048470a320e163217
| 10,396
|
py
|
Python
|
module/cek_tanda_tangan_bap.py
|
riandakarizal/ITeung
|
2d3fc7e4974c9a9b67ff61f2a77a528988b55820
|
[
"MIT"
] | null | null | null |
module/cek_tanda_tangan_bap.py
|
riandakarizal/ITeung
|
2d3fc7e4974c9a9b67ff61f2a77a528988b55820
|
[
"MIT"
] | 37
|
2020-03-22T23:21:14.000Z
|
2020-09-16T15:07:06.000Z
|
module/cek_tanda_tangan_bap.py
|
riandakarizal/ITeung
|
2d3fc7e4974c9a9b67ff61f2a77a528988b55820
|
[
"MIT"
] | 1
|
2020-09-08T11:31:30.000Z
|
2020-09-08T11:31:30.000Z
|
from module import kelas
from lib import numbers, wa, reply, message
import subprocess, config, os
def getMateriFromJadwalID(jadwalid):
db = kelas.dbConnectSiap()
sql = f"select MP from simak_trn_presensi_dosen WHERE `JadwalID` = {jadwalid} ORDER BY Pertemuan ASC"
with db:
cur = db.cursor()
cur.execute(sql)
rows=cur.fetchall()
if rows is not None:
return rows
else:
return None
def materiToList(materiTuple):
materiData=[]
for i in materiTuple:
materiData.append(i[0])
return materiData
def getListJadwalIDfromKaprodi(prodiID):
db=kelas.dbConnectSiap()
sql=f"select JadwalID from simak_trn_jadwal where TahunID={kelas.getTahunID()} and ProdiID='{prodiID}'"
with db:
cur = db.cursor()
cur.execute(sql)
rows=cur.fetchall()
if rows is not None:
return rows
else:
return None
def getListJadwalIDfromDeputi(status, prodiid):
db=kelas.dbConnectSiap()
if status:
sql=f"select JadwalID from simak_trn_jadwal where TahunID={kelas.getTahunID()} and ProdiID='{prodiid}'"
else:
sql=f"select JadwalID from simak_trn_jadwal where TahunID={kelas.getTahunID()}"
with db:
cur = db.cursor()
cur.execute(sql)
rows=cur.fetchall()
if rows is not None:
return rows
else:
return None
def cekMateriPerkuliahan(jadwalid):
MateriTuple = getMateriFromJadwalID(jadwalid)
MateriToList = materiToList(MateriTuple)
if None in MateriToList or '' in MateriToList:
ret = False
else:
ret = True
return ret
def cekStatusBKDKaprodi(jadwalid):
db=kelas.dbConnectSiap()
sql=f'select BKD_Prodi from simak_trn_jadwal where JadwalID={jadwalid}'
with db:
cur=db.cursor()
cur.execute(sql)
row=cur.fetchone()
if row[0] == 'true':
return True
else:
return False
def cekStatusBKDDeputi(jadwalid):
db=kelas.dbConnectSiap()
sql=f'select BKD_Deputi from simak_trn_jadwal where JadwalID={jadwalid}'
with db:
cur=db.cursor()
cur.execute(sql)
row=cur.fetchone()
if row[0] == 'true':
return True
else:
return False
def infoBAPKaprodi(prodiid):
JadwalIDDataProdi=getListJadwalIDfromKaprodi(prodiid)
sudah=[]
siap=[]
belum=[]
for jadwalid in JadwalIDDataProdi:
statusmateri=cekMateriPerkuliahan(jadwalid[0])
statusttd=cekStatusBKDKaprodi(jadwalid[0])
if statusmateri == False and statusttd == False:
belum.append(jadwalid[0])
elif statusmateri == True and statusttd == False:
siap.append(jadwalid[0])
else:
sudah.append(jadwalid[0])
msgsudah = ''
for i in sudah:
kelas_info = kelas.getMatakuliahInfowithJadwalID(i)
msgsudah += f'{config.whatsapp_api_lineBreak}{kelas_info[0]} | {getNamaProdiFromProdiID(kelas_info[5].split(".")[1])} | {kelas_info[12]} | {kelas.getNamaDosen(kelas_info[21])}'
msgsudah += f'{config.whatsapp_api_lineBreak}{config.whatsapp_api_lineBreak}'
msgsiap = ''
for i in siap:
kelas_info = kelas.getMatakuliahInfowithJadwalID(i)
msgsiap += f'{config.whatsapp_api_lineBreak}{kelas_info[0]} | {getNamaProdiFromProdiID(kelas_info[5].split(".")[1])} | {kelas_info[12]} | {kelas.getNamaDosen(kelas_info[21])}'
msgsiap += f'{config.whatsapp_api_lineBreak}{config.whatsapp_api_lineBreak}'
msgbelum = ''
for i in belum:
kelas_info = kelas.getMatakuliahInfowithJadwalID(i)
msgbelum += f'{config.whatsapp_api_lineBreak}{kelas_info[0]} | {getNamaProdiFromProdiID(kelas_info[5].split(".")[1])} | {kelas_info[12]} | {kelas.getNamaDosen(kelas_info[21])}'
msgbelum += f'{config.whatsapp_api_lineBreak}{config.whatsapp_api_lineBreak}'
msgreply = f"BAP yang sudah ditandatangani ada: {len(sudah)} berkas{msgsudah}BAP yang siap ditandatangani ada: {len(siap)} berkas{msgsiap}BAP yang belum siap ditandatangani ada: {len(belum)} berkas{msgbelum}"
return msgreply, sudah, siap, belum
def infoBAPDeputi(msg):
msgs=msg.split(' ')[-1]
if msgs == 'all':
JadwalIDDataDeputi=getListJadwalIDfromDeputi(False, '')
else:
JadwalIDDataDeputi=getListJadwalIDfromDeputi(True, getProdiIDfromSingkatan(msgs))
sudah=[]
siap=[]
belum=[]
for jadwalid in JadwalIDDataDeputi:
statusmateri=cekMateriPerkuliahan(jadwalid[0])
statusttd=cekStatusBKDDeputi(jadwalid[0])
if statusmateri == False and statusttd == False:
belum.append(jadwalid[0])
elif statusmateri == True and statusttd == False:
siap.append(jadwalid[0])
else:
sudah.append(jadwalid[0])
msgsudah=''
for i in sudah:
kelas_info=kelas.getMatakuliahInfowithJadwalID(i)
msgsudah+=f'{config.whatsapp_api_lineBreak}{kelas_info[0]} | {getNamaProdiFromProdiID(kelas_info[5].split(".")[1])} | {kelas_info[12]} | {kelas.getNamaDosen(kelas_info[21])}'
msgsudah+=f'{config.whatsapp_api_lineBreak}{config.whatsapp_api_lineBreak}'
msgsiap=''
for i in siap:
kelas_info=kelas.getMatakuliahInfowithJadwalID(i)
msgsiap+=f'{config.whatsapp_api_lineBreak}{kelas_info[0]} | {getNamaProdiFromProdiID(kelas_info[5].split(".")[1])} | {kelas_info[12]} | {kelas.getNamaDosen(kelas_info[21])}'
msgsiap += f'{config.whatsapp_api_lineBreak}{config.whatsapp_api_lineBreak}'
msgbelum=''
for i in belum:
kelas_info=kelas.getMatakuliahInfowithJadwalID(i)
msgbelum+=f'{config.whatsapp_api_lineBreak}{kelas_info[0]} | {getNamaProdiFromProdiID(kelas_info[5].split(".")[1])} | {kelas_info[12]} | {kelas.getNamaDosen(kelas_info[21])}'
msgbelum += f'{config.whatsapp_api_lineBreak}{config.whatsapp_api_lineBreak}'
msgreply=f"BAP yang sudah ditandatangani ada: {len(sudah)} berkas{msgsudah}BAP yang siap ditandatangani ada: {len(siap)} berkas{msgsiap}BAP yang belum siap ditandatangani ada: {len(belum)} berkas{msgbelum}"
return msgreply, sudah, siap, belum
def approveBAPDeputi(msg):
msgs=msg.split(' ')[-1]
if msgs == 'all':
JadwalIDDataDeputi=getListJadwalIDfromDeputi(False, '')
else:
JadwalIDDataDeputi=getListJadwalIDfromDeputi(True, getProdiIDfromSingkatan(msgs))
sudah=[]
siap=[]
belum=[]
for jadwalid in JadwalIDDataDeputi:
statusmateri=cekMateriPerkuliahan(jadwalid[0])
statusttd=cekStatusBKDDeputi(jadwalid[0])
if statusmateri == False and statusttd == False:
belum.append(jadwalid[0])
elif statusmateri == True and statusttd == False:
siap.append(jadwalid[0])
else:
sudah.append(jadwalid[0])
msgreply = f"BAP yang sudah ditandatangani ada: {len(sudah)} berkas%0ABAP yang siap ditandatangani ada: {len(siap)} berkas%0ABAP yang belum siap ditandatangani ada: {len(belum)} berkas"
return msgreply, sudah, siap, belum
def approveBAPKaprodi(prodiid):
JadwalIDDataProdi=getListJadwalIDfromKaprodi(prodiid)
sudah=[]
siap=[]
belum=[]
for jadwalid in JadwalIDDataProdi:
statusmateri=cekMateriPerkuliahan(jadwalid[0])
statusttd=cekStatusBKDKaprodi(jadwalid[0])
if statusmateri == False and statusttd == False:
belum.append(jadwalid[0])
elif statusmateri == True and statusttd == False:
siap.append(jadwalid[0])
else:
sudah.append(jadwalid[0])
msgreply = f"BAP yang sudah ditandatangani ada: {len(sudah)} berkas%0ABAP yang siap ditandatangani ada: {len(siap)} berkas%0ABAP yang belum siap ditandatangani ada: {len(belum)} berkas"
return msgreply, sudah, siap, belum
def getNIPYfromHandphone(num):
num=numbers.normalize(num)
db=kelas.dbConnectSiap()
sql=f'select NIPY from simak_mst_dosen where Handphone="{num}"'
with db:
cur=db.cursor()
cur.execute(sql)
row=cur.fetchone()
if row is not None:
return row[0]
else:
return None
def getNamaProdiFromProdiID(prodiid):
db=kelas.dbConnectSiap()
sql=f'select Nama from simak_mst_prodi where ProdiID={prodiid}'
with db:
cur=db.cursor()
cur.execute(sql)
row=cur.fetchone()
if row is not None:
return row[0]
else:
return None
def isDeputiAkademik(NIPY):
db=kelas.dbConnectSiap()
sql=f'select * from simak_mst_pejabat where NIPY="{NIPY}" and JenisJabatanID=9'
with db:
cur=db.cursor()
cur.execute(sql)
row=cur.fetchone()
if row is not None:
return True
else:
return False
def isKaprodi(NIPY):
db = kelas.dbConnectSiap()
sql = f'select * from simak_mst_pejabat where NIPY="{NIPY}" and JenisJabatanID=5'
with db:
cur = db.cursor()
cur.execute(sql)
row = cur.fetchone()
if row is not None:
return True
else:
return False
def auth(data):
if isKaprodi(getNIPYfromHandphone(data[0])) or isDeputiAkademik(getNIPYfromHandphone(data[0])):
return True
else:
return False
def replymsg(driver, data):
num=numbers.normalize(data[0])
msg=message.normalize(data[3])
data=f'{num};{msg}'
wmsg = reply.getWaitingMessage(os.path.basename(__file__).split('.')[0])
wmsg = wmsg.replace('#BOTNAME#', config.bot_name)
subprocess.Popen(["python", "run.py", os.path.basename(__file__).split('.')[0], data], cwd=config.cwd)
return wmsg
def run(data):
num=data.split(';')[0]
msg=data.split(';')[1]
if isKaprodi(getNIPYfromHandphone(num)):
status='kaprodi'
else:
status='deputi'
if status == 'kaprodi':
msgreply=infoBAPKaprodi(f'.{kelas.getAllDataDosens(kelas.getKodeDosen(num))[20]}.')
else:
msgreply=infoBAPDeputi(msg)
wa.setOutbox(numbers.normalize(num), msgreply[0])
def getProdiIDfromSingkatan(singkatan):
db=kelas.dbConnectSiap()
sql=f"select ProdiID from simak_mst_prodi where Singkatan = '{singkatan}'"
with db:
cur=db.cursor()
cur.execute(sql)
row = cur.fetchone()
if row:
return f".{row[0]}."
else:
return None
| 35.60274
| 212
| 0.653905
| 1,184
| 10,396
| 5.657095
| 0.123311
| 0.040311
| 0.045685
| 0.069872
| 0.797104
| 0.787847
| 0.767543
| 0.752314
| 0.740072
| 0.740072
| 0
| 0.010833
| 0.227491
| 10,396
| 292
| 213
| 35.60274
| 0.823185
| 0
| 0
| 0.750973
| 0
| 0.038911
| 0.289795
| 0.129941
| 0
| 0
| 0
| 0
| 0
| 1
| 0.07393
| false
| 0
| 0.011673
| 0
| 0.198444
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 6
|
68f9926a1a6cee5c7b3808e4d3e51e60201ff9cc
| 122
|
py
|
Python
|
pycantonese/tests/__init__.py
|
chaaklau/pycantonese
|
94694fea2f3c3405d3b6bb6d504a56bb05a6496c
|
[
"MIT"
] | 124
|
2019-08-12T13:10:43.000Z
|
2022-03-24T18:35:58.000Z
|
pycantonese/tests/__init__.py
|
chaaklau/pycantonese
|
94694fea2f3c3405d3b6bb6d504a56bb05a6496c
|
[
"MIT"
] | 13
|
2019-09-03T17:08:49.000Z
|
2021-12-28T21:37:17.000Z
|
pycantonese/tests/__init__.py
|
chaaklau/pycantonese
|
94694fea2f3c3405d3b6bb6d504a56bb05a6496c
|
[
"MIT"
] | 15
|
2019-08-09T04:03:01.000Z
|
2022-03-17T10:18:21.000Z
|
import os
_THIS_DIR = os.path.dirname(os.path.realpath(__file__))
REPO_DIR = os.path.dirname(os.path.dirname(_THIS_DIR))
| 24.4
| 55
| 0.778689
| 21
| 122
| 4.095238
| 0.428571
| 0.27907
| 0.453488
| 0.372093
| 0.511628
| 0.511628
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07377
| 122
| 4
| 56
| 30.5
| 0.761062
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 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
| 6
|
ec431f839118040109012d9dbffe4ec8364d62fb
| 3,700
|
py
|
Python
|
bglcapi/bgapi/sm/cmd.py
|
edgebr/python-bgapi
|
0aeb525edf605e892b20f5c3fb11269cce0c5bdf
|
[
"MIT"
] | null | null | null |
bglcapi/bgapi/sm/cmd.py
|
edgebr/python-bgapi
|
0aeb525edf605e892b20f5c3fb11269cce0c5bdf
|
[
"MIT"
] | null | null | null |
bglcapi/bgapi/sm/cmd.py
|
edgebr/python-bgapi
|
0aeb525edf605e892b20f5c3fb11269cce0c5bdf
|
[
"MIT"
] | null | null | null |
from struct import pack
from bglcapi.base_command import command
from bglcapi.types import (MessageType, MessageClass)
def bonding_confirm(connection, confirm):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x0e
payload = pack('<BB', connection, confirm)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def configure(flags, io_capabilities):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x01
payload = pack('<BB', flags, io_capabilities)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def delete_bonding(bonding):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x06
payload = pack('<B', bonding)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def delete_bondings():
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x07
payload = b''
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def enter_passkey(connection, passkey):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x08
payload = pack('<Bi', connection, passkey)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def increase_security(connection):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x04
payload = pack('<B', connection)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def list_all_bondings():
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x0b
payload = b''
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def passkey_confirm(connection, confirm):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x09
payload = pack('<BB', connection, confirm)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def set_bondable_mode(bondable):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x00
payload = pack('<B', bondable)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def set_debug_mode():
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x0f
payload = b''
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def set_oob_data(oob_data):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x0a
payload = pack('<B', len(oob_data)) + bytes(oob_data)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def set_passkey(passkey):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x10
payload = pack('<i', passkey)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def set_sc_remote_oob_data(oob_data):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x12
payload = pack('<B', len(oob_data)) + bytes(oob_data)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def store_bonding_configuration(max_bonding_count, policy_flags):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x02
payload = pack('<BB', max_bonding_count, policy_flags)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
def use_sc_oob(enable):
MSG_TYPE = MessageType.COMMAND_RESPONSE.value
MSG_CLASS = MessageClass.SM.value
MSG_ID = 0x11
payload = pack('<B', enable)
return command(MSG_TYPE, MSG_CLASS, MSG_ID, payload)
| 29.6
| 65
| 0.73027
| 510
| 3,700
| 5.017647
| 0.139216
| 0.082063
| 0.10551
| 0.146542
| 0.798359
| 0.778038
| 0.778038
| 0.778038
| 0.778038
| 0.762407
| 0
| 0.013465
| 0.177027
| 3,700
| 124
| 66
| 29.83871
| 0.826929
| 0
| 0
| 0.55914
| 0
| 0
| 0.007838
| 0
| 0
| 0
| 0.016216
| 0
| 0
| 1
| 0.16129
| false
| 0.053763
| 0.032258
| 0
| 0.354839
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 6
|
6b637d51ee53d130d2f22a3cc30f1efdedb53487
| 445
|
py
|
Python
|
douyinspider/structures/__init__.py
|
MisterZhouZhou/pythonThreeSpider
|
0e120350402f690158c89b7431f243cb462ae12f
|
[
"Apache-2.0"
] | 3
|
2019-11-05T01:00:05.000Z
|
2021-03-16T03:56:46.000Z
|
douyinspider/structures/__init__.py
|
bingwin/pythonThreeSpider
|
0e120350402f690158c89b7431f243cb462ae12f
|
[
"Apache-2.0"
] | null | null | null |
douyinspider/structures/__init__.py
|
bingwin/pythonThreeSpider
|
0e120350402f690158c89b7431f243cb462ae12f
|
[
"Apache-2.0"
] | 1
|
2020-05-16T12:45:36.000Z
|
2020-05-16T12:45:36.000Z
|
from douyinspider.structures.hot import *
from douyinspider.structures.base import Base
from douyinspider.structures.music import Music
from douyinspider.structures.user import User
from douyinspider.structures.video import Video
from douyinspider.structures.address import Address
from douyinspider.structures.topic import Topic
from douyinspider.structures.word import Word
from douyinspider.structures.music_collection import MusicCollection
| 44.5
| 68
| 0.876404
| 54
| 445
| 7.203704
| 0.259259
| 0.37018
| 0.601542
| 0.159383
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.080899
| 445
| 9
| 69
| 49.444444
| 0.9511
| 0
| 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
| 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
| 6
|
6b7d62abec208b5d28e43bdb68af22c4c8b92da6
| 43,769
|
py
|
Python
|
test/augmentation/test_augmentation_3d.py
|
prcaaf/kornia
|
a3eca7400e6da89b313549bbae751ff23a0e7bc5
|
[
"ECL-2.0",
"Apache-2.0"
] | 1
|
2020-12-13T16:13:08.000Z
|
2020-12-13T16:13:08.000Z
|
test/augmentation/test_augmentation_3d.py
|
ZhiyuanChen/kornia
|
87a0ead264ce5fc97997071acb9fe2286d6c425c
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
test/augmentation/test_augmentation_3d.py
|
ZhiyuanChen/kornia
|
87a0ead264ce5fc97997071acb9fe2286d6c425c
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
from typing import Union, Tuple
import pytest
import torch
import torch.nn as nn
from torch.testing import assert_allclose
from torch.autograd import gradcheck
import kornia
import kornia.testing as utils # test utils
from kornia.constants import pi
from kornia.augmentation import (
RandomDepthicalFlip3D,
RandomHorizontalFlip3D,
RandomVerticalFlip3D,
RandomAffine3D,
RandomRotation3D,
RandomCrop3D,
CenterCrop3D,
RandomEqualize3D
)
class TestRandomHorizontalFlip3D:
# TODO: improve and implement more meaningful smoke tests e.g check for a consistent
# return values such a torch.Tensor variable.
@pytest.mark.xfail(reason="might fail under windows OS due to printing preicision.")
def test_smoke(self):
f = RandomHorizontalFlip3D(0.5)
repr = "RandomHorizontalFlip3D(p=0.5, p_batch=1.0, same_on_batch=False, return_transform=0.5)"
assert str(f) == repr
def test_random_hflip(self, device):
f = RandomHorizontalFlip3D(p=1.0, return_transform=True)
f1 = RandomHorizontalFlip3D(p=0., return_transform=True)
f2 = RandomHorizontalFlip3D(p=1.)
f3 = RandomHorizontalFlip3D(p=0.)
input = torch.tensor([[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 1., 2.]],
[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 1., 2.]]]) # 2 x 3 x 4
input = input.to(device)
expected = torch.tensor([[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[2., 1., 0., 0.]],
[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[2., 1., 0., 0.]]]) # 2 x 3 x 4
expected = expected.to(device)
expected_transform = torch.tensor([[-1., 0., 0., 3.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]) # 4 x 4
expected_transform = expected_transform.to(device)
identity = torch.tensor([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]) # 4 x 4
identity = identity.to(device)
assert (f(input)[0] == expected).all()
assert (f(input)[1] == expected_transform).all()
assert (f1(input)[0] == input).all()
assert (f1(input)[1] == identity).all()
assert (f2(input) == expected).all()
assert (f3(input) == input).all()
def test_batch_random_hflip(self, device):
f = RandomHorizontalFlip3D(p=1.0, return_transform=True)
f1 = RandomHorizontalFlip3D(p=0.0, return_transform=True)
input = torch.tensor([[[[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]]]) # 1 x 1 x 1 x 3 x 3
input = input.to(device)
expected = torch.tensor([[[[[0., 0., 0.],
[0., 0., 0.],
[1., 1., 0.]]]]]) # 1 x 1 x 1 x 3 x 3
expected = expected.to(device)
expected_transform = torch.tensor([[[-1., 0., 0., 2.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
expected_transform = expected_transform.to(device)
identity = torch.tensor([[[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
identity = identity.to(device)
input = input.repeat(5, 3, 1, 1, 1) # 5 x 3 x 3 x 3 x 3
expected = expected.repeat(5, 3, 1, 1, 1) # 5 x 3 x 3 x 3 x 3
expected_transform = expected_transform.repeat(5, 1, 1) # 5 x 4 x 4
identity = identity.repeat(5, 1, 1) # 5 x 4 x 4
assert (f(input)[0] == expected).all()
assert (f(input)[1] == expected_transform).all()
assert (f1(input)[0] == input).all()
assert (f1(input)[1] == identity).all()
def test_same_on_batch(self, device):
f = RandomHorizontalFlip3D(p=0.5, same_on_batch=True)
input = torch.eye(3).unsqueeze(dim=0).unsqueeze(dim=0).repeat(2, 1, 1, 1, 1)
res = f(input)
assert (res[0] == res[1]).all()
def test_sequential(self, device):
f = nn.Sequential(
RandomHorizontalFlip3D(p=1.0, return_transform=True),
RandomHorizontalFlip3D(p=1.0, return_transform=True),
)
f1 = nn.Sequential(
RandomHorizontalFlip3D(p=1.0, return_transform=True),
RandomHorizontalFlip3D(p=1.0),
)
input = torch.tensor([[[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]]) # 1 x 1 x 3 x 3
input = input.to(device)
expected_transform = torch.tensor([[[-1., 0., 0., 2.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
expected_transform = expected_transform.to(device)
expected_transform_1 = expected_transform @ expected_transform
expected_transform_1 = expected_transform_1.to(device)
assert(f(input)[0] == input).all()
assert(f(input)[1] == expected_transform_1).all()
assert(f1(input)[0] == input).all()
assert(f1(input)[1] == expected_transform).all()
@pytest.mark.skip(reason="turn off all jit for a while")
def test_jit(self, device):
@torch.jit.script
def op_script(data: torch.Tensor) -> Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
return kornia.random_hflip(data)
input = torch.tensor([[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]) # 1 x 3 x 3
# Build jit trace
op_trace = torch.jit.trace(op_script, (input, ))
# Create new inputs
input = torch.tensor([[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]]) # 3 x 3
input = input.repeat(2, 1, 1) # 2 x 3 x 3
expected = torch.tensor([[[0., 0., 0.],
[0., 5., 5.],
[0., 0., 0.]]]) # 3 x 3
expected = expected.repeat(2, 1, 1)
actual = op_trace(input)
assert_allclose(actual, expected)
def test_gradcheck(self, device):
input = torch.rand((1, 3, 3)).to(device) # 3 x 3
input = utils.tensor_to_gradcheck_var(input) # to var
assert gradcheck(RandomHorizontalFlip3D(p=1.), (input, ), raise_exception=True)
class TestRandomVerticalFlip3D:
# TODO: improve and implement more meaningful smoke tests e.g check for a consistent
# return values such a torch.Tensor variable.
@pytest.mark.xfail(reason="might fail under windows OS due to printing preicision.")
def test_smoke(self):
f = RandomVerticalFlip3D(0.5)
repr = "RandomVerticalFlip3D(p=0.5, p_batch=1.0, same_on_batch=False, return_transform=0.5)"
assert str(f) == repr
def test_random_vflip(self, device):
f = RandomVerticalFlip3D(p=1.0, return_transform=True)
f1 = RandomVerticalFlip3D(p=0., return_transform=True)
f2 = RandomVerticalFlip3D(p=1.)
f3 = RandomVerticalFlip3D(p=0.)
input = torch.tensor([[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]],
[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]) # 2 x 3 x 3
input = input.to(device)
expected = torch.tensor([[[0., 1., 1.],
[0., 0., 0.],
[0., 0., 0.]],
[[0., 1., 1.],
[0., 0., 0.],
[0., 0., 0.]]]) # 2 x 3 x 3
expected = expected.to(device)
expected_transform = torch.tensor([[1., 0., 0., 0.],
[0., -1., 0., 2.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]) # 4 x 4
expected_transform = expected_transform.to(device)
identity = torch.tensor([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]) # 4 x 4
identity = identity.to(device)
assert_allclose(f(input)[0], expected)
assert_allclose(f(input)[1], expected_transform)
assert_allclose(f1(input)[0], input)
assert_allclose(f1(input)[1], identity)
assert_allclose(f2(input), expected)
assert_allclose(f3(input), input)
def test_batch_random_vflip(self, device):
f = RandomVerticalFlip3D(p=1.0, return_transform=True)
f1 = RandomVerticalFlip3D(p=0.0, return_transform=True)
input = torch.tensor([[[[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]]]) # 1 x 1 x 1 x 3 x 3
input = input.to(device)
expected = torch.tensor([[[[[0., 1., 1.],
[0., 0., 0.],
[0., 0., 0.]]]]]) # 1 x 1 x 1 x 3 x 3
expected = expected.to(device)
expected_transform = torch.tensor([[[1., 0., 0., 0.],
[0., -1., 0., 2.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
expected_transform = expected_transform.to(device)
identity = torch.tensor([[[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
identity = identity.to(device)
input = input.repeat(5, 3, 1, 1, 1) # 5 x 3 x 3 x 3 x 3
expected = expected.repeat(5, 3, 1, 1, 1) # 5 x 3 x 3 x 3 x 3
expected_transform = expected_transform.repeat(5, 1, 1) # 5 x 4 x 4
identity = identity.repeat(5, 1, 1) # 5 x 4 x 4
assert_allclose(f(input)[0], expected)
assert_allclose(f(input)[1], expected_transform)
assert_allclose(f1(input)[0], input)
assert_allclose(f1(input)[1], identity)
def test_same_on_batch(self, device):
f = RandomVerticalFlip3D(p=0.5, same_on_batch=True)
input = torch.eye(3).unsqueeze(dim=0).unsqueeze(dim=0).repeat(2, 1, 1, 1, 1)
res = f(input)
assert (res[0] == res[1]).all()
def test_sequential(self, device):
f = nn.Sequential(
RandomVerticalFlip3D(p=1.0, return_transform=True),
RandomVerticalFlip3D(p=1.0, return_transform=True),
)
f1 = nn.Sequential(
RandomVerticalFlip3D(p=1.0, return_transform=True),
RandomVerticalFlip3D(p=1.0),
)
input = torch.tensor([[[[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]]]) # 1 x 1 x 1 x 4 x 4
input = input.to(device)
expected_transform = torch.tensor([[[1., 0., 0., 0.],
[0., -1., 0., 2.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
expected_transform = expected_transform.to(device)
expected_transform_1 = expected_transform @ expected_transform
assert_allclose(f(input)[0], input.squeeze())
assert_allclose(f(input)[1], expected_transform_1)
assert_allclose(f1(input)[0], input.squeeze())
assert_allclose(f1(input)[1], expected_transform)
@pytest.mark.skip(reason="turn off all jit for a while")
def test_jit(self, device):
@torch.jit.script
def op_script(data: torch.Tensor) -> Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
return kornia.random_vflip(data)
input = torch.tensor([[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]) # 4 x 4
# Build jit trace
op_trace = torch.jit.trace(op_script, (input, ))
# Create new inputs
input = torch.tensor([[[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]]]) # 1 x 4 x 4
input = input.repeat(2, 1, 1) # 2 x 4 x 4
expected = torch.tensor([[[[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]]]]) # 1 x 4 x 4
expected = expected.repeat(2, 1, 1)
actual = op_trace(input)
assert_allclose(actual, expected)
def test_gradcheck(self, device):
input = torch.rand((1, 3, 3)).to(device) # 4 x 4
input = utils.tensor_to_gradcheck_var(input) # to var
assert gradcheck(RandomVerticalFlip3D(p=1.), (input, ), raise_exception=True)
class TestRandomDepthicalFlip3D:
# TODO: improve and implement more meaningful smoke tests e.g check for a consistent
# return values such a torch.Tensor variable.
@pytest.mark.xfail(reason="might fail under windows OS due to printing preicision.")
def test_smoke(self):
f = RandomDepthicalFlip3D(0.5)
repr = "RandomDepthicalFlip3D(p=0.5, p_batch=1.0, same_on_batch=False, return_transform=0.5)"
assert str(f) == repr
def test_random_dflip(self, device):
f = RandomDepthicalFlip3D(p=1.0, return_transform=True)
f1 = RandomDepthicalFlip3D(p=0., return_transform=True)
f2 = RandomDepthicalFlip3D(p=1.)
f3 = RandomDepthicalFlip3D(p=0.)
input = torch.tensor([[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 1.]],
[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 2.]]]) # 2 x 3 x 4
input = input.to(device)
expected = torch.tensor([[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 2.]],
[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 1.]]]) # 2 x 3 x 4
expected = expected.to(device)
expected_transform = torch.tensor([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., -1., 1.],
[0., 0., 0., 1.]]) # 4 x 4
expected_transform = expected_transform.to(device)
identity = torch.tensor([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]) # 4 x 4
identity = identity.to(device)
assert_allclose(f(input)[0], expected)
assert_allclose(f(input)[1], expected_transform)
assert_allclose(f1(input)[0], input)
assert_allclose(f1(input)[1], identity)
assert_allclose(f2(input), expected)
assert_allclose(f3(input), input)
def test_batch_random_dflip(self, device):
f = RandomDepthicalFlip3D(p=1.0, return_transform=True)
f1 = RandomDepthicalFlip3D(p=0.0, return_transform=True)
input = torch.tensor([[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 1.]],
[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 2.]]]) # 2 x 3 x 4
input = input.to(device)
expected = torch.tensor([[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 2.]],
[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 1.]]]) # 2 x 3 x 4
expected = expected.to(device)
expected_transform = torch.tensor([[[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., -1., 1.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
expected_transform = expected_transform.to(device)
identity = torch.tensor([[[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
identity = identity.to(device)
input = input.repeat(5, 3, 1, 1, 1) # 5 x 3 x 3 x 3 x 3
expected = expected.repeat(5, 3, 1, 1, 1) # 5 x 3 x 3 x 3 x 3
expected_transform = expected_transform.repeat(5, 1, 1) # 5 x 4 x 4
identity = identity.repeat(5, 1, 1) # 5 x 4 x 4
assert_allclose(f(input)[0], expected)
assert_allclose(f(input)[1], expected_transform)
assert_allclose(f1(input)[0], input)
assert_allclose(f1(input)[1], identity)
def test_same_on_batch(self, device):
f = RandomDepthicalFlip3D(p=0.5, same_on_batch=True)
input = torch.eye(3).unsqueeze(dim=0).unsqueeze(dim=0).repeat(2, 1, 2, 1, 1)
res = f(input)
assert (res[0] == res[1]).all()
def test_sequential(self, device):
f = nn.Sequential(
RandomDepthicalFlip3D(p=1.0, return_transform=True),
RandomDepthicalFlip3D(p=1.0, return_transform=True),
)
f1 = nn.Sequential(
RandomDepthicalFlip3D(p=1.0, return_transform=True),
RandomDepthicalFlip3D(p=1.0),
)
input = torch.tensor([[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 1.]],
[[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 2.]]]) # 2 x 3 x 4
input = input.to(device)
expected_transform = torch.tensor([[[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., -1., 1.],
[0., 0., 0., 1.]]]) # 1 x 4 x 4
expected_transform = expected_transform.to(device)
expected_transform_1 = expected_transform @ expected_transform
assert_allclose(f(input)[0], input.squeeze())
assert_allclose(f(input)[1], expected_transform_1)
assert_allclose(f1(input)[0], input.squeeze())
assert_allclose(f1(input)[1], expected_transform)
@pytest.mark.skip(reason="turn off all jit for a while")
def test_jit(self, device):
@torch.jit.script
def op_script(data: torch.Tensor) -> Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
return kornia.random_vflip(data)
input = torch.tensor([[[0., 0., 0.],
[0., 0., 0.],
[0., 1., 1.]]]) # 4 x 4
# Build jit trace
op_trace = torch.jit.trace(op_script, (input, ))
# Create new inputs
input = torch.tensor([[[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]]]) # 1 x 4 x 4
input = input.repeat(2, 1, 1) # 2 x 4 x 4
expected = torch.tensor([[[[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]]]]) # 1 x 4 x 4
expected = expected.repeat(2, 1, 1)
actual = op_trace(input)
assert_allclose(actual, expected)
def test_gradcheck(self, device):
input = torch.rand((1, 3, 3)).to(device) # 4 x 4
input = utils.tensor_to_gradcheck_var(input) # to var
assert gradcheck(RandomDepthicalFlip3D(p=1.), (input, ), raise_exception=True)
class TestRandomRotation3D:
torch.manual_seed(0) # for random reproductibility
# TODO: improve and implement more meaningful smoke tests e.g check for a consistent
# return values such a torch.Tensor variable.
@pytest.mark.xfail(reason="might fail under windows OS due to printing preicision.")
def test_smoke(self):
f = RandomRotation3D(degrees=45.5)
repr = """RandomRotation3D(degrees=tensor([[-45.5000, 45.5000],
[-45.5000, 45.5000],
[-45.5000, 45.5000]]), resample=BILINEAR, align_corners=False, p=0.5, """\
"""p_batch=1.0, same_on_batch=False, return_transform=False)"""
assert str(f) == repr
def test_random_rotation(self, device, dtype):
# This is included in doctest
torch.manual_seed(0) # for random reproductibility
f = RandomRotation3D(degrees=45.0, return_transform=True)
f1 = RandomRotation3D(degrees=45.0)
input = torch.tensor([[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]]], device=device, dtype=dtype) # 3 x 4 x 4
expected = torch.tensor([[[[[0.2771, 0.0000, 0.0036, 0.0000],
[0.5751, 0.0183, 0.7505, 0.4702],
[0.0262, 0.2591, 0.5776, 0.4764],
[0.0000, 0.0093, 0.0000, 0.0393]],
[[0.0000, 0.0000, 0.0583, 0.0222],
[0.1665, 0.0000, 1.0424, 1.0224],
[0.1296, 0.4846, 1.4200, 1.2287],
[0.0078, 0.3851, 0.3965, 0.3612]],
[[0.0000, 0.7704, 0.6704, 0.0000],
[0.0000, 0.0332, 0.2414, 0.0524],
[0.0000, 0.3349, 1.4545, 1.3689],
[0.0000, 0.0312, 0.5874, 0.8702]]]]], device=device, dtype=dtype)
expected_transform = torch.tensor([[[0.5784, 0.7149, -0.3929, -0.0471],
[-0.3657, 0.6577, 0.6585, 0.4035],
[0.7292, -0.2372, 0.6419, -0.3799],
[0.0000, 0.0000, 0.0000, 1.0000]]], device=device, dtype=dtype)
expected_2 = torch.tensor([[[[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]]]]], device=device, dtype=dtype)
out, mat = f(input)
assert_allclose(out, expected, rtol=1e-6, atol=1e-4)
assert_allclose(mat, expected_transform, rtol=1e-6, atol=1e-4)
assert_allclose(f1(input), expected_2, rtol=1e-6, atol=1e-4)
def test_batch_random_rotation(self, device, dtype):
torch.manual_seed(0) # for random reproductibility
f = RandomRotation3D(degrees=45.0, return_transform=True)
input = torch.tensor([[[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]]]], device=device, dtype=dtype) # 1 x 1 x 4 x 4
expected = torch.tensor([[[[[0.0000, 0.5106, 0.1146, 0.0000],
[0.0000, 0.1261, 0.0000, 0.4723],
[0.1714, 0.9931, 0.5442, 0.4684],
[0.0193, 0.5802, 0.4195, 0.0000]],
[[0.0000, 0.2386, 0.0000, 0.0000],
[0.0187, 0.3527, 0.0000, 0.6119],
[0.1294, 1.2251, 0.9130, 0.0942],
[0.0962, 1.0769, 0.8448, 0.0000]],
[[0.0000, 0.0202, 0.0000, 0.0000],
[0.1092, 0.5845, 0.1038, 0.4598],
[0.0000, 1.1218, 1.0796, 0.0000],
[0.0780, 0.9513, 1.1278, 0.0000]]]],
[[[[1.0000, 0.0000, 0.0000, 2.0000],
[0.0000, 0.0000, 0.0000, 0.0000],
[0.0000, 1.0000, 2.0000, 0.0000],
[0.0000, 0.0000, 1.0000, 2.0000]],
[[1.0000, 0.0000, 0.0000, 2.0000],
[0.0000, 0.0000, 0.0000, 0.0000],
[0.0000, 1.0000, 2.0000, 0.0000],
[0.0000, 0.0000, 1.0000, 2.0000]],
[[1.0000, 0.0000, 0.0000, 2.0000],
[0.0000, 0.0000, 0.0000, 0.0000],
[0.0000, 1.0000, 2.0000, 0.0000],
[0.0000, 0.0000, 1.0000, 2.0000]]]]], device=device, dtype=dtype)
expected_transform = torch.tensor([[[0.7894, -0.6122, 0.0449, 1.1892],
[0.5923, 0.7405, -0.3176, -0.1816],
[0.1612, 0.2773, 0.9472, -0.6049],
[0.0000, 0.0000, 0.0000, 1.0000]],
[[1.0000, 0.0000, 0.0000, 0.0000],
[0.0000, 1.0000, 0.0000, 0.0000],
[0.0000, 0.0000, 1.0000, 0.0000],
[0.0000, 0.0000, 0.0000, 1.0000]]], device=device, dtype=dtype)
input = input.repeat(2, 1, 1, 1, 1) # 5 x 4 x 4 x 3
out, mat = f(input)
assert_allclose(out, expected, rtol=1e-6, atol=1e-4)
assert_allclose(mat, expected_transform, rtol=1e-6, atol=1e-4)
def test_same_on_batch(self, device, dtype):
f = RandomRotation3D(degrees=40, same_on_batch=True)
input = torch.eye(6, device=device, dtype=dtype).unsqueeze(dim=0).unsqueeze(dim=0).repeat(2, 3, 1, 1, 1)
res = f(input)
assert (res[0] == res[1]).all()
def test_sequential(self, device, dtype):
torch.manual_seed(0) # for random reproductibility
f = nn.Sequential(
RandomRotation3D(torch.tensor([-45.0, 90]), return_transform=True),
RandomRotation3D(10.4, return_transform=True),
)
f1 = nn.Sequential(
RandomRotation3D(torch.tensor([-45.0, 90]), return_transform=True),
RandomRotation3D(10.4),
)
input = torch.tensor([[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]]], device=device, dtype=dtype) # 3 x 4 x 4
expected = torch.tensor([[[[[0.2752, 0.0000, 0.0000, 0.0000],
[0.5767, 0.0059, 0.6440, 0.4307],
[0.0000, 0.2793, 0.6638, 0.5716],
[0.0000, 0.0049, 0.0000, 0.0685]],
[[0.0000, 0.0000, 0.1806, 0.0000],
[0.2138, 0.0000, 0.9061, 0.7966],
[0.0657, 0.5395, 1.4299, 1.2912],
[0.0000, 0.3600, 0.3088, 0.3655]],
[[0.0000, 0.6515, 0.8861, 0.0000],
[0.0000, 0.0000, 0.2278, 0.0000],
[0.0027, 0.4403, 1.5462, 1.3480],
[0.0000, 0.1182, 0.6297, 0.8623]]]]], device=device, dtype=dtype)
expected_transform = torch.tensor([[[0.6306, 0.6496, -0.4247, 0.0044],
[-0.3843, 0.7367, 0.5563, 0.4151],
[0.6743, -0.1876, 0.7142, -0.4443],
[0.0000, 0.0000, 0.0000, 1.0000]]], device=device, dtype=dtype)
expected_transform_2 = torch.tensor([[[0.9611, 0.0495, -0.2717, 0.2557],
[0.1255, 0.7980, 0.5894, -0.4747],
[0.2460, -0.6006, 0.7608, 0.7710],
[0.0000, 0.0000, 0.0000, 1.0000]]], device=device, dtype=dtype)
out, mat = f(input)
_, mat_2 = f1(input)
assert_allclose(out, expected, rtol=1e-6, atol=1e-4)
assert_allclose(mat, expected_transform, rtol=1e-6, atol=1e-4)
assert_allclose(mat_2, expected_transform_2, rtol=1e-6, atol=1e-4)
@pytest.mark.skip(reason="turn off all jit for a while")
def test_jit(self, device):
torch.manual_seed(0) # for random reproductibility
@torch.jit.script
def op_script(data: torch.Tensor) -> Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
return kornia.random_rotation(data, degrees=45.0)
input = torch.tensor([[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]],
[[1., 0., 0., 2.],
[0., 0., 0., 0.],
[0., 1., 2., 0.],
[0., 0., 1., 2.]]]) # 3 x 4 x 4
# Build jit trace
op_trace = torch.jit.trace(op_script, (input, ))
# Create new inputs
input = torch.tensor([[[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]],
[[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]],
[[0., 0., 0.],
[5., 5., 0.],
[0., 0., 0.]]]) # 3 x 3 x 3
expected = torch.tensor([[[0.0000, 0.2584, 0.0000],
[2.9552, 5.0000, 0.2584],
[1.6841, 0.4373, 0.0000]]])
actual = op_trace(input)
assert_allclose(actual, expected, rtol=1e-6, atol=1e-4)
def test_gradcheck(self, device):
torch.manual_seed(0) # for random reproductibility
input = torch.rand((3, 3, 3)).to(device) # 3 x 3 x 3
input = utils.tensor_to_gradcheck_var(input) # to var
assert gradcheck(RandomRotation3D(degrees=(15.0, 15.0), p=1.), (input, ), raise_exception=True)
class TestRandomCrop3D:
# TODO: improve and implement more meaningful smoke tests e.g check for a consistent
# return values such a torch.Tensor variable.
@pytest.mark.xfail(reason="might fail under windows OS due to printing preicision.")
def test_smoke(self):
f = RandomCrop3D(size=(2, 3, 4), padding=(0, 1, 2), fill=10, pad_if_needed=False, p=1.)
repr = "RandomCrop3D(crop_size=(2, 3, 4), padding=(0, 1, 2), fill=10, pad_if_needed=False, "\
"padding_mode=constant, resample=BILINEAR, p=1.0, p_batch=1.0, same_on_batch=False, "\
"return_transform=False)"
assert str(f) == repr
@pytest.mark.parametrize("batch_size", [1, 2])
def test_no_padding(self, batch_size, device, dtype):
torch.manual_seed(0)
inp = torch.tensor([[[[
[0., 1., 2., 3., 4.],
[5., 6., 7., 8., 9.],
[10, 11, 12, 13, 14],
[15, 16, 17, 18, 19],
[20, 21, 22, 23, 24]
]]]], device=device, dtype=dtype).repeat(batch_size, 1, 5, 1, 1)
f = RandomCrop3D(size=(2, 3, 4), padding=None, align_corners=True, p=1.)
out = f(inp)
if batch_size == 1:
expected = torch.tensor([[[[
[11, 12, 13, 14],
[16, 17, 18, 19],
[21, 22, 23, 24]
]]]], device=device, dtype=dtype).repeat(batch_size, 1, 2, 1, 1)
if batch_size == 2:
expected = torch.tensor([
[[[[6.0000, 7.0000, 8.0000, 9.0000],
[11.0000, 12.0000, 13.0000, 14.0000],
[16.0000, 17.0000, 18.0000, 19.0000]],
[[6.0000, 7.0000, 8.0000, 9.0000],
[11.0000, 12.0000, 13.0000, 14.0000],
[16.0000, 17.0000, 18.0000, 19.0000]]]],
[[[[11.0000, 12.0000, 13.0000, 14.0000],
[16.0000, 17.0000, 18.0000, 19.0000],
[21.0000, 22.0000, 23.0000, 24.0000]],
[[11.0000, 12.0000, 13.0000, 14.0000],
[16.0000, 17.0000, 18.0000, 19.0000],
[21.0000, 22.0000, 23.0000, 24.0000]]]]], device=device, dtype=dtype)
assert_allclose(out, expected, atol=1e-4, rtol=1e-4)
def test_same_on_batch(self, device, dtype):
f = RandomCrop3D(size=(2, 3, 4), padding=None, align_corners=True, p=1., same_on_batch=True)
input = torch.eye(6).unsqueeze(dim=0).unsqueeze(dim=0).unsqueeze(dim=0).repeat(2, 3, 5, 1, 1)
res = f(input)
assert (res[0] == res[1]).all()
@pytest.mark.parametrize("padding", [1, (1, 1, 1), (1, 1, 1, 1, 1, 1)])
def test_padding_batch(self, padding, device, dtype):
torch.manual_seed(0)
batch_size = 2
inp = torch.tensor([[[
[0., 1., 2.],
[3., 4., 5.],
[6., 7., 8.]
]]], device=device, dtype=dtype).repeat(batch_size, 1, 3, 1, 1)
expected = torch.tensor([[[
[[0., 1., 2., 10.],
[3., 4., 5., 10.],
[6., 7., 8., 10.]],
[[0., 1., 2., 10.],
[3., 4., 5., 10.],
[6., 7., 8., 10.]],
]], [[
[[3., 4., 5., 10.],
[6., 7., 8., 10.],
[10, 10, 10, 10.]],
[[10, 10, 10, 10.],
[10, 10, 10, 10.],
[10, 10, 10, 10.]],
]]], device=device, dtype=dtype)
f = RandomCrop3D(size=(2, 3, 4), fill=10., padding=padding, align_corners=True, p=1.)
out = f(inp)
assert_allclose(out, expected, atol=1e-4, rtol=1e-4)
def test_pad_if_needed(self, device, dtype):
torch.manual_seed(0)
inp = torch.tensor([[
[0., 1., 2.],
]], device=device, dtype=dtype)
expected = torch.tensor([[[
[[9., 9., 9., 9.],
[9., 9., 9., 9.],
[9., 9., 9., 9.]],
[[0., 1., 2., 9.],
[9., 9., 9., 9.],
[9., 9., 9., 9.]],
]]], device=device, dtype=dtype)
rc = RandomCrop3D(size=(2, 3, 4), pad_if_needed=True, fill=9, align_corners=True, p=1.)
out = rc(inp)
assert_allclose(out, expected, atol=1e-4, rtol=1e-4)
def test_gradcheck(self, device, dtype):
torch.manual_seed(0) # for random reproductibility
inp = torch.rand((3, 3, 3), device=device, dtype=dtype) # 3 x 3
inp = utils.tensor_to_gradcheck_var(inp) # to var
assert gradcheck(RandomCrop3D(size=(3, 3, 3), p=1.), (inp, ), raise_exception=True)
@pytest.mark.skip("Need to fix Union type")
def test_jit(self, device, dtype):
# Define script
op = RandomCrop(size=(3, 3), p=1.).forward
op_script = torch.jit.script(op)
img = torch.ones(1, 1, 5, 6, device=device, dtype=dtype)
actual = op_script(img)
expected = kornia.center_crop3d(img)
assert_allclose(actual, expected)
@pytest.mark.skip("Need to fix Union type")
def test_jit_trace(self, device, dtype):
# Define script
op = RandomCrop(size=(3, 3), p=1.).forward
op_script = torch.jit.script(op)
# 1. Trace op
img = torch.ones(1, 1, 5, 6, device=device, dtype=dtype)
op_trace = torch.jit.trace(op_script, (img,))
# 2. Generate new input
img = torch.ones(1, 1, 5, 6, device=device, dtype=dtype)
# 3. Evaluate
actual = op_trace(img)
expected = op(img)
assert_allclose(actual, expected)
class TestCenterCrop3D:
def test_no_transform(self, device, dtype):
inp = torch.rand(1, 2, 4, 4, 4, device=device, dtype=dtype)
out = kornia.augmentation.CenterCrop3D(2)(inp)
assert out.shape == (1, 2, 2, 2, 2)
def test_transform(self, device, dtype):
inp = torch.rand(1, 2, 5, 4, 8, device=device, dtype=dtype)
out = kornia.augmentation.CenterCrop3D(2, return_transform=True)(inp)
assert len(out) == 2
assert out[0].shape == (1, 2, 2, 2, 2)
assert out[1].shape == (1, 4, 4)
def test_no_transform_tuple(self, device, dtype):
inp = torch.rand(1, 2, 5, 4, 8, device=device, dtype=dtype)
out = kornia.augmentation.CenterCrop3D((3, 4, 5))(inp)
assert out.shape == (1, 2, 3, 4, 5)
def test_gradcheck(self, device, dtype):
input = torch.rand(1, 2, 3, 4, 5, device=device, dtype=dtype)
input = utils.tensor_to_gradcheck_var(input) # to var
assert gradcheck(kornia.augmentation.CenterCrop3D(3), (input,), raise_exception=True)
class TestRandomEqualize3D:
# TODO: improve and implement more meaningful smoke tests e.g check for a consistent
# return values such a torch.Tensor variable.
@pytest.mark.xfail(reason="might fail under windows OS due to printing preicision.")
def test_smoke(self, device, dtype):
f = RandomEqualize3D(p=0.5)
repr = "RandomEqualize3D(p=0.5, p_batch=1.0, same_on_batch=False, return_transform=False)"
assert str(f) == repr
def test_random_equalize(self, device, dtype):
f = RandomEqualize3D(p=1.0, return_transform=True)
f1 = RandomEqualize3D(p=0., return_transform=True)
f2 = RandomEqualize3D(p=1.)
f3 = RandomEqualize3D(p=0.)
bs, channels, depth, height, width = 1, 3, 6, 10, 10
inputs3d = self.build_input(channels, depth, height, width, device=device, dtype=dtype).squeeze(dim=0)
row_expected = torch.tensor([
0.0000, 0.11764, 0.2353, 0.3529, 0.4706, 0.5882, 0.7059, 0.8235, 0.9412, 1.0000
], device=device, dtype=dtype)
expected = self.build_input(channels, depth, height, width, bs=1, row=row_expected,
device=device, dtype=dtype)
identity = kornia.eye_like(4, expected)
assert_allclose(f(inputs3d)[0], expected, rtol=1e-4, atol=1e-4)
assert_allclose(f(inputs3d)[1], identity, rtol=1e-4, atol=1e-4)
assert_allclose(f1(inputs3d)[0], inputs3d, rtol=1e-4, atol=1e-4)
assert_allclose(f1(inputs3d)[1], identity, rtol=1e-4, atol=1e-4)
assert_allclose(f2(inputs3d), expected, rtol=1e-4, atol=1e-4)
assert_allclose(f3(inputs3d), inputs3d, rtol=1e-4, atol=1e-4)
def test_batch_random_equalize(self, device, dtype):
f = RandomEqualize3D(p=1.0, return_transform=True)
f1 = RandomEqualize3D(p=0., return_transform=True)
f2 = RandomEqualize3D(p=1.)
f3 = RandomEqualize3D(p=0.)
bs, channels, depth, height, width = 2, 3, 6, 10, 10
inputs3d = self.build_input(channels, depth, height, width, bs, device=device, dtype=dtype)
row_expected = torch.tensor([
0.0000, 0.11764, 0.2353, 0.3529, 0.4706, 0.5882, 0.7059, 0.8235, 0.9412, 1.0000
])
expected = self.build_input(channels, depth, height, width, bs, row=row_expected,
device=device, dtype=dtype)
identity = kornia.eye_like(4, expected) # 2 x 4 x 4
assert_allclose(f(inputs3d)[0], expected, rtol=1e-4, atol=1e-4)
assert_allclose(f(inputs3d)[1], identity, rtol=1e-4, atol=1e-4)
assert_allclose(f1(inputs3d)[0], inputs3d, rtol=1e-4, atol=1e-4)
assert_allclose(f1(inputs3d)[1], identity, rtol=1e-4, atol=1e-4)
assert_allclose(f2(inputs3d), expected, rtol=1e-4, atol=1e-4)
assert_allclose(f3(inputs3d), inputs3d, rtol=1e-4, atol=1e-4)
def test_same_on_batch(self, device, dtype):
f = RandomEqualize3D(p=0.5, same_on_batch=True)
input = torch.eye(4, device=device, dtype=dtype)
input = input.unsqueeze(dim=0).unsqueeze(dim=0).repeat(2, 1, 2, 1, 1)
res = f(input)
assert (res[0] == res[1]).all()
def test_gradcheck(self, device, dtype):
torch.manual_seed(0) # for random reproductibility
inputs3d = torch.rand((3, 3, 3), device=device, dtype=dtype) # 3 x 3 x 3
inputs3d = utils.tensor_to_gradcheck_var(inputs3d) # to var
assert gradcheck(RandomEqualize3D(p=0.5), (inputs3d,), raise_exception=True)
@staticmethod
def build_input(channels, depth, height, width, bs=1, row=None, device='cpu', dtype=torch.float32):
if row is None:
row = torch.arange(width, device=device, dtype=dtype) / float(width)
channel = torch.stack([row] * height)
image = torch.stack([channel] * channels)
image3d = torch.stack([image] * depth).transpose(0, 1)
batch = torch.stack([image3d] * bs)
return batch.to(device, dtype)
| 43.378593
| 112
| 0.448125
| 5,403
| 43,769
| 3.559504
| 0.069036
| 0.050437
| 0.054285
| 0.049085
| 0.835847
| 0.806
| 0.789621
| 0.767887
| 0.74662
| 0.712666
| 0
| 0.144954
| 0.393018
| 43,769
| 1,008
| 113
| 43.421627
| 0.578951
| 0.045626
| 0
| 0.648408
| 0
| 0.008917
| 0.028655
| 0.00738
| 0
| 0
| 0
| 0.000992
| 0.122293
| 1
| 0.063694
| false
| 0
| 0.012739
| 0.005096
| 0.09172
| 0.007643
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
6bbdd01acf71fc3e4336063b1dbd03093b010571
| 6,037
|
py
|
Python
|
baselines/ppo2/defaults.py
|
jinala/RLbaselines
|
3594c1edae49e1bb997057912cfb9b07531d41f4
|
[
"MIT"
] | null | null | null |
baselines/ppo2/defaults.py
|
jinala/RLbaselines
|
3594c1edae49e1bb997057912cfb9b07531d41f4
|
[
"MIT"
] | null | null | null |
baselines/ppo2/defaults.py
|
jinala/RLbaselines
|
3594c1edae49e1bb997057912cfb9b07531d41f4
|
[
"MIT"
] | 1
|
2021-04-27T17:21:28.000Z
|
2021-04-27T17:21:28.000Z
|
import random
import numpy as np
def unif_range(a, b):
return random.random() * (b - a) + a
def rand_elem(xs):
return xs[random.randrange(len(xs))]
def rand_int_linspace(start, stop, num = 50):
return rand_elem([int(x) for x in np.linspace(start, stop, num)])
def mujoco():
return dict(
nsteps=2048,
nminibatches=32,
lam=0.95,
gamma=0.99,
noptepochs=10,
log_interval=1,
ent_coef=0.0,
lr=lambda f: 3e-4 * f,
cliprange=0.2,
value_network='copy'
)
def atari():
return dict(
nsteps=128, nminibatches=4,
lam=0.95, gamma=0.99, noptepochs=4, log_interval=1,
ent_coef=.01,
lr=lambda f : f * 2.5e-4,
cliprange=0.1,
)
def retro():
return atari()
def car_retrieval_train():
lr = unif_range(0.003, 5e-6)
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
#nminibatches = rand_elem([1, 2, 4, 8, 16, 32, 64, 128, 256]),
nminibatches = 1, # for lstm
ent_coef = rand_elem([0.0, 0.01, 0.05, 0.1]),
noptepochs = rand_int_linspace(3, 36),
cliprange = rand_elem([0.1, 0.2, 0.3]),
gamma = 0.99,
lr = lambda f : f * lr
)
'''
# best params for car retrieval bench
def car_retrieval_train():
lr = 0.002
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 128,
ent_coef = 0.01,
noptepochs = 33,
cliprange = 0.1,
gamma = 0.99,
lr = lambda f : f * lr
)
def car_retrieval_train1():
lr = 0.002
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 128,
ent_coef = 0.01,
noptepochs = 33,
cliprange = 0.1,
gamma = 0.99,
lr = lambda f : f * lr
)
def car_retrieval_train2():
lr = 0.002
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 128,
ent_coef = 0.01,
noptepochs = 33,
cliprange = 0.1,
gamma = 0.99,
lr = lambda f : f * lr
)
def car_retrieval_train3():
lr = 0.002
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 128,
ent_coef = 0.01,
noptepochs = 33,
cliprange = 0.1,
gamma = 0.99,
lr = lambda f : f * lr
)
def car_retrieval_train4():
lr = 0.002
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 128,
ent_coef = 0.01,
noptepochs = 33,
cliprange = 0.1,
gamma = 0.99,
lr = lambda f : f * lr
)
def car_retrieval_train5():
lr = 0.002
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 128,
ent_coef = 0.01,
noptepochs = 33,
cliprange = 0.1,
gamma = 0.99,
lr = lambda f : f * lr
)'''
def pendulum_train():
lr = unif_range(0.003, 5e-6)
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
#nminibatches = rand_elem([1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]),
nminibatches = 1, #for lstm
ent_coef = rand_elem([0.0, 0.01, 0.05, 0.1]),
noptepochs = rand_int_linspace(3, 36),
cliprange = rand_elem([0.1, 0.2, 0.3]),
gamma = 0.99,
lr = lambda f : f * lr
)
'''
# best version for pendulum
def pendulum_train():
lr = 0.0003
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 1,
ent_coef = 0.01,
noptepochs = 28,
cliprange = 0.1,
gamma = 0.99,
lr = lambda f : f * lr
)'''
def mountain_car_train():
lr = unif_range(0.003, 5e-6)
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 1, #rand_elem([1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]),
ent_coef = rand_elem([0.0, 0.01, 0.05, 0.1]),
noptepochs = rand_int_linspace(3, 36),
cliprange = rand_elem([0.1, 0.2, 0.3]),
gamma = 0.99,
lr = lambda f : f * lr
)
def quad_train():
lr = unif_range(0.003, 5e-6)
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
#nminibatches = rand_elem([1, 2, 4, 8, 16, 32, 64, 128, 256]),
nminibatches=1, # for lstm
ent_coef = rand_elem([0.0, 0.01, 0.05, 0.1]),
noptepochs = rand_int_linspace(3, 36),
cliprange = rand_elem([0.1, 0.2, 0.3]),
gamma = 0.99,
lr = lambda f : f * lr
)
def quad_r_train():
lr = unif_range(0.003, 5e-6)
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 1, #rand_elem([1, 2, 4, 8, 16, 32, 64, 128, 256]),
ent_coef = rand_elem([0.0, 0.01, 0.05, 0.1]),
noptepochs = rand_int_linspace(3, 36),
cliprange = rand_elem([0.1, 0.2, 0.3]),
gamma = 0.99,
lr = lambda f : f * lr
)
def acrobot_train():
lr = unif_range(0.003, 5e-6)
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 1, #rand_elem([1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]),
ent_coef = rand_elem([0.0, 0.01, 0.05, 0.1]),
noptepochs = rand_int_linspace(3, 36),
cliprange = rand_elem([0.1, 0.2, 0.3]),
gamma = 0.99,
lr = lambda f : f * lr
)
def cartpole_train():
lr = unif_range(0.003, 5e-6)
print("lr: ", lr)
return dict(
# horizon = rand_int_linspace(32, 500),
nminibatches = 1, #rand_elem([1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]),
ent_coef = rand_elem([0.0, 0.01, 0.05, 0.1]),
noptepochs = rand_int_linspace(3, 36),
cliprange = rand_elem([0.1, 0.2, 0.3]),
gamma = 0.99,
lr = lambda f : f * lr
)
| 27.193694
| 90
| 0.525427
| 891
| 6,037
| 3.428732
| 0.106622
| 0.060229
| 0.10802
| 0.0491
| 0.839935
| 0.809493
| 0.809493
| 0.793781
| 0.793781
| 0.793781
| 0
| 0.145982
| 0.32599
| 6,037
| 222
| 91
| 27.193694
| 0.604817
| 0.120258
| 0
| 0.611111
| 0
| 0
| 0.009997
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.12037
| false
| 0
| 0.018519
| 0.055556
| 0.259259
| 0.064815
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
d40859cfcfbe9d41075f18e967f903d43551b1c9
| 43
|
py
|
Python
|
tests/distributed/test_dir_structures/src5/executors/utils/data.py
|
vishalbelsare/jina
|
ae72cc5ce1f7e7f4c662e72e96ea21dddc28bf43
|
[
"Apache-2.0"
] | 3
|
2021-12-06T08:10:02.000Z
|
2021-12-06T14:50:11.000Z
|
tests/distributed/test_dir_structures/src5/executors/utils/data.py
|
vishalbelsare/jina
|
ae72cc5ce1f7e7f4c662e72e96ea21dddc28bf43
|
[
"Apache-2.0"
] | 2
|
2021-12-17T15:22:12.000Z
|
2021-12-18T07:19:06.000Z
|
tests/distributed/test_dir_structures/src5/executors/utils/data.py
|
vishalbelsare/jina
|
ae72cc5ce1f7e7f4c662e72e96ea21dddc28bf43
|
[
"Apache-2.0"
] | 1
|
2022-02-03T08:30:53.000Z
|
2022-02-03T08:30:53.000Z
|
def dataops():
print('doing data ops')
| 14.333333
| 27
| 0.627907
| 6
| 43
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.209302
| 43
| 2
| 28
| 21.5
| 0.794118
| 0
| 0
| 0
| 0
| 0
| 0.325581
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 6
|
d40c0bad03a56999b23c54f3b491a32e5393de51
| 196
|
py
|
Python
|
aggregationtools/__init__.py
|
alexandria-julius/plttools
|
0feb298e5f0d52c73b926bd127f32339bda4a62e
|
[
"MIT"
] | null | null | null |
aggregationtools/__init__.py
|
alexandria-julius/plttools
|
0feb298e5f0d52c73b926bd127f32339bda4a62e
|
[
"MIT"
] | null | null | null |
aggregationtools/__init__.py
|
alexandria-julius/plttools
|
0feb298e5f0d52c73b926bd127f32339bda4a62e
|
[
"MIT"
] | 2
|
2021-11-15T14:20:52.000Z
|
2022-01-07T06:27:48.000Z
|
""" PLT tools module imports to create a better module interface """
from aggregationtools.ep_curve import EPCurve, EPType
from aggregationtools.plt import PLT
from aggregationtools.elt import ELT
| 49
| 68
| 0.826531
| 27
| 196
| 5.962963
| 0.62963
| 0.372671
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122449
| 196
| 4
| 69
| 49
| 0.936047
| 0.306122
| 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
| 1
| 0
|
0
| 6
|
d443a92b3d66d3399c8c6a3006c5303d8c1121f2
| 2,512
|
py
|
Python
|
test/test_loader.py
|
miguelgf/flask-pypendency
|
44f1ab9ab65a4cc5951ba3ce9e3cf332ea44a23d
|
[
"MIT"
] | 4
|
2020-03-30T07:40:26.000Z
|
2020-05-24T12:30:07.000Z
|
test/test_loader.py
|
miguelgf/flask-pypendency
|
44f1ab9ab65a4cc5951ba3ce9e3cf332ea44a23d
|
[
"MIT"
] | null | null | null |
test/test_loader.py
|
miguelgf/flask-pypendency
|
44f1ab9ab65a4cc5951ba3ce9e3cf332ea44a23d
|
[
"MIT"
] | null | null | null |
import os
from unittest import TestCase
from unittest.mock import patch, call
from flask import Flask
from flask_pypendency import Pypendency
class TestLoader(TestCase):
def setUp(self) -> None:
self.test_folder = os.path.dirname(os.path.abspath(__file__))
@patch("flask_pypendency.YamlLoader")
@patch("flask_pypendency.PyLoader")
def test_loader_default_values(self, py_loader, yaml_loader):
app = Flask(__name__)
Pypendency(app)
py_loader.return_value.load_dir.assert_has_calls([
call(f"{self.test_folder}/resources/test_loader/autodiscover1/_dependency_injection"),
call(f"{self.test_folder}/resources/test_loader/autodiscover2/_dependency_injection"),
])
yaml_loader.return_value.load_dir.assert_has_calls([
call(f"{self.test_folder}/resources/test_loader/autodiscover1/_dependency_injection"),
call(f"{self.test_folder}/resources/test_loader/autodiscover2/_dependency_injection"),
])
@patch("flask_pypendency.YamlLoader")
@patch("flask_pypendency.PyLoader")
def test_loader_configured_di_folder(self, py_loader, yaml_loader):
"""
Specifying the folder's name loads different routes
"""
app = Flask(__name__)
app.config.from_mapping(
PYPENDENCY_DI_FOLDER_NAME="_di_folder1",
)
Pypendency(app)
py_loader.return_value.load_dir.assert_has_calls([
call(f"{self.test_folder}/resources/test_loader/autodiscover1/_di_folder1"),
])
yaml_loader.return_value.load_dir.assert_has_calls([
call(f"{self.test_folder}/resources/test_loader/autodiscover1/_di_folder1"),
])
@patch("flask_pypendency.YamlLoader")
@patch("flask_pypendency.PyLoader")
def test_loader_configured_di_discover_paths(self, py_loader, yaml_loader):
"""
Specifying the folder's name loads different routes
"""
app = Flask(__name__)
app.config.from_mapping(
PYPENDENCY_DISCOVER_PATHS=[f"{self.test_folder}/resources/test_loader/autodiscover2"]
)
Pypendency(app)
py_loader.return_value.load_dir.assert_has_calls([
call(f"{self.test_folder}/resources/test_loader/autodiscover2/_dependency_injection"),
])
yaml_loader.return_value.load_dir.assert_has_calls([
call(f"{self.test_folder}/resources/test_loader/autodiscover2/_dependency_injection"),
])
| 35.885714
| 98
| 0.693869
| 293
| 2,512
| 5.556314
| 0.194539
| 0.07371
| 0.085995
| 0.082924
| 0.827396
| 0.813882
| 0.813882
| 0.813882
| 0.785012
| 0.785012
| 0
| 0.005988
| 0.202229
| 2,512
| 69
| 99
| 36.405797
| 0.806387
| 0.041003
| 0
| 0.693878
| 0
| 0
| 0.342651
| 0.337992
| 0
| 0
| 0
| 0
| 0.122449
| 1
| 0.081633
| false
| 0
| 0.102041
| 0
| 0.204082
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
2e096b561d4731bab44bbf1d9a49e8a4523798e5
| 3,027
|
py
|
Python
|
tests/policies/discrete_random/test_discrete_random_policy.py
|
AGI-Labs/continual_rl
|
bcf17d879e8a983340be233ff8f740c424d0f303
|
[
"MIT"
] | 19
|
2021-07-27T05:20:09.000Z
|
2022-02-27T07:12:05.000Z
|
tests/policies/discrete_random/test_discrete_random_policy.py
|
AGI-Labs/continual_rl
|
bcf17d879e8a983340be233ff8f740c424d0f303
|
[
"MIT"
] | 2
|
2021-11-05T07:36:50.000Z
|
2022-03-11T00:21:50.000Z
|
tests/policies/discrete_random/test_discrete_random_policy.py
|
AGI-Labs/continual_rl
|
bcf17d879e8a983340be233ff8f740c424d0f303
|
[
"MIT"
] | 3
|
2021-10-20T06:04:35.000Z
|
2022-03-06T22:59:36.000Z
|
import os
from pathlib import Path
from continual_rl.experiments.experiment import Experiment
from continual_rl.experiments.tasks.image_task import ImageTask
from continual_rl.policies.discrete_random.discrete_random_policy_config import DiscreteRandomPolicyConfig
from continual_rl.policies.discrete_random.discrete_random_policy import DiscreteRandomPolicy
class TestDiscreteRandomPolicy(object):
def test_end_to_end_batch(self, set_tmp_directory, cleanup_experiment, request):
"""
Not a unit test - a full (very short) run with Discrete Random for a sanity check that it's working.
This is testing: DiscreteRandomPolicy, ImageTask
"""
# Arrange
experiment = Experiment(tasks=[
ImageTask(task_id="some_id", action_space_id=0,
env_spec='BreakoutDeterministic-v4',
num_timesteps=10, time_batch_size=4, eval_mode=False,
image_size=[84, 84], grayscale=True)
])
config = DiscreteRandomPolicyConfig()
config.num_parallel_envs = 2 # To make it batched
# Make a subfolder of the output directory that only this experiment is using, to avoid conflict
output_dir = Path(request.node.experiment_output_dir, "discrete_random_batch")
os.makedirs(output_dir)
experiment.set_output_dir(output_dir)
config.set_output_dir(output_dir)
policy = DiscreteRandomPolicy(config, experiment.observation_space, experiment.action_spaces)
# Act
experiment.try_run(policy, summary_writer=None)
# Assert
assert Path(policy._config.output_dir, "core_process.log").is_file(), "Log file not created"
def test_end_to_end_sync(self, set_tmp_directory, cleanup_experiment, request):
"""
Not a unit test - a full (very short) run with Discrete Random for a sanity check that it's working.
This is testing: DiscreteRandomPolicy, ImageTask
"""
# Arrange
experiment = Experiment(tasks=[
ImageTask(task_id="end_to_end_sync", action_space_id=0,
env_spec='BreakoutDeterministic-v4',
num_timesteps=10, time_batch_size=4, eval_mode=False,
image_size=[84, 84], grayscale=True)
])
config = DiscreteRandomPolicyConfig()
config.num_parallel_envs = None # To make it sync
# Make a subfolder of the output directory that only this experiment is using, to avoid conflict
output_dir = Path(request.node.experiment_output_dir, "discrete_random_sync")
os.makedirs(output_dir)
experiment.set_output_dir(output_dir)
config.set_output_dir(output_dir)
policy = DiscreteRandomPolicy(config, experiment.observation_space, experiment.action_spaces)
# Act
experiment.try_run(policy, summary_writer=None)
# Assert
assert Path(policy._config.output_dir, "core_process.log").is_file(), "Log file not created"
| 44.514706
| 108
| 0.693426
| 366
| 3,027
| 5.483607
| 0.284153
| 0.071749
| 0.029895
| 0.035874
| 0.849028
| 0.834081
| 0.834081
| 0.834081
| 0.834081
| 0.77728
| 0
| 0.008186
| 0.233234
| 3,027
| 67
| 109
| 45.179104
| 0.856527
| 0.185993
| 0
| 0.615385
| 0
| 0
| 0.076505
| 0.028846
| 0
| 0
| 0
| 0
| 0.051282
| 1
| 0.051282
| false
| 0
| 0.153846
| 0
| 0.230769
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
2e3ad4d7cf10b8564049ab45fe9d5fd486d4fd14
| 150
|
py
|
Python
|
my_utils/send_mail.py
|
Yookyiss/segmentfault
|
8fb7890c8b650ac34541a8fb14c3cd9bef98d120
|
[
"MIT"
] | null | null | null |
my_utils/send_mail.py
|
Yookyiss/segmentfault
|
8fb7890c8b650ac34541a8fb14c3cd9bef98d120
|
[
"MIT"
] | 12
|
2020-02-12T01:14:42.000Z
|
2022-03-11T23:54:43.000Z
|
my_utils/send_mail.py
|
Yookyiss/segmentfault
|
8fb7890c8b650ac34541a8fb14c3cd9bef98d120
|
[
"MIT"
] | null | null | null |
# -*- coding:utf-8 -*-
# @Time : 2019/7/30 9:00 PM
# @Author : __wutonghe__
from django.core.mail import send_mail
def send_email():
pass
| 13.636364
| 38
| 0.626667
| 23
| 150
| 3.826087
| 0.913043
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094017
| 0.22
| 150
| 10
| 39
| 15
| 0.65812
| 0.486667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
cf0dd9eac4b7a622418f1535040a8fa0ae6f0b9d
| 50,168
|
py
|
Python
|
experiment_extra.py
|
Shihab-Shahriar/500-miles
|
49fc9c6d037521f454da4bc02cccd62117c0ac5f
|
[
"MIT"
] | null | null | null |
experiment_extra.py
|
Shihab-Shahriar/500-miles
|
49fc9c6d037521f454da4bc02cccd62117c0ac5f
|
[
"MIT"
] | null | null | null |
experiment_extra.py
|
Shihab-Shahriar/500-miles
|
49fc9c6d037521f454da4bc02cccd62117c0ac5f
|
[
"MIT"
] | 1
|
2018-10-03T21:17:27.000Z
|
2018-10-03T21:17:27.000Z
|
from __future__ import division, print_function
import pickle
import pdb
import os
import time
from sklearn.cross_validation import StratifiedKFold
from sklearn import svm
from sklearn import metrics
import gensim
import random
from learners import SK_SVM,SK_KNN,SK_LDA
from tuner import DE_Tune_ML
from model import PaperData
from utility import study
from results import results_process
import numpy as np
#import wget
import zipfile
from sklearn import neighbors
from sklearn.neighbors import KNeighborsClassifier
from sklearn import metrics
import threading
from threading import Barrier
import timeit
import multiprocessing
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.lda import LDA
from sklearn.decomposition import NMF, LatentDirichletAllocation
from sklearn.neighbors import NearestNeighbors
from sklearn.cluster import KMeans
from sklearn.cluster import AffinityPropagation
import collections
from multiprocessing import Queue
import pandas as pd
def tune_learner(learner, train_X, train_Y, tune_X, tune_Y, goal,
target_class=None):
"""
:param learner:
:param train_X:
:param train_Y:
:param tune_X:
:param tune_Y:
:param goal:
:param target_class:
:return:
"""
if not target_class:
target_class = goal
clf = learner(train_X, train_Y, tune_X, tune_Y, goal)
tuner = DE_Tune_ML(clf, clf.get_param(), goal, target_class)
return tuner.Tune()
def load_vec(d, data, use_pkl=False, file_name=None):
if use_pkl:
if os.path.isfile(file_name):
with open(file_name, "rb") as my_pickle:
return pickle.load(my_pickle)
else:
# print("call get_document_vec")
return d.get_document_vec(data, file_name)
def print_results(clfs):
file_name = time.strftime(os.path.sep.join([".", "results",
"%Y%m%d_%H:%M:%S.txt"]))
file_name = os.path.sep.join(["20171103.txt"])
content = ""
for each in clfs:
content += each.confusion
print(content)
with open(file_name, "w") as f:
f.write(content)
results_process.reports(file_name)
def get_acc(cm):
out = []
for i in range(4):
out.append(cm[i][i] / 400)
return out
@study
def run_tuning_SVM(word2vec_src, repeats=1,
fold=10,
tuning=True):
"""
:param word2vec_src:str, path of word2vec model
:param repeats:int, number of repeats
:param fold: int,number of folds
:param tuning: boolean, tuning or not.
:return: None
"""
print("# word2vec:", word2vec_src)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, file_name=False)
print(train_pd)
test_pd = load_vec(data, data.test_data, file_name=False)
learner = [SK_SVM][0]
goal = {0: "PD", 1: "PF", 2: "PREC", 3: "ACC", 4: "F", 5: "G", 6: "Macro_F",
7: "Micro_F"}[6]
print(goal)
F = {}
clfs = []
start = timeit.default_timer()
for i in range(repeats): # repeat n times here
kf = StratifiedKFold(train_pd.loc[:, "LinkTypeId"].values, fold,
shuffle=True)
for train_index, tune_index in kf:
print(train_pd)
print(train_index)
train_data = train_pd.ix[train_index]
print(train_data)
tune_data = train_pd.ix[tune_index]
train_X = train_data.loc[:, "Output"].values
train_Y = train_data.loc[:, "LinkTypeId"].values
tune_X = tune_data.loc[:, "Output"].values
tune_Y = tune_data.loc[:, "LinkTypeId"].values
test_X = test_pd.loc[:, "Output"].values
test_Y = test_pd.loc[:, "LinkTypeId"].values
params, evaluation = tune_learner(learner, train_X, train_Y, tune_X,
tune_Y, goal) if tuning else ({}, 0)
clf = learner(train_X, train_Y, test_X, test_Y, goal)
F = clf.learn(F, **params)
clfs.append(clf)
stop = timeit.default_timer()
print("Model training time: ", stop - start)
print_results(clfs)
@study
def run_tuning_KNN(word2vec_src, repeats=1,
fold=10,
tuning=True):
"""
:param word2vec_src:str, path of word2vec model
:param repeats:int, number of repeats
:param fold: int,number of folds
:param tuning: boolean, tuning or not.
:return: None
"""
print("# word2vec:", word2vec_src)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, file_name=False)
test_pd = load_vec(data, data.test_data, file_name=False)
learner = [SK_KNN][0]
goal = {0: "PD", 1: "PF", 2: "PREC", 3: "ACC", 4: "F", 5: "G", 6: "Macro_F",
7: "Micro_F"}[6]
F = {}
clfs = []
start = timeit.default_timer()
for i in range(repeats): # repeat n times here
kf = StratifiedKFold(train_pd.loc[:, "LinkTypeId"].values, fold,
shuffle=True)
for train_index, tune_index in kf:
train_data = train_pd.ix[train_index]
tune_data = train_pd.ix[tune_index]
train_X = train_data.loc[:, "Output"].values
train_Y = train_data.loc[:, "LinkTypeId"].values
tune_X = tune_data.loc[:, "Output"].values
tune_Y = tune_data.loc[:, "LinkTypeId"].values
test_X = test_pd.loc[:, "Output"].values
test_Y = test_pd.loc[:, "LinkTypeId"].values
params, evaluation = tune_learner(learner, train_X, train_Y, tune_X,
tune_Y, goal) if tuning else ({}, 0)
clf = learner(train_X, train_Y, test_X, test_Y, goal)
F = clf.learn(F, **params)
clfs.append(clf)
stop = timeit.default_timer()
print("Model training time: ", stop - start)
print_results(clfs)
@study
def run_tuning_LDA(word2vec_src, repeats=1,
fold=10,
tuning=True):
"""
:param word2vec_src:str, path of word2vec model
:param repeats:int, number of repeats
:param fold: int,number of folds
:param tuning: boolean, tuning or not.
:return: None
"""
print("# word2vec:", word2vec_src)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, file_name=False)
test_pd = load_vec(data, data.test_data, file_name=False)
learner = [SK_LDA][0]
goal = {0: "PD", 1: "PF", 2: "PREC", 3: "ACC", 4: "F", 5: "G", 6: "Macro_F",
7: "Micro_F"}[6]
F = {}
clfs = []
for i in range(repeats): # repeat n times here
kf = StratifiedKFold(train_pd.loc[:, "LinkTypeId"].values, fold,
shuffle=True)
for train_index, tune_index in kf:
print(train_index)
train_data = train_pd.ix[train_index]
print(train_data)
tune_data = train_pd.ix[tune_index]
train_X = train_data.loc[:, "Output"].values
train_Y = train_data.loc[:, "LinkTypeId"].values
tune_X = tune_data.loc[:, "Output"].values
tune_Y = tune_data.loc[:, "LinkTypeId"].values
test_X = test_pd.loc[:, "Output"].values
test_Y = test_pd.loc[:, "LinkTypeId"].values
params, evaluation = tune_learner(learner, train_X, train_Y, tune_X,
tune_Y, goal) if tuning else ({}, 0)
clf = learner(train_X, train_Y, test_X, test_Y, goal)
F = clf.learn(F, **params)
clfs.append(clf)
print_results(clfs)
@study
def run_SVM_baseline(word2vec_src):
"""
Run SVM+word embedding experiment !
This is the baseline method.
:return:None
"""
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
clf = svm.SVC(kernel="rbf", gamma=0.005)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
stop = timeit.default_timer()
predicted = clf.predict(test_X)
print(metrics.classification_report(test_Y, predicted,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(test_Y, predicted, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("Model training time: ", stop - start)
@study
def run_LDA(word2vec_src):
"""
Run LDA+word embedding experiment !
This is the baseline method.
:return:None
"""
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
clf = LDA(solver='lsqr', shrinkage='auto')
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
stop = timeit.default_timer()
predicted = clf.predict(test_X)
print(metrics.classification_report(test_Y, predicted,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(test_Y, predicted, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("Model training time: ", stop - start)
@study
def run_LinearDiscriminantAnalysis(word2vec_src):
"""
Run LinearDiscriminantAnalysis+word embedding experiment !
This is the baseline method.
:return:None
"""
# Create a subplot with 1 row and 2 columns
def select_n_components(var_ratio, goal_var: float) -> int:
# Set initial variance explained so far
total_variance = 0.0
# Set initial number of features
n_components = 0
# For the explained variance of each feature:
for explained_variance in var_ratio:
# Add the explained variance to the total
total_variance += explained_variance
# Add one to the number of components
n_components += 1
# If we reach our goal level of explained variance
if total_variance >= goal_var:
# End the loop
break
# Return the number of components
return n_components
print("# word2vec:", word2vec_src)
clf = LinearDiscriminantAnalysis(n_components=None)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
lda_var_ratios = clf.explained_variance_ratio_
n_com = select_n_components(lda_var_ratios, 0.99)
clf = LinearDiscriminantAnalysis(n_components=n_com)
clf.fit(train_X, train_Y)
stop = timeit.default_timer()
predicted = clf.predict(test_X)
print(metrics.classification_report(test_Y, predicted,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(test_Y, predicted, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("Model training time: ", stop - start)
@study
def run_KNN(word2vec_src):
"""
Run KNN+word embedding experiment !
This is the baseline method.
:return:None
"""
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
clf = neighbors.KNeighborsClassifier(n_neighbors = 5)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
stop = timeit.default_timer()
predicted = clf.predict(test_X)
print(metrics.classification_report(test_Y, predicted,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(test_Y, predicted, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("Model training time: ", stop - start)
@study
def run_RNN(word2vec_src):
"""
Run KNN+word embedding experiment !
This is the baseline method.
:return:None
"""
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
clf = neighbors.RadiusNeighborsClassifier(radius=5.0)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
stop = timeit.default_timer()
predicted = clf.predict(test_X)
print(metrics.classification_report(test_Y, predicted,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(test_Y, predicted, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("Model training time: ", stop - start)
@study
def run_SVM_KNN(word2vec_src):
"""
Run SVM->KNN+word embedding experiment !
This is the baseline method.
:return:None
"""
classX1 = []
classX2 = []
classX3 = []
classX4 = []
classY1 = []
classY2 = []
classY3 = []
classY4 = []
classTX1 = []
classTX2 = []
classTX3 = []
classTX4 = []
classTY1 = []
classTY2 = []
classTY3 = []
classTY4 = []
predicted_F = []
finalY = []
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
clf = svm.SVC(kernel="rbf", gamma=0.005)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
predicted = clf.predict(train_X)
# predicted = pd.DataFrame(predicted)
# train_X = pd.DataFrame(train_X)
# t = predicted.index[predicted.loc[1] == 1].tolist()
# print(predicted.axes)
# print(t)
for i in range(len(predicted)):
if predicted[i] == '1':
classX1.append(train_X[i])
classY1.append(train_Y[i])
elif predicted[i] == '2':
classX2.append(train_X[i])
classY2.append(train_Y[i])
elif predicted[i] == '3':
classX3.append(train_X[i])
classY3.append(train_Y[i])
elif predicted[i] == '4':
classX4.append(train_X[i])
classY4.append(train_Y[i])
clf2 = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf3 = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf4 = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf5 = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf2.fit(classX1,classY1)
clf3.fit(classX2,classY2)
clf4.fit(classX3,classY3)
clf5.fit(classX4,classY4)
stop = timeit.default_timer()
predicted0 = clf.predict(test_X)
for i in range(len(predicted0)):
if predicted0[i] == '1':
classTX1.append(test_X[i])
classTY1.append(test_Y[i])
elif predicted0[i] == '2':
classTX2.append(test_X[i])
classTY2.append(test_Y[i])
elif predicted0[i] == '3':
classTX3.append(test_X[i])
classTY3.append(test_Y[i])
elif predicted0[i] == '4':
classTX4.append(test_X[i])
classTY4.append(test_Y[i])
predicted1 = clf2.predict(classTX1)
predicted2 = clf3.predict(classTX2)
predicted3 = clf4.predict(classTX3)
predicted4 = clf5.predict(classTX4)
finalY = np.append(classTY1, classTY2)
finalY = np.append(finalY, classTY3)
finalY = np.append(finalY, classTY4)
predicted_F = np.append(predicted1, predicted2)
predicted_F = np.append(predicted_F, predicted3)
predicted_F = np.append(predicted_F, predicted4)
print("+++++++++++++++++++Original Predcition Result+++++++++++++++++++++++++")
print(metrics.classification_report(test_Y, predicted0,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(test_Y, predicted0, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("+++++++++++++++++++2nd Layer 1st Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY1, predicted1,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY1, predicted1, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 2nd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY2, predicted2,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY2, predicted2, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 3rd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY3, predicted3,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY3, predicted3, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 4th Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY4, predicted4,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY4, predicted4, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++combined result+++++++++++++++++++++++++")
print(metrics.classification_report(finalY, predicted_F,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(finalY, predicted_F, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("Model training time: ", stop - start)
@study
def run_SVM_KNN_thread(word2vec_src):
"""
Run SVM->KNN+word embedding experiment !
This is the baseline method.
:return:None
"""
classX1 = []
classX2 = []
classX3 = []
classX4 = []
classY1 = []
classY2 = []
classY3 = []
classY4 = []
classTX1 = []
classTX2 = []
classTX3 = []
classTX4 = []
classTY1 = []
classTY2 = []
classTY3 = []
classTY4 = []
TrainingSamplesX = []
TrainingSamplesY = []
models = []
predicted_F = []
finalY = []
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
clf = svm.SVC(kernel="rbf", gamma=0.005)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
start0 = timeit.default_timer()
clf.fit(train_X, train_Y)
stop0 = timeit.default_timer()
predicted = clf.predict(train_X)
for i in range(len(predicted)):
if predicted[i] == '1':
classX1.append(train_X[i])
classY1.append(train_Y[i])
elif predicted[i] == '2':
classX2.append(train_X[i])
classY2.append(train_Y[i])
elif predicted[i] == '3':
classX3.append(train_X[i])
classY3.append(train_Y[i])
elif predicted[i] == '4':
classX4.append(train_X[i])
classY4.append(train_Y[i])
TrainingSamplesX.append(classX1)
TrainingSamplesY.append(classY1)
TrainingSamplesX.append(classX2)
TrainingSamplesY.append(classY2)
TrainingSamplesX.append(classX3)
TrainingSamplesY.append(classY3)
TrainingSamplesX.append(classX4)
TrainingSamplesY.append(classY4)
clf2 = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf3 = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf4 = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf5 = neighbors.KNeighborsClassifier(n_neighbors = 5)
models.append(clf2)
models.append(clf3)
models.append(clf4)
models.append(clf5)
start1 = timeit.default_timer()
for i in range((len(TrainingSamplesX))):
t = threading.Thread(target= models[i].fit, args = [TrainingSamplesX[i],TrainingSamplesY[i]])
threads.append(t)
t.start()
stop1 = timeit.default_timer()
predicted0 = clf.predict(test_X)
for i in range(len(predicted0)):
if predicted0[i] == '1':
classTX1.append(test_X[i])
classTY1.append(test_Y[i])
elif predicted0[i] == '2':
classTX2.append(test_X[i])
classTY2.append(test_Y[i])
elif predicted0[i] == '3':
classTX3.append(test_X[i])
classTY3.append(test_Y[i])
elif predicted0[i] == '4':
classTX4.append(test_X[i])
classTY4.append(test_Y[i])
predicted1 = clf2.predict(classTX1)
predicted2 = clf3.predict(classTX2)
predicted3 = clf4.predict(classTX3)
predicted4 = clf5.predict(classTX4)
finalY = np.append(classTY1, classTY2)
finalY = np.append(finalY, classTY3)
finalY = np.append(finalY, classTY4)
predicted_F = np.append(predicted1, predicted2)
predicted_F = np.append(predicted_F, predicted3)
predicted_F = np.append(predicted_F, predicted4)
print("+++++++++++++++++++Original Predcition Result+++++++++++++++++++++++++")
print(metrics.classification_report(test_Y, predicted0,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(test_Y, predicted0, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("+++++++++++++++++++2nd Layer 1st Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY1, predicted1,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY1, predicted1, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 2nd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY2, predicted2,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY2, predicted2, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 3rd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY3, predicted3,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY3, predicted3, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 4th Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY4, predicted4,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY4, predicted4, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++combined result+++++++++++++++++++++++++")
print(metrics.classification_report(finalY, predicted_F,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(finalY, predicted_F, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("1st Model training time: ", (stop0 - start0))
print("layer 2 Models training time: ", (stop1 - start1))
print("Total Model training time: ", (stop1 - start0))
@study
def run_KNN_SVM(word2vec_src):
"""
Run KNN -> SVM+word embedding experiment !
This is the baseline method.
:return:None
"""
classX1 = []
classX2 = []
classX3 = []
classX4 = []
classY1 = []
classY2 = []
classY3 = []
classY4 = []
classTX1 = []
classTX2 = []
classTX3 = []
classTX4 = []
classTY1 = []
classTY2 = []
classTY3 = []
classTY4 = []
TrainingSamplesX = []
TrainingSamplesY = []
models = []
predicted_F = []
finalY = []
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
clf = neighbors.KNeighborsClassifier(n_neighbors = 5)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
#print("before train")
start0 = timeit.default_timer()
clf.fit(train_X, train_Y)
stop0 = timeit.default_timer()
predicted = clf.predict(train_X)
for i in range(len(predicted)):
if predicted[i] == '1':
classX1.append(train_X[i])
classY1.append(train_Y[i])
elif predicted[i] == '2':
classX2.append(train_X[i])
classY2.append(train_Y[i])
elif predicted[i] == '3':
classX3.append(train_X[i])
classY3.append(train_Y[i])
elif predicted[i] == '4':
classX4.append(train_X[i])
classY4.append(train_Y[i])
TrainingSamplesX.append(classX1)
TrainingSamplesY.append(classY1)
TrainingSamplesX.append(classX2)
TrainingSamplesY.append(classY2)
TrainingSamplesX.append(classX3)
TrainingSamplesY.append(classY3)
TrainingSamplesX.append(classX4)
TrainingSamplesY.append(classY4)
clf2 = svm.SVC(kernel="rbf", gamma=0.005)
clf3 = svm.SVC(kernel="rbf", gamma=0.005)
clf4 = svm.SVC(kernel="rbf", gamma=0.005)
clf5 = svm.SVC(kernel="rbf", gamma=0.005)
models.append(clf2)
models.append(clf3)
models.append(clf4)
models.append(clf5)
start1 = timeit.default_timer()
for i in range((len(TrainingSamplesX))):
t = threading.Thread(target= models[i].fit, args = [TrainingSamplesX[i],TrainingSamplesY[i]])
threads.append(t)
t.start()
stop1 = timeit.default_timer()
predicted0 = clf.predict(test_X)
for i in range(len(predicted0)):
if predicted0[i] == '1':
classTX1.append(test_X[i])
classTY1.append(test_Y[i])
elif predicted0[i] == '2':
classTX2.append(test_X[i])
classTY2.append(test_Y[i])
elif predicted0[i] == '3':
classTX3.append(test_X[i])
classTY3.append(test_Y[i])
elif predicted0[i] == '4':
classTX4.append(test_X[i])
classTY4.append(test_Y[i])
predicted1 = clf2.predict(classTX1)
predicted2 = clf3.predict(classTX2)
predicted3 = clf4.predict(classTX3)
predicted4 = clf5.predict(classTX4)
finalY = np.append(classTY1, classTY2)
finalY = np.append(finalY, classTY3)
finalY = np.append(finalY, classTY4)
predicted_F = np.append(predicted1, predicted2)
predicted_F = np.append(predicted_F, predicted3)
predicted_F = np.append(predicted_F, predicted4)
print("+++++++++++++++++++Original Predcition Result+++++++++++++++++++++++++")
print(metrics.classification_report(test_Y, predicted0,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(test_Y, predicted0, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("+++++++++++++++++++2nd Layer 1st Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY1, predicted1,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY1, predicted1, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 2nd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY2, predicted2,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY2, predicted2, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 3rd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY3, predicted3,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY3, predicted3, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 4th Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY4, predicted4,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY4, predicted4, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++combined result+++++++++++++++++++++++++")
print(metrics.classification_report(finalY, predicted_F,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(finalY, predicted_F, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("1st Model training time: ", (stop0 - start0))
print("layer 2 Models training time: ", (stop1 - start1))
print("Total Model training time: ", (stop1 - start0))
@study
def run_KNN_KNN(word2vec_src):
"""
Run KNN+word embedding experiment !
This is the baseline method.
:return:None
"""
classX1 = []
classX2 = []
classX3 = []
classX4 = []
classY1 = []
classY2 = []
classY3 = []
classY4 = []
classTX1 = []
classTX2 = []
classTX3 = []
classTX4 = []
classTY1 = []
classTY2 = []
classTY3 = []
classTY4 = []
TrainingSamplesX = []
TrainingSamplesY = []
models = []
predicted_F = []
finalY = []
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
#clf = svm.SVC(kernel="rbf", gamma=0.005)
clf = neighbors.KNeighborsClassifier(n_neighbors = 5)
#clf = KMeans(n_clusters=4, init='k-means++', max_iter=100, n_init=1)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
test_X = test_pd.loc[:, "Output"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
#print("before train")
start0 = timeit.default_timer()
clf.fit(train_X, train_Y)
stop0 = timeit.default_timer()
predicted = clf.predict(train_X)
for i in range(len(predicted)):
if predicted[i] == '1':
classX1.append(train_X[i])
classY1.append(train_Y[i])
elif predicted[i] == '2':
classX2.append(train_X[i])
classY2.append(train_Y[i])
elif predicted[i] == '3':
classX3.append(train_X[i])
classY3.append(train_Y[i])
elif predicted[i] == '4':
classX4.append(train_X[i])
classY4.append(train_Y[i])
#print(classX1)
TrainingSamplesX.append(classX1)
TrainingSamplesY.append(classY1)
TrainingSamplesX.append(classX2)
TrainingSamplesY.append(classY2)
TrainingSamplesX.append(classX3)
TrainingSamplesY.append(classY3)
TrainingSamplesX.append(classX4)
TrainingSamplesY.append(classY4)
clf2 = neighbors.KNeighborsClassifier(n_neighbors = 10)
clf3 = neighbors.KNeighborsClassifier(n_neighbors = 10)
clf4 = neighbors.KNeighborsClassifier(n_neighbors = 10)
clf5 = neighbors.KNeighborsClassifier(n_neighbors = 10)
models.append(clf2)
models.append(clf3)
models.append(clf4)
models.append(clf5)
start1 = timeit.default_timer()
for i in range((len(TrainingSamplesX))):
t = threading.Thread(target= models[i].fit, args = [TrainingSamplesX[i],TrainingSamplesY[i]])
threads.append(t)
t.start()
stop1 = timeit.default_timer()
predicted0 = clf.predict(test_X)
for i in range(len(predicted0)):
if predicted0[i] == '1':
classTX1.append(test_X[i])
classTY1.append(test_Y[i])
elif predicted0[i] == '2':
classTX2.append(test_X[i])
classTY2.append(test_Y[i])
elif predicted0[i] == '3':
classTX3.append(test_X[i])
classTY3.append(test_Y[i])
elif predicted0[i] == '4':
classTX4.append(test_X[i])
classTY4.append(test_Y[i])
predicted1 = clf2.predict(classTX1)
predicted2 = clf3.predict(classTX2)
predicted3 = clf4.predict(classTX3)
predicted4 = clf5.predict(classTX4)
finalY = np.append(classTY1, classTY2)
finalY = np.append(finalY, classTY3)
finalY = np.append(finalY, classTY4)
predicted_F = np.append(predicted1, predicted2)
predicted_F = np.append(predicted_F, predicted3)
predicted_F = np.append(predicted_F, predicted4)
print("+++++++++++++++++++Original Predcition Result+++++++++++++++++++++++++")
print(metrics.classification_report(test_Y, predicted0,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(test_Y, predicted0, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("+++++++++++++++++++2nd Layer 1st Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY1, predicted1,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY1, predicted1, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 2nd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY2, predicted2,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY2, predicted2, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 3rd Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY3, predicted3,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY3, predicted3, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++2nd Layer 4th Prediction Model+++++++++++++++++++++++++")
print(metrics.classification_report(classTY4, predicted4,
labels=["1", "2", "3", "4"],
digits=3))
#print("print classification data")
cm=metrics.confusion_matrix(classTY4, predicted4, labels=["1", "2", "3", "4"])
print("+++++++++++++++++++combined result+++++++++++++++++++++++++")
print(metrics.classification_report(finalY, predicted_F,
labels=["1", "2", "3", "4"],
digits=3))
cm=metrics.confusion_matrix(finalY, predicted_F, labels=["1", "2", "3", "4"])
print("accuracy ", get_acc(cm))
print("1st Model training time: ", (stop0 - start0))
print("layer 2 Models training time: ", (stop1 - start1))
print("Total Model training time: ", (stop1 - start0))
@study
def run_KMeans_Wpair(word2vec_src):
"""
Run KMeans+word embedding experiment !
This is the baseline method.
:return:None
"""
# Create a subplot with 1 row and 2 columns
print("# word2vec:", word2vec_src)
#clf = svm.SVC(kernel="rbf", gamma=0.005)
#clf = neighbors.KNeighborsClassifier(n_neighbors = 5)
clf = KMeans(n_clusters=4, init='k-means++', max_iter=100, n_init=1)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "PostIdVec"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
train_X1 = train_pd.loc[:, "RelatedPostIdVec"].tolist()
train_Y1 = train_pd.loc[:, "LinkTypeId"].tolist()
np.append(train_X,train_X1)
np.append(train_Y,train_Y1)
test_X = test_pd.loc[:, "PostIdVec"].tolist()
test_Y = test_pd.loc[:, "LinkTypeId"].tolist()
clf.fit(train_X, train_Y)
predicted = clf.predict(test_X)
print(predicted)
x = list(np.asarray(clf.labels_) + 1)
print("Homogeneity: %0.3f" % metrics.homogeneity_score(train_Y, x))
print("Completeness: %0.3f" % metrics.completeness_score(train_Y, clf.labels_))
print("V-measure: %0.3f" % metrics.v_measure_score(train_Y, clf.labels_))
print("Adjusted Rand-Index: %.3f"
% metrics.adjusted_rand_score(train_Y, clf.labels_))
print("Silhouette Coefficient: %0.3f"
% metrics.silhouette_score(train_X, clf.labels_, sample_size=1000))
#################Katie's Code +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# returns the svm model
def run_SVM(word2vec_src, train_pd, queue):
clf = svm.SVC(kernel="rbf", gamma=0.005)
# word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
# data = PaperData(word2vec=word2vec_model)
# print("Train data: " + str(train_pd.shape))
# if train_pd is None: train_pd = load_vec(
# data, data.train_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
stop = timeit.default_timer()
print("SVM Model Train Time", (stop-start))
queue.put(clf)
return clf
def run_KNN_clustering(word2vec_src, train_pd, queue):
print("# word2vec:", word2vec_src)
clf = neighbors.KNeighborsClassifier(n_neighbors = 10)
# word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
# data = PaperData(word2vec=word2vec_model)
# print("Train data: " + str(train_pd.shape))
# if train_pd is None: train_pd = load_vec(
# data, data.train_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
train_Y = train_pd.loc[:, "LinkTypeId"].tolist()
start = timeit.default_timer()
clf.fit(train_X, train_Y)
stop = timeit.default_timer()
print("SVM Model Train Time", (stop-start))
queue.put(clf)
return clf
@study
def run_tuning_SVM_C(word2vec_src,train_pd_c,queue, repeats=1,
fold=10,
tuning=True):
"""
:param word2vec_src:str, path of word2vec model
:param repeats:int, number of repeats
:param fold: int,number of folds
:param tuning: boolean, tuning or not.
:return: None
"""
print("# word2vec:", word2vec_src)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd_c = train_pd_c.reset_index()
train_pd = train_pd_c
test_pd = load_vec(data, data.test_data, file_name=False)
learner = [SK_SVM][0]
goal = {0: "PD", 1: "PF", 2: "PREC", 3: "ACC", 4: "F", 5: "G", 6: "Macro_F",
7: "Micro_F"}[6]
print(goal)
F = {}
clfs = []
for i in range(repeats): # repeat n times here
kf = StratifiedKFold(train_pd.loc[:, "LinkTypeId"].values, fold,
shuffle=True)
for train_index, tune_index in kf:
print(train_pd)
train_data = train_pd.ix[train_index]
print(train_index)
print(train_data)
tune_data = train_pd.ix[tune_index]
train_X = train_data.loc[:, "Output"].values
print(train_X)
train_Y = train_data.loc[:, "LinkTypeId"].values
print(train_Y)
tune_X = tune_data.loc[:, "Output"].values
tune_Y = tune_data.loc[:, "LinkTypeId"].values
test_X = test_pd.loc[:, "Output"].values
test_Y = test_pd.loc[:, "LinkTypeId"].values
params, evaluation = tune_learner(learner, train_X, train_Y, tune_X,
tune_Y, goal) if tuning else ({}, 0)
clf = learner(train_X, train_Y, test_X, test_Y, goal)
F = clf.learn(F, **params)
clfs.append(clf)
queue.put(clfs)
print_results(clfs)
# parses and returns a given svm in the format of dictionary -
# [class](precision, recall, f1score, support)
def results_SVM(clf, test_X, test_Y):
predicted = clf.predict(test_X)
# labels: ["Duplicates", "DirectLink","IndirectLink", "Isolated"]
report_gen = metrics.classification_report(
test_Y, predicted, labels=["1", "2", "3", "4"], digits=3)
parsed_report = parse_classification_report(report_gen)
return parsed_report
#cm=metrics.confusion_matrix(test_Y, predicted, labels=["1", "2", "3", "4"])
#print("accuracy ", get_acc(cm)
def total_summary(result_set, num_rows, start0,start1,stop0,stop1):
weightedAvgs = [0, 0, 0]
for l in result_set:
avg_list = l['avg']
for i in range(3):
support_count = avg_list[3]
weightedAvgs[i] += (avg_list[i] * support_count)/num_rows
result = {}
result['precision'] = weightedAvgs[0]
result['recall'] = weightedAvgs[1]
result['f1'] = weightedAvgs[2]
print(result)
print("1st Model training time: ", (stop0 - start0))
print("layer 2 Models training time: ", (stop1 - start1))
print("Total Model training time: ", (stop1 - start0))
def run_kmeans(word2vec_src):
print("# word2vec:", word2vec_src)
word2vec_model = gensim.models.Word2Vec.load(word2vec_src)
data = PaperData(word2vec=word2vec_model)
train_pd = load_vec(data, data.train_data, use_pkl=False)
test_pd = load_vec(data, data.test_data, use_pkl=False)
train_X = train_pd.loc[:, "Output"].tolist()
queue = Queue()
numClusters = optimalK(train_X)
#numClusters = 5
print("Found optimal k: " + str(numClusters))
clf = KMeans(n_clusters=numClusters,
init='k-means++', max_iter=200, n_init=1)
start0 = timeit.default_timer()
clf.fit(train_X)
stop0 = timeit.default_timer()
svm_models = [] # maintain a list of svms
s1 = timeit.default_timer()
data.train_data['clabel'] = clf.labels_
s2 = timeit.default_timer()
print("Inter - ", (s2-s1))
start1 = timeit.default_timer()
#b = Barrier(numClusters-1)
for l in range(numClusters):
cluster = data.train_data.loc[data.train_data['clabel'] == l]
t = threading.Thread(target=run_tuning_SVM_C, args = [word2vec_src,cluster,queue])
threads.append(t)
t.start()
response = queue.get()
svm_models.append(response)
#b.wait()
t.join()
stop1 = timeit.default_timer()
svm_results = [] # maintain a list of svm results
test_X = test_pd.loc[:, "Output"].tolist()
predicted = clf.predict(test_X)
data.test_data['clabel'] = predicted
for l in range(numClusters):
#print("Label " + str(l))
cluster = data.test_data.loc[data.test_data['clabel'] == l]
svm_model = svm_models[l]
cluster_X = cluster.loc[:, "Output"].tolist()
cluster_Y = cluster.loc[:, "LinkTypeId"].tolist()
svm_results.append(results_SVM(svm_model, cluster_X, cluster_Y))# store all the SVM result report in a dictionary
# call the helper method to summarize the svm results
total_summary(svm_results, test_pd.shape[0],start0,start1,stop0,stop1)
# Source: https://anaconda.org/milesgranger/gap-statistic/notebook
def optimalK(data, nrefs=3, maxClusters=15):
"""
Calculates KMeans optimal K using Gap Statistic from Tibshirani, Walther, Hastie
Params:
data: ndarry of shape (n_samples, n_features)
nrefs: number of sample reference datasets to create
maxClusters: Maximum number of clusters to test for
Returns: (gaps, optimalK)
"""
gaps = np.zeros((len(range(1, maxClusters)),))
resultsdf = pd.DataFrame({'clusterCount': [], 'gap': []})
for gap_index, k in enumerate(range(1, maxClusters)):
# Holder for reference dispersion results
refDisps = np.zeros(nrefs)
# For n references, generate random sample and perform kmeans getting resulting dispersion of each loop
for i in range(nrefs):
# Create new random reference set
# randomReference = np.random.random_sample(size=data.shape)
# Fit to it
km = KMeans(n_clusters=k, init='k-means++', max_iter=200, n_init=1)
km.fit(data)
refDisp = km.inertia_
refDisps[i] = refDisp
# Fit cluster to original data and create dispersion
km = KMeans(k)
km.fit(data)
origDisp = km.inertia_
# print(str(i+1) + ": " + str(origDisp))
# Calculate gap statistic
gap = np.log(np.mean(refDisps)) - np.log(origDisp)
# Assign this loop's gap statistic to gaps
gaps[gap_index] = gap
resultsdf = resultsdf.append(
{'clusterCount': k, 'gap': gap}, ignore_index=True)
# return (gaps.argmax() + 1, resultsdf) # Plus 1 because index of 0 means 1 cluster is optimal, index 2 = 3 clusters are optimal
return gaps.argmax()
# Not used, but wanted to put this code somewhere
def results_kmeans(clf, train_X, train_Y, test_X, test_Y):
predicted = clf.predict(test_X)
print("Homogeneity: %0.3f" % metrics.homogeneity_score(train_Y, clf.labels_))
print("Completeness: %0.3f" %
metrics.completeness_score(train_Y, clf.labels_))
print("V-measure: %0.3f" % metrics.v_measure_score(train_Y, clf.labels_))
print("Adjusted Rand-Index: %.3f"
% metrics.adjusted_rand_score(train_Y, clf.labels_))
print("Silhouette Coefficient: %0.3f"
% metrics.silhouette_score(train_X, clf.labels_, sample_size=1000))
"""
Parse a sklearn classification report into a dict keyed by class name
and containing a tuple (precision, recall, fscore, support) for each class
Reference: https://gist.github.com/julienr/6b9b9a03bd8224db7b4f
"""
def parse_classification_report(clfreport):
lines = clfreport.split('\n')
# Remove empty lines
lines = list(filter(lambda l: not len(l.strip()) == 0, lines))
# Starts with a header, then score for each class and finally an average
header = lines[0]
cls_lines = lines[1:-1]
avg_line = lines[-1]
assert header.split() == ['precision', 'recall', 'f1-score', 'support']
assert avg_line.split()[0] == 'avg'
# class names can have spaces - figure the width of the class field
# using indentation of the precision header
cls_field_width = len(header) - len(header.lstrip())
# Now, collect all the class names and score in a dict
def parse_line(l):
"""Parse a line of classification_report"""
cls_name = l[:cls_field_width].strip()
precision, recall, fscore, support = l[cls_field_width:].split()
precision = float(precision)
recall = float(recall)
fscore = float(fscore)
support = int(support)
return (cls_name, precision, recall, fscore, support)
data = collections.OrderedDict()
for l in cls_lines:
ret = parse_line(l)
cls_name = ret[0]
scores = ret[1:]
data[cls_name] = scores
data['avg'] = parse_line(avg_line)[1:] # average
return data
#################Katie's Code +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def prepare_word2vec():
print("Downloading pretrained word2vec models")
url = "https://zenodo.org/record/807727/files/word2vecs_models.zip"
file_name = wget.download(url)
with zipfile.ZipFile(file_name, "r") as zip_ref:
zip_ref.extractall()
if __name__ == "__main__":
word_src = "word2vecs_models"
threads = []
if not os.path.exists(word_src):
prepare_word2vec()
elif len(os.listdir(word_src)) == 0:
os.rmdir(word_src)
prepare_word2vec()
for x in range(1):
random.seed(x)
np.random.seed(x)
myword2vecs = [os.path.join(word_src, i) for i in os.listdir(word_src)
if "syn" not in i]
# t = threading.Thread(target=run_tuning_SVM_KNN, args = [myword2vecs[x]])
# threads.append(t)
# t.start()
run_SVM_baseline(myword2vecs[x])
#run_SVM_KNN_thread(myword2vecs[x])
#run_LinearDiscriminantAnalysis(myword2vecs[x])
#run_KNN(myword2vecs[x])
#run_SVM_KNN(myword2vecs[x])
#run_KMeans_Wpair(myword2vecs[x])
#run_kmeans(myword2vecs[x])
#run_KNN_SVM(myword2vecs[x])
#run_KNN_KNN(myword2vecs[x])
#Srun_LDA(myword2vecs[x])
#run_RNN(myword2vecs[x])
#print("Run completed for baseline model--------------------------------------------------")
#run_tuning_SVM(myword2vecs[x])
#run_tuning_LDA(myword2vecs[x])
#run_tuning_KNN(myword2vecs[x])
#print("Run completed for DE model--------------------------------------------------")
| 38.296183
| 131
| 0.62514
| 6,349
| 50,168
| 4.77335
| 0.074815
| 0.013859
| 0.015838
| 0.017818
| 0.771167
| 0.754207
| 0.750808
| 0.742163
| 0.738138
| 0.725896
| 0
| 0.030163
| 0.212287
| 50,168
| 1,310
| 132
| 38.296183
| 0.736728
| 0.131917
| 0
| 0.777126
| 0
| 0
| 0.096464
| 0.030205
| 0
| 0
| 0
| 0
| 0.001955
| 1
| 0.028348
| false
| 0
| 0.032258
| 0
| 0.071359
| 0.135875
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 6
|
cf3ffee88a76c631b85e7a5469a248333708be1a
| 34
|
py
|
Python
|
src/superfit/mainwindow/__init__.py
|
awacha/superfit
|
a95d346c4b38f61173c7434eb7389e2cf1ccae9c
|
[
"BSD-3-Clause"
] | null | null | null |
src/superfit/mainwindow/__init__.py
|
awacha/superfit
|
a95d346c4b38f61173c7434eb7389e2cf1ccae9c
|
[
"BSD-3-Clause"
] | null | null | null |
src/superfit/mainwindow/__init__.py
|
awacha/superfit
|
a95d346c4b38f61173c7434eb7389e2cf1ccae9c
|
[
"BSD-3-Clause"
] | null | null | null |
from .mainwindow import MainWindow
| 34
| 34
| 0.882353
| 4
| 34
| 7.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088235
| 34
| 1
| 34
| 34
| 0.967742
| 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
| 1
| 0
|
0
| 6
|
cf44da1421ffcad816c602ccc4edb40367643818
| 199
|
py
|
Python
|
prof_school/__init__.py
|
mohamedmelsayed/erp-school
|
6da9bc4c4634e3b362be18f55300aacf147c32a3
|
[
"MIT"
] | null | null | null |
prof_school/__init__.py
|
mohamedmelsayed/erp-school
|
6da9bc4c4634e3b362be18f55300aacf147c32a3
|
[
"MIT"
] | null | null | null |
prof_school/__init__.py
|
mohamedmelsayed/erp-school
|
6da9bc4c4634e3b362be18f55300aacf147c32a3
|
[
"MIT"
] | null | null | null |
from .models import stage
from .models import level
from .models import class_name
from .models import student
from .models import parent
from .models import study_year
from .models import enrollment
| 28.428571
| 30
| 0.829146
| 30
| 199
| 5.433333
| 0.4
| 0.429448
| 0.687117
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135678
| 199
| 7
| 31
| 28.428571
| 0.947674
| 0
| 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
| 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
| 6
|
cf68743af20103a597b92c1707121c418cb28844
| 34
|
py
|
Python
|
myscript.py
|
kRituraj/learnGIt
|
dad92da290d1aab0713d99af722e86140507e9ab
|
[
"MIT"
] | null | null | null |
myscript.py
|
kRituraj/learnGIt
|
dad92da290d1aab0713d99af722e86140507e9ab
|
[
"MIT"
] | null | null | null |
myscript.py
|
kRituraj/learnGIt
|
dad92da290d1aab0713d99af722e86140507e9ab
|
[
"MIT"
] | null | null | null |
print("My name is Rituraj Khare")
| 17
| 33
| 0.735294
| 6
| 34
| 4.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 34
| 1
| 34
| 34
| 0.862069
| 0
| 0
| 0
| 0
| 0
| 0.705882
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 6
|
cf7897f04a99a685cf752ce25bde96a1bd963ec7
| 183
|
py
|
Python
|
dist/micropy-cli/frozen/uasyncio/funcs.py
|
kevindawson/Pico-Stub
|
6f9112779d4d81f821a3af273a450b9329ccdbab
|
[
"Apache-2.0"
] | 19
|
2021-01-25T23:56:09.000Z
|
2022-02-21T13:55:16.000Z
|
dist/micropy-cli/frozen/uasyncio/funcs.py
|
kevindawson/Pico-Stub
|
6f9112779d4d81f821a3af273a450b9329ccdbab
|
[
"Apache-2.0"
] | 18
|
2021-02-06T09:03:09.000Z
|
2021-10-04T16:36:35.000Z
|
dist/micropy-cli/frozen/uasyncio/funcs.py
|
kevindawson/Pico-Stub
|
6f9112779d4d81f821a3af273a450b9329ccdbab
|
[
"Apache-2.0"
] | 6
|
2021-01-26T08:41:47.000Z
|
2021-04-27T11:33:33.000Z
|
from typing import Any
def wait_for_ms(aw: Any, timeout: int) -> Any: ...
# 0: return wait_for(aw,timeout,core.sleep_ms)
# ? 0: return wait_for(aw, timeout, core.sleep_ms)
| 30.5
| 54
| 0.672131
| 31
| 183
| 3.774194
| 0.483871
| 0.179487
| 0.188034
| 0.239316
| 0.581197
| 0.581197
| 0.581197
| 0.581197
| 0.581197
| 0
| 0
| 0.013423
| 0.185792
| 183
| 5
| 55
| 36.6
| 0.771812
| 0.508197
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0.5
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
d8d46c16be9da8396527eb259a0965644da2d48d
| 37
|
py
|
Python
|
veintitres/__init__.py
|
joelalejandro/veintitres-python
|
18fa7aa66688cce3f2c42ebc96ddb780bcd6d4bf
|
[
"MIT"
] | null | null | null |
veintitres/__init__.py
|
joelalejandro/veintitres-python
|
18fa7aa66688cce3f2c42ebc96ddb780bcd6d4bf
|
[
"MIT"
] | null | null | null |
veintitres/__init__.py
|
joelalejandro/veintitres-python
|
18fa7aa66688cce3f2c42ebc96ddb780bcd6d4bf
|
[
"MIT"
] | null | null | null |
from .client import VeintitresClient
| 18.5
| 36
| 0.864865
| 4
| 37
| 8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 37
| 1
| 37
| 37
| 0.969697
| 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
| 1
| 0
|
0
| 6
|
d8e1c9d0e3a88657f33d1a06132b17c2fdbfdca9
| 40
|
py
|
Python
|
cs-224n/assn2/utils/__init__.py
|
PranjalGupta2199/nlp-dl
|
7e2290c82602cb2ff863f2513c54dfb0412affd0
|
[
"MIT"
] | null | null | null |
cs-224n/assn2/utils/__init__.py
|
PranjalGupta2199/nlp-dl
|
7e2290c82602cb2ff863f2513c54dfb0412affd0
|
[
"MIT"
] | null | null | null |
cs-224n/assn2/utils/__init__.py
|
PranjalGupta2199/nlp-dl
|
7e2290c82602cb2ff863f2513c54dfb0412affd0
|
[
"MIT"
] | null | null | null |
from . import gradcheck, treebank, utils
| 40
| 40
| 0.8
| 5
| 40
| 6.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 40
| 1
| 40
| 40
| 0.914286
| 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
| 1
| 0
|
0
| 6
|
d8fbe81e9f1a510748c80f8dc8a1b42b637b2f92
| 207
|
py
|
Python
|
kartverket_tide_api/exceptions/__init__.py
|
matsjp/kartverket_tide_api
|
b4be15e9c8f077ef6ec0747fe67f0a64383cfa30
|
[
"MIT"
] | null | null | null |
kartverket_tide_api/exceptions/__init__.py
|
matsjp/kartverket_tide_api
|
b4be15e9c8f077ef6ec0747fe67f0a64383cfa30
|
[
"MIT"
] | null | null | null |
kartverket_tide_api/exceptions/__init__.py
|
matsjp/kartverket_tide_api
|
b4be15e9c8f077ef6ec0747fe67f0a64383cfa30
|
[
"MIT"
] | null | null | null |
from .apierrorexception import NoTideDataErrorException, UnknownApiErrorException,\
ApiErrorException, InvalidStationTypeErrorException
from .cannotfindelementexception import CannotFindElementException
| 51.75
| 83
| 0.898551
| 11
| 207
| 16.909091
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072464
| 207
| 3
| 84
| 69
| 0.96875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 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
| 1
| 0
|
0
| 6
|
2b1231e92f21f35984d0911fe8b686f6f0ee27b3
| 4,272
|
py
|
Python
|
python/tests/wind_settings_test.py
|
anth-dj/geog5003m_project
|
51caa4255a04cc7043dde9ff94e654c41fc1620c
|
[
"MIT"
] | null | null | null |
python/tests/wind_settings_test.py
|
anth-dj/geog5003m_project
|
51caa4255a04cc7043dde9ff94e654c41fc1620c
|
[
"MIT"
] | null | null | null |
python/tests/wind_settings_test.py
|
anth-dj/geog5003m_project
|
51caa4255a04cc7043dde9ff94e654c41fc1620c
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Wind Settings unit tests
@author: Anthony Jarrett
"""
import unittest
from python.src.simulation import particleframework
class WindSettingsTestCase(unittest.TestCase):
def test_init(self):
# Initialize parameters
north_percentage = 5
east_percentage = 10
south_percentage = 20
west_percentage = 65
# Create wind settings
wind_settings = particleframework.WindSettings(
north_percentage,
east_percentage,
south_percentage,
west_percentage
)
# Verify the wind settings
self.assertIsNotNone(wind_settings)
self.assertEqual(wind_settings.north_percentage, north_percentage)
self.assertEqual(wind_settings.east_percentage, east_percentage)
self.assertEqual(wind_settings.south_percentage, south_percentage)
self.assertEqual(wind_settings.west_percentage, west_percentage)
def test_sum_too_large(self):
# Initialize parameters
north_percentage = 5
east_percentage = 10
south_percentage = 20
west_percentage = 75
try:
# Create wind settings
particleframework.WindSettings(
north_percentage,
east_percentage,
south_percentage,
west_percentage
)
self.fail()
except Exception as e:
self.assertIsNotNone(e)
def test_sum_too_small(self):
# Initialize parameters
north_percentage = 5
east_percentage = 10
south_percentage = 20
west_percentage = 15
try:
# Create wind settings
particleframework.WindSettings(
north_percentage,
east_percentage,
south_percentage,
west_percentage
)
self.fail()
except Exception as e:
self.assertIsNotNone(e)
def test_get_next_north(self):
# Initialize parameters
north_percentage = 100
east_percentage = 0
south_percentage = 0
west_percentage = 0
# Create wind settings
wind_settings = particleframework.WindSettings(
north_percentage,
east_percentage,
south_percentage,
west_percentage
)
# Verify the next direction
next_direction = wind_settings.get_next()
self.assertEqual(next_direction, particleframework.Direction.NORTH)
def test_get_next_east(self):
# Initialize parameters
north_percentage = 0
east_percentage = 100
south_percentage = 0
west_percentage = 0
# Create wind settings
wind_settings = particleframework.WindSettings(
north_percentage,
east_percentage,
south_percentage,
west_percentage
)
# Verify the next direction
next_direction = wind_settings.get_next()
self.assertEqual(next_direction, particleframework.Direction.EAST)
def test_get_next_south(self):
# Initialize parameters
north_percentage = 0
east_percentage = 0
south_percentage = 100
west_percentage = 0
# Create wind settings
wind_settings = particleframework.WindSettings(
north_percentage,
east_percentage,
south_percentage,
west_percentage
)
# Verify the next direction
next_direction = wind_settings.get_next()
self.assertEqual(next_direction, particleframework.Direction.SOUTH)
def test_get_next_west(self):
# Initialize parameters
north_percentage = 0
east_percentage = 0
south_percentage = 0
west_percentage = 100
# Create wind settings
wind_settings = particleframework.WindSettings(
north_percentage,
east_percentage,
south_percentage,
west_percentage
)
# Verify the next direction
next_direction = wind_settings.get_next()
self.assertEqual(next_direction, particleframework.Direction.WEST)
| 27.037975
| 75
| 0.617041
| 393
| 4,272
| 6.430025
| 0.157761
| 0.10922
| 0.075979
| 0.080332
| 0.815196
| 0.755837
| 0.755837
| 0.755837
| 0.722596
| 0.722596
| 0
| 0.016445
| 0.330993
| 4,272
| 157
| 76
| 27.210191
| 0.86774
| 0.122659
| 0
| 0.673267
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108911
| 1
| 0.069307
| false
| 0
| 0.019802
| 0
| 0.09901
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
2b4a876ac0b876943151201b66e9e6e75e65f68a
| 4,953
|
py
|
Python
|
tests/features/test_decryption.py
|
ratschlab/tools-project-archives
|
a42ef1d3d60b24ff39ce5aa73a8fb332b4f25056
|
[
"MIT"
] | 1
|
2021-12-02T15:13:47.000Z
|
2021-12-02T15:13:47.000Z
|
tests/features/test_decryption.py
|
ratschlab/tools-project-archives
|
a42ef1d3d60b24ff39ce5aa73a8fb332b4f25056
|
[
"MIT"
] | null | null | null |
tests/features/test_decryption.py
|
ratschlab/tools-project-archives
|
a42ef1d3d60b24ff39ce5aa73a8fb332b4f25056
|
[
"MIT"
] | null | null | null |
import os
import shutil
import re
import pytest
from archiver.extract import decrypt_existing_archive
from archiver.helpers import get_absolute_path_string
from .archiving_helpers import assert_successful_archive_creation, assert_successful_action_to_destination, add_prefix_to_list_elements, compare_listing_files, valid_md5_hash_in_file, compare_text_file_ignoring_order, compare_hash_files
from tests import helpers
ENCRYPTION_PUBLIC_KEY_A = "public.gpg"
ENCRYPTION_PUBLIC_KEY_B = "public_second.pub"
def test_decrypt_regular_archive(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="all", unencrypted="all")
def test_decrypt_regular_archive_remove_unencrypted(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path, remove_unencrypted=True)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="hash", unencrypted="all")
def test_decrypt_regular_archive_to_destination(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
destination_path = tmp_path / folder_name
decrypt_existing_archive(archive_path, destination_path)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False)
def test_decrypt_regular_archive_error_existing(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
destination_path = tmp_path / folder_name
destination_path.mkdir()
with pytest.raises(SystemExit) as error:
decrypt_existing_archive(archive_path, destination_path)
assert error.type == SystemExit
def test_decrypt_regular_archive_force_override_existing(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
destination_path = tmp_path / folder_name
destination_path.mkdir()
decrypt_existing_archive(archive_path, destination_path, force=True)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False)
def test_decrypt_regular_file(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
copied_archive_path = tmp_path / folder_name
archive_file = copied_archive_path / f"{folder_name}.tar.lz.gpg"
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(archive_file)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="all", unencrypted="all")
def test_decrypt_regular_file_to_destination(tmp_path, setup_gpg):
folder_name = "test-folder"
archive_path = helpers.get_directory_with_name("encrypted-archive")
archive_file = archive_path / f"{folder_name}.tar.lz.gpg"
destination_path = tmp_path / folder_name
decrypt_existing_archive(archive_file, destination_path)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False)
def test_decrypt_archive_split(tmp_path, setup_gpg):
folder_name = "large-folder"
archive_path = helpers.get_directory_with_name("split-encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="all", unencrypted="all", split=3)
def test_decrypt_archive_split_remove_unencrypted(tmp_path, setup_gpg):
folder_name = "large-folder"
archive_path = helpers.get_directory_with_name("split-encrypted-archive")
copied_archive_path = tmp_path / folder_name
shutil.copytree(archive_path, copied_archive_path)
decrypt_existing_archive(copied_archive_path, remove_unencrypted=True)
assert_successful_archive_creation(copied_archive_path, archive_path, folder_name, encrypted="hash", unencrypted="all", split=3)
def test_decrypt_archive_split_to_destination(tmp_path):
folder_name = "large-folder"
archive_path = helpers.get_directory_with_name("split-encrypted-archive")
destination_path = tmp_path / folder_name
decrypt_existing_archive(archive_path, destination_path)
assert_successful_action_to_destination(destination_path, archive_path, folder_name, encrypted=False, split=3)
| 43.447368
| 236
| 0.816475
| 652
| 4,953
| 5.722393
| 0.119632
| 0.144465
| 0.091128
| 0.050121
| 0.862503
| 0.826856
| 0.826856
| 0.80461
| 0.764942
| 0.747789
| 0
| 0.000908
| 0.11064
| 4,953
| 113
| 237
| 43.831858
| 0.846084
| 0
| 0
| 0.6125
| 0
| 0
| 0.082374
| 0.023622
| 0
| 0
| 0
| 0
| 0.1375
| 1
| 0.125
| false
| 0
| 0.1
| 0
| 0.225
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
992d31ef563a84f77f44d14348541fc61f975cc8
| 11,799
|
py
|
Python
|
tests/test_extractors/body/test_form_fields_extractor.py
|
dantownsend/xpresso
|
a4c4dbe96972a6f0339f30d7d794932f70510eea
|
[
"MIT"
] | 4
|
2022-02-07T05:12:51.000Z
|
2022-02-28T12:34:57.000Z
|
tests/test_extractors/body/test_form_fields_extractor.py
|
dantownsend/xpresso
|
a4c4dbe96972a6f0339f30d7d794932f70510eea
|
[
"MIT"
] | 2
|
2022-01-25T02:05:02.000Z
|
2022-01-25T02:38:59.000Z
|
tests/test_extractors/body/test_form_fields_extractor.py
|
dantownsend/xpresso
|
a4c4dbe96972a6f0339f30d7d794932f70510eea
|
[
"MIT"
] | null | null | null |
import sys
import typing
from dataclasses import dataclass
if sys.version_info < (3, 9):
from typing_extensions import Annotated
else:
from typing import Annotated
from pydantic import BaseModel
from starlette.responses import Response
from starlette.testclient import TestClient
from xpresso import App, Form, FormEncodedField, FromFormData, FromFormField, Path
def test_form_field_scalar_defaults() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[int]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"field": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_scalar_style_form_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[int, FormEncodedField(style="form", explode=True)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"field": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_scalar_style_form_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[int, FormEncodedField(style="form", explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"field": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_array_defaults() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[typing.List[int]]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_form_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[typing.List[int], FormEncodedField(explode=True)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_form_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[typing.List[int], FormEncodedField(explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1,2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_spaceDelimited_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="spaceDelimited", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_spaceDelimited_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="spaceDelimited", explode=False)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1 2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_pipeDelimited_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="pipeDelimited", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1"), ("field", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_array_style_pipeDelimited_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
typing.List[int], FormEncodedField(style="pipeDelimited", explode=False)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "1|2")])
assert resp.status_code == 200, resp.content
class ShallowObject(BaseModel):
a: int
b: str
def test_form_field_shallow_object_defaults() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[ShallowObject]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("a", "1"), ("b", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_shallow_object_style_form_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[ShallowObject, FormEncodedField(explode=True)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("a", "1"), ("b", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_shallow_object_style_form_explode_false() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[ShallowObject, FormEncodedField(explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field", "a,1,b,2")])
assert resp.status_code == 200, resp.content
def test_form_field_shallow_object_style_deepObject_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
ShallowObject, FormEncodedField(style="deepObject", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("field[a]", "1"), ("field[b]", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_deep_object_style_deepObject_explode_true() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
ShallowObject, FormEncodedField(style="deepObject", explode=True)
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post(
"/",
data=[
("field[a]", "1"),
("field[b]", "2"),
],
)
assert resp.status_code == 200, resp.content
def test_form_field_alias_scalar() -> None:
class FormModel(BaseModel):
field: Annotated[int, FormEncodedField(alias="realFieldName")]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == 2
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data={"realFieldName": "2"})
assert resp.status_code == 200, resp.content
def test_form_field_alias_array() -> None:
class FormModel(BaseModel):
field: Annotated[typing.List[int], FormEncodedField(alias="realFieldName")]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == [1, 2]
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", data=[("realFieldName", "1"), ("realFieldName", "2")])
assert resp.status_code == 200, resp.content
def test_form_field_alias_deepObject() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[
ShallowObject, FormEncodedField(style="deepObject", alias="readlFieldName")
]
async def endpoint(form: FromFormData[FormModel]) -> Response:
assert form.field == ShallowObject(a=1, b="2")
return Response()
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post(
"/",
data=[
("readlFieldName[a]", "1"),
("readlFieldName[b]", "2"),
],
)
assert resp.status_code == 200, resp.content
def test_invalid_serialization() -> None:
@dataclass(frozen=True)
class FormModel:
field: Annotated[ShallowObject, FormEncodedField(explode=False)]
async def endpoint(form: FromFormData[FormModel]) -> Response:
raise AssertionError("Should not be called") # pragma: no cover
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
# fields cannot be repeated if explode=False
# this is just an arbitrary example of a malformed serialzition
resp = client.post("/", data=[("field", "a,1"), ("field", "b,2")])
assert resp.status_code == 422, resp.content
assert resp.json() == {
"detail": [
{
"loc": ["body", "field"],
"msg": "Data is not a valid URL encoded form",
"type": "type_error",
}
]
}
def test_form_field_from_file() -> None:
@dataclass(frozen=True)
class FormModel:
field: FromFormField[str]
async def endpoint(
form: Annotated[FormModel, Form(enforce_media_type=False)]
) -> Response:
raise AssertionError("Should not be called") # pragma: no cover
app = App([Path("/", post=endpoint)])
with TestClient(app) as client:
resp = client.post("/", files=[("field", ("file.txt", b"abcd"))])
assert resp.status_code == 422, resp.content
assert resp.json() == {
"detail": [
{
"loc": ["body", "field"],
"msg": "Expected a string form field but received a file",
"type": "type_error.unexpectedfilereceived",
}
]
}
| 30.567358
| 87
| 0.625053
| 1,335
| 11,799
| 5.41573
| 0.08764
| 0.047303
| 0.029046
| 0.040664
| 0.892946
| 0.889903
| 0.873167
| 0.873167
| 0.86556
| 0.839419
| 0
| 0.014111
| 0.231206
| 11,799
| 385
| 88
| 30.646753
| 0.782935
| 0.011696
| 0
| 0.685921
| 0
| 0
| 0.056023
| 0.002831
| 0
| 0
| 0
| 0
| 0.151625
| 1
| 0.072202
| false
| 0
| 0.032491
| 0
| 0.32491
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
993dcfa2a570da9e634a847c20c71d05390a7639
| 260,269
|
py
|
Python
|
instances/passenger_demand/pas-20210422-1717-int18e/37.py
|
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
|
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
|
[
"BSD-3-Clause"
] | null | null | null |
instances/passenger_demand/pas-20210422-1717-int18e/37.py
|
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
|
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
|
[
"BSD-3-Clause"
] | null | null | null |
instances/passenger_demand/pas-20210422-1717-int18e/37.py
|
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
|
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
|
[
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 34483
passenger_arriving = (
(6, 8, 12, 6, 7, 5, 6, 1, 4, 0, 1, 2, 0, 14, 9, 4, 3, 9, 4, 3, 1, 7, 3, 5, 0, 0), # 0
(6, 15, 6, 15, 7, 6, 2, 5, 3, 0, 1, 3, 0, 8, 8, 5, 7, 6, 6, 7, 5, 4, 2, 2, 1, 0), # 1
(10, 7, 9, 8, 8, 6, 5, 8, 3, 4, 0, 2, 0, 7, 17, 3, 9, 10, 7, 2, 2, 3, 7, 0, 1, 0), # 2
(6, 8, 11, 9, 6, 3, 5, 5, 5, 5, 3, 5, 0, 11, 14, 11, 4, 13, 5, 3, 6, 2, 7, 2, 2, 0), # 3
(13, 14, 11, 12, 9, 6, 8, 5, 6, 2, 3, 0, 0, 10, 15, 11, 8, 7, 9, 3, 1, 1, 2, 3, 0, 0), # 4
(11, 12, 18, 18, 8, 7, 3, 3, 7, 6, 2, 4, 0, 14, 8, 7, 4, 12, 9, 8, 1, 5, 4, 3, 0, 0), # 5
(10, 13, 9, 15, 6, 5, 5, 11, 6, 3, 4, 2, 0, 13, 7, 9, 6, 9, 5, 7, 2, 4, 1, 2, 0, 0), # 6
(16, 14, 15, 10, 10, 6, 2, 6, 8, 2, 1, 0, 0, 23, 6, 18, 7, 17, 5, 9, 6, 9, 4, 2, 2, 0), # 7
(24, 11, 8, 14, 12, 8, 7, 3, 7, 3, 2, 0, 0, 12, 15, 11, 4, 14, 3, 4, 2, 5, 5, 3, 4, 0), # 8
(19, 20, 16, 9, 6, 5, 8, 3, 4, 3, 1, 2, 0, 11, 18, 7, 4, 12, 9, 1, 2, 7, 3, 1, 3, 0), # 9
(21, 21, 15, 19, 7, 9, 9, 7, 5, 1, 3, 3, 0, 14, 15, 9, 6, 15, 6, 10, 2, 4, 9, 3, 2, 0), # 10
(16, 14, 9, 17, 8, 6, 2, 5, 7, 3, 4, 2, 0, 13, 19, 7, 7, 11, 7, 5, 4, 2, 6, 6, 0, 0), # 11
(14, 18, 19, 20, 12, 6, 6, 2, 4, 1, 2, 1, 0, 15, 17, 15, 12, 6, 8, 9, 5, 6, 6, 2, 4, 0), # 12
(12, 14, 18, 13, 17, 6, 5, 3, 10, 1, 1, 1, 0, 19, 14, 12, 13, 12, 7, 4, 4, 6, 5, 1, 1, 0), # 13
(13, 16, 12, 10, 22, 3, 4, 10, 10, 3, 5, 1, 0, 13, 19, 7, 16, 12, 6, 3, 6, 3, 3, 3, 3, 0), # 14
(21, 13, 14, 22, 11, 5, 4, 5, 8, 3, 1, 1, 0, 11, 29, 11, 10, 19, 4, 7, 4, 8, 5, 4, 0, 0), # 15
(13, 17, 15, 12, 10, 7, 10, 3, 9, 4, 2, 1, 0, 24, 16, 9, 9, 13, 9, 7, 4, 9, 4, 4, 1, 0), # 16
(23, 13, 13, 13, 14, 8, 5, 9, 8, 5, 3, 2, 0, 17, 17, 10, 11, 9, 8, 7, 4, 5, 5, 2, 3, 0), # 17
(16, 12, 14, 13, 10, 5, 5, 7, 7, 1, 3, 4, 0, 22, 21, 10, 9, 9, 9, 6, 7, 8, 4, 1, 1, 0), # 18
(22, 13, 17, 12, 8, 9, 6, 5, 8, 2, 2, 3, 0, 17, 14, 10, 14, 17, 9, 6, 4, 9, 5, 4, 4, 0), # 19
(14, 16, 8, 18, 18, 6, 12, 10, 7, 1, 2, 1, 0, 17, 15, 19, 10, 23, 3, 8, 3, 8, 10, 1, 0, 0), # 20
(14, 12, 23, 14, 16, 3, 10, 6, 9, 1, 3, 1, 0, 20, 15, 12, 16, 12, 9, 7, 9, 9, 6, 2, 4, 0), # 21
(18, 21, 16, 17, 11, 5, 7, 9, 3, 4, 1, 2, 0, 15, 20, 12, 6, 12, 9, 15, 2, 7, 6, 3, 2, 0), # 22
(15, 15, 17, 16, 9, 8, 11, 7, 8, 7, 2, 3, 0, 15, 19, 13, 11, 17, 6, 11, 5, 5, 4, 2, 3, 0), # 23
(14, 16, 16, 20, 11, 6, 7, 4, 8, 2, 1, 2, 0, 19, 8, 12, 9, 7, 14, 11, 5, 7, 4, 3, 4, 0), # 24
(15, 20, 11, 28, 16, 3, 3, 5, 8, 2, 0, 2, 0, 20, 26, 15, 10, 12, 7, 9, 3, 6, 6, 3, 3, 0), # 25
(17, 24, 22, 22, 15, 3, 7, 4, 3, 5, 1, 3, 0, 21, 17, 13, 13, 11, 10, 4, 4, 4, 4, 4, 4, 0), # 26
(20, 25, 12, 11, 11, 7, 8, 1, 11, 5, 2, 2, 0, 15, 22, 10, 4, 16, 9, 9, 4, 10, 4, 2, 1, 0), # 27
(19, 17, 23, 22, 8, 4, 6, 12, 9, 2, 7, 4, 0, 13, 17, 13, 9, 22, 8, 10, 2, 6, 7, 5, 0, 0), # 28
(24, 21, 13, 13, 16, 5, 8, 9, 7, 5, 2, 0, 0, 26, 12, 16, 10, 13, 11, 6, 5, 9, 3, 2, 2, 0), # 29
(17, 20, 14, 13, 11, 2, 4, 11, 11, 7, 4, 3, 0, 13, 18, 17, 9, 18, 9, 7, 6, 6, 8, 5, 0, 0), # 30
(21, 18, 16, 29, 16, 2, 10, 7, 9, 1, 0, 0, 0, 21, 19, 14, 9, 12, 11, 7, 5, 4, 6, 4, 3, 0), # 31
(24, 17, 16, 13, 17, 10, 9, 7, 3, 1, 3, 5, 0, 21, 18, 9, 12, 17, 9, 4, 4, 7, 7, 3, 3, 0), # 32
(15, 14, 17, 15, 10, 4, 9, 10, 12, 3, 4, 4, 0, 13, 14, 10, 9, 16, 16, 9, 3, 6, 9, 3, 0, 0), # 33
(19, 20, 14, 23, 14, 9, 8, 7, 8, 4, 4, 0, 0, 17, 7, 12, 12, 20, 6, 8, 7, 10, 8, 2, 1, 0), # 34
(14, 12, 13, 19, 15, 7, 9, 7, 6, 6, 2, 2, 0, 18, 7, 12, 11, 8, 15, 9, 5, 7, 2, 3, 0, 0), # 35
(17, 19, 22, 20, 12, 3, 6, 4, 11, 3, 1, 2, 0, 9, 9, 8, 8, 13, 6, 2, 2, 11, 1, 3, 2, 0), # 36
(15, 23, 13, 20, 13, 4, 9, 6, 10, 2, 1, 2, 0, 19, 21, 14, 6, 11, 5, 6, 8, 2, 8, 2, 1, 0), # 37
(13, 21, 18, 16, 7, 4, 8, 7, 5, 4, 1, 0, 0, 19, 12, 15, 5, 16, 9, 5, 4, 5, 7, 2, 0, 0), # 38
(18, 20, 12, 12, 11, 7, 3, 6, 4, 2, 3, 0, 0, 19, 20, 9, 9, 16, 14, 4, 7, 10, 9, 3, 3, 0), # 39
(16, 16, 14, 23, 7, 5, 7, 10, 11, 2, 2, 3, 0, 25, 18, 14, 4, 26, 7, 6, 4, 6, 11, 4, 6, 0), # 40
(14, 15, 18, 24, 16, 4, 3, 5, 8, 4, 4, 2, 0, 21, 15, 9, 15, 10, 7, 4, 3, 3, 2, 1, 1, 0), # 41
(16, 15, 9, 19, 10, 4, 5, 6, 12, 4, 1, 3, 0, 17, 15, 17, 12, 12, 7, 7, 7, 7, 3, 2, 3, 0), # 42
(16, 24, 23, 18, 17, 7, 8, 7, 11, 3, 2, 3, 0, 15, 15, 7, 15, 10, 10, 5, 6, 4, 6, 3, 2, 0), # 43
(18, 19, 17, 17, 5, 4, 1, 4, 8, 4, 3, 2, 0, 19, 21, 8, 17, 17, 4, 5, 3, 4, 10, 3, 0, 0), # 44
(19, 17, 14, 17, 13, 13, 6, 7, 10, 4, 6, 0, 0, 19, 18, 16, 7, 17, 8, 4, 5, 8, 7, 2, 3, 0), # 45
(13, 16, 14, 18, 11, 7, 5, 6, 4, 4, 2, 0, 0, 13, 12, 16, 14, 17, 7, 7, 6, 4, 6, 2, 1, 0), # 46
(20, 16, 17, 16, 12, 10, 7, 7, 7, 3, 3, 0, 0, 17, 19, 13, 6, 14, 10, 11, 2, 9, 2, 1, 2, 0), # 47
(22, 17, 16, 16, 20, 3, 10, 7, 13, 3, 0, 1, 0, 15, 21, 18, 7, 10, 8, 9, 3, 2, 5, 3, 1, 0), # 48
(19, 12, 20, 11, 9, 8, 11, 11, 6, 4, 1, 4, 0, 13, 17, 15, 8, 13, 12, 9, 8, 8, 4, 4, 2, 0), # 49
(18, 17, 23, 13, 16, 10, 7, 2, 9, 1, 4, 0, 0, 19, 18, 19, 10, 9, 11, 7, 4, 7, 2, 4, 2, 0), # 50
(24, 10, 14, 14, 10, 4, 7, 7, 6, 6, 2, 2, 0, 17, 20, 13, 7, 19, 11, 5, 3, 7, 7, 6, 0, 0), # 51
(20, 20, 11, 14, 10, 3, 8, 9, 4, 3, 3, 1, 0, 17, 17, 14, 11, 7, 6, 6, 3, 4, 7, 3, 2, 0), # 52
(22, 23, 11, 15, 16, 4, 5, 6, 4, 4, 2, 0, 0, 22, 19, 9, 10, 19, 7, 4, 4, 10, 6, 5, 0, 0), # 53
(18, 19, 17, 24, 15, 7, 6, 5, 9, 3, 1, 3, 0, 23, 11, 11, 8, 10, 14, 4, 6, 4, 4, 4, 0, 0), # 54
(15, 21, 15, 16, 14, 3, 8, 8, 4, 4, 4, 0, 0, 28, 17, 14, 9, 8, 10, 5, 5, 7, 4, 3, 0, 0), # 55
(16, 17, 16, 13, 9, 5, 10, 4, 4, 6, 0, 3, 0, 19, 14, 11, 8, 9, 5, 6, 4, 8, 6, 6, 1, 0), # 56
(20, 20, 5, 20, 12, 9, 8, 7, 5, 4, 1, 3, 0, 15, 12, 14, 7, 17, 8, 7, 4, 6, 4, 2, 3, 0), # 57
(17, 15, 15, 24, 8, 10, 6, 2, 7, 6, 6, 1, 0, 21, 11, 13, 10, 19, 5, 9, 6, 6, 3, 3, 1, 0), # 58
(16, 21, 14, 6, 18, 6, 12, 4, 4, 4, 1, 0, 0, 10, 10, 10, 12, 16, 9, 6, 3, 12, 7, 5, 0, 0), # 59
(14, 20, 18, 16, 10, 9, 10, 4, 7, 4, 3, 2, 0, 20, 12, 10, 7, 15, 10, 6, 6, 7, 7, 2, 1, 0), # 60
(19, 11, 14, 15, 14, 3, 7, 6, 7, 7, 0, 3, 0, 12, 16, 15, 7, 13, 12, 2, 4, 6, 6, 0, 0, 0), # 61
(36, 16, 17, 13, 17, 4, 9, 5, 11, 4, 0, 0, 0, 11, 15, 14, 14, 19, 13, 13, 3, 9, 3, 3, 2, 0), # 62
(17, 18, 11, 23, 18, 5, 6, 4, 8, 5, 0, 2, 0, 30, 9, 15, 9, 5, 7, 10, 1, 5, 3, 3, 4, 0), # 63
(18, 15, 22, 12, 16, 6, 6, 9, 5, 1, 3, 2, 0, 13, 19, 13, 13, 9, 9, 7, 1, 6, 8, 2, 0, 0), # 64
(14, 8, 20, 13, 17, 2, 7, 10, 5, 5, 1, 1, 0, 20, 20, 18, 14, 11, 9, 8, 5, 6, 8, 0, 1, 0), # 65
(23, 19, 16, 20, 17, 6, 3, 10, 11, 4, 5, 1, 0, 18, 12, 7, 5, 19, 7, 10, 5, 8, 5, 4, 0, 0), # 66
(14, 15, 20, 15, 15, 4, 4, 6, 3, 3, 5, 0, 0, 16, 22, 9, 7, 11, 7, 7, 4, 9, 4, 3, 1, 0), # 67
(14, 12, 17, 15, 14, 4, 8, 3, 8, 4, 1, 0, 0, 17, 19, 16, 8, 15, 8, 5, 4, 12, 8, 2, 1, 0), # 68
(12, 25, 17, 18, 15, 9, 10, 11, 13, 1, 4, 2, 0, 19, 12, 13, 16, 10, 9, 8, 4, 7, 4, 2, 1, 0), # 69
(14, 13, 15, 22, 10, 7, 3, 3, 5, 4, 3, 0, 0, 24, 25, 16, 10, 16, 5, 6, 3, 5, 9, 0, 1, 0), # 70
(16, 16, 20, 19, 17, 7, 6, 6, 6, 2, 2, 2, 0, 8, 15, 7, 9, 15, 5, 6, 4, 7, 5, 3, 2, 0), # 71
(19, 10, 18, 20, 19, 1, 8, 4, 7, 2, 0, 0, 0, 22, 15, 19, 14, 9, 7, 2, 3, 8, 4, 4, 0, 0), # 72
(25, 15, 12, 16, 11, 5, 10, 6, 11, 0, 3, 2, 0, 22, 11, 10, 6, 13, 5, 14, 7, 10, 9, 2, 1, 0), # 73
(21, 14, 12, 15, 13, 8, 8, 7, 9, 4, 0, 0, 0, 22, 17, 11, 9, 18, 7, 10, 3, 6, 6, 5, 0, 0), # 74
(23, 26, 13, 20, 11, 14, 6, 4, 7, 5, 1, 2, 0, 18, 8, 10, 11, 14, 7, 8, 4, 7, 7, 1, 2, 0), # 75
(16, 15, 19, 21, 17, 10, 7, 11, 2, 1, 2, 1, 0, 12, 13, 17, 16, 12, 3, 5, 5, 11, 2, 4, 1, 0), # 76
(13, 21, 19, 16, 12, 6, 4, 4, 9, 3, 4, 0, 0, 18, 15, 19, 12, 12, 5, 8, 3, 7, 3, 3, 1, 0), # 77
(23, 12, 13, 20, 16, 9, 7, 4, 9, 2, 3, 2, 0, 14, 22, 16, 11, 11, 3, 7, 4, 6, 1, 2, 0, 0), # 78
(19, 14, 12, 17, 22, 9, 8, 6, 7, 4, 2, 4, 0, 26, 18, 14, 7, 13, 10, 3, 8, 9, 8, 1, 1, 0), # 79
(22, 11, 20, 13, 16, 6, 4, 3, 5, 6, 1, 1, 0, 29, 13, 10, 10, 14, 4, 4, 4, 5, 4, 2, 0, 0), # 80
(17, 17, 10, 18, 11, 6, 10, 5, 2, 2, 1, 0, 0, 17, 15, 17, 9, 20, 8, 3, 5, 9, 5, 8, 1, 0), # 81
(14, 11, 12, 21, 11, 6, 11, 5, 6, 2, 2, 6, 0, 16, 16, 9, 17, 16, 6, 11, 3, 5, 2, 3, 1, 0), # 82
(14, 12, 15, 22, 14, 3, 6, 4, 3, 3, 2, 2, 0, 22, 12, 14, 9, 14, 6, 4, 4, 6, 5, 3, 1, 0), # 83
(18, 14, 17, 17, 10, 7, 5, 9, 9, 1, 0, 4, 0, 21, 14, 12, 8, 17, 8, 9, 5, 4, 7, 2, 3, 0), # 84
(14, 11, 12, 21, 19, 4, 1, 7, 5, 1, 4, 0, 0, 18, 13, 11, 3, 18, 8, 10, 7, 11, 5, 2, 1, 0), # 85
(16, 10, 17, 15, 13, 1, 4, 2, 12, 4, 2, 4, 0, 13, 10, 13, 8, 24, 8, 5, 4, 7, 2, 6, 1, 0), # 86
(17, 18, 15, 8, 13, 8, 17, 3, 6, 2, 0, 2, 0, 23, 14, 11, 9, 8, 11, 9, 8, 9, 3, 4, 1, 0), # 87
(18, 14, 13, 15, 11, 9, 6, 4, 8, 4, 4, 2, 0, 18, 12, 6, 12, 18, 9, 5, 4, 9, 5, 4, 1, 0), # 88
(20, 18, 13, 14, 13, 6, 7, 2, 2, 2, 2, 0, 0, 14, 10, 7, 9, 14, 3, 4, 6, 6, 3, 4, 0, 0), # 89
(21, 16, 16, 15, 6, 6, 5, 4, 8, 5, 2, 2, 0, 24, 14, 7, 10, 13, 3, 8, 4, 6, 9, 3, 2, 0), # 90
(26, 14, 9, 14, 6, 4, 10, 8, 4, 2, 0, 0, 0, 14, 15, 11, 6, 16, 6, 3, 3, 7, 5, 0, 1, 0), # 91
(13, 15, 12, 20, 13, 5, 3, 7, 4, 5, 1, 0, 0, 18, 17, 12, 7, 8, 13, 5, 5, 5, 5, 0, 2, 0), # 92
(25, 10, 14, 15, 17, 6, 2, 6, 9, 1, 5, 2, 0, 14, 11, 9, 8, 21, 5, 9, 5, 9, 6, 3, 3, 0), # 93
(19, 15, 15, 19, 14, 4, 8, 6, 5, 3, 1, 1, 0, 19, 17, 13, 8, 15, 7, 7, 9, 3, 3, 1, 0, 0), # 94
(17, 11, 8, 21, 15, 4, 9, 2, 10, 1, 1, 2, 0, 12, 16, 5, 7, 14, 7, 7, 4, 6, 5, 1, 2, 0), # 95
(20, 9, 9, 13, 11, 7, 6, 5, 5, 1, 4, 1, 0, 21, 13, 15, 5, 13, 7, 4, 8, 3, 5, 3, 1, 0), # 96
(20, 16, 15, 13, 17, 6, 6, 7, 6, 6, 4, 1, 0, 23, 11, 11, 10, 16, 7, 3, 5, 8, 6, 3, 2, 0), # 97
(10, 14, 6, 13, 13, 9, 9, 3, 8, 3, 3, 2, 0, 22, 9, 9, 11, 10, 12, 2, 5, 7, 2, 3, 0, 0), # 98
(18, 15, 14, 15, 9, 3, 7, 7, 8, 4, 5, 2, 0, 18, 13, 11, 13, 10, 8, 6, 3, 5, 3, 4, 2, 0), # 99
(24, 14, 14, 24, 7, 7, 6, 3, 6, 2, 4, 2, 0, 21, 14, 20, 10, 17, 4, 2, 5, 12, 5, 2, 1, 0), # 100
(22, 11, 17, 10, 12, 4, 4, 3, 8, 4, 2, 0, 0, 14, 13, 12, 9, 15, 10, 6, 3, 7, 9, 2, 0, 0), # 101
(17, 18, 10, 14, 15, 5, 6, 4, 9, 0, 2, 1, 0, 16, 13, 8, 5, 11, 11, 3, 5, 7, 2, 4, 2, 0), # 102
(19, 11, 19, 12, 12, 7, 7, 5, 6, 3, 3, 1, 0, 16, 11, 17, 7, 11, 10, 6, 4, 7, 6, 3, 1, 0), # 103
(12, 17, 13, 23, 13, 6, 6, 4, 6, 10, 1, 1, 0, 21, 14, 16, 9, 17, 8, 7, 8, 5, 4, 1, 1, 0), # 104
(18, 12, 18, 20, 16, 7, 4, 7, 10, 2, 1, 0, 0, 23, 13, 12, 12, 14, 7, 5, 6, 8, 3, 2, 1, 0), # 105
(12, 12, 14, 16, 18, 6, 5, 5, 6, 4, 2, 1, 0, 25, 19, 12, 5, 11, 6, 4, 3, 12, 5, 3, 3, 0), # 106
(15, 8, 20, 13, 12, 11, 10, 1, 6, 1, 2, 0, 0, 11, 18, 15, 12, 12, 8, 5, 4, 7, 3, 3, 0, 0), # 107
(17, 18, 16, 13, 6, 7, 10, 4, 9, 2, 6, 1, 0, 11, 16, 10, 5, 15, 6, 8, 7, 5, 6, 2, 1, 0), # 108
(18, 14, 12, 14, 9, 3, 4, 5, 5, 3, 4, 3, 0, 17, 13, 8, 9, 15, 4, 4, 7, 6, 4, 2, 1, 0), # 109
(11, 12, 12, 18, 18, 8, 7, 0, 5, 4, 0, 2, 0, 16, 13, 14, 8, 15, 5, 5, 4, 7, 3, 0, 0, 0), # 110
(20, 9, 20, 15, 15, 6, 8, 6, 7, 1, 4, 2, 0, 20, 14, 7, 3, 12, 6, 4, 2, 2, 3, 1, 0, 0), # 111
(18, 7, 18, 13, 18, 7, 8, 1, 6, 2, 0, 2, 0, 19, 13, 10, 4, 13, 7, 4, 6, 4, 5, 6, 1, 0), # 112
(20, 16, 17, 19, 12, 7, 5, 6, 11, 1, 3, 0, 0, 18, 10, 8, 3, 14, 4, 5, 4, 2, 6, 5, 0, 0), # 113
(23, 11, 15, 17, 6, 8, 3, 6, 6, 1, 0, 1, 0, 24, 8, 9, 6, 14, 4, 7, 6, 3, 5, 1, 0, 0), # 114
(16, 16, 16, 18, 11, 4, 4, 3, 6, 5, 2, 0, 0, 14, 11, 7, 3, 18, 5, 4, 4, 12, 3, 5, 0, 0), # 115
(14, 15, 10, 18, 10, 3, 6, 3, 6, 2, 3, 1, 0, 19, 15, 9, 11, 9, 6, 4, 4, 6, 7, 2, 0, 0), # 116
(18, 14, 15, 19, 9, 3, 4, 3, 7, 3, 2, 1, 0, 24, 15, 8, 3, 22, 6, 2, 6, 8, 3, 3, 1, 0), # 117
(8, 11, 8, 9, 16, 7, 6, 7, 4, 1, 3, 1, 0, 18, 8, 8, 7, 13, 3, 5, 3, 4, 4, 2, 1, 0), # 118
(14, 8, 10, 11, 10, 7, 9, 6, 7, 5, 2, 0, 0, 22, 12, 10, 8, 11, 6, 2, 3, 10, 5, 6, 1, 0), # 119
(13, 9, 14, 15, 11, 12, 10, 4, 7, 4, 3, 1, 0, 16, 16, 12, 7, 17, 9, 4, 2, 4, 4, 2, 1, 0), # 120
(14, 17, 8, 19, 13, 1, 3, 2, 6, 2, 4, 0, 0, 17, 17, 12, 4, 14, 6, 6, 1, 9, 3, 0, 3, 0), # 121
(19, 14, 16, 16, 11, 8, 6, 4, 5, 1, 0, 0, 0, 19, 14, 13, 5, 13, 5, 2, 4, 2, 4, 7, 1, 0), # 122
(11, 13, 21, 17, 14, 3, 4, 5, 7, 2, 0, 3, 0, 12, 17, 16, 9, 15, 10, 7, 2, 10, 6, 2, 0, 0), # 123
(15, 16, 8, 19, 7, 4, 0, 8, 6, 2, 2, 3, 0, 20, 11, 9, 6, 14, 4, 4, 5, 3, 6, 3, 1, 0), # 124
(17, 12, 15, 21, 9, 11, 5, 4, 5, 2, 3, 1, 0, 24, 14, 10, 9, 14, 3, 6, 5, 9, 5, 2, 1, 0), # 125
(20, 9, 19, 13, 18, 3, 3, 6, 5, 1, 0, 3, 0, 11, 11, 9, 3, 8, 8, 5, 3, 7, 6, 3, 0, 0), # 126
(21, 12, 7, 18, 8, 7, 3, 4, 6, 0, 2, 1, 0, 10, 8, 12, 9, 6, 7, 4, 5, 11, 6, 3, 1, 0), # 127
(18, 21, 11, 13, 15, 0, 9, 5, 8, 3, 0, 4, 0, 21, 13, 5, 7, 10, 4, 7, 2, 2, 4, 4, 0, 0), # 128
(20, 12, 11, 17, 9, 3, 8, 5, 4, 4, 2, 0, 0, 18, 12, 6, 8, 20, 7, 5, 5, 8, 5, 2, 3, 0), # 129
(11, 7, 11, 16, 18, 8, 8, 5, 4, 4, 1, 2, 0, 16, 9, 7, 8, 13, 5, 3, 5, 12, 3, 6, 1, 0), # 130
(13, 11, 6, 8, 10, 2, 6, 4, 8, 2, 0, 3, 0, 14, 6, 14, 11, 9, 7, 7, 5, 5, 2, 7, 1, 0), # 131
(10, 13, 9, 11, 12, 7, 9, 5, 9, 4, 1, 1, 0, 25, 13, 11, 11, 13, 3, 4, 3, 7, 3, 1, 0, 0), # 132
(10, 13, 9, 13, 8, 2, 3, 3, 4, 4, 4, 3, 0, 27, 13, 11, 11, 14, 6, 5, 3, 11, 2, 2, 0, 0), # 133
(22, 8, 17, 14, 13, 3, 9, 5, 9, 7, 4, 2, 0, 27, 13, 11, 9, 16, 5, 8, 1, 6, 1, 5, 2, 0), # 134
(16, 10, 11, 11, 15, 4, 4, 4, 4, 4, 1, 0, 0, 14, 15, 11, 4, 16, 11, 3, 5, 8, 4, 5, 4, 0), # 135
(22, 16, 14, 10, 13, 7, 3, 2, 4, 0, 1, 1, 0, 12, 15, 9, 9, 12, 9, 5, 3, 12, 5, 0, 0, 0), # 136
(17, 13, 10, 15, 14, 5, 3, 5, 9, 0, 2, 1, 0, 12, 16, 7, 9, 13, 3, 4, 4, 6, 3, 0, 0, 0), # 137
(21, 17, 13, 18, 14, 5, 6, 6, 6, 2, 3, 1, 0, 13, 14, 10, 8, 9, 3, 4, 2, 3, 7, 4, 1, 0), # 138
(13, 9, 17, 15, 15, 2, 7, 2, 6, 3, 1, 0, 0, 13, 11, 9, 8, 7, 5, 4, 2, 8, 3, 5, 2, 0), # 139
(18, 6, 11, 14, 7, 5, 8, 3, 7, 3, 4, 1, 0, 13, 13, 9, 8, 9, 9, 2, 3, 1, 4, 2, 1, 0), # 140
(16, 9, 9, 17, 8, 4, 7, 6, 5, 4, 2, 0, 0, 11, 12, 5, 8, 11, 6, 3, 5, 7, 2, 3, 0, 0), # 141
(16, 11, 5, 14, 15, 6, 5, 5, 7, 3, 3, 2, 0, 15, 20, 8, 5, 10, 7, 7, 1, 5, 9, 4, 0, 0), # 142
(16, 12, 20, 17, 11, 8, 8, 5, 7, 6, 2, 0, 0, 23, 13, 12, 5, 11, 8, 4, 4, 7, 6, 4, 0, 0), # 143
(18, 11, 15, 11, 12, 4, 5, 3, 11, 5, 3, 1, 0, 18, 9, 9, 8, 8, 8, 3, 5, 3, 4, 3, 0, 0), # 144
(17, 12, 16, 11, 9, 6, 6, 5, 5, 3, 1, 2, 0, 18, 14, 12, 6, 14, 8, 7, 5, 10, 6, 9, 0, 0), # 145
(21, 8, 13, 12, 16, 7, 4, 1, 7, 1, 0, 1, 0, 19, 9, 8, 7, 15, 13, 7, 4, 2, 3, 1, 2, 0), # 146
(15, 8, 15, 10, 15, 2, 5, 3, 9, 5, 2, 2, 0, 11, 10, 9, 5, 7, 10, 4, 2, 6, 3, 1, 1, 0), # 147
(17, 11, 9, 12, 14, 6, 4, 3, 10, 1, 0, 0, 0, 16, 6, 8, 9, 10, 7, 5, 2, 3, 2, 2, 0, 0), # 148
(18, 7, 16, 13, 10, 9, 2, 5, 9, 3, 0, 1, 0, 9, 18, 11, 7, 13, 5, 5, 2, 12, 7, 3, 2, 0), # 149
(13, 14, 10, 10, 9, 8, 1, 3, 3, 1, 1, 1, 0, 14, 12, 7, 8, 12, 7, 2, 5, 5, 6, 4, 1, 0), # 150
(17, 7, 19, 16, 10, 6, 4, 3, 3, 3, 2, 1, 0, 14, 7, 7, 9, 8, 4, 1, 2, 9, 4, 2, 0, 0), # 151
(12, 11, 14, 10, 12, 5, 7, 4, 9, 3, 2, 1, 0, 15, 6, 8, 7, 11, 5, 4, 4, 4, 2, 4, 0, 0), # 152
(17, 8, 17, 20, 15, 2, 4, 2, 6, 2, 1, 0, 0, 19, 10, 6, 9, 15, 3, 3, 6, 9, 6, 3, 1, 0), # 153
(19, 16, 14, 17, 12, 7, 6, 5, 4, 1, 2, 0, 0, 12, 18, 11, 7, 16, 5, 0, 4, 4, 3, 5, 1, 0), # 154
(6, 17, 18, 9, 5, 8, 2, 2, 4, 2, 0, 2, 0, 18, 8, 5, 3, 15, 4, 4, 6, 7, 2, 4, 0, 0), # 155
(10, 10, 12, 11, 6, 5, 2, 5, 6, 0, 3, 1, 0, 13, 15, 7, 6, 15, 7, 3, 6, 8, 4, 2, 2, 0), # 156
(15, 8, 7, 10, 16, 8, 2, 5, 5, 2, 1, 0, 0, 19, 11, 8, 4, 11, 8, 2, 2, 3, 3, 4, 0, 0), # 157
(9, 7, 7, 11, 11, 7, 6, 1, 5, 1, 0, 1, 0, 17, 14, 7, 4, 8, 3, 2, 5, 9, 4, 1, 0, 0), # 158
(10, 8, 12, 12, 11, 8, 6, 5, 7, 1, 0, 1, 0, 12, 10, 4, 6, 11, 4, 1, 0, 2, 0, 2, 1, 0), # 159
(14, 6, 10, 8, 4, 4, 3, 6, 3, 0, 1, 0, 0, 22, 10, 3, 6, 9, 3, 3, 5, 8, 5, 1, 0, 0), # 160
(5, 13, 11, 11, 8, 3, 8, 2, 7, 3, 1, 1, 0, 15, 11, 7, 11, 10, 5, 7, 2, 7, 6, 1, 2, 0), # 161
(12, 9, 15, 7, 15, 9, 4, 6, 5, 1, 1, 1, 0, 21, 7, 9, 6, 12, 4, 10, 3, 11, 2, 4, 1, 0), # 162
(15, 7, 12, 12, 7, 8, 7, 2, 3, 0, 2, 3, 0, 10, 9, 11, 4, 7, 4, 5, 5, 1, 4, 3, 2, 0), # 163
(12, 3, 16, 9, 11, 4, 2, 3, 5, 0, 0, 3, 0, 11, 7, 7, 8, 6, 3, 2, 3, 4, 2, 5, 0, 0), # 164
(11, 12, 7, 12, 14, 4, 5, 3, 7, 3, 1, 1, 0, 7, 11, 8, 3, 10, 6, 2, 2, 8, 5, 1, 3, 0), # 165
(13, 10, 12, 12, 14, 4, 4, 4, 9, 0, 2, 1, 0, 14, 17, 15, 3, 4, 3, 9, 3, 6, 4, 2, 1, 0), # 166
(22, 6, 5, 6, 12, 4, 2, 5, 8, 1, 0, 0, 0, 3, 8, 7, 3, 10, 4, 2, 4, 5, 2, 1, 0, 0), # 167
(11, 9, 13, 10, 10, 5, 5, 3, 6, 3, 1, 0, 0, 11, 16, 9, 4, 7, 9, 3, 1, 7, 4, 3, 2, 0), # 168
(1, 11, 15, 13, 12, 4, 5, 4, 6, 0, 0, 0, 0, 14, 6, 5, 6, 15, 3, 4, 9, 8, 4, 1, 0, 0), # 169
(12, 7, 9, 9, 10, 10, 3, 1, 6, 3, 0, 1, 0, 5, 8, 2, 5, 6, 6, 3, 3, 3, 3, 4, 0, 0), # 170
(9, 9, 9, 7, 17, 2, 4, 5, 4, 0, 0, 0, 0, 14, 6, 3, 5, 9, 6, 4, 1, 3, 1, 3, 3, 0), # 171
(9, 8, 10, 12, 5, 2, 4, 4, 5, 1, 2, 0, 0, 9, 7, 1, 4, 12, 7, 2, 2, 2, 4, 2, 0, 0), # 172
(13, 7, 9, 16, 6, 5, 0, 1, 3, 1, 0, 0, 0, 10, 7, 3, 7, 8, 6, 2, 2, 1, 3, 2, 0, 0), # 173
(6, 2, 14, 5, 9, 2, 1, 2, 3, 1, 1, 3, 0, 16, 9, 5, 8, 6, 7, 1, 1, 1, 5, 0, 1, 0), # 174
(7, 6, 10, 7, 6, 2, 5, 3, 3, 1, 0, 1, 0, 7, 8, 5, 3, 5, 3, 2, 1, 5, 1, 0, 0, 0), # 175
(6, 4, 7, 4, 6, 4, 2, 2, 1, 2, 0, 1, 0, 4, 9, 5, 4, 12, 2, 7, 3, 4, 2, 2, 0, 0), # 176
(6, 5, 6, 7, 1, 0, 3, 4, 3, 1, 1, 1, 0, 9, 5, 4, 7, 3, 2, 2, 1, 2, 1, 2, 3, 0), # 177
(6, 7, 6, 4, 4, 3, 1, 4, 4, 4, 0, 1, 0, 10, 4, 3, 5, 7, 2, 2, 1, 4, 5, 0, 1, 0), # 178
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 179
)
station_arriving_intensity = (
(9.037558041069182, 9.9455194074477, 9.380309813302512, 11.18640199295418, 9.998434093697302, 5.64957887766721, 7.462864107673047, 8.375717111362961, 10.962178311902413, 7.124427027940266, 7.569477294994085, 8.816247140951113, 9.150984382641052), # 0
(9.637788873635953, 10.602109249460566, 9.999623864394273, 11.925259655897909, 10.660482607453627, 6.0227704512766005, 7.955044094274649, 8.927124701230275, 11.686041587399236, 7.59416524609887, 8.069573044721038, 9.398189989465838, 9.755624965391739), # 1
(10.236101416163518, 11.256093307603763, 10.616476113985344, 12.66117786839663, 11.320133352749538, 6.3944732061224006, 8.445273314329269, 9.476325446227955, 12.407016252379588, 8.062044795036982, 8.567681667797364, 9.9778187736955, 10.357856690777442), # 2
(10.830164027663812, 11.904876903485604, 11.228419564775738, 13.391237533557733, 11.974791016803424, 6.763213120653203, 8.93160655496632, 10.021142083490112, 13.122243289657968, 8.526208857167125, 9.061827141289289, 10.55283423287483, 10.955291051257605), # 3
(11.417645067148767, 12.545865358714394, 11.833007219465467, 14.112519554488625, 12.621860286833686, 7.127516173317602, 9.412098603315226, 10.559397350150848, 13.828863682048873, 8.984800614901822, 9.550033442263036, 11.120937106238575, 11.54553953929167), # 4
(11.996212893630318, 13.176463994898459, 12.427792080754532, 14.822104834296708, 13.258745850058704, 7.485908342564186, 9.884804246505404, 11.088913983344266, 14.524018412366805, 9.435963250653593, 10.030324547784838, 11.679828133021466, 12.126213647339089), # 5
(12.5635358661204, 13.794078133646101, 13.010327151342958, 15.517074276089375, 13.882852393696878, 7.836915606841555, 10.347778271666273, 11.60751472020448, 15.204848463426268, 9.877839946834966, 10.500724434920908, 12.227208052458254, 12.694924867859292), # 6
(13.117282343630944, 14.396113096565637, 13.578165433930742, 16.194508782974033, 14.491584604966597, 8.179063944598298, 10.799075465927253, 12.113022297865593, 15.868494818041759, 10.308573885858456, 10.959257080737483, 12.760777603783673, 13.249284693311735), # 7
(13.655120685173882, 14.979974205265378, 14.128859931217914, 16.85148925805807, 15.082347171086255, 8.510879334283002, 11.236750616417757, 12.603259453461705, 16.512098459027772, 10.726308250136594, 11.403946462300778, 13.278237526232465, 13.786904616155851), # 8
(14.174719249761154, 15.543066781353641, 14.659963645904467, 17.485096604448906, 15.652544779274237, 8.830887754344271, 11.658858510267216, 13.076048924126933, 17.132800369198815, 11.129186222081895, 11.83281655667702, 13.777288559039365, 14.305396128851092), # 9
(14.673746396404677, 16.082796146438728, 15.169029580690424, 18.092411725253918, 16.199582116748942, 9.137615183230693, 12.063453934605038, 13.52921344699538, 17.727741531369386, 11.515350984106886, 12.243891340932432, 14.255631441439114, 14.802370723856898), # 10
(15.149870484116411, 16.596567622128973, 15.653610738275788, 18.670515523580516, 16.72086387072876, 9.429587599390864, 12.44859167656065, 13.960575759201147, 18.294062928353988, 11.882945718624095, 12.635194792133248, 14.710966912666459, 15.2754398936327), # 11
(15.600759871908263, 17.081786530032655, 16.111260121360573, 19.216488902536103, 17.21379472843208, 9.705330981273365, 12.812326523263462, 14.367958597878339, 18.82890554296712, 12.23011360804603, 13.004750887345683, 15.140995711956123, 15.722215130637963), # 12
(16.02408291879218, 17.535858191758116, 16.539530732644792, 19.727412765228078, 17.675779377077284, 9.963371307326803, 13.152713261842901, 14.749184700161067, 19.329410358023278, 12.554997834785228, 13.350583603635965, 15.543418578542857, 16.140307927332124), # 13
(16.41750798378009, 17.95618792891366, 16.935975574828465, 20.20036801476383, 18.10422250388278, 10.202234555999762, 13.46780667942839, 15.102076803183444, 19.79271835633696, 12.855741581254202, 13.670716918070312, 15.915936251661408, 16.527329776174614), # 14
(16.77870342588394, 18.34018106310759, 17.298147650611575, 20.632435554250776, 18.496528796066954, 10.420446705740842, 13.755661563149326, 15.424457644079562, 20.215970520722674, 13.130488029865482, 13.963174807714955, 16.256249470546507, 16.880892169624886), # 15
(17.10533760411564, 18.685242915948237, 17.623599962694165, 21.02069628679629, 18.8501029408482, 10.616533734998628, 14.014332700135158, 15.71414995998353, 20.596307833994917, 13.377380363031593, 14.225981249636122, 16.56205897443289, 17.198606600142384), # 16
(17.395078877487137, 18.988778809043904, 17.909885513776235, 21.362231115507804, 19.162349625444907, 10.789021622221714, 14.24187487751528, 15.968976488029472, 20.930871278968173, 13.594561763165041, 14.457160220900038, 16.8310655025553, 17.47808456018655), # 17
(17.645595605010367, 19.248194064002895, 18.154557306557784, 21.654120943492703, 19.43067353707546, 10.936436345858706, 14.436342882419133, 16.18675996535147, 21.216801838456973, 13.780175412678366, 14.654735698572916, 17.060969794148487, 17.716937542216822), # 18
(17.85455614569726, 19.46089400243354, 18.355168343738843, 21.893446673858367, 19.65247936295826, 11.057303884358175, 14.59579150197611, 16.36532312908364, 21.4512404952758, 13.93236449398409, 14.81673165972098, 17.249472588447173, 17.912777038692653), # 19
(18.01962885855975, 19.624283945944132, 18.509271628019405, 22.077289209712237, 19.8251717903117, 11.150150216168733, 14.718275523315652, 16.50248871636009, 21.631328232239156, 14.049272189494726, 14.94117208141047, 17.394274624686105, 18.063214542073485), # 20
(18.13848210260976, 19.735769216143005, 18.614420162099496, 22.202729454161673, 19.94615550635416, 11.213501319738963, 14.801849733567167, 16.596079464314922, 21.754206032161537, 14.1290416816228, 15.026080940707608, 17.49307664210003, 18.165861544818743), # 21
(18.20878423685924, 19.792755134638462, 18.668166948679115, 22.266848310314106, 20.012835198304035, 11.245883173517461, 14.844568919860079, 16.643918110082247, 21.81701487785745, 14.169816152780836, 15.069482214678613, 17.54357937992368, 18.218329539387888), # 22
(18.23470805401675, 19.799502469135803, 18.674861728395065, 22.274875462962967, 20.029917700858675, 11.25, 14.84964720406681, 16.64908888888889, 21.824867222222224, 14.17462609053498, 15.074924466891131, 17.549815637860082, 18.225), # 23
(18.253822343461476, 19.79556666666667, 18.673766666666666, 22.273887500000004, 20.039593704506736, 11.25, 14.8468568627451, 16.6419, 21.823815, 14.17167111111111, 15.074324242424245, 17.548355555555556, 18.225), # 24
(18.272533014380844, 19.78780864197531, 18.671604938271606, 22.27193287037037, 20.049056902070106, 11.25, 14.841358024691358, 16.62777777777778, 21.82173611111111, 14.16585390946502, 15.073134118967452, 17.545473251028806, 18.225), # 25
(18.290838634286462, 19.776346913580248, 18.668406172839507, 22.269033796296295, 20.05830696315799, 11.25, 14.833236092955698, 16.60698888888889, 21.81865722222222, 14.157271275720165, 15.07136487093154, 17.54120823045268, 18.225), # 26
(18.308737770689945, 19.7613, 18.6642, 22.265212499999997, 20.067343557379587, 11.25, 14.822576470588237, 16.579800000000002, 21.814605, 14.146019999999998, 15.069027272727272, 17.535600000000002, 18.225), # 27
(18.3262289911029, 19.742786419753084, 18.659016049382718, 22.260491203703705, 20.076166354344124, 11.25, 14.809464560639071, 16.54647777777778, 21.809606111111112, 14.132196872427985, 15.066132098765433, 17.528688065843625, 18.225), # 28
(18.34331086303695, 19.720924691358025, 18.652883950617287, 22.25489212962963, 20.084775023660796, 11.25, 14.793985766158318, 16.507288888888887, 21.803687222222223, 14.115898683127574, 15.06269012345679, 17.520511934156378, 18.225), # 29
(18.359981954003697, 19.695833333333333, 18.645833333333332, 22.2484375, 20.093169234938827, 11.25, 14.776225490196078, 16.4625, 21.796875, 14.097222222222223, 15.058712121212121, 17.51111111111111, 18.225), # 30
(18.376240831514746, 19.667630864197534, 18.637893827160497, 22.241149537037035, 20.101348657787415, 11.25, 14.756269135802471, 16.412377777777778, 21.78919611111111, 14.07626427983539, 15.054208866442199, 17.500525102880662, 18.225), # 31
(18.392086063081717, 19.636435802469137, 18.629095061728393, 22.233050462962964, 20.10931296181577, 11.25, 14.734202106027599, 16.357188888888892, 21.780677222222224, 14.053121646090535, 15.0491911335578, 17.48879341563786, 18.225), # 32
(18.407516216216216, 19.602366666666665, 18.619466666666668, 22.2241625, 20.117061816633115, 11.25, 14.710109803921569, 16.2972, 21.771345, 14.027891111111112, 15.043669696969696, 17.475955555555554, 18.225), # 33
(18.422529858429858, 19.56554197530864, 18.609038271604938, 22.21450787037037, 20.12459489184864, 11.25, 14.684077632534496, 16.232677777777777, 21.761226111111114, 14.000669465020577, 15.037655331088663, 17.462051028806584, 18.225), # 34
(18.437125557234253, 19.52608024691358, 18.597839506172843, 22.204108796296293, 20.131911857071568, 11.25, 14.656190994916486, 16.163888888888888, 21.750347222222224, 13.971553497942386, 15.031158810325476, 17.447119341563788, 18.225), # 35
(18.45130188014101, 19.484099999999998, 18.5859, 22.192987499999997, 20.139012381911105, 11.25, 14.626535294117646, 16.0911, 21.738735, 13.94064, 15.024190909090908, 17.431200000000004, 18.225), # 36
(18.46505739466174, 19.43971975308642, 18.57324938271605, 22.181166203703704, 20.145896135976457, 11.25, 14.595195933188089, 16.014577777777777, 21.72641611111111, 13.908025761316873, 15.016762401795738, 17.414332510288066, 18.225), # 37
(18.47839066830806, 19.39305802469136, 18.559917283950615, 22.168667129629632, 20.152562788876843, 11.25, 14.562258315177923, 15.934588888888891, 21.713417222222223, 13.873807572016462, 15.00888406285073, 17.396556378600824, 18.225), # 38
(18.491300268591576, 19.34423333333333, 18.545933333333334, 22.1555125, 20.159012010221467, 11.25, 14.527807843137257, 15.8514, 21.699765000000003, 13.838082222222223, 15.000566666666668, 17.37791111111111, 18.225), # 39
(18.503784763023894, 19.293364197530863, 18.531327160493827, 22.14172453703704, 20.165243469619533, 11.25, 14.491929920116196, 15.765277777777781, 21.685486111111114, 13.800946502057615, 14.99182098765432, 17.358436213991773, 18.225), # 40
(18.51584271911663, 19.24056913580247, 18.51612839506173, 22.127325462962965, 20.171256836680264, 11.25, 14.454709949164851, 15.67648888888889, 21.67060722222222, 13.76249720164609, 14.982657800224468, 17.338171193415636, 18.225), # 41
(18.527472704381402, 19.18596666666667, 18.500366666666668, 22.112337500000002, 20.177051781012857, 11.25, 14.416233333333333, 15.5853, 21.655155000000004, 13.72283111111111, 14.97308787878788, 17.317155555555555, 18.225), # 42
(18.538673286329807, 19.12967530864198, 18.484071604938272, 22.096782870370372, 20.182627972226527, 11.25, 14.37658547567175, 15.491977777777779, 21.63915611111111, 13.682045020576133, 14.96312199775533, 17.295428806584365, 18.225), # 43
(18.54944303247347, 19.071813580246914, 18.467272839506176, 22.0806837962963, 20.18798507993048, 11.25, 14.335851779230211, 15.396788888888892, 21.62263722222222, 13.64023572016461, 14.952770931537597, 17.2730304526749, 18.225), # 44
(18.55978051032399, 19.0125, 18.45, 22.064062500000002, 20.193122773733933, 11.25, 14.294117647058824, 15.3, 21.605625, 13.597500000000002, 14.942045454545454, 17.25, 18.225), # 45
(18.569684287392985, 18.951853086419753, 18.432282716049382, 22.046941203703703, 20.198040723246088, 11.25, 14.251468482207699, 15.20187777777778, 21.588146111111108, 13.553934650205761, 14.930956341189674, 17.226376954732512, 18.225), # 46
(18.579152931192063, 18.88999135802469, 18.41415061728395, 22.02934212962963, 20.202738598076163, 11.25, 14.207989687726945, 15.102688888888888, 21.570227222222226, 13.50963646090535, 14.919514365881032, 17.20220082304527, 18.225), # 47
(18.588185009232834, 18.827033333333333, 18.395633333333333, 22.0112875, 20.20721606783336, 11.25, 14.163766666666668, 15.0027, 21.551895000000002, 13.464702222222222, 14.907730303030302, 17.177511111111112, 18.225), # 48
(18.596779089026917, 18.763097530864197, 18.376760493827163, 21.99279953703704, 20.211472802126895, 11.25, 14.118884822076978, 14.902177777777778, 21.53317611111111, 13.419228724279836, 14.895614927048262, 17.152347325102884, 18.225), # 49
(18.604933738085908, 18.698302469135808, 18.357561728395066, 21.973900462962963, 20.21550847056597, 11.25, 14.073429557007989, 14.801388888888889, 21.514097222222222, 13.373312757201646, 14.883179012345678, 17.126748971193418, 18.225), # 50
(18.61264752392144, 18.63276666666667, 18.338066666666666, 21.9546125, 20.219322742759797, 11.25, 14.027486274509805, 14.7006, 21.494685000000004, 13.32705111111111, 14.870433333333335, 17.10075555555556, 18.225), # 51
(18.619919014045102, 18.56660864197531, 18.318304938271606, 21.934957870370372, 20.222915288317584, 11.25, 13.981140377632535, 14.600077777777777, 21.47496611111111, 13.280540576131688, 14.857388664421999, 17.074406584362144, 18.225), # 52
(18.626746775968517, 18.49994691358025, 18.29830617283951, 21.914958796296297, 20.226285776848552, 11.25, 13.93447726942629, 14.50008888888889, 21.454967222222226, 13.233877942386831, 14.844055780022448, 17.04774156378601, 18.225), # 53
(18.63312937720329, 18.432900000000004, 18.2781, 21.8946375, 20.229433877961906, 11.25, 13.887582352941177, 14.400899999999998, 21.434715, 13.18716, 14.830445454545453, 17.0208, 18.225), # 54
(18.63906538526104, 18.365586419753086, 18.25771604938272, 21.874016203703704, 20.232359261266843, 11.25, 13.840541031227307, 14.302777777777777, 21.414236111111112, 13.140483539094651, 14.816568462401795, 16.993621399176956, 18.225), # 55
(18.64455336765337, 18.298124691358026, 18.237183950617286, 21.85311712962963, 20.235061596372585, 11.25, 13.793438707334786, 14.20598888888889, 21.393557222222224, 13.09394534979424, 14.802435578002246, 16.96624526748971, 18.225), # 56
(18.649591891891887, 18.230633333333333, 18.216533333333334, 21.8319625, 20.23754055288834, 11.25, 13.746360784313726, 14.110800000000001, 21.372705, 13.047642222222223, 14.788057575757577, 16.93871111111111, 18.225), # 57
(18.654179525488225, 18.163230864197534, 18.195793827160493, 21.810574537037034, 20.239795800423316, 11.25, 13.699392665214235, 14.017477777777778, 21.35170611111111, 13.001670946502058, 14.773445230078567, 16.91105843621399, 18.225), # 58
(18.658314835953966, 18.096035802469135, 18.174995061728396, 21.788975462962963, 20.24182700858672, 11.25, 13.65261975308642, 13.92628888888889, 21.330587222222224, 12.956128312757203, 14.758609315375981, 16.883326748971193, 18.225), # 59
(18.661996390800738, 18.02916666666667, 18.154166666666665, 21.767187500000002, 20.243633846987766, 11.25, 13.606127450980392, 13.8375, 21.309375000000003, 12.911111111111111, 14.743560606060607, 16.855555555555558, 18.225), # 60
(18.665222757540146, 17.962741975308646, 18.13333827160494, 21.74523287037037, 20.24521598523566, 11.25, 13.560001161946259, 13.751377777777778, 21.288096111111113, 12.866716131687244, 14.728309876543209, 16.82778436213992, 18.225), # 61
(18.66799250368381, 17.89688024691358, 18.112539506172844, 21.7231337962963, 20.246573092939624, 11.25, 13.514326289034132, 13.66818888888889, 21.266777222222224, 12.823040164609054, 14.712867901234567, 16.80005267489712, 18.225), # 62
(18.670304196743327, 17.831699999999998, 18.0918, 21.7009125, 20.24770483970884, 11.25, 13.469188235294117, 13.5882, 21.245445, 12.78018, 14.697245454545456, 16.7724, 18.225), # 63
(18.672156404230314, 17.767319753086422, 18.071149382716047, 21.678591203703704, 20.24861089515255, 11.25, 13.424672403776325, 13.511677777777779, 21.22412611111111, 12.738232427983538, 14.681453310886642, 16.7448658436214, 18.225), # 64
(18.67354769365639, 17.703858024691357, 18.05061728395062, 21.65619212962963, 20.24929092887994, 11.25, 13.380864197530865, 13.438888888888888, 21.202847222222225, 12.697294238683126, 14.665502244668913, 16.717489711934153, 18.225), # 65
(18.674476632533153, 17.641433333333335, 18.030233333333335, 21.6337375, 20.249744610500233, 11.25, 13.337849019607843, 13.3701, 21.181635000000004, 12.657462222222222, 14.649403030303029, 16.690311111111114, 18.225), # 66
(18.674941788372227, 17.580164197530863, 18.010027160493827, 21.611249537037036, 20.249971609622634, 11.25, 13.29571227305737, 13.30557777777778, 21.16051611111111, 12.618833168724281, 14.633166442199778, 16.6633695473251, 18.225), # 67
(18.674624906065485, 17.519847550776582, 17.989930709876543, 21.588555132850242, 20.249780319535223, 11.24979122085048, 13.254327350693364, 13.245018930041153, 21.13935812757202, 12.5813167949649, 14.616514779372677, 16.636554039419536, 18.22477527006173), # 68
(18.671655072463768, 17.458641935483872, 17.969379166666666, 21.564510326086953, 20.248039215686273, 11.248140740740741, 13.212482726423904, 13.185177777777778, 21.11723611111111, 12.543851503267971, 14.597753110047847, 16.608994152046783, 18.222994791666668), # 69
(18.665794417606012, 17.39626642771804, 17.948283179012343, 21.538956823671498, 20.244598765432098, 11.244890260631001, 13.169988242210465, 13.125514403292183, 21.09402520576132, 12.506255144032922, 14.576667995746943, 16.580560970327056, 18.219478202160495), # 70
(18.657125389157272, 17.332758303464754, 17.92665015432099, 21.51193230676329, 20.239502541757446, 11.240092455418381, 13.12686298717018, 13.066048559670783, 21.06975997942387, 12.46852864681675, 14.553337267410951, 16.551275286982886, 18.21427179783951), # 71
(18.64573043478261, 17.268154838709677, 17.9044875, 21.48347445652174, 20.23279411764706, 11.2338, 13.083126050420168, 13.0068, 21.044475000000002, 12.43067294117647, 14.527838755980863, 16.52115789473684, 18.207421875), # 72
(18.631692002147076, 17.20249330943847, 17.88180262345679, 21.45362095410628, 20.224517066085692, 11.226065569272976, 13.038796521077565, 12.947788477366256, 21.01820483539095, 12.392688956669087, 14.50025029239766, 16.490229586311454, 18.198974729938275), # 73
(18.61509253891573, 17.1358109916368, 17.858602932098762, 21.42240948067633, 20.214714960058096, 11.216941838134431, 12.9938934882595, 12.889033744855967, 20.990984053497943, 12.354577622851611, 14.470649707602341, 16.45851115442928, 18.18897665895062), # 74
(18.59601449275362, 17.06814516129032, 17.83489583333333, 21.389877717391304, 20.203431372549023, 11.206481481481482, 12.9484360410831, 12.830555555555556, 20.96284722222222, 12.316339869281046, 14.439114832535884, 16.426023391812866, 18.177473958333334), # 75
(18.57454031132582, 16.99953309438471, 17.8106887345679, 21.35606334541063, 20.19070987654321, 11.19473717421125, 12.902443268665492, 12.772373662551441, 20.93382890946502, 12.277976625514404, 14.405723498139285, 16.392787091184747, 18.164512924382716), # 76
(18.55075244229737, 16.93001206690562, 17.785989043209874, 21.32100404589372, 20.176594045025414, 11.18176159122085, 12.855934260123803, 12.714507818930043, 20.90396368312757, 12.239488821108692, 14.370553535353537, 16.358823045267492, 18.150139853395064), # 77
(18.524733333333334, 16.859619354838713, 17.760804166666667, 21.2847375, 20.16112745098039, 11.167607407407406, 12.808928104575164, 12.65697777777778, 20.87328611111111, 12.200877385620915, 14.333682775119618, 16.324152046783627, 18.134401041666667), # 78
(18.496565432098766, 16.788392234169656, 17.735141512345677, 21.24730138888889, 20.144353667392885, 11.152327297668037, 12.761443891136702, 12.59980329218107, 20.84183076131687, 12.162143248608086, 14.29518904837852, 16.28879488845571, 18.117342785493825), # 79
(18.466331186258724, 16.71636798088411, 17.70900848765432, 21.208733393719807, 20.126316267247642, 11.135973936899862, 12.713500708925546, 12.543004115226339, 20.809632201646092, 12.123287339627208, 14.255150186071239, 16.252772363006283, 18.09901138117284), # 80
(18.434113043478263, 16.643583870967742, 17.682412499999998, 21.169071195652176, 20.10705882352941, 11.118599999999999, 12.665117647058823, 12.486600000000001, 20.776725, 12.084310588235295, 14.213644019138757, 16.216105263157896, 18.079453124999997), # 81
(18.399993451422436, 16.570077180406216, 17.655360956790126, 21.12835247584541, 20.086624909222948, 11.10025816186557, 12.616313794653665, 12.430610699588478, 20.743143724279836, 12.045213923989348, 14.170748378522063, 16.178814381633096, 18.058714313271608), # 82
(18.364054857756308, 16.495885185185184, 17.6278612654321, 21.086614915458934, 20.065058097313, 11.08100109739369, 12.567108240827196, 12.37505596707819, 20.70892294238683, 12.00599827644638, 14.12654109516215, 16.14092051115443, 18.036841242283952), # 83
(18.326379710144927, 16.421045161290323, 17.599920833333332, 21.043896195652174, 20.042401960784314, 11.060881481481482, 12.517520074696545, 12.319955555555556, 20.674097222222223, 11.9666645751634, 14.0811, 16.102444444444444, 18.013880208333333), # 84
(18.287050456253354, 16.345594384707287, 17.571547067901232, 21.000233997584544, 20.01870007262164, 11.039951989026063, 12.467568385378843, 12.265329218106997, 20.63870113168724, 11.92721374969741, 14.034502923976609, 16.06340697422569, 17.989877507716052), # 85
(18.246149543746643, 16.269570131421744, 17.54274737654321, 20.955666002415462, 19.99399600580973, 11.018265294924555, 12.417272261991217, 12.21119670781893, 20.60276923868313, 11.887646729605423, 13.986827698032961, 16.02382889322071, 17.964879436728395), # 86
(18.203759420289852, 16.193009677419354, 17.513529166666665, 20.910229891304347, 19.968333333333337, 10.995874074074074, 12.366650793650793, 12.157577777777778, 20.566336111111116, 11.847964444444443, 13.938152153110048, 15.983730994152046, 17.938932291666667), # 87
(18.159962533548043, 16.11595029868578, 17.483899845679012, 20.86396334541063, 19.941755628177198, 10.972831001371743, 12.315723069474704, 12.104492181069958, 20.52943631687243, 11.808167823771482, 13.888554120148857, 15.943134069742257, 17.912082368827164), # 88
(18.11484133118626, 16.03842927120669, 17.453866820987656, 20.81690404589372, 19.91430646332607, 10.94918875171468, 12.264508178580074, 12.051959670781894, 20.492104423868312, 11.76825779714355, 13.838111430090379, 15.902058912713883, 17.884375964506173), # 89
(18.068478260869565, 15.960483870967742, 17.423437500000002, 20.769089673913047, 19.886029411764707, 10.925, 12.213025210084034, 12.0, 20.454375000000002, 11.728235294117647, 13.786901913875598, 15.860526315789475, 17.855859375), # 90
(18.020955770263015, 15.8821513739546, 17.392619290123456, 20.720557910628024, 19.85696804647785, 10.900317421124829, 12.161293253103711, 11.9486329218107, 20.41628261316873, 11.688101244250786, 13.735003402445509, 15.818557071691574, 17.826578896604936), # 91
(17.97235630703167, 15.80346905615293, 17.361419598765433, 20.671346437198068, 19.827165940450254, 10.875193689986283, 12.109331396756236, 11.897878189300412, 20.377861831275723, 11.647856577099976, 13.682493726741095, 15.776171973142736, 17.796580825617283), # 92
(17.92276231884058, 15.724474193548389, 17.329845833333334, 20.621492934782612, 19.796666666666667, 10.84968148148148, 12.057158730158731, 11.847755555555556, 20.339147222222223, 11.607502222222221, 13.62945071770335, 15.733391812865497, 17.76591145833333), # 93
(17.872256253354806, 15.645204062126643, 17.29790540123457, 20.571035084541062, 19.765513798111837, 10.823833470507545, 12.00479434242833, 11.798284773662553, 20.300173353909464, 11.567039109174534, 13.575952206273259, 15.690237383582414, 17.734617091049383), # 94
(17.820920558239397, 15.56569593787336, 17.265605709876546, 20.52001056763285, 19.733750907770517, 10.797702331961592, 11.95225732268216, 11.749485596707821, 20.260974794238685, 11.526468167513919, 13.522076023391813, 15.646729478016026, 17.70274402006173), # 95
(17.76883768115942, 15.485987096774197, 17.23295416666667, 20.468457065217393, 19.701421568627453, 10.77134074074074, 11.899566760037347, 11.701377777777779, 20.221586111111108, 11.485790326797385, 13.4679, 15.602888888888891, 17.67033854166667), # 96
(17.716090069779927, 15.406114814814819, 17.199958179012345, 20.416412258454105, 19.668569353667394, 10.744801371742112, 11.846741743611025, 11.65398106995885, 20.182041872427984, 11.445006516581941, 13.413501967038808, 15.558736408923545, 17.637446952160495), # 97
(17.66276017176597, 15.326116367980884, 17.166625154320986, 20.363913828502415, 19.635237835875095, 10.718136899862827, 11.793801362520316, 11.607315226337448, 20.142376646090533, 11.404117666424595, 13.35895975544923, 15.514292830842535, 17.604115547839505), # 98
(17.608930434782607, 15.246029032258065, 17.1329625, 20.31099945652174, 19.601470588235298, 10.6914, 11.740764705882354, 11.5614, 20.102625, 11.363124705882353, 13.304351196172249, 15.469578947368422, 17.570390625), # 99
(17.5546833064949, 15.165890083632016, 17.09897762345679, 20.257706823671498, 19.567311183732752, 10.664643347050754, 11.687650862814262, 11.516255144032922, 20.062821502057616, 11.322028564512225, 13.249754120148857, 15.42461555122374, 17.536318479938274), # 100
(17.500101234567904, 15.085736798088412, 17.064677932098768, 20.204073611111113, 19.532803195352216, 10.637919615912208, 11.634478922433171, 11.471900411522633, 20.02300072016461, 11.280830171871218, 13.195246358320043, 15.379423435131034, 17.501945408950615), # 101
(17.44526666666667, 15.005606451612904, 17.030070833333333, 20.1501375, 19.497990196078433, 10.611281481481482, 11.58126797385621, 11.428355555555555, 19.98319722222222, 11.239530457516341, 13.140905741626794, 15.334023391812867, 17.467317708333336), # 102
(17.390262050456254, 14.92553632019116, 16.9951637345679, 20.095936171497584, 19.462915758896152, 10.584781618655693, 11.528037106200506, 11.385640329218107, 19.943445576131687, 11.1981303510046, 13.086810101010101, 15.28843621399177, 17.432481674382714), # 103
(17.335169833601718, 14.845563679808842, 16.959964043209876, 20.041507306763286, 19.427623456790123, 10.558472702331962, 11.474805408583187, 11.343774485596708, 19.90378034979424, 11.156630781893005, 13.03303726741095, 15.242682694390297, 17.397483603395063), # 104
(17.280072463768114, 14.765725806451613, 16.924479166666668, 19.98688858695652, 19.392156862745097, 10.532407407407408, 11.421591970121383, 11.302777777777779, 19.86423611111111, 11.115032679738563, 12.979665071770334, 15.196783625730996, 17.362369791666666), # 105
(17.225052388620504, 14.686059976105138, 16.888716512345678, 19.932117693236716, 19.356559549745825, 10.50663840877915, 11.36841587993222, 11.262669958847736, 19.82484742798354, 11.07333697409828, 12.92677134502924, 15.15075980073641, 17.327186535493826), # 106
(17.17019205582394, 14.606603464755079, 16.852683487654325, 19.877232306763286, 19.32087509077705, 10.48121838134431, 11.31529622713283, 11.223470781893006, 19.78564886831276, 11.03154459452917, 12.874433918128654, 15.104632012129088, 17.29198013117284), # 107
(17.11557391304348, 14.5273935483871, 16.8163875, 19.822270108695655, 19.28514705882353, 10.4562, 11.262252100840335, 11.185200000000002, 19.746675000000003, 10.989656470588237, 12.82273062200957, 15.05842105263158, 17.256796875000003), # 108
(17.061280407944178, 14.448467502986858, 16.779835956790127, 19.767268780193234, 19.249419026870008, 10.431635939643346, 11.209302590171871, 11.147877366255145, 19.707960390946504, 10.947673531832486, 12.771739287612972, 15.012147714966428, 17.221683063271605), # 109
(17.007393988191087, 14.369862604540026, 16.743036265432103, 19.71226600241546, 19.213734567901238, 10.407578875171467, 11.15646678424456, 11.111522633744855, 19.669539609053498, 10.90559670781893, 12.72153774587985, 14.965832791856185, 17.18668499228395), # 110
(16.953997101449275, 14.29161612903226, 16.705995833333336, 19.65729945652174, 19.178137254901962, 10.384081481481482, 11.103763772175537, 11.076155555555555, 19.631447222222224, 10.863426928104575, 12.672203827751195, 14.919497076023394, 17.151848958333336), # 111
(16.90117219538379, 14.213765352449222, 16.66872206790124, 19.602406823671497, 19.142670660856936, 10.361196433470509, 11.051212643081925, 11.041795884773663, 19.593717798353907, 10.821165122246429, 12.623815364167996, 14.873161360190599, 17.11722125771605), # 112
(16.84890760266548, 14.136477513814715, 16.631312090853726, 19.547700988485673, 19.10731622431267, 10.338965584586125, 10.998946734582185, 11.00853462380509, 19.556483060265517, 10.778948525902914, 12.57646303107516, 14.826947285707972, 17.0827990215178), # 113
(16.796665616220118, 14.060514930345965, 16.594282215038913, 19.493620958299207, 19.071708038219388, 10.317338295353823, 10.947632775139043, 10.976780267109216, 19.52031426428351, 10.73756730224301, 12.530239806803754, 14.781441909803354, 17.048295745488062), # 114
(16.744292825407193, 13.985904957629483, 16.55765447887317, 19.440152109327204, 19.035733820199482, 10.296258322497776, 10.89730737034481, 10.946524777701677, 19.485224961603823, 10.697085590378538, 12.485078120568769, 14.736667648605932, 17.013611936988678), # 115
(16.691723771827743, 13.912538906325063, 16.521357941970972, 19.38719907047953, 18.999339347490803, 10.275675979116777, 10.847888671550209, 10.917684563218188, 19.451126410610094, 10.657428045209185, 12.440890676288666, 14.692541755477222, 16.978693067560602), # 116
(16.63889299708279, 13.840308087092497, 16.485321663946774, 19.33466647066604, 18.9624703973312, 10.255541578309604, 10.799294830105955, 10.890176031294454, 19.417929869685967, 10.618519321634633, 12.39759017788191, 14.64898148377875, 16.943484608744804), # 117
(16.58573504277338, 13.769103810591583, 16.44947470441506, 19.2824589387966, 18.925072746958516, 10.235805433175049, 10.751443997362767, 10.863915589566174, 19.385546597215082, 10.580284074554568, 12.355089329266963, 14.60590408687203, 16.907932032082243), # 118
(16.532184450500534, 13.698817387482112, 16.413746122990304, 19.23048110378107, 18.887092173610597, 10.2164178568119, 10.70425432467136, 10.838819645669062, 19.353887851581078, 10.54264695886867, 12.31330083436229, 14.563226818118581, 16.87198080911388), # 119
(16.47817576186529, 13.629340128423884, 16.37806497928697, 19.17863759452931, 18.848474454525295, 10.197329162318939, 10.657643963382455, 10.814804607238818, 19.322864891167605, 10.50553262947663, 12.272137397086349, 14.520866930879935, 16.835576411380675), # 120
(16.423643518468683, 13.560563344076693, 16.342360332919537, 19.12683303995118, 18.809165366940455, 10.178489662794956, 10.611531064846766, 10.791786881911152, 19.2923889743583, 10.468865741278133, 12.23151172135761, 14.4787416785176, 16.79866431042359), # 121
(16.36852226191174, 13.49237834510033, 16.30656124350248, 19.07497206895654, 18.76911068809392, 10.159849671338735, 10.565833780415012, 10.769682877321769, 19.2623713595368, 10.43257094917286, 12.191336511094532, 14.436768314393102, 16.761189977783587), # 122
(16.312746533795494, 13.424676442154594, 16.270596770650265, 19.02295931045525, 18.728256195223544, 10.141359501049065, 10.52047026143791, 10.74840900110637, 19.232723305086758, 10.396572908060497, 12.151524470215579, 14.394864091867959, 16.72309888500163), # 123
(16.256250875720976, 13.357348945899277, 16.234395973977367, 18.970699393357176, 18.68654766556717, 10.12296946502473, 10.475358659266176, 10.727881660900668, 19.20335606939181, 10.36079627284073, 12.111988302639215, 14.352946264303695, 16.68433650361868), # 124
(16.198969829289226, 13.290287166994178, 16.197887913098263, 18.91809694657217, 18.643930876362642, 10.104629876364521, 10.43041712525053, 10.708017264340365, 19.174180910835588, 10.32516569841324, 12.072640712283903, 14.310932085061827, 16.644848305175692), # 125
(16.14083793610127, 13.22338241609909, 16.16100164762742, 18.8650565990101, 18.60035160484781, 10.086291048167222, 10.385563810741687, 10.688732219061166, 19.145109087801753, 10.289605839677717, 12.033394403068103, 14.268738807503881, 16.604579761213643), # 126
(16.08178973775815, 13.156526003873804, 16.123666237179307, 18.81148297958082, 18.555755628260517, 10.067903293531618, 10.34071686709037, 10.669942932698781, 19.116051858673934, 10.254041351533843, 11.994162078910282, 14.226283684991369, 16.56347634327348), # 127
(16.021759775860883, 13.089609240978122, 16.08581074136841, 18.7572807171942, 18.51008872383862, 10.0494169255565, 10.295794445647289, 10.651565812888913, 19.086920481835772, 10.218396888881303, 11.954856443728904, 14.183483970885819, 16.521483522896165), # 128
(15.960682592010507, 13.022523438071834, 16.047364219809193, 18.702354440760086, 18.46329666881996, 10.03078225734065, 10.250714697763163, 10.633517267267269, 19.057626215670915, 10.182597106619781, 11.915390201442428, 14.140256918548745, 16.478546771622668), # 129
(15.89849272780806, 12.955159905814739, 16.008255732116123, 18.646608779188355, 18.415325240442385, 10.011949601982854, 10.205395774788713, 10.61571370346955, 19.028080318563003, 10.146566659648963, 11.87567605596932, 14.096519781341675, 16.434611560993947), # 130
(15.83512472485457, 12.887409954866628, 15.968414337903685, 18.589948361388856, 18.36612021594374, 9.992869272581904, 10.159755828074656, 10.59807152913147, 18.998194048895677, 10.110230202868534, 11.835626711228041, 14.052189812626125, 16.38962336255096), # 131
(15.770513124751067, 12.8191648958873, 15.927769096786342, 18.532277816271456, 18.315627372561877, 9.973491582236585, 10.113713008971706, 10.580507151888732, 18.967878665052577, 10.073512391178177, 11.795154871137056, 14.007184265763614, 16.343527647834676), # 132
(15.704592469098595, 12.750316039536544, 15.88624906837857, 18.473501772746012, 18.263792487534637, 9.95376684404568, 10.06718546883058, 10.562936979377039, 18.93704542541735, 10.036337879477578, 11.754173239614829, 13.961420394115667, 16.296269888386057), # 133
(15.63729729949817, 12.68075469647416, 15.843783312294848, 18.413524859722386, 18.210561338099865, 9.933645371107978, 10.020091359002002, 10.545277419232098, 18.905605588373632, 9.998631322666423, 11.712594520579822, 13.914815451043799, 16.24779555574605), # 134
(15.568562157550836, 12.610372177359944, 15.800300888149636, 18.352251706110444, 18.15587970149542, 9.913077476522266, 9.972348830836681, 10.527444879089616, 18.873470412305064, 9.960317375644397, 11.670331417950496, 13.867286689909534, 16.198050121455637), # 135
(15.498321584857623, 12.539059792853687, 15.755730855557415, 18.28958694082003, 18.09969335495913, 9.892013473387332, 9.923876035685343, 10.509355766585298, 18.840551155595293, 9.92132069331118, 11.627296635645319, 13.818751364074394, 16.146979057055766), # 136
(15.426510123019561, 12.466708853615184, 15.710002274132659, 18.225435192761026, 18.04194807572886, 9.870403674801956, 9.8745911248987, 10.490926489354854, 18.80675907662796, 9.881565930566463, 11.583402877582751, 13.769126726899895, 16.094527834087398), # 137
(15.353062313637686, 12.393210670304235, 15.66304420348983, 18.159701090843274, 17.982589641042455, 9.848198393864935, 9.824412249827468, 10.472073455033982, 18.772005433786706, 9.840977742309924, 11.538562847681254, 13.718330031747561, 16.040641924091503), # 138
(15.277912698313022, 12.31845655358063, 15.614785703243411, 18.092289263976646, 17.921563828137746, 9.825347943675048, 9.773257561822367, 10.452713071258394, 18.73620148545517, 9.799480783441254, 11.492689249859293, 13.66627853197891, 15.985266798609034), # 139
(15.200995818646616, 12.242337814104165, 15.565155833007877, 18.023104341071, 17.858816414252605, 9.801802637331082, 9.721045212234115, 10.432761745663793, 18.699258490016998, 9.756999708860134, 11.445694788035329, 13.612889480955465, 15.928347929180966), # 140
(15.122246216239494, 12.164745762534638, 15.514083652397689, 17.952050951036195, 17.794293176624855, 9.777512787931828, 9.667693352413432, 10.412135885885887, 18.661087705855824, 9.713459173466253, 11.39749216612783, 13.558080132038745, 15.869830787348244), # 141
(15.041598432692682, 12.08557170953184, 15.461498221027327, 17.879033722782097, 17.727939892492355, 9.752428708576069, 9.613120133711027, 10.39075189956038, 18.621600391355297, 9.66878383215929, 11.347994088055255, 13.50176773859027, 15.80966084465184), # 142
(14.958987009607215, 12.004706965755565, 15.407328598511267, 17.803957285218555, 17.659702339092952, 9.726500712362592, 9.557243707477623, 10.368526194322978, 18.580707804899063, 9.622898339838935, 11.297113257736068, 13.443869553971561, 15.747783572632711), # 143
(14.874346488584132, 11.922042841865615, 15.35150384446397, 17.72672626725544, 17.58952629366449, 9.699679112390184, 9.499982225063938, 10.34537517780939, 18.53832120487076, 9.575727351404868, 11.244762379088732, 13.384302831544138, 15.684144442831826), # 144
(14.787611411224459, 11.837470648521778, 15.29395301849992, 17.64724529780261, 17.51735753344482, 9.671914221757634, 9.441253837820689, 10.321215257655316, 18.494351849654016, 9.527195521756779, 11.190854156031712, 13.322984824669524, 15.618688926790139), # 145
(14.69871631912923, 11.750881696383855, 15.23460518023359, 17.565419005769925, 17.443141835671785, 9.643156353563725, 9.380976697098594, 10.295962841496468, 18.448710997632492, 9.477227505794348, 11.135301292483467, 13.259832786709236, 15.551362496048613), # 146
(14.607595753899481, 11.662167296111635, 15.173389389279437, 17.481152020067245, 17.36682497758323, 9.613355820907245, 9.319068954248365, 10.269534336968547, 18.401309907189823, 9.425747958417263, 11.078016492362465, 13.194763971024798, 15.482110622148213), # 147
(14.51418425713624, 11.571218758364918, 15.11023470525195, 17.394348969604433, 17.28835273641701, 9.582462936886982, 9.255448760620729, 10.241846151707264, 18.352059836709653, 9.372681534525205, 11.018912459587169, 13.127695630977726, 15.410878776629895), # 148
(14.418416370440541, 11.477927393803494, 15.045070187765598, 17.304914483291345, 17.207670889410966, 9.550428014601719, 9.190034267566393, 10.21281469334832, 18.30087204457561, 9.317952889017864, 10.957901898076038, 13.058545019929545, 15.337612431034628), # 149
(14.320226635413416, 11.382184513087163, 14.97782489643485, 17.212753190037848, 17.124725213802947, 9.517201367150248, 9.122743626436081, 10.182356369527422, 18.247657789171353, 9.261486676794918, 10.894897511747537, 12.987229391241772, 15.262257056903364), # 150
(14.219549593655895, 11.283881426875716, 14.908427890874176, 17.117769718753795, 17.0394614868308, 9.48273330763135, 9.05349498858051, 10.150387587880278, 18.19232832888052, 9.20320755275606, 10.829812004520129, 12.91366599827593, 15.184758125777073), # 151
(14.116319786769019, 11.182909445828951, 14.836808230698063, 17.019868698349054, 16.951825485732364, 9.446974149143815, 8.982206505350396, 10.116824756042595, 18.134794922086748, 9.143040171800969, 10.762558080312278, 12.837772094393538, 15.105061109196717), # 152
(14.010471756353809, 11.079159880606662, 14.762894975520963, 16.91895475773348, 16.8617629877455, 9.409874204786428, 8.908796328096455, 10.081584281650072, 18.07496882717368, 9.080909188829333, 10.693048443042448, 12.759464932956115, 15.02311147870325), # 153
(13.901940044011312, 10.972524041868644, 14.686617184957365, 16.81493252581694, 16.769219770108045, 9.371383787657978, 8.83318260816941, 10.044582572338422, 18.01276130252496, 9.016739258740834, 10.6211957966291, 12.678661767325185, 14.938854705837642), # 154
(13.790659191342543, 10.86289324027469, 14.607903918621735, 16.707706631509282, 16.674141610057855, 9.331453210857248, 8.75528349691997, 10.005736035743345, 17.948083606524232, 8.950455036435159, 10.5469128449907, 12.595279850862267, 14.852236262140847), # 155
(13.676563739948545, 10.750158786484597, 14.526684236128547, 16.597181703720377, 16.576474284832766, 9.29003278748303, 8.67501714569886, 9.964961079500554, 17.88084699755513, 8.88198117681199, 10.470112292045709, 12.50923643692888, 14.763201619153833), # 156
(13.559588231430352, 10.634211991158162, 14.442887197092272, 16.483262371360087, 16.476163571670632, 9.247072830634105, 8.592301705856794, 9.922174111245749, 17.8109627340013, 8.811242334771014, 10.39070684171259, 12.420448778886547, 14.671696248417557), # 157
(13.43642570352943, 10.512815617390064, 14.352465517024239, 16.36158524697224, 16.368625990567796, 9.199844057370798, 8.505192097670143, 9.87443451422887, 17.732991764878374, 8.73605864932406, 10.306072354570096, 12.32567921554981, 14.573674546947622), # 158
(13.288116180561124, 10.37351757527906, 14.232128073125379, 16.207158885819215, 16.22734435760693, 9.132641366412786, 8.40278297409429, 9.804984358975888, 17.61556907019986, 8.644105789377742, 10.20135048411419, 12.206452542629595, 14.445769764456351), # 159
(13.112769770827757, 10.215174111373285, 14.0794577243206, 16.017439518735948, 16.04955623642423, 9.043814332885832, 8.284038747090811, 9.712078541149223, 17.455365409011574, 8.534170173353209, 10.075067115497172, 12.060903507998123, 14.285557096008445), # 160
(12.911799698254727, 10.038817562544844, 13.896084549438555, 15.79423050676211, 15.837107623707803, 8.934439034826566, 8.149826602812377, 9.596880959597605, 17.254493580598233, 8.407184747707687, 9.928334978279473, 11.890381444033627, 14.094673280674375), # 161
(12.686619186767443, 9.84548026566583, 13.683638627307893, 15.539335210937388, 15.591844516145768, 8.80559155027162, 8.001013727411657, 9.460555513169764, 17.015066384244545, 8.264082458898416, 9.762266802021516, 11.696235683114327, 13.874755057524599), # 162
(12.438641460291295, 9.636194557608343, 13.443750036757264, 15.254556992301481, 15.315612910426239, 8.65834795725763, 7.838467307041322, 9.304266100714425, 16.73919661923523, 8.105796253382625, 9.577975316283736, 11.479815557618458, 13.627439165629584), # 163
(12.16927974275169, 9.411992775244478, 13.178048856615318, 14.941699211894072, 15.01025880323734, 8.493784333821234, 7.663054527854039, 9.129176621080324, 16.428997084855002, 7.933259077617543, 9.376573250626553, 11.242470399924246, 13.35436234405979), # 164
(11.879947258074031, 9.173907255446338, 12.888165165710705, 14.602565230754854, 14.677628191267182, 8.312976757999055, 7.475642576002479, 8.936450973116184, 16.086580580388564, 7.747403878060404, 9.1591733346104, 10.985549542409915, 13.057161331885686), # 165
(11.572057230183715, 8.922970335086019, 12.57572904287207, 14.238958409923503, 14.319567071203886, 8.117001307827735, 7.277098637639315, 8.727253055670738, 15.714059905120632, 7.549163601168441, 8.926888297795703, 10.710402317453703, 12.737472868177733), # 166
(11.24702288300614, 8.660214351035616, 12.242370566928068, 13.852682110439718, 13.937921439735565, 7.906934061343905, 7.0682898989172145, 8.502746767592717, 15.31354785833592, 7.339471193398886, 8.680830869742888, 10.418378057433825, 12.396933692006392), # 167
(10.906257440466712, 8.386671640167231, 11.889719816707347, 13.445539693343184, 13.534537293550335, 7.683851096584198, 6.850083545988848, 8.264096007730847, 14.887157239319139, 7.11925960120897, 8.422113780012385, 10.11082609472852, 12.037180542442131), # 168
(10.551174126490828, 8.103374539352963, 11.519406871038555, 13.019334519673588, 13.111260629336316, 7.4488284915852505, 6.623346765006885, 8.012464674933861, 14.437000847355009, 6.889461771055926, 8.151849758164623, 9.78909576171601, 11.659850158555415), # 169
(10.18318616500389, 7.811355385464907, 11.133061808750343, 12.575869950470615, 12.66993744378162, 7.2029423243836925, 6.388946742123995, 7.749016668050485, 13.96519148172823, 6.6510106493969845, 7.871151533760029, 9.454536390774527, 11.2665792794167), # 170
(9.8037067799313, 7.511646515375161, 10.73231470867136, 12.116949346773964, 12.21241373357437, 6.947268673016157, 6.147750663492849, 7.47491588592945, 13.47384194172352, 6.404839182689379, 7.581131836359027, 9.108497314282296, 10.859004644096458), # 171
(9.414149195198457, 7.205280265955825, 10.318795649630257, 11.644376069623315, 11.740535495402677, 6.682883615519281, 5.900625715266118, 7.191326227419487, 12.965065026625595, 6.151880317390344, 7.282903395522049, 8.752327864617548, 10.438762991665145), # 172
(9.015926634730764, 6.893288974078996, 9.894134710455681, 11.159953480058356, 11.256148725954663, 6.410863229929695, 5.64843908359647, 6.899411591369322, 12.440973535719161, 5.893066999957107, 6.97757894080952, 8.387377374158506, 10.007491061193234), # 173
(8.610452322453618, 6.576704976616772, 9.459961969976282, 10.665484939118773, 10.76109942191844, 6.132283594284034, 5.3920579546365754, 6.600335876627689, 11.903680268288936, 5.629332176846904, 6.66627120178187, 8.014995175283403, 9.566825591751181), # 174
(8.19913948229242, 6.256560610441251, 9.017907507020714, 10.162773807844262, 10.257233579982124, 5.848220786618931, 5.132349514539104, 6.295262982043313, 11.35529802361963, 5.361608794516964, 6.3500929079995245, 7.636530600370466, 9.118403322409455), # 175
(7.783401338172574, 5.933888212424531, 8.569601400417621, 9.653623447274505, 9.746397196833835, 5.55975088497102, 4.870180949456727, 5.985356806464928, 10.797939600995955, 5.090829799424521, 6.0301567890229135, 7.253332981797922, 8.663860992238513), # 176
(7.364651114019479, 5.6097201194387125, 8.116673728995655, 9.13983721844919, 9.230436269161691, 5.267949967376934, 4.606419445542112, 5.671781248741259, 10.233717799702626, 4.817928138026804, 5.7075755744124645, 6.866751651944002, 8.204835340308824), # 177
(6.944302033758534, 5.285088668355891, 7.660754571583465, 8.623218482408008, 8.711196793653805, 4.973894111873309, 4.341932188947932, 5.355700207721038, 9.664745419024355, 4.54383675678105, 5.383461993728603, 6.478135943186929, 7.742963105690853), # 178
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179
)
passenger_arriving_acc = (
(6, 8, 12, 6, 7, 5, 6, 1, 4, 0, 1, 2, 0, 14, 9, 4, 3, 9, 4, 3, 1, 7, 3, 5, 0, 0), # 0
(12, 23, 18, 21, 14, 11, 8, 6, 7, 0, 2, 5, 0, 22, 17, 9, 10, 15, 10, 10, 6, 11, 5, 7, 1, 0), # 1
(22, 30, 27, 29, 22, 17, 13, 14, 10, 4, 2, 7, 0, 29, 34, 12, 19, 25, 17, 12, 8, 14, 12, 7, 2, 0), # 2
(28, 38, 38, 38, 28, 20, 18, 19, 15, 9, 5, 12, 0, 40, 48, 23, 23, 38, 22, 15, 14, 16, 19, 9, 4, 0), # 3
(41, 52, 49, 50, 37, 26, 26, 24, 21, 11, 8, 12, 0, 50, 63, 34, 31, 45, 31, 18, 15, 17, 21, 12, 4, 0), # 4
(52, 64, 67, 68, 45, 33, 29, 27, 28, 17, 10, 16, 0, 64, 71, 41, 35, 57, 40, 26, 16, 22, 25, 15, 4, 0), # 5
(62, 77, 76, 83, 51, 38, 34, 38, 34, 20, 14, 18, 0, 77, 78, 50, 41, 66, 45, 33, 18, 26, 26, 17, 4, 0), # 6
(78, 91, 91, 93, 61, 44, 36, 44, 42, 22, 15, 18, 0, 100, 84, 68, 48, 83, 50, 42, 24, 35, 30, 19, 6, 0), # 7
(102, 102, 99, 107, 73, 52, 43, 47, 49, 25, 17, 18, 0, 112, 99, 79, 52, 97, 53, 46, 26, 40, 35, 22, 10, 0), # 8
(121, 122, 115, 116, 79, 57, 51, 50, 53, 28, 18, 20, 0, 123, 117, 86, 56, 109, 62, 47, 28, 47, 38, 23, 13, 0), # 9
(142, 143, 130, 135, 86, 66, 60, 57, 58, 29, 21, 23, 0, 137, 132, 95, 62, 124, 68, 57, 30, 51, 47, 26, 15, 0), # 10
(158, 157, 139, 152, 94, 72, 62, 62, 65, 32, 25, 25, 0, 150, 151, 102, 69, 135, 75, 62, 34, 53, 53, 32, 15, 0), # 11
(172, 175, 158, 172, 106, 78, 68, 64, 69, 33, 27, 26, 0, 165, 168, 117, 81, 141, 83, 71, 39, 59, 59, 34, 19, 0), # 12
(184, 189, 176, 185, 123, 84, 73, 67, 79, 34, 28, 27, 0, 184, 182, 129, 94, 153, 90, 75, 43, 65, 64, 35, 20, 0), # 13
(197, 205, 188, 195, 145, 87, 77, 77, 89, 37, 33, 28, 0, 197, 201, 136, 110, 165, 96, 78, 49, 68, 67, 38, 23, 0), # 14
(218, 218, 202, 217, 156, 92, 81, 82, 97, 40, 34, 29, 0, 208, 230, 147, 120, 184, 100, 85, 53, 76, 72, 42, 23, 0), # 15
(231, 235, 217, 229, 166, 99, 91, 85, 106, 44, 36, 30, 0, 232, 246, 156, 129, 197, 109, 92, 57, 85, 76, 46, 24, 0), # 16
(254, 248, 230, 242, 180, 107, 96, 94, 114, 49, 39, 32, 0, 249, 263, 166, 140, 206, 117, 99, 61, 90, 81, 48, 27, 0), # 17
(270, 260, 244, 255, 190, 112, 101, 101, 121, 50, 42, 36, 0, 271, 284, 176, 149, 215, 126, 105, 68, 98, 85, 49, 28, 0), # 18
(292, 273, 261, 267, 198, 121, 107, 106, 129, 52, 44, 39, 0, 288, 298, 186, 163, 232, 135, 111, 72, 107, 90, 53, 32, 0), # 19
(306, 289, 269, 285, 216, 127, 119, 116, 136, 53, 46, 40, 0, 305, 313, 205, 173, 255, 138, 119, 75, 115, 100, 54, 32, 0), # 20
(320, 301, 292, 299, 232, 130, 129, 122, 145, 54, 49, 41, 0, 325, 328, 217, 189, 267, 147, 126, 84, 124, 106, 56, 36, 0), # 21
(338, 322, 308, 316, 243, 135, 136, 131, 148, 58, 50, 43, 0, 340, 348, 229, 195, 279, 156, 141, 86, 131, 112, 59, 38, 0), # 22
(353, 337, 325, 332, 252, 143, 147, 138, 156, 65, 52, 46, 0, 355, 367, 242, 206, 296, 162, 152, 91, 136, 116, 61, 41, 0), # 23
(367, 353, 341, 352, 263, 149, 154, 142, 164, 67, 53, 48, 0, 374, 375, 254, 215, 303, 176, 163, 96, 143, 120, 64, 45, 0), # 24
(382, 373, 352, 380, 279, 152, 157, 147, 172, 69, 53, 50, 0, 394, 401, 269, 225, 315, 183, 172, 99, 149, 126, 67, 48, 0), # 25
(399, 397, 374, 402, 294, 155, 164, 151, 175, 74, 54, 53, 0, 415, 418, 282, 238, 326, 193, 176, 103, 153, 130, 71, 52, 0), # 26
(419, 422, 386, 413, 305, 162, 172, 152, 186, 79, 56, 55, 0, 430, 440, 292, 242, 342, 202, 185, 107, 163, 134, 73, 53, 0), # 27
(438, 439, 409, 435, 313, 166, 178, 164, 195, 81, 63, 59, 0, 443, 457, 305, 251, 364, 210, 195, 109, 169, 141, 78, 53, 0), # 28
(462, 460, 422, 448, 329, 171, 186, 173, 202, 86, 65, 59, 0, 469, 469, 321, 261, 377, 221, 201, 114, 178, 144, 80, 55, 0), # 29
(479, 480, 436, 461, 340, 173, 190, 184, 213, 93, 69, 62, 0, 482, 487, 338, 270, 395, 230, 208, 120, 184, 152, 85, 55, 0), # 30
(500, 498, 452, 490, 356, 175, 200, 191, 222, 94, 69, 62, 0, 503, 506, 352, 279, 407, 241, 215, 125, 188, 158, 89, 58, 0), # 31
(524, 515, 468, 503, 373, 185, 209, 198, 225, 95, 72, 67, 0, 524, 524, 361, 291, 424, 250, 219, 129, 195, 165, 92, 61, 0), # 32
(539, 529, 485, 518, 383, 189, 218, 208, 237, 98, 76, 71, 0, 537, 538, 371, 300, 440, 266, 228, 132, 201, 174, 95, 61, 0), # 33
(558, 549, 499, 541, 397, 198, 226, 215, 245, 102, 80, 71, 0, 554, 545, 383, 312, 460, 272, 236, 139, 211, 182, 97, 62, 0), # 34
(572, 561, 512, 560, 412, 205, 235, 222, 251, 108, 82, 73, 0, 572, 552, 395, 323, 468, 287, 245, 144, 218, 184, 100, 62, 0), # 35
(589, 580, 534, 580, 424, 208, 241, 226, 262, 111, 83, 75, 0, 581, 561, 403, 331, 481, 293, 247, 146, 229, 185, 103, 64, 0), # 36
(604, 603, 547, 600, 437, 212, 250, 232, 272, 113, 84, 77, 0, 600, 582, 417, 337, 492, 298, 253, 154, 231, 193, 105, 65, 0), # 37
(617, 624, 565, 616, 444, 216, 258, 239, 277, 117, 85, 77, 0, 619, 594, 432, 342, 508, 307, 258, 158, 236, 200, 107, 65, 0), # 38
(635, 644, 577, 628, 455, 223, 261, 245, 281, 119, 88, 77, 0, 638, 614, 441, 351, 524, 321, 262, 165, 246, 209, 110, 68, 0), # 39
(651, 660, 591, 651, 462, 228, 268, 255, 292, 121, 90, 80, 0, 663, 632, 455, 355, 550, 328, 268, 169, 252, 220, 114, 74, 0), # 40
(665, 675, 609, 675, 478, 232, 271, 260, 300, 125, 94, 82, 0, 684, 647, 464, 370, 560, 335, 272, 172, 255, 222, 115, 75, 0), # 41
(681, 690, 618, 694, 488, 236, 276, 266, 312, 129, 95, 85, 0, 701, 662, 481, 382, 572, 342, 279, 179, 262, 225, 117, 78, 0), # 42
(697, 714, 641, 712, 505, 243, 284, 273, 323, 132, 97, 88, 0, 716, 677, 488, 397, 582, 352, 284, 185, 266, 231, 120, 80, 0), # 43
(715, 733, 658, 729, 510, 247, 285, 277, 331, 136, 100, 90, 0, 735, 698, 496, 414, 599, 356, 289, 188, 270, 241, 123, 80, 0), # 44
(734, 750, 672, 746, 523, 260, 291, 284, 341, 140, 106, 90, 0, 754, 716, 512, 421, 616, 364, 293, 193, 278, 248, 125, 83, 0), # 45
(747, 766, 686, 764, 534, 267, 296, 290, 345, 144, 108, 90, 0, 767, 728, 528, 435, 633, 371, 300, 199, 282, 254, 127, 84, 0), # 46
(767, 782, 703, 780, 546, 277, 303, 297, 352, 147, 111, 90, 0, 784, 747, 541, 441, 647, 381, 311, 201, 291, 256, 128, 86, 0), # 47
(789, 799, 719, 796, 566, 280, 313, 304, 365, 150, 111, 91, 0, 799, 768, 559, 448, 657, 389, 320, 204, 293, 261, 131, 87, 0), # 48
(808, 811, 739, 807, 575, 288, 324, 315, 371, 154, 112, 95, 0, 812, 785, 574, 456, 670, 401, 329, 212, 301, 265, 135, 89, 0), # 49
(826, 828, 762, 820, 591, 298, 331, 317, 380, 155, 116, 95, 0, 831, 803, 593, 466, 679, 412, 336, 216, 308, 267, 139, 91, 0), # 50
(850, 838, 776, 834, 601, 302, 338, 324, 386, 161, 118, 97, 0, 848, 823, 606, 473, 698, 423, 341, 219, 315, 274, 145, 91, 0), # 51
(870, 858, 787, 848, 611, 305, 346, 333, 390, 164, 121, 98, 0, 865, 840, 620, 484, 705, 429, 347, 222, 319, 281, 148, 93, 0), # 52
(892, 881, 798, 863, 627, 309, 351, 339, 394, 168, 123, 98, 0, 887, 859, 629, 494, 724, 436, 351, 226, 329, 287, 153, 93, 0), # 53
(910, 900, 815, 887, 642, 316, 357, 344, 403, 171, 124, 101, 0, 910, 870, 640, 502, 734, 450, 355, 232, 333, 291, 157, 93, 0), # 54
(925, 921, 830, 903, 656, 319, 365, 352, 407, 175, 128, 101, 0, 938, 887, 654, 511, 742, 460, 360, 237, 340, 295, 160, 93, 0), # 55
(941, 938, 846, 916, 665, 324, 375, 356, 411, 181, 128, 104, 0, 957, 901, 665, 519, 751, 465, 366, 241, 348, 301, 166, 94, 0), # 56
(961, 958, 851, 936, 677, 333, 383, 363, 416, 185, 129, 107, 0, 972, 913, 679, 526, 768, 473, 373, 245, 354, 305, 168, 97, 0), # 57
(978, 973, 866, 960, 685, 343, 389, 365, 423, 191, 135, 108, 0, 993, 924, 692, 536, 787, 478, 382, 251, 360, 308, 171, 98, 0), # 58
(994, 994, 880, 966, 703, 349, 401, 369, 427, 195, 136, 108, 0, 1003, 934, 702, 548, 803, 487, 388, 254, 372, 315, 176, 98, 0), # 59
(1008, 1014, 898, 982, 713, 358, 411, 373, 434, 199, 139, 110, 0, 1023, 946, 712, 555, 818, 497, 394, 260, 379, 322, 178, 99, 0), # 60
(1027, 1025, 912, 997, 727, 361, 418, 379, 441, 206, 139, 113, 0, 1035, 962, 727, 562, 831, 509, 396, 264, 385, 328, 178, 99, 0), # 61
(1063, 1041, 929, 1010, 744, 365, 427, 384, 452, 210, 139, 113, 0, 1046, 977, 741, 576, 850, 522, 409, 267, 394, 331, 181, 101, 0), # 62
(1080, 1059, 940, 1033, 762, 370, 433, 388, 460, 215, 139, 115, 0, 1076, 986, 756, 585, 855, 529, 419, 268, 399, 334, 184, 105, 0), # 63
(1098, 1074, 962, 1045, 778, 376, 439, 397, 465, 216, 142, 117, 0, 1089, 1005, 769, 598, 864, 538, 426, 269, 405, 342, 186, 105, 0), # 64
(1112, 1082, 982, 1058, 795, 378, 446, 407, 470, 221, 143, 118, 0, 1109, 1025, 787, 612, 875, 547, 434, 274, 411, 350, 186, 106, 0), # 65
(1135, 1101, 998, 1078, 812, 384, 449, 417, 481, 225, 148, 119, 0, 1127, 1037, 794, 617, 894, 554, 444, 279, 419, 355, 190, 106, 0), # 66
(1149, 1116, 1018, 1093, 827, 388, 453, 423, 484, 228, 153, 119, 0, 1143, 1059, 803, 624, 905, 561, 451, 283, 428, 359, 193, 107, 0), # 67
(1163, 1128, 1035, 1108, 841, 392, 461, 426, 492, 232, 154, 119, 0, 1160, 1078, 819, 632, 920, 569, 456, 287, 440, 367, 195, 108, 0), # 68
(1175, 1153, 1052, 1126, 856, 401, 471, 437, 505, 233, 158, 121, 0, 1179, 1090, 832, 648, 930, 578, 464, 291, 447, 371, 197, 109, 0), # 69
(1189, 1166, 1067, 1148, 866, 408, 474, 440, 510, 237, 161, 121, 0, 1203, 1115, 848, 658, 946, 583, 470, 294, 452, 380, 197, 110, 0), # 70
(1205, 1182, 1087, 1167, 883, 415, 480, 446, 516, 239, 163, 123, 0, 1211, 1130, 855, 667, 961, 588, 476, 298, 459, 385, 200, 112, 0), # 71
(1224, 1192, 1105, 1187, 902, 416, 488, 450, 523, 241, 163, 123, 0, 1233, 1145, 874, 681, 970, 595, 478, 301, 467, 389, 204, 112, 0), # 72
(1249, 1207, 1117, 1203, 913, 421, 498, 456, 534, 241, 166, 125, 0, 1255, 1156, 884, 687, 983, 600, 492, 308, 477, 398, 206, 113, 0), # 73
(1270, 1221, 1129, 1218, 926, 429, 506, 463, 543, 245, 166, 125, 0, 1277, 1173, 895, 696, 1001, 607, 502, 311, 483, 404, 211, 113, 0), # 74
(1293, 1247, 1142, 1238, 937, 443, 512, 467, 550, 250, 167, 127, 0, 1295, 1181, 905, 707, 1015, 614, 510, 315, 490, 411, 212, 115, 0), # 75
(1309, 1262, 1161, 1259, 954, 453, 519, 478, 552, 251, 169, 128, 0, 1307, 1194, 922, 723, 1027, 617, 515, 320, 501, 413, 216, 116, 0), # 76
(1322, 1283, 1180, 1275, 966, 459, 523, 482, 561, 254, 173, 128, 0, 1325, 1209, 941, 735, 1039, 622, 523, 323, 508, 416, 219, 117, 0), # 77
(1345, 1295, 1193, 1295, 982, 468, 530, 486, 570, 256, 176, 130, 0, 1339, 1231, 957, 746, 1050, 625, 530, 327, 514, 417, 221, 117, 0), # 78
(1364, 1309, 1205, 1312, 1004, 477, 538, 492, 577, 260, 178, 134, 0, 1365, 1249, 971, 753, 1063, 635, 533, 335, 523, 425, 222, 118, 0), # 79
(1386, 1320, 1225, 1325, 1020, 483, 542, 495, 582, 266, 179, 135, 0, 1394, 1262, 981, 763, 1077, 639, 537, 339, 528, 429, 224, 118, 0), # 80
(1403, 1337, 1235, 1343, 1031, 489, 552, 500, 584, 268, 180, 135, 0, 1411, 1277, 998, 772, 1097, 647, 540, 344, 537, 434, 232, 119, 0), # 81
(1417, 1348, 1247, 1364, 1042, 495, 563, 505, 590, 270, 182, 141, 0, 1427, 1293, 1007, 789, 1113, 653, 551, 347, 542, 436, 235, 120, 0), # 82
(1431, 1360, 1262, 1386, 1056, 498, 569, 509, 593, 273, 184, 143, 0, 1449, 1305, 1021, 798, 1127, 659, 555, 351, 548, 441, 238, 121, 0), # 83
(1449, 1374, 1279, 1403, 1066, 505, 574, 518, 602, 274, 184, 147, 0, 1470, 1319, 1033, 806, 1144, 667, 564, 356, 552, 448, 240, 124, 0), # 84
(1463, 1385, 1291, 1424, 1085, 509, 575, 525, 607, 275, 188, 147, 0, 1488, 1332, 1044, 809, 1162, 675, 574, 363, 563, 453, 242, 125, 0), # 85
(1479, 1395, 1308, 1439, 1098, 510, 579, 527, 619, 279, 190, 151, 0, 1501, 1342, 1057, 817, 1186, 683, 579, 367, 570, 455, 248, 126, 0), # 86
(1496, 1413, 1323, 1447, 1111, 518, 596, 530, 625, 281, 190, 153, 0, 1524, 1356, 1068, 826, 1194, 694, 588, 375, 579, 458, 252, 127, 0), # 87
(1514, 1427, 1336, 1462, 1122, 527, 602, 534, 633, 285, 194, 155, 0, 1542, 1368, 1074, 838, 1212, 703, 593, 379, 588, 463, 256, 128, 0), # 88
(1534, 1445, 1349, 1476, 1135, 533, 609, 536, 635, 287, 196, 155, 0, 1556, 1378, 1081, 847, 1226, 706, 597, 385, 594, 466, 260, 128, 0), # 89
(1555, 1461, 1365, 1491, 1141, 539, 614, 540, 643, 292, 198, 157, 0, 1580, 1392, 1088, 857, 1239, 709, 605, 389, 600, 475, 263, 130, 0), # 90
(1581, 1475, 1374, 1505, 1147, 543, 624, 548, 647, 294, 198, 157, 0, 1594, 1407, 1099, 863, 1255, 715, 608, 392, 607, 480, 263, 131, 0), # 91
(1594, 1490, 1386, 1525, 1160, 548, 627, 555, 651, 299, 199, 157, 0, 1612, 1424, 1111, 870, 1263, 728, 613, 397, 612, 485, 263, 133, 0), # 92
(1619, 1500, 1400, 1540, 1177, 554, 629, 561, 660, 300, 204, 159, 0, 1626, 1435, 1120, 878, 1284, 733, 622, 402, 621, 491, 266, 136, 0), # 93
(1638, 1515, 1415, 1559, 1191, 558, 637, 567, 665, 303, 205, 160, 0, 1645, 1452, 1133, 886, 1299, 740, 629, 411, 624, 494, 267, 136, 0), # 94
(1655, 1526, 1423, 1580, 1206, 562, 646, 569, 675, 304, 206, 162, 0, 1657, 1468, 1138, 893, 1313, 747, 636, 415, 630, 499, 268, 138, 0), # 95
(1675, 1535, 1432, 1593, 1217, 569, 652, 574, 680, 305, 210, 163, 0, 1678, 1481, 1153, 898, 1326, 754, 640, 423, 633, 504, 271, 139, 0), # 96
(1695, 1551, 1447, 1606, 1234, 575, 658, 581, 686, 311, 214, 164, 0, 1701, 1492, 1164, 908, 1342, 761, 643, 428, 641, 510, 274, 141, 0), # 97
(1705, 1565, 1453, 1619, 1247, 584, 667, 584, 694, 314, 217, 166, 0, 1723, 1501, 1173, 919, 1352, 773, 645, 433, 648, 512, 277, 141, 0), # 98
(1723, 1580, 1467, 1634, 1256, 587, 674, 591, 702, 318, 222, 168, 0, 1741, 1514, 1184, 932, 1362, 781, 651, 436, 653, 515, 281, 143, 0), # 99
(1747, 1594, 1481, 1658, 1263, 594, 680, 594, 708, 320, 226, 170, 0, 1762, 1528, 1204, 942, 1379, 785, 653, 441, 665, 520, 283, 144, 0), # 100
(1769, 1605, 1498, 1668, 1275, 598, 684, 597, 716, 324, 228, 170, 0, 1776, 1541, 1216, 951, 1394, 795, 659, 444, 672, 529, 285, 144, 0), # 101
(1786, 1623, 1508, 1682, 1290, 603, 690, 601, 725, 324, 230, 171, 0, 1792, 1554, 1224, 956, 1405, 806, 662, 449, 679, 531, 289, 146, 0), # 102
(1805, 1634, 1527, 1694, 1302, 610, 697, 606, 731, 327, 233, 172, 0, 1808, 1565, 1241, 963, 1416, 816, 668, 453, 686, 537, 292, 147, 0), # 103
(1817, 1651, 1540, 1717, 1315, 616, 703, 610, 737, 337, 234, 173, 0, 1829, 1579, 1257, 972, 1433, 824, 675, 461, 691, 541, 293, 148, 0), # 104
(1835, 1663, 1558, 1737, 1331, 623, 707, 617, 747, 339, 235, 173, 0, 1852, 1592, 1269, 984, 1447, 831, 680, 467, 699, 544, 295, 149, 0), # 105
(1847, 1675, 1572, 1753, 1349, 629, 712, 622, 753, 343, 237, 174, 0, 1877, 1611, 1281, 989, 1458, 837, 684, 470, 711, 549, 298, 152, 0), # 106
(1862, 1683, 1592, 1766, 1361, 640, 722, 623, 759, 344, 239, 174, 0, 1888, 1629, 1296, 1001, 1470, 845, 689, 474, 718, 552, 301, 152, 0), # 107
(1879, 1701, 1608, 1779, 1367, 647, 732, 627, 768, 346, 245, 175, 0, 1899, 1645, 1306, 1006, 1485, 851, 697, 481, 723, 558, 303, 153, 0), # 108
(1897, 1715, 1620, 1793, 1376, 650, 736, 632, 773, 349, 249, 178, 0, 1916, 1658, 1314, 1015, 1500, 855, 701, 488, 729, 562, 305, 154, 0), # 109
(1908, 1727, 1632, 1811, 1394, 658, 743, 632, 778, 353, 249, 180, 0, 1932, 1671, 1328, 1023, 1515, 860, 706, 492, 736, 565, 305, 154, 0), # 110
(1928, 1736, 1652, 1826, 1409, 664, 751, 638, 785, 354, 253, 182, 0, 1952, 1685, 1335, 1026, 1527, 866, 710, 494, 738, 568, 306, 154, 0), # 111
(1946, 1743, 1670, 1839, 1427, 671, 759, 639, 791, 356, 253, 184, 0, 1971, 1698, 1345, 1030, 1540, 873, 714, 500, 742, 573, 312, 155, 0), # 112
(1966, 1759, 1687, 1858, 1439, 678, 764, 645, 802, 357, 256, 184, 0, 1989, 1708, 1353, 1033, 1554, 877, 719, 504, 744, 579, 317, 155, 0), # 113
(1989, 1770, 1702, 1875, 1445, 686, 767, 651, 808, 358, 256, 185, 0, 2013, 1716, 1362, 1039, 1568, 881, 726, 510, 747, 584, 318, 155, 0), # 114
(2005, 1786, 1718, 1893, 1456, 690, 771, 654, 814, 363, 258, 185, 0, 2027, 1727, 1369, 1042, 1586, 886, 730, 514, 759, 587, 323, 155, 0), # 115
(2019, 1801, 1728, 1911, 1466, 693, 777, 657, 820, 365, 261, 186, 0, 2046, 1742, 1378, 1053, 1595, 892, 734, 518, 765, 594, 325, 155, 0), # 116
(2037, 1815, 1743, 1930, 1475, 696, 781, 660, 827, 368, 263, 187, 0, 2070, 1757, 1386, 1056, 1617, 898, 736, 524, 773, 597, 328, 156, 0), # 117
(2045, 1826, 1751, 1939, 1491, 703, 787, 667, 831, 369, 266, 188, 0, 2088, 1765, 1394, 1063, 1630, 901, 741, 527, 777, 601, 330, 157, 0), # 118
(2059, 1834, 1761, 1950, 1501, 710, 796, 673, 838, 374, 268, 188, 0, 2110, 1777, 1404, 1071, 1641, 907, 743, 530, 787, 606, 336, 158, 0), # 119
(2072, 1843, 1775, 1965, 1512, 722, 806, 677, 845, 378, 271, 189, 0, 2126, 1793, 1416, 1078, 1658, 916, 747, 532, 791, 610, 338, 159, 0), # 120
(2086, 1860, 1783, 1984, 1525, 723, 809, 679, 851, 380, 275, 189, 0, 2143, 1810, 1428, 1082, 1672, 922, 753, 533, 800, 613, 338, 162, 0), # 121
(2105, 1874, 1799, 2000, 1536, 731, 815, 683, 856, 381, 275, 189, 0, 2162, 1824, 1441, 1087, 1685, 927, 755, 537, 802, 617, 345, 163, 0), # 122
(2116, 1887, 1820, 2017, 1550, 734, 819, 688, 863, 383, 275, 192, 0, 2174, 1841, 1457, 1096, 1700, 937, 762, 539, 812, 623, 347, 163, 0), # 123
(2131, 1903, 1828, 2036, 1557, 738, 819, 696, 869, 385, 277, 195, 0, 2194, 1852, 1466, 1102, 1714, 941, 766, 544, 815, 629, 350, 164, 0), # 124
(2148, 1915, 1843, 2057, 1566, 749, 824, 700, 874, 387, 280, 196, 0, 2218, 1866, 1476, 1111, 1728, 944, 772, 549, 824, 634, 352, 165, 0), # 125
(2168, 1924, 1862, 2070, 1584, 752, 827, 706, 879, 388, 280, 199, 0, 2229, 1877, 1485, 1114, 1736, 952, 777, 552, 831, 640, 355, 165, 0), # 126
(2189, 1936, 1869, 2088, 1592, 759, 830, 710, 885, 388, 282, 200, 0, 2239, 1885, 1497, 1123, 1742, 959, 781, 557, 842, 646, 358, 166, 0), # 127
(2207, 1957, 1880, 2101, 1607, 759, 839, 715, 893, 391, 282, 204, 0, 2260, 1898, 1502, 1130, 1752, 963, 788, 559, 844, 650, 362, 166, 0), # 128
(2227, 1969, 1891, 2118, 1616, 762, 847, 720, 897, 395, 284, 204, 0, 2278, 1910, 1508, 1138, 1772, 970, 793, 564, 852, 655, 364, 169, 0), # 129
(2238, 1976, 1902, 2134, 1634, 770, 855, 725, 901, 399, 285, 206, 0, 2294, 1919, 1515, 1146, 1785, 975, 796, 569, 864, 658, 370, 170, 0), # 130
(2251, 1987, 1908, 2142, 1644, 772, 861, 729, 909, 401, 285, 209, 0, 2308, 1925, 1529, 1157, 1794, 982, 803, 574, 869, 660, 377, 171, 0), # 131
(2261, 2000, 1917, 2153, 1656, 779, 870, 734, 918, 405, 286, 210, 0, 2333, 1938, 1540, 1168, 1807, 985, 807, 577, 876, 663, 378, 171, 0), # 132
(2271, 2013, 1926, 2166, 1664, 781, 873, 737, 922, 409, 290, 213, 0, 2360, 1951, 1551, 1179, 1821, 991, 812, 580, 887, 665, 380, 171, 0), # 133
(2293, 2021, 1943, 2180, 1677, 784, 882, 742, 931, 416, 294, 215, 0, 2387, 1964, 1562, 1188, 1837, 996, 820, 581, 893, 666, 385, 173, 0), # 134
(2309, 2031, 1954, 2191, 1692, 788, 886, 746, 935, 420, 295, 215, 0, 2401, 1979, 1573, 1192, 1853, 1007, 823, 586, 901, 670, 390, 177, 0), # 135
(2331, 2047, 1968, 2201, 1705, 795, 889, 748, 939, 420, 296, 216, 0, 2413, 1994, 1582, 1201, 1865, 1016, 828, 589, 913, 675, 390, 177, 0), # 136
(2348, 2060, 1978, 2216, 1719, 800, 892, 753, 948, 420, 298, 217, 0, 2425, 2010, 1589, 1210, 1878, 1019, 832, 593, 919, 678, 390, 177, 0), # 137
(2369, 2077, 1991, 2234, 1733, 805, 898, 759, 954, 422, 301, 218, 0, 2438, 2024, 1599, 1218, 1887, 1022, 836, 595, 922, 685, 394, 178, 0), # 138
(2382, 2086, 2008, 2249, 1748, 807, 905, 761, 960, 425, 302, 218, 0, 2451, 2035, 1608, 1226, 1894, 1027, 840, 597, 930, 688, 399, 180, 0), # 139
(2400, 2092, 2019, 2263, 1755, 812, 913, 764, 967, 428, 306, 219, 0, 2464, 2048, 1617, 1234, 1903, 1036, 842, 600, 931, 692, 401, 181, 0), # 140
(2416, 2101, 2028, 2280, 1763, 816, 920, 770, 972, 432, 308, 219, 0, 2475, 2060, 1622, 1242, 1914, 1042, 845, 605, 938, 694, 404, 181, 0), # 141
(2432, 2112, 2033, 2294, 1778, 822, 925, 775, 979, 435, 311, 221, 0, 2490, 2080, 1630, 1247, 1924, 1049, 852, 606, 943, 703, 408, 181, 0), # 142
(2448, 2124, 2053, 2311, 1789, 830, 933, 780, 986, 441, 313, 221, 0, 2513, 2093, 1642, 1252, 1935, 1057, 856, 610, 950, 709, 412, 181, 0), # 143
(2466, 2135, 2068, 2322, 1801, 834, 938, 783, 997, 446, 316, 222, 0, 2531, 2102, 1651, 1260, 1943, 1065, 859, 615, 953, 713, 415, 181, 0), # 144
(2483, 2147, 2084, 2333, 1810, 840, 944, 788, 1002, 449, 317, 224, 0, 2549, 2116, 1663, 1266, 1957, 1073, 866, 620, 963, 719, 424, 181, 0), # 145
(2504, 2155, 2097, 2345, 1826, 847, 948, 789, 1009, 450, 317, 225, 0, 2568, 2125, 1671, 1273, 1972, 1086, 873, 624, 965, 722, 425, 183, 0), # 146
(2519, 2163, 2112, 2355, 1841, 849, 953, 792, 1018, 455, 319, 227, 0, 2579, 2135, 1680, 1278, 1979, 1096, 877, 626, 971, 725, 426, 184, 0), # 147
(2536, 2174, 2121, 2367, 1855, 855, 957, 795, 1028, 456, 319, 227, 0, 2595, 2141, 1688, 1287, 1989, 1103, 882, 628, 974, 727, 428, 184, 0), # 148
(2554, 2181, 2137, 2380, 1865, 864, 959, 800, 1037, 459, 319, 228, 0, 2604, 2159, 1699, 1294, 2002, 1108, 887, 630, 986, 734, 431, 186, 0), # 149
(2567, 2195, 2147, 2390, 1874, 872, 960, 803, 1040, 460, 320, 229, 0, 2618, 2171, 1706, 1302, 2014, 1115, 889, 635, 991, 740, 435, 187, 0), # 150
(2584, 2202, 2166, 2406, 1884, 878, 964, 806, 1043, 463, 322, 230, 0, 2632, 2178, 1713, 1311, 2022, 1119, 890, 637, 1000, 744, 437, 187, 0), # 151
(2596, 2213, 2180, 2416, 1896, 883, 971, 810, 1052, 466, 324, 231, 0, 2647, 2184, 1721, 1318, 2033, 1124, 894, 641, 1004, 746, 441, 187, 0), # 152
(2613, 2221, 2197, 2436, 1911, 885, 975, 812, 1058, 468, 325, 231, 0, 2666, 2194, 1727, 1327, 2048, 1127, 897, 647, 1013, 752, 444, 188, 0), # 153
(2632, 2237, 2211, 2453, 1923, 892, 981, 817, 1062, 469, 327, 231, 0, 2678, 2212, 1738, 1334, 2064, 1132, 897, 651, 1017, 755, 449, 189, 0), # 154
(2638, 2254, 2229, 2462, 1928, 900, 983, 819, 1066, 471, 327, 233, 0, 2696, 2220, 1743, 1337, 2079, 1136, 901, 657, 1024, 757, 453, 189, 0), # 155
(2648, 2264, 2241, 2473, 1934, 905, 985, 824, 1072, 471, 330, 234, 0, 2709, 2235, 1750, 1343, 2094, 1143, 904, 663, 1032, 761, 455, 191, 0), # 156
(2663, 2272, 2248, 2483, 1950, 913, 987, 829, 1077, 473, 331, 234, 0, 2728, 2246, 1758, 1347, 2105, 1151, 906, 665, 1035, 764, 459, 191, 0), # 157
(2672, 2279, 2255, 2494, 1961, 920, 993, 830, 1082, 474, 331, 235, 0, 2745, 2260, 1765, 1351, 2113, 1154, 908, 670, 1044, 768, 460, 191, 0), # 158
(2682, 2287, 2267, 2506, 1972, 928, 999, 835, 1089, 475, 331, 236, 0, 2757, 2270, 1769, 1357, 2124, 1158, 909, 670, 1046, 768, 462, 192, 0), # 159
(2696, 2293, 2277, 2514, 1976, 932, 1002, 841, 1092, 475, 332, 236, 0, 2779, 2280, 1772, 1363, 2133, 1161, 912, 675, 1054, 773, 463, 192, 0), # 160
(2701, 2306, 2288, 2525, 1984, 935, 1010, 843, 1099, 478, 333, 237, 0, 2794, 2291, 1779, 1374, 2143, 1166, 919, 677, 1061, 779, 464, 194, 0), # 161
(2713, 2315, 2303, 2532, 1999, 944, 1014, 849, 1104, 479, 334, 238, 0, 2815, 2298, 1788, 1380, 2155, 1170, 929, 680, 1072, 781, 468, 195, 0), # 162
(2728, 2322, 2315, 2544, 2006, 952, 1021, 851, 1107, 479, 336, 241, 0, 2825, 2307, 1799, 1384, 2162, 1174, 934, 685, 1073, 785, 471, 197, 0), # 163
(2740, 2325, 2331, 2553, 2017, 956, 1023, 854, 1112, 479, 336, 244, 0, 2836, 2314, 1806, 1392, 2168, 1177, 936, 688, 1077, 787, 476, 197, 0), # 164
(2751, 2337, 2338, 2565, 2031, 960, 1028, 857, 1119, 482, 337, 245, 0, 2843, 2325, 1814, 1395, 2178, 1183, 938, 690, 1085, 792, 477, 200, 0), # 165
(2764, 2347, 2350, 2577, 2045, 964, 1032, 861, 1128, 482, 339, 246, 0, 2857, 2342, 1829, 1398, 2182, 1186, 947, 693, 1091, 796, 479, 201, 0), # 166
(2786, 2353, 2355, 2583, 2057, 968, 1034, 866, 1136, 483, 339, 246, 0, 2860, 2350, 1836, 1401, 2192, 1190, 949, 697, 1096, 798, 480, 201, 0), # 167
(2797, 2362, 2368, 2593, 2067, 973, 1039, 869, 1142, 486, 340, 246, 0, 2871, 2366, 1845, 1405, 2199, 1199, 952, 698, 1103, 802, 483, 203, 0), # 168
(2798, 2373, 2383, 2606, 2079, 977, 1044, 873, 1148, 486, 340, 246, 0, 2885, 2372, 1850, 1411, 2214, 1202, 956, 707, 1111, 806, 484, 203, 0), # 169
(2810, 2380, 2392, 2615, 2089, 987, 1047, 874, 1154, 489, 340, 247, 0, 2890, 2380, 1852, 1416, 2220, 1208, 959, 710, 1114, 809, 488, 203, 0), # 170
(2819, 2389, 2401, 2622, 2106, 989, 1051, 879, 1158, 489, 340, 247, 0, 2904, 2386, 1855, 1421, 2229, 1214, 963, 711, 1117, 810, 491, 206, 0), # 171
(2828, 2397, 2411, 2634, 2111, 991, 1055, 883, 1163, 490, 342, 247, 0, 2913, 2393, 1856, 1425, 2241, 1221, 965, 713, 1119, 814, 493, 206, 0), # 172
(2841, 2404, 2420, 2650, 2117, 996, 1055, 884, 1166, 491, 342, 247, 0, 2923, 2400, 1859, 1432, 2249, 1227, 967, 715, 1120, 817, 495, 206, 0), # 173
(2847, 2406, 2434, 2655, 2126, 998, 1056, 886, 1169, 492, 343, 250, 0, 2939, 2409, 1864, 1440, 2255, 1234, 968, 716, 1121, 822, 495, 207, 0), # 174
(2854, 2412, 2444, 2662, 2132, 1000, 1061, 889, 1172, 493, 343, 251, 0, 2946, 2417, 1869, 1443, 2260, 1237, 970, 717, 1126, 823, 495, 207, 0), # 175
(2860, 2416, 2451, 2666, 2138, 1004, 1063, 891, 1173, 495, 343, 252, 0, 2950, 2426, 1874, 1447, 2272, 1239, 977, 720, 1130, 825, 497, 207, 0), # 176
(2866, 2421, 2457, 2673, 2139, 1004, 1066, 895, 1176, 496, 344, 253, 0, 2959, 2431, 1878, 1454, 2275, 1241, 979, 721, 1132, 826, 499, 210, 0), # 177
(2872, 2428, 2463, 2677, 2143, 1007, 1067, 899, 1180, 500, 344, 254, 0, 2969, 2435, 1881, 1459, 2282, 1243, 981, 722, 1136, 831, 499, 211, 0), # 178
(2872, 2428, 2463, 2677, 2143, 1007, 1067, 899, 1180, 500, 344, 254, 0, 2969, 2435, 1881, 1459, 2282, 1243, 981, 722, 1136, 831, 499, 211, 0), # 179
)
passenger_arriving_rate = (
(9.037558041069182, 9.116726123493724, 7.81692484441876, 8.389801494715634, 6.665622729131535, 3.295587678639206, 3.7314320538365235, 3.4898821297345672, 3.654059437300804, 1.781106756985067, 1.261579549165681, 0.7346872617459261, 0.0, 9.150984382641052, 8.081559879205185, 6.307897745828405, 5.3433202709552, 7.308118874601608, 4.885834981628395, 3.7314320538365235, 2.3539911990280045, 3.3328113645657673, 2.7966004982385453, 1.5633849688837522, 0.828793283953975, 0.0), # 0
(9.637788873635953, 9.718600145338852, 8.333019886995228, 8.943944741923431, 7.106988404969084, 3.5132827632446837, 3.9775220471373247, 3.7196352921792815, 3.8953471957997454, 1.8985413115247178, 1.3449288407868398, 0.7831824991221532, 0.0, 9.755624965391739, 8.615007490343684, 6.724644203934198, 5.695623934574153, 7.790694391599491, 5.207489409050994, 3.9775220471373247, 2.509487688031917, 3.553494202484542, 2.9813149139744777, 1.6666039773990458, 0.883509104121714, 0.0), # 1
(10.236101416163518, 10.318085531970116, 8.847063428321121, 9.495883401297473, 7.546755568499692, 3.7301093702380674, 4.222636657164634, 3.948468935928315, 4.135672084126529, 2.015511198759246, 1.4279469446328943, 0.8314848978079584, 0.0, 10.357856690777442, 9.14633387588754, 7.13973472316447, 6.046533596277737, 8.271344168253059, 5.527856510299641, 4.222636657164634, 2.6643638358843336, 3.773377784249846, 3.1652944670991583, 1.7694126856642243, 0.938007775633647, 0.0), # 2
(10.830164027663812, 10.912803828195138, 9.357016303979782, 10.0434281501683, 7.983194011202283, 3.9452076537143688, 4.46580327748316, 4.175475868120881, 4.374081096552656, 2.1315522142917818, 1.5103045235482149, 0.8794028527395692, 0.0, 10.955291051257605, 9.67343138013526, 7.551522617741075, 6.3946566428753435, 8.748162193105312, 5.845666215369232, 4.46580327748316, 2.818005466938835, 3.9915970056011414, 3.3478093833894342, 1.8714032607959565, 0.9920730752904672, 0.0), # 3
(11.417645067148767, 11.500376578821527, 9.860839349554556, 10.584389665866468, 8.41457352455579, 4.1577177677686015, 4.706049301657613, 4.399748895896186, 4.609621227349624, 2.246200153725456, 1.5916722403771728, 0.9267447588532147, 0.0, 11.54553953929167, 10.19419234738536, 7.958361201885864, 6.738600461176366, 9.219242454699248, 6.159648454254661, 4.706049301657613, 2.969798405549001, 4.207286762277895, 3.528129888622157, 1.9721678699109113, 1.0454887798928663, 0.0), # 4
(11.996212893630318, 12.07842532865692, 10.356493400628777, 11.11657862572253, 8.839163900039136, 4.366779866495776, 4.942402123252702, 4.620380826393444, 4.841339470788935, 2.3589908126633987, 1.67172075796414, 0.9733190110851223, 0.0, 12.126213647339089, 10.706509121936344, 8.358603789820698, 7.076972437990195, 9.68267894157787, 6.468533156950822, 4.942402123252702, 3.119128476068411, 4.419581950019568, 3.705526208574178, 2.071298680125756, 1.0980386662415385, 0.0), # 5
(12.5635358661204, 12.644571622508925, 10.8419392927858, 11.63780570706703, 9.255234929131252, 4.571534103990907, 5.173889135833137, 4.836464466751867, 5.068282821142089, 2.469459986708742, 1.750120739153485, 1.0189340043715214, 0.0, 12.694924867859292, 11.208274048086732, 8.750603695767424, 7.408379960126224, 10.136565642284179, 6.771050253452613, 5.173889135833137, 3.265381502850648, 4.627617464565626, 3.8792685690223445, 2.16838785855716, 1.1495065111371752, 0.0), # 6
(13.117282343630944, 13.196437005185167, 11.315137861608953, 12.145881587230525, 9.661056403311065, 4.771120634349007, 5.399537732963626, 5.047092624110664, 5.289498272680586, 2.5771434714646144, 1.8265428467895808, 1.0633981336486396, 0.0, 13.249284693311735, 11.697379470135033, 9.132714233947903, 7.7314304143938415, 10.578996545361171, 7.06592967375493, 5.399537732963626, 3.4079433102492906, 4.830528201655532, 4.048627195743509, 2.2630275723217905, 1.1996760913804698, 0.0), # 7
(13.655120685173882, 13.731643021493262, 11.774049942681595, 12.638616943543553, 10.054898114057503, 4.964679611665085, 5.618375308208878, 5.251358105609044, 5.504032819675924, 2.681577062534149, 1.9006577437167966, 1.1065197938527056, 0.0, 13.786904616155851, 12.171717732379758, 9.503288718583983, 8.044731187602444, 11.008065639351848, 7.351901347852662, 5.618375308208878, 3.5461997226179176, 5.027449057028751, 4.212872314514518, 2.3548099885363194, 1.248331183772115, 0.0), # 8
(14.174719249761154, 14.247811216240837, 12.216636371587056, 13.11382245333668, 10.43502985284949, 5.151351190034158, 5.829429255133608, 5.4483537183862225, 5.710933456399605, 2.782296555520474, 1.9721360927795035, 1.1481073799199473, 0.0, 14.305396128851092, 12.629181179119417, 9.860680463897518, 8.34688966656142, 11.42186691279921, 7.627695205740712, 5.829429255133608, 3.679536564310113, 5.217514926424745, 4.371274151112227, 2.4433272743174115, 1.2952555651128035, 0.0), # 9
(14.673746396404677, 14.7425631342355, 12.640857983908687, 13.569308793940438, 10.799721411165962, 5.330275523551238, 6.031726967302519, 5.637172269581408, 5.909247177123128, 2.878837746026722, 2.0406485568220725, 1.187969286786593, 0.0, 14.802370723856898, 13.06766215465252, 10.20324278411036, 8.636513238080164, 11.818494354246257, 7.892041177413972, 6.031726967302519, 3.8073396596794558, 5.399860705582981, 4.52310293131348, 2.5281715967817378, 1.3402330122032275, 0.0), # 10
(15.149870484116411, 15.213520320284891, 13.044675615229824, 14.002886642685386, 11.14724258048584, 5.500592766311337, 6.224295838280325, 5.816906566333811, 6.098020976117995, 2.970736429656024, 2.105865798688875, 1.2259139093888718, 0.0, 15.2754398936327, 13.485053003277587, 10.529328993444373, 8.912209288968072, 12.19604195223599, 8.143669192867335, 6.224295838280325, 3.9289948330795266, 5.57362129024292, 4.66762888089513, 2.6089351230459648, 1.3830473018440812, 0.0), # 11
(15.600759871908263, 15.6583043191966, 13.42605010113381, 14.412366676902078, 11.475863152288053, 5.6614430724094635, 6.406163261631731, 5.986649415782641, 6.276301847655707, 3.0575284020115086, 2.1674584812242808, 1.2617496426630104, 0.0, 15.722215130637963, 13.879246069293112, 10.837292406121403, 9.172585206034523, 12.552603695311413, 8.381309182095698, 6.406163261631731, 4.043887908863902, 5.737931576144026, 4.804122225634027, 2.6852100202267626, 1.4234822108360548, 0.0), # 12
(16.02408291879218, 16.074536675778273, 13.782942277203993, 14.795559573921057, 11.783852918051522, 5.8119665959406355, 6.576356630921451, 6.145493625067111, 6.443136786007759, 3.138749458696308, 2.225097267272661, 1.2952848815452382, 0.0, 16.140307927332124, 14.248133696997618, 11.125486336363304, 9.416248376088921, 12.886273572015519, 8.603691075093955, 6.576356630921451, 4.151404711386168, 5.891926459025761, 4.93185319130702, 2.756588455440799, 1.4613215159798432, 0.0), # 13
(16.41750798378009, 16.45983893483752, 14.113312979023721, 15.150276011072872, 12.069481669255186, 5.9513034909998614, 6.733903339714195, 6.292532001326435, 6.597572785445653, 3.2139353953135514, 2.2784528196783858, 1.3263280209717843, 0.0, 16.527329776174614, 14.589608230689624, 11.392264098391927, 9.641806185940652, 13.195145570891306, 8.80954480185701, 6.733903339714195, 4.250931064999901, 6.034740834627593, 5.050092003690958, 2.8226625958047444, 1.4963489940761385, 0.0), # 14
(16.77870342588394, 16.811832641181958, 14.415123042176313, 15.474326665688082, 12.33101919737797, 6.078593911682158, 6.877830781574663, 6.426857351699818, 6.738656840240891, 3.2826220074663714, 2.3271958012858263, 1.3546874558788757, 0.0, 16.880892169624886, 14.90156201466763, 11.63597900642913, 9.847866022399112, 13.477313680481782, 8.997600292379746, 6.877830781574663, 4.341852794058684, 6.165509598688985, 5.158108888562695, 2.883024608435263, 1.5283484219256327, 0.0), # 15
(17.10533760411564, 17.128139339619217, 14.686333302245139, 15.765522215097217, 12.566735293898798, 6.192978012082533, 7.007166350067579, 6.547562483326471, 6.865435944664972, 3.344345090757899, 2.370996874939354, 1.380171581202741, 0.0, 17.198606600142384, 15.181887393230149, 11.85498437469677, 10.033035272273695, 13.730871889329944, 9.16658747665706, 7.007166350067579, 4.423555722916095, 6.283367646949399, 5.255174071699074, 2.9372666604490276, 1.55710357632902, 0.0), # 16
(17.395078877487137, 17.406380574956913, 14.92490459481353, 16.021673336630855, 12.774899750296605, 6.2935959462960005, 7.12093743875764, 6.653740203345614, 6.976957092989391, 3.398640440791261, 2.40952670348334, 1.4025887918796085, 0.0, 17.47808456018655, 15.428476710675692, 12.047633517416699, 10.195921322373781, 13.953914185978782, 9.31523628468386, 7.12093743875764, 4.4954256759257145, 6.387449875148302, 5.340557778876952, 2.984980918962706, 1.5823982340869922, 0.0), # 17
(17.645595605010367, 17.644177892002652, 15.12879775546482, 16.24059070761953, 12.953782358050306, 6.379587868417579, 7.2181714412095666, 6.744483318896446, 7.072267279485658, 3.4450438531695924, 2.4424559497621527, 1.4217474828457075, 0.0, 17.716937542216822, 15.63922231130278, 12.212279748810763, 10.335131559508774, 14.144534558971316, 9.442276646455024, 7.2181714412095666, 4.556848477441128, 6.476891179025153, 5.413530235873177, 3.0257595510929645, 1.6040161720002415, 0.0), # 18
(17.85455614569726, 17.83915283556408, 15.29597361978237, 16.420085005393776, 13.10165290863884, 6.450093932542269, 7.297895750988055, 6.818884637118185, 7.150413498425267, 3.4830911234960236, 2.4694552766201636, 1.4374560490372645, 0.0, 17.912777038692653, 15.812016539409907, 12.347276383100818, 10.449273370488068, 14.300826996850533, 9.546438491965459, 7.297895750988055, 4.607209951815906, 6.55082645431942, 5.473361668464593, 3.059194723956474, 1.621741166869462, 0.0), # 19
(18.01962885855975, 17.988926950448786, 15.424393023349506, 16.55796690728418, 13.216781193541133, 6.504254292765094, 7.359137761657826, 6.876036965150038, 7.210442744079718, 3.5123180473736824, 2.490195346901745, 1.4495228853905089, 0.0, 18.063214542073485, 15.944751739295596, 12.450976734508725, 10.536954142121044, 14.420885488159437, 9.626451751210054, 7.359137761657826, 4.645895923403639, 6.608390596770566, 5.51932230242806, 3.084878604669901, 1.6353569954953444, 0.0), # 20
(18.13848210260976, 18.09112178146442, 15.51201680174958, 16.652047090621256, 13.297437004236105, 6.541209103181062, 7.400924866783583, 6.915033110131218, 7.251402010720512, 3.532260420405701, 2.5043468234512685, 1.4577563868416692, 0.0, 18.165861544818743, 16.03532025525836, 12.52173411725634, 10.5967812612171, 14.502804021441024, 9.681046354183705, 7.400924866783583, 4.672292216557902, 6.648718502118053, 5.550682363540419, 3.1024033603499164, 1.644647434678584, 0.0), # 21
(18.20878423685924, 18.143358873418588, 15.55680579056593, 16.70013623273558, 13.341890132202689, 6.560098517885186, 7.422284459930039, 6.934965879200936, 7.27233829261915, 3.54245403819521, 2.5115803691131027, 1.4619649483269737, 0.0, 18.218329539387888, 16.08161443159671, 12.557901845565512, 10.627362114585626, 14.5446765852383, 9.70895223088131, 7.422284459930039, 4.6857846556322755, 6.6709450661013445, 5.5667120775785275, 3.111361158113186, 1.649396261219872, 0.0), # 22
(18.23470805401675, 18.14954393004115, 15.562384773662554, 16.706156597222225, 13.353278467239116, 6.5625, 7.424823602033405, 6.937120370370371, 7.274955740740741, 3.543656522633746, 2.512487411148522, 1.4624846364883404, 0.0, 18.225, 16.08733100137174, 12.56243705574261, 10.630969567901236, 14.549911481481482, 9.71196851851852, 7.424823602033405, 4.6875, 6.676639233619558, 5.568718865740743, 3.1124769547325113, 1.6499585390946503, 0.0), # 23
(18.253822343461476, 18.145936111111112, 15.561472222222221, 16.705415625000004, 13.359729136337823, 6.5625, 7.42342843137255, 6.934125, 7.274604999999999, 3.5429177777777783, 2.5123873737373743, 1.462362962962963, 0.0, 18.225, 16.085992592592593, 12.561936868686871, 10.628753333333332, 14.549209999999999, 9.707775, 7.42342843137255, 4.6875, 6.679864568168911, 5.568471875000002, 3.1122944444444447, 1.649630555555556, 0.0), # 24
(18.272533014380844, 18.138824588477366, 15.559670781893006, 16.70394965277778, 13.366037934713404, 6.5625, 7.420679012345679, 6.928240740740742, 7.273912037037037, 3.541463477366256, 2.512189019827909, 1.4621227709190674, 0.0, 18.225, 16.08335048010974, 12.560945099139545, 10.624390432098766, 14.547824074074073, 9.69953703703704, 7.420679012345679, 4.6875, 6.683018967356702, 5.567983217592594, 3.1119341563786014, 1.6489840534979427, 0.0), # 25
(18.290838634286462, 18.128318004115226, 15.557005144032923, 16.70177534722222, 13.372204642105325, 6.5625, 7.416618046477849, 6.919578703703704, 7.27288574074074, 3.539317818930042, 2.511894145155257, 1.4617673525377233, 0.0, 18.225, 16.079440877914955, 12.559470725776283, 10.617953456790124, 14.54577148148148, 9.687410185185186, 7.416618046477849, 4.6875, 6.686102321052663, 5.567258449074075, 3.111401028806585, 1.648028909465021, 0.0), # 26
(18.308737770689945, 18.114524999999997, 15.553500000000001, 16.698909375, 13.378229038253057, 6.5625, 7.411288235294118, 6.908250000000002, 7.271535, 3.5365050000000005, 2.5115045454545455, 1.4613000000000003, 0.0, 18.225, 16.0743, 12.557522727272728, 10.609514999999998, 14.54307, 9.671550000000002, 7.411288235294118, 4.6875, 6.689114519126528, 5.566303125, 3.1107000000000005, 1.646775, 0.0), # 27
(18.3262289911029, 18.097554218106993, 15.549180041152265, 16.695368402777778, 13.384110902896083, 6.5625, 7.404732280319536, 6.894365740740742, 7.269868703703704, 3.533049218106997, 2.5110220164609056, 1.4607240054869688, 0.0, 18.225, 16.067964060356655, 12.555110082304529, 10.599147654320989, 14.539737407407408, 9.652112037037039, 7.404732280319536, 4.6875, 6.6920554514480415, 5.565122800925927, 3.1098360082304533, 1.6452322016460905, 0.0), # 28
(18.34331086303695, 18.077514300411522, 15.54406995884774, 16.69116909722222, 13.389850015773863, 6.5625, 7.396992883079159, 6.8780370370370365, 7.267895740740741, 3.5289746707818943, 2.510448353909465, 1.4600426611796984, 0.0, 18.225, 16.06046927297668, 12.552241769547326, 10.58692401234568, 14.535791481481482, 9.629251851851851, 7.396992883079159, 4.6875, 6.694925007886932, 5.563723032407409, 3.1088139917695483, 1.6434103909465023, 0.0), # 29
(18.359981954003697, 18.054513888888888, 15.538194444444445, 16.686328125000003, 13.395446156625884, 6.5625, 7.388112745098039, 6.859375, 7.265625, 3.5243055555555567, 2.509785353535354, 1.4592592592592593, 0.0, 18.225, 16.05185185185185, 12.548926767676768, 10.572916666666668, 14.53125, 9.603125, 7.388112745098039, 4.6875, 6.697723078312942, 5.562109375000001, 3.107638888888889, 1.6413194444444446, 0.0), # 30
(18.376240831514746, 18.028661625514406, 15.531578189300415, 16.680862152777777, 13.400899105191609, 6.5625, 7.378134567901236, 6.838490740740741, 7.26306537037037, 3.5190660699588485, 2.5090348110737, 1.458377091906722, 0.0, 18.225, 16.04214801097394, 12.5451740553685, 10.557198209876542, 14.52613074074074, 9.573887037037037, 7.378134567901236, 4.6875, 6.7004495525958045, 5.56028738425926, 3.106315637860083, 1.638969238683128, 0.0), # 31
(18.392086063081717, 18.000066152263376, 15.524245884773661, 16.674787847222223, 13.406208641210513, 6.5625, 7.3671010530137995, 6.815495370370372, 7.260225740740741, 3.5132804115226346, 2.5081985222596335, 1.4573994513031552, 0.0, 18.225, 16.031393964334704, 12.540992611298167, 10.539841234567902, 14.520451481481482, 9.541693518518521, 7.3671010530137995, 4.6875, 6.703104320605257, 5.558262615740742, 3.1048491769547324, 1.6363696502057616, 0.0), # 32
(18.407516216216216, 17.96883611111111, 15.516222222222224, 16.668121874999997, 13.411374544422076, 6.5625, 7.355054901960784, 6.790500000000001, 7.257115, 3.506972777777779, 2.507278282828283, 1.4563296296296298, 0.0, 18.225, 16.019625925925926, 12.536391414141413, 10.520918333333334, 14.51423, 9.5067, 7.355054901960784, 4.6875, 6.705687272211038, 5.5560406250000005, 3.103244444444445, 1.6335305555555555, 0.0), # 33
(18.422529858429858, 17.93508014403292, 15.507531893004115, 16.660880902777777, 13.41639659456576, 6.5625, 7.342038816267248, 6.7636157407407405, 7.253742037037037, 3.500167366255145, 2.5062758885147773, 1.4551709190672155, 0.0, 18.225, 16.006880109739367, 12.531379442573886, 10.500502098765432, 14.507484074074075, 9.469062037037038, 7.342038816267248, 4.6875, 6.70819829728288, 5.553626967592593, 3.1015063786008232, 1.6304618312757202, 0.0), # 34
(18.437125557234253, 17.898906893004114, 15.49819958847737, 16.65308159722222, 13.421274571381044, 6.5625, 7.328095497458243, 6.734953703703703, 7.250115740740741, 3.4928883744855974, 2.5051931350542462, 1.4539266117969825, 0.0, 18.225, 15.993192729766804, 12.52596567527123, 10.47866512345679, 14.500231481481482, 9.428935185185185, 7.328095497458243, 4.6875, 6.710637285690522, 5.551027199074074, 3.099639917695474, 1.627173353909465, 0.0), # 35
(18.45130188014101, 17.860424999999996, 15.488249999999999, 16.644740624999997, 13.426008254607403, 6.5625, 7.313267647058823, 6.704625000000001, 7.246244999999999, 3.485160000000001, 2.504031818181818, 1.4526000000000006, 0.0, 18.225, 15.978600000000004, 12.520159090909091, 10.45548, 14.492489999999998, 9.386475, 7.313267647058823, 4.6875, 6.7130041273037016, 5.548246875, 3.0976500000000002, 1.623675, 0.0), # 36
(18.46505739466174, 17.819743106995883, 15.477707818930043, 16.63587465277778, 13.430597423984304, 6.5625, 7.2975979665940445, 6.672740740740741, 7.242138703703703, 3.477006440329219, 2.502793733632623, 1.451194375857339, 0.0, 18.225, 15.963138134430727, 12.513968668163116, 10.431019320987655, 14.484277407407406, 9.341837037037038, 7.2975979665940445, 4.6875, 6.715298711992152, 5.545291550925927, 3.0955415637860084, 1.619976646090535, 0.0), # 37
(18.47839066830806, 17.776969855967078, 15.466597736625513, 16.626500347222226, 13.435041859251228, 6.5625, 7.281129157588961, 6.639412037037038, 7.237805740740741, 3.4684518930041164, 2.5014806771417883, 1.4497130315500688, 0.0, 18.225, 15.946843347050754, 12.507403385708942, 10.405355679012347, 14.475611481481481, 9.295176851851854, 7.281129157588961, 4.6875, 6.717520929625614, 5.542166782407409, 3.0933195473251027, 1.61608816872428, 0.0), # 38
(18.491300268591576, 17.732213888888886, 15.454944444444445, 16.616634375, 13.439341340147644, 6.5625, 7.2639039215686285, 6.60475, 7.233255000000001, 3.4595205555555566, 2.500094444444445, 1.4481592592592594, 0.0, 18.225, 15.92975185185185, 12.500472222222223, 10.378561666666666, 14.466510000000001, 9.24665, 7.2639039215686285, 4.6875, 6.719670670073822, 5.538878125000001, 3.0909888888888895, 1.6120194444444444, 0.0), # 39
(18.503784763023894, 17.685583847736623, 15.442772633744857, 16.60629340277778, 13.443495646413021, 6.5625, 7.245964960058098, 6.568865740740742, 7.228495370370371, 3.4502366255144046, 2.49863683127572, 1.4465363511659812, 0.0, 18.225, 15.911899862825791, 12.4931841563786, 10.350709876543212, 14.456990740740743, 9.196412037037039, 7.245964960058098, 4.6875, 6.721747823206511, 5.535431134259261, 3.0885545267489714, 1.6077803497942387, 0.0), # 40
(18.51584271911663, 17.637188374485596, 15.430106995884776, 16.595494097222222, 13.447504557786843, 6.5625, 7.2273549745824255, 6.531870370370371, 7.22353574074074, 3.4406243004115233, 2.4971096333707448, 1.4448475994513033, 0.0, 18.225, 15.893323593964332, 12.485548166853723, 10.321872901234567, 14.44707148148148, 9.14461851851852, 7.2273549745824255, 4.6875, 6.723752278893421, 5.531831365740742, 3.0860213991769556, 1.6033807613168727, 0.0), # 41
(18.527472704381402, 17.587136111111114, 15.416972222222224, 16.584253125000004, 13.45136785400857, 6.5625, 7.208116666666666, 6.493875, 7.218385000000001, 3.4307077777777786, 2.4955146464646467, 1.4430962962962963, 0.0, 18.225, 15.874059259259258, 12.477573232323234, 10.292123333333333, 14.436770000000003, 9.091425000000001, 7.208116666666666, 4.6875, 6.725683927004285, 5.5280843750000015, 3.083394444444445, 1.598830555555556, 0.0), # 42
(18.538673286329807, 17.53553569958848, 15.403393004115227, 16.57258715277778, 13.455085314817683, 6.5625, 7.188292737835875, 6.454990740740741, 7.213052037037036, 3.420511255144034, 2.4938536662925554, 1.4412857338820306, 0.0, 18.225, 15.854143072702334, 12.469268331462775, 10.2615337654321, 14.426104074074072, 9.036987037037038, 7.188292737835875, 4.6875, 6.727542657408842, 5.524195717592594, 3.080678600823046, 1.5941396090534983, 0.0), # 43
(18.54944303247347, 17.482495781893004, 15.389394032921814, 16.560512847222224, 13.458656719953654, 6.5625, 7.1679258896151055, 6.415328703703706, 7.2075457407407395, 3.4100589300411532, 2.4921284885895996, 1.439419204389575, 0.0, 18.225, 15.833611248285322, 12.460642442947998, 10.230176790123457, 14.415091481481479, 8.981460185185188, 7.1679258896151055, 4.6875, 6.729328359976827, 5.520170949074076, 3.077878806584363, 1.5893177983539097, 0.0), # 44
(18.55978051032399, 17.428124999999998, 15.375, 16.548046875, 13.462081849155954, 6.5625, 7.147058823529412, 6.375000000000001, 7.201874999999999, 3.3993750000000014, 2.4903409090909094, 1.4375000000000002, 0.0, 18.225, 15.8125, 12.451704545454545, 10.198125000000001, 14.403749999999999, 8.925, 7.147058823529412, 4.6875, 6.731040924577977, 5.516015625000001, 3.075, 1.584375, 0.0), # 45
(18.569684287392985, 17.372531995884774, 15.360235596707819, 16.535205902777776, 13.465360482164058, 6.5625, 7.125734241103849, 6.334115740740741, 7.196048703703703, 3.388483662551441, 2.4884927235316128, 1.4355314128943761, 0.0, 18.225, 15.790845541838134, 12.442463617658062, 10.16545098765432, 14.392097407407405, 8.86776203703704, 7.125734241103849, 4.6875, 6.732680241082029, 5.511735300925927, 3.072047119341564, 1.5793210905349795, 0.0), # 46
(18.579152931192063, 17.31582541152263, 15.345125514403293, 16.522006597222223, 13.46849239871744, 6.5625, 7.103994843863473, 6.292787037037037, 7.190075740740742, 3.3774091152263384, 2.486585727646839, 1.4335167352537728, 0.0, 18.225, 15.768684087791497, 12.432928638234193, 10.132227345679013, 14.380151481481484, 8.809901851851851, 7.103994843863473, 4.6875, 6.73424619935872, 5.507335532407408, 3.069025102880659, 1.5741659465020577, 0.0), # 47
(18.588185009232834, 17.258113888888886, 15.329694444444444, 16.508465625, 13.471477378555573, 6.5625, 7.081883333333334, 6.251125000000001, 7.183965000000001, 3.3661755555555564, 2.4846217171717173, 1.4314592592592594, 0.0, 18.225, 15.746051851851853, 12.423108585858586, 10.098526666666666, 14.367930000000001, 8.751575, 7.081883333333334, 4.6875, 6.735738689277786, 5.502821875000001, 3.065938888888889, 1.5689194444444445, 0.0), # 48
(18.596779089026917, 17.199506069958847, 15.313967078189304, 16.49459965277778, 13.47431520141793, 6.5625, 7.059442411038489, 6.209240740740741, 7.17772537037037, 3.35480718106996, 2.4826024878413775, 1.4293622770919072, 0.0, 18.225, 15.722985048010976, 12.413012439206886, 10.064421543209878, 14.35545074074074, 8.692937037037037, 7.059442411038489, 4.6875, 6.737157600708965, 5.498199884259261, 3.0627934156378607, 1.5635914609053498, 0.0), # 49
(18.604933738085908, 17.140110596707824, 15.297968106995889, 16.480425347222223, 13.477005647043978, 6.5625, 7.0367147785039945, 6.16724537037037, 7.1713657407407405, 3.3433281893004123, 2.480529835390947, 1.427229080932785, 0.0, 18.225, 15.699519890260632, 12.402649176954732, 10.029984567901234, 14.342731481481481, 8.634143518518519, 7.0367147785039945, 4.6875, 6.738502823521989, 5.4934751157407415, 3.059593621399178, 1.5581918724279842, 0.0), # 50
(18.61264752392144, 17.080036111111113, 15.281722222222223, 16.465959375, 13.479548495173198, 6.5625, 7.013743137254902, 6.12525, 7.164895000000001, 3.3317627777777785, 2.478405555555556, 1.4250629629629634, 0.0, 18.225, 15.675692592592595, 12.392027777777779, 9.995288333333333, 14.329790000000003, 8.57535, 7.013743137254902, 4.6875, 6.739774247586599, 5.488653125000001, 3.0563444444444445, 1.552730555555556, 0.0), # 51
(18.619919014045102, 17.019391255144033, 15.26525411522634, 16.45121840277778, 13.481943525545056, 6.5625, 6.9905701888162675, 6.08336574074074, 7.158322037037037, 3.320135144032923, 2.4762314440703332, 1.4228672153635122, 0.0, 18.225, 15.651539368998632, 12.381157220351666, 9.960405432098767, 14.316644074074073, 8.516712037037037, 6.9905701888162675, 4.6875, 6.740971762772528, 5.483739467592594, 3.0530508230452678, 1.547217386831276, 0.0), # 52
(18.626746775968517, 16.958284670781893, 15.248588477366258, 16.43621909722222, 13.484190517899034, 6.5625, 6.967238634713145, 6.041703703703704, 7.1516557407407415, 3.3084694855967087, 2.4740092966704084, 1.4206451303155008, 0.0, 18.225, 15.627096433470507, 12.37004648335204, 9.925408456790123, 14.303311481481483, 8.458385185185186, 6.967238634713145, 4.6875, 6.742095258949517, 5.478739699074075, 3.049717695473252, 1.5416622427983542, 0.0), # 53
(18.63312937720329, 16.896825000000003, 15.23175, 16.420978125, 13.486289251974604, 6.5625, 6.943791176470588, 6.000374999999999, 7.144905, 3.296790000000001, 2.4717409090909093, 1.4184000000000003, 0.0, 18.225, 15.602400000000001, 12.358704545454545, 9.89037, 14.28981, 8.400525, 6.943791176470588, 4.6875, 6.743144625987302, 5.473659375000001, 3.04635, 1.5360750000000005, 0.0), # 54
(18.63906538526104, 16.835120884773662, 15.2147633744856, 16.405512152777778, 13.488239507511228, 6.5625, 6.9202705156136535, 5.9594907407407405, 7.1380787037037035, 3.2851208847736637, 2.4694280770669663, 1.4161351165980798, 0.0, 18.225, 15.577486282578874, 12.34714038533483, 9.855362654320988, 14.276157407407407, 8.343287037037037, 6.9202705156136535, 4.6875, 6.744119753755614, 5.468504050925927, 3.04295267489712, 1.530465534979424, 0.0), # 55
(18.64455336765337, 16.77328096707819, 15.197653292181073, 16.389837847222225, 13.49004106424839, 6.5625, 6.896719353667393, 5.9191620370370375, 7.131185740740741, 3.2734863374485608, 2.467072596333708, 1.4138537722908093, 0.0, 18.225, 15.5523914951989, 12.335362981668538, 9.82045901234568, 14.262371481481482, 8.286826851851853, 6.896719353667393, 4.6875, 6.745020532124195, 5.463279282407409, 3.0395306584362145, 1.5248437242798356, 0.0), # 56
(18.649591891891887, 16.711413888888888, 15.180444444444445, 16.373971875, 13.49169370192556, 6.5625, 6.873180392156863, 5.879500000000001, 7.124235, 3.2619105555555565, 2.4646762626262633, 1.4115592592592594, 0.0, 18.225, 15.527151851851851, 12.323381313131314, 9.785731666666667, 14.24847, 8.231300000000001, 6.873180392156863, 4.6875, 6.74584685096278, 5.457990625000001, 3.0360888888888895, 1.5192194444444447, 0.0), # 57
(18.654179525488225, 16.64962829218107, 15.163161522633745, 16.357930902777774, 13.49319720028221, 6.5625, 6.849696332607118, 5.840615740740741, 7.11723537037037, 3.2504177366255154, 2.4622408716797612, 1.4092548696844995, 0.0, 18.225, 15.501803566529492, 12.311204358398806, 9.751253209876543, 14.23447074074074, 8.176862037037038, 6.849696332607118, 4.6875, 6.746598600141105, 5.4526436342592595, 3.032632304526749, 1.5136025720164612, 0.0), # 58
(18.658314835953966, 16.58803281893004, 15.145829218106996, 16.34173159722222, 13.494551339057814, 6.5625, 6.82630987654321, 5.802620370370371, 7.110195740740741, 3.2390320781893016, 2.4597682192293306, 1.4069438957475995, 0.0, 18.225, 15.476382853223592, 12.298841096146651, 9.717096234567903, 14.220391481481482, 8.12366851851852, 6.82630987654321, 4.6875, 6.747275669528907, 5.447243865740742, 3.0291658436213997, 1.5080029835390947, 0.0), # 59
(18.661996390800738, 16.526736111111113, 15.128472222222221, 16.325390625, 13.495755897991843, 6.5625, 6.803063725490196, 5.765625, 7.103125, 3.2277777777777787, 2.4572601010101014, 1.40462962962963, 0.0, 18.225, 15.450925925925928, 12.286300505050505, 9.683333333333334, 14.20625, 8.071875, 6.803063725490196, 4.6875, 6.747877948995922, 5.441796875000001, 3.0256944444444445, 1.502430555555556, 0.0), # 60
(18.665222757540146, 16.465846810699592, 15.111115226337452, 16.308924652777776, 13.496810656823772, 6.5625, 6.780000580973129, 5.729740740740741, 7.0960320370370376, 3.216679032921812, 2.4547183127572016, 1.40231536351166, 0.0, 18.225, 15.425468998628258, 12.273591563786008, 9.650037098765434, 14.192064074074075, 8.021637037037038, 6.780000580973129, 4.6875, 6.748405328411886, 5.436308217592593, 3.0222230452674905, 1.496895164609054, 0.0), # 61
(18.66799250368381, 16.40547355967078, 15.093782921810703, 16.292350347222225, 13.497715395293081, 6.5625, 6.757163144517066, 5.695078703703705, 7.088925740740741, 3.2057600411522644, 2.4521446502057613, 1.4000043895747603, 0.0, 18.225, 15.40004828532236, 12.260723251028807, 9.61728012345679, 14.177851481481483, 7.973110185185186, 6.757163144517066, 4.6875, 6.748857697646541, 5.430783449074076, 3.018756584362141, 1.4914066872427985, 0.0), # 62
(18.670304196743327, 16.345724999999998, 15.0765, 16.275684375, 13.498469893139227, 6.5625, 6.734594117647059, 5.6617500000000005, 7.081815, 3.195045000000001, 2.4495409090909095, 1.3977000000000002, 0.0, 18.225, 15.3747, 12.247704545454548, 9.585135, 14.16363, 7.926450000000001, 6.734594117647059, 4.6875, 6.749234946569613, 5.425228125000001, 3.0153000000000003, 1.485975, 0.0), # 63
(18.672156404230314, 16.286709773662555, 15.059291152263373, 16.258943402777778, 13.499073930101698, 6.5625, 6.712336201888163, 5.629865740740741, 7.0747087037037035, 3.1845581069958855, 2.446908885147774, 1.3954054869684502, 0.0, 18.225, 15.34946035665295, 12.23454442573887, 9.553674320987653, 14.149417407407407, 7.881812037037038, 6.712336201888163, 4.6875, 6.749536965050849, 5.419647800925927, 3.011858230452675, 1.4806099794238687, 0.0), # 64
(18.67354769365639, 16.228536522633743, 15.042181069958849, 16.242144097222223, 13.49952728591996, 6.5625, 6.690432098765433, 5.599537037037037, 7.067615740740742, 3.1743235596707824, 2.4442503741114856, 1.3931241426611796, 0.0, 18.225, 15.324365569272972, 12.221251870557428, 9.522970679012344, 14.135231481481483, 7.839351851851852, 6.690432098765433, 4.6875, 6.74976364295998, 5.4140480324074085, 3.00843621399177, 1.4753215020576131, 0.0), # 65
(18.674476632533153, 16.17131388888889, 15.025194444444447, 16.225303125, 13.499829740333489, 6.5625, 6.668924509803921, 5.570875000000001, 7.060545000000001, 3.1643655555555563, 2.4415671717171716, 1.3908592592592597, 0.0, 18.225, 15.299451851851854, 12.207835858585858, 9.493096666666666, 14.121090000000002, 7.799225000000001, 6.668924509803921, 4.6875, 6.749914870166744, 5.408434375000001, 3.0050388888888895, 1.4701194444444448, 0.0), # 66
(18.674941788372227, 16.11515051440329, 15.00835596707819, 16.208437152777776, 13.499981073081756, 6.5625, 6.647856136528685, 5.543990740740742, 7.05350537037037, 3.154708292181071, 2.438861073699963, 1.3886141289437586, 0.0, 18.225, 15.274755418381341, 12.194305368499816, 9.464124876543211, 14.10701074074074, 7.761587037037039, 6.647856136528685, 4.6875, 6.749990536540878, 5.40281238425926, 3.001671193415638, 1.465013683127572, 0.0), # 67
(18.674624906065485, 16.059860254878533, 14.99160892489712, 16.19141634963768, 13.499853546356814, 6.56237821216278, 6.627163675346682, 5.518757887517148, 7.046452709190673, 3.145329198741226, 2.436085796562113, 1.3863795032849615, 0.0, 18.22477527006173, 15.250174536134574, 12.180428982810565, 9.435987596223676, 14.092905418381346, 7.726261042524007, 6.627163675346682, 4.6874130086877, 6.749926773178407, 5.3971387832125615, 2.998321784979424, 1.4599872958980487, 0.0), # 68
(18.671655072463768, 16.00375510752688, 14.974482638888889, 16.173382744565217, 13.498692810457515, 6.561415432098766, 6.606241363211952, 5.493824074074074, 7.039078703703703, 3.1359628758169937, 2.4329588516746417, 1.3840828460038987, 0.0, 18.222994791666668, 15.224911306042884, 12.164794258373206, 9.407888627450978, 14.078157407407407, 7.6913537037037045, 6.606241363211952, 4.686725308641976, 6.749346405228757, 5.391127581521739, 2.994896527777778, 1.4548868279569895, 0.0), # 69
(18.665794417606012, 15.946577558741536, 14.956902649176953, 16.154217617753623, 13.496399176954732, 6.559519318701418, 6.5849941211052325, 5.468964334705077, 7.031341735253773, 3.1265637860082314, 2.429444665957824, 1.3817134141939216, 0.0, 18.219478202160495, 15.198847556133135, 12.147223329789119, 9.379691358024692, 14.062683470507546, 7.656550068587107, 6.5849941211052325, 4.685370941929584, 6.748199588477366, 5.384739205917875, 2.9913805298353906, 1.4496888689765035, 0.0), # 70
(18.657125389157272, 15.888361778176023, 14.938875128600824, 16.133949230072467, 13.493001694504963, 6.556720598994056, 6.56343149358509, 5.444186899862826, 7.023253326474624, 3.1171321617041885, 2.425556211235159, 1.3792729405819073, 0.0, 18.21427179783951, 15.172002346400978, 12.127781056175793, 9.351396485112563, 14.046506652949247, 7.621861659807958, 6.56343149358509, 4.683371856424325, 6.746500847252482, 5.377983076690823, 2.987775025720165, 1.4443965252887296, 0.0), # 71
(18.64573043478261, 15.82914193548387, 14.92040625, 16.112605842391304, 13.488529411764706, 6.553050000000001, 6.541563025210084, 5.4195, 7.014825, 3.1076682352941183, 2.421306459330144, 1.376763157894737, 0.0, 18.207421875, 15.144394736842104, 12.10653229665072, 9.323004705882353, 14.02965, 7.587300000000001, 6.541563025210084, 4.680750000000001, 6.744264705882353, 5.370868614130436, 2.98408125, 1.4390129032258066, 0.0), # 72
(18.631692002147076, 15.768952200318596, 14.90150218621399, 16.09021571557971, 13.483011377390461, 6.548538248742569, 6.519398260538782, 5.394911865569274, 7.006068278463649, 3.0981722391672726, 2.4167083820662767, 1.374185798859288, 0.0, 18.198974729938275, 15.116043787452165, 12.083541910331384, 9.294516717501814, 14.012136556927299, 7.552876611796983, 6.519398260538782, 4.677527320530407, 6.741505688695231, 5.363405238526571, 2.9803004372427986, 1.4335411091198726, 0.0), # 73
(18.61509253891573, 15.707826742333731, 14.882169110082302, 16.06680711050725, 13.47647664003873, 6.543216072245086, 6.49694674412975, 5.37043072702332, 6.996994684499314, 3.0886444057129037, 2.411774951267057, 1.3715425962024403, 0.0, 18.18897665895062, 15.086968558226841, 12.058874756335285, 9.26593321713871, 13.993989368998628, 7.518603017832648, 6.49694674412975, 4.673725765889347, 6.738238320019365, 5.355602370169083, 2.976433822016461, 1.4279842493030668, 0.0), # 74
(18.59601449275362, 15.645799731182793, 14.862413194444443, 16.04240828804348, 13.468954248366014, 6.537114197530865, 6.47421802054155, 5.346064814814815, 6.98761574074074, 3.0790849673202625, 2.406519138755981, 1.3688352826510723, 0.0, 18.177473958333334, 15.057188109161793, 12.032595693779903, 9.237254901960785, 13.97523148148148, 7.484490740740742, 6.47421802054155, 4.669367283950618, 6.734477124183007, 5.347469429347827, 2.9724826388888888, 1.422345430107527, 0.0), # 75
(18.57454031132582, 15.582905336519316, 14.842240612139918, 16.01704750905797, 13.460473251028805, 6.53026335162323, 6.451221634332746, 5.321822359396434, 6.977942969821673, 3.069494156378602, 2.400953916356548, 1.3660655909320625, 0.0, 18.164512924382716, 15.026721500252684, 12.004769581782737, 9.208482469135802, 13.955885939643347, 7.450551303155008, 6.451221634332746, 4.664473822588021, 6.730236625514403, 5.339015836352658, 2.9684481224279837, 1.4166277578653925, 0.0), # 76
(18.55075244229737, 15.519177727996816, 14.821657536008228, 15.99075303442029, 13.451062696683609, 6.522694261545496, 6.4279671300619015, 5.2977115912208514, 6.967987894375857, 3.059872205277174, 2.3950922558922563, 1.3632352537722912, 0.0, 18.150139853395064, 14.9955877914952, 11.975461279461282, 9.179616615831518, 13.935975788751714, 7.416796227709193, 6.4279671300619015, 4.659067329675354, 6.725531348341804, 5.330251011473431, 2.964331507201646, 1.4108343389088016, 0.0), # 77
(18.524733333333334, 15.45465107526882, 14.80067013888889, 15.963553124999999, 13.440751633986928, 6.514437654320987, 6.404464052287582, 5.273740740740742, 6.957762037037036, 3.0502193464052296, 2.388947129186603, 1.3603460038986357, 0.0, 18.134401041666667, 14.963806042884991, 11.944735645933015, 9.150658039215687, 13.915524074074073, 7.383237037037039, 6.404464052287582, 4.653169753086419, 6.720375816993464, 5.3211843750000005, 2.960134027777778, 1.404968279569893, 0.0), # 78
(18.496565432098766, 15.389359547988851, 14.779284593621398, 15.935476041666668, 13.429569111595256, 6.505524256973022, 6.380721945568351, 5.249918038408779, 6.947276920438957, 3.0405358121520223, 2.382531508063087, 1.3573995740379758, 0.0, 18.117342785493825, 14.931395314417731, 11.912657540315433, 9.121607436456063, 13.894553840877913, 7.349885253772292, 6.380721945568351, 4.646803040695016, 6.714784555797628, 5.311825347222223, 2.95585691872428, 1.399032686180805, 0.0), # 79
(18.466331186258724, 15.323337315810434, 14.757507073045266, 15.906550045289855, 13.417544178165095, 6.49598479652492, 6.356750354462773, 5.226251714677641, 6.9365440672153635, 3.030821834906803, 2.375858364345207, 1.3543976969171905, 0.0, 18.09901138117284, 14.898374666089092, 11.879291821726033, 9.092465504720405, 13.873088134430727, 7.316752400548698, 6.356750354462773, 4.639989140374943, 6.708772089082547, 5.302183348429953, 2.9515014146090537, 1.3930306650736761, 0.0), # 80
(18.434113043478263, 15.256618548387095, 14.735343749999998, 15.876803396739131, 13.404705882352939, 6.48585, 6.3325588235294115, 5.202750000000001, 6.925574999999999, 3.0210776470588248, 2.36894066985646, 1.3513421052631582, 0.0, 18.079453124999997, 14.864763157894737, 11.844703349282298, 9.063232941176471, 13.851149999999999, 7.283850000000001, 6.3325588235294115, 4.63275, 6.7023529411764695, 5.292267798913045, 2.94706875, 1.3869653225806453, 0.0), # 81
(18.399993451422436, 15.189237415372364, 14.712800797325105, 15.846264356884058, 13.391083272815298, 6.475150594421583, 6.308156897326833, 5.179421124828533, 6.914381241426612, 3.011303480997338, 2.3617913964203443, 1.3482345318027582, 0.0, 18.058714313271608, 14.830579849830338, 11.80895698210172, 9.03391044299201, 13.828762482853223, 7.2511895747599455, 6.308156897326833, 4.625107567443988, 6.695541636407649, 5.2820881189613536, 2.9425601594650215, 1.3808397650338515, 0.0), # 82
(18.364054857756308, 15.121228086419752, 14.689884387860083, 15.8149611865942, 13.376705398208665, 6.463917306812986, 6.283554120413598, 5.156273319615913, 6.902974314128944, 3.001499569111596, 2.3544235158603586, 1.3450767092628693, 0.0, 18.036841242283952, 14.79584380189156, 11.772117579301792, 9.004498707334786, 13.805948628257887, 7.218782647462278, 6.283554120413598, 4.617083790580704, 6.688352699104333, 5.2716537288647345, 2.9379768775720168, 1.374657098765432, 0.0), # 83
(18.326379710144927, 15.052624731182796, 14.666600694444444, 15.78292214673913, 13.361601307189542, 6.452180864197532, 6.258760037348273, 5.133314814814815, 6.89136574074074, 2.9916661437908503, 2.3468500000000003, 1.3418703703703705, 0.0, 18.013880208333333, 14.760574074074073, 11.73425, 8.97499843137255, 13.78273148148148, 7.186640740740741, 6.258760037348273, 4.608700617283951, 6.680800653594771, 5.260974048913044, 2.933320138888889, 1.3684204301075271, 0.0), # 84
(18.287050456253354, 14.983461519315012, 14.642955889917694, 15.750175498188408, 13.345800048414427, 6.439971993598538, 6.233784192689422, 5.110553840877915, 6.879567043895747, 2.981803437424353, 2.3390838206627684, 1.338617247852141, 0.0, 17.989877507716052, 14.724789726373547, 11.69541910331384, 8.945410312273058, 13.759134087791494, 7.154775377229082, 6.233784192689422, 4.5999799954275264, 6.672900024207213, 5.250058499396137, 2.928591177983539, 1.362132865392274, 0.0), # 85
(18.246149543746643, 14.913772620469931, 14.618956147119343, 15.716749501811597, 13.32933067053982, 6.427321422039324, 6.208636130995608, 5.087998628257887, 6.86758974622771, 2.9719116824013563, 2.3311379496721605, 1.3353190744350594, 0.0, 17.964879436728395, 14.68850981878565, 11.655689748360802, 8.915735047204068, 13.73517949245542, 7.123198079561043, 6.208636130995608, 4.590943872885232, 6.66466533526991, 5.2389165006038665, 2.923791229423869, 1.3557975109518121, 0.0), # 86
(18.203759420289852, 14.843592204301075, 14.594607638888888, 15.68267241847826, 13.312222222222225, 6.41425987654321, 6.1833253968253965, 5.065657407407408, 6.855445370370372, 2.9619911111111112, 2.323025358851675, 1.3319775828460039, 0.0, 17.938932291666667, 14.651753411306041, 11.615126794258373, 8.885973333333332, 13.710890740740744, 7.091920370370371, 6.1833253968253965, 4.581614197530865, 6.656111111111112, 5.227557472826088, 2.9189215277777776, 1.3494174731182798, 0.0), # 87
(18.159962533548043, 14.772954440461966, 14.569916538065844, 15.647972509057974, 13.294503752118132, 6.400818084133517, 6.157861534737352, 5.043538408779149, 6.843145438957476, 2.952041955942871, 2.31475902002481, 1.328594505811855, 0.0, 17.912082368827164, 14.614539563930402, 11.573795100124048, 8.856125867828611, 13.686290877914953, 7.06095377229081, 6.157861534737352, 4.572012917238227, 6.647251876059066, 5.215990836352659, 2.913983307613169, 1.3429958582238153, 0.0), # 88
(18.11484133118626, 14.701893498606132, 14.544889017489714, 15.612678034420288, 13.276204308884047, 6.387026771833563, 6.132254089290037, 5.0216498628257895, 6.830701474622771, 2.942064449285888, 2.3063519050150636, 1.3251715760594904, 0.0, 17.884375964506173, 14.576887336654393, 11.531759525075316, 8.826193347857663, 13.661402949245542, 7.0303098079561055, 6.132254089290037, 4.562161979881116, 6.638102154442024, 5.2042260114734304, 2.908977803497943, 1.3365357726005578, 0.0), # 89
(18.068478260869565, 14.630443548387097, 14.519531250000002, 15.576817255434786, 13.257352941176471, 6.372916666666668, 6.106512605042017, 5.0, 6.818125, 2.9320588235294123, 2.2978169856459334, 1.3217105263157898, 0.0, 17.855859375, 14.538815789473684, 11.489084928229666, 8.796176470588236, 13.63625, 7.0, 6.106512605042017, 4.552083333333334, 6.6286764705882355, 5.192272418478263, 2.903906250000001, 1.3300403225806454, 0.0), # 90
(18.020955770263015, 14.558638759458383, 14.493849408436214, 15.540418432971018, 13.237978697651899, 6.35851849565615, 6.0806466265518555, 4.978597050754459, 6.80542753772291, 2.922025311062697, 2.2891672337409186, 1.3182130893076314, 0.0, 17.826578896604936, 14.500343982383942, 11.445836168704592, 8.76607593318809, 13.61085507544582, 6.9700358710562424, 6.0806466265518555, 4.541798925468679, 6.6189893488259495, 5.180139477657007, 2.898769881687243, 1.3235126144962168, 0.0), # 91
(17.97235630703167, 14.486513301473519, 14.467849665637862, 15.50350982789855, 13.218110626966835, 6.343862985825332, 6.054665698378118, 4.957449245541839, 6.7926206104252405, 2.9119641442749944, 2.2804156211235163, 1.3146809977618947, 0.0, 17.796580825617283, 14.46149097538084, 11.40207810561758, 8.735892432824983, 13.585241220850481, 6.940428943758574, 6.054665698378118, 4.531330704160951, 6.609055313483418, 5.167836609299518, 2.8935699331275724, 1.3169557546794108, 0.0), # 92
(17.92276231884058, 14.414101344086022, 14.441538194444446, 15.46611970108696, 13.197777777777777, 6.328980864197531, 6.0285793650793655, 4.936564814814815, 6.779715740740741, 2.9018755555555558, 2.2715751196172254, 1.3111159844054583, 0.0, 17.76591145833333, 14.422275828460037, 11.357875598086125, 8.705626666666666, 13.559431481481482, 6.911190740740742, 6.0285793650793655, 4.520700617283951, 6.598888888888888, 5.155373233695654, 2.888307638888889, 1.3103728494623659, 0.0), # 93
(17.872256253354806, 14.341437056949422, 14.414921167695475, 15.428276313405796, 13.177009198741224, 6.313902857796068, 6.002397171214165, 4.915951989026064, 6.766724451303155, 2.891759777293634, 2.2626587010455435, 1.3075197819652014, 0.0, 17.734617091049383, 14.382717601617212, 11.313293505227715, 8.675279331880901, 13.53344890260631, 6.88233278463649, 6.002397171214165, 4.509930612711477, 6.588504599370612, 5.1427587711352665, 2.882984233539095, 1.3037670051772203, 0.0), # 94
(17.820920558239397, 14.268554609717246, 14.388004758230455, 15.390007925724635, 13.155833938513677, 6.298659693644262, 5.97612866134108, 4.895618998628259, 6.753658264746228, 2.88161704187848, 2.253679337231969, 1.3038941231680024, 0.0, 17.70274402006173, 14.342835354848022, 11.268396686159845, 8.644851125635439, 13.507316529492456, 6.853866598079563, 5.97612866134108, 4.49904263831733, 6.577916969256838, 5.130002641908213, 2.8776009516460914, 1.2971413281561135, 0.0), # 95
(17.76883768115942, 14.195488172043014, 14.360795138888891, 15.351342798913045, 13.134281045751635, 6.283282098765432, 5.9497833800186735, 4.875574074074075, 6.740528703703703, 2.8714475816993468, 2.2446500000000005, 1.300240740740741, 0.0, 17.67033854166667, 14.30264814814815, 11.22325, 8.614342745098039, 13.481057407407405, 6.825803703703705, 5.9497833800186735, 4.488058641975309, 6.5671405228758175, 5.117114266304349, 2.8721590277777787, 1.2904989247311833, 0.0), # 96
(17.716090069779927, 14.12227191358025, 14.333298482510289, 15.31230919384058, 13.112379569111596, 6.267800800182899, 5.9233708718055125, 4.855825445816188, 6.727347290809328, 2.8612516291454857, 2.235583661173135, 1.2965613674102956, 0.0, 17.637446952160495, 14.262175041513249, 11.177918305865674, 8.583754887436456, 13.454694581618655, 6.798155624142662, 5.9233708718055125, 4.477000571559214, 6.556189784555798, 5.104103064613527, 2.8666596965020577, 1.2838429012345685, 0.0), # 97
(17.66276017176597, 14.048940003982477, 14.305520961934155, 15.27293537137681, 13.090158557250064, 6.252246524919983, 5.896900681260158, 4.83638134430727, 6.714125548696844, 2.851029416606149, 2.226493292574872, 1.2928577359035447, 0.0, 17.604115547839505, 14.22143509493899, 11.13246646287436, 8.553088249818446, 13.428251097393687, 6.770933882030178, 5.896900681260158, 4.465890374942845, 6.545079278625032, 5.090978457125605, 2.8611041923868314, 1.277176363998407, 0.0), # 98
(17.608930434782607, 13.975526612903225, 14.277468750000002, 15.233249592391303, 13.067647058823532, 6.23665, 5.870382352941177, 4.8172500000000005, 6.700875, 2.8407811764705886, 2.2173918660287084, 1.2891315789473687, 0.0, 17.570390625, 14.180447368421053, 11.086959330143541, 8.522343529411764, 13.40175, 6.744150000000001, 5.870382352941177, 4.45475, 6.533823529411766, 5.0777498641304355, 2.8554937500000004, 1.2705024193548389, 0.0), # 99
(17.5546833064949, 13.902065909996015, 14.249148019547325, 15.193280117753623, 13.044874122488501, 6.2210419524462734, 5.843825431407131, 4.798439643347051, 6.687607167352539, 2.8305071411280567, 2.2082923533581433, 1.285384629268645, 0.0, 17.536318479938274, 14.139230921955095, 11.041461766790714, 8.49152142338417, 13.375214334705078, 6.717815500685871, 5.843825431407131, 4.443601394604481, 6.522437061244251, 5.064426705917875, 2.8498296039094653, 1.2638241736360014, 0.0), # 100
(17.500101234567904, 13.828592064914377, 14.22056494341564, 15.153055208333335, 13.021868796901476, 6.205453109282122, 5.817239461216586, 4.7799585048010975, 6.674333573388203, 2.820207542967805, 2.1992077263866743, 1.281618619594253, 0.0, 17.501945408950615, 14.097804815536781, 10.99603863193337, 8.460622628903414, 13.348667146776407, 6.691941906721536, 5.817239461216586, 4.432466506630087, 6.510934398450738, 5.051018402777779, 2.8441129886831282, 1.2571447331740344, 0.0), # 101
(17.44526666666667, 13.755139247311828, 14.191725694444445, 15.112603125, 12.998660130718955, 6.189914197530865, 5.790633986928105, 4.761814814814815, 6.66106574074074, 2.809882614379086, 2.1901509569377993, 1.2778352826510724, 0.0, 17.467317708333336, 14.056188109161795, 10.950754784688995, 8.429647843137257, 13.32213148148148, 6.666540740740741, 5.790633986928105, 4.421367283950618, 6.499330065359477, 5.037534375000001, 2.838345138888889, 1.2504672043010754, 0.0), # 102
(17.390262050456254, 13.681741626841896, 14.16263644547325, 15.071952128623188, 12.975277172597433, 6.174455944215821, 5.764018553100253, 4.7440168038408785, 6.647815192043895, 2.7995325877511505, 2.181135016835017, 1.2740363511659811, 0.0, 17.432481674382714, 14.014399862825789, 10.905675084175085, 8.39859776325345, 13.29563038408779, 6.64162352537723, 5.764018553100253, 4.410325674439872, 6.487638586298717, 5.023984042874397, 2.8325272890946502, 1.2437946933492634, 0.0), # 103
(17.335169833601718, 13.608433373158105, 14.133303369341563, 15.031130480072465, 12.951748971193414, 6.159109076360311, 5.737402704291593, 4.7265727023319615, 6.634593449931413, 2.7891576954732518, 2.1721728779018252, 1.2702235578658583, 0.0, 17.397483603395063, 13.972459136524439, 10.860864389509127, 8.367473086419754, 13.269186899862826, 6.617201783264746, 5.737402704291593, 4.399363625971651, 6.475874485596707, 5.010376826690822, 2.826660673868313, 1.237130306650737, 0.0), # 104
(17.280072463768114, 13.535248655913978, 14.103732638888891, 14.99016644021739, 12.928104575163397, 6.143904320987655, 5.710795985060692, 4.709490740740741, 6.621412037037037, 2.7787581699346413, 2.1632775119617227, 1.2663986354775831, 0.0, 17.362369791666666, 13.930384990253412, 10.816387559808613, 8.336274509803923, 13.242824074074074, 6.5932870370370384, 5.710795985060692, 4.388503086419754, 6.464052287581699, 4.996722146739131, 2.820746527777778, 1.2304771505376346, 0.0), # 105
(17.225052388620504, 13.462221644763043, 14.073930426954732, 14.949088269927536, 12.904373033163882, 6.128872405121171, 5.68420793996611, 4.6927791495198905, 6.608282475994512, 2.7683342435245706, 2.1544618908382067, 1.2625633167280343, 0.0, 17.327186535493826, 13.888196484008375, 10.772309454191033, 8.30500273057371, 13.216564951989024, 6.5698908093278465, 5.68420793996611, 4.377766003657979, 6.452186516581941, 4.98302942330918, 2.8147860853909465, 1.223838331342095, 0.0), # 106
(17.17019205582394, 13.389386509358822, 14.043902906378605, 14.907924230072464, 12.880583393851367, 6.114044055784181, 5.657648113566415, 4.6764461591220865, 6.595216289437586, 2.7578861486322928, 2.145738986354776, 1.2587193343440908, 0.0, 17.29198013117284, 13.845912677784996, 10.728694931773878, 8.273658445896878, 13.190432578875171, 6.547024622770921, 5.657648113566415, 4.367174325560129, 6.440291696925684, 4.969308076690822, 2.808780581275721, 1.2172169553962566, 0.0), # 107
(17.11557391304348, 13.31677741935484, 14.013656250000002, 14.866702581521741, 12.856764705882352, 6.099450000000001, 5.631126050420168, 4.660500000000001, 6.582225000000001, 2.7474141176470597, 2.1371217703349283, 1.2548684210526317, 0.0, 17.256796875000003, 13.803552631578947, 10.685608851674642, 8.242242352941178, 13.164450000000002, 6.524700000000001, 5.631126050420168, 4.356750000000001, 6.428382352941176, 4.955567527173915, 2.8027312500000003, 1.2106161290322583, 0.0), # 108
(17.061280407944178, 13.24442854440462, 13.983196630658439, 14.825451585144926, 12.832946017913338, 6.085120964791952, 5.604651295085936, 4.644948902606311, 6.569320130315501, 2.736918382958122, 2.1286232146021624, 1.2510123095805359, 0.0, 17.221683063271605, 13.761135405385891, 10.64311607301081, 8.210755148874364, 13.138640260631002, 6.502928463648835, 5.604651295085936, 4.346514974851394, 6.416473008956669, 4.941817195048309, 2.796639326131688, 1.2040389585822384, 0.0), # 109
(17.007393988191087, 13.17237405416169, 13.95253022119342, 14.784199501811596, 12.809156378600825, 6.071087677183356, 5.57823339212228, 4.62980109739369, 6.556513203017833, 2.726399176954733, 2.120256290979975, 1.2471527326546823, 0.0, 17.18668499228395, 13.718680059201501, 10.601281454899876, 8.179197530864197, 13.113026406035665, 6.4817215363511655, 5.57823339212228, 4.336491197988112, 6.404578189300413, 4.928066500603866, 2.790506044238684, 1.1974885503783357, 0.0), # 110
(16.953997101449275, 13.10064811827957, 13.921663194444447, 14.742974592391306, 12.785424836601308, 6.0573808641975315, 5.551881886087768, 4.615064814814815, 6.543815740740741, 2.715856732026144, 2.1120339712918663, 1.2432914230019496, 0.0, 17.151848958333336, 13.676205653021444, 10.56016985645933, 8.147570196078432, 13.087631481481482, 6.461090740740741, 5.551881886087768, 4.326700617283951, 6.392712418300654, 4.914324864130436, 2.78433263888889, 1.1909680107526885, 0.0), # 111
(16.90117219538379, 13.029284906411787, 13.890601723251033, 14.701805117753622, 12.76178044057129, 6.044031252857797, 5.5256063215409625, 4.60074828532236, 6.531239266117969, 2.7052912805616076, 2.103969227361333, 1.2394301133492167, 0.0, 17.11722125771605, 13.633731246841382, 10.519846136806663, 8.115873841684822, 13.062478532235938, 6.441047599451304, 5.5256063215409625, 4.3171651806127125, 6.380890220285645, 4.900601705917875, 2.778120344650207, 1.1844804460374354, 0.0), # 112
(16.84890760266548, 12.958437720996821, 13.859426742378105, 14.660775741364255, 12.738210816208445, 6.03106325767524, 5.499473367291093, 4.586889426585454, 6.518827686755172, 2.694737131475729, 2.0960771718458604, 1.2355789404756645, 0.0, 17.0827990215178, 13.591368345232306, 10.480385859229301, 8.084211394427186, 13.037655373510344, 6.421645197219636, 5.499473367291093, 4.307902326910885, 6.369105408104223, 4.886925247121419, 2.7718853484756214, 1.178039792817893, 0.0), # 113
(16.796665616220118, 12.888805352817133, 13.828568512532428, 14.620215718724406, 12.71447202547959, 6.018447338956397, 5.473816387569522, 4.57365844462884, 6.506771421427836, 2.684391825560753, 2.0883733011339594, 1.2317868258169462, 0.0, 17.048295745488062, 13.549655083986407, 10.441866505669795, 8.053175476682258, 13.013542842855673, 6.403121822480377, 5.473816387569522, 4.298890956397426, 6.357236012739795, 4.873405239574803, 2.7657137025064857, 1.1717095775288306, 0.0), # 114
(16.744292825407193, 12.820412877827026, 13.798045399060976, 14.580114081995404, 12.690489213466321, 6.006150688123703, 5.448653685172405, 4.561051990709032, 6.495074987201274, 2.674271397594635, 2.0808463534281283, 1.2280556373838278, 0.0, 17.013611936988678, 13.508612011222104, 10.404231767140642, 8.022814192783905, 12.990149974402549, 6.385472786992645, 5.448653685172405, 4.290107634374073, 6.345244606733161, 4.860038027331802, 2.7596090798121957, 1.165492079802457, 0.0), # 115
(16.691723771827743, 12.753160664131308, 13.767798284975811, 14.540399302859647, 12.666226231660534, 5.994144321151453, 5.423944335775104, 4.549035234674245, 6.483708803536698, 2.6643570113022967, 2.0734817793814444, 1.224378479623102, 0.0, 16.978693067560602, 13.46816327585412, 10.367408896907222, 7.9930710339068884, 12.967417607073395, 6.368649328543944, 5.423944335775104, 4.281531657965324, 6.333113115830267, 4.846799767619883, 2.7535596569951624, 1.1593782421937553, 0.0), # 116
(16.63889299708279, 12.686949079834788, 13.73776805328898, 14.50099985299953, 12.641646931554131, 5.982399254013936, 5.399647415052978, 4.537573346372689, 6.472643289895322, 2.6546298304086586, 2.0662650296469853, 1.2207484569815625, 0.0, 16.943484608744804, 13.428233026797187, 10.331325148234924, 7.963889491225975, 12.945286579790643, 6.352602684921765, 5.399647415052978, 4.2731423242956685, 6.320823465777066, 4.833666617666511, 2.747553610657796, 1.1533590072577082, 0.0), # 117
(16.58573504277338, 12.621678493042284, 13.707895587012551, 14.461844204097451, 12.616715164639011, 5.970886502685445, 5.375721998681383, 4.526631495652572, 6.461848865738361, 2.6450710186386424, 2.0591815548778274, 1.2171586739060027, 0.0, 16.907932032082243, 13.388745412966028, 10.295907774389137, 7.935213055915925, 12.923697731476722, 6.337284093913602, 5.375721998681383, 4.264918930489604, 6.3083575823195055, 4.820614734699151, 2.74157911740251, 1.1474253175492988, 0.0), # 118
(16.532184450500534, 12.557249271858602, 13.678121769158587, 14.422860827835802, 12.591394782407065, 5.9595770831402755, 5.35212716233568, 4.516174852362109, 6.451295950527026, 2.6356617397171678, 2.0522168057270487, 1.2136022348432152, 0.0, 16.87198080911388, 13.349624583275366, 10.261084028635242, 7.906985219151502, 12.902591901054052, 6.322644793306953, 5.35212716233568, 4.256840773671625, 6.295697391203532, 4.807620275945268, 2.7356243538317178, 1.1415681156235096, 0.0), # 119
(16.47817576186529, 12.49356178438856, 13.648387482739144, 14.383978195896983, 12.565649636350196, 5.948442011352714, 5.3288219816912274, 4.506168586349507, 6.440954963722534, 2.626383157369158, 2.045356232847725, 1.2100722442399947, 0.0, 16.835576411380675, 13.31079468663994, 10.226781164238623, 7.879149472107472, 12.881909927445069, 6.308636020889311, 5.3288219816912274, 4.248887150966224, 6.282824818175098, 4.794659398632328, 2.7296774965478288, 1.1357783440353237, 0.0), # 120
(16.423643518468683, 12.430516398736968, 13.618633610766281, 14.345124779963385, 12.539443577960302, 5.937452303297058, 5.305765532423383, 4.49657786746298, 6.430796324786099, 2.6172164353195337, 2.038585286892935, 1.2065618065431336, 0.0, 16.79866431042359, 13.272179871974467, 10.192926434464676, 7.8516493059586, 12.861592649572199, 6.295209014448172, 5.305765532423383, 4.2410373594978985, 6.269721788980151, 4.781708259987796, 2.7237267221532564, 1.1300469453397246, 0.0), # 121
(16.36852226191174, 12.368013483008635, 13.588801036252066, 14.306229051717406, 12.51274045872928, 5.926578974947596, 5.282916890207506, 4.487367865550737, 6.420790453178933, 2.6081427372932153, 2.0318894185157554, 1.2030640261994254, 0.0, 16.761189977783587, 13.233704288193676, 10.159447092578777, 7.824428211879645, 12.841580906357866, 6.282315011771032, 5.282916890207506, 4.2332706963911395, 6.25637022936464, 4.768743017239136, 2.7177602072504135, 1.1243648620916942, 0.0), # 122
(16.312746533795494, 12.305953405308378, 13.558830642208555, 14.267219482841437, 12.485504130149028, 5.915793042278621, 5.260235130718955, 4.478503750460988, 6.410907768362252, 2.5991432270151247, 2.0252540783692634, 1.1995720076556633, 0.0, 16.72309888500163, 13.195292084212294, 10.126270391846315, 7.797429681045372, 12.821815536724504, 6.269905250645383, 5.260235130718955, 4.225566458770444, 6.242752065074514, 4.755739827613813, 2.711766128441711, 1.1187230368462162, 0.0), # 123
(16.256250875720976, 12.244236533741004, 13.528663311647806, 14.228024545017881, 12.457698443711445, 5.905065521264426, 5.237679329633088, 4.469950692041945, 6.401118689797269, 2.590199068210183, 2.018664717106536, 1.1960788553586414, 0.0, 16.68433650361868, 13.156867408945052, 10.09332358553268, 7.770597204630548, 12.802237379594539, 6.257930968858723, 5.237679329633088, 4.217903943760304, 6.2288492218557225, 4.742674848339295, 2.7057326623295617, 1.1131124121582732, 0.0), # 124
(16.198969829289226, 12.18276323641133, 13.498239927581887, 14.188572709929128, 12.429287250908427, 5.894367427879304, 5.215208562625265, 4.461673860141818, 6.391393636945196, 2.5812914246033105, 2.012106785380651, 1.1925776737551523, 0.0, 16.644848305175692, 13.118354411306674, 10.060533926903252, 7.74387427380993, 12.782787273890392, 6.246343404198546, 5.215208562625265, 4.210262448485217, 6.2146436254542134, 4.7295242366430434, 2.6996479855163775, 1.1075239305828484, 0.0), # 125
(16.14083793610127, 12.121433881424165, 13.46750137302285, 14.148792449257574, 12.400234403231872, 5.883669778097547, 5.192781905370843, 4.453638424608819, 6.381703029267251, 2.57240145991943, 2.005565733844684, 1.1890615672919902, 0.0, 16.604579761213643, 13.079677240211891, 10.02782866922342, 7.717204379758288, 12.763406058534501, 6.235093794452347, 5.192781905370843, 4.202621270069677, 6.200117201615936, 4.716264149752526, 2.69350027460457, 1.1019485346749243, 0.0), # 126
(16.08178973775815, 12.06014883688432, 13.436388530982757, 14.108612234685616, 12.370503752173677, 5.872943587893444, 5.170358433545185, 4.445809555291159, 6.3720172862246445, 2.563510337883461, 1.9990270131517138, 1.1855236404159475, 0.0, 16.56347634327348, 13.040760044575421, 9.99513506575857, 7.690531013650382, 12.744034572449289, 6.224133377407623, 5.170358433545185, 4.194959705638174, 6.185251876086839, 4.702870744895206, 2.6872777061965514, 1.0963771669894837, 0.0), # 127
(16.021759775860883, 11.998808470896611, 13.404842284473675, 14.06796053789565, 12.340059149225747, 5.862159873241292, 5.147897222823644, 4.438152422037048, 6.362306827278591, 2.554599222220326, 1.9924760739548175, 1.1819569975738184, 0.0, 16.521483522896165, 13.001526973312, 9.962380369774086, 7.663797666660978, 12.724613654557182, 6.2134133908518665, 5.147897222823644, 4.187257052315209, 6.170029574612873, 4.689320179298551, 2.680968456894735, 1.0908007700815103, 0.0), # 128
(15.960682592010507, 11.937313151565847, 13.37280351650766, 14.026765830570064, 12.308864445879973, 5.85128965011538, 5.125357348881582, 4.430632194694696, 6.352542071890305, 2.5456492766549457, 1.9858983669070716, 1.1783547432123955, 0.0, 16.478546771622668, 12.96190217533635, 9.929491834535357, 7.636947829964836, 12.70508414378061, 6.202885072572574, 5.125357348881582, 4.179492607225272, 6.154432222939986, 4.675588610190022, 2.6745607033015326, 1.0852102865059863, 0.0), # 129
(15.89849272780806, 11.875563246996844, 13.34021311009677, 13.984956584391266, 12.276883493628256, 5.840303934489999, 5.102697887394356, 4.423214043112313, 6.342693439521001, 2.536641664912241, 1.9792793426615536, 1.174709981778473, 0.0, 16.434611560993947, 12.921809799563201, 9.896396713307768, 7.609924994736723, 12.685386879042001, 6.192499660357238, 5.102697887394356, 4.171645667492856, 6.138441746814128, 4.66165219479709, 2.668042622019354, 1.0795966588178951, 0.0), # 130
(15.83512472485457, 11.81345912529441, 13.307011948253072, 13.942461271041642, 12.244080143962494, 5.829173742339445, 5.079877914037328, 4.415863137138113, 6.332731349631892, 2.527557550717134, 1.9726044518713404, 1.1710158177188439, 0.0, 16.38962336255096, 12.88117399490728, 9.863022259356702, 7.5826726521514, 12.665462699263784, 6.182208391993358, 5.079877914037328, 4.16369553024246, 6.122040071981247, 4.647487090347215, 2.6614023896506143, 1.073950829572219, 0.0), # 131
(15.770513124751067, 11.750901154563357, 13.27314091398862, 13.899208362203591, 12.210418248374584, 5.817870089638008, 5.056856504485853, 4.408544646620305, 6.322626221684192, 2.5183780977945447, 1.9658591451895095, 1.1672653554803014, 0.0, 16.343527647834676, 12.839918910283313, 9.829295725947548, 7.555134293383633, 12.645252443368385, 6.171962505268427, 5.056856504485853, 4.155621492598577, 6.105209124187292, 4.633069454067865, 2.654628182797724, 1.0682637413239418, 0.0), # 132
(15.704592469098595, 11.687789702908498, 13.238540890315475, 13.855126329559509, 12.175861658356425, 5.80636399235998, 5.03359273441529, 4.4012237414071, 6.312348475139116, 2.509084469869395, 1.9590288732691383, 1.1634516995096391, 0.0, 16.296269888386057, 12.797968694606027, 9.795144366345692, 7.527253409608184, 12.624696950278231, 6.1617132379699395, 5.03359273441529, 4.1474028516857, 6.087930829178212, 4.618375443186504, 2.647708178063095, 1.0625263366280455, 0.0), # 133
(15.63729729949817, 11.624025138434646, 13.203152760245707, 13.81014364479179, 12.14037422539991, 5.794626466479654, 5.010045679501001, 4.3938655913467075, 6.301868529457877, 2.499657830666606, 1.952099086763304, 1.1595679542536501, 0.0, 16.24779555574605, 12.755247496790147, 9.76049543381652, 7.498973491999817, 12.603737058915755, 6.151411827885391, 5.010045679501001, 4.139018904628324, 6.070187112699955, 4.6033812149305975, 2.6406305520491418, 1.0567295580395135, 0.0), # 134
(15.568562157550836, 11.559507829246614, 13.166917406791363, 13.764188779582833, 12.103919800996945, 5.7826285279713225, 4.986174415418341, 4.3864353662873405, 6.291156804101687, 2.4900793439110998, 1.945055236325083, 1.155607224159128, 0.0, 16.198050121455637, 12.711679465750406, 9.725276181625414, 7.470238031733298, 12.582313608203375, 6.141009512802277, 4.986174415418341, 4.130448948550945, 6.051959900498472, 4.588062926527612, 2.633383481358273, 1.0508643481133288, 0.0), # 135
(15.498321584857623, 11.494138143449213, 13.129775712964513, 13.717190205615022, 12.066462236639419, 5.770341192809277, 4.961938017842671, 4.378898236077208, 6.280183718531764, 2.4803301733277956, 1.9378827726075534, 1.1515626136728663, 0.0, 16.146979057055766, 12.667188750401527, 9.689413863037766, 7.4409905199833855, 12.560367437063528, 6.130457530508091, 4.961938017842671, 4.121672280578055, 6.033231118319709, 4.572396735205008, 2.6259551425929026, 1.044921649404474, 0.0), # 136
(15.426510123019561, 11.427816449147253, 13.091668561777217, 13.66907639457077, 12.02796538381924, 5.757735476967808, 4.93729556244935, 4.371219370564522, 6.2689196922093195, 2.4703914826416162, 1.930567146263792, 1.1474272272416581, 0.0, 16.094527834087398, 12.621699499658236, 9.652835731318959, 7.411174447924847, 12.537839384418639, 6.119707118790331, 4.93729556244935, 4.112668197834148, 6.01398269190962, 4.556358798190257, 2.6183337123554433, 1.0388924044679322, 0.0), # 137
(15.353062313637686, 11.360443114445548, 13.052536836241526, 13.619775818132457, 11.988393094028304, 5.744782396421213, 4.912206124913734, 4.363363939597493, 6.257335144595569, 2.4602444355774815, 1.9230938079468758, 1.143194169312297, 0.0, 16.040641924091503, 12.575135862435264, 9.615469039734378, 7.380733306732443, 12.514670289191137, 6.10870951543649, 4.912206124913734, 4.103415997443723, 5.994196547014152, 4.5399252727108195, 2.6105073672483052, 1.0327675558586864, 0.0), # 138
(15.277912698313022, 11.29191850744891, 13.01232141936951, 13.569216947982484, 11.947709218758497, 5.731452967143778, 4.886628780911184, 4.355297113024331, 6.245400495151722, 2.449870195860314, 1.9154482083098823, 1.1388565443315761, 0.0, 15.985266798609034, 12.527421987647335, 9.577241041549412, 7.3496105875809405, 12.490800990303445, 6.0974159582340635, 4.886628780911184, 4.093894976531271, 5.973854609379249, 4.523072315994162, 2.602464283873902, 1.0265380461317193, 0.0), # 139
(15.200995818646616, 11.22214299626215, 12.970963194173232, 13.51732825580325, 11.905877609501736, 5.717718205109798, 4.860522606117057, 4.346984060693248, 6.233086163338999, 2.439249927215034, 1.9076157980058883, 1.134407456746289, 0.0, 15.928347929180966, 12.478482024209175, 9.538078990029442, 7.3177497816451, 12.466172326677999, 6.085777684970546, 4.860522606117057, 4.084084432221284, 5.952938804750868, 4.505776085267751, 2.5941926388346466, 1.020194817842014, 0.0), # 140
(15.122246216239494, 11.151016948990085, 12.92840304366474, 13.464038213277146, 11.862862117749902, 5.7035491262935665, 4.833846676206716, 4.338389952452453, 6.220362568618608, 2.4283647933665637, 1.8995820276879718, 1.129840011003229, 0.0, 15.869830787348244, 12.428240121035515, 9.497910138439858, 7.2850943800996895, 12.440725137237216, 6.073745933433434, 4.833846676206716, 4.0739636616382615, 5.931431058874951, 4.48801273775905, 2.5856806087329485, 1.0137288135445532, 0.0), # 141
(15.041598432692682, 11.07844073373752, 12.884581850856106, 13.409275292086573, 11.818626594994903, 5.688916746669374, 4.806560066855513, 4.329479958150158, 6.207200130451765, 2.417195958039823, 1.8913323480092095, 1.1251473115491895, 0.0, 15.80966084465184, 12.37662042704108, 9.456661740046046, 7.251587874119467, 12.41440026090353, 6.061271941410222, 4.806560066855513, 4.063511961906696, 5.909313297497452, 4.469758430695525, 2.5769163701712214, 1.00713097579432, 0.0), # 142
(14.958987009607215, 11.004314718609267, 12.839440498759389, 13.352967963913915, 11.773134892728635, 5.673792082211512, 4.778621853738811, 4.320219247634575, 6.1935692682996875, 2.405724584959734, 1.8828522096226783, 1.1203224628309636, 0.0, 15.747783572632711, 12.323547091140597, 9.41426104811339, 7.217173754879202, 12.387138536599375, 6.048306946688404, 4.778621853738811, 4.05270863015108, 5.886567446364317, 4.45098932130464, 2.5678880997518783, 1.0003922471462972, 0.0), # 143
(14.874346488584132, 10.928539271710147, 12.792919870386642, 13.29504470044158, 11.726350862442994, 5.658146148894274, 4.749991112531969, 4.310572990753912, 6.1794404016235855, 2.3939318378512175, 1.8741270631814555, 1.115358569295345, 0.0, 15.684144442831826, 12.268944262248793, 9.370635315907277, 7.181795513553651, 12.358880803247171, 6.034802187055478, 4.749991112531969, 4.04153296349591, 5.863175431221497, 4.431681566813861, 2.5585839740773286, 0.993503570155468, 0.0), # 144
(14.787611411224459, 10.851014761144963, 12.744960848749933, 13.235433973351956, 11.67823835562988, 5.641949962691953, 4.7206269189103445, 4.300506357356382, 6.164783949884672, 2.381798880439195, 1.865142359338619, 1.110248735389127, 0.0, 15.618688926790139, 12.212736089280396, 9.325711796693094, 7.145396641317584, 12.329567899769344, 6.020708900298935, 4.7206269189103445, 4.029964259065681, 5.83911917781494, 4.411811324450653, 2.548992169749987, 0.986455887376815, 0.0), # 145
(14.69871631912923, 10.771641555018533, 12.695504316861326, 13.174064254327444, 11.62876122378119, 5.62517453957884, 4.690488348549297, 4.289984517290195, 6.1495703325441635, 2.3693068764485874, 1.8558835487472447, 1.104986065559103, 0.0, 15.551362496048613, 12.154846721150133, 9.279417743736223, 7.107920629345761, 12.299140665088327, 6.005978324206273, 4.690488348549297, 4.0179818139848855, 5.814380611890595, 4.391354751442482, 2.539100863372265, 0.9792401413653213, 0.0), # 146
(14.607595753899481, 10.690320021435666, 12.644491157732865, 13.110864015050435, 11.577883318388821, 5.607790895529226, 4.659534477124183, 4.278972640403562, 6.133769969063274, 2.3564369896043162, 1.846336082060411, 1.0995636642520668, 0.0, 15.482110622148213, 12.095200306772732, 9.231680410302054, 7.069310968812948, 12.267539938126548, 5.990561696564987, 4.659534477124183, 4.005564925378019, 5.7889416591944105, 4.370288005016812, 2.5288982315465733, 0.9718472746759697, 0.0), # 147
(14.51418425713624, 10.606950528501175, 12.591862254376625, 13.045761727203324, 11.525568490944673, 5.5897700465174065, 4.627724380310364, 4.2674358965446935, 6.1173532789032175, 2.3431703836313016, 1.836485409931195, 1.0939746359148106, 0.0, 15.410878776629895, 12.033720995062914, 9.182427049655974, 7.029511150893903, 12.234706557806435, 5.974410255162571, 4.627724380310364, 3.9926928903695758, 5.762784245472337, 4.348587242401109, 2.5183724508753254, 0.9642682298637433, 0.0), # 148
(14.418416370440541, 10.52143344431987, 12.537558489804665, 12.97868586246851, 11.471780592940643, 5.57108300851767, 4.595017133783196, 4.255339455561801, 6.100290681525203, 2.3294882222544664, 1.8263169830126733, 1.0882120849941288, 0.0, 15.337612431034628, 11.970332934935415, 9.131584915063366, 6.988464666763398, 12.200581363050405, 5.957475237786521, 4.595017133783196, 3.9793450060840496, 5.735890296470322, 4.326228620822837, 2.507511697960933, 0.9564939494836247, 0.0), # 149
(14.320226635413416, 10.433669136996565, 12.481520747029043, 12.909564892528387, 11.416483475868631, 5.551700797504312, 4.561371813218041, 4.242648487303093, 6.0825525963904505, 2.31537166919873, 1.815816251957923, 1.0822691159368145, 0.0, 15.262257056903364, 11.904960275304958, 9.079081259789614, 6.946115007596189, 12.165105192780901, 5.93970788222433, 4.561371813218041, 3.9655005696459367, 5.7082417379343156, 4.303188297509463, 2.4963041494058085, 0.948515376090597, 0.0), # 150
(14.219549593655895, 10.343557974636072, 12.423689909061814, 12.838327289065347, 11.359640991220532, 5.531594429451621, 4.526747494290255, 4.229328161616783, 6.064109442960174, 2.3008018881890155, 1.8049686674200216, 1.0761388331896609, 0.0, 15.184758125777073, 11.837527165086268, 9.024843337100108, 6.902405664567045, 12.128218885920347, 5.921059426263496, 4.526747494290255, 3.951138878179729, 5.679820495610266, 4.27944242968845, 2.484737981812363, 0.9403234522396431, 0.0), # 151
(14.116319786769019, 10.251000325343204, 12.364006858915053, 12.76490152376179, 11.301216990488243, 5.510734920333892, 4.491103252675198, 4.215343648351081, 6.044931640695582, 2.2857600429502427, 1.7937596800520466, 1.0698143411994616, 0.0, 15.105061109196717, 11.767957753194075, 8.968798400260232, 6.857280128850727, 12.089863281391164, 5.901481107691514, 4.491103252675198, 3.936239228809923, 5.650608495244121, 4.254967174587264, 2.4728013717830106, 0.931909120485746, 0.0), # 152
(14.010471756353809, 10.155896557222773, 12.302412479600802, 12.68921606830011, 11.241175325163667, 5.489093286125417, 4.454398164048228, 4.200660117354197, 6.024989609057894, 2.2702272972073336, 1.782174740507075, 1.0632887444130097, 0.0, 15.02311147870325, 11.696176188543106, 8.910873702535374, 6.810681891622, 12.049979218115787, 5.880924164295876, 4.454398164048228, 3.920780918661012, 5.620587662581833, 4.229738689433371, 2.4604824959201608, 0.9232633233838886, 0.0), # 153
(13.901940044011312, 10.05814703837959, 12.238847654131138, 12.611199394362703, 11.179479846738696, 5.466640542800487, 4.416591304084705, 4.185242738474343, 6.00425376750832, 2.254184814685209, 1.7701992994381837, 1.0565551472770989, 0.0, 14.938854705837642, 11.622106620048086, 8.850996497190918, 6.762554444055626, 12.00850753501664, 5.85933983386408, 4.416591304084705, 3.904743244857491, 5.589739923369348, 4.203733131454236, 2.447769530826228, 0.9143770034890537, 0.0), # 154
(13.790659191342543, 9.957652136918465, 12.173253265518113, 12.530779973631962, 11.116094406705237, 5.443347706333395, 4.377641748459985, 4.169056681559727, 5.982694535508077, 2.23761375910879, 1.7578188074984502, 1.0496066542385225, 0.0, 14.852236262140847, 11.545673196623744, 8.789094037492251, 6.712841277326369, 11.965389071016155, 5.836679354183619, 4.377641748459985, 3.8881055045238533, 5.5580472033526185, 4.176926657877321, 2.4346506531036227, 0.9052411033562243, 0.0), # 155
(13.676563739948545, 9.854312220944214, 12.10557019677379, 12.447886277790282, 11.050982856555176, 5.419185792698435, 4.33750857284943, 4.152067116458564, 5.960282332518376, 2.220495294202998, 1.7450187153409518, 1.0424363697440735, 0.0, 14.763201619153833, 11.466800067184806, 8.725093576704758, 6.661485882608993, 11.920564665036752, 5.81289396304199, 4.33750857284943, 3.870846994784596, 5.525491428277588, 4.149295425930095, 2.4211140393547583, 0.8958465655403832, 0.0), # 156
(13.559588231430352, 9.748027658561648, 12.035739330910227, 12.362446778520066, 10.984109047780422, 5.394125817869895, 4.296150852928397, 4.134239213019062, 5.9369875780004335, 2.202810583692754, 1.731784473618765, 1.0350373982405456, 0.0, 14.671696248417557, 11.385411380646001, 8.658922368093824, 6.60843175107826, 11.873975156000867, 5.787934898226687, 4.296150852928397, 3.8529470127642105, 5.492054523890211, 4.120815592840023, 2.407147866182046, 0.8861843325965136, 0.0), # 157
(13.43642570352943, 9.636747649274225, 11.960387930853534, 12.27118893522918, 10.912417327045198, 5.366575700132966, 4.252596048835072, 4.1143477142620295, 5.910997254959458, 2.1840146623310153, 1.717678725761683, 1.027139934629151, 0.0, 14.573674546947622, 11.298539280920659, 8.588393628808413, 6.552043986993045, 11.821994509918916, 5.7600867999668415, 4.252596048835072, 3.833268357237833, 5.456208663522599, 4.090396311743061, 2.3920775861707066, 0.8760679681158388, 0.0), # 158
(13.288116180561124, 9.509057777339137, 11.860106727604483, 12.155369164364412, 10.818229571737954, 5.327374130407459, 4.201391487047145, 4.085410149573287, 5.871856356733287, 2.161026447344436, 1.7002250806856987, 1.0172043785524665, 0.0, 14.445769764456351, 11.189248164077128, 8.501125403428492, 6.483079342033307, 11.743712713466573, 5.719574209402602, 4.201391487047145, 3.8052672360053275, 5.409114785868977, 4.051789721454805, 2.372021345520897, 0.8644597979399218, 0.0), # 159
(13.112769770827757, 9.363909602092178, 11.732881436933834, 12.013079639051961, 10.699704157616154, 5.275558360850069, 4.142019373545406, 4.04669939214551, 5.818455136337191, 2.1335425433383026, 1.6791778525828622, 1.0050752923331772, 0.0, 14.285557096008445, 11.055828215664945, 8.39588926291431, 6.400627630014906, 11.636910272674381, 5.665379149003714, 4.142019373545406, 3.7682559720357633, 5.349852078808077, 4.004359879683988, 2.346576287386767, 0.8512645092811072, 0.0), # 160
(12.911799698254727, 9.202249432332774, 11.580070457865464, 11.845672880071582, 10.558071749138534, 5.21175610364883, 4.0749133014061885, 3.9987003998323356, 5.751497860199411, 2.101796186926922, 1.6547224963799123, 0.9908651203361357, 0.0, 14.094673280674375, 10.899516323697492, 8.273612481899562, 6.305388560780765, 11.502995720398822, 5.59818055976527, 4.0749133014061885, 3.722682931177736, 5.279035874569267, 3.9485576266905285, 2.3160140915730927, 0.8365681302120704, 0.0), # 161
(12.686619186767443, 9.025023576860344, 11.403032189423245, 11.654501408203041, 10.394563010763845, 5.1365950709917785, 4.000506863705828, 3.941898130487402, 5.6716887947481816, 2.0660206147246045, 1.6270444670035862, 0.9746863069261941, 0.0, 13.874755057524599, 10.721549376188133, 8.13522233501793, 6.198061844173813, 11.343377589496363, 5.518657382682362, 4.000506863705828, 3.668996479279842, 5.197281505381922, 3.884833802734348, 2.280606437884649, 0.8204566888054858, 0.0), # 162
(12.438641460291295, 8.833178344474314, 11.203125030631053, 11.44091774422611, 10.210408606950825, 5.050702975066952, 3.919233653520661, 3.876777541964344, 5.579732206411743, 2.0264490633456567, 1.5963292193806227, 0.956651296468205, 0.0, 13.627439165629584, 10.523164261150253, 7.9816460969031136, 6.079347190036969, 11.159464412823485, 5.427488558750082, 3.919233653520661, 3.6076449821906795, 5.105204303475412, 3.813639248075371, 2.2406250061262107, 0.8030162131340287, 0.0), # 163
(12.16927974275169, 8.627660043974105, 10.981707380512765, 11.206274408920553, 10.006839202158226, 4.954707528062387, 3.8315272639270197, 3.8038235921168018, 5.476332361618334, 1.9833147694043862, 1.562762208437759, 0.9368725333270206, 0.0, 13.35436234405979, 10.305597866597225, 7.813811042188794, 5.949944308213158, 10.952664723236667, 5.325353028963523, 3.8315272639270197, 3.5390768057588473, 5.003419601079113, 3.735424802973519, 2.1963414761025533, 0.7843327312703733, 0.0), # 164
(11.879947258074031, 8.409414984159142, 10.740137638092254, 10.95192392306614, 9.785085460844787, 4.849236442166116, 3.7378212880012396, 3.7235212387984102, 5.3621935267961875, 1.9368509695151015, 1.5265288891017337, 0.915462461867493, 0.0, 13.057161331885686, 10.070087080542422, 7.632644445508667, 5.810552908545303, 10.724387053592375, 5.2129297343177745, 3.7378212880012396, 3.4637403158329394, 4.892542730422393, 3.6506413076887143, 2.148027527618451, 0.7644922712871949, 0.0), # 165
(11.572057230183715, 8.17938947382885, 10.479774202393392, 10.679218807442627, 9.546378047469258, 4.734917429566179, 3.6385493188196576, 3.636355439862808, 5.2380199683735436, 1.8872909002921108, 1.4878147162992839, 0.8925335264544754, 0.0, 12.737472868177733, 9.817868790999228, 7.4390735814964195, 5.661872700876331, 10.476039936747087, 5.090897615807931, 3.6385493188196576, 3.3820838782615565, 4.773189023734629, 3.5597396024808767, 2.0959548404786785, 0.7435808612571683, 0.0), # 166
(11.24702288300614, 7.938529821782648, 10.201975472440058, 10.389511582829789, 9.291947626490376, 4.6123782024506115, 3.5341449494586072, 3.542811153163632, 5.104515952778639, 1.834867798349722, 1.4468051449571482, 0.8681981714528189, 0.0, 12.396933692006392, 9.550179885981006, 7.23402572478574, 5.504603395049164, 10.209031905557278, 4.959935614429085, 3.5341449494586072, 3.2945558588932937, 4.645973813245188, 3.4631705276099303, 2.040395094488012, 0.7216845292529681, 0.0), # 167
(10.906257440466712, 7.687782336819962, 9.908099847256123, 10.084154770007387, 9.023024862366888, 4.482246473007449, 3.425041772994424, 3.44337333655452, 4.962385746439713, 1.779814900302243, 1.4036856300020644, 0.8425688412273767, 0.0, 12.037180542442131, 9.268257253501142, 7.018428150010321, 5.339444700906728, 9.924771492879426, 4.820722671176328, 3.425041772994424, 3.2016046235767495, 4.511512431183444, 3.361384923335797, 1.9816199694512246, 0.6988893033472693, 0.0), # 168
(10.551174126490828, 7.428093327740216, 9.599505725865463, 9.76450088975519, 8.740840419557543, 4.3451499534247295, 3.3116733825034426, 3.338526947889109, 4.812333615785002, 1.7223654427639818, 1.3586416263607706, 0.8157579801430009, 0.0, 11.659850158555415, 8.97333778157301, 6.793208131803853, 5.167096328291944, 9.624667231570005, 4.673937727044753, 3.3116733825034426, 3.103678538160521, 4.370420209778771, 3.254833629918398, 1.9199011451730927, 0.675281211612747, 0.0), # 169
(10.18318616500389, 7.160409103342831, 9.277551507291953, 9.43190246285296, 8.44662496252108, 4.201716355890488, 3.1944733710619975, 3.228756945021036, 4.655063827242743, 1.6627526623492466, 1.311858588960005, 0.7878780325645439, 0.0, 11.2665792794167, 8.666658358209983, 6.559292944800025, 4.988257987047739, 9.310127654485486, 4.52025972302945, 3.1944733710619975, 3.0012259684932054, 4.22331248126054, 3.1439674876176547, 1.8555103014583907, 0.6509462821220756, 0.0), # 170
(9.8037067799313, 6.88567597242723, 8.943595590559468, 9.087712010080473, 8.141609155716246, 4.052573392592758, 3.0738753317464247, 3.1145482858039375, 4.491280647241173, 1.6012097956723452, 1.2635219727265048, 0.759041442856858, 0.0, 10.859004644096458, 8.349455871425437, 6.317609863632523, 4.803629387017034, 8.982561294482347, 4.360367600125513, 3.0738753317464247, 2.8946952804233987, 4.070804577858123, 3.029237336693492, 1.7887191181118935, 0.6259705429479302, 0.0), # 171
(9.414149195198457, 6.604840243792839, 8.59899637469188, 8.733282052217486, 7.827023663601784, 3.898348775719581, 2.950312857633059, 2.996385928091453, 4.321688342208532, 1.5379700793475863, 1.2138172325870082, 0.7293606553847958, 0.0, 10.438762991665145, 8.022967209232752, 6.069086162935041, 4.613910238042758, 8.643376684417063, 4.194940299328034, 2.950312857633059, 2.7845348397997007, 3.913511831800892, 2.911094017405829, 1.7197992749383764, 0.6004400221629854, 0.0), # 172
(9.015926634730764, 6.31884822623908, 8.245112258713068, 8.369965110043767, 7.504099150636442, 3.739670217458989, 2.824219541798235, 2.874754829737218, 4.146991178573053, 1.4732667499892769, 1.1629298234682535, 0.6989481145132089, 0.0, 10.007491061193234, 7.6884292596452966, 5.8146491173412675, 4.41980024996783, 8.293982357146106, 4.024656761632105, 2.824219541798235, 2.6711930124707064, 3.752049575318221, 2.7899883700145893, 1.6490224517426137, 0.5744407478399164, 0.0), # 173
(8.610452322453618, 6.028646228565374, 7.883301641646902, 7.99911370433908, 7.174066281278959, 3.57716542999902, 2.6960289773182877, 2.7501399485948705, 3.9678934227629785, 1.4073330442117262, 1.1110452002969786, 0.6679162646069503, 0.0, 9.566825591751181, 7.347078910676452, 5.555226001484892, 4.221999132635178, 7.935786845525957, 3.850195928032819, 2.6960289773182877, 2.5551181642850143, 3.5870331406394795, 2.6663712347796937, 1.5766603283293805, 0.5480587480513978, 0.0), # 174
(8.19913948229242, 5.7351805595711465, 7.514922922517262, 7.622080355883197, 6.838155719988082, 3.41146212552771, 2.566174757269552, 2.623026242518047, 3.7850993412065432, 1.3404021986292411, 1.058348817999921, 0.6363775500308723, 0.0, 9.118403322409455, 7.000153050339593, 5.291744089999604, 4.021206595887723, 7.5701986824130865, 3.6722367395252657, 2.566174757269552, 2.4367586610912215, 3.419077859994041, 2.540693451961066, 1.5029845845034526, 0.5213800508701043, 0.0), # 175
(7.783401338172574, 5.43939752805582, 7.141334500348018, 7.240217585455879, 6.497598131222556, 3.2431880162330953, 2.4350904747283635, 2.493898669360387, 3.5993132003319848, 1.2727074498561304, 1.0050261315038191, 0.6044444151498269, 0.0, 8.663860992238513, 6.648888566648095, 5.025130657519095, 3.8181223495683905, 7.1986264006639695, 3.4914581371045417, 2.4350904747283635, 2.3165628687379254, 3.248799065611278, 2.4134058618186267, 1.4282669000696038, 0.49449068436871096, 0.0), # 176
(7.364651114019479, 5.1422434428188195, 6.763894774163046, 6.8548779138368925, 6.1536241794411275, 3.0729708143032117, 2.303209722771056, 2.3632421869755245, 3.411239266567542, 1.2044820345067013, 0.9512625957354108, 0.5722293043286669, 0.0, 8.204835340308824, 6.2945223476153345, 4.756312978677054, 3.6134461035201033, 6.822478533135084, 3.3085390617657344, 2.303209722771056, 2.1949791530737226, 3.0768120897205637, 2.284959304612298, 1.3527789548326095, 0.4674766766198928, 0.0), # 177
(6.944302033758534, 4.8446646126595665, 6.383962142986221, 6.467413861806007, 5.807464529102536, 2.901438231926097, 2.170966094473966, 2.2315417532170994, 3.2215818063414514, 1.1359591891952627, 0.897243665621434, 0.5398446619322442, 0.0, 7.742963105690853, 5.938291281254685, 4.486218328107169, 3.4078775675857873, 6.443163612682903, 3.1241584545039394, 2.170966094473966, 2.072455879947212, 2.903732264551268, 2.1558046206020025, 1.2767924285972443, 0.44042405569632426, 0.0), # 178
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179
)
passenger_allighting_rate = (
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 0
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 1
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 2
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 3
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 4
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 5
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 6
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 7
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 8
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 9
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 10
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 11
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 12
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 13
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 14
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 15
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 16
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 17
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 18
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 19
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 20
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 21
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 22
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 23
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 24
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 25
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 26
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 27
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 28
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 29
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 30
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 31
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 32
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 33
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 34
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 35
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 36
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 37
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 38
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 39
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 40
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 41
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 42
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 43
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 44
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 45
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 46
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 47
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 48
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 49
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 50
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 51
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 52
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 53
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 54
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 55
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 56
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 57
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 58
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 59
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 60
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 61
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 62
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 63
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 64
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 65
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 66
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 67
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 68
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 69
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 70
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 71
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 72
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 73
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 74
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 75
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 76
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 77
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 78
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 79
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 80
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 81
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 82
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 83
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 84
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 85
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 86
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 87
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 88
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 89
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 90
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 91
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 92
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 93
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 94
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 95
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 96
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 97
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 98
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 99
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 100
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 101
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 102
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 103
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 104
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 105
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 106
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 107
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 108
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 109
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 110
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 111
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 112
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 113
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 114
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 115
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 116
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 117
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 118
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 119
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 120
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 121
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 122
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 123
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 124
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 125
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 126
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 127
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 128
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 129
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 130
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 131
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 132
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 133
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 134
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 135
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 136
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 137
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 138
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 139
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 140
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 141
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 142
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 143
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 144
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 145
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 146
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 147
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 148
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 149
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 150
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 151
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 152
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 153
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 154
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 155
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 156
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 157
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 158
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 159
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 160
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 161
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 162
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 163
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 164
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 165
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 166
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 167
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 168
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 169
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 170
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 171
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 172
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 173
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 174
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 175
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 176
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 177
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 178
(0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 179
)
"""
parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html
"""
#initial entropy
entropy = 8991598675325360468762009371570610170
#index for seed sequence child
child_seed_index = (
1, # 0
36, # 1
)
| 278.362567
| 490
| 0.771298
| 32,987
| 260,269
| 6.085246
| 0.235062
| 0.355097
| 0.340749
| 0.645631
| 0.366161
| 0.361105
| 0.360646
| 0.360577
| 0.360577
| 0.360577
| 0
| 0.851062
| 0.095032
| 260,269
| 934
| 491
| 278.6606
| 0.001185
| 0.015411
| 0
| 0.200873
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.005459
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
9941155b73b50825f4c22e8bd60744aecb14e706
| 38
|
py
|
Python
|
savecode/threeyears/idownserver/dnsreq/__init__.py
|
Octoberr/swm0920
|
8f05a6b91fc205960edd57f9076facec04f49a1a
|
[
"Apache-2.0"
] | 2
|
2019-05-19T11:54:26.000Z
|
2019-05-19T12:03:49.000Z
|
savecode/threeyears/idownserver/dnsreq/__init__.py
|
Octoberr/swm0920
|
8f05a6b91fc205960edd57f9076facec04f49a1a
|
[
"Apache-2.0"
] | 1
|
2020-11-27T07:55:15.000Z
|
2020-11-27T07:55:15.000Z
|
savecode/threeyears/idownserver/dnsreq/__init__.py
|
Octoberr/swm0920
|
8f05a6b91fc205960edd57f9076facec04f49a1a
|
[
"Apache-2.0"
] | 2
|
2021-09-06T18:06:12.000Z
|
2021-12-31T07:44:43.000Z
|
from .dnsreqdealer import DnsReqDealer
| 38
| 38
| 0.894737
| 4
| 38
| 8.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078947
| 38
| 1
| 38
| 38
| 0.971429
| 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
| 1
| 0
|
0
| 6
|
9969702168eaa2a803a9b22907df963ef3cbab6f
| 143
|
py
|
Python
|
mail_alias_manager/api/v1_api/__init__.py
|
stuvusIT/mail_alias_manager
|
260b6d1da4db03079afee159c23c3f83f4e75937
|
[
"MIT"
] | null | null | null |
mail_alias_manager/api/v1_api/__init__.py
|
stuvusIT/mail_alias_manager
|
260b6d1da4db03079afee159c23c3f83f4e75937
|
[
"MIT"
] | null | null | null |
mail_alias_manager/api/v1_api/__init__.py
|
stuvusIT/mail_alias_manager
|
260b6d1da4db03079afee159c23c3f83f4e75937
|
[
"MIT"
] | null | null | null |
"""Module containing the v1 API."""
from .root import API_V1 # noqa
from . import recipient_alias # noqa
from . import sender_alias # noqa
| 23.833333
| 37
| 0.72028
| 21
| 143
| 4.761905
| 0.571429
| 0.16
| 0.28
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017241
| 0.188811
| 143
| 5
| 38
| 28.6
| 0.844828
| 0.314685
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
9984268e196c7b6f74d5fc4959e1fab66773f0d3
| 1,471
|
py
|
Python
|
chempy/properties/tests/test_water_viscosity_korson_1969.py
|
bertiewooster/chempy
|
115adc1d570aa1631baff4374f3128ce23fa7776
|
[
"BSD-2-Clause"
] | 340
|
2015-10-30T03:41:05.000Z
|
2022-03-31T05:01:17.000Z
|
chempy/properties/tests/test_water_viscosity_korson_1969.py
|
bertiewooster/chempy
|
115adc1d570aa1631baff4374f3128ce23fa7776
|
[
"BSD-2-Clause"
] | 80
|
2015-11-03T13:31:23.000Z
|
2022-03-31T16:46:19.000Z
|
chempy/properties/tests/test_water_viscosity_korson_1969.py
|
bertiewooster/chempy
|
115adc1d570aa1631baff4374f3128ce23fa7776
|
[
"BSD-2-Clause"
] | 75
|
2016-06-06T19:55:48.000Z
|
2022-03-19T23:39:13.000Z
|
import warnings
from ..water_viscosity_korson_1969 import water_viscosity
def test_water_viscosity():
warnings.filterwarnings("error") # Table II (p. 38):
assert abs(water_viscosity(273.15 + 0) - 1.7916) < 5e-4
assert abs(water_viscosity(273.15 + 5) - 1.5192) < 5e-4
assert abs(water_viscosity(273.15 + 10) - 1.3069) < 5e-4
assert abs(water_viscosity(273.15 + 15) - 1.1382) < 5e-4
assert abs(water_viscosity(273.15 + 20) - 1.0020) < 5e-4
assert abs(water_viscosity(273.15 + 25) - 0.8903) < 5e-4
assert abs(water_viscosity(273.15 + 30) - 0.7975) < 5e-4
assert abs(water_viscosity(273.15 + 35) - 0.7195) < 5e-4
assert abs(water_viscosity(273.15 + 40) - 0.6532) < 5e-4
assert abs(water_viscosity(273.15 + 45) - 0.5963) < 5e-4
assert abs(water_viscosity(273.15 + 50) - 0.5471) < 5e-4
assert abs(water_viscosity(273.15 + 55) - 0.5042) < 5e-4
assert abs(water_viscosity(273.15 + 60) - 0.4666) < 5e-4
assert abs(water_viscosity(273.15 + 65) - 0.4334) < 5e-4
assert abs(water_viscosity(273.15 + 70) - 0.4039) < 5e-4
assert abs(water_viscosity(273.15 + 75) - 0.3775) < 5e-4
assert abs(water_viscosity(273.15 + 80) - 0.3538) < 5e-4
assert abs(water_viscosity(273.15 + 85) - 0.3323) < 5e-4
assert abs(water_viscosity(273.15 + 90) - 0.3128) < 5e-4
assert abs(water_viscosity(273.15 + 95) - 0.2949) < 6e-4
assert abs(water_viscosity(273.15 + 100) - 0.2783) < 2e-3
warnings.resetwarnings()
| 50.724138
| 61
| 0.656016
| 254
| 1,471
| 3.692913
| 0.26378
| 0.358209
| 0.313433
| 0.514925
| 0.688699
| 0.688699
| 0.658849
| 0.627932
| 0
| 0
| 0
| 0.250629
| 0.188987
| 1,471
| 28
| 62
| 52.535714
| 0.535624
| 0.011557
| 0
| 0
| 0
| 0
| 0.003444
| 0
| 0
| 0
| 0
| 0
| 0.807692
| 1
| 0.038462
| true
| 0
| 0.076923
| 0
| 0.115385
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
| 6
|
41e2290afea8242f9b3ad627b8896fc8296f5d30
| 110
|
py
|
Python
|
basis/cli/commands/logout.py
|
kvh/basis
|
8d109ff5ccf2c30b1a11406827d2c1620691ad95
|
[
"BSD-3-Clause"
] | 11
|
2020-05-29T20:56:48.000Z
|
2021-09-22T15:44:42.000Z
|
basis/cli/commands/logout.py
|
kvh/basis
|
8d109ff5ccf2c30b1a11406827d2c1620691ad95
|
[
"BSD-3-Clause"
] | null | null | null |
basis/cli/commands/logout.py
|
kvh/basis
|
8d109ff5ccf2c30b1a11406827d2c1620691ad95
|
[
"BSD-3-Clause"
] | null | null | null |
from basis.cli.services import auth
def logout():
"""Log out of your Basis account"""
auth.logout()
| 15.714286
| 39
| 0.663636
| 16
| 110
| 4.5625
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.209091
| 110
| 6
| 40
| 18.333333
| 0.83908
| 0.263636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
5146d58c84bb7104d16ee9a9d1a76b8231e89082
| 224
|
py
|
Python
|
nyaggle/experiment/__init__.py
|
harupy/nyaggle
|
132a93079e364d60b5598de77ab636a603ec06a4
|
[
"MIT"
] | null | null | null |
nyaggle/experiment/__init__.py
|
harupy/nyaggle
|
132a93079e364d60b5598de77ab636a603ec06a4
|
[
"MIT"
] | null | null | null |
nyaggle/experiment/__init__.py
|
harupy/nyaggle
|
132a93079e364d60b5598de77ab636a603ec06a4
|
[
"MIT"
] | null | null | null |
from nyaggle.experiment.experiment import Experiment, add_leaderboard_score
from nyaggle.experiment.averaging import average_results
from nyaggle.experiment.run import autoprep_gbdt, run_experiment, find_best_lgbm_parameter
| 56
| 90
| 0.892857
| 29
| 224
| 6.62069
| 0.586207
| 0.171875
| 0.328125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066964
| 224
| 3
| 91
| 74.666667
| 0.91866
| 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
| 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
| 6
|
515d5f82ce87af195121b8847cb3e553f85bb1c4
| 194
|
py
|
Python
|
src/Lexer/run.py
|
PetukhovVictor/compiler2
|
0bf87393ce9ecdd421393165fc14cb7f03f5e3b8
|
[
"MIT"
] | 3
|
2017-09-08T21:35:31.000Z
|
2019-04-24T11:48:59.000Z
|
src/Lexer/run.py
|
PetukhovVictor/compiler2
|
0bf87393ce9ecdd421393165fc14cb7f03f5e3b8
|
[
"MIT"
] | 1
|
2018-11-19T15:34:00.000Z
|
2018-11-19T15:35:52.000Z
|
src/Lexer/run.py
|
PetukhovVictor/compiler2
|
0bf87393ce9ecdd421393165fc14cb7f03f5e3b8
|
[
"MIT"
] | 4
|
2017-03-13T06:16:48.000Z
|
2019-04-24T11:49:00.000Z
|
from .rules import token_expressions
from .lex import lex
def run(code):
""" Wrapper to run the Lexer (with the token expressions listed here). """
return lex(code, token_expressions)
| 24.25
| 78
| 0.726804
| 28
| 194
| 4.964286
| 0.607143
| 0.345324
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.185567
| 194
| 7
| 79
| 27.714286
| 0.879747
| 0.340206
| 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 | 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
| 1
| 0
|
0
| 6
|
5acf6a6ed2a18dd015b90e514e7a54da35d4ea24
| 34,367
|
py
|
Python
|
agoora-profiler-service/quality_inspection/tests/quality_inspector_test.py
|
spoud/agoora-agents
|
918602d428b6cd9918d1ade682fa54e85a9a2df3
|
[
"MIT"
] | 8
|
2021-03-25T13:49:31.000Z
|
2021-08-19T04:09:14.000Z
|
agoora-profiler-service/quality_inspection/tests/quality_inspector_test.py
|
spoud/agoora-agents
|
918602d428b6cd9918d1ade682fa54e85a9a2df3
|
[
"MIT"
] | 18
|
2021-03-31T11:38:45.000Z
|
2022-02-16T05:00:09.000Z
|
agoora-profiler-service/quality_inspection/tests/quality_inspector_test.py
|
spoud/agoora-agents
|
918602d428b6cd9918d1ade682fa54e85a9a2df3
|
[
"MIT"
] | null | null | null |
import unittest
from quality_inspection.quality_inspector import QualityInspector
from quality_inspection.schema_definition import SchemaDefinition
from quality_inspection.tests.data_loader import DataLoader
class QualityInspectorTest(unittest.TestCase):
def setUp(self) -> None:
self.inspector = QualityInspector()
def test_inspect_inferred(self) -> None:
# arrange
samples = DataLoader.load_samples()
# act
schema_definition = SchemaDefinition.create(DataLoader.load_schema())
result = self.inspector.inspect(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
self.assertEqual(.0, result.attribute_specification)
self.assertEqual(.5, result.attribute_quality_index)
def test_inspect_avro(self) -> None:
# arrange
samples = DataLoader.load_samples()
# act
schema_definition = SchemaDefinition.create(DataLoader.load_schema(), False)
result = self.inspector.inspect(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
self.assertEqual(.625, result.attribute_specification)
self.assertEqual(.8125, result.attribute_quality_index)
def test_inspect_json(self) -> None:
# arrange
samples = DataLoader.load_samples()
# act
schema_definition = SchemaDefinition.create(DataLoader.load_schema_json(), False)
result = self.inspector.inspect(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
self.assertEqual(.625, result.attribute_specification)
self.assertEqual(.8125, result.attribute_quality_index)
def test_inspect_with_specified_field(self):
# arrange
samples = [
{"random_int": 1},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
["random_int"]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.5, result.attribute_specification)
self.assertEqual(1, result.attribute_integrity)
self.assertEqual(.75, result.attribute_quality_index)
def test_inspect_with_unspecified_field(self):
# arrange
samples = [
{"random_int": 1},
]
schema_definition = DataLoader.expand_schema(
[],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(0, result.attribute_specification)
self.assertEqual(1, result.attribute_integrity)
self.assertEqual(.5, result.attribute_quality_index)
def test_inspect_with_missing_field(self):
# arrange
samples = [
{"random_other": "other"},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
["random_int"]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
expected_specification = (0 + 1) / 2
expected_integrity = (1 + 0) / 2
self.assertEqual(expected_specification, result.attribute_specification,
"Attribute specification is not correct")
self.assertEqual(expected_integrity, result.attribute_integrity,
"Attribute integrity is not correct")
self.assertEqual((expected_specification + expected_integrity) / 2, result.attribute_quality_index,
"Attribute quality is not correct")
def test_specification_with_only_type_specification(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
["random_string", "random_int"],
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.5, result.attribute_specification)
def test_specification_with_complete_specification(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
["random_string", "random_int"],
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.5, result.attribute_specification)
def test_specification_with_inferred_schema(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema = '''
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"random_string": {
"type": "string"
},
"random_integer": {
"type": "integer"
}
},
"required": [
"random_integer",
"random_string"
]
}
'''
schema_definition = SchemaDefinition.create(schema, True)
# act
result = self.inspector.inspect(samples, schema_definition)
# assert
self.assertEqual(.0, result.attribute_specification,
"Attribute specification is considered 0% when schema is inferred")
def test_specification_with_empty_schema(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(0, result.attribute_specification)
def test_specification_with_partial_specification(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[("random_string", "string")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert (half of the data is specified to .5)
self.assertEqual(.25, result.attribute_specification,
"Specification must be 25% because only half of the data is specified in schema")
def test_specification_with_irrelevant_specification(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[("random_other", "string")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(0, result.attribute_specification,
"Specification must be 0% because none of the attributes are specified")
def test_quality_with_complete_specification(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"}, # random_string does not match
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[("random_string", "string"), ("random_int", "number")],
[],
{"random_string": {"pattern": "bar"}, "random_int": {"minimum": 0, "maximum": 100}}
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.75, result.attribute_integrity)
self.assertEqual(1.0, result.attribute_specification)
self.assertEqual(.875, result.attribute_quality_index)
def test_quality_with_partial_specification(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[("random_string", "string"), ("random_int", "int")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
self.assertEqual(.5, result.attribute_specification)
self.assertEqual(.75, result.attribute_quality_index)
def test_quality_without_specification(self):
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema_definition = DataLoader.expand_schema(
[],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.5, result.attribute_quality_index)
def test_specification_with_partial_schema_and_inferred(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "foo"},
{"random_int": 2, "random_string": "bar"}
]
schema = '''
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"random_string": {
"type": "string"
},
"random_integer": {
"type": "integer"
}
},
"required": [
"random_integer",
"random_string"
]
}
'''
schema_definition = SchemaDefinition.create(schema, True)
# act
result = self.inspector.inspect(samples, schema_definition)
# assert
self.assertEqual(.0, result.attribute_specification,
"Attribute specification is considered 0% when the schema is inferred")
def test_integrity_with_missing_required(self) -> None:
# arrange
samples = [
{"random_int": 1},
{"random_int": None},
{"random_int": 2}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
["random_int"]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertAlmostEqual(2 / 3, result.attribute_integrity, 3,
"Attribute integrity must be 66%")
def test_integrity_for_complex_type(self):
# arrange
schema = DataLoader.load_schema_with_name("schema_registry_avro.json")
samples = [
{"timestamp": 1595601702, "iss_position": {"longitude": "-42.2948", "latitude": "-40.3670"},
"message": "success"},
{"timestamp": 1595601702, "iss_position": {"latitude": "-40.3670"},
"message": "success"},
{"timestamp": "wrong", "iss_position": {"longitude": 666, "latitude": "-40.0283"},
"message": "success"},
]
# act
result = self.inspector.inspect_attributes(samples,
SchemaDefinition.create(schema, False))
# assert - only message is not mandatory so 3 out of 12 (3*4) are missing or wrong
invalid_elements = 3
all_elements = 12
expected_integrity = (all_elements - invalid_elements) / all_elements
self.assertAlmostEqual(expected_integrity,
result.attribute_integrity, 3,
f"Integrity must be {expected_integrity * 100}%")
def test_integrity_with_missing_not_required(self) -> None:
# arrange
samples = [
{"random_int": 1},
{"random_int": None},
{"random_int": 2}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
def test_integrity_without_specified_optional_field(self) -> None:
# arrange
samples = [
{"random_int": 1},
{"random_int": 2},
{"random_int": 3}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
["random_int"]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
def test_integrity_without_specified_required_field(self) -> None:
# arrange
samples = [
{"random_int": 1},
{"random_int": 2},
{"random_int": 3}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
["random_string"]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.5, result.attribute_integrity)
def test_integrity_with_additional_field(self) -> None:
# arrange
samples = [
{"random_int": 1, "random_string": "abc"},
{"random_int": 2, "random_string": "efg"},
{"random_int": 3, "random_string": "hij"}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
def test_integrity_with_numeric_as_string(self) -> None:
# arrange
samples = [
{"random_int": "10000001.023"},
{"random_int": "1"}
]
schema_definition = DataLoader.expand_schema(
[("random_int", "number")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.0, result.attribute_integrity)
def test_integrity_with_float_as_int(self) -> None:
# arrange
samples = [{"random_int": "10000001.023"}]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(0.0, result.attribute_integrity)
def test_integrity_on_attribute_level_with_not_specified_partial_field(self) -> None:
# arrange
samples = [
{"random_int": 1002, "random_string": 1},
{"random_int": 1003, "random_string": 2},
{"random_int": 1004},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_string' in attribute_details.keys(),
"Missing integrity for attribute random_string")
self.assertAlmostEqual(1, attribute_details['random_string'].attribute_integrity, 3,
"Integrity of random_string is not correct")
def test_integrity_on_attribute_level_with_missing_value(self) -> None:
# arrange
samples = [
{"random_int": 1002, "random_string": 1},
{"random_int": 1003, "random_string": 2},
{"random_int": "foo", "random_string": 3},
{"random_int": 1005, "random_string": "fourth"},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_int' in attribute_details.keys(),
"Missing integrity for attribute random_int")
self.assertTrue('random_string' in attribute_details.keys(),
"Missing integrity for attribute random_string")
self.assertAlmostEqual((3 / 4), attribute_details['random_int'].attribute_integrity, 3,
"Integrity of random_int is not correct")
self.assertAlmostEqual((1 / 4), attribute_details['random_string'].attribute_integrity, 3,
"Integrity of random_string is not correct")
def test_integrity_on_attribute_level_with_not_specified_fields(self) -> None:
# arrange
samples = [
{"random_int": 1002, "random_string": 1},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_string' in attribute_details.keys(),
"Even a not specified fields needs to be present in the details.")
self.assertEqual(1.0, attribute_details['random_string'].attribute_integrity)
def test_specification_on_attribute_level_with_complete_expectations(self) -> None:
# arrange
samples = [
{"random_int": 1002, "random_string": "1"},
{"random_int": 1003, "random_string": "2"},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
[],
{"random_int": {"minimum": 0, "maximum": 1004}, "random_string": {"pattern": ""}}
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_int' in attribute_details.keys())
self.assertTrue('random_string' in attribute_details.keys())
self.assertEqual(1.0, attribute_details['random_int'].attribute_specification)
self.assertEqual(1.0, attribute_details['random_string'].attribute_specification)
def test_specification_on_attribute_level_with_partial_expectations(self) -> None:
# arrange
samples = [
{"random_int": 1002, "random_string": 1},
{"random_int": 1003, "random_string": 2},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
[],
{"random_int": {"minimum": 0}}
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_int' in attribute_details.keys())
self.assertEqual(.75, attribute_details['random_int'].attribute_specification)
self.assertEqual(.5, attribute_details['random_string'].attribute_specification)
def test_specification_on_attribute_level_without_expectations(self) -> None:
# arrange
samples = [
{"random_int": 1002, "random_string": 1},
{"random_int": 1003, "random_string": 2},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer"), ("random_string", "string")],
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_int' in attribute_details.keys())
self.assertEqual(.5, attribute_details['random_int'].attribute_specification)
self.assertEqual(.5, attribute_details['random_string'].attribute_specification)
def test_specification_on_attribute_level_with_missing_specification(self) -> None:
# arrange
samples = [
{"random_int": 1002, "random_string": 1},
{"random_int": 1003, "random_string": 2},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_string' in attribute_details.keys())
self.assertEqual(0.0, attribute_details['random_string'].attribute_specification)
def test_quality_on_attribute_level(self) -> None:
# arrange
samples = [
{"random_int": 2, "random_string": "one"},
{"random_int": 55, "random_string": "two"},
{"random_int": 101, "random_string": "three"},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[],
{"random_int": {"minimum": 50, "maximum": 100}}
)
# act
result = self.inspector.inspect(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertTrue('random_int' in attribute_details.keys())
self.assertTrue('random_string' in attribute_details.keys())
self.assertAlmostEquals(((1 / 3) + 1) / 2, attribute_details['random_int'].attribute_quality_index, 3)
self.assertAlmostEquals((1 + 0) / 2, attribute_details['random_string'].attribute_quality_index, 3)
def test_inspect_with_non_unique_types_does_not_throw_exception(self) -> None:
# arrange
samples = [
{"random_int": 1002},
{"random_int": "1003"},
{"random_int": "1004"},
]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[],
{"random_int": {"minimum": 0, "maximum": 100}}
)
# act
result = self.inspector.inspect(samples, schema_definition)
# assert
attribute_details = result.attribute_details
self.assertAlmostEquals((1 / 3),
attribute_details['random_int'].attribute_integrity, 3)
def test_integrity_on_attribute_level_with_expectations(self):
# arrange
schema = '''
{
"type": "record",
"name": "RandomData",
"namespace": "data.producer.random",
"fields": [
{
"name": "random_integer",
"type": "int",
"expectations": [
{
"kwargs": {
"min_value": 0,
"max_value": 10
},
"expectation_type": "expect_column_values_to_be_between"
}
]
},
{
"name": "random_string",
"type": "string",
"expectations": [
{
"kwargs": {
"regex": "id_"
},
"meta": {},
"expectation_type": "expect_column_values_to_match_regex"
}
]
}
]
}
'''
samples = [
{'random_integer': 1, 'random_string': 'missing_id'},
{'random_integer': 11, 'random_string': 'id_1'},
{'random_integer': 3, 'random_string': 'missing_id'},
]
# act
result = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
attribute_details = result.attribute_details
self.assertAlmostEqual((3 / 6), result.attribute_integrity, 3,
"Attribute integrity is not correct")
self.assertTrue('random_integer' in attribute_details.keys(),
"Missing integrity for attribute random_integer")
self.assertTrue('random_string' in attribute_details.keys(),
"Missing integrity for attribute random_string")
self.assertAlmostEqual((2 / 3), attribute_details['random_integer'].attribute_integrity, 3,
"Integrity of random_int is not correct")
self.assertAlmostEqual((1 / 3), attribute_details['random_string'].attribute_integrity, 3,
"Integrity of random_string is not correct")
def test_integrity_with_negative_as_string(self) -> None:
# arrange
samples = [{"random_int": "-10000"}]
schema_definition = DataLoader.expand_schema(
[("random_int", "integer")],
[]
)
# act
result = self.inspector.inspect_attributes(samples, schema_definition)
# assert
self.assertEqual(.0, result.attribute_integrity,
"Attribute integrity must be 0% (even if not required, a "
"specified value needs to be correct).")
def test_integrity_with_wrong_type(self) -> None:
# arrange
samples, schema = DataLoader.create_dummy_samples()
# noinspection PyTypeChecker
samples[0]['random_string'] = 123
# act
result = self.inspector.inspect_attributes(samples, schema)
# assert
self.assertEqual(0.5, result.attribute_integrity)
def test_integrity_without_provided_schema(self) -> None:
# arrange
samples, _ = DataLoader.create_dummy_samples()
# act
empty_schema = SchemaDefinition.empty()
result = self.inspector.inspect(samples, empty_schema)
# assert
self.assertEqual(1.0, result.attribute_integrity)
self.assertEqual(.0, result.attribute_specification)
self.assertEqual(.5, result.attribute_quality_index)
def test_inspect_with_inferred_schemas(self):
# arrange
schema = DataLoader.load_schema_with_name("schema_registry_json.json")
schema_definition = SchemaDefinition.create(schema, True)
samples = DataLoader.load_samples()
# act
result = self.inspector.inspect(samples, schema_definition)
# assert
self.assertEqual(1.0, result.attribute_integrity)
self.assertEqual(.0, result.attribute_specification)
self.assertEqual(.5, result.attribute_quality_index)
def test_various_types_do_not_throw_exceptions(self):
# arrange
schema = '''
{
"type": "record",
"name": "RandomData",
"namespace": "data.producer.random",
"fields": [
{
"name": "random_string",
"type": "string"
},
{
"name": "random_integer",
"type": "int"
},
{
"name": "random_float",
"type": "float"
},
{
"name": "random_boolean",
"type": "boolean"
}
]
}
'''
samples = [
{'random_string': 'wheyuugkwi', 'random_integer': 876, 'random_float': 0.2295482, 'random_boolean': False}
]
# act
metrics = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
self.assertIsNotNone(metrics)
def test_inspect_with_min_max_range_expectation(self):
# arrange
schema = DataLoader.load_schema_with_name("schema_with_min_max.json")
samples = [
{'random_integer': 3}, {'random_integer': 11}, {'random_integer': 3}, {'random_integer': 8},
{'random_integer': 3}, {'random_integer': -5}, {'random_integer': 3}, {'random_integer': 10},
]
# act
metrics = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
self.assertEqual((6 / 8), metrics.attribute_integrity,
f"Attribute integrity must be {(6 / 8) * 100}%")
def test_inspect_with_min_expectation(self):
# arrange
schema = DataLoader.load_schema_with_name("schema_with_min.json")
samples = [
{'random_integer': 3}, {'random_integer': 11}, {'random_integer': 3}, {'random_integer': 8},
{'random_integer': 3}, {'random_integer': -5}, {'random_integer': 3}, {'random_integer': 10},
]
# act
metrics = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
self.assertEqual((7 / 8), metrics.attribute_integrity,
f"Attribute integrity must be {(7 / 8) * 100}%")
def test_inspect_with_multiple_expectations_asyncapi_style(self):
# arrange
schema = DataLoader.load_schema_with_name("schema_expectation_asyncapi_style.json")
samples = [
{'random_integer': 1, 'random_string': 'id_1'},
{'random_integer': 2, 'random_string': 'foo'}, # no match (string)
{'random_integer': 3, 'random_string': 'id_3'},
{'random_integer': 4, 'random_string': 'id_4'}, # no match (integer)
{'random_integer': 5, 'random_string': 'foo'}, # no match (integer, string)
]
# act
metrics = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
self.assertAlmostEqual(6 / 10, metrics.attribute_integrity, 3)
def test_inspect_with_multiple_expectations_asyncapi_style_json(self):
# arrange
schema = DataLoader.load_schema_with_name("schema_expectation_asyncapi_style_json.json")
samples = [
{'random_integer': 1, 'random_string': 'id_1'},
{'random_integer': 2, 'random_string': 'foo'}, # no match (string)
{'random_integer': 3, 'random_string': 'id_3'},
{'random_integer': 4, 'random_string': 'id_4'}, # no match (integer)
{'random_integer': 5, 'random_string': 'foo'}, # no match (integer, string)
]
# act
metrics = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
self.assertAlmostEqual(6 / 10, metrics.attribute_integrity, 3)
def test_inspect_with_both_schema_formats(self):
# arrange
schema_json = DataLoader.load_schema_with_name("schema_diff_json.json")
schema_avro = DataLoader.load_schema_with_name("schema_diff_avro.json")
samples = DataLoader.load_samples()
# act
result_json = self.inspector.inspect(samples, SchemaDefinition.create(schema_json, False))
result_avro = self.inspector.inspect(samples, SchemaDefinition.create(schema_avro, False))
# assert
self.assertEqual(result_json, result_avro)
def test_specification_from_toeggelomat_json(self):
# arrange
samples = DataLoader.load_samples_from_file("samples_toeggelomat.json")
# act
schema = DataLoader.load_schema_with_name("schema_toeggelomat_json.json")
result = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
self.assertEqual(53, len(result.attribute_details.keys()),
"There should be 53 keys in the dictionary")
for attribute_metric in result.attribute_details.keys():
self.assertEqual(1.0, result.attribute_details[attribute_metric].attribute_specification,
f"Attribute specification must be 100% ({attribute_metric})")
self.assertEqual(1.0, result.attribute_details[attribute_metric].attribute_integrity,
f"Attribute integrity must be 100% ({attribute_metric})")
def test_specification_from_toeggelomat(self):
# arrange
samples = DataLoader.load_samples_from_file("samples_toeggelomat.json")
# act
schema = DataLoader.load_schema_with_name("schema_toeggelomat.json")
result = self.inspector.inspect(samples, SchemaDefinition.create(schema, False))
# assert
self.assertEqual(53, len(result.attribute_details.keys()),
"There should be 53 keys in the dictionary")
for attribute_metric in result.attribute_details.keys():
self.assertEqual(1.0, result.attribute_details[attribute_metric].attribute_specification,
f"Attribute specification must be 100% ({attribute_metric})")
self.assertEqual(1.0, result.attribute_details[attribute_metric].attribute_integrity,
f"Attribute integrity must be 100% ({attribute_metric})")
| 35.724532
| 118
| 0.575407
| 3,185
| 34,367
| 5.929042
| 0.070016
| 0.052902
| 0.049778
| 0.055073
| 0.869572
| 0.830544
| 0.785798
| 0.753548
| 0.731148
| 0.702764
| 0
| 0.020126
| 0.314691
| 34,367
| 961
| 119
| 35.761707
| 0.781675
| 0.034015
| 0
| 0.553292
| 0
| 0
| 0.249864
| 0.012557
| 0
| 0
| 0
| 0
| 0.141066
| 1
| 0.073668
| false
| 0
| 0.00627
| 0
| 0.081505
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
5ae07991afc23cb7d9a2fd6ee5c2c60cb7e50a1b
| 2,560
|
py
|
Python
|
unit_tests/test_extract_initial_rules.py
|
fensta/bracid2019
|
ad9bf0b4e44c19f66c1597e857ef6cf70f56a646
|
[
"MIT"
] | null | null | null |
unit_tests/test_extract_initial_rules.py
|
fensta/bracid2019
|
ad9bf0b4e44c19f66c1597e857ef6cf70f56a646
|
[
"MIT"
] | null | null | null |
unit_tests/test_extract_initial_rules.py
|
fensta/bracid2019
|
ad9bf0b4e44c19f66c1597e857ef6cf70f56a646
|
[
"MIT"
] | null | null | null |
from unittest import TestCase
import pandas as pd
from scripts.utils import extract_initial_rules
class TestExtractInitialRules(TestCase):
"""Tests test_extract_initial_rules() from utils"""
def test_extract_initial_rules_numeric(self):
"""Test that rules are extracted correctly with a single numeric features"""
df = pd.DataFrame({"A": [1.0, 2, 3], "Class": ["A", "B", "C"]})
class_col_name = "Class"
rules = extract_initial_rules(df, class_col_name)
correct = pd.DataFrame({"A": [(1.0, 1.0), (2, 2), (3, 3)], "Class": ["A", "B", "C"]})
self.assertTrue(df.shape == (3, 2) and rules.shape == (3, 2))
self.assertTrue(rules.equals(correct))
def test_extract_initial_rules_nominal(self):
"""Test that rules are extracted correctly with a single nominal features"""
df = pd.DataFrame({"A": ["a", "b", "c"], "Class": ["A", "B", "C"]})
class_col_name = "Class"
rules = extract_initial_rules(df, class_col_name)
correct = pd.DataFrame({"A": ["a", "b", "c"], "Class": ["A", "B", "C"]})
self.assertTrue(df.shape == (3, 2) and rules.shape == (3, 2))
self.assertTrue(rules.equals(correct))
def test_extract_initial_rules_single_feature_mixed(self):
"""
Test that rules are extracted correctly with a single numeric and nominal feature
"""
df = pd.DataFrame({"A": [1.0, 2, 3], "B": ["a", "b", "c"], "Class": ["A", "B", "C"]})
class_col_name = "Class"
rules = extract_initial_rules(df, class_col_name)
correct = pd.DataFrame({"A": [(1.0, 1.0), (2, 2), (3, 3)], "B": ["a", "b", "c"], "Class": ["A", "B", "C"]})
self.assertTrue(df.shape == (3, 3) and rules.shape == (3, 3))
self.assertTrue(rules.equals(correct))
def test_extract_initial_rules_multiple_features_mixed(self):
"""
Test that rules are extracted correctly with different numeric and nominal features
"""
df = pd.DataFrame({"A": [1.0, 2, 3], "B": ["a", "b", "c"], "C": [5, -1, 3], "D": ["t", "t", "e"],
"Class": ["A", "B", "C"]})
class_col_name = "Class"
rules = extract_initial_rules(df, class_col_name)
correct = pd.DataFrame({"A": [(1.0, 1.0), (2, 2), (3, 3)], "B": ["a", "b", "c"],
"C": [(5, 5), (-1, -1), (3, 3)], "D": ["t", "t", "e"], "Class": ["A", "B", "C"]})
self.assertTrue(df.shape == (3, 5) and rules.shape == (3, 5))
self.assertTrue(rules.equals(correct))
| 49.230769
| 115
| 0.551563
| 357
| 2,560
| 3.817927
| 0.142857
| 0.020543
| 0.030814
| 0.046955
| 0.80044
| 0.757887
| 0.740279
| 0.737344
| 0.737344
| 0.644901
| 0
| 0.031314
| 0.239063
| 2,560
| 51
| 116
| 50.196078
| 0.668378
| 0.137891
| 0
| 0.411765
| 0
| 0
| 0.057809
| 0
| 0
| 0
| 0
| 0
| 0.235294
| 1
| 0.117647
| false
| 0
| 0.088235
| 0
| 0.235294
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
5aea87607e71c1fa54637d37748174be3086f680
| 174
|
py
|
Python
|
core.py
|
guillaumevincent/keepass-less
|
03e041b2b49595b421a7b6ca8a0a4e7ae51d7fdc
|
[
"MIT"
] | 1
|
2015-12-01T21:47:34.000Z
|
2015-12-01T21:47:34.000Z
|
core.py
|
guillaumevincent/keepass-less
|
03e041b2b49595b421a7b6ca8a0a4e7ae51d7fdc
|
[
"MIT"
] | null | null | null |
core.py
|
guillaumevincent/keepass-less
|
03e041b2b49595b421a7b6ca8a0a4e7ae51d7fdc
|
[
"MIT"
] | null | null | null |
def split_entry(entry):
entries = entry.split(':')
if len(entries) == 3:
return entries[0], entries[1], int(entries[2])
return entries[0], entries[1], 10
| 29
| 54
| 0.609195
| 25
| 174
| 4.2
| 0.52
| 0.247619
| 0.266667
| 0.4
| 0.419048
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058394
| 0.212644
| 174
| 5
| 55
| 34.8
| 0.708029
| 0
| 0
| 0
| 0
| 0
| 0.005747
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 6
|
5af6d73e24f9be5da73ff272a9a33f09624bf320
| 125
|
py
|
Python
|
daraja_api/clients/b2c_api_client.py
|
jakhax/python_daraja_api
|
7584679d0c5eaa2beafbfa221254e6370f40f12d
|
[
"MIT"
] | 4
|
2019-10-30T09:19:58.000Z
|
2020-04-18T12:32:09.000Z
|
daraja_api/clients/b2c_api_client.py
|
jakhax/python_daraja_api
|
7584679d0c5eaa2beafbfa221254e6370f40f12d
|
[
"MIT"
] | 2
|
2019-10-31T20:39:57.000Z
|
2019-10-31T20:41:32.000Z
|
daraja_api/clients/b2c_api_client.py
|
jakhax/python_daraja_api
|
7584679d0c5eaa2beafbfa221254e6370f40f12d
|
[
"MIT"
] | 3
|
2020-04-17T23:03:25.000Z
|
2021-05-14T08:26:07.000Z
|
from daraja_api.clients.abstract_api_client import AbstractApiClient
class AbstractB2CApiClient(AbstractApiClient):
pass
| 31.25
| 68
| 0.872
| 13
| 125
| 8.153846
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008772
| 0.088
| 125
| 4
| 69
| 31.25
| 0.921053
| 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
| 1
| 0
|
0
| 6
|
51e93219bcf0932e974ca77a974c31a6703b7426
| 159
|
py
|
Python
|
api/app/api/mutations/types/TokenData.py
|
VidroX/recommdo
|
fe518158b1a63225816054fb129f680e1d0c7d9c
|
[
"MIT"
] | null | null | null |
api/app/api/mutations/types/TokenData.py
|
VidroX/recommdo
|
fe518158b1a63225816054fb129f680e1d0c7d9c
|
[
"MIT"
] | null | null | null |
api/app/api/mutations/types/TokenData.py
|
VidroX/recommdo
|
fe518158b1a63225816054fb129f680e1d0c7d9c
|
[
"MIT"
] | null | null | null |
import graphene
class TokenData(graphene.ObjectType):
access_token = graphene.String(required=False)
refresh_token = graphene.String(required=False)
| 22.714286
| 51
| 0.786164
| 18
| 159
| 6.833333
| 0.611111
| 0.211382
| 0.308943
| 0.439024
| 0.520325
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125786
| 159
| 6
| 52
| 26.5
| 0.884892
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 6
|
cf9d43beea070a2999be037ff5c098b3a4dc9ef5
| 1,173
|
py
|
Python
|
18-04-18-REST APIs with Flask and Python/Section 6 - Simplifying storage with Flask-SQLAlchemy/1_Improving code structure/models/user.py
|
maraboinavamshi/courses
|
48f255ffb1903ba20865c2b91b488758d5cb1a09
|
[
"Apache-2.0"
] | 15
|
2017-09-19T08:09:01.000Z
|
2019-04-29T00:37:51.000Z
|
18-04-18-REST APIs with Flask and Python/Section 6 - Simplifying storage with Flask-SQLAlchemy/1_Improving code structure/models/user.py
|
chitrita/Courses-1
|
7713267ee5c92e488086588ac41490c44b4f7350
|
[
"Apache-2.0"
] | null | null | null |
18-04-18-REST APIs with Flask and Python/Section 6 - Simplifying storage with Flask-SQLAlchemy/1_Improving code structure/models/user.py
|
chitrita/Courses-1
|
7713267ee5c92e488086588ac41490c44b4f7350
|
[
"Apache-2.0"
] | 17
|
2018-02-27T03:15:54.000Z
|
2019-04-24T09:26:46.000Z
|
import sqlite3
class UserModel:
def __init__(self, _id, username, password):
self.id = _id
self.username = username
self.password = password
@classmethod
def find_by_username(cls, username):
connection = sqlite3.connect('data.db')
cursor = connection.cursor()
query = "SELECT * FROM users WHERE username = ?"
# Parameters MUST ALWAYS be in form of a TUPLE!
result = cursor.execute(query, (username, ))
# If the result set does not contain any values row = None
row = result.fetchone()
if row is not None:
# *row is like *args, cls in this example is class User
user = cls(*row)
else:
user = None
connection.close()
return user
@classmethod
def find_by_id(cls, id):
connection = sqlite3.connect('data.db')
cursor = connection.cursor()
query = "SELECT * FROM users WHERE id = ?"
# Parameters MUST ALWAYS be in form of a TUPLE!
result = cursor.execute(query, (id, ))
# If the result set does not contain any values row = None
row = result.fetchone()
if row is not None:
# *row is like *args, cls in this example is class User
user = cls(*row)
else:
user = None
connection.close()
return user
| 23.938776
| 60
| 0.680307
| 169
| 1,173
| 4.662722
| 0.325444
| 0.035533
| 0.045685
| 0.050761
| 0.758883
| 0.758883
| 0.758883
| 0.758883
| 0.758883
| 0.758883
| 0
| 0.003279
| 0.219949
| 1,173
| 49
| 61
| 23.938776
| 0.857924
| 0.266837
| 0
| 0.625
| 0
| 0
| 0.098361
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.09375
| false
| 0.0625
| 0.03125
| 0
| 0.21875
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 6
|
cfdb1d30cc9bd9520aaaaae8ec7fdec44f23d872
| 38
|
py
|
Python
|
HashableDict/__init__.py
|
IFcoltransG/HashableDict
|
d638176db7439e835e777241073433f496cabfcb
|
[
"Unlicense"
] | null | null | null |
HashableDict/__init__.py
|
IFcoltransG/HashableDict
|
d638176db7439e835e777241073433f496cabfcb
|
[
"Unlicense"
] | null | null | null |
HashableDict/__init__.py
|
IFcoltransG/HashableDict
|
d638176db7439e835e777241073433f496cabfcb
|
[
"Unlicense"
] | null | null | null |
from HashableDict import HashableDict
| 19
| 37
| 0.894737
| 4
| 38
| 8.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 38
| 1
| 38
| 38
| 1
| 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
| 1
| 0
|
0
| 6
|
cfdb6aea4b5d0ec5643271d0d007024ceb0871a2
| 7,187
|
py
|
Python
|
tests/emulator/test_line_handler.py
|
pp81381/nicett6
|
addace8fbd5350105bf4fb27d1b485bb9cf20236
|
[
"MIT"
] | null | null | null |
tests/emulator/test_line_handler.py
|
pp81381/nicett6
|
addace8fbd5350105bf4fb27d1b485bb9cf20236
|
[
"MIT"
] | 1
|
2021-06-06T20:43:09.000Z
|
2021-06-06T20:43:09.000Z
|
tests/emulator/test_line_handler.py
|
pp81381/nicett6
|
addace8fbd5350105bf4fb27d1b485bb9cf20236
|
[
"MIT"
] | null | null | null |
import asyncio
from nicett6.emulator.cover_emulator import TT6CoverEmulator
from nicett6.emulator.line_handler import (
LineHandler,
CMD_STOP,
CMD_MOVE_DOWN,
CMD_MOVE_UP,
)
from nicett6.ttbus_device import TTBusDeviceAddress
from unittest import IsolatedAsyncioTestCase
from unittest.mock import AsyncMock, MagicMock, PropertyMock
RCV_EOL = b"\r"
class TestHandleWebOnCommands(IsolatedAsyncioTestCase):
"""Test the behaviour of handle_line for web_on commands with mock controller"""
async def test_handle_web_on(self):
line_bytes = b"WEB_ON" + RCV_EOL
controller = AsyncMock()
controller.web_on = False
wrapped_writer = AsyncMock()
line_handler = LineHandler(wrapped_writer, controller)
await line_handler.handle_line(line_bytes)
self.assertTrue(controller.web_on)
wrapped_writer.write_msg.assert_awaited_once_with(
LineHandler.MSG_WEB_COMMANDS_ON
)
async def test_handle_web_on_err(self):
line_bytes = b"WEB_ON BAD" + RCV_EOL
controller = AsyncMock()
controller.web_on = False
wrapped_writer = AsyncMock()
line_handler = LineHandler(wrapped_writer, controller)
await line_handler.handle_line(line_bytes)
self.assertFalse(controller.web_on)
wrapped_writer.write_msg.assert_awaited_once_with(
LineHandler.MSG_INVALID_COMMAND_ERROR
)
async def test_handle_web_off(self):
line_bytes = b"WEB_OFF" + RCV_EOL
controller = AsyncMock()
controller.web_on = True
wrapped_writer = AsyncMock()
line_handler = LineHandler(wrapped_writer, controller)
await line_handler.handle_line(line_bytes)
self.assertFalse(controller.web_on)
wrapped_writer.write_msg.assert_awaited_once_with(
LineHandler.MSG_WEB_COMMANDS_OFF
)
async def test_handle_web_off_whitespace(self):
line_bytes = b"\n WEB_OFF " + RCV_EOL
controller = AsyncMock()
controller.web_on = True
wrapped_writer = AsyncMock()
line_handler = LineHandler(wrapped_writer, controller)
await line_handler.handle_line(line_bytes)
self.assertFalse(controller.web_on)
wrapped_writer.write_msg.assert_awaited_once_with(
LineHandler.MSG_WEB_COMMANDS_OFF
)
async def test_handle_web_cmd_while_web_off(self):
line_bytes = b"POS < 02 04 FFFF FFFF FF" + RCV_EOL
controller = AsyncMock()
controller.web_on = False
wrapped_writer = AsyncMock()
line_handler = LineHandler(wrapped_writer, controller)
await line_handler.handle_line(line_bytes)
wrapped_writer.write_msg.assert_awaited_once_with(
LineHandler.MSG_INVALID_COMMAND_ERROR
)
async def test_handle_quit(self):
line_bytes = b"QUIT" + RCV_EOL
controller = AsyncMock()
controller.stop_server = MagicMock()
wrapped_writer = AsyncMock()
line_handler = LineHandler(wrapped_writer, controller)
await line_handler.handle_line(line_bytes)
controller.stop_server.assert_called_once_with()
wrapped_writer.write_msg.assert_not_awaited()
class TestHandleMovementCommands(IsolatedAsyncioTestCase):
"""Test the behaviour of handle_line for movement commands using mock cover"""
async def asyncSetUp(self):
self.cover = AsyncMock(spec=TT6CoverEmulator)
self.cover.tt_addr = TTBusDeviceAddress(0x02, 0x04)
self.cover.name = "test_cover"
self.controller = AsyncMock()
self.controller.web_on = False
self.controller.lookup_device = MagicMock(return_value=self.cover)
self.wrapped_writer = AsyncMock()
self.line_handler = LineHandler(self.wrapped_writer, self.controller)
async def test_handle_move_up(self):
line_bytes = b"CMD 02 04 05" + RCV_EOL
await self.line_handler.handle_line(line_bytes)
self.cover.move_up.assert_awaited_once_with()
self.wrapped_writer.write_msg.assert_awaited_once_with("RSP 2 4 5")
async def test_handle_read_hex_pos(self):
line_bytes = b"CMD 02 04 45" + RCV_EOL
percent_pos = PropertyMock(return_value=0xAB / 0xFF)
type(self.cover).percent_pos = percent_pos
await self.line_handler.handle_line(line_bytes)
percent_pos.assert_called_once_with()
self.wrapped_writer.write_msg.assert_awaited_once_with("RSP 2 4 45 AB")
async def test_handle_move_hex_pos(self):
line_bytes = b"CMD 02 04 40 AB" + RCV_EOL
await self.line_handler.handle_line(line_bytes)
self.cover.move_to_percent_pos.assert_awaited_once_with(0xAB / 0xFF)
self.wrapped_writer.write_msg.assert_awaited_once_with("RSP 2 4 40 AB")
async def test_handle_read_pct_pos(self):
line_bytes = b"POS < 02 04 FFFF FFFF FF" + RCV_EOL
self.controller.web_on = True
percent_pos = PropertyMock(return_value=0.5)
type(self.cover).percent_pos = percent_pos
await self.line_handler.handle_line(line_bytes)
percent_pos.assert_called_once_with()
self.wrapped_writer.write_msg.assert_awaited_once_with(
"POS * 02 04 0500 FFFF FF"
)
async def test_handle_move_pct_pos(self):
line_bytes = b"POS > 02 04 0500 FFFF FF" + RCV_EOL
self.controller.web_on = True
await self.line_handler.handle_line(line_bytes)
self.cover.move_to_percent_pos.assert_awaited_once_with(0.5)
class TestMovementCommands(IsolatedAsyncioTestCase):
"""Test the behaviour of handle_line for movement commands using a cover emulator"""
async def asyncSetUp(self):
self.cover = TT6CoverEmulator(
"test_cover", TTBusDeviceAddress(0x02, 0x04), 0.01, 1.77, 0.08, 1.0
)
self.controller = AsyncMock()
self.controller.web_on = False
self.controller.lookup_device = MagicMock(return_value=self.cover)
self.wrapped_writer = AsyncMock()
self.line_handler = LineHandler(self.wrapped_writer, self.controller)
async def test_stop(self):
mover = asyncio.create_task(
self.line_handler.handle_line(
f"CMD 02 04 {CMD_MOVE_DOWN:02X}".encode("utf-8") + RCV_EOL
)
)
delay = 3
await asyncio.sleep(delay)
await self.line_handler.handle_line(
f"CMD 02 04 {CMD_STOP:02X}".encode("utf-8") + RCV_EOL
)
await mover
self.assertGreater(self.cover.drop, 0.19)
self.assertLess(self.cover.drop, 0.24)
async def test_move_while_moving(self):
mover = asyncio.create_task(
self.line_handler.handle_line(
f"CMD 02 04 {CMD_MOVE_DOWN:02X}".encode("utf-8") + RCV_EOL
)
)
delay = 3
await asyncio.sleep(delay)
self.assertGreater(self.cover.drop, 0.19)
self.assertLess(self.cover.drop, 0.24)
await self.line_handler.handle_line(
f"CMD 02 04 {CMD_MOVE_UP:02X}".encode("utf-8") + RCV_EOL
)
await mover
self.assertEqual(self.cover.drop, 0)
| 39.489011
| 88
| 0.685265
| 927
| 7,187
| 5.007551
| 0.140237
| 0.072813
| 0.054933
| 0.067859
| 0.821198
| 0.769496
| 0.727273
| 0.722749
| 0.711116
| 0.666523
| 0
| 0.024182
| 0.234729
| 7,187
| 182
| 89
| 39.489011
| 0.819818
| 0.031446
| 0
| 0.535032
| 0
| 0
| 0.051828
| 0
| 0
| 0
| 0.004607
| 0
| 0.159236
| 1
| 0
| false
| 0
| 0.038217
| 0
| 0.057325
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
5c7679f7f5b438170113cc7075f9558e13ac35ef
| 33
|
py
|
Python
|
reporting/__init__.py
|
4ESoftware/TempRent
|
822268c787bdd2be6e6c446db8417da24dbb2ec5
|
[
"MIT"
] | null | null | null |
reporting/__init__.py
|
4ESoftware/TempRent
|
822268c787bdd2be6e6c446db8417da24dbb2ec5
|
[
"MIT"
] | null | null | null |
reporting/__init__.py
|
4ESoftware/TempRent
|
822268c787bdd2be6e6c446db8417da24dbb2ec5
|
[
"MIT"
] | null | null | null |
from .rep_utils import RepEngine
| 16.5
| 32
| 0.848485
| 5
| 33
| 5.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 33
| 1
| 33
| 33
| 0.931034
| 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
| 1
| 0
|
0
| 6
|
5c9febd4c5cf40ff34bafdd56f8c84d210e5451c
| 56
|
py
|
Python
|
easy_differ/__init__.py
|
FurkanOzkaya/easy_differ
|
9c81a53447536df006045ea35f264225367c4b61
|
[
"MIT"
] | 1
|
2020-09-26T21:46:48.000Z
|
2020-09-26T21:46:48.000Z
|
easy_differ/__init__.py
|
FurkanOzkaya/easy_differ
|
9c81a53447536df006045ea35f264225367c4b61
|
[
"MIT"
] | null | null | null |
easy_differ/__init__.py
|
FurkanOzkaya/easy_differ
|
9c81a53447536df006045ea35f264225367c4b61
|
[
"MIT"
] | null | null | null |
from easy_differ.easy_differ import list_diff, text_diff
| 56
| 56
| 0.892857
| 10
| 56
| 4.6
| 0.7
| 0.434783
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 56
| 1
| 56
| 56
| 0.884615
| 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
| 1
| 0
|
0
| 6
|
5ce52894ee777c761bbe80312dc0afb967f4d975
| 141
|
py
|
Python
|
homie/models/__init__.py
|
timpur/homie-discovery-python
|
f157e3843cae7b1ad3e4fd810b340c35c34473eb
|
[
"MIT"
] | null | null | null |
homie/models/__init__.py
|
timpur/homie-discovery-python
|
f157e3843cae7b1ad3e4fd810b340c35c34473eb
|
[
"MIT"
] | null | null | null |
homie/models/__init__.py
|
timpur/homie-discovery-python
|
f157e3843cae7b1ad3e4fd810b340c35c34473eb
|
[
"MIT"
] | null | null | null |
"""Homie Models module"""
from .homie_device import HomieDevice
from .homie_node import HomieNode
from .homie_property import HomieProperty
| 23.5
| 41
| 0.822695
| 18
| 141
| 6.277778
| 0.611111
| 0.238938
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113475
| 141
| 5
| 42
| 28.2
| 0.904
| 0.134752
| 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
| 1
| 0
|
0
| 6
|
7a3acfc511ddee7da218b4ddb4970a9394b9e44a
| 5,946
|
py
|
Python
|
venv/lib/python3.7/site-packages/rqdatac/services/orm/financial_indicator_sql.py
|
CatTiger/vnpy
|
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
|
[
"MIT"
] | null | null | null |
venv/lib/python3.7/site-packages/rqdatac/services/orm/financial_indicator_sql.py
|
CatTiger/vnpy
|
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
|
[
"MIT"
] | 1
|
2020-04-21T02:42:32.000Z
|
2020-04-21T02:42:32.000Z
|
venv/lib/python3.7/site-packages/rqdatac/services/orm/financial_indicator_sql.py
|
CatTiger/vnpy
|
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
|
[
"MIT"
] | null | null | null |
# coding: utf-8
from sqlalchemy import Numeric, Column
from .fundamental_base_sql import FundamentalBase
class AnaStkFinIdx(FundamentalBase):
earnings_per_share = Column(Numeric(18, 4))
fully_diluted_earnings_per_share = Column(Numeric(18, 4))
diluted_earnings_per_share = Column(Numeric(18, 4))
adjusted_earnings_per_share = Column(Numeric(18, 4))
adjusted_fully_diluted_earnings_per_share = Column(Numeric(18, 4))
adjusted_diluted_earnings_per_share = Column(Numeric(18, 4))
book_value_per_share = Column(Numeric(18, 4))
operating_cash_flow_per_share = Column(Numeric(18, 4))
operating_total_revenue_per_share = Column(Numeric(18, 4))
operating_revenue_per_share = Column(Numeric(18, 4))
capital_reserve_per_share = Column(Numeric(18, 4))
earned_reserve_per_share = Column(Numeric(18, 4))
undistributed_profit_per_share = Column(Numeric(18, 4))
retained_earnings_per_share = Column(Numeric(18, 4))
cash_flow_from_operations_per_share = Column(Numeric(18, 4))
ebit_per_share = Column(Numeric(18, 4))
free_cash_flow_company_per_share = Column(Numeric(18, 4))
free_cash_flow_equity_per_share = Column(Numeric(18, 4))
dividend_per_share = Column(Numeric(18, 4))
return_on_equity = Column(Numeric(18, 4))
return_on_equity_weighted_average = Column(Numeric(18, 4))
return_on_equity_diluted = Column(Numeric(18, 4))
adjusted_return_on_equity_average = Column(Numeric(18, 4))
adjusted_return_on_equity_weighted_average = Column(Numeric(18, 4))
adjusted_return_on_equity_diluted = Column(Numeric(18, 4))
return_on_asset = Column(Numeric(18, 4))
return_on_asset_net_profit = Column(Numeric(18, 4))
return_on_invested_capital = Column(Numeric(18, 4))
annual_return_on_equity = Column(Numeric(18, 4))
annual_return_on_asset = Column(Numeric(18, 4))
annual_return_on_asset_net_profit = Column(Numeric(18, 4))
net_profit_margin = Column(Numeric(18, 4))
gross_profit_margin = Column(Numeric(18, 4))
cost_to_sales = Column(Numeric(18, 4))
net_profit_to_revenue = Column(Numeric(18, 4))
profit_from_operation_to_revenue = Column(Numeric(18, 4))
ebit_to_revenue = Column(Numeric(18, 4))
expense_to_revenue = Column(Numeric(18, 4))
operating_profit_to_profit_before_tax = Column(Numeric(18, 4))
invesment_profit_to_profit_before_tax = Column(Numeric(18, 4))
non_operating_profit_to_profit_before_tax = Column(Numeric(18, 4))
income_tax_to_profit_before_tax = Column(Numeric(18, 4))
adjusted_profit_to_total_profit = Column(Numeric(18, 4))
debt_to_asset_ratio = Column(Numeric(18, 4))
equity_multiplier = Column(Numeric(18, 4))
current_asset_to_total_asset = Column(Numeric(18, 4))
non_current_asset_to_total_asset = Column(Numeric(18, 4))
interest_bearing_debt_to_capital = Column(Numeric(18, 4))
current_debt_to_total_debt = Column(Numeric(18, 4))
non_current_debt_to_total_debt = Column(Numeric(18, 4))
current_ratio = Column(Numeric(18, 4))
quick_ratio = Column(Numeric(18, 4))
super_quick_ratio = Column(Numeric(18, 4))
debt_to_equity_ratio = Column(Numeric(18, 4))
equity_to_debt_ratio = Column(Numeric(18, 4))
equity_to_interest_bearing_debt = Column(Numeric(18, 4))
ebit_to_debt = Column(Numeric(18, 4))
ocf_to_debt = Column(Numeric(18, 4))
ocf_to_interest_bearing_debt = Column(Numeric(18, 4))
ocf_to_current_ratio = Column(Numeric(18, 4))
ocf_to_net_debt = Column(Numeric(18, 4))
time_interest_earned_ratio = Column(Numeric(18, 4))
long_term_debt_to_working_capital = Column(Numeric(18, 4))
account_payable_turnover_rate = Column(Numeric(18, 4))
account_payable_turnover_days = Column(Numeric(18, 4))
account_receivable_turnover_days = Column(Numeric(18, 4))
inventory_turnover = Column(Numeric(18, 4))
account_receivable_turnover_rate = Column(Numeric(18, 4))
current_asset_turnover = Column(Numeric(18, 4))
fixed_asset_turnover = Column(Numeric(18, 4))
total_asset_turnover = Column(Numeric(18, 4))
inc_earnings_per_share = Column(Numeric(18, 4))
inc_diluted_earnings_per_share = Column(Numeric(18, 4))
inc_revenue = Column(Numeric(18, 4))
inc_operating_revenue = Column(Numeric(18, 4))
inc_gross_profit = Column(Numeric(18, 4))
inc_profit_before_tax = Column(Numeric(18, 4))
inc_net_profit = Column(Numeric(18, 4))
inc_adjusted_net_profit = Column(Numeric(18, 4))
inc_cash_from_operations = Column(Numeric(18, 4))
inc_return_on_equity = Column(Numeric(18, 4))
inc_book_per_share = Column(Numeric(18, 4))
inc_total_asset = Column(Numeric(18, 4))
du_return_on_equity = Column(Numeric(18, 4))
du_equity_multiplier = Column(Numeric(18, 4))
du_asset_turnover_ratio = Column(Numeric(18, 4))
du_profit_margin = Column(Numeric(18, 4))
du_return_on_sales = Column(Numeric(18, 4))
non_recurring_profit_and_loss = Column(Numeric(18, 4))
adjusted_net_profit = Column(Numeric(18, 4))
ebit = Column(Numeric(18, 4))
ebitda = Column(Numeric(18, 4))
invested_capital = Column(Numeric(18, 4))
working_capital = Column(Numeric(18, 4))
net_working_capital = Column(Numeric(18, 4))
retained_earnings = Column(Numeric(18, 4))
interest_bearing_debt = Column(Numeric(18, 4))
net_debt = Column(Numeric(18, 4))
non_interest_bearing_current_debt = Column(Numeric(18, 4))
non_interest_bearing_non_current_debt = Column(Numeric(18, 4))
fcff = Column(Numeric(18, 4))
fcfe = Column(Numeric(18, 4))
depreciation_and_amortization = Column(Numeric(18, 4))
ev = Column(Numeric(21, 4))
ev_2 = Column(Numeric(21, 4))
ev_to_ebit = Column(Numeric(18, 4))
ev_to_ebitda = Column(Numeric(19, 4))
tangible_assets = Column(Numeric(19, 4))
tangible_asset_to_debt = Column(Numeric(19, 4))
tangible_asset_to_interest_bearing_debt = Column(Numeric(19, 4))
| 50.389831
| 71
| 0.736798
| 881
| 5,946
| 4.614075
| 0.111237
| 0.351784
| 0.383764
| 0.409348
| 0.868143
| 0.793604
| 0.550308
| 0.308241
| 0.178352
| 0.023616
| 0
| 0.065756
| 0.150858
| 5,946
| 117
| 72
| 50.820513
| 0.739354
| 0.002186
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.017699
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 6
|
7a3e3c0c5a227d2ab34cab782fab2492bb8ae99d
| 35,990
|
py
|
Python
|
teospy/iceliq4.py
|
jarethholt/teospy
|
3bb23e67bbb765c0842aa8d4a73c1d55ea395d2f
|
[
"MIT"
] | null | null | null |
teospy/iceliq4.py
|
jarethholt/teospy
|
3bb23e67bbb765c0842aa8d4a73c1d55ea395d2f
|
[
"MIT"
] | null | null | null |
teospy/iceliq4.py
|
jarethholt/teospy
|
3bb23e67bbb765c0842aa8d4a73c1d55ea395d2f
|
[
"MIT"
] | null | null | null |
"""Ice-liquid water equilibrium functions.
This module provides thermodynamic properties of ice and liquid water in
equilibrium, e.g. the enthalpy of melting.
:Examples:
>>> pressure(temp=270.)
39313338.8825
>>> densityliq(temp=270.)
1019.05568894
>>> enthalpymelt(temp=270.)
325166.686739
>>> entropymelt(temp=270.)
1204.32106199
>>> volumemelt(temp=270.)
-1.04052121182e-4
>>> temperature(pres=1e7)
272.401648868
>>> densityliq(pres=1e7)
1004.79353660
>>> enthalpymelt(pres=1e7)
331548.910815
>>> entropymelt(pres=1e7)
1217.13254010
>>> volumemelt(pres=1e7)
-9.4217890326e-05
:Functions:
* :func:`eq_tp`: Calculate ice-liquid water equilibrium properties at
either temperature or pressure.
* :func:`temperature`: Temperature at ice-liquid water equilibrium.
* :func:`pressure`: Pressure at ice-liquid water equilibrium.
* :func:`densityliq`: Liquid water density at ice-liquid water
equilibrium.
* :func:`chempot`: Chemical potential at ice-liquid water equilibrium.
* :func:`densityice`: Ice density at ice-liquid water equilibrium.
* :func:`enthalpyice`: Ice enthalpy at ice-liquid water equilibrium.
* :func:`enthalpyliq`: Liquid water enthalpy at ice-liquid water
equilibrium.
* :func:`enthalpymelt`: Enthalpy of melting.
* :func:`entropyice`: Ice entropy at ice-liquid water equilibrium.
* :func:`entropyliq`: Liquid water entropy at ice-liquid water
equilibrium.
* :func:`entropymelt`: Entropy of melting.
* :func:`volumemelt`: Specific volume of melting.
"""
__all__ = ['eq_tp','temperature','pressure','densityliq','chempot','densityice',
'enthalpyice','enthalpyliq','enthalpymelt','entropyice','entropyliq',
'entropymelt','volumemelt']
import warnings
import numpy
from teospy import constants0
from teospy import ice1
from teospy import flu2
from teospy import ice2
from teospy import maths3
_CHKTOL = constants0.CHKTOL
_TTP = constants0.TTP
_PTPI = constants0.PTPI
_DLTP = constants0.DLTP
_LILTP = constants0.LILTP
_chkflubnds = constants0.chkflubnds
_chkicebnds = constants0.chkicebnds
_ice_g = ice1.ice_g
_eq_chempot = flu2.eq_chempot
_eq_pressure = flu2.eq_pressure
_newton = maths3.newton
_C_APPS = ((-1.78582981492113,-12.2325084306734,-52.8236936433529),
(-1.67329759176351e-7,-2.02262929999658e-13))
## Equilibrium functions
def _approx_t(temp):
"""Approximate PDl at T.
Approximate the pressure and liquid water density for ice and liquid
water in equilibrium at the given temperature. This approximation is
based on an empirical polynomial for density.
:arg float temp: Temperature in K.
:returns: Pressure in Pa and liquid water density in kg/m3.
"""
tau = temp/_TTP - 1
dta = 0.
for (i,a) in enumerate(_C_APPS[0]):
dta += a * tau**(i+1)
dliq = _DLTP * (1 + dta)
pres = flu2.pressure(temp,dliq)
return pres, dliq
def _approx_p(pres):
"""Approximate TDl at P.
Approximate the temperature and liquid water density for ice and
liquid water in equilibrium at the given pressure. This
approximation is based on empirical polynomials for temperature and
density.
:arg float pres: Pressure in Pa.
:returns: Temperature in K and liquid water density in kg/m3.
"""
a1, a2 = _C_APPS[1]
psi = pres/_PTPI - 1
tau = a1*psi + a2*psi**2
temp = _TTP * (1 + tau)
dta = 0.
for (i,a) in enumerate(_C_APPS[0]):
dta += a * tau**(i+1)
dliq = _DLTP * (1 + dta)
return temp, dliq
def _diff_t(p,dl,temp):
"""Calculate ice-liquid disequilibrium at T.
Calculate both sides of the equations
given pressure = pressure of liquid water
chemical potential of ice = potential of liquid water
and their Jacobians with respect to pressure and liquid water
density. Solving these equations gives the pressure and liquid water
density at the given temperature.
:arg float p: Pressure in Pa.
:arg float dl: Liquid water density in kg/m3.
:arg float temp: Temperature in K.
:returns: Left-hand side of the equation, right-hand side,
Jacobian of LHS, and Jacobian of RHS.
:rtype: tuple(array(float))
"""
pl = _eq_pressure(0,0,temp,dl)
gi = _ice_g(0,0,temp,p)
gl = _eq_chempot(0,0,temp,dl)
lhs = numpy.array([p, gi])
rhs = numpy.array([pl, gl])
pl_d = _eq_pressure(0,1,temp,dl)
gi_p = _ice_g(0,1,temp,p)
gl_d = _eq_chempot(0,1,temp,dl)
dlhs = numpy.array([[1.,0.], [gi_p,0.]])
drhs = numpy.array([[0.,pl_d], [0.,gl_d]])
return lhs, rhs, dlhs, drhs
def _diff_p(t,dl,pres):
"""Calculate ice-liquid disequilibrium at P.
Calculate both sides of the equations
given pressure = pressure of liquid water
chemical potential of ice = potential of liquid water
and their Jacobians with respect to temperature and liquid water
density. Solving these equations gives the temperature and liquid
water density at the given temperature.
:arg float t: Temperature in K.
:arg float dl: Liquid water density in kg/m3.
:arg float pres: Pressure in Pa.
:returns: Left-hand side of the equation, right-hand side,
Jacobian of LHS, and Jacobian of RHS.
:rtype: tuple(array(float))
"""
pl = _eq_pressure(0,0,t,dl)
gi = _ice_g(0,0,t,pres)
gl = _eq_chempot(0,0,t,dl)
lhs = numpy.array([pres, gi])
rhs = numpy.array([pl, gl])
pl_t = _eq_pressure(1,0,t,dl)
pl_d = _eq_pressure(0,1,t,dl)
gi_t = _ice_g(1,0,t,pres)
gl_t = _eq_chempot(1,0,t,dl)
gl_d = _eq_chempot(0,1,t,dl)
dlhs = numpy.array([[0.,0.], [gi_t,0.]])
drhs = numpy.array([[pl_t,pl_d], [gl_t,gl_d]])
return lhs, rhs, dlhs, drhs
def eq_tp(temp=None,pres=None,dliq=None,chkvals=False,chktol=_CHKTOL,
temp0=None,pres0=None,dliq0=None,chkbnd=False,mathargs=None):
"""Get primary ice-liquid variables at T or P.
Get the values of all primary variables for ice and liquid water in
equilibrium at either of a given temperature or pressure.
If the calculation has already been done, the results can be passed
to avoid unnecessary repeat calculations. If enough values are
passed, they will be checked for consistency if chkvals is True.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Temperature, pressure, and liquid water density (all in SI
units).
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
"""
if temp is None and pres is None:
errmsg = 'One of temp or pres must be provided'
raise ValueError(errmsg)
if temp is not None:
if any(val is None for val in (pres,dliq)):
x0 = (pres0,dliq0)
fargs = (temp,)
if mathargs is None:
mathargs = dict()
x1 = _newton(_diff_t,x0,_approx_t,fargs=fargs,**mathargs)
pres, dliq = x1
else:
x0 = (temp0,dliq0)
fargs = (pres,)
if mathargs is None:
mathargs = dict()
x1 = _newton(_diff_p,x0,_approx_p,fargs=fargs,**mathargs)
temp, dliq = x1
_chkflubnds(temp,dliq,chkbnd=chkbnd)
_chkicebnds(temp,pres,chkbnd=chkbnd)
if not chkvals:
return temp, pres, dliq
lhs, rhs, __, __ = _diff_p(temp,dliq,pres)
errs = list()
for (l,r) in zip(lhs,rhs):
if abs(r) >= chktol:
errs.append(abs(l/r-1))
else:
errs.append(abs(l-r))
if max(errs) > chktol:
warnmsg = ('Given values {0} and solutions {1} disagree to more than '
'the tolerance {2}').format(lhs,rhs,chktol)
warnings.warn(warnmsg,RuntimeWarning)
return temp, pres, dliq
## Thermodynamic properties
def temperature(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate ice-liquid temperature.
Calculate the temperature of ice and liquid water in equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Temperature in K.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> temperature(pres=1e7)
272.40164887
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
return temp
def pressure(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate ice-liquid pressure.
Calculate the pressure of ice and liquid water in equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Pressure in Pa.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> pressure(temp=270.)
39313338.8825
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
return pres
def densityliq(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate ice-liquid liquid water density.
Calculate the density of liquid water for ice and liquid water in
equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Liquid water density in kg/m3.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> densityliq(pres=1e7)
1004.79353660
>>> densityliq(temp=270.)
1019.05568894
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
return dliq
def chempot(temp=None,pres=None,dliq=None,chkvals=False,chktol=_CHKTOL,
temp0=None,pres0=None,dliq0=None,chkbnd=False,mathargs=None):
"""Calculate ice-liquid chemical potential.
Calculate the chemical potential of ice and liquid water in
equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Chemical potential in J/kg.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> chempot(pres=1e7)
9972.8817069
>>> chempot(temp=270.)
38870.0605192
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
g = _ice_g(0,0,temp,pres)
return g
def densityice(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate ice-liquid ice density.
Calculate the density of ice for ice and liquid water in
equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Ice density in kg/m3.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> densityice(pres=1e7)
917.896690830
>>> densityice(temp=270.)
921.359428514
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
dice = ice2.density(temp,pres)
return dice
def enthalpyice(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate liquid-ice ice enthalpy.
Calculate the specific enthalpy of ice for ice and liquid water in
equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Enthalpy in J/kg.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> enthalpyice(pres=1e7)
-324602.983822
>>> enthalpyice(temp=270.)
-299055.938629
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
hi = ice2.enthalpy(temp,pres)
return hi
def enthalpyliq(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate ice-liquid liquid water enthalpy.
Calculate the specific enthalpy of liquid water for ice and liquid
water in equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Enthalpy in J/kg.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> enthalpyliq(pres=1e7)
6945.9269937
>>> enthalpyliq(temp=270.)
26110.7481094
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
hl = flu2.enthalpy(temp,dliq)
return hl
def enthalpymelt(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate enthalpy of melting.
Calculate the specific enthalpy of melting.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Enthalpy in J/kg.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> enthalpymelt(pres=1e7)
331548.910815
>>> enthalpymelt(temp=270.)
325166.686739
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
hl = flu2.enthalpy(temp,dliq)
hi = ice2.enthalpy(temp,pres)
hmelt = hl - hi
return hmelt
def entropyice(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate ice-liquid ice entropy.
Calculate the specific entropy of ice for ice and liquid water in
equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Entropy in J/kg/K.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> entropyice(pres=1e7)
-1228.24464139
>>> entropyice(temp=270.)
-1251.57777462
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
si = ice2.entropy(temp,pres)
return si
def entropyliq(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate ice-liquid liquid entropy.
Calculate the specific entropy of liquid water for ice and liquid
water in equilibrium.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Entropy in J/kg/K.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> entropyliq(pres=1e7)
-11.11210129
>>> entropyliq(temp=270.)
-47.2567126291
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
sl = flu2.entropy(temp,dliq)
return sl
def entropymelt(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate entropy of melting.
Calculate the specific entropy of melting.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Entropy in J/kg/K.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> entropymelt(pres=1e7)
1217.13254010
>>> entropymelt(temp=270.)
1204.32106199
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
sl = flu2.entropy(temp,dliq)
si = ice2.entropy(temp,pres)
smelt = sl - si
return smelt
def volumemelt(temp=None,pres=None,dliq=None,chkvals=False,
chktol=_CHKTOL,temp0=None,pres0=None,dliq0=None,chkbnd=False,
mathargs=None):
"""Calculate specific volume of melting.
Calculate the specific volume of melting.
:arg temp: Temperature in K.
:type temp: float or None
:arg pres: Pressure in Pa.
:type pres: float or None
:arg dliq: Liquid water density in kg/m3. If unknown, pass None
(default) and it will be calculated.
:type dliq: float or None
:arg bool chkvals: If True (default False) and all values are given,
this function will calculate the disequilibrium and raise a
warning if the results are not within a given tolerance.
:arg float chktol: Tolerance to use when checking values (default
_CHKTOL).
:arg temp0: Initial guess for the temperature in K. If None
(default) then `_approx_p` is used.
:type temp0: float or None
:arg pres0: Initial guess for the pressure in Pa. If None (default)
then `_approx_t` is used.
:type pres0: float or None
:arg dliq0: Initial guess for the liquid water density in kg/m3. If
None (default) then `_approx_t` or `_approx_p` is used.
:type dliq0: float or None
:arg bool chkbnd: If True then warnings are raised when the given
values are valid but outside the recommended bounds (default
False).
:arg mathargs: Keyword arguments to the root-finder
:func:`_newton <maths3.newton>` (e.g. maxiter, rtol). If None
(default) then no arguments are passed and default parameters
will be used.
:returns: Specific volume in m3/kg.
:raises ValueError: If neither of temp or pres is provided.
:raises RuntimeWarning: If the relative disequilibrium is more than
chktol, if chkvals is True and all values are given.
:Examples:
>>> volumemelt(pres=1e7)
-9.4217890326e-05
>>> volumemelt(temp=270.)
-1.04052121182e-4
"""
temp, pres, dliq = eq_tp(temp=temp,pres=pres,dliq=dliq,chkvals=chkvals,
chktol=chktol,temp0=temp0,pres0=pres0,dliq0=dliq0,chkbnd=chkbnd,
mathargs=mathargs)
vi = _ice_g(0,1,temp,pres,chkbnd=chkbnd)
vl = dliq**(-1)
vmelt = vl - vi
return vmelt
| 39.549451
| 80
| 0.676077
| 5,225
| 35,990
| 4.605933
| 0.057799
| 0.022688
| 0.035652
| 0.045375
| 0.858223
| 0.822571
| 0.799717
| 0.78077
| 0.777154
| 0.769675
| 0
| 0.031991
| 0.23915
| 35,990
| 909
| 81
| 39.592959
| 0.846876
| 0.703362
| 0
| 0.437811
| 0
| 0
| 0.029086
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.084577
| false
| 0
| 0.034826
| 0
| 0.208955
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
7a43eae4859f7e4a0ab17cb3b690aad1f9bb0c07
| 7,430
|
py
|
Python
|
fpga/fourteensegmentdisplay.py
|
renzenicolai/nmigen-experiments
|
c6048ad9cbb29d5b478538ef04997a00c0e5dd1b
|
[
"Unlicense"
] | null | null | null |
fpga/fourteensegmentdisplay.py
|
renzenicolai/nmigen-experiments
|
c6048ad9cbb29d5b478538ef04997a00c0e5dd1b
|
[
"Unlicense"
] | null | null | null |
fpga/fourteensegmentdisplay.py
|
renzenicolai/nmigen-experiments
|
c6048ad9cbb29d5b478538ef04997a00c0e5dd1b
|
[
"Unlicense"
] | null | null | null |
from nmigen import *
from nmigen.build import Platform, ResourceError
from nmigen.back.pysim import Simulator, Delay, Settle
# Small helper classes to simulate the structure of the platform device
class _OutputSimulator():
def __init__(self, signal):
self.signal = signal
self.eq = self.signal.eq
class _SegmentSimulator():
def __init__(self, signal):
self.o = _OutputSimulator(signal)
class FourteenSegmentDisplay(Elaboratable):
"""
This submodule shows the provided ASCII character on a 14 segment display.
The eight bit of the input data is used to switch the dot on or off.
"""
def __init__(self, deviceType="alnum_led", deviceId=0, simulation=False):
# Public
self.data = Signal(8, reset=0)
self.simulation = simulation
self.simSignals = []
# Private
self._device = None
self._deviceType = deviceType
self._deviceId = deviceId
self._segments = ['a','b','c','d','e','f','g','h','j','k','l','m','n','p']
self._dotSegment = 'dp'
self._lut = [
[0,0,0,0,0,0, 0,0,0, 0, 0,0,0, 0], # (0x20)
[0,0,0,0,1,1, 0,0,0, 0, 0,0,0, 0], # ! (0x21)
[0,1,0,0,0,1, 0,0,0, 0, 0,0,0, 0], # " (0x22)
[0,1,1,1,0,0, 0,1,0, 1, 0,1,0, 1], # # (0x23)
[1,0,1,1,0,1, 0,1,0, 1, 0,1,0, 1], # $ (0x24)
[0,0,1,0,0,1, 0,0,1, 0, 0,0,1, 0], # % (0x25)
[1,0,0,1,1,0, 1,0,1, 0, 1,0,0, 1], # & (0x26)
[0,1,0,0,0,0, 0,1,0, 0, 0,0,0, 0], # ' (0x27)
[1,0,0,1,1,1, 0,0,0, 0, 0,0,0, 0], # ( (0x28)
[1,1,1,1,0,0, 0,0,0, 0, 0,0,0, 0], # ) (0x29)
[0,0,0,0,0,0, 1,1,1, 1, 1,1,1, 1], # * (0x2A)
[0,0,0,0,0,0, 0,1,0, 1, 0,1,0, 1], # + (0x2B)
[0,0,0,0,0,0, 0,0,0, 0, 1,0,0, 0], # , (0x2C)
[0,0,0,0,0,0, 0,0,0, 1, 0,0,0, 1], # - (0x2D)
[0,0,0,0,0,0, 0,0,0, 0, 0,1,0, 0], # . (0x2E)
[0,0,0,0,0,0, 0,0,1, 0, 0,0,1, 0], # / (0x2F)
[1,1,1,1,1,1, 0,0,0, 0, 0,0,0, 0], # 0 (0x30)
[0,1,1,0,0,0, 0,0,1, 0, 0,0,0, 0], # 1 (0x31)
[1,1,0,1,1,0, 0,0,0, 1, 0,0,0, 1], # 2 (0x32)
[1,1,1,1,0,0, 0,0,0, 1, 0,0,0, 0], # 3 (0x33)
[0,1,1,0,0,1, 0,0,0, 1, 0,0,0, 1], # 4 (0x34)
[1,0,1,1,0,1, 0,0,0, 1, 0,0,0, 1], # 5 (0x35)
[1,0,1,1,1,1, 0,0,0, 1, 0,0,0, 1], # 6 (0x36)
[1,0,0,0,0,0, 0,0,1, 0, 0,1,0, 0], # 7 (0x37)
[1,1,1,1,1,1, 0,0,0, 1, 0,0,0, 1], # 8 (0x38)
[1,1,1,0,0,1, 0,0,0, 1, 0,0,0, 1], # 9 (0x39)
[0,0,0,0,0,0, 0,1,0, 0, 0,1,0, 0], # : (0x3A)
[0,0,0,0,0,0, 0,1,0, 0, 0,0,1, 0], # ; (0x3B)
[0,0,0,0,0,0, 0,0,1, 0, 1,0,0, 0], # < (0x3C)
[0,0,0,1,0,0, 0,0,0, 1, 0,0,0, 1], # = (0x3D)
[0,0,0,0,0,0, 1,0,0, 0, 0,0,1, 0], # > (0x3E)
[1,0,0,0,0,1, 0,0,1, 0, 0,1,0, 0], # ? (0x3F)
[1,1,1,1,1,1, 1,0,1, 0, 1,0,1, 0], # @ (0x40)
[1,1,1,0,1,1, 0,0,0, 1, 0,0,0, 1], # A (0x41)
[1,1,1,1,0,0, 0,1,0, 1, 0,1,0, 0], # B (0x42)
[1,0,0,1,1,1, 0,0,0, 0, 0,0,0, 0], # C (0x43)
[1,1,1,1,0,0, 0,1,0, 0, 0,1,0, 0], # D (0x44)
[1,0,0,1,1,1, 0,0,0, 1, 0,0,0, 1], # E (0x45)
[1,0,0,0,1,1, 0,0,0, 1, 0,0,0, 1], # F (0x46)
[1,0,1,1,1,1, 0,0,0, 1, 0,0,0, 0], # G (0x47)
[0,1,1,0,1,1, 0,0,0, 1, 0,0,0, 1], # H (0x48)
[1,0,0,1,0,0, 0,1,0, 0, 0,1,0, 0], # I (0x49)
[0,1,1,1,1,0, 0,0,0, 0, 0,0,0, 0], # J (0x4A)
[0,0,0,0,1,1, 0,0,1, 0, 1,0,0, 1], # K (0x4B)
[0,0,0,1,1,1, 0,0,0, 0, 0,0,0, 0], # L (0x4C)
[0,1,1,0,1,1, 1,0,1, 0, 0,0,0, 0], # M (0x4D)
[0,1,1,0,1,1, 1,0,0, 0, 1,0,0, 0], # N (0x4E)
[1,1,1,1,1,1, 0,0,0, 0, 0,0,0, 0], # O (0x4F)
[1,1,0,0,1,1, 0,0,0, 1, 0,0,0, 1], # P (0x50)
[1,1,1,1,1,1, 0,0,0, 0, 1,0,0, 0], # Q (0x51)
[1,1,0,0,1,1, 0,0,0, 1, 1,0,0, 1], # R (0x52)
[1,0,1,1,0,0, 1,0,0, 1, 0,0,0, 0], # S (0x53)
[1,0,0,0,0,0, 0,1,0, 0, 0,1,0, 0], # T (0x54)
[0,1,1,1,1,1, 0,0,0, 0, 0,0,0, 0], # U (0x55)
[0,0,0,0,1,1, 0,0,1, 0, 0,0,1, 0], # V (0x56)
[0,1,1,0,1,1, 0,0,0, 0, 1,0,1, 0], # W (0x57)
[0,0,0,0,0,0, 1,0,1, 0, 1,0,1, 0], # X (0x58)
[0,0,0,0,0,0, 1,0,1, 0, 0,1,0, 0], # Y (0x59)
[1,0,0,1,0,0, 0,0,1, 0, 0,0,1, 0], # Z (0x5A)
[1,0,0,1,1,1, 0,0,0, 0, 0,0,0, 0], # [ (0x5B)
[0,0,0,0,0,0, 1,0,0, 0, 1,0,0, 0], # \ (0x5C)
[1,1,1,1,0,0, 0,0,0, 0, 0,0,0, 0], # ] (0x5D)
[1,1,0,0,0,1, 0,0,0, 0, 0,0,0, 0], # ^ (0x5E)
[0,0,0,1,0,0, 0,0,0, 0, 0,0,0, 0], # _ (0x5F)
[0,0,0,0,0,0, 1,0,0, 0, 0,0,0, 0], # ` (0x60)
[1,1,1,1,1,0, 0,0,0, 1, 0,0,0, 1], # a (0x61)
[0,0,0,1,1,1, 0,0,0, 0, 1,0,0, 1], # b (0x62)
[0,0,0,1,1,0, 0,0,0, 1, 0,0,0, 1], # c (0x63)
[0,1,1,1,0,0, 0,0,0, 1, 0,0,1, 0], # d (0x64)
[1,0,0,1,1,1, 0,0,0, 0, 0,0,0, 1], # e (0x65)
[1,0,0,0,1,1, 0,0,0, 0, 0,0,0, 1], # f (0x66)
[1,1,1,1,0,0, 1,0,0, 1, 0,0,0, 0], # g (0x67)
[0,0,1,0,1,1, 0,0,0, 1, 0,0,0, 1], # h (0x68)
[0,0,0,0,0,0, 0,0,0, 0, 0,1,0, 0], # i (0x69)
[0,1,1,1,0,0, 0,0,0, 0, 0,0,0, 0], # j (0x6A)
[0,0,0,0,1,1, 0,0,1, 0, 1,0,0, 0], # k (0x6B)
[0,0,0,0,0,0, 0,1,0, 0, 0,1,0, 0], # l (0x6C)
[0,0,1,0,1,0, 0,0,0, 1, 0,1,0, 1], # m (0x6D)
[0,0,0,0,1,0, 0,0,0, 0, 1,0,0, 1], # n (0x6E)
[0,0,1,1,1,0, 0,0,0, 1, 0,0,0, 1], # o (0x6F)
[1,0,0,0,1,1, 0,0,1, 0, 0,0,0, 1], # p (0x70)
[1,1,0,0,0,1, 0,0,0, 1, 1,0,0, 1], # q (0x71)
[0,0,0,0,1,0, 0,0,0, 0, 0,0,0, 1], # r (0x72)
[1,0,1,1,0,0, 1,0,0, 1, 0,0,0, 0], # s (0x73)
[0,0,0,1,1,1, 0,0,0, 0, 0,0,0, 1], # t (0x74)
[0,0,1,1,1,0, 0,0,0, 0, 0,0,0, 0], # u (0x75)
[0,0,0,0,1,0, 0,0,0, 0, 0,0,1, 0], # v (0x76)
[0,0,1,0,1,0, 0,0,0, 0, 1,0,1, 0], # w (0x77)
[0,0,0,0,0,0, 1,0,1, 0, 1,0,1, 0], # x (0x78)
[0,1,1,1,0,0, 0,1,0, 1, 0,0,0, 0], # y (0x79)
[1,0,0,1,0,0, 0,0,1, 0, 0,0,1, 0], # z (0x7A)
[1,0,0,1,0,0, 1,0,0, 0, 0,0,1, 1], # { (0x7B)
[0,0,0,0,0,0, 0,1,0, 0, 0,1,0, 0], # | (0x7C)
[1,0,0,1,0,0, 0,0,1, 1, 1,0,0, 0], # } (0x7D)
[0,0,0,0,0,0, 0,0,0, 1, 0,0,0, 1], # ~ (0x7E)
]
def elaborate(self, platform: Platform) -> Module:
m = Module()
if self.simulation:
self._device = {}
for segment in self._segments + [self._dotSegment]:
s = Signal(1)
s.name = segment
self.simSignals.append(s)
self._device[segment] = _SegmentSimulator(s)
else:
self._device = platform.request(self._deviceType, self._deviceId)
# Remove the eighth bit from the data signal and map the seven remaining bits onto the LUT
data7 = Signal(unsigned(7))
with m.If(self.data[0:7] < 0x20): # Out of range
m.d.comb += data7.eq(0) # Set to SPACE (0x20), 0 in our LUT, when data is out of range
with m.Else():
m.d.comb += data7.eq(self.data[0:7]-0x20)
# Drive the dot segment using the eighth bit of the data signal
m.d.comb += self._device[self._dotSegment].o.eq(self.data[7])
# Drive the other fourteen segments using the LUT
with m.Switch(data7):
for i in range(len(self._lut)):
with m.Case(i): # (SPACE to ~)
for j in range(len(self._segments)):
m.d.comb += self._device[self._segments[j]].o.eq(self._lut[i][j])
with m.Default(): # (0x7F / DEL)
for j in range(len(self._segments)):
m.d.comb += self._device[self._segments[j]].o.eq(1)
return m
def ports(self):
ports = [self.data]
if self.simulation:
ports.extend(self.simSignals)
return ports
if __name__ == "__main__":
m = FourteenSegmentDisplay(simulation = True)
sim = Simulator(m)
def process():
# This design consist purely of combinational logic
# so we just loop through all possible input values
for i in range(256):
yield m.data.eq(i)
yield Delay(1e-6)
yield Settle()
sim.add_process(process)
with sim.write_vcd("test.vcd", "test.gtkw", traces=m.ports()):
sim.run()
| 40.162162
| 92
| 0.490983
| 1,903
| 7,430
| 1.890173
| 0.137677
| 0.35196
| 0.353628
| 0.302474
| 0.442591
| 0.4134
| 0.406172
| 0.397554
| 0.389491
| 0.361412
| 0
| 0.277635
| 0.212248
| 7,430
| 184
| 93
| 40.380435
| 0.336921
| 0.199462
| 0
| 0.163522
| 0
| 0
| 0.008579
| 0
| 0
| 0
| 0.001373
| 0
| 0
| 1
| 0.037736
| false
| 0
| 0.018868
| 0
| 0.08805
| 0
| 0
| 0
| 1
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
7aa2ecacc1b4edd27824ab28d2f199ab480f960d
| 141
|
py
|
Python
|
thirvusoft/thirvusoft/doctype/ts_payroll/test_ts_payroll.py
|
SaraneshThirvu/Script_Report
|
5af8f4d3dc32ead2b124f10c55040d49a21ebb5d
|
[
"MIT"
] | null | null | null |
thirvusoft/thirvusoft/doctype/ts_payroll/test_ts_payroll.py
|
SaraneshThirvu/Script_Report
|
5af8f4d3dc32ead2b124f10c55040d49a21ebb5d
|
[
"MIT"
] | null | null | null |
thirvusoft/thirvusoft/doctype/ts_payroll/test_ts_payroll.py
|
SaraneshThirvu/Script_Report
|
5af8f4d3dc32ead2b124f10c55040d49a21ebb5d
|
[
"MIT"
] | null | null | null |
# Copyright (c) 2021, TS and Contributors
# See license.txt
# import frappe
import unittest
class TestTS_Payroll(unittest.TestCase):
pass
| 15.666667
| 41
| 0.77305
| 19
| 141
| 5.684211
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 0.148936
| 141
| 8
| 42
| 17.625
| 0.866667
| 0.489362
| 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
| 1
| 0
|
0
| 6
|
8ff1fc7f5b6a1164af4260cd817188ff96c48ecb
| 103
|
py
|
Python
|
bitmovin_api_sdk/encoding/configurations/video/vp9/customdata/__init__.py
|
jaythecaesarean/bitmovin-api-sdk-python
|
48166511fcb9082041c552ace55a9b66cc59b794
|
[
"MIT"
] | 11
|
2019-07-03T10:41:16.000Z
|
2022-02-25T21:48:06.000Z
|
bitmovin_api_sdk/encoding/configurations/video/vp9/customdata/__init__.py
|
jaythecaesarean/bitmovin-api-sdk-python
|
48166511fcb9082041c552ace55a9b66cc59b794
|
[
"MIT"
] | 8
|
2019-11-23T00:01:25.000Z
|
2021-04-29T12:30:31.000Z
|
bitmovin_api_sdk/encoding/configurations/video/vp9/customdata/__init__.py
|
jaythecaesarean/bitmovin-api-sdk-python
|
48166511fcb9082041c552ace55a9b66cc59b794
|
[
"MIT"
] | 13
|
2020-01-02T14:58:18.000Z
|
2022-03-26T12:10:30.000Z
|
from bitmovin_api_sdk.encoding.configurations.video.vp9.customdata.customdata_api import CustomdataApi
| 51.5
| 102
| 0.902913
| 13
| 103
| 6.923077
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010101
| 0.038835
| 103
| 1
| 103
| 103
| 0.89899
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
56f59a848cb0e6dafae0001284fd9453da3b89e8
| 27
|
py
|
Python
|
code/cyclegan/__init__.py
|
karl-joan/text2art-gan
|
86370667f9a62bab95968abe1990dcaa4760b333
|
[
"MIT"
] | 5
|
2021-10-30T13:40:41.000Z
|
2022-03-20T04:48:45.000Z
|
code/cyclegan/__init__.py
|
karl-joan/text2art-gan
|
86370667f9a62bab95968abe1990dcaa4760b333
|
[
"MIT"
] | null | null | null |
code/cyclegan/__init__.py
|
karl-joan/text2art-gan
|
86370667f9a62bab95968abe1990dcaa4760b333
|
[
"MIT"
] | 2
|
2021-09-06T03:45:04.000Z
|
2022-03-13T03:23:49.000Z
|
from .main import cyclegan
| 13.5
| 26
| 0.814815
| 4
| 27
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 27
| 1
| 27
| 27
| 0.956522
| 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
| 1
| 0
|
0
| 6
|
56fe5a7bf702f7326f225c4e486c0a157601c27e
| 39,967
|
py
|
Python
|
test/intelliflow/core/signal_processing/routing_runtime_constructs/test_route.py
|
amzn/rheoceros
|
5e8f79d97f8b21d693d3c869b0df70de3d5fd068
|
[
"Apache-2.0",
"MIT-0"
] | 4
|
2022-03-24T04:39:02.000Z
|
2022-03-31T16:41:50.000Z
|
test/intelliflow/core/signal_processing/routing_runtime_constructs/test_route.py
|
amzn/rheoceros
|
5e8f79d97f8b21d693d3c869b0df70de3d5fd068
|
[
"Apache-2.0",
"MIT-0"
] | null | null | null |
test/intelliflow/core/signal_processing/routing_runtime_constructs/test_route.py
|
amzn/rheoceros
|
5e8f79d97f8b21d693d3c869b0df70de3d5fd068
|
[
"Apache-2.0",
"MIT-0"
] | null | null | null |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import copy
import time
from test.intelliflow.core.signal_processing.dimension_constructs.test_dimension_spec import TestDimensionSpec
from test.intelliflow.core.signal_processing.routing_runtime_constructs import create_incoming_signal
from test.intelliflow.core.signal_processing.signal.test_signal_link_node import signal_dimension_tuple
import pytest
from intelliflow.core.platform.constructs import RoutingHookInterface
from intelliflow.core.serialization import dumps, loads
from intelliflow.core.signal_processing.definitions.dimension_defs import Type
from intelliflow.core.signal_processing.routing_runtime_constructs import *
from intelliflow.core.signal_processing.signal import *
from intelliflow.core.signal_processing.signal_source import InternalDatasetSignalSourceAccessSpec
from intelliflow.core.signal_processing.slot import SlotType
def _create_hook(code: str = "pass") -> Slot:
return Slot(SlotType.SYNC_INLINED, dumps(code), None, None, None, None)
class TestRoute:
@classmethod
def _route_1_basic(cls):
from test.intelliflow.core.signal_processing.test_slot import TestSlot
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
from test.intelliflow.core.signal_processing.signal.test_signal_link_node import TestSignalLinkNode
signal_link_node = copy.deepcopy(TestSignalLinkNode.signal_link_node_1)
output_spec = DimensionSpec.load_from_pretty({"output_dim": {type: Type.LONG}})
output_dim_link_matrix = [
SignalDimensionLink(
signal_dimension_tuple(None, "output_dim"), lambda x: x, signal_dimension_tuple(TestSignal.signal_internal_1, "dim_1_1")
)
]
output_filter = signal_link_node.get_output_filter(
output_spec,
# Logical equivalent -> output_dim = (signal_internal_1('dim_1_1')
output_dim_link_matrix,
)
output_signal = Signal(
TestSignal.signal_internal_1.type,
InternalDatasetSignalSourceAccessSpec("sample_data", output_spec, **{}),
SignalDomainSpec(output_spec, output_filter, TestSignal.signal_internal_1.domain_spec.integrity_check_protocol),
"sample_data",
)
return Route(
f"InternalDataNode-{output_signal.alias}",
signal_link_node,
output_signal,
output_dim_link_matrix,
[TestSlot.slot_batch_compute_basic],
False,
)
@classmethod
def _route_2_two_inputs_linked(cls):
from test.intelliflow.core.signal_processing.test_slot import TestSlot
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
from test.intelliflow.core.signal_processing.signal.test_signal_link_node import TestSignalLinkNode
signal_link_node = copy.deepcopy(TestSignalLinkNode.signal_link_node_2)
output_spec = DimensionSpec.load_from_pretty({"output_dim": {type: Type.LONG}})
output_dim_link_matrix = [
SignalDimensionLink(
signal_dimension_tuple(None, "output_dim"), lambda x: x, signal_dimension_tuple(TestSignal.signal_internal_1, "dim_1_1")
)
]
output_filter = signal_link_node.get_output_filter(output_spec, output_dim_link_matrix)
output_signal = Signal(
TestSignal.signal_internal_1.type,
InternalDatasetSignalSourceAccessSpec("sample_data_2", output_spec, **{}),
SignalDomainSpec(output_spec, output_filter, TestSignal.signal_internal_1.domain_spec.integrity_check_protocol),
"sample_data_2",
)
return Route(
f"InternalDataNode-{output_signal.alias}",
signal_link_node,
output_signal,
output_dim_link_matrix,
[TestSlot.slot_batch_compute_basic],
False,
)
@classmethod
def _route_3_three_inputs_unlinked(cls):
from test.intelliflow.core.signal_processing.test_slot import TestSlot
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
from test.intelliflow.core.signal_processing.signal.test_signal_link_node import TestSignalLinkNode
signal_link_node = copy.deepcopy(TestSignalLinkNode.signal_link_node_3_complex)
# create sample expected output
output_spec = DimensionSpec.load_from_pretty(
{"output_dim_1": {type: Type.LONG, "output_dim_2": {type: Type.LONG, "output_dim_3": {type: Type.LONG}}}}
)
output_dim_link_matrix = [
SignalDimensionLink(
signal_dimension_tuple(None, "output_dim_1"),
lambda x: x,
signal_dimension_tuple(TestSignal.signal_internal_complex_1, "dim_1_1"),
),
SignalDimensionLink(
signal_dimension_tuple(None, "output_dim_2"),
# input's sub dimension is of type String, convert it.
# because output spec expects it to be of type Long.
lambda x: ord(x),
signal_dimension_tuple(TestSignal.signal_internal_complex_1, "dim_1_2"),
),
SignalDimensionLink(
signal_dimension_tuple(None, "output_dim_3"),
# and this one is from the 3rd input (which has only one dim 'dim_1_1')
lambda x: x,
signal_dimension_tuple(TestSignal.signal_s3_1, "dim_1_1"),
),
]
output_filter = signal_link_node.get_output_filter(output_spec, output_dim_link_matrix)
output_signal = Signal(
SignalType.INTERNAL_PARTITION_CREATION,
InternalDatasetSignalSourceAccessSpec("sample_data_3", output_spec, **{}),
SignalDomainSpec(output_spec, output_filter, TestSignal.signal_internal_complex_1.domain_spec.integrity_check_protocol),
"sample_data_3",
)
return Route(
f"InternalDataNode-{output_signal.alias}",
signal_link_node,
output_signal,
output_dim_link_matrix,
[TestSlot.slot_batch_compute_basic],
False,
)
@classmethod
def _route_3_three_inputs_linked(cls):
from test.intelliflow.core.signal_processing.test_slot import TestSlot
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
from test.intelliflow.core.signal_processing.signal.test_signal_link_node import TestSignalLinkNode
signal_link_node = copy.deepcopy(TestSignalLinkNode.signal_link_node_3_complex)
# add links (since the dimension names on same, use the auto-linking of dimensions,
# so that;
# signal_internal_complex_1['dim_1_1'] == signal_s3_1['dim_1_1'], etc
signal_link_node.compensate_missing_links()
# create sample expected output
output_spec = DimensionSpec.load_from_pretty(
{
"output_dim_1": {
type: Type.LONG,
"output_dim_2": {
type: Type.LONG,
},
}
}
)
output_dim_link_matrix = [
SignalDimensionLink(
signal_dimension_tuple(None, "output_dim_1"),
# from the second dimension of the first/second inputs (convert to Long)
lambda x: ord(x),
signal_dimension_tuple(TestSignal.signal_internal_complex_1, "dim_1_2"),
),
SignalDimensionLink(
signal_dimension_tuple(None, "output_dim_2"),
# and this one is from the 3rd input (which has only one dim 'dim_1_1')
lambda x: x,
signal_dimension_tuple(TestSignal.signal_s3_1, "dim_1_1"),
),
]
output_filter = signal_link_node.get_output_filter(output_spec, output_dim_link_matrix)
output_signal = Signal(
SignalType.INTERNAL_PARTITION_CREATION,
InternalDatasetSignalSourceAccessSpec("sample_data_4", output_spec, **{}),
SignalDomainSpec(output_spec, output_filter, TestSignal.signal_internal_complex_1.domain_spec.integrity_check_protocol),
"sample_data_4",
)
return Route(
f"InternalDataNode-{output_signal.alias}",
signal_link_node,
output_signal,
output_dim_link_matrix,
[TestSlot.slot_batch_compute_basic],
False,
)
def test_route_init(self):
assert self._route_1_basic()
def test_route_init_with_hooks(self):
route = self._route_1_basic()
Route(
route.route_id,
route.link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
RouteExecutionHook(
on_exec_begin=_create_hook(),
on_exec_skipped=_create_hook(),
on_compute_success=_create_hook(),
on_compute_failure=_create_hook(),
on_success=_create_hook(),
on_failure=_create_hook(),
checkpoints=[RouteCheckpoint(5, _create_hook())],
),
30 * 24 * 60 * 60,
RoutePendingNodeHook(on_pending_node_created=_create_hook(), on_expiration=_create_hook(), checkpoints=None),
)
# check another instantiation case + checkpoint sorting
assert (
Route(
route.route_id,
route.link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
RouteExecutionHook(
on_exec_begin=_create_hook(),
on_exec_skipped=_create_hook(),
on_compute_success=_create_hook(),
on_compute_failure=_create_hook(),
on_success=_create_hook(),
on_failure=_create_hook(),
checkpoints=[],
),
None,
RoutePendingNodeHook(
on_pending_node_created=_create_hook(),
on_expiration=None,
checkpoints=[RouteCheckpoint(2, _create_hook()), RouteCheckpoint(1, _create_hook())],
),
)
.pending_node_hook.checkpoints[0]
.checkpoint_in_secs
== 1
)
def test_route_init_with_hook_chain(self):
route = self._route_1_basic()
callback1_var = None
callback1_var_expected = 1
def _callback1(*args, **kwargs):
nonlocal callback1_var
callback1_var = callback1_var_expected
callback2_var = None
callback2_var_expected = 2
def _callback2(*args, **kwargs):
nonlocal callback2_var
callback2_var = callback2_var_expected
hook1 = RouteExecutionHook(
on_exec_begin=_create_hook(),
on_exec_skipped=_callback1,
on_compute_success=_create_hook(),
on_compute_failure=_create_hook(),
on_success=_create_hook(),
on_failure=_create_hook(),
checkpoints=[RouteCheckpoint(5, _create_hook())],
)
hook2 = RouteExecutionHook(
on_exec_begin=_create_hook(),
on_exec_skipped=_callback2,
on_compute_success=_create_hook(),
on_compute_failure=_create_hook(),
on_success=_create_hook(),
on_failure=_create_hook(),
checkpoints=[RouteCheckpoint(10, _create_hook())],
)
exec_hook_chain = hook1.chain(hook2)
pending_hook1 = RoutePendingNodeHook(
on_pending_node_created=_create_hook(), on_expiration=_create_hook(), checkpoints=[RouteCheckpoint(5, _create_hook())]
)
pending_hook2 = RoutePendingNodeHook(
on_pending_node_created=_create_hook(), on_expiration=_create_hook(), checkpoints=[RouteCheckpoint(10, _create_hook())]
)
pending_hook3 = RoutePendingNodeHook(
on_pending_node_created=_create_hook(), on_expiration=_create_hook(), checkpoints=[RouteCheckpoint(13, _create_hook())]
)
pending_hook_chain = pending_hook1.chain(pending_hook2, pending_hook3)
pending_hook_chain_2 = pending_hook1.chain(pending_hook2).chain(pending_hook3)
Route(
route.route_id,
route.link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
exec_hook_chain,
24 * 60 * 60,
pending_hook_chain,
)
assert len(exec_hook_chain.checkpoints) == 2
assert len(pending_hook_chain.checkpoints) == 3
assert len(pending_hook_chain_2.checkpoints) == 3
exec_hook_chain.on_exec_begin()
pending_hook_chain.on_pending_node_created()
pending_hook_chain_2.on_expiration()
exec_hook_chain.on_exec_skipped()
assert callback1_var == callback1_var_expected
assert callback2_var == callback2_var_expected
def test_route_equality(self):
assert self._route_1_basic() == self._route_1_basic()
assert Route("test", None, None, [], [], False) == Route("test", None, None, [], [], False)
assert Route("test", None, None, [], [], False) != Route("test2", None, None, [], [], False)
assert self._route_1_basic() == self._route_1_basic().clone()
def test_route_check_integrity(self):
route = self._route_1_basic()
assert route.check_integrity(self._route_1_basic())
route2 = self._route_2_two_inputs_linked()
# Route is very sensitive about an integrity check against a different Route. This is very critical
# for whole Routing module. It should not occur! A safe-guard against a high-level (e.g RoutingTable) bug.
with pytest.raises(ValueError):
assert route.check_integrity(route2)
# make id equal so that check move on to other fields
route2._id = route.route_id
assert not route.check_integrity(route2)
assert route.check_integrity(Route(route.route_id, route.link_node, route.output, route._output_dim_matrix, route.slots, False))
assert not route.check_integrity(
Route(route.route_id, route2.link_node, route.output, route._output_dim_matrix, route.slots, False)
)
assert not route.check_integrity(
Route(route.route_id, route.link_node, route2.output, route._output_dim_matrix, route.slots, False)
)
assert not route.check_integrity(Route(route.route_id, route.link_node, route.output, [], route.slots, False))
assert not route.check_integrity(Route(route.route_id, route.link_node, route.output, route._output_dim_matrix, [], False))
def test_route_check_integrity_noops(self):
"""show that some type of changes in route should not invalidate the integrity"""
route = self._route_3_three_inputs_linked()
# dim matrix ordering should not alter the semantics of route
new_route = copy.deepcopy(route)
new_route.link_node.link_matrix.reverse()
new_route.output_dim_matrix.reverse()
# TODO evaluate slots order? currently impacting integrity but not as critical as dim matrice
assert route.check_integrity(new_route)
@pytest.mark.parametrize(
"execution_hook_1, pending_node_ttl_1, pending_hook_1, execution_hook_2, pending_node_ttl_2, pending_hook_2, result",
[
(None, 30 * 24 * 60 * 60, None, None, 24 * 60 * 60, None, False),
(
RouteExecutionHook(
on_exec_begin=_create_hook(),
on_exec_skipped=_create_hook(),
on_compute_success=_create_hook(),
on_compute_failure=_create_hook(),
on_success=_create_hook(),
on_failure=_create_hook(),
checkpoints=[RouteCheckpoint(checkpoint_in_secs=5, slot=_create_hook())],
),
30 * 24 * 60 * 60,
RoutePendingNodeHook(
on_pending_node_created=_create_hook(),
on_expiration=_create_hook(),
checkpoints=[RouteCheckpoint(checkpoint_in_secs=1, slot=_create_hook()), RouteCheckpoint(2, _create_hook())],
),
RouteExecutionHook(
on_exec_begin=_create_hook(),
on_exec_skipped=_create_hook(),
on_compute_success=_create_hook(),
on_compute_failure=_create_hook(),
on_success=_create_hook(),
on_failure=_create_hook(),
checkpoints=[RouteCheckpoint(5, _create_hook())],
),
30 * 24 * 60 * 60,
RoutePendingNodeHook(
on_pending_node_created=_create_hook(),
on_expiration=_create_hook(),
# also test that checkpoint other should not matter as long as values are same
checkpoints=[RouteCheckpoint(2, _create_hook()), RouteCheckpoint(1, _create_hook())],
),
True,
),
(
RouteExecutionHook(on_exec_begin=_create_hook()),
30 * 24 * 60 * 60,
RoutePendingNodeHook(),
RouteExecutionHook(on_exec_begin=_create_hook()),
30 * 24 * 60 * 60,
RoutePendingNodeHook(),
True,
),
(
RouteExecutionHook(on_exec_begin=_create_hook("print('diff')")),
30 * 24 * 60 * 60,
RoutePendingNodeHook(),
RouteExecutionHook(on_exec_begin=_create_hook()),
30 * 24 * 60 * 60,
RoutePendingNodeHook(),
False,
),
(None, None, None, None, None, None, True),
(
RouteExecutionHook(on_exec_begin=None, on_exec_skipped=None),
None,
None,
RouteExecutionHook(on_exec_begin=None, on_exec_skipped=_create_hook()),
None,
None,
False,
),
(
RouteExecutionHook(on_exec_begin=None, on_exec_skipped=_create_hook()),
None,
None,
RouteExecutionHook(on_exec_begin=None, on_exec_skipped=None),
None,
None,
False,
),
(
RouteExecutionHook(
on_exec_begin=None,
on_exec_skipped=None,
on_compute_success=None,
on_compute_failure=None,
on_success=None,
on_failure=None,
checkpoints=[RouteCheckpoint(1, _create_hook())],
),
None,
RoutePendingNodeHook(),
RouteExecutionHook(
on_exec_begin=None,
on_exec_skipped=None,
on_compute_success=None,
on_compute_failure=None,
on_success=None,
on_failure=None,
# change the value of first checkpoint
checkpoints=[RouteCheckpoint(5, _create_hook())],
),
None,
RoutePendingNodeHook(),
False,
),
(
RouteExecutionHook(),
None,
RoutePendingNodeHook(
on_pending_node_created=_create_hook(), on_expiration=None, checkpoints=[RouteCheckpoint(2, _create_hook())]
),
RouteExecutionHook(),
None,
RoutePendingNodeHook(
on_pending_node_created=_create_hook(),
on_expiration=None,
# also test that checkpoint other should not matter as long as values are same
checkpoints=[RouteCheckpoint(1, _create_hook())],
),
False,
),
(
None,
None,
RoutePendingNodeHook(on_pending_node_created=None, on_expiration=None, checkpoints=[RouteCheckpoint(1, _create_hook())]),
None,
None,
RoutePendingNodeHook(
on_pending_node_created=None,
on_expiration=None,
# also test that checkpoint other should not matter as long as values are same
checkpoints=[RouteCheckpoint(1, _create_hook("print('diff 2')"))],
),
False,
),
],
)
def test_route_check_auxiliary_integrity(
self, execution_hook_1, pending_node_ttl_1, pending_hook_1, execution_hook_2, pending_node_ttl_2, pending_hook_2, result
):
route = self._route_1_basic()
assert (
Route(
route.route_id,
route.link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
execution_hook_1,
pending_node_ttl_1,
pending_hook_1,
).check_auxiliary_data_integrity(
Route(
route.route_id,
route.link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
execution_hook_2,
pending_node_ttl_2,
pending_hook_2,
)
)
== result
)
def test_route_serialization(self):
route = self._route_1_basic()
assert route == loads(dumps(route))
def test_route_receive_basic(self):
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_1_basic()
# route will reject incompatible signal
assert not route.receive(create_incoming_signal(TestSignal.signal_s3_1, [1]))
assert not route._pending_nodes
# successful trigger # 1
response: Optional[Route.Response] = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
assert response
assert len(response.new_execution_contexts) == 1
assert response.new_execution_contexts[0].slots
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({1: {}})
)
# since the node completed immediately (since it has only one input),
# also removed from the internal pending nodes.
assert not route._pending_nodes
# successful trigger # 2
response: Optional[Route.Response] = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [2]))
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({2: {}})
)
# since the node completed immediately (since it has only one input),
# also removed from the internal pending nodes.
assert not route._pending_nodes
def test_route_receive_two_inputs_linked(self):
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_2_two_inputs_linked()
# will consume the event, create a new pending node but return no 'new_execution_contexts'
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 1
# will consume the event, create a new pending node but return no 'new_execution_contexts'
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [2]))
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 2 # please note that it is 2 now!
# will consume again with no internal effect
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [2]))
assert not response.new_execution_contexts
assert not response.new_pending_nodes
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
assert not response.new_execution_contexts
assert not response.new_pending_nodes
assert len(route._pending_nodes) == 2 # please note that it is 2 still
# send in a Signal that belongs to the second input but with different dim value
# will create another pending node since it is neither '1' nor '2' (linking is active).
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [3]))
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 3 # please note that it is 3 now!
# Completions
# unleash the third pending node (which is pending on its first input with dim value 3)
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [3]))
assert len(response.new_execution_contexts) == 1
assert not response.new_pending_nodes
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({3: {}})
)
assert len(route._pending_nodes) == 2 # please note that it got back to 2!
# unleash the fist node
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [1]))
assert len(response.new_execution_contexts) == 1
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({1: {}})
)
assert len(route._pending_nodes) == 1
# and finally the second node
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [2]))
assert len(response.new_execution_contexts) == 1
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({2: {}})
)
assert not route._pending_nodes
def test_route_receive_three_inputs_unlinked(self):
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_3_three_inputs_unlinked()
# will consume the event, create a new pending node but return no 'new_execution_contexts'
response = route.receive(create_incoming_signal(TestSignal.signal_internal_complex_1, [1, "y"]))
assert not response.new_execution_contexts
assert len(route._pending_nodes) == 1
# will consume the event, create a new pending node but return no 'new_execution_contexts'
response = route.receive(create_incoming_signal(TestSignal.signal_internal_complex_1, [2, "y"]))
assert not response.new_execution_contexts
assert len(route._pending_nodes) == 2 # please note that it is 2 now!
# will consume again with no internal effect
response = route.receive(create_incoming_signal(TestSignal.signal_internal_complex_1, [2, "y"]))
assert not response.new_execution_contexts
response = route.receive(create_incoming_signal(TestSignal.signal_internal_complex_1, [1, "y"]))
assert not response.new_execution_contexts
assert len(route._pending_nodes) == 2 # please note that it is 2 still
# EFFECT of missing linking (N-N logic)
# incoming signal will satisfy all of the pending nodes
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [3]))
assert len(response.new_execution_contexts) == 2
assert not route._pending_nodes # please note that it got back to 0 now!
# we have to compare this way since the order is not guarateed
if DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec,
DimensionFilter.load_raw(
{
2: { # from the 1st dim of the 1st input signal
121: {3: {}} # ord('y') from the second dim of the 1st input signal # from the 3rd input
}
}
),
):
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[1].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({1: {121: {3: {}}}})
)
else:
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[1].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({2: {121: {3: {}}}})
)
def test_route_receive_three_inputs_linked(self):
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_3_three_inputs_linked()
# will consume the event, create a new pending node but return no 'new_execution_contexts'
response = route.receive(create_incoming_signal(TestSignal.signal_internal_complex_1, [1, "y"]))
assert not response.new_execution_contexts
assert len(route._pending_nodes) == 1
# will consume the event, create a new pending node but return no 'new_execution_contexts'
response = route.receive(create_incoming_signal(TestSignal.signal_internal_complex_1, [2, "y"]))
assert not response.new_execution_contexts
assert len(route._pending_nodes) == 2
# EFFECT of linking
# incoming signal will not satisfy dimensional linking and will just create another node.
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [3]))
assert not response.new_execution_contexts
assert len(route._pending_nodes) == 3 # please note that it is 3 now!
# unleash the most recent node
response = route.receive(create_incoming_signal(TestSignal.signal_internal_complex_1, [3, "y"]))
assert len(response.new_execution_contexts) == 1
assert len(route._pending_nodes) == 2
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({121: {3: {}}})
)
# unleash the node that created first
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [1]))
assert len(response.new_execution_contexts) == 1
assert len(route._pending_nodes) == 1
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({121: {1: {}}})
)
# unleash the node that created second
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [2]))
assert len(response.new_execution_contexts) == 1
assert not route._pending_nodes # no remaining pending nodes!
assert DimensionFilter.check_equivalence(
response.new_execution_contexts[0].output.domain_spec.dimension_filter_spec, DimensionFilter.load_raw({121: {2: {}}})
)
def test_route_check_expired_nodes(self):
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_2_two_inputs_linked()
route = Route(
route.route_id,
route.link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
RouteExecutionHook(),
5, # seconds
RoutePendingNodeHook(),
)
route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
route.receive(create_incoming_signal(TestSignal.signal_internal_1, [2]))
assert len(route._pending_nodes) == 2
# send in a Signal that belongs to the second input but with different dim value
# will create another pending node since it is neither '1' nor '2' (linking is active).
response = route.receive(create_incoming_signal(TestSignal.signal_s3_1, [3]))
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 3 # please note that it is 3 now!
# Completions
# unleash the third pending node (which is pending on its first input with dim value 3)
route.receive(create_incoming_signal(TestSignal.signal_internal_1, [3]))
assert len(route._pending_nodes) == 2 # please note that it got back to 2!
# just make sure that it has been at least 5 seconds after the creation of those pending nodes.
time.sleep(5)
expired_nodes = route.check_expired_nodes()
assert len(expired_nodes) == 2
assert len(route._pending_nodes) == 0
def test_route_zombie_node_on_other_input_already_materialized(self):
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_2_two_inputs_linked()
# create new route to make sure that the second input is already materialized on value 3 [for dim_1_1]!
new_signal_link_node = SignalLinkNode(
[TestSignal.signal_internal_1, create_incoming_signal(TestSignal.signal_s3_1.clone("test_signal_from_S3"), [3])]
)
new_signal_link_node.compensate_missing_links()
route = Route(
route.route_id,
new_signal_link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
route.execution_hook,
route.pending_node_ttl_in_secs, # seconds
route.pending_node_hook,
)
# since second input is locked on 3, this event would yield a zombie node
# 1 != 3
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 1
assert next(iter(response.new_pending_nodes)).is_zombie
# same again 2 != 3
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [2]))
# since second input is locked on 3, this event would yield a zombie node
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 2
assert next(iter(response.new_pending_nodes)).is_zombie
# new pending node! 3 == 3
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [3]))
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 3
# new node should NOT be a zombie, waiting for TestSignal.signal_s3_1[3] to come in
assert not next(iter(response.new_pending_nodes)).is_zombie
def test_route_zombie_node_not_possible_when_inputs_unlinked(self):
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_2_two_inputs_linked()
# create new route to make sure that the second input is already materialized on value 3 [for dim_1_1]!
new_signal_link_node = SignalLinkNode(
[TestSignal.signal_internal_1, create_incoming_signal(TestSignal.signal_s3_1.clone("test_signal_from_S3"), [3])]
)
# UNLINKED !
# new_signal_link_node.compensate_missing_links()
route = Route(
route.route_id,
new_signal_link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
route.execution_hook,
route.pending_node_ttl_in_secs, # seconds
route.pending_node_hook,
)
# since second input is locked on 3, this event can NOT yield a zombie node since they are unlinked
# 1 != 3
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
assert not response.new_execution_contexts
assert len(response.new_pending_nodes) == 1
assert len(route._pending_nodes) == 1
assert not next(iter(response.new_pending_nodes)).is_zombie
def test_route_zombie_node_not_possible_when_other_is_a_materialized_reference_even_if_inputs_linked(self):
"""Actually yields execution immediately since the second input is a materialized reference"""
from test.intelliflow.core.signal_processing.signal.test_signal import TestSignal
route = self._route_2_two_inputs_linked()
# create new route to make sure that the second input is already materialized on value 3 [for dim_1_1]!
new_signal_link_node = SignalLinkNode(
[
TestSignal.signal_internal_1,
# materialized reference input
create_incoming_signal(TestSignal.signal_s3_1.clone("test_signal_from_S3").as_reference(), [3]),
]
)
# LINK !
new_signal_link_node.compensate_missing_links()
route = Route(
route.route_id,
new_signal_link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
route.execution_hook,
route.pending_node_ttl_in_secs,
route.pending_node_hook,
)
# although second input is locked on 3, this event can NOT yield a zombie node since it is a material reference.
# 1 != 3
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
# yields execution !
assert response.new_execution_contexts
assert len(response.new_pending_nodes) == 0
assert len(route._pending_nodes) == 0
# DONE
# We are actually done but let's show that even if they are unlinked, the result would not change.
new_signal_link_node = SignalLinkNode(
[
TestSignal.signal_internal_1,
# materialized reference input
create_incoming_signal(TestSignal.signal_s3_1.clone("test_signal_from_S3").as_reference(), [3]),
]
)
# UNLINK !
# new_signal_link_node.compensate_missing_links()
route = Route(
route.route_id,
new_signal_link_node,
route.output,
route._output_dim_matrix,
route.slots,
False,
route.execution_hook,
route.pending_node_ttl_in_secs,
route.pending_node_hook,
)
response = route.receive(create_incoming_signal(TestSignal.signal_internal_1, [1]))
# yields execution again!
assert response.new_execution_contexts
assert len(response.new_pending_nodes) == 0
assert len(route._pending_nodes) == 0
| 44.358491
| 138
| 0.636525
| 4,486
| 39,967
| 5.326349
| 0.076906
| 0.031807
| 0.037666
| 0.045702
| 0.861137
| 0.8282
| 0.813342
| 0.788315
| 0.774881
| 0.756508
| 0
| 0.017156
| 0.286837
| 39,967
| 900
| 139
| 44.407778
| 0.821142
| 0.129582
| 0
| 0.669944
| 0
| 0
| 0.020388
| 0.004383
| 0
| 0
| 0
| 0.001111
| 0.154494
| 1
| 0.032303
| false
| 0.001404
| 0.046348
| 0.001404
| 0.087079
| 0.002809
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
711dc29809114966ffd1a3a12882c04b3dd3d23a
| 49
|
py
|
Python
|
feedback/views/__init__.py
|
darkismus/kompassi
|
35dea2c7af2857a69cae5c5982b48f01ba56da1f
|
[
"CC-BY-3.0"
] | 13
|
2015-11-29T12:19:12.000Z
|
2021-02-21T15:42:11.000Z
|
feedback/views/__init__.py
|
darkismus/kompassi
|
35dea2c7af2857a69cae5c5982b48f01ba56da1f
|
[
"CC-BY-3.0"
] | 23
|
2015-04-29T19:43:34.000Z
|
2021-02-10T05:50:17.000Z
|
feedback/views/__init__.py
|
darkismus/kompassi
|
35dea2c7af2857a69cae5c5982b48f01ba56da1f
|
[
"CC-BY-3.0"
] | 11
|
2015-09-20T18:59:00.000Z
|
2020-02-07T08:47:34.000Z
|
from .feedback_view import feedback_view # noqa
| 24.5
| 48
| 0.816327
| 7
| 49
| 5.428571
| 0.714286
| 0.631579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 49
| 1
| 49
| 49
| 0.904762
| 0.081633
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 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
| 6
|
8570b07b4e9af91f0c08ffa94177023db3ec5f6a
| 81
|
py
|
Python
|
nbgrader/exchange/abc/fetch_feedback.py
|
omelnikov/nbgrader
|
66984e5732c98bd15733c027601a62fca6a46222
|
[
"BSD-3-Clause"
] | 1,116
|
2015-01-20T19:22:24.000Z
|
2022-03-31T22:05:10.000Z
|
nbgrader/exchange/abc/fetch_feedback.py
|
jld23/nbgrader
|
07a38cd8ed12ab33870bdd42f0bf35aa1252b0db
|
[
"BSD-3-Clause"
] | 1,166
|
2015-01-08T21:50:31.000Z
|
2022-03-31T05:15:01.000Z
|
nbgrader/exchange/abc/fetch_feedback.py
|
jld23/nbgrader
|
07a38cd8ed12ab33870bdd42f0bf35aa1252b0db
|
[
"BSD-3-Clause"
] | 337
|
2015-02-06T01:28:00.000Z
|
2022-03-29T06:52:38.000Z
|
from .exchange import Exchange
class ExchangeFetchFeedback(Exchange):
pass
| 13.5
| 38
| 0.790123
| 8
| 81
| 8
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.160494
| 81
| 5
| 39
| 16.2
| 0.941176
| 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
| 1
| 0
|
0
| 6
|
85b9df7e5df2c3700d38f73b5d3eb34cddac9dcb
| 31
|
py
|
Python
|
schoolInfo/school/schedule/__init__.py
|
sunrabbit123/school-info_python
|
e2fbe928d6f024c6ec2f86b109833595dbdbb294
|
[
"MIT"
] | null | null | null |
schoolInfo/school/schedule/__init__.py
|
sunrabbit123/school-info_python
|
e2fbe928d6f024c6ec2f86b109833595dbdbb294
|
[
"MIT"
] | 1
|
2021-05-09T12:51:37.000Z
|
2021-05-17T14:36:23.000Z
|
schoolInfo/school/schedule/__init__.py
|
sunrabbit123/school-info_python
|
e2fbe928d6f024c6ec2f86b109833595dbdbb294
|
[
"MIT"
] | null | null | null |
from .schedule import schedule
| 15.5
| 30
| 0.83871
| 4
| 31
| 6.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 31
| 1
| 31
| 31
| 0.962963
| 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
| 1
| 0
|
0
| 6
|
a42e9d2a1e7a9cf3db47e508fb6f4bf89cb81693
| 5,486
|
py
|
Python
|
strategies/go_to_incarnam.py
|
ProjectBlackFalcon/BlackFalconCore
|
23af1829224738c06092e3e513a0bf2753b4c35f
|
[
"MIT"
] | 8
|
2019-05-26T19:44:28.000Z
|
2021-01-31T14:53:17.000Z
|
strategies/go_to_incarnam.py
|
ProjectBlackFalcon/BlackFalconCore
|
23af1829224738c06092e3e513a0bf2753b4c35f
|
[
"MIT"
] | 8
|
2019-07-17T21:19:47.000Z
|
2019-09-28T12:52:39.000Z
|
strategies/go_to_incarnam.py
|
ProjectBlackFalcon/BlackFalconCore
|
23af1829224738c06092e3e513a0bf2753b4c35f
|
[
"MIT"
] | null | null | null |
import json
import time
from tools import logger as log
import strategies
def go_to_incarnam(**kwargs):
"""
A strategy to go from Astrub to Incarnam trough the portal
:param kwargs: strategy, listener, and orders_queue
:return: the input strategy with a report
"""
strategy = kwargs['strategy']
listener = kwargs['listener']
orders_queue = kwargs['orders_queue']
assets = kwargs['assets']
logger = log.get_logger(__name__, strategy['bot'])
global_start, start = time.time(), time.time()
# Enter the portal room
door_skill_id = 184
element_id, skill_uid = None, None
for element in listener.game_state['map_elements']:
if 'enabledSkills' in element.keys():
for skill in element['enabledSkills']:
if 'skillId' in skill.keys() and skill['skillId'] == door_skill_id:
element_id = element['elementId']
skill_uid = skill['skillInstanceUid']
if element_id is None or skill_uid is None:
logger.warn('Failed entering the portal room in {}s'.format(0))
strategy['report'] = {
'success': False,
'details': {'Execution time': 0, 'Reason': 'Could not find skill UID or element id'}
}
log.close_logger(logger)
return strategy
order = {
'command': 'use_interactive',
'parameters': {
'element_id': element_id,
'skill_uid': skill_uid
}
}
logger.info('Sending order to bot API: {}'.format(order))
orders_queue.put((json.dumps(order),))
start = time.time()
timeout = 10 if 'timeout' not in strategy.keys() else strategy['timeout']
waiting = True
while waiting and time.time() - start < timeout:
if 'pos' in listener.game_state.keys():
if listener.game_state['map_id'] == 192416776:
waiting = False
time.sleep(0.05)
execution_time = time.time() - start
if waiting:
logger.warn('Failed entering the portal room in {}s'.format(execution_time))
strategy['report'] = {
'success': False,
'details': {'Execution time': execution_time, 'Reason': 'Timeout'}
}
log.close_logger(logger)
return strategy
logger.info('Entered the portal room in {}s'.format(execution_time))
# Go to cell 468
order = {
'command': 'move',
'parameters': {
"isUsingNewMovementSystem": False,
"cells": [[True, False, 0, 0, True, 0] for _ in range(560)],
"target_cell": 468
}
}
logger.info('Sending order to bot API: {}'.format(order))
orders_queue.put((json.dumps(order),))
start = time.time()
timeout = 10 if 'timeout' not in strategy.keys() else strategy['timeout']
waiting = True
while waiting and time.time() - start < timeout:
if 'pos' in listener.game_state.keys() and 'worldmap' in listener.game_state.keys():
if listener.game_state['cell'] == 468:
waiting = False
time.sleep(0.05)
execution_time = time.time() - start
if waiting:
logger.warning('Failed going to cell 468 in {}s'.format(execution_time))
strategy['report'] = {
'success': False,
'details': {'Execution time': execution_time, 'Reason': 'Timeout'}
}
log.close_logger(logger)
return strategy
# Use the portal
door_skill_id = 184
element_id, skill_uid = None, None
for element in listener.game_state['map_elements']:
if 'enabledSkills' in element.keys():
for skill in element['enabledSkills']:
if 'skillId' in skill.keys() and skill['skillId'] == door_skill_id:
element_id = element['elementId']
skill_uid = skill['skillInstanceUid']
if element_id is None or skill_uid is None:
logger.warn('Failed entering the portal room in {}s'.format(0))
strategy['report'] = {
'success': False,
'details': {'Execution time': 0, 'Reason': 'Could not find skill UID or element id'}
}
log.close_logger(logger)
return strategy
order = {
'command': 'use_interactive',
'parameters': {
'element_id': element_id,
'skill_uid': skill_uid
}
}
logger.info('Sending order to bot API: {}'.format(order))
orders_queue.put((json.dumps(order),))
start = time.time()
timeout = 10 if 'timeout' not in strategy.keys() else strategy['timeout']
waiting = True
while waiting and time.time() - start < timeout:
if 'pos' in listener.game_state.keys():
if listener.game_state['worldmap'] == 2:
waiting = False
time.sleep(0.05)
execution_time = time.time() - start
if waiting:
logger.warning('Failed going through the portal from Incarnam to Astrub in {}s'.format(execution_time))
strategy['report'] = {
'success': False,
'details': {'Execution time': execution_time, 'Reason': 'Timeout'}
}
log.close_logger(logger)
return strategy
execution_time = time.time() - global_start
logger.info('Went from Astrub to Incarnam in {}s'.format(execution_time))
strategy['report'] = {
'success': True,
'details': {'Execution time': execution_time}
}
log.close_logger(logger)
return strategy
| 34.503145
| 111
| 0.595151
| 644
| 5,486
| 4.948758
| 0.167702
| 0.077502
| 0.048008
| 0.03577
| 0.787888
| 0.777534
| 0.766865
| 0.766865
| 0.742391
| 0.729212
| 0
| 0.013476
| 0.283084
| 5,486
| 158
| 112
| 34.721519
| 0.796847
| 0.03755
| 0
| 0.70229
| 0
| 0
| 0.21279
| 0.004568
| 0
| 0
| 0
| 0
| 0
| 1
| 0.007634
| false
| 0
| 0.030534
| 0
| 0.083969
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 6
|
a42f7f668f38670d489c9bdb6a6b76503b566b68
| 26
|
py
|
Python
|
get_decks_ids/__init__.py
|
sarajaksa/anki-addons
|
01e4cedca0cca1df11202c52c473a8c35eb5f0b8
|
[
"Unlicense"
] | 3
|
2017-03-05T21:53:06.000Z
|
2019-03-13T09:50:19.000Z
|
get_decks_ids/__init__.py
|
sarajaksa/anki-addons
|
01e4cedca0cca1df11202c52c473a8c35eb5f0b8
|
[
"Unlicense"
] | 3
|
2017-03-04T16:24:15.000Z
|
2018-11-14T15:20:49.000Z
|
get_decks_ids/__init__.py
|
sarajaksa/anki-addons
|
01e4cedca0cca1df11202c52c473a8c35eb5f0b8
|
[
"Unlicense"
] | 1
|
2019-05-12T10:46:25.000Z
|
2019-05-12T10:46:25.000Z
|
from . import get_deck_id
| 13
| 25
| 0.807692
| 5
| 26
| 3.8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 26
| 1
| 26
| 26
| 0.863636
| 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
| 1
| 0
|
0
| 6
|
a44fcaf72af452eb78dae46d1d49a2249dd7f3c4
| 143
|
py
|
Python
|
week1/2.py
|
kamorozov/coursera_python
|
706bc1bc46839f8b3debdf293240ad5ce20c9775
|
[
"Unlicense"
] | 2
|
2019-05-17T13:42:02.000Z
|
2019-05-18T04:00:35.000Z
|
week1/2.py
|
kamorozov/coursera_python
|
706bc1bc46839f8b3debdf293240ad5ce20c9775
|
[
"Unlicense"
] | null | null | null |
week1/2.py
|
kamorozov/coursera_python
|
706bc1bc46839f8b3debdf293240ad5ce20c9775
|
[
"Unlicense"
] | 2
|
2019-10-03T09:07:44.000Z
|
2019-12-28T19:17:20.000Z
|
n = int(input())
print(' _~_ ' * n)
print(' (o o) ' * n)
print(' / V \ ' * n)
print('/( _ )\ ' * n)
print(' ^^ ^^ ' * n)
| 20.428571
| 24
| 0.314685
| 16
| 143
| 2.625
| 0.375
| 0.571429
| 0.52381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.384615
| 143
| 6
| 25
| 23.833333
| 0.477273
| 0
| 0
| 0
| 0
| 0
| 0.364964
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.833333
| 1
| 0
| 0
| null | 1
| 1
| 0
| 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
| 1
|
0
| 6
|
f13146176d51f8cb1731e866ee6731f529600270
| 97
|
py
|
Python
|
setup.py
|
souravdatta/words
|
1d4d8e5f192b24b2c734d839fe3eaa540256e2ed
|
[
"MIT"
] | null | null | null |
setup.py
|
souravdatta/words
|
1d4d8e5f192b24b2c734d839fe3eaa540256e2ed
|
[
"MIT"
] | null | null | null |
setup.py
|
souravdatta/words
|
1d4d8e5f192b24b2c734d839fe3eaa540256e2ed
|
[
"MIT"
] | null | null | null |
# Py2Exe setup file
from distutils.core import setup
import py2exe
setup(console=['words.py'])
| 13.857143
| 32
| 0.762887
| 14
| 97
| 5.285714
| 0.714286
| 0.297297
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02381
| 0.134021
| 97
| 6
| 33
| 16.166667
| 0.857143
| 0.175258
| 0
| 0
| 0
| 0
| 0.103896
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 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
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
f13ba3b7c19b139da995ed439ad5c64bd1341cb8
| 3,020
|
py
|
Python
|
TestSlice6.py
|
TecnicoSSof/Software-Security
|
9c31f5f59a1d1c21c2c9876d09bbbd9823d96357
|
[
"Apache-2.0"
] | null | null | null |
TestSlice6.py
|
TecnicoSSof/Software-Security
|
9c31f5f59a1d1c21c2c9876d09bbbd9823d96357
|
[
"Apache-2.0"
] | null | null | null |
TestSlice6.py
|
TecnicoSSof/Software-Security
|
9c31f5f59a1d1c21c2c9876d09bbbd9823d96357
|
[
"Apache-2.0"
] | null | null | null |
import os
import unittest
from searcher.Vulnerability import Vulnerability
from searcher.Searcher import Searcher
import json
from static_analyzer import file_get_contents
class TestSlice6(unittest.TestCase):
def test_rules(self):
parsed_snippet = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/slice6.json"))
parsed_rules = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/rules.json"))
output = open(os.getcwd() + "/tests/slice6/slice6_rules.out", "r")
vulnerabilities = Vulnerability.build_vulnerabilities(parsed_rules)
s = Searcher(parsed_snippet['body'], vulnerabilities)
self.assertEqual(s.get_vulnerabilities_str(), output.read(), "Should be equal")
output.close()
def test_rules2(self):
parsed_snippet = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/slice6.json"))
parsed_rules = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/rules2.json"))
output = open(os.getcwd() + "/tests/slice6/slice6_rules2.out", "r")
vulnerabilities = Vulnerability.build_vulnerabilities(parsed_rules)
s = Searcher(parsed_snippet['body'], vulnerabilities)
self.assertEqual(s.get_vulnerabilities_str(), output.read(), "Should be equal")
output.close()
def test_rules3(self):
parsed_snippet = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/slice6.json"))
parsed_rules = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/rules3.json"))
output = open(os.getcwd() + "/tests/slice6/slice6_rules3.out", "r")
vulnerabilities = Vulnerability.build_vulnerabilities(parsed_rules)
s = Searcher(parsed_snippet['body'], vulnerabilities)
self.assertEqual(s.get_vulnerabilities_str(), output.read(), "Should be equal")
output.close()
def test_rulesNoVuln(self):
parsed_snippet = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/slice6.json"))
parsed_rules = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/rulesNoVuln.json"))
output = open(os.getcwd() + "/tests/slice6/slice6_rulesNoVuln.out", "r")
vulnerabilities = Vulnerability.build_vulnerabilities(parsed_rules)
s = Searcher(parsed_snippet['body'], vulnerabilities)
self.assertEqual(s.get_vulnerabilities_str(), output.read(), "Should be equal")
output.close()
def test_rulesSanit(self):
parsed_snippet = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/slice6.json"))
parsed_rules = json.loads(file_get_contents(os.getcwd() + "/tests/slice6/rulesSanit.json"))
output = open(os.getcwd() + "/tests/slice6/slice6_rulesSanit.out", "r")
vulnerabilities = Vulnerability.build_vulnerabilities(parsed_rules)
s = Searcher(parsed_snippet['body'], vulnerabilities)
self.assertEqual(s.get_vulnerabilities_str(), output.read(), "Should be equal")
output.close()
if __name__ == '__main__':
unittest.main()
| 50.333333
| 100
| 0.700993
| 357
| 3,020
| 5.717087
| 0.131653
| 0.058795
| 0.095541
| 0.139637
| 0.841744
| 0.841744
| 0.841744
| 0.841744
| 0.746203
| 0.746203
| 0
| 0.012668
| 0.163576
| 3,020
| 59
| 101
| 51.186441
| 0.795329
| 0
| 0
| 0.510204
| 0
| 0
| 0.175166
| 0.139404
| 0
| 0
| 0
| 0
| 0.102041
| 1
| 0.102041
| false
| 0
| 0.122449
| 0
| 0.244898
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
f14b4723145eab9e4983e1e31682b70ef51514f9
| 38,348
|
py
|
Python
|
tests/test_worldpop.py
|
mcarans/hdxscraper-worldpop
|
dcfd73df5af2fffb927a6ad39129f744a6f5debb
|
[
"MIT"
] | 1
|
2017-09-02T15:07:43.000Z
|
2017-09-02T15:07:43.000Z
|
tests/test_worldpop.py
|
mcarans/hdxscraper-worldpop
|
dcfd73df5af2fffb927a6ad39129f744a6f5debb
|
[
"MIT"
] | 1
|
2021-09-21T15:44:59.000Z
|
2021-09-22T22:47:42.000Z
|
tests/test_worldpop.py
|
mcarans/hdxscraper-worldpop
|
dcfd73df5af2fffb927a6ad39129f744a6f5debb
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
"""
Unit tests for worldpop.
"""
from os.path import join
import pytest
from hdx.data.vocabulary import Vocabulary
from hdx.hdx_configuration import Configuration
from hdx.hdx_locations import Locations
from hdx.location.country import Country
from worldpop import (
generate_datasets_and_showcases,
get_countriesdata,
get_indicators_metadata,
)
class TestWorldPop:
indicators_metadata = [
{
"alias": "pop",
"name": "Population",
"title": "Population",
"desc": "WorldPop produces different types of gridded population count datasets...",
},
{
"alias": "births",
"name": "Births",
"title": "Births",
"desc": "The health and survival of women and their new-born babies in low income countries is a key public health priority...",
},
{
"alias": "pregnancies",
"name": "Pregnancies",
"title": "Pregnancies",
"desc": "The health and survival of women and their new-born babies in low income countries is a key public health priority...",
},
{
"alias": "age_structures",
"name": "Age and sex structures",
"title": "Age and sex structures",
"desc": "Age and sex structures: WorldPop produces different types of gridded population count datasets...",
},
]
countriesdata = {
"AUS": {
"pop": {
"wpgp": ["http://papa/getJSON/pop/wpgp?iso3=AUS"],
"wpgpunadj": ["http://papa/getJSON/pop/wpgpunadj?iso3=AUS"],
}
},
"BRA": {
"pop": {
"wpgp": ["http://papa/getJSON/pop/wpgp?iso3=BRA"],
"wpgpunadj": ["http://papa/getJSON/pop/wpgpunadj?iso3=BRA"],
}
},
"CAN": {
"pop": {
"wpgp": ["http://papa/getJSON/pop/wpgp?iso3=CAN"],
"wpgpunadj": ["http://papa/getJSON/pop/wpgpunadj?iso3=CAN"],
}
},
"RUS": {
"pop": {
"wpgp": ["http://papa/getJSON/pop/wpgp?iso3=RUS"],
"wpgpunadj": ["http://papa/getJSON/pop/wpgpunadj?iso3=RUS"],
}
},
"World": {
"pop": {
"wpgp1km": [
"http://papa/getJSON/pop/wpgp1km?id=24776",
"http://papa/getJSON/pop/wpgp1km?id=24777",
]
}
},
"ZWE": {
"pop": {
"wpgp": ["http://papa/getJSON/pop/wpgp?iso3=ZWE"],
"wpgpunadj": ["http://papa/getJSON/pop/wpgpunadj?iso3=ZWE"],
}
},
}
wpgpdata = [
{"id": "1325", "iso3": "AUS"},
{"id": "1326", "iso3": "RUS"},
{"id": "1327", "iso3": "BRA"},
{"id": "1328", "iso3": "CAN"},
{"id": "1482", "iso3": "ZWE"},
]
wpgpunadjdata = [
{"id": "13251", "iso3": "AUS"},
{"id": "13261", "iso3": "RUS"},
{"id": "13271", "iso3": "BRA"},
{"id": "13281", "iso3": "CAN"},
{"id": "14821", "iso3": "ZWE"},
]
metadata = [
{
"id": "1482",
"title": "The spatial distribution of population in 2000, Zimbabwe",
"desc": "Estimated total number of people per grid-cell.",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2000",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2000/ZWE/zwe_ppp_2000.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2000/ZWE/zwe_ppp_2000.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/1482/zwe_ppp_wpgp_2000_Image.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=1482",
},
{
"id": "1731",
"title": "The spatial distribution of population in 2001, Zimbabwe",
"desc": "Estimated total number of people per grid-cell.",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2001",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2001/ZWE/zwe_ppp_2001.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2001/ZWE/zwe_ppp_2001.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/1731/zwe_ppp_wpgp_2001_Image.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=1731",
},
{
"id": "3474",
"title": "The spatial distribution of population in 2008, Zimbabwe",
"desc": "Estimated total number of people per grid-cell.",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2008",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2008/ZWE/zwe_ppp_2008.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2008/ZWE/zwe_ppp_2008.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/3474/zwe_ppp_wpgp_2008_Image.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=3474",
},
{
"id": "4711",
"title": "The spatial distribution of population in 2013, Zimbabwe",
"desc": "Estimated total number of people per grid-cell.",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2013",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2013/ZWE/zwe_ppp_2013.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2013/ZWE/zwe_ppp_2013.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/4711/zwe_ppp_wpgp_2013_Image.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=4711",
},
{
"id": "6205",
"title": "The spatial distribution of population in 2019, Zimbabwe",
"desc": "Estimated total number of people per grid-cell.",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2019",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2019/ZWE/zwe_ppp_2019.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2019/ZWE/zwe_ppp_2019.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/6205/zwe_ppp_wpgp_2019_Image.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=6205",
},
{
"id": "6454",
"title": "The spatial distribution of population in 2020, Zimbabwe",
"desc": "Estimated total number of people per grid-cell.",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2020",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2020/ZWE/zwe_ppp_2020.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2020/ZWE/zwe_ppp_2020.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/6454/zwe_ppp_wpgp_2020_Image.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=6454",
},
]
metadataunadj = [
{
"id": "14821",
"title": "The spatial distribution of population in 2000 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"desc": "Estimated total number of people per grid-cell. UNAdj",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2000",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2000/ZWE/zwe_ppp_2000.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 UN adjusted ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2000/ZWE/zwe_ppp_2000_UNadj.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/1482/zwe_ppp_wpgp_2000_Image_UNadj.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=14821",
},
{
"id": "17311",
"title": "The spatial distribution of population in 2001 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"desc": "Estimated total number of people per grid-cell. UNAdj",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2001",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2001/ZWE/zwe_ppp_2001.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 UN adjusted ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2001/ZWE/zwe_ppp_2001_UNadj.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/1731/zwe_ppp_wpgp_2001_Image_UNadj.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=17311",
},
{
"id": "34741",
"title": "The spatial distribution of population in 2008 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"desc": "Estimated total number of people per grid-cell. UNAdj",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2008",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2008/ZWE/zwe_ppp_2008.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 UN adjusted ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2008/ZWE/zwe_ppp_2008_UNadj.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/3474/zwe_ppp_wpgp_2008_Image_UNadj.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=34741",
},
{
"id": "47111",
"title": "The spatial distribution of population in 2013 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"desc": "Estimated total number of people per grid-cell. UNAdj",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2013",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2013/ZWE/zwe_ppp_2013.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 UN adjusted ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2013/ZWE/zwe_ppp_2013_UNadj.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/4711/zwe_ppp_wpgp_2013_Image_UNadj.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=47111",
},
{
"id": "62051",
"title": "The spatial distribution of population in 2019 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"desc": "Estimated total number of people per grid-cell. UNAdj",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2019",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2019/ZWE/zwe_ppp_2019.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 UN adjusted ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2019/ZWE/zwe_ppp_2019_UNadj.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/6205/zwe_ppp_wpgp_2019_Image_UNadj.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=62051",
},
{
"id": "64541",
"title": "The spatial distribution of population in 2020 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"desc": "Estimated total number of people per grid-cell. UNAdj",
"doi": "10.5258/SOTON/WP00645",
"date": "2018-11-01",
"popyear": "2020",
"citation": "WorldPop",
"data_file": "GIS/Population/Global_2000_2020/2020/ZWE/zwe_ppp_2020.tif",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "geotiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Individual countries 2000-2020 UN adjusted ( 100m resolution )",
"gtype": "Population",
"continent": "Africa",
"country": "Zimbabwe",
"iso3": "ZWE",
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2020/ZWE/zwe_ppp_2020_UNadj.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/6454/zwe_ppp_wpgp_2020_Image_UNadj.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=64541",
},
]
wpgp1kmdata = [{"id": "24776"}, {"id": "24777"}]
metadata_24777 = {
"id": "24777",
"title": "The spatial distribution of population in 2020",
"desc": "Estimated total number of people per grid-cell...\r\n",
"doi": "10.5258/SOTON/WP00647",
"date": "0018-02-01",
"popyear": "2020",
"citation": "WorldPop...\r\n",
"data_file": "GIS/Population/Global_2000_2020/2020/0_Mosaicked/ppp_2020_1km_Aggregated.tif",
"file_img": "world_ppp_wpgp_2020_Image.png",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "tiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Global mosaics 2000-2020",
"gtype": "Population",
"continent": "World",
"country": None,
"iso3": None,
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2020/0_Mosaicked/ppp_2020_1km_Aggregated.tif"
],
"url_img": "",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=24777",
}
metadata_24776 = {
"id": "24776",
"title": "The spatial distribution of population in 2019",
"desc": "Estimated total number of people per grid-cell...\r\n",
"doi": "10.5258/SOTON/WP00647",
"date": "2018-11-01",
"popyear": "2019",
"citation": "WorldPop...\r\n",
"data_file": "GIS/Population/Global_2000_2020/2019/0_Mosaicked/ppp_2019_1km_Aggregated.tif",
"file_img": "world_ppp_wpgp_2019_Image.png",
"archive": "N",
"public": "Y",
"source": "WorldPop, University of Southampton, UK",
"data_format": "tiff",
"author_email": "[email protected]",
"author_name": "WorldPop",
"maintainer_name": "WorldPop",
"maintainer_email": "[email protected]",
"project": "Population",
"category": "Global mosaics 2000-2020",
"gtype": "Population",
"continent": "World",
"country": None,
"iso3": None,
"files": [
"ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2019/0_Mosaicked/ppp_2019_1km_Aggregated.tif"
],
"url_img": "https://www.worldpop.org/tabs/gdata/img/24776/world_ppp_wpgp_2019_Image.png",
"organisation": "WorldPop, University of Southampton, UK, www.worldpop.org",
"license": "https://www.worldpop.org/data/licence.txt",
"url_summary": "https://www.worldpop.org/geodata/summary?id=24776",
}
@pytest.fixture(scope="function")
def configuration(self):
Configuration._create(
hdx_read_only=True,
user_agent="test",
project_config_yaml=join("tests", "config", "project_configuration.yml"),
)
Locations.set_validlocations(
[{"name": "zwe", "title": "Zimbabwe"}, {"name": "world", "title": "World"}]
)
Country.countriesdata(use_live=False)
Vocabulary._tags_dict = True
Vocabulary._approved_vocabulary = {
"tags": [{"name": "population"}, {"name": "geodata"}],
"id": "4e61d464-4943-4e97-973a-84673c1aaa87",
"name": "approved",
}
return Configuration.read()
@pytest.fixture(scope="function")
def downloader(self):
class Download:
url = None
@classmethod
def download(cls, url):
cls.url = url
@classmethod
def get_json(cls):
if cls.url == "http://lala/getJSON/":
return {"data": TestWorldPop.indicators_metadata}
elif cls.url == "http://papa/getJSON/pop/wpgp":
return {"data": TestWorldPop.wpgpdata}
elif cls.url == "http://papa/getJSON/pop/wpgpunadj":
return {"data": TestWorldPop.wpgpunadjdata}
elif cls.url == "http://papa/getJSON/pop/wpgp1km":
return {"data": TestWorldPop.wpgp1kmdata}
elif cls.url == "http://papa/getJSON/pop/wpgp?iso3=ZWE":
return {"data": TestWorldPop.metadata}
elif cls.url == "http://papa/getJSON/pop/wpgpunadj?iso3=ZWE":
return {"data": TestWorldPop.metadataunadj}
elif cls.url == "http://papa/getJSON/pop/wpgp1km?id=24776":
return {"data": TestWorldPop.metadata_24776}
elif cls.url == "http://papa/getJSON/pop/wpgp1km?id=24777":
return {"data": TestWorldPop.metadata_24777}
@staticmethod
def get_text():
return (
"The WorldPop project aims to provide an open access archive of spatial "
"demographic datasets ... at creativecommons.org."
)
return Download()
def test_get_indicators_metadata(self, configuration, downloader):
indicators = configuration["indicators"]
indicators_metadata = get_indicators_metadata(
"http://lala/getJSON/", downloader, indicators
)
assert "pop" in indicators_metadata.keys()
assert sorted(
list(indicators_metadata.values()), key=lambda k: k["alias"]
) == sorted(TestWorldPop.indicators_metadata, key=lambda k: k["alias"])
def test_get_countriesdata(self, configuration, downloader):
indicators = configuration["indicators"]
cutdownindicators = {"pop": indicators["pop"]}
countriesdata, countries = get_countriesdata(
"http://papa/getJSON/", downloader, cutdownindicators
)
assert countriesdata == TestWorldPop.countriesdata
assert countries == [
{"iso3": "AUS"},
{"iso3": "BRA"},
{"iso3": "CAN"},
{"iso3": "RUS"},
{"iso3": "ZWE"},
{"iso3": "World"},
]
def test_generate_datasets_and_showcases(self, configuration, downloader):
indicators_metadata = {"pop": TestWorldPop.indicators_metadata[0]}
countryiso = "World"
countrydata = TestWorldPop.countriesdata[countryiso]
datasets, showcases = generate_datasets_and_showcases(
downloader, countryiso, indicators_metadata, countrydata
)
dataset = datasets[0]
assert dataset == {
"name": "worldpop-population-for-world",
"title": "World - Population",
"notes": "WorldPop produces different types of gridded population count datasets... \nData for earlier dates is available directly from WorldPop. \n \nWorldPop...\r\n",
"methodology": "Other",
"methodology_other": "Estimated total number of people per grid-cell...\r\n",
"dataset_source": "WorldPop, University of Southampton, UK",
"license_id": "hdx-other",
"license_other": "The WorldPop project aims to provide an open access archive of spatial demographic datasets ... at creativecommons.org.",
"private": False,
"maintainer": "37023db4-a571-4f28-8d1f-15f0353586af",
"owner_org": "3f077dff-1d05-484d-a7c2-4cb620f22689",
"data_update_frequency": "365",
"subnational": "1",
"groups": [{"name": "world"}],
"tags": [
{
"name": "population",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
{
"name": "geodata",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
],
"dataset_date": "[2019-01-01T00:00:00 TO 2020-12-31T00:00:00]",
}
resources = dataset.get_resources()
assert resources == [
{
"name": "ppp_2020_1km_Aggregated.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2020/0_Mosaicked/ppp_2020_1km_Aggregated.tif",
"description": "The spatial distribution of population in 2020",
"resource_type": "api",
"url_type": "api",
},
{
"name": "ppp_2019_1km_Aggregated.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2019/0_Mosaicked/ppp_2019_1km_Aggregated.tif",
"description": "The spatial distribution of population in 2019",
"resource_type": "api",
"url_type": "api",
},
]
showcase = next(iter(showcases.values()))[0]
assert showcase == {
"name": "worldpop-population-for-world-showcase",
"title": "WorldPop World Population Summary Page",
"notes": "Summary for Global mosaics 2000-2020 - World",
"url": "https://www.worldpop.org/geodata/summary?id=24777",
"image_url": "https://www.worldpop.org/tabs/gdata/img/24776/world_ppp_wpgp_2019_Image.png",
"tags": [
{
"name": "population",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
{
"name": "geodata",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
],
}
countryiso = "ZWE"
countrydata = TestWorldPop.countriesdata[countryiso]
datasets, showcases = generate_datasets_and_showcases(
downloader, countryiso, indicators_metadata, countrydata
)
dataset = datasets[0]
assert dataset == {
"name": "worldpop-population-for-zimbabwe",
"title": "Zimbabwe - Population",
"notes": "WorldPop produces different types of gridded population count datasets... \nData for earlier dates is available directly from WorldPop. \n \nWorldPop",
"methodology": "Other",
"methodology_other": "Estimated total number of people per grid-cell. UNAdj",
"dataset_source": "WorldPop, University of Southampton, UK",
"license_id": "hdx-other",
"license_other": "The WorldPop project aims to provide an open access archive of spatial demographic datasets ... at creativecommons.org.",
"private": False,
"maintainer": "37023db4-a571-4f28-8d1f-15f0353586af",
"owner_org": "3f077dff-1d05-484d-a7c2-4cb620f22689",
"data_update_frequency": "365",
"subnational": "1",
"groups": [{"name": "zwe"}],
"tags": [
{
"name": "population",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
{
"name": "geodata",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
],
"dataset_date": "[2000-01-01T00:00:00 TO 2020-12-31T00:00:00]",
}
resources = dataset.get_resources()
assert resources == [
{
"name": "zwe_ppp_2020.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2020/ZWE/zwe_ppp_2020.tif",
"description": "The spatial distribution of population in 2020, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2020_UNadj.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2020/ZWE/zwe_ppp_2020_UNadj.tif",
"description": "The spatial distribution of population in 2020 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2019.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2019/ZWE/zwe_ppp_2019.tif",
"description": "The spatial distribution of population in 2019, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2019_UNadj.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2019/ZWE/zwe_ppp_2019_UNadj.tif",
"description": "The spatial distribution of population in 2019 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2013.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2013/ZWE/zwe_ppp_2013.tif",
"description": "The spatial distribution of population in 2013, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2013_UNadj.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2013/ZWE/zwe_ppp_2013_UNadj.tif",
"description": "The spatial distribution of population in 2013 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2008.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2008/ZWE/zwe_ppp_2008.tif",
"description": "The spatial distribution of population in 2008, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2008_UNadj.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2008/ZWE/zwe_ppp_2008_UNadj.tif",
"description": "The spatial distribution of population in 2008 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2001.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2001/ZWE/zwe_ppp_2001.tif",
"description": "The spatial distribution of population in 2001, Zimbabwe",
"resource_type": "api",
"url_type": "api",
},
{
"name": "zwe_ppp_2001_UNadj.tif",
"format": "geotiff",
"url": "ftp://ftp.worldpop.org.uk/GIS/Population/Global_2000_2020/2001/ZWE/zwe_ppp_2001_UNadj.tif",
"description": "The spatial distribution of population in 2001 with country total adjusted to match the corresponding UNPD estimate, Zimbabwe",
"resource_type": "api",
"url_type": "api",
}
]
showcase = next(iter(showcases.values()))[0]
assert showcase == {
"name": "worldpop-population-for-zimbabwe-showcase",
"title": "WorldPop Zimbabwe Population Summary Page",
"notes": "Summary for Individual countries 2000-2020 ( 100m resolution ) - Zimbabwe",
"url": "https://www.worldpop.org/geodata/summary?id=6454",
"image_url": "https://www.worldpop.org/tabs/gdata/img/6454/zwe_ppp_wpgp_2020_Image.png",
"tags": [
{
"name": "population",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
{
"name": "geodata",
"vocabulary_id": "4e61d464-4943-4e97-973a-84673c1aaa87",
},
],
}
| 45.81601
| 183
| 0.541541
| 3,858
| 38,348
| 5.250648
| 0.075687
| 0.046157
| 0.040776
| 0.042208
| 0.881177
| 0.871254
| 0.859555
| 0.841734
| 0.795577
| 0.769067
| 0
| 0.078749
| 0.311229
| 38,348
| 836
| 184
| 45.870813
| 0.688184
| 0.001069
| 0
| 0.544895
| 0
| 0.03936
| 0.541125
| 0.112982
| 0
| 0
| 0
| 0
| 0.0123
| 1
| 0.00984
| false
| 0
| 0.00861
| 0.00123
| 0.04551
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
f18bd24ea799cc66f95a6e5ba34ff5211de2b387
| 30
|
py
|
Python
|
time_execution/__init__.py
|
snelis/py-timeexecution
|
f08bf6b9c5307a50b3ee1190f79bf74dc920f8da
|
[
"Apache-2.0"
] | null | null | null |
time_execution/__init__.py
|
snelis/py-timeexecution
|
f08bf6b9c5307a50b3ee1190f79bf74dc920f8da
|
[
"Apache-2.0"
] | null | null | null |
time_execution/__init__.py
|
snelis/py-timeexecution
|
f08bf6b9c5307a50b3ee1190f79bf74dc920f8da
|
[
"Apache-2.0"
] | null | null | null |
from .time_execution import *
| 15
| 29
| 0.8
| 4
| 30
| 5.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 30
| 1
| 30
| 30
| 0.884615
| 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
| 1
| 0
|
0
| 6
|
74ce8c8a200f28440567b9bb992acb489cd7d1a9
| 107
|
py
|
Python
|
office365/sharepoint/utilities/wopi_web_app_properties.py
|
rikeshtailor/Office365-REST-Python-Client
|
ca7bfa1b22212137bb4e984c0457632163e89a43
|
[
"MIT"
] | 544
|
2016-08-04T17:10:16.000Z
|
2022-03-31T07:17:20.000Z
|
office365/sharepoint/utilities/wopi_web_app_properties.py
|
rikeshtailor/Office365-REST-Python-Client
|
ca7bfa1b22212137bb4e984c0457632163e89a43
|
[
"MIT"
] | 438
|
2016-10-11T12:24:22.000Z
|
2022-03-31T19:30:35.000Z
|
office365/sharepoint/utilities/wopi_web_app_properties.py
|
rikeshtailor/Office365-REST-Python-Client
|
ca7bfa1b22212137bb4e984c0457632163e89a43
|
[
"MIT"
] | 202
|
2016-08-22T19:29:40.000Z
|
2022-03-30T20:26:15.000Z
|
from office365.runtime.client_value import ClientValue
class WopiWebAppProperties(ClientValue):
pass
| 17.833333
| 54
| 0.831776
| 11
| 107
| 8
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.031915
| 0.121495
| 107
| 5
| 55
| 21.4
| 0.904255
| 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
| 1
| 0
|
0
| 6
|
74dbc6e6353172f4c10b84fea774baef4a531397
| 95
|
py
|
Python
|
src/sementeira/iii_controllers/pesquisar_pessoa.py
|
torraodocerrado/sementeira
|
962d15bef63a73493b8cf29a22b656f19aa161ff
|
[
"Apache-2.0"
] | 2
|
2021-02-25T23:52:40.000Z
|
2021-02-25T23:52:42.000Z
|
src/sementeira/iii_controllers/pesquisar_pessoa.py
|
torraodocerrado/sementeira
|
962d15bef63a73493b8cf29a22b656f19aa161ff
|
[
"Apache-2.0"
] | null | null | null |
src/sementeira/iii_controllers/pesquisar_pessoa.py
|
torraodocerrado/sementeira
|
962d15bef63a73493b8cf29a22b656f19aa161ff
|
[
"Apache-2.0"
] | null | null | null |
from .abstract_query import AbstractQuery
class PesquisarPessoa(AbstractQuery):
pass
| 15.833333
| 41
| 0.778947
| 9
| 95
| 8.111111
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178947
| 95
| 5
| 42
| 19
| 0.935897
| 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
| 1
| 0
|
0
| 6
|
2d1d61b3fcb8f382f84576e100b3996770495f89
| 25
|
py
|
Python
|
env/Lib/site-packages/win32/mapi/__init__.py
|
Daniel-Key/HearStone-Python
|
981584d2b9502319393bd92b48f0ec8d906b4d44
|
[
"MIT"
] | null | null | null |
env/Lib/site-packages/win32/mapi/__init__.py
|
Daniel-Key/HearStone-Python
|
981584d2b9502319393bd92b48f0ec8d906b4d44
|
[
"MIT"
] | 1
|
2020-10-27T14:44:08.000Z
|
2020-10-27T14:44:08.000Z
|
env/Lib/site-packages/win32/mapi/__init__.py
|
Daniel-Key/HearStone-Python
|
981584d2b9502319393bd92b48f0ec8d906b4d44
|
[
"MIT"
] | null | null | null |
from win32._mapi import *
| 25
| 25
| 0.8
| 4
| 25
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.12
| 25
| 1
| 25
| 25
| 0.772727
| 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
| 1
| 0
|
0
| 6
|
2d2e9702d8917bd50d220179a5ae3d2d3a0df138
| 71
|
py
|
Python
|
common/__init__.py
|
wupengyue/AdminLTE
|
7a15c85a2a9ceb22f1b9c67437113df9aebf77bf
|
[
"MIT"
] | null | null | null |
common/__init__.py
|
wupengyue/AdminLTE
|
7a15c85a2a9ceb22f1b9c67437113df9aebf77bf
|
[
"MIT"
] | null | null | null |
common/__init__.py
|
wupengyue/AdminLTE
|
7a15c85a2a9ceb22f1b9c67437113df9aebf77bf
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# @Date : 2017-07-18 20:12:08
# @Author :
| 14.2
| 32
| 0.478873
| 11
| 71
| 3.090909
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.283019
| 0.253521
| 71
| 4
| 33
| 17.75
| 0.358491
| 0.887324
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
742448e3aae25772c6b6399b5c670e3dc3e6f144
| 33
|
py
|
Python
|
deployment/__init__.py
|
maxfrei750/CarbonBlackSegmentation
|
ff5aeaf03a9c60c1a0396f1d2b6d5a3347808a30
|
[
"MIT"
] | null | null | null |
deployment/__init__.py
|
maxfrei750/CarbonBlackSegmentation
|
ff5aeaf03a9c60c1a0396f1d2b6d5a3347808a30
|
[
"MIT"
] | null | null | null |
deployment/__init__.py
|
maxfrei750/CarbonBlackSegmentation
|
ff5aeaf03a9c60c1a0396f1d2b6d5a3347808a30
|
[
"MIT"
] | null | null | null |
from .segmenter import Segmenter
| 16.5
| 32
| 0.848485
| 4
| 33
| 7
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 33
| 1
| 33
| 33
| 0.965517
| 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
| 1
| 0
|
0
| 6
|
74414156113f70aed599e59e489aec7e8aaa778e
| 43,200
|
py
|
Python
|
sdh/metrics/org/api.py
|
SmartDeveloperHub/sdh-org-metrics
|
78a50501a04ce7c9d8bd55d4688d66c9f6e36766
|
[
"Apache-2.0"
] | null | null | null |
sdh/metrics/org/api.py
|
SmartDeveloperHub/sdh-org-metrics
|
78a50501a04ce7c9d8bd55d4688d66c9f6e36766
|
[
"Apache-2.0"
] | null | null | null |
sdh/metrics/org/api.py
|
SmartDeveloperHub/sdh-org-metrics
|
78a50501a04ce7c9d8bd55d4688d66c9f6e36766
|
[
"Apache-2.0"
] | null | null | null |
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2015 Center for Open Middleware.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
"""
from sdh.metrics.org import app, st as store
from sdh.metrics.server import ORG, SCM, CI, APIError
import calendar
from datetime import datetime
__author__ = 'Alejandro F. Carrera'
def get_average_list(l):
return reduce(lambda x, y: x + y, l) / len(l)
def get_correct_kwargs(kwargs):
args = {
'begin': 0 if kwargs.get('begin') is None else kwargs.get('begin'),
'end': calendar.timegm(datetime.now().timetuple())
if kwargs.get('end') is None else kwargs.get('end'),
'max': 0 if kwargs.get('max') is None else kwargs.get('max')
}
if args['max'] == 0:
args['step'] = 86400
else:
args['step'] = (args.get('end') - args.get('begin')) / args.get('max')
return args
def detect_overlap_date(a_begin, a_end, b_begin, b_end):
return (
(int(a_begin) <= int(b_begin)) and (int(a_end) >= int(b_end)) # contains
) or (
(int(a_begin) >= int(b_begin)) and (int(a_end) <= int(b_end)) # contains
) or (
(int(a_begin) <= int(b_begin)) and (int(b_begin) <= int(a_end)) # shift right
) or (
(int(a_begin) <= int(b_end)) and (int(b_end) <= int(a_end)) # shift left
)
def detect_project_repositories_overlap(uri, args):
temp_frame = store.get_project_temporal_frame(uri)
return detect_overlap_date(
args.get('begin'), args.get('end'),
temp_frame.get('first_commit'), temp_frame.get('last_commit')
)
def get_external_position_metric(uid, endpoint, position, aggregate, args, flag):
try:
pr = get_position_products(uid, args, position, flag)
pr_res = []
if args['begin'] == 0:
args['begin'] = None
tmp_arg = args
if flag:
if aggregate == 'sum':
tmp_frame = store.get_specific_products_temporal_frame(pr)
tmp_arg['begin'] = tmp_frame.get('first_commit')
tmp_arg['end'] = tmp_frame.get('last_commit')
pr_res = map(
lambda x: app.request_metric(endpoint, prid=x.get('id'), **tmp_arg), pr
)
else:
for k in pr:
pr_temp_frame = store.get_product_temporal_frame(k.get('uri'))
tmp_arg['begin'] = pr_temp_frame.get('first_commit')
tmp_arg['end'] = pr_temp_frame.get('last_commit')
pr_res.append(app.request_metric(endpoint, prid=k.get('id'), **tmp_arg))
else:
pr_res = map(lambda k: app.request_metric(endpoint, prid=k.get('id'), **tmp_arg), pr)
if len(pr_res):
context = pr_res[0][0]
else:
context = args
v = zip(*map(lambda x: x[1], pr_res))
if aggregate == 'avg':
res = [get_average_list(x) for x in v]
else:
res = [sum(x) for x in v]
return context, res
except (EnvironmentError, AttributeError) as e:
raise APIError(e.message)
return args, []
def get_position_repositories(uid, args, position, flag_total, only_uris):
positions_id = store.get_all_members_id(position)
if uid not in positions_id:
return []
else:
projects = store.get_all_member_projects(positions_id[uid])
res_prj = set()
res = []
for x in projects:
repos = store.get_all_project_repositories(x)
if not flag_total:
for k in repos:
rep_info = store.db.hgetall(k)
if detect_overlap_date(
args.get('begin'), args.get('end'),
rep_info.get('first_commit'), rep_info.get('last_commit')
):
res_prj.add(k)
if only_uris:
return res_prj
else:
[res.append({
'id': store.db.hgetall(x).get('id'),
'uri': x
}) for x in res_prj]
return res
def get_position_projects(uid, args, position, flag_total, only_uris):
positions_id = store.get_all_members_id(position)
if uid not in positions_id:
return []
else:
projects = store.get_all_member_projects(positions_id[uid])
if not flag_total:
res_prj = set()
for x in projects:
if detect_project_repositories_overlap(x, args):
res_prj.add(x)
projects = list(res_prj)
res = []
if only_uris:
return projects
else:
[res.append({
'id': store.db.get(x),
'uri': x
}) for x in projects]
return res
def get_position_products(uid, args, position, flag_total):
pr = get_position_projects(uid, args, position, flag_total, False)
pro = set()
res = []
for x in pr:
pro = pro.union(set(store.get_all_project_products(x.get('uri'))))
[res.append({
'id': store.db.get(x),
'uri': x
}) for x in pro]
return res
def get_position_position(uid, args, fil, position, flag_total):
pr = set(get_position_projects(uid, args, fil, flag_total, True))
members = store.get_all_members(position)
members_dir = set()
res = []
for x in members:
if len(pr.intersection(set(store.get_all_member_projects(x)))) > 0:
members_dir.add(x)
[res.append({
'id': store.db.hgetall(x).get("id"),
'uri': x
}) for x in members_dir]
return res
def get_director_position(uid, args, position, flag_total):
return get_position_position(uid, args, 'directors', position, flag_total)
def get_pmanager_position(uid, args, position, flag_total):
return get_position_position(uid, args, 'productmanagers', position, flag_total)
def get_project_roles(pjid, args, role, flag_total):
projects_id = store.get_all_projects_id()
if pjid not in projects_id:
return []
else:
if not flag_total and not detect_project_repositories_overlap(projects_id[pjid], args):
return []
if role == "softwaredeveloper":
tmp_arg = args
if not flag_total:
pr_temp_frame = store.get_project_temporal_frame(projects_id[pjid])
tmp_arg['begin'] = pr_temp_frame.get('first_commit')
tmp_arg['end'] = pr_temp_frame.get('last_commit')
co, res = app.request_view('project-developers', pjid=pjid, **tmp_arg)
return res
else:
res = set()
users_id = store.get_all_members(role)
for x in users_id:
pr_res = store.get_all_member_projects(x)
if projects_id[pjid] in pr_res:
res.add(x)
res_set = []
[res_set.append({
'id': store.db.hgetall(x).get("id"),
'uri': x
}) for x in res]
return res_set
def get_director_roles(uid, args, role, flag_total):
return get_position_position(uid, args, 'directors', role, flag_total)
def get_pmanager_roles(uid, args, role, flag_total):
return get_position_position(uid, args, 'productmanagers', role, flag_total)
def helper_get_director_pmanagers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_director_position(uid, args, 'productmanagers', flag_total)
def helper_get_director_architects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_director_position(uid, args, 'architects', flag_total)
def helper_get_pmanager_architects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_pmanager_position(uid, args, 'architects', flag_total)
def helper_get_position_developers(uid, position, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
try:
res = set()
pr = get_position_products(uid, args, position, flag_total)
devs = map(lambda k: app.request_view('product-developers', prid=k.get('id'), **kwargs), pr)
[[res.add(j.get('uri')) for j in x] for x in map(lambda x: x[1], devs)]
res_devs = []
[res_devs.append({
"id": store.db.hgetall(x).get("id"),
"uri": x
}) for x in res]
return args, res_devs
except (EnvironmentError, AttributeError) as e:
raise APIError(e.message)
return args, []
@app.view('/product-projects', target=ORG.Project, parameters=[ORG.Product],
id='product-projects', title='Projects of Product')
def get_product_projects(prid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
products_id = store.get_all_products_id()
if prid not in products_id:
return args, []
else:
projects = store.get_all_product_projects(products_id[prid])
if not flag_total:
res_prj = set()
for x in projects:
if detect_project_repositories_overlap(x, args):
res_prj.add(x)
projects = list(res_prj)
res = []
[res.append({
'id': store.db.get(x),
'uri': x
}) for x in projects]
return args, res
@app.view('/project-repositories', target=SCM.Repository, parameters=[ORG.Project],
id='project-repositories', title='Repositories of Project')
def get_project_repositories(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
projects_id = store.get_all_projects_id()
if pjid not in projects_id:
return args, []
else:
repos = store.get_all_project_repositories(projects_id[pjid])
if not flag_total:
res_prj = set()
for k in repos:
rep_info = store.db.hgetall(k)
if detect_overlap_date(
args.get('begin'), args.get('end'),
rep_info.get('first_commit'), rep_info.get('last_commit')
):
res_prj.add(k)
repos = res_prj
res = []
[res.append({
'id': store.db.hgetall(x).get('id'),
'uri': x
}) for x in repos]
return args, res
@app.metric('/total-project-stakeholders', parameters=[ORG.Project],
id='project-stakeholders', title='Stakeholders of Project')
def get_total_project_stakeholders(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_project_roles(pjid, args, 'stakeholder', flag_total))]
@app.view('/project-stakeholders', target=ORG.Person, parameters=[ORG.Project],
id='project-stakeholders', title='Stakeholders of Project')
def get_project_stakeholders(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_project_roles(pjid, args, 'stakeholder', flag_total)
@app.metric('/total-project-swarchitects', parameters=[ORG.Project],
id='project-swarchitects', title='Software Architects of Project')
def get_total_project_swarchitects(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_project_roles(pjid, args, 'softwarearchitect', flag_total))]
@app.view('/project-swarchitects', target=ORG.Person, parameters=[ORG.Project],
id='project-swarchitects', title='Software Architects of Project')
def get_project_swarchitects(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_project_roles(pjid, args, 'softwarearchitect', flag_total)
@app.metric('/total-project-pjmanagers', parameters=[ORG.Project],
id='project-pjmanagers', title='Project Managers of Project')
def get_total_project_pjmanagers(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_project_roles(pjid, args, 'projectmanager', flag_total))]
@app.view('/project-pjmanagers', target=ORG.Person, parameters=[ORG.Project],
id='project-pjmanagers', title='Project Managers of Project')
def get_project_pjmanagers(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_project_roles(pjid, args, 'projectmanager', flag_total)
@app.metric('/total-project-swdevelopers', parameters=[ORG.Project],
id='project-swdevelopers', title='Software Developers of Project')
def get_total_project_swdevelopers(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_project_roles(pjid, args, 'softwaredeveloper', flag_total))]
@app.view('/project-swdevelopers', target=ORG.Person, parameters=[ORG.Project],
id='project-swdevelopers', title='Software Developers of Project')
def get_project_swdevelopers(pjid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_project_roles(pjid, args, 'softwaredeveloper', flag_total)
@app.metric('/total-director-repositories', parameters=[ORG.Person],
id='director-repositories', title='Repositories of Director')
def get_total_director_repositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_repositories(uid, args, 'directors', flag_total, False))]
@app.view('/director-repositories', target=SCM.Repository, parameters=[ORG.Person],
id='director-repositories', title='Repositories of Director')
def get_director_repositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_repositories(uid, args, 'directors', flag_total, False)
@app.metric('/total-director-projects', parameters=[ORG.Person],
id='director-projects', title='Projects of Director')
def get_total_director_projects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_projects(uid, args, 'directors', flag_total, False))]
@app.view('/director-projects', target=ORG.Project, parameters=[ORG.Person],
id='director-projects', title='Projects of Director')
def get_director_projects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_projects(uid, args, 'directors', flag_total, False)
@app.metric('/total-architect-projects', parameters=[ORG.Person],
id='architect-projects', title='Projects of Architect')
def get_total_architects_projects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_projects(uid, args, 'architects', flag_total, False))]
@app.view('/architect-projects', target=ORG.Project, parameters=[ORG.Person],
id='architect-projects', title='Projects of Architect')
def get_architect_projects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_projects(uid, args, 'architects', flag_total, False)
@app.metric('/total-pmanager-projects', parameters=[ORG.Person],
id='pmanager-projects', title='Projects of Product Manager')
def get_total_manager_projects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_projects(uid, args, 'productmanagers', flag_total, False))]
@app.view('/pmanager-projects', target=ORG.Project, parameters=[ORG.Person],
id='pmanager-projects', title='Projects of Product Manager')
def get_manager_projects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_projects(uid, args, 'productmanagers', flag_total, False)
@app.metric('/total-director-products', parameters=[ORG.Person],
id='director-products', title='Products of Director')
def get_total_director_products(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_products(uid, args, 'directors', flag_total))]
@app.view('/director-products', target=ORG.Product, parameters=[ORG.Person],
id='director-products', title='Products of Director')
def get_director_products(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_products(uid, args, 'directors', flag_total)
@app.metric('/total-architect-products', parameters=[ORG.Person],
id='architects-products', title='Products of Architect')
def get_total_architect_products(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_products(uid, args, 'architects', flag_total))]
@app.view('/architect-products', target=ORG.Product, parameters=[ORG.Person],
id='architects-products', title='Products of Architect')
def get_architect_products(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_products(uid, args, 'architects', flag_total)
@app.metric('/total-pmanager-repositories', parameters=[ORG.Person],
id='pmanager-repositories', title='Repositories of Product Manager')
def get_total_pmanager_repositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_repositories(uid, args, 'productmanagers', flag_total, False))]
@app.view('/pmanager-repositories', target=SCM.Repository, parameters=[ORG.Person],
id='pmanager-repositories', title='Repositories of Product Manager')
def get_pmanager_repositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_repositories(uid, args, 'productmanagers', flag_total, False)
@app.metric('/total-pmanager-products', parameters=[ORG.Person],
id='pmanager-products', title='Products of Product Manager')
def get_total_manager_products(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_position_products(uid, args, 'productmanagers', flag_total))]
@app.view('/pmanager-products', target=ORG.Product, parameters=[ORG.Person],
id='pmanager-products', title='Products of Product Manager')
def get_manager_products(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_position_products(uid, args, 'productmanagers', flag_total)
@app.metric('/total-director-productmanagers', parameters=[ORG.Person],
id='director-productmanagers', title='Product Managers of Director')
def get_total_director_pmanagers(uid, **kwargs):
co, res = helper_get_director_pmanagers(uid, **kwargs)
return co, [len(res)]
@app.view('/director-productmanagers', target=ORG.Person, parameters=[ORG.Person],
id='director-productmanagers', title='Product Managers of Director')
def get_director_pmanagers(uid, **kwargs):
return helper_get_director_pmanagers(uid, **kwargs)
@app.metric('/total-director-architects', parameters=[ORG.Person],
id='director-architects', title='Architects of Director')
def get_total_director_architects(uid, **kwargs):
co, res = helper_get_director_architects(uid, **kwargs)
return co, [len(res)]
@app.view('/director-architects', target=ORG.Person, parameters=[ORG.Person],
id='director-architects', title='Architects of Director')
def get_director_architects(uid, **kwargs):
return helper_get_director_architects(uid, **kwargs)
@app.metric('/total-director-developers', parameters=[ORG.Person],
id='director-developers', title='Developers of Director')
def get_total_director_developers(uid, **kwargs):
co, res = helper_get_position_developers(uid, 'directors', **kwargs)
return co, [len(res)]
@app.view('/director-developers', target=ORG.Person, parameters=[ORG.Person],
id='director-developers', title='Developers of Director')
def get_director_developers(uid, **kwargs):
return helper_get_position_developers(uid, 'directors', **kwargs)
@app.metric('/total-director-stakeholders', parameters=[ORG.Person],
id='director-stakeholders', title='Stakeholders of Director')
def get_total_director_stakeholders(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_director_roles(uid, args, 'stakeholder', flag_total))]
@app.view('/director-stakeholders', target=ORG.Person, parameters=[ORG.Person],
id='director-stakeholders', title='Stakeholders of Director')
def get_director_stakeholders(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_director_roles(uid, args, 'stakeholder', flag_total)
@app.metric('/total-director-swarchitects', parameters=[ORG.Person],
id='director-swarchitects', title='Software Architects of Director')
def get_total_director_swarchitects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_director_roles(uid, args, 'softwarearchitect', flag_total))]
@app.view('/director-swarchitects', target=ORG.Person, parameters=[ORG.Person],
id='director-swarchitects', title='Software Architects of Director')
def get_director_swarchitects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_director_roles(uid, args, 'softwarearchitect', flag_total)
@app.metric('/total-director-swdevelopers', parameters=[ORG.Person],
id='director-swdevelopers', title='Software Developers of Director')
def get_total_director_swdevelopers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_director_roles(uid, args, 'softwaredeveloper', flag_total))]
@app.view('/director-swdevelopers', target=ORG.Person, parameters=[ORG.Person],
id='director-swdevelopers', title='Software Developers of Director')
def get_director_swdevelopers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_director_roles(uid, args, 'softwaredeveloper', flag_total)
@app.metric('/total-director-pjmanagers', parameters=[ORG.Person],
id='director-pjmanagers', title='Project Managers of Director')
def get_total_director_pjmanagers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_director_roles(uid, args, 'projectmanager', flag_total))]
@app.view('/director-pjmanagers', target=ORG.Person, parameters=[ORG.Person],
id='director-pjmanagers', title='Project Managers of Director')
def get_director_pjmanagers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_director_roles(uid, args, 'projectmanager', flag_total)
@app.metric('/total-director-members', parameters=[ORG.Person],
id='director-members', title='Members below Director')
def get_total_director_members(uid, **kwargs):
res = {}
co, pm = helper_get_director_pmanagers(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in pm]
co, ar = helper_get_director_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'directors', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
return co, [len(res.keys())]
@app.view('/director-members', target=ORG.Person, parameters=[ORG.Person],
id='director-members', title='Members below Director')
def get_director_members(uid, **kwargs):
res = {}
co, pm = helper_get_director_pmanagers(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in pm]
co, ar = helper_get_director_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'directors', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
res_mem = []
[res_mem.append({
"id": x,
"uri": res[x]
}) for x in res.keys()]
return co, res_mem
@app.metric('/director-productmembers', aggr='avg', parameters=[ORG.Person],
id='director-productmembers', title='Product Members AVG of Director')
def get_avg_director_productmembers(uid, **kwargs):
res = {}
co, pm = helper_get_director_pmanagers(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in pm]
co, ar = helper_get_director_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'directors', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
res_mem = len(res.keys())
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_pr = len(get_position_products(uid, args, 'directors', flag_total))
if res_pr == 0:
return co, [0]
return co, [float(res_mem) / float(res_pr)]
@app.metric('/director-productrepositories', aggr='avg', parameters=[ORG.Person],
id='director-productrepositories', title='Product Repositories AVG of Director')
def get_avg_director_productrepositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_rep = len(get_position_repositories(uid, args, 'directors', flag_total, True))
res_pr = len(get_position_products(uid, args, 'directors', flag_total))
if res_pr == 0:
return args, [0]
return args, [float(res_rep) / float(res_pr)]
@app.metric('/director-projectmembers', aggr='avg', parameters=[ORG.Person],
id='director-projectmembers', title='Project Members AVG of Director')
def get_avg_director_projectmembers(uid, **kwargs):
res = {}
co, pm = helper_get_director_pmanagers(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in pm]
co, ar = helper_get_director_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'directors', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
res_mem = len(res.keys())
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_pr = len(get_position_projects(uid, args, 'directors', flag_total, True))
if res_pr == 0:
return co, [0]
return co, [float(res_mem) / float(res_pr)]
@app.metric('/director-projectrepositories', aggr='avg', parameters=[ORG.Person],
id='director-projectrepositories', title='Project Repositories AVG of Director')
def get_avg_director_projectrepositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_rep = len(get_position_repositories(uid, args, 'directors', flag_total, True))
res_pr = len(get_position_projects(uid, args, 'directors', flag_total, True))
if res_pr == 0:
return args, [0]
return args, [float(res_rep) / float(res_pr)]
@app.metric('/director-activity', parameters=[ORG.Person],
id='director-activity', title='Activity of Director')
def get_director_activity(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
co, res = get_external_position_metric(uid, 'sum-product-activity', 'directors', 'sum', args, flag_total)
res_makeup = []
if len(res):
res_max = max(res)
[res_makeup.append(float(x)/res_max) for x in res]
return co, res_makeup
@app.metric('/director-quality', aggr='avg', parameters=[ORG.Person],
id='director-quality', title='Quality of Director')
def get_director_quality(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-quality', 'directors', 'avg', args, flag_total)
@app.metric('/director-health', aggr='avg', parameters=[ORG.Person],
id='director-health', title='Health of Director')
def get_director_health(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-health', 'directors', 'avg', args, flag_total)
@app.metric('/director-costs', parameters=[ORG.Person],
id='director-costs', title='Costs of Director')
def get_director_costs(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-cost', 'directors', 'sum', args, flag_total)
@app.metric('/director-externals', parameters=[ORG.Person],
id='director-externals', title='External Committers from Products of Director')
def get_director_externals(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-externals', 'directors', 'sum', args, flag_total)
@app.metric('/director-timetomarket', aggr='avg', parameters=[ORG.Person],
id='director-timetomarket', title='Time To Market from Products of Director')
def get_director_timetomarket(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-timetomarket', 'directors', 'avg', args, flag_total)
@app.metric('/total-pmanager-architects', parameters=[ORG.Person],
id='pmanager-architects', title='Architects of Product Manager')
def get_total_pmanager_architects(uid, **kwargs):
co, res = helper_get_pmanager_architects(uid, **kwargs)
return co, [len(res)]
@app.view('/pmanager-architects', target=ORG.Person, parameters=[ORG.Person],
id='pmanager-architects', title='Architects of Product Manager')
def get_pmanager_architects(uid, **kwargs):
return helper_get_pmanager_architects(uid, **kwargs)
@app.metric('/total-pmanager-developers', parameters=[ORG.Person],
id='pmanager-developers', title='Developers of Product Manager')
def get_total_pmanager_developers(uid, **kwargs):
co, res = helper_get_position_developers(uid, 'productmanagers', **kwargs)
return co, [len(res)]
@app.view('/pmanager-developers', target=ORG.Person, parameters=[ORG.Person],
id='pmanager-developers', title='Developers of Product Manager')
def get_pmanager_developers(uid, **kwargs):
return helper_get_position_developers(uid, 'productmanagers', **kwargs)
@app.metric('/total-pmanager-stakeholders', parameters=[ORG.Person],
id='pmanager-stakeholders', title='Stakeholders of Product Manager')
def get_total_pmanager_stakeholders(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_pmanager_roles(uid, args, 'stakeholder', flag_total))]
@app.view('/pmanager-stakeholders', target=ORG.Person, parameters=[ORG.Person],
id='pmanager-stakeholders', title='Stakeholders of Product Manager')
def get_pmanager_stakeholders(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_pmanager_roles(uid, args, 'stakeholder', flag_total)
@app.metric('/total-pmanager-swarchitects', parameters=[ORG.Person],
id='pmanager-swarchitects', title='Software Architects of Product Manager')
def get_total_pmanager_swarchitects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_pmanager_roles(uid, args, 'softwarearchitect', flag_total))]
@app.view('/pmanager-swarchitects', target=ORG.Person, parameters=[ORG.Person],
id='pmanager-swarchitects', title='Software Architects of Product Manager')
def get_pmanager_swarchitects(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_pmanager_roles(uid, args, 'softwarearchitect', flag_total)
@app.metric('/total-pmanager-swdevelopers', parameters=[ORG.Person],
id='pmanager-swdevelopers', title='Software Developers of Product Manager')
def get_total_pmanager_swdevelopers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_pmanager_roles(uid, args, 'softwaredeveloper', flag_total))]
@app.view('/pmanager-swdevelopers', target=ORG.Person, parameters=[ORG.Person],
id='pmanager-swdevelopers', title='Software Developers of Product Manager')
def get_pmanager_swdevelopers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_pmanager_roles(uid, args, 'softwaredeveloper', flag_total)
@app.metric('/total-pmanager-pjmanagers', parameters=[ORG.Person],
id='pmanager-pjmanagers', title='Project Managers of Product Manager')
def get_total_pmanager_pjmanagers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, [len(get_pmanager_roles(uid, args, 'projectmanager', flag_total))]
@app.view('/pmanager-pjmanagers', target=ORG.Person, parameters=[ORG.Person],
id='pmanager-pjmanagers', title='Project Managers of Product Manager')
def get_pmanager_pjmanagers(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return args, get_pmanager_roles(uid, args, 'projectmanager', flag_total)
@app.metric('/total-pmanager-members', parameters=[ORG.Person],
id='pmanager-members', title='Members below Product Manager')
def get_total_pmanager_members(uid, **kwargs):
res = {}
co, ar = helper_get_pmanager_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'productmanagers', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
return co, [len(res.keys())]
@app.metric('/pmanager-productrepositories', aggr='avg', parameters=[ORG.Person],
id='pmanager-productrepositories', title='Product Repositories AVG of Product Manager')
def get_avg_pmanager_productrepositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_rep = len(get_position_repositories(uid, args, 'productmanagers', flag_total, True))
res_pr = len(get_position_products(uid, args, 'productmanagers', flag_total))
if res_pr == 0:
return args, [0]
return args, [float(res_rep) / float(res_pr)]
@app.metric('/pmanager-productmembers', aggr='avg', parameters=[ORG.Person],
id='pmanager-productmembers', title='Product Members AVG of Product Manager')
def get_avg_pmanager_productmembers(uid, **kwargs):
res = {}
co, ar = helper_get_pmanager_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'productmanagers', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
res_mem = len(res.keys())
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_pr = len(get_position_products(uid, args, 'productmanagers', flag_total))
if res_pr == 0:
return co, [0]
return co, [float(res_mem) / float(res_pr)]
@app.metric('/pmanager-projectrepositories', aggr='avg', parameters=[ORG.Person],
id='pmanager-projectrepositories', title='Project Repositories AVG of Product Manager')
def get_avg_pmanager_projectrepositories(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_rep = len(get_position_repositories(uid, args, 'productmanagers', flag_total, True))
res_pr = len(get_position_projects(uid, args, 'productmanagers', flag_total, True))
if res_pr == 0:
return args, [0]
return args, [float(res_rep) / float(res_pr)]
@app.metric('/pmanager-projectmembers', aggr='avg', parameters=[ORG.Person],
id='pmanager-projectmembers', title='Project Members AVG of Product Manager')
def get_avg_pmanager_projectmembers(uid, **kwargs):
res = {}
co, ar = helper_get_pmanager_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'productmanagers', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
res_mem = len(res.keys())
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
res_pr = len(get_position_projects(uid, args, 'productmanagers', flag_total, True))
if res_pr == 0:
return co, [0]
return co, [float(res_mem) / float(res_pr)]
@app.view('/pmanager-members', target=ORG.Person, parameters=[ORG.Person],
id='pmanager-members', title='Members below Product Manager')
def get_pmanager_members(uid, **kwargs):
res = {}
co, ar = helper_get_pmanager_architects(uid, **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in ar]
co, dev = helper_get_position_developers(uid, 'productmanagers', **kwargs)
[res.update({x.get('id'): x.get('uri')}) for x in dev]
res_mem = []
[res_mem.append({
"id": x,
"uri": res[x]
}) for x in res.keys()]
return co, res_mem
@app.metric('/pmanager-activity', parameters=[ORG.Person],
id='pmanager-activity', title='Activity of Product Manager')
def get_pmanager_activity(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
co, res = get_external_position_metric(uid, 'sum-product-activity', 'productmanagers', 'sum', args, flag_total)
res_makeup = []
if len(res):
res_max = max(res)
[res_makeup.append(float(x)/res_max) for x in res]
return co, res_makeup
@app.metric('/pmanager-quality', aggr='avg', parameters=[ORG.Person],
id='pmanager-quality', title='Quality of Product Manager')
def get_pmanager_quality(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-quality', 'productmanagers', 'avg', args, flag_total)
@app.metric('/pmanager-health', aggr='avg', parameters=[ORG.Person],
id='pmanager-health', title='Health of Product Manager')
def get_pmanager_health(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-health', 'productmanagers', 'avg', args, flag_total)
@app.metric('/pmanager-costs', parameters=[ORG.Person],
id='pmanager-costs', title='Costs of Product Manager')
def get_pmanager_costs(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-cost', 'productmanagers', 'sum', args, flag_total)
@app.metric('/pmanager-timetomarket', aggr='avg', parameters=[ORG.Person],
id='pmanager-timetomarket', title='Time To Market from Products of Product Manager')
def get_pmanager_timetomarket(uid, **kwargs):
flag_total = kwargs.get('begin') is None and kwargs.get('end') is None
args = get_correct_kwargs(kwargs)
return get_external_position_metric(uid, 'sum-product-timetomarket', 'productmanagers', 'avg', args, flag_total)
| 42.60355
| 116
| 0.673472
| 5,765
| 43,200
| 4.869905
| 0.041977
| 0.049047
| 0.033411
| 0.051719
| 0.900089
| 0.84545
| 0.800534
| 0.757222
| 0.702369
| 0.647373
| 0
| 0.001075
| 0.181944
| 43,200
| 1,013
| 117
| 42.645607
| 0.79335
| 0.025787
| 0
| 0.546753
| 0
| 0
| 0.181676
| 0.046322
| 0
| 0
| 0
| 0
| 0
| 1
| 0.120779
| false
| 0
| 0.005195
| 0.014286
| 0.271429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
746248a9a6ff0d428ab94f820ef076b18b48282a
| 123
|
py
|
Python
|
iot_api/user_api/websocket/alerts.py
|
dolfandringa/rolaguard_backend
|
d4df7b55fc001aa6e0499edcfa94bf1b1c63b084
|
[
"Apache-2.0"
] | null | null | null |
iot_api/user_api/websocket/alerts.py
|
dolfandringa/rolaguard_backend
|
d4df7b55fc001aa6e0499edcfa94bf1b1c63b084
|
[
"Apache-2.0"
] | 7
|
2020-05-05T20:10:59.000Z
|
2021-05-26T17:59:24.000Z
|
iot_api/user_api/websocket/alerts.py
|
dolfandringa/rolaguard_backend
|
d4df7b55fc001aa6e0499edcfa94bf1b1c63b084
|
[
"Apache-2.0"
] | 1
|
2021-01-28T05:54:11.000Z
|
2021-01-28T05:54:11.000Z
|
from iot_api import socketio
def emit_alert_event(event, recipient):
socketio.emit('new_alert', event, room=recipient)
| 30.75
| 53
| 0.788618
| 18
| 123
| 5.166667
| 0.666667
| 0.215054
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113821
| 123
| 4
| 53
| 30.75
| 0.853211
| 0
| 0
| 0
| 0
| 0
| 0.072581
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 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
| 1
| 0
| 1
| 0
|
0
| 6
|
7481800efb51f4d1a5766aebafa35170462e666c
| 38
|
py
|
Python
|
autox/autox_ts/metrics/__init__.py
|
OneToolsCollection/4paradigm-AutoX
|
f8e838021354de17f5bb9bc44e9d68d12dda6427
|
[
"Apache-2.0"
] | null | null | null |
autox/autox_ts/metrics/__init__.py
|
OneToolsCollection/4paradigm-AutoX
|
f8e838021354de17f5bb9bc44e9d68d12dda6427
|
[
"Apache-2.0"
] | null | null | null |
autox/autox_ts/metrics/__init__.py
|
OneToolsCollection/4paradigm-AutoX
|
f8e838021354de17f5bb9bc44e9d68d12dda6427
|
[
"Apache-2.0"
] | null | null | null |
from .metrics import _get_score_metric
| 38
| 38
| 0.894737
| 6
| 38
| 5.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078947
| 38
| 1
| 38
| 38
| 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
| 1
| 0
|
0
| 6
|
77823bcef33f848f86c9133fcce12df4adef4d86
| 27
|
py
|
Python
|
__init__.py
|
GRV96/hm_duration
|
89de54a114cab42862dbe6b6dd5b2180adf2ee0d
|
[
"MIT"
] | null | null | null |
__init__.py
|
GRV96/hm_duration
|
89de54a114cab42862dbe6b6dd5b2180adf2ee0d
|
[
"MIT"
] | null | null | null |
__init__.py
|
GRV96/hm_duration
|
89de54a114cab42862dbe6b6dd5b2180adf2ee0d
|
[
"MIT"
] | null | null | null |
from .hm_duration import *
| 13.5
| 26
| 0.777778
| 4
| 27
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 27
| 1
| 27
| 27
| 0.869565
| 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
| 1
| 0
|
0
| 6
|
77ea483e2f5d12c57ce4e04b7312ab2402473ea4
| 47
|
py
|
Python
|
input.py
|
rooch001/RaspberryPi-DTU
|
baea2ad7a2eb8bdc45b56d6bde5d5bd3e3c30cfd
|
[
"MIT"
] | null | null | null |
input.py
|
rooch001/RaspberryPi-DTU
|
baea2ad7a2eb8bdc45b56d6bde5d5bd3e3c30cfd
|
[
"MIT"
] | null | null | null |
input.py
|
rooch001/RaspberryPi-DTU
|
baea2ad7a2eb8bdc45b56d6bde5d5bd3e3c30cfd
|
[
"MIT"
] | null | null | null |
import os
import shutil
print(os.listdir('/'))
| 11.75
| 22
| 0.723404
| 7
| 47
| 4.857143
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106383
| 47
| 4
| 22
| 11.75
| 0.809524
| 0
| 0
| 0
| 0
| 0
| 0.020833
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0.333333
| 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
| 1
| 0
|
0
| 6
|
77ff924bd9452e672bd6d921994120546cb53305
| 102
|
py
|
Python
|
custom_components/matts_gadgets_ceiling_fan/const.py
|
mattyway/matts_gadgets_ceiling_fan
|
f7b353fb9752f87569ec1925d08804a83e6715cf
|
[
"MIT"
] | null | null | null |
custom_components/matts_gadgets_ceiling_fan/const.py
|
mattyway/matts_gadgets_ceiling_fan
|
f7b353fb9752f87569ec1925d08804a83e6715cf
|
[
"MIT"
] | null | null | null |
custom_components/matts_gadgets_ceiling_fan/const.py
|
mattyway/matts_gadgets_ceiling_fan
|
f7b353fb9752f87569ec1925d08804a83e6715cf
|
[
"MIT"
] | null | null | null |
"""Constants for the Matt's Gadgets Ceiling Fan integration."""
DOMAIN = "matts_gadgets_ceiling_fan"
| 25.5
| 63
| 0.77451
| 14
| 102
| 5.428571
| 0.785714
| 0.368421
| 0.447368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 102
| 3
| 64
| 34
| 0.844444
| 0.558824
| 0
| 0
| 0
| 0
| 0.641026
| 0.641026
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
7ad29cf27964c995c953363ee94f815f643e4137
| 44
|
py
|
Python
|
sdk/exception/exceed_limit_exception.py
|
CLG0125/elemesdk
|
344466398bad7cf026e082e47c77d3ca98621ef3
|
[
"MIT"
] | 1
|
2021-04-03T05:11:29.000Z
|
2021-04-03T05:11:29.000Z
|
sdk/exception/exceed_limit_exception.py
|
CLG0125/elemesdk
|
344466398bad7cf026e082e47c77d3ca98621ef3
|
[
"MIT"
] | null | null | null |
sdk/exception/exceed_limit_exception.py
|
CLG0125/elemesdk
|
344466398bad7cf026e082e47c77d3ca98621ef3
|
[
"MIT"
] | null | null | null |
class ExceedLimitException(Exception):pass
| 14.666667
| 42
| 0.863636
| 4
| 44
| 9.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 44
| 2
| 43
| 22
| 0.926829
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 1
| 0
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 6
|
7af9ce8ba99ab0024b0d79ef7600bd2202d6b9e4
| 41
|
py
|
Python
|
packages/plugins/model-define/tensorflow-cycle-gan-model-define/CycleGAN/image_loader/__init__.py
|
CandyQiu/pipcook
|
12d482d6dcfb828bf80fcf908aee2c8ba5e9bd8a
|
[
"Apache-2.0"
] | 2
|
2020-04-21T05:49:02.000Z
|
2021-03-01T15:14:29.000Z
|
packages/plugins/model-define/tensorflow-cycle-gan-model-define/CycleGAN/image_loader/__init__.py
|
CandyQiu/pipcook
|
12d482d6dcfb828bf80fcf908aee2c8ba5e9bd8a
|
[
"Apache-2.0"
] | null | null | null |
packages/plugins/model-define/tensorflow-cycle-gan-model-define/CycleGAN/image_loader/__init__.py
|
CandyQiu/pipcook
|
12d482d6dcfb828bf80fcf908aee2c8ba5e9bd8a
|
[
"Apache-2.0"
] | null | null | null |
from .image_loader import ImageGenerator
| 20.5
| 40
| 0.878049
| 5
| 41
| 7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097561
| 41
| 1
| 41
| 41
| 0.945946
| 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
| 1
| 0
|
0
| 6
|
bb17d26fa2cfe52fac2399248342acf911c767f1
| 125
|
py
|
Python
|
rl_helper/__init__.py
|
yiwc/rl_helper
|
3cb0c088b40dabd3fa17af6e53f7c9563c7ef8b8
|
[
"MIT"
] | null | null | null |
rl_helper/__init__.py
|
yiwc/rl_helper
|
3cb0c088b40dabd3fa17af6e53f7c9563c7ef8b8
|
[
"MIT"
] | null | null | null |
rl_helper/__init__.py
|
yiwc/rl_helper
|
3cb0c088b40dabd3fa17af6e53f7c9563c7ef8b8
|
[
"MIT"
] | null | null | null |
from rl_helper.envhelper import envhelper,VDisplay
from rl_helper.fps import fps
from rl_helper.exps import ExperimentManager
| 41.666667
| 50
| 0.88
| 19
| 125
| 5.631579
| 0.473684
| 0.168224
| 0.336449
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088
| 125
| 3
| 51
| 41.666667
| 0.938596
| 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
| 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
| 6
|
bb1fea629f2a9e4489bdbe2cada201c3a470df90
| 38
|
py
|
Python
|
pyqt_helper/__init__.py
|
morefigs/pyqt-ui-helper
|
0f80f8483f57fc58a1c58fb2832094c7931b9fa6
|
[
"MIT"
] | 2
|
2019-07-08T22:57:00.000Z
|
2022-01-07T10:36:53.000Z
|
pyqt_helper/__init__.py
|
morefigs/pyqt-ui-helper
|
0f80f8483f57fc58a1c58fb2832094c7931b9fa6
|
[
"MIT"
] | 20
|
2021-05-03T18:02:23.000Z
|
2022-03-12T12:01:04.000Z
|
pyqt_helper/__init__.py
|
morefigs/pyqt-ui-helper
|
0f80f8483f57fc58a1c58fb2832094c7931b9fa6
|
[
"MIT"
] | null | null | null |
from .pyqt_helper import process_file
| 19
| 37
| 0.868421
| 6
| 38
| 5.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 38
| 1
| 38
| 38
| 0.911765
| 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
| 1
| 0
|
0
| 6
|
bb2e7d5f7c0ebcba291fff0eb900b78cfa2b84c9
| 24,753
|
py
|
Python
|
tests/integration/test_krkgw_page.py
|
konrad-kocik/nicelka
|
a174fce9b8c6d4414312120e89e10bb1e10629df
|
[
"MIT"
] | null | null | null |
tests/integration/test_krkgw_page.py
|
konrad-kocik/nicelka
|
a174fce9b8c6d4414312120e89e10bb1e10629df
|
[
"MIT"
] | null | null | null |
tests/integration/test_krkgw_page.py
|
konrad-kocik/nicelka
|
a174fce9b8c6d4414312120e89e10bb1e10629df
|
[
"MIT"
] | null | null | null |
from pytest import fixture
from tests.integration.utilities.utilities import get_io_dir_paths, create_dir, remove_dir, run_krkgw_searcher, assert_report_file_content_equals
test_suite = 'krkgw_page'
test_cases = ['no_result',
'no_result_twice',
'single_result',
'single_result_indirect_match_skipped',
'single_result_indirect_match_allowed',
'single_result_duplicate_skipped',
'single_result_duplicate_allowed',
'single_result_twice',
'multiple_results',
'multiple_results_indirect_matches_skipped',
'multiple_results_indirect_matches_allowed',
'multiple_results_duplicate_skipped',
'multiple_results_duplicate_allowed',
'multiple_results_twice',
'multiple_results_on_multiple_pages_all_allowed',
'multiple_results_on_multiple_pages_indirect_matches_skipped',
'multiple_results_with_empty_details',
'basic_use_cases'
]
@fixture(scope='module')
def create_reports_dirs():
for test_case in test_cases:
_, report_dir_path = get_io_dir_paths(test_suite, test_case)
create_dir(report_dir_path)
@fixture(scope='module')
def remove_reports_dirs(request):
def teardown():
for test_case in test_cases:
_, report_dir_path = get_io_dir_paths(test_suite, test_case)
remove_dir(report_dir_path)
request.addfinalizer(teardown)
def test_no_result(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'33-383 MUSZYNKA' + '\n\n' + \
'Results found: 0'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='no_result')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_no_result_twice(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'33-383 MUSZYNKA' + '\n\n' + \
'======================================================================' + '\n' + \
'33-322 JASIENNA' + '\n\n' + \
'Results found: 0'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='no_result_twice')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_single_result(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'21-075 ZEZULIN PIERWSZY' + '\n\n' + \
'Koło Gospodyń Wiejskich "Zezulin" w Zezulinie' + '\n' + \
'Zezulin Pierwszy 22A' + '\n' + \
'21-075 Zezulin Pierwszy' + '\n\n' + \
'Results found: 1'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='single_result')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_single_result_indirect_match_skipped(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'33-334 BOGUSZA' + '\n\n' + \
'Results found: 0'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='single_result_indirect_match_skipped')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_single_result_indirect_match_allowed(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'33-334 BOGUSZA' + '\n\n' + \
'Koło Gospodyń Wiejskich w Boguszach' + '\n' + \
'Bogusze 45' + '\n' + \
'16-100 Bogusze' + '\n\n' + \
'Results found: 1'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='single_result_indirect_match_allowed')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path, allow_indirect_matches=True)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_single_result_duplicate_skipped(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'21-075 ZEZULIN PIERWSZY' + '\n\n' + \
'Koło Gospodyń Wiejskich "Zezulin" w Zezulinie' + '\n' + \
'Zezulin Pierwszy 22A' + '\n' + \
'21-075 Zezulin Pierwszy' + '\n\n' + \
'======================================================================' + '\n' + \
'21-075 ZEZULIN PIERWSZY' + '\n\n' + \
'Results found: 1'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='single_result_duplicate_skipped')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_single_result_duplicate_allowed(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'21-075 ZEZULIN PIERWSZY' + '\n\n' + \
'Koło Gospodyń Wiejskich "Zezulin" w Zezulinie' + '\n' + \
'Zezulin Pierwszy 22A' + '\n' + \
'21-075 Zezulin Pierwszy' + '\n\n' + \
'======================================================================' + '\n' + \
'21-075 ZEZULIN PIERWSZY' + '\n\n' + \
'Koło Gospodyń Wiejskich "Zezulin" w Zezulinie' + '\n' + \
'Zezulin Pierwszy 22A' + '\n' + \
'21-075 Zezulin Pierwszy' + '\n\n' + \
'Results found: 2'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='single_result_duplicate_allowed')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path, allow_duplicates=True)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_single_result_twice(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'22-234 SĘKÓW' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH "BUBNOWSKIE BABY"' + '\n' + \
'Sęków 15' + '\n' + \
'22-234 Sęków' + '\n\n' + \
'======================================================================' + '\n' + \
'21-421 ZASTAWIE' + '\n\n' + \
'Koło Gospodyń Wiejskich w Zastawiu' + '\n' + \
'Zastawie 47A' + '\n' + \
'21-421 Zastawie' + '\n\n' + \
'Results found: 2'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='single_result_twice')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'38-315 KUNKOWA' + '\n\n' + \
'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Results found: 2'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_indirect_matches_skipped(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'33-393 MARCINKOWICE' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
'Marcinkowice 124' + '\n' + \
'33-393 Marcinkowice' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
'Marcinkowice 104' + '\n' + \
'33-393 Marcinkowice' + '\n\n' + \
'Koło Gospodyń Wiejskich "Marcinkowicanki"' + '\n' + \
'Marcinkowice 47' + '\n' + \
'33-273 Marcinkowice' + '\n\n' + \
'Results found: 3'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_indirect_matches_skipped')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_indirect_matches_allowed(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'24-100 TOMASZÓW' + '\n\n' + \
'Koło Gospodyń Wiejskich w Tomaszowie' + '\n' + \
'Tomaszów lok. 39' + '\n' + \
'24-100 Tomaszów' + '\n\n' + \
'Koło Gospodyń Wiejskich w Tomaszowie' + '\n' + \
'Tomaszów 44 "b"' + '\n' + \
'26-505 Tomaszów' + '\n\n' + \
'Results found: 2'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_indirect_matches_allowed')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path, allow_indirect_matches=True)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_duplicate_skipped(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'38-315 KUNKOWA' + '\n\n' + \
'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'======================================================================' + '\n' + \
'38-315 KUNKOWA' + '\n\n' + \
'Results found: 2'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_duplicate_skipped')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_duplicate_allowed(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'38-315 KUNKOWA' + '\n\n' + \
'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'======================================================================' + '\n' + \
'38-315 KUNKOWA' + '\n\n' + \
'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Results found: 4'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_duplicate_allowed')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path, allow_duplicates=True)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_twice(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'38-315 KUNKOWA' + '\n\n' + \
'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'======================================================================' + '\n' + \
'33-393 MARCINKOWICE' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
'Marcinkowice 124' + '\n' + \
'33-393 Marcinkowice' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
'Marcinkowice 104' + '\n' + \
'33-393 Marcinkowice' + '\n\n' + \
'Koło Gospodyń Wiejskich "Marcinkowicanki"' + '\n' + \
'Marcinkowice 47' + '\n' + \
'33-273 Marcinkowice' + '\n\n' + \
'Results found: 5'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_twice')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_on_multiple_pages_all_allowed(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'00-001 NOWA WIEŚ' + '\n\n' + \
'Koło Gospodyń Wiejskich Nowa Wieś Niemczańska' + '\n' + \
'Nowa Wieś Niemczańska 36 lok. 2' + '\n' + \
'58-230 Nowa Wieś Niemczańska' + '\n\n' + \
'Koło Gospodyń Wiejskich Nowowianki w Nowej Wsi Legnickiej' + '\n' + \
'Nowa Wieś Legnicka 56' + '\n' + \
'59-241 Nowa Wieś Legnicka' + '\n\n' + \
'Koło Gospodyń Wiejskich POLANKI w Nowej Wsi Grodziskiej' + '\n' + \
'Nowa Wieś Grodziska 54' + '\n' + \
'59-524 Nowa Wieś Grodziska' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi "Ale Babki"' + '\n' + \
'Nowa Wieś 63' + '\n' + \
'87-602 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 80' + '\n' + \
'88-324 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 76' + '\n' + \
'21-107 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 20C' + '\n' + \
'22-600 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 27' + '\n' + \
'99-300 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich ,,Futuryści" w Nowej Wsi' + '\n' + \
'Nowa Wieś 84' + '\n' + \
'97-340 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich Nowa Wieś "Koniczynka"' + '\n' + \
'Nowa Wieś 3' + '\n' + \
'97-330 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich Szlachcianki' + '\n' + \
'Nowa Wieś Szlachecka 1b' + '\n' + \
'32-060 Nowa Wieś Szlachecka' + '\n\n' + \
'Koło Gospodyń Wiejskich Nowa Wieś' + '\n' + \
'Nowa Wieś 42' + '\n' + \
'32-046 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi (gmina Łabowa)' + '\n' + \
'Nowa Wieś 55' + '\n' + \
'33-336 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 25' + '\n' + \
'05-660 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Babeczki z pieprzem i solą' + '\n' + \
'Nowa Wieś 52' + '\n' + \
'26-900 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich "Nowalijki" w Nowej Wsi' + '\n' + \
'ul. Reymonta 32 A' + '\n' + \
'07-416 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Wschodniej' + '\n' + \
'Nowa Wieś Wschodnia 32A' + '\n' + \
'07-411 Nowa Wieś Wschodnia' + '\n\n' + \
'Koło Gospodyń Wiejskich KAROLEWO-NOWA WIEŚ' + '\n' + \
'Nowa Wieś 1' + '\n' + \
'09-505 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich "Stokrotka"' + '\n' + \
'Nowa Wieś 7B' + '\n' + \
'09-440 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich Gospochy w Nowej Wsi' + '\n' + \
'ul. Magnolii 7' + '\n' + \
'05-806 Nowa Wieś' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W NOWEJ WSI' + '\n' + \
'ul. Wolności 37' + '\n' + \
'08-300 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś lok. 90' + '\n' + \
'36-100 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 152 A' + '\n' + \
'38-120 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich "Wespół w Zespół" w Nowej Wsi' + '\n' + \
'Nowa Wieś 18F' + '\n' + \
'16-402 Nowa Wieś' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH FIOŁKI W NOWEJ WSI' + '\n' + \
'Nowa Wieś 4' + '\n' + \
'77-320 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Przywidzkiej' + '\n' + \
'ul. Szkolna 2' + '\n' + \
'83-047 Nowa Wieś Przywidzka' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 41' + '\n' + \
'42-110 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich Nowa Wieś' + '\n' + \
'Nowa Wieś 100' + '\n' + \
'28-362 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 25' + '\n' + \
'27-640 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi „Nowalijki”' + '\n' + \
'Nowa Wieś 9A' + '\n' + \
'11-030 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Niechanowskiej "Storczyk"' + '\n' + \
'Nowa Wieś Niechanowska 14' + '\n' + \
'62-220 Nowa Wieś Niechanowska' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Książęcej' + '\n' + \
'Nowa Wieś Książęca 35' + '\n' + \
'63-640 Nowa Wieś Książęca' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W NOWEJ WSI' + '\n' + \
'Nowa Wieś ' + '\n' + \
'63-708 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi' + '\n' + \
'Nowa Wieś 19 lok. B7' + '\n' + \
'63-308 Nowa Wieś' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Podgórnej' + '\n' + \
'Nowa Wieś Podgórna 21 lok. 2' + '\n' + \
'62-320 Nowa Wieś Podgórna' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Królewskiej' + '\n' + \
'Nowa Wieś Królewska 22' + '\n' + \
'62-300 Nowa Wieś Królewska' + '\n\n' + \
'Results found: 36'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_on_multiple_pages_all_allowed')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path, allow_indirect_matches=True, allow_duplicates=True)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_on_multiple_pages_indirect_matches_skipped(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'62-300 NOWA WIEŚ' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Niechanowskiej "Storczyk"' + '\n' + \
'Nowa Wieś Niechanowska 14' + '\n' + \
'62-220 Nowa Wieś Niechanowska' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Podgórnej' + '\n' + \
'Nowa Wieś Podgórna 21 lok. 2' + '\n' + \
'62-320 Nowa Wieś Podgórna' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Królewskiej' + '\n' + \
'Nowa Wieś Królewska 22' + '\n' + \
'62-300 Nowa Wieś Królewska' + '\n\n' + \
'Results found: 3'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_on_multiple_pages_indirect_matches_skipped')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_multiple_results_with_empty_details(create_reports_dirs, remove_reports_dirs):
expected_report = \
'======================================================================' + '\n' + \
'89-200 TUR' + '\n\n' + \
'Koło Gospodyń Wiejskich Centrum Kultury Ostrowite' + '\n' + \
'ul. Szkolna 22' + '\n' + \
'89-620 Ostrowite' + '\n\n' + \
'Results found: 1'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='multiple_results_with_empty_details')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
def test_basic_use_cases(create_reports_dirs, remove_reports_dirs):
"""
no_result
single_result
multiple_results
no_result_twice
single_result_indirect_match_skipped
multiple_results_on_multiple_pages_indirect_matches_skipped
single_result_duplicate_skipped
multiple_results_twice
single_result_twice
"""
expected_report = \
'======================================================================' + '\n' + \
'33-383 MUSZYNKA' + '\n\n' + \
'======================================================================' + '\n' + \
'21-075 ZEZULIN PIERWSZY' + '\n\n' + \
'Koło Gospodyń Wiejskich "Zezulin" w Zezulinie' + '\n' + \
'Zezulin Pierwszy 22A' + '\n' + \
'21-075 Zezulin Pierwszy' + '\n\n' + \
'======================================================================' + '\n' + \
'38-315 KUNKOWA' + '\n\n' + \
'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
'Kunkowa 18' + '\n' + \
'38-315 Kunkowa' + '\n\n' + \
'======================================================================' + '\n' + \
'33-383 MUSZYNKA' + '\n\n' + \
'======================================================================' + '\n' + \
'33-322 JASIENNA' + '\n\n' + \
'======================================================================' + '\n' + \
'33-334 BOGUSZA' + '\n\n' + \
'======================================================================' + '\n' + \
'62-300 NOWA WIEŚ' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Niechanowskiej "Storczyk"' + '\n' + \
'Nowa Wieś Niechanowska 14' + '\n' + \
'62-220 Nowa Wieś Niechanowska' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Podgórnej' + '\n' + \
'Nowa Wieś Podgórna 21 lok. 2' + '\n' + \
'62-320 Nowa Wieś Podgórna' + '\n\n' + \
'Koło Gospodyń Wiejskich w Nowej Wsi Królewskiej' + '\n' + \
'Nowa Wieś Królewska 22' + '\n' + \
'62-300 Nowa Wieś Królewska' + '\n\n' + \
'======================================================================' + '\n' + \
'21-075 ZEZULIN PIERWSZY' + '\n\n' + \
'======================================================================' + '\n' + \
'33-393 MARCINKOWICE' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
'Marcinkowice 124' + '\n' + \
'33-393 Marcinkowice' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
'Marcinkowice 104' + '\n' + \
'33-393 Marcinkowice' + '\n\n' + \
'Koło Gospodyń Wiejskich "Marcinkowicanki"' + '\n' + \
'Marcinkowice 47' + '\n' + \
'33-273 Marcinkowice' + '\n\n' + \
'======================================================================' + '\n' + \
'22-234 SĘKÓW' + '\n\n' + \
'KOŁO GOSPODYŃ WIEJSKICH "BUBNOWSKIE BABY"' + '\n' + \
'Sęków 15' + '\n' + \
'22-234 Sęków' + '\n\n' + \
'======================================================================' + '\n' + \
'21-421 ZASTAWIE' + '\n\n' + \
'Koło Gospodyń Wiejskich w Zastawiu' + '\n' + \
'Zastawie 47A' + '\n' + \
'21-421 Zastawie' + '\n\n' + \
'Results found: 11'
data_dir_path, report_dir_path = get_io_dir_paths(test_suite, test_case='basic_use_cases')
searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
assert_report_file_content_equals(expected_report, searcher.report_file_path)
| 48.251462
| 145
| 0.531653
| 2,759
| 24,753
| 4.499094
| 0.093875
| 0.020624
| 0.036736
| 0.085717
| 0.873359
| 0.838315
| 0.828245
| 0.809555
| 0.795859
| 0.781036
| 0
| 0.038731
| 0.238557
| 24,753
| 512
| 146
| 48.345703
| 0.619801
| 0.009211
| 0
| 0.625
| 0
| 0
| 0.45365
| 0.136536
| 0
| 0
| 0
| 0
| 0.043182
| 1
| 0.047727
| false
| 0
| 0.004545
| 0
| 0.052273
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
bb3bccac3c361186a4bcf66d697926d46ae834d7
| 20,129
|
py
|
Python
|
vim/plugins/vim-orgmode/tests/test_plugin_navigator.py
|
Raymond-yn/dotfiles
|
b1745ff62f4285785877a2c04d93ce8fa2775964
|
[
"MIT"
] | 11
|
2018-11-16T02:30:33.000Z
|
2018-11-27T14:57:55.000Z
|
vim/plugins/vim-orgmode/tests/test_plugin_navigator.py
|
Raymond-yn/dotfiles
|
b1745ff62f4285785877a2c04d93ce8fa2775964
|
[
"MIT"
] | null | null | null |
vim/plugins/vim-orgmode/tests/test_plugin_navigator.py
|
Raymond-yn/dotfiles
|
b1745ff62f4285785877a2c04d93ce8fa2775964
|
[
"MIT"
] | 1
|
2019-01-22T06:51:51.000Z
|
2019-01-22T06:51:51.000Z
|
# -*- coding: utf-8 -*-
import unittest
import sys
sys.path.append(u'../ftplugin')
import vim
from orgmode._vim import ORGMODE
from orgmode.py3compat.encode_compatibility import *
START = True
END = False
def set_visual_selection(visualmode, line_start, line_end, col_start=1,
col_end=1, cursor_pos=START):
if visualmode not in (u'', u'V', u'v'):
raise ValueError(u'Illegal value for visualmode, must be in , V, v')
vim.EVALRESULTS['visualmode()'] = visualmode
# getpos results [bufnum, lnum, col, off]
vim.EVALRESULTS['getpos("\'<")'] = ('', '%d' % line_start, '%d' %
col_start, '')
vim.EVALRESULTS['getpos("\'>")'] = ('', '%d' % line_end, '%d' %
col_end, '')
if cursor_pos == START:
vim.current.window.cursor = (line_start, col_start)
else:
vim.current.window.cursor = (line_end, col_end)
counter = 0
class NavigatorTestCase(unittest.TestCase):
def setUp(self):
global counter
counter += 1
vim.CMDHISTORY = []
vim.CMDRESULTS = {}
vim.EVALHISTORY = []
vim.EVALRESULTS = {
# no org_todo_keywords for b
u_encode(u'exists("b:org_todo_keywords")'): u_encode('0'),
# global values for org_todo_keywords
u_encode(u'exists("g:org_todo_keywords")'): u_encode('1'),
u_encode(u'g:org_todo_keywords'): [u_encode(u'TODO'), u_encode(u'|'), u_encode(u'DONE')],
u_encode(u'exists("g:org_debug")'): u_encode(u'0'),
u_encode(u'exists("g:org_debug")'): u_encode(u'0'),
u_encode(u'exists("*repeat#set()")'): u_encode(u'0'),
u_encode(u'b:changedtick'): u_encode(u'%d' % counter),
u_encode(u"v:count"): u_encode(u'0'),
}
vim.current.buffer[:] = [ u_encode(i) for i in u"""
* Überschrift 1
Text 1
Bla bla
** Überschrift 1.1
Text 2
Bla Bla bla
** Überschrift 1.2
Text 3
**** Überschrift 1.2.1.falsch
Bla Bla bla bla
*** Überschrift 1.2.1
* Überschrift 2
* Überschrift 3
asdf sdf
""".split(u'\n') ]
if not u'Navigator' in ORGMODE.plugins:
ORGMODE.register_plugin(u'Navigator')
self.navigator = ORGMODE.plugins[u'Navigator']
def test_movement(self):
# test movement outside any heading
vim.current.window.cursor = (1, 0)
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (1, 0))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
def test_forward_movement(self):
# test forward movement
vim.current.window.cursor = (2, 0)
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (6, 3))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (10, 3))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (13, 5))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (16, 4))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (17, 2))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (18, 2))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (18, 2))
## don't move cursor if last heading is already focussed
vim.current.window.cursor = (19, 6)
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (19, 6))
## test movement with count
vim.current.window.cursor = (2, 0)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'-1')
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (6, 3))
vim.current.window.cursor = (2, 0)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'0')
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (6, 3))
vim.current.window.cursor = (2, 0)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'1')
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (6, 3))
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'3')
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (16, 4))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (18, 2))
self.navigator.next(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (18, 2))
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'0')
def test_backward_movement(self):
# test backward movement
vim.current.window.cursor = (19, 6)
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (18, 2))
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (17, 2))
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (16, 4))
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (13, 5))
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (10, 3))
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (6, 3))
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
## test movement with count
vim.current.window.cursor = (19, 6)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'-1')
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (18, 2))
vim.current.window.cursor = (19, 6)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'0')
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (18, 2))
vim.current.window.cursor = (19, 6)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'3')
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (16, 4))
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'4')
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'4')
self.navigator.previous(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
def test_parent_movement(self):
# test movement to parent
vim.current.window.cursor = (2, 0)
self.assertEqual(self.navigator.parent(mode=u'normal'), None)
self.assertEqual(vim.current.window.cursor, (2, 0))
vim.current.window.cursor = (3, 4)
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (3, 4))
vim.current.window.cursor = (16, 4)
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (10, 3))
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
vim.current.window.cursor = (15, 6)
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (10, 3))
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
## test movement with count
vim.current.window.cursor = (16, 4)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'-1')
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (10, 3))
vim.current.window.cursor = (16, 4)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'0')
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (10, 3))
vim.current.window.cursor = (16, 4)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'1')
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (10, 3))
vim.current.window.cursor = (16, 4)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'2')
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
vim.current.window.cursor = (16, 4)
vim.EVALRESULTS[u_encode(u"v:count")] = u_encode(u'3')
self.navigator.parent(mode=u'normal')
self.assertEqual(vim.current.window.cursor, (2, 2))
def test_next_parent_movement(self):
# test movement to parent
vim.current.window.cursor = (6, 0)
self.assertNotEqual(self.navigator.parent_next_sibling(mode=u'normal'), None)
self.assertEqual(vim.current.window.cursor, (17, 2))
def test_forward_movement_visual(self):
# selection start: <<
# selection end: >>
# cursor poistion: |
# << text
# text| >>
# text
# heading
set_visual_selection(u'V', 2, 4, cursor_pos=END)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV5gg'))
# << text
# text
# text| >>
# heading
set_visual_selection(u'V', 2, 5, cursor_pos=END)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV9gg'))
# << text
# x. heading
# text| >>
# heading
set_visual_selection(u'V', 12, 14, cursor_pos=END)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV15gg'))
set_visual_selection(u'V', 12, 15, cursor_pos=END)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV16gg'))
set_visual_selection(u'V', 12, 16, cursor_pos=END)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV17gg'))
# << text
# text
# text| >>
# heading
# EOF
set_visual_selection(u'V', 15, 17, cursor_pos=END)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 15ggV20gg'))
# << text >>
# heading
set_visual_selection(u'V', 1, 1, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 1ggV5gg'))
# << heading >>
# text
# heading
set_visual_selection(u'V', 2, 2, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV5gg'))
# << text >>
# heading
set_visual_selection(u'V', 1, 1, cursor_pos=END)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 1ggV5gg'))
# << |text
# heading
# text
# heading
# text >>
set_visual_selection(u'V', 1, 8, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV8ggo'))
# << |heading
# text
# heading
# text >>
set_visual_selection(u'V', 2, 8, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 6ggV8ggo'))
# << |heading
# text >>
# heading
set_visual_selection(u'V', 6, 8, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 8ggV9gg'))
# << |x. heading
# text >>
# heading
set_visual_selection(u'V', 13, 15, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 15ggV15gg'))
set_visual_selection(u'V', 13, 16, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 16ggV16ggo'))
set_visual_selection(u'V', 16, 16, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 16ggV17gg'))
# << |x. heading
# text >>
# heading
# EOF
set_visual_selection(u'V', 17, 17, cursor_pos=START)
self.assertNotEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 17ggV20gg'))
# << |heading
# text>>
# text
# EOF
set_visual_selection(u'V', 18, 19, cursor_pos=START)
self.assertEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 19ggV20gg'))
# << heading
# text|>>
# text
# EOF
set_visual_selection(u'V', 18, 19, cursor_pos=END)
self.assertEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 18ggV20gg'))
# << heading
# text|>>
# EOF
set_visual_selection(u'V', 18, 20, cursor_pos=END)
self.assertEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 18ggV20gg'))
# << |heading
# text>>
# EOF
set_visual_selection(u'V', 20, 20, cursor_pos=START)
self.assertEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 20ggV20gg'))
def test_forward_movement_visual_to_the_end_of_the_file(self):
vim.current.buffer[:] = [ u_encode(i) for i in u"""
* Überschrift 1
Text 1
Bla bla
** Überschrift 1.1
Text 2
Bla Bla bla
** Überschrift 1.2
Text 3
**** Überschrift 1.2.1.falsch
Bla Bla bla bla
test
""".split(u'\n') ]
# << |heading
# text>>
# EOF
set_visual_selection(u'V', 15, 15, cursor_pos=START)
self.assertEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 15ggV17gg'))
set_visual_selection(u'V', 15, 17, cursor_pos=END)
self.assertEqual(self.navigator.next(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 15ggV17gg'))
def test_backward_movement_visual(self):
# selection start: <<
# selection end: >>
# cursor poistion: |
# << text | >>
# text
# heading
set_visual_selection(u'V', 1, 1, cursor_pos=START)
self.assertEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! gv'))
set_visual_selection(u'V', 1, 1, cursor_pos=END)
self.assertEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! gv'))
# << heading| >>
# text
# heading
set_visual_selection(u'V', 2, 2, cursor_pos=START)
self.assertEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV2ggo'))
set_visual_selection(u'V', 2, 2, cursor_pos=END)
self.assertEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV2ggo'))
# heading
# text
# << |text
# text >>
set_visual_selection(u'V', 3, 5, cursor_pos=START)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV5ggo'))
# heading
# text
# << text
# text| >>
set_visual_selection(u'V', 3, 5, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV3ggo'))
# heading
# text
# << text
# text| >>
set_visual_selection(u'V', 8, 9, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 6ggV8ggo'))
# heading
# << text
# x. heading
# text| >>
set_visual_selection(u'V', 12, 14, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV12gg'))
set_visual_selection(u'V', 12, 15, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV12gg'))
# heading
# << |text
# x. heading
# text >>
set_visual_selection(u'V', 12, 15, cursor_pos=START)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 10ggV15ggo'))
# heading
# << text
# x. heading| >>
set_visual_selection(u'V', 12, 13, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV12gg'))
# heading
# << text
# heading
# text
# x. heading| >>
set_visual_selection(u'V', 12, 16, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV15gg'))
# << text
# heading
# text
# heading| >>
set_visual_selection(u'V', 15, 17, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 15ggV16gg'))
# heading
# << |text
# text
# heading
# text >>
set_visual_selection(u'V', 4, 8, cursor_pos=START)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV8ggo'))
# heading
# << text
# text
# heading
# text| >>
set_visual_selection(u'V', 4, 8, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 4ggV5gg'))
# heading
# << text
# text
# heading
# text| >>
set_visual_selection(u'V', 4, 5, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV4ggo'))
# BOF
# << |heading
# text
# heading
# text >>
set_visual_selection(u'V', 2, 8, cursor_pos=START)
self.assertEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV8ggo'))
# BOF
# heading
# << text
# text| >>
set_visual_selection(u'V', 3, 4, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV3ggo'))
# BOF
# << heading
# text
# text| >>
set_visual_selection(u'V', 2, 4, cursor_pos=END)
self.assertNotEqual(self.navigator.previous(mode=u'visual'), None)
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV2ggo'))
# << text
# heading
# text
# x. heading
# text| >>
set_visual_selection(u'V', 8, 14, cursor_pos=END)
self.navigator.previous(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 8ggV12gg'))
def test_parent_movement_visual(self):
# selection start: <<
# selection end: >>
# cursor poistion: |
# heading
# << text|
# text
# text >>
set_visual_selection(u'V', 4, 8, cursor_pos=START)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! gv'))
# heading
# << text|
# text
# text >>
set_visual_selection(u'V', 6, 8, cursor_pos=START)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV8ggo'))
# heading
# << text
# text
# text| >>
set_visual_selection(u'V', 6, 8, cursor_pos=END)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 6ggV5gg'))
# << |heading
# text
# text
# text >>
set_visual_selection(u'V', 2, 8, cursor_pos=START)
self.assertEqual(self.navigator.parent(mode=u'visual'), None)
# << heading
# text
# heading
# text| >>
set_visual_selection(u'V', 2, 8, cursor_pos=END)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV5gg'))
set_visual_selection(u'V', 7, 8, cursor_pos=START)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV8ggo'))
# heading
# heading
# << text
# text| >>
set_visual_selection(u'V', 12, 13, cursor_pos=END)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 12ggV12gg'))
set_visual_selection(u'V', 10, 12, cursor_pos=START)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 2ggV12ggo'))
# heading
# << text
# text
# heading| >>
set_visual_selection(u'V', 11, 17, cursor_pos=END)
self.assertEqual(self.navigator.parent(mode=u'visual'), None)
# << text
# heading
# text
# x. heading
# text| >>
set_visual_selection(u'V', 8, 14, cursor_pos=END)
self.navigator.parent(mode=u'visual')
self.assertEqual(vim.CMDHISTORY[-1], u_encode(u'normal! 8ggV12gg'))
def suite():
return unittest.TestLoader().loadTestsFromTestCase(NavigatorTestCase)
| 31.749211
| 93
| 0.696657
| 2,960
| 20,129
| 4.630405
| 0.058446
| 0.113819
| 0.056034
| 0.099518
| 0.900482
| 0.882971
| 0.872246
| 0.866117
| 0.844302
| 0.815117
| 0
| 0.031468
| 0.130111
| 20,129
| 633
| 94
| 31.799368
| 0.751285
| 0.093199
| 0
| 0.68661
| 0
| 0
| 0.123464
| 0.00681
| 0
| 0
| 0
| 0.00158
| 0.384615
| 1
| 0.034188
| false
| 0
| 0.014245
| 0.002849
| 0.054131
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
bb46960a624b1fcc9ef41fe1b43cb6eb44c59062
| 14,165
|
py
|
Python
|
src/bos_consensus/blockchain/test_blockchain.py
|
LuffyEMonkey/isaac-consensus-protocol
|
806d967d56ef8862a477b2515c7854af289c10a0
|
[
"Apache-2.0"
] | 1
|
2018-04-10T11:00:59.000Z
|
2018-04-10T11:00:59.000Z
|
src/bos_consensus/blockchain/test_blockchain.py
|
LuffyEMonkey/isaac-consensus-protocol
|
806d967d56ef8862a477b2515c7854af289c10a0
|
[
"Apache-2.0"
] | null | null | null |
src/bos_consensus/blockchain/test_blockchain.py
|
LuffyEMonkey/isaac-consensus-protocol
|
806d967d56ef8862a477b2515c7854af289c10a0
|
[
"Apache-2.0"
] | null | null | null |
from ..common import Ballot, BallotVotingResult, Message, node_factory
from ..network import Endpoint
from ..blockchain import Blockchain
from ..consensus import get_fba_module
from ..consensus.fba.isaac import IsaacState
from .util import StubTransport
IsaacConsensus = get_fba_module('isaac').IsaacConsensus
def blockchain_factory(name, address, threshold, validator_endpoint_uris):
node = node_factory(name, Endpoint.from_uri(address))
validators = list()
for uri in validator_endpoint_uris:
validators.append(
node_factory(uri, Endpoint.from_uri(uri)),
)
consensus = IsaacConsensus(node, threshold, validators)
return Blockchain(
consensus,
StubTransport()
)
def test_consensus_instantiation():
blockchain = blockchain_factory(
'n1',
'http://localhost:5001',
100,
['http://localhost:5002', 'http://localhost:5003'])
assert blockchain.node_name == 'n1'
assert blockchain.endpoint.uri_full == 'http://localhost:5001?name=n1'
assert blockchain.consensus.threshold == 100
IsaacConsensus.transport = StubTransport()
def test_state_init_to_sign():
node_name_1 = 'http://localhost:5001'
node_name_2 = 'http://localhost:5002'
node_name_3 = 'http://localhost:5003'
bc1 = blockchain_factory(
node_name_1,
'http://localhost:5001',
100,
[node_name_2, node_name_3]
)
bc2 = blockchain_factory(
node_name_2,
'http://localhost:5002',
100,
[node_name_1, node_name_3]
)
bc3 = blockchain_factory(
node_name_3,
'http://localhost:5003',
100,
[node_name_1, node_name_2]
)
bc1.consensus.add_to_validator_connected(bc2.node)
bc1.consensus.add_to_validator_connected(bc3.node)
bc1.consensus.init()
message = Message.new('message')
ballot_init_1 = Ballot.new(node_name_1, message, IsaacState.INIT, BallotVotingResult.agree)
ballot_id = ballot_init_1.ballot_id
ballot_init_2 = Ballot(ballot_id, node_name_2, message, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_1.timestamp)
ballot_init_3 = Ballot(ballot_id, node_name_3, message, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_1.timestamp)
bc1.receive_ballot(ballot_init_1)
bc1.receive_ballot(ballot_init_2)
bc1.receive_ballot(ballot_init_3)
assert bc1.consensus.slot.get_ballot_state(ballot_init_1) == IsaacState.SIGN
def test_state_init_to_all_confirm_sequence():
node_name_1 = 'http://localhost:5001'
node_name_2 = 'http://localhost:5002'
node_name_3 = 'http://localhost:5003'
bc1 = blockchain_factory(
node_name_1,
'http://localhost:5001',
100,
[node_name_2, node_name_3],
)
bc2 = blockchain_factory(
node_name_2,
'http://localhost:5002',
100,
[node_name_1, node_name_3],
)
bc3 = blockchain_factory(
node_name_3,
'http://localhost:5003',
100,
[node_name_1, node_name_2],
)
bc1.consensus.add_to_validator_connected(bc2.node)
bc1.consensus.add_to_validator_connected(bc3.node)
bc1.consensus.init()
bc2.consensus.add_to_validator_connected(bc1.node)
bc2.consensus.add_to_validator_connected(bc3.node)
bc2.consensus.init()
bc3.consensus.add_to_validator_connected(bc1.node)
bc3.consensus.add_to_validator_connected(bc2.node)
bc3.consensus.init()
message = Message.new('message')
ballot_init_1 = Ballot.new(node_name_1, message, IsaacState.INIT, BallotVotingResult.agree)
ballot_id = ballot_init_1.ballot_id
ballot_init_2 = Ballot(ballot_id, node_name_2, message, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_1.timestamp)
ballot_init_3 = Ballot(ballot_id, node_name_3, message, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_1.timestamp)
bc1.receive_ballot(ballot_init_1)
bc1.receive_ballot(ballot_init_2)
bc1.receive_ballot(ballot_init_3)
bc2.receive_ballot(ballot_init_1)
bc2.receive_ballot(ballot_init_2)
bc2.receive_ballot(ballot_init_3)
bc3.receive_ballot(ballot_init_1)
bc3.receive_ballot(ballot_init_2)
bc3.receive_ballot(ballot_init_3)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.SIGN
assert bc2.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.SIGN
assert bc3.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.SIGN
ballot_sign_1 = Ballot(ballot_id, node_name_1, message, IsaacState.SIGN, BallotVotingResult.agree,
ballot_init_1.timestamp)
ballot_sign_2 = Ballot(ballot_id, node_name_2, message, IsaacState.SIGN, BallotVotingResult.agree,
ballot_init_1.timestamp)
ballot_sign_3 = Ballot(ballot_id, node_name_3, message, IsaacState.SIGN, BallotVotingResult.agree,
ballot_init_1.timestamp)
bc1.receive_ballot(ballot_sign_1)
bc1.receive_ballot(ballot_sign_2)
bc1.receive_ballot(ballot_sign_3)
bc2.receive_ballot(ballot_sign_1)
bc2.receive_ballot(ballot_sign_2)
bc2.receive_ballot(ballot_sign_3)
bc3.receive_ballot(ballot_sign_1)
bc3.receive_ballot(ballot_sign_2)
bc3.receive_ballot(ballot_sign_3)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.ACCEPT
assert bc2.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.ACCEPT
assert bc3.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.ACCEPT
ballot_accept_1 = Ballot(ballot_id, node_name_1, message, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_1.timestamp)
ballot_accept_2 = Ballot(ballot_id, node_name_2, message, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_1.timestamp)
ballot_accept_3 = Ballot(ballot_id, node_name_3, message, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_1.timestamp)
bc1.receive_ballot(ballot_sign_1) # different state ballot
bc1.receive_ballot(ballot_accept_2)
bc1.receive_ballot(ballot_accept_3)
bc2.receive_ballot(ballot_accept_1)
bc2.receive_ballot(ballot_accept_2)
bc2.receive_ballot(ballot_sign_3) # different state ballot
bc3.receive_ballot(ballot_accept_1)
bc3.receive_ballot(ballot_accept_2)
bc3.receive_ballot(ballot_accept_3)
assert message in bc1.consensus.messages
assert bc2.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.ACCEPT
assert message in bc3.consensus.messages
def test_state_jump_from_init():
node_name_1 = 'http://localhost:5001'
node_name_2 = 'http://localhost:5002'
node_name_3 = 'http://localhost:5003'
node_name_4 = 'http://localhost:5004'
bc1 = blockchain_factory(
node_name_1,
'http://localhost:5001',
100,
[node_name_2, node_name_3, node_name_4],
)
bc2 = blockchain_factory(
node_name_2,
'http://localhost:5002',
100,
[node_name_1, node_name_3, node_name_4],
)
bc3 = blockchain_factory(
node_name_3,
'http://localhost:5003',
100,
[node_name_1, node_name_2, node_name_4],
)
bc4 = blockchain_factory(
node_name_4,
'http://localhost:5004',
100,
[node_name_1, node_name_2, node_name_3],
)
bc1.consensus.add_to_validator_connected(bc2.node)
bc1.consensus.add_to_validator_connected(bc3.node)
bc1.consensus.add_to_validator_connected(bc4.node)
bc1.consensus.init()
message = Message.new('message')
ballot_init_2 = Ballot.new(node_name_2, message, IsaacState.INIT, BallotVotingResult.agree)
ballot_id = ballot_init_2.ballot_id
ballot_init_3 = Ballot(ballot_id, node_name_3, message, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_init_4 = Ballot(ballot_id, node_name_4, message, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_2.timestamp)
bc1.receive_ballot(ballot_init_2)
bc1.receive_ballot(ballot_init_3)
bc1.receive_ballot(ballot_init_4)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.SIGN
ballot_sign_2 = Ballot(ballot_id, node_name_2, message, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_sign_3 = Ballot(ballot_id, node_name_3, message, IsaacState.SIGN, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_sign_4 = Ballot(ballot_id, node_name_4, message, IsaacState.SIGN, BallotVotingResult.agree,
ballot_init_2.timestamp)
bc1.receive_ballot(ballot_sign_2)
bc1.receive_ballot(ballot_sign_3)
bc1.receive_ballot(ballot_sign_4)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.ACCEPT
ballot_accept_3 = Ballot(ballot_id, node_name_3, message, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_accept_4 = Ballot(ballot_id, node_name_4, message, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_2.timestamp)
bc1.receive_ballot(ballot_accept_3)
bc1.receive_ballot(ballot_accept_4)
assert message in bc1.consensus.messages
def test_next_message():
node_name_1 = 'http://localhost:5001'
node_name_2 = 'http://localhost:5002'
node_name_3 = 'http://localhost:5003'
node_name_4 = 'http://localhost:5004'
bc1 = blockchain_factory(
node_name_1,
'http://localhost:5001',
100,
[node_name_2, node_name_3, node_name_4],
)
bc2 = blockchain_factory(
node_name_2,
'http://localhost:5002',
100,
[node_name_1, node_name_3, node_name_4],
)
bc3 = blockchain_factory(
node_name_3,
'http://localhost:5003',
100,
[node_name_1, node_name_2, node_name_4],
)
bc4 = blockchain_factory(
node_name_4,
'http://localhost:5004',
100,
[node_name_1, node_name_2, node_name_3],
)
bc1.consensus.add_to_validator_connected(bc2.node)
bc1.consensus.add_to_validator_connected(bc3.node)
bc1.consensus.add_to_validator_connected(bc4.node)
bc1.consensus.init()
message_1 = Message.new('message-1')
ballot_init_2 = Ballot.new(node_name_2, message_1, IsaacState.INIT, BallotVotingResult.agree)
ballot_id = ballot_init_2.ballot_id
ballot_init_3 = Ballot(ballot_id, node_name_3, message_1, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_init_4 = Ballot(ballot_id, node_name_4, message_1, IsaacState.INIT, BallotVotingResult.agree,
ballot_init_2.timestamp)
bc1.receive_ballot(ballot_init_2)
bc1.receive_ballot(ballot_init_3)
bc1.receive_ballot(ballot_init_4)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.SIGN
ballot_sign_2 = Ballot(ballot_id, node_name_2, message_1, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_sign_3 = Ballot(ballot_id, node_name_3, message_1, IsaacState.SIGN, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_sign_4 = Ballot(ballot_id, node_name_4, message_1, IsaacState.SIGN, BallotVotingResult.agree,
ballot_init_2.timestamp)
bc1.receive_ballot(ballot_sign_2)
bc1.receive_ballot(ballot_sign_3)
bc1.receive_ballot(ballot_sign_4)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.ACCEPT
ballot_accept_3 = Ballot(ballot_id, node_name_3, message_1, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_2.timestamp)
ballot_accept_4 = Ballot(ballot_id, node_name_4, message_1, IsaacState.ACCEPT, BallotVotingResult.agree,
ballot_init_2.timestamp)
bc1.receive_ballot(ballot_accept_3)
bc1.receive_ballot(ballot_accept_4)
assert message_1 in bc1.consensus.messages
message_2 = Message.new('message-2')
ballot_init_2 = Ballot.new(node_name_2, message_2, IsaacState.INIT, BallotVotingResult.agree)
ballot_id_2 = ballot_init_2.ballot_id
ballot_init_2.ballot_id = ballot_id_2
ballot_init_3.ballot_id = ballot_id_2
ballot_init_4.ballot_id = ballot_id_2
ballot_init_2.timestamp = ballot_init_2.timestamp
ballot_init_3.timestamp = ballot_init_2.timestamp
ballot_init_4.timestamp = ballot_init_2.timestamp
ballot_init_2.message = message_2
ballot_init_3.message = message_2
ballot_init_4.message = message_2
bc1.receive_ballot(ballot_init_2)
bc1.receive_ballot(ballot_init_3)
bc1.receive_ballot(ballot_init_4)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.SIGN
ballot_sign_2.ballot_id = ballot_id_2
ballot_sign_3.ballot_id = ballot_id_2
ballot_sign_4.ballot_id = ballot_id_2
ballot_sign_2.timestamp = ballot_init_2.timestamp
ballot_sign_3.timestamp = ballot_init_2.timestamp
ballot_sign_4.timestamp = ballot_init_2.timestamp
ballot_sign_2.message = message_2
ballot_sign_3.message = message_2
ballot_sign_4.message = message_2
bc1.receive_ballot(ballot_sign_2)
bc1.receive_ballot(ballot_sign_3)
bc1.receive_ballot(ballot_sign_4)
assert bc1.consensus.slot.get_ballot_state(ballot_init_2) == IsaacState.ACCEPT
ballot_accept_3.ballot_id = ballot_id_2
ballot_accept_4.ballot_id = ballot_id_2
ballot_accept_3.message = message_2
ballot_accept_4.message = message_2
ballot_accept_3.timestamp = ballot_init_2.timestamp
ballot_accept_4.timestamp = ballot_init_2.timestamp
bc1.receive_ballot(ballot_accept_3)
bc1.receive_ballot(ballot_accept_4)
assert message_1 in bc1.consensus.messages
| 35.32419
| 108
| 0.710131
| 1,880
| 14,165
| 4.948936
| 0.039362
| 0.080825
| 0.110275
| 0.085125
| 0.89166
| 0.822979
| 0.806535
| 0.730546
| 0.72356
| 0.707868
| 0
| 0.051588
| 0.202188
| 14,165
| 400
| 109
| 35.4125
| 0.771702
| 0.003177
| 0
| 0.601286
| 0
| 0
| 0.051569
| 0
| 0
| 0
| 0
| 0
| 0.07074
| 1
| 0.019293
| false
| 0
| 0.019293
| 0
| 0.041801
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
2484b713073294f833a7aedb426225a3f08b5595
| 299
|
py
|
Python
|
__init__.py
|
d-we/binja-golang-symbol-restore
|
251cc45cab66512fd404eaf69ec6e018684aa5d4
|
[
"MIT"
] | 9
|
2020-06-15T09:14:18.000Z
|
2021-12-30T19:39:33.000Z
|
__init__.py
|
d-we/binja-golang-symbol-restore
|
251cc45cab66512fd404eaf69ec6e018684aa5d4
|
[
"MIT"
] | 3
|
2020-06-10T03:29:26.000Z
|
2021-02-08T19:25:51.000Z
|
__init__.py
|
d-we/binja-golang-symbol-restore
|
251cc45cab66512fd404eaf69ec6e018684aa5d4
|
[
"MIT"
] | 3
|
2020-08-15T16:01:14.000Z
|
2020-10-14T21:48:32.000Z
|
import binaryninja
from .golang_symbol_restore import restore_golang_symbols
binaryninja.plugin.PluginCommand.register("Restore Golang Symbols",
"Fill region with breakpoint instructions.",
restore_golang_symbols)
| 42.714286
| 86
| 0.622074
| 25
| 299
| 7.2
| 0.6
| 0.216667
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.334448
| 299
| 6
| 87
| 49.833333
| 0.904523
| 0
| 0
| 0
| 0
| 0
| 0.210702
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
703a9b063f761ade9c2123a1def345dd3a9fc462
| 138
|
py
|
Python
|
pyplex/gl/__init__.py
|
pyplex/pyplex
|
66e19acb3efd1a8a69d28022edcb0b6ad5cb6b11
|
[
"MIT"
] | 5
|
2018-01-17T09:08:38.000Z
|
2020-09-20T20:38:51.000Z
|
pyplex/gl/__init__.py
|
pyplex/pyplex
|
66e19acb3efd1a8a69d28022edcb0b6ad5cb6b11
|
[
"MIT"
] | null | null | null |
pyplex/gl/__init__.py
|
pyplex/pyplex
|
66e19acb3efd1a8a69d28022edcb0b6ad5cb6b11
|
[
"MIT"
] | null | null | null |
from .gl import GL20, GL21, GL30, GL31, GL32, GL33, GL40, GL41, GL42, GL43, GL44, GL45, GL_ANY
from .enum import *
from .constant import *
| 46
| 94
| 0.710145
| 23
| 138
| 4.217391
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.208696
| 0.166667
| 138
| 3
| 95
| 46
| 0.634783
| 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
| 1
| 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
| 6
|
703aacd66e46deed1090e868e263e907aa004b9c
| 78
|
py
|
Python
|
metaL/core/__init__.py
|
ponyatov/metaLmin
|
6634b67465ea448c4a763d7c035b851579378ffd
|
[
"MIT"
] | null | null | null |
metaL/core/__init__.py
|
ponyatov/metaLmin
|
6634b67465ea448c4a763d7c035b851579378ffd
|
[
"MIT"
] | null | null | null |
metaL/core/__init__.py
|
ponyatov/metaLmin
|
6634b67465ea448c4a763d7c035b851579378ffd
|
[
"MIT"
] | null | null | null |
from .object import *
from .ns import *
from .io import *
from .time import *
| 15.6
| 21
| 0.692308
| 12
| 78
| 4.5
| 0.5
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.205128
| 78
| 4
| 22
| 19.5
| 0.870968
| 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
| 1
| 0
|
0
| 6
|
563e1dc93625ecb24de9882d6fb7672e51e4500d
| 9,664
|
py
|
Python
|
Projects/ABM_DA/bussim/A03_calibration.py
|
RobertClay/DUST-RC
|
09f7ec9d8d093021d068dff8a7a48c15ea318b86
|
[
"MIT"
] | 15
|
2018-11-21T14:57:24.000Z
|
2022-03-04T15:42:09.000Z
|
Projects/ABM_DA/bussim/A03_calibration.py
|
RobertClay/DUST-RC
|
09f7ec9d8d093021d068dff8a7a48c15ea318b86
|
[
"MIT"
] | 125
|
2019-11-06T13:03:35.000Z
|
2022-03-07T13:38:33.000Z
|
Projects/ABM_DA/bussim/A03_calibration.py
|
RobertClay/DUST-RC
|
09f7ec9d8d093021d068dff8a7a48c15ea318b86
|
[
"MIT"
] | 6
|
2018-11-20T15:56:49.000Z
|
2021-10-08T10:21:06.000Z
|
# -*- coding: utf-8 -*-
"""
This code evaluates the outputs from calibrated BusSim
@author: geomlk
"""
import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
os.chdir("/Users/minhkieu/Documents/Github/dust/Projects/ABM_DA/bussim/")
'''
Step 1: Load calibration results
'''
def load_calibrated_params_IncreaseRate(IncreaseRate):
name0 = ['./Calibration/BusSim_Model2_calibration_IncreaseRate_',str(IncreaseRate),'.pkl']
str1 = ''.join(name0)
with open(str1, 'rb') as f:
model_params, best_mean_model2,Sol_archived_mean,Sol_archived_std,PI_archived = pickle.load(f)
name0 = ['./Calibration/BusSim_Model1_calibration_IncreaseRate_',str(IncreaseRate),'.pkl']
str1 = ''.join(name0)
with open(str1, 'rb') as f:
model_params, best_mean_model1,Sol_archived_mean,Sol_archived_std,PI_archived = pickle.load(f)
return best_mean_model1,best_mean_model2
def load_calibrated_params_maxDemand(maxDemand):
name0 = ['./Calibration/BusSim_Model2_calibration_static_maxDemand_',str(maxDemand),'.pkl']
str1 = ''.join(name0)
with open(str1, 'rb') as f:
model_params, best_mean_model2,Sol_archived_mean,Sol_archived_std,PI_archived = pickle.load(f)
name0 = ['./Calibration/BusSim_Model1_calibration_static_maxDemand_',str(maxDemand),'.pkl']
str1 = ''.join(name0)
with open(str1, 'rb') as f:
model_params, best_mean_model1,Sol_archived_mean,Sol_archived_std,PI_archived = pickle.load(f)
return best_mean_model1,best_mean_model2
'''
Step 2: Load synthetic real-time data
'''
def load_actual_params_IncreaseRate(IncreaseRate):
#load up a model from a Pickle
name0 = ['./Data/Realtime_data_IncreaseRate_',str(IncreaseRate),'.pkl']
str1 = ''.join(name0)
with open(str1, 'rb') as f:
model_params,t,x,GroundTruth = pickle.load(f)
return model_params,t,x
def load_actual_params_maxDemand(maxDemand):
#load up a model from a Pickle
name0 = ['./Data/Realtime_data_static_maxDemand_',str(maxDemand),'.pkl']
str1 = ''.join(name0)
with open(str1, 'rb') as f:
model_params,t,x,GroundTruth = pickle.load(f)
return model_params,t,x
#define RMSE function
def rmse(yhat,y):
return np.sqrt(np.square(np.subtract(yhat, y).mean()))
'''
Step 3: Evaluation of calibrated models when the arrival rate is changing by 1 to 20%
'''
def IncreaseRate_analysis():
Results = [0,0]
do_plot=True
for IncreaseRate in range(1,20,2):
#load real-time data
model_params, t,x = load_actual_params_IncreaseRate(IncreaseRate)
#load calibrated parameters
best_mean_model1,best_mean_model2 = load_calibrated_params_IncreaseRate(IncreaseRate)
#load the BusSim-static model
from BusSim_stochastic import Model as Model2
ArrivalRate = best_mean_model2[0:(model_params['NumberOfStop'])]
DepartureRate = best_mean_model2[model_params['NumberOfStop']:(2*model_params['NumberOfStop'])]
TrafficSpeed = best_mean_model2[-2]
#load model
model = Model2(model_params, TrafficSpeed,ArrivalRate,DepartureRate)
for time_step in range(int(model.EndTime / model.dt)):
model.step()
x2 = np.array([bus.trajectory for bus in model.buses]).T
t2 = np.arange(0, model.EndTime, model.dt)
x2[x2 <= 0 ] = np.nan
x2[x2 >= (model.NumberOfStop * model.LengthBetweenStop)] = np.nan
#load the BusSim-stochastic model
from BusSim_deterministic import Model as Model1
ArrivalRate = best_mean_model1[0:(model_params['NumberOfStop'])]
DepartureRate = best_mean_model1[model_params['NumberOfStop']:(2*model_params['NumberOfStop'])]
TrafficSpeed = best_mean_model1[-2]
#load model
model = Model1(model_params, TrafficSpeed,ArrivalRate,DepartureRate)
for time_step in range(int(model.EndTime / model.dt)):
model.step()
x3 = np.array([bus.trajectory for bus in model.buses]).T
t3 = np.arange(0, model.EndTime, model.dt)
x3[x3 <= 0 ] = np.nan
x3[x3 >= (model.NumberOfStop * model.LengthBetweenStop)] = np.nan
#plot individual run (if needed)
if do_plot:
plt.figure(3, figsize=(16 / 2, 9 / 2))
plt.clf()
plt.plot(t, x, linewidth=1,color='black',linestyle = '-')
plt.plot(t2, x2, linewidth=1.5,linestyle = ':',color='r')
plt.ylabel('Distance (m)')
plt.xlabel('Time (s)')
plt.plot(t3, x3, linewidth=1.5,linestyle = '--',color='b')
plt.plot([], [], linewidth=1.5,linestyle = ':',color='r',label='BusSim-stochastic')
plt.plot([], [], linewidth=1.5,linestyle = '--',color='b',label='BusSim-deterministic')
plt.plot([], [], linewidth=1,color='black',linestyle = '-',label='Real-time')
plt.legend()
plt.show()
name0 = ['./Figures/Fig_calibration_IncreaseRate_',str(IncreaseRate),'.pdf']
str1 = ''.join(name0)
plt.savefig(str1, dpi=200,bbox_inches='tight')
#calculate RMSE
x3[np.isnan(x3)]=0
x2[np.isnan(x2)]=0
x[np.isnan(x)]=0
RMSE1 = rmse(x3,x)
RMSE2 = rmse(x2,x)
Results = np.vstack((Results,[RMSE1,RMSE2]))
#plot the evaluation results
do_plot_results=True
if do_plot_results:
plt.figure(3, figsize=(16 / 2, 9 / 2))
plt.clf()
plt.plot(np.arange(1,20,2),Results[1:,1],linewidth=1.5,linestyle = '--',color='b',label='BusSim-deterministic')
plt.plot(np.arange(1,20,2),Results[1:,0],linewidth=1.5,linestyle = ':',color='r',label='BusSim-stochastic')
plt.ylabel('RMSE (m)')
plt.xlabel(r'$\xi$ (%)')
plt.legend()
plt.show()
plt.savefig('./Figures/Fig_calibration_results_IncreaseRate.pdf', dpi=200,bbox_inches='tight')
return Results
'''
Step 3: Evaluation of the case when the maxDemand increases from 0.5 to 4.5
'''
def maxDemand_analysis():
Results = [0,0]
do_plot=False
for maxDemand in range(1,10,2):
maxDemand=maxDemand/2
model_params, t,x = load_actual_params_maxDemand(maxDemand)
best_mean_model1,best_mean_model2 = load_calibrated_params_maxDemand(maxDemand)
from BusSim_stochastic import Model as Model2
ArrivalRate = best_mean_model2[0:(model_params['NumberOfStop'])]
DepartureRate = best_mean_model2[model_params['NumberOfStop']:(2*model_params['NumberOfStop'])]
TrafficSpeed = best_mean_model2[-1]
#load model
model = Model2(model_params, TrafficSpeed,ArrivalRate,DepartureRate)
for time_step in range(int(model.EndTime / model.dt)):
model.step()
x2 = np.array([bus.trajectory for bus in model.buses]).T
t2 = np.arange(0, model.EndTime, model.dt)
x2[x2 <= 0 ] = np.nan
x2[x2 >= (model.NumberOfStop * model.LengthBetweenStop)] = np.nan
from BusSim_deterministic import Model as Model1
ArrivalRate = best_mean_model1[0:(model_params['NumberOfStop'])]
DepartureRate = best_mean_model1[model_params['NumberOfStop']:(2*model_params['NumberOfStop'])]
TrafficSpeed = best_mean_model1[-1]
#load model
model = Model1(model_params, TrafficSpeed,ArrivalRate,DepartureRate)
for time_step in range(int(model.EndTime / model.dt)):
model.step()
x3 = np.array([bus.trajectory for bus in model.buses]).T
t3 = np.arange(0, model.EndTime, model.dt)
x3[x3 <= 0 ] = np.nan
x3[x3 >= (model.NumberOfStop * model.LengthBetweenStop)] = np.nan
#plot individual plots if it's needed
if do_plot:
plt.figure(3, figsize=(16 / 2, 9 / 2))
plt.clf()
plt.plot(t2, x2, linewidth=1,linestyle = ':',color='r',label='BusSim-stochastic')
plt.plot(t, x, linewidth=1,color='black',linestyle = '-',label='Real-time')
plt.ylabel('Distance (m)')
plt.xlabel('Time (s)')
plt.plot(t3, x3, linewidth=.5,linestyle = '--',color='b',label='BusSim-deterministic')
plt.legend()
plt.show()
name0 = ['./Figures/Fig_calibration_maxDemand_',str(maxDemand),'.pdf']
str1 = ''.join(name0)
plt.savefig(str1, dpi=200,bbox_inches='tight')
#calculate RMSE for each run
x3[np.isnan(x3)]=0
x2[np.isnan(x2)]=0
x[np.isnan(x)]=0
RMSE1 = rmse(x3,x)
RMSE2 = rmse(x2,x)
Results = np.vstack((Results,[RMSE1,RMSE2]))
#plot the evaluation results
do_plot_results=True
if do_plot_results:
plt.figure(3, figsize=(16 / 2, 9 / 2))
plt.clf()
plt.plot(np.arange(1,10,2),Results[1:,0],linewidth=1.5,linestyle = '--',color='b',label='BusSim-deterministic')
plt.plot(np.arange(1,10,2),Results[1:,1],linewidth=1.5,linestyle = ':',color='r',label='BusSim-stochastic')
plt.ylabel('RMSE (m)')
plt.xlabel(r'$maxDemand$ (passenger/min)')
plt.xticks(np.arange(1,10,2), (np.arange(1,10,2)/2))
plt.legend()
plt.show()
plt.savefig('./Figures/Fig_calibration_results_maxDemand.pdf', dpi=200,bbox_inches='tight')
return Results
if __name__ == '__main__': #main code, just call the evaluation codes
Results = IncreaseRate_analysis()
#Results = maxDemand_analysis()
| 45.158879
| 119
| 0.627276
| 1,244
| 9,664
| 4.71865
| 0.141479
| 0.048722
| 0.02862
| 0.025894
| 0.851448
| 0.807836
| 0.776831
| 0.765758
| 0.725724
| 0.679557
| 0
| 0.035256
| 0.233961
| 9,664
| 214
| 120
| 45.158879
| 0.757666
| 0.06012
| 0
| 0.670732
| 0
| 0
| 0.118463
| 0.059686
| 0
| 0
| 0
| 0
| 0
| 1
| 0.042683
| false
| 0.006098
| 0.04878
| 0.006098
| 0.134146
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
56708965d6fec056a956b940dd9b227f3d8fbfd4
| 8,820
|
py
|
Python
|
dist_train/workers/baseline.py
|
victorcampos7/edl
|
ffdf23d4e102ca7d69a1408bafa267b0c7d8bfa0
|
[
"MIT"
] | 30
|
2020-02-16T15:52:59.000Z
|
2022-03-22T10:54:54.000Z
|
dist_train/workers/baseline.py
|
imatge-upc/edl
|
ffdf23d4e102ca7d69a1408bafa267b0c7d8bfa0
|
[
"MIT"
] | null | null | null |
dist_train/workers/baseline.py
|
imatge-upc/edl
|
ffdf23d4e102ca7d69a1408bafa267b0c7d8bfa0
|
[
"MIT"
] | 7
|
2020-02-16T15:53:05.000Z
|
2022-01-18T03:41:03.000Z
|
# Copyright (c) 2019, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: MIT
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
import os
import json
import time
import torch
import numpy as np
from dist_train.utils.shared_optim import SharedAdam as Adam
from dist_train.workers.base import EpisodicOffPolicyManager, OffPolicyManager, OnPolicyManager, PPOManager
class EpisodicOffPolicy(EpisodicOffPolicyManager):
def rollout_wrapper(self, c_ep_counter):
st = time.time()
self.agent_model.play_episode()
# Add episode for training.
self.replay_buffer.add_episode(self.agent_model.transitions_for_buffer(training=True))
dur = time.time() - st
# Calculate losses to allow dense logging
episode_stats = self.agent_model.episode_summary()
self._log_rollout(c_ep_counter, dur, episode_stats)
def _log_rollout(self, c_ep_counter, dur, episode_stats):
# Increment the steps counters, place the log in the epoch buffer, and give a quick rollout print
c_ep_counter += 1
self.time_keeper['n_rounds'] += 1
n_steps = int(self.agent_model.train_steps.data.item()) + int(c_ep_counter.item())
timestamp = ''.join('{:017.4f}'.format(time.time()).split('.'))
log = {'{:d}.{}'.format(n_steps, timestamp): [str(sl) for sl in episode_stats]}
self.epoch_buffer.append(log)
dense_save = False # (int(self.time_keeper['n_rounds']) % self.settings.ep_save) == 0 and self.rank == 0
log_str = '{:10d} - {} {:6d} Dur = {:6.2f}, Steps = {:3d} {} {}'.format(
n_steps,
'*' if dense_save else ' ',
int(self.time_keeper['n_rounds']),
dur,
int(self.agent_model.n_steps),
'!!!' if int(self.agent_model.was_success) else ' ',
'*' if dense_save else ' '
)
self.logger.info(log_str)
def eval_wrapper(self):
stats = []
episodes = {}
for evi in range(self.config.get('eval_iters', 10)):
self.agent_model.play_episode(do_eval=self.config.get('greedy_eval', True))
ep_stats = [float(x) for x in self.agent_model.episode_summary()]
stats.append(ep_stats)
dump_ep = []
for t in self.agent_model.curr_ep:
dump_t = {k: np.array(v.detach()).tolist() for k, v in t.items()}
dump_ep.append(dump_t)
episodes[evi] = dump_ep
return stats, episodes
class OffPolicy(OffPolicyManager):
def env_transitions_wrapper(self, c_step_counter, num_transitions):
# Collect transitions and update counter
self.agent_model.collect_transitions(num_transitions, skip_im_rew=True)
c_step_counter += num_transitions
# Add episode for training
self.replay_buffer.add_episode(self.agent_model.transitions_for_buffer(training=True))
def eval_wrapper(self):
stats = []
episodes = {}
for evi in range(self.config.get('eval_iters', 10)):
self.agent_model.play_episode(do_eval=self.config.get('greedy_eval', True))
ep_stats = [float(x) for x in self.agent_model.episode_summary()]
stats.append(ep_stats)
dump_ep = []
for t in self.agent_model.curr_ep:
dump_t = {k: np.array(v.cpu().detach()).tolist() for k, v in t.items()}
dump_ep.append(dump_t)
episodes[evi] = dump_ep
return stats, episodes
class HierarchicalEpisodicOffPolicy(EpisodicOffPolicy):
def __init__(self, rank, config, settings):
super().__init__(rank, config, settings)
self.optim_lo_path = os.path.join(self.exp_dir, 'optim_lo.pth.tar')
self.optim_lo = Adam(self.agent_model._lo_parameters, lr=config['learning_rate'])
if os.path.isfile(self.optim_lo_path):
self.optim_lo.load_state_dict(torch.load(self.optim_lo_path))
def checkpoint(self):
super().checkpoint()
torch.save(self.optim_lo, self.optim_lo_path)
def rollout_wrapper(self, c_ep_counter):
st = time.time()
self.agent_model.play_episode(optim_lo=self.optim_lo)
self.agent_model.relabel_episode()
# Add episode for training.
self.replay_buffer.add_episode(self.agent_model.transitions_for_buffer(training=True))
dur = time.time() - st
# Calculate losses to allow dense logging
episode_stats = self.agent_model.episode_summary()
self._log_rollout(c_ep_counter, dur, episode_stats)
class OnPolicy(OnPolicyManager):
def rollout_wrapper(self, c_ep_counter):
st = time.time()
self.agent_model.eval()
self.agent_model.play_episode()
self.agent_model.train()
loss = self.condense_loss(self.agent_model())
dur = time.time() - st
# Calculate losses to allow dense logging
episode_stats = self.agent_model.episode_summary()
self._log_rollout(c_ep_counter, dur, episode_stats)
return loss
def _log_rollout(self, c_ep_counter, dur, episode_stats):
c_ep_counter += 1
n_steps = int(self.agent_model.train_steps.data.item()) + int(c_ep_counter.item())
timestamp = ''.join('{:017.4f}'.format(time.time()).split('.'))
dense_save = False # (int(self.time_keeper['n_rounds']) % self.settings.ep_save) == 0 and self.rank == 0
# The burden to save falls to us
if dense_save:
dstr = '{:010d}.{}'.format(n_steps, timestamp)
config_path = self.settings.config_path
exp_name = config_path.split('/')[-1][:-5]
exp_dir = os.path.join(self.settings.log_dir, exp_name)
c_path = os.path.join(exp_dir, dstr + '.json')
dump_ep = []
for t in self.agent_model.curr_ep:
dump_t = {k: np.array(v.detach()).tolist() for k, v in t.items()}
dump_ep.append(dump_t)
with open(c_path, 'wt') as f:
json.dump(dump_ep, f)
self.time_keeper['ep_save'] = int(self.time_keeper['n_rounds'])
# Increment the steps counters and log the results.
self.time_keeper['n_rounds'] += 1
hist_name = 'hist_{}.json'.format(self.rank)
with open(os.path.join(self.exp_dir, hist_name), 'a') as save_file:
log = {'{:d}.{}'.format(n_steps, timestamp): [str(sl) for sl in episode_stats]}
save_file.write(json.dumps(log))
save_file.close()
log_str = '{:10d} - {} {:6d} Dur = {:6.2f}, Steps = {:3d} {} {}'.format(
n_steps,
'*' if dense_save else ' ',
int(self.time_keeper['n_rounds']),
dur,
int(self.agent_model.n_steps),
'!!!' if int(self.agent_model.was_success) else ' ',
'*' if dense_save else ' '
)
self.logger.info(log_str)
def eval_wrapper(self):
stats = []
episodes = {}
for evi in range(self.config.get('eval_iters', 10)):
self.agent_model.play_episode(do_eval=bool(self.config.get('greedy_eval', True)))
ep_stats = [float(x) for x in self.agent_model.episode_summary()]
stats.append(ep_stats)
dump_ep = []
for t in self.agent_model.curr_ep:
dump_t = {k: np.array(v.detach()).tolist() for k, v in t.items()}
dump_ep.append(dump_t)
episodes[evi] = dump_ep
return stats, episodes
class PPO(PPOManager, OnPolicy):
def rollout_wrapper(self, c_ep_counter):
st = time.time()
self.agent_model.reach_horizon()
dur = time.time() - st
# Calculate losses to allow dense logging
episode_stats = self.agent_model.episode_summary()
self._log_rollout(c_ep_counter, dur, episode_stats)
class HierarchicalPPO(PPO):
def __init__(self, rank, config, settings):
super().__init__(rank, config, settings)
self.optim_lo_path = os.path.join(self.exp_dir, 'optim_lo.pth.tar')
self.optim_lo = Adam(self.agent_model._lo_parameters, lr=config['learning_rate'])
if os.path.isfile(self.optim_lo_path):
self.optim_lo.load_state_dict(torch.load(self.optim_lo_path))
def checkpoint(self):
super().checkpoint()
torch.save(self.optim_lo, self.optim_lo_path)
def rollout_wrapper(self, c_ep_counter):
st = time.time()
self.agent_model.reach_horizon(optim_lo=self.optim_lo)
dur = time.time() - st
# Calculate losses to allow dense logging
episode_stats = self.agent_model.episode_summary()
self._log_rollout(c_ep_counter, dur, episode_stats)
| 37.372881
| 113
| 0.625057
| 1,191
| 8,820
| 4.373636
| 0.164568
| 0.0622
| 0.096756
| 0.032252
| 0.760799
| 0.739105
| 0.722404
| 0.722404
| 0.722404
| 0.722404
| 0
| 0.006525
| 0.252834
| 8,820
| 236
| 114
| 37.372881
| 0.783915
| 0.096485
| 0
| 0.742331
| 0
| 0.01227
| 0.045403
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.092025
| false
| 0
| 0.042945
| 0
| 0.196319
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 6
|
8e673db362c569f9ad4cae086dd2478daf171db2
| 13,601
|
py
|
Python
|
figures.py
|
maria-kuruvilla/temp_collective_new
|
c45b72cee7c17072507eb67790d1699f5684098a
|
[
"MIT"
] | null | null | null |
figures.py
|
maria-kuruvilla/temp_collective_new
|
c45b72cee7c17072507eb67790d1699f5684098a
|
[
"MIT"
] | null | null | null |
figures.py
|
maria-kuruvilla/temp_collective_new
|
c45b72cee7c17072507eb67790d1699f5684098a
|
[
"MIT"
] | null | null | null |
"""
Code to plot average nearest neighbor distance between fish in a school as a function of group size - one line per water temperature.
"""
# imports
import sys, os
import numpy as np
import matplotlib.pyplot as plt
import pickle
from matplotlib import cm
import argparse
#argparse
def boolean_string(s):
# this function helps with getting Boolean input
if s not in ['False', 'True']:
raise ValueError('Not a valid boolean string')
return s == 'True' # note use of ==
# create the parser object
parser = argparse.ArgumentParser()
# NOTE: argparse will throw an error if:
# - a flag is given with no value
# - the value does not match the type
# and if a flag is not given it will be filled with the default.
parser.add_argument('-a', '--a_string', default='annd', type=str)
#parser.add_argument('-s', '--a_string', default='annd_std', type=str)
parser.add_argument('-b', '--integer_b', default=3, type=int)
parser.add_argument('-c', '--float_c', default=1.5, type=float)
parser.add_argument('-v', '--verbose', default=True, type=boolean_string)
# Note that you assign a short name and a long name to each argument.
# You can use either when you call the program, but you have to use the
# long name when getting the values back from "args".
# get the arguments
args = parser.parse_args()
xx=0
h = 0.3
if args.a_string=='annd':
y_label = 'ANND (Body Length)'
xx = 1
if args.a_string=='speed':
y_label = 'Speed (Body Length/s)'
if args.a_string=='acceleration':
y_label = 'Acceleration (Body Length/s'+r'$^2$)'
if args.a_string=='polarization':
y_label = 'Polarization'
xx=1
if args.a_string=='spikes':
y_label = 'Number of \n startles'
h = 0.4
if args.a_string=='accurate':
y_label = 'Number of \n accurate startles'
h = 0.4
if args.a_string=='latency':
y_label = 'Latency (frames)'
if args.a_string=='local_pol':
y_label = 'Local polarization'
xx = 1
if args.a_string=='local_pol_m':
y_label = 'Local polarization'
xx = 1
if args.a_string=='dtc':
y_label = 'Distance to center \n (pixels)'
if args.a_string=='dtc_roi':
y_label = 'Distance to center \n (pixels)'
if args.a_string=='dtc_roi_norm':
y_label = 'Distance to center \n (Body Length)'
if args.a_string=='percentile_speed99':
y_label = '99th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed90':
y_label = '90th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed80':
y_label = '80th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed70':
y_label = '70th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed60':
y_label = '60th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed100':
y_label = '100th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed_low_pass99':
y_label = '99th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed_low_pass90':
y_label = '90th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed_low_pass80':
y_label = '80th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed_low_pass70':
y_label = '70th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed_low_pass60':
y_label = '60th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_speed_low_pass100':
y_label = '100th percentile of speed \n (Body Length/s)'
if args.a_string=='percentile_acc99':
y_label = '99th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc90':
y_label = '90th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc80':
y_label = '80th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc70':
y_label = '70th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc60':
y_label = '60th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc100':
y_label = '100th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc_low_pass99':
y_label = '99th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc_low_pass90':
y_label = '90th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc_low_pass80':
y_label = '80th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc_low_pass70':
y_label = '70th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc_low_pass60':
y_label = '60th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='percentile_acc_low_pass100':
y_label = '100th percentile of \n acceleration \n (Body Length/s'+r'$^2$)'
if args.a_string=='unmasked_startles':
y_label = 'No. of startles \n per unit unmasked time'
if args.a_string=='max_loom_speed':
y_label = 'Maximum speed during loom \n (Body Length/s)'
if args.a_string=='loom_speed99':
y_label = '99th percentile of \n speed during loom \n (Body Length/s)'
if args.a_string=='loom_speed90':
y_label = '90th percentile of \n speed during loom \n (Body Length/s)'
if args.a_string=='max_loom_acc':
y_label = 'Maximum acceleration during loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='loom_acc99':
y_label = '99th percentile of \n acceleration during loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='loom_acc90':
y_label = '90th percentile of \n acceleration during loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='max_loom_speed_low_pass':
y_label = 'Maximum speed during loom \n (Body Length/s)'
if args.a_string=='loom_speed99_low_pass':
y_label = '99th percentile of \n speed during loom \n (Body Length/s)'
if args.a_string=='loom_speed90_low_pass':
y_label = '90th percentile of \n speed during loom \n (Body Length/s)'
if args.a_string=='max_loom_acc_low_pass':
y_label = 'Maximum acceleration during loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='loom_acc99_low_pass':
y_label = '99th percentile of \n acceleration during loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='loom_acc90_low_pass':
y_label = '90th percentile of \n acceleration during loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='ratio_max_loom_speed_low_pass':
y_label = 'Ratio of maximum \n speed during loom \n to before loom'
if args.a_string=='ratio_loom_speed99_low_pass':
y_label = 'Ratio of 99th percentile of \n speed during loom \n to before loom'
if args.a_string=='ratio_loom_speed90_low_pass':
y_label = 'Ratio of 90th percentile of \n speed during loom \n to before loom'
if args.a_string=='ratio_max_loom_acc_low_pass':
y_label = 'Ratio of maximum \n acceleration during loom \n to before loom'
if args.a_string=='ratio_loom_acc99_low_pass':
y_label = 'Ratio of 99th percentile of \n acceleration during loom \n to before loom'
if args.a_string=='ratio_loom_acc90_low_pass':
y_label = 'Ratio of 90th percentile of \n acceleration during loom \n to before loom'
if args.a_string=='ratio_loom_acc50_low_pass':
y_label = 'Ratio of 50th percentile of \n acceleration during loom \n to before loom'
if args.a_string=='ratio_loom_speed50_low_pass':
y_label = 'Ratio of 50th percentile of \n speed during loom \n to before loom'
if args.a_string=='max_non_loom_speed_low_pass':
y_label = 'Maximum speed before loom \n (Body Length/s)'
if args.a_string=='non_loom_speed99_low_pass':
y_label = '99th percentile of \n speed before loom \n (Body Length/s)'
if args.a_string=='non_loom_speed90_low_pass':
y_label = '90th percentile of \n speed before loom \n (Body Length/s)'
if args.a_string=='max_non_loom_acc_low_pass':
y_label = 'Maximum acceleration before loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='non_loom_acc99_low_pass':
y_label = '99th percentile of \n acceleration before loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='non_loom_acc90_low_pass':
y_label = '90th percentile of \n acceleration before loom \n (Body Length/s'+r'$^2$)'
if args.a_string=='unmasked_startles_ratio':
y_label = 'Proportion of accurate startles'
if args.a_string=='new_masked_startles_ratio':
y_label = 'Proportion of accurate startles'
if args.a_string=='prop_startles':
y_label = 'Proportion of individuals \n that startle'
xx=1
if args.a_string=='prop_startles_new_mask':
y_label = 'Proportion of individuals \n that startle'
xx=1
if args.a_string=='prop_startles_no_nan_new_mask':
y_label = 'Proportion of individuals \n that startle'
xx=1
if args.a_string=='loom_startles':
y_label = 'Number of startles \n per fish during loom'
if args.a_string=='loom_startles_normalized':
y_label = 'Number of startles \n per fish during loom'
if args.a_string=='preloom_startles_normalized':
y_label = 'Number of startles \n per fish before loom'
if args.a_string=='nonloom_startles_normalized':
y_label = 'Number of startles \n per fish between looms'
if args.a_string=='ind_startle_speed':
y_label = 'Maximum startle speed \n (Body Length/s)'
if args.a_string=='ind_median_speed':
y_label = 'Median speed before loom \n (Body Length/s)'
if args.a_string=='ind_ratio_speed':
y_label = 'Ratio of max startle speed \n to median speed before loom'
in_dir1 = '../../output/temp_collective/roi/' + args.a_string + '.p'
annd_values = pickle.load(open(in_dir1, 'rb')) # 'rb is for read binary
in_dir2 = '../../output/temp_collective/roi/' + args.a_string + '_std.p'
out_dir = '../../output/temp_collective/roi_figures/' + args.a_string + '.png'
std_annd_values = pickle.load(open(in_dir2, 'rb')) # 'rb is for read binary
temperature = [9,13,17,21,25,29]
if xx == 0:
group = [1,2,4,8,16]
else:
group = [2,4,8,16]
#group = [1,8]
x = 5 # 5 for gs upto 16
#Plotting
lw=1.25
fs=12
colors = plt.cm.viridis(np.linspace(0,1,6))
plt.close('all') # always start by cleaning up
fig = plt.figure(figsize=(10,6))
ax = fig.add_subplot(211)
plt.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=h)
for i in range(6):
ax.plot(group[:x], annd_values[i,:x], label = str(temperature[i])+ r'$^{\circ}$C', linewidth = lw, color = colors[i])
ax.fill_between(group[:x], annd_values[i,:x] - std_annd_values[i,:x], annd_values[i,:x] + std_annd_values[i,:x], alpha = 0.3, color = colors[i])
plt.xlabel('Group Size', size = fs)
plt.ylabel(y_label, size = fs)
plt.xscale('log',basex=2)
if xx == 0:
plt.xticks(ticks = [1,2,4,8,16], labels = [1,2,4,8,16])
else:
plt.xticks(ticks = [2,4,8,16], labels = [2,4,8,16])
"""
if xx == 0:
plt.xticks(ticks = [1,2,4,8,16,32], labels = [1,2,4,8,16,32])
else:
plt.xticks(ticks = [2,4,8,16,32], labels = [2,4,8,16,32])
"""
#plt.xlim(right = 30)
ax.tick_params(labelsize=.9*fs)
ax.set_title('a)', loc='left', fontsize = fs)
plt.legend(fontsize=fs, loc='upper right', title = 'Water Temperature', framealpha = 0.5)
x=6
colors = plt.cm.viridis(np.linspace(0,1,5)) # 5 for gs upto 16
ax = fig.add_subplot(212)
for i in range(4):
ax.plot(temperature[0:x], annd_values[0:x,i], label = str(group[i]), linewidth = lw, color = colors[i])
ax.fill_between(temperature[0:x], annd_values[0:x,i] - std_annd_values[0:x,i], annd_values[0:x,i] + std_annd_values[0:x,i], alpha = 0.3, color = colors[i])
plt.xlabel('Temperature '+r'($^{\circ}$C)', size = fs)
plt.locator_params(axis='x', nbins=5)
plt.ylabel(y_label, size = fs)
plt.xticks(ticks = [9,13,17,21,25,29], labels = [9,13,17,21,25,29])
#plt.xlim(right = 30)
ax.tick_params(labelsize=.9*fs)
ax.set_title('b)', loc='left', fontsize = fs)
plt.legend(fontsize=fs, loc='upper right', title = 'Group Size', framealpha = 0.5)
fig.savefig(out_dir, dpi = 300)
plt.show()
"""
#SPEED
in_dir1 = '../../output/temp_collective/roi/average_speed.p'
speed_values = pickle.load(open(in_dir1, 'rb')) # 'rb is for read binary
in_dir2 = '../../output/temp_collective/roi/speed_std.p'
out_dir = '../../output/temp_collective/roi_figures/speed.png'
std_speed = pickle.load(open(in_dir2, 'rb')) # 'rb is for read binary
temperature = [29,25,21,17,13,9]
group = [1,2,4,8,16]
x = 5
#Plotting
lw=1.25
fs=14
colors = plt.cm.viridis_r(np.linspace(0,1,6))
plt.close('all') # always start by cleaning up
fig = plt.figure(figsize=(12,8))
ax = fig.add_subplot(211)
for i in range(6):
ax.plot(group[0:x], speed_values[i,0:x], label = str(temperature[i])+ r'$^{\circ}$C', linewidth = lw, color = colors[i])
ax.fill_between(group[0:x], speed_values[i,0:x] - std_speed[i,0:x], speed_values[i,0:x] + std_speed[i,0:x], alpha = 0.3, color = colors[i])
plt.xlabel('Group Size', size = 0.9*fs)
plt.ylabel('Speed (Body Length/s)', size = 0.9*fs)
ax.tick_params(labelsize=.8*fs)
ax.set_title('a)', loc='left', fontsize = fs)
plt.legend(fontsize=fs, loc='upper right', title = 'Water Temperature')
x=6
colors = plt.cm.viridis(np.linspace(0,1,5))
ax = fig.add_subplot(212)
for i in range(1,5):
ax.plot(temperature[0:x], speed_values[0:x,i], label = str(group[i]), linewidth = lw, color = colors[i])
ax.fill_between(temperature[0:x], speed_values[0:x,i] - std_speed[0:x,i], speed_values[0:x,i] + std_speed[0:x,i], alpha = 0.3, color = colors[i])
plt.xlabel('Temperature '+r'($^{\circ}$C)', size = 0.9*fs)
plt.locator_params(axis='x', nbins=5)
plt.ylabel('Speed (Body Length/s)', size = 0.9*fs)
ax.tick_params(labelsize=.8*fs)
ax.set_title('b)', loc='left', fontsize = fs)
plt.legend(fontsize=fs, loc='upper right', title = 'Group Size')
#fig.suptitle('Average Nearest Neighbor Distance (ANND)', size = 1.5*fs)
fig.savefig(out_dir)
plt.show()
"""
| 35.792105
| 160
| 0.710462
| 2,404
| 13,601
| 3.849002
| 0.121048
| 0.060521
| 0.092727
| 0.105371
| 0.818653
| 0.794661
| 0.758133
| 0.72852
| 0.690587
| 0.668972
| 0
| 0.038361
| 0.131755
| 13,601
| 379
| 161
| 35.886544
| 0.745194
| 0.063378
| 0
| 0.286996
| 0
| 0
| 0.503086
| 0.097643
| 0
| 0
| 0
| 0
| 0
| 1
| 0.004484
| false
| 0.143498
| 0.026906
| 0
| 0.035874
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 6
|
8eed562bb3ffb90d5a64ae9eed83f174c8c31c52
| 11,116
|
py
|
Python
|
util/modules_asym.py
|
Isaac-Li-cn/certify_robustness
|
f904dc923afc6354e406c57a1c923d13fc39d315
|
[
"BSD-3-Clause"
] | null | null | null |
util/modules_asym.py
|
Isaac-Li-cn/certify_robustness
|
f904dc923afc6354e406c57a1c923d13fc39d315
|
[
"BSD-3-Clause"
] | null | null | null |
util/modules_asym.py
|
Isaac-Li-cn/certify_robustness
|
f904dc923afc6354e406c57a1c923d13fc39d315
|
[
"BSD-3-Clause"
] | null | null | null |
"""
这个文件修改自原文件,修改内容包括:
1. 删除quadratic algorithm的使用,因为还没想好该怎么用
2. 从原来的单扰动改为多扰动
"""
'''
>>> This file creates modules that can do forward, backward pass as well as bound propagation
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from abc import ABCMeta, abstractmethod
import numpy as np
from .linearize import linearize_relu, linearize_sigd, linearize_tanh, linearize_arctan
from .utility import reduced_m_bm, reduced_bm_bm, reduced_bv_bm, reduced_bm_bv, quad_bound_calc
class Layer(nn.Module, metaclass = ABCMeta):
def __init__(self,):
super(Layer, self).__init__()
@abstractmethod
def forward(self, x):
'''
>>> do forward pass with a given input
'''
raise NotImplementedError
@abstractmethod
def bound(self, l, u, W_list, m1_list, m2_list, ori_perturb_norm = None, ori_perturb_eps1 = None, ori_perturb_eps2 = None, first_layer = False):
'''
>>> do bound calculation
>>> l, u: the lower and upper bound of the input, of shape [batch_size, immediate_in_dim]
>>> W_list: the transformation matrix introduced by the previous layers, of shape [batch_size, out_dim, in_dim]
>>> m1_list, m2_list: the bias introduced by the previous layers, of shape [batch_size, in_dim]
>>> ori_perturb_norm, ori_perturb_eps: the original perturbation, default is None
>>> first_layer: boolean, whether or not this layer is the first layer
'''
raise NotImplementedError
class FCLayer(Layer):
def __init__(self, in_features, out_features):
super(FCLayer, self).__init__()
self.in_features = in_features
self.out_features = out_features
self.layer = nn.Linear(in_features, out_features)
def forward(self, x):
return F.linear(x, self.layer.weight, self.layer.bias)
def bound(self, l, u, W_list, m1_list, m2_list, ori_perturb_norm = None, ori_perturb_eps1 = None, ori_perturb_eps2 = None, first_layer = False):
batch_size = l.shape[0]
# # quad method
# # if the bias term in the last iteration is the same, we can merge it with the current one
# max_var = torch.max(torch.abs(m1_list[-1] - m2_list[-1]))
# # Update the transition weight matrix
# update_list = W_list if max_var > 1e-4 or ori_perturb_norm != None else W_list[:-1]
# for idx, W in enumerate(update_list):
# W_list[idx] = reduced_m_bm(self.layer.weight, W)
# # Add the contribution of this layer
# if max_var > 1e-4 or ori_perturb_norm != None:
# W_list.append(torch.ones([batch_size, self.out_features], device = self.layer.weight.device))
# m1_list.append(self.layer.bias.unsqueeze(0).repeat(batch_size, 1))
# m2_list.append(self.layer.bias.unsqueeze(0).repeat(batch_size, 1))
# else:
# W_list[-1] = torch.ones([batch_size, self.out_features], device = self.layer.weight.device)
# m1_list[-1] = torch.matmul(m1_list[-1], self.layer.weight.transpose(0, 1)) + self.layer.bias
# m2_list[-1] = torch.matmul(m2_list[-1], self.layer.weight.transpose(0, 1)) + self.layer.bias
# quad_low_bound, quad_up_bound = quad_bound_calc(W_list, m1_list, m2_list, ori_perturb_norm, ori_perturb_eps)
# simp method
if first_layer == True:
primal_norm = ori_perturb_norm
dual_norm = 1. / (1. - 1. / primal_norm)
adjust1 = torch.norm(self.layer.weight.unsqueeze(0) * ori_perturb_eps1.unsqueeze(1), dim = 2, p = dual_norm) # of shape [batch_size, out_dim]
adjust2 = torch.norm(self.layer.weight.unsqueeze(0) * ori_perturb_eps2.unsqueeze(1), dim = 2, p = dual_norm) # of shape [batch_size, out_dim]
else:
adjust = 0.
W_neg = torch.clamp(self.layer.weight, max = 0.)
W_pos = torch.clamp(self.layer.weight, min = 0.)
low_bound = l.matmul(W_pos.t()) + u.matmul(W_neg.t()) - adjust1 + self.layer.bias
up_bound = l.matmul(W_neg.t()) + u.matmul(W_pos.t()) + adjust2 + self.layer.bias
# low_bound = torch.max(quad_low_bound, simp_low_bound)
# up_bound = torch.min(quad_up_bound, simp_up_bound)
return low_bound, up_bound, W_list, m1_list, m2_list
class ReLULayer(Layer):
def __init__(self,):
super(ReLULayer, self).__init__()
def forward(self, x):
return F.relu(x, inplace = True)
def bound(self, l, u, W_list, m1_list, m2_list, ori_perturb_norm = None, ori_perturb_eps = None, first_layer = False):
assert first_layer == False, 'the first layer cannot be ReLU'
batch_size = l.shape[0]
# # quad method
# # Obtain D, m1, m2
# D, m1, m2 = linearize_relu(l, u)
# D = D.reshape(batch_size, -1) # of shape [batch_size, dim]
# m1 = m1.reshape(batch_size, -1) # of shape [batch_size, dim]
# m2 = m2.reshape(batch_size, -1) # of shape [batch_size, dim]
# out_dim = D.shape[1]
# # For potential merge
# max_var = torch.max(torch.abs(m1_list[-1] - m2_list[-1]))
# # Update
# update_list = W_list if max_var > 1e-4 else W_list[:-1]
# for idx, W in enumerate(update_list):
# W_list[idx] = reduced_bm_bm(D, W)
# # Add the contribution of this layer
# if max_var > 1e-4:
# W_list.append(torch.ones([batch_size, out_dim], device = D.device))
# m1_list.append(m1)
# m2_list.append(m2)
# else:
# m1_list[-1] = m1_list[-1] * D + m1
# m2_list[-1] = m2_list[-1] * D + m2
# quad_low_bound, quad_up_bound = quad_bound_calc(W_list, m1_list, m2_list, ori_perturb_norm, ori_perturb_eps)
# simp method
low_bound = F.relu(l, inplace = True)
up_bound = F.relu(u, inplace = True)
# low_bound = torch.max(quad_low_bound, simp_low_bound)
# up_bound = torch.min(quad_up_bound, simp_up_bound)
return low_bound, up_bound, W_list, m1_list, m2_list
class SigdLayer(Layer):
def __init__(self,):
super(SigdLayer, self).__init__()
def forward(self, x):
return F.sigmoid(x)
def bound(self, l, u, W_list, m1_list, m2_list, ori_perturb_norm = None, ori_perturb_eps = None, first_layer = False):
assert first_layer == False, 'the first layer cannot be ReLU'
batch_size = l.shape[0]
# # quad method
# # Obtain D, m1, m2
# D, m1, m2 = linearize_sigd(l, u)
# D = D.reshape(batch_size, -1)
# m1 = m1.reshape(batch_size, -1)
# m2 = m2.reshape(batch_size, -1)
# out_dim = D.shape[1]
# # For potential merge
# max_var = torch.max(torch.abs(m1_list[-1] - m2_list[-1]))
# # Update
# update_list = W_list if max_var > 1e-4 else W_list[:-1]
# for idx, W in enumerate(update_list):
# W_list[idx] = reduced_bm_bm(D, W)
# # Add the contribution of this layer
# if max_var > 1e-4:
# W_list.append(torch.ones([batch_size, out_dim], device = D.device))
# m1_list.append(m1)
# m2_list.append(m2)
# else:
# m1_list[-1] = m1_list[-1] * D + m1
# m2_list[-1] = m2_list[-1] * D + m2
# quad_low_bound, quad_up_bound = quad_bound_calc(W_list, m1_list, m2_list, ori_perturb_norm, ori_perturb_eps)
# simp method
low_bound = F.sigmoid(l)
up_bound = F.sigmoid(u)
# low_bound = torch.max(quad_low_bound, simp_low_bound)
# up_bound = torch.min(quad_up_bound, simp_up_bound)
return low_bound, up_bound, W_list, m1_list, m2_list
class TanhLayer(Layer):
def __init__(self,):
super(TanhLayer, self).__init__()
def forward(self, x):
return torch.tanh(x)
def bound(self, l, u, W_list, m1_list, m2_list, ori_perturb_norm = None, ori_perturb_eps = None, first_layer = False):
assert first_layer == False, 'the first layer cannot be ReLU'
batch_size = l.shape[0]
# # quad method
# # Obtain D, m1, m2
# D, m1, m2 = linearize_tanh(l, u)
# D = D.reshape(batch_size, -1)
# m1 = m1.reshape(batch_size, -1)
# m2 = m2.reshape(batch_size, -1)
# out_dim = D.shape[1]
# # For potential merge
# max_var = torch.max(torch.abs(m1_list[-1] - m2_list[-1]))
# # Update
# update_list = W_list if max_var > 1e-4 else W_list[:-1]
# for idx, W in enumerate(update_list):
# W_list[idx] = reduced_bm_bm(D, W)
# # Add the contribution of this layer
# if max_var > 1e-4:
# W_list.append(torch.ones([batch_size, out_dim], device = D.device))
# m1_list.append(m1)
# m2_list.append(m2)
# else:
# m1_list[-1] = m1_list[-1] * D + m1
# m2_list[-1] = m2_list[-1] * D + m2
# quad_low_bound, quad_up_bound = quad_bound_calc(W_list, m1_list, m2_list, ori_perturb_norm, ori_perturb_eps)
# simp method
low_bound = torch.tanh(l)
up_bound = torch.tanh(u)
# low_bound = torch.max(quad_low_bound, simp_low_bound)
# up_bound = torch.min(quad_up_bound, simp_up_bound)
return low_bound, up_bound, W_list, m1_list, m2_list
class ArctanLayer(Layer):
def __init__(self,):
super(ArctanLayer, self).__init__()
def forward(self, x):
return torch.atan(x)
def bound(self, l, u, W_list, m1_list, m2_list, ori_perturb_norm = None, ori_perturb_eps = None, first_layer = False):
assert first_layer == False, 'the first layer cannot be ReLU'
batch_size = l.shape[0]
# # quad method
# # Obtain D, m1, m2
# D, m1, m2 = linearize_arctan(l, u)
# D = D.reshape(batch_size, -1)
# m1 = m1.reshape(batch_size, -1)
# m2 = m2.reshape(batch_size, -1)
# out_dim = D.shape[1]
# # For potential merge
# max_var = torch.max(torch.abs(m1_list[-1] - m2_list[-1]))
# # Update
# update_list = W_list if max_var > 1e-4 else W_list[:-1]
# for idx, W in enumerate(update_list):
# W_list[idx] = reduced_bm_bm(D, W)
# # Add the contribution of this layer
# if max_var > 1e-4:
# W_list.append(torch.ones([batch_size, out_dim], device = D.device))
# m1_list.append(m1)
# m2_list.append(m2)
# else:
# m1_list[-1] = m1_list[-1] * D + m1
# m2_list[-1] = m2_list[-1] * D + m2
# quad_low_bound, quad_up_bound = quad_bound_calc(W_list, m1_list, m2_list, ori_perturb_norm, ori_perturb_eps)
# simp method
low_bound = torch.atan(l)
up_bound = torch.atan(u)
# low_bound = torch.max(quad_low_bound, simp_low_bound)
# up_bound = torch.min(quad_up_bound, simp_up_bound)
return low_bound, up_bound, W_list, m1_list, m2_list
| 35.066246
| 154
| 0.609662
| 1,650
| 11,116
| 3.830909
| 0.10303
| 0.030059
| 0.021516
| 0.032273
| 0.743237
| 0.722038
| 0.712071
| 0.706217
| 0.685335
| 0.637716
| 0
| 0.028543
| 0.27195
| 11,116
| 316
| 155
| 35.177215
| 0.752502
| 0.496402
| 0
| 0.421687
| 0
| 0
| 0.02284
| 0
| 0
| 0
| 0
| 0
| 0.048193
| 1
| 0.216867
| false
| 0
| 0.096386
| 0.060241
| 0.506024
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 6
|
d907a43938650d8d6f9175971c2ee412f0e1b223
| 1,430
|
py
|
Python
|
Problems/primetest.py
|
NielsonJ/Project-Euler
|
d54dce5461825c440a094310c3567b88c6f9a150
|
[
"MIT"
] | null | null | null |
Problems/primetest.py
|
NielsonJ/Project-Euler
|
d54dce5461825c440a094310c3567b88c6f9a150
|
[
"MIT"
] | 1
|
2020-03-11T08:06:25.000Z
|
2020-03-11T08:06:34.000Z
|
Problems/primetest.py
|
NielsonJ/Project-Euler
|
d54dce5461825c440a094310c3567b88c6f9a150
|
[
"MIT"
] | null | null | null |
from libs.primelib import Prime
import cProfile
import time
# Test variable's
primeindex = 100000
primecheck = 1000000000000
def main():
prime = Prime()
print('test 1:')
start = time.clock()
value = prime.getByIndex(primeindex)
end = time.clock()
print('value: ' + str(value))
print('time: ' + str(end - start))
print()
print('test 2:')
start = time.clock()
value = prime.getByIndex(primeindex)
end = time.clock()
print('value: ' + str(value))
print('time: ' + str(end - start))
print()
prime1 = Prime()
prime2 = Prime()
print('test 4:')
start = time.clock()
value = prime1.checkIfPrime(primecheck)
end = time.clock()
print('value: ' + str(value))
print('time: ' + str(end - start))
print()
print('test 5:')
start = time.clock()
value = prime1.checkIfPrime(primecheck)
end = time.clock()
print('value: ' + str(value))
print('time: ' + str(end - start))
print()
print('test 6:')
start = time.clock()
value = prime2.checkIfPrime(primecheck)
end = time.clock()
print('value: ' + str(value))
print('time: ' + str(end - start))
print()
print('test 7:')
start = time.clock()
value = prime2.checkIfPrime(primecheck)
end = time.clock()
print('value: ' + str(value))
print('time: ' + str(end - start))
print()
if __name__ == '__main__':
main()
| 21.666667
| 43
| 0.58042
| 166
| 1,430
| 4.951807
| 0.204819
| 0.131387
| 0.10219
| 0.138686
| 0.781022
| 0.781022
| 0.781022
| 0.781022
| 0.781022
| 0.781022
| 0
| 0.028972
| 0.251748
| 1,430
| 65
| 44
| 22
| 0.739252
| 0.01049
| 0
| 0.679245
| 0
| 0
| 0.090587
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.018868
| false
| 0
| 0.056604
| 0
| 0.075472
| 0.45283
| 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
| 1
|
0
| 6
|
d9863370e480b53bf264ca69904724291538c799
| 105
|
py
|
Python
|
application/configuration/views.py
|
pernaess/ctrlpnl
|
e0636f3b19d4a5ec5e96120526f238888271391d
|
[
"MIT"
] | 34
|
2020-01-27T15:07:25.000Z
|
2021-09-25T17:07:37.000Z
|
application/configuration/views.py
|
pernaess/ctrlpnl
|
e0636f3b19d4a5ec5e96120526f238888271391d
|
[
"MIT"
] | 26
|
2020-01-29T12:24:42.000Z
|
2022-03-12T00:16:44.000Z
|
application/configuration/views.py
|
pernaess/ctrlpnl
|
e0636f3b19d4a5ec5e96120526f238888271391d
|
[
"MIT"
] | 7
|
2020-01-27T11:42:11.000Z
|
2021-04-05T04:42:22.000Z
|
from django.shortcuts import redirect
def login_redirect(request):
return redirect('/account/login')
| 26.25
| 37
| 0.790476
| 13
| 105
| 6.307692
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114286
| 105
| 4
| 38
| 26.25
| 0.88172
| 0
| 0
| 0
| 0
| 0
| 0.132075
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0.333333
| 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
| 1
| 1
| 0
|
0
| 6
|
7940074a7371928505748d90b9c862ee5b2d225e
| 82
|
py
|
Python
|
haystack/nodes/question_generator/__init__.py
|
mapapa/haystack
|
79fdda8a7cf393d774803608a4874f2a6e63cf6f
|
[
"Apache-2.0"
] | 7
|
2022-01-22T18:58:54.000Z
|
2022-03-18T17:06:35.000Z
|
haystack/nodes/question_generator/__init__.py
|
mapapa/haystack
|
79fdda8a7cf393d774803608a4874f2a6e63cf6f
|
[
"Apache-2.0"
] | 17
|
2021-12-08T18:00:58.000Z
|
2021-12-28T14:03:27.000Z
|
haystack/nodes/question_generator/__init__.py
|
mapapa/haystack
|
79fdda8a7cf393d774803608a4874f2a6e63cf6f
|
[
"Apache-2.0"
] | 1
|
2022-01-05T15:24:36.000Z
|
2022-01-05T15:24:36.000Z
|
from haystack.nodes.question_generator.question_generator import QuestionGenerator
| 82
| 82
| 0.926829
| 9
| 82
| 8.222222
| 0.777778
| 0.459459
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036585
| 82
| 1
| 82
| 82
| 0.936709
| 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
| 1
| 0
|
0
| 6
|
79dc47eea0d2277e80b8015449551a4eef9526a7
| 235
|
py
|
Python
|
terrafirma/calendar/apps.py
|
AlexandraAlter/django-terrafirma
|
afce5946f173aded2b4bfea78cf1b1034ec32272
|
[
"MIT"
] | null | null | null |
terrafirma/calendar/apps.py
|
AlexandraAlter/django-terrafirma
|
afce5946f173aded2b4bfea78cf1b1034ec32272
|
[
"MIT"
] | null | null | null |
terrafirma/calendar/apps.py
|
AlexandraAlter/django-terrafirma
|
afce5946f173aded2b4bfea78cf1b1034ec32272
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class CalendarConfig(AppConfig):
name = 'terrafirma.calendar'
label = 'terrafirma_calendar'
verbose_name = _('Terrafirma Calendar')
| 26.111111
| 54
| 0.770213
| 26
| 235
| 6.769231
| 0.653846
| 0.306818
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153191
| 235
| 8
| 55
| 29.375
| 0.884422
| 0
| 0
| 0
| 0
| 0
| 0.242553
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
8de1d142174d05fb9706941c985835cf92bd890c
| 242
|
py
|
Python
|
allauth/account/admin.py
|
k1000/django-allauth
|
e67b05fde5635f19850de73558987573c085826f
|
[
"MIT"
] | 1
|
2015-11-05T15:17:10.000Z
|
2015-11-05T15:17:10.000Z
|
allauth/account/admin.py
|
k1000/django-allauth
|
e67b05fde5635f19850de73558987573c085826f
|
[
"MIT"
] | null | null | null |
allauth/account/admin.py
|
k1000/django-allauth
|
e67b05fde5635f19850de73558987573c085826f
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# from models import PasswordReset
#
# class PasswordResetAdmin(admin.ModelAdmin):
# list_display = ["user", "temp_key", "timestamp", "reset"]
#
# admin.site.register(PasswordReset, PasswordResetAdmin)
| 26.888889
| 63
| 0.747934
| 25
| 242
| 7.16
| 0.76
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128099
| 242
| 8
| 64
| 30.25
| 0.848341
| 0.805785
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
8df73822b76b3e31a9ba5cf5bb546df14eb33a80
| 38
|
py
|
Python
|
pipeline/__init__.py
|
tom-010/python-pipeline
|
6be08206b96d56b0c206f12384548e52f5075be6
|
[
"Apache-2.0"
] | null | null | null |
pipeline/__init__.py
|
tom-010/python-pipeline
|
6be08206b96d56b0c206f12384548e52f5075be6
|
[
"Apache-2.0"
] | null | null | null |
pipeline/__init__.py
|
tom-010/python-pipeline
|
6be08206b96d56b0c206f12384548e52f5075be6
|
[
"Apache-2.0"
] | null | null | null |
from pipeline.pipeline import pipeline
| 38
| 38
| 0.894737
| 5
| 38
| 6.8
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078947
| 38
| 1
| 38
| 38
| 0.971429
| 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
| 1
| 0
|
0
| 6
|
30d54fa27b6407cf613e47ef65f685b9f45ab6fc
| 37
|
py
|
Python
|
src/RGT/userProfile/__init__.py
|
danrg/RGT-tool
|
115ba9a93686595699b3e182958921b3d60382b3
|
[
"MIT"
] | 7
|
2015-02-09T12:12:04.000Z
|
2019-03-31T08:23:36.000Z
|
src/RGT/userProfile/__init__.py
|
danrg/RGT-tool
|
115ba9a93686595699b3e182958921b3d60382b3
|
[
"MIT"
] | 3
|
2015-07-05T20:49:14.000Z
|
2017-07-03T19:45:18.000Z
|
src/RGT/userProfile/__init__.py
|
danrg/RGT-tool
|
115ba9a93686595699b3e182958921b3d60382b3
|
[
"MIT"
] | 1
|
2021-03-23T14:01:22.000Z
|
2021-03-23T14:01:22.000Z
|
from views import displayUserProfile
| 18.5
| 36
| 0.891892
| 4
| 37
| 8.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 37
| 1
| 37
| 37
| 1
| 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
| 1
| 0
|
0
| 6
|
30dd9689a3bf67ed453ecd720684aa2b2390bfa6
| 4,680
|
py
|
Python
|
authors/apps/articles/tests/test_like_comments.py
|
andela/ah-codeofduty
|
ab749037dbb08712a2e47848e31a1ccb14de1165
|
[
"BSD-3-Clause"
] | null | null | null |
authors/apps/articles/tests/test_like_comments.py
|
andela/ah-codeofduty
|
ab749037dbb08712a2e47848e31a1ccb14de1165
|
[
"BSD-3-Clause"
] | 41
|
2018-10-23T08:45:43.000Z
|
2022-03-11T23:34:18.000Z
|
authors/apps/articles/tests/test_like_comments.py
|
andela/ah-codeofduty
|
ab749037dbb08712a2e47848e31a1ccb14de1165
|
[
"BSD-3-Clause"
] | 3
|
2020-05-01T16:21:13.000Z
|
2021-05-11T08:25:11.000Z
|
from .base import BaseTest
from authors.apps.articles.models import Article
from rest_framework.views import status
import json
class CommentsLikeDislikeTestCase(BaseTest):
"""test class for liking and disliking comments """
def create_article(self, token, article):
""" Method to create an article"""
return self.client.post(self.ARTICLES, self.test_article_data,
HTTP_AUTHORIZATION=self.token, format='json')
def create_comment(self, token, slug, test_comment_data):
""" Method to create an article then comment"""
self.client.post(self.ARTICLES, self.test_article_data,
HTTP_AUTHORIZATION=self.token, format='json')
return self.client.post('/api/articles/test-title12/comment/', self.test_comment_data,
HTTP_AUTHORIZATION=self.token, format='json')
def test_like_comment(self):
"""Test test the liking of a comment"""
# article created
response = self.create_article(self.token, self.test_article_data)
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
# creating a comment
slug = response.data['slug']
response = self.create_comment(self.token, slug, self.test_comment_data)
comment_id = response.data["id"]
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
# like a comment
response = self.client.put('/api/articles/test-title12/comment/' + str(comment_id) + '/like/',
HTTP_AUTHORIZATION=self.token, format='json')
self.assertEquals(status.HTTP_200_OK, response.status_code)
def test_unlike_comment(self):
"""Test test the liking of a comment"""
response = self.create_article(self.token, self.test_article_data)
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
slug = response.data['slug']
response = self.create_comment(self.token, slug, self.test_comment_data)
comment_id = response.data["id"]
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
response = self.client.put('/api/articles/test-title12/comment/' + str(comment_id) + '/like/',
HTTP_AUTHORIZATION=self.token, format='json')
self.assertEquals(status.HTTP_200_OK, response.status_code)
def test_like_missing_article(self):
"""Test test the liking of a comment"""
response = self.create_article(self.token, self.test_article_data)
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
slug = response.data['slug']
response = self.create_comment(self.token, slug, self.test_comment_data)
comment_id = response.data["id"]
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
response = self.client.put('/api/articles/me/comment/' + str(comment_id) + '/dislike/',
HTTP_AUTHORIZATION=self.token,
format='json'
)
self.assertEquals(status.HTTP_404_NOT_FOUND, response.status_code)
def test_like_missing_comment(self):
"""Test test the liking of a comment"""
response = self.create_article(self.token, self.test_article_data)
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
slug = response.data['slug']
response = self.create_comment(self.token, slug, self.test_comment_data)
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
response = self.client.put('/api/articles/test-title12/comment/99/dislike/',
HTTP_AUTHORIZATION=self.token,
format='json'
)
self.assertEquals(status.HTTP_404_NOT_FOUND, response.status_code)
def test_like_comment_if_article_does_not_exist(self):
"""Test test the liking of a comment in an article that does not exist"""
slug = 'test-title12'
response = self.create_comment(self.token, slug, self.test_comment_data)
comment_id = response.data["id"]
self.assertEquals(status.HTTP_201_CREATED, response.status_code)
# like a comment
response = self.client.put('/api/articles/test-title123/comment/' + str(comment_id) + '/like/',
HTTP_AUTHORIZATION=self.token,
format='json'
)
self.assertEquals(response.data['Error'], 'The article does not exist')
| 47.272727
| 103
| 0.640385
| 546
| 4,680
| 5.283883
| 0.130037
| 0.059272
| 0.099133
| 0.117158
| 0.835009
| 0.8
| 0.8
| 0.793761
| 0.767071
| 0.753899
| 0
| 0.015544
| 0.257692
| 4,680
| 98
| 104
| 47.755102
| 0.814911
| 0.082051
| 0
| 0.651515
| 0
| 0
| 0.079529
| 0.049882
| 0
| 0
| 0
| 0
| 0.212121
| 1
| 0.106061
| false
| 0
| 0.060606
| 0
| 0.212121
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 6
|
30f3cfcf7af0bb5923bab6a38ac6e979bd553f2b
| 275
|
py
|
Python
|
sphinxcontrib/__init__.py
|
nikicc/anaconda-recipes
|
9c611a5854bf41bbc5e7ed9853dc71c0851a62ef
|
[
"BSD-3-Clause"
] | 130
|
2015-07-28T03:41:21.000Z
|
2022-03-16T03:07:41.000Z
|
sphinxcontrib/__init__.py
|
nikicc/anaconda-recipes
|
9c611a5854bf41bbc5e7ed9853dc71c0851a62ef
|
[
"BSD-3-Clause"
] | 147
|
2017-08-13T04:31:27.000Z
|
2022-03-07T11:22:23.000Z
|
sphinxcontrib/__init__.py
|
nikicc/anaconda-recipes
|
9c611a5854bf41bbc5e7ed9853dc71c0851a62ef
|
[
"BSD-3-Clause"
] | 72
|
2015-07-29T02:35:56.000Z
|
2022-02-26T14:31:15.000Z
|
# This empty file makes the sphinxcontrib namespace package work.
# It is the only file included in the 'sphinxcontrib' conda package.
# Conda packages which use the sphinxcontrib namespace do not include
# this file, but depend on the 'sphinxcontrib' conda package instead.
| 55
| 69
| 0.796364
| 40
| 275
| 5.475
| 0.625
| 0.292237
| 0.228311
| 0.255708
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 275
| 4
| 70
| 68.75
| 0.948052
| 0.967273
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 1
| 1
| 1
| 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
| 6
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.