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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
324260c88bea23764586a668ddc1efbe0053ddc4 | 41 | py | Python | src/nprintml/learn/__init__.py | nprint/nPrintML | 69e56036fd7ab6b050cbe81b31309c06f166f0f2 | [
"Apache-2.0"
] | 13 | 2020-11-04T14:57:12.000Z | 2021-11-18T08:50:00.000Z | src/nprintml/learn/__init__.py | nprint/nPrintML | 69e56036fd7ab6b050cbe81b31309c06f166f0f2 | [
"Apache-2.0"
] | 60 | 2020-10-22T16:08:14.000Z | 2021-12-14T23:00:36.000Z | src/nprintml/learn/__init__.py | nprint/nprintml | 69e56036fd7ab6b050cbe81b31309c06f166f0f2 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:10:18.000Z | 2021-12-16T01:10:18.000Z | from .automl import AutoML # noqa: F401
| 20.5 | 40 | 0.731707 | 6 | 41 | 5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0.195122 | 41 | 1 | 41 | 41 | 0.818182 | 0.243902 | 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 |
08cde5bcc6f2417d6046eee9c51928ef6e711759 | 107 | py | Python | lambda_function.py | DallasPetsAlive/New_Digs_Automation | 60e63b3b0a562a83da6e0c6ff1710527473855e3 | [
"MIT"
] | null | null | null | lambda_function.py | DallasPetsAlive/New_Digs_Automation | 60e63b3b0a562a83da6e0c6ff1710527473855e3 | [
"MIT"
] | null | null | null | lambda_function.py | DallasPetsAlive/New_Digs_Automation | 60e63b3b0a562a83da6e0c6ff1710527473855e3 | [
"MIT"
] | null | null | null | from new_digs_automation import automations
def lambda_handler(event, context):
return automations()
| 17.833333 | 43 | 0.803738 | 13 | 107 | 6.384615 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140187 | 107 | 5 | 44 | 21.4 | 0.902174 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
08efad46a3852c784ff66ceb49863ad741b44168 | 74 | py | Python | src/cipr/commands/main.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | 1 | 2015-04-19T20:53:15.000Z | 2015-04-19T20:53:15.000Z | src/cipr/commands/main.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | null | null | null | src/cipr/commands/main.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | 2 | 2016-04-11T15:35:10.000Z | 2020-04-13T10:42:32.000Z | from cipr.commands import app, core
def main():
app.command.main()
| 14.8 | 35 | 0.675676 | 11 | 74 | 4.545455 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.202703 | 74 | 5 | 36 | 14.8 | 0.847458 | 0 | 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 |
412ba9d22d59540b6b8ccf827dcb5c9b099969db | 138 | py | Python | syft/core/frameworks/__init__.py | ceballosiker/PySyft | 9680f5ebddec9d4e31eefade8d0b9b19f30ba32c | [
"Apache-2.0"
] | 2 | 2018-12-24T14:46:16.000Z | 2018-12-24T16:53:47.000Z | syft/core/frameworks/__init__.py | ashgreat/PySyft | 41a525443881bfd94ccb488d7a24765c1778ac05 | [
"Apache-2.0"
] | null | null | null | syft/core/frameworks/__init__.py | ashgreat/PySyft | 41a525443881bfd94ccb488d7a24765c1778ac05 | [
"Apache-2.0"
] | 1 | 2018-11-12T10:59:30.000Z | 2018-11-12T10:59:30.000Z | from syft.core.frameworks import torch, tensorflow, numpy, encode, pandas
__all__ = ["torch", "tensorflow", "numpy", "encode", "pandas"]
| 34.5 | 73 | 0.717391 | 16 | 138 | 5.9375 | 0.6875 | 0.315789 | 0.421053 | 0.547368 | 0.673684 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115942 | 138 | 3 | 74 | 46 | 0.778689 | 0 | 0 | 0 | 0 | 0 | 0.231884 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 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 |
f5ab54af88beb8823f00c21ccfad2a0871e06cd4 | 119 | py | Python | climi/uuuu/__init__.py | ahheo/climi | d51d8faedb9bf1b6554733af469d15e1cffdc4e2 | [
"MIT"
] | null | null | null | climi/uuuu/__init__.py | ahheo/climi | d51d8faedb9bf1b6554733af469d15e1cffdc4e2 | [
"MIT"
] | null | null | null | climi/uuuu/__init__.py | ahheo/climi | d51d8faedb9bf1b6554733af469d15e1cffdc4e2 | [
"MIT"
] | null | null | null | from .ffff import *
from .cccc import *
from .xxxx import *
from .bbbb import *
from .gggg import *
from .rgd import *
| 17 | 19 | 0.697479 | 18 | 119 | 4.611111 | 0.444444 | 0.60241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.201681 | 119 | 6 | 20 | 19.833333 | 0.873684 | 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 |
f5b6a989abb860a141f151f1782c8b5ce7bde5b0 | 14,846 | py | Python | ewetasker/delivery/channels.py | gsi-upm/ewetasker_server | 70287385013834ba65b582a431eaf89520d86b12 | [
"Apache-2.0"
] | null | null | null | ewetasker/delivery/channels.py | gsi-upm/ewetasker_server | 70287385013834ba65b582a431eaf89520d86b12 | [
"Apache-2.0"
] | null | null | null | ewetasker/delivery/channels.py | gsi-upm/ewetasker_server | 70287385013834ba65b582a431eaf89520d86b12 | [
"Apache-2.0"
] | null | null | null | from data.sparql.channels import *
from data.sparql.actions import *
from data.sparql.parameters import *
from data.sparql.events import *
from rdflib import Graph, URIRef, Literal
import json
import logging
log = logging.getLogger('tester.sub')
#log.warning('warning test')
# get base channels
def get_base_channels():
channels = {"@context": { "@vocab" : "http://www.gsi.dit.upm.es/ontologies/ewe#"}, "channels" : []}
channels_result = get_all_base_channels()
index = 0
for uri, label, comment, logo, color_uri in channels_result:
color_result = get_channel_colour(color_uri)
color=""
for color_hex in color_result:
color = color_hex[0]
channels["channels"].append({"@id" : uri, "rdfs:label" : label.n3(), "rdfs:comment" : comment.n3(), "foaf:logo" : logo.n3(), "color" : color, "events" : [], "actions" : [], "parameters" : []})
actions_result = get_channel_actions(uri)
action_index = 0
for action_uri, action_label, action_comment in actions_result:
channels["channels"][index]["actions"].append({"@id" : action_uri, "rdfs:label" : action_label.n3(), "rdfs:comment" : action_comment.n3(), "input_parameters" : [], "output_parameters" : []})
channels["channels"][index]["actions"][action_index]["input_parameters"]=get_parse_parameters(get_input_parameters(action_uri, uri))
channels["channels"][index]["actions"][action_index]["output_parameters"]=get_parse_parameters(get_output_parameters(action_uri, uri))
"""
# get input parameters
input_params_result = get_input_parameters(action_uri, uri)
for input_param_uri, input_param_label, input_param_comment, input_param_datatype, input_param_operation in input_params_result:
channels["channels"][index]["actions"][action_index]["input_parameters"].append({"@id" : input_param_uri, "rdfs:label" : input_param_label.n3(), "rdfs:comment" : input_param_comment.n3(), "rdf:datatype" : input_param_datatype})
# get output parameters
output_params_result = get_output_parameters(action_uri, uri)
for output_param_uri, output_param_label, output_param_comment, output_param_datatype, output_param_operation in output_params_result:
channels["channels"][index]["actions"][action_index]["output_parameters"].append({"@id" : output_param_uri, "rdfs:label" : output_param_label.n3(), "rdfs:comment" : output_param_comment.n3(), "rdf:datatype" : output_param_datatype})
"""
action_index+=1
# get events
events_result = get_channel_events(uri)
event_index = 0
for event_uri, event_label, event_comment in events_result:
channels["channels"][index]["events"].append({"@id" : event_uri, "rdfs:label" : event_label.n3(), "rdfs:comment" : event_comment.n3(), "input_parameters" : [], "output_parameters" : []})
channels["channels"][index]["events"][event_index]["input_parameters"]=get_parse_parameters(get_input_parameters(event_uri, uri))
channels["channels"][index]["events"][event_index]["output_parameters"]=get_parse_parameters(get_output_parameters(event_uri, uri))
"""
# get input parameters
input_params_result = get_input_parameters(event_uri, uri)
for input_param_uri, input_param_label, input_param_comment, input_param_datatype, input_param_operation in input_params_result:
channels["channels"][index]["events"][event_index]["input_parameters"].append({"@id" : input_param_uri, "rdfs:label" : input_param_label.n3(), "rdfs:comment" : input_param_comment.n3(), "rdf:datatype" : input_param_datatype})
# get output parameters
output_params_result = get_output_parameters(event_uri, uri)
for output_param_uri, output_param_label, output_param_comment, output_param_datatype, output_param_operation in output_params_result:
channels["channels"][index]["events"][event_index]["output_parameters"].append({"@id" : output_param_uri, "rdfs:label" : output_param_label.n3(), "rdfs:comment" : output_param_comment.n3(), "rdf:datatype" : output_param_datatype})
"""
event_index+=1
# get channel parameters
parameters_result = get_channel_parameters(uri)
for param_uri, param_label, param_comment, param_datatype in parameters_result:
channels["channels"][index]["parameters"].append({"@id" : param_uri, "rdfs:label" : param_label.n3(), "rdfs:comment" : param_comment.n3(), "rdf:datatype" : param_datatype})
index+=1
return json.dumps(channels).replace('\\"', "")
# get custom channels
def get_custom_channels():
channels = {"@context": { "@vocab" : "http://www.gsi.dit.upm.es/ontologies/ewe#"}, "channels" : []}
channels_result = get_all_custom_channels()
index = 0
for uri, label, comment, baseChannel, logo, color_uri in channels_result:
color_result = get_channel_colour(color_uri)
color=""
for color_hex in color_result:
color = color_hex[0]
channels["channels"].append({"@id" : uri, "rdfs:label" : label.n3(), "rdfs:comment" : comment.n3(), "foaf:logo" : logo.n3(), "color" : color, "rdf:type" : baseChannel, "parameters" : []})
parameters_result = get_custom_channel_parameters(uri)
for param_uri, param_label, param_value, param_datatype in parameters_result:
channels["channels"][index]["parameters"].append({"@id" : param_uri, "rdfs:label" : param_label.n3(), "rdf:value" : param_value.n3(), "rdf:datatype" : param_datatype})
index+=1
return json.dumps(channels).replace('\\"', "")
# get channels
def get_custom_category_channels(category_uri):
channels = {"@context": { "@vocab" : "http://www.gsi.dit.upm.es/ontologies/ewe#"}, "channels" : []}
channels_result = get_all_custom_category_channels(category_uri)
index = 0
for uri, label, comment, baseChannel, logo, color_uri in channels_result:
color_result = get_channel_colour(color_uri)
color=""
for color_hex in color_result:
color = color_hex[0]
channels["channels"].append({"@id" : uri, "rdfs:label" : label.n3(), "rdfs:comment" : comment.n3(), "foaf:logo" : logo.n3(), "color" : color, "rdf:type" : baseChannel, "parameters" : []})
parameters_result = get_custom_channel_parameters(uri)
for param_uri, param_label, param_value, param_datatype, param_base in parameters_result:
channels["channels"][index]["parameters"].append({"@id" : param_uri, "rdfs:label" : param_label.n3(), "rdf:value" : param_value.n3(), "rdf:datatype" : param_datatype})
index+=1
return json.dumps(channels).replace('\\"', "")
# get subchannels of channel
def get_subchannels_of_channel(channel_uri):
channels = {"@context": { "@vocab" : "http://www.gsi.dit.upm.es/ontologies/ewe#"}, "channels" : []}
channels_result = get_all_subchannels(channel_uri)
index = 0
for uri, label, comment in channels_result:
channels["channels"].append({"@id" : uri, "rdfs:label" : label.n3(), "rdfs:comment" : comment.n3(), "parameters" : [], "rdf:type" : channel_uri})
parameters_result = get_custom_channel_parameters(uri)
for param_uri, param_label, param_value, param_datatype, param_base in parameters_result:
channels["channels"][index]["parameters"].append({"@id" : param_uri, "rdfs:label" : param_label.n3(), "rdf:value" : param_value.n3(), "rdf:type" : param_base})
index+=1
return json.dumps(channels).replace('\\"', "")
# get channels of a certain category
def get_category_channels(category_uri):
channels = {"@context": { "@vocab" : "http://www.gsi.dit.upm.es/ontologies/ewe#"}, "channels" : []}
channels_result = get_all_category_channels(category_uri)
index = 0
for uri, label, comment, logo, color_uri in channels_result:
color_result = get_channel_colour(color_uri)
color=""
for color_hex in color_result:
color = color_hex[0]
channels["channels"].append({"@id" : uri, "rdfs:label" : label.n3(), "rdfs:comment" : comment.n3(), "foaf:logo" : logo.n3(), "color" : color, "events" : [], "actions" : [], "parameters" : []})
actions_result = get_channel_actions(uri)
action_index = 0
for action_uri, action_label, action_comment in actions_result:
channels["channels"][index]["actions"].append({"@id" : action_uri, "rdfs:label" : action_label.n3(), "rdfs:comment" : action_comment.n3(), "input_parameters" : [], "output_parameters" : []})
channels["channels"][index]["actions"][action_index]["input_parameters"]=get_parse_parameters(get_input_parameters(action_uri, uri))
channels["channels"][index]["actions"][action_index]["output_parameters"]=get_parse_parameters(get_output_parameters(action_uri, uri))
"""
# get input parameters
input_params_result = get_input_parameters(action_uri, uri)
for input_param_uri, input_param_label, input_param_comment, input_param_datatype in input_params_result:
channels["channels"][index]["actions"][action_index]["input_parameters"].append({"@id" : input_param_uri, "rdfs:label" : input_param_label.n3(), "rdfs:comment" : input_param_comment.n3(), "rdf:datatype" : input_param_datatype})
# get output parameters
output_params_result = get_output_parameters(action_uri, uri)
for output_param_uri, output_param_label, output_param_comment, output_param_datatype in output_params_result:
channels["channels"][index]["actions"][action_index]["output_parameters"].append({"@id" : output_param_uri, "rdfs:label" : output_param_label.n3(), "rdfs:comment" : output_param_comment.n3(), "rdf:datatype" : output_param_datatype})
"""
action_index+=1
# get events
events_result = get_channel_events(uri)
event_index = 0
for event_uri, event_label, event_comment in events_result:
channels["channels"][index]["events"].append({"@id" : event_uri, "rdfs:label" : event_label.n3(), "rdfs:comment" : event_comment.n3(), "input_parameters" : [], "output_parameters" : []})
channels["channels"][index]["events"][event_index]["input_parameters"]=get_parse_parameters(get_input_parameters(event_uri, uri))
channels["channels"][index]["events"][event_index]["output_parameters"]=get_parse_parameters(get_output_parameters(event_uri, uri))
"""
# get input parameters
input_params_result = get_input_parameters(event_uri, uri)
for input_param_uri, input_param_label, input_param_comment, input_param_datatype in input_params_result:
channels["channels"][index]["events"][event_index]["input_parameters"].append({"@id" : input_param_uri, "rdfs:label" : input_param_label.n3(), "rdfs:comment" : input_param_comment.n3(), "rdf:datatype" : input_param_datatype})
# get output parameters
output_params_result = get_output_parameters(event_uri, uri)
for output_param_uri, output_param_label, output_param_comment, output_param_datatype in output_params_result:
channels["channels"][index]["events"][event_index]["output_parameters"].append({"@id" : output_param_uri, "rdfs:label" : output_param_label.n3(), "rdfs:comment" : output_param_comment.n3(), "rdf:datatype" : output_param_datatype})
"""
event_index+=1
# get channel parameters
parameters_result = get_channel_parameters(uri)
for param_uri, param_label, param_comment, param_datatype in parameters_result:
channels["channels"][index]["parameters"].append({"@id" : param_uri, "rdfs:label" : param_label.n3(), "rdfs:comment" : param_comment.n3(), "rdf:datatype" : param_datatype})
index+=1
return json.dumps(channels).replace('\\"', "")
def import_new_channel(channel_json):
channel_label = channel_json["rdfs:label"]
channel_comment = channel_json["rdfs:comment"]
channel_type = channel_json["rdf:type"]
channel_base = channel_json["@context"]["@base"]
channel_parameters = channel_json["parameters"]
return create_channel(channel_base, channel_label.replace(" ", "").lower(), channel_type, channel_label, channel_comment, channel_parameters)
def delete_custom_channel_with_uri(uri):
return delete_custom_channel(uri)
def get_channel_with_action_uri(action_uri):
channel_result = get_channel_by_action(action_uri)
for uri, label, logo, comment, color_uri in channel_result:
color_result = get_channel_colour(color_uri)
color=""
for color_hex in color_result:
color = color_hex[0]
channel = {"@id" : uri, "rdfs:label" : label.n3(), "foaf:logo" : logo.n3(), "rdfs:comment" : comment.n3(), "color" : color}
return channel
def get_channel_with_event_uri(event_uri):
channel_result = get_channel_by_event(event_uri)
for uri, label, logo, comment, color_uri in channel_result:
color_result = get_channel_colour(color_uri)
color=""
for color_hex in color_result:
color = color_hex[0]
channel = {"@id" : uri, "rdfs:label" : label.n3(), "foaf:logo" : logo.n3(), "rdfs:comment" : comment.n3(), "color" : color}
return channel
def get_parse_parameters(params_result):
parameters=[]
if (len(params_result)==0):
return parameters
operations_name = {"greaterThan": "Greater than","lessThan":"Less than","equalIgnoringCase":"Equal" }
param_operations = []
last_param_uri=""
last_param_label=None
last_param_comment=None
last_param_datatype=None
for param_uri, param_label, param_comment, param_datatype, param_operation in params_result:
if(last_param_uri!=param_uri)&(last_param_uri!=""):
parameters.append({"@id" : last_param_uri, "rdfs:label" : last_param_label.n3(), "rdfs:comment" : last_param_comment.n3(), "rdf:datatype" : last_param_datatype, "operations":param_operations})
param_operations=[]
last_param_uri=param_uri
last_param_label=param_label
last_param_comment=param_comment
last_param_datatype=param_datatype
param_operations.append({"name":operations_name[param_operation.split("#")[-1]], "id":param_operation})
parameters.append({"@id" : last_param_uri, "rdfs:label" : last_param_label.n3(), "rdfs:comment" : last_param_comment.n3(), "rdf:datatype" : last_param_datatype, "operations":param_operations})
return parameters | 56.022642 | 248 | 0.679038 | 1,811 | 14,846 | 5.243512 | 0.052457 | 0.062342 | 0.032856 | 0.039806 | 0.867839 | 0.860783 | 0.854886 | 0.84425 | 0.84425 | 0.833614 | 0 | 0.006915 | 0.181732 | 14,846 | 265 | 249 | 56.022642 | 0.774778 | 0.014078 | 0 | 0.677419 | 0 | 0 | 0.164914 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.064516 | false | 0 | 0.051613 | 0.006452 | 0.187097 | 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 |
eb0da6961a4cfffc2e8a11f66dd3ba03425761a9 | 61 | py | Python | attacks/__init__.py | SergioYF/NIPS-Adversarial-2017-CASIA | 8c680ad4a4ece76988f7563b4aed48691c415b01 | [
"Apache-2.0"
] | null | null | null | attacks/__init__.py | SergioYF/NIPS-Adversarial-2017-CASIA | 8c680ad4a4ece76988f7563b4aed48691c415b01 | [
"Apache-2.0"
] | null | null | null | attacks/__init__.py | SergioYF/NIPS-Adversarial-2017-CASIA | 8c680ad4a4ece76988f7563b4aed48691c415b01 | [
"Apache-2.0"
] | null | null | null | from .attacks_tf import fgsm
from .utils_tf import model_loss | 30.5 | 32 | 0.852459 | 11 | 61 | 4.454545 | 0.727273 | 0.326531 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114754 | 61 | 2 | 32 | 30.5 | 0.907407 | 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 |
eb32f6a071de65ee52f26882eebac4f084a67ec9 | 143 | py | Python | marcotools/__init__.py | marc0u/marcotools | 1ce099174c00f042e15dec17189ea7d144e6ff12 | [
"MIT"
] | null | null | null | marcotools/__init__.py | marc0u/marcotools | 1ce099174c00f042e15dec17189ea7d144e6ff12 | [
"MIT"
] | null | null | null | marcotools/__init__.py | marc0u/marcotools | 1ce099174c00f042e15dec17189ea7d144e6ff12 | [
"MIT"
] | null | null | null | import marcotools.schedule
import marcotools.filestools
import marcotools.generaltools
import marcotools.retools
import marcotools.telegrambot
| 23.833333 | 30 | 0.895105 | 15 | 143 | 8.533333 | 0.466667 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06993 | 143 | 5 | 31 | 28.6 | 0.962406 | 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 |
de59939dc71ef7b89c627a57932e60b6fba1f19d | 4,049 | py | Python | geomechy/constitutive.py | cfgarciar/geomechy | 5452c705e7ae771e2f8f8a11277bd00c12707b8c | [
"Apache-2.0"
] | null | null | null | geomechy/constitutive.py | cfgarciar/geomechy | 5452c705e7ae771e2f8f8a11277bd00c12707b8c | [
"Apache-2.0"
] | 2 | 2021-09-28T05:34:32.000Z | 2022-02-26T10:00:57.000Z | geomechy/constitutive.py | cfgarciar/geomechy | 5452c705e7ae771e2f8f8a11277bd00c12707b8c | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 02_constitutive.ipynb (unless otherwise specified).
__all__ = ['Elastic', 'PlaneStrain', 'PlaneStress', 'TransverseIsotropic', 'MMC']
# Cell
import numpy as np
from .base import BaseConstitutive, Properties
from .io import jsonReader
# Cell
class Elastic(BaseConstitutive):
def __init__(self, props):
#Call the BaseMaterial constructor
BaseConstitutive.__init__(self, props)
#Create the hookean matrix
fc1 = self.E/((1+self.nu)*(1-2*self.nu))
fc2 = (1-2*self.nu)/2
D11 = self.nu*(np.ones(3)-np.eye(3))+(1-self.nu)*np.eye(3)
D12 = np.zeros((3,3))
D21 = D12.copy()
D22 = fc2*np.eye(3)
self.De = fc1*np.block([[D11,D12],[D21,D22]])
def getStress(self, deformation):
sigma = np.matmul(self.De, deformation.eps)
return sigma, self.De
def getElasticMatrix(self):
return self.De
# Cell
class PlaneStrain(BaseConstitutive):
def __init__(self, props):
#Call the BaseMaterial constructor
BaseConstitutive.__init__(self, props)
#Create the hookean matrix
fc1 = self.E/((1+self.nu)*(1-2*self.nu))
fc2 = (1-2*self.nu)/2
D11 = self.nu*(np.ones(2)-np.eye(2))+(1-self.nu)*np.eye(2)
D12 = np.zeros((2,1))
D21 = np.zeros((1,2))
D22 = np.array([fc2]).reshape((1,1))
self.De = fc1*np.vstack([np.hstack([D11,D12]),np.hstack([D21,D22])])
def getStress(self, deformation):
sigma = np.matmul(self.De, deformation.eps)
return sigma, self.De
def getElasticMatrix(self):
return self.De
# Cell
class PlaneStress(BaseConstitutive):
def __init__(self, props):
#Call the BaseMaterial constructor
BaseConstitutive.__init__(self, props)
#Create the hookean matrix
fc1 = self.E/(1-self.nu**2)
fc2 = 1-self.nu
D11 = self.nu*(np.ones(2)-np.eye(2))+np.eye(2)
D12 = np.zeros((2,1))
D21 = np.zeros((1,2))
D22 = np.array([fc2]).reshape((1,1))
self.De = fc1*np.vstack([np.hstack([D11,D12]),np.hstack([D21,D22])])
def getStress(self, deformation):
sigma = np.matmul(self.De, deformation.eps)
return sigma, self.De
def getTangent(self):
return self.De
# Cell
class TransverseIsotropic(BaseConstitutive):
def __init__(self, props):
#Call the BaseMaterial constructor
BaseConstitutive.__init__(self, props)
#Create the hookean matrix
fc1 = self.E2/(2*(1+self.nu23))
D11 = np.ones((3,3))
D11[0,0] *= 1./self.E1
D11[1,1] *= 1./self.E2
D11[2,2] *= 1./self.E2
D11[0,1] *= -1.*self.nu12/self.E2
D11[1,0] = D11[0,1].copy()
D11[0,2] *= -1.*self.nu12/self.E2
D11[2,0] = D11[0,2].copy()
D11[1,2] *= -1.*self.nu23/self.E2
D11[2,1] = D11[1,2].copy()
D12 = np.zeros((3,3))
D21 = D12.copy()
D22 = np.diagflat([self.G12, self.G12, fc1])
self.De = np.linalg.inv(np.block([[D11,D12],[D21,D22]]))
def getStress(self, deformation):
sigma = np.matmul(self.De, deformation.eps)
return sigma, self.De
def getElasticMatrix(self):
return self.De
# Cell
class MMC(BaseConstitutive):
def __init__(self, props):
#Call the BaseMaterial constructor
BaseConstitutive.__init__(self, props)
#Create the hookean matrix
fc1 = self.E/((1+self.nu)*(1-2*self.nu))
fc2 = (1-2*self.nu)/2
D11 = self.nu*(np.ones(3)-np.eye(3))+(1-self.nu)*np.eye(3)
D12 = np.zeros((3,3))
D21 = D12.copy()
D22 = fc2*np.eye(3)
self.De = fc1*np.block([[D11,D12],[D21,D22]])
def getStress(self, deformation):
sigma = np.matmul(self.De, deformation.eps)
return sigma, self.De
def getElasticMatrix(self):
return self.De
def PlasticIntegration(self):
pass
def getElastoPlasticMatrix(self):
return self.D | 27.358108 | 95 | 0.584095 | 570 | 4,049 | 4.070175 | 0.145614 | 0.051724 | 0.056034 | 0.02069 | 0.771983 | 0.768966 | 0.742672 | 0.742672 | 0.742672 | 0.719397 | 0 | 0.079349 | 0.256113 | 4,049 | 148 | 96 | 27.358108 | 0.690903 | 0.102 | 0 | 0.659341 | 1 | 0 | 0.014092 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.186813 | false | 0.010989 | 0.032967 | 0.065934 | 0.395604 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
de9d9c9daf7b68968fef7034e5af4df6e43a3b7d | 39 | py | Python | test/test.py | humbletest/lgbot | 6ec64ff1a925583839184820015f4a65a4ee924e | [
"MIT"
] | 3 | 2018-10-03T17:31:42.000Z | 2019-01-27T20:39:53.000Z | test/test.py | humbletest/lgbot | 6ec64ff1a925583839184820015f4a65a4ee924e | [
"MIT"
] | 2 | 2021-02-08T20:29:13.000Z | 2021-04-30T20:54:08.000Z | test/test.py | humbletest/lgbot | 6ec64ff1a925583839184820015f4a65a4ee924e | [
"MIT"
] | 2 | 2020-06-24T16:23:28.000Z | 2020-07-11T21:25:47.000Z | import module
print("foo", module.foo) | 13 | 24 | 0.74359 | 6 | 39 | 4.833333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.102564 | 39 | 3 | 24 | 13 | 0.828571 | 0 | 0 | 0 | 0 | 0 | 0.075 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 6 |
a0d65ecc76294a351ef2d264139cda0eb4852a23 | 332 | py | Python | rofl/policies/__init__.py | Bobobert/RoLas | 75d601e7906e31c95ff3c574ebbed1142e220992 | [
"Apache-2.0"
] | 2 | 2021-11-02T16:33:08.000Z | 2021-11-05T23:57:31.000Z | rofl/policies/__init__.py | Bobobert/RoLas | 75d601e7906e31c95ff3c574ebbed1142e220992 | [
"Apache-2.0"
] | null | null | null | rofl/policies/__init__.py | Bobobert/RoLas | 75d601e7906e31c95ff3c574ebbed1142e220992 | [
"Apache-2.0"
] | null | null | null | from rofl.policies.base import Policy, dummyPolicy
from rofl.policies.dqn import dqnPolicy
from rofl.policies.pg import pgPolicy
from rofl.policies.dqnrollout import dqnRollPolicy
from rofl.policies.a2c import a2cPolicy, a2cWorkerPolicy
from rofl.policies.ppo import ppoPolicy, ppoWorkerPolicy
# TODO, include all policies in here
| 36.888889 | 56 | 0.843373 | 45 | 332 | 6.222222 | 0.533333 | 0.171429 | 0.342857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010101 | 0.105422 | 332 | 8 | 57 | 41.5 | 0.93266 | 0.10241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
9d0588560bab85c56115251f648cf036a82b0a6e | 97 | py | Python | snippets/matmul_python.py | srgrr/TFM | f6c302547fdfc9b1df3423cc4e927cd6bb83b345 | [
"MIT"
] | 6 | 2019-01-02T10:39:32.000Z | 2019-05-22T14:01:41.000Z | snippets/matmul_python.py | srgrr/TFM | f6c302547fdfc9b1df3423cc4e927cd6bb83b345 | [
"MIT"
] | null | null | null | snippets/matmul_python.py | srgrr/TFM | f6c302547fdfc9b1df3423cc4e927cd6bb83b345 | [
"MIT"
] | null | null | null | for i in range(N):
for j in range(N):
for k in range(N):
C[i, j] += A[i, k] * B[k, j] | 24.25 | 34 | 0.463918 | 24 | 97 | 1.875 | 0.416667 | 0.466667 | 0.533333 | 0.488889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.319588 | 97 | 4 | 34 | 24.25 | 0.681818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
9d2b7ff529ebc5954732218e326a1c2516ed412d | 412 | py | Python | magpie/src/__init__.py | knaidoo29/magpie | efab3c2666aab2c928ca12a631758bc1b43c149c | [
"MIT"
] | null | null | null | magpie/src/__init__.py | knaidoo29/magpie | efab3c2666aab2c928ca12a631758bc1b43c149c | [
"MIT"
] | null | null | null | magpie/src/__init__.py | knaidoo29/magpie | efab3c2666aab2c928ca12a631758bc1b43c149c | [
"MIT"
] | null | null | null |
#from .utils import linspace
#from .utils import midpoint
from .remap_utils import get_remap_pix_len
from .remap_utils import which_pix
from .remap_utils import pix1dto2d
from .remap_utils import pix1dto3d
from .remap_utils import remap_1d_grid2grid_pixel
from .remap_1d_grid2grid import remap_1d_grid2grid
from .remap_2d_grid2grid import remap_2d_grid2grid
from .remap_3d_grid2grid import remap_3d_grid2grid
| 29.428571 | 50 | 0.866505 | 64 | 412 | 5.203125 | 0.265625 | 0.216216 | 0.21021 | 0.3003 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04878 | 0.104369 | 412 | 13 | 51 | 31.692308 | 0.853659 | 0.131068 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
9d386cf64736e3e513d85e5df2766e0aaf89a0c4 | 95 | py | Python | api/ansible_api/forms.py | 240325184/KubeOperator | 777774050b236abf938a5a9ef505124c26e4916e | [
"Apache-2.0"
] | 3 | 2019-11-29T03:49:08.000Z | 2020-07-29T02:52:51.000Z | api/ansible_api/forms.py | 240325184/KubeOperator | 777774050b236abf938a5a9ef505124c26e4916e | [
"Apache-2.0"
] | 27 | 2021-05-05T02:51:26.000Z | 2022-01-04T21:30:21.000Z | api/ansible_api/forms.py | 240325184/KubeOperator | 777774050b236abf938a5a9ef505124c26e4916e | [
"Apache-2.0"
] | 1 | 2020-11-22T01:15:05.000Z | 2020-11-22T01:15:05.000Z | import uuid
from django import forms
from django.utils.translation import ugettext_lazy as _
| 15.833333 | 55 | 0.831579 | 14 | 95 | 5.5 | 0.714286 | 0.25974 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147368 | 95 | 5 | 56 | 19 | 0.950617 | 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 |
9d3c979adcbda94eeb2af4d200e6d9da6f642657 | 69 | py | Python | 02_LinkedList/LinkedList/__init__.py | Chipdelmal/DataStructures | 426e30b91e8f27843be1d9385dc800e5d0dc8d3f | [
"MIT"
] | 1 | 2019-07-11T22:31:15.000Z | 2019-07-11T22:31:15.000Z | 02_LinkedList/LinkedList/__init__.py | Chipdelmal/DataStructures | 426e30b91e8f27843be1d9385dc800e5d0dc8d3f | [
"MIT"
] | null | null | null | 02_LinkedList/LinkedList/__init__.py | Chipdelmal/DataStructures | 426e30b91e8f27843be1d9385dc800e5d0dc8d3f | [
"MIT"
] | null | null | null |
from class_LinkedList import LinkedList
from class_Node import Node
| 17.25 | 39 | 0.869565 | 10 | 69 | 5.8 | 0.5 | 0.310345 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 69 | 3 | 40 | 23 | 0.966667 | 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 |
19f5899e02e903e67c2592d17a15de3559732ec3 | 159 | py | Python | octavvs/pymcr_new/__init__.py | S73ph4n/octavvs | adbfa3f489b1928281a55de640c64d20afb4f9e1 | [
"MIT"
] | 7 | 2020-02-19T13:05:11.000Z | 2021-08-28T05:23:33.000Z | octavvs/pymcr_new/__init__.py | S73ph4n/octavvs | adbfa3f489b1928281a55de640c64d20afb4f9e1 | [
"MIT"
] | 2 | 2020-02-19T14:39:28.000Z | 2020-03-23T15:13:38.000Z | octavvs/pymcr_new/__init__.py | S73ph4n/octavvs | adbfa3f489b1928281a55de640c64d20afb4f9e1 | [
"MIT"
] | 2 | 2019-12-09T12:16:38.000Z | 2021-01-11T02:58:01.000Z | """ pyMCR: Pythonic Multivariate Curve Resolution - Alternating Least Squares """
from . import constraints
from . import metrics
from . import regressors
| 31.8 | 82 | 0.761006 | 17 | 159 | 7.117647 | 0.764706 | 0.247934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169811 | 159 | 4 | 83 | 39.75 | 0.916667 | 0.45912 | 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 |
dfc20d946a9d3b3987fc3441545246233a46ad7a | 15,137 | py | Python | vmware-ose-common-test-suites/prj/cases/test_bucket.py | csgtree/object-storage-extension-samples | 397f3033ddd4aa1bb1e2079a9e77309a78cc0b0d | [
"Apache-2.0"
] | 6 | 2020-09-11T02:52:42.000Z | 2021-04-19T11:20:42.000Z | vmware-ose-common-test-suites/prj/cases/test_bucket.py | csgtree/object-storage-extension-samples | 397f3033ddd4aa1bb1e2079a9e77309a78cc0b0d | [
"Apache-2.0"
] | 5 | 2020-12-21T20:14:59.000Z | 2022-03-21T14:35:43.000Z | vmware-ose-common-test-suites/prj/cases/test_bucket.py | csgtree/object-storage-extension-samples | 397f3033ddd4aa1bb1e2079a9e77309a78cc0b0d | [
"Apache-2.0"
] | 4 | 2021-07-20T09:07:52.000Z | 2022-03-21T14:33:44.000Z | # -*- coding:utf-8 -*-
from framework.addons.UnitTi import data_provider, group
from framework.core.Base import Base
from framework.libs.common.utils import get_group_list, get_doc_string_list
from prj.test_data.test_bucket.test_bucket import *
class TestBucket(Base):
@classmethod
def setUpClass(cls):
cls.initialize()
pass
def setUp(self):
pass
prov = test_create_bucket_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('create_bucket', append=True)
@data_provider(provider=test_create_bucket_provider,
docstring_list=doc_l,
group_list=g_l)
def test01_test_create_bucket(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_delete_bucket_analytics_configuration_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('delete_bucket_analytics_configuration', append=True)
@data_provider(provider=test_delete_bucket_analytics_configuration_provider,
docstring_list=doc_l,
group_list=g_l)
def test02_test_delete_bucket_analytics_configuration(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_delete_bucket_cors_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('delete_bucket_cors', append=True)
@data_provider(provider=test_delete_bucket_cors_provider,
docstring_list=doc_l,
group_list=g_l)
def test03_test_delete_bucket_cors(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_delete_bucket_encryption_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
# @unittest.skip("skip")
@group('delete_bucket_encryption', append=True)
@data_provider(provider=test_delete_bucket_encryption_provider,
docstring_list=doc_l,
group_list=g_l)
def test04_test_delete_bucket_encryption(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_delete_bucket_lifecycle_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('delete_bucket_lifecycle', append=True)
@data_provider(provider=test_delete_bucket_lifecycle_provider,
docstring_list=doc_l,
group_list=g_l)
def test06_test_delete_bucket_lifecycle(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_delete_bucket_policy_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('delete_bucket_policy', append=True)
@data_provider(provider=test_delete_bucket_policy_provider,
docstring_list=doc_l,
group_list=g_l)
def test08_test_delete_bucket_policy(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_delete_bucket_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('delete_bucket', append=True)
@data_provider(provider=test_delete_bucket_provider,
docstring_list=doc_l,
group_list=g_l)
def test09_test_delete_bucket(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_delete_bucket_tagging_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('delete_bucket_tagging', append=True)
@data_provider(provider=test_delete_bucket_tagging_provider,
docstring_list=doc_l,
group_list=g_l)
def test11_test_delete_bucket_tagging(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_acl_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('get_bucket_acl', append=True)
@data_provider(provider=test_get_bucket_acl_provider,
docstring_list=doc_l,
group_list=g_l)
def test14_test_get_bucket_acl(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_analytics_configuration_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('get_bucket_analytics_configuration', append=True)
@data_provider(provider=test_get_bucket_analytics_configuration_provider,
docstring_list=doc_l,
group_list=g_l)
def test15_test_get_bucket_analytics_configuration(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_cors_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('get_bucket_cors', append=True)
@data_provider(provider=test_get_bucket_cors_provider,
docstring_list=doc_l,
group_list=g_l)
def test16_test_get_bucket_cors(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_encryption_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
# @unittest.skip("skip")
@group('get_bucket_encryption', append=True)
@data_provider(provider=test_get_bucket_encryption_provider,
docstring_list=doc_l,
group_list=g_l)
def test17_test_get_bucket_encryption(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_lifecycle_configuration_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
# @unittest.skip("skip")
@group('get_bucket_lifecycle_configuration', append=True)
@data_provider(provider=test_get_bucket_lifecycle_configuration_provider,
docstring_list=doc_l,
group_list=g_l)
def test19_test_get_bucket_lifecycle_configuration(self, testdata):
self.generic_s3_test_process(testdata)
# prov = test_get_bucket_lifecycle_provider()
# doc_l = get_doc_string_list(prov)
# g_l = get_group_list(prov)
#
# # @unittest.skip("skip")
# @data_provider(provider=test_get_bucket_lifecycle_provider,
# docstring_list=doc_l,
# group_list=g_l)
# def test20_test_get_bucket_lifecycle(self, testdata):
# self.generic_s3_test_process(testdata)
prov = test_get_bucket_location_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
# @unittest.skip("skip")
@group('get_bucket_location', append=True)
@data_provider(provider=test_get_bucket_location_provider,
docstring_list=doc_l,
group_list=g_l)
def test21_test_get_bucket_location(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_logging_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
# @unittest.skip("skip")
@group('get_bucket_logging', append=True)
@data_provider(provider=test_get_bucket_logging_provider,
docstring_list=doc_l,
group_list=g_l)
def test22_test_get_bucket_logging(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_policy_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('get_bucket_policy', append=True)
@data_provider(provider=test_get_bucket_policy_provider,
docstring_list=doc_l,
group_list=g_l)
def test26_test_get_bucket_policy(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_policy_status_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('get_bucket_policy_status', append=True)
@data_provider(provider=test_get_bucket_policy_status_provider,
docstring_list=doc_l,
group_list=g_l)
def test27_test_get_bucket_policy_status(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_tagging_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('get_bucket_tagging', append=True)
@data_provider(provider=test_get_bucket_tagging_provider,
docstring_list=doc_l,
group_list=g_l)
def test29_test_get_bucket_tagging(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_get_bucket_versioning_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('get_bucket_versioning', append=True)
@data_provider(provider=test_get_bucket_versioning_provider,
docstring_list=doc_l,
group_list=g_l)
def test30_test_get_bucket_versioning(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_head_bucket_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('head_bucket', append=True)
@data_provider(provider=test_head_bucket_provider,
docstring_list=doc_l,
group_list=g_l)
def test32_test_head_bucket(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_list_bucket_analytics_configurations_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('list_bucket_analytics_configurations', append=True)
@data_provider(provider=test_list_bucket_analytics_configurations_provider,
docstring_list=doc_l,
group_list=g_l)
def test33_test_list_bucket_analytics_configuration(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_list_buckets_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('list_buckets', append=True)
@data_provider(provider=test_list_buckets_provider,
docstring_list=doc_l,
group_list=g_l)
def test36_test_list_buckets(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_acl_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_acl', append=True)
@data_provider(provider=test_put_bucket_acl_provider,
docstring_list=doc_l,
group_list=g_l)
def test38_test_put_bucket_acl(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_analytics_configuration_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_analytics_configuration', append=True)
@data_provider(provider=test_put_bucket_analytics_configuration_provider,
docstring_list=doc_l,
group_list=g_l)
def test39_test_put_bucket_analytics_configuration(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_cors_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_cors', append=True)
@data_provider(provider=test_put_bucket_cors_provider,
docstring_list=doc_l,
group_list=g_l)
def test40_test_put_bucket_cors(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_encryption_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_encryption', append=True)
@data_provider(provider=test_put_bucket_encryption_provider,
docstring_list=doc_l,
group_list=g_l)
def test41_test_put_bucket_encryption(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_lifecycle_configuration_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_lifecycle_configuration', append=True)
@data_provider(provider=test_put_bucket_lifecycle_configuration_provider,
docstring_list=doc_l,
group_list=g_l)
def test43_test_put_bucket_lifecycle_configuration(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_logging_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_logging', append=True)
@data_provider(provider=test_put_bucket_logging_provider,
docstring_list=doc_l,
group_list=g_l)
def test45_test_put_bucket_logging(self, testdata):
self.generic_s3_test_process(testdata)
# prov = test_put_bucket_lifecycle_provider()
# doc_l = get_doc_string_list(prov)
# g_l = get_group_list(prov)
#
# # @unittest.skip("skip")
# @data_provider(provider=test_put_bucket_lifecycle_provider,
# docstring_list=doc_l,
# group_list=g_l)
# def test44_test_put_bucket_lifecycle(self, testdata):
# self.generic_s3_test_process(testdata)
prov = test_put_bucket_policy_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_policy', append=True)
@data_provider(provider=test_put_bucket_policy_provider,
docstring_list=doc_l,
group_list=g_l)
def test50_test_put_bucket_policy(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_tagging_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_logging', append=True)
@data_provider(provider=test_put_bucket_tagging_provider,
docstring_list=doc_l,
group_list=g_l)
def test52_test_put_bucket_tagging(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_put_bucket_versioning_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
@group('put_bucket_versioning', append=True)
@data_provider(provider=test_put_bucket_versioning_provider,
docstring_list=doc_l,
group_list=g_l)
def test53_test_put_bucket_versioning(self, testdata):
self.generic_s3_test_process(testdata)
'''
prov = test_bucket_acl_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
#@unittest.skip("skip")
@data_provider(provider=test_bucket_acl_provider,
docstring_list=doc_l,
group_list=g_l)
def test04_test_bucket_acl(self, testdata):
self.generic_s3_test_process(testdata)
prov = test_bucket_logging_provider()
doc_l = get_doc_string_list(prov)
g_l = get_group_list(prov)
#@unittest.skip("skip")
@data_provider(provider=test_bucket_logging_provider,
docstring_list=doc_l,
group_list=g_l)
def test05_test_bucket_logging(self, testdata):
self.generic_s3_test_process(testdata)
'''
def tearDown(self):
super().tearDown()
@classmethod
def tearDownClass(cls):
pass
| 36.474699 | 80 | 0.701724 | 1,997 | 15,137 | 4.807211 | 0.050075 | 0.068438 | 0.045 | 0.06 | 0.908125 | 0.899896 | 0.892604 | 0.875729 | 0.792083 | 0.752708 | 0 | 0.008972 | 0.219462 | 15,137 | 414 | 81 | 36.562802 | 0.803555 | 0.055691 | 0 | 0.549153 | 0 | 0 | 0.04845 | 0.028478 | 0 | 0 | 0 | 0 | 0 | 1 | 0.118644 | false | 0.010169 | 0.013559 | 0 | 0.450847 | 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 |
dfe01f543ddba240267933adeeb44d2e467ed803 | 43 | py | Python | trainer/__init__.py | syinari0123/tridepth | 5e7e90b537b82e731bb6beac1c8c93fc9187fee0 | [
"MIT"
] | 81 | 2019-10-27T13:50:52.000Z | 2022-02-22T18:15:45.000Z | trainer/__init__.py | syinari0123/tridepth | 5e7e90b537b82e731bb6beac1c8c93fc9187fee0 | [
"MIT"
] | 10 | 2019-11-21T09:56:59.000Z | 2022-03-12T00:03:55.000Z | trainer/__init__.py | syinari0123/tridepth | 5e7e90b537b82e731bb6beac1c8c93fc9187fee0 | [
"MIT"
] | 9 | 2019-11-16T04:02:47.000Z | 2021-05-27T06:40:44.000Z | from .trainer_depth import TriDepthTrainer
| 21.5 | 42 | 0.883721 | 5 | 43 | 7.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 43 | 1 | 43 | 43 | 0.948718 | 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 |
5f30bdef5d3fe88d6b9aea945bb25378037b1b3b | 86 | py | Python | app.py | FAUSheppy/serien-ampel | ae8f332b22a8f236a3f248e5a793c2013eecd57d | [
"MIT"
] | null | null | null | app.py | FAUSheppy/serien-ampel | ae8f332b22a8f236a3f248e5a793c2013eecd57d | [
"MIT"
] | null | null | null | app.py | FAUSheppy/serien-ampel | ae8f332b22a8f236a3f248e5a793c2013eecd57d | [
"MIT"
] | null | null | null | import init
def createApp(envivorment=None, start_response=None):
return init.app
| 21.5 | 53 | 0.790698 | 12 | 86 | 5.583333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.127907 | 86 | 3 | 54 | 28.666667 | 0.893333 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
a0308a56f8b8b03a2bd6252980aec72e70b9fdc0 | 84,429 | py | Python | tests/test_Board.py | seungjaeryanlee/clarity | 93ea38e125d8a7761625ef75bfe4c2b6485bb065 | [
"Apache-2.0"
] | null | null | null | tests/test_Board.py | seungjaeryanlee/clarity | 93ea38e125d8a7761625ef75bfe4c2b6485bb065 | [
"Apache-2.0"
] | null | null | null | tests/test_Board.py | seungjaeryanlee/clarity | 93ea38e125d8a7761625ef75bfe4c2b6485bb065 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
This file defines unit tests for the Board class.
"""
import unittest
from clarity import constants as const
from clarity.BitBoard import BitBoard
from clarity.Board import Board
from clarity.Color import Color
from clarity.Direction import Direction
from clarity.Move import Move
from clarity.MoveType import MoveType
from clarity.Piece import Piece
from clarity.Sq import Sq
class TestBoardClass(unittest.TestCase):
"""
This class tests the Board class.
"""
def test_init(self):
"""
Tests the __init__() function of the Board class.
"""
board = Board()
assert board.bitboards[Piece.WP].num \
== int('0000000000000000000000000000000000000000000000001111111100000000', 2)
assert board.bitboards[Piece.WN].num \
== int('0000000000000000000000000000000000000000000000000000000001000010', 2)
assert board.bitboards[Piece.WB].num \
== int('0000000000000000000000000000000000000000000000000000000000100100', 2)
assert board.bitboards[Piece.WR].num \
== int('0000000000000000000000000000000000000000000000000000000010000001', 2)
assert board.bitboards[Piece.WQ].num \
== int('0000000000000000000000000000000000000000000000000000000000010000', 2)
assert board.bitboards[Piece.WK].num \
== int('0000000000000000000000000000000000000000000000000000000000001000', 2)
assert board.bitboards[Piece.BP].num \
== int('0000000011111111000000000000000000000000000000000000000000000000', 2)
assert board.bitboards[Piece.BN].num \
== int('0100001000000000000000000000000000000000000000000000000000000000', 2)
assert board.bitboards[Piece.BB].num \
== int('0010010000000000000000000000000000000000000000000000000000000000', 2)
assert board.bitboards[Piece.BR].num \
== int('1000000100000000000000000000000000000000000000000000000000000000', 2)
assert board.bitboards[Piece.BQ].num \
== int('0001000000000000000000000000000000000000000000000000000000000000', 2)
assert board.bitboards[Piece.BK].num \
== int('0000100000000000000000000000000000000000000000000000000000000000', 2)
assert board.turn == Color.WHITE
assert board.ep_square == -1
assert board.castling[Piece.WK]
assert board.castling[Piece.WQ]
assert board.castling[Piece.BK]
assert board.castling[Piece.BQ]
assert board.half_move_clock == 0
assert board.full_move_count == 1
board = Board('K7/8/8/8/8/8/8/7k b - - 0 1')
assert board.bitboards[Piece.WP].num == 0
assert board.bitboards[Piece.WN].num == 0
assert board.bitboards[Piece.WB].num == 0
assert board.bitboards[Piece.WR].num == 0
assert board.bitboards[Piece.WQ].num == 0
assert board.bitboards[Piece.WK].num \
== int('1000000000000000000000000000000000000000000000000000000000000000', 2)
assert board.bitboards[Piece.BP].num == 0
assert board.bitboards[Piece.BN].num == 0
assert board.bitboards[Piece.BB].num == 0
assert board.bitboards[Piece.BR].num == 0
assert board.bitboards[Piece.BQ].num == 0
assert board.bitboards[Piece.BK].num == int('00000001', 2)
assert board.turn == Color.BLACK
assert board.ep_square == -1
assert not board.castling[Piece.WK]
assert not board.castling[Piece.WQ]
assert not board.castling[Piece.BK]
assert not board.castling[Piece.BQ]
assert board.half_move_clock == 0
assert board.full_move_count == 1
def test_str(self):
"""
Tests the __str__() function of the Board class
"""
board = Board()
assert str(board) == ('rnbqkbnr\n'
'pppppppp\n'
'--------\n'
'--------\n'
'--------\n'
'--------\n'
'PPPPPPPP\n'
'RNBQKBNR')
def test_get_fen(self):
"""
TODO Add more tests
Tests the _get_fen() function of the Board class
"""
board = Board()
assert board.fen() == 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'
board.bitboards[Piece.WP][Sq.E4] = 1
board.bitboards[Piece.WP][Sq.E2] = 0
board.turn = Color.BLACK
board.castling[Piece.WK] = False
board.castling[Piece.BK] = False
board.ep_square = Sq.A8
board.half_move_clock = 13
board.full_move_count = 20
assert board.fen() == 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b Qq a8 13 20'
def test_set_fen(self):
"""
Tests the _set_fen() function of the Board class
"""
board = Board()
board.fen('rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1')
self.assertEqual(board.bitboards[Piece.WP][Sq.E2], 0)
self.assertEqual(board.color_bb[Color.WHITE][Sq.E2], 0)
self.assertEqual(board.bitboards[Piece.WP][Sq.E4], 1)
self.assertEqual(board.color_bb[Color.WHITE][Sq.E4], 1)
self.assertEqual(board.turn, Color.BLACK)
self.assertEqual(board.castling[Piece.WK], True)
self.assertEqual(board.castling[Piece.WQ], True)
self.assertEqual(board.castling[Piece.BK], True)
self.assertEqual(board.castling[Piece.BQ], True)
self.assertEqual(board.ep_square, Sq.E3)
self.assertEqual(board.half_move_clock, 0)
self.assertEqual(board.full_move_count, 1)
self.assertListEqual(sorted(board.piece_sq[Piece.WP]),
sorted([Sq.A2, Sq.B2, Sq.C2, Sq.D2, Sq.E4, Sq.F2, Sq.G2, Sq.H2]))
self.assertListEqual(sorted(board.piece_sq[Piece.WN]),
sorted([Sq.B1, Sq.G1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WB]),
sorted([Sq.C1, Sq.F1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WR]),
sorted([Sq.A1, Sq.H1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WQ]),
sorted([Sq.D1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WK]),
sorted([Sq.E1]))
self.assertListEqual(sorted(board.piece_sq[Piece.BP]),
sorted([Sq.A7, Sq.B7, Sq.C7, Sq.D7, Sq.E7, Sq.F7, Sq.G7, Sq.H7]))
self.assertListEqual(sorted(board.piece_sq[Piece.BN]),
sorted([Sq.B8, Sq.G8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BB]),
sorted([Sq.C8, Sq.F8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BR]),
sorted([Sq.A8, Sq.H8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BQ]),
sorted([Sq.D8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BK]),
sorted([Sq.E8]))
board.fen('rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w - c6 1 2')
self.assertEqual(board.bitboards[Piece.BP][Sq.C7], 0)
self.assertEqual(board.color_bb[Color.BLACK][Sq.C7], 0)
self.assertEqual(board.bitboards[Piece.BP][Sq.C5], 1)
self.assertEqual(board.color_bb[Color.BLACK][Sq.C5], 1)
self.assertEqual(board.turn, Color.WHITE)
self.assertEqual(board.castling[Piece.WK], False)
self.assertEqual(board.castling[Piece.WQ], False)
self.assertEqual(board.castling[Piece.BK], False)
self.assertEqual(board.castling[Piece.BQ], False)
self.assertEqual(board.ep_square, Sq.C6)
self.assertEqual(board.half_move_clock, 1)
self.assertEqual(board.full_move_count, 2)
self.assertListEqual(sorted(board.piece_sq[Piece.WP]),
sorted([Sq.A2, Sq.B2, Sq.C2, Sq.D2, Sq.E4, Sq.F2, Sq.G2, Sq.H2]))
self.assertListEqual(sorted(board.piece_sq[Piece.WN]),
sorted([Sq.B1, Sq.G1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WB]),
sorted([Sq.C1, Sq.F1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WR]),
sorted([Sq.A1, Sq.H1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WQ]),
sorted([Sq.D1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WK]),
sorted([Sq.E1]))
self.assertListEqual(sorted(board.piece_sq[Piece.BP]),
sorted([Sq.A7, Sq.B7, Sq.C5, Sq.D7, Sq.E7, Sq.F7, Sq.G7, Sq.H7]))
self.assertListEqual(sorted(board.piece_sq[Piece.BN]),
sorted([Sq.B8, Sq.G8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BB]),
sorted([Sq.C8, Sq.F8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BR]),
sorted([Sq.A8, Sq.H8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BQ]),
sorted([Sq.D8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BK]),
sorted([Sq.E8]))
board.fen('8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 10 30')
assert board.turn == Color.WHITE
assert not board.castling[Piece.WK]
assert not board.castling[Piece.WQ]
assert not board.castling[Piece.BK]
assert not board.castling[Piece.BQ]
assert board.ep_square == -1
assert board.half_move_clock == 10
assert board.full_move_count == 30
assert sorted(board.piece_sq[Piece.WP]) == sorted([Sq.B5, Sq.E2, Sq.G2])
assert sorted(board.piece_sq[Piece.WP]) == sorted([Sq.B5, Sq.E2, Sq.G2])
assert len(board.piece_sq[Piece.WN]) == 0
assert len(board.piece_sq[Piece.WB]) == 0
assert sorted(board.piece_sq[Piece.WR]) == sorted([Sq.B4])
assert len(board.piece_sq[Piece.WQ]) == 0
assert sorted(board.piece_sq[Piece.WK]) == sorted([Sq.A5])
assert sorted(board.piece_sq[Piece.BP]) == sorted([Sq.C7, Sq.D6, Sq.F4])
assert len(board.piece_sq[Piece.BN]) == 0
assert len(board.piece_sq[Piece.BB]) == 0
assert sorted(board.piece_sq[Piece.BR]) == sorted([Sq.H5])
assert len(board.piece_sq[Piece.BQ]) == 0
assert sorted(board.piece_sq[Piece.BK]) == sorted([Sq.H4])
def test_get_piece_on_sq(self):
"""
Tests the _get_piece_on_sq() function of the Board class
"""
board = Board()
assert board._get_piece_on_sq(Sq.A1) == Piece.WR
assert board._get_piece_on_sq(Sq.B1) == Piece.WN
assert board._get_piece_on_sq(Sq.C1) == Piece.WB
assert board._get_piece_on_sq(Sq.D1) == Piece.WQ
assert board._get_piece_on_sq(Sq.E1) == Piece.WK
assert board._get_piece_on_sq(Sq.F1) == Piece.WB
assert board._get_piece_on_sq(Sq.G1) == Piece.WN
assert board._get_piece_on_sq(Sq.H1) == Piece.WR
assert board._get_piece_on_sq(Sq.A8) == Piece.BR
assert board._get_piece_on_sq(Sq.B8) == Piece.BN
assert board._get_piece_on_sq(Sq.C8) == Piece.BB
assert board._get_piece_on_sq(Sq.D8) == Piece.BQ
assert board._get_piece_on_sq(Sq.E8) == Piece.BK
assert board._get_piece_on_sq(Sq.F8) == Piece.BB
assert board._get_piece_on_sq(Sq.G8) == Piece.BN
assert board._get_piece_on_sq(Sq.H8) == Piece.BR
assert board._get_piece_on_sq(Sq.A2) == Piece.WP
assert board._get_piece_on_sq(Sq.B2) == Piece.WP
assert board._get_piece_on_sq(Sq.C2) == Piece.WP
assert board._get_piece_on_sq(Sq.D2) == Piece.WP
assert board._get_piece_on_sq(Sq.E2) == Piece.WP
assert board._get_piece_on_sq(Sq.F2) == Piece.WP
assert board._get_piece_on_sq(Sq.G2) == Piece.WP
assert board._get_piece_on_sq(Sq.H2) == Piece.WP
assert board._get_piece_on_sq(Sq.A7) == Piece.BP
assert board._get_piece_on_sq(Sq.B7) == Piece.BP
assert board._get_piece_on_sq(Sq.C7) == Piece.BP
assert board._get_piece_on_sq(Sq.D7) == Piece.BP
assert board._get_piece_on_sq(Sq.E7) == Piece.BP
assert board._get_piece_on_sq(Sq.F7) == Piece.BP
assert board._get_piece_on_sq(Sq.G7) == Piece.BP
assert board._get_piece_on_sq(Sq.H7) == Piece.BP
def test_get_sqs_between(self):
"""
Tests the _get_sqs_between() function of the Board class
"""
# horizontal direction
assert sorted(Board._get_sqs_between(Sq.A1, Sq.A8).indices()), sorted([Sq.A2, Sq.A3, Sq.A4,
Sq.A5, Sq.A6, Sq.A7])
# vertical direction
assert sorted(Board._get_sqs_between(Sq.C3, Sq.C5).indices()), sorted([Sq.C4])
# diagonal (UL-DR) direction
assert sorted(Board._get_sqs_between(Sq.B7, Sq.G2).indices()), sorted([Sq.C6, Sq.D5, Sq.E4, Sq.F3])
# diagonal (UR-DL) direction
assert sorted(Board._get_sqs_between(Sq.D2, Sq.F4).indices()), sorted([Sq.E3])
def test_make_move(self):
"""
Tests the make_move() function of the Board class
"""
board = Board()
move = Move(Sq.E2, Sq.E4, MoveType.DOUBLE)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
self.assertEqual(captured_piece, -1)
self.assertEqual(castling[Piece.WK], True)
self.assertEqual(castling[Piece.WQ], True)
self.assertEqual(castling[Piece.BK], True)
self.assertEqual(castling[Piece.BQ], True)
self.assertEqual(ep_square, -1)
self.assertEqual(half_move_clock, 0)
self.assertEqual(board.fen(), 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1')
self.assertEqual(board.color_bb[Color.WHITE].num, int('00001000000000001111011111111111', 2))
self.assertEqual(board.color_bb[Color.BLACK].num,
int('1111111111111111000000000000000000000000000000000000000000000000', 2))
self.assertListEqual(sorted(board.piece_sq[Piece.WP]),
sorted([Sq.A2, Sq.B2, Sq.C2, Sq.D2, Sq.E4, Sq.F2, Sq.G2, Sq.H2]))
self.assertListEqual(sorted(board.piece_sq[Piece.WN]),
sorted([Sq.B1, Sq.G1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WB]),
sorted([Sq.C1, Sq.F1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WR]),
sorted([Sq.A1, Sq.H1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WQ]),
sorted([Sq.D1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WK]),
sorted([Sq.E1]))
self.assertListEqual(sorted(board.piece_sq[Piece.BP]),
sorted([Sq.A7, Sq.B7, Sq.C7, Sq.D7, Sq.E7, Sq.F7, Sq.G7, Sq.H7]))
self.assertListEqual(sorted(board.piece_sq[Piece.BN]),
sorted([Sq.B8, Sq.G8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BB]),
sorted([Sq.C8, Sq.F8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BR]),
sorted([Sq.A8, Sq.H8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BQ]),
sorted([Sq.D8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BK]),
sorted([Sq.E8]))
move = Move(Sq.B8, Sq.C6, MoveType.QUIET)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
self.assertEqual(captured_piece, -1)
self.assertEqual(castling[Piece.WK], True)
self.assertEqual(castling[Piece.WQ], True)
self.assertEqual(castling[Piece.BK], True)
self.assertEqual(castling[Piece.BQ], True)
self.assertEqual(ep_square, Sq.E3)
self.assertEqual(half_move_clock, 0)
self.assertEqual(board.fen(), 'r1bqkbnr/pppppppp/2n5/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 1 2')
self.assertEqual(board.color_bb[Color.WHITE].num, int('00001000000000001111011111111111', 2))
self.assertEqual(board.color_bb[Color.BLACK].num,
int('1011111111111111001000000000000000000000000000000000000000000000', 2))
self.assertListEqual(sorted(board.piece_sq[Piece.WP]),
sorted([Sq.A2, Sq.B2, Sq.C2, Sq.D2, Sq.E4, Sq.F2, Sq.G2, Sq.H2]))
self.assertListEqual(sorted(board.piece_sq[Piece.WN]),
sorted([Sq.B1, Sq.G1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WB]),
sorted([Sq.C1, Sq.F1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WR]),
sorted([Sq.A1, Sq.H1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WQ]),
sorted([Sq.D1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WK]),
sorted([Sq.E1]))
self.assertListEqual(sorted(board.piece_sq[Piece.BP]),
sorted([Sq.A7, Sq.B7, Sq.C7, Sq.D7, Sq.E7, Sq.F7, Sq.G7, Sq.H7]))
self.assertListEqual(sorted(board.piece_sq[Piece.BN]),
sorted([Sq.C6, Sq.G8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BB]),
sorted([Sq.C8, Sq.F8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BR]),
sorted([Sq.A8, Sq.H8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BQ]),
sorted([Sq.D8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BK]),
sorted([Sq.E8]))
move = Move(Sq.E1, Sq.E2, MoveType.QUIET)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
self.assertEqual(captured_piece, -1)
self.assertEqual(castling[Piece.WK], True)
self.assertEqual(castling[Piece.WQ], True)
self.assertEqual(castling[Piece.BK], True)
self.assertEqual(castling[Piece.BQ], True)
self.assertEqual(ep_square, -1)
self.assertEqual(half_move_clock, 1)
self.assertEqual(board.fen(), 'r1bqkbnr/pppppppp/2n5/8/4P3/8/PPPPKPPP/RNBQ1BNR b kq - 2 2')
self.assertEqual(board.color_bb[Color.WHITE].num, int('00001000000000001111111111110111', 2))
self.assertEqual(board.color_bb[Color.BLACK].num,
int('1011111111111111001000000000000000000000000000000000000000000000', 2))
self.assertListEqual(sorted(board.piece_sq[Piece.WP]),
sorted([Sq.A2, Sq.B2, Sq.C2, Sq.D2, Sq.E4, Sq.F2, Sq.G2, Sq.H2]))
self.assertListEqual(sorted(board.piece_sq[Piece.WN]),
sorted([Sq.B1, Sq.G1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WB]),
sorted([Sq.C1, Sq.F1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WR]),
sorted([Sq.A1, Sq.H1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WQ]),
sorted([Sq.D1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WK]),
sorted([Sq.E2]))
self.assertListEqual(sorted(board.piece_sq[Piece.BP]),
sorted([Sq.A7, Sq.B7, Sq.C7, Sq.D7, Sq.E7, Sq.F7, Sq.G7, Sq.H7]))
self.assertListEqual(sorted(board.piece_sq[Piece.BN]),
sorted([Sq.C6, Sq.G8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BB]),
sorted([Sq.C8, Sq.F8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BR]),
sorted([Sq.A8, Sq.H8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BQ]),
sorted([Sq.D8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BK]),
sorted([Sq.E8]))
board.fen('rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w - - 0 2')
move = Move(Sq.E4, Sq.D5, MoveType.CAPTURE)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
self.assertEqual(captured_piece, Piece.BP)
self.assertEqual(castling[Piece.WK], False)
self.assertEqual(castling[Piece.WQ], False)
self.assertEqual(castling[Piece.BK], False)
self.assertEqual(castling[Piece.BQ], False)
self.assertEqual(ep_square, -1)
self.assertEqual(half_move_clock, 0)
self.assertEqual(board.fen(), 'rnbqkbnr/ppp1pppp/8/3P4/8/8/PPPP1PPP/RNBQKBNR b - - 0 2')
self.assertEqual(board.color_bb[Color.WHITE].num, int('0001000000000000000000001111011111111111', 2))
self.assertEqual(board.color_bb[Color.BLACK].num,
int('1111111111101111000000000000000000000000000000000000000000000000', 2))
self.assertListEqual(sorted(board.piece_sq[Piece.WP]),
sorted([Sq.A2, Sq.B2, Sq.C2, Sq.D2, Sq.D5, Sq.F2, Sq.G2, Sq.H2]))
self.assertListEqual(sorted(board.piece_sq[Piece.WN]),
sorted([Sq.B1, Sq.G1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WB]),
sorted([Sq.C1, Sq.F1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WR]),
sorted([Sq.A1, Sq.H1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WQ]),
sorted([Sq.D1]))
self.assertListEqual(sorted(board.piece_sq[Piece.WK]),
sorted([Sq.E1]))
self.assertListEqual(sorted(board.piece_sq[Piece.BP]),
sorted([Sq.A7, Sq.B7, Sq.C7, Sq.E7, Sq.F7, Sq.G7, Sq.H7]))
self.assertListEqual(sorted(board.piece_sq[Piece.BN]),
sorted([Sq.B8, Sq.G8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BB]),
sorted([Sq.C8, Sq.F8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BR]),
sorted([Sq.A8, Sq.H8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BQ]),
sorted([Sq.D8]))
self.assertListEqual(sorted(board.piece_sq[Piece.BK]),
sorted([Sq.E8]))
# MoveType.N_PROMO
board.fen('k7/7P/8/8/8/8/8/n6K w - - 0 1')
move = Move(Sq.H7, Sq.H8, MoveType.N_PROMO)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
assert captured_piece == -1
assert not castling[Piece.WK]
assert not castling[Piece.WQ]
assert not castling[Piece.BK]
assert not castling[Piece.BQ]
assert ep_square == -1
assert half_move_clock == 0
assert board.fen() == 'k6N/8/8/8/8/8/8/n6K b - - 0 1'
assert board.color_bb[Color.WHITE].num == int('00000001'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000001', 2)
assert board.color_bb[Color.BLACK].num == int('10000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'10000000', 2)
assert len(board.piece_sq[Piece.WP]) == 0
assert sorted(board.piece_sq[Piece.WN]) == sorted([Sq.H8])
assert len(board.piece_sq[Piece.WB]) == 0
assert len(board.piece_sq[Piece.WR]) == 0
assert len(board.piece_sq[Piece.WQ]) == 0
assert sorted(board.piece_sq[Piece.WK]) == sorted([Sq.H1])
assert len(board.piece_sq[Piece.BP]) == 0
assert sorted(board.piece_sq[Piece.BN]) == sorted([Sq.A1])
assert len(board.piece_sq[Piece.BB]) == 0
assert len(board.piece_sq[Piece.BR]) == 0
assert len(board.piece_sq[Piece.BQ]) == 0
assert sorted(board.piece_sq[Piece.BK]) == sorted([Sq.A8])
# MoveType.N_PROMO_CAPTURE
board.fen('k5n1/7P/8/8/8/8/8/n6K w - - 0 1')
move = Move(Sq.H7, Sq.G8, MoveType.N_PROMO_CAPTURE)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
assert captured_piece == Piece.BN
assert not castling[Piece.WK]
assert not castling[Piece.WQ]
assert not castling[Piece.BK]
assert not castling[Piece.BQ]
assert ep_square == -1
assert half_move_clock == 0
assert board.fen() == 'k5N1/8/8/8/8/8/8/n6K b - - 0 1'
assert board.color_bb[Color.WHITE].num == int('00000010'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000001', 2)
assert board.color_bb[Color.BLACK].num == int('10000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'10000000', 2)
assert len(board.piece_sq[Piece.WP]) == 0
assert sorted(board.piece_sq[Piece.WN]) == sorted([Sq.G8])
assert len(board.piece_sq[Piece.WB]) == 0
assert len(board.piece_sq[Piece.WR]) == 0
assert len(board.piece_sq[Piece.WQ]) == 0
assert sorted(board.piece_sq[Piece.WK]) == sorted([Sq.H1])
assert len(board.piece_sq[Piece.BP]) == 0
assert sorted(board.piece_sq[Piece.BN]) == sorted([Sq.A1])
assert len(board.piece_sq[Piece.BB]) == 0
assert len(board.piece_sq[Piece.BR]) == 0
assert len(board.piece_sq[Piece.BQ]) == 0
assert sorted(board.piece_sq[Piece.BK]) == sorted([Sq.A8])
# MoveType.EP_CAPTURE
board.fen('k5n1/8/8/8/4pP2/8/8/n6K b - f3 1 1')
move = Move(Sq.E4, Sq.F3, MoveType.EP_CAPTURE)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
assert captured_piece == Piece.WP
assert not castling[Piece.WK]
assert not castling[Piece.WQ]
assert not castling[Piece.BK]
assert not castling[Piece.BQ]
assert ep_square == Sq.F3
assert half_move_clock == 1
assert board.fen() == 'k5n1/8/8/8/8/5p2/8/n6K w - - 0 2'
assert board.color_bb[Color.WHITE].num == int('00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000001', 2)
assert board.color_bb[Color.BLACK].num == int('10000010'
'00000000'
'00000000'
'00000000'
'00000000'
'00000100'
'00000000'
'10000000', 2)
assert len(board.piece_sq[Piece.WP]) == 0
assert len(board.piece_sq[Piece.WN]) == 0
assert len(board.piece_sq[Piece.WB]) == 0
assert len(board.piece_sq[Piece.WR]) == 0
assert len(board.piece_sq[Piece.WQ]) == 0
assert sorted(board.piece_sq[Piece.WK]) == sorted([Sq.H1])
assert sorted(board.piece_sq[Piece.BP]) == sorted([Sq.F3])
assert sorted(board.piece_sq[Piece.BN]) == sorted([Sq.G8, Sq.A1])
assert len(board.piece_sq[Piece.BB]) == 0
assert len(board.piece_sq[Piece.BR]) == 0
assert len(board.piece_sq[Piece.BQ]) == 0
assert sorted(board.piece_sq[Piece.BK]) == sorted([Sq.A8])
# MoveType.K_CASTLE
board.fen('k5n1/8/8/8/4pP2/8/8/4K2R w K - 0 1')
move = Move(Sq.E1, Sq.G1, MoveType.K_CASTLE)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
assert captured_piece == -1
assert castling[Piece.WK]
assert not castling[Piece.WQ]
assert not castling[Piece.BK]
assert not castling[Piece.BQ]
assert ep_square == -1
assert half_move_clock == 0
assert board.fen() == 'k5n1/8/8/8/4pP2/8/8/5RK1 b - - 1 1'
assert board.color_bb[Color.WHITE].num == int('00000000'
'00000000'
'00000000'
'00000000'
'00000100'
'00000000'
'00000000'
'00000110', 2)
assert board.color_bb[Color.BLACK].num == int('10000010'
'00000000'
'00000000'
'00000000'
'00001000'
'00000000'
'00000000'
'00000000', 2)
assert sorted(board.piece_sq[Piece.WP]) == sorted([Sq.F4])
assert len(board.piece_sq[Piece.WN]) == 0
assert len(board.piece_sq[Piece.WB]) == 0
assert sorted(board.piece_sq[Piece.WR]) == sorted([Sq.F1])
assert len(board.piece_sq[Piece.WQ]) == 0
assert sorted(board.piece_sq[Piece.WK]) == sorted([Sq.G1])
assert sorted(board.piece_sq[Piece.BP]) == sorted([Sq.E4])
assert sorted(board.piece_sq[Piece.BN]) == sorted([Sq.G8])
assert len(board.piece_sq[Piece.BB]) == 0
assert len(board.piece_sq[Piece.BR]) == 0
assert len(board.piece_sq[Piece.BQ]) == 0
assert sorted(board.piece_sq[Piece.BK]) == sorted([Sq.A8])
# MoveType.Q_CASTLE
board.fen('6bk/8/8/8/8/8/8/R3K3 w Q - 0 1')
move = Move(Sq.E1, Sq.C1, MoveType.Q_CASTLE)
captured_piece, castling, ep_square, half_move_clock, = board.make_move(move)
assert captured_piece == -1
assert not castling[Piece.WK]
assert castling[Piece.WQ]
assert not castling[Piece.BK]
assert not castling[Piece.BQ]
assert ep_square == -1
assert half_move_clock == 0
assert board.fen() == '6bk/8/8/8/8/8/8/2KR4 b - - 1 1'
assert board.color_bb[Color.WHITE].num == int('00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00110000', 2)
assert board.color_bb[Color.BLACK].num == int('00000011'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000'
'00000000', 2)
assert len(board.piece_sq[Piece.WP]) == 0
assert len(board.piece_sq[Piece.WN]) == 0
assert len(board.piece_sq[Piece.WB]) == 0
assert sorted(board.piece_sq[Piece.WR]) == sorted([Sq.D1])
assert len(board.piece_sq[Piece.WQ]) == 0
assert sorted(board.piece_sq[Piece.WK]) == sorted([Sq.C1])
assert len(board.piece_sq[Piece.BP]) == 0
assert len(board.piece_sq[Piece.BN]) == 0
assert sorted(board.piece_sq[Piece.BB]) == sorted([Sq.G8])
assert len(board.piece_sq[Piece.BR]) == 0
assert len(board.piece_sq[Piece.BQ]) == 0
assert sorted(board.piece_sq[Piece.BK]) == sorted([Sq.H8])
# TODO add more tests (X_PROMO, X_PROMO_CAPTURE)
def test_undo_move(self):
"""
Tests the undo_move() function of the Board class
"""
# make and undo a quiet move
board = Board()
move = Move(Sq.D2, Sq.D3, MoveType.QUIET)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == Board().fen()
# make and undo a double pawn push move
board = Board()
move = Move(Sq.E2, Sq.E4, MoveType.DOUBLE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == Board().fen()
# make and undo a kingside castling
board = Board('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQK2R w KQkq - 0 1')
move = Move(Sq.E1, Sq.G1, MoveType.K_CASTLE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQK2R w KQkq - 0 1'
# make and undo a queenside castling
board = Board('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/R3KBNR w KQkq - 0 1')
move = Move(Sq.E1, Sq.C1, MoveType.Q_CASTLE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/R3KBNR w KQkq - 0 1'
# make and undo a capture
board = Board('rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w - - 0 2')
move = Move(Sq.E4, Sq.D5, MoveType.CAPTURE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w - - 0 2'
# make and undo an en passant capture
board = Board('rnbqkbnr/ppp1pppp/8/8/3pP3/8/PPPP1PPP/RNBQKBNR b - e3 0 1')
move = Move(Sq.D4, Sq.E3, MoveType.EP_CAPTURE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'rnbqkbnr/ppp1pppp/8/8/3pP3/8/PPPP1PPP/RNBQKBNR b - e3 0 1'
# make and undo a promotion to knight
board = Board('k7/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.H8, MoveType.N_PROMO)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k7/7P/8/pp6/8/8/8/7K w - - 0 10'
# make and undo a promotion to bishop
board = Board('k7/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.H8, MoveType.B_PROMO)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k7/7P/8/pp6/8/8/8/7K w - - 0 10'
# make and undo a promotion to rook
board = Board('k7/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.H8, MoveType.R_PROMO)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k7/7P/8/pp6/8/8/8/7K w - - 0 10'
# make and undo a promotion to queen
board = Board('k7/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.H8, MoveType.Q_PROMO)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k7/7P/8/pp6/8/8/8/7K w - - 0 10'
# make and undo a promotion capture to knight
board = Board('k5p1/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.G8, MoveType.N_PROMO_CAPTURE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k5p1/7P/8/pp6/8/8/8/7K w - - 0 10'
# make and undo a promotion capture to bishop
board = Board('k5p1/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.G8, MoveType.B_PROMO_CAPTURE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k5p1/7P/8/pp6/8/8/8/7K w - - 0 10'
# make and undo a promotion capture to rook
board = Board('k5p1/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.G8, MoveType.R_PROMO_CAPTURE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k5p1/7P/8/pp6/8/8/8/7K w - - 0 10'
# make and undo a promotion capture to queen
board = Board('k5p1/7P/8/pp6/8/8/8/7K w - - 0 10')
move = Move(Sq.H7, Sq.G8, MoveType.Q_PROMO_CAPTURE)
captured_piece, castling, ep_square, half_move_clock = board.make_move(move)
board.undo_move(move, captured_piece, castling, ep_square, half_move_clock)
assert board.fen() == 'k5p1/7P/8/pp6/8/8/8/7K w - - 0 10'
def test_move_gen(self):
"""
# TODO add more specific tests comparing individual moves using Counter()
Tests the move_gen() function of the Board class
"""
board = Board()
moves = board.move_gen()
self.assertEqual(len(moves), 20)
# From https://chessprogramming.wikispaces.com/Perft+Results
board.fen('r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1')
moves = board.move_gen()
self.assertEqual(len(moves), 48)
board.fen('8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1')
moves = board.move_gen()
self.assertEqual(len(moves), 14)
board.fen('r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1')
moves = board.move_gen()
print(board)
self.assertEqual(len(moves), 6)
board.fen('rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8')
moves = board.move_gen()
self.assertEqual(len(moves), 44)
board.fen('r4rk1/1pp1qppp/p1np1n2/2b1p1B1/2B1P1b1/P1NP1N2/1PP1QPPP/R4RK1 w - - 0 10')
moves = board.move_gen()
self.assertEqual(len(moves), 46)
def test_get_target_noncapture_moves(self):
"""
Tests the get_target_noncapture_moves() function of the Board class
"""
# no target
board = Board()
target_bb = BitBoard(0)
moves = board.get_target_noncapture_moves(target_bb)
assert len(moves) == 0
# one target square, one move - pawn quiet move
board = Board('k7/pp6/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 0 1')
target_bb = BitBoard(0)
target_bb[Sq.G3] = 1
moves = board.get_target_noncapture_moves(target_bb)
assert len(moves) == 1
assert sorted(moves) == sorted([Move(Sq.G2, Sq.G3, MoveType.QUIET)])
# one target square, one move - pawn double pawn push
board = Board('k7/pp6/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 0 1')
target_bb = BitBoard(0)
target_bb[Sq.H4] = 1
moves = board.get_target_noncapture_moves(target_bb)
assert len(moves) == 1
assert sorted(moves) == sorted([Move(Sq.H2, Sq.H4, MoveType.DOUBLE)])
# one target square, two moves - pawn quiet move and knight
board = Board('k7/pp6/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 0 1')
target_bb = BitBoard(0)
target_bb[Sq.H3] = 1
moves = board.get_target_noncapture_moves(target_bb)
assert len(moves) == 2
assert sorted(moves) == sorted([Move(Sq.H2, Sq.H3, MoveType.QUIET), Move(Sq.G1, Sq.H3, MoveType.QUIET)])
# two target squares, three moves
board = Board('k7/pp6/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 0 1')
target_bb = BitBoard(0)
target_bb[Sq.H3] = 1
target_bb[Sq.E4] = 1
moves = board.get_target_noncapture_moves(target_bb)
assert len(moves) == 3
assert sorted(moves) == sorted([Move(Sq.E2, Sq.E4, MoveType.DOUBLE),
Move(Sq.H2, Sq.H3, MoveType.QUIET),
Move(Sq.G1, Sq.H3, MoveType.QUIET)])
def test_get_attacking_sqs(self):
"""
Tests the get_attacking_sqs() function of the Board class
"""
# no checks
board = Board()
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
check_sqs = board.get_attacking_sqs(king_sq)
self.assertEqual(len(check_sqs), 0)
# single check
board = Board('4K2k/8/5B2/8/8/8/8/1n6 b - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
check_sqs = board.get_attacking_sqs(king_sq)
self.assertEqual(len(check_sqs), 1)
self.assertListEqual(sorted(check_sqs), sorted([Sq.F6]))
# multiple checks
board = Board('7k/8/8/8/7r/8/5n2/7K w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
check_sqs = board.get_attacking_sqs(king_sq)
self.assertEqual(len(check_sqs), 2)
self.assertListEqual(sorted(check_sqs), sorted([Sq.H4, Sq.F2]))
def test_get_attacking_pawn_sqs(self):
"""
Tests the _get_attacking_pawn_sqs() function of the Board class
"""
# normal
board = Board('7k/8/8/8/6p1/7K/8/8 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
pawn_sqs = board._get_attacking_pawn_sqs(king_sq)
self.assertEqual(len(pawn_sqs), 1)
self.assertListEqual(sorted(pawn_sqs), sorted([Sq.G4]))
# no check
board = Board('7k/8/8/8/p6p/7K/8/8 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
pawn_sqs = board._get_attacking_pawn_sqs(king_sq)
self.assertEqual(len(pawn_sqs), 0)
# double check
# not possible in actual game of chess
board = Board('7K/8/8/8/8/4k3/3P1P2/8 b - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
pawn_sqs = board._get_attacking_pawn_sqs(king_sq)
self.assertEqual(len(pawn_sqs), 2)
self.assertListEqual(sorted(pawn_sqs), sorted([Sq.D2, Sq.F2]))
# pawn on 2nd/7th row (promotion)
board = Board('7k/8/8/8/8/8/3p4/4K3 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
pawn_sqs = board._get_attacking_pawn_sqs(king_sq)
self.assertEqual(len(pawn_sqs), 1)
self.assertListEqual(sorted(pawn_sqs), sorted([Sq.D2]))
def test_get_attacking_knight_sqs(self):
"""
Tests the _get_attacking_knight_sqs() function of the Board class
"""
# normal
board = Board('7k/8/8/8/5n2/7K/8/8 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
knight_sqs = board._get_attacking_knight_sqs(king_sq)
self.assertEqual(len(knight_sqs), 1)
self.assertListEqual(sorted(knight_sqs), sorted([Sq.F4]))
# no check
board = Board('nn6/8/8/8/8/7K/8/3k4 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
knight_sqs = board._get_attacking_knight_sqs(king_sq)
self.assertEqual(len(knight_sqs), 0)
# double check
# not possible in actual game of chess
board = Board('7K/8/8/8/8/4k3/8/3N1N2 b - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
knight_sqs = board._get_attacking_knight_sqs(king_sq)
self.assertEqual(len(knight_sqs), 2)
self.assertListEqual(sorted(knight_sqs), sorted([Sq.D1, Sq.F1]))
def test_get_attacking_bishop_sqs(self):
"""
Tests the _get_attacking_bishop_sqs() function of the Board class
"""
# normal
board = Board('7k/8/8/8/6b1/7K/8/8 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
bishop_sqs = board._get_attacking_bishop_sqs(king_sq)
self.assertEqual(len(bishop_sqs), 1)
self.assertListEqual(sorted(bishop_sqs), sorted([Sq.G4]))
# no check
board = Board('6bb/8/8/8/8/7K/8/3k4 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
bishop_sqs = board._get_attacking_bishop_sqs(king_sq)
self.assertEqual(len(bishop_sqs), 0)
# no check (covered)
board = Board('8/8/8/5b2/6N1/7K/8/3k4 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
bishop_sqs = board._get_attacking_bishop_sqs(king_sq)
self.assertEqual(len(bishop_sqs), 0)
# double check
# not possible in actual game of chess
board = Board('7K/8/8/8/8/4k3/3B4/6B1 b - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
bishop_sqs = board._get_attacking_bishop_sqs(king_sq)
self.assertEqual(len(bishop_sqs), 2)
self.assertListEqual(sorted(bishop_sqs), sorted([Sq.D2, Sq.G1]))
def test_get_attacking_rook_sqs(self):
"""
Tests the _get_attacking_rook_sqs() function of the Board class
"""
# normal
board = Board('7k/8/8/7r/8/7K/8/8 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
rook_sqs = board._get_attacking_rook_sqs(king_sq)
self.assertEqual(len(rook_sqs), 1)
self.assertListEqual(sorted(rook_sqs), sorted([Sq.H5]))
# no check
board = Board('6r1/8/8/8/8/7K/8/3k4 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
rook_sqs = board._get_attacking_rook_sqs(king_sq)
self.assertEqual(len(rook_sqs), 0)
# no check (covered)
board = Board('8/8/8/5b2/6N1/5rnK/8/3k4 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
rook_sqs = board._get_attacking_rook_sqs(king_sq)
self.assertEqual(len(rook_sqs), 0)
# double check
# not possible in actual game of chess
board = Board('7K/8/8/4R3/8/2R1k3/3B4/6B1 b - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
rook_sqs = board._get_attacking_rook_sqs(king_sq)
self.assertEqual(len(rook_sqs), 2)
self.assertListEqual(sorted(rook_sqs), sorted([Sq.E5, Sq.C3]))
def test_get_attacking_queen_sqs(self):
"""
Tests the _get_attacking_queen_sqs() function of the Board class
"""
# normal
board = Board('7k/8/7q/8/8/7K/8/8 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
queen_sqs = board._get_attacking_queen_sqs(king_sq)
self.assertEqual(len(queen_sqs), 1)
self.assertListEqual(sorted(queen_sqs), sorted([Sq.H6]))
# no check
board = Board('5q1Q/8/8/8/8/7K/8/3k4 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
queen_sqs = board._get_attacking_queen_sqs(king_sq)
self.assertEqual(len(queen_sqs), 0)
# no check (covered)
board = Board('8/8/8/5b2/q2N3K/8/8/3k4 w - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
queen_sqs = board._get_attacking_queen_sqs(king_sq)
self.assertEqual(len(queen_sqs), 0)
# triple check
# not possible in actual game of chess
board = Board('7K/8/6Q1/5n2/8/3Q2k1/7Q/6b1 b - - 0 1')
king = Piece.WK if board.turn == Color.WHITE else Piece.BK
king_sq = board.piece_sq[king][0]
queen_sqs = board._get_attacking_queen_sqs(king_sq)
self.assertEqual(len(queen_sqs), 3)
self.assertListEqual(sorted(queen_sqs), sorted([Sq.H2, Sq.D3, Sq.G6]))
def test_find_pinned(self):
"""
Tests the _find_pinned() function of the Board class
"""
# pinned by bishop
board = Board('k6K/1p6/8/8/8/8/8/7B b - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 1)
self.assertEqual(sorted(pinned[0]), sorted([Sq.B7]))
self.assertEqual(len(pinned[1]), 0)
# pinned by rook
board = Board('k6K/8/8/n7/8/8/8/R7 b - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 1)
self.assertEqual(sorted(pinned[0]), sorted([Sq.A5]))
self.assertEqual(len(pinned[1]), 0)
# pinned by queen
board = Board('k6K/1p6/8/8/8/5Q2/8/8 b - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 1)
self.assertEqual(sorted(pinned[0]), sorted([Sq.B7]))
self.assertEqual(len(pinned[1]), 0)
# no pinned piece (no slider on trajectory)
board = Board('k6K/1p6/8/2r5/8/3b4/8/8 w - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 0)
self.assertEqual(len(pinned[1]), 0)
# no pinned piece (multiple allied piece on slider trajectory)
board = Board('K6k/1N6/8/3P4/4q3/8/8/8 w - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 0)
self.assertEqual(len(pinned[1]), 0)
# no pinned piece (enemy piece on slider trajectory)
board = Board('q3k3/8/2n5/3K4/8/8/8/7B w - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 0)
self.assertEqual(len(pinned[1]), 0)
# no pinned piece, piece in trajectory but further than king
board = Board('1q5k/8/8/8/8/6K1/7R/8 w - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 0)
self.assertEqual(len(pinned[1]), 0)
# one pinned, piece in trajectory but further than king
board = Board('q6k/8/8/8/4P3/5K2/8/7B w - - 0 1')
pinned = board.find_pinned()
self.assertEqual(len(pinned[0]), 1)
self.assertEqual(sorted(pinned[0]), sorted([Sq.E4]))
self.assertEqual(len(pinned[1]), 0)
# multiple pinned pieces
board = Board('1q1k4/2R5/8/rN2K3/8/8/8/8 w - - 0 1')
pinned = board.find_pinned()
print(board)
self.assertEqual(len(pinned[0]), 2)
self.assertEqual(sorted(pinned[0]), sorted([Sq.C7, Sq.B5]))
self.assertEqual(len(pinned[1]), 0)
def test_pinned_move_gen(self):
"""
Tests the _pinned_move_gen() function of the Board class
"""
# pawn pinned by rook
board = Board('k6K/8/8/8/8/p7/8/R7 b - - 0 1')
moves = board._pinned_move_gen(Sq.A3, Sq.A1, Direction.U)
assert len(moves) == 1
assert sorted(moves) == [Move(Sq.A3, Sq.A2, MoveType. QUIET)]
# knight pinned by rook
board = Board('k6K/8/8/8/8/n7/8/R7 b - - 0 1')
moves = board._pinned_move_gen(Sq.A3, Sq.A1, Direction.U)
self.assertEqual(len(moves), 0)
# bishop pinned by rook
board = Board('k6K/8/8/8/b7/8/8/R7 b - - 0 1')
moves = board._pinned_move_gen(Sq.A4, Sq.A1, Direction.U)
self.assertEqual(len(moves), 0)
# rook pinned by rook
board = Board('8/8/8/k6K/8/r7/8/R7 b - - 0 1')
moves = board._pinned_move_gen(Sq.A3, Sq.A1, Direction.U)
assert len(moves) == 3
assert sorted(moves) == [Move(Sq.A3, Sq.A1, MoveType.CAPTURE),
Move(Sq.A3, Sq.A2, MoveType.QUIET),
Move(Sq.A3, Sq.A4, MoveType.QUIET)]
# queen pinned by rook
board = Board('8/8/8/8/k6K/q7/8/R7 b - - 0 1')
moves = board._pinned_move_gen(Sq.A3, Sq.A1, Direction.U)
assert len(moves) == 2
assert sorted(moves) == [Move(Sq.A3, Sq.A1, MoveType.CAPTURE),
Move(Sq.A3, Sq.A2, MoveType.QUIET)]
# pawn pinned by bishop (no attack)
board = Board('K6k/8/8/8/3p4/8/1B6/8 b - - 0 1')
moves = board._pinned_move_gen(Sq.D4, Sq.B2, Direction.UR)
assert len(moves) == 0
# pawn pinned by bishop (can attack)
board = Board('K6k/8/8/8/8/2p5/1B6/8 b - - 0 1')
moves = board._pinned_move_gen(Sq.C3, Sq.B2, Direction.UR)
self.assertEqual(len(moves), 1)
self.assertEqual(sorted(moves), [Move(Sq.C3, Sq.B2, MoveType.CAPTURE)])
# pawn pinned by bishop (promo attack)
board = Board('K6k/8/8/8/8/8/1p6/B7 b - - 0 1')
moves = board._pinned_move_gen(Sq.B2, Sq.A1, Direction.UR)
assert len(moves) == 4
assert sorted(moves) == [Move(Sq.B2, Sq.A1, MoveType.N_PROMO_CAPTURE),
Move(Sq.B2, Sq.A1, MoveType.B_PROMO_CAPTURE),
Move(Sq.B2, Sq.A1, MoveType.R_PROMO_CAPTURE),
Move(Sq.B2, Sq.A1, MoveType.Q_PROMO_CAPTURE)]
# knight pinned by bishop
board = Board('k6K/6N1/8/8/8/8/1b6/8 w - - 0 1')
moves = board._pinned_move_gen(Sq.G7, Sq.B2, Direction.UR)
self.assertEqual(len(moves), 0)
# bishop pinned by bishop
board = Board('k6K/6B1/8/4b3/8/8/8/8 w - - 0 1')
moves = board._pinned_move_gen(Sq.G7, Sq.E5, Direction.UR)
assert len(moves) == 2
assert sorted(moves) == [Move(Sq.G7, Sq.E5, MoveType.CAPTURE),
Move(Sq.G7, Sq.F6, MoveType.QUIET)]
# rook pinned by bishop
board = Board('k6K/6R1/8/8/8/8/1b6/8 w - - 0 1')
moves = board._pinned_move_gen(Sq.G7, Sq.B2, Direction.UR)
assert len(moves) == 0
# queen pinned by bishop
board = Board('k6K/8/5Q2/4b3/8/8/8/8 w - - 0 1')
moves = board._pinned_move_gen(Sq.F6, Sq.E5, Direction.UR)
assert len(moves) == 2
assert sorted(moves) == [Move(Sq.F6, Sq.E5, MoveType.CAPTURE),
Move(Sq.F6, Sq.G7, MoveType.QUIET)]
def test_pawn_move_gen(self):
"""
Tests the pawn_move_gen() function of the Board class
"""
# test on starting position
board = Board()
pawn_moves = board._pawn_move_gen()
self.assertEqual(len(pawn_moves), 16)
self.assertListEqual(sorted(pawn_moves), sorted([Move(Sq.A2, Sq.A3, MoveType.QUIET),
Move(Sq.A2, Sq.A4, MoveType.DOUBLE),
Move(Sq.B2, Sq.B3, MoveType.QUIET),
Move(Sq.B2, Sq.B4, MoveType.DOUBLE),
Move(Sq.C2, Sq.C3, MoveType.QUIET),
Move(Sq.C2, Sq.C4, MoveType.DOUBLE),
Move(Sq.D2, Sq.D3, MoveType.QUIET),
Move(Sq.D2, Sq.D4, MoveType.DOUBLE),
Move(Sq.E2, Sq.E3, MoveType.QUIET),
Move(Sq.E2, Sq.E4, MoveType.DOUBLE),
Move(Sq.F2, Sq.F3, MoveType.QUIET),
Move(Sq.F2, Sq.F4, MoveType.DOUBLE),
Move(Sq.G2, Sq.G3, MoveType.QUIET),
Move(Sq.G2, Sq.G4, MoveType.DOUBLE),
Move(Sq.H2, Sq.H3, MoveType.QUIET),
Move(Sq.H2, Sq.H4, MoveType.DOUBLE)]))
# test for capture
board = Board('7k/8/8/3p4/4P3/8/8/K7 w - - 0 1')
pawn_moves = board._pawn_move_gen()
self.assertEqual(len(pawn_moves), 2)
self.assertListEqual(sorted(pawn_moves), sorted([Move(Sq.E4, Sq.E5, MoveType.QUIET),
Move(Sq.E4, Sq.D5, MoveType.CAPTURE)]))
# test for promotions
board = Board('k6K/8/8/8/8/8/7p/6N1 b - - 0 1')
pawn_moves = board._pawn_move_gen()
self.assertEqual(len(pawn_moves), 8)
self.assertListEqual(sorted(pawn_moves), sorted([Move(Sq.H2, Sq.H1, MoveType.N_PROMO),
Move(Sq.H2, Sq.H1, MoveType.B_PROMO),
Move(Sq.H2, Sq.H1, MoveType.R_PROMO),
Move(Sq.H2, Sq.H1, MoveType.Q_PROMO),
Move(Sq.H2, Sq.G1, MoveType.N_PROMO_CAPTURE),
Move(Sq.H2, Sq.G1, MoveType.B_PROMO_CAPTURE),
Move(Sq.H2, Sq.G1, MoveType.R_PROMO_CAPTURE),
Move(Sq.H2, Sq.G1, MoveType.Q_PROMO_CAPTURE)]))
# test for en passant capture
board = Board('k7/8/8/8/3pP3/8/8/7K b - e3 0 1')
pawn_moves = board._pawn_move_gen()
self.assertEqual(len(pawn_moves), 2)
self.assertListEqual(sorted(pawn_moves), sorted([Move(Sq.D4, Sq.D3, MoveType.QUIET),
Move(Sq.D4, Sq.E3, MoveType.EP_CAPTURE)]))
# test for optional parameter pinned_sqs
board = Board('k7/8/2q5/8/4P3/8/8/7K w - - 0 1')
pinned_sqs = [Sq.E4]
pawn_moves = board._pawn_move_gen(pinned_sqs)
self.assertEqual(len(pawn_moves), 0)
def test_knight_move_gen(self):
"""
Tests the knight_move_gen() function of the Board class
"""
board = Board()
knight_moves = board._knight_move_gen()
self.assertEqual(len(knight_moves), 4)
self.assertListEqual(sorted(knight_moves), sorted([Move(Sq.B1, Sq.A3, MoveType.QUIET),
Move(Sq.B1, Sq.C3, MoveType.QUIET),
Move(Sq.G1, Sq.F3, MoveType.QUIET),
Move(Sq.G1, Sq.H3, MoveType.QUIET)]))
board = Board('K6k/8/8/8/8/6p1/8/7N w - - 0 1')
knight_moves = board._knight_move_gen()
self.assertEqual(len(knight_moves), 2)
self.assertListEqual(sorted(knight_moves), sorted([Move(Sq.H1, Sq.G3, MoveType.CAPTURE),
Move(Sq.H1, Sq.F2, MoveType.QUIET)]))
board = Board('K7/8/8/6R1/4n3/8/4n3/2k5 b - - 0 1')
knight_moves = board._knight_move_gen()
self.assertEqual(len(knight_moves), 13)
self.assertListEqual(sorted(knight_moves), sorted([Move(Sq.E2, Sq.C3, MoveType.QUIET),
Move(Sq.E2, Sq.D4, MoveType.QUIET),
Move(Sq.E2, Sq.F4, MoveType.QUIET),
Move(Sq.E2, Sq.G3, MoveType.QUIET),
Move(Sq.E2, Sq.G1, MoveType.QUIET),
Move(Sq.E4, Sq.D2, MoveType.QUIET),
Move(Sq.E4, Sq.C3, MoveType.QUIET),
Move(Sq.E4, Sq.C5, MoveType.QUIET),
Move(Sq.E4, Sq.D6, MoveType.QUIET),
Move(Sq.E4, Sq.F6, MoveType.QUIET),
Move(Sq.E4, Sq.G5, MoveType.CAPTURE),
Move(Sq.E4, Sq.G3, MoveType.QUIET),
Move(Sq.E4, Sq.F2, MoveType.QUIET)]))
# test for optional parameter pinned_sqs
board = Board('k7/8/2q5/8/8/5N2/8/7K w - - 0 1')
pinned_sqs = [Sq.F3]
knight_moves = board._knight_move_gen(pinned_sqs)
self.assertEqual(len(knight_moves), 0)
def test_bishop_move_gen(self):
"""
Tests the bishop_move_gen() function of the Board class
"""
board = Board()
bishop_moves = board._bishop_move_gen()
self.assertEqual(len(bishop_moves), 0)
board = Board('K6k/8/8/8/8/6p1/8/7B w - - 0 1')
bishop_moves = board._bishop_move_gen()
self.assertEqual(len(bishop_moves), 6)
self.assertListEqual(sorted(bishop_moves), sorted([Move(Sq.H1, Sq.G2, MoveType.QUIET),
Move(Sq.H1, Sq.F3, MoveType.QUIET),
Move(Sq.H1, Sq.E4, MoveType.QUIET),
Move(Sq.H1, Sq.D5, MoveType.QUIET),
Move(Sq.H1, Sq.C6, MoveType.QUIET),
Move(Sq.H1, Sq.B7, MoveType.QUIET)]))
board = Board('k6K/8/2N5/8/8/5b2/8/7b b - - 0 1')
bishop_moves = board._bishop_move_gen()
self.assertEqual(len(bishop_moves), 9)
self.assertListEqual(sorted(bishop_moves), sorted([Move(Sq.H1, Sq.G2, MoveType.QUIET),
Move(Sq.F3, Sq.G2, MoveType.QUIET),
Move(Sq.F3, Sq.E2, MoveType.QUIET),
Move(Sq.F3, Sq.D1, MoveType.QUIET),
Move(Sq.F3, Sq.G4, MoveType.QUIET),
Move(Sq.F3, Sq.H5, MoveType.QUIET),
Move(Sq.F3, Sq.E4, MoveType.QUIET),
Move(Sq.F3, Sq.D5, MoveType.QUIET),
Move(Sq.F3, Sq.C6, MoveType.CAPTURE)]))
# test for optional parameter pinned_sqs
board = Board('k7/8/2q5/8/8/5N2/8/r2B3K w - - 0 1')
pinned_sqs = [Sq.D1]
bishop_moves = board._bishop_move_gen(pinned_sqs)
self.assertEqual(len(bishop_moves), 0)
def test_rook_move_gen(self):
"""
Tests the rook_move_gen() function of the Board class
"""
board = Board()
rook_moves = board._rook_move_gen()
self.assertEqual(len(rook_moves), 0)
board = Board('K5k1/8/8/8/8/8/8/7R w - - 0 1')
rook_moves = board._rook_move_gen()
self.assertEqual(len(rook_moves), 14)
self.assertListEqual(sorted(rook_moves), sorted([Move(Sq.H1, Sq.H2, MoveType.QUIET),
Move(Sq.H1, Sq.H3, MoveType.QUIET),
Move(Sq.H1, Sq.H4, MoveType.QUIET),
Move(Sq.H1, Sq.H5, MoveType.QUIET),
Move(Sq.H1, Sq.H6, MoveType.QUIET),
Move(Sq.H1, Sq.H7, MoveType.QUIET),
Move(Sq.H1, Sq.H8, MoveType.QUIET),
Move(Sq.H1, Sq.G1, MoveType.QUIET),
Move(Sq.H1, Sq.F1, MoveType.QUIET),
Move(Sq.H1, Sq.E1, MoveType.QUIET),
Move(Sq.H1, Sq.D1, MoveType.QUIET),
Move(Sq.H1, Sq.C1, MoveType.QUIET),
Move(Sq.H1, Sq.B1, MoveType.QUIET),
Move(Sq.H1, Sq.A1, MoveType.QUIET)]))
board = Board('K6k/8/8/8/8/8/8/2N2r1r b - - 0 1')
rook_moves = board._rook_move_gen()
self.assertEqual(len(rook_moves), 18)
self.assertListEqual(sorted(rook_moves), sorted([Move(Sq.H1, Sq.H2, MoveType.QUIET),
Move(Sq.H1, Sq.H3, MoveType.QUIET),
Move(Sq.H1, Sq.H4, MoveType.QUIET),
Move(Sq.H1, Sq.H5, MoveType.QUIET),
Move(Sq.H1, Sq.H6, MoveType.QUIET),
Move(Sq.H1, Sq.H7, MoveType.QUIET),
Move(Sq.H1, Sq.G1, MoveType.QUIET),
Move(Sq.F1, Sq.F2, MoveType.QUIET),
Move(Sq.F1, Sq.F3, MoveType.QUIET),
Move(Sq.F1, Sq.F4, MoveType.QUIET),
Move(Sq.F1, Sq.F5, MoveType.QUIET),
Move(Sq.F1, Sq.F6, MoveType.QUIET),
Move(Sq.F1, Sq.F7, MoveType.QUIET),
Move(Sq.F1, Sq.F8, MoveType.QUIET),
Move(Sq.F1, Sq.G1, MoveType.QUIET),
Move(Sq.F1, Sq.E1, MoveType.QUIET),
Move(Sq.F1, Sq.D1, MoveType.QUIET),
Move(Sq.F1, Sq.C1, MoveType.CAPTURE)]))
# test for optional parameter pinned_sqs
board = Board('k7/1b6/8/8/8/5R2/8/7K w - - 0 1')
pinned_sqs = [Sq.F3]
rook_moves = board._rook_move_gen(pinned_sqs)
self.assertEqual(len(rook_moves), 0)
def test_queen_move_gen(self):
"""
Tests the queen_move_gen() function of the Board class
"""
board = Board()
queen_moves = board._queen_move_gen()
self.assertEqual(len(queen_moves), 0)
board = Board('K5k1/8/8/8/8/8/8/6rQ w - - 0 1')
queen_moves = board._queen_move_gen()
self.assertEqual(len(queen_moves), 14)
self.assertListEqual(sorted(queen_moves), sorted([Move(Sq.H1, Sq.H2, MoveType.QUIET),
Move(Sq.H1, Sq.H3, MoveType.QUIET),
Move(Sq.H1, Sq.H4, MoveType.QUIET),
Move(Sq.H1, Sq.H5, MoveType.QUIET),
Move(Sq.H1, Sq.H6, MoveType.QUIET),
Move(Sq.H1, Sq.H7, MoveType.QUIET),
Move(Sq.H1, Sq.H8, MoveType.QUIET),
Move(Sq.H1, Sq.G2, MoveType.QUIET),
Move(Sq.H1, Sq.F3, MoveType.QUIET),
Move(Sq.H1, Sq.E4, MoveType.QUIET),
Move(Sq.H1, Sq.D5, MoveType.QUIET),
Move(Sq.H1, Sq.C6, MoveType.QUIET),
Move(Sq.H1, Sq.B7, MoveType.QUIET),
Move(Sq.H1, Sq.G1, MoveType.CAPTURE)]))
board = Board('k3K2N/8/8/8/3p4/5b2/8/4R1qq b - - 0 1')
queen_moves = board._queen_move_gen()
self.assertEqual(len(queen_moves), 20)
self.assertListEqual(sorted(queen_moves), sorted([Move(Sq.H1, Sq.H2, MoveType.QUIET),
Move(Sq.H1, Sq.H3, MoveType.QUIET),
Move(Sq.H1, Sq.H4, MoveType.QUIET),
Move(Sq.H1, Sq.H5, MoveType.QUIET),
Move(Sq.H1, Sq.H6, MoveType.QUIET),
Move(Sq.H1, Sq.H7, MoveType.QUIET),
Move(Sq.H1, Sq.H8, MoveType.CAPTURE),
Move(Sq.H1, Sq.G2, MoveType.QUIET),
Move(Sq.G1, Sq.G2, MoveType.QUIET),
Move(Sq.G1, Sq.G3, MoveType.QUIET),
Move(Sq.G1, Sq.G4, MoveType.QUIET),
Move(Sq.G1, Sq.G5, MoveType.QUIET),
Move(Sq.G1, Sq.G6, MoveType.QUIET),
Move(Sq.G1, Sq.G7, MoveType.QUIET),
Move(Sq.G1, Sq.G8, MoveType.QUIET),
Move(Sq.G1, Sq.F1, MoveType.QUIET),
Move(Sq.G1, Sq.E1, MoveType.CAPTURE),
Move(Sq.G1, Sq.F2, MoveType.QUIET),
Move(Sq.G1, Sq.E3, MoveType.QUIET),
Move(Sq.G1, Sq.H2, MoveType.QUIET)]))
# test for optional parameter pinned_sqs
# note that the move capturing the pinning piece is not generated in this function, but in the
# Board._pinned_move_gen()
board = Board('k7/8/8/8/8/8/8/1r4QK w - - 0 1')
pinned_sqs = [Sq.G1]
queen_moves = board._queen_move_gen(pinned_sqs)
self.assertEqual(len(queen_moves), 0)
def test_king_move_gen(self):
"""
Tests the king_move_gen() function of the Board class
"""
board = Board()
king_moves = board._king_move_gen()
self.assertEqual(len(king_moves), 0)
# 3 pseudolegal moves, 2 legal moves
board = Board('k7/8/8/8/8/6p1/8/6nK w - - 0 1')
king_moves = board._king_move_gen()
self.assertEqual(len(king_moves), 2)
self.assertListEqual(sorted(king_moves), sorted([Move(Sq.H1, Sq.G2, MoveType.QUIET),
Move(Sq.H1, Sq.G1, MoveType.CAPTURE)]))
# 7 pseudolegal moves, 5 legal moves
board = Board('8/8/8/3kb3/3N4/8/8/6nK b - - 0 1')
print()
print(board)
king_moves = board._king_move_gen()
self.assertEqual(len(king_moves), 5)
self.assertListEqual(sorted(king_moves), sorted([Move(Sq.D5, Sq.C4, MoveType.QUIET),
Move(Sq.D5, Sq.C5, MoveType.QUIET),
Move(Sq.D5, Sq.D6, MoveType.QUIET),
Move(Sq.D5, Sq.E4, MoveType.QUIET),
Move(Sq.D5, Sq.D4, MoveType.CAPTURE)]))
def test_castling_move_gen(self):
"""
Tests the castling_move_gen() function of the Board class
"""
# all castling possible
board = Board('k7/8/8/8/8/8/8/R3K2R w KQkq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 2)
self.assertListEqual(sorted(moves), sorted([Move(Sq.E1, Sq.C1, MoveType.Q_CASTLE),
Move(Sq.E1, Sq.G1, MoveType.K_CASTLE)]))
board = Board('r3k2r/8/8/8/8/8/8/R3K2R b KQkq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 2)
self.assertListEqual(sorted(moves), sorted([Move(Sq.E8, Sq.C8, MoveType.Q_CASTLE),
Move(Sq.E8, Sq.G8, MoveType.K_CASTLE)]))
# one castling blocked by allied piece
board = Board('k7/8/8/8/8/8/8/R2BK2R w KQkq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 1)
self.assertListEqual(sorted(moves), sorted([Move(Sq.E1, Sq.G1, MoveType.K_CASTLE)]))
# one castling blocked by "rook moving"
board = Board('k7/8/8/8/8/8/8/R3K2R w Qkq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 1)
self.assertListEqual(sorted(moves), sorted([Move(Sq.E1, Sq.C1, MoveType.Q_CASTLE)]))
# both castling blocked by "king moving"
board = Board('k7/8/8/8/8/8/8/R3K2R w kq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 0)
# castling not allowed due to king on check
board = Board('k7/8/8/8/8/4r3/8/R3K2R w KQkq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 0)
# one castling not allowed due to check while castling
board = Board('k7/8/8/8/8/3r4/8/R3K2R w KQkq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 1)
self.assertListEqual(sorted(moves), sorted([Move(Sq.E1, Sq.G1, MoveType.K_CASTLE)]))
# one castling not allowed due to check after castling
board = Board('k7/8/8/8/8/2r5/8/R3K2R w KQkq - 0 1')
moves = board._castling_move_gen()
self.assertEqual(len(moves), 1)
self.assertListEqual(sorted(moves), sorted([Move(Sq.E1, Sq.G1, MoveType.K_CASTLE)]))
def test_get_safe_bb(self):
"""
Tests the _get_safe_bb() function of the Board class
"""
# just king
board = Board('k7/8/8/8/8/8/8/7K w - - 0 1')
safe_bb = board._get_safe_bb()
self.assertEqual(sorted((~safe_bb).indices()), sorted([Sq.B7, Sq.B8, Sq.A7]))
# king and pawn
board = Board('k7/7p/8/8/8/8/8/7K w - - 0 1')
safe_bb = board._get_safe_bb()
self.assertEqual(sorted((~safe_bb).indices()), sorted([Sq.B7, Sq.B8, Sq.A7, Sq.G6]))
# king and knight
board = Board('k5n1/8/8/8/8/8/8/7K w - - 0 1')
safe_bb = board._get_safe_bb()
self.assertEqual(sorted((~safe_bb).indices()), sorted([Sq.B7, Sq.B8, Sq.A7, Sq.E7, Sq.F6, Sq.H6]))
# king and bishop
board = Board('k4b2/8/8/8/8/8/8/7K w - - 0 1')
safe_bb = board._get_safe_bb()
self.assertEqual(sorted((~safe_bb).indices()), sorted([Sq.B7, Sq.B8, Sq.A7, Sq.E7, Sq.D6, Sq.C5, Sq.B4, Sq.A3,
Sq.G7, Sq.H6]))
# king and rook
board = Board('k7/8/8/8/8/8/8/4K2R b - - 0 1')
safe_bb = board._get_safe_bb()
self.assertEqual(sorted((~safe_bb).indices()), sorted([Sq.H2, Sq.H3, Sq.H4, Sq.H5, Sq.H6, Sq.H7, Sq.H8, Sq.G1,
Sq.F1, Sq.F2, Sq.E1, Sq.E2, Sq.D2, Sq.D1]))
# king and queen
board = Board('k7/8/8/8/8/8/8/4KQ2 b - - 0 1')
safe_bb = board._get_safe_bb()
self.assertEqual(sorted((~safe_bb).indices()), sorted([Sq.F2, Sq.F3, Sq.F4, Sq.F5, Sq.F6, Sq.F7, Sq.F8,
Sq.E2, Sq.D3, Sq.C4, Sq.B5, Sq.A6,
Sq.G1, Sq.H1, Sq.G2, Sq.H3, Sq.D1, Sq.D2, Sq.F1, Sq.E1]))
# starting position
board = Board()
safe_bb = board._get_safe_bb()
self.assertEqual(sorted((~safe_bb).indices()), sorted([Sq.B8, Sq.C8, Sq.D8, Sq.E8, Sq.F8, Sq.G8,
Sq.A7, Sq.B7, Sq.C7, Sq.D7, Sq.E7, Sq.F7, Sq.G7, Sq.H7,
Sq.A6, Sq.B6, Sq.C6, Sq.D6, Sq.E6, Sq.F6, Sq.G6, Sq.H6]))
def test_eval(self):
"""
Tests the test_eval() function of the Board class
"""
# starting position
board = Board()
assert board.eval() == 0
# after 1. e4
board.make_move(Move(Sq.E2, Sq.E4, MoveType.DOUBLE))
# note that make_move() also changes the turn
assert board.eval() == -(const.PCSQ_VALUE[Piece.WP][Sq.E4] - const.PCSQ_VALUE[Piece.WP][Sq.E2])
# after 1. e4 - d5
board.make_move(Move(Sq.D7, Sq.D5, MoveType.DOUBLE))
assert board.eval() == (const.PCSQ_VALUE[Piece.WP][Sq.E4] - const.PCSQ_VALUE[Piece.WP][Sq.E2]) + \
(const.PCSQ_VALUE[Piece.BP][Sq.D5] - const.PCSQ_VALUE[Piece.BP][Sq.D7])
# no piece
board = Board('8/8/8/8/8/8/8/8 w - - 0 1')
assert board.eval() == 0
# white pawn
board = Board('8/8/8/8/8/8/7P/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.WP] + const.PCSQ_VALUE[Piece.WP][Sq.H2]
board = Board('8/8/8/8/8/8/7P/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.WP] + const.PCSQ_VALUE[Piece.WP][Sq.H2])
# black pawn
board = Board('8/3p4/8/8/8/8/8/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.BP] + const.PCSQ_VALUE[Piece.BP][Sq.D7]
board = Board('8/3p4/8/8/8/8/8/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.BP] + const.PCSQ_VALUE[Piece.BP][Sq.D7])
# white knight
board = Board('8/8/8/8/8/8/8/1N6 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.WN] + const.PCSQ_VALUE[Piece.WN][Sq.B1]
board = Board('8/8/8/8/8/8/8/1N6 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.WN] + const.PCSQ_VALUE[Piece.WN][Sq.B1])
# black knight
board = Board('8/8/8/8/2n5/8/8/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.BN] + const.PCSQ_VALUE[Piece.BN][Sq.C4]
board = Board('8/8/8/8/2n5/8/8/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.BN] + const.PCSQ_VALUE[Piece.BN][Sq.C4])
# white bishop
board = Board('8/8/8/8/8/8/6B1/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.WB] + const.PCSQ_VALUE[Piece.WB][Sq.G2]
board = Board('8/8/8/8/8/8/6B1/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.WB] + const.PCSQ_VALUE[Piece.WB][Sq.G2])
# black bishop
board = Board('6b1/8/8/8/8/8/8/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.BB] + const.PCSQ_VALUE[Piece.BB][Sq.G8]
board = Board('6b1/8/8/8/8/8/8/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.BB] + const.PCSQ_VALUE[Piece.BB][Sq.G8])
# white rook
board = Board('8/8/8/8/8/8/8/R7 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.WR] + const.PCSQ_VALUE[Piece.WR][Sq.A1]
board = Board('8/8/8/8/8/8/8/R7 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.WR] + const.PCSQ_VALUE[Piece.WR][Sq.A1])
# black rook
board = Board('8/7r/8/8/8/8/8/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.BR] + const.PCSQ_VALUE[Piece.BR][Sq.H7]
board = Board('8/7r/8/8/8/8/8/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.BR] + const.PCSQ_VALUE[Piece.BR][Sq.H7])
# white queen
board = Board('8/8/8/8/8/8/2Q5/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.WQ] + const.PCSQ_VALUE[Piece.WQ][Sq.C2]
board = Board('8/8/8/8/8/8/2Q5/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.WQ] + const.PCSQ_VALUE[Piece.WQ][Sq.C2])
# black queen
board = Board('3q4/8/8/8/8/8/8/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.BQ] + const.PCSQ_VALUE[Piece.BQ][Sq.D8]
board = Board('3q4/8/8/8/8/8/8/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.BQ] + const.PCSQ_VALUE[Piece.BQ][Sq.D8])
# white king
board = Board('8/8/8/8/8/8/8/4K3 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.WK] + const.PCSQ_VALUE[Piece.WK][Sq.E1]
board = Board('8/8/8/8/8/8/8/4K3 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.WK] + const.PCSQ_VALUE[Piece.WK][Sq.E1])
# black king
board = Board('8/8/3k4/8/8/8/8/8 w - - 0 1')
assert board.eval() == const.PIECE_VALUE[Piece.BK] + const.PCSQ_VALUE[Piece.BK][Sq.D6]
board = Board('8/8/3k4/8/8/8/8/8 b - - 0 1')
assert board.eval() == -(const.PIECE_VALUE[Piece.BK] + const.PCSQ_VALUE[Piece.BK][Sq.D6])
| 51.924354 | 120 | 0.527603 | 10,844 | 84,429 | 3.98626 | 0.03993 | 0.021838 | 0.021653 | 0.017211 | 0.867907 | 0.847179 | 0.763921 | 0.718255 | 0.675064 | 0.624401 | 0 | 0.086016 | 0.344277 | 84,429 | 1,625 | 121 | 51.956308 | 0.694791 | 0.058226 | 0 | 0.546465 | 0 | 0 | 0.092175 | 0.044862 | 0 | 0 | 0 | 0.001846 | 0.428912 | 1 | 0.021446 | false | 0 | 0.007943 | 0 | 0.030183 | 0.003177 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
a05ea4bf22a953ea753cfab9536c7c7653642c8b | 14,176 | py | Python | pytopkapi/results_analysis/sim_result_tools.py | scottza/PyTOPKAPI | 880735b03b00c3e304faf7125bc49b00a4179b9c | [
"BSD-3-Clause"
] | 17 | 2015-05-30T10:31:26.000Z | 2021-02-24T21:52:10.000Z | pytopkapi/results_analysis/sim_result_tools.py | scottza/PyTOPKAPI | 880735b03b00c3e304faf7125bc49b00a4179b9c | [
"BSD-3-Clause"
] | 7 | 2016-02-12T05:59:15.000Z | 2022-01-22T15:04:44.000Z | pytopkapi/results_analysis/sim_result_tools.py | scottza/PyTOPKAPI | 880735b03b00c3e304faf7125bc49b00a4179b9c | [
"BSD-3-Clause"
] | 10 | 2015-03-21T14:03:35.000Z | 2022-01-03T12:18:52.000Z | __all__ = ['extract_ssi', 'extract_ssi_to_file',
'extract_eta', 'extract_eta_to_file',
'extract_Q_channel', 'extract_Q_down',
'extract_overland_volume', 'extract_overland_volume_to_file']
from datetime import timedelta
from configparser import SafeConfigParser
import h5py
import numpy as np
import numpy.ma as ma
# gzip compression flag
comp = 6
def extract_Q_down(control_fname):
"""Extract combined soil and overland out flow rates.
Read a PyTOPKAPI simulation file and return the combined overland
andsoil store outflows in a Numpy array.
Parameters
----------
control_fname : string
The file name of a PyTOPKAPI simulation control file. The name
should contain the full path relative to the current
directory.
Returns
-------
Qdown : Numpy array
A Numpy array containing the simulated outflow flow rates from
the overland and soil store of each cell.
"""
config = SafeConfigParser()
config.read(control_fname)
sim_fname = config.get('output_files', 'file_out')
tkpi_file = h5py.File(sim_fname, 'r')
Qdown = tkpi_file['/Q_down'][...]
tkpi_file.close()
return Qdown
def extract_Q_channel(control_fname):
"""Extract channel flow rates from a PyTOPKAPI simulation file.
Read a PyTOPKAPI simulation file and return the simulated channel
flows in a Numpy masked array.
Parameters
----------
control_fname : string
The file name of a PyTOPKAPI simulation control file. The name
should contain the full path relative to the current
directory.
Returns
-------
Qc : Numpy masked array
A Numpy masked array containing the simulated flow rates for
channel cells.
"""
config = SafeConfigParser()
config.read(control_fname)
param_fname = config.get('input_files', 'file_cell_param')
sim_fname = config.get('output_files', 'file_out')
params = np.loadtxt(param_fname)
tkpi_file = h5py.File(sim_fname, 'r')
Qc = tkpi_file['/Channel/Qc_out'][...]
tkpi_file.close()
channel_mask = params[:, 3]
cond = params[:, 3]*np.ones(Qc.shape, dtype=np.int) != 1
Qc = np.ma.masked_where(cond, Qc)
return Qc
def extract_overland_volume(control_fname):
"""Extract the volumes in the overland stores.
Read a PyTOPKAPI simulation file and return the combined overland
and store volumes in a Numpy array.
Parameters
----------
control_fname : string
The file name of a PyTOPKAPI simulation control file. The name
should contain the full path relative to the current directory
(or the root of the file system).
Returns
-------
Vo : Numpy array
A Numpy array containing the simulated storage volume in the
overland store of each cell.
"""
config = SafeConfigParser()
config.read(control_fname)
sim_fname = config.get('output_files', 'file_out')
tkpi_file = h5py.File(sim_fname, 'r')
Vo = tkpi_file['/Overland/V_o'][...]
tkpi_file.close()
return Vo
def extract_overland_volume_to_file(sim_fname, param_fname,
result_fname, start_dt, timestep):
"""Extract the volumes in the overland stores to a file.
Read a TOPKAPI simulation file and it's associated parameter file
and extract the overland store volumes for each timestep. Store
the results in a new HDF5 file, grouped by date and containing
datasets of latitude, longitude and storage volume.
Parameters
----------
sim_fname : string
The name of a PyTOPKAPI simulation file. This should include
the full or relative path.
param_fname : string
The name of a parameter file describing the catchment. This
should include the full or relative path.
result_fname : string
The name of an HDF5 file to store the output. This should
include the full or relative path.
start_dt : datetime.datetime
The starting date and time of the simulated results in
`sim_fname`.
timestep : int
The length of each model time-step in seconds.
Returns
-------
Nothing
"""
params = np.loadtxt(param_fname)
x = params[:, 1]
y = params[:, 2]
soil_depth = params[:, 8]
soil_depth = ma.masked_values(soil_depth, 0.0)
x = ma.array(x, mask=soil_depth.mask).compressed()
y = ma.array(y, mask=soil_depth.mask).compressed()
tkpi_file = h5py.File(sim_fname, 'r')
result_file = h5py.File(result_fname, 'w')
overland_vol = tkpi_file['/Overland/V_o'][...]
tkpi_file.close()
rows, cols = overland_vol.shape
# y
dset = result_file.require_dataset('y', shape=y.shape,
dtype=np.float32, compression=comp)
dset[...] = y
dset.attrs['name'] = 'y coordinate'
dset.attrs['units'] = 'Projection dependent (Metres or Decimal degrees)'
# x
dset = result_file.require_dataset('x', shape=x.shape,
dtype=np.float32, compression=comp)
dset[...] = x
dset.attrs['name'] = 'x coordinate'
dset.attrs['units'] = 'Projection dependent (Metres or Decimal degrees)'
curr_dt = start_dt
for k in range(rows):
print(curr_dt)
ov = ma.array(overland_vol[k], mask=soil_depth.mask).compressed()
dset = result_file.require_dataset(curr_dt.strftime('%Y%m%d%H00'),
shape=ov.shape,
dtype=np.float32, compression=comp)
dset[...] = ov
dset.attrs['name'] = 'TOPKAPI overland store volume'
dset.attrs['units'] = 'm^3'
curr_dt += timedelta(seconds=timestep)
tkpi_file.close()
result_file.close()
def extract_ssi(control_fname):
"""Extract SSI from a PyTOPKAPI simulation file.
Read a PyTOPKAPI simulation file and it's associated parameter
file and compute the Soil Saturation Index (SSI) for each model
cell and timestep. The results are returned as a Numpy array.
Parameters
----------
control_fname : string
The file name of a PyTOPKAPI simulation control file. The name
should contain the full path relative to the current
directory.
Returns
-------
ssi : Numpy ndarray
A Numpy array containing the calculated SSI values.
"""
config = SafeConfigParser()
config.read(control_fname)
global_param_fname = config.get('input_files', 'file_global_param')
param_fname = config.get('input_files', 'file_cell_param')
sim_fname = config.get('output_files', 'file_out')
fac_L = config.getfloat('calib_params', 'fac_L')
params = np.loadtxt(param_fname)
glob_params = np.genfromtxt(global_param_fname, names=True)
soil_depth = fac_L*params[:, 8]
factor = params[:, 11] - params[:, 10]
cell_area = glob_params['X']**2 # m^2
soil_depth = ma.masked_values(soil_depth, 0.0)
factor = ma.array(factor, mask=soil_depth.mask)
div = factor*soil_depth*cell_area
tkpi_file = h5py.File(sim_fname, 'r')
soil_vol = tkpi_file['/Soil/V_s'][...]
tkpi_file.close()
# ssi = (Vs/cell_vol)*100
# cell_vol = (theta_s - theta_r)*soil_depth*cell_area
sv = ma.array(soil_vol, mask=soil_depth.mask)
ssi = (sv/(div))*100.0
return ssi
def extract_ssi_to_file(sim_fname, param_fname,
result_fname, start_dt, timestep):
"""Extract percentage saturation to a file
Read a TOPKAPI simulation file and it's associated parameter file
and compute the SSI for each timestep. Store the results in a new
HDF5 file, grouped by date and containing datasets of latitude,
longitude and SSI value.
Parameters
----------
sim_fname : string
The name of a PyTOPKAPI simulation file. This should include
the full or relative path.
param_fname : string
The name of a parameter file describing the catchment. This
should include the full or relative path.
result_fname : string
The name of an HDF5 file to store the output. This should
include the full or relative path.
start_dt : datetime.datetime
The starting date and time of the simulated results in
`sim_fname`.
timestep : int
The length of each model time-step in seconds.
Returns
-------
Nothing
"""
params = np.loadtxt(param_fname)
x = params[:, 1]
y = params[:, 2]
soil_depth = params[:, 8]
factor = params[:, 11] - params[:, 10]
cell_area = 1000.0**2 # m^2
soil_depth = ma.masked_values(soil_depth, 0.0)
factor = ma.array(factor, mask=soil_depth.mask)
x = ma.array(x, mask=soil_depth.mask).compressed()
y = ma.array(y, mask=soil_depth.mask).compressed()
div = factor*soil_depth*cell_area
tkpi_file = h5py.File(sim_fname, 'r')
result_file = h5py.File(result_fname, 'w')
soil_vol = tkpi_file['/Soil/V_s'][...]
tkpi_file.close()
rows, cols = soil_vol.shape
# y
dset = result_file.require_dataset('y', shape=y.shape,
dtype=np.float32, compression=comp)
dset[...] = y
dset.attrs['name'] = 'y coordinate'
dset.attrs['units'] = 'Projection dependent (Metres or Decimal degrees)'
# x
dset = result_file.require_dataset('x', shape=x.shape,
dtype=np.float32, compression=comp)
dset[...] = x
dset.attrs['name'] = 'x coordinate'
dset.attrs['units'] = 'Projection dependent (Metres or Decimal degrees)'
curr_dt = start_dt
for k in range(rows):
print(curr_dt)
# ssi = (Vs/cell_vol)*100
# cell_vol = (theta_s - theta_r)*soil_depth*cell_area
sv = ma.array(soil_vol[k], mask=soil_depth.mask)
ssi = (sv/(div))*100.0
ssi = ssi.compressed()
# ssi
dset = result_file.require_dataset(curr_dt.strftime('%Y%m%d%H00'),
shape=ssi.shape,
dtype=np.float32, compression=comp)
dset[...] = ssi
dset.attrs['name'] = 'TOPKAPI soil saturation index'
dset.attrs['units'] = '% saturation'
curr_dt += timedelta(seconds=timestep)
tkpi_file.close()
result_file.close()
def extract_eta(control_fname):
"""Extract ETa from a PyTOPKAPI simulation file.
Read a PyTOPKAPI simulation file and it's associated parameter file
and extract the actual evapotranspiration for each model cell and
timestep. The results are returned as a Numpy array.
Parameters
----------
control_fname : string
The file name of a PyTOPKAPI simulation control file. The name
should contain the full path relative to the current
directory.
Returns
-------
eta : Numpy ndarray
A Numpy array containing the calculated ETa values.
"""
config = SafeConfigParser()
config.read(control_fname)
param_fname = config.get('input_files', 'file_cell_param')
sim_fname = config.get('output_files', 'file_out')
params = np.loadtxt(param_fname)
soil_depth = params[:, 8]
soil_depth = ma.masked_values(soil_depth, 0.0)
tkpi_file = h5py.File(sim_fname, 'r')
eta = tkpi_file['/ET_out'][...]
tkpi_file.close()
eta = ma.array(eta, mask=soil_depth.mask)
return eta
def extract_eta_to_file(sim_fname, param_fname,
result_fname, start_dt, timestep):
"""Extract actual evapotranspiration to a file
Read a PyTOPKAPI simulation file and it's associated parameter
file and extract the actual evapotranspiration for each
timestep. Store the results in a new HDF5 file, grouped by date
and containing datasets of latitude, longitude and ETa value.
Parameters
----------
sim_fname : string
The name of a PyTOPKAPI simulation file. This should include
the full or relative path.
param_fname : string
The name of a parameter file describing the catchment. This
should include the full or relative path.
result_fname : string
The name of an HDF5 file to store the output. This should
include the full or relative path.
start_dt : datetime.datetime
The starting date and time of the simulated results in
`sim_fname`.
timestep : int
The length of each model time-step in seconds.
Returns
-------
Nothing
"""
params = np.loadtxt(param_fname)
x = params[:, 1]
y = params[:, 2]
soil_depth = params[:, 8]
soil_depth = ma.masked_values(soil_depth, 0.0)
x = ma.array(x, mask=soil_depth.mask).compressed()
y = ma.array(y, mask=soil_depth.mask).compressed()
tkpi_file = h5py.File(sim_fname, 'r')
result_file = h5py.File(result_fname, 'w')
eta = tkpi_file['/ET_out'][...]
tkpi_file.close()
rows, cols = eta.shape
# y
dset = result_file.require_dataset('y', shape=y.shape,
dtype=np.float32, compression=comp)
dset[...] = y
dset.attrs['name'] = 'y coordinate'
dset.attrs['units'] = 'Projection dependent (Metres or Decimal degrees)'
# x
dset = result_file.require_dataset('x', shape=x.shape,
dtype=np.float32, compression=comp)
dset[...] = x
dset.attrs['name'] = 'x coordinate'
dset.attrs['units'] = 'Projection dependent (Metres or Decimal degrees)'
curr_dt = start_dt
for k in range(rows):
print(curr_dt)
et = ma.array(eta[k], mask=soil_depth.mask)
et = et.compressed()
# ETa
dset = result_file.require_dataset(curr_dt.strftime('%Y%m%d%H00'),
shape=et.shape,
dtype=np.float32, compression=comp)
dset[...] = et
dset.attrs['name'] = 'PyTOPKAPI actual ET'
dset.attrs['units'] = 'mm'
curr_dt += timedelta(seconds=timestep)
result_file.close()
| 30.486022 | 78 | 0.632195 | 1,879 | 14,176 | 4.624268 | 0.103779 | 0.033145 | 0.03913 | 0.025434 | 0.830475 | 0.812291 | 0.809759 | 0.773161 | 0.737829 | 0.723443 | 0 | 0.00951 | 0.26566 | 14,176 | 464 | 79 | 30.551724 | 0.825168 | 0.374154 | 0 | 0.694737 | 0 | 0 | 0.125228 | 0.006559 | 0 | 0 | 0 | 0 | 0 | 1 | 0.042105 | false | 0 | 0.026316 | 0 | 0.094737 | 0.015789 | 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 |
a05ffb3ec7022a1cb9e2a0cfdd94109aedc8e56f | 254 | py | Python | test.py | gtema/homeautomation-backend | 9453a3ad598d87b1b1a49fcb8238a6781c84e793 | [
"Apache-2.0"
] | 2 | 2017-04-14T15:19:09.000Z | 2020-09-17T21:27:06.000Z | test.py | gtema/homeautomation-backend | 9453a3ad598d87b1b1a49fcb8238a6781c84e793 | [
"Apache-2.0"
] | null | null | null | test.py | gtema/homeautomation-backend | 9453a3ad598d87b1b1a49fcb8238a6781c84e793 | [
"Apache-2.0"
] | null | null | null | import unittest
"""General entry point for the tests
"""
if __name__ == '__main__':
from tests.test_api_base import *
from tests.test_basic import *
from tests.test_stock_api import *
from tests.test_models import *
unittest.main()
| 21.166667 | 38 | 0.708661 | 35 | 254 | 4.742857 | 0.514286 | 0.216867 | 0.313253 | 0.343373 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204724 | 254 | 11 | 39 | 23.090909 | 0.821782 | 0 | 0 | 0 | 0 | 0 | 0.037383 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.714286 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 6 |
a0915408f11535cefb48b6cd42035d0a71fb00a5 | 23 | py | Python | src/corrcal/__init__.py | UKZN-Astronomy/corrcal | aa9b98bf8788fde5b92712eab5eccb4f7774bb60 | [
"BSD-2-Clause"
] | null | null | null | src/corrcal/__init__.py | UKZN-Astronomy/corrcal | aa9b98bf8788fde5b92712eab5eccb4f7774bb60 | [
"BSD-2-Clause"
] | 31 | 2019-10-07T13:29:32.000Z | 2020-02-17T08:58:26.000Z | src/corrcal/__init__.py | UKZN-Astronomy/corrcal2 | aa9b98bf8788fde5b92712eab5eccb4f7774bb60 | [
"BSD-2-Clause"
] | null | null | null | from .corrcal import *
| 11.5 | 22 | 0.73913 | 3 | 23 | 5.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 23 | 1 | 23 | 23 | 0.894737 | 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 |
a0c3eae210fe2a5fe242bafe042e5e2906386df6 | 96 | py | Python | venv/lib/python3.8/site-packages/future/backports/email/mime/text.py | GiulianaPola/select_repeats | 17a0d053d4f874e42cf654dd142168c2ec8fbd11 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/future/backports/email/mime/text.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/future/backports/email/mime/text.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/cd/5f/7c/063a11e12fe75fc738ef1e372e7b2789f7868487cd1b0480879ef96ecd | 96 | 96 | 0.895833 | 9 | 96 | 9.555556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.416667 | 0 | 96 | 1 | 96 | 96 | 0.479167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
2631e0b700cb38e2cd6cd7e739c8df073ff9d3d5 | 146 | py | Python | modules/__init__.py | crivera31/Criptoteam | 91c3c99985883a375036c56c3693b77dc7bbe896 | [
"MIT"
] | null | null | null | modules/__init__.py | crivera31/Criptoteam | 91c3c99985883a375036c56c3693b77dc7bbe896 | [
"MIT"
] | null | null | null | modules/__init__.py | crivera31/Criptoteam | 91c3c99985883a375036c56c3693b77dc7bbe896 | [
"MIT"
] | null | null | null | """
The flask application package.
"""
# agregar numeros
from flask import Flask
#import admi_dash.app_admin as wapp
#app = wapp.server | 16.222222 | 36 | 0.705479 | 20 | 146 | 5.05 | 0.75 | 0.217822 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.205479 | 146 | 9 | 37 | 16.222222 | 0.87069 | 0.678082 | 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 |
265eb158ea1846484229d854283e55d347b23d64 | 1,025 | py | Python | tests/save_noise.py | scicubator/countGauss | 7e744c3de1de342d72ef10da76c0c3b4605d70d4 | [
"BSD-2-Clause"
] | null | null | null | tests/save_noise.py | scicubator/countGauss | 7e744c3de1de342d72ef10da76c0c3b4605d70d4 | [
"BSD-2-Clause"
] | null | null | null | tests/save_noise.py | scicubator/countGauss | 7e744c3de1de342d72ef10da76c0c3b4605d70d4 | [
"BSD-2-Clause"
] | null | null | null | import pickle
import pylab as plt
D = pickle.load(open("tests/noise.pkl", "r"))
fig, ax = plt.subplots()
fig.canvas.draw()
plt.imshow(D['gauss'], cmap='gray_r', origin='lower')
# labels=[-5,0.01, 0.03, 0.08, 0.22,0.6,1]
labels = []
ax.set_xticklabels(labels)
ax.get_yticklabels()
ylabels = [-1, "", 40, ]
ax.set_yticklabels(ylabels)
ax.set_yticklabels(ylabels, fontsize=25)
ax.set_xticklabels(labels, fontsize=25)
plt.ylabel("features", fontsize=22)
plt.savefig("tests/noise_gauss.pdf", transparent=True, bbox_inches='tight',
pad_inches=0)
fig, ax = plt.subplots()
fig.canvas.draw()
plt.imshow(D['countGauss'], cmap='gray_r', origin='lower')
labels = [-5, 0.01, 0.03, 0.08, 0.22, 0.6, 1]
ax.set_xticklabels(labels)
ax.get_yticklabels()
ylabels = [-1, "", 40, ]
ax.set_yticklabels(ylabels)
ax.set_yticklabels(ylabels, fontsize=25)
ax.set_xticklabels(labels, fontsize=25)
plt.ylabel("sorted", fontsize=22)
plt.savefig("tests/noise_countgauss.pdf", transparent=True, bbox_inches='tight',
pad_inches=0)
| 31.060606 | 80 | 0.705366 | 163 | 1,025 | 4.325153 | 0.319018 | 0.056738 | 0.09078 | 0.124823 | 0.848227 | 0.848227 | 0.763121 | 0.763121 | 0.763121 | 0.641135 | 0 | 0.056645 | 0.10439 | 1,025 | 32 | 81 | 32.03125 | 0.711329 | 0.039024 | 0 | 0.62069 | 0 | 0 | 0.126144 | 0.047813 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.068966 | 0 | 0.068966 | 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 |
cd40e1e41e019a1e6b4fb307a1409504fd80fe08 | 47 | py | Python | neslter/analysis/suna/__init__.py | WHOIGit/nes-lter-ims | d4cc96c10da56ca33286af84d669625b67170522 | [
"MIT"
] | 3 | 2019-01-24T16:32:50.000Z | 2021-11-05T02:18:12.000Z | neslter/analysis/suna/__init__.py | WHOIGit/nes-lter-ims | d4cc96c10da56ca33286af84d669625b67170522 | [
"MIT"
] | 45 | 2019-05-23T15:15:32.000Z | 2022-03-15T14:09:20.000Z | neslter/analysis/suna/__init__.py | WHOIGit/nes-lter-ims | d4cc96c10da56ca33286af84d669625b67170522 | [
"MIT"
] | null | null | null | from .ts_correction import ts_corrected_nitrate | 47 | 47 | 0.914894 | 7 | 47 | 5.714286 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06383 | 47 | 1 | 47 | 47 | 0.909091 | 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 |
cd8606c36907261e19b831952497b3723bb70e2d | 10,233 | py | Python | python/matrix_io/test/test_matrix_io.py | msteijaert/smurff | e6066d51e1640e9aad0118628ba72c9d662919fb | [
"MIT"
] | null | null | null | python/matrix_io/test/test_matrix_io.py | msteijaert/smurff | e6066d51e1640e9aad0118628ba72c9d662919fb | [
"MIT"
] | null | null | null | python/matrix_io/test/test_matrix_io.py | msteijaert/smurff | e6066d51e1640e9aad0118628ba72c9d662919fb | [
"MIT"
] | null | null | null | import os
import shutil
import unittest
import matrix_io
import numpy
import scipy
import scipy.io
class TestMatrixIO(unittest.TestCase):
TEMP_DIR_NAME = 'tmp'
@classmethod
def setUpClass(cls):
shutil.rmtree(cls.TEMP_DIR_NAME, ignore_errors=True)
os.makedirs(cls.TEMP_DIR_NAME)
@classmethod
def tearDownClass(cls):
shutil.rmtree(cls.TEMP_DIR_NAME, ignore_errors=True)
def test_dense_float64(self):
matrix_filename = "test_dense_float64.ddm"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = numpy.random.randn(10, 20)
matrix_io.write_dense_float64(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_dense_float64(matrix_relative_path)
self.assertTrue(numpy.array_equal(actual_matrix, expected_matrix))
def test_sparse_float64(self):
matrix_filename = "test_sparse_float64.sdm"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = scipy.sparse.rand(10, 20, 0.5)
matrix_io.write_sparse_float64(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_sparse_float64(matrix_relative_path)
self.assertTrue((expected_matrix != actual_matrix).nnz == 0)
def test_sparse_binary_matrix(self):
matrix_filename = "test_sparse_binary_matrix.sbm"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_dense_matrix = numpy.random.randint(0, 2, size=(10, 20))
expected_sparse_matrix = scipy.sparse.coo_matrix(expected_dense_matrix)
matrix_io.write_sparse_binary_matrix(matrix_relative_path, expected_sparse_matrix)
actual_matrix = matrix_io.read_sparse_binary_matrix(matrix_relative_path)
self.assertTrue((expected_sparse_matrix != actual_matrix).nnz == 0)
def test_dense_float64_matrix_as_tensor(self):
matrix_filename = "test_dense_float64_matrix_as_tensor.ddt"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = numpy.random.randn(10, 20)
matrix_io.write_dense_float64_matrix_as_tensor(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_dense_float64_tensor_as_matrix(matrix_relative_path)
self.assertTrue(numpy.array_equal(actual_matrix, expected_matrix))
def test_sparse_float64_matrix_as_tensor(self):
matrix_filename = "test_sparse_float64_matrix_as_tensor.sdt"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = scipy.sparse.rand(10, 20, 0.5)
matrix_io.write_sparse_float64_matrix_as_tensor(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_sparse_float64_tensor_as_matrix(matrix_relative_path)
self.assertTrue((expected_matrix != actual_matrix).nnz == 0)
def test_csv(self):
matrix_filename = "test_csv.csv"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = numpy.random.randn(10, 20)
matrix_io.write_csv(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_csv(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix, expected_matrix))
def test_dense_mtx(self):
matrix_filename = "test_dense_mtx.mtx"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = numpy.random.randn(10, 20)
matrix_io.my_mmwrite(matrix_relative_path, expected_matrix)
actual_matrix = scipy.io.mmread(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix, expected_matrix))
def test_sparse_mtx(self):
matrix_filename = "test_sparse_mtx.mtx"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = scipy.sparse.rand(10, 20, 0.5)
matrix_io.my_mmwrite(matrix_relative_path, expected_matrix)
actual_matrix = scipy.io.mmread(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix.todense(), expected_matrix.todense()))
def test_matrix_ddm(self):
matrix_filename = "test_matrix_ddt.ddm"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = numpy.random.randn(10, 20)
matrix_io.write_matrix(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.array_equal(actual_matrix, expected_matrix))
def test_matrix_sdm(self):
matrix_filename = "test_matrix_sdm.sdm"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = scipy.sparse.rand(10, 20, 0.5)
matrix_io.write_matrix(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue((expected_matrix != actual_matrix).nnz == 0)
def test_matrix_sbm(self):
matrix_filename = "test_matrix_sbm.sbm"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_dense_matrix = numpy.random.randint(0, 2, size=(10, 20))
expected_sparse_matrix = scipy.sparse.coo_matrix(expected_dense_matrix)
matrix_io.write_matrix(matrix_relative_path, expected_sparse_matrix)
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue((expected_sparse_matrix != actual_matrix).nnz == 0)
def test_dense_matrix_mtx(self):
matrix_filename = "test_dense_matrix_mtx.mtx"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = numpy.random.randn(10, 20)
matrix_io.write_matrix(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix, expected_matrix))
def test_matrix_sparse_mtx(self):
matrix_filename = "test_matrix_sparse_mtx.mtx"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = scipy.sparse.rand(10, 20, 0.5)
matrix_io.write_matrix(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix.todense(), expected_matrix.todense()))
def test_dense_matrix_csv(self):
matrix_filename = "test_dense_matrix_csv.csv"
matrix_relative_path = "{}/{}".format(self.TEMP_DIR_NAME, matrix_filename)
expected_matrix = numpy.random.randn(10, 20)
matrix_io.write_matrix(matrix_relative_path, expected_matrix)
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix, expected_matrix))
def test_read_cpp_generated_dense_matrix_ddm(self):
matrix_relative_path = "test_data/cpp_generated_dense_matrix.ddm"
expected_matrix = numpy.array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]])
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix, expected_matrix))
def test_read_cpp_generated_dense_matrix_mtx(self):
matrix_relative_path = "test_data/cpp_generated_dense_matrix.mtx"
expected_matrix = numpy.array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]])
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix, expected_matrix))
def test_read_cpp_generated_dense_matrix_csv(self):
matrix_relative_path = "test_data/cpp_generated_dense_matrix.csv"
expected_matrix = numpy.array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]])
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix, expected_matrix))
def test_read_cpp_generated_sparse_matrix_sdm(self):
matrix_relative_path = "test_data/cpp_generated_sparse_matrix.sdm"
expected_matrix_rows = numpy.array([0, 0, 0, 0, 2, 2, 2, 2])
expected_matrix_cols = numpy.array([0, 1, 2, 3, 0, 1, 2, 3])
expected_matrix_vals = numpy.array([1, 2, 3, 4, 9, 10, 11, 12])
expected_matrix = scipy.sparse.coo_matrix((expected_matrix_vals, (expected_matrix_rows, expected_matrix_cols)), shape=(3, 4))
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix.todense(), expected_matrix.todense()))
def test_read_cpp_generated_sparse_matrix_sbm(self):
matrix_relative_path = "test_data/cpp_generated_sparse_matrix.sbm"
expected_matrix_rows = numpy.array([0, 0, 0, 0, 2, 2, 2, 2])
expected_matrix_cols = numpy.array([0, 1, 2, 3, 0, 1, 2, 3])
expected_matrix_vals = numpy.array([1, 1, 1, 1, 1, 1, 1, 1])
expected_matrix = scipy.sparse.coo_matrix((expected_matrix_vals, (expected_matrix_rows, expected_matrix_cols)), shape=(3, 4))
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix.todense(), expected_matrix.todense()))
def test_read_cpp_generated_sparse_matrix_mtx(self):
matrix_relative_path = "test_data/cpp_generated_sparse_matrix.mtx"
expected_matrix_rows = numpy.array([0, 0, 0, 0, 2, 2, 2, 2])
expected_matrix_cols = numpy.array([0, 1, 2, 3, 0, 1, 2, 3])
expected_matrix_vals = numpy.array([1, 2, 3, 4, 9, 10, 11, 12])
expected_matrix = scipy.sparse.coo_matrix((expected_matrix_vals, (expected_matrix_rows, expected_matrix_cols)), shape=(3, 4))
actual_matrix = matrix_io.read_matrix(matrix_relative_path)
self.assertTrue(numpy.allclose(actual_matrix.todense(), expected_matrix.todense()))
if __name__ == '__main__':
unittest.main()
| 54.142857 | 133 | 0.709274 | 1,347 | 10,233 | 4.974759 | 0.063846 | 0.13789 | 0.145053 | 0.078794 | 0.952843 | 0.922997 | 0.878973 | 0.872556 | 0.860767 | 0.858379 | 0 | 0.028444 | 0.189192 | 10,233 | 188 | 134 | 54.430851 | 0.779197 | 0 | 0 | 0.582822 | 0 | 0 | 0.064399 | 0.046125 | 0 | 0 | 0 | 0 | 0.122699 | 1 | 0.134969 | false | 0 | 0.042945 | 0 | 0.190184 | 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 |
26a68ea9d0b6a92cfdd09ed01a483ef0e68817ba | 54 | py | Python | main.py | RaffeSagioro/AC3 | 225f501957d31baa00665e55a2919e7f2e1d1d0f | [
"Apache-2.0"
] | null | null | null | main.py | RaffeSagioro/AC3 | 225f501957d31baa00665e55a2919e7f2e1d1d0f | [
"Apache-2.0"
] | null | null | null | main.py | RaffeSagioro/AC3 | 225f501957d31baa00665e55a2919e7f2e1d1d0f | [
"Apache-2.0"
] | null | null | null | def Soma_numeros(num1, num2):
return (num1 + num2) | 27 | 29 | 0.685185 | 8 | 54 | 4.5 | 0.75 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0.185185 | 54 | 2 | 30 | 27 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 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 | 0 | 1 | 1 | 0 | 0 | 6 |
26d39706d6418843e1540a0e0701f325d4fe8530 | 42 | py | Python | api_v3/views/__init__.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | api_v3/views/__init__.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | api_v3/views/__init__.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | from .current_user import CurrentUserView
| 21 | 41 | 0.880952 | 5 | 42 | 7.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 42 | 1 | 42 | 42 | 0.947368 | 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 |
f841d32737d8d95009d6b6dac926ea1f5922ef68 | 11,660 | py | Python | pedsnetdcc/permissions.py | PEDSnet/pedsnetdcc | 76a32a09416956c9a0831ec05c14d490309d7b41 | [
"BSD-2-Clause"
] | null | null | null | pedsnetdcc/permissions.py | PEDSnet/pedsnetdcc | 76a32a09416956c9a0831ec05c14d490309d7b41 | [
"BSD-2-Clause"
] | 112 | 2016-06-14T21:03:38.000Z | 2021-02-16T16:08:12.000Z | pedsnetdcc/permissions.py | PEDSnet/pedsnetdcc | 76a32a09416956c9a0831ec05c14d490309d7b41 | [
"BSD-2-Clause"
] | null | null | null | import logging
import time
import re
from pedsnetdcc.db import Statement, StatementList
from pedsnetdcc.dict_logging import secs_since
from pedsnetdcc import SITES_AND_DCC, SITES_EXTERNAL_ADD_DCC
from pedsnetdcc.utils import check_stmt_err, combine_dicts, get_conn_info_dict
logger = logging.getLogger(__name__)
PREP_DB_SQL_TEMPLATE = """
grant all on schema {{.Site}}_pcornet to loading_user with grant option;
"""
# SQL template for creating site schemas in an internal database instance.
PERMISSIONS_SQL_TEMPLATE = """
grant usage on schema {{.Site}}_pedsnet to pcor_et_user, peds_staff, dcc_analytics;
grant select on all tables in schema {{.Site}}_pedsnet to pcor_et_user, peds_staff, dcc_analytics;
grant all on schema {{.Site}}_pedsnet to loading_user;
grant all on schema {{.Site}}_pcornet to pcor_et_user;
grant usage on schema {{.Site}}_pcornet to peds_staff;
grant select on all tables in schema {{.Site}}_pcornet to peds_staff;
alter default privileges for role loading_user in schema {{.Site}}_pedsnet grant select on tables to pcor_et_user, peds_staff, dcc_analytics;
alter default privileges for role loading_user in schema {{.Site}}_pcornet grant select on tables to peds_staff;
"""
# SQL template for creating site schemas in an internal database instance.
PERMISSIONS_SQL_TEMPLATE_LIMITED = """
grant all on schema {{.Site}}_pedsnet to loading_user;
"""
ID_MAPS_SQL_TEMPLATE = """
grant all on schema {{.Site}}_id_maps to loading_user;
alter default privileges for role loading_user in schema {{.Site}}_id_maps grant select on tables to peds_staff;
"""
ID_MAPS_SQL_TEMPLATE_LIMITED = """
grant all on schema {{.Site}}_id_maps to loading_user;
"""
VOCABULARY_PERMISSIONS_SQL_TEMPL = """
grant all on schema dcc_ids to loading_user;
grant all on schema vocabulary to loading_user;
grant usage on schema vocabulary to pcor_et_user, peds_staff, dcc_analytics;
grant select on all tables in schema vocabulary to pcor_et_user, peds_staff, dcc_analytics;
alter default privileges for role loading_user in schema vocabulary grant select on tables to pcor_et_user, peds_staff, dcc_analytics;
"""
VOCABULARY_PERM_SQL_TEMPL_LIMITED = """
grant all on schema dcc_ids to loading_user;
grant all on schema vocabulary to loading_user;
"""
def _loading_user_privileges_sql(site):
"""Return a list of statements to set the correct permissions loading_user during prepdb.
:param site: site name, e.g. 'dcc' or 'stlouis'
:type: str
:return: SQL statements
:rtype: list(str)
:raises: ValueError
"""
tmpl = PREP_DB_SQL_TEMPLATE
sql = tmpl.replace('{{.Site}}', site)
return [_despace(x) for x in sql.split("\n") if x]
def _database_privileges_sql(database_name):
"""Return a tuple of statements granting privileges on the database.
:param database_name: Database name
:type: str
:return: a tuple of statements
:rtype: tuple(str)
"""
tmpl = 'grant create on database {db} to {usr}'
return (tmpl.format(db=database_name, usr='peds_staff'),
tmpl.format(db=database_name, usr='loading_user'))
def _database_privileges_sql_limited(database_name):
"""Return a tuple of statements granting privileges on the database.
:param database_name: Database name
:type: str
:return: a tuple of statements
:rtype: tuple(str)
"""
tmpl = 'grant create on database {db} to {usr}'
return (tmpl.format(db=database_name, usr='loading_user')),
def _despace(statement):
"""Return string with runs of spaces replaced with a single space"""
return re.sub(r' +', ' ', statement)
def _permissions_sql(site):
"""Return a list of statements to set the correct permissions for a given site.
:param site: site name, e.g. 'dcc' or 'stlouis'
:type: str
:return: SQL statements
:rtype: list(str)
:raises: ValueError
"""
tmpl = PERMISSIONS_SQL_TEMPLATE
sql = tmpl.replace('{{.Site}}', site)
statements = [_despace(x) for x in sql.split("\n") if x]
if site != 'dcc':
id_maps_tmpl = ID_MAPS_SQL_TEMPLATE
id_maps_sql = id_maps_tmpl.replace('{{.Site}}', site)
statements = statements + [_despace(x) for x in id_maps_sql.split("\n") if x]
return statements
def _permissions_sql_limited(site):
"""Return a list of statements to set the correct permissions for a given site.
:param site: site name, e.g. 'dcc' or 'stlouis'
:type: str
:return: SQL statements
:rtype: list(str)
:raises: ValueError
"""
tmpl = PERMISSIONS_SQL_TEMPLATE_LIMITED
sql = tmpl.replace('{{.Site}}', site)
statements = [_despace(x) for x in sql.split("\n") if x]
if site != 'dcc':
id_maps_tmpl = ID_MAPS_SQL_TEMPLATE_LIMITED
id_maps_sql = id_maps_tmpl.replace('{{.Site}}', site)
statements = statements + [_despace(x) for x in id_maps_sql.split("\n") if x]
return statements
def _vocabulary_permissions_sql():
sql = VOCABULARY_PERMISSIONS_SQL_TEMPL
return [_despace(x) for x in sql.split("\n") if x]
def _vocabulary_permissions_sql_limited():
sql = VOCABULARY_PERM_SQL_TEMPL_LIMITED
return [_despace(x) for x in sql.split("\n") if x]
def grant_loading_user_permissions(conn_str, inc_external = False):
"""Grant loading_user grant permissions for pcornet
:param conn_str: connection string to database
:type: str
"""
log_dict = get_conn_info_dict(conn_str)
logger.info(combine_dicts({'msg': 'starting granting of loading_user permissions'},
log_dict))
start_time = time.time()
stmnts = StatementList()
if inc_external:
site_list = SITES_EXTERNAL_ADD_DCC
else:
site_list = SITES_AND_DCC
for site in site_list:
stmnts.extend(
[Statement(x) for x in _loading_user_privileges_sql(site)]
)
stmnts.serial_execute(conn_str)
for stmnt in stmnts:
check_stmt_err(stmnt, 'granting loading permissions')
# Log end of function.
logger.info(combine_dicts({'msg': 'finished granting of loading permissions',
'elapsed': secs_since(start_time)}, log_dict))
def grant_database_permissions(conn_str, database_name):
"""Grant create permissions on a database for the appropriate PEDSnet users
:param conn_str: connection string to database
:type: str
:param database_name: name of newly created database to grant permissions on
:type: str
"""
log_dict = get_conn_info_dict(conn_str)
logger.info(combine_dicts({'msg': 'starting granting of database permissions'},
log_dict))
start_time = time.time()
stmnts = StatementList()
stmnts.extend(
[Statement(x) for x in _database_privileges_sql(database_name)])
stmnts.serial_execute(conn_str)
for stmnt in stmnts:
check_stmt_err(stmnt, 'granting database permissions')
# Log end of function.
logger.info(combine_dicts({'msg': 'finished granting of database permissions',
'elapsed': secs_since(start_time)}, log_dict))
def grant_database_permissions_limited(conn_str, database_name):
"""Grant create permissions on a database for the appropriate PEDSnet users
:param conn_str: connection string to database
:type: str
:param database_name: name of newly created database to grant permissions on
:type: str
"""
log_dict = get_conn_info_dict(conn_str)
logger.info(combine_dicts({'msg': 'starting granting of database permissions'},
log_dict))
start_time = time.time()
stmnts = StatementList()
stmnts.extend(
[Statement(x) for x in _database_privileges_sql_limited(database_name)])
stmnts.serial_execute(conn_str)
for stmnt in stmnts:
check_stmt_err(stmnt, 'granting database permissions')
# Log end of function.
logger.info(combine_dicts({'msg': 'finished granting of database permissions',
'elapsed': secs_since(start_time)}, log_dict))
def grant_schema_permissions(conn_str, inc_external=False):
"""Grant schema and table permissions on a database for the appropriate PEDSnet users
:param conn_str: connection string to database
:type: str
"""
log_dict = get_conn_info_dict(conn_str)
logger.info(combine_dicts({'msg': 'starting granting of schema permissions'},
log_dict))
start_time = time.time()
stmnts = StatementList()
if inc_external:
site_list = SITES_EXTERNAL_ADD_DCC
else:
site_list = SITES_AND_DCC
for site in site_list:
stmnts.extend([Statement(x) for x in _permissions_sql(site)])
stmnts.serial_execute(conn_str)
for stmnt in stmnts:
check_stmt_err(stmnt, 'granting schema permissions')
# Log end of function.
logger.info(combine_dicts({'msg': 'finished granting of schema permissions',
'elapsed': secs_since(start_time)}, log_dict))
def grant_schema_permissions_limited(conn_str, inc_external=False):
"""Grant schema and table permissions on a database for the appropriate PEDSnet users
:param conn_str: connection string to database
:type: str
"""
log_dict = get_conn_info_dict(conn_str)
logger.info(combine_dicts({'msg': 'starting granting of schema permissions'},
log_dict))
start_time = time.time()
stmnts = StatementList()
if inc_external:
site_list = SITES_EXTERNAL_ADD_DCC
else:
site_list = SITES_AND_DCC
for site in site_list:
stmnts.extend([Statement(x) for x in _permissions_sql_limited(site)])
stmnts.serial_execute(conn_str)
for stmnt in stmnts:
check_stmt_err(stmnt, 'granting schema permissions')
# Log end of function.
logger.info(combine_dicts({'msg': 'finished granting of schema permissions',
'elapsed': secs_since(start_time)}, log_dict))
def grant_vocabulary_permissions(conn_str):
"""FILL IN
"""
log_dict = get_conn_info_dict(conn_str)
logger.info(combine_dicts({'msg': 'starting granting of vocabulary permissions'},
log_dict))
start_time = time.time()
stmnts = StatementList()
stmnts.extend([Statement(x) for x in _vocabulary_permissions_sql()])
stmnts.serial_execute(conn_str)
for stmnt in stmnts:
check_stmt_err(stmnt, 'granting vocabulary permissions')
# Log end of function.
logger.info(combine_dicts({'msg': 'finished granting of vocabulary permissions',
'elapsed': secs_since(start_time)}, log_dict))
def grant_vocabulary_permissions_limited(conn_str):
"""FILL IN
"""
log_dict = get_conn_info_dict(conn_str)
logger.info(combine_dicts({'msg': 'starting granting of vocabulary permissions'},
log_dict))
start_time = time.time()
stmnts = StatementList()
stmnts.extend([Statement(x) for x in _vocabulary_permissions_sql_limited()])
stmnts.serial_execute(conn_str)
for stmnt in stmnts:
check_stmt_err(stmnt, 'granting vocabulary permissions')
# Log end of function.
logger.info(combine_dicts({'msg': 'finished granting of vocabulary permissions',
'elapsed': secs_since(start_time)}, log_dict))
| 32.299169 | 141 | 0.679074 | 1,539 | 11,660 | 4.896036 | 0.089019 | 0.024154 | 0.00929 | 0.013006 | 0.902721 | 0.879628 | 0.868879 | 0.840743 | 0.832913 | 0.81566 | 0 | 0 | 0.230189 | 11,660 | 360 | 142 | 32.388889 | 0.839461 | 0.184134 | 0 | 0.648352 | 0 | 0.005495 | 0.30118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.082418 | false | 0 | 0.038462 | 0 | 0.164835 | 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 |
f874ecc858ceda841fccd1aad71c2e75c322f6d9 | 5,522 | py | Python | output/models/nist_data/list_pkg/nmtokens/schema_instance/nistschema_sv_iv_list_nmtokens_enumeration_4_xsd/nistschema_sv_iv_list_nmtokens_enumeration_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/nmtokens/schema_instance/nistschema_sv_iv_list_nmtokens_enumeration_4_xsd/nistschema_sv_iv_list_nmtokens_enumeration_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/nmtokens/schema_instance/nistschema_sv_iv_list_nmtokens_enumeration_4_xsd/nistschema_sv_iv_list_nmtokens_enumeration_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-list-NMTOKENS-enumeration-4-NS"
class NistschemaSvIvListNmtokensEnumeration4Type(Enum):
PARTNERS_ABLE_CAPABILITIES_TO_OF_MECHANISM_EACH_DOM_TECHNOL_IS_THE_REVIEW_MADE_COMPUTING_FOR_PROCESSES_PR_ADDI_BOTH_TECHNIQUES_HIGH_TO_SOFTWARE_INTUITIVE_RE = (
"partners_able_capabilities.to:of:mechanism:each_DOM:",
"technol",
"is_The",
"review:made:computing.for.processes",
"pr",
"addi",
"both-techniques:high_",
"to-software-intuitive_re",
)
ENVIR_FOR_THE_AS_INFORMATION_SUCH_AS_HEALTH_SET_THIS_DIAGNOSTIC_SPECIFICATION_OF_USE_VISIBLY_A_SAME_USE_DOMAINS_DEPENDABILI_LESS_FORUM_ENSURE_TH = (
"envir",
"for-the",
"as:information:Such.as",
"health.set_This:diagnostic.specification",
"of:use-visibly_A:same.use_domains:dependabili",
"less:forum-ensure:th",
)
ALTHOUGH_HAS_ENFORCEMENT_TECHNOLOGY_WEB_THE_EN_THE_ENSURE_AS_DISTRIBUTED_CREATION_RECOMMENDAT_CONSORTI_COMPUTING_WORKING_DISCOVER_STANDARDS_DRAFT_THE_XML_A_BUILD_DEPENDABILITY_RECOMMENDATI_OF_TO_COST_AS_COMPLETE_REVISIONS_FOR_BY_INTO_BLOCKS_BE_XML_APPLICATIONS_LOGIC_THEM_AND_CON = (
"Although:has-",
"enforcement:-technology-web.the-en",
"the_",
"ensure_as:distributed.creation_recommendat",
"consorti",
"computing-working_discover_standards:draft:The_XML_a-",
"build-dependability:Recommendati",
"of.to-cost_as.complete-revisions:for:by:into.blocks_be",
"XML-applications.logic-them:and_con",
)
THE_THE_THE_THE_SCHEMAS_TO_REPOSITOR_OF_AND_ABLE_XML_RELATED_APPROPRIATE_AND_XML_RELATED_BOT_NEWCOMERS_A_STRUCTURED_TO_BY_WITH_FORMED_XML_CREAT_THE_INTERCONNECTING_IMPLEMENTATIONS_BEEN_DATA_OF_FILES_DEVICES_WIT = (
"the.the:the_the_Schemas_to:repositor",
"of",
"and_",
"able:XML-related-appropriate-and.XML-related.bot",
"newcomers:a-Structured",
"to-by:with.formed.XML-creat",
"the_interconnecting-implementations:been:data_of_files",
"devices_wit",
)
RECOMMENDATION_CHAIR_DEVELOPED_THESE_FROM_WORKI_AND_IS_AND_JINI_THEIR_AND_TO_TO_DOM_TESTING_OF_AND_THE_XML_IN_MARKUP_SERVICE_OF_DOCUMENTS_DESCRIPTION_CORRECTION_SIGNATURES_FOR_THAT_FILTER_STANDAR_SOFTWARE_ABILITY_AS_BOTH_S_FO = (
"Recommendation-chair_developed:these:from:Worki",
"and-is-and:Jini-their_and_to.to:DOM_testing.of_and.the.XML:in",
"Markup.service-of-documents-Description:correction.signatures.",
"for_that.filter.Standar",
"software_ability_as.",
"both.s",
"fo",
)
THE_RELATED_PROCESS_A_TECHNICAL_KEY_IS_AND_THE_ANY_IN_A_OF_AN_OF_IS_IS_FOR_TO_IN_SIMUL_IS_SUCCESS_FROM_DISSEMINATE_FACT_MANIPULATE_AND_ELIMINATE_UNDER_AD_A_REGISTRY_AND_SPECIFICATIONS_UNBIASED_AROUN_THE_ELECTRONIC_STYLESHEET_ELIMINATE_BOTH_IN_WHERE_SYSTEMS_RECOGNITION_TO_WITH_H_TO_AND_XML_CAPABILIT_THE_XML_BASED_A_AS_RAISED_TO_FOR_USE_THEM_THE_METROLOG_XML_REFERENCE_WITHIN_APPROACH_INDUSTRY_OF = (
"the:related:process-A_technical-key.is-and-the-any",
"in.a:of-an.of_is:is.for_to_in",
"simul",
"is_success-from:disseminate-fact_manipulate:and-eliminate.under",
"ad:a:registry_and:specifications_unbiased:aroun",
"the:Electronic_Stylesheet-eliminate_both:in",
"where_systems-recognition-to:with-h",
"to-and:XML-capabilit",
"the_XML-based_a:As.raised_to-for:use.them_the:metrolog",
"XML-reference:within_approach-industry.of",
)
THE_XML_IS_CONSTITUENT_THE_OFFER_APPROPRIATE_OBVIOUS_DESIGN_FOR_USING_MEASUREMENTS_M_DOCUMENTS_TRANSMIT_SUCH_THE_INTEROPERABILITY_AND_OVER_AND_ISSUES_AND_OF_TECHN_PARTNERS_TECHNOLOGIES_HAS_AND_INTERC_CAN_MUST_CREATES_UTI = (
"the-XML:is_constituent_the:offer_appropriate:obvious.design.",
"for_Using.measurements-m",
"documents:transmit_such_",
"the-interoperability:and_over:and-issues.and-of:techn",
"partners_technologies:has-and.interc",
"can:must-creates.uti",
)
FOUR_OF_PRIMARY_REFERENCE_REGISTRY_BUILD_XML_LED_INVOLVED_AND_ALLOWS_SUBJE_THE_REACH_HAS_ACCESS_ADDITIONALLY_FINE_IS_ARE_QUALI_MANIPULATE_THEM_CAPABI_AS_MEASURE_OBJECT_HAS_FOUR_INTERNATIONAL_CORRECTION_A_ISSUES_BY_OR_NIST_INTERNET_ENAB_THIS_COM_SPECIFICATIONS_OBJECTIVE_AMONG_METH = (
"four.of-primary-reference.registry_build.XML-led:involved.and.",
"allows:subje",
"the-reach-has:access-Additionally-fine_is:are:",
"quali",
"manipulate_them.capabi",
"as:measure:object-has:four_international.correction.a",
"issues:By_or-NIST.Internet-enab",
"this_com",
"specifications.objective_among_meth",
)
@dataclass
class NistschemaSvIvListNmtokensEnumeration4:
class Meta:
name = "NISTSchema-SV-IV-list-NMTOKENS-enumeration-4"
namespace = "NISTSchema-SV-IV-list-NMTOKENS-enumeration-4-NS"
value: Optional[NistschemaSvIvListNmtokensEnumeration4Type] = field(
default=None,
metadata={
"required": True,
}
)
| 54.137255 | 404 | 0.725462 | 682 | 5,522 | 5.322581 | 0.31085 | 0.013223 | 0.009917 | 0.014876 | 0.921763 | 0.921763 | 0.921763 | 0.911295 | 0.911295 | 0.884298 | 0 | 0.001343 | 0.191235 | 5,522 | 101 | 405 | 54.673267 | 0.811464 | 0 | 0 | 0 | 0 | 0.010526 | 0.364723 | 0.328685 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.031579 | 0 | 0.157895 | 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 |
f8cb0b94ccf26ee1573a3c6810d2a6e1f0d336a9 | 7,787 | py | Python | prog_principale.py | Ignoramus-Sage/RBM-DBN_DNN | 175d722c4c9898a1a61e86ea164d80c17f4b7943 | [
"MIT"
] | null | null | null | prog_principale.py | Ignoramus-Sage/RBM-DBN_DNN | 175d722c4c9898a1a61e86ea164d80c17f4b7943 | [
"MIT"
] | null | null | null | prog_principale.py | Ignoramus-Sage/RBM-DBN_DNN | 175d722c4c9898a1a61e86ea164d80c17f4b7943 | [
"MIT"
] | null | null | null | from principal_DNN_MNIST import *
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
# Reloading modules just in case
if __name__ == "__main__" :
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data(path="mnist.npz")
data_mnist = scale_and_read_img(x_train)
test_data = scale_and_read_img(x_test) # scaling test data
labels = transform_labels(y_train) #transforming labels
layers = [data_mnist[0, :].shape[0], 700, 600, 500, 400, 300, 200, 100, 50, 10]
test_dnn = MNIST_DNN(layers)
print('begin unsupervised training')
test_dnn = test_dnn.pretrain_DNN(data_mnist, batch_size=150, n_epoch=15000)
print('Unsupervised training is done')
print('begin supervised training')
test_dnn = test_dnn.retropropagation(data_mnist, labels, lr_rate=0.1, batch_size=150, n_epoch=30000)
print('Supervised training is done')
test_dnn.test_dnn(test_data, y_test)
generated = test_dnn.generer_image_DBN(data_mnist[0, :].shape[0], 10, rows=28, cols=28, max_iter=15000)
### L'effet du nombre de couches sur la classification
hidden_mult = 6
layers_list = []
layers=[200]
for i in range(2,hidden_mult+1):
layers_list.append(i*layers)
for layers in layers_list:
layers.insert(0, data_mnist[0, :].shape[0])
layers.append(10)
test_pretrain, test_retro = [], []
for layer in layers_list:
dnn_pretrain = MNIST_DNN(layer)
dnn_retro = MNIST_DNN(layer)
print('Training pretrained version')
print('begin unsupervised training')
dnn_pretrain = dnn_pretrain.pretrain_DNN(data_mnist, batch_size=150, n_epoch=15000)
print('Unsupervised training is done')
print('Begin supervised training')
dnn_pretrain = dnn_pretrain.retropropagation(data_mnist, labels, lr_rate=0.1, batch_size=150, n_epoch=40000)
print('Supervised training is done')
print('Training non pretrained version')
print('Begin supervised training')
dnn_retro = dnn_retro.retropropagation(data_mnist, labels, lr_rate=0.1, batch_size=150, n_epoch=40000)
print('Supervised training is done')
test_pretrain.append(dnn_pretrain.test_dnn(test_data, y_test))
test_retro.append(dnn_retro.test_dnn(test_data, y_test))
plt.figure(figsize=(15,6))
plt.plot([i for i in range(2,hidden_mult+1)], test_pretrain, '--g', label='Modèle pré-entraîné') # dashed cyan
plt.plot([i for i in range(2,hidden_mult+1)], test_retro, '-.k', label='Modèle non pré-entraîné') # dashdot black
plt.grid()
plt.legend(loc="upper right")
plt.title('Pourcentage d\'erreurs de classification par rapport au numéro de couche cachée');
plt.xlabel('Numéro de couche cachée')
plt.ylabel('Pourcentage d\'erreurs de classification');
plt.figure(figsize=(15,6))
plt.plot([i for i in range(2,hidden_mult+1)], test_pretrain, '--g', label='Modèle pré-entraîné') # dashed cyan
plt.plot([i for i in range(2,hidden_mult+1)], test_retro, '-.k', label='Modèle non pré-entraîné') # dashdot black
plt.ylim(0,4)
plt.grid()
plt.legend(loc="upper right")
plt.title('Pourcentage d\'erreurs de classification par rapport au numéro de couche cachée');
plt.xlabel('Numéro de couche cachée')
plt.ylabel('Pourcentage d\'erreurs de classification');
### L'effet du nombre de neurones de la couche cachée sur la classification
hidden_mult = 7
layers_list = []
for i in range(2,hidden_mult+1):
layers=[100, 100]
for j in range(len(layers)):
layers[j] *= i
layers_list.append(layers)
for layers in layers_list:
layers.insert(0, data_mnist[0, :].shape[0])
layers.append(10)
test_pretrain_size, test_retro_size = [], []
for layer in layers_list:
dnn_pretrain = MNIST_DNN(layer)
dnn_retro = MNIST_DNN(layer)
print('Training pretrained version')
print('begin unsupervised training')
dnn_pretrain = dnn_pretrain.pretrain_DNN(data_mnist, batch_size=150, n_epoch=15000)
print('Unsupervised training is done')
print('Begin supervised training')
dnn_pretrain = dnn_pretrain.retropropagation(data_mnist, labels, lr_rate=0.1, batch_size=150, n_epoch=30000)
print('Supervised training is done')
print('Training non pretrained version')
print('Begin supervised training')
dnn_retro = dnn_retro.retropropagation(data_mnist, labels, lr_rate=0.1, batch_size=150, n_epoch=30000)
print('Supervised training is done')
test_pretrain_size.append(dnn_pretrain.test_dnn(test_data, y_test))
test_retro_size.append(dnn_retro.test_dnn(test_data, y_test))
plt.figure(figsize=(15,6))
plt.plot([100*i for i in range(2,hidden_mult+1)], test_pretrain_size, '--g', label='Modèle pré-entraîné') # dashed cyan
plt.plot([100*i for i in range(2,hidden_mult+1)], test_retro_size, '-.k', label='Modèle non pré-entraîné') # dashdot black
plt.ylim(0,4)
plt.grid()
plt.legend(loc="upper right")
plt.title('Pourcentage d\'erreurs de classification par rapport au nombre de neurones dans les couches cachées');
plt.xlabel('Nombre de neurones dans les couches cachées')
plt.ylabel('Pourcentage d\'erreurs de classification');
### L'effet du L'effet du nombre d'échantillons d'apprentissage sur l'erreur de classification
sizes = [1000, 3000, 7000, 10000, 30000]
data_list = []
labels_list = []
layers = [data_mnist[0, :].shape[0], 200, 200, 10]
for size in sizes:
idx = np.random.choice(np.arange(data_mnist.shape[0]), size)
data_sample = data[idx]
labels_sample = labels[idx]
data_list.append(data_sample)
labels_list.append(labels_sample)
labels_list.append(labels)
data_list.append(data_mnist)
test_pretrain_data, test_retro_data = [], []
for i in range(len(sizes)):
dnn_pretrain = MNIST_DNN(layers)
dnn_retro = MNIST_DNN(layers)
print('Training pretrained version')
print('begin unsupervised training')
dnn_pretrain = dnn_pretrain.pretrain_DNN(data_list[i], batch_size=150, n_epoch=15000)
print('Unsupervised training is done')
print('Begin supervised training')
dnn_pretrain = dnn_pretrain.retropropagation(data_list[i], labels_list[i], lr_rate=0.1, batch_size=150, n_epoch=30000)
print('Supervised training is done')
print('Training non pretrained version')
print('Begin supervised training')
dnn_retro = dnn_retro.retropropagation(data_list[i], labels_list[i], lr_rate=0.1, batch_size=150, n_epoch=30000)
print('Supervised training is done')
test_pretrain_data.append(dnn_pretrain.test_dnn(test_data, y_test))
test_retro_data.append(dnn_retro.test_dnn(test_data, y_test))
plt.figure(figsize=(15,6))
plt.plot(sizes, test_pretrain_data, '--g', label='Modèle pré-entraîné') # dashed cyan
plt.plot(sizes, test_retro_data, '-.k', label='Modèle non pré-entraîné') # dashdot black
plt.ylim(0,4)
plt.grid()
plt.legend(loc="upper right")
plt.title('Pourcentage d\'erreurs de classification par rapport à la taille de l\'ensemble de données d\'entraînement.');
plt.xlabel('Taille de l\'ensemble de données d\'entraînement')
plt.ylabel('Pourcentage d\'erreurs de classification'); | 45.805882 | 127 | 0.660331 | 1,080 | 7,787 | 4.568519 | 0.15 | 0.042359 | 0.026753 | 0.028983 | 0.800365 | 0.755371 | 0.7424 | 0.731658 | 0.716052 | 0.672477 | 0 | 0.039203 | 0.226917 | 7,787 | 170 | 128 | 45.805882 | 0.780399 | 0.049441 | 0 | 0.533333 | 0 | 0 | 0.174962 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.02963 | 0 | 0.02963 | 0.207407 | 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 |
3e2714f6df8152cc04e96961ee2d66c5b7f5ab41 | 759 | py | Python | test_phyton/pages/func.py | gergo1001/conduit | b4ea1c2a71a865c03812a0833a743fb2a7d03a8b | [
"MIT"
] | null | null | null | test_phyton/pages/func.py | gergo1001/conduit | b4ea1c2a71a865c03812a0833a743fb2a7d03a8b | [
"MIT"
] | null | null | null | test_phyton/pages/func.py | gergo1001/conduit | b4ea1c2a71a865c03812a0833a743fb2a7d03a8b | [
"MIT"
] | null | null | null | import random
import string
webpage_visible = False
def random_email():
return "".join([random.choice(string.ascii_lowercase) for _ in range(8)]) + '@testemail.hu'
def random_user():
return "".join([random.choice(string.ascii_letters) for _ in range(6)])
def random_pass():
return "".join([random.choice(string.ascii_lowercase) for _ in range(6)]) + "".join(
[random.choice(string.ascii_uppercase) for _ in range(1)]) + "".join(
[random.choice(string.digits) for _ in range(1)]) + '!'
def random_title():
return "".join([random.choice(string.ascii_letters) for _ in range(10)])
def inputelement(driver, typeofelementpath, path):
if typeofelementpath == 'xpath':
return driver.find_element_by_xpath(path)
| 27.107143 | 95 | 0.687747 | 99 | 759 | 5.080808 | 0.373737 | 0.119284 | 0.190855 | 0.262425 | 0.459245 | 0.405567 | 0.405567 | 0.405567 | 0.405567 | 0.405567 | 0 | 0.010989 | 0.160738 | 759 | 27 | 96 | 28.111111 | 0.77865 | 0 | 0 | 0 | 0 | 0 | 0.025033 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3125 | false | 0.0625 | 0.125 | 0.25 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 6 |
3e2e6a1b4168e73c7e80be80e03e7a4d37075858 | 410 | py | Python | challenges/FizzBuzzTree/conftest.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 1 | 2021-04-02T12:12:20.000Z | 2021-04-02T12:12:20.000Z | challenges/FizzBuzzTree/conftest.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 2 | 2018-03-21T17:34:34.000Z | 2018-03-26T16:46:07.000Z | challenges/FizzBuzzTree/conftest.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 2 | 2018-08-29T18:59:59.000Z | 2019-04-12T21:16:14.000Z | from .bst import BST
from .bst import Node
import pytest
@pytest.fixture
def small_bst():
return BST([20, 15, 9, 11])
@pytest.fixture
def empty_bst():
return BST()
@pytest.fixture
def no_fizzbuzz():
return BST([1, 4, 7, 11])
@pytest.fixture
def fizz_node():
return Node(3)
@pytest.fixture
def buzz_node():
return Node(5)
@pytest.fixture
def fizzbuzz_node():
return Node(15)
| 12.058824 | 31 | 0.668293 | 63 | 410 | 4.253968 | 0.365079 | 0.291045 | 0.358209 | 0.134328 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04878 | 0.2 | 410 | 33 | 32 | 12.424242 | 0.768293 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | true | 0 | 0.142857 | 0.285714 | 0.714286 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
3e6011de0576253b8523ef08cc7a1e337e5aebba | 120 | py | Python | templar/exceptions.py | Cal-CS-61A-Staff/templar | 2c2a5a544da377e3c311750fadd6606bba3b7e75 | [
"MIT"
] | 6 | 2015-05-04T06:17:49.000Z | 2021-09-11T00:13:14.000Z | templar/exceptions.py | albert12132/templar | 39851c89730ab69e5c73d0a46adca2a44ecc4165 | [
"MIT"
] | 17 | 2015-01-07T03:25:47.000Z | 2016-10-08T03:53:44.000Z | templar/exceptions.py | Cal-CS-61A-Staff/templar | 2c2a5a544da377e3c311750fadd6606bba3b7e75 | [
"MIT"
] | 6 | 2015-10-08T11:37:17.000Z | 2019-06-03T21:27:52.000Z | """Base exception for Templar."""
class TemplarError(Exception):
"""Top-level exception for Templar."""
pass
| 15 | 42 | 0.666667 | 13 | 120 | 6.153846 | 0.692308 | 0.3 | 0.475 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183333 | 120 | 7 | 43 | 17.142857 | 0.816327 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 6 |
e41c61f329970e499675ba8d58beb7f06af3223e | 13,826 | py | Python | exam.py | SizeLee/Industry-big-data-time-sequence-process | 0e5f870ff4bc15a9a3217ccb706345ee034bc379 | [
"MIT"
] | 1 | 2020-04-18T05:08:03.000Z | 2020-04-18T05:08:03.000Z | exam.py | SizeLee/Industry-big-data-time-sequence-process | 0e5f870ff4bc15a9a3217ccb706345ee034bc379 | [
"MIT"
] | null | null | null | exam.py | SizeLee/Industry-big-data-time-sequence-process | 0e5f870ff4bc15a9a3217ccb706345ee034bc379 | [
"MIT"
] | null | null | null | import numpy as np
import BPNN_model, KNN_sequence_Model
import RNN_models, CNN_models, AttentionModel, Incremental_Learning_models
import configparser
import json
import time
def rnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, cell_type, random_seed=None):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
print('%s_model test start' % cell_type)
model = RNN_models.FixedLengthRNN(sequence_fix_length, data['features'].shape[1],
class_num=class_num, cell_type=cell_type)
# lstm.train(data['features'], data['labels'], 1, 1024, training_sample_ids,
# foresight_steps=foresight_steps, reset_flag=True)
# lstm.test(data['features'], data['labels'], test_sample_ids)
# lstm.save_model('./model/rnn_model')
start_time = time.time()
model.train_v2(data['features'], data['labels'], data['samples_length'], 1, 1024, training_sample_ids,
test_sample_ids, foresight_steps=0, reset_flag=True, record_flag=False, random_seed=random_seed)
end_time = time.time()
print('cost training time %f' % (end_time - start_time))
model.test_v2(data['features'], data['labels'], data['samples_length'], test_sample_ids)
# model.save_model('./model/%s_model_v2' % cell_type)
whole_time_on_test = model.test_time(data['features'], data['labels'], data['samples_length'], test_sample_ids)
whole_time_on_test_str = '%s time cost on predicting %d test samples: %fs\n' % (cell_type,
len(test_sample_ids),
whole_time_on_test)
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# print('cost time %f' % (end_time - start_time))
print('%s_model test over\n' % cell_type)
return whole_time_on_test_str
def cnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, random_seed=None):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
print('cnn_model test start')
cnn = CNN_models.ConvSequence2One(sequence_fix_length, data['features'].shape[1],
class_num=class_num)
# cnn.train(data['features'], data['labels'], 1, 1024, training_sample_ids)
# cnn.test(data['features'], data['labels'], test_sample_ids)
# cnn.save_model('./model/cnn_model')
start_time = time.time()
cnn.train_v2(data['features'], data['labels'], data['samples_length'], 1, 1024, training_sample_ids, test_sample_ids,
foresight_steps=0, reset_flag=True, record_flag=False, random_seed=random_seed)
end_time = time.time()
print('cost training time %f' % (end_time - start_time))
cnn.test_v2(data['features'], data['labels'], data['samples_length'], test_sample_ids)
# cnn.save_model('./model/cnn_model_v2')
whole_time_on_test = cnn.test_time(data['features'], data['labels'], data['samples_length'], test_sample_ids)
whole_time_on_test_str = 'cnn time cost on predicting %d test samples: %fs\n' % (len(test_sample_ids),
whole_time_on_test)
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# print('cost time %f' % (end_time - start_time))
print('cnn_model test over\n')
return whole_time_on_test_str
def atn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, random_seed=None):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
print('atn_model test start')
atn = AttentionModel.CNN_Attention(sequence_fix_length, data['features'].shape[1], class_num=class_num,
network_hyperparameters='./data/attention_network_hyperparameters_v2.json')
# atn.train(data['features'], data['labels'], 1, 1024, training_sample_ids)
# atn.test(data['features'], data['labels'], test_sample_ids)
# atn.save_model('./model/atn_model_new')
start_time = time.time()
atn.train_v2(data['features'], data['labels'], data['samples_length'], 1, 1024, training_sample_ids, test_sample_ids,
foresight_steps=0, reset_flag=True, record_flag=False, random_seed=random_seed)
end_time = time.time()
print('cost training time %f' % (end_time - start_time))
atn.test_v2(data['features'], data['labels'], data['samples_length'], test_sample_ids)
# atn.save_model('./model/atn_model_v2')
whole_time_on_test = atn.test_time(data['features'], data['labels'], data['samples_length'], test_sample_ids)
whole_time_on_test_str = 'sum_a_cnn time cost on predicting %d test samples: %fs\n' % (len(test_sample_ids),
whole_time_on_test)
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# print('cost time %f' % (end_time - start_time))
print('atn_model test over\n')
return whole_time_on_test_str
def incremental_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, incremental_sample_ids, random_seed=None):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
print('incremental_model test start')
incre_cnn_a = Incremental_Learning_models.Incremental_CNN_Attention(sequence_fix_length, data['features'].shape[1],
class_num=class_num,
network_hyperparameters='./data/attention_network_hyperparameters_v2.json',
incremental_net_hyperparameters='./data/Incremental_CNN_A.json')
incre_cnn_a.incremental_simulation(data['features'], data['labels'], data['samples_length'], 2, 1024,
training_sample_ids, test_sample_ids, incremental_sample_ids,
foresight_steps=0, reset_flag=True, record_flag=False, random_seed=random_seed)
# atn.train(data['features'], data['labels'], 1, 1024, training_sample_ids)
# atn.test(data['features'], data['labels'], test_sample_ids)
# atn.save_model('./model/atn_model_new')
# start_time = time.time()
# incre_cnn_a.train_v2(data['features'], data['labels'], data['samples_length'], 1, 1024, training_sample_ids, test_sample_ids,
# foresight_steps=0, reset_flag=True, record_flag=True, random_seed=random_seed)
# end_time = time.time()
# print('cost training time %f' % (end_time - start_time))
# incre_cnn_a.test_v2(data['features'], data['labels'], data['samples_length'], test_sample_ids)
# incre_cnn_a.save_model('./model/atn_model_v2')
#
# whole_time_on_test = incre_cnn_a.test_time(data['features'], data['labels'], data['samples_length'], test_sample_ids)
# whole_time_on_test_str = 'sum_a_cnn time cost on predicting %d test samples: %fs\n' % (len(test_sample_ids),
# whole_time_on_test)
#
# print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# # print('cost time %f' % (end_time - start_time))
# print('atn_model test over\n')
# return whole_time_on_test_str
def bpnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, random_seed=None):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
print('bpnn_model test start')
bpnn = BPNN_model.BPNN(sequence_fix_length, data['features'].shape[1], class_num=class_num)
# bpnn.train(data['features'], data['labels'], 1, 4096, training_sample_ids,
# foresight_steps=foresight_steps, reset_flag=True)
# bpnn.test(data['features'], data['labels'], test_sample_ids)
# bpnn.save_model('./model/bpnn_model')
start_time = time.time()
bpnn.train_v2(data['features'], data['labels'], data['samples_length'], 1, 1024, training_sample_ids, test_sample_ids,
foresight_steps=0, reset_flag=True, record_flag=False, random_seed=random_seed)
end_time = time.time()
print('cost training time %f' % (end_time - start_time))
bpnn.test_v2(data['features'], data['labels'], data['samples_length'], test_sample_ids)
# bpnn.save_model('./model/bpnn_model_v2')
whole_time_on_test = bpnn.test_time(data['features'], data['labels'], data['samples_length'], test_sample_ids)
whole_time_on_test_str = 'bpnn time cost on predicting %d test samples: %fs\n' % (len(test_sample_ids),
whole_time_on_test)
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# print('cost time %f' % (end_time - start_time))
print('bpnn_model test over\n')
return whole_time_on_test_str
def knn_exams(data, training_sample_ids, test_sample_ids):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
print('knn_model test start')
start_time = time.time()
knn = KNN_sequence_Model.KNN_Sequence()
# knn.train(data['features'], data['labels'], training_sample_ids, data['samples_length'])
knn.test_cpu(data['features'], data['labels'], test_sample_ids[-10000:], data['samples_length'], 100)
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
end_time = time.time()
print('cost time %f' % (end_time - start_time))
print('knn_model test over\n')
return
def exam1and2():
common_para = configparser.ConfigParser()
common_para.read('common_para.ini')
sequence_fix_length = common_para['common_parameters'].getint('sequence_fix_length')
foresight_steps = common_para['common_parameters'].getint('foresight_steps')
class_num = common_para['common_parameters'].getint('class_num')
random_seed = common_para['common_parameters'].getint('random_seed')
data = np.load(common_para['path']['data_file'])
# print(data['features'])
# print(data['labels'])
# print(data['samples_length'])
# print(data['features'].shape)
# print(data['labels'].shape)
# print(data['samples_length'].shape)
### generate training samples' id
# sample_num = data['labels'].shape[0]
# sample_ids = [i for i in range(sample_num)]
# training_sample_ids = random.sample(sample_ids, int(0.7*sample_num))
# test_sample_ids = list(set(sample_ids) - set(training_sample_ids))
# training_sample_ids = [i for i in range(10000)]
# test_sample_ids = [i for i in range(1000, 2000)]
with open(common_para['path']['data_set_ids_file'], 'r') as f:
data_set_ids = json.load(f)
training_sample_ids = data_set_ids['training_set']
test_sample_ids = data_set_ids['test_set']
# training_sample_ids = list(map(int, data_set_ids['training_set']))
# test_sample_ids = list(map(int, data_set_ids['test_set']))
# print(type(training_sample_ids), type(test_sample_ids))
time_str = ''
# rnn exams
# lstm
tstr = rnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids,
'lstm', random_seed)
time_str += tstr
# gru
tstr = rnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, 'gru',
random_seed)
time_str += tstr
# sru
tstr = rnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids, 'sru',
random_seed)
time_str += tstr
# cnn exams
tstr = cnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids,
random_seed)
time_str += tstr
#
# # attention net exams
tstr = atn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids,
random_seed)
time_str += tstr
#
# traditional ways
# BPNN exams
tstr = bpnn_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids,
random_seed)
time_str += tstr
# with open('./data/time_cost.txt', 'w+') as file:
# file.write(time_str)
# todo add dtw exams
# # KNN exams
# knn_exams(data, training_sample_ids, test_sample_ids)
def exam3():
common_para = configparser.ConfigParser()
common_para.read('common_para.ini')
sequence_fix_length = common_para['common_parameters'].getint('sequence_fix_length')
foresight_steps = common_para['common_parameters'].getint('foresight_steps')
class_num = common_para['common_parameters'].getint('class_num')
random_seed = common_para['common_parameters'].getint('random_seed')
data = np.load(common_para['path']['data_file'])
# print(data['features'])
# print(data['labels'])
# print(data['samples_length'])
# print(data['features'].shape)
# print(data['labels'].shape)
# print(data['samples_length'].shape)
# Incremental exams
with open(common_para['path']['data_set_incremental_ids_file'], 'r') as f:
data_set_ids = json.load(f)
training_sample_ids = data_set_ids['training_set']
test_sample_ids = data_set_ids['test_set']
incremental_sample_ids = data_set_ids['incremental_set']
incremental_exams(sequence_fix_length, foresight_steps, class_num, data, training_sample_ids, test_sample_ids,
incremental_sample_ids, random_seed)
if __name__ == '__main__':
exam1and2()
exam3()
| 51.589552 | 157 | 0.661507 | 1,870 | 13,826 | 4.550802 | 0.069519 | 0.092009 | 0.071798 | 0.072385 | 0.850294 | 0.818449 | 0.810341 | 0.783784 | 0.764512 | 0.730082 | 0 | 0.010329 | 0.201721 | 13,826 | 267 | 158 | 51.782772 | 0.760714 | 0.25575 | 0 | 0.472222 | 0 | 0 | 0.167385 | 0.015092 | 0 | 0 | 0 | 0.003745 | 0 | 1 | 0.055556 | false | 0 | 0.041667 | 0 | 0.131944 | 0.1875 | 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 |
e492dc5dbcfc8d53771bb8a08232bc09b7aab3a2 | 154 | py | Python | utime/dataset/queue/__init__.py | learning310/U-Time | f7c8e3f1368f43226872a69b0fbb8c29990e4bd9 | [
"MIT"
] | 138 | 2019-11-20T02:31:17.000Z | 2022-03-23T04:31:51.000Z | utime/dataset/queue/__init__.py | amiyapatanaik/U-Time | a9ed4892da77d165a71dbfef1d069d782c909757 | [
"MIT"
] | 46 | 2019-12-04T03:13:28.000Z | 2022-03-31T13:10:48.000Z | utime/dataset/queue/__init__.py | amiyapatanaik/U-Time | a9ed4892da77d165a71dbfef1d069d782c909757 | [
"MIT"
] | 42 | 2019-11-26T16:02:26.000Z | 2022-01-06T11:01:32.000Z | from .study_loader import StudyLoader
from .limitation_queue import LimitationQueue
from .lazy_queue import LazyQueue
from .eager_queue import EagerQueue
| 30.8 | 45 | 0.87013 | 20 | 154 | 6.5 | 0.6 | 0.253846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103896 | 154 | 4 | 46 | 38.5 | 0.942029 | 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 |
e4a0087c40617faf803a9b051de1bc0df33d06cd | 74 | py | Python | Dinos/Achatina/PrimalItemResource_SnailPaste.PrimalItemResource_SnailPaste.py | cutec-chris/sce-PrimalEarth | 4e7a45acffc57a455a7668af1a954004668c3085 | [
"MIT"
] | null | null | null | Dinos/Achatina/PrimalItemResource_SnailPaste.PrimalItemResource_SnailPaste.py | cutec-chris/sce-PrimalEarth | 4e7a45acffc57a455a7668af1a954004668c3085 | [
"MIT"
] | null | null | null | Dinos/Achatina/PrimalItemResource_SnailPaste.PrimalItemResource_SnailPaste.py | cutec-chris/sce-PrimalEarth | 4e7a45acffc57a455a7668af1a954004668c3085 | [
"MIT"
] | null | null | null | import sys,sce
class PrimalItemResource_SnailPaste(sce.Resources):
pass | 24.666667 | 51 | 0.837838 | 9 | 74 | 6.777778 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094595 | 74 | 3 | 52 | 24.666667 | 0.910448 | 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 |
e4a8fe0733a651e1ab21324b7a6b33167b29e314 | 214 | py | Python | randomtesting.py | ManderaGeneral/generalbrowser | 2cbbb3c4e2b45a3d8523c0e7dd071d66a962e5ed | [
"MIT"
] | null | null | null | randomtesting.py | ManderaGeneral/generalbrowser | 2cbbb3c4e2b45a3d8523c0e7dd071d66a962e5ed | [
"MIT"
] | null | null | null | randomtesting.py | ManderaGeneral/generalbrowser | 2cbbb3c4e2b45a3d8523c0e7dd071d66a962e5ed | [
"MIT"
] | null | null | null |
from generalbrowser.assets.account.client import AccountClient
from generalbrowser.assets.account.clientpage import GeneralSigninPage
client = AccountClient(domain="http://127.0.0.1:8000")
client.create_page()
| 23.777778 | 70 | 0.82243 | 26 | 214 | 6.730769 | 0.653846 | 0.205714 | 0.274286 | 0.354286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050505 | 0.074766 | 214 | 8 | 71 | 26.75 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.099057 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 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 |
e4c0bdeed0a670a1c56d63a18d195fbf5901a3ce | 3,789 | py | Python | seh/tests/unit/test_query.py | xu1991/seartest | beb2d5e282d88b29544d2d17add2be6b97454ec1 | [
"CC0-1.0"
] | 1 | 2020-12-24T16:24:31.000Z | 2020-12-24T16:24:31.000Z | seh/tests/unit/test_query.py | xu1991/seartest | beb2d5e282d88b29544d2d17add2be6b97454ec1 | [
"CC0-1.0"
] | 6 | 2021-03-31T19:23:49.000Z | 2021-12-13T20:17:36.000Z | seh/tests/unit/test_query.py | xu1991/seartest | beb2d5e282d88b29544d2d17add2be6b97454ec1 | [
"CC0-1.0"
] | 1 | 2020-09-05T11:45:21.000Z | 2020-09-05T11:45:21.000Z | from searx.query import RawTextQuery
from searx.testing import SearxTestCase
class TestQuery(SearxTestCase):
def test_simple_query(self):
query_text = 'the query'
query = RawTextQuery(query_text, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), query_text)
self.assertEquals(len(query.query_parts), 1)
self.assertEquals(len(query.languages), 0)
self.assertFalse(query.specific)
def test_language_code(self):
language = 'es-ES'
query_text = 'the query'
full_query = ':' + language + ' ' + query_text
query = RawTextQuery(full_query, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), full_query)
self.assertEquals(len(query.query_parts), 3)
self.assertEquals(len(query.languages), 1)
self.assertIn(language, query.languages)
self.assertFalse(query.specific)
def test_language_name(self):
language = 'english'
query_text = 'the query'
full_query = ':' + language + ' ' + query_text
query = RawTextQuery(full_query, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), full_query)
self.assertEquals(len(query.query_parts), 3)
self.assertIn('en', query.languages)
self.assertFalse(query.specific)
def test_unlisted_language_code(self):
language = 'all'
query_text = 'the query'
full_query = ':' + language + ' ' + query_text
query = RawTextQuery(full_query, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), full_query)
self.assertEquals(len(query.query_parts), 3)
self.assertIn('all', query.languages)
self.assertFalse(query.specific)
def test_invalid_language_code(self):
language = 'not_a_language'
query_text = 'the query'
full_query = ':' + language + ' ' + query_text
query = RawTextQuery(full_query, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), full_query)
self.assertEquals(len(query.query_parts), 1)
self.assertEquals(len(query.languages), 0)
self.assertFalse(query.specific)
def test_timeout_below100(self):
query_text = '<3 the query'
query = RawTextQuery(query_text, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), query_text)
self.assertEquals(len(query.query_parts), 3)
self.assertEquals(query.timeout_limit, 3)
self.assertFalse(query.specific)
def test_timeout_above100(self):
query_text = '<350 the query'
query = RawTextQuery(query_text, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), query_text)
self.assertEquals(len(query.query_parts), 3)
self.assertEquals(query.timeout_limit, 0.35)
self.assertFalse(query.specific)
def test_timeout_above1000(self):
query_text = '<3500 the query'
query = RawTextQuery(query_text, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), query_text)
self.assertEquals(len(query.query_parts), 3)
self.assertEquals(query.timeout_limit, 3.5)
self.assertFalse(query.specific)
def test_timeout_invalid(self):
# invalid number: it is not bang but it is part of the query
query_text = '<xxx the query'
query = RawTextQuery(query_text, [])
query.parse_query()
self.assertEquals(query.getFullQuery(), query_text)
self.assertEquals(len(query.query_parts), 1)
self.assertEquals(query.query_parts[0], query_text)
self.assertEquals(query.timeout_limit, None)
self.assertFalse(query.specific)
| 35.411215 | 68 | 0.651623 | 427 | 3,789 | 5.592506 | 0.133489 | 0.174204 | 0.123116 | 0.120603 | 0.801926 | 0.780988 | 0.780988 | 0.718593 | 0.657035 | 0.65201 | 0 | 0.012781 | 0.235946 | 3,789 | 106 | 69 | 35.745283 | 0.81209 | 0.015307 | 0 | 0.658824 | 0 | 0 | 0.03808 | 0 | 0 | 0 | 0 | 0 | 0.447059 | 1 | 0.105882 | false | 0 | 0.023529 | 0 | 0.141176 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
902bc96b363fc1a23c95abf6ff5896f9d01de328 | 44 | py | Python | main.py | kiminza/TestGit | b450572ab1a244472306acbd087b54b126f179b9 | [
"MIT"
] | null | null | null | main.py | kiminza/TestGit | b450572ab1a244472306acbd087b54b126f179b9 | [
"MIT"
] | null | null | null | main.py | kiminza/TestGit | b450572ab1a244472306acbd087b54b126f179b9 | [
"MIT"
] | null | null | null | print("git is my vcs of choice")
# its wow!! | 22 | 32 | 0.659091 | 9 | 44 | 3.222222 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 44 | 2 | 33 | 22 | 0.805556 | 0.204545 | 0 | 0 | 0 | 0 | 0.676471 | 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 |
5f5496e976920f524654e9c29d93e98dce288911 | 141 | py | Python | __init__.py | SunYanCN/tendecomlib | 3473d05855c87e39c162c3fea6fe59f94344735b | [
"MIT"
] | null | null | null | __init__.py | SunYanCN/tendecomlib | 3473d05855c87e39c162c3fea6fe59f94344735b | [
"MIT"
] | null | null | null | __init__.py | SunYanCN/tendecomlib | 3473d05855c87e39c162c3fea6fe59f94344735b | [
"MIT"
] | null | null | null | from tensorcomlib import *
from .matrix import *
from .base import *
from .random import *
from .tools import *
from .decomposition import *
| 20.142857 | 28 | 0.751773 | 18 | 141 | 5.888889 | 0.444444 | 0.471698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170213 | 141 | 6 | 29 | 23.5 | 0.905983 | 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 |
5f91b00f9ba9a5d385b8c3809943d29527bb9be4 | 135 | py | Python | math_lib.py | cu-swe4s-fall-2019/version-control-adziulko | b5d3f35f3c3397f80cfe6eb3605c34ce02f34db6 | [
"MIT"
] | null | null | null | math_lib.py | cu-swe4s-fall-2019/version-control-adziulko | b5d3f35f3c3397f80cfe6eb3605c34ce02f34db6 | [
"MIT"
] | null | null | null | math_lib.py | cu-swe4s-fall-2019/version-control-adziulko | b5d3f35f3c3397f80cfe6eb3605c34ce02f34db6 | [
"MIT"
] | null | null | null | def div(a, b):
if b == 0:
return 'Please use non-zero integer'
else:
return a/b
def add(a, b):
return a+b
| 15 | 44 | 0.511111 | 24 | 135 | 2.875 | 0.583333 | 0.115942 | 0.231884 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011628 | 0.362963 | 135 | 8 | 45 | 16.875 | 0.790698 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0.142857 | 0.714286 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
5fa355a1dc1c6f54f59821fdf08f9e9db59d54c7 | 2,485 | py | Python | SciDataTool/GUI/Resources/SDT_rc.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | null | null | null | SciDataTool/GUI/Resources/SDT_rc.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | null | null | null | SciDataTool/GUI/Resources/SDT_rc.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | null | null | null | # Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 5.15.2
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore
qt_resource_data = b"\
\x00\x00\x01q\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\
\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\
\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\
\x9c\x18\x00\x00\x01\x06IDATXGc\x18\x05\xa3\
`(\x01\x1d \x9e\x04\xa5\x07\x04\x80,\xff\xcf\xcc\xcc\
\xfc\xdf\xc6\x91\xf7?\x94OW\xc7\x80\x1d\x00\xc2\x8c\x8c\
\x8c`\x1a\x88\xb7C\xc5\xe9\xe2\x10\xb8\x03\xb0`\x90C\
\xc8r\x04\x13\x94\xa6\x14x\x00q\x1a\x84I\x1a`\x86\
\xd2\xc4\x00O 6\x870Q\x010J\x184u9\
\xcd\xdf\xbc\xfa#\x0c\xe4\x82\xd4=\x06\xe2W 9j\
\x02|Q\x80\x8e\x89\x8e\x12jE\x01: :Jh\
\xe5\x00\x06]C\xce\x5c E\xd5\x1cBJ\x14\xa0g\
U\x9c\x8e\xa0Y\x08\xfc\xff\x0f\xb2\x1b\x0c\xf0F\x07\xcd\
\x1c@,\xa0\x99\x03@Y\x13\x0av\x00\xf1,\x08\x13\
\x13\xd0\xcc\x01\x06\xa6\x1c j2\x10\x97\x02\xf1\x15\x10\
\x87R@R\x22\x04b\x90z\x82\x80\x16!\x00\x0ar\
\x90\xcfq\x06;\xb9\x00g\x08\xd0\xab\x8a\xc6\xe9\x80\xe0\
\x18>\x10Ms\x80/\x0d\x10\x15\xdf\xd8\x00\xa5i\x80\
f\xf1\x8d\x0d\x80C\x00\x14\xdf\x8e\x1e\x03\xd3$\x03Y\
FwKG\xc1(\xa01``\x00\x00\x1a\xf6lp\
\xfcO\xe9\xd3\x00\x00\x00\x00IEND\xaeB`\x82\
\
"
qt_resource_name = b"\
\x00\x06\
\x07\x03}\xc3\
\x00i\
\x00m\x00a\x00g\x00e\x00s\
\x00\x04\
\x00\x06\xfa^\
\x00i\
\x00c\x00o\x00n\
\x00\x11\
\x06\x99\x08\xc7\
\x00p\
\x00l\x00a\x00y\x00-\x003\x002\x00p\x00x\x00_\x00S\x00D\x00T\x00.\x00p\x00n\x00g\
\
"
qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x12\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00 \x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x7f\xc1}\x1fz\
"
def qInitResources():
QtCore.qRegisterResourceData(
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
)
def qCleanupResources():
QtCore.qUnregisterResourceData(
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
)
qInitResources()
| 31.0625 | 82 | 0.692958 | 482 | 2,485 | 3.533195 | 0.410788 | 0.338227 | 0.364651 | 0.345273 | 0.244862 | 0.244862 | 0.234292 | 0.230769 | 0.230769 | 0.214915 | 0 | 0.297189 | 0.098189 | 2,485 | 79 | 83 | 31.455696 | 0.46274 | 0.065996 | 0 | 0.123077 | 0 | 0.353846 | 0 | 0 | 0 | 0 | 0.003576 | 0 | 0 | 1 | 0.030769 | false | 0 | 0.015385 | 0 | 0.046154 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
5fbc97411e6554a4c9906879416462c7be1a8f68 | 131 | py | Python | 04 - IWAE/vae.py | wrongu/vae-tutorial | f1a652905c11a06e9c037f0542b6545360d95916 | [
"MIT"
] | 5 | 2019-01-20T07:07:29.000Z | 2022-03-12T20:45:41.000Z | 04 - IWAE/vae.py | wrongu/vae-tutorial | f1a652905c11a06e9c037f0542b6545360d95916 | [
"MIT"
] | null | null | null | 04 - IWAE/vae.py | wrongu/vae-tutorial | f1a652905c11a06e9c037f0542b6545360d95916 | [
"MIT"
] | 2 | 2020-10-15T17:47:20.000Z | 2021-12-22T02:58:38.000Z | import keras.backend as K
from keras.engine import Model
class IWAE(object):
# YOUR CODE HERE
class VAE(IWAE):
# YOUR CODE HERE
| 13.1 | 30 | 0.748092 | 22 | 131 | 4.454545 | 0.681818 | 0.163265 | 0.244898 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175573 | 131 | 9 | 31 | 14.555556 | 0.907407 | 0.221374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 0 | 0 | null | null | 0 | 0.5 | null | null | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
395b8c8a3e4cd76270cfec929f4f8502ec8a2930 | 196 | py | Python | common/views.py | IvanParvanovski/petstagram-repository | 03f1464d4f5919712446f812fad044056f9a15f6 | [
"MIT"
] | 2 | 2021-06-10T08:18:00.000Z | 2021-06-12T19:10:49.000Z | common/views.py | IvanParvanovski/petstagram-repository | 03f1464d4f5919712446f812fad044056f9a15f6 | [
"MIT"
] | null | null | null | common/views.py | IvanParvanovski/petstagram-repository | 03f1464d4f5919712446f812fad044056f9a15f6 | [
"MIT"
] | null | null | null | from django.shortcuts import render
def landing_page(req):
return render(req, 'landing_page.html')
def original(req):
return render(req, 'landing_page.html')
# Create your views here.
| 17.818182 | 43 | 0.734694 | 28 | 196 | 5.035714 | 0.571429 | 0.234043 | 0.212766 | 0.255319 | 0.468085 | 0.468085 | 0.468085 | 0 | 0 | 0 | 0 | 0 | 0.158163 | 196 | 10 | 44 | 19.6 | 0.854545 | 0.117347 | 0 | 0.4 | 0 | 0 | 0.19883 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0.4 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 6 |
3990695a1585edd7605ed880e5bb75a2271da0cf | 21,012 | py | Python | tests/test_selection.py | kexinchenn/LEAP | 97ba277dae29f1111c03dce6484d4104a575ea21 | [
"AFL-3.0"
] | 53 | 2018-10-04T18:01:22.000Z | 2022-03-24T05:24:37.000Z | tests/test_selection.py | kexinchenn/LEAP | 97ba277dae29f1111c03dce6484d4104a575ea21 | [
"AFL-3.0"
] | 180 | 2018-10-11T21:36:57.000Z | 2022-03-25T17:38:33.000Z | tests/test_selection.py | kexinchenn/LEAP | 97ba277dae29f1111c03dce6484d4104a575ea21 | [
"AFL-3.0"
] | 8 | 2019-09-27T23:11:26.000Z | 2021-09-29T21:15:35.000Z | """
Unit test for selection operators.
"""
import random
from math import nan
import numpy as np
import pytest
from leap_ec import Individual
from leap_ec import ops, statistical_helpers
from leap_ec.binary_rep.problems import MaxOnes
from leap_ec.data import test_population
from leap_ec.real_rep.problems import SpheroidProblem
##############################
# Tests for sus_selection()
##############################
def test_sus_selection1():
''' Test of a deterministic case of stochastic universal sampling '''
# Make a population where sus_selection has an obvious
# reproducible choice
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
pop = Individual.evaluate_population(pop)
# This selection operator will always choose the [1, 1, 1] individual
# since [0, 0, 0] has zero fitness
selector = ops.sus_selection(pop)
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
# run one more time to test shuffle
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
@pytest.mark.stochastic
def test_sus_selection_shuffle():
''' Test of a stochastic case of SUS selection '''
# Make a population where sus_selection has an obvious
# reproducible choice
# Proportions here should be 1/4 and 3/4, respectively
pop = [Individual(np.array([0, 1, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# Assign a unique identifier to each individual
pop[0].id = 0
pop[1].id = 1
# We first need to evaluate all the individuals so that
# selection has fitnesses to compare
pop = Individual.evaluate_population(pop)
selected = ops.sus_selection(pop)
N = 1000
p_thresh = 0.1
observed_dist = statistical_helpers.collect_distribution(
lambda: next(selected).id, samples=N)
expected_dist = {pop[0].id: 0.25*N, pop[1].id: 0.75*N}
print(f"Observed: {observed_dist}")
print(f"Expected: {expected_dist}")
assert(statistical_helpers.stochastic_equals(expected_dist,
observed_dist, p=p_thresh))
def test_sus_selection_offset():
''' Test of SUS selection with a non-default offset '''
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# evaluate population and negate fitness of second individual
pop = Individual.evaluate_population(pop)
pop[1].fitness = -pop[1].fitness
# now we try to evaluate normally (this should throw a ValueError)
# due to the negative fitness
with pytest.raises(ValueError):
selector = ops.sus_selection(pop)
selected = next(selector)
# it should work by setting the offset to +3
# this adds 3 to each fitness value, making the second
# individual's fitness 0.
selector = ops.sus_selection(pop, offset=3)
# we expect the first individual to always be selected
# since the new zero point is now -3.
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
def test_sus_selection_pop_min():
''' Test of SUS selection with pop-min offset '''
# Create a population of positive fitness individuals
# scaling the fitness by the population minimum makes it so the
# least fit member never gets selected.
pop = [Individual(np.array([0, 1, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
pop = Individual.evaluate_population(pop)
selector = ops.sus_selection(pop, offset='pop-min')
# we expect that the second individual is always selected
# since the new zero point will be at the minimum fitness
# of the population
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
def test_sus_selection_custom_key():
''' Test of SUS selection with custom evaluation '''
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
def custom_key(individual):
''' Returns fitness based on MaxZeros '''
return np.count_nonzero(individual.genome == 0)
pop = Individual.evaluate_population(pop)
selector = ops.sus_selection(pop, key=custom_key)
# we expect the first individual to always be selected
# since its genome is all 0s
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
def test_sus_selection_num_points():
''' Test of SUS selection with varying `n` random points '''
# the second individual should always be selected
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
pop = Individual.evaluate_population(pop)
# with negative points
with pytest.raises(ValueError):
selector = ops.sus_selection(pop, n=-1)
selected = next(selector)
# with n = None (default)
selector = ops.sus_selection(pop, n=None)
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
# with n less than len(population)
selector = ops.sus_selection(pop, n=1)
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
# with n greater than len(population)
selector = ops.sus_selection(pop, n=3)
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
##############################
# Tests for proportional_selection()
##############################
def test_proportional_selection1():
''' Test of a deterministic case of proportional selection '''
# Make a population where proportional_selection has an obvious
# reproducible choice
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
parents = Individual.evaluate_population(pop)
# This selection operator will always select the [1, 1, 1] individual since
# [0, 0, 0] has zero fitness
selector = ops.proportional_selection(parents)
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
@pytest.mark.stochastic
def test_proportional_selection2():
''' Test of a stochastic proportional selection '''
# Make a population where fitness proportional selection has an obvious
# reproducible choice
# Proportions here should be 1/4 and 3/4, respectively
pop = [Individual(np.array([0, 1, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# Assign a unique identifier to each individual
pop[0].id = 0
pop[1].id = 1
# We first need to evaluate all the individuals so that
# selection has fitnesses to compare
pop = Individual.evaluate_population(pop)
selected = ops.proportional_selection(pop)
N = 1000
p_thresh = 0.1
observed_dist = statistical_helpers.collect_distribution(
lambda: next(selected).id, samples=N)
expected_dist = {pop[0].id: 0.25*N, pop[1].id: 0.75*N}
print(f"Observed: {observed_dist}")
print(f"Expected: {expected_dist}")
assert(statistical_helpers.stochastic_equals(expected_dist,
observed_dist, p=p_thresh))
def test_proportional_selection_offset():
''' Test of proportional selection with a non-default offset '''
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# evaluate population and negate fitness of second individual
pop = Individual.evaluate_population(pop)
pop[1].fitness = -pop[1].fitness
# now we try to evaluate normally (this should throw a ValueError)
# due to the negative fitness
with pytest.raises(ValueError):
selector = ops.proportional_selection(pop)
selected = next(selector)
# it should work by setting the offset to +3
# this adds 3 to each fitness value, making the second
# individual's fitness 0.
selector = ops.proportional_selection(pop, offset=3)
# we expect the first individual to always be selected
# since the new zero point is now -3.
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
def test_proportional_selection_pop_min():
''' Test of proportional selection with pop-min offset '''
# Create a population of positive fitness individuals
# scaling the fitness by the population minimum makes it so the
# least fit member never gets selected.
pop = [Individual(np.array([0, 1, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
pop = Individual.evaluate_population(pop)
selector = ops.proportional_selection(pop, offset='pop-min')
# we expect that the second individual is always selected
# since the new zero point will be at the minimum fitness
# of the population
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
selected = next(selector)
assert np.all(selected.genome == [1, 1, 1])
def test_proportional_selection_custom_key():
''' Test of proportional selection with custom evaluation '''
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
def custom_key(individual):
''' Returns fitness based on MaxZeros '''
return np.count_nonzero(individual.genome == 0)
pop = Individual.evaluate_population(pop)
selector = ops.proportional_selection(pop, key=custom_key)
# we expect the first individual to always be selected
# since its genome is all 0s
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
selected = next(selector)
assert np.all(selected.genome == [0, 0, 0])
##############################
# Tests for naive_cyclic_selection()
##############################
def test_naive_cyclic_selection():
""" Test of the naive deterministic cyclic selection """
pop = [Individual(np.array([0, 0]), problem=MaxOnes()),
Individual(np.array([0, 1]), problem=MaxOnes())]
# This selection operator will deterministically cycle through the
# given population
selector = ops.naive_cyclic_selection(pop)
selected = next(selector)
assert np.all(selected.genome == [0, 0])
selected = next(selector)
assert np.all(selected.genome == [0, 1])
# And now we cycle back to the first individual
selected = next(selector)
assert np.all(selected.genome == [0, 0])
##############################
# Tests for cyclic_selection()
##############################
def test_cyclic_selection():
""" Test of the deterministic cyclic selection """
# Set seed so that we get consistent test results. I.e., it is possible
# by happenstance for some tests to fail even though they're actually ok.
# E.g., the cyclic selection tests will test if the test_sequence
# shuffles between a complete cycle, but there's a chance that the same
# test_sequence may come up in the random shuffle, so the test will fail.
# However, if we set a random seed ahead of time, then we can control for
# those pathological scenarios.
random.seed(123)
# We're just going to use integers for the population as that's
# sufficient for testing this selection operator; we don't want to get in
# the weeds with comparing individuals for test_sequence equivalency
# testing.
pop = list(range(4))
# This selection operator will deterministically cycle through the
# given population
selector = ops.cyclic_selection(pop)
# first cycle should be the same order as we started
first_iteration = [next(selector) for _ in range(len(pop))]
assert pop == first_iteration
# the second iteration should be shuffled
second_iteration = [next(selector) for _ in range(len(pop))]
assert pop != second_iteration
##############################
# Tests for truncation_selection()
##############################
def test_truncation_selection():
""" Basic truncation selection test"""
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([0, 0, 1]), problem=MaxOnes()),
Individual(np.array([1, 1, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# We first need to evaluate all the individuals so that truncation
# selection has fitnesses to compare
pop = Individual.evaluate_population(pop)
truncated = ops.truncation_selection(pop, 2)
assert len(truncated) == 2
# Just to make sure, check that the two best individuals from the
# original population are in the selected population
assert pop[2] in truncated
assert pop[3] in truncated
def test_truncation_parents_selection():
""" Test (mu + lambda), i.e., parents competing with offspring
Create parent and offspring populations such that each has an "best" individual that will be selected by
truncation selection.
"""
parents = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 0]), problem=MaxOnes())]
parents = Individual.evaluate_population(parents)
offspring = [Individual(np.array([0, 0, 1]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
offspring = Individual.evaluate_population(offspring)
truncated = ops.truncation_selection(offspring, 2, parents=parents)
assert len(truncated) == 2
assert parents[1] in truncated
assert offspring[1] in truncated
def test_truncation_selection_with_nan1():
"""If truncation selection encounters a NaN and non-NaN fitness
while maximizing, the non-NaN wins.
"""
# Make a population where binary tournament_selection has an obvious
# reproducible choice
problem = MaxOnes()
pop = [Individual(np.array([0, 0, 0]), problem=problem),
Individual(np.array([1, 1, 1]), problem=problem)]
# We first need to evaluate all the individuals so that truncation
# selection has fitnesses to compare
pop = Individual.evaluate_population(pop)
# Now set the "best" to NaN
pop[1].fitness = nan
best = ops.truncation_selection(pop, size=1)
assert pop[0] == best[0]
def test_truncation_selection_with_nan2():
"""If truncation selection encounters a NaN and non-NaN fitness
while minimizing, the non-NaN wins.
"""
problem = SpheroidProblem(maximize=False)
pop = []
pop.append(Individual(np.array([0]), problem=problem))
pop.append(Individual(np.array([1]), problem=problem))
pop = Individual.evaluate_population(pop)
# First *normal* selection should yield the 0 as the "best"
best = ops.truncation_selection(pop, size=1)
assert pop[0] == best[0]
# But now let's set that best to a NaN, which *should* force the other
# individual to be selected.
pop[0].fitness = nan
best = ops.truncation_selection(pop, size=1)
assert pop[1] == best[0]
##############################
# Tests for tournament_selection()
##############################
@pytest.mark.stochastic
def test_tournament_selection1():
"""If there are just two individuals in the population, then binary tournament
selection will select the better one with 75% probability."""
# Make a population where binary tournament_selection has an obvious
# reproducible choice
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# Assign a unique identifier to each individual
pop[0].id = 0
pop[1].id = 1
# We first need to evaluate all the individuals so that
# selection has fitnesses to compare
pop = Individual.evaluate_population(pop)
selected = ops.tournament_selection(pop)
N = 1000
p_thresh = 0.1
observed_dist = statistical_helpers.collect_distribution(lambda: next(selected).id, samples=N)
expected_dist = { pop[0].id: 0.25*N, pop[1].id: 0.75*N }
print(f"Observed: {observed_dist}")
print(f"Expected: {expected_dist}")
assert(statistical_helpers.stochastic_equals(expected_dist, observed_dist, p=p_thresh))
@pytest.mark.stochastic
def test_tournament_selection2():
"""If there are just two individuals in the population, and we set select_worst=True,
then binary tournament selection will select the worse one with 75% probability."""
# Make a population where binary tournament_selection has an obvious
# reproducible choice
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# Assign a unique identifier to each individual
pop[0].id = 0
pop[1].id = 1
# We first need to evaluate all the individuals so that
# selection has fitnesses to compare
pop = Individual.evaluate_population(pop)
selected = ops.tournament_selection(pop, select_worst=True)
N = 1000
p_thresh = 0.1
observed_dist = statistical_helpers.collect_distribution(lambda: next(selected).id, samples=N)
expected_dist = { pop[0].id: 0.75*N, pop[1].id: 0.25*N }
print(f"Observed: {observed_dist}")
print(f"Expected: {expected_dist}")
assert(statistical_helpers.stochastic_equals(expected_dist, observed_dist, p=p_thresh))
def test_tournament_selection_indices():
"""If an empty list is provided to tournament selection, it should be populated with
the index of the selected individual.
If we select a second individual, the list should be cleared and populated with the
index of the second individual."""
pop = test_population
indices = []
op = ops.tournament_selection(indices=indices)
# Select an individual
s = next(op(pop))
# Ensure the returned index is correct
assert(len(indices) == 1)
idx = indices[0]
assert(idx >= 0)
assert(idx < len(pop))
assert(pop[idx] is s)
# Select another individual
s = next(op(pop))
# Ensure the returned index is correct
assert(len(indices) == 1)
idx = indices[0]
assert(idx >= 0)
assert(idx < len(pop))
assert(pop[idx] is s)
##############################
# Tests for random_selection()
##############################
@pytest.mark.stochastic
def test_random_selection1():
"""If there are just two individuals in the population, then random
selection will select the better one with 50% probability."""
pop = [Individual(np.array([0, 0, 0]), problem=MaxOnes()),
Individual(np.array([1, 1, 1]), problem=MaxOnes())]
# Assign a unique identifier to each individual
pop[0].id = 0
pop[1].id = 1
# We first need to evaluate all the individuals so that
# selection has fitnesses to compare
pop = Individual.evaluate_population(pop)
selected = ops.random_selection(pop)
N = 1000
p_thresh = 0.1
observed_dist = statistical_helpers.collect_distribution(lambda: next(selected).id, samples=N)
expected_dist = { pop[0].id: 0.5*N, pop[1].id: 0.5*N }
print(f"Observed: {observed_dist}")
print(f"Expected: {expected_dist}")
assert(statistical_helpers.stochastic_equals(expected_dist, observed_dist, p=p_thresh))
def test_random_selection_indices():
"""If an empty list is provided to random selection, it should be populated with
the index of the selected individual.
If we select a second individual, the list should be cleared and populated with the
index of the second individual."""
pop = test_population
indices = []
op = ops.random_selection(indices=indices)
# Select an individual
s = next(op(pop))
# Ensure the returned index is correct
assert(len(indices) == 1)
idx = indices[0]
assert(idx >= 0)
assert(idx < len(pop))
assert(pop[idx] is s)
# Select another individual
s = next(op(pop))
# Ensure the returned index is correct
assert(len(indices) == 1)
idx = indices[0]
assert(idx >= 0)
assert(idx < len(pop))
assert(pop[idx] is s)
| 35.373737 | 108 | 0.663906 | 2,836 | 21,012 | 4.843089 | 0.102609 | 0.010775 | 0.051984 | 0.053003 | 0.80466 | 0.773062 | 0.750273 | 0.732508 | 0.72763 | 0.705133 | 0 | 0.022871 | 0.209261 | 21,012 | 593 | 109 | 35.43339 | 0.803792 | 0.342519 | 0 | 0.7 | 0 | 0 | 0.020221 | 0 | 0 | 0 | 0 | 0 | 0.206897 | 1 | 0.082759 | false | 0 | 0.031034 | 0 | 0.12069 | 0.034483 | 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 |
39a06336e8ca04a247b0fe30fb5ab3a5c0dd8996 | 229 | py | Python | main/PluginDemos/connectivity_global_fast/Simulation/connectivity_global_fast.py | JulianoGianlupi/nh-cc3d-4x-base-tool | c0f4aceebd4c5bf3ec39e831ef851e419b161259 | [
"CC0-1.0"
] | null | null | null | main/PluginDemos/connectivity_global_fast/Simulation/connectivity_global_fast.py | JulianoGianlupi/nh-cc3d-4x-base-tool | c0f4aceebd4c5bf3ec39e831ef851e419b161259 | [
"CC0-1.0"
] | null | null | null | main/PluginDemos/connectivity_global_fast/Simulation/connectivity_global_fast.py | JulianoGianlupi/nh-cc3d-4x-base-tool | c0f4aceebd4c5bf3ec39e831ef851e419b161259 | [
"CC0-1.0"
] | 1 | 2021-02-26T21:50:29.000Z | 2021-02-26T21:50:29.000Z | from cc3d import CompuCellSetup
from connectivity_global_fastSteppables import connectivity_global_fastSteppable
CompuCellSetup.register_steppable(steppable=connectivity_global_fastSteppable(frequency=1))
CompuCellSetup.run()
| 28.625 | 91 | 0.899563 | 23 | 229 | 8.652174 | 0.565217 | 0.271357 | 0.311558 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009259 | 0.056769 | 229 | 7 | 92 | 32.714286 | 0.912037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 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 |
39a9bf478c6361d5d109e7383e1d1532b484b5fa | 1,657 | py | Python | datacode/summarize/subset/missing/detail/textfuncs.py | nickderobertis/data-code | b4649a1702ccd6b68995e58cc53d74544ff34294 | [
"MIT"
] | null | null | null | datacode/summarize/subset/missing/detail/textfuncs.py | nickderobertis/data-code | b4649a1702ccd6b68995e58cc53d74544ff34294 | [
"MIT"
] | 44 | 2020-02-01T03:28:59.000Z | 2022-03-12T00:35:17.000Z | datacode/summarize/subset/missing/detail/textfuncs.py | nickderobertis/data-code | b4649a1702ccd6b68995e58cc53d74544ff34294 | [
"MIT"
] | 1 | 2021-08-09T11:10:57.000Z | 2021-08-09T11:10:57.000Z | from datacode.typing import IntOrNone, FloatOrNone, Union
def missing_more_than_str(missing_tolerance: IntOrNone, missing_quantile: FloatOrNone,
missing_display_str: str, id_var: str) -> str:
return f'More than {_t_or_q(missing_tolerance, missing_quantile)} {missing_display_str} {id_var}'
def missing_more_than_pct_str(missing_tolerance: IntOrNone, missing_quantile: FloatOrNone,
missing_display_str: str, id_var: str) -> str:
return f'More than {_t_or_q(missing_tolerance, missing_quantile)} {missing_display_str} {id_var} Percentage'
def missing_tolerance_count_str(missing_tolerance: IntOrNone, missing_quantile: FloatOrNone,
missing_display_str: str, id_var: str) -> str:
return f'{_t_or_q(missing_tolerance, missing_quantile)} or less {missing_display_str} {id_var} Count'
def id_count_str(id_var: str) -> str:
return f'{id_var} Count'
def num_or_pct(missing_tolerance: IntOrNone, missing_quantile: FloatOrNone) -> str:
if missing_quantile is not None:
return '%'
return '#'
def num_or_pct_word(missing_tolerance: IntOrNone, missing_quantile: FloatOrNone) -> str:
if missing_quantile is not None:
return 'percentage'
return 'number'
def pct_of_if_necessary(missing_tolerance: IntOrNone, missing_quantile: FloatOrNone) -> str:
if missing_quantile is not None:
return '% of'
return ''
def _t_or_q(missing_tolerance: IntOrNone, missing_quantile: FloatOrNone) -> Union[int, str]:
if missing_quantile is not None:
return f'{missing_quantile * 100:g}%'
return missing_tolerance | 41.425 | 112 | 0.72239 | 218 | 1,657 | 5.133028 | 0.174312 | 0.201072 | 0.15639 | 0.200179 | 0.743521 | 0.720286 | 0.67471 | 0.624665 | 0.593387 | 0.593387 | 0 | 0.002239 | 0.19131 | 1,657 | 40 | 113 | 41.425 | 0.832836 | 0 | 0 | 0.25 | 0 | 0 | 0.204463 | 0.086852 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.035714 | 0.142857 | 0.75 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
39a9e0220c9082d6ffae3648151d4c0946af5b9b | 161 | py | Python | lambdata/__init__.py | kevmanning/lambdata-dspt11 | 6f7e0d80d9bd3e698c4443f786dc0765ce3e1f6e | [
"MIT"
] | null | null | null | lambdata/__init__.py | kevmanning/lambdata-dspt11 | 6f7e0d80d9bd3e698c4443f786dc0765ce3e1f6e | [
"MIT"
] | null | null | null | lambdata/__init__.py | kevmanning/lambdata-dspt11 | 6f7e0d80d9bd3e698c4443f786dc0765ce3e1f6e | [
"MIT"
] | null | null | null | """collection of data science helper functions"""
import pandas
import numpy
def df_cleanser(df):
"""cleans dataframe"""
# TODO - implement
pass
| 13.416667 | 49 | 0.677019 | 19 | 161 | 5.684211 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.217391 | 161 | 11 | 50 | 14.636364 | 0.857143 | 0.484472 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0 | 1 | 0.25 | false | 0.25 | 0.5 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 6 |
39c720ead49987060b7be70bdd2007dc09c7b171 | 24 | py | Python | netforce_sale/netforce_sale/controllers/__init__.py | nfco/netforce | 35252eecd0a6633ab9d82162e9e3ff57d4da029a | [
"MIT"
] | 27 | 2015-09-30T23:53:30.000Z | 2021-06-07T04:56:25.000Z | netforce_sale/netforce_sale/controllers/__init__.py | nfco/netforce | 35252eecd0a6633ab9d82162e9e3ff57d4da029a | [
"MIT"
] | 191 | 2015-10-08T11:46:30.000Z | 2019-11-14T02:24:36.000Z | netforce_sale/netforce_sale/controllers/__init__.py | nfco/netforce | 35252eecd0a6633ab9d82162e9e3ff57d4da029a | [
"MIT"
] | 32 | 2015-10-01T03:59:43.000Z | 2022-01-13T07:31:05.000Z | from . import view_quot
| 12 | 23 | 0.791667 | 4 | 24 | 4.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 24 | 1 | 24 | 24 | 0.9 | 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 |
844125889fb1cacf63c605be69a756b750060f16 | 209 | py | Python | soundfleet/accounts/admin.py | Soundfleet/soundfleet | d2d8a6ac875372884e6494d618c54613f2fcd725 | [
"BSD-3-Clause"
] | null | null | null | soundfleet/accounts/admin.py | Soundfleet/soundfleet | d2d8a6ac875372884e6494d618c54613f2fcd725 | [
"BSD-3-Clause"
] | null | null | null | soundfleet/accounts/admin.py | Soundfleet/soundfleet | d2d8a6ac875372884e6494d618c54613f2fcd725 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from . import models
class UserAdmin(BaseUserAdmin):
pass
admin.site.register(models.User, UserAdmin)
| 17.416667 | 64 | 0.799043 | 27 | 209 | 6.185185 | 0.555556 | 0.11976 | 0.203593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133971 | 209 | 11 | 65 | 19 | 0.922652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.166667 | 0.5 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 6 |
8457478a367755818c76020b5d847b1448d9bcad | 27,238 | py | Python | ownership/test_views.py | Duke-GCB/D4S2 | 47bef4b632967440608f2cc7a3fc31c32b2060fa | [
"MIT"
] | null | null | null | ownership/test_views.py | Duke-GCB/D4S2 | 47bef4b632967440608f2cc7a3fc31c32b2060fa | [
"MIT"
] | 138 | 2016-09-23T18:09:18.000Z | 2022-03-03T15:50:19.000Z | ownership/test_views.py | Duke-GCB/D4S2 | 47bef4b632967440608f2cc7a3fc31c32b2060fa | [
"MIT"
] | null | null | null | import uuid
from django.core.urlresolvers import reverse
from rest_framework import status
from django.test.testcases import TestCase
from ownership.views import MISSING_TRANSFER_ID_MSG, TRANSFER_ID_NOT_FOUND, REASON_REQUIRED_MSG, NOT_RECIPIENT_MSG
from switchboard.dds_util import SHARE_IN_RESPONSE_TO_DELIVERY_MSG
from ownership.views import DDSDeliveryType, S3DeliveryType, S3NotRecipientException, DDSNotRecipientException, \
DataServiceError, S3Exception
from d4s2_api.models import DDSDelivery, S3Delivery, State, ShareRole, EmailTemplateSet, UserEmailTemplateSet, \
EmailTemplate, EmailTemplateType
from d4s2_api.utils import MessageDirection
from switchboard.mocks_ddsutil import MockDDSUser
from django.contrib.auth.models import User as django_user
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from mock import patch, Mock, call, ANY
def url_with_transfer_id(name, transfer_id=None):
url = reverse(name)
if transfer_id:
url = "{}?transfer_id={}".format(url, transfer_id)
return url
def setup_mock_delivery_details(MockDeliveryDetails):
x = MockDeliveryDetails()
x.get_from_user.return_value = MockDDSUser('joe', 'joe@joe.com')
x.get_to_user.return_value = MockDDSUser('bob', 'bob@joe.com')
x.get_action_template_text.return_value = ('Action Subject Template {{ project_name }}',
'Action Body Template {{ recipient_name }}, Action User Message {{ user_message }}')
x.get_share_template_text.return_value = ('Share Subject Template {{ project_name }}',
'Share Body Template {{ recipient_name }}, Share User Message {{ user_message }}')
x.get_email_context.return_value = {
'project_name': 'project',
'recipient_name': 'bob',
'recipient_email': 'bob@joe.com',
'sender_email': 'joe@joe.com',
'sender_name': 'joe',
'project_url': 'http://example.com/project-url',
'accept_url': '',
'type': 'accept',
'message': '',
'user_message': 'msg',
'warning_message': '',
}
x.get_context.return_value = {'transfer_id':'abc123'}
return x
def setup_mock_delivery_type(mock_get_delivery_type):
mock_delivery_type = mock_get_delivery_type.return_value
mock_delivery_type.name = 'mock'
mock_delivery_type.delivery_cls = DDSDelivery
mock_delivery_type.make_delivery_details.return_value = setup_mock_delivery_details(Mock())
# Convenience for tests to assign return values without .return_value.return_value
mock_delivery_type.mock_delivery_details = mock_delivery_type.make_delivery_details.return_value
mock_delivery_type.mock_delivery_util = mock_delivery_type.make_delivery_util.return_value
mock_delivery_type.mock_processed_message = mock_delivery_type.make_processed_message.return_value
return mock_delivery_type
class AuthenticatedTestCase(TestCase):
def setUp(self):
username = 'ownership_user'
password = 'secret'
self.user = django_user.objects.create_user(username, password=password)
self.client.login(username=username, password=password)
self.email_template_set = EmailTemplateSet.objects.create(name='someset')
self.user_email_template_set = UserEmailTemplateSet.objects.create(user=self.user, email_template_set=self.email_template_set)
def create_delivery(self):
return DDSDelivery.objects.create(project_id='project1', from_user_id='fromuser1',
to_user_id='touser1', transfer_id='abc123',
email_template_set=self.email_template_set)
def create_delivery_get_transfer_id(self):
delivery = self.create_delivery()
return str(delivery.transfer_id)
class AcceptTestCase(AuthenticatedTestCase):
def test_redirects_for_login(self):
self.client.logout()
url = url_with_transfer_id('ownership-prompt', 'transfer-id')
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_302_FOUND)
self.assertIn('login', response['Location'])
def test_error_when_no_transfer_id(self):
url = url_with_transfer_id('ownership-prompt')
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(MISSING_TRANSFER_ID_MSG, str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_normal_with_valid_transfer_id(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = DDSDelivery.objects.get(
transfer_id=transfer_id)
url = url_with_transfer_id('ownership-prompt', transfer_id)
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertNotIn(MISSING_TRANSFER_ID_MSG, str(response.content))
self.assertIn(transfer_id, str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_normal_with_s3_not_recipient_exception(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
url = url_with_transfer_id('ownership-prompt', transfer_id)
mock_get_delivery_type.return_value.make_delivery_details.side_effect = S3NotRecipientException()
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertIn(NOT_RECIPIENT_MSG, str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_normal_with_dds_not_recipient_exception(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
url = url_with_transfer_id('ownership-prompt', transfer_id)
mock_get_delivery_type.return_value.make_delivery_details.side_effect = DDSNotRecipientException()
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertIn(NOT_RECIPIENT_MSG, str(response.content))
def test_with_transfer_id_not_found(self):
transfer_id = str(uuid.uuid4())
url = url_with_transfer_id('ownership-prompt', transfer_id)
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertIn(TRANSFER_ID_NOT_FOUND, str(response.content))
def test_post_not_allowed(self):
url = url_with_transfer_id('ownership-prompt')
response = self.client.post(url)
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
class ProcessTestCase(AuthenticatedTestCase):
def test_redirects_for_login(self):
self.client.logout()
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': 'transfer-id'})
self.assertEqual(response.status_code, status.HTTP_302_FOUND)
self.assertIn('login', response['Location'])
def test_error_when_no_transfer_id(self):
transfer_id = self.create_delivery_get_transfer_id()
url = url_with_transfer_id('ownership-process')
response = self.client.post(url)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(MISSING_TRANSFER_ID_MSG, str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_normal_with_transfer_id_is_redirect(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
mock_delivery_type.transfer_delivery.return_value = 'Failed to share with Joe, Tom'
mock_delivery_type.mock_processed_message.email_text = 'email text'
delivery = self.create_delivery()
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
transfer_id = delivery.transfer_id
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id})
expected_warning_message = urlencode({'transfer_id': transfer_id, 'warning_message': 'Failed to share with Joe, Tom', 'delivery_type': 'mock'})
expected_url = reverse('ownership-accepted') + '?' + expected_warning_message
self.assertRedirects(response, expected_url)
self.assertNotIn(MISSING_TRANSFER_ID_MSG, str(response.content))
self.assertTrue(mock_delivery_type.transfer_delivery.called)
def test_with_bad_transfer_id(self):
transfer_id = self.create_delivery_get_transfer_id() + "a"
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id})
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertIn(TRANSFER_ID_NOT_FOUND, str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_accept_with_already_declined(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
delivery.mark_declined('user', 'Done', 'email text')
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
transfer_id = delivery.transfer_id
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id})
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(State.DELIVERY_CHOICES[State.DECLINED][1], str(response.content))
self.assertFalse(mock_delivery_type.mock_delivery_util.accept_project_transfer.called)
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_accept_when_transfer_fails_with_data_service_error(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
mock_delivery_type.transfer_delivery.side_effect = DataServiceError(
response=Mock(status_code=403),
url_suffix="", request_data=Mock())
transfer_id = delivery.transfer_id
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id})
self.assertEqual(response.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR)
self.assertIn('Unable to transfer ownership: Error 403', str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_accept_when_transfer_fails_with_s3_error(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
mock_delivery_type.transfer_delivery.side_effect = S3Exception()
transfer_id = delivery.transfer_id
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id})
self.assertEqual(response.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR)
self.assertIn('Unable to transfer s3 ownership', str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_accept_with_already_accepted(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
delivery.mark_accepted('user', 'email text')
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': delivery.transfer_id})
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(State.DELIVERY_CHOICES[State.ACCEPTED][1], str(response.content))
self.assertFalse(mock_delivery_type.mock_delivery_util.accept_project_transfer.called)
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_normal_with_decline(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = DDSDelivery.objects.get(
transfer_id=transfer_id)
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id, 'decline':'decline'}, follow=True)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('reason for declining delivery', str(response.content))
self.assertFalse(mock_delivery_type.mock_delivery_util.accept_project_transfer.called)
def test_get_not_allowed(self):
url = url_with_transfer_id('ownership-process')
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
@patch('switchboard.dds_util.DDSUtil', autospec=True)
@patch('switchboard.dds_util.DDSProjectTransfer', autospec=True)
@patch('d4s2_api.utils.Message', autospec=True)
def test_receiving_user_can_accept_deliveries_without_email_template_set(self, mock_message,
mock_dds_project_transfer, mock_dds_util):
mock_dds_project_transfer.fetch_one.return_value.project_dict = {'name': 'MouseRNA'}
mock_message.return_value.email_text = ''
# accepting/current user should have not email template setup
self.user_email_template_set.delete()
# a template set is specified when the delivery was created
sending_user = django_user.objects.create_user('sender', password='senderpass')
sender_email_template_set = EmailTemplateSet.objects.create(name='group1')
EmailTemplate.objects.create(template_set=sender_email_template_set,
owner=sending_user,
template_type=EmailTemplateType.objects.get(name='accepted'),
subject='Subject1',
body='email body1')
EmailTemplate.objects.create(template_set=sender_email_template_set,
owner=sending_user,
template_type=EmailTemplateType.objects.get(name='accepted_recipient'),
subject='Subject2',
body='email body2')
delivery = DDSDelivery.objects.create(
project_id='project1', from_user_id='fromuser1',
to_user_id='touser1', transfer_id='abc123',
email_template_set=sender_email_template_set)
transfer_id = delivery.transfer_id
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id}, follow=True)
self.assertEqual(response.status_code, status.HTTP_200_OK)
delivery.refresh_from_db()
self.assertEqual(delivery.state, State.ACCEPTED)
self.assertEqual(delivery.project_name, 'MouseRNA')
@patch('switchboard.dds_util.DDSUtil', autospec=True)
@patch('switchboard.dds_util.DDSProjectTransfer', autospec=True)
@patch('d4s2_api.utils.Message', autospec=True)
def test_delivery_emails_always_use_senders_email_template_set(self, mock_message, mock_dds_project_transfer,
mock_dds_util):
mock_dds_project_transfer.fetch_one.return_value.project_dict = {'name': 'MouseRNA'}
mock_message.return_value.email_text = ''
# a template set is specified when the delivery was created
sending_user = django_user.objects.create_user('sender', password='senderpass')
sender_email_template_set = EmailTemplateSet.objects.create(name='group1')
sender_template1 = EmailTemplate.objects.create(template_set=sender_email_template_set,
owner=sending_user,
template_type=EmailTemplateType.objects.get(name='accepted'),
subject='Subject1',
body='email body2')
sender_template2 = EmailTemplate.objects.create(template_set=sender_email_template_set,
owner=sending_user,
template_type=EmailTemplateType.objects.get(
name='accepted_recipient'),
subject='Subject2',
body='email body2')
delivery = DDSDelivery.objects.create(
project_id='project1', from_user_id='fromuser1',
to_user_id='touser1', transfer_id='abc123',
email_template_set=sender_email_template_set)
transfer_id = delivery.transfer_id
url = reverse('ownership-process')
response = self.client.post(url, {'transfer_id': transfer_id}, follow=True)
self.assertEqual(response.status_code, status.HTTP_200_OK)
# check that the sender template subject/body was used to render the email
self.assertEqual(mock_message.mock_calls, [
call(ANY, ANY, sender_template1.subject, sender_template1.body, ANY, None),
call(ANY, ANY, sender_template2.subject, sender_template2.body, ANY, None),
call().send(),
call().send(),
])
class DeclineGetTestCase(AuthenticatedTestCase):
def test_redirects_for_login(self):
self.client.logout()
url = reverse('ownership-decline')
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_302_FOUND)
self.assertIn('login', response['Location'])
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_get_with_already_accepted(self,mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
delivery.mark_accepted('user', 'email text')
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
url = reverse('ownership-decline')
response = self.client.get(url, {'transfer_id': delivery.transfer_id})
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(State.DELIVERY_CHOICES[State.ACCEPTED][1], str(response.content))
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_get_with_already_declined(self,mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
delivery.mark_declined('user', 'Done', 'email text')
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
url = reverse('ownership-decline')
response = self.client.get(url, {'transfer_id': delivery.transfer_id})
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(State.DELIVERY_CHOICES[State.DECLINED][1], str(response.content))
class DeclinePostTestCase(AuthenticatedTestCase):
def test_redirects_for_login(self):
self.client.logout()
url = reverse('ownership-decline')
response = self.client.post(url)
self.assertEqual(response.status_code, status.HTTP_302_FOUND)
self.assertIn('login', response['Location'])
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_cancel_decline(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
url = reverse('ownership-decline')
response = self.client.post(url, {'transfer_id': transfer_id, 'cancel': 'cancel'})
self.assertEqual(response.status_code, status.HTTP_302_FOUND)
expected_url = reverse('ownership-prompt')
self.assertIn(expected_url, response.url)
self.assertFalse(mock_delivery_type.mock_delivery_util.accept_project_transfer.called)
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_confirm_decline(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
mock_delivery_type.mock_processed_message.email_text = 'email text'
transfer_id = self.create_delivery_get_transfer_id()
delivery = DDSDelivery.objects.get(transfer_id=transfer_id)
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
url = reverse('ownership-decline')
response = self.client.post(url, {'transfer_id': transfer_id, 'decline_reason':'Wrong person.'}, follow=True)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('has been declined', str(response.content))
self.assertTrue(mock_delivery_type.mock_delivery_util.decline_delivery.called)
self.assertTrue(mock_delivery_type.make_processed_message.called)
mock_delivery_type.make_processed_message.assert_called_with(
delivery, ANY, 'declined', MessageDirection.ToSender, 'Reason: Wrong person.'
)
self.assertTrue(mock_delivery_type.mock_processed_message.send.called)
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_decline_with_blank(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = DDSDelivery.objects.get(
transfer_id=transfer_id)
url = reverse('ownership-decline')
response = self.client.post(url, {'transfer_id': transfer_id, 'decline_reason': ''})
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(REASON_REQUIRED_MSG, str(response.content))
self.assertFalse(mock_delivery_type.mock_delivery_util.decline_delivery.called)
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_decline_with_already_declined(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
delivery.mark_declined('user', 'Done', 'email text')
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
transfer_id = delivery.transfer_id
url = reverse('ownership-decline')
response = self.client.post(url, {'transfer_id': transfer_id, 'decline_reason': 'Wrong person.'})
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(State.DELIVERY_CHOICES[State.DECLINED][1], str(response.content))
self.assertFalse(mock_delivery_type.mock_delivery_util.decline_delivery.called)
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_decline_with_already_accepted(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
delivery = self.create_delivery()
delivery.mark_accepted('user','email type')
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = delivery
transfer_id = delivery.transfer_id
url = reverse('ownership-decline')
response = self.client.post(url, {'transfer_id': transfer_id, 'decline_reason': 'Wrong person.'})
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn(State.DELIVERY_CHOICES[State.ACCEPTED][1], str(response.content))
self.assertFalse(mock_delivery_type.mock_delivery_util.decline_delivery.called)
class AcceptedPageTestCase(AuthenticatedTestCase):
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_renders_accepted_page_with_project_url(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = DDSDelivery.objects.get(
transfer_id=transfer_id)
url = reverse('ownership-accepted')
response = self.client.get(url, {'transfer_id': transfer_id})
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('View this data', str(response.content))
def test_renders_error_with_bad_transfer_id(self):
url = reverse('ownership-accepted')
response = self.client.get(url, {'transfer_id': 'garbage'})
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_post_not_allowed(self):
url = url_with_transfer_id('ownership-accepted')
response = self.client.post(url)
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
class DeclinedPageTestCase(AuthenticatedTestCase):
@patch('ownership.views.DeliveryViewBase.get_delivery_type')
def test_renders_declined_page_with_project_url(self, mock_get_delivery_type):
mock_delivery_type = setup_mock_delivery_type(mock_get_delivery_type)
transfer_id = self.create_delivery_get_transfer_id()
mock_delivery_type.mock_delivery_details.from_transfer_id.return_value.get_delivery.return_value = DDSDelivery.objects.get(
transfer_id=transfer_id)
url = reverse('ownership-declined')
response = self.client.get(url, {'transfer_id': transfer_id})
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('has been declined', str(response.content))
def test_renders_error_with_bad_transfer_id(self):
url = reverse('ownership-declined')
response = self.client.get(url, {'transfer_id': 'garbage'})
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_post_not_allowed(self):
url = url_with_transfer_id('ownership-declined')
response = self.client.post(url)
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
| 56.27686 | 151 | 0.719436 | 3,252 | 27,238 | 5.652522 | 0.076568 | 0.081602 | 0.067893 | 0.051137 | 0.822272 | 0.811609 | 0.792242 | 0.782015 | 0.772604 | 0.766184 | 0 | 0.007519 | 0.189441 | 27,238 | 483 | 152 | 56.393375 | 0.825075 | 0.012079 | 0 | 0.635266 | 0 | 0 | 0.124559 | 0.04007 | 0 | 0 | 0 | 0 | 0.183575 | 1 | 0.096618 | false | 0.012077 | 0.036232 | 0.002415 | 0.161836 | 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 |
ffe06aa86e3a06dcf73541a692851e853ca40f17 | 4,101 | py | Python | error_solver/solvers/error_solver_test.py | line-mind/error_solver | 472d086157e49cbe3e7d5b3278ddee6792cf676b | [
"BSD-3-Clause"
] | null | null | null | error_solver/solvers/error_solver_test.py | line-mind/error_solver | 472d086157e49cbe3e7d5b3278ddee6792cf676b | [
"BSD-3-Clause"
] | 5 | 2018-12-22T20:59:42.000Z | 2019-06-04T22:10:08.000Z | error_solver/solvers/error_solver_test.py | mpewsey/error_solver | 472d086157e49cbe3e7d5b3278ddee6792cf676b | [
"BSD-3-Clause"
] | null | null | null | import os
import time
import pytest
from ..data import get_file_path
from .error_solver import *
def test_repr():
path = get_file_path('wire_load.ef')
solver = ErrorSolver.from_file(path)
repr(solver)
def test_from_file():
path = get_file_path('wire_load.ef')
solver = ErrorSolver.from_file(path)
assert len(solver.get_equations()) == 4
assert len(solver.get_partials()) == 4
def test_get_equations():
path = get_file_path('wire_load.ef')
solver = ErrorSolver.from_file(path)
assert len(solver.get_equations('wind_pressure')) == 3
assert len(solver.get_equations('wind_velocity')) == 4
def test_get_partials():
path = get_file_path('wire_load.ef')
solver = ErrorSolver.from_file(path)
assert len(solver.get_partials('wind_pressure')) == 3
assert len(solver.get_partials('wind_velocity')) == 4
def test_check_determinancy1():
path = get_file_path('cylinder.ef')
solver = ErrorSolver.from_file(path)
values = {
'height': 12,
'radius': 5,
'area': 78.539816,
'volume': 942.477796
}
errors = {
'height': 0.05,
}
with pytest.raises(ValueError):
solver.solve(values, errors)
def test_check_determinancy2():
path = get_file_path('cylinder.ef')
solver = ErrorSolver.from_file(path)
values = {
'height': 12,
'radius': 5,
'area': 78.539816,
'volume': 942.477796
}
errors = {
'height': 0.05,
'radius': 0.05,
'area': 0.05,
}
with pytest.raises(ValueError):
solver.solve(values, errors)
def test_solve1():
path = get_file_path('cylinder.ef')
solver = ErrorSolver.from_file(path)
values = {
'height': 12,
'radius': 5,
'area': 78.539816,
'volume': 942.477796
}
errors = {
'height': 0.05,
'radius': 0.05
}
df = solver.solve(values, errors)
assert pytest.approx(df['value']['volume'], 0.01) == 942.477796
assert pytest.approx(df['error']['volume'], 0.01) == 22.78
assert pytest.approx(df['pct_error']['volume'], 0.01) == 2.42
assert df['is_calc']['volume'] == True
def test_solve2():
path = get_file_path('cylinder.ef')
solver = ErrorSolver.from_file(path)
values = {
'height': 12,
'radius': 5,
'area': 78.539816,
'volume': 942.477796
}
errors = {
'height': 0.05,
'radius': 0.05
}
const = {
'height': 0
}
df = solver.solve(values, errors, const)
assert pytest.approx(df['value']['volume'], 0.01) == 942.477796
assert pytest.approx(df['error']['volume'], 0.01) == 22.78
assert pytest.approx(df['pct_error']['volume'], 0.01) == 2.42
assert df['is_calc']['volume'] == True
def test_write_python():
path = get_file_path('wire_load.ef')
solver = ErrorSolver.from_file(path)
path = get_file_path('_wire_load_test_mod.py')
solver.write_python(path)
time.sleep(3)
assert os.path.exists(path)
os.remove(path)
def test_bad_values():
path = get_file_path('cylinder.ef')
solver = ErrorSolver.from_file(path)
values = {
'height': 12,
'radius': 5,
'area': 78.539816,
'volume': 900
}
errors = {
'height': 0.05,
'radius': 0.05
}
with pytest.raises(ValueError):
solver.solve(values, errors)
def test_missing_values():
path = get_file_path('cylinder.ef')
solver = ErrorSolver.from_file(path)
values = {
'height': 12,
'radius': 5,
'area': 78.539816,
}
errors = {
'height': 0.05,
'radius': 0.05
}
with pytest.raises(ValueError):
solver.solve(values, errors)
def test_restricted_symbols():
equations = [
'V = I * R'
]
values = {
'I': 1,
'R': 2,
'V': 2,
}
errors = {
'I': 0.05,
'R': 0.05,
}
solver = ErrorSolver(equations)
with pytest.raises(ValueError):
solver.solve(values, errors)
| 20.505 | 67 | 0.576689 | 510 | 4,101 | 4.47451 | 0.154902 | 0.087642 | 0.062664 | 0.078878 | 0.825153 | 0.777826 | 0.753287 | 0.726117 | 0.704645 | 0.704645 | 0 | 0.070998 | 0.271885 | 4,101 | 199 | 68 | 20.60804 | 0.693235 | 0 | 0 | 0.589041 | 0 | 0 | 0.125823 | 0.005365 | 0 | 0 | 0 | 0 | 0.10274 | 1 | 0.082192 | false | 0 | 0.034247 | 0 | 0.116438 | 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 |
08173733b6dade43d978daa4e42c8e520137deb2 | 30 | py | Python | aipack/__init__.py | heewinkim/aipack | df2ff6db0ede07b5e5a779b2679841e34f2e0f10 | [
"Apache-2.0"
] | 1 | 2020-10-20T01:31:38.000Z | 2020-10-20T01:31:38.000Z | aipack/__init__.py | heewinkim/aipack | df2ff6db0ede07b5e5a779b2679841e34f2e0f10 | [
"Apache-2.0"
] | 5 | 2020-09-25T22:15:45.000Z | 2022-02-10T01:58:10.000Z | aipack/__init__.py | heewinkim/aipack | df2ff6db0ede07b5e5a779b2679841e34f2e0f10 | [
"Apache-2.0"
] | null | null | null | from .tf import TensorflowPack | 30 | 30 | 0.866667 | 4 | 30 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 30 | 1 | 30 | 30 | 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 |
083c56a67040a6b88ccf87ddf916112833dbbae1 | 28,832 | py | Python | adlibre_tms/apps/tms/tests/__init__.py | adlibre/Adlibre-TMS | 4c8de1e4448203fb267d38ec0f4ec9e64d58a21d | [
"BSD-3-Clause"
] | 26 | 2015-01-06T11:09:18.000Z | 2022-03-16T06:20:53.000Z | adlibre_tms/apps/tms/tests/__init__.py | adlibre/Adlibre-TMS | 4c8de1e4448203fb267d38ec0f4ec9e64d58a21d | [
"BSD-3-Clause"
] | 4 | 2015-02-26T11:00:35.000Z | 2020-06-05T18:02:02.000Z | adlibre_tms/apps/tms/tests/__init__.py | adlibre/Adlibre-TMS | 4c8de1e4448203fb267d38ec0f4ec9e64d58a21d | [
"BSD-3-Clause"
] | 16 | 2015-02-08T05:24:38.000Z | 2021-06-13T14:45:30.000Z | from django.test import TestCase
import unittest
from django.test import Client
from test_settings import *
from helpers import *
from django.core.urlresolvers import reverse
from tms.forms import *
from tms.models import Timesheet, Expense, Job, Employee
from django_any import any_model
import datetime
from django.shortcuts import get_object_or_404
import reporting
class BasicAPPOk(unittest.TestCase):
"""
Test of app ability to run at all
"""
def setUp(self):
# Every test needs a client.
self.client = Client()
unittest.TestCase.setUp(self)
def test_app_has_no_errors(self):
help = """
Testing an app that it has no errors when
called main Url '/'
testing if Response 200.
"""
response = self.client.get('/', {})
self.failUnlessEqual(response.status_code, 200)
#print ''
#print 'BasicAPPOK test passed........................................................OK'
class Auth_Tests(TestCase):
"""
Bacic test of user login sequence functionality
"""
def setUp(self):
# Every test needs a client.
self.client = Client()
def test_login(self):
help = """
Testing an app login programmatically
- tests main login page loads with code 200
- tests POST to login url with test user data with code 302 and redirect to
tms.timesheets view
"""
#testing login page exist and works
response = self.client.get(reverse('auth_login'), {})
#print ('Login URL response code: '+str(response.status_code))
self.failUnlessEqual(response.status_code, 200)
self.client, response = client_login(self.client, callback=reverse('tms_timesheets'))
self.assertRedirects(response, 'http://testserver'+reverse('tms_timesheets'))
#print 'Login test passed.............................................................OK'
def test_logout(self):
help = """
Testing an app logout programmatically
- makes simple login with redirect to tms_timesheets' url
- tests a logout works
"""
#logging in
self.client, response = client_login(self.client, callback=reverse('tms_timesheets'))
self.assertRedirects(response, 'http://testserver'+reverse('tms_timesheets'))
#
#logout
response = self.client.get(reverse('auth_logout'))
self.failUnlessEqual(response.status_code, 200)
#print 'Logout test passed............................................................OK'
class TMSMainUrlsTest(TestCase):
def setUp(self):
"""
Test's init sequence.
- saves test data directly into model needed for tests
Creates random timesheet
"""
# Every test needs a client.
self.client = Client()
self.client, self.response = client_login(self.client, callback=reverse('tms_timesheets'))
self.datetime = datetime.datetime.now
self.user = new_test_user()
self.job_model = any_model(Job, is_active=True)
try:
self.employee = any_model(Employee, user = self.user)
except:
#employee with this user already exists
self.employee = Employee.objects.get(user=self.user)
self.timesheet1 = any_model(Timesheet,
employee=self.employee,
is_submitted=False,
is_billed=False,
comment='Django_tests comment for timesheet model1')
self.expense1 = any_model(Expense,
comment='Django_tests comment for expense model1')
def test_timesheets_render_data(self):
help = """
Tests for APP 'tms.views.timesheets' basic functiuonality:
- tries to log in
- checks tms.timesheets view returns response with code 200 (view url works)
- checks if response form exists
- checks if data can be saved to model
- checks response for test data from test's init model
"""
#print help
#checking if page loads ok
response = self.client.get(reverse('tms_timesheets'), {})
self.failUnlessEqual(response.status_code, 200)
#checking for Form exists in the context
self.assertContains(response, 'form')
self.failUnlessEqual(response.context['form'].initial, {})
#checking for test data inserted into context in context
self.assertContains(response, self.timesheet1.comment)
#print 'tms.timesheets render entries test passed..................................OK'
def test_timesheets_add_entry_with_form(self):
help = """
Tests for APP 'tms.views.timesheets' ADDING functiuonality:
- checks for ability to POST form data to view
- checks for view returns with code 200 and form with errors
in response to faulty form POST data
- checks for valid data posting to view.
Form should return a valid HttpResponse html data,
containing rendered current added entry
checked by part of unique string in entry
- checks it does not contain edit string
required to trigger AXAJ actions of replace
edited item on JavaScript side.
"""
#print help
# trying to post form data to view with bad POST data
# checking response contains form and
# error (form errors exist so it should have at least one)
response = self.client.post(reverse('tms_timesheets'), {
"job": '200',
"date_start_day": "8",
"date_start_yearmonth": "2011-9",
"date_start_datepicker": "",
"start_time_hour": "16",
"start_time_minute": "0",
"end_time_hour": "16",
"end_time_minute": "0",
"comment": "some test comment",
"save": "Save",
"data_id": "",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'form')
self.assertContains(response, 'error')
# testing valid data posting to view. Form should return
# a valid HttpResponse html data, containing rendered current added entry
# by part of unique string in entry
# checking it does not contain edit string
# required to trigger AXAJ actions on JavaScript side.
response = self.client.post(reverse('tms_timesheets'), {
"job": '1',
"date_start_day": "8",
"date_start_yearmonth": "2011-9",
"date_start_datepicker": "",
"start_time_hour": "16",
"start_time_minute": "0",
"end_time_hour": "16",
"end_time_minute": "0",
"comment": "some test comment",
"save": "Save",
"data_id": " ",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'return timesheet_editbtn_press')
self.assertNotContains(response, 'form')
self.assertNotContains(response, 'edited_item_returned')
#print 'tms.timesheets test passed.................................................OK'
def test_timesheets_edit_actions(self):
help = """
Tests for APP 'tms.views.timesheet' EDITING functiuonality:
- checks for a valid HttpResponse html data,
containing rendered current added entry
by part of unique string in entry
checking it contains edit string
required to trigger AXAJ EDIT actions on JavaScript side.
- testing invalid data posting to view.
View should return form with errors and 200 status
"""
#print help
#trying to access url of editing test database entry and get the form
response = self.client.get(reverse('tms_timesheets'), {})
self.failUnlessEqual(response.status_code, 200)
# checks for a valid HttpResponse html data,
# containing rendered current added entry
# by part of unique string in entry
# checking it contains edit string
# required to trigger AXAJ actions on JavaScript side.
response = self.client.post(reverse('tms_timesheets'), {
"job": '1',
"date_start_day": "8",
"date_start_yearmonth": "2011-9",
"date_start_datepicker": "",
"start_time_hour": "16",
"start_time_minute": "0",
"end_time_hour": "16",
"end_time_minute": "0",
"comment": "some test comment",
"save": "Save",
"data_id": "1",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'return timesheet_editbtn_press')
self.assertNotContains(response, 'form')
self.assertContains(response, 'edited_item_returned')
# testing invalid data posting to view.
# View should return form with errors and 200 status
response = self.client.post(reverse('tms_timesheets'), {
"job": '2000', #faulty job pk ID
"date_start_day": "8",
"date_start_yearmonth": "2011-9",
"date_start_datepicker": "",
"start_time_hour": "16",
"start_time_minute": "0",
"end_time_hour": "16",
"end_time_minute": "0",
"comment": "some test comment",
"save": "Save",
"data_id": "1",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'form')
self.assertContains(response, 'error')
#print 'tms.timesheets.edit test passed............................................OK'
def test_timesheet_del_urls(self):
help = """
Tests for APP 'tms.views.timesheet_del' DELETING functiuonality:
- tries to log in
- checks 'tms_timesheet_del' view returns response with code 400
- checks POST to this view returns code 400
- checks empty POST to this view returns 400 too
- checks post with variable returns 200 and desired model PK (for AJAX manipulations)
"""
#print help
#trying to access url of deleting test database entry
response = self.client.get(reverse('tms_timesheet_del'), {})
self.failUnlessEqual(response.status_code, 400)
# empty POST to this view returns 400 too
response = self.client.post(reverse('tms_timesheet_del'), {})
self.failUnlessEqual(response.status_code, 400)
# post with variable returns 200 and desired model PK (for AJAX manipulations)
response = self.client.post(reverse('tms_timesheet_del'), {'data_id': self.timesheet1.pk})
self.failUnlessEqual(response.content, str(self.timesheet1.pk))
#print 'tms.timesheet.del test passed...............................................OK'
# prohibited view... Does not need testing
# def test_timesheet_detail_urls(self):
# help = """
# Tests for APP 'tms.views.timesheet' basic functiuonality:
#
# - tries to log in
# - checks 'tms_timesheet_detail' view returns response with code 200
# - checks response for test data from test's init model
# - check for test model context in response
# """
# print help
# #testing detail view exists and running with code 200
# response = self.client.get(reverse('tms_timesheet_detail', args=[self.timesheet1.pk]), {})
# self.failUnlessEqual(response.status_code, 200)
#
# #check for test model context in response
# self.assertContains(response, self.timesheet1.comment)
# print 'tms.timesheet.details test passed...........................................OK'
def test_expenses_urls(self):
help = """
Tests for APP 'tms.views.expenses' basic functiuonality:
- tries to log in
- checks 'tms_expenses' view returns response with code 200
- checks POST to this view returns code 400
- checks empty POST to this view returns 400 too
- checks post with right variable returns 200 and redirect to new updated page
"""
#print help
#trying to access url of deleting test database entry
response = self.client.get(reverse('tms_expenses'), {})
self.failUnlessEqual(response.status_code, 200)
# faulty post to this page returns normal form/list page
response = self.client.post(reverse('tms_expenses'), {})
self.failUnlessEqual(response.status_code, 200)
#print 'tms.expenses test passed..................................................OK'
def test_expenses_form(self):
help = """
Tests for FORM 'expenses' working check:
- creates an instance of a form with specified test model
- tries to compare created instance to original model
"""
#print help
form = ExpenseForm(instance=self.expense1)
self.failUnlessEqual(form.instance.comment, self.expense1.comment)
#print 'tms.forms.expenses test passed...............................................OK'
def test_expenses_adding_new_entry_with_form(self):
help = """
Tests for APP 'tms.views.expenses' ADDING functiuonality:
- checks for ability to POST form data to view
- checks for view returns with code 200 and form with errors
in response to faulty form POST data
- checks for valid data posting to view.
Form should return a valid HttpResponse html data,
containing rendered current added entry
checked by part of unique string in entry template
- checks it does not contain edit string
required to trigger AXAJ actions of replace
edited item on JavaScript side.
"""
#print help
# trying to post form data to view with bad POST data
# checking response contains form and
# error (form errors exist so it should have at least one)
response = self.client.post(reverse('tms_expenses'), {
"currency": "2000", #Invalid form field
"expense_date_day": "8",
"expense_date_yearmonth": "2011-9",
"expense_date_datepicker": "",
"claim_date_day": "8",
"claim_date_yearmonth": "2011-9",
"claim_date_datepicker": "",
"customer": "1",
"expense_type": "1",
"comment": "some test comment test for expenses",
"is_receipted": "on",
"payment_method": "1",
"is_taxable": "on",
"expense_amount": "3345",
"tax_amount": "23",
"local_amount": "3346",
"save": "Save",
"data_id": "",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'form')
self.assertContains(response, 'error')
# testing valid data posting to view. Form should return
# a valid HttpResponse html data, containing rendered current added entry
# by part of unique string in entry
# checking it does not contain edit string
# required to trigger AXAJ actions on JavaScript side.
response = self.client.post(reverse('tms_expenses'), {
"currency": "1",
"expense_date_day": "8",
"expense_date_yearmonth": "2011-9",
"expense_date_datepicker": "",
"claim_date_day": "8",
"claim_date_yearmonth": "2011-9",
"claim_date_datepicker": "",
"customer": "1",
"expense_type": "1",
"comment": "some test comment test for expenses",
"is_receipted": "on",
"payment_method": "1",
"is_taxable": "on",
"expense_amount": "3345",
"tax_amount": "23",
"local_amount": "3346",
"save": "Save",
"data_id": "",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'return expense_editbtn_press')
self.assertNotContains(response, 'form')
self.assertNotContains(response, 'edited_item_returned')
#print 'tms.expenses adding new entry with form test passed.......................OK'
def test_expenses_edit_actions(self):
help = """
Tests for APP 'tms.views.expenses' EDITING functiuonality:
- checks for a valid HttpResponse html data,
containing rendered current added entry
by part of unique string in entry
checking it contains edit string
required to trigger AXAJ EDIT actions on JavaScript side.
- testing invalid data posting to view.
View should return form with errors and 200 status
"""
#print help
#trying to access url of editing test database entry and get the form
response = self.client.get(reverse('tms_timesheets'), {})
self.failUnlessEqual(response.status_code, 200)
# checks for a valid HttpResponse html data,
# containing rendered current added entry
# by part of unique string in entry
# checking it contains edit string
# required to trigger AXAJ actions on JavaScript side.
response = self.client.post(reverse('tms_expenses'), {
"currency": "1",
"expense_date_day": "8",
"expense_date_yearmonth": "2011-9",
"expense_date_datepicker": "",
"claim_date_day": "8",
"claim_date_yearmonth": "2011-9",
"claim_date_datepicker": "",
"customer": "1",
"expense_type": "1",
"comment": "some test comment test for expenses",
"is_receipted": "on",
"payment_method": "1",
"is_taxable": "on",
"expense_amount": "3345",
"tax_amount": "23",
"local_amount": "3346",
"save": "Save",
"data_id": "1",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'return expense_editbtn_press')
self.assertNotContains(response, 'form')
self.assertContains(response, 'edited_item_returned')
# testing invalid data posting to view.
# View should return form with errors and 200 status
response = self.client.post(reverse('tms_expenses'), {
"currency": "2000", #faulty data in here
"expense_date_day": "8",
"expense_date_yearmonth": "2011-9",
"expense_date_datepicker": "",
"claim_date_day": "8",
"claim_date_yearmonth": "2011-9",
"claim_date_datepicker": "",
"customer": "1",
"expense_type": "1",
"comment": "some test comment test for expenses",
"is_receipted": "on",
"payment_method": "1",
"is_taxable": "on",
"expense_amount": "3345",
"tax_amount": "23",
"local_amount": "3346",
"save": "Save",
"data_id": "1",
})
self.failUnlessEqual(response.status_code, 200)
self.assertContains(response, 'form')
self.assertContains(response, 'error')
#print 'tms.expenses.edit test passed..............................................OK'
def test_expense_del_urls(self):
help = """
Tests for APP 'tms.views.timesheet_del' DELETING functiuonality:
- tries to log in
- checks 'tms_expense_del' GET to view returns response with code 400
- checks POST to this view returns code 400
- checks empty POST to this view returns 400 too
- checks post with variable returns 200 and desired model PK (for AJAX manipulations)
"""
#print help
#trying to access url of deleting test database entry
response = self.client.get(reverse('tms_expense_del'), {})
self.failUnlessEqual(response.status_code, 400)
# empty POST to this view returns 400 too
response = self.client.post(reverse('tms_expense_del'), {})
self.failUnlessEqual(response.status_code, 400)
# post with variable returns 200 and desired model PK (for AJAX manipulations)
response = self.client.post(reverse('tms_expense_del'), {'data_id': self.expense1.pk})
self.failUnlessEqual(response.content, str(self.expense1.pk))
#print 'tms.expense.del test passed...............................................OK'
class ReportsWorking(TestCase):
"""
Various tests of reports
"""
def setUp(self):
"""
Crating a test environment with logged in
client and at least one timesheet model
and one Expense and Job models.
"""
self.client = Client()
self.client, self.response = client_login(self.client, callback=reverse('tms_timesheets'))
self.datetime = datetime.datetime.now
self.user = new_test_user()
self.job_model = any_model(Job, is_active=True)
try:
self.employee = any_model(Employee, user = self.user)
except:
#employee with this user already exists
self.employee = Employee.objects.get(user=self.user)
self.timesheet1 = any_model(Timesheet,
employee=self.employee,
is_submitted=False,
is_billed=False,
start_time='2011-08-29 20:57:34.848614',
end_time='2011-08-29 22:57:34.848614',
comment='Django_tests comment for timesheet model1')
self.expense1 = any_model(Expense,
expense_date='2011-09-10',
claim_date='2011-09-10',
is_receipted=True,
is_submitted=False,
is_billed=False,
is_taxable=True,
comment='Django_tests comment for expense model1')
self.reports_list = reporting.all_reports()
self.reporting_post_data = { 'consultant': '',
'date_end_datepicker' : '',
'date_end_day': '13',
'date_end_yearmonth': '2011-9',
'date_start_datepicker': '',
'date_start_day': '16',
'date_start_yearmonth': '2011-8',
'generate': 'Generate',
}
def test_reports_working(self):
help = """
Tests for APP 'reporting' main functionality:
- loggs in
- checks 'reports' GET to view returns response with code 200
- checks for existence of every test url in view response
- checks for number of reports is greater than 3 (in the time of writing we have 4 reports)
"""
#print help
response = self.client.get(reverse('reports'), {})
self.failUnlessEqual(response.status_code, 200)
#verifying all reports exist
for slug, report in self.reports_list:
self.assertContains(response, slug)
#checking it has more than 3 reports
self.assertGreater(self.reports_list.count, 3)
#print 'reporting.reports test passed...............................................OK'
def test_report_days_consultant_contains_data(self):
help = """
Tests for APP 'report_detail' report 'days_consultant' functionality:
- loggs in
- checks 'report_detail' with 'days_consultant' report returns 200 status code
- checks cotains report test data model comment
"""
#print help
response = self.client.get('/reporting/days_consultant/')
self.failUnlessEqual(response.status_code, 200)
response = self.client.post('/reporting/days_consultant/', self.reporting_post_data)
self.assertContains(response, self.timesheet1.comment)
#print 'reporting.days_consultant test passed......................................OK'
def test_report_expense_summary_consultant_contains_data(self):
help = """
Tests for APP 'report_detail' report 'expense_summary_consultant' functionality:
- loggs in
- checks 'report_detail' with 'expense_summary_consultant' report returns 200 status code
- checks cotains report test data model comment
"""
#print help
response = self.client.get('/reporting/expense_summary_consultant/')
self.failUnlessEqual(response.status_code, 200)
response = self.client.post('/reporting/expense_summary_consultant/', self.reporting_post_data)
self.assertContains(response, self.expense1.comment)
#print 'reporting.expense_summary_consultant test passed...........................OK'
def test_report_expense_summary_client_contains_data(self):
help = """
Tests for APP 'report_detail' report 'expense_summary_client' functionality:
- loggs in
- checks 'report_detail' with 'expense_summary_client' report returns 200 status code
- checks cotains report test data model comment
"""
#print help
response = self.client.get('/reporting/expense_summary_client/')
self.failUnlessEqual(response.status_code, 200)
response = self.client.post('/reporting/expense_summary_client/', self.reporting_post_data)
self.assertContains(response, self.expense1.comment)
#print 'reporting.expense_summary_client test passed...............................OK'
def test_report_project_details_contains_data(self):
help = """
Tests for APP 'report_detail' report 'project_details' functionality:
- loggs in
- checks 'report_detail' with 'project_details' report returns 200 status code
- checks cotains report test data model comment
"""
#print help
response = self.client.get('/reporting/project_details/')
self.failUnlessEqual(response.status_code, 200)
response = self.client.post('/reporting/project_details/', self.reporting_post_data)
self.assertContains(response, self.timesheet1.comment)
#print 'reporting.project_details test passed......................................OK'
| 44.356923 | 103 | 0.548453 | 2,947 | 28,832 | 5.230064 | 0.099762 | 0.028547 | 0.037371 | 0.055667 | 0.809901 | 0.796795 | 0.761305 | 0.719068 | 0.687277 | 0.655356 | 0 | 0.023487 | 0.341392 | 28,832 | 649 | 104 | 44.42527 | 0.788193 | 0.181084 | 0 | 0.723744 | 0 | 0.002283 | 0.382059 | 0.039699 | 0 | 0 | 0 | 0 | 0.068493 | 1 | 0.047945 | false | 0 | 0.027397 | 0 | 0.084475 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
0846e2918fb1afe4badda15c28a6e0a09afcca79 | 234 | py | Python | masq/cms/models/__init__.py | tehdiplomat/hidden-role-games | e6fdc132700db8d12fd57f08200a499cdc5bef7d | [
"MIT"
] | null | null | null | masq/cms/models/__init__.py | tehdiplomat/hidden-role-games | e6fdc132700db8d12fd57f08200a499cdc5bef7d | [
"MIT"
] | null | null | null | masq/cms/models/__init__.py | tehdiplomat/hidden-role-games | e6fdc132700db8d12fd57f08200a499cdc5bef7d | [
"MIT"
] | null | null | null | from cms.models.Base import BaseModel
from cms.models.Game import Game
from cms.models.GameSession import GameSession
from cms.models.Player import Player
from cms.models.Role import Role
from cms.models.Affiliation import Affiliation | 39 | 46 | 0.850427 | 36 | 234 | 5.527778 | 0.305556 | 0.211055 | 0.39196 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.098291 | 234 | 6 | 47 | 39 | 0.943128 | 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 |
f22fa400c243d73c8d36858f6e9512a406655b00 | 166 | py | Python | pswalker/__init__.py | ZLLentz/pswalker | 9642489e6add37906998f09cc88290bc95686ac9 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pswalker/__init__.py | ZLLentz/pswalker | 9642489e6add37906998f09cc88290bc95686ac9 | [
"BSD-3-Clause-LBNL"
] | 8 | 2018-04-20T21:26:02.000Z | 2021-01-11T19:31:08.000Z | pswalker/__init__.py | ZLLentz/pswalker | 9642489e6add37906998f09cc88290bc95686ac9 | [
"BSD-3-Clause-LBNL"
] | 2 | 2018-06-26T00:09:27.000Z | 2018-11-29T19:40:04.000Z | import os.path
import pcdsdevices # Pick up ophyd 1.2.0 hotfix via import
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| 27.666667 | 58 | 0.801205 | 26 | 166 | 4.807692 | 0.653846 | 0.264 | 0.288 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02069 | 0.126506 | 166 | 5 | 59 | 33.2 | 0.841379 | 0.222892 | 0 | 0 | 0 | 0 | 0.055118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 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 |
f27447e6818266ee2ddd022f5fab2bd63d05e69d | 120 | py | Python | greydot/tests/test_wallet.py | TralahM/greydot-api | 34982c34bf878b2728e934147ca4ea38a78523e4 | [
"MIT"
] | null | null | null | greydot/tests/test_wallet.py | TralahM/greydot-api | 34982c34bf878b2728e934147ca4ea38a78523e4 | [
"MIT"
] | null | null | null | greydot/tests/test_wallet.py | TralahM/greydot-api | 34982c34bf878b2728e934147ca4ea38a78523e4 | [
"MIT"
] | null | null | null | from sms import parse_xml_response
from wallet import SAMPLE
def test_wallet():
print(parse_xml_response(SAMPLE))
| 17.142857 | 37 | 0.8 | 18 | 120 | 5.055556 | 0.611111 | 0.175824 | 0.351648 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141667 | 120 | 6 | 38 | 20 | 0.883495 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.5 | 0 | 0.75 | 0.25 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
f2bf3f5afd346f146f40c4d9543b2cc8710e5b7e | 89 | py | Python | tests/test_version.py | Kludex/package-list | 7724b657547d5286a1d5cc0e00f86dfd57c9ecbf | [
"MIT"
] | null | null | null | tests/test_version.py | Kludex/package-list | 7724b657547d5286a1d5cc0e00f86dfd57c9ecbf | [
"MIT"
] | null | null | null | tests/test_version.py | Kludex/package-list | 7724b657547d5286a1d5cc0e00f86dfd57c9ecbf | [
"MIT"
] | null | null | null | import package_list
def test_version():
assert package_list.__version__ == "0.2.0"
| 14.833333 | 46 | 0.730337 | 13 | 89 | 4.461538 | 0.692308 | 0.37931 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0.157303 | 89 | 5 | 47 | 17.8 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0.05618 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.333333 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 6 |
4b2fda57c214b90c15902fa7f760cc097e68f983 | 23 | py | Python | xsearch/__init__.py | e2dubba/py-xsearch | 5da8dd90ae00fb261f0c80868cfdc2b8fa5d4a34 | [
"MIT"
] | null | null | null | xsearch/__init__.py | e2dubba/py-xsearch | 5da8dd90ae00fb261f0c80868cfdc2b8fa5d4a34 | [
"MIT"
] | null | null | null | xsearch/__init__.py | e2dubba/py-xsearch | 5da8dd90ae00fb261f0c80868cfdc2b8fa5d4a34 | [
"MIT"
] | null | null | null | from .xsearch import *
| 11.5 | 22 | 0.73913 | 3 | 23 | 5.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 23 | 1 | 23 | 23 | 0.894737 | 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 |
4b4a110dc99ea87b539cc72e84e1320deaea67d9 | 106 | py | Python | hex/domain/test_IReturnHelloWorld.py | demorose/hexashell_python | 13d5efa166ea9699cae70cf6b9eb50e27feb1ef6 | [
"MIT"
] | null | null | null | hex/domain/test_IReturnHelloWorld.py | demorose/hexashell_python | 13d5efa166ea9699cae70cf6b9eb50e27feb1ef6 | [
"MIT"
] | null | null | null | hex/domain/test_IReturnHelloWorld.py | demorose/hexashell_python | 13d5efa166ea9699cae70cf6b9eb50e27feb1ef6 | [
"MIT"
] | null | null | null | from hex.domain.IReturnHelloWorld import helloWorld
def test():
assert helloWorld() == 'Hello World'
| 21.2 | 51 | 0.745283 | 12 | 106 | 6.583333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150943 | 106 | 4 | 52 | 26.5 | 0.877778 | 0 | 0 | 0 | 0 | 0 | 0.103774 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 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 |
4b60b312901e2cbe8d206ed1b2245bf2f3bbd096 | 144 | py | Python | tess/summarization/abstractive/__init__.py | ashishbaghudana/tess | b7ba6c6cd79cb22c04c584988a718f43679c4e9c | [
"MIT"
] | 1 | 2019-04-19T18:19:33.000Z | 2019-04-19T18:19:33.000Z | tess/summarization/abstractive/__init__.py | ashishbaghudana/tess | b7ba6c6cd79cb22c04c584988a718f43679c4e9c | [
"MIT"
] | 5 | 2021-03-18T23:27:03.000Z | 2022-03-11T23:44:49.000Z | tess/summarization/abstractive/__init__.py | ashishbaghudana/tess | b7ba6c6cd79cb22c04c584988a718f43679c4e9c | [
"MIT"
] | null | null | null | from abc import ABC
from tess.summarization import SummarizationModel
class AbstractiveSummarizationModel(SummarizationModel, ABC):
pass
| 18 | 61 | 0.833333 | 14 | 144 | 8.571429 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131944 | 144 | 7 | 62 | 20.571429 | 0.96 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.25 | 0.5 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 6 |
4b8113bdad5c4f85ddd8fca143aeaacfcb9ecc71 | 145 | py | Python | webcontentdownloader/__init__.py | hail-kang/module-webcontent-downloader | 93d9fa209c8a14540f10298e5b483edd692021c6 | [
"MIT"
] | null | null | null | webcontentdownloader/__init__.py | hail-kang/module-webcontent-downloader | 93d9fa209c8a14540f10298e5b483edd692021c6 | [
"MIT"
] | null | null | null | webcontentdownloader/__init__.py | hail-kang/module-webcontent-downloader | 93d9fa209c8a14540f10298e5b483edd692021c6 | [
"MIT"
] | null | null | null | from .interface import *
from .simpledownloader import *
from .utils import *
from .complexdownloader import *
from .downloadmanager import * | 29 | 33 | 0.772414 | 15 | 145 | 7.466667 | 0.466667 | 0.357143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158621 | 145 | 5 | 34 | 29 | 0.918033 | 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 |
29a2695fb04c4da69126c5401d964308b1450b4e | 41 | py | Python | torchsummaryDynamic/__init__.py | chenbong/torchsummaryDynamic | 48ad7e46c4c762dda335b496313ed63b76507b59 | [
"MIT"
] | 1 | 2022-01-05T07:28:23.000Z | 2022-01-05T07:28:23.000Z | torchsummaryDynamic/__init__.py | chenbong/torchsummaryDynamic | 48ad7e46c4c762dda335b496313ed63b76507b59 | [
"MIT"
] | null | null | null | torchsummaryDynamic/__init__.py | chenbong/torchsummaryDynamic | 48ad7e46c4c762dda335b496313ed63b76507b59 | [
"MIT"
] | null | null | null | from .torchsummaryDynamic import summary
| 20.5 | 40 | 0.878049 | 4 | 41 | 9 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097561 | 41 | 1 | 41 | 41 | 0.972973 | 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 |
29e883b4eaafdda5eedde7da523db3f7e0769bbc | 179 | py | Python | libraries/python/telstra_data_usage/tests/test_sample.py | tvlfyi/ghuntley | 8bf49dd414b93185a5eeb9981c52051b2d7b33db | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 48 | 2018-10-07T05:01:50.000Z | 2022-03-08T07:58:51.000Z | libraries/python/telstra_data_usage/tests/test_sample.py | BenjaminAbt/ghuntley | d614f88a2c900101aa2d6097328f3f8bc8e5fc44 | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 61 | 2018-07-15T03:15:25.000Z | 2022-02-27T11:36:20.000Z | libraries/python/telstra_data_usage/tests/test_sample.py | BenjaminAbt/ghuntley | d614f88a2c900101aa2d6097328f3f8bc8e5fc44 | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 15 | 2017-07-07T05:14:19.000Z | 2022-03-25T08:35:21.000Z | # Copyright (c) 2020 Geoffrey Huntley <ghuntley@ghuntley.com>. All rights reserved.
# SPDX-License-Identifier: Proprietary
def test_pass():
assert True, "dummy sample test"
| 25.571429 | 83 | 0.748603 | 23 | 179 | 5.782609 | 0.913043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026144 | 0.145251 | 179 | 6 | 84 | 29.833333 | 0.843137 | 0.659218 | 0 | 0 | 0 | 0 | 0.293103 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0.5 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 6 |
4b07bb05675a5215427f2858c9a1cdd5318f7099 | 45 | py | Python | visigoth/charts/table/__init__.py | visigoths/visigoth | c5297148209d630f6668f0e5ba3039a8856d8320 | [
"MIT"
] | null | null | null | visigoth/charts/table/__init__.py | visigoths/visigoth | c5297148209d630f6668f0e5ba3039a8856d8320 | [
"MIT"
] | 1 | 2021-01-26T16:55:48.000Z | 2021-09-03T15:29:14.000Z | visigoth/charts/table/__init__.py | visigoths/visigoth | c5297148209d630f6668f0e5ba3039a8856d8320 | [
"MIT"
] | null | null | null | from visigoth.charts.table.table import Table | 45 | 45 | 0.866667 | 7 | 45 | 5.571429 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 45 | 1 | 45 | 45 | 0.928571 | 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 |
4b167786427c6fb55f2276fa1af5ad702efa2099 | 49 | py | Python | oligo/__init__.py | think-free/python-oligo | 1a7c9b81fb358f15ab53e3160d5d7b4dade4052e | [
"MIT"
] | 2 | 2019-10-01T20:06:49.000Z | 2019-10-01T20:13:03.000Z | oligo/__init__.py | think-free/python-oligo | 1a7c9b81fb358f15ab53e3160d5d7b4dade4052e | [
"MIT"
] | null | null | null | oligo/__init__.py | think-free/python-oligo | 1a7c9b81fb358f15ab53e3160d5d7b4dade4052e | [
"MIT"
] | 2 | 2019-10-01T21:48:36.000Z | 2020-04-29T23:11:11.000Z | from .iber import Iber, watthourmeter, icpstatus
| 24.5 | 48 | 0.816327 | 6 | 49 | 6.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122449 | 49 | 1 | 49 | 49 | 0.930233 | 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 |
d9dd077cb59e6bc8af8fec882148943d40182aa4 | 156 | py | Python | CodeWars/7 Kyu/How far will I go.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/How far will I go.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/How far will I go.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def travel(total_time, run_time, rest_time, speed):
q, r = divmod(total_time, run_time + rest_time)
return (q * run_time + min(r, run_time)) * speed | 52 | 52 | 0.692308 | 27 | 156 | 3.703704 | 0.444444 | 0.28 | 0.24 | 0.32 | 0.48 | 0.48 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179487 | 156 | 3 | 52 | 52 | 0.78125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 6 |
8a0aac9a0273dd07bfdb3f2a88fde832068f7d54 | 72 | py | Python | examples/Shape Example/run.py | josepic99/mesas | 8453fe36b8536795ce5b80975fc9dbc604da42df | [
"Apache-2.0"
] | 27 | 2015-10-19T13:08:27.000Z | 2021-03-22T19:50:28.000Z | examples/Shape Example/run.py | josepic99/mesas | 8453fe36b8536795ce5b80975fc9dbc604da42df | [
"Apache-2.0"
] | 9 | 2016-10-04T22:53:30.000Z | 2021-03-05T16:48:23.000Z | examples/Shape Example/run.py | josepic99/mesas | 8453fe36b8536795ce5b80975fc9dbc604da42df | [
"Apache-2.0"
] | 50 | 2015-09-23T08:46:18.000Z | 2021-09-15T09:38:10.000Z | from shape_model.server import launch_shape_model
launch_shape_model()
| 18 | 49 | 0.875 | 11 | 72 | 5.272727 | 0.545455 | 0.517241 | 0.551724 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 72 | 3 | 50 | 24 | 0.878788 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 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 |
8a4768e1543150c197203689f27aeaacf4d29fcc | 4,414 | py | Python | skyfield/tests/test_strs_and_reprs.py | facorazza/python-skyfield | 8d3dc132f43656766a58e3e1984363592aa1f11a | [
"MIT"
] | 765 | 2015-04-15T22:54:43.000Z | 2022-03-31T10:02:16.000Z | skyfield/tests/test_strs_and_reprs.py | facorazza/python-skyfield | 8d3dc132f43656766a58e3e1984363592aa1f11a | [
"MIT"
] | 589 | 2015-04-18T16:32:35.000Z | 2022-03-31T09:35:33.000Z | skyfield/tests/test_strs_and_reprs.py | facorazza/python-skyfield | 8d3dc132f43656766a58e3e1984363592aa1f11a | [
"MIT"
] | 169 | 2015-04-15T19:47:38.000Z | 2022-03-11T13:15:44.000Z | import textwrap
from ..api import Topos, load, wgs84
from ..sgp4lib import EarthSatellite
lines = [
'ISS (ZARYA) ',
'1 25544U 98067A 13330.58127943 .00000814 00000-0 21834-4 0 1064',
'2 25544 51.6484 23.7537 0001246 74.1647 18.7420 15.50540527859894',
]
def dedent(s):
return textwrap.dedent(s.rstrip())
def eph():
yield load('de421.bsp')
def test_jpl_segment(eph):
e = eph['mercury barycenter']
expected = dedent("""\
'de421.bsp' segment 0 SOLAR SYSTEM BARYCENTER -> 1 MERCURY BARYCENTER
""")
assert str(e) == expected
expected = dedent("""\
<ChebyshevPosition 'de421.bsp' segment 0 SOLAR SYSTEM BARYCENTER -> 1 MERCURY BARYCENTER>
""")
assert repr(e) == expected
def test_satellite_with_name():
s = EarthSatellite(lines[1], lines[2], lines[0])
expected = dedent("""\
ISS (ZARYA) catalog #25544 epoch 2013-11-26 13:57:03 UTC
""")
assert str(s) == expected
expected = dedent("""\
<EarthSatellite ISS (ZARYA) catalog #25544 epoch 2013-11-26 13:57:03 UTC>
""")
assert repr(s) == expected
def test_satellite_without_name():
s = EarthSatellite(lines[1], lines[2])
expected = dedent("""\
catalog #25544 epoch 2013-11-26 13:57:03 UTC
""")
assert str(s) == expected
expected = dedent("""\
<EarthSatellite catalog #25544 epoch 2013-11-26 13:57:03 UTC>
""")
assert repr(s) == expected
def test_geographic_position():
t = wgs84.latlon(42.2, -88.1)
expected = dedent("""\
WGS84 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m
""")
assert str(t) == expected
expected = dedent("""\
<GeographicPosition WGS84 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m>
""")
assert repr(t) == expected
t.target_name = 'Custom name'
assert str(t) == 'Custom name'
assert repr(t) == "<GeographicPosition Custom name>"
def test_topos():
t = Topos(latitude_degrees=42.2, longitude_degrees=-88.1)
expected = dedent("""\
IERS2010 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m
""")
assert str(t) == expected
expected = dedent("""\
<Topos IERS2010 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m>
""")
assert repr(t) == expected
t.target_name = 'Custom name'
assert str(t) == 'Custom name'
assert repr(t) == "<Topos Custom name>"
def test_jpl_vector_sum(eph):
e = eph['earth']
expected = dedent("""\
Sum of 2 vectors:
'de421.bsp' segment 0 SOLAR SYSTEM BARYCENTER -> 3 EARTH BARYCENTER
'de421.bsp' segment 3 EARTH BARYCENTER -> 399 EARTH
""")
assert str(e) == expected
expected = dedent("""\
<VectorSum of 2 vectors:
'de421.bsp' segment 0 SOLAR SYSTEM BARYCENTER -> 3 EARTH BARYCENTER
'de421.bsp' segment 3 EARTH BARYCENTER -> 399 EARTH>
""")
assert repr(e) == expected
def test_geographic_position_and_earth_satellite_vector_sum(eph):
s = EarthSatellite(lines[1], lines[2])
t = wgs84.latlon(42.2, -88.1)
v = s - t
expected = dedent("""\
Sum of 2 vectors:
Reversed Geodetic WGS84 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m -> 399 EARTH
EarthSatellite 399 EARTH -> catalog #25544 epoch 2013-11-26 13:57:03 UTC
""")
assert str(v) == expected
expected = dedent("""\
<VectorSum of 2 vectors:
Reversed Geodetic WGS84 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m -> 399 EARTH
EarthSatellite 399 EARTH -> catalog #25544 epoch 2013-11-26 13:57:03 UTC>
""")
assert repr(v) == expected
def test_topos_and_earth_satellite_vector_sum(eph):
s = EarthSatellite(lines[1], lines[2])
t = Topos(latitude_degrees=42.2, longitude_degrees=-88.1)
v = s - t
expected = dedent("""\
Sum of 2 vectors:
Reversed Geodetic IERS2010 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m -> 399 EARTH
EarthSatellite 399 EARTH -> catalog #25544 epoch 2013-11-26 13:57:03 UTC
""")
assert str(v) == expected
expected = dedent("""\
<VectorSum of 2 vectors:
Reversed Geodetic IERS2010 latitude +42.2000 N longitude -88.1000 E elevation 0.0 m -> 399 EARTH
EarthSatellite 399 EARTH -> catalog #25544 epoch 2013-11-26 13:57:03 UTC>
""")
assert repr(v) == expected
| 34.217054 | 105 | 0.628002 | 603 | 4,414 | 4.542289 | 0.167496 | 0.081782 | 0.064257 | 0.061336 | 0.805403 | 0.79226 | 0.760497 | 0.714859 | 0.714859 | 0.714859 | 0 | 0.148936 | 0.243996 | 4,414 | 128 | 106 | 34.484375 | 0.671861 | 0 | 0 | 0.675439 | 0 | 0.061404 | 0.53285 | 0 | 0 | 0 | 0 | 0 | 0.175439 | 1 | 0.087719 | false | 0 | 0.026316 | 0.008772 | 0.122807 | 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 |
8a695c14aab91f5b5f881e7bda1721db13e1c449 | 15,909 | py | Python | tests/test_command_handler.py | vdonga/FCR | 59c4c27d6974f55730cd9f6d219214c090928c7c | [
"BSD-3-Clause"
] | null | null | null | tests/test_command_handler.py | vdonga/FCR | 59c4c27d6974f55730cd9f6d219214c090928c7c | [
"BSD-3-Clause"
] | null | null | null | tests/test_command_handler.py | vdonga/FCR | 59c4c27d6974f55730cd9f6d219214c090928c7c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
from fbnet.command_runner.command_handler import CommandHandler
from fbnet.command_runner.options import Option
from fbnet.command_runner_asyncio.CommandRunner import ttypes
from mock import Mock
from .mocks import MockService
from .testutil import AsyncTestCase, async_test
client_ip = "127.0.0.1"
client_port = 5000
class TestCommandHandler(AsyncTestCase):
def setUp(self):
super().setUp()
self.mock_options = {}
self._mocks = MockService(self.mock_options, loop=self._loop)
self.stats_mgr = Mock()
self.cmd_handler = CommandHandler(self._mocks)
def tearDown(self):
self._mocks.tearDown()
super().tearDown()
def mock_device(self, name, console="", command_prompts=None):
return Mock(hostname=name, console=console, command_prompts=command_prompts)
@async_test
async def test_run_success(self):
device = self.mock_device("test-dev-1")
result = await self.cmd_handler.run(
"show version\n", device, 5, 5, client_ip, client_port
)
self.assertEqual(result.status, "success")
self.assertEqual(
result.output, "$ show version\nMock response for show version"
)
@async_test
async def test_run_no_device(self):
device = self.mock_device("test-dev-100")
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.run(
"show version\n", device, 5, 5, client_ip, client_port
)
self.assertEqual(
exc.exception.message, "KeyError('Device not found', 'test-dev-100')"
)
@async_test
async def test_run_connect_timeout(self):
device = self.mock_device("test-dev-2")
self.mock_options["connect_drop"] = True
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.run(
"show version\n", device, 0, 0, client_ip, client_port
)
self.assertEqual(
exc.exception.message,
"Failed (session: MockCommandSession, peer: ('test-ip', 22)): "
"TimeoutError()",
)
@async_test
async def test_run_command_timeout(self):
device = self.mock_device("test-dev-2")
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.run(
"command timeout\n", device, 0, 0, client_ip, client_port
)
self.assertEqual(
exc.exception.message,
"Failed (session: MockCommandSession, peer: ('test-ip', 22)): "
"TimeoutError()",
)
@async_test
async def test_run_success_user_prompt(self):
command_prompts = {"user prompt test": "<<<User Magic Prompt>>>"}
device = self.mock_device("test-dev-1", command_prompts=command_prompts)
result = await self.cmd_handler.run(
"show version\n", device, 5, 5, client_ip, client_port
)
self.assertEqual(result.status, "success")
self.assertEqual(
result.output, "$ show version\nMock response for show version"
)
result = await self.cmd_handler.run(
"user prompt test\n", device, 5, 5, client_ip, client_port
)
self.assertEqual(result.status, "success")
self.assertEqual(
result.output,
"<<<User Magic Prompt>>> user prompt test\n" "Test for user prompts",
)
@async_test
async def test_run_success_user_prompt_failed(self):
command_prompts = {"user prompt test": "<<<XX User Magic Prompt>>>"}
device = self.mock_device("test-dev-1", command_prompts=command_prompts)
result = await self.cmd_handler.run(
"show version\n", device, 5, 5, client_ip, client_port
)
self.assertEqual(result.status, "success")
self.assertEqual(
result.output, "$ show version\nMock response for show version"
)
with self.assertRaises(ttypes.SessionException) as exc:
result = await self.cmd_handler.run(
"user prompt test\n", device, 1, 1, client_ip, client_port
)
self.assertEqual(
exc.exception.message,
"Failed (session: MockCommandSession, peer: ('test-ip', 22)): "
"RuntimeError('Command Response Timeout', "
"b'user prompt test\\nTest for user prompts\\n<<<User Magic Prompt>>>')",
)
@async_test
async def test_open_session(self):
device = self.mock_device("test-dev-1")
session = await self.cmd_handler.open_session(
device, 5, 5, client_ip, client_port
)
self.assertIsNotNone(session)
self.assertEqual(session.name, device.hostname)
self.assertEqual(session.hostname, device.hostname)
@async_test
async def test_open_session_no_device(self):
device = self.mock_device("test-dev-10")
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.open_session(
device, 0.01, 0.01, client_ip, client_port
)
self.assertEqual(
exc.exception.message,
"open_session failed: KeyError('Device not found', 'test-dev-10')",
)
@async_test
async def test_open_session_timeout(self):
device = self.mock_device("test-dev-2")
self.mock_options["connect_drop"] = True
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.open_session(
device, 0.01, 0.01, client_ip, client_port
)
self.assertEqual(exc.exception.message, "open_session failed: TimeoutError()")
@async_test
async def test_run_session(self):
device = self.mock_device("test-dev-1")
session = await self.cmd_handler.open_session(
device, 5, 5, client_ip, client_port
)
result = await self.cmd_handler.run_session(
session, "show version\n", 5, client_ip, client_port
)
self.assertEqual(result.status, "success")
self.assertEqual(
result.output, "$ show version\nMock response for show version"
)
@async_test
async def test_run_session_invalid(self):
session = Mock(id=1234)
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.run_session(
session, "show version\n", 5, client_ip, client_port
)
self.assertEqual(
exc.exception.message,
"run_session failed: KeyError('Session not found', "
+ "(1234, '127.0.0.1', 5000))",
)
@async_test
async def test_run_session_command_timeout(self):
device = self.mock_device("test-dev-1")
session = await self.cmd_handler.open_session(
device, 5, 5, client_ip, client_port
)
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.run_session(
session, "command timeout\n", 1, client_ip, client_port
)
self.assertEqual(
exc.exception.message,
"run_session failed: RuntimeError('%s', b'%s')"
% (
"Command Response Timeout",
"command timeout\\nMock response for command timeout",
),
)
@async_test
async def test_close_session(self):
device = self.mock_device("test-dev-1")
session = await self.cmd_handler.open_session(
device, 5, 5, client_ip, client_port
)
await self.cmd_handler.close_session(session, client_ip, client_port)
@async_test
async def test_close_session_invalid(self):
session = Mock(id=1234)
with self.assertRaises(ttypes.SessionException) as exc:
await self.cmd_handler.close_session(session, client_ip, client_port)
self.assertEqual(
exc.exception.message,
"close_session failed: KeyError('Session not found', "
+ "(1234, '127.0.0.1', 5000))",
)
@async_test
async def test_bulk_run_local(self):
devices = ["test-dev-%d" % i for i in range(1, 5)]
commands = {self.mock_device(name): ["show version\n"] for name in devices}
all_results = await self.cmd_handler.bulk_run_local(
commands, 1, 1, client_ip, client_port
)
for host in devices:
for result in all_results[host]:
self.assert_command_result(result)
@async_test
async def test_bulk_run_local_with_invalid_devices(self):
devices = ["test-dev-%d" % i for i in range(0, 5)]
commands = {self.mock_device(name): ["show version\n"] for name in devices}
all_results = await self.cmd_handler.bulk_run_local(
commands, 1, 1, client_ip, client_port
)
for host in devices:
if host == "test-dev-0":
result = all_results[host][0]
self.assertEqual(
result.status,
'SessionException(\n message="'
"KeyError('%s', '%s')\")" % ("Device not found", "test-dev-0"),
)
continue
for result in all_results[host]:
self.assert_command_result(result)
Option.config.lb_threshold = 20
@async_test
async def test_bulk_run_local_with_command_timeout(self):
devices = ["test-dev-%d" % i for i in range(0, 5)]
commands = {self.mock_device(name): ["show version\n"] for name in devices}
# pick a scapegoat
onehost = next(iter(commands))
commands[onehost] = ["command timeout\n"]
all_results = await self.cmd_handler.bulk_run_local(
commands, 1, 1, client_ip, client_port
)
for host in devices:
if host == "test-dev-0":
result = all_results[host][0]
self.assertEqual(
result.status,
'SessionException(\n message="'
"KeyError('%s', '%s')\")" % ("Device not found", "test-dev-0"),
)
continue
for result in all_results[host]:
self.assert_command_result(result)
@async_test
async def test_bulk_run_local_with_connect_timeout(self):
devices = ["test-dev-%d" % i for i in range(0, 2)]
commands = {self.mock_device(name): ["show version\n"] for name in devices}
# pick a scapegoat
onehost = next(iter(commands))
commands[onehost] = ["command timeout\n"]
self.mock_options["connect_drop"] = True
all_results = await self.cmd_handler.bulk_run_local(
commands, 1, 1, client_ip, client_port
)
for host in devices:
if host == "test-dev-0":
result = all_results[host][0]
self.assertEqual(
result.status,
'SessionException(\n message="'
"KeyError('%s', '%s')\")" % ("Device not found", "test-dev-0"),
)
continue
for result in all_results[host]:
self.assertEqual(
result.status,
'SessionException(\n message="Failed (session: '
"MockCommandSession, peer: ('test-ip', 22)): "
'TimeoutError()")',
)
@async_test
async def test_bulk_run_local_overload(self):
devices = ["test-dev-%d" % i for i in range(1, 5)]
commands = {self.mock_device(name): ["show version\n"] for name in devices}
Option.config.bulk_session_limit = 4
CommandHandler._bulk_session_count = 4
with self.assertRaises(ttypes.InstanceOverloaded) as exc:
await self.cmd_handler.bulk_run_local(
commands, 1, 1, client_ip, client_port
)
self.assertEqual(exc.exception.message, "Too many session open: 4")
@async_test
async def test_bluk_run_load_balance(self):
Option.config.lb_threshold = 2
device_names = {"test-dev-%d" % i for i in range(0, 10)}
commands = {self.mock_device(name): ["show version\n"] for name in device_names}
command_chunks = []
async def _bulk_run_remote(chunk, *args):
command_chunks.append(chunk)
return {dev: "%s: Success" % dev.hostname for dev in chunk.keys()}
self.cmd_handler._bulk_run_remote = _bulk_run_remote
all_results = await self.cmd_handler.bulk_run(
commands, 10, 10, client_ip, client_port
)
self.assertEqual(len(command_chunks), 5, "Commands are run in chunks")
devices = set(commands.keys())
res_devices = set(all_results.keys())
self.assertEqual(res_devices, devices, "Responses are received for all devices")
# Make sure the responses are right from devices
for dev, resp in all_results.items():
self.assertEqual(
resp, "%s: Success" % dev.hostname, "Correct response is received"
)
@async_test
async def test_bluk_run_below_threshold(self):
Option.config.lb_threshold = 20
device_names = {"test-dev-%d" % i for i in range(0, 10)}
commands = {self.mock_device(name): ["show version\n"] for name in device_names}
command_chunks = []
local_commands = []
async def _bulk_run_remote(chunk, *args):
command_chunks.append(chunk)
return {dev: "%s: Success" % dev.hostname for dev in chunk.keys()}
async def _bulk_run_local(chunk, *args):
local_commands.append(chunk)
return {dev: "%s: Success" % dev.hostname for dev in chunk.keys()}
self.cmd_handler._bulk_run_remote = _bulk_run_remote
self.cmd_handler.bulk_run_local = _bulk_run_local
all_results = await self.cmd_handler.bulk_run(
commands, 10, 10, client_ip, client_port
)
self.assertEqual(len(command_chunks), 0, "Commands are not run in chunks")
self.assertEqual(len(local_commands), 1, "Commands are run locally")
self.assertEqual(len(local_commands[0]), 10, "Commands are run locally")
devices = set(commands.keys())
res_devices = set(all_results.keys())
self.assertEqual(res_devices, devices, "Responses are received for all devices")
# Make sure the responses are right from devices
for dev, resp in all_results.items():
self.assertEqual(
resp, "%s: Success" % dev.hostname, "Correct response is received"
)
def assert_command_result(self, result):
if result.command == "show version\n":
self.assertEqual(result.status, "success")
self.assertEqual(
result.output, "$ show version\nMock response for show version"
)
elif result.command == "command timeout\n":
status_fmt = (
"Failed (session: MockCommandSession, peer: "
"('test-ip' 22)): RuntimeError('{0}', b'{2}\\nMock response for {2}')"
)
self.assertEqual(
result.status,
status_fmt.format("Command Response Timeout", "command timeout"),
)
else:
self.fail("unexpected result: %r" % result)
| 34.964835 | 88 | 0.598843 | 1,885 | 15,909 | 4.875862 | 0.10504 | 0.060385 | 0.045697 | 0.053748 | 0.814601 | 0.791209 | 0.768034 | 0.732129 | 0.713415 | 0.684365 | 0 | 0.016138 | 0.29499 | 15,909 | 454 | 89 | 35.04185 | 0.803317 | 0.028537 | 0 | 0.592486 | 0 | 0.00289 | 0.164033 | 0.00136 | 0 | 0 | 0 | 0 | 0.150289 | 1 | 0.011561 | false | 0 | 0.017341 | 0.00289 | 0.043353 | 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 |
76dee53569e48ae7a7753b829def8d90ef41cd96 | 137 | py | Python | Profile & Portfolio Showcasing/services/views.py | Rajan917/Python-Django-Projects | e47ac342bf4a047931ed6a1784dbc3d4321aac59 | [
"MIT"
] | 3 | 2022-03-20T10:50:04.000Z | 2022-03-20T10:50:15.000Z | SUC/my_profile/services/views.py | Rajan917/Python-Django-Projects | e47ac342bf4a047931ed6a1784dbc3d4321aac59 | [
"MIT"
] | null | null | null | SUC/my_profile/services/views.py | Rajan917/Python-Django-Projects | e47ac342bf4a047931ed6a1784dbc3d4321aac59 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def services(request):
return render(request,'services/services.html') | 27.4 | 51 | 0.781022 | 18 | 137 | 5.944444 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124088 | 137 | 5 | 51 | 27.4 | 0.891667 | 0.167883 | 0 | 0 | 0 | 0 | 0.19469 | 0.19469 | 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 |
76df4129e5de865d815a67ca36e121d2d0dc9777 | 63 | py | Python | backend/app/views/predict_bad_clone_rates/__init__.py | Edinburgh-Genome-Foundry/CUBA | d57565951ead619ef9263e8b356b451001fb910f | [
"MIT"
] | 15 | 2018-02-12T13:12:13.000Z | 2021-08-15T11:37:59.000Z | backend/app/views/predict_bad_clone_rates/__init__.py | Edinburgh-Genome-Foundry/CUBA | d57565951ead619ef9263e8b356b451001fb910f | [
"MIT"
] | 9 | 2020-06-05T17:54:54.000Z | 2022-02-12T12:03:19.000Z | backend/app/views/predict_bad_clone_rates/__init__.py | Edinburgh-Genome-Foundry/CUBA | d57565951ead619ef9263e8b356b451001fb910f | [
"MIT"
] | 3 | 2018-10-18T13:08:50.000Z | 2020-08-17T14:09:46.000Z | from .PredictBadCloneRatesView import PredictBadCloneRatesView
| 31.5 | 62 | 0.920635 | 4 | 63 | 14.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.063492 | 63 | 1 | 63 | 63 | 0.983051 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 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 |
0a45bddc730d6703b8a412ddb4a9cbb4f0bd5c09 | 22 | py | Python | hasan/app/models.py | ibrahimediz/flaskrest | e0d52d35dc5b3aff8a7a15832c84e1c3882c4f36 | [
"MIT"
] | null | null | null | hasan/app/models.py | ibrahimediz/flaskrest | e0d52d35dc5b3aff8a7a15832c84e1c3882c4f36 | [
"MIT"
] | null | null | null | hasan/app/models.py | ibrahimediz/flaskrest | e0d52d35dc5b3aff8a7a15832c84e1c3882c4f36 | [
"MIT"
] | null | null | null | from app import app,db | 22 | 22 | 0.818182 | 5 | 22 | 3.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 22 | 1 | 22 | 22 | 0.947368 | 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 |
6a627520d64a15cc571ac29da99cae5ca4d56fae | 6,759 | py | Python | code/policies.py | Rayckey/ARS | 5613a6b9817b70af498ccc72fc1210dec35f9adc | [
"BSD-2-Clause"
] | null | null | null | code/policies.py | Rayckey/ARS | 5613a6b9817b70af498ccc72fc1210dec35f9adc | [
"BSD-2-Clause"
] | null | null | null | code/policies.py | Rayckey/ARS | 5613a6b9817b70af498ccc72fc1210dec35f9adc | [
"BSD-2-Clause"
] | null | null | null | '''
Policy class for computing action from weights and observation vector.
Horia Mania --- hmania@berkeley.edu
Aurelia Guy
Benjamin Recht
'''
import numpy as np
from ARS.code.filter import get_filter
class Policy(object):
def __init__(self, policy_params):
self.ob_dim = policy_params['ob_dim']
self.ac_dim = policy_params['ac_dim']
self.weights = np.empty(0)
# a filter for updating statistics of the observations and normalizing inputs to the policies
self.observation_filter = get_filter(policy_params['ob_filter'], shape = (self.ob_dim,))
self.update_filter = True
def update_weights(self, new_weights):
self.weights[:] = new_weights[:]
return
def get_weights(self):
return self.weights
def get_observation_filter(self):
return self.observation_filter
def act(self, ob):
raise NotImplementedError
def copy(self):
raise NotImplementedError
class LinearPolicy(Policy):
"""
Linear policy class that computes action as <w, ob>.
"""
def __init__(self, policy_params):
Policy.__init__(self, policy_params)
self.weights = np.zeros((self.ac_dim, self.ob_dim), dtype = np.float64)
def act(self, ob):
ob = self.observation_filter(ob, update=self.update_filter)
return np.dot(self.weights, ob)
def get_weights_plus_stats(self):
mu, std = self.observation_filter.get_stats()
aux = np.asarray([self.weights, mu, std])
return aux
class HLinearPolicy(Policy):
"""
Hierarchical policy class that computes action as <w, ob>.
"""
def __init__(self, policy_params):
Policy.__init__(self, policy_params)
self.latent_dim = policy_params['latent_dim']
self.ob_h_dim = policy_params['ob_h_dim']
self.ob_l_dim = policy_params['ob_l_dim']
self.history_size = policy_params['history_size']
self.time_step_h = 0
self.latent_comm = None
self.theta_h_size = (self.latent_dim + 1) * self.ob_h_dim
self.theta_l_size = self.ac_dim*(self.latent_dim+self.ob_l_dim)
self.theta_size = self.ac_dim * (self.ob_l_dim + self.latent_dim + 1) + self.theta_h_size
self.weights = np.zeros(self.theta_size, dtype = np.float64)
def act(self, ob):
ob = self.observation_filter(ob, update=self.update_filter)
#reshape delta from flat to shape of theta h and l
[theta_h,theta_l,theta_b] = self.reshapeFromFlat(self.weights)
[ob_h,ob_l] = self.splitInput(ob)
#high level policy
if self.time_step_h <= 0:
output_h = np.clip(theta_h@ob_h,-1,1)
self.latent_comm = output_h[0:self.latent_dim]
self.time_step_h = np.interp(output_h[-1], (-1, 1), (20, 200))
self.time_step_h -= 1
return theta_l@np.concatenate((ob_l, self.latent_comm))+theta_b
def reshapeFromFlat(self, flat):
h = flat[0:self.theta_h_size].reshape((self.latent_dim + 1,self.ob_h_dim))
l = flat[self.theta_h_size:self.theta_h_size+self.theta_l_size].reshape((self.ac_dim,(self.latent_dim+self.ob_l_dim)))
b = flat[self.theta_h_size+self.theta_l_size:].reshape((self.ac_dim,))
return [h,l,b]
def get_weights_plus_stats(self):
mu, std = self.observation_filter.get_stats()
aux = np.asarray([self.weights, mu, std])
return aux
def splitInput(self,input):
h = input[0:3*self.history_size]
l = input[3*self.history_size+self.history_size*5:]
for i in range(self.history_size):
imu_index = int(3*self.history_size+i*5)
h = np.concatenate([h,input[imu_index,np.newaxis]])
#the order of IMU history is reversed here (probably okay to keep)
l = np.concatenate([input[imu_index+1:imu_index+5],l])
return [h,l]
def loadWeights(self,filepath):
print('loading policy')
lin_policy = np.load(filepath, allow_pickle = True)
lin_policy = lin_policy['arr_0']
self.weights = lin_policy[0]
def reset(self):
self.time_step_h = 0
class HLinearPolicyHOnly(Policy):
"""
Hierarchical policy class that computes action as <w, ob>.
"""
def __init__(self, policy_params):
Policy.__init__(self, policy_params)
self.latent_dim = policy_params['latent_dim']
self.ob_h_dim = policy_params['ob_h_dim']
self.ob_l_dim = policy_params['ob_l_dim']
self.history_size = policy_params['history_size']
self.time_step_h = 0
self.latent_comm = None
self.theta_h_size = (self.latent_dim + 1) * self.ob_h_dim
self.theta_l_size = self.ac_dim*(self.latent_dim+self.ob_l_dim)
self.lweights = np.zeros(self.theta_l_size + self.ac_dim, dtype = np.float64)
self.weights = np.zeros(self.theta_h_size, dtype = np.float64)
def act(self, ob):
ob = self.observation_filter(ob, update=self.update_filter)
#reshape delta from flat to shape of theta h and l
[theta_h,theta_l,theta_b] = self.reshapeFromFlat(self.weights,self.lweights)
[ob_h,ob_l] = self.splitInput(ob)
#high level policy
if self.time_step_h <= 0:
output_h = np.clip(theta_h@ob_h,-1,1)
self.latent_comm = output_h[0:self.latent_dim]
self.time_step_h = np.interp(output_h[-1], (-1, 1), (20, 200))
self.time_step_h -= 1
return theta_l@np.concatenate((ob_l, self.latent_comm))+theta_b
def reshapeFromFlat(self, high,low):
h = high.reshape((self.latent_dim + 1,self.ob_h_dim))
l = low[:self.theta_l_size].reshape((self.ac_dim,(self.latent_dim+self.ob_l_dim)))
b = low[self.theta_l_size:].reshape((self.ac_dim,))
return [h,l,b]
def get_weights_plus_stats(self):
mu, std = self.observation_filter.get_stats()
aux = np.asarray([self.weights, mu, std])
return aux
def splitInput(self,input):
h = input[0:3*self.history_size]
l = input[3*self.history_size+self.history_size*5:]
for i in range(self.history_size):
imu_index = int(3*self.history_size+i*5)
h = np.concatenate([h,input[imu_index,np.newaxis]])
#the order of IMU history is reversed here (probably okay to keep)
l = np.concatenate([input[imu_index+1:imu_index+5],l])
return [h,l]
def loadWeights(self,filepath):
print('loading policy')
lin_policy = np.load(filepath, allow_pickle = True)
lin_policy = lin_policy['arr_0']
self.weights = lin_policy[0][:self.theta_h_size]
self.lweights = lin_policy[0][self.theta_h_size:]
def reset(self):
self.time_step_h = 0
| 35.761905 | 126 | 0.650096 | 1,012 | 6,759 | 4.079051 | 0.12747 | 0.044089 | 0.04094 | 0.031492 | 0.80814 | 0.781735 | 0.764535 | 0.744428 | 0.731831 | 0.730378 | 0 | 0.0127 | 0.231099 | 6,759 | 188 | 127 | 35.952128 | 0.781605 | 0.0975 | 0 | 0.698413 | 0 | 0 | 0.022347 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.18254 | false | 0 | 0.015873 | 0.015873 | 0.333333 | 0.015873 | 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 |
6a69f66ed2420c6a0e7ed798e229af040bf61ce5 | 27 | py | Python | src/euler_python_package/euler_python/medium/p326.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p326.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p326.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | def problem326():
pass
| 9 | 17 | 0.62963 | 3 | 27 | 5.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 0.259259 | 27 | 2 | 18 | 13.5 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 6 |
6a91fcd1459677781a12e3e74f64879ca48ec088 | 104 | py | Python | integration/tests/multilines.py | youhavethewrong/hurl | 91cc14882a5f1ef7fa86be09a9f5581cef680559 | [
"Apache-2.0"
] | 1,013 | 2020-08-27T12:38:48.000Z | 2022-03-31T23:12:23.000Z | integration/tests/multilines.py | youhavethewrong/hurl | 91cc14882a5f1ef7fa86be09a9f5581cef680559 | [
"Apache-2.0"
] | 217 | 2020-08-31T11:18:10.000Z | 2022-03-30T17:50:30.000Z | integration/tests/multilines.py | youhavethewrong/hurl | 91cc14882a5f1ef7fa86be09a9f5581cef680559 | [
"Apache-2.0"
] | 54 | 2020-09-02T09:41:06.000Z | 2022-03-19T15:33:05.000Z | from tests import app
@app.route("/multilines")
def multilines():
return 'line1\nline2\nline3\n'
| 13 | 34 | 0.701923 | 14 | 104 | 5.214286 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034091 | 0.153846 | 104 | 7 | 35 | 14.857143 | 0.795455 | 0 | 0 | 0 | 0 | 0 | 0.313725 | 0.205882 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.25 | 0.25 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 6 |
6ad7b4330532db584e1ef655fe160d7ef732d096 | 115 | py | Python | post/admin.py | jatingupta14/cruzz | 9a00f1555cdd5c76c9ef250d7037d72d725de367 | [
"MIT"
] | 7 | 2018-11-09T14:40:54.000Z | 2019-12-20T08:10:17.000Z | post/admin.py | jatingupta14/cruzz | 9a00f1555cdd5c76c9ef250d7037d72d725de367 | [
"MIT"
] | 25 | 2018-11-30T17:38:36.000Z | 2018-12-27T17:21:09.000Z | post/admin.py | jatingupta14/cruzz | 9a00f1555cdd5c76c9ef250d7037d72d725de367 | [
"MIT"
] | 6 | 2018-12-03T14:44:29.000Z | 2018-12-26T11:49:43.000Z | # django
from django.contrib import admin
# local django
from post.models import Post
admin.site.register(Post)
| 12.777778 | 32 | 0.782609 | 17 | 115 | 5.294118 | 0.588235 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147826 | 115 | 8 | 33 | 14.375 | 0.918367 | 0.165217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 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 |
0a86b4fc5fcd07a0177ef8ecd01139e73c576574 | 795 | gyp | Python | deps/libgdal/gyp-formats/sdts.gyp | jimgambale/node-gdal | dc5c89fb23f1004732106250c8b7d57f380f9b61 | [
"Apache-2.0"
] | 1 | 2015-07-04T20:09:20.000Z | 2015-07-04T20:09:20.000Z | deps/libgdal/gyp-formats/sdts.gyp | jimgambale/node-gdal | dc5c89fb23f1004732106250c8b7d57f380f9b61 | [
"Apache-2.0"
] | null | null | null | deps/libgdal/gyp-formats/sdts.gyp | jimgambale/node-gdal | dc5c89fb23f1004732106250c8b7d57f380f9b61 | [
"Apache-2.0"
] | 2 | 2019-03-31T06:51:24.000Z | 2019-06-07T01:56:42.000Z | {
"includes": [
"../common.gypi"
],
"targets": [
{
"target_name": "libgdal_sdts_frmt",
"type": "static_library",
"sources": [
"../gdal/frmts/sdts/sdts2shp.cpp",
"../gdal/frmts/sdts/sdtsattrreader.cpp",
"../gdal/frmts/sdts/sdtscatd.cpp",
"../gdal/frmts/sdts/sdtsdataset.cpp",
"../gdal/frmts/sdts/sdtsindexedreader.cpp",
"../gdal/frmts/sdts/sdtsiref.cpp",
"../gdal/frmts/sdts/sdtslib.cpp",
"../gdal/frmts/sdts/sdtslinereader.cpp",
"../gdal/frmts/sdts/sdtspointreader.cpp",
"../gdal/frmts/sdts/sdtspolygonreader.cpp",
"../gdal/frmts/sdts/sdtsrasterreader.cpp",
"../gdal/frmts/sdts/sdtstransfer.cpp",
"../gdal/frmts/sdts/sdtsxref.cpp"
],
"include_dirs": [
"../gdal/frmts/sdts",
"../gdal/frmts/iso8211",
]
}
]
}
| 25.645161 | 47 | 0.606289 | 86 | 795 | 5.546512 | 0.372093 | 0.283019 | 0.381551 | 0.402516 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007452 | 0.155975 | 795 | 30 | 48 | 26.5 | 0.703428 | 0 | 0 | 0.066667 | 0 | 0 | 0.738365 | 0.597484 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
0adee0afc64f65e7bf2d777a538e7f71d080d76f | 13,635 | py | Python | tests/integration/test_quorum_inserts/test.py | maqroll/ClickHouse | 85cf3e798a075ea42c14b868dc1fa911b2ae06fe | [
"Apache-2.0"
] | 1 | 2020-11-03T01:50:06.000Z | 2020-11-03T01:50:06.000Z | tests/integration/test_quorum_inserts/test.py | maqroll/ClickHouse | 85cf3e798a075ea42c14b868dc1fa911b2ae06fe | [
"Apache-2.0"
] | null | null | null | tests/integration/test_quorum_inserts/test.py | maqroll/ClickHouse | 85cf3e798a075ea42c14b868dc1fa911b2ae06fe | [
"Apache-2.0"
] | null | null | null | import time
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
zero = cluster.add_instance("zero", user_configs=["configs/users.d/settings.xml"],
macros={"cluster": "anime", "shard": "0", "replica": "zero"},
with_zookeeper=True)
first = cluster.add_instance("first", user_configs=["configs/users.d/settings.xml"],
macros={"cluster": "anime", "shard": "0", "replica": "first"},
with_zookeeper=True)
second = cluster.add_instance("second", user_configs=["configs/users.d/settings.xml"],
macros={"cluster": "anime", "shard": "0", "replica": "second"},
with_zookeeper=True)
def execute_on_all_cluster(query_):
for node in [zero, first, second]:
node.query(query_)
@pytest.fixture(scope="module")
def started_cluster():
global cluster
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
def test_simple_add_replica(started_cluster):
execute_on_all_cluster("DROP TABLE IF EXISTS test_simple")
create_query = "CREATE TABLE test_simple " \
"(a Int8, d Date) " \
"Engine = ReplicatedMergeTree('/clickhouse/tables/{shard}/{table}', '{replica}') " \
"PARTITION BY d ORDER BY a"
zero.query(create_query)
first.query(create_query)
first.query("SYSTEM STOP FETCHES test_simple")
zero.query("INSERT INTO test_simple VALUES (1, '2011-01-01')", settings={'insert_quorum': 1})
assert '1\t2011-01-01\n' == zero.query("SELECT * from test_simple")
assert '' == first.query("SELECT * from test_simple")
first.query("SYSTEM START FETCHES test_simple")
first.query("SYSTEM SYNC REPLICA test_simple", timeout=20)
assert '1\t2011-01-01\n' == zero.query("SELECT * from test_simple")
assert '1\t2011-01-01\n' == first.query("SELECT * from test_simple")
second.query(create_query)
second.query("SYSTEM SYNC REPLICA test_simple", timeout=20)
assert '1\t2011-01-01\n' == zero.query("SELECT * from test_simple")
assert '1\t2011-01-01\n' == first.query("SELECT * from test_simple")
assert '1\t2011-01-01\n' == second.query("SELECT * from test_simple")
execute_on_all_cluster("DROP TABLE IF EXISTS test_simple")
def test_drop_replica_and_achieve_quorum(started_cluster):
execute_on_all_cluster("DROP TABLE IF EXISTS test_drop_replica_and_achieve_quorum")
create_query = "CREATE TABLE test_drop_replica_and_achieve_quorum " \
"(a Int8, d Date) " \
"Engine = ReplicatedMergeTree('/clickhouse/tables/{shard}/{table}', '{replica}') " \
"PARTITION BY d ORDER BY a"
print("Create Replicated table with two replicas")
zero.query(create_query)
first.query(create_query)
print("Stop fetches on one replica. Since that, it will be isolated.")
first.query("SYSTEM STOP FETCHES test_drop_replica_and_achieve_quorum")
print("Insert to other replica. This query will fail.")
quorum_timeout = zero.query_and_get_error(
"INSERT INTO test_drop_replica_and_achieve_quorum(a,d) VALUES (1, '2011-01-01')",
settings={'insert_quorum_timeout': 5000})
assert "Timeout while waiting for quorum" in quorum_timeout, "Query must fail."
assert TSV("1\t2011-01-01\n") == TSV(zero.query("SELECT * FROM test_drop_replica_and_achieve_quorum",
settings={'select_sequential_consistency': 0}))
assert TSV("") == TSV(zero.query("SELECT * FROM test_drop_replica_and_achieve_quorum",
settings={'select_sequential_consistency': 1}))
# TODO:(Mikhaylov) begin; maybe delete this lines. I want clickhouse to fetch parts and update quorum.
print("START FETCHES first replica")
first.query("SYSTEM START FETCHES test_drop_replica_and_achieve_quorum")
print("SYNC first replica")
first.query("SYSTEM SYNC REPLICA test_drop_replica_and_achieve_quorum", timeout=20)
# TODO:(Mikhaylov) end
print("Add second replica")
second.query(create_query)
print("SYNC second replica")
second.query("SYSTEM SYNC REPLICA test_drop_replica_and_achieve_quorum", timeout=20)
print("Quorum for previous insert achieved.")
assert TSV("1\t2011-01-01\n") == TSV(second.query("SELECT * FROM test_drop_replica_and_achieve_quorum",
settings={'select_sequential_consistency': 1}))
print("Now we can insert some other data.")
zero.query("INSERT INTO test_drop_replica_and_achieve_quorum(a,d) VALUES (2, '2012-02-02')")
assert TSV("1\t2011-01-01\n2\t2012-02-02\n") == TSV(
zero.query("SELECT * FROM test_drop_replica_and_achieve_quorum ORDER BY a"))
assert TSV("1\t2011-01-01\n2\t2012-02-02\n") == TSV(
first.query("SELECT * FROM test_drop_replica_and_achieve_quorum ORDER BY a"))
assert TSV("1\t2011-01-01\n2\t2012-02-02\n") == TSV(
second.query("SELECT * FROM test_drop_replica_and_achieve_quorum ORDER BY a"))
execute_on_all_cluster("DROP TABLE IF EXISTS test_drop_replica_and_achieve_quorum")
@pytest.mark.parametrize(
('add_new_data'),
[
False,
True
]
)
def test_insert_quorum_with_drop_partition(started_cluster, add_new_data):
execute_on_all_cluster("DROP TABLE IF EXISTS test_quorum_insert_with_drop_partition")
create_query = "CREATE TABLE test_quorum_insert_with_drop_partition " \
"(a Int8, d Date) " \
"Engine = ReplicatedMergeTree('/clickhouse/tables/{shard}/{table}', '{replica}') " \
"PARTITION BY d ORDER BY a "
print("Create Replicated table with three replicas")
zero.query(create_query)
first.query(create_query)
second.query(create_query)
print("Stop fetches for test_quorum_insert_with_drop_partition at first replica.")
first.query("SYSTEM STOP FETCHES test_quorum_insert_with_drop_partition")
print("Insert with quorum. (zero and second)")
zero.query("INSERT INTO test_quorum_insert_with_drop_partition(a,d) VALUES(1, '2011-01-01')")
print("Drop partition.")
zero.query("ALTER TABLE test_quorum_insert_with_drop_partition DROP PARTITION '2011-01-01'")
if (add_new_data):
print("Insert to deleted partition")
zero.query("INSERT INTO test_quorum_insert_with_drop_partition(a,d) VALUES(2, '2011-01-01')")
print("Resume fetches for test_quorum_insert_with_drop_partition at first replica.")
first.query("SYSTEM START FETCHES test_quorum_insert_with_drop_partition")
print("Sync first replica with others.")
first.query("SYSTEM SYNC REPLICA test_quorum_insert_with_drop_partition")
assert "20110101" not in first.query("SELECT * FROM system.zookeeper " \
"where path='/clickhouse/tables/0/test_quorum_insert_with_drop_partition/quorum/last_part' " \
"format Vertical")
print("Select from updated partition.")
if (add_new_data):
assert TSV("2\t2011-01-01\n") == TSV(zero.query("SELECT * FROM test_quorum_insert_with_drop_partition"))
assert TSV("2\t2011-01-01\n") == TSV(second.query("SELECT * FROM test_quorum_insert_with_drop_partition"))
else:
assert TSV("") == TSV(zero.query("SELECT * FROM test_quorum_insert_with_drop_partition"))
assert TSV("") == TSV(second.query("SELECT * FROM test_quorum_insert_with_drop_partition"))
execute_on_all_cluster("DROP TABLE IF EXISTS test_quorum_insert_with_drop_partition")
@pytest.mark.parametrize(
('add_new_data'),
[
False,
True
]
)
def test_insert_quorum_with_move_partition(started_cluster, add_new_data):
execute_on_all_cluster("DROP TABLE IF EXISTS test_insert_quorum_with_move_partition_source")
execute_on_all_cluster("DROP TABLE IF EXISTS test_insert_quorum_with_move_partition_destination")
create_source = "CREATE TABLE test_insert_quorum_with_move_partition_source " \
"(a Int8, d Date) " \
"Engine = ReplicatedMergeTree('/clickhouse/tables/{shard}/{table}', '{replica}') " \
"PARTITION BY d ORDER BY a "
create_destination = "CREATE TABLE test_insert_quorum_with_move_partition_destination " \
"(a Int8, d Date) " \
"Engine = ReplicatedMergeTree('/clickhouse/tables/{shard}/{table}', '{replica}') " \
"PARTITION BY d ORDER BY a "
print("Create source Replicated table with three replicas")
zero.query(create_source)
first.query(create_source)
second.query(create_source)
print("Create destination Replicated table with three replicas")
zero.query(create_destination)
first.query(create_destination)
second.query(create_destination)
print("Stop fetches for test_insert_quorum_with_move_partition_source at first replica.")
first.query("SYSTEM STOP FETCHES test_insert_quorum_with_move_partition_source")
print("Insert with quorum. (zero and second)")
zero.query("INSERT INTO test_insert_quorum_with_move_partition_source(a,d) VALUES(1, '2011-01-01')")
print("Drop partition.")
zero.query(
"ALTER TABLE test_insert_quorum_with_move_partition_source MOVE PARTITION '2011-01-01' TO TABLE test_insert_quorum_with_move_partition_destination")
if (add_new_data):
print("Insert to deleted partition")
zero.query("INSERT INTO test_insert_quorum_with_move_partition_source(a,d) VALUES(2, '2011-01-01')")
print("Resume fetches for test_insert_quorum_with_move_partition_source at first replica.")
first.query("SYSTEM START FETCHES test_insert_quorum_with_move_partition_source")
print("Sync first replica with others.")
first.query("SYSTEM SYNC REPLICA test_insert_quorum_with_move_partition_source")
assert "20110101" not in first.query("SELECT * FROM system.zookeeper " \
"where path='/clickhouse/tables/0/test_insert_quorum_with_move_partition_source/quorum/last_part' " \
"format Vertical")
print("Select from updated partition.")
if (add_new_data):
assert TSV("2\t2011-01-01\n") == TSV(zero.query("SELECT * FROM test_insert_quorum_with_move_partition_source"))
assert TSV("2\t2011-01-01\n") == TSV(
second.query("SELECT * FROM test_insert_quorum_with_move_partition_source"))
else:
assert TSV("") == TSV(zero.query("SELECT * FROM test_insert_quorum_with_move_partition_source"))
assert TSV("") == TSV(second.query("SELECT * FROM test_insert_quorum_with_move_partition_source"))
execute_on_all_cluster("DROP TABLE IF EXISTS test_insert_quorum_with_move_partition_source")
execute_on_all_cluster("DROP TABLE IF EXISTS test_insert_quorum_with_move_partition_destination")
def test_insert_quorum_with_ttl(started_cluster):
execute_on_all_cluster("DROP TABLE IF EXISTS test_insert_quorum_with_ttl")
create_query = "CREATE TABLE test_insert_quorum_with_ttl " \
"(a Int8, d Date) " \
"Engine = ReplicatedMergeTree('/clickhouse/tables/{table}', '{replica}') " \
"PARTITION BY d ORDER BY a " \
"TTL d + INTERVAL 5 second DELETE WHERE toYear(d) = 2011 " \
"SETTINGS merge_with_ttl_timeout=2 "
print("Create Replicated table with two replicas")
zero.query(create_query)
first.query(create_query)
print("Stop fetches for test_insert_quorum_with_ttl at first replica.")
first.query("SYSTEM STOP FETCHES test_insert_quorum_with_ttl")
print("Insert should fail since it can not reach the quorum.")
quorum_timeout = zero.query_and_get_error("INSERT INTO test_insert_quorum_with_ttl(a,d) VALUES(1, '2011-01-01')",
settings={'insert_quorum_timeout': 5000})
assert "Timeout while waiting for quorum" in quorum_timeout, "Query must fail."
print("Wait 10 seconds and TTL merge have to be executed. But it won't delete data.")
time.sleep(10)
assert TSV("1\t2011-01-01\n") == TSV(
zero.query("SELECT * FROM test_insert_quorum_with_ttl", settings={'select_sequential_consistency': 0}))
print("Resume fetches for test_insert_quorum_with_ttl at first replica.")
first.query("SYSTEM START FETCHES test_insert_quorum_with_ttl")
print("Sync first replica.")
first.query("SYSTEM SYNC REPLICA test_insert_quorum_with_ttl")
zero.query("INSERT INTO test_insert_quorum_with_ttl(a,d) VALUES(1, '2011-01-01')",
settings={'insert_quorum_timeout': 5000})
print("Inserts should resume.")
zero.query("INSERT INTO test_insert_quorum_with_ttl(a, d) VALUES(2, '2012-02-02')")
first.query("OPTIMIZE TABLE test_insert_quorum_with_ttl")
first.query("SYSTEM SYNC REPLICA test_insert_quorum_with_ttl")
zero.query("SYSTEM SYNC REPLICA test_insert_quorum_with_ttl")
assert TSV("2\t2012-02-02\n") == TSV(
first.query("SELECT * FROM test_insert_quorum_with_ttl", settings={'select_sequential_consistency': 0}))
assert TSV("2\t2012-02-02\n") == TSV(
first.query("SELECT * FROM test_insert_quorum_with_ttl", settings={'select_sequential_consistency': 1}))
execute_on_all_cluster("DROP TABLE IF EXISTS test_insert_quorum_with_ttl")
| 45.149007 | 156 | 0.686542 | 1,808 | 13,635 | 4.893252 | 0.095133 | 0.059681 | 0.072341 | 0.090426 | 0.860631 | 0.835651 | 0.806714 | 0.785012 | 0.705663 | 0.683056 | 0 | 0.033094 | 0.2044 | 13,635 | 301 | 157 | 45.299003 | 0.782448 | 0.008874 | 0 | 0.417431 | 0 | 0 | 0.544815 | 0.253793 | 0 | 0 | 0 | 0.003322 | 0.12844 | 1 | 0.03211 | false | 0 | 0.018349 | 0 | 0.050459 | 0.151376 | 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 |
e402f4ac017043a10a0a1b3ab8ac8a83969daf41 | 5,408 | py | Python | test/api/test_snapshot.py | WagPTech/grafana_api | 8a61bf64784947a3956b75c9d8326a679457d7bd | [
"MIT"
] | 107 | 2017-12-29T13:18:44.000Z | 2022-01-06T09:34:35.000Z | test/api/test_snapshot.py | WagPTech/grafana_api | 8a61bf64784947a3956b75c9d8326a679457d7bd | [
"MIT"
] | 75 | 2018-03-31T15:45:42.000Z | 2022-03-21T10:20:31.000Z | test/api/test_snapshot.py | WagPTech/grafana_api | 8a61bf64784947a3956b75c9d8326a679457d7bd | [
"MIT"
] | 76 | 2018-03-31T15:18:02.000Z | 2022-03-16T20:12:38.000Z | import unittest
import requests_mock
from grafana_api.grafana_face import GrafanaFace
class SnapshotTestCase(unittest.TestCase):
def setUp(self):
self.cli = GrafanaFace(
("admin", "admin"), host="localhost", url_path_prefix="", protocol="http"
)
@requests_mock.Mocker()
def test_create_new_snapshot(self, m):
m.post(
"http://localhost/api/snapshots",
json={
"deleteKey": "XXXXXXX",
"deleteUrl": "myurl/api/snapshots.py-delete/XXXXXXX",
"key": "YYYYYYY",
"url": "myurl/dashboard/snapshot/YYYYYYY"
},
)
snapshot = self.cli.snapshots.create_new_snapshot(dashboard={
"editable": "false",
"hideControls": "true",
"nav": [
{
"enable": "false",
"type": "timepicker"
}
],
"rows": [
{
}
],
"style": "dark",
"tags": [],
"templating": {
"list": [
]
},
"time": {
},
"timezone": "browser",
"title": "Home",
"version": 5
}, name="Test", key="YYYYYYY", delete_key="XXXXXXX", external=True, expires=3600)
self.assertEqual(snapshot["key"], "YYYYYYY")
@requests_mock.Mocker()
def test_create_new_snapshot_without_optional(self, m):
m.post(
"http://localhost/api/snapshots",
json={
"deleteKey": "XXXXXXX",
"deleteUrl": "myurl/api/snapshots.py-delete/XXXXXXX",
"key": "YYYYYYY",
"url": "myurl/dashboard/snapshot/YYYYYYY"
},
)
snapshot = self.cli.snapshots.create_new_snapshot(dashboard={
"editable": "false",
"hideControls": "true",
"nav": [
{
"enable": "false",
"type": "timepicker"
}
],
"rows": [
{
}
],
"style": "dark",
"tags": [],
"templating": {
"list": [
]
},
"time": {
},
"timezone": "browser",
"title": "Home",
"version": 5
})
self.assertEqual(snapshot["key"], "YYYYYYY")
@requests_mock.Mocker()
def test_get_dashboard_snapshots(self, m):
m.get(
"http://localhost/api/dashboard/snapshots",
json=[
{
"id": 8,
"name": "Home",
"key": "YYYYYYY",
"orgId": 1,
"userId": 1,
"external": False,
"externalUrl": "",
"expires": "2200-13-32T25:23:23+02:00",
"created": "2200-13-32T28:24:23+02:00",
"updated": "2200-13-32T28:24:23+02:00"
}
]
)
dashboards = self.cli.snapshots.get_dashboard_snapshots()
self.assertEqual(len(dashboards), 1)
@requests_mock.Mocker()
def test_get_snapshot_by_key(self, m):
m.get(
"http://localhost/api/snapshots/YYYYYYY",
json=[
{
"id": 8,
"name": "Home",
"key": "YYYYYYY",
"orgId": 1,
"userId": 1,
"external": False,
"externalUrl": "",
"expires": "2200-13-32T25:23:23+02:00",
"created": "2200-13-32T28:24:23+02:00",
"updated": "2200-13-32T28:24:23+02:00"
}
]
)
dashboards = self.cli.snapshots.get_snapshot_by_key(key="YYYYYYY")
self.assertEqual(len(dashboards), 1)
@requests_mock.Mocker()
def test_delete_snapshot_by_key(self, m):
m.delete('http://localhost/api/snapshots/YYYYYYY', json={"message": "Snapshot deleted. It might take an hour "
"before it's cleared from any CDN "
"caches."})
annotation = self.cli.snapshots.delete_snapshot_by_key(snapshot_id="YYYYYYY")
self.assertEqual(annotation['message'], "Snapshot deleted. It might take an hour before it's cleared from any "
"CDN caches.")
@requests_mock.Mocker()
def test_delete_snapshot_by_delete_key(self, m):
m.get('http://localhost/api/snapshots-delete/XXXXXXX', json={"message": "Snapshot deleted. It might take an hour "
"before it's cleared from any CDN "
"caches."})
annotation = self.cli.snapshots.delete_snapshot_by_delete_key(snapshot_delete_key="XXXXXXX")
self.assertEqual(annotation['message'], "Snapshot deleted. It might take an hour before it's cleared from any "
"CDN caches.")
| 35.116883 | 122 | 0.43676 | 452 | 5,408 | 5.103982 | 0.230089 | 0.034677 | 0.046814 | 0.054616 | 0.826181 | 0.819679 | 0.791938 | 0.781101 | 0.730819 | 0.698743 | 0 | 0.039935 | 0.435096 | 5,408 | 153 | 123 | 35.346405 | 0.715221 | 0 | 0 | 0.642857 | 0 | 0 | 0.259478 | 0.053264 | 0 | 0 | 0 | 0 | 0.042857 | 1 | 0.05 | false | 0 | 0.021429 | 0 | 0.078571 | 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 |
e4030b4aea2f04ae8e4fc24f8e8f32ca53363ccd | 27 | py | Python | src/staticlocal/__init__.py | billsix/staticlocal | fe99ec9008a0c248830b17551ffd9ae1e4a0ca3e | [
"MIT"
] | null | null | null | src/staticlocal/__init__.py | billsix/staticlocal | fe99ec9008a0c248830b17551ffd9ae1e4a0ca3e | [
"MIT"
] | null | null | null | src/staticlocal/__init__.py | billsix/staticlocal | fe99ec9008a0c248830b17551ffd9ae1e4a0ca3e | [
"MIT"
] | null | null | null | from .staticlocal import *
| 13.5 | 26 | 0.777778 | 3 | 27 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 27 | 1 | 27 | 27 | 0.913043 | 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 |
7c5bb3a53679ff8c1a39b8c521e9d18078902e15 | 137 | py | Python | tests/conftest.py | StarfishPlatform/starfish-shells | 402f42770d57c83abe70122c621a0407f33cb2f4 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | StarfishPlatform/starfish-shells | 402f42770d57c83abe70122c621a0407f33cb2f4 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | StarfishPlatform/starfish-shells | 402f42770d57c83abe70122c621a0407f33cb2f4 | [
"Apache-2.0"
] | null | null | null | from .mock import mock_server, mock_starfish
# Noop, prevent "not used" cleanup
mock_server = mock_server
mock_starfish = mock_starfish
| 22.833333 | 44 | 0.810219 | 20 | 137 | 5.25 | 0.5 | 0.285714 | 0.4 | 0.419048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131387 | 137 | 5 | 45 | 27.4 | 0.882353 | 0.233577 | 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 |
7c7211ee2e54290f43b9f39573ea2aeba98c8b27 | 156 | py | Python | IMQ_server/src/main/python/db/topic_entity.py | snehseel/imq | 13bf0ef4a0c2f38cba9173b09d69248ee6ec51d7 | [
"MIT"
] | null | null | null | IMQ_server/src/main/python/db/topic_entity.py | snehseel/imq | 13bf0ef4a0c2f38cba9173b09d69248ee6ec51d7 | [
"MIT"
] | null | null | null | IMQ_server/src/main/python/db/topic_entity.py | snehseel/imq | 13bf0ef4a0c2f38cba9173b09d69248ee6ec51d7 | [
"MIT"
] | null | null | null | class Topic_entity:
def topic_name(self, value):
self.topic_name = value
def topic_status(self, value):
self.topic_status = value
| 19.5 | 34 | 0.660256 | 21 | 156 | 4.666667 | 0.380952 | 0.163265 | 0.265306 | 0.367347 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25641 | 156 | 7 | 35 | 22.285714 | 0.844828 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 6 |
7c9d37a0083fe0f315c2f6b7e8debf228550347f | 6,524 | py | Python | BrainMaGe/models/networks.py | Terf/BrainMaGe | a824baf39404afd4e79a13ae7ea1c9e603b0469e | [
"BSD-3-Clause"
] | null | null | null | BrainMaGe/models/networks.py | Terf/BrainMaGe | a824baf39404afd4e79a13ae7ea1c9e603b0469e | [
"BSD-3-Clause"
] | null | null | null | BrainMaGe/models/networks.py | Terf/BrainMaGe | a824baf39404afd4e79a13ae7ea1c9e603b0469e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 24 06:16:01 2020
@author: siddhesh
"""
import torch.nn as nn
import torch
from BrainMaGe.models.seg_modules import in_conv, DownsamplingModule, EncodingModule
from BrainMaGe.models.seg_modules import UpsamplingModule, DecodingModule
from BrainMaGe.models.seg_modules import out_conv, FCNUpsamplingModule
class unet(nn.Module):
def __init__(self, n_channels, n_classes, base_filters=16):
super(unet, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.ins = in_conv(self.n_channels, base_filters)
self.ds_0 = DownsamplingModule(base_filters, base_filters*2)
self.en_1 = EncodingModule(base_filters*2, base_filters*2)
self.ds_1 = DownsamplingModule(base_filters*2, base_filters*4)
self.en_2 = EncodingModule(base_filters*4, base_filters*4)
self.ds_2 = DownsamplingModule(base_filters*4, base_filters*8)
self.en_3 = EncodingModule(base_filters*8, base_filters*8)
self.ds_3 = DownsamplingModule(base_filters*8, base_filters*16)
self.en_4 = EncodingModule(base_filters*16, base_filters*16)
self.us_3 = UpsamplingModule(base_filters*16, base_filters*8)
self.de_3 = DecodingModule(base_filters*16, base_filters*8)
self.us_2 = UpsamplingModule(base_filters*8, base_filters*4)
self.de_2 = DecodingModule(base_filters*8, base_filters*4)
self.us_1 = UpsamplingModule(base_filters*4, base_filters*2)
self.de_1 = DecodingModule(base_filters*4, base_filters*2)
self.us_0 = UpsamplingModule(base_filters*2, 16)
self.out = out_conv(base_filters*2, self.n_classes-1)
def forward(self, x):
x1 = self.ins(x)
x2 = self.ds_0(x1)
x2 = self.en_1(x2)
x3 = self.ds_1(x2)
x3 = self.en_2(x3)
x4 = self.ds_2(x3)
x4 = self.en_3(x4)
x5 = self.ds_3(x4)
x5 = self.en_4(x5)
x = self.us_3(x5)
x = self.de_3(x, x4)
x = self.us_2(x)
x = self.de_2(x, x3)
x = self.us_1(x)
x = self.de_1(x, x2)
x = self.us_0(x)
x = self.out(x, x1)
return x
class resunet(nn.Module):
def __init__(self, n_channels, n_classes, base_filters=16):
super(resunet, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.ins = in_conv(self.n_channels, base_filters, res=True)
self.ds_0 = DownsamplingModule(base_filters, base_filters*2)
self.en_1 = EncodingModule(base_filters*2, base_filters*2, res=True)
self.ds_1 = DownsamplingModule(base_filters*2, base_filters*4)
self.en_2 = EncodingModule(base_filters*4, base_filters*4, res=True)
self.ds_2 = DownsamplingModule(base_filters*4, base_filters*8)
self.en_3 = EncodingModule(base_filters*8, base_filters*8, res=True)
self.ds_3 = DownsamplingModule(base_filters*8, base_filters*16)
self.en_4 = EncodingModule(base_filters*16, base_filters*16, res=True)
self.us_3 = UpsamplingModule(base_filters*16, base_filters*8)
self.de_3 = DecodingModule(base_filters*16, base_filters*8, res=True)
self.us_2 = UpsamplingModule(base_filters*8, base_filters*4)
self.de_2 = DecodingModule(base_filters*8, base_filters*4, res=True)
self.us_1 = UpsamplingModule(base_filters*4, base_filters*2)
self.de_1 = DecodingModule(base_filters*4, base_filters*2, res=True)
self.us_0 = UpsamplingModule(base_filters*2, base_filters)
self.out = out_conv(base_filters*2, self.n_classes-1, res=True)
def forward(self, x):
x1 = self.ins(x)
x2 = self.ds_0(x1)
x2 = self.en_1(x2)
x3 = self.ds_1(x2)
x3 = self.en_2(x3)
x4 = self.ds_2(x3)
x4 = self.en_3(x4)
x5 = self.ds_3(x4)
x5 = self.en_4(x5)
x = self.us_3(x5)
x = self.de_3(x, x4)
x = self.us_2(x)
x = self.de_2(x, x3)
x = self.us_1(x)
x = self.de_1(x, x2)
x = self.us_0(x)
x = self.out(x, x1)
return x
class fcn(nn.Module):
def __init__(self, n_channels, n_classes, base_filters=16):
super(fcn, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.ins = in_conv(self.n_channels, base_filters)
self.ds_0 = DownsamplingModule(base_filters, base_filters*2)
self.en_1 = EncodingModule(base_filters*2, base_filters*2)
self.ds_1 = DownsamplingModule(base_filters*2, base_filters*4)
self.en_2 = EncodingModule(base_filters*4, base_filters*4)
self.ds_2 = DownsamplingModule(base_filters*4, base_filters*8)
self.en_3 = EncodingModule(base_filters*8, base_filters*8)
self.ds_3 = DownsamplingModule(base_filters*8, base_filters*16)
self.en_4 = EncodingModule(base_filters*16, base_filters*16)
self.us_4 = FCNUpsamplingModule(base_filters*16, 1, scale_factor=5)
self.us_3 = FCNUpsamplingModule(base_filters*8, 1, scale_factor=4)
self.us_2 = FCNUpsamplingModule(base_filters*4, 1, scale_factor=3)
self.us_1 = FCNUpsamplingModule(base_filters*2, 1, scale_factor=2)
self.us_0 = FCNUpsamplingModule(base_filters, 1, scale_factor=1)
self.conv_0 = nn.Conv3d(in_channels=5, out_channels=self.n_classes-1,
kernel_size=1, stride=1, padding=0, bias=True)
def forward(self, x):
x1 = self.ins(x)
x2 = self.ds_0(x1)
x2 = self.en_1(x2)
x3 = self.ds_1(x2)
x3 = self.en_2(x3)
x4 = self.ds_2(x3)
x4 = self.en_3(x4)
x5 = self.ds_3(x4)
x5 = self.en_4(x5)
u5 = self.us_4(x5)
u4 = self.us_3(x4)
u3 = self.us_2(x3)
u2 = self.us_1(x2)
u1 = self.us_0(x1)
x = torch.cat([u5, u4, u3, u2, u1], dim=1)
x = self.conv_0(x)
return torch.sigmoid(x)
def fetch_model(modelname, num_channels, num_classes, num_filters):
if modelname == 'resunet':
model = resunet(num_channels, num_classes, num_filters)
elif modelname == 'unet':
model = resunet(num_channels, num_classes, num_filters)
elif modelname == 'fcn':
model = fcn(num_channels, num_classes, num_filters)
else:
raise ValueError('Check Model spelling, should be one of resunet, unet, fcn in the config'+\
'file!')
return model
| 40.775 | 100 | 0.645616 | 994 | 6,524 | 3.980885 | 0.104628 | 0.24463 | 0.063685 | 0.040435 | 0.791509 | 0.788729 | 0.735911 | 0.718221 | 0.718221 | 0.718221 | 0 | 0.059677 | 0.23973 | 6,524 | 159 | 101 | 41.031447 | 0.738105 | 0.015021 | 0 | 0.635037 | 0 | 0 | 0.014025 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.051095 | false | 0 | 0.036496 | 0 | 0.138686 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
6b0b01553f84f3f70d1e6adef28c41ac1866ddca | 85 | py | Python | subrename/main.py | kevinzg/subrename | 1785ea2112f34c8cfaeabcf3e2d8faa52dc2bec9 | [
"MIT"
] | null | null | null | subrename/main.py | kevinzg/subrename | 1785ea2112f34c8cfaeabcf3e2d8faa52dc2bec9 | [
"MIT"
] | 3 | 2020-03-31T09:51:49.000Z | 2021-06-02T00:41:03.000Z | subrename/main.py | kevinzg/subrename | 1785ea2112f34c8cfaeabcf3e2d8faa52dc2bec9 | [
"MIT"
] | null | null | null | import fire
from .subrename import Subrename
def main():
fire.Fire(Subrename)
| 10.625 | 32 | 0.729412 | 11 | 85 | 5.636364 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.188235 | 85 | 7 | 33 | 12.142857 | 0.898551 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.5 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
860d6cd6674b59bb72c2c6c38fa086d390c46f32 | 106 | py | Python | Lab_2/bae.py | gradampl/MONTY | db8646b0fdb1f7220b0417ee1e2d72da2e07bfd0 | [
"MIT"
] | null | null | null | Lab_2/bae.py | gradampl/MONTY | db8646b0fdb1f7220b0417ee1e2d72da2e07bfd0 | [
"MIT"
] | null | null | null | Lab_2/bae.py | gradampl/MONTY | db8646b0fdb1f7220b0417ee1e2d72da2e07bfd0 | [
"MIT"
] | null | null | null | numbers = [1,2,3,1,2,5,6,7,3,9,2,8,11,7]
print(list(set(numbers)))
# Result: [1, 2, 3, 5, 6, 7, 8, 9, 11] | 26.5 | 40 | 0.537736 | 29 | 106 | 1.965517 | 0.482759 | 0.105263 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.274725 | 0.141509 | 106 | 4 | 41 | 26.5 | 0.351648 | 0.339623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 6 |
861b9873378c4b279e41c69ad5bc8369572c456a | 170,866 | py | Python | tests/adapters/test_kraken_trading_adapter.py | SwamyDev/datums-warehouse | ee7530d4e11d40932328ae2513dd205d2c563491 | [
"MIT"
] | null | null | null | tests/adapters/test_kraken_trading_adapter.py | SwamyDev/datums-warehouse | ee7530d4e11d40932328ae2513dd205d2c563491 | [
"MIT"
] | null | null | null | tests/adapters/test_kraken_trading_adapter.py | SwamyDev/datums-warehouse | ee7530d4e11d40932328ae2513dd205d2c563491 | [
"MIT"
] | null | null | null | import pytest
from datums_warehouse.broker.adapters import KrakenAdapter
from datums_warehouse.broker.source import get_trades
from datums_warehouse.broker.validation import DataError
EXPECTED_OHLC = "timestamp,open,high,low,close,vwap,volume,count\n" \
"1571122800,7537.3,7564.8,7533.9,7557.6,7556.0,53.98027612,264\n" \
"1571124600,7557.0,7557.0,7521.5,7531.5,7539.1,75.68998155,377"
OTHER = '{"error":[],"result":{"XXBTZEUR":[["7563.60000","0.01830351",1571121079.057,"s","l",""],["7563.80000","0.00600000",1571121095.0604,"b","m",""],["7566.00000","0.02843955",1571121095.0717,"b","m",""],["7566.60000","0.07598088",1571121095.0745,"b","m",""],["7566.70000","0.04782605",1571121095.0781,"b","m",""],["7563.70000","0.05000000",1571121097.2624,"s","l",""],["7563.50000","0.07500000",1571121099.8753,"s","l",""],["7563.90000","0.01626325",1571121104.4257,"b","m",""],["7563.00000","0.02044135",1571121109.9838,"s","l",""],["7562.80000","0.00916404",1571121126.4425,"b","l",""],["7561.30000","0.02044135",1571121152.1332,"s","l",""],["7561.10000","0.02044135",1571121155.6053,"s","l",""],["7561.10000","0.02044135",1571121159.421,"s","l",""],["7561.10000","0.01595240",1571121159.6807,"s","l",""],["7561.10000","0.00924437",1571121161.2461,"s","l",""],["7561.10000","0.02281900",1571121166.0734,"s","l",""],["7561.10000","0.00282268",1571121167.176,"s","l",""],["7561.10000","0.02044033",1571121173.523,"s","l",""],["7561.10000","0.02044033",1571121174.8605,"s","l",""],["7561.50000","0.01559570",1571121184.1755,"b","l",""],["7561.40000","0.01703168",1571121191.2254,"s","l",""],["7561.60000","0.02026581",1571121202.8104,"b","l",""],["7561.50000","0.03418279",1571121203.2146,"b","l",""],["7561.10000","0.00298326",1571121218.7672,"s","l",""],["7561.10000","1.75494493",1571121221.1171,"s","l",""],["7561.00000","0.10000000",1571121222.2407,"s","l",""],["7560.80000","0.92001302",1571121222.2491,"s","l",""],["7560.00000","0.03945200",1571121222.2522,"s","l",""],["7560.00000","0.10690831",1571121222.2565,"s","l",""],["7560.00000","0.11210742",1571121222.2604,"s","l",""],["7560.00000","0.29054042",1571121222.2645,"s","l",""],["7558.80000","0.01653000",1571121229.5673,"s","l",""],["7559.90000","0.00393253",1571121246.4348,"s","l",""],["7555.30000","0.00999600",1571121283.9276,"s","m",""],["7555.20000","0.25000400",1571121283.9351,"s","m",""],["7557.80000","0.01276912",1571121301.525,"b","m",""],["7557.80000","0.00604200",1571121308.5468,"b","m",""],["7555.30000","0.06135781",1571121332.3198,"b","l",""],["7555.10000","0.06135781",1571121334.9264,"b","l",""],["7555.10000","0.00200000",1571121335.2595,"b","m",""],["7554.60000","0.00500000",1571121338.3874,"s","m",""],["7555.00000","0.06135781",1571121339.35,"b","l",""],["7554.60000","0.00446081",1571121340.3595,"s","m",""],["7554.80000","0.02045260",1571121341.0708,"b","l",""],["7554.80000","0.06135781",1571121342.8874,"b","l",""],["7554.80000","0.06135781",1571121344.6143,"b","l",""],["7554.80000","0.02045260",1571121346.1853,"b","l",""],["7555.10000","0.02258400",1571121349.1545,"s","l",""],["7555.30000","0.01129200",1571121362.8161,"b","m",""],["7555.40000","0.01283581",1571121362.8817,"b","m",""],["7555.40000","0.00542940",1571121363.2054,"b","m",""],["7555.40000","0.00275512",1571121363.9074,"b","m",""],["7554.90000","0.02045260",1571121372.8326,"b","l",""],["7555.20000","0.02045260",1571121374.3878,"b","l",""],["7555.20000","0.02045260",1571121375.6795,"b","l",""],["7554.60000","0.02366203",1571121389.6365,"s","l",""],["7552.80000","0.02045260",1571121392.7031,"b","l",""],["7552.70000","0.02063000",1571121393.052,"s","l",""],["7552.20000","0.04634104",1571121414.7057,"b","l",""],["7552.20000","0.00800000",1571121424.9861,"b","m",""],["7551.80000","0.02063000",1571121440.2362,"s","l",""],["7551.00000","0.01119126",1571121441.3785,"s","l",""],["7551.00000","2.48880874",1571121441.384,"s","l",""],["7550.60000","0.26771366",1571121443.4601,"s","l",""],["7550.00000","0.02063000",1571121444.5646,"s","l",""],["7548.90000","0.16540000",1571121464.174,"b","m",""],["7548.10000","0.02063000",1571121477.948,"s","m",""],["7547.10000","0.97937000",1571121477.967,"s","m",""],["7548.20000","0.02887368",1571121485.9162,"b","l",""],["7547.90000","0.00752537",1571121519.8178,"b","m",""],["7547.70000","0.00707298",1571121541.5542,"b","m",""],["7547.60000","0.00200000",1571121542.8033,"b","m",""],["7547.60000","0.10230480",1571121544.3676,"b","l",""],["7547.60000","0.00593950",1571121544.9451,"b","l",""],["7547.60000","0.00358103",1571121545.5125,"b","l",""],["7547.60000","0.01423747",1571121545.5206,"b","l",""],["7547.60000","0.01187900",1571121546.0891,"b","l",""],["7547.60000","0.14848750",1571121546.672,"b","l",""],["7547.60000","0.01187900",1571121547.2419,"b","l",""],["7545.90000","0.29355053",1571121589.2476,"s","m",""],["7545.90000","0.05054100",1571121589.2615,"s","m",""],["7545.90000","0.03626874",1571121589.264,"s","m",""],["7545.90000","0.14769582",1571121589.2666,"s","m",""],["7545.80000","0.09949213",1571121595.0736,"s","m",""],["7545.80000","0.00025787",1571121595.1005,"s","m",""],["7546.40000","0.25000000",1571121596.8867,"b","l",""],["7546.40000","0.01325135",1571121638.1002,"b","m",""],["7546.30000","0.03099910",1571121640.7781,"b","l",""],["7547.60000","0.17900000",1571121693.8747,"s","l",""],["7548.20000","0.36451078",1571121697.429,"s","l",""],["7547.80000","0.20548922",1571121697.4521,"s","l",""],["7548.30000","0.00600000",1571121702.0446,"b","m",""],["7548.30000","0.02000000",1571121704.1558,"b","m",""],["7552.00000","0.00224004",1571121712.4075,"b","m",""],["7552.00000","0.10000000",1571121720.8428,"b","m",""],["7552.00000","0.06018761",1571121723.0659,"b","m",""],["7552.00000","0.01057235",1571121735.3513,"b","m",""],["7552.00000","0.01135709",1571121735.3875,"b","m",""],["7551.60000","0.03787662",1571121797.5272,"b","m",""],["7552.00000","0.06212338",1571121797.5574,"b","m",""],["7552.00000","0.00530000",1571121803.5597,"b","m",""],["7552.00000","0.00300000",1571121815.2643,"b","l",""],["7550.10000","0.17589069",1571121830.839,"b","m",""],["7550.10000","0.00110931",1571121840.1819,"b","l",""],["7550.10000","0.01210120",1571121840.1947,"b","l",""],["7550.10000","0.07284000",1571121858.0874,"b","l",""],["7550.00000","0.00894100",1571121899.488,"s","l",""],["7550.00000","0.00683468",1571121901.7297,"s","m",""],["7550.00000","1.87269812",1571121904.8314,"s","l",""],["7550.00000","0.01500000",1571121904.8449,"s","l",""],["7547.60000","0.50200000",1571121911.7517,"b","l",""],["7547.60000","0.35700000",1571121911.7597,"b","l",""],["7547.90000","0.70480451",1571121911.7622,"b","l",""],["7547.50000","0.55500000",1571121945.8717,"b","l",""],["7547.50000","0.26800000",1571121945.9109,"b","l",""],["7547.60000","0.15600000",1571121945.9132,"b","l",""],["7547.80000","3.02039765",1571121945.9156,"b","l",""],["7546.30000","0.01940716",1571121949.3996,"s","l",""],["7546.30000","0.00004284",1571121949.4059,"s","l",""],["7546.40000","0.00610000",1571121980.0508,"b","m",""],["7546.30000","0.98105000",1571121985.975,"s","l",""],["7546.10000","0.02000000",1571121988.0743,"s","l",""],["7545.10000","0.02063000",1571122006.0326,"s","l",""],["7542.40000","0.00716200",1571122012.5754,"s","l",""],["7540.00000","0.04347300",1571122012.5864,"s","l",""],["7540.00000","0.60652700",1571122012.5963,"s","m",""],["7539.60000","0.10387368",1571122012.6009,"s","m",""],["7539.50000","1.78959932",1571122012.6036,"s","m",""],["7540.40000","0.16000000",1571122014.7662,"b","l",""],["7537.90000","0.02020000",1571122027.6211,"s","l",""],["7537.90000","0.02021000",1571122027.6292,"s","l",""],["7537.90000","0.02021000",1571122027.6318,"s","l",""],["7537.90000","0.02021000",1571122027.6348,"s","l",""],["7537.30000","0.01200000",1571122028.7284,"s","l",""],["7536.50000","0.00577908",1571122028.7352,"s","l",""],["7535.00000","0.10000000",1571122029.9406,"s","l",""],["7530.10000","0.00997407",1571122029.9593,"s","m",""],["7530.10000","0.00002586",1571122029.9623,"s","m",""],["7530.10000","0.00000007",1571122029.9645,"s","m",""],["7530.30000","0.08041800",1571122070.598,"s","l",""],["7530.30000","0.04040492",1571122074.1312,"s","m",""],["7530.30000","0.00009508",1571122074.139,"s","m",""],["7536.20000","0.00980333",1571122122.6258,"s","l",""],["7536.20000","0.01435867",1571122122.6544,"s","l",""],["7536.20000","0.11370126",1571122128.9159,"s","l",""],["7536.20000","0.18629874",1571122128.931,"s","l",""],["7536.30000","0.00300000",1571122144.5627,"b","m",""],["7536.30000","0.01406000",1571122164.9226,"b","l",""],["7536.30000","0.02782000",1571122171.1596,"b","m",""],["7536.20000","0.01569999",1571122174.9389,"s","m",""],["7533.00000","0.00850671",1571122174.9448,"s","m",""],["7534.50000","0.13345400",1571122177.2497,"s","m",""],["7534.50000","0.00610000",1571122177.6562,"s","l",""],["7534.90000","0.00200000",1571122201.615,"b","m",""],["7534.90000","0.02515400",1571122202.5035,"b","m",""],["7534.90000","0.01674392",1571122202.8452,"b","m",""],["7534.60000","0.00995533",1571122204.0148,"b","m",""],["7534.60000","0.00443774",1571122204.0921,"b","m",""],["7534.50000","0.01591200",1571122207.7389,"b","l",""],["7534.50000","0.10676499",1571122207.7416,"b","l",""],["7533.30000","0.04312700",1571122217.6852,"s","l",""],["7533.30000","0.01113772",1571122217.998,"s","l",""],["7533.20000","0.00967177",1571122230.3053,"s","l",""],["7533.40000","0.02000000",1571122254.7378,"s","m",""],["7533.60000","0.00999600",1571122265.1615,"s","l",""],["7533.50000","0.08780395",1571122265.1666,"s","l",""],["7535.80000","0.09600000",1571122310.131,"b","m",""],["7535.70000","0.00999600",1571122316.2364,"s","m",""],["7535.70000","0.17000000",1571122316.246,"s","m",""],["7535.10000","0.28109379",1571122316.2492,"s","m",""],["7535.10000","0.03891021",1571122316.2564,"s","m",""],["7535.70000","0.01256121",1571122321.8793,"b","m",""],["7535.10000","0.31598876",1571122328.9457,"s","m",""],["7535.10000","0.32490800",1571122328.9503,"s","m",""],["7535.10000","0.01100000",1571122328.9539,"s","m",""],["7533.60000","0.04259727",1571122328.9563,"s","m",""],["7533.50000","0.03328935",1571122328.9584,"s","m",""],["7533.50000","0.00007662",1571122328.9604,"s","m",""],["7534.60000","0.02856711",1571122345.3041,"s","l",""],["7535.10000","0.03000000",1571122352.802,"b","l",""],["7538.00000","0.00900000",1571122360.2079,"b","m",""],["7538.40000","0.03313921",1571122365.162,"b","m",""],["7538.00000","0.00599793",1571122374.9704,"s","l",""],["7538.10000","0.01077572",1571122375.848,"s","l",""],["7539.10000","0.02855006",1571122385.5144,"s","l",""],["7539.30000","0.75984406",1571122387.4653,"s","l",""],["7539.20000","0.12699480",1571122387.4738,"s","l",""],["7539.20000","0.00646433",1571122387.4767,"s","l",""],["7539.20000","0.41562402",1571122387.4789,"s","l",""],["7539.20000","0.00107279",1571122387.4809,"s","l",""],["7539.60000","0.05000000",1571122392.3658,"s","m",""],["7539.70000","0.00592699",1571122396.5908,"s","l",""],["7540.70000","0.02129864",1571122414.5568,"s","l",""],["7540.00000","0.28870136",1571122414.5679,"s","l",""],["7540.00000","0.00956215",1571122417.2769,"s","m",""],["7540.90000","0.00612739",1571122431.6965,"b","l",""],["7540.90000","0.00777708",1571122441.9358,"b","m",""],["7540.90000","0.00606080",1571122470.2043,"b","m",""],["7540.90000","0.00756350",1571122500.1774,"b","l",""],["7540.90000","0.01211760",1571122501.0309,"b","m",""],["7540.90000","0.00654629",1571122501.7396,"b","m",""],["7540.80000","0.01000000",1571122533.4715,"s","m",""],["7540.00000","0.72827773",1571122533.4804,"s","m",""],["7538.70000","0.62450865",1571122533.4838,"s","m",""],["7540.70000","0.01111038",1571122533.858,"b","m",""],["7538.80000","0.01255778",1571122561.8984,"b","m",""],["7538.70000","0.01512009",1571122571.408,"s","m",""],["7537.00000","0.01000000",1571122571.4209,"s","m",""],["7535.50000","0.01000000",1571122571.4241,"s","m",""],["7535.20000","0.03362500",1571122571.4271,"s","m",""],["7533.60000","0.97000000",1571122571.431,"s","m",""],["7532.40000","0.04000000",1571122571.434,"s","m",""],["7532.40000","0.03790000",1571122571.4364,"s","m",""],["7532.30000","0.24300000",1571122571.439,"s","m",""],["7532.10000","0.14035491",1571122571.4422,"s","m",""],["7534.40000","0.04950000",1571122576.8297,"s","l",""],["7534.50000","0.00200000",1571122582.1605,"b","m",""],["7534.40000","0.00608795",1571122586.2395,"s","m",""],["7534.50000","0.50000000",1571122608.3986,"b","l",""],["7534.40000","0.01927000",1571122613.8304,"s","m",""],["7534.50000","0.00670468",1571122621.8203,"b","m",""],["7533.00000","0.02342138",1571122629.3856,"b","l",""],["7534.40000","1.18000000",1571122629.3949,"b","l",""],["7534.50000","0.12357862",1571122629.3987,"b","l",""],["7535.50000","0.01064932",1571122659.5597,"s","l",""],["7535.00000","0.08935068",1571122659.5631,"s","l",""],["7535.20000","0.02366900",1571122682.2715,"s","l",""],["7535.20000","0.01819180",1571122690.2203,"b","m",""],["7534.80000","0.00200000",1571122704.296,"s","l",""],["7535.40000","0.04000000",1571122720.219,"b","m",""],["7535.50000","0.02997156",1571122720.2328,"b","m",""],["7535.50000","0.01055034",1571122725.031,"b","l",""],["7533.70000","0.02871091",1571122738.0571,"s","l",""],["7535.10000","0.06879144",1571122757.5603,"b","m",""],["7535.10000","0.00010856",1571122757.5707,"b","m",""],["7535.10000","0.00614740",1571122757.573,"b","m",""],["7535.10000","0.09385260",1571122758.4591,"b","m",""],["7535.50000","0.12014740",1571122758.4658,"b","m",""],["7534.80000","0.01000000",1571122766.1336,"s","l",""],["7534.70000","0.28493200",1571122766.1427,"s","l",""],["7534.70000","0.26389300",1571122773.1149,"s","l",""],["7535.50000","0.01153070",1571122782.9694,"b","m",""],["7535.80000","0.02895000",1571122782.9773,"b","m",""],["7537.30000","1.00000000",1571122782.9801,"b","m",""],["7538.30000","0.80000000",1571122782.9823,"b","m",""],["7538.30000","0.20100000",1571122782.9845,"b","m",""],["7538.40000","0.03673000",1571122782.9872,"b","m",""],["7538.60000","0.03673000",1571122782.9894,"b","m",""],["7538.70000","0.32989565",1571122782.9918,"b","m",""],["7538.70000","0.03692359",1571122782.9948,"b","m",""],["7537.10000","0.37500000",1571122795.1351,"s","l",""],["7537.00000","0.02098600",1571122795.1471,"s","l",""],["7537.30000","0.10393000",1571122808.1487,"s","l",""],["7537.30000","0.15755973",1571122815.8118,"s","m",""],["7538.90000","0.02840000",1571122831.9393,"b","m",""],["7538.40000","0.12731491",1571122847.3291,"b","m",""],["7539.60000","0.04619178",1571122847.3466,"b","m",""],["7538.00000","0.00926144",1571122850.5876,"s","m",""],["7538.00000","0.00001856",1571122850.5908,"s","m",""],["7539.20000","0.09718106",1571122890.5735,"b","m",""],["7538.90000","0.06829746",1571122921.8678,"b","m",""],["7538.90000","0.00202805",1571122921.8843,"b","m",""],["7539.00000","0.03044536",1571122921.8869,"b","m",""],["7537.40000","0.00960760",1571122926.8741,"s","m",""],["7537.00000","0.02771040",1571122953.6901,"s","l",""],["7537.00000","0.01547500",1571122965.2415,"s","l",""],["7537.00000","0.00664200",1571122969.2615,"s","l",""],["7537.00000","0.00848600",1571122973.2672,"s","l",""],["7537.10000","0.03496251",1571122981.8198,"b","m",""],["7537.00000","0.02869834",1571122982.5344,"s","l",""],["7537.00000","0.00566908",1571122984.0568,"s","l",""],["7537.00000","0.00566908",1571122984.172,"s","l",""],["7537.00000","0.00198179",1571122984.2352,"s","l",""],["7533.90000","0.02076740",1571122987.1958,"s","l",""],["7534.00000","0.00566908",1571122994.5412,"s","l",""],["7536.10000","0.52988000",1571123004.9483,"b","m",""],["7534.30000","0.00276518",1571123021.2954,"b","l",""],["7534.20000","0.00359297",1571123030.8341,"s","l",""],["7534.30000","0.02647642",1571123033.0144,"b","l",""],["7534.30000","0.00632185",1571123041.7466,"b","m",""],["7534.20000","0.12650000",1571123044.156,"s","l",""],["7534.30000","0.00661910",1571123055.7032,"b","l",""],["7534.20000","0.30000000",1571123059.339,"s","m",""],["7534.30000","0.00776184",1571123070.2524,"b","l",""],["7534.30000","0.03032040",1571123075.7217,"b","m",""],["7534.30000","0.09652824",1571123093.3185,"b","m",""],["7534.20000","0.09100000",1571123096.0865,"s","m",""],["7534.30000","0.02320697",1571123102.2869,"b","l",""],["7534.30000","0.60000000",1571123102.2933,"b","l",""],["7534.30000","0.20000000",1571123102.2985,"b","l",""],["7534.30000","0.21300000",1571123102.3012,"b","l",""],["7534.40000","0.01185364",1571123103.1765,"s","l",""],["7535.50000","0.03245257",1571123105.6191,"b","m",""],["7535.50000","0.00200000",1571123106.8492,"b","m",""],["7535.40000","0.26500000",1571123109.0831,"b","m",""],["7534.80000","0.01000000",1571123118.3798,"s","l",""],["7535.10000","0.03032040",1571123135.8947,"b","m",""],["7535.10000","0.00200000",1571123161.9575,"b","m",""],["7535.00000","0.02000000",1571123162.5358,"s","l",""],["7535.00000","0.11967000",1571123162.5424,"s","l",""],["7535.10000","0.01195757",1571123163.1759,"b","m",""],["7535.00000","0.18533000",1571123194.4214,"s","l",""],["7535.00000","0.42775800",1571123194.4307,"s","l",""],["7535.10000","0.03057998",1571123210.6649,"b","l",""],["7536.80000","0.01000000",1571123258.9523,"s","m",""],["7536.90000","0.01241461",1571123265.3937,"b","m",""],["7536.90000","0.25000000",1571123272.9124,"b","m",""],["7536.90000","0.29916329",1571123288.7041,"b","l",""],["7536.80000","0.25579400",1571123290.5625,"s","l",""],["7536.80000","0.00783505",1571123300.859,"s","m",""],["7536.90000","0.00542210",1571123325.0615,"b","l",""],["7537.00000","0.01314800",1571123343.5694,"b","l",""],["7537.00000","0.00017195",1571123344.7182,"b","l",""],["7537.00000","0.00508725",1571123344.723,"b","l",""],["7536.90000","0.00120790",1571123373.5573,"s","m",""],["7536.90000","0.10058610",1571123373.5682,"s","m",""],["7536.90000","0.00200000",1571123426.5191,"s","m",""],["7537.00000","0.01212380",1571123438.6088,"b","m",""],["7537.00000","0.17248000",1571123451.2737,"b","l",""],["7537.00000","0.08684114",1571123460.8826,"b","m",""],["7537.00000","0.02343309",1571123478.0686,"b","l",""],["7537.00000","0.00003472",1571123478.0836,"b","l",""],["7538.30000","0.00700000",1571123482.9953,"b","l",""],["7538.20000","0.00759707",1571123483.3708,"s","m",""],["7538.30000","0.03517204",1571123484.6983,"b","l",""],["7538.30000","0.00350000",1571123488.1584,"b","l",""],["7538.20000","0.03240293",1571123494.5089,"s","m",""],["7538.20000","1.10000000",1571123494.5203,"s","m",""],["7538.20000","0.80000000",1571123494.5226,"s","m",""],["7538.20000","0.11471713",1571123494.5246,"s","m",""],["7538.20000","0.23878265",1571123494.5269,"s","m",""],["7538.30000","0.00567767",1571123502.8651,"b","m",""],["7538.20000","0.00299416",1571123502.9265,"s","l",""],["7538.30000","0.04990029",1571123510.3608,"b","l",""],["7538.30000","0.14874971",1571123510.37,"b","l",""],["7538.20000","0.02302148",1571123513.3801,"s","l",""],["7538.20000","0.00359297",1571123542.8744,"s","l",""],["7538.30000","0.00000029",1571123554.0476,"b","m",""],["7541.80000","0.02063000",1571123554.0654,"b","m",""],["7544.60000","0.00524171",1571123554.0813,"b","m",""],["7545.70000","0.00541000",1571123580.9222,"b","m",""],["7545.70000","0.00707125",1571123582.1511,"b","m",""],["7545.70000","0.01063145",1571123583.3115,"b","m",""],["7545.60000","0.06947000",1571123584.3896,"s","l",""],["7545.70000","0.00970200",1571123614.0177,"b","m",""],["7546.30000","0.02500000",1571123642.5298,"b","m",""],["7547.80000","0.01114501",1571123642.5518,"b","m",""],["7548.70000","0.04304261",1571123669.0439,"b","l",""],["7548.90000","0.00323400",1571123672.2726,"b","m",""],["7549.00000","0.01000000",1571123682.7041,"s","m",""],["7549.10000","0.00618867",1571123700.9121,"b","m",""],["7549.10000","0.03908847",1571123705.2708,"b","l",""],["7549.10000","0.02000000",1571123714.3914,"b","m",""],["7549.00000","0.03053760",1571123748.2653,"s","m",""],["7549.00000","0.00007240",1571123748.2691,"s","m",""],["7549.10000","0.47026116",1571123758.2884,"b","l",""],["7549.10000","0.04000000",1571123758.2961,"b","l",""],["7549.10000","0.05542318",1571123758.2983,"b","l",""],["7549.10000","0.00008854",1571123758.3001,"b","l",""],["7549.10000","0.00000012",1571123758.3018,"b","l",""],["7549.40000","0.00642751",1571123764.4037,"b","m",""],["7549.50000","0.86931274",1571123771.6882,"b","l",""],["7551.20000","0.00700000",1571123775.4398,"s","m",""],["7551.60000","0.13056329",1571123775.4609,"b","m",""],["7551.60000","0.26943671",1571123777.5702,"b","l",""],["7552.00000","0.02063000",1571123786.511,"b","m",""],["7552.00000","0.02063000",1571123786.5165,"b","m",""],["7552.00000","0.02063000",1571123786.5184,"b","m",""],["7552.00000","0.02063000",1571123786.5203,"b","m",""],["7553.00000","0.48413200",1571123786.5228,"b","m",""],["7552.90000","0.99001000",1571123796.2702,"b","l",""],["7551.60000","0.00000029",1571123816.5656,"s","m",""],["7551.00000","0.00408774",1571123816.5771,"s","m",""],["7551.40000","0.35000000",1571123827.5182,"b","l",""],["7552.80000","0.07878101",1571123827.5527,"b","l",""],["7552.90000","1.00000000",1571123827.5558,"b","l",""],["7553.50000","0.10343132",1571123827.5582,"b","l",""],["7553.50000","2.46766868",1571123827.5605,"b","l",""],["7553.80000","0.99000000",1571123827.5643,"b","l",""],["7554.40000","0.07499829",1571123827.6154,"b","m",""],["7555.10000","0.92500171",1571123827.6188,"b","m",""],["7554.10000","0.26407031",1571123844.2591,"b","l",""],["7554.10000","0.00068481",1571123844.2792,"b","l",""],["7554.10000","0.00000176",1571123844.2815,"b","l",""],["7554.10000","0.13524312",1571123852.5562,"b","m",""],["7554.10000","0.01570057",1571123852.5859,"b","m",""],["7554.10000","0.23429943",1571123859.4888,"b","l",""],["7554.10000","0.01823037",1571123859.5132,"b","l",""],["7554.10000","0.47560367",1571123859.5161,"b","l",""],["7554.00000","0.01416000",1571123860.5463,"s","l",""],["7554.00000","0.33500000",1571123868.4178,"b","m",""],["7554.10000","1.60656075",1571123868.4253,"b","m",""],["7554.10000","0.39343925",1571123870.8094,"b","m",""],["7556.20000","0.16800000",1571123870.8198,"b","m",""],["7556.50000","0.01059720",1571123870.8234,"b","m",""],["7556.60000","0.00708000",1571123870.826,"b","m",""],["7557.50000","0.34763842",1571123870.8292,"b","m",""],["7558.50000","0.07500000",1571123870.8322,"b","m",""],["7558.60000","0.09400000",1571123870.8347,"b","m",""],["7558.70000","0.27793601",1571123870.8376,"b","m",""],["7554.60000","0.00628278",1571123881.2143,"b","m",""],["7556.70000","0.05249200",1571123883.7329,"b","l",""],["7556.80000","0.32500000",1571123895.8572,"b","m",""],["7556.80000","0.16800000",1571123895.8674,"b","m",""],["7556.90000","0.00439730",1571123895.8696,"b","m",""],["7554.30000","0.00542210",1571123895.8862,"s","l",""],["7554.30000","0.00120790",1571123895.8921,"s","l",""],["7554.90000","0.15048986",1571123898.4488,"b","m",""],["7555.30000","0.00206383",1571123923.603,"s","l",""],["7557.90000","0.00294978",1571123926.5264,"b","l",""],["7558.00000","0.00037892",1571123926.5305,"b","l",""],["7555.50000","0.02046693",1571123929.466,"b","l",""],["7557.70000","0.02003451",1571123932.0161,"b","m",""],["7556.10000","0.03500645",1571123942.8056,"b","m",""],["7556.00000","0.11173600",1571123943.3322,"s","l",""],["7556.10000","0.05000000",1571123944.4599,"b","m",""],["7556.40000","0.07137847",1571123978.9983,"b","l",""],["7556.80000","0.02063000",1571123979.024,"b","l",""],["7557.80000","0.16590221",1571123979.0264,"b","l",""],["7558.90000","0.00505573",1571124055.6471,"b","m",""],["7559.00000","0.99494427",1571124055.6921,"b","m",""],["7559.00000","0.02554474",1571124060.979,"b","m",""],["7558.10000","0.00819475",1571124069.5238,"s","m",""],["7559.00000","0.14951099",1571124069.9946,"b","m",""],["7559.00000","0.20682391",1571124070.0006,"b","m",""],["7559.00000","2.00000000",1571124083.2138,"b","l",""],["7560.20000","0.45109860",1571124083.2324,"b","l",""],["7561.00000","0.25774074",1571124083.2409,"b","l",""],["7561.10000","0.00297757",1571124120.9854,"b","m",""],["7561.10000","0.00319000",1571124135.8111,"b","m",""],["7561.00000","0.02730411",1571124155.0002,"s","l",""],["7561.10000","0.00661000",1571124177.8598,"b","l",""],["7561.10000","0.03251244",1571124182.7858,"b","m",""],["7561.10000","0.03000000",1571124190.6181,"b","m",""],["7561.10000","2.92470999",1571124194.841,"b","l",""],["7561.10000","0.19900000",1571124194.8457,"b","l",""],["7563.40000","0.09200000",1571124194.8488,"b","l",""],["7563.80000","2.15361950",1571124194.8518,"b","l",""],["7564.20000","0.34671355",1571124194.8597,"b","l",""],["7564.70000","0.54188034",1571124194.8619,"b","l",""],["7564.80000","1.00340983",1571124194.8643,"b","l",""],["7563.30000","0.02859854",1571124203.6764,"s","l",""],["7563.30000","0.02123878",1571124213.0713,"s","m",""],["7563.30000","0.00005122",1571124213.0897,"s","m",""],["7563.40000","0.18789700",1571124215.4533,"b","m",""],["7563.30000","0.00661000",1571124217.4736,"s","m",""],["7563.40000","0.01196568",1571124218.6769,"b","m",""],["7563.40000","0.00013732",1571124219.7655,"b","l",""],["7563.40000","0.00645772",1571124219.7721,"b","l",""],["7563.40000","0.00001574",1571124219.7745,"b","l",""],["7563.40000","0.08552654",1571124221.5244,"b","l",""],["7563.40000","0.02494427",1571124221.5339,"b","l",""],["7563.50000","0.81864175",1571124226.9947,"b","m",""],["7563.50000","2.00000000",1571124238.216,"b","m",""],["7563.50000","0.06197827",1571124242.8517,"b","m",""],["7563.50000","0.03931800",1571124243.5643,"b","l",""],["7564.00000","0.04000000",1571124252.1781,"s","l",""],["7563.80000","0.10926120",1571124252.185,"s","l",""],["7563.70000","0.37500000",1571124252.1873,"s","l",""],["7563.60000","0.19350147",1571124252.1901,"s","l",""],["7563.40000","2.28223733",1571124252.1929,"s","l",""],["7564.50000","0.00277501",1571124252.3921,"b","l",""],["7564.50000","0.03678107",1571124252.3981,"b","l",""],["7564.30000","0.28000000",1571124255.1916,"s","l",""],["7563.70000","0.04000000",1571124255.2018,"s","l",""],["7563.40000","1.60729186",1571124255.2053,"s","l",""],["7563.40000","1.77270814",1571124255.2077,"s","l",""],["7563.40000","0.00214230",1571124259.3765,"s","l",""],["7564.00000","0.03000000",1571124266.3577,"b","m",""],["7563.90000","1.19000000",1571124269.1786,"s","l",""],["7563.40000","0.22514956",1571124269.1927,"s","l",""],["7561.10000","0.01321042",1571124269.1967,"s","l",""],["7561.10000","0.00000958",1571124269.1995,"s","l",""],["7561.00000","1.17163044",1571124269.2026,"s","l",""],["7563.30000","0.00661000",1571124314.5561,"b","l",""],["7560.00000","0.07923947",1571124331.397,"s","m",""],["7560.00000","0.04000000",1571124331.4129,"s","m",""],["7560.00000","0.58076053",1571124331.4156,"s","m",""],["7561.10000","0.05200000",1571124341.8043,"b","l",""],["7562.00000","0.09800000",1571124341.8082,"b","l",""],["7563.10000","0.04000000",1571124353.435,"b","m",""],["7563.30000","0.00157888",1571124353.4496,"b","m",""],["7563.30000","0.00661000",1571124359.0235,"b","l",""],["7563.30000","0.00843045",1571124361.102,"b","m",""],["7562.70000","0.24450837",1571124384.2139,"b","m",""],["7562.50000","0.00446091",1571124391.1231,"s","m",""],["7563.30000","0.02166925",1571124422.298,"b","m",""],["7563.30000","0.52710142",1571124464.7581,"b","l",""],["7564.50000","0.01178615",1571124482.4407,"b","m",""],["7563.40000","0.36517325",1571124524.3618,"b","m",""],["7563.40000","0.08538290",1571124524.9198,"b","l",""],["7563.30000","0.00312940",1571124537.2432,"s","l",""],["7563.30000","0.00312940",1571124537.2824,"s","l",""],["7563.30000","0.00312940",1571124537.3459,"s","l",""],["7563.30000","0.00904315",1571124537.3688,"s","l",""],["7563.30000","0.00312940",1571124537.3747,"s","l",""],["7563.30000","0.00312940",1571124537.4695,"s","l",""],["7563.30000","0.00312698",1571124537.6758,"s","l",""],["7563.40000","0.01020103",1571124541.4023,"b","m",""],["7563.40000","0.10000000",1571124544.306,"b","l",""],["7563.40000","0.05424282",1571124544.4137,"b","m",""],["7563.40000","0.10000000",1571124544.4179,"b","m",""],["7563.40000","0.17138995",1571124544.4207,"b","m",""],["7563.30000","0.02859905",1571124547.6188,"s","l",""],["7563.30000","0.01190019",1571124550.1612,"s","l",""],["7563.30000","2.30000000",1571124556.2466,"s","l",""],["7563.30000","0.26168363",1571124557.0173,"s","l",""],["7563.30000","0.04473197",1571124557.0233,"s","l",""],["7562.50000","0.06263704",1571124557.6921,"s","l",""],["7562.00000","0.33736296",1571124557.6979,"s","l",""],["7562.00000","0.47651517",1571124559.2657,"s","l",""],["7560.20000","0.06009882",1571124560.6113,"b","m",""],["7557.40000","0.04000000",1571124585.1568,"s","l",""],["7557.00000","0.02030000",1571124585.1649,"s","l",""],["7557.00000","0.06772310",1571124585.1741,"s","m",""],["7557.60000","0.01543409",1571124586.1207,"b","m",""],["7557.00000","0.07524323",1571124601.3929,"b","m",""],["7557.00000","0.00591167",1571124607.5681,"b","l",""],["7556.60000","0.00948779",1571124618.5137,"b","l",""],["7556.60000","0.00679635",1571124619.3754,"b","m",""],["7556.50000","0.03042534",1571124620.3536,"b","l",""],["7556.00000","0.02880000",1571124635.3649,"b","l",""],["7556.00000","0.01060466",1571124648.9403,"b","l",""],["7555.90000","0.00670000",1571124657.8349,"s","l",""],["7555.90000","0.13200000",1571124657.8751,"s","l",""],["7555.90000","0.00200000",1571124657.8788,"s","l",""],["7553.90000","0.15881000",1571124658.3144,"b","l",""],["7553.30000","0.05414015",1571124675.6199,"b","m",""],["7553.20000","0.02099488",1571124682.6487,"s","l",""],["7553.30000","0.06712000",1571124691.537,"b","m",""],["7553.20000","0.05400512",1571124691.9357,"s","l",""],["7553.10000","0.01293806",1571124691.9426,"s","l",""],["7553.10000","0.00002682",1571124691.9449,"s","l",""],["7552.10000","0.01754845",1571124696.1058,"b","m",""],["7552.00000","0.01350000",1571124716.5863,"s","m",""],["7552.10000","0.01251800",1571124717.5114,"b","m",""],["7552.10000","0.01000000",1571124720.2187,"b","l",""],["7552.10000","0.01920112",1571124721.028,"b","m",""],["7552.10000","0.54328088",1571124732.761,"b","m",""],["7552.10000","0.74228712",1571124732.7805,"b","m",""],["7552.90000","0.04167648",1571124764.9223,"s","l",""],["7553.00000","0.15000000",1571124782.8701,"b","m",""],["7553.00000","0.04000000",1571124782.922,"b","m",""],["7553.00000","0.02083824",1571124782.925,"b","m",""],["7553.00000","0.31510400",1571124782.9283,"b","m",""],["7553.00000","0.01112723",1571124782.9309,"b","m",""],["7553.00000","0.13900000",1571124782.9347,"b","m",""],["7553.00000","0.45112311",1571124782.938,"b","m",""],["7552.90000","0.02469919",1571124782.951,"s","l",""],["7552.90000","0.01255778",1571124782.9558,"s","l",""],["7552.90000","0.09718106",1571124782.9581,"s","l",""],["7552.90000","0.07388549",1571124782.9608,"s","l",""],["7552.90000","0.01255435",1571124782.9632,"s","l",""],["7552.90000","0.79845716",1571124782.9666,"s","l",""],["7552.80000","0.01414045",1571124783.274,"b","m",""],["7552.90000","0.07221789",1571124783.836,"b","m",""],["7551.60000","0.03305859",1571124783.991,"s","l",""],["7551.60000","0.49305592",1571124829.133,"s","l",""],["7551.60000","0.02000000",1571124829.1354,"s","l",""],["7551.60000","0.05388549",1571124829.1374,"s","l",""],["7551.60000","0.19145841",1571124829.1401,"s","l",""],["7551.60000","0.15854159",1571124829.1424,"s","l",""],["7551.60000","1.08305859",1571124829.1443,"s","l",""],["7551.00000","0.01661862",1571124842.0666,"s","m",""],["7551.60000","0.01456766",1571124843.4213,"b","m",""],["7551.00000","0.81519968",1571124844.1432,"s","m",""],["7551.70000","0.45500000",1571124844.7948,"b","m",""],["7551.70000","0.54500000",1571124844.8,"b","m",""],["7551.00000","0.07287793",1571124847.5149,"s","m",""],["7551.00000","0.03643896",1571124859.1088,"b","m",""],["7551.10000","0.20856104",1571124859.1266,"b","m",""],["7549.70000","0.00409200",1571124882.7499,"b","m",""],["7549.10000","0.00958979",1571124899.9485,"b","m",""],["7549.10000","0.08600000",1571124901.5805,"b","m",""],["7551.00000","0.02299881",1571124901.5829,"b","m",""],["7548.00000","0.01200000",1571124903.5854,"s","m",""],["7548.00000","0.98800000",1571124906.9108,"s","l",""],["7545.30000","1.90839878",1571124915.4742,"b","l",""],["7545.20000","0.02063000",1571124917.136,"s","m",""],["7541.20000","1.00000000",1571124917.1461,"s","m",""],["7541.10000","0.04000000",1571124917.1487,"s","m",""],["7540.90000","0.09799881",1571124917.152,"s","m",""],["7540.70000","0.54000000",1571124917.1545,"s","m",""],["7540.40000","1.00000000",1571124917.1572,"s","m",""],["7540.30000","0.80075307",1571124917.1595,"s","m",""],["7540.30000","0.02780234",1571124917.1635,"s","m",""],["7540.30000","1.12843890",1571124917.1656,"s","m",""],["7539.30000","0.01433810",1571124917.1678,"s","m",""],["7538.20000","0.00665600",1571124917.1705,"s","m",""],["7538.20000","0.80000000",1571124917.1731,"s","m",""],["7538.10000","0.08000000",1571124917.1762,"s","m",""],["7536.90000","0.25000000",1571124917.1797,"s","m",""],["7536.90000","1.26200000",1571124917.1829,"s","m",""],["7536.60000","0.75000000",1571124917.1859,"s","m",""],["7535.80000","0.25000000",1571124917.1889,"s","m",""],["7535.10000","0.00910130",1571124917.1917,"s","m",""],["7535.00000","0.00305000",1571124917.1956,"s","m",""],["7535.00000","0.02063000",1571124917.1982,"s","m",""],["7534.40000","0.52878185",1571124917.2009,"s","m",""],["7534.40000","0.53014878",1571124917.2034,"s","m",""],["7534.30000","4.13967085",1571124917.2061,"s","m",""],["7540.50000","0.00202212",1571124931.7659,"b","l",""],["7539.50000","0.11200000",1571124974.2551,"s","l",""],["7538.00000","0.03026100",1571124974.3983,"b","m",""],["7537.80000","0.00635533",1571124977.6267,"b","m",""],["7537.60000","0.00412822",1571125001.0239,"s","m",""],["7537.60000","0.14587178",1571125001.0547,"s","m",""],["7537.60000","0.06132406",1571125003.0743,"s","l",""],["7537.60000","0.01187503",1571125010.7873,"s","l",""],["7538.80000","0.04000000",1571125022.4119,"b","m",""],["7539.70000","0.08848551",1571125022.4264,"b","m",""],["7537.70000","0.00634857",1571125030.9673,"s","l",""],["7537.60000","0.19730480",1571125030.9783,"s","l",""],["7537.60000","0.13056329",1571125030.981,"s","l",""],["7537.60000","0.05306104",1571125030.9831,"s","l",""],["7535.40000","0.34704353",1571125030.9853,"s","l",""],["7535.40000","0.00067877",1571125030.9871,"s","l",""],["7538.30000","0.00251200",1571125032.7506,"b","m",""],["7538.20000","0.00550000",1571125045.1505,"b","l",""],["7539.60000","0.03174800",1571125072.5538,"b","l",""],["7541.90000","0.01235319",1571125082.6237,"b","m",""],["7541.80000","0.08159000",1571125101.4086,"s","m",""],["7541.90000","0.10000000",1571125127.623,"b","m",""],["7541.90000","0.02801953",1571125130.7096,"b","l",""],["7541.80000","0.00402918",1571125138.2099,"s","l",""],["7541.90000","0.00910435",1571125141.1455,"b","m",""],["7541.80000","0.13075649",1571125141.5156,"s","l",""],["7541.80000","0.01570057",1571125141.5199,"s","l",""],["7541.80000","0.16792376",1571125141.5223,"s","l",""],["7541.80000","0.18000000",1571125141.5249,"s","l",""],["7540.30000","0.38750918",1571125141.5279,"s","l",""],["7541.80000","0.01335939",1571125143.1812,"b","m",""],["7541.70000","0.00895053",1571125149.7386,"b","l",""],["7541.90000","0.06264681",1571125149.7636,"b","l",""],["7542.50000","0.03250000",1571125150.3023,"b","m",""],["7542.70000","0.00227063",1571125172.9347,"s","l",""],["7543.10000","0.56500000",1571125191.1609,"s","l",""],["7542.20000","0.06182220",1571125191.174,"s","l",""],["7542.20000","0.00015780",1571125191.1763,"s","l",""],["7545.10000","0.00770043",1571125245.1892,"s","l",""],["7545.30000","0.02698245",1571125257.4544,"b","m",""],["7545.20000","0.01342400",1571125258.0702,"b","m",""],["7545.30000","0.01879038",1571125261.1447,"b","m",""],["7545.10000","0.00366771",1571125262.4062,"b","m",""],["7544.70000","0.00397079",1571125296.1945,"b","m",""],["7544.60000","0.02649738",1571125297.649,"s","m",""],["7542.00000","0.00016162",1571125297.6549,"s","m",""],["7543.60000","0.00645000",1571125297.928,"b","m",""],["7543.10000","0.62043500",1571125309.1653,"b","l",""],["7544.20000","0.01563944",1571125321.3818,"b","m",""],["7543.00000","0.22090297",1571125322.6098,"s","m",""],["7543.00000","0.26472339",1571125324.0666,"s","m",""],["7542.30000","0.34062661",1571125324.0762,"s","m",""],["7542.60000","0.60535000",1571125330.6467,"s","m",""],["7543.80000","0.02382630",1571125338.7755,"b","m",""],["7545.00000","0.03484370",1571125338.7857,"b","m",""],["7542.90000","0.72658659",1571125350.3056,"b","m",""],["7542.90000","0.01191315",1571125350.3335,"b","m",""],["7543.00000","0.20000000",1571125350.337,"b","m",""],["7543.30000","0.01191315",1571125350.3401,"b","m",""],["7543.50000","1.04958711",1571125350.343,"b","m",""],["7543.50000","0.95041289",1571125370.6689,"b","m",""],["7545.00000","0.07500000",1571125370.7199,"b","m",""],["7545.70000","0.29722010",1571125370.7234,"b","m",""],["7544.10000","1.03399959",1571125374.1908,"b","l",""],["7544.10000","0.83640600",1571125377.7739,"b","m",""],["7540.40000","0.06633919",1571125381.1417,"s","m",""],["7544.10000","0.02540000",1571125383.1724,"b","l",""],["7544.70000","0.00271999",1571125403.9177,"b","m",""],["7544.70000","0.01627762",1571125405.5445,"b","l",""],["7545.40000","0.01260901",1571125441.4791,"b","m",""],["7545.40000","0.01335556",1571125442.1631,"b","m",""],["7544.70000","0.02645974",1571125442.6894,"s","m",""],["7544.00000","0.02354026",1571125442.6991,"s","m",""],["7545.40000","0.01234232",1571125443.2621,"b","m",""],["7545.40000","0.01670000",1571125443.9217,"b","m",""],["7545.40000","0.01280094",1571125445.164,"b","m",""],["7545.40000","0.01324532",1571125475.3871,"b","l",""],["7544.00000","0.01325247",1571125485.0336,"s","m",""],["7544.00000","0.00000309",1571125485.0422,"s","m",""],["7543.90000","0.12403810",1571125485.0453,"s","m",""],["7544.10000","0.00654518",1571125494.0434,"b","l",""],["7542.40000","0.00224870",1571125499.0597,"s","l",""],["7544.10000","0.00443850",1571125501.6494,"b","m",""],["7545.30000","0.06633919",1571125505.0495,"b","l",""],["7545.40000","0.12047000",1571125507.932,"s","l",""],["7545.40000","0.01325305",1571125510.8345,"s","l",""],["7545.50000","0.01300000",1571125513.7594,"b","m",""],["7545.50000","0.20203711",1571125514.9531,"b","l",""],["7545.40000","0.30000000",1571125533.1205,"s","m",""],["7545.50000","0.00606942",1571125539.6539,"b","l",""],["7545.40000","0.20000000",1571125541.239,"s","m",""],["7545.50000","0.02605600",1571125542.776,"b","m",""],["7545.50000","0.00744173",1571125561.2041,"b","m",""],["7545.50000","0.05029000",1571125562.6934,"b","m",""],["7545.50000","0.00781686",1571125564.1461,"b","l",""],["7545.40000","0.12000000",1571125582.9611,"s","l",""],["7545.40000","0.10764776",1571125583.9472,"s","l",""],["7545.40000","0.00200000",1571125583.954,"s","l",""],["7545.40000","0.00530124",1571125583.9572,"s","l",""],["7545.40000","2.02750000",1571125583.9609,"s","l",""],["7540.60000","0.03300000",1571125600.0154,"s","m",""],["7540.50000","0.07500000",1571125600.0309,"s","m",""],["7540.40000","0.95773300",1571125600.0346,"s","m",""],["7540.50000","0.02719997",1571125608.5875,"b","m",""],["7540.50000","0.19525205",1571125616.5305,"b","m",""],["7540.50000","0.24500000",1571125616.5408,"b","m",""],["7540.60000","0.91600000",1571125616.5441,"b","m",""],["7540.80000","0.48327012",1571125616.5465,"b","m",""],["7540.80000","0.01672988",1571125617.5967,"b","m",""],["7542.10000","0.08662000",1571125617.6044,"b","m",""],["7542.10000","0.03948494",1571125622.4992,"b","m",""],["7542.10000","0.01552465",1571125623.91,"b","m",""],["7540.50000","0.00663086",1571125646.2541,"b","l",""],["7540.50000","0.10000000",1571125656.8389,"b","m",""],["7540.40000","0.00299134",1571125660.7928,"s","l",""],["7540.40000","0.20000000",1571125675.2123,"s","m",""],["7540.50000","0.49336914",1571125681.3952,"b","l",""],["7540.50000","0.03709086",1571125681.4145,"b","l",""],["7540.50000","0.05074126",1571125683.0144,"b","m",""],["7540.40000","0.00998290",1571125694.1697,"s","l",""],["7540.40000","0.00001710",1571125694.1759,"s","l",""],["7540.40000","0.00209274",1571125694.5753,"s","l",""],["7540.50000","0.21211131",1571125698.0077,"b","l",""],["7540.50000","0.00048869",1571125698.0144,"b","l",""],["7540.50000","0.01657000",1571125704.3961,"b","l",""],["7540.50000","0.00607071",1571125709.2697,"b","l",""],["7540.50000","0.20892717",1571125726.51,"b","m",""],["7540.50000","0.14566283",1571125726.5152,"b","m",""],["7540.40000","0.03502900",1571125733.9556,"s","m",""],["7540.40000","0.91613000",1571125749.214,"s","m",""],["7540.40000","1.39495646",1571125768.2384,"s","l",""],["7540.40000","0.01000000",1571125768.2516,"s","l",""],["7540.40000","0.00770432",1571125768.2548,"s","l",""],["7540.10000","0.06615376",1571125774.1212,"b","l",""],["7540.10000","0.06000000",1571125800.5796,"b","m",""],["7540.10000","0.01699256",1571125801.3081,"b","l",""],["7540.10000","0.00368117",1571125801.3884,"b","m",""],["7540.10000","0.00331492",1571125802.3506,"b","m",""],["7540.10000","0.00000859",1571125802.3566,"b","m",""],["7540.10000","0.00000002",1571125802.3592,"b","m",""],["7540.10000","0.46584898",1571125818.9703,"b","l",""],["7541.70000","0.00602837",1571125825.5459,"b","m",""],["7541.50000","0.06637567",1571125834.5491,"s","m",""],["7541.50000","0.00628278",1571125834.5528,"s","m",""],["7541.50000","0.10034155",1571125834.5553,"s","m",""],["7541.50000","0.02868172",1571125834.8408,"s","l",""],["7541.50000","0.02146659",1571125838.0944,"s","l",""],["7541.50000","0.02046693",1571125838.0989,"s","l",""],["7541.50000","0.03500645",1571125838.1008,"s","l",""],["7541.50000","0.05000000",1571125838.1029,"s","l",""],["7541.50000","0.07137847",1571125838.1053,"s","l",""],["7541.50000","0.01260901",1571125838.1074,"s","l",""],["7541.50000","0.01335556",1571125838.1101,"s","l",""],["7541.50000","0.01234232",1571125838.1126,"s","l",""],["7541.50000","0.01670000",1571125838.1151,"s","l",""],["7541.50000","0.01280094",1571125838.1173,"s","l",""],["7541.50000","0.01324532",1571125838.1196,"s","l",""],["7541.50000","0.00654518",1571125838.1218,"s","l",""],["7541.50000","0.00443850",1571125838.1238,"s","l",""],["7541.50000","0.01300000",1571125838.1258,"s","l",""],["7541.50000","0.09496301",1571125838.1282,"s","l",""],["7541.50000","1.01500000",1571125838.1298,"s","l",""],["7541.50000","2.00000000",1571125838.1324,"s","l",""],["7540.30000","0.58668172",1571125838.1348,"s","l",""],["7540.20000","2.00000000",1571125849.1493,"s","l",""],["7540.10000","0.85780967",1571125849.1631,"s","l",""],["7540.00000","0.46825200",1571125849.167,"s","l",""],["7538.10000","0.13263957",1571125849.17,"s","l",""],["7537.70000","0.53989644",1571125849.1728,"s","l",""],["7537.70000","0.00140009",1571125849.1753,"s","l",""],["7537.70000","0.00000223",1571125849.1778,"s","l",""],["7540.20000","0.00712656",1571125852.6022,"b","m",""],["7538.50000","0.03307710",1571125877.5577,"b","m",""],["7539.70000","0.05000000",1571125883.8241,"b","l",""],["7540.70000","0.06631978",1571125892.53,"b","m",""],["7540.80000","0.22746719",1571125892.5362,"b","m",""],["7540.20000","0.00770024",1571125895.1663,"s","l",""],["7540.20000","0.07466376",1571125907.9245,"s","l",""],["7535.80000","0.01762000",1571125921.4852,"b","l",""],["7535.40000","0.05000000",1571125923.4181,"s","l",""],["7535.50000","1.14000000",1571125927.1245,"b","l",""],["7535.50000","0.38215216",1571125927.1346,"b","l",""],["7535.50000","0.13284784",1571125931.1089,"b","m",""],["7535.60000","0.02500000",1571125931.1225,"b","m",""],["7535.90000","0.01452866",1571125931.1252,"b","m",""],["7535.90000","0.00200000",1571125947.8065,"b","l",""],["7535.40000","0.01071917",1571125949.1084,"s","l",""],["7535.40000","0.52296735",1571125951.7955,"s","m",""],["7535.00000","0.24823265",1571125951.8074,"s","m",""],["7535.20000","0.00530000",1571125959.5177,"b","l",""],["7535.10000","0.11913128",1571125964.8689,"b","l",""],["7535.00000","0.01840964",1571125970.3358,"s","m",""],["7535.00000","0.73335771",1571125974.9256,"s","m",""],["7534.30000","0.84172771",1571125974.9445,"s","m",""],["7534.10000","0.23546458",1571125974.9484,"s","m",""],["7533.50000","0.03163101",1571125983.2325,"b","m",""],["7534.00000","0.08816131",1571126005.3595,"b","m",""],["7533.70000","0.50000000",1571126018.7658,"b","m",""],["7532.00000","0.03976644",1571126027.4353,"s","m",""],["7530.30000","0.16023356",1571126027.4444,"s","m",""],["7530.10000","0.02063000",1571126033.5242,"s","m",""],["7530.10000","0.02063000",1571126033.5446,"s","m",""],["7530.10000","0.02063000",1571126033.547,"s","m",""],["7530.00000","0.25000000",1571126033.5497,"s","m",""],["7530.00000","0.01325948",1571126033.5526,"s","m",""],["7529.10000","0.66000000",1571126033.5559,"s","m",""],["7528.70000","0.01485052",1571126033.5586,"s","m",""],["7528.70000","0.01959712",1571126050.1484,"s","m",""],["7528.50000","0.04207883",1571126050.157,"s","m",""],["7528.40000","0.13832405",1571126050.1602,"s","m",""],["7530.70000","0.02065989",1571126060.5485,"b","l",""],["7535.00000","0.00660000",1571126077.6148,"b","m",""],["7535.00000","0.02682865",1571126085.9449,"b","l",""],["7535.00000","0.00877800",1571126086.748,"b","m",""],["7531.70000","0.01277600",1571126095.6879,"s","l",""],["7531.80000","0.10890000",1571126097.7849,"s","m",""],["7533.50000","0.01324131",1571126099.6414,"b","m",""],["7533.50000","0.00002869",1571126099.6495,"b","m",""],["7530.00000","0.00603365",1571126132.7903,"b","m",""],["7531.70000","0.00356000",1571126143.2138,"b","m",""],["7528.70000","0.07500000",1571126153.6508,"s","m",""],["7528.30000","0.01143182",1571126153.6587,"s","m",""],["7528.20000","0.00578339",1571126153.6624,"s","m",""],["7528.00000","0.05043000",1571126153.6658,"s","m",""],["7527.70000","0.05735479",1571126153.6684,"s","m",""],["7527.70000","0.02917500",1571126153.6826,"s","m",""],["7527.00000","0.01000000",1571126161.5997,"s","m",""],["7527.00000","0.01000000",1571126161.6102,"s","m",""],["7526.40000","0.01348708",1571126161.6138,"s","m",""],["7525.70000","0.00578327",1571126161.6172,"s","m",""],["7524.00000","0.00250000",1571126161.6211,"s","m",""],["7523.30000","0.02495875",1571126161.6238,"s","m",""],["7527.10000","0.08385000",1571126161.6395,"b","m",""],["7527.10000","2.18215000",1571126161.6464,"b","m",""],["7527.10000","0.11785000",1571126161.649,"b","m",""],["7527.10000","0.12215000",1571126161.6563,"b","m",""],["7527.10000","2.00000000",1571126161.6594,"b","m",""],["7527.10000","0.08000000",1571126161.6621,"b","m",""],["7527.40000","1.00000000",1571126161.6647,"b","m",""],["7528.00000","0.22500000",1571126161.6684,"b","m",""],["7528.40000","0.07285000",1571126161.6709,"b","m",""],["7528.40000","0.00215000",1571126161.677,"b","m",""],["7528.40000","0.00544167",1571126161.68,"b","m",""],["7528.40000","0.39355833",1571126161.6869,"b","m",""],["7528.50000","0.60000000",1571126161.6894,"b","m",""],["7528.80000","0.02243386",1571126161.692,"b","m",""],["7529.00000","1.09256614",1571126161.6946,"b","m",""],["7523.30000","0.03977300",1571126161.7011,"s","m",""],["7523.30000","0.02882300",1571126161.7071,"s","m",""],["7523.40000","0.02698245",1571126162.1098,"s","m",""],["7523.20000","0.30000000",1571126162.1164,"s","m",""],["7523.00000","0.00267649",1571126162.1195,"s","m",""],["7521.50000","0.67034106",1571126162.1221,"s","m",""],["7526.70000","0.04305967",1571126162.8787,"b","m",""],["7524.50000","0.01121693",1571126174.8989,"b","l",""],["7525.00000","0.01290000",1571126175.1824,"b","l",""],["7525.00000","0.00009477",1571126180.1309,"b","m",""],["7530.40000","0.08900000",1571126180.1409,"b","m",""],["7531.70000","0.29875615",1571126180.1435,"b","m",""],["7530.30000","0.15000000",1571126184.9956,"s","m",""],["7530.30000","0.00100000",1571126193.2324,"s","m",""],["7531.70000","0.00600661",1571126202.2042,"b","l",""],["7530.50000","0.46000000",1571126216.8665,"s","m",""],["7530.40000","1.52735735",1571126216.8784,"s","m",""],["7530.40000","0.00396083",1571126216.8809,"s","m",""],["7530.40000","0.00001027",1571126216.8832,"s","m",""],["7530.40000","0.00000002",1571126216.8855,"s","m",""],["7531.60000","0.00657700",1571126224.7509,"b","l",""],["7531.60000","0.38146600",1571126225.3088,"b","l",""],["7531.60000","0.14469400",1571126225.9026,"b","l",""],["7531.60000","0.00263300",1571126226.467,"b","l",""],["7531.60000","0.03422900",1571126227.0285,"b","l",""],["7530.70000","0.00331974",1571126230.5403,"s","m",""],["7530.30000","0.00182779",1571126230.5443,"s","m",""],["7530.30000","0.00000247",1571126230.5464,"s","m",""],["7530.70000","0.02395381",1571126268.615,"s","l",""],["7531.70000","0.08140993",1571126275.4578,"b","m",""],["7531.70000","0.01083836",1571126283.2216,"b","m",""],["7531.10000","0.00603509",1571126302.3549,"b","m",""],["7531.70000","0.04205893",1571126313.917,"b","m",""],["7531.60000","0.02044033",1571126323.0498,"s","l",""],["7531.70000","0.00393002",1571126328.6205,"b","l",""],["7534.10000","0.04000000",1571126336.9205,"b","l",""],["7535.00000","0.14000000",1571126336.9245,"b","l",""],["7535.00000","0.00100000",1571126338.583,"b","m",""],["7535.00000","0.12760961",1571126348.2774,"b","m",""],["7535.00000","0.02804518",1571126350.2943,"b","l",""],["7533.80000","0.37500000",1571126369.3641,"s","m",""],["7533.10000","0.02400000",1571126369.3873,"s","m",""],["7531.70000","0.01760846",1571126389.9091,"b","l",""],["7531.80000","0.16646496",1571126389.9116,"b","l",""],["7531.50000","0.00222220",1571126399.5987,"b","m",""],["7530.60000","0.40000000",1571126403.8877,"b","l",""],["7530.60000","0.00769313",1571126403.8909,"b","l",""],["7531.80000","0.24357837",1571126403.8934,"b","l",""],["7531.80000","0.63153600",1571126404.464,"b","l",""],["7530.50000","0.00265307",1571126452.1364,"s","m",""],["7530.40000","2.06914137",1571126452.1502,"s","m",""],["7530.30000","0.11233914",1571126452.1541,"s","m",""],["7530.00000","0.13245392",1571126452.1572,"s","m",""],["7529.20000","0.04000000",1571126452.16,"s","m",""],["7527.00000","0.03480000",1571126452.1634,"s","m",""],["7526.60000","0.03000000",1571126452.1659,"s","m",""],["7526.50000","0.07861250",1571126452.1689,"s","m",""],["7526.00000","0.25532766",1571126460.3841,"b","m",""],["7524.60000","0.64220915",1571126462.7818,"b","m",""],["7524.60000","0.03292331",1571126462.9179,"b","m",""],["7524.00000","0.03249014",1571126468.0587,"b","l",""],["7523.60000","0.00274162",1571126471.5763,"b","l",""],["7519.40000","0.18420240",1571126481.0507,"b","l",""],["7519.30000","0.00268986",1571126481.0629,"s","m",""],["7519.00000","0.00201000",1571126481.0664,"s","m",""],["7519.00000","0.00200600",1571126481.0685,"s","m",""],["7518.10000","0.01291114",1571126481.0707,"s","m",""],["7518.10000","0.02913200",1571126481.0827,"s","m",""],["7519.80000","0.02046693",1571126482.3938,"b","l",""],["7520.00000","0.19000000",1571126483.1598,"b","l",""],["7519.30000","0.02045260",1571126487.093,"b","l",""],["7518.90000","0.02045260",1571126488.5342,"b","l",""],["7517.00000","0.13600000",1571126507.6562,"s","l",""],["7517.00000","0.02738399",1571126507.6778,"s","l",""],["7516.90000","0.25000000",1571126509.4085,"s","m",""],["7516.90000","0.15000000",1571126509.4284,"s","m",""],["7516.90000","0.00417403",1571126511.5936,"s","l",""],["7516.90000","0.15274114",1571126518.1236,"s","l",""],["7516.90000","0.00035886",1571126518.1267,"s","l",""],["7516.90000","0.00324516",1571126518.5815,"s","l",""],["7517.00000","0.00250000",1571126521.0948,"b","m",""],["7517.00000","0.04952734",1571126522.6221,"b","m",""],["7517.00000","0.06354464",1571126525.3576,"b","l",""],["7517.00000","0.12592600",1571126526.7177,"b","m",""],["7516.90000","0.08709048",1571126530.2804,"s","l",""],["7517.00000","0.15200000",1571126531.776,"b","l",""],["7517.00000","0.15563020",1571126531.7807,"b","l",""],["7517.80000","0.29900000",1571126532.7404,"b","l",""],["7520.70000","0.02686192",1571126537.201,"b","l",""],["7521.30000","0.00917900",1571126540.686,"b","m",""],["7521.30000","0.01130200",1571126540.7177,"b","m",""],["7519.10000","0.30000000",1571126540.9303,"s","m",""],["7521.20000","0.31163987",1571126548.7477,"b","m",""],["7517.60000","0.00604521",1571126553.2284,"b","m",""],["7516.90000","0.35289033",1571126566.2027,"s","l",""],["7516.90000","0.09710967",1571126566.2059,"s","l",""],["7516.90000","0.12000000",1571126566.2296,"s","l",""],["7516.90000","0.55000000",1571126566.629,"s","m",""],["7516.90000","0.55000000",1571126568.8352,"s","l",""],["7516.90000","0.04000000",1571126568.932,"s","l",""],["7516.90000","0.04000000",1571126568.9693,"s","l",""],["7516.90000","0.07000000",1571126569.1054,"s","l",""],["7516.90000","0.02877558",1571126569.137,"s","l",""],["7517.00000","0.32609107",1571126574.3592,"b","m",""],["7517.00000","0.01649020",1571126582.6939,"b","m",""],["7516.90000","0.00100000",1571126585.2463,"s","m",""],["7516.90000","0.01301479",1571126586.437,"s","m",""],["7516.90000","0.01000702",1571126586.6764,"s","m",""],["7516.90000","0.00978974",1571126593.8232,"s","l",""],["7516.90000","0.00978972",1571126593.8543,"s","l",""],["7516.90000","0.00919607",1571126593.8839,"s","l",""],["7516.90000","0.01000000",1571126595.4446,"s","l",""],["7516.90000","0.01104342",1571126602.5218,"s","l",""],["7516.90000","0.02877558",1571126603.7057,"s","l",""],["7517.00000","0.01206715",1571126612.1932,"b","l",""],["7516.90000","0.40149841",1571126615.9292,"s","m",""],["7516.90000","1.34623393",1571126615.9319,"s","m",""],["7516.90000","0.00349113",1571126615.9342,"s","m",""],["7516.90000","0.00000653",1571126615.9358,"s","m",""],["7517.00000","0.18993285",1571126618.5884,"b","l",""],["7522.10000","0.04715844",1571126623.2095,"b","m",""],["7522.10000","0.06391423",1571126632.489,"b","m",""],["7522.10000","0.03608577",1571126668.7298,"b","l",""],["7522.10000","0.16391423",1571126668.741,"b","l",""],["7522.10000","0.20000000",1571126673.1426,"b","l",""],["7522.10000","0.00604279",1571126675.8488,"b","m",""],["7522.00000","0.00299628",1571126684.8837,"s","l",""],["7522.10000","0.81700000",1571126685.1544,"s","l",""],["7524.50000","0.22978000",1571126687.4632,"b","l",""],["7524.50000","0.00199810",1571126687.6098,"b","m",""],["7524.50000","0.02670904",1571126703.1887,"b","m",""],["7524.50000","0.00900000",1571126711.3654,"b","m",""],["7524.50000","0.72490470",1571126728.5664,"b","m",""],["7524.50000","0.64532782",1571126729.4022,"b","m",""],["7524.40000","0.00444097",1571126730.255,"s","m",""],["7524.40000","0.00533859",1571126730.562,"s","l",""],["7524.50000","0.01988318",1571126742.0355,"b","l",""],["7524.40000","0.00360236",1571126752.6285,"s","l",""],["7524.40000","0.07025557",1571126759.3793,"s","m",""],["7524.40000","0.00606942",1571126759.3976,"s","m",""],["7524.40000","0.02605600",1571126759.4,"s","m",""],["7524.40000","0.00744173",1571126759.4024,"s","m",""],["7524.40000","0.05029000",1571126759.4047,"s","m",""],["7524.40000","0.00781686",1571126759.4074,"s","m",""],["7524.40000","0.19525205",1571126759.4101,"s","m",""],["7524.40000","0.00663086",1571126759.4127,"s","m",""],["7524.40000","0.10000000",1571126759.4149,"s","m",""],["7524.40000","0.11380931",1571126759.4174,"s","m",""],["7522.20000","0.01000000",1571126759.4199,"s","m",""],["7522.00000","0.10637820",1571126759.4223,"s","m",""],["7524.40000","0.01988936",1571126760.9441,"b","l",""],["7524.40000","0.00005064",1571126760.9525,"b","l",""]],"last":"1571126760952486039"}}'
RAW_TRADES = '{"error":[],"result":{"XXBTZEUR":[["7537.30000","0.10393000",1571122808.1487,"s","l",""],["7537.30000","0.15755973",1571122815.8118,"s","m",""],["7538.90000","0.02840000",1571122831.9393,"b","m",""],["7538.40000","0.12731491",1571122847.3291,"b","m",""],["7539.60000","0.04619178",1571122847.3466,"b","m",""],["7538.00000","0.00926144",1571122850.5876,"s","m",""],["7538.00000","0.00001856",1571122850.5908,"s","m",""],["7539.20000","0.09718106",1571122890.5735,"b","m",""],["7538.90000","0.06829746",1571122921.8678,"b","m",""],["7538.90000","0.00202805",1571122921.8843,"b","m",""],["7539.00000","0.03044536",1571122921.8869,"b","m",""],["7537.40000","0.00960760",1571122926.8741,"s","m",""],["7537.00000","0.02771040",1571122953.6901,"s","l",""],["7537.00000","0.01547500",1571122965.2415,"s","l",""],["7537.00000","0.00664200",1571122969.2615,"s","l",""],["7537.00000","0.00848600",1571122973.2672,"s","l",""],["7537.10000","0.03496251",1571122981.8198,"b","m",""],["7537.00000","0.02869834",1571122982.5344,"s","l",""],["7537.00000","0.00566908",1571122984.0568,"s","l",""],["7537.00000","0.00566908",1571122984.172,"s","l",""],["7537.00000","0.00198179",1571122984.2352,"s","l",""],["7533.90000","0.02076740",1571122987.1958,"s","l",""],["7534.00000","0.00566908",1571122994.5412,"s","l",""],["7536.10000","0.52988000",1571123004.9483,"b","m",""],["7534.30000","0.00276518",1571123021.2954,"b","l",""],["7534.20000","0.00359297",1571123030.8341,"s","l",""],["7534.30000","0.02647642",1571123033.0144,"b","l",""],["7534.30000","0.00632185",1571123041.7466,"b","m",""],["7534.20000","0.12650000",1571123044.156,"s","l",""],["7534.30000","0.00661910",1571123055.7032,"b","l",""],["7534.20000","0.30000000",1571123059.339,"s","m",""],["7534.30000","0.00776184",1571123070.2524,"b","l",""],["7534.30000","0.03032040",1571123075.7217,"b","m",""],["7534.30000","0.09652824",1571123093.3185,"b","m",""],["7534.20000","0.09100000",1571123096.0865,"s","m",""],["7534.30000","0.02320697",1571123102.2869,"b","l",""],["7534.30000","0.60000000",1571123102.2933,"b","l",""],["7534.30000","0.20000000",1571123102.2985,"b","l",""],["7534.30000","0.21300000",1571123102.3012,"b","l",""],["7534.40000","0.01185364",1571123103.1765,"s","l",""],["7535.50000","0.03245257",1571123105.6191,"b","m",""],["7535.50000","0.00200000",1571123106.8492,"b","m",""],["7535.40000","0.26500000",1571123109.0831,"b","m",""],["7534.80000","0.01000000",1571123118.3798,"s","l",""],["7535.10000","0.03032040",1571123135.8947,"b","m",""],["7535.10000","0.00200000",1571123161.9575,"b","m",""],["7535.00000","0.02000000",1571123162.5358,"s","l",""],["7535.00000","0.11967000",1571123162.5424,"s","l",""],["7535.10000","0.01195757",1571123163.1759,"b","m",""],["7535.00000","0.18533000",1571123194.4214,"s","l",""],["7535.00000","0.42775800",1571123194.4307,"s","l",""],["7535.10000","0.03057998",1571123210.6649,"b","l",""],["7536.80000","0.01000000",1571123258.9523,"s","m",""],["7536.90000","0.01241461",1571123265.3937,"b","m",""],["7536.90000","0.25000000",1571123272.9124,"b","m",""],["7536.90000","0.29916329",1571123288.7041,"b","l",""],["7536.80000","0.25579400",1571123290.5625,"s","l",""],["7536.80000","0.00783505",1571123300.859,"s","m",""],["7536.90000","0.00542210",1571123325.0615,"b","l",""],["7537.00000","0.01314800",1571123343.5694,"b","l",""],["7537.00000","0.00017195",1571123344.7182,"b","l",""],["7537.00000","0.00508725",1571123344.723,"b","l",""],["7536.90000","0.00120790",1571123373.5573,"s","m",""],["7536.90000","0.10058610",1571123373.5682,"s","m",""],["7536.90000","0.00200000",1571123426.5191,"s","m",""],["7537.00000","0.01212380",1571123438.6088,"b","m",""],["7537.00000","0.17248000",1571123451.2737,"b","l",""],["7537.00000","0.08684114",1571123460.8826,"b","m",""],["7537.00000","0.02343309",1571123478.0686,"b","l",""],["7537.00000","0.00003472",1571123478.0836,"b","l",""],["7538.30000","0.00700000",1571123482.9953,"b","l",""],["7538.20000","0.00759707",1571123483.3708,"s","m",""],["7538.30000","0.03517204",1571123484.6983,"b","l",""],["7538.30000","0.00350000",1571123488.1584,"b","l",""],["7538.20000","0.03240293",1571123494.5089,"s","m",""],["7538.20000","1.10000000",1571123494.5203,"s","m",""],["7538.20000","0.80000000",1571123494.5226,"s","m",""],["7538.20000","0.11471713",1571123494.5246,"s","m",""],["7538.20000","0.23878265",1571123494.5269,"s","m",""],["7538.30000","0.00567767",1571123502.8651,"b","m",""],["7538.20000","0.00299416",1571123502.9265,"s","l",""],["7538.30000","0.04990029",1571123510.3608,"b","l",""],["7538.30000","0.14874971",1571123510.37,"b","l",""],["7538.20000","0.02302148",1571123513.3801,"s","l",""],["7538.20000","0.00359297",1571123542.8744,"s","l",""],["7538.30000","0.00000029",1571123554.0476,"b","m",""],["7541.80000","0.02063000",1571123554.0654,"b","m",""],["7544.60000","0.00524171",1571123554.0813,"b","m",""],["7545.70000","0.00541000",1571123580.9222,"b","m",""],["7545.70000","0.00707125",1571123582.1511,"b","m",""],["7545.70000","0.01063145",1571123583.3115,"b","m",""],["7545.60000","0.06947000",1571123584.3896,"s","l",""],["7545.70000","0.00970200",1571123614.0177,"b","m",""],["7546.30000","0.02500000",1571123642.5298,"b","m",""],["7547.80000","0.01114501",1571123642.5518,"b","m",""],["7548.70000","0.04304261",1571123669.0439,"b","l",""],["7548.90000","0.00323400",1571123672.2726,"b","m",""],["7549.00000","0.01000000",1571123682.7041,"s","m",""],["7549.10000","0.00618867",1571123700.9121,"b","m",""],["7549.10000","0.03908847",1571123705.2708,"b","l",""],["7549.10000","0.02000000",1571123714.3914,"b","m",""],["7549.00000","0.03053760",1571123748.2653,"s","m",""],["7549.00000","0.00007240",1571123748.2691,"s","m",""],["7549.10000","0.47026116",1571123758.2884,"b","l",""],["7549.10000","0.04000000",1571123758.2961,"b","l",""],["7549.10000","0.05542318",1571123758.2983,"b","l",""],["7549.10000","0.00008854",1571123758.3001,"b","l",""],["7549.10000","0.00000012",1571123758.3018,"b","l",""],["7549.40000","0.00642751",1571123764.4037,"b","m",""],["7549.50000","0.86931274",1571123771.6882,"b","l",""],["7551.20000","0.00700000",1571123775.4398,"s","m",""],["7551.60000","0.13056329",1571123775.4609,"b","m",""],["7551.60000","0.26943671",1571123777.5702,"b","l",""],["7552.00000","0.02063000",1571123786.511,"b","m",""],["7552.00000","0.02063000",1571123786.5165,"b","m",""],["7552.00000","0.02063000",1571123786.5184,"b","m",""],["7552.00000","0.02063000",1571123786.5203,"b","m",""],["7553.00000","0.48413200",1571123786.5228,"b","m",""],["7552.90000","0.99001000",1571123796.2702,"b","l",""],["7551.60000","0.00000029",1571123816.5656,"s","m",""],["7551.00000","0.00408774",1571123816.5771,"s","m",""],["7551.40000","0.35000000",1571123827.5182,"b","l",""],["7552.80000","0.07878101",1571123827.5527,"b","l",""],["7552.90000","1.00000000",1571123827.5558,"b","l",""],["7553.50000","0.10343132",1571123827.5582,"b","l",""],["7553.50000","2.46766868",1571123827.5605,"b","l",""],["7553.80000","0.99000000",1571123827.5643,"b","l",""],["7554.40000","0.07499829",1571123827.6154,"b","m",""],["7555.10000","0.92500171",1571123827.6188,"b","m",""],["7554.10000","0.26407031",1571123844.2591,"b","l",""],["7554.10000","0.00068481",1571123844.2792,"b","l",""],["7554.10000","0.00000176",1571123844.2815,"b","l",""],["7554.10000","0.13524312",1571123852.5562,"b","m",""],["7554.10000","0.01570057",1571123852.5859,"b","m",""],["7554.10000","0.23429943",1571123859.4888,"b","l",""],["7554.10000","0.01823037",1571123859.5132,"b","l",""],["7554.10000","0.47560367",1571123859.5161,"b","l",""],["7554.00000","0.01416000",1571123860.5463,"s","l",""],["7554.00000","0.33500000",1571123868.4178,"b","m",""],["7554.10000","1.60656075",1571123868.4253,"b","m",""],["7554.10000","0.39343925",1571123870.8094,"b","m",""],["7556.20000","0.16800000",1571123870.8198,"b","m",""],["7556.50000","0.01059720",1571123870.8234,"b","m",""],["7556.60000","0.00708000",1571123870.826,"b","m",""],["7557.50000","0.34763842",1571123870.8292,"b","m",""],["7558.50000","0.07500000",1571123870.8322,"b","m",""],["7558.60000","0.09400000",1571123870.8347,"b","m",""],["7558.70000","0.27793601",1571123870.8376,"b","m",""],["7554.60000","0.00628278",1571123881.2143,"b","m",""],["7556.70000","0.05249200",1571123883.7329,"b","l",""],["7556.80000","0.32500000",1571123895.8572,"b","m",""],["7556.80000","0.16800000",1571123895.8674,"b","m",""],["7556.90000","0.00439730",1571123895.8696,"b","m",""],["7554.30000","0.00542210",1571123895.8862,"s","l",""],["7554.30000","0.00120790",1571123895.8921,"s","l",""],["7554.90000","0.15048986",1571123898.4488,"b","m",""],["7555.30000","0.00206383",1571123923.603,"s","l",""],["7557.90000","0.00294978",1571123926.5264,"b","l",""],["7558.00000","0.00037892",1571123926.5305,"b","l",""],["7555.50000","0.02046693",1571123929.466,"b","l",""],["7557.70000","0.02003451",1571123932.0161,"b","m",""],["7556.10000","0.03500645",1571123942.8056,"b","m",""],["7556.00000","0.11173600",1571123943.3322,"s","l",""],["7556.10000","0.05000000",1571123944.4599,"b","m",""],["7556.40000","0.07137847",1571123978.9983,"b","l",""],["7556.80000","0.02063000",1571123979.024,"b","l",""],["7557.80000","0.16590221",1571123979.0264,"b","l",""],["7558.90000","0.00505573",1571124055.6471,"b","m",""],["7559.00000","0.99494427",1571124055.6921,"b","m",""],["7559.00000","0.02554474",1571124060.979,"b","m",""],["7558.10000","0.00819475",1571124069.5238,"s","m",""],["7559.00000","0.14951099",1571124069.9946,"b","m",""],["7559.00000","0.20682391",1571124070.0006,"b","m",""],["7559.00000","2.00000000",1571124083.2138,"b","l",""],["7560.20000","0.45109860",1571124083.2324,"b","l",""],["7561.00000","0.25774074",1571124083.2409,"b","l",""],["7561.10000","0.00297757",1571124120.9854,"b","m",""],["7561.10000","0.00319000",1571124135.8111,"b","m",""],["7561.00000","0.02730411",1571124155.0002,"s","l",""],["7561.10000","0.00661000",1571124177.8598,"b","l",""],["7561.10000","0.03251244",1571124182.7858,"b","m",""],["7561.10000","0.03000000",1571124190.6181,"b","m",""],["7561.10000","2.92470999",1571124194.841,"b","l",""],["7561.10000","0.19900000",1571124194.8457,"b","l",""],["7563.40000","0.09200000",1571124194.8488,"b","l",""],["7563.80000","2.15361950",1571124194.8518,"b","l",""],["7564.20000","0.34671355",1571124194.8597,"b","l",""],["7564.70000","0.54188034",1571124194.8619,"b","l",""],["7564.80000","1.00340983",1571124194.8643,"b","l",""],["7563.30000","0.02859854",1571124203.6764,"s","l",""],["7563.30000","0.02123878",1571124213.0713,"s","m",""],["7563.30000","0.00005122",1571124213.0897,"s","m",""],["7563.40000","0.18789700",1571124215.4533,"b","m",""],["7563.30000","0.00661000",1571124217.4736,"s","m",""],["7563.40000","0.01196568",1571124218.6769,"b","m",""],["7563.40000","0.00013732",1571124219.7655,"b","l",""],["7563.40000","0.00645772",1571124219.7721,"b","l",""],["7563.40000","0.00001574",1571124219.7745,"b","l",""],["7563.40000","0.08552654",1571124221.5244,"b","l",""],["7563.40000","0.02494427",1571124221.5339,"b","l",""],["7563.50000","0.81864175",1571124226.9947,"b","m",""],["7563.50000","2.00000000",1571124238.216,"b","m",""],["7563.50000","0.06197827",1571124242.8517,"b","m",""],["7563.50000","0.03931800",1571124243.5643,"b","l",""],["7564.00000","0.04000000",1571124252.1781,"s","l",""],["7563.80000","0.10926120",1571124252.185,"s","l",""],["7563.70000","0.37500000",1571124252.1873,"s","l",""],["7563.60000","0.19350147",1571124252.1901,"s","l",""],["7563.40000","2.28223733",1571124252.1929,"s","l",""],["7564.50000","0.00277501",1571124252.3921,"b","l",""],["7564.50000","0.03678107",1571124252.3981,"b","l",""],["7564.30000","0.28000000",1571124255.1916,"s","l",""],["7563.70000","0.04000000",1571124255.2018,"s","l",""],["7563.40000","1.60729186",1571124255.2053,"s","l",""],["7563.40000","1.77270814",1571124255.2077,"s","l",""],["7563.40000","0.00214230",1571124259.3765,"s","l",""],["7564.00000","0.03000000",1571124266.3577,"b","m",""],["7563.90000","1.19000000",1571124269.1786,"s","l",""],["7563.40000","0.22514956",1571124269.1927,"s","l",""],["7561.10000","0.01321042",1571124269.1967,"s","l",""],["7561.10000","0.00000958",1571124269.1995,"s","l",""],["7561.00000","1.17163044",1571124269.2026,"s","l",""],["7563.30000","0.00661000",1571124314.5561,"b","l",""],["7560.00000","0.07923947",1571124331.397,"s","m",""],["7560.00000","0.04000000",1571124331.4129,"s","m",""],["7560.00000","0.58076053",1571124331.4156,"s","m",""],["7561.10000","0.05200000",1571124341.8043,"b","l",""],["7562.00000","0.09800000",1571124341.8082,"b","l",""],["7563.10000","0.04000000",1571124353.435,"b","m",""],["7563.30000","0.00157888",1571124353.4496,"b","m",""],["7563.30000","0.00661000",1571124359.0235,"b","l",""],["7563.30000","0.00843045",1571124361.102,"b","m",""],["7562.70000","0.24450837",1571124384.2139,"b","m",""],["7562.50000","0.00446091",1571124391.1231,"s","m",""],["7563.30000","0.02166925",1571124422.298,"b","m",""],["7563.30000","0.52710142",1571124464.7581,"b","l",""],["7564.50000","0.01178615",1571124482.4407,"b","m",""],["7563.40000","0.36517325",1571124524.3618,"b","m",""],["7563.40000","0.08538290",1571124524.9198,"b","l",""],["7563.30000","0.00312940",1571124537.2432,"s","l",""],["7563.30000","0.00312940",1571124537.2824,"s","l",""],["7563.30000","0.00312940",1571124537.3459,"s","l",""],["7563.30000","0.00904315",1571124537.3688,"s","l",""],["7563.30000","0.00312940",1571124537.3747,"s","l",""],["7563.30000","0.00312940",1571124537.4695,"s","l",""],["7563.30000","0.00312698",1571124537.6758,"s","l",""],["7563.40000","0.01020103",1571124541.4023,"b","m",""],["7563.40000","0.10000000",1571124544.306,"b","l",""],["7563.40000","0.05424282",1571124544.4137,"b","m",""],["7563.40000","0.10000000",1571124544.4179,"b","m",""],["7563.40000","0.17138995",1571124544.4207,"b","m",""],["7563.30000","0.02859905",1571124547.6188,"s","l",""],["7563.30000","0.01190019",1571124550.1612,"s","l",""],["7563.30000","2.30000000",1571124556.2466,"s","l",""],["7563.30000","0.26168363",1571124557.0173,"s","l",""],["7563.30000","0.04473197",1571124557.0233,"s","l",""],["7562.50000","0.06263704",1571124557.6921,"s","l",""],["7562.00000","0.33736296",1571124557.6979,"s","l",""],["7562.00000","0.47651517",1571124559.2657,"s","l",""],["7560.20000","0.06009882",1571124560.6113,"b","m",""],["7557.40000","0.04000000",1571124585.1568,"s","l",""],["7557.00000","0.02030000",1571124585.1649,"s","l",""],["7557.00000","0.06772310",1571124585.1741,"s","m",""],["7557.60000","0.01543409",1571124586.1207,"b","m",""],["7557.00000","0.07524323",1571124601.3929,"b","m",""],["7557.00000","0.00591167",1571124607.5681,"b","l",""],["7556.60000","0.00948779",1571124618.5137,"b","l",""],["7556.60000","0.00679635",1571124619.3754,"b","m",""],["7556.50000","0.03042534",1571124620.3536,"b","l",""],["7556.00000","0.02880000",1571124635.3649,"b","l",""],["7556.00000","0.01060466",1571124648.9403,"b","l",""],["7555.90000","0.00670000",1571124657.8349,"s","l",""],["7555.90000","0.13200000",1571124657.8751,"s","l",""],["7555.90000","0.00200000",1571124657.8788,"s","l",""],["7553.90000","0.15881000",1571124658.3144,"b","l",""],["7553.30000","0.05414015",1571124675.6199,"b","m",""],["7553.20000","0.02099488",1571124682.6487,"s","l",""],["7553.30000","0.06712000",1571124691.537,"b","m",""],["7553.20000","0.05400512",1571124691.9357,"s","l",""],["7553.10000","0.01293806",1571124691.9426,"s","l",""],["7553.10000","0.00002682",1571124691.9449,"s","l",""],["7552.10000","0.01754845",1571124696.1058,"b","m",""],["7552.00000","0.01350000",1571124716.5863,"s","m",""],["7552.10000","0.01251800",1571124717.5114,"b","m",""],["7552.10000","0.01000000",1571124720.2187,"b","l",""],["7552.10000","0.01920112",1571124721.028,"b","m",""],["7552.10000","0.54328088",1571124732.761,"b","m",""],["7552.10000","0.74228712",1571124732.7805,"b","m",""],["7552.90000","0.04167648",1571124764.9223,"s","l",""],["7553.00000","0.15000000",1571124782.8701,"b","m",""],["7553.00000","0.04000000",1571124782.922,"b","m",""],["7553.00000","0.02083824",1571124782.925,"b","m",""],["7553.00000","0.31510400",1571124782.9283,"b","m",""],["7553.00000","0.01112723",1571124782.9309,"b","m",""],["7553.00000","0.13900000",1571124782.9347,"b","m",""],["7553.00000","0.45112311",1571124782.938,"b","m",""],["7552.90000","0.02469919",1571124782.951,"s","l",""],["7552.90000","0.01255778",1571124782.9558,"s","l",""],["7552.90000","0.09718106",1571124782.9581,"s","l",""],["7552.90000","0.07388549",1571124782.9608,"s","l",""],["7552.90000","0.01255435",1571124782.9632,"s","l",""],["7552.90000","0.79845716",1571124782.9666,"s","l",""],["7552.80000","0.01414045",1571124783.274,"b","m",""],["7552.90000","0.07221789",1571124783.836,"b","m",""],["7551.60000","0.03305859",1571124783.991,"s","l",""],["7551.60000","0.49305592",1571124829.133,"s","l",""],["7551.60000","0.02000000",1571124829.1354,"s","l",""],["7551.60000","0.05388549",1571124829.1374,"s","l",""],["7551.60000","0.19145841",1571124829.1401,"s","l",""],["7551.60000","0.15854159",1571124829.1424,"s","l",""],["7551.60000","1.08305859",1571124829.1443,"s","l",""],["7551.00000","0.01661862",1571124842.0666,"s","m",""],["7551.60000","0.01456766",1571124843.4213,"b","m",""],["7551.00000","0.81519968",1571124844.1432,"s","m",""],["7551.70000","0.45500000",1571124844.7948,"b","m",""],["7551.70000","0.54500000",1571124844.8,"b","m",""],["7551.00000","0.07287793",1571124847.5149,"s","m",""],["7551.00000","0.03643896",1571124859.1088,"b","m",""],["7551.10000","0.20856104",1571124859.1266,"b","m",""],["7549.70000","0.00409200",1571124882.7499,"b","m",""],["7549.10000","0.00958979",1571124899.9485,"b","m",""],["7549.10000","0.08600000",1571124901.5805,"b","m",""],["7551.00000","0.02299881",1571124901.5829,"b","m",""],["7548.00000","0.01200000",1571124903.5854,"s","m",""],["7548.00000","0.98800000",1571124906.9108,"s","l",""],["7545.30000","1.90839878",1571124915.4742,"b","l",""],["7545.20000","0.02063000",1571124917.136,"s","m",""],["7541.20000","1.00000000",1571124917.1461,"s","m",""],["7541.10000","0.04000000",1571124917.1487,"s","m",""],["7540.90000","0.09799881",1571124917.152,"s","m",""],["7540.70000","0.54000000",1571124917.1545,"s","m",""],["7540.40000","1.00000000",1571124917.1572,"s","m",""],["7540.30000","0.80075307",1571124917.1595,"s","m",""],["7540.30000","0.02780234",1571124917.1635,"s","m",""],["7540.30000","1.12843890",1571124917.1656,"s","m",""],["7539.30000","0.01433810",1571124917.1678,"s","m",""],["7538.20000","0.00665600",1571124917.1705,"s","m",""],["7538.20000","0.80000000",1571124917.1731,"s","m",""],["7538.10000","0.08000000",1571124917.1762,"s","m",""],["7536.90000","0.25000000",1571124917.1797,"s","m",""],["7536.90000","1.26200000",1571124917.1829,"s","m",""],["7536.60000","0.75000000",1571124917.1859,"s","m",""],["7535.80000","0.25000000",1571124917.1889,"s","m",""],["7535.10000","0.00910130",1571124917.1917,"s","m",""],["7535.00000","0.00305000",1571124917.1956,"s","m",""],["7535.00000","0.02063000",1571124917.1982,"s","m",""],["7534.40000","0.52878185",1571124917.2009,"s","m",""],["7534.40000","0.53014878",1571124917.2034,"s","m",""],["7534.30000","4.13967085",1571124917.2061,"s","m",""],["7540.50000","0.00202212",1571124931.7659,"b","l",""],["7539.50000","0.11200000",1571124974.2551,"s","l",""],["7538.00000","0.03026100",1571124974.3983,"b","m",""],["7537.80000","0.00635533",1571124977.6267,"b","m",""],["7537.60000","0.00412822",1571125001.0239,"s","m",""],["7537.60000","0.14587178",1571125001.0547,"s","m",""],["7537.60000","0.06132406",1571125003.0743,"s","l",""],["7537.60000","0.01187503",1571125010.7873,"s","l",""],["7538.80000","0.04000000",1571125022.4119,"b","m",""],["7539.70000","0.08848551",1571125022.4264,"b","m",""],["7537.70000","0.00634857",1571125030.9673,"s","l",""],["7537.60000","0.19730480",1571125030.9783,"s","l",""],["7537.60000","0.13056329",1571125030.981,"s","l",""],["7537.60000","0.05306104",1571125030.9831,"s","l",""],["7535.40000","0.34704353",1571125030.9853,"s","l",""],["7535.40000","0.00067877",1571125030.9871,"s","l",""],["7538.30000","0.00251200",1571125032.7506,"b","m",""],["7538.20000","0.00550000",1571125045.1505,"b","l",""],["7539.60000","0.03174800",1571125072.5538,"b","l",""],["7541.90000","0.01235319",1571125082.6237,"b","m",""],["7541.80000","0.08159000",1571125101.4086,"s","m",""],["7541.90000","0.10000000",1571125127.623,"b","m",""],["7541.90000","0.02801953",1571125130.7096,"b","l",""],["7541.80000","0.00402918",1571125138.2099,"s","l",""],["7541.90000","0.00910435",1571125141.1455,"b","m",""],["7541.80000","0.13075649",1571125141.5156,"s","l",""],["7541.80000","0.01570057",1571125141.5199,"s","l",""],["7541.80000","0.16792376",1571125141.5223,"s","l",""],["7541.80000","0.18000000",1571125141.5249,"s","l",""],["7540.30000","0.38750918",1571125141.5279,"s","l",""],["7541.80000","0.01335939",1571125143.1812,"b","m",""],["7541.70000","0.00895053",1571125149.7386,"b","l",""],["7541.90000","0.06264681",1571125149.7636,"b","l",""],["7542.50000","0.03250000",1571125150.3023,"b","m",""],["7542.70000","0.00227063",1571125172.9347,"s","l",""],["7543.10000","0.56500000",1571125191.1609,"s","l",""],["7542.20000","0.06182220",1571125191.174,"s","l",""],["7542.20000","0.00015780",1571125191.1763,"s","l",""],["7545.10000","0.00770043",1571125245.1892,"s","l",""],["7545.30000","0.02698245",1571125257.4544,"b","m",""],["7545.20000","0.01342400",1571125258.0702,"b","m",""],["7545.30000","0.01879038",1571125261.1447,"b","m",""],["7545.10000","0.00366771",1571125262.4062,"b","m",""],["7544.70000","0.00397079",1571125296.1945,"b","m",""],["7544.60000","0.02649738",1571125297.649,"s","m",""],["7542.00000","0.00016162",1571125297.6549,"s","m",""],["7543.60000","0.00645000",1571125297.928,"b","m",""],["7543.10000","0.62043500",1571125309.1653,"b","l",""],["7544.20000","0.01563944",1571125321.3818,"b","m",""],["7543.00000","0.22090297",1571125322.6098,"s","m",""],["7543.00000","0.26472339",1571125324.0666,"s","m",""],["7542.30000","0.34062661",1571125324.0762,"s","m",""],["7542.60000","0.60535000",1571125330.6467,"s","m",""],["7543.80000","0.02382630",1571125338.7755,"b","m",""],["7545.00000","0.03484370",1571125338.7857,"b","m",""],["7542.90000","0.72658659",1571125350.3056,"b","m",""],["7542.90000","0.01191315",1571125350.3335,"b","m",""],["7543.00000","0.20000000",1571125350.337,"b","m",""],["7543.30000","0.01191315",1571125350.3401,"b","m",""],["7543.50000","1.04958711",1571125350.343,"b","m",""],["7543.50000","0.95041289",1571125370.6689,"b","m",""],["7545.00000","0.07500000",1571125370.7199,"b","m",""],["7545.70000","0.29722010",1571125370.7234,"b","m",""],["7544.10000","1.03399959",1571125374.1908,"b","l",""],["7544.10000","0.83640600",1571125377.7739,"b","m",""],["7540.40000","0.06633919",1571125381.1417,"s","m",""],["7544.10000","0.02540000",1571125383.1724,"b","l",""],["7544.70000","0.00271999",1571125403.9177,"b","m",""],["7544.70000","0.01627762",1571125405.5445,"b","l",""],["7545.40000","0.01260901",1571125441.4791,"b","m",""],["7545.40000","0.01335556",1571125442.1631,"b","m",""],["7544.70000","0.02645974",1571125442.6894,"s","m",""],["7544.00000","0.02354026",1571125442.6991,"s","m",""],["7545.40000","0.01234232",1571125443.2621,"b","m",""],["7545.40000","0.01670000",1571125443.9217,"b","m",""],["7545.40000","0.01280094",1571125445.164,"b","m",""],["7545.40000","0.01324532",1571125475.3871,"b","l",""],["7544.00000","0.01325247",1571125485.0336,"s","m",""],["7544.00000","0.00000309",1571125485.0422,"s","m",""],["7543.90000","0.12403810",1571125485.0453,"s","m",""],["7544.10000","0.00654518",1571125494.0434,"b","l",""],["7542.40000","0.00224870",1571125499.0597,"s","l",""],["7544.10000","0.00443850",1571125501.6494,"b","m",""],["7545.30000","0.06633919",1571125505.0495,"b","l",""],["7545.40000","0.12047000",1571125507.932,"s","l",""],["7545.40000","0.01325305",1571125510.8345,"s","l",""],["7545.50000","0.01300000",1571125513.7594,"b","m",""],["7545.50000","0.20203711",1571125514.9531,"b","l",""],["7545.40000","0.30000000",1571125533.1205,"s","m",""],["7545.50000","0.00606942",1571125539.6539,"b","l",""],["7545.40000","0.20000000",1571125541.239,"s","m",""],["7545.50000","0.02605600",1571125542.776,"b","m",""],["7545.50000","0.00744173",1571125561.2041,"b","m",""],["7545.50000","0.05029000",1571125562.6934,"b","m",""],["7545.50000","0.00781686",1571125564.1461,"b","l",""],["7545.40000","0.12000000",1571125582.9611,"s","l",""],["7545.40000","0.10764776",1571125583.9472,"s","l",""],["7545.40000","0.00200000",1571125583.954,"s","l",""],["7545.40000","0.00530124",1571125583.9572,"s","l",""],["7545.40000","2.02750000",1571125583.9609,"s","l",""],["7540.60000","0.03300000",1571125600.0154,"s","m",""],["7540.50000","0.07500000",1571125600.0309,"s","m",""],["7540.40000","0.95773300",1571125600.0346,"s","m",""],["7540.50000","0.02719997",1571125608.5875,"b","m",""],["7540.50000","0.19525205",1571125616.5305,"b","m",""],["7540.50000","0.24500000",1571125616.5408,"b","m",""],["7540.60000","0.91600000",1571125616.5441,"b","m",""],["7540.80000","0.48327012",1571125616.5465,"b","m",""],["7540.80000","0.01672988",1571125617.5967,"b","m",""],["7542.10000","0.08662000",1571125617.6044,"b","m",""],["7542.10000","0.03948494",1571125622.4992,"b","m",""],["7542.10000","0.01552465",1571125623.91,"b","m",""],["7540.50000","0.00663086",1571125646.2541,"b","l",""],["7540.50000","0.10000000",1571125656.8389,"b","m",""],["7540.40000","0.00299134",1571125660.7928,"s","l",""],["7540.40000","0.20000000",1571125675.2123,"s","m",""],["7540.50000","0.49336914",1571125681.3952,"b","l",""],["7540.50000","0.03709086",1571125681.4145,"b","l",""],["7540.50000","0.05074126",1571125683.0144,"b","m",""],["7540.40000","0.00998290",1571125694.1697,"s","l",""],["7540.40000","0.00001710",1571125694.1759,"s","l",""],["7540.40000","0.00209274",1571125694.5753,"s","l",""],["7540.50000","0.21211131",1571125698.0077,"b","l",""],["7540.50000","0.00048869",1571125698.0144,"b","l",""],["7540.50000","0.01657000",1571125704.3961,"b","l",""],["7540.50000","0.00607071",1571125709.2697,"b","l",""],["7540.50000","0.20892717",1571125726.51,"b","m",""],["7540.50000","0.14566283",1571125726.5152,"b","m",""],["7540.40000","0.03502900",1571125733.9556,"s","m",""],["7540.40000","0.91613000",1571125749.214,"s","m",""],["7540.40000","1.39495646",1571125768.2384,"s","l",""],["7540.40000","0.01000000",1571125768.2516,"s","l",""],["7540.40000","0.00770432",1571125768.2548,"s","l",""],["7540.10000","0.06615376",1571125774.1212,"b","l",""],["7540.10000","0.06000000",1571125800.5796,"b","m",""],["7540.10000","0.01699256",1571125801.3081,"b","l",""],["7540.10000","0.00368117",1571125801.3884,"b","m",""],["7540.10000","0.00331492",1571125802.3506,"b","m",""],["7540.10000","0.00000859",1571125802.3566,"b","m",""],["7540.10000","0.00000002",1571125802.3592,"b","m",""],["7540.10000","0.46584898",1571125818.9703,"b","l",""],["7541.70000","0.00602837",1571125825.5459,"b","m",""],["7541.50000","0.06637567",1571125834.5491,"s","m",""],["7541.50000","0.00628278",1571125834.5528,"s","m",""],["7541.50000","0.10034155",1571125834.5553,"s","m",""],["7541.50000","0.02868172",1571125834.8408,"s","l",""],["7541.50000","0.02146659",1571125838.0944,"s","l",""],["7541.50000","0.02046693",1571125838.0989,"s","l",""],["7541.50000","0.03500645",1571125838.1008,"s","l",""],["7541.50000","0.05000000",1571125838.1029,"s","l",""],["7541.50000","0.07137847",1571125838.1053,"s","l",""],["7541.50000","0.01260901",1571125838.1074,"s","l",""],["7541.50000","0.01335556",1571125838.1101,"s","l",""],["7541.50000","0.01234232",1571125838.1126,"s","l",""],["7541.50000","0.01670000",1571125838.1151,"s","l",""],["7541.50000","0.01280094",1571125838.1173,"s","l",""],["7541.50000","0.01324532",1571125838.1196,"s","l",""],["7541.50000","0.00654518",1571125838.1218,"s","l",""],["7541.50000","0.00443850",1571125838.1238,"s","l",""],["7541.50000","0.01300000",1571125838.1258,"s","l",""],["7541.50000","0.09496301",1571125838.1282,"s","l",""],["7541.50000","1.01500000",1571125838.1298,"s","l",""],["7541.50000","2.00000000",1571125838.1324,"s","l",""],["7540.30000","0.58668172",1571125838.1348,"s","l",""],["7540.20000","2.00000000",1571125849.1493,"s","l",""],["7540.10000","0.85780967",1571125849.1631,"s","l",""],["7540.00000","0.46825200",1571125849.167,"s","l",""],["7538.10000","0.13263957",1571125849.17,"s","l",""],["7537.70000","0.53989644",1571125849.1728,"s","l",""],["7537.70000","0.00140009",1571125849.1753,"s","l",""],["7537.70000","0.00000223",1571125849.1778,"s","l",""],["7540.20000","0.00712656",1571125852.6022,"b","m",""],["7538.50000","0.03307710",1571125877.5577,"b","m",""],["7539.70000","0.05000000",1571125883.8241,"b","l",""],["7540.70000","0.06631978",1571125892.53,"b","m",""],["7540.80000","0.22746719",1571125892.5362,"b","m",""],["7540.20000","0.00770024",1571125895.1663,"s","l",""],["7540.20000","0.07466376",1571125907.9245,"s","l",""],["7535.80000","0.01762000",1571125921.4852,"b","l",""],["7535.40000","0.05000000",1571125923.4181,"s","l",""],["7535.50000","1.14000000",1571125927.1245,"b","l",""],["7535.50000","0.38215216",1571125927.1346,"b","l",""],["7535.50000","0.13284784",1571125931.1089,"b","m",""],["7535.60000","0.02500000",1571125931.1225,"b","m",""],["7535.90000","0.01452866",1571125931.1252,"b","m",""],["7535.90000","0.00200000",1571125947.8065,"b","l",""],["7535.40000","0.01071917",1571125949.1084,"s","l",""],["7535.40000","0.52296735",1571125951.7955,"s","m",""],["7535.00000","0.24823265",1571125951.8074,"s","m",""],["7535.20000","0.00530000",1571125959.5177,"b","l",""],["7535.10000","0.11913128",1571125964.8689,"b","l",""],["7535.00000","0.01840964",1571125970.3358,"s","m",""],["7535.00000","0.73335771",1571125974.9256,"s","m",""],["7534.30000","0.84172771",1571125974.9445,"s","m",""],["7534.10000","0.23546458",1571125974.9484,"s","m",""],["7533.50000","0.03163101",1571125983.2325,"b","m",""],["7534.00000","0.08816131",1571126005.3595,"b","m",""],["7533.70000","0.50000000",1571126018.7658,"b","m",""],["7532.00000","0.03976644",1571126027.4353,"s","m",""],["7530.30000","0.16023356",1571126027.4444,"s","m",""],["7530.10000","0.02063000",1571126033.5242,"s","m",""],["7530.10000","0.02063000",1571126033.5446,"s","m",""],["7530.10000","0.02063000",1571126033.547,"s","m",""],["7530.00000","0.25000000",1571126033.5497,"s","m",""],["7530.00000","0.01325948",1571126033.5526,"s","m",""],["7529.10000","0.66000000",1571126033.5559,"s","m",""],["7528.70000","0.01485052",1571126033.5586,"s","m",""],["7528.70000","0.01959712",1571126050.1484,"s","m",""],["7528.50000","0.04207883",1571126050.157,"s","m",""],["7528.40000","0.13832405",1571126050.1602,"s","m",""],["7530.70000","0.02065989",1571126060.5485,"b","l",""],["7535.00000","0.00660000",1571126077.6148,"b","m",""],["7535.00000","0.02682865",1571126085.9449,"b","l",""],["7535.00000","0.00877800",1571126086.748,"b","m",""],["7531.70000","0.01277600",1571126095.6879,"s","l",""],["7531.80000","0.10890000",1571126097.7849,"s","m",""],["7533.50000","0.01324131",1571126099.6414,"b","m",""],["7533.50000","0.00002869",1571126099.6495,"b","m",""],["7530.00000","0.00603365",1571126132.7903,"b","m",""],["7531.70000","0.00356000",1571126143.2138,"b","m",""],["7528.70000","0.07500000",1571126153.6508,"s","m",""],["7528.30000","0.01143182",1571126153.6587,"s","m",""],["7528.20000","0.00578339",1571126153.6624,"s","m",""],["7528.00000","0.05043000",1571126153.6658,"s","m",""],["7527.70000","0.05735479",1571126153.6684,"s","m",""],["7527.70000","0.02917500",1571126153.6826,"s","m",""],["7527.00000","0.01000000",1571126161.5997,"s","m",""],["7527.00000","0.01000000",1571126161.6102,"s","m",""],["7526.40000","0.01348708",1571126161.6138,"s","m",""],["7525.70000","0.00578327",1571126161.6172,"s","m",""],["7524.00000","0.00250000",1571126161.6211,"s","m",""],["7523.30000","0.02495875",1571126161.6238,"s","m",""],["7527.10000","0.08385000",1571126161.6395,"b","m",""],["7527.10000","2.18215000",1571126161.6464,"b","m",""],["7527.10000","0.11785000",1571126161.649,"b","m",""],["7527.10000","0.12215000",1571126161.6563,"b","m",""],["7527.10000","2.00000000",1571126161.6594,"b","m",""],["7527.10000","0.08000000",1571126161.6621,"b","m",""],["7527.40000","1.00000000",1571126161.6647,"b","m",""],["7528.00000","0.22500000",1571126161.6684,"b","m",""],["7528.40000","0.07285000",1571126161.6709,"b","m",""],["7528.40000","0.00215000",1571126161.677,"b","m",""],["7528.40000","0.00544167",1571126161.68,"b","m",""],["7528.40000","0.39355833",1571126161.6869,"b","m",""],["7528.50000","0.60000000",1571126161.6894,"b","m",""],["7528.80000","0.02243386",1571126161.692,"b","m",""],["7529.00000","1.09256614",1571126161.6946,"b","m",""],["7523.30000","0.03977300",1571126161.7011,"s","m",""],["7523.30000","0.02882300",1571126161.7071,"s","m",""],["7523.40000","0.02698245",1571126162.1098,"s","m",""],["7523.20000","0.30000000",1571126162.1164,"s","m",""],["7523.00000","0.00267649",1571126162.1195,"s","m",""],["7521.50000","0.67034106",1571126162.1221,"s","m",""],["7526.70000","0.04305967",1571126162.8787,"b","m",""],["7524.50000","0.01121693",1571126174.8989,"b","l",""],["7525.00000","0.01290000",1571126175.1824,"b","l",""],["7525.00000","0.00009477",1571126180.1309,"b","m",""],["7530.40000","0.08900000",1571126180.1409,"b","m",""],["7531.70000","0.29875615",1571126180.1435,"b","m",""],["7530.30000","0.15000000",1571126184.9956,"s","m",""],["7530.30000","0.00100000",1571126193.2324,"s","m",""],["7531.70000","0.00600661",1571126202.2042,"b","l",""],["7530.50000","0.46000000",1571126216.8665,"s","m",""],["7530.40000","1.52735735",1571126216.8784,"s","m",""],["7530.40000","0.00396083",1571126216.8809,"s","m",""],["7530.40000","0.00001027",1571126216.8832,"s","m",""],["7530.40000","0.00000002",1571126216.8855,"s","m",""],["7531.60000","0.00657700",1571126224.7509,"b","l",""],["7531.60000","0.38146600",1571126225.3088,"b","l",""],["7531.60000","0.14469400",1571126225.9026,"b","l",""],["7531.60000","0.00263300",1571126226.467,"b","l",""],["7531.60000","0.03422900",1571126227.0285,"b","l",""],["7530.70000","0.00331974",1571126230.5403,"s","m",""],["7530.30000","0.00182779",1571126230.5443,"s","m",""],["7530.30000","0.00000247",1571126230.5464,"s","m",""],["7530.70000","0.02395381",1571126268.615,"s","l",""],["7531.70000","0.08140993",1571126275.4578,"b","m",""],["7531.70000","0.01083836",1571126283.2216,"b","m",""],["7531.10000","0.00603509",1571126302.3549,"b","m",""],["7531.70000","0.04205893",1571126313.917,"b","m",""],["7531.60000","0.02044033",1571126323.0498,"s","l",""],["7531.70000","0.00393002",1571126328.6205,"b","l",""],["7534.10000","0.04000000",1571126336.9205,"b","l",""],["7535.00000","0.14000000",1571126336.9245,"b","l",""],["7535.00000","0.00100000",1571126338.583,"b","m",""],["7535.00000","0.12760961",1571126348.2774,"b","m",""],["7535.00000","0.02804518",1571126350.2943,"b","l",""],["7533.80000","0.37500000",1571126369.3641,"s","m",""],["7533.10000","0.02400000",1571126369.3873,"s","m",""],["7531.70000","0.01760846",1571126389.9091,"b","l",""],["7531.80000","0.16646496",1571126389.9116,"b","l",""],["7531.50000","0.00222220",1571126399.5987,"b","m",""],["7530.60000","0.40000000",1571126403.8877,"b","l",""],["7530.60000","0.00769313",1571126403.8909,"b","l",""],["7531.80000","0.24357837",1571126403.8934,"b","l",""],["7531.80000","0.63153600",1571126404.464,"b","l",""],["7530.50000","0.00265307",1571126452.1364,"s","m",""],["7530.40000","2.06914137",1571126452.1502,"s","m",""],["7530.30000","0.11233914",1571126452.1541,"s","m",""],["7530.00000","0.13245392",1571126452.1572,"s","m",""],["7529.20000","0.04000000",1571126452.16,"s","m",""],["7527.00000","0.03480000",1571126452.1634,"s","m",""],["7526.60000","0.03000000",1571126452.1659,"s","m",""],["7526.50000","0.07861250",1571126452.1689,"s","m",""],["7526.00000","0.25532766",1571126460.3841,"b","m",""],["7524.60000","0.64220915",1571126462.7818,"b","m",""],["7524.60000","0.03292331",1571126462.9179,"b","m",""],["7524.00000","0.03249014",1571126468.0587,"b","l",""],["7523.60000","0.00274162",1571126471.5763,"b","l",""],["7519.40000","0.18420240",1571126481.0507,"b","l",""],["7519.30000","0.00268986",1571126481.0629,"s","m",""],["7519.00000","0.00201000",1571126481.0664,"s","m",""],["7519.00000","0.00200600",1571126481.0685,"s","m",""],["7518.10000","0.01291114",1571126481.0707,"s","m",""],["7518.10000","0.02913200",1571126481.0827,"s","m",""],["7519.80000","0.02046693",1571126482.3938,"b","l",""],["7520.00000","0.19000000",1571126483.1598,"b","l",""],["7519.30000","0.02045260",1571126487.093,"b","l",""],["7518.90000","0.02045260",1571126488.5342,"b","l",""],["7517.00000","0.13600000",1571126507.6562,"s","l",""],["7517.00000","0.02738399",1571126507.6778,"s","l",""],["7516.90000","0.25000000",1571126509.4085,"s","m",""],["7516.90000","0.15000000",1571126509.4284,"s","m",""],["7516.90000","0.00417403",1571126511.5936,"s","l",""],["7516.90000","0.15274114",1571126518.1236,"s","l",""],["7516.90000","0.00035886",1571126518.1267,"s","l",""],["7516.90000","0.00324516",1571126518.5815,"s","l",""],["7517.00000","0.00250000",1571126521.0948,"b","m",""],["7517.00000","0.04952734",1571126522.6221,"b","m",""],["7517.00000","0.06354464",1571126525.3576,"b","l",""],["7517.00000","0.12592600",1571126526.7177,"b","m",""],["7516.90000","0.08709048",1571126530.2804,"s","l",""],["7517.00000","0.15200000",1571126531.776,"b","l",""],["7517.00000","0.15563020",1571126531.7807,"b","l",""],["7517.80000","0.29900000",1571126532.7404,"b","l",""],["7520.70000","0.02686192",1571126537.201,"b","l",""],["7521.30000","0.00917900",1571126540.686,"b","m",""],["7521.30000","0.01130200",1571126540.7177,"b","m",""],["7519.10000","0.30000000",1571126540.9303,"s","m",""],["7521.20000","0.31163987",1571126548.7477,"b","m",""],["7517.60000","0.00604521",1571126553.2284,"b","m",""],["7516.90000","0.35289033",1571126566.2027,"s","l",""],["7516.90000","0.09710967",1571126566.2059,"s","l",""],["7516.90000","0.12000000",1571126566.2296,"s","l",""],["7516.90000","0.55000000",1571126566.629,"s","m",""],["7516.90000","0.55000000",1571126568.8352,"s","l",""],["7516.90000","0.04000000",1571126568.932,"s","l",""],["7516.90000","0.04000000",1571126568.9693,"s","l",""],["7516.90000","0.07000000",1571126569.1054,"s","l",""],["7516.90000","0.02877558",1571126569.137,"s","l",""],["7517.00000","0.32609107",1571126574.3592,"b","m",""],["7517.00000","0.01649020",1571126582.6939,"b","m",""],["7516.90000","0.00100000",1571126585.2463,"s","m",""],["7516.90000","0.01301479",1571126586.437,"s","m",""],["7516.90000","0.01000702",1571126586.6764,"s","m",""],["7516.90000","0.00978974",1571126593.8232,"s","l",""],["7516.90000","0.00978972",1571126593.8543,"s","l",""],["7516.90000","0.00919607",1571126593.8839,"s","l",""],["7516.90000","0.01000000",1571126595.4446,"s","l",""],["7516.90000","0.01104342",1571126602.5218,"s","l",""],["7516.90000","0.02877558",1571126603.7057,"s","l",""],["7517.00000","0.01206715",1571126612.1932,"b","l",""],["7516.90000","0.40149841",1571126615.9292,"s","m",""],["7516.90000","1.34623393",1571126615.9319,"s","m",""],["7516.90000","0.00349113",1571126615.9342,"s","m",""],["7516.90000","0.00000653",1571126615.9358,"s","m",""],["7517.00000","0.18993285",1571126618.5884,"b","l",""],["7522.10000","0.04715844",1571126623.2095,"b","m",""],["7522.10000","0.06391423",1571126632.489,"b","m",""],["7522.10000","0.03608577",1571126668.7298,"b","l",""],["7522.10000","0.16391423",1571126668.741,"b","l",""],["7522.10000","0.20000000",1571126673.1426,"b","l",""],["7522.10000","0.00604279",1571126675.8488,"b","m",""],["7522.00000","0.00299628",1571126684.8837,"s","l",""],["7522.10000","0.81700000",1571126685.1544,"s","l",""],["7524.50000","0.22978000",1571126687.4632,"b","l",""],["7524.50000","0.00199810",1571126687.6098,"b","m",""],["7524.50000","0.02670904",1571126703.1887,"b","m",""],["7524.50000","0.00900000",1571126711.3654,"b","m",""],["7524.50000","0.72490470",1571126728.5664,"b","m",""],["7524.50000","0.64532782",1571126729.4022,"b","m",""],["7524.40000","0.00444097",1571126730.255,"s","m",""],["7524.40000","0.00533859",1571126730.562,"s","l",""],["7524.50000","0.01988318",1571126742.0355,"b","l",""],["7524.40000","0.00360236",1571126752.6285,"s","l",""],["7524.40000","0.07025557",1571126759.3793,"s","m",""],["7524.40000","0.00606942",1571126759.3976,"s","m",""],["7524.40000","0.02605600",1571126759.4,"s","m",""],["7524.40000","0.00744173",1571126759.4024,"s","m",""],["7524.40000","0.05029000",1571126759.4047,"s","m",""],["7524.40000","0.00781686",1571126759.4074,"s","m",""],["7524.40000","0.19525205",1571126759.4101,"s","m",""],["7524.40000","0.00663086",1571126759.4127,"s","m",""],["7524.40000","0.10000000",1571126759.4149,"s","m",""],["7524.40000","0.11380931",1571126759.4174,"s","m",""],["7522.20000","0.01000000",1571126759.4199,"s","m",""],["7522.00000","0.10637820",1571126759.4223,"s","m",""],["7524.40000","0.01988936",1571126760.9441,"b","l",""],["7524.40000","0.00005064",1571126760.9525,"b","l",""],["7524.30000","0.04200000",1571126761.7112,"s","m",""],["7524.30000","0.06132406",1571126762.6881,"s","l",""],["7524.40000","0.23349737",1571126776.2412,"s","l",""],["7524.40000","0.00658602",1571126776.3394,"s","l",""],["7524.40000","0.01841601",1571126776.5924,"s","l",""],["7524.50000","0.01214400",1571126828.1691,"b","m",""],["7524.40000","0.12052306",1571126832.0829,"s","m",""],["7524.50000","0.26478000",1571126840.0401,"b","m",""],["7524.50000","0.02657983",1571126847.9028,"b","l",""],["7524.50000","0.03775466",1571126875.5881,"b","l",""],["7524.50000","0.00002867",1571126875.5942,"b","l",""],["7524.60000","0.03000000",1571126877.0101,"b","m",""],["7524.50000","0.44390540",1571126880.4349,"s","m",""],["7524.50000","0.00114460",1571126880.4449,"s","m",""],["7524.50000","0.02396624",1571126882.9702,"s","l",""],["7524.60000","0.07028322",1571126902.816,"b","m",""],["7524.50000","0.04829000",1571126917.5648,"s","l",""],["7526.40000","0.00200000",1571126941.0812,"b","m",""],["7526.40000","0.02072429",1571126941.4177,"b","m",""],["7526.30000","0.07462558",1571126945.7524,"s","l",""],["7524.50000","0.24099409",1571126951.9165,"s","l",""],["7521.30000","0.04752825",1571126959.4353,"b","m",""],["7520.00000","0.00281000",1571126963.8917,"s","m",""],["7521.00000","0.16760000",1571126969.2737,"b","m",""],["7520.70000","0.00300000",1571126971.0269,"s","m",""],["7520.70000","0.00165000",1571126972.7931,"s","m",""],["7520.70000","0.00135000",1571126972.8009,"s","m",""],["7520.70000","0.00300000",1571126973.8583,"s","m",""],["7520.70000","0.00300000",1571126977.8338,"s","m",""],["7521.90000","0.03239543",1571126984.6044,"b","m",""],["7520.00000","0.00691218",1571127008.5853,"s","m",""],["7520.10000","0.03000000",1571127012.3359,"b","l",""],["7520.00000","0.99027782",1571127014.1085,"s","m",""],["7520.00000","0.34868618",1571127014.1137,"s","m",""],["7520.10000","0.80297622",1571127035.4214,"b","m",""],["7520.00000","0.28600973",1571127037.0748,"s","l",""],["7520.00000","0.03270826",1571127037.0802,"s","l",""],["7517.30000","0.00618700",1571127041.2289,"s","m",""],["7517.50000","0.02044033",1571127041.6229,"b","l",""],["7517.50000","0.18521055",1571127041.6318,"b","l",""],["7517.40000","0.43041842",1571127060.1322,"b","l",""],["7517.30000","0.02535000",1571127064.129,"s","l",""],["7517.30000","0.03610244",1571127064.3965,"s","m",""],["7516.80000","0.01654864",1571127064.4022,"s","m",""],["7516.90000","0.01393230",1571127068.5923,"b","l",""],["7516.90000","0.00601977",1571127073.7414,"b","m",""],["7516.80000","0.02400000",1571127074.9448,"s","m",""],["7516.80000","0.02400000",1571127082.9938,"s","m",""],["7516.80000","0.04000000",1571127088.5359,"s","l",""],["7516.80000","4.67411261",1571127090.4254,"s","l",""],["7515.60000","0.00270331",1571127090.4347,"s","l",""],["7515.30000","0.08000000",1571127090.4382,"s","l",""],["7514.90000","0.24318408",1571127090.4404,"s","l",""],["7515.00000","0.02400000",1571127098.2042,"s","m",""],["7515.40000","0.06048509",1571127115.3084,"b","m",""],["7514.80000","0.50000000",1571127171.0261,"b","m",""],["7514.80000","0.70000000",1571127171.038,"b","m",""],["7514.80000","0.20000000",1571127171.0406,"b","m",""],["7514.80000","2.00000000",1571127171.0434,"b","m",""],["7515.10000","0.52000000",1571127171.0458,"b","m",""],["7515.20000","7.25100000",1571127171.0482,"b","m",""],["7515.40000","0.77000000",1571127171.0509,"b","m",""],["7515.70000","0.33030000",1571127171.0532,"b","m",""],["7515.70000","0.04370000",1571127173.6252,"b","m",""],["7516.20000","0.06546762",1571127173.6321,"b","m",""],["7516.20000","0.02977724",1571127181.843,"b","m",""],["7514.70000","0.02063000",1571127182.4204,"s","l",""],["7514.10000","0.00579688",1571127182.4282,"s","l",""],["7514.00000","0.05000000",1571127182.4318,"s","l",""],["7513.70000","0.12879300",1571127182.4368,"s","l",""],["7513.60000","0.80000000",1571127182.4395,"s","l",""],["7513.40000","0.03289701",1571127182.4423,"s","l",""],["7513.00000","0.00200600",1571127182.4448,"s","l",""],["7513.80000","0.06439650",1571127185.8622,"s","l",""],["7512.70000","0.85500000",1571127189.265,"s","l",""],["7512.80000","0.42900000",1571127190.1058,"b","m",""],["7514.70000","0.04000000",1571127190.1112,"b","m",""],["7515.20000","0.10044132",1571127190.1134,"b","m",""],["7515.30000","0.24000000",1571127190.1155,"b","m",""],["7516.30000","0.47039158",1571127190.1181,"b","m",""],["7515.20000","0.03847847",1571127191.7413,"b","m",""],["7514.10000","0.17500000",1571127192.9807,"s","l",""],["7514.00000","0.37955983",1571127192.9885,"s","l",""],["7514.00000","0.22044017",1571127192.9924,"s","l",""],["7512.90000","0.04121485",1571127202.0474,"s","m",""],["7512.90000","1.95878515",1571127204.3174,"s","l",""],["7512.90000","0.10165815",1571127204.3213,"s","l",""],["7513.00000","0.02137639",1571127207.8844,"b","m",""],["7512.90000","0.27000000",1571127214.9696,"s","l",""],["7512.90000","0.05082907",1571127214.9924,"s","l",""],["7512.00000","0.00201000",1571127219.1025,"s","l",""],["7512.00000","0.01302953",1571127222.615,"b","l",""],["7511.90000","0.00271682",1571127222.9056,"s","l",""],["7511.00000","1.00000000",1571127226.3628,"s","l",""],["7510.00000","1.00000000",1571127239.8306,"s","l",""],["7510.00000","0.10000000",1571127239.841,"s","l",""],["7509.30000","0.02574500",1571127239.8521,"s","m",""],["7510.10000","0.03127385",1571127242.6515,"b","m",""],["7508.20000","0.00273039",1571127260.1646,"s","m",""],["7507.50000","0.00026961",1571127260.1754,"s","m",""],["7507.60000","0.02200000",1571127260.7862,"s","m",""],["7507.60000","0.02944220",1571127261.3956,"s","m",""],["7508.00000","1.81121953",1571127269.389,"s","m",""],["7508.00000","0.00397594",1571127269.3968,"s","m",""],["7508.00000","0.00000873",1571127269.3993,"s","m",""],["7508.00000","0.00000001",1571127269.4015,"s","m",""],["7508.30000","0.03400000",1571127269.838,"b","m",""],["7508.30000","0.00200000",1571127273.3116,"b","m",""],["7508.30000","0.05977825",1571127283.7487,"b","l",""],["7508.20000","0.14274439",1571127284.3695,"s","m",""],["7508.20000","0.00420000",1571127284.3796,"s","m",""],["7508.20000","0.00305561",1571127284.3816,"s","m",""],["7508.30000","0.02521300",1571127286.6108,"b","m",""],["7509.10000","0.00200000",1571127295.389,"s","m",""],["7509.10000","0.00200000",1571127301.3072,"s","m",""],["7509.20000","0.02391284",1571127303.2968,"b","m",""],["7509.10000","0.02500000",1571127304.9677,"s","m",""],["7509.10000","0.01995172",1571127305.2544,"s","m",""],["7509.10000","0.00004828",1571127305.2585,"s","m",""],["7509.20000","0.15608716",1571127311.4034,"b","m",""],["7509.20000","0.11627468",1571127311.4104,"b","m",""],["7509.10000","0.08047694",1571127321.5703,"s","m",""],["7509.10000","0.02138365",1571127321.5942,"s","m",""],["7509.10000","0.44651004",1571127321.5964,"s","m",""],["7508.10000","0.02645163",1571127321.5996,"s","m",""],["7507.90000","0.11692193",1571127321.6023,"s","m",""],["7507.90000","0.49213220",1571127321.605,"s","m",""],["7507.70000","0.08000000",1571127321.6072,"s","m",""],["7507.20000","0.04720000",1571127321.6107,"s","m",""],["7507.10000","0.04000000",1571127321.6132,"s","m",""],["7507.10000","0.04720000",1571127321.6162,"s","m",""],["7507.10000","0.16172361",1571127321.6188,"s","m",""],["7506.90000","0.00200000",1571127324.4078,"s","m",""],["7506.90000","0.02992100",1571127324.4225,"s","m",""],["7506.80000","0.00200000",1571127329.5268,"s","m",""],["7506.80000","0.00200000",1571127334.6151,"s","m",""],["7506.80000","0.00300000",1571127350.3908,"s","m",""],["7506.80000","0.00115000",1571127353.014,"s","m",""],["7506.80000","0.00185000",1571127353.0284,"s","m",""],["7506.90000","0.00684180",1571127372.1479,"b","m",""],["7506.80000","0.00879950",1571127380.3586,"s","l",""],["7506.90000","0.14915820",1571127390.9854,"b","l",""],["7506.90000","0.01946050",1571127390.9916,"b","l",""],["7506.90000","0.10668130",1571127390.995,"b","l",""],["7506.90000","0.00001870",1571127392.3111,"b","l",""],["7508.80000","0.02574500",1571127392.3155,"b","l",""],["7510.20000","0.07500000",1571127392.7602,"b","l",""],["7511.60000","0.20000000",1571127397.6864,"s","m",""],["7511.70000","0.08200000",1571127397.8681,"b","l",""],["7515.80000","0.03000000",1571127399.7516,"b","l",""],["7516.50000","0.00395498",1571127399.768,"b","m",""],["7516.70000","0.00877342",1571127399.7709,"b","m",""],["7516.70000","0.03122658",1571127400.1328,"b","l",""],["7516.80000","0.02997342",1571127400.1361,"b","l",""],["7518.20000","0.03000000",1571127400.7357,"b","l",""],["7516.80000","0.30000000",1571127401.3907,"s","l",""],["7520.30000","0.12045795",1571127402.8071,"s","l",""],["7520.40000","0.00350000",1571127405.2642,"b","l",""],["7520.40000","0.00009393",1571127405.8794,"b","l",""],["7521.20000","0.21800000",1571127407.072,"b","l",""],["7524.40000","0.57900000",1571127408.3666,"s","l",""],["7524.50000","0.10000000",1571127408.3797,"b","m",""],["7524.50000","0.12381739",1571127408.3868,"b","m",""],["7524.50000","0.01464117",1571127409.9159,"b","l",""],["7524.50000","0.01425100",1571127410.1423,"b","l",""],["7524.50000","0.03704299",1571127437.3447,"b","m",""],["7524.50000","0.01988322",1571127450.8338,"b","l",""],["7524.50000","0.00004508",1571127450.8452,"b","l",""],["7524.50000","0.00273648",1571127478.1413,"b","l",""],["7524.40000","0.17077501",1571127488.6708,"s","l",""],["7524.50000","0.03983573",1571127490.811,"b","m",""],["7524.50000","0.01295600",1571127514.8986,"b","m",""],["7524.50000","0.01479094",1571127517.3759,"b","l",""],["7524.50000","0.11200000",1571127517.3959,"b","l",""],["7524.50000","0.22490906",1571127517.3992,"b","l",""],["7524.50000","0.00009094",1571127519.0109,"b","l",""],["7524.50000","0.00258145",1571127519.0256,"b","l",""],["7525.10000","0.02063000",1571127519.0284,"b","l",""],["7533.50000","0.59000000",1571127524.3211,"s","l",""],["7532.10000","0.01210057",1571127550.2271,"s","l",""],["7532.10000","0.02765320",1571127563.3407,"s","l",""],["7532.10000","0.01209991",1571127565.1476,"s","l",""],["7532.20000","0.05181200",1571127574.966,"b","m",""],["7532.20000","0.00718800",1571127579.6079,"b","m",""],["7533.50000","0.02063000",1571127579.6223,"b","m",""],["7535.30000","0.02063000",1571127579.6247,"b","m",""],["7535.40000","0.00678805",1571127579.6274,"b","m",""],["7535.50000","0.01259295",1571127579.6309,"b","m",""],["7532.30000","0.06132100",1571127580.0812,"s","l",""],["7535.40000","0.04790572",1571127581.9245,"s","l",""],["7535.40000","0.00012423",1571127581.9359,"s","l",""],["7535.40000","0.00000005",1571127581.938,"s","l",""],["7535.40000","0.06132100",1571127581.9868,"s","l",""],["7535.50000","0.02774781",1571127602.086,"b","m",""],["7535.50000","0.00834981",1571127603.7744,"b","m",""],["7535.50000","0.55130943",1571127604.7877,"b","m",""],["7537.00000","0.72471899",1571127604.795,"b","m",""],["7537.00000","0.00520792",1571127605.033,"b","m",""],["7537.00000","0.00219015",1571127606.8901,"b","l",""],["7539.30000","0.06647962",1571127629.7407,"s","l",""],["7539.30000","0.03032040",1571127629.7478,"s","l",""],["7539.30000","0.00200000",1571127629.7503,"s","l",""],["7539.30000","0.01195757",1571127629.7529,"s","l",""],["7539.30000","0.03057998",1571127629.7554,"s","l",""],["7539.30000","0.00541000",1571127629.7577,"s","l",""],["7539.30000","0.00707125",1571127629.7601,"s","l",""],["7539.30000","0.01063145",1571127629.7627,"s","l",""],["7539.30000","0.00323400",1571127629.7652,"s","l",""],["7539.30000","0.00618867",1571127629.7676,"s","l",""],["7539.30000","0.03908847",1571127629.7697,"s","l",""],["7539.30000","0.00642751",1571127629.7719,"s","l",""],["7539.30000","0.01931247",1571127629.7739,"s","l",""],["7539.30000","0.85823498",1571127629.777,"s","l",""],["7538.00000","0.01358700",1571127635.219,"b","m",""],["7537.90000","0.54500000",1571127637.0843,"b","l",""],["7538.00000","0.58641300",1571127637.0942,"b","l",""],["7538.90000","0.09749478",1571127637.097,"b","l",""],["7539.30000","0.00322386",1571127638.6406,"s","l",""],["7539.30000","0.02063000",1571127659.3729,"s","l",""],["7539.40000","0.00610000",1571127663.7554,"b","m",""],["7539.40000","0.03923616",1571127664.934,"b","l",""],["7539.40000","0.13229258",1571127665.6583,"b","m",""],["7539.40000","0.00349850",1571127695.5704,"b","l",""],["7539.40000","0.00300000",1571127703.9928,"b","m",""],["7539.30000","0.00678237",1571127704.145,"s","m",""],["7539.40000","0.00300000",1571127705.6324,"b","m",""],["7539.40000","0.01702000",1571127709.2022,"b","m",""],["7539.30000","1.17600809",1571127711.6592,"s","l",""],["7538.80000","0.04874739",1571127722.5769,"b","m",""],["7538.80000","0.01092036",1571127722.5866,"b","m",""],["7538.50000","0.01616200",1571127728.3635,"b","m",""],["7538.50000","0.00821170",1571127730.4793,"b","m",""],["7538.50000","0.01681881",1571127730.4901,"b","m",""],["7538.30000","0.03000000",1571127756.6505,"s","m",""],["7538.30000","0.00291758",1571127760.6568,"s","l",""],["7538.40000","0.00544500",1571127767.494,"b","l",""],["7539.10000","0.04913492",1571127773.6579,"b","m",""],["7538.60000","0.13264000",1571127791.1221,"b","l",""],["7538.50000","0.08471314",1571127800.9285,"b","m",""],["7538.50000","0.00795850",1571127808.2122,"b","l",""],["7538.50000","0.01877600",1571127810.6946,"b","m",""],["7538.50000","0.01311700",1571127822.8772,"b","m",""],["7538.50000","0.15000000",1571127824.3608,"b","l",""]],"last":"1571127824360805960"}}'
FRAGMENTED_TRADES = '{"error":[],"result":{"ADAETH":[["0.000490000","42.00000000",1538147978.8057,"b","m",""],["0.000373400","579.98215041",1538148134.7575,"s","m",""],["0.000373400","1.50404308",1538148134.7644,"s","m",""],["0.000373400","0.00390037",1538148134.7667,"s","m",""],["0.000373400","0.00001011",1538148134.7687,"s","m",""],["0.000490000","458.00000000",1538148183.99,"b","m",""],["0.000489000","250.00000000",1538148326.1047,"b","m",""],["0.000491000","160.00000000",1538148326.112,"b","m",""],["0.000488000","110.00000000",1538148429.7194,"b","l",""],["0.000488000","140.00000000",1538148739.1002,"b","m",""],["0.000490000","250.00000000",1538148739.1083,"b","m",""],["0.000491000","90.00000000",1538148739.1111,"b","m",""],["0.000497800","220.00000000",1538148739.1142,"b","m",""],["0.000495000","250.00000000",1538148890.5451,"b","m",""],["0.000497800","150.00000000",1538148890.5669,"b","m",""],["0.000373900","10.00000000",1538150243.7262,"s","m",""],["0.000373700","139.43746260",1538150243.7295,"s","m",""],["0.000373700","0.36159725",1538150243.7317,"s","m",""],["0.000373700","0.00093771",1538150243.7339,"s","m",""],["0.000396000","10.00000000",1538150759.7889,"b","m",""],["0.000396000","304.01082475",1538151101.6746,"b","l",""],["0.000396000","303.99075962",1538151107.6748,"b","l",""],["0.000396000","2728.63260346",1538151149.499,"b","l",""],["0.000396000","4.35883803",1538151149.501,"b","l",""],["0.000396000","0.00696300",1538151149.5029,"b","l",""],["0.000396000","0.00001112",1538151149.5047,"b","l",""],["0.000396000","0.00058439",1538151194.8067,"s","l",""],["0.000379200","3167.26456083",1538151194.8104,"s","l",""],["0.000379400","5572.13927200",1538151198.3805,"s","l",""],["0.000379300","4206.86072800",1538151198.3838,"s","l",""],["0.000483900","500.00000000",1538152250.5391,"b","m",""],["0.000382200","6014.45673708",1538152269.6838,"s","l",""],["0.000383000","120.65146869",1538153017.4231,"s","l",""],["0.000383000","77.72033207",1538153043.5716,"s","l",""],["0.000383000","0.20154883",1538153043.5747,"s","l",""],["0.000383000","0.00052086",1538153043.5767,"s","l",""],["0.000383000","5018.87649608",1538153050.8521,"s","l",""],["0.000381100","6.26150392",1538153055.9915,"s","l",""],["0.000381100","764.92564038",1538153068.5136,"s","l",""],["0.000381000","650.00000000",1538153068.5181,"s","l",""],["0.000380000","6954.86701944",1538153068.5218,"s","l",""],["0.000449900","3000.00000000",1538153070.6614,"b","m",""],["0.000380000","6260.25698629",1538153098.8497,"s","l",""],["0.000380000","77.96396946",1538153130.0921,"s","l",""],["0.000380000","0.20218065",1538153130.0943,"s","l",""],["0.000380000","0.00052250",1538153130.0962,"s","l",""],["0.000380000","5142.80875776",1538153130.1309,"s","l",""],["0.000380000","53825.67389737",1538153131.3009,"s","l",""],["0.000375500","101.14810263",1538153134.884,"s","l",""],["0.000390000","3244.22000000",1538153688.1992,"b","m",""],["0.000388800","180.00000000",1538153801.8707,"b","m",""],["0.000388500","500.00000000",1538153822.3927,"b","m",""],["0.000381100","2500.00000000",1538154125.5093,"b","m",""],["0.000379700","22.00000000",1538154327.0189,"b","m",""],["0.000379600","200.00000000",1538154355.4189,"b","l",""],["0.000379500","7172.93840342",1538154361.9265,"b","l",""],["0.000379700","18827.06159658",1538154361.9312,"b","l",""],["0.000377000","3350.72941645",1538155269.8513,"s","l",""],["0.000384100","7172.93840342",1538155423.1018,"b","m",""],["0.000384200","17947.06159658",1538155423.109,"b","m",""],["0.000380600","1130.00000000",1538155667.727,"s","l",""],["0.000380700","39.00000000",1538155736.9247,"b","m",""],["0.000380700","3944.73199999",1538155773.4734,"b","l",""],["0.000380700","1250.32834252",1538156121.1921,"b","l",""],["0.000380700","942.51679538",1538156124.632,"s","l",""],["0.000380600","0.28901734",1538156124.6372,"s","l",""],["0.000380300","80.08008008",1538156357.4569,"b","l",""],["0.000380200","3000.00000000",1538156541.7376,"b","m",""],["0.000380200","105.99707916",1538156775.2162,"b","l",""],["0.000380100","4087.25861615",1538157271.3637,"b","l",""],["0.000380100","3085.67978727",1538157271.4407,"b","l",""],["0.000380200","882.09182864",1538157271.4443,"b","l",""],["0.000380400","30053.23349332",1538157271.4478,"b","l",""],["0.000380400","0.00000009",1538157271.4499,"b","l",""],["0.000387400","10000.00000000",1538157271.4522,"b","l",""],["0.000389500","6000.00000000",1538157271.455,"b","l",""],["0.000389500","20000.00000000",1538157271.4576,"b","l",""],["0.000389600","50838.98532348",1538157271.4617,"b","l",""],["0.000389600","81.21243662",1538157271.4653,"b","l",""],["0.000389600","0.12973233",1538157271.4675,"b","l",""],["0.000389600","0.00020724",1538157271.4696,"b","l",""],["0.000389600","2444.45867855",1538157272.3722,"s","l",""],["0.000380400","19.54132145",1538157272.3793,"s","l",""],["0.000380400","1216.60484048",1538157275.4089,"s","l",""],["0.000380400","1296.57347829",1538157275.4116,"s","l",""],["0.000380400","3011.19832887",1538157275.4142,"s","l",""],["0.000380400","4475.62335236",1538157275.4167,"s","l",""],["0.000387300","5857.34700387",1538157275.8924,"b","l",""],["0.000389400","2865.16719284",1538157276.4387,"b","l",""],["0.000387300","1943.97108184",1538157277.7016,"s","l",""],["0.000380400","2034.80875901",1538157277.7055,"s","l",""],["0.000380400","3960.97124982",1538157278.9202,"s","l",""],["0.000380400","6039.02875018",1538157278.923,"s","l",""],["0.000387300","1943.23194918",1538157279.7055,"b","l",""],["0.000387300","1341.82017854",1538157280.7385,"s","l",""],["0.000380400","5103.65632507",1538157282.9523,"s","l",""],["0.000380100","3085.68038385",1538157282.9581,"s","l",""],["0.000378000","20.00000000",1538157282.9618,"s","l",""],["0.000375600","1790.66329108",1538157282.9652,"s","l",""],["0.000380000","100.98654967",1538157285.8188,"b","l",""],["0.000380000","0.16132037",1538157285.8211,"b","l",""],["0.000380000","0.00025770",1538157285.823,"b","l",""],["0.000378200","627.79509477",1538157294.8488,"s","l",""],["0.000378200","0.20490523",1538157294.8521,"s","l",""],["0.000380400","3978.77984085",1538157327.6929,"b","l",""],["0.000378200","422.30800000",1538157331.021,"s","l",""],["0.000380400","450.45045045",1538157409.3041,"b","l",""],["0.000380400","1001.00100100",1538157437.0449,"b","l",""],["0.000380400","2536.53142681",1538157520.4827,"b","l",""],["0.000380400","3986.60500718",1538157976.501,"b","l",""],["0.000380800","3987.77083610",1538157982.012,"b","l",""],["0.000380800","0.00050396",1538157982.7405,"s","l",""],["0.000380400","1847.13363077",1538157982.7437,"s","l",""],["0.000380800","1897.44590336",1538157988.2273,"s","l",""],["0.000380800","155.00906880",1538157988.2373,"s","l",""],["0.000380800","140.82603024",1538157990.1994,"b","l",""],["0.000380800","1794.48983370",1538157992.5053,"b","l",""],["0.000380800","0.00044297",1538157994.1971,"s","l",""],["0.000380700","2782.07229377",1538158015.1837,"b","l",""],["0.000380400","1719.19391917",1538158030.2072,"s","l",""],["0.000378000","130.00000000",1538158271.7702,"s","l",""],["0.000376100","533.55490029",1538158271.774,"s","l",""],["0.000376100","354.68128167",1538158271.7771,"s","l",""],["0.000379800","3996.16368286",1538158276.0087,"b","m",""],["0.000390700","2003.83631714",1538158276.0193,"b","m",""],["0.000376300","1009.44130860",1538158513.7625,"s","l",""],["0.000379400","2500.00000000",1538158616.9538,"b","m",""],["0.000380200","200.00000000",1538158785.1898,"b","m",""],["0.000379600","117.13413413",1538160721.3382,"b","l",""],["0.000376700","2377.00000000",1538161591.2685,"s","l",""],["0.000376800","1024.00000000",1538161612.257,"s","l",""],["0.000376900","28.00000000",1538161620.2461,"s","l",""],["0.000377000","28.00000000",1538161630.1338,"s","l",""],["0.000380400","428.80452194",1538161901.3447,"s","l",""],["0.000380800","3989.04342739",1538162220.4052,"b","l",""],["0.000381400","2399.89026114",1538162241.6564,"b","l",""],["0.000381400","313.02897535",1538162241.6676,"b","l",""],["0.000381400","670.54011556",1538162254.3245,"b","l",""],["0.000381400","595.32048880",1538162254.3538,"b","l",""],["0.000381700","3978.04121251",1538162272.1161,"b","l",""],["0.000382100","144.77404874",1538162276.4429,"b","l",""],["0.000382100","3340.69002410",1538162279.6845,"b","l",""],["0.000382600","2002.00200200",1538162390.0579,"b","l",""],["0.000384200","100.10010010",1538162470.9788,"b","l",""],["0.000384200","3232.74952194",1538162471.195,"b","l",""],["0.000384200","100.10010010",1538162471.6304,"b","l",""],["0.000384200","504.05815188",1538162473.3081,"b","l",""],["0.000385700","1233.30465837",1538162476.2247,"b","l",""],["0.000384700","3343.21074802",1538162484.3516,"b","l",""],["0.000384700","604.15767303",1538162484.9084,"b","l",""],["0.000385300","3937.00787402",1538162498.9294,"b","l",""],["0.000385200","282.96768990",1538162504.0799,"b","l",""],["0.000385200","3654.04018412",1538162504.1722,"b","l",""],["0.000385900","1251.25125124",1538162517.7922,"b","l",""],["0.000385900","565.25325213",1538162518.9083,"b","l",""],["0.000385200","1288.88239148",1538162581.0503,"b","l",""],["0.000385200","257.40441795",1538162581.0975,"b","l",""],["0.000385200","591.77708930",1538162581.1965,"b","l",""],["0.000385200","14.39820044",1538162581.2169,"b","l",""],["0.000385200","965.01030919",1538162581.4124,"b","l",""],["0.000385200","819.53546566",1538162581.4785,"b","l",""],["0.000385200","1784.54600000",1538162584.3549,"s","l",""],["0.000385200","1281.86564563",1538162587.4783,"b","l",""],["0.000385200","869.45988752",1538162590.4958,"b","l",""],["0.000386300","2.69169169",1538162596.0541,"b","l",""],["0.000386300","10.01001001",1538162603.517,"b","l",""],["0.000385600","3939.07563025",1538162619.6702,"b","l",""],["0.000384600","133.39038762",1538162659.1026,"s","l",""],["0.000385200","100.00000000",1538162970.4821,"b","m",""],["0.000384800","1000.00000000",1538163286.8638,"b","m",""],["0.000382300","1600.00000000",1538163517.3475,"b","m",""],["0.000382300","9991.66033116",1538163925.1894,"s","l",""],["0.000382300","8.33966884",1538164286.9001,"s","l",""],["0.000382400","150.00000000",1538164465.9197,"s","l",""],["0.000386200","2582.61916106",1538164519.675,"b","m",""],["0.000386300","3921.56862745",1538164763.3258,"b","l",""],["0.000386900","315.31531531",1538164836.4065,"b","l",""],["0.000382000","100.00000000",1538164899.4965,"s","l",""],["0.000386900","292.48547428",1538164952.7646,"b","l",""],["0.000386900","100.00000000",1538164995.9805,"b","l",""],["0.000382800","100.00000000",1538165002.2578,"s","l",""],["0.000387700","150.15015015",1538165037.1877,"b","l",""],["0.000387700","3766.60573151",1538165052.8125,"b","l",""],["0.000382900","100.00000000",1538165140.8676,"s","l",""],["0.000382900","92.27500000",1538165215.6859,"s","l",""],["0.000382900","100.00000000",1538165367.9132,"s","l",""],["0.000386700","5737.56809930",1538165383.3306,"b","m",""],["0.000386400","1000.00000000",1538165452.2297,"b","l",""],["0.000386400","1200.00000000",1538165542.8869,"s","l",""],["0.000386400","100.00000000",1538165649.5971,"b","l",""],["0.000387000","3916.44908616",1538165649.6018,"b","l",""],["0.000387700","2560.00000000",1538165676.4317,"b","m",""],["0.000387400","2660.00000000",1538165821.0672,"b","m",""],["0.000386200","200.20020020",1538165938.8176,"b","l",""],["0.000387100","570.07482438",1538166101.5077,"b","l",""],["0.000387100","0.91066266",1538166101.5136,"b","l",""],["0.000387100","0.00145473",1538166101.5158,"b","l",""],["0.000384000","299.22256493",1538166275.8801,"s","l",""],["0.000384000","0.77596117",1538166275.8836,"s","l",""],["0.000384000","0.00147390",1538166275.8859,"s","l",""],["0.000387300","3412.00000000",1538166354.5522,"b","m",""],["0.000387300","1075.86958068",1538166444.5011,"b","l",""],["0.000388100","107.24189049",1538166622.8345,"b","l",""],["0.000387700","1101.10110110",1538167616.3808,"b","l",""],["0.000387700","195.19519519",1538167692.0225,"b","l",""],["0.000387700","2615.96472977",1538167722.5637,"b","l",""],["0.000388100","60.06006006",1538167798.9641,"b","l",""],["0.000388000","710.00000000",1538167990.0829,"b","m",""],["0.000388100","3851.18084630",1538168286.3291,"b","m",""],["0.000388600","1148.81915370",1538168286.3552,"b","m",""],["0.000387400","3906.25000000",1538169462.7021,"b","l",""],["0.000383600","80.20766308",1538169836.177,"s","m",""],["0.000386200","1400.00000000",1538170204.9377,"b","m",""],["0.000383000","1240.01500522",1538174163.7933,"s","l",""],["0.000382000","2540.00000000",1538174579.9896,"s","l",""],["0.000383200","5200.00000000",1538176018.4106,"b","m",""],["0.000383100","2000.00000000",1538176163.8225,"b","m",""],["0.000382000","0.80921217",1538177238.8104,"s","l",""],["0.000380400","6464.19078783",1538177238.8142,"s","l",""],["0.000380400","483.00000000",1538177270.4326,"s","l",""],["0.000380400","6636.41132996",1538177616.5805,"s","l",""],["0.000380400","2237.97031118",1538177632.8036,"s","l",""],["0.000380400","0.72830131",1538177688.5862,"s","l",""],["0.000380000","197.20203802",1538177688.5927,"s","l",""],["0.000380000","0.16638303",1538178729.4428,"s","l",""],["0.000379100","5312.39647684",1538178899.0846,"b","l",""],["0.000379100","52.75631759",1538178927.8277,"b","l",""],["0.000379100","2367.36736736",1538178999.6619,"b","l",""],["0.000379100","79.06266062",1538179011.1982,"b","l",""],["0.000379200","9180.14023207",1538179095.8455,"b","l",""],["0.000379200","273.90258345",1538179307.8962,"b","l",""],["0.000379200","1001.00100100",1538179323.8477,"b","l",""],["0.000379200","1036.08387150",1538179389.2349,"b","l",""],["0.000379200","199.18286351",1538179391.8046,"b","l",""],["0.000379200","4733.48159245",1538179437.972,"b","l",""],["0.000379100","20.02002002",1538179451.7492,"b","l",""],["0.000379100","5347.40356106",1538179451.8604,"b","l",""],["0.000379200","11576.20785602",1538179500.5042,"b","l",""],["0.000379200","396.39894706",1538179500.5075,"b","l",""],["0.000379200","0.00000045",1538179500.5097,"b","l",""],["0.000380900","5220.72604800",1538179511.9329,"b","m",""],["0.000381100","20000.00000000",1538179511.9384,"b","m",""],["0.000381300","3976.35394852",1538179511.9418,"b","m",""],["0.000383800","11739.47422888",1538179511.945,"b","m",""],["0.000384000","9063.44577460",1538179511.9482,"b","m",""],["0.000379200","178.00000000",1538181570.7832,"b","m",""],["0.000379200","28274.47603876",1538183348.3656,"b","l",""],["0.000379200","0.00000027",1538183348.3688,"b","l",""],["0.000381100","45.52396097",1538183350.1494,"b","l",""],["0.000381100","7876.87304216",1538184715.194,"b","m",""],["0.000381100","12.58286429",1538184715.202,"b","m",""],["0.000381100","0.02010042",1538184715.2043,"b","m",""],["0.000381100","0.00003211",1538184715.2061,"b","m",""],["0.000382300","3968.25396825",1538184715.2084,"b","m",""],["0.000387700","10000.00000000",1538184715.211,"b","m",""],["0.000387900","20000.00000000",1538184715.2135,"b","m",""],["0.000388000","1433.81589457",1538184715.2166,"b","m",""],["0.000388000","2.29044072",1538184715.2187,"b","m",""],["0.000388000","0.00365886",1538184715.2208,"b","m",""],["0.000389500","6000.00000000",1538184715.2232,"b","m",""],["0.000393300","706.15999862",1538184715.2257,"b","m",""],["0.000375600","943.99287415",1538186016.4379,"s","l",""],["0.000375500","2479.22511012",1538186016.4412,"s","l",""],["0.000375500","11720.77488988",1538186017.0429,"s","l",""],["0.000375000","2450.00000000",1538186017.181,"s","l",""],["0.000375000","1385.56546933",1538186017.1847,"s","l",""],["0.000375000","2.19453067",1538186995.4169,"b","l",""],["0.000375500","0.00012585",1538187127.6322,"b","m",""],["0.000382200","999.99987415",1538187127.6564,"b","m",""],["0.000381600","250.00000000",1538187937.6934,"b","m",""],["0.000380700","3000.00000000",1538188820.4092,"b","l",""],["0.000381100","2500.00000000",1538189740.6794,"b","m",""],["0.000381000","10858.01348494",1538190740.5516,"b","m",""],["0.000381100","942.48490064",1538190740.5588,"b","m",""],["0.000381100","1.50556693",1538190740.5615,"b","m",""],["0.000381100","0.00240506",1538190740.5641,"b","m",""],["0.000381500","3978.46325226",1538190740.5675,"b","m",""],["0.000386800","4398.85613495",1538190740.5708,"b","m",""],["0.000381700","1.00000000",1538191010.0247,"b","m",""],["0.000381200","900.00000000",1538192889.0825,"b","m",""],["0.000381100","50.00000000",1538193494.2001,"b","m",""],["0.000376400","951.63102364",1538194126.544,"s","l",""],["0.000382600","2300.00000000",1538202325.3406,"b","m",""],["0.000380000","150.00000000",1538202368.1013,"s","l",""],["0.000382200","3968.25396825",1538202556.3841,"b","l",""],["0.000382100","1486.23123123",1538202586.2664,"b","l",""],["0.000380800","41.82893356",1538204857.3511,"s","l",""],["0.000382200","3970.24959636",1538205103.5118,"b","l",""],["0.000382200","5115.65722200",1538205106.2029,"s","l",""],["0.000382200","3651.03017530",1538205106.8852,"s","l",""],["0.000382900","3948.09570184",1538206001.7858,"b","m",""],["0.000388000","950.11085013",1538206001.7945,"b","m",""],["0.000388000","1.51774896",1538206001.7973,"b","m",""],["0.000388000","0.00242452",1538206001.8001,"b","m",""],["0.000388100","10100.27327455",1538206001.8039,"b","m",""],["0.000383900","250.00000000",1538206572.648,"b","m",""],["0.000381000","940.25224848",1538207930.3966,"s","l",""],["0.000381000","3554.55444552",1538207930.4004,"s","l",""],["0.000380800","10443.90678309",1538208005.5698,"s","l",""],["0.000376100","14.26521691",1538208008.2241,"s","l",""],["0.000376000","101.00000000",1538208108.7307,"s","l",""],["0.000375000","1086.54636600",1538208553.1953,"s","l",""],["0.000375000","2775.28918240",1538208561.8972,"s","l",""],["0.000375000","77.35831159",1538208563.9969,"s","l",""],["0.000375000","6060.80614001",1538208564.0225,"s","l",""],["0.000373500","77.35885999",1538208567.9256,"s","l",""],["0.000373400","344.91808705",1538208602.8699,"s","l",""],["0.000373400","0.02031680",1538208603.2229,"s","l",""],["0.000373000","801.02639946",1538208603.2266,"s","l",""],["0.000373200","3468.87531556",1538208845.9519,"b","l",""],["0.000374200","4054.27320396",1538208864.9373,"b","l",""],["0.000370000","1116.81035824",1538209810.9695,"s","l",""],["0.000372200","4067.24511931",1538209824.8728,"b","m",""],["0.000375600","4894.00000000",1538209824.8781,"b","m",""],["0.000380200","100.50000000",1538209824.8817,"b","m",""],["0.000380300","938.25488069",1538209824.8845,"b","m",""],["0.000372200","4074.86892505",1538209928.6953,"b","m",""],["0.000380200","1925.13107495",1538209928.7023,"b","m",""],["0.000379900","9.30458015",1538210611.5104,"b","l",""],["0.000370000","3218.03074800",1538210994.087,"s","l",""],["0.000370000","1061.07480541",1538210996.4836,"s","l",""],["0.000370000","1000.00000000",1538210996.4874,"s","l",""],["0.000365500","7.08444659",1538210998.991,"s","l",""],["0.000370800","600.00000000",1538211594.0159,"b","m",""],["0.000360700","3235.80690205",1538211734.5009,"s","l",""],["0.000360700","8.39128062",1538211734.5094,"s","l",""],["0.000360700","0.02176075",1538211734.5122,"s","l",""],["0.000360700","0.00005643",1538211734.5144,"s","l",""],["0.000360000","1000.00000000",1538212575.4745,"s","l",""],["0.000360000","1411.36919722",1538212575.4781,"s","l",""],["0.000356200","2.24280278",1538212578.3731,"s","l",""],["0.000354600","2299.38018994",1538212639.7112,"s","l",""],["0.000366200","500.00000000",1538214141.0572,"b","m",""],["0.000365800","4143.64640884",1538214957.9576,"b","m",""],["0.000368900","4541.23695853",1538214957.9637,"b","m",""],["0.000365300","542.15234400",1538215808.9267,"b","l",""],["0.000367300","3000.00000000",1538216272.6757,"b","m",""],["0.000366700","170.39844736",1538218079.1199,"b","l",""],["0.000366700","739.57875130",1538218090.909,"b","l",""],["0.000369100","4109.47645270",1538219112.291,"b","m",""],["0.000376200","1955.00000000",1538219112.2954,"b","m",""],["0.000379900","3000.00000000",1538219112.2979,"b","m",""],["0.000379900","1573.18662016",1538219112.3005,"b","m",""],["0.000374300","4043.12668464",1538219625.8223,"b","l",""],["0.000375300","3000.00000000",1538219625.825,"b","l",""],["0.000375300","2.71668604",1538219625.8281,"b","l",""],["0.000365700","4337.69300160",1538219814.147,"s","m",""],["0.000365700","10.30699840",1538219814.1556,"s","m",""],["0.000367000","1138.21664400",1538220366.4363,"s","l",""],["0.000370500","1500.00000000",1538220999.9507,"b","m",""],["0.000370000","1000.00000000",1538221315.3217,"b","m",""],["0.000379600","578.49998419",1538222886.7039,"b","m",""],["0.000370100","3000.00000000",1538223302.8877,"b","l",""],["0.000370000","35946.75756917",1538223418.9533,"s","l",""],["0.000370000","70.85050617",1538223419.0348,"s","l",""],["0.000370000","70.84666051",1538223419.1772,"s","l",""],["0.000370000","4452.08580469",1538223420.1744,"s","l",""],["0.000370100","38.81011069",1538223553.0246,"b","l",""],["0.000369200","3000.00000000",1538223810.2649,"b","m",""],["0.000369300","4098.24868173",1538223810.2731,"b","m",""],["0.000379600","6251.55887250",1538223810.2757,"b","m",""],["0.000369200","2698.88755146",1538225065.0006,"b","m",""],["0.000369100","3000.00000000",1538225143.5657,"b","l",""],["0.000369200","1406.87694189",1538225143.5702,"b","l",""],["0.000370000","15495.55369242",1538225145.0729,"s","l",""],["0.000370000","8.91112323",1538225145.0778,"s","l",""],["0.000370000","3088.65824246",1538225145.9066,"s","l",""],["0.000369000","215.33113513",1538227273.2929,"b","m",""],["0.000369900","3500.00000000",1538227621.5737,"b","m",""],["0.000370100","3000.00000000",1538232686.5124,"b","l",""],["0.000370300","4098.36065574",1538232760.1571,"b","l",""],["0.000368900","2700.00000000",1538235209.4252,"b","m",""],["0.000368100","10.00000000",1538235712.2312,"b","m",""],["0.000368100","2.00000000",1538235826.2169,"b","m",""],["0.000368100","1000.00000000",1538236309.0989,"b","m",""],["0.000368000","300.00000000",1538236794.8654,"b","m",""],["0.000367700","200.00000000",1538238010.545,"b","m",""],["0.000367700","1000.00000000",1538238512.3856,"b","m",""],["0.000367200","50.00000000",1538239203.1432,"b","m",""],["0.000368800","4120.19996704",1538243204.5492,"b","m",""],["0.000371100","8379.80003296",1538243204.5548,"b","m",""],["0.000368200","4119.40607943",1538243349.3783,"b","l",""],["0.000368200","0.68071707",1538243534.5751,"b","l",""],["0.000368200","720.87389191",1538243535.3959,"s","l",""],["0.000360900","1.15110809",1538243538.8191,"s","l",""],["0.000369000","737.55338455",1538244808.2461,"b","l",""],["0.000369000","3377.78585658",1538244808.7307,"b","l",""],["0.000369000","453.16836619",1538244839.7044,"s","l",""],["0.000369000","0.14062817",1538244841.77,"s","l",""],["0.000369000","741.64297373",1538244979.9302,"b","l",""],["0.000369200","1458.35702627",1538244979.9397,"b","l",""],["0.000369800","3808.43699296",1538245280.7301,"b","l",""],["0.000369800","289.92366278",1538245281.6615,"b","l",""],["0.000369800","3807.21980953",1538245282.2197,"s","l",""],["0.000363000","0.00019047",1538245282.2236,"s","l",""],["0.000371100","1620.00000000",1538246212.4072,"b","m",""],["0.000371200","4088.64175321",1538246528.2013,"b","l",""],["0.000371300","693.01177335",1538246528.2061,"b","l",""],["0.000370000","680.00000000",1538247866.5762,"b","m",""],["0.000369200","4088.04806733",1538248979.3824,"b","l",""],["0.000369600","200.00000000",1538252772.317,"b","l",""],["0.000369600","8.36038961",1538252995.7762,"b","l",""],["0.000369000","4105.58211325",1538253198.0608,"b","l",""],["0.000369400","938.75025196",1538253994.1424,"b","l",""],["0.000369400","1.49960104",1538253994.155,"b","l",""],["0.000369400","0.00239553",1538253994.1571,"b","l",""],["0.000369500","4111.84210526",1538253994.1621,"b","l",""],["0.000371200","184.90564621",1538253994.1648,"b","l",""],["0.000370000","149.91202570",1538254110.0579,"s","l",""],["0.000370000","0.08797430",1538254110.2243,"s","l",""],["0.000362000","149.91202570",1538254110.2282,"s","l",""],["0.000371100","4097.91279642",1538254819.0158,"b","l",""],["0.000371300","47.72833869",1538254819.0216,"b","l",""],["0.000371300","741.12376219",1538254819.0243,"b","l",""],["0.000379900","426.11482160",1538254819.0277,"b","l",""],["0.000370200","4103.29357698",1538255253.484,"b","l",""],["0.000370500","4995.00000000",1538256928.8449,"s","l",""],["0.000370500","3005.00000000",1538256933.4204,"s","l",""],["0.000370100","3005.00000000",1538257098.5081,"b","m",""],["0.000371200","4083.29930584",1538257098.5223,"b","m",""],["0.000379800","2911.70069416",1538257098.5257,"b","m",""],["0.000366000","3000.00000000",1538258291.2516,"s","m",""],["0.000365900","490.92359864",1538258291.2558,"s","m",""],["0.000365900","0.00000070",1538258291.2578,"s","m",""],["0.000365300","25837.01067600",1538262434.1503,"s","l",""],["0.000367900","100.10010010",1538263626.9808,"s","l",""],["0.000367900","2899.89989990",1538263626.984,"s","l",""],["0.000368200","12.00000000",1538274622.7819,"b","m",""],["0.000372700","349.23617655",1538279128.5208,"b","m",""],["0.000364400","397.96529025",1538282130.7272,"s","m",""],["0.000364400","1.03202648",1538282130.7499,"s","m",""],["0.000364400","0.00267631",1538282130.752,"s","m",""],["0.000370000","141.46108888",1538288316.235,"b","m",""],["0.000370000","0.22597618",1538288316.2399,"b","m",""],["0.000370000","0.00036098",1538288316.2418,"b","m",""],["0.000370100","2568.31257396",1538288316.2443,"b","m",""],["0.000369100","1100.00000000",1538291356.4913,"b","m",""],["0.000369300","250.00000000",1538291592.6427,"b","m",""],["0.000369500","1250.00000000",1538293856.1616,"s","l",""],["0.000369500","1352.30215268",1538297358.162,"s","l",""],["0.000369500","0.87782025",1538297358.4091,"s","l",""],["0.000365800","1352.12217975",1538297358.4133,"s","l",""],["0.000365800","16.28916484",1538297602.8712,"s","l",""],["0.000367700","96.00000000",1538298186.1199,"b","m",""],["0.000365200","3000.00000000",1538298377.4438,"s","l",""],["0.000365200","3000.00000000",1538298381.0939,"s","l",""],["0.000365100","6389.46414000",1538298382.6027,"s","l",""],["0.000365100","795.38329773",1538298397.4666,"s","l",""],["0.000365000","2000.00000000",1538298397.4702,"s","l",""],["0.000362400","11.48270227",1538298400.2393,"s","l",""],["0.000367700","1000.00000000",1538299000.3991,"b","m",""],["0.000371100","2720.00000000",1538300178.5947,"b","m",""],["0.000371400","500.00000000",1538300455.5721,"b","m",""],["0.000370200","1788.97373582",1538301560.5076,"b","m",""],["0.000370200","2000.00000000",1538302623.1154,"b","m",""],["0.000370200","2093.77473322",1538302814.5735,"b","m",""],["0.000371200","3000.00000000",1538302814.5789,"b","m",""],["0.000371300","4906.22526678",1538302814.5823,"b","m",""],["0.000369600","100.00000000",1538303335.2041,"b","l",""],["0.000368800","4118.84233072",1538304660.2811,"b","m",""],["0.000376900","8965.15766928",1538304660.298,"b","m",""],["0.000362800","84.00000000",1538304847.9907,"s","m",""],["0.000370800","1000.00000000",1538306188.62,"b","m",""],["0.000369600","2697.52512446",1538307533.6716,"b","m",""],["0.000367900","801.46103800",1538310203.391,"b","l",""],["0.000367900","271.81299200",1538310665.9865,"b","l",""],["0.000367800","89.35462055",1538313891.6771,"b","l",""],["0.000367900","2718.00000000",1538315801.0297,"b","m",""],["0.000367900","14481.48954703",1538316196.3165,"b","l",""],["0.000367900","0.00000002",1538316196.3224,"b","l",""],["0.000367900","2172.79874900",1538318228.1259,"s","l",""],["0.000369700","900.00000000",1538318835.2709,"b","m",""],["0.000368900","1500.00000000",1538319900.5397,"b","m",""],["0.000368900","1200.00000000",1538320402.452,"b","m",""],["0.000368900","701.30046000",1538321640.7966,"b","l",""],["0.000368900","2700.00000000",1538321836.1284,"b","m",""],["0.000368400","100.00000000",1538324971.6021,"b","m",""],["0.000366200","2000.00000000",1538327321.4261,"b","m",""],["0.000366200","2136.44761878",1538327481.6609,"b","m",""],["0.000368800","5863.55238122",1538327481.673,"b","m",""],["0.000367500","1250.00000000",1538328210.6927,"b","m",""],["0.000366200","50.00000000",1538328460.5207,"b","l",""],["0.000367300","6085.69560577",1538334496.6503,"b","l",""],["0.000367300","275.44265723",1538336384.8511,"b","m",""],["0.000367300","8015.67166264",1538338745.3216,"b","l",""],["0.000369300","20.12833736",1538338746.8342,"b","l",""],["0.000370200","4109.70163566",1538339404.8614,"b","l",""],["0.000370300","3000.00036434",1538339407.5417,"s","l",""],["0.000370000","3000.00000000",1538340267.7556,"b","l",""],["0.000370300","4142.23085010",1538340268.7764,"s","l",""],["0.000370300","6.61261947",1538340268.7801,"s","l",""],["0.000370300","10242.04591889",1538340268.8784,"s","l",""],["0.000370300","5.36983525",1538340268.881,"s","l",""],["0.000370300","9359.14049100",1538340269.8449,"s","l",""],["0.000370300","140.73912000",1538340269.8747,"s","l",""],["0.000370300","3000.00000000",1538340270.525,"s","l",""],["0.000370300","9359.14049100",1538340270.6651,"s","l",""],["0.000370300","4098.92061757",1538340272.3305,"s","l",""],["0.000370300","4098.92061757",1538340280.3079,"s","l",""],["0.000370300","2546.87943915",1538340281.2845,"s","l",""],["0.000369900","4103.74261326",1538341222.6132,"b","m",""],["0.000375900","3000.00000000",1538341222.6201,"b","m",""],["0.000375900","4896.25738674",1538341222.623,"b","m",""],["0.000363800","300.00000000",1538342013.135,"s","m",""],["0.000370100","4098.36065574",1538342032.2782,"b","m",""],["0.000375900","20901.63934426",1538342032.2963,"b","m",""],["0.000370200","50.00000000",1538342096.6072,"b","m",""],["0.000369900","2000.00000000",1538343342.7155,"b","m",""],["0.000369200","4113.08234391",1538348386.9908,"b","m",""],["0.000375800","3000.00000000",1538348387.0042,"b","m",""],["0.000375900","7886.91765609",1538348387.0069,"b","m",""],["0.000367900","273.00000000",1538352309.5284,"b","m",""],["0.000367900","24438.70617015",1538352749.8597,"b","l",""],["0.000367900","891.44941306",1538352750.6856,"b","l",""],["0.000370200","35.84441679",1538352752.7267,"b","l",""],["0.000362800","234.60472825",1538353321.1428,"s","l",""],["0.000368200","4115.22633745",1538358905.4227,"b","l",""],["0.000375900","14835.00000000",1538358905.4477,"b","l",""],["0.000375900","2332.02958168",1538358905.4508,"b","l",""],["0.000365700","128.89786300",1538364660.4514,"s","l",""],["0.000369000","387.55884117",1538369614.1505,"s","l",""],["0.000369000","4335.00665400",1538369614.7313,"s","l",""],["0.000369000","31.39006666",1538369615.8992,"s","l",""],["0.000369000","387.85992244",1538369615.9086,"s","l",""],["0.000369000","387.92179701",1538369616.3798,"s","l",""],["0.000369000","102.37103387",1538369622.2937,"s","l",""],["0.000369000","21367.89168485",1538369774.4813,"s","l",""],["0.000371600","2408.78084500",1538373044.2272,"b","m",""],["0.000371800","780.00000000",1538374020.5417,"b","m",""],["0.000371900","2000.00000000",1538377740.7439,"b","m",""],["0.000372200","4081.52159125",1538380654.4319,"b","m",""],["0.000374600","5918.47840875",1538380654.4351,"b","m",""],["0.000370000","39.17020243",1538381401.5016,"s","l",""],["0.000372200","2100.00000000",1538381761.5116,"b","m",""],["0.000370000","810.82979757",1538381773.6508,"s","l",""],["0.000368000","923.30277300",1538383484.7902,"s","l",""],["0.000368000","16744.27995900",1538383656.996,"s","l",""],["0.000368000","2380.93855060",1538383657.1937,"s","l",""],["0.000369200","4088.86465858",1538387984.5748,"b","l",""],["0.000369200","4104.64098074",1538387990.4191,"b","l",""],["0.000372200","530.00000000",1538389689.6784,"b","m",""],["0.000371700","4079.30162356",1538390288.6755,"b","l",""],["0.000374700","5930.46052429",1538390288.6818,"b","l",""],["0.000371700","4079.30200000",1538390291.3198,"s","l",""],["0.000372200","4076.08695652",1538390637.8508,"b","l",""],["0.000372200","4072.21392697",1538390644.3598,"b","l",""],["0.000372200","4072.10337713",1538390652.8072,"b","l",""],["0.000371600","4071.32969628",1538390715.0696,"b","l",""],["0.000371600","4071.21919444",1538390718.513,"b","l",""],["0.000371600","4072.43504466",1538390734.2338,"b","l",""],["0.000371600","3513.72981700",1538390815.4738,"b","l",""],["0.000371600","558.70522766",1538390817.0564,"b","l",""],["0.000371600","456.20820820",1538390820.1916,"b","l",""],["0.000371600","3615.89516893",1538390820.228,"b","l",""],["0.000371600","3064.74703982",1538390826.9202,"b","l",""],["0.000371600","1007.24579347",1538390905.3662,"b","l",""],["0.000372200","4069.67279831",1538391045.3571,"b","l",""],["0.000372200","4069.89364011",1538391050.4807,"b","l",""],["0.000372200","4069.89364011",1538391060.787,"b","l",""],["0.000372700","4065.04065041",1538391182.4773,"b","l",""],["0.000372700","0.00034959",1538391182.8887,"s","l",""],["0.000372700","4069.89329052",1538391210.7853,"b","l",""],["0.000373000","4069.78321621",1538391299.1648,"b","l",""],["0.000372200","4073.60619807",1538391575.7645,"b","l",""],["0.000372200","2.48075845",1538391576.0131,"b","l",""],["0.000372200","4073.60624155",1538391576.379,"s","l",""],["0.000372800","2971.20369102",1538391621.2856,"b","l",""],["0.000371200","4087.19346049",1538392442.3241,"b","m",""],["0.000374600","1287.80653951",1538392442.3294,"b","m",""],["0.000368600","100.00000000",1538392840.7619,"s","m",""],["0.000372200","50.00000000",1538396874.281,"b","m",""],["0.000371200","1245.12288739",1538397376.6352,"b","l",""],["0.000371200","2841.40247631",1538397377.2092,"b","l",""],["0.000371200","0.00063630",1538397380.1232,"s","l",""],["0.000372200","1343.37000000",1538399702.035,"b","m",""],["0.000372200","2020.57797581",1538399897.6599,"b","l",""],["0.000372200","708.48706885",1538399897.785,"b","l",""],["0.000372200","2729.06600000",1538399906.089,"b","l",""],["0.000372600","434.66161299",1538400600.5613,"b","m",""],["0.000371200","329.11969940",1538400824.6037,"b","l",""],["0.000371000","4076.08695652",1538400930.999,"b","l",""],["0.000371000","3007.77088948",1538400936.7251,"b","l",""],["0.000371000","1074.75047572",1538400938.6529,"b","l",""],["0.000374700","9.32604348",1538400939.9856,"b","l",""],["0.000371100","1074.75100000",1538401277.7668,"s","l",""],["0.000371500","4087.19346049",1538401572.3636,"b","m",""],["0.000374700","4729.69223450",1538401572.3693,"b","m",""],["0.000374700","7.55541891",1538401572.3716,"b","m",""],["0.000374700","0.01206936",1538401572.3738,"b","m",""],["0.000374700","0.00001846",1538401572.3757,"b","m",""],["0.000377000","998.40255591",1538401572.4099,"b","m",""],["0.000377000","1.59489226",1538401572.4121,"b","m",""],["0.000377000","0.00254775",1538401572.4278,"b","m",""],["0.000379800","2175.54680236",1538401572.4308,"b","m",""],["0.000371000","4090.98347243",1538401879.0158,"b","m",""],["0.000379800","1912.75250348",1538401879.021,"b","m",""],["0.000379900","249.60063927",1538401879.0247,"b","m",""],["0.000379900","0.39872306",1538401879.0285,"b","m",""],["0.000379900","0.00063694",1538401879.0308,"b","m",""],["0.000380000","2000.00000000",1538401879.0339,"b","m",""],["0.000380400","1746.26402482",1538401879.0366,"b","m",""],["0.000369300","147.48048048",1538401895.2257,"b","l",""],["0.000369000","4096.45792938",1538402715.3592,"b","l",""],["0.000369000","903.54207062",1538402718.0863,"s","l",""],["0.000368200","4102.62020677",1538402804.5993,"b","l",""],["0.000369000","2749.80680680",1538402825.3437,"b","l",""],["0.000369000","106.47179539",1538402826.2455,"b","l",""],["0.000369000","1088.01168809",1538402826.4812,"b","l",""],["0.000369000","158.32991649",1538402827.8575,"b","l",""],["0.000368100","969.64498347",1538403360.977,"s","l",""],["0.000368000","2175.87892120",1538403379.8928,"s","l",""],["0.000365600","3.46906227",1538403384.2618,"s","l",""],["0.000369200","2708.60000000",1538403832.1968,"b","m",""],["0.000369600","4109.58904110",1538404361.429,"b","l",""],["0.000369600","0.00095890",1538404364.939,"s","l",""],["0.000369500","4109.58808220",1538404374.3959,"b","l",""],["0.000379900","3000.00000000",1538404374.4116,"b","l",""],["0.000379900","7696.41191780",1538404374.4146,"b","l",""],["0.000369600","4109.58904110",1538404392.9545,"b","l",""],["0.000369600","0.00095890",1538404398.18,"s","l",""],["0.000369600","968.09507303",1538404404.0082,"b","l",""],["0.000369600","1.54647776",1538404404.014,"b","l",""],["0.000369600","0.00247041",1538404404.0159,"b","l",""],["0.000369700","3128.71697880",1538404404.8544,"b","l",""],["0.000369700","969.64367694",1538404415.244,"b","l",""],["0.000369700","0.00032306",1538404416.9448,"s","l",""],["0.000369700","4107.22565651",1538404433.653,"b","l",""],["0.000369700","0.00034349",1538404448.3086,"s","l",""],["0.000369700","4098.36031225",1538404461.8321,"b","l",""],["0.000369700","0.00068775",1538404473.8856,"s","l",""],["0.000369700","4098.35996799",1538404492.2354,"b","l",""],["0.000369700","4095.11589178",1538404503.2254,"b","l",""],["0.000369700","0.00010822",1538404505.9169,"s","l",""],["0.000369700","4095.11578356",1538404524.9441,"b","l",""],["0.000369700","0.00021644",1538404533.2777,"s","l",""],["0.000369600","4095.11567534",1538404567.4219,"b","l",""],["0.000369700","4095.11589178",1538404617.179,"b","l",""],["0.000369700","0.00010822",1538404620.4178,"s","l",""],["0.000369600","0.00032466",1538404620.4246,"s","l",""],["0.000369200","4095.11600000",1538404636.4598,"s","l",""],["0.000369700","4095.11589178",1538404657.157,"b","l",""],["0.000369700","0.00010822",1538404660.4897,"s","l",""],["0.000369700","4095.11578356",1538404679.4855,"b","l",""],["0.000369700","0.00021644",1538404685.9104,"s","l",""],["0.000369700","1333.00000000",1538404793.1224,"b","m",""],["0.000369700","4802.36350014",1538407393.3871,"s","l",""],["0.000366800","7.67249986",1538407395.2048,"s","l",""],["0.000369200","27.00000000",1538411383.0656,"b","m",""],["0.000369900","460.50000000",1538414629.8608,"b","m",""],["0.000369700","300.00000000",1538415820.6359,"b","m",""],["0.000369200","2736.63583153",1538417926.5142,"b","l",""],["0.000369200","1000.00000000",1538420695.3408,"b","l",""],["0.000369200","2000.00000000",1538422338.4757,"b","m",""],["0.000367500","5447.62449531",1538422861.6998,"s","l",""],["0.000367500","4552.37550469",1538423122.9701,"s","l",""],["0.000369500","1503.32228454",1538424046.9493,"b","l",""],["0.000369700","1617.20758124",1538424046.9522,"b","l",""],["0.000369700","2475.56185941",1538424048.5364,"b","l",""],["0.000369700","496.39699332",1538424049.1504,"s","l",""],["0.000369200","3169.90513252",1538424350.6818,"b","l",""],["0.000369200","80.12914542",1538424350.9248,"b","l",""],["0.000369900","1000.00000000",1538424644.8241,"b","m",""],["0.000365500","5000.00000000",1538426188.2652,"s","l",""],["0.000369200","2000.00000000",1538429126.2846,"b","m",""],["0.000369200","1246.69102384",1538430679.6474,"b","m",""],["0.000363700","14.07869232",1538432630.8159,"s","l",""],["0.000368200","2750.00000000",1538434736.5251,"b","m",""],["0.000364400","2178.33632555",1538434753.2456,"s","m",""],["0.000364400","5.64898708",1538434753.259,"s","m",""],["0.000364400","0.01464928",1538434753.2612,"s","m",""],["0.000364400","0.00003799",1538434753.263,"s","m",""],["0.000367900","3000.00000000",1538442589.8258,"b","m",""],["0.000367000","670.75057800",1538449435.469,"s","l",""],["0.000367000","333.74991600",1538449496.1251,"s","l",""],["0.000367000","333.74991600",1538449496.6739,"s","l",""],["0.000367900","15477.84724136",1538449936.1656,"b","l",""],["0.000367900","4000.00000000",1538452874.7797,"b","m",""],["0.000367000","4983.46254900",1538453858.2302,"s","l",""],["0.000367000","3511.89359100",1538454150.4708,"s","l",""],["0.000367000","2342.30452672",1538454168.6734,"s","l",""],["0.000367000","0.03358881",1538454168.6769,"s","l",""],["0.000367000","4824.05533447",1538454169.0485,"s","l",""],["0.000363200","1.74077055",1538454365.0182,"s","l",""],["0.000367900","1009.34650720",1538461468.2173,"b","m",""],["0.000367900","276.99169058",1538461613.337,"b","l",""],["0.000367900","0.00000093",1538461613.3395,"b","l",""],["0.000369600","33.27030849",1538461615.2491,"b","l",""],["0.000369200","1810.00000000",1538461953.4466,"b","l",""],["0.000363200","400.00000000",1538467356.3274,"s","m",""],["0.000368300","5537.62171502",1538468869.9786,"b","m",""],["0.000368400","413.41722870",1538468869.985,"b","m",""],["0.000368400","0.66041091",1538468869.9875,"b","m",""],["0.000368400","0.00105497",1538468869.9895,"b","m",""],["0.000369400","6418.60306398",1538468869.9924,"b","m",""],["0.000369800","3841.91728232",1538468869.9949,"b","m",""],["0.000368900","8223.89835000",1538470091.4464,"b","l",""],["0.000368900","2710.76172404",1538471193.5839,"b","l",""],["0.000368800","5405.40540500",1538472158.9099,"b","l",""],["0.000364400","1000.00000000",1538474448.7665,"s","l",""],["0.000364400","213.49714861",1538474448.7696,"s","l",""],["0.000368500","1065.23744911",1538474461.3295,"b","l",""],["0.000368000","1.00000000",1538475756.562,"b","m",""],["0.000366600","230.00000000",1538478765.381,"b","m",""],["0.000367600","1.45000000",1538479760.4554,"b","m",""],["0.000365000","424.55452712",1538480630.258,"s","l",""],["0.000365000","75.44547288",1538480801.5292,"s","l",""],["0.000365000","7603.46631583",1538480801.5326,"s","l",""],["0.000364900","274.00000000",1538480967.6939,"s","l",""],["0.000364900","6118.66612764",1538480967.7049,"s","l",""],["0.000364900","6359.24737288",1538480968.1769,"s","l",""],["0.000364900","6469.30812916",1538480969.9402,"s","l",""],["0.000364900","6584.68883423",1538480973.4758,"s","l",""],["0.000364900","6660.91186593",1538480973.9373,"s","l",""],["0.000367500","29.00000000",1538483075.7389,"b","m",""],["0.000367100","41.22448900",1538487036.6325,"b","l",""],["0.000367100","477.00000000",1538487118.4104,"b","m",""],["0.000367100","2737.16987469",1538488508.7716,"b","m",""],["0.000367100","13593.02642300",1538488814.1205,"s","l",""],["0.000368300","100.99900000",1538494467.5001,"b","m",""],["0.000367700","408.00000000",1538495139.4133,"b","l",""],["0.000363300","5420.50847202",1538499644.0805,"s","l",""],["0.000363300","4579.49152798",1538499644.5609,"s","l",""],["0.000363300","896.08927954",1538499644.5644,"s","l",""],["0.000363300","5542.67335246",1538499646.3067,"s","l",""],["0.000363300","5572.00339994",1538499647.4404,"s","l",""],["0.000363300","5688.53474065",1538499648.2287,"s","l",""],["0.000363300","4281.74022741",1538499648.5638,"s","l",""],["0.000363300","1461.39002702",1538499648.5673,"s","l",""],["0.000363300","5684.56002275",1538499648.9802,"s","l",""],["0.000363300","5690.31758839",1538499649.2675,"s","l",""],["0.000363300","5743.07420860",1538499650.0645,"s","l",""],["0.000363300","3380.92015324",1538499650.686,"s","l",""],["0.000363300","1895.79633401",1538499653.1616,"b","l",""],["0.000363300","4489.75378956",1538499653.1651,"b","l",""],["0.000363300","5327.75063492",1538499653.1681,"b","l",""],["0.000367300","545.00000000",1538502928.5464,"b","m",""],["0.000367100","1000.00000000",1538503353.9675,"b","m",""],["0.000367500","1723.00000000",1538503353.9753,"b","m",""],["0.000368900","1000.00000000",1538506144.4778,"b","m",""],["0.000369000","1000.00000000",1538506144.4872,"b","m",""],["0.000369000","13363.20355827",1538508427.0556,"b","l",""],["0.000369000","1000.00000000",1538508736.8504,"b","l",""],["0.000369000","2000.00000000",1538509146.5227,"b","m",""],["0.000369000","5110.33348974",1538510421.8245,"b","m",""],["0.000369000","0.00000076",1538510421.834,"b","m",""],["0.000370500","1000.00000000",1538510421.8372,"b","m",""],["0.000370700","4077.63823194",1538510421.8398,"b","m",""],["0.000370800","10000.00000000",1538510421.8423,"b","m",""],["0.000372000","551.27446785",1538510421.8455,"b","m",""],["0.000372000","0.88063014",1538510421.8475,"b","m",""],["0.000372000","0.00090201",1538510421.8494,"b","m",""],["0.000375800","2818.00000000",1538510421.8518,"b","m",""],["0.000380000","2993.00000000",1538510421.855,"b","m",""],["0.000380400","8711.90797518",1538510421.8585,"b","m",""],["0.000390000","469.59702051",1538510421.8617,"b","m",""],["0.000369000","1042.22273400",1538512103.2757,"s","l",""],["0.000369000","1662.16839837",1538512194.4578,"s","l",""],["0.000369000","3444.09322863",1538512194.4612,"s","l",""],["0.000366700","1.36821013",1538512265.4142,"s","l",""],["0.000370400","3000.00000000",1538515505.2107,"b","m",""],["0.000368400","270.58063789",1538520379.2269,"b","m",""],["0.000367000","1090.00000000",1538521086.5273,"s","l",""],["0.000367000","1742.73000000",1538523551.2496,"s","l",""],["0.000367000","190.54808992",1538523552.0182,"s","l",""],["0.000367000","1750.11083357",1538523552.0214,"s","l",""],["0.000367000","24114.10816643",1538523552.8923,"s","l",""],["0.000367000","0.00083357",1538523552.8961,"s","l",""],["0.000367000","2706.63457014",1538523553.719,"s","l",""],["0.000366200","4000.00000000",1538525959.2008,"b","m",""],["0.000366200","1000.00000000",1538526585.5375,"b","m",""],["0.000364000","5256.35835795",1538529743.4684,"s","l",""],["0.000364000","1343.64164205",1538529745.1239,"s","l",""],["0.000364000","4093.69389197",1538529745.1274,"s","l",""],["0.000364000","5451.99332315",1538529745.5934,"s","l",""],["0.000364000","5419.97569933",1538529746.2493,"s","l",""],["0.000364000","5372.82354833",1538529747.6883,"s","l",""],["0.000364000","4034.08253722",1538529747.8637,"s","l",""],["0.000363300","2000.00000000",1538529820.4771,"s","l",""],["0.000363300","20307.31700000",1538529820.4827,"s","l",""],["0.000363300","256.68300000",1538532266.2287,"b","l",""],["0.000363000","260.80321488",1538533255.607,"s","l",""],["0.000363000","250.00000000",1538533255.6115,"s","l",""],["0.000363000","9502.14481412",1538533255.6146,"s","l",""],["0.000363900","1324.32855400",1538534105.5191,"b","l",""],["0.000364100","1403.44013121",1538534105.5246,"b","l",""],["0.000363700","1120.00000000",1538545548.3694,"s","m",""],["0.000363300","60.00000000",1538545674.1709,"s","m",""],["0.000364600","1370.27153044",1538547565.7583,"s","m",""],["0.000364500","2936.34436242",1538547565.7659,"s","m",""],["0.000364500","7.61469713",1538547565.768,"s","m",""],["0.000364500","0.01941001",1538547565.7703,"s","m",""],["0.000363200","11321.71373019",1538552953.3447,"s","m",""],["0.000363200","11887.29600000",1538552953.3559,"s","m",""],["0.000363200","129.76969381",1538552953.3605,"s","m",""],["0.000366300","2313.51251251",1538553170.9437,"b","l",""],["0.000366300","3285.39291809",1538553185.8476,"b","l",""],["0.000366300","2302.64411894",1538553186.111,"b","l",""],["0.000366300","10503.48748748",1538553598.8537,"b","l",""],["0.000366300","5801.17734868",1538555111.728,"b","l",""],["0.000368300","33.78565132",1538555115.1851,"b","l",""],["0.000367100","700.00000000",1538556167.901,"b","m",""],["0.000367400","770.00000000",1538558897.6578,"b","m",""],["0.000369100","20.00000000",1538562726.2421,"b","m",""],["0.000369000","2750.00000000",1538563865.2403,"b","m",""],["0.000369900","1000.00000000",1538564504.5892,"b","l",""],["0.000369900","5448.60817477",1538564504.5961,"b","l",""],["0.000369900","3551.39182523",1538564504.5998,"b","l",""],["0.000370000","1000.00000000",1538564691.3154,"b","l",""],["0.000370000","2500.00000000",1538564692.4787,"s","l",""],["0.000364700","485.27872609",1538564985.7165,"s","m",""],["0.000364700","1.25845271",1538564985.7363,"s","m",""],["0.000364700","0.00326349",1538564985.7389,"s","m",""],["0.000369000","30.00000000",1538565051.5218,"b","m",""],["0.000369300","477.98807744",1538566054.6027,"b","m",""],["0.000368600","1000.00000000",1538566441.3287,"b","m",""],["0.000369100","8782.28025162",1538566441.3336,"b","m",""],["0.000369200","1851.86679445",1538566441.3364,"b","m",""],["0.000369300","4098.36065574",1538566441.339,"b","m",""],["0.000370000","9267.49229819",1538566441.3418,"b","m",""],["0.000367700","500.00000000",1538574079.7231,"b","m",""],["0.000364100","1000.00000000",1538577204.2176,"s","l",""],["0.000368100","2800.00000000",1538578518.2309,"b","m",""],["0.000369000","418.10810800",1538585010.1341,"b","l",""],["0.000369000","500.00000000",1538586308.116,"b","m",""],["0.000369400","1000.00000000",1538586629.3201,"b","m",""],["0.000369400","1000.00000000",1538586629.3326,"b","m",""],["0.000365600","22.18903801",1538586811.8598,"s","l",""],["0.000365400","262.66009852",1538587537.9589,"s","m",""],["0.000365400","999.74057598",1538587537.9803,"s","m",""],["0.000365400","2.59258478",1538587537.9829,"s","m",""],["0.000365400","0.00672324",1538587537.985,"s","m",""],["0.000365400","0.00001743",1538587537.987,"s","m",""],["0.000369200","200.00000000",1538592478.8905,"b","m",""],["0.000369200","200.00000000",1538594170.3922,"b","m",""],["0.000365700","975.24458208",1538603511.9861,"s","l",""],["0.000365600","2358.47788020",1538603511.9893,"s","l",""],["0.000365500","242.70606202",1538605253.652,"b","l",""],["0.000365500","3757.00000000",1538605257.3165,"b","l",""],["0.000365500","0.29393798",1538607231.4475,"b","l",""],["0.000365600","4052.89704600",1538614947.5202,"s","l",""],["0.000365600","622.35545158",1538614955.6551,"s","l",""],["0.000365600","333.91498714",1538614965.0415,"s","l",""],["0.000365600","5745.13751528",1538614972.7223,"s","l",""],["0.000365600","4227.63958346",1538614972.7251,"s","l",""],["0.000365600","9972.77709874",1538615008.8551,"s","l",""],["0.000365600","728.00090126",1538615010.3535,"s","l",""],["0.000365600","323.69004020",1538615010.3574,"s","l",""],["0.000365600","8193.08526230",1538615010.5611,"s","l",""],["0.000365600","728.00089469",1538615011.1146,"s","l",""],["0.000365600","1461.71280281",1538615014.0278,"s","l",""],["0.000365600","8511.06429593",1538615014.0307,"s","l",""],["0.000367000","1089.81743869",1538615110.0616,"b","l",""],["0.000365600","218.57631701",1538615312.7192,"s","l",""],["0.000365600","478.95156900",1538615318.0717,"s","l",""],["0.000365600","3740.03810599",1538615324.4434,"s","l",""],["0.000366700","973.68668507",1538616055.783,"b","l",""],["0.000366700","1.55541004",1538616055.7869,"b","l",""],["0.000366700","0.00248468",1538616055.789,"b","l",""],["0.000365600","4368.24200933",1538616699.617,"s","l",""],["0.000365600","543.74571000",1538616903.8987,"s","l",""],["0.000366800","2995.06543075",1538617952.5418,"b","l",""],["0.000366800","2571.99493625",1538617953.969,"b","l",""],["0.000367000","11114.19433331",1538617953.9725,"b","l",""],["0.000365100","1346.49910233",1538620558.7142,"s","m",""],["0.000365100","3.49181894",1538620558.725,"s","m",""],["0.000365100","0.00905519",1538620558.7273,"s","m",""],["0.000365100","0.00002348",1538620558.7292,"s","m",""],["0.000369500","4096.12233752",1538629110.4443,"b","m",""],["0.000370900","1571.05355922",1538629110.4496,"b","m",""],["0.000371000","1000.00000000",1538629110.4526,"b","m",""],["0.000371800","6332.82410326",1538629110.4552,"b","m",""],["0.000369400","120.00000000",1538631263.9507,"b","m",""],["0.000369300","40.00000000",1538637094.4899,"b","l",""],["0.000368000","595.28410870",1538651095.0576,"b","m",""],["0.000366000","500.00000000",1538653735.3152,"s","l",""],["0.000365600","1500.00000000",1538653735.3389,"s","l",""],["0.000365600","6665.27691466",1538654041.3277,"s","l",""],["0.000363500","13.06408534",1538654042.629,"s","l",""],["0.000367000","105.00000000",1538654456.8652,"b","m",""],["0.000366400","3.00000000",1538655038.495,"b","m",""],["0.000363500","550.21485557",1538658438.3372,"s","l",""],["0.000365400","1500.00000000",1538659818.8703,"b","m",""],["0.000365200","40.00000000",1538660130.7855,"b","m",""],["0.000369200","2500.00000000",1538668721.0686,"b","m",""],["0.000369200","709.16246208",1538668721.1021,"b","m",""],["0.000369600","1583.05181548",1538669332.3927,"b","m",""],["0.000369000","2500.00000000",1538673616.2293,"b","m",""],["0.000369100","1000.00000000",1538673616.2423,"b","m",""],["0.000369300","4094.44520268",1538673616.2448,"b","m",""],["0.000369400","3238.55479732",1538673616.2475,"b","m",""],["0.000370400","75.00000000",1538701609.2461,"b","m",""],["0.000365400","500.00000000",1538703011.7892,"s","m",""],["0.000369300","27.07092582",1538717993.3827,"b","l",""],["0.000369500","50.00000000",1538719132.6474,"b","m",""],["0.000368700","235.00000000",1538721810.6194,"b","m",""],["0.000368800","700.70070070",1538723796.2944,"b","l",""],["0.000365200","8189.11511365",1538724876.8531,"s","m",""],["0.000365100","309.40170926",1538724876.8594,"s","m",""],["0.000364900","868.69970888",1538724876.863,"s","m",""],["0.000363900","1127.90997401",1538724876.8663,"s","m",""],["0.000363900","2.92496103",1538724876.8685,"s","m",""],["0.000363900","0.00753317",1538724876.8706,"s","m",""],["0.000367900","303.64108453",1538727662.5414,"b","m",""],["0.000367700","867.31201364",1538729120.0293,"b","l",""],["0.000367700","1.38548245",1538729120.0348,"b","l",""],["0.000367700","0.00221323",1538729120.0372,"b","l",""],["0.000367800","1829.28464927",1538729120.0402,"b","l",""],["0.000367700","2500.00000000",1538730272.2937,"b","l",""],["0.000367800","5030.94687240",1538730272.2968,"b","l",""],["0.000367700","1749.68000000",1538730277.1105,"s","l",""],["0.000368700","8.23312760",1538730293.2753,"b","l",""],["0.000368400","8.17089033",1538731263.5681,"b","l",""],["0.000368400","2491.82910967",1538731317.5975,"b","l",""],["0.000368400","4842.00000000",1538731323,"s","l",""],["0.000368400","5015.00000000",1538731353.7712,"s","l",""],["0.000368400","1120.00000000",1538731370.0166,"s","l",""],["0.000368400","2903.00000000",1538731547.0953,"s","l",""],["0.000368400","2000.00000000",1538731550.3975,"s","l",""],["0.000368400","2453.00000000",1538731636.3638,"s","l",""],["0.000368400","1570.00000000",1538731666.8946,"s","l",""],["0.000368400","14787.00000000",1538731685.0271,"s","l",""],["0.000368400","4664.00000000",1538731696.45,"s","l",""],["0.000368400","28458.18826233",1538731698.4856,"s","l",""],["0.000367800","1752.19140837",1538732260.0315,"b","l",""],["0.000367800","747.80859163",1538732261.2606,"b","l",""],["0.000367900","1004.66762473",1538732261.2642,"b","l",""],["0.000367900","5969.92192192",1538732261.775,"b","l",""],["0.000367900","4221.03358059",1538732262.3359,"b","l",""],["0.000367800","2500.00000000",1538732603.526,"b","l",""],["0.000367900","408.88556727",1538732603.5299,"b","l",""],["0.000367900","9085.52525592",1538736406.4665,"b","m",""],["0.000369500","5914.47474408",1538736406.4729,"b","m",""],["0.000367900","800.00000000",1538738643.5221,"b","l",""],["0.000367500","110.11011011",1538739417.2154,"b","l",""],["0.000367400","1247.38710756",1538739680.0087,"b","l",""],["0.000368400","666.00000000",1538742916.0285,"b","m",""],["0.000367200","59.85294117",1538756393.8612,"b","l",""],["0.000367900","2812.73987496",1538760847.6689,"b","l",""],["0.000367900","7866.62511735",1538760847.8708,"b","l",""],["0.000367900","2274.06125011",1538760849.2161,"b","l",""],["0.000367900","26047.97179956",1538761163.9949,"b","l",""],["0.000367900","0.00000097",1538761163.9977,"b","l",""],["0.000369700","54.60219947",1538761166.4106,"b","l",""],["0.000369000","1601.66896150",1538768309.3151,"b","l",""],["0.000369000","898.33103850",1538768310.7576,"b","l",""],["0.000369900","4092.21115810",1538768310.7606,"b","l",""],["0.000370400","2200.80810848",1538768310.7634,"b","l",""],["0.000370400","4092.21115810",1538768311.3234,"s","l",""],["0.000371300","3446.30566013",1538768312.4315,"b","l",""],["0.000371500","84.01491519",1538768313.9188,"b","l",""],["0.000369900","622.80184945",1538768318.3121,"b","l",""],["0.000369900","3468.40478376",1538768319.2629,"b","l",""],["0.000371500","478.49893442",1538768320.9155,"b","l",""],["0.000371500","0.76437530",1538768320.9178,"b","l",""],["0.000371500","0.00077509",1538768320.92,"b","l",""],["0.000371500","0.00091519",1538768321.3642,"s","l",""],["0.000371500","2499.99908481",1538768321.3688,"s","l",""],["0.000371600","1969.26791519",1538768322.305,"s","l",""],["0.000369800","2121.93900000",1538768326.9157,"b","l",""],["0.000369800","378.06100000",1538768327.6406,"b","l",""],["0.000369900","2121.93871802",1538768327.6432,"b","l",""],["0.000365800","100.00000000",1538769259.2522,"s","l",""],["0.000366700","971.66489931",1538777157.9322,"s","l",""],["0.000366700","555.49701472",1538777159.201,"b","l",""],["0.000366100","100.00000000",1538777282.6585,"s","l",""],["0.000366100","1583.94244742",1538782573.8379,"s","m",""],["0.000362800","10000.00000000",1538782573.8539,"s","m",""],["0.000362800","1000.00000000",1538782573.857,"s","m",""],["0.000362700","7416.05755258",1538782573.8599,"s","m",""],["0.000368800","540.81792571",1538784997.4978,"b","m",""],["0.000368800","2017.57340700",1538785561.7715,"s","l",""],["0.000368800","6513.07340700",1538785561.8714,"s","l",""],["0.000368800","6513.07340700",1538785561.9265,"s","l",""],["0.000368800","2017.57340700",1538785578.0157,"s","l",""],["0.000368800","969.14512552",1538785632.3406,"s","l",""],["0.000368800","2.51324290",1538785632.3491,"s","l",""],["0.000368800","0.00651748",1538785632.3515,"s","l",""],["0.000368800","0.00001691",1538785632.3535,"s","l",""],["0.000368800","2000.00000000",1538786562.9497,"s","l",""],["0.000368800","2325.32963477",1538786570.3484,"s","l",""],["0.000368800","2000.00000000",1538786573.8882,"s","l",""],["0.000368800","1695.00000000",1538786573.9834,"s","l",""],["0.000368800","1029.97743764",1538786574.4798,"s","l",""],["0.000367100","575.00000000",1538797877.8472,"b","m",""],["0.000366600","2500.00000000",1538799105.8754,"b","l",""],["0.000367000","7441.81248066",1538799105.8779,"b","l",""],["0.000367000","913.45536766",1538799106.7044,"b","l",""],["0.000367800","1000.00000000",1538799106.7086,"b","l",""],["0.000367900","4105.20266017",1538799106.712,"b","l",""],["0.000368600","2175.23819103",1538799106.7147,"b","l",""],["0.000369200","1100.26175618",1538799106.7172,"b","l",""],["0.000366500","1.15000000",1538799536.7439,"b","m",""],["0.000365900","272.15939874",1538802727.3489,"b","m",""],["0.000366000","875.80020000",1538814089.8365,"b","m",""],["0.000367100","2500.00000000",1538818692.3838,"b","m",""],["0.000367400","4118.61614498",1538818692.3918,"b","m",""],["0.000367700","8067.18549183",1538818692.3961,"b","m",""],["0.000368000","2778.98407349",1538818692.3995,"b","m",""],["0.000369300","1000.00000000",1538818692.4029,"b","m",""],["0.000369400","5106.09080992",1538818692.4059,"b","m",""]],"last":"1538818692405917721"}}'
@pytest.fixture
def make_adapter():
def adapter_fac(interval):
return KrakenAdapter(interval)
return adapter_fac
@pytest.fixture
def adapter(make_adapter):
return make_adapter(interval=1)
def test_empty_data(adapter):
assert adapter([]) == "timestamp,open,high,low,close,vwap,volume,count"
@pytest.mark.parametrize("price,volume,time", [(1.0, 10.0, 0), (2.0, 15.0, 1)])
def test_single_entry_for_interval(adapter, price, volume, time):
assert adapter(trades(trade(price, volume, time),
trade(2.0, 10.0, 61.0))) == \
"timestamp,open,high,low,close,vwap,volume,count\n" \
f"0,{price},{price},{price},{price},{float(price)},{volume},1"
def trade(price, volume, time):
return [price, volume, time]
def trades(*entries):
return list(entries)
def test_aggregate_multiple_entries_for_interval(adapter):
assert adapter(trades(trade(1, 10, 0), trade(3, 20, 1), trade(2, 10, 2),
trade(1, 10, 61))) == \
"timestamp,open,high,low,close,vwap,volume,count\n" \
"0,1.0,3.0,1.0,2.0,2.2,40.0,3"
def test_aggregate_to_multiple_intervals(adapter):
assert adapter(trades(trade(1, 20, 120.1), trade(3, 20, 170.5), trade(2, 10, 180.0), trade(1, 30, 241.9),
trade(1, 30, 301.5), trade(1, 30, 302.5))) == \
"timestamp,open,high,low,close,vwap,volume,count\n" \
"120,1.0,3.0,1.0,3.0,2.0,40.0,2\n" \
"180,2.0,2.0,2.0,2.0,2.0,10.0,1\n" \
"240,1.0,1.0,1.0,1.0,1.0,30.0,1"
def test_configure_different_interval(make_adapter):
adapter = make_adapter(interval=30)
assert adapter(trades(trade(1, 20, 120), trade(3, 20, 1799), trade(2, 10, 1800), trade(2, 10, 3601))) == \
"timestamp,open,high,low,close,vwap,volume,count\n" \
"0,1.0,3.0,1.0,3.0,2.0,40.0,2\n" \
"1800,2.0,2.0,2.0,2.0,2.0,10.0,1"
def test_handling_gaps(adapter):
assert adapter(trades(trade(1, 20, 120.1), trade(3, 20, 170.5), trade(1, 30, 241.9),
trade(1, 30, 301.5), trade(1, 30, 302.5))) == \
"timestamp,open,high,low,close,vwap,volume,count\n" \
"120,1.0,3.0,1.0,3.0,2.0,40.0,2\n" \
"240,1.0,1.0,1.0,1.0,1.0,30.0,1"
def test_with_real_data(make_adapter):
adapter = make_adapter(interval=30)
import json
assert adapter(get_trades(json.loads(RAW_TRADES))) == EXPECTED_OHLC
def test_find_gaps_in_real_data(make_adapter):
adapter = make_adapter(interval=30)
import json
from datums_warehouse.broker.validation import validate
from datums_warehouse.broker.datums import CsvDatums
with pytest.raises(DataError):
validate(CsvDatums(30, adapter(get_trades(json.loads(FRAGMENTED_TRADES)))), z_score_threshold=20)
| 1,817.723404 | 58,204 | 0.625045 | 24,481 | 170,866 | 4.360279 | 0.243168 | 0.016938 | 0.009387 | 0.003607 | 0.541614 | 0.494182 | 0.484898 | 0.481517 | 0.481142 | 0.480374 | 0 | 0.581725 | 0.003693 | 170,866 | 93 | 58,205 | 1,837.268817 | 0.045314 | 0 | 0 | 0.276923 | 0 | 0.2 | 0.985339 | 0.98524 | 0 | 0 | 0 | 0 | 0.107692 | 1 | 0.2 | false | 0 | 0.123077 | 0.061538 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
8629e2f8a075165876d107f2641c13f60663eccd | 14,035 | py | Python | dcase_util/datasets/dcase2013.py | ankitshah009/dcase_util | 738571ce78faf60b0fdfa1d59fd42f42c8944f3d | [
"MIT"
] | null | null | null | dcase_util/datasets/dcase2013.py | ankitshah009/dcase_util | 738571ce78faf60b0fdfa1d59fd42f42c8944f3d | [
"MIT"
] | null | null | null | dcase_util/datasets/dcase2013.py | ankitshah009/dcase_util | 738571ce78faf60b0fdfa1d59fd42f42c8944f3d | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import os
import numpy
from dcase_util.datasets import AcousticSceneDataset
from dcase_util.containers import MetaDataContainer, MetaDataItem
from dcase_util.utils import Path
class DCASE2013_Scenes_DevelopmentSet(AcousticSceneDataset):
#
"""DCASE2013 Acoustic scenes 2013 development dataset
This dataset was used in DCASE2013 - Task 1, Acoustic scene classification
"""
def __init__(self,
storage_name='DCASE2013-acoustic-scenes-development',
data_path=None,
included_content_types=None,
**kwargs):
"""
Constructor
Parameters
----------
storage_name : str
Name to be used when storing dataset on disk
Default value 'DCASE2013-acoustic-scenes-development'
data_path : str
Root path where the dataset is stored. If None, os.path.join(tempfile.gettempdir(), 'dcase_util_datasets')
is used.
Default value None
included_content_types : list of str or str
Indicates what content type should be processed. One or multiple from ['all', 'audio', 'meta', 'code',
'documentation']. If None given, ['all'] is used. Parameter can be also comma separated string.
Default value None
"""
kwargs['included_content_types'] = included_content_types
kwargs['data_path'] = data_path
kwargs['storage_name'] = storage_name
kwargs['dataset_group'] = 'scene'
kwargs['dataset_meta'] = {
'authors': 'D. Giannoulis, E. Benetos, D. Stowell, and M. D. Plumbley',
'title': 'IEEE AASP CASA Challenge - Public Dataset for Scene Classification Task',
'url': 'https://archive.org/details/dcase2013_scene_classification',
'audio_source': 'Field recording',
'audio_type': 'Natural',
'recording_device_model': 'Unknown',
'microphone_model': 'Soundman OKM II Klassik/studio A3 electret microphone',
}
kwargs['crossvalidation_folds'] = 5
kwargs['package_list'] = [
{
'content_type': ['audio', 'meta', 'documentation'],
'remote_file': 'https://archive.org/download/dcase2013_scene_classification/scenes_stereo.zip',
'remote_bytes': 361748263,
'remote_md5': 'abdefde136d84de33b0f20a0f13a6b97',
'filename': 'scenes_stereo.zip'
}
]
kwargs['audio_paths'] = [
'scenes_stereo'
]
super(DCASE2013_Scenes_DevelopmentSet, self).__init__(**kwargs)
def prepare(self):
"""Prepare dataset for the usage.
Returns
-------
self
"""
if not self.meta_container.exists():
meta_data = MetaDataContainer()
for filename in self.audio_files:
raw_path, raw_filename = os.path.split(filename)
relative_path = self.absolute_to_relative_path(raw_path)
meta_data.append(
MetaDataItem(
{
'filename': os.path.join(relative_path, raw_filename),
'scene_label': os.path.splitext(os.path.split(filename)[1])[0][:-2],
}
)
)
meta_data.save(
filename=self.meta_file
)
self.load_meta()
all_folds_found = True
for fold in self.folds():
train_filename = self.evaluation_setup_filename(
setup_part='train',
fold=fold
)
test_filename = self.evaluation_setup_filename(
setup_part='test',
fold=fold
)
if not os.path.isfile(train_filename):
all_folds_found = False
if not os.path.isfile(test_filename):
all_folds_found = False
if not all_folds_found:
Path().makedirs(
path=self.evaluation_setup_path
)
classes = []
files = []
for item in self.meta:
classes.append(item.scene_label)
files.append(item.filename)
files = numpy.array(files)
from sklearn.model_selection import StratifiedShuffleSplit
sss = StratifiedShuffleSplit(
n_splits=self.crossvalidation_folds,
test_size=0.3,
random_state=0
)
fold = 1
for train_index, test_index in sss.split(X=numpy.zeros(len(classes)), y=classes):
train_files = files[train_index]
test_files = files[test_index]
train_filename = self.evaluation_setup_filename(
setup_part='train',
fold=fold
)
test_filename = self.evaluation_setup_filename(
setup_part='test',
fold=fold
)
eval_filename = self.evaluation_setup_filename(
setup_part='evaluate',
fold=fold
)
# Create meta containers and save them
# Train
train_meta = MetaDataContainer(
filename=train_filename
)
for filename in train_files:
train_meta += self.meta_container.filter(
filename=filename
)
train_meta.save()
# Test
test_meta = MetaDataContainer(
filename=test_filename
)
for filename in test_files:
test_meta.append(
MetaDataItem(
{
'filename': self.absolute_to_relative_path(filename)
}
)
)
test_meta.save()
# Evaluate
eval_meta = MetaDataContainer(
filename=eval_filename
)
for filename in test_files:
eval_meta += self.meta_container.filter(
filename=filename
)
eval_meta.save()
fold += 1
# Load meta and cross validation
self.load()
return self
class DCASE2013_Scenes_EvaluationSet(AcousticSceneDataset):
"""DCASE2013 Acoustic scenes 2013 evaluation dataset
This dataset was used in DCASE2013 - Task 1, Acoustic scene classification
"""
def __init__(self,
storage_name='DCASE2013-acoustic-scenes-evaluation',
data_path=None,
included_content_types=None,
**kwargs):
"""
Constructor
Parameters
----------
storage_name : str
Name to be used when storing dataset on disk
Default value 'DCASE2013-acoustic-scenes-evaluation'
data_path : str
Root path where the dataset is stored. If None, os.path.join(tempfile.gettempdir(), 'dcase_util_datasets')
is used.
Default value None
included_content_types : list of str or str
Indicates what content type should be processed. One or multiple from ['all', 'audio', 'meta', 'code',
'documentation']. If None given, ['all'] is used. Parameter can be also comma separated string.
Default value None
"""
kwargs['included_content_types'] = included_content_types
kwargs['data_path'] = data_path
kwargs['storage_name'] = storage_name
kwargs['dataset_group'] = 'scene'
kwargs['dataset_meta'] = {
'authors': 'D. Giannoulis, E. Benetos, D. Stowell, and M. D. Plumbley',
'title': 'IEEE AASP CASA Challenge - Private Dataset for Scene Classification Task',
'url': 'https://archive.org/details/dcase2013_scene_classification_testset',
'audio_source': 'Field recording',
'audio_type': 'Natural',
'recording_device_model': 'Unknown',
'microphone_model': 'Soundman OKM II Klassik/studio A3 electret microphone',
}
kwargs['crossvalidation_folds'] = 5
kwargs['package_list'] = [
{
'content_type': ['audio', 'documentation'],
'remote_file': 'https://archive.org/download/dcase2013_scene_classification_testset/scenes_stereo_testset.zip',
'remote_bytes': 371994727,
'remote_md5': None,
'filename': 'scenes_stereo_testset.zip'
},
{
'content_type': ['meta'],
'remote_file': 'https://archive.org/download/dcase2013_scene_classification_testset/dcase2013_task1_filenamekey.csv',
'remote_bytes': 8572,
'remote_md5': None,
'filename': 'dcase2013_task1_filenamekey.csv'
}
]
kwargs['audio_paths'] = [
'audio'
]
super(DCASE2013_Scenes_EvaluationSet, self).__init__(**kwargs)
def prepare(self):
"""Prepare dataset for the usage.
Returns
-------
self
"""
Path(os.path.join(self.local_path, 'audio')).create()
for filename in Path(os.path.join(self.local_path)).file_list(extensions='wav'):
# Rename files so that they do not overlap with ones in DCASE2013_Scenes_DevelopmentSet
if not os.path.split(filename)[1].startswith('test_'):
base, file = os.path.split(filename)
os.rename(
filename,
os.path.join(base, 'audio', 'test_' + file)
)
self.files = None
if not self.meta_container.exists():
meta_data = MetaDataContainer()
for filename in self.audio_files:
raw_path, raw_filename = os.path.split(filename)
relative_path = self.absolute_to_relative_path(raw_path)
meta_data.append(
MetaDataItem(
{
'filename': os.path.join(relative_path, raw_filename),
'scene_label': os.path.splitext(os.path.split(filename)[1])[0][:-2].replace('test_', ''),
}
)
)
meta_data.save(
filename=self.meta_file
)
self.load_meta()
all_folds_found = True
for fold in self.folds():
train_filename = self.evaluation_setup_filename(
setup_part='train',
fold=fold
)
test_filename = self.evaluation_setup_filename(
setup_part='test',
fold=fold
)
if not os.path.isfile(train_filename):
all_folds_found = False
if not os.path.isfile(test_filename):
all_folds_found = False
if not all_folds_found:
Path().makedirs(
path=self.evaluation_setup_path
)
classes = []
files = []
for item in self.meta:
classes.append(item.scene_label)
files.append(item.filename)
files = numpy.array(files)
from sklearn.model_selection import StratifiedShuffleSplit
sss = StratifiedShuffleSplit(
n_splits=self.crossvalidation_folds,
test_size=0.3,
random_state=0
)
fold = 1
for train_index, test_index in sss.split(X=numpy.zeros(len(classes)), y=classes):
train_files = files[train_index]
test_files = files[test_index]
train_filename = self.evaluation_setup_filename(
setup_part='train',
fold=fold
)
test_filename = self.evaluation_setup_filename(
setup_part='test',
fold=fold
)
eval_filename = self.evaluation_setup_filename(
setup_part='evaluate',
fold=fold
)
# Create meta containers and save them
# Train
train_meta = MetaDataContainer(
filename=train_filename
)
for filename in train_files:
train_meta += self.meta_container.filter(
filename=filename
)
train_meta.save()
# Test
test_meta = MetaDataContainer(
filename=test_filename
)
for filename in test_files:
test_meta.append(
MetaDataItem(
{
'filename': self.absolute_to_relative_path(filename)
}
)
)
test_meta.save()
# Evaluate
eval_meta = MetaDataContainer(
filename=eval_filename
)
for filename in test_files:
eval_meta += self.meta_container.filter(
filename=filename
)
eval_meta.save()
fold += 1
# Load meta and cross validation
self.load()
return self
| 32.413395 | 133 | 0.516779 | 1,284 | 14,035 | 5.419003 | 0.172897 | 0.016384 | 0.032768 | 0.038804 | 0.860736 | 0.844352 | 0.838316 | 0.830555 | 0.830555 | 0.830555 | 0 | 0.018435 | 0.400926 | 14,035 | 432 | 134 | 32.488426 | 0.80911 | 0.132882 | 0 | 0.654676 | 0 | 0 | 0.146794 | 0.024678 | 0 | 0 | 0 | 0 | 0 | 1 | 0.014388 | false | 0 | 0.028777 | 0 | 0.057554 | 0.003597 | 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 |
863f5bc4ee8947bd82afd245ff3717e82937c705 | 11,593 | py | Python | tests/components/homekit/test_type_switches.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | tests/components/homekit/test_type_switches.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | tests/components/homekit/test_type_switches.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Test different accessory types: Switches."""
from datetime import timedelta
import pytest
from openpeerpower.components.homekit.const import (
ATTR_VALUE,
TYPE_FAUCET,
TYPE_SHOWER,
TYPE_SPRINKLER,
TYPE_VALVE,
)
from openpeerpower.components.homekit.type_switches import Outlet, Switch, Vacuum, Valve
from openpeerpower.components.vacuum import (
DOMAIN as VACUUM_DOMAIN,
SERVICE_RETURN_TO_BASE,
SERVICE_START,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_CLEANING,
STATE_DOCKED,
SUPPORT_RETURN_HOME,
SUPPORT_START,
)
from openpeerpower.const import (
ATTR_ENTITY_ID,
ATTR_SUPPORTED_FEATURES,
CONF_TYPE,
STATE_OFF,
STATE_ON,
)
from openpeerpower.core import split_entity_id
import openpeerpower.util.dt as dt_util
from tests.common import async_fire_time_changed, async_mock_service
async def test_outlet_set_state(opp, hk_driver, events):
"""Test if Outlet accessory and OPP are updated accordingly."""
entity_id = "switch.outlet_test"
opp.states.async_set(entity_id, None)
await opp.async_block_till_done()
acc = Outlet(opp, hk_driver, "Outlet", entity_id, 2, None)
await acc.run()
await opp.async_block_till_done()
assert acc.aid == 2
assert acc.category == 7 # Outlet
assert acc.char_on.value is False
assert acc.char_outlet_in_use.value is True
opp.states.async_set(entity_id, STATE_ON)
await opp.async_block_till_done()
assert acc.char_on.value is True
opp.states.async_set(entity_id, STATE_OFF)
await opp.async_block_till_done()
assert acc.char_on.value is False
# Set from HomeKit
call_turn_on = async_mock_service(opp, "switch", "turn_on")
call_turn_off = async_mock_service(opp, "switch", "turn_off")
await opp.async_add_executor_job(acc.char_on.client_update_value, True)
await opp.async_block_till_done()
assert call_turn_on
assert call_turn_on[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
await opp.async_add_executor_job(acc.char_on.client_update_value, False)
await opp.async_block_till_done()
assert call_turn_off
assert call_turn_off[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 2
assert events[-1].data[ATTR_VALUE] is None
@pytest.mark.parametrize(
"entity_id, attrs",
[
("automation.test", {}),
("input_boolean.test", {}),
("remote.test", {}),
("script.test", {}),
("switch.test", {}),
],
)
async def test_switch_set_state(opp, hk_driver, entity_id, attrs, events):
"""Test if accessory and OPP are updated accordingly."""
domain = split_entity_id(entity_id)[0]
opp.states.async_set(entity_id, None, attrs)
await opp.async_block_till_done()
acc = Switch(opp, hk_driver, "Switch", entity_id, 2, None)
await acc.run()
await opp.async_block_till_done()
assert acc.aid == 2
assert acc.category == 8 # Switch
assert acc.activate_only is False
assert acc.char_on.value is False
opp.states.async_set(entity_id, STATE_ON, attrs)
await opp.async_block_till_done()
assert acc.char_on.value is True
opp.states.async_set(entity_id, STATE_OFF, attrs)
await opp.async_block_till_done()
assert acc.char_on.value is False
# Set from HomeKit
call_turn_on = async_mock_service(opp, domain, "turn_on")
call_turn_off = async_mock_service(opp, domain, "turn_off")
await opp.async_add_executor_job(acc.char_on.client_update_value, True)
await opp.async_block_till_done()
assert call_turn_on
assert call_turn_on[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
await opp.async_add_executor_job(acc.char_on.client_update_value, False)
await opp.async_block_till_done()
assert call_turn_off
assert call_turn_off[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 2
assert events[-1].data[ATTR_VALUE] is None
async def test_valve_set_state(opp, hk_driver, events):
"""Test if Valve accessory and OPP are updated accordingly."""
entity_id = "switch.valve_test"
opp.states.async_set(entity_id, None)
await opp.async_block_till_done()
acc = Valve(opp, hk_driver, "Valve", entity_id, 2, {CONF_TYPE: TYPE_FAUCET})
await acc.run()
await opp.async_block_till_done()
assert acc.category == 29 # Faucet
assert acc.char_valve_type.value == 3 # Water faucet
acc = Valve(opp, hk_driver, "Valve", entity_id, 2, {CONF_TYPE: TYPE_SHOWER})
await acc.run()
await opp.async_block_till_done()
assert acc.category == 30 # Shower
assert acc.char_valve_type.value == 2 # Shower head
acc = Valve(opp, hk_driver, "Valve", entity_id, 2, {CONF_TYPE: TYPE_SPRINKLER})
await acc.run()
await opp.async_block_till_done()
assert acc.category == 28 # Sprinkler
assert acc.char_valve_type.value == 1 # Irrigation
acc = Valve(opp, hk_driver, "Valve", entity_id, 2, {CONF_TYPE: TYPE_VALVE})
await acc.run()
await opp.async_block_till_done()
assert acc.aid == 2
assert acc.category == 29 # Faucet
assert acc.char_active.value == 0
assert acc.char_in_use.value == 0
assert acc.char_valve_type.value == 0 # Generic Valve
opp.states.async_set(entity_id, STATE_ON)
await opp.async_block_till_done()
assert acc.char_active.value == 1
assert acc.char_in_use.value == 1
opp.states.async_set(entity_id, STATE_OFF)
await opp.async_block_till_done()
assert acc.char_active.value == 0
assert acc.char_in_use.value == 0
# Set from HomeKit
call_turn_on = async_mock_service(opp, "switch", "turn_on")
call_turn_off = async_mock_service(opp, "switch", "turn_off")
await opp.async_add_executor_job(acc.char_active.client_update_value, 1)
await opp.async_block_till_done()
assert acc.char_in_use.value == 1
assert call_turn_on
assert call_turn_on[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
await opp.async_add_executor_job(acc.char_active.client_update_value, 0)
await opp.async_block_till_done()
assert acc.char_in_use.value == 0
assert call_turn_off
assert call_turn_off[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 2
assert events[-1].data[ATTR_VALUE] is None
async def test_vacuum_set_state_with_returnhome_and_start_support(
opp, hk_driver, events
):
"""Test if Vacuum accessory and OPP are updated accordingly."""
entity_id = "vacuum.roomba"
opp.states.async_set(
entity_id, None, {ATTR_SUPPORTED_FEATURES: SUPPORT_RETURN_HOME | SUPPORT_START}
)
await opp.async_block_till_done()
acc = Vacuum(opp, hk_driver, "Vacuum", entity_id, 2, None)
await acc.run()
await opp.async_block_till_done()
assert acc.aid == 2
assert acc.category == 8 # Switch
assert acc.char_on.value == 0
opp.states.async_set(
entity_id,
STATE_CLEANING,
{ATTR_SUPPORTED_FEATURES: SUPPORT_RETURN_HOME | SUPPORT_START},
)
await opp.async_block_till_done()
assert acc.char_on.value == 1
opp.states.async_set(
entity_id,
STATE_DOCKED,
{ATTR_SUPPORTED_FEATURES: SUPPORT_RETURN_HOME | SUPPORT_START},
)
await opp.async_block_till_done()
assert acc.char_on.value == 0
# Set from HomeKit
call_start = async_mock_service(opp, VACUUM_DOMAIN, SERVICE_START)
call_return_to_base = async_mock_service(opp, VACUUM_DOMAIN, SERVICE_RETURN_TO_BASE)
await opp.async_add_executor_job(acc.char_on.client_update_value, 1)
await opp.async_block_till_done()
assert acc.char_on.value == 1
assert call_start
assert call_start[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
await opp.async_add_executor_job(acc.char_on.client_update_value, 0)
await opp.async_block_till_done()
assert acc.char_on.value == 0
assert call_return_to_base
assert call_return_to_base[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 2
assert events[-1].data[ATTR_VALUE] is None
async def test_vacuum_set_state_without_returnhome_and_start_support(
opp, hk_driver, events
):
"""Test if Vacuum accessory and OPP are updated accordingly."""
entity_id = "vacuum.roomba"
opp.states.async_set(entity_id, None)
await opp.async_block_till_done()
acc = Vacuum(opp, hk_driver, "Vacuum", entity_id, 2, None)
await acc.run()
await opp.async_block_till_done()
assert acc.aid == 2
assert acc.category == 8 # Switch
assert acc.char_on.value == 0
opp.states.async_set(entity_id, STATE_ON)
await opp.async_block_till_done()
assert acc.char_on.value == 1
opp.states.async_set(entity_id, STATE_OFF)
await opp.async_block_till_done()
assert acc.char_on.value == 0
# Set from HomeKit
call_turn_on = async_mock_service(opp, VACUUM_DOMAIN, SERVICE_TURN_ON)
call_turn_off = async_mock_service(opp, VACUUM_DOMAIN, SERVICE_TURN_OFF)
await opp.async_add_executor_job(acc.char_on.client_update_value, 1)
await opp.async_block_till_done()
assert acc.char_on.value == 1
assert call_turn_on
assert call_turn_on[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
await opp.async_add_executor_job(acc.char_on.client_update_value, 0)
await opp.async_block_till_done()
assert acc.char_on.value == 0
assert call_turn_off
assert call_turn_off[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 2
assert events[-1].data[ATTR_VALUE] is None
async def test_reset_switch(opp, hk_driver, events):
"""Test if switch accessory is reset correctly."""
domain = "scene"
entity_id = "scene.test"
opp.states.async_set(entity_id, None)
await opp.async_block_till_done()
acc = Switch(opp, hk_driver, "Switch", entity_id, 2, None)
await acc.run()
await opp.async_block_till_done()
assert acc.activate_only is True
assert acc.char_on.value is False
call_turn_on = async_mock_service(opp, domain, "turn_on")
call_turn_off = async_mock_service(opp, domain, "turn_off")
await opp.async_add_executor_job(acc.char_on.client_update_value, True)
await opp.async_block_till_done()
assert acc.char_on.value is True
assert call_turn_on
assert call_turn_on[0].data[ATTR_ENTITY_ID] == entity_id
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
future = dt_util.utcnow() + timedelta(seconds=1)
async_fire_time_changed(opp, future)
await opp.async_block_till_done()
assert acc.char_on.value is False
assert len(events) == 1
assert not call_turn_off
await opp.async_add_executor_job(acc.char_on.client_update_value, False)
await opp.async_block_till_done()
assert acc.char_on.value is False
assert len(events) == 1
async def test_reset_switch_reload(opp, hk_driver, events):
"""Test reset switch after script reload."""
entity_id = "script.test"
opp.states.async_set(entity_id, None)
await opp.async_block_till_done()
acc = Switch(opp, hk_driver, "Switch", entity_id, 2, None)
await acc.run()
await opp.async_block_till_done()
assert acc.activate_only is False
opp.states.async_set(entity_id, None)
await opp.async_block_till_done()
assert acc.char_on.value is False
| 32.564607 | 88 | 0.717933 | 1,785 | 11,593 | 4.337815 | 0.071709 | 0.064058 | 0.088984 | 0.095312 | 0.850058 | 0.830686 | 0.803565 | 0.780834 | 0.753455 | 0.73589 | 0 | 0.009729 | 0.184335 | 11,593 | 355 | 89 | 32.656338 | 0.809116 | 0.020357 | 0 | 0.680147 | 0 | 0 | 0.02826 | 0 | 0 | 0 | 0 | 0 | 0.356618 | 1 | 0 | false | 0 | 0.033088 | 0 | 0.033088 | 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 |
86b5138622d3dc4d2082778ceebeb85ad8b327b3 | 36,570 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_batch.py | leonardbf/azure-sdk-for-python | efa43f4db6a97506ed0c6780c0bd4475a396db10 | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_batch.py | montgomp/azure-sdk-for-python | 0ffb0b0de095b97cbc5b69309bbce0a3b91d3eb4 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_batch.py | montgomp/azure-sdk-for-python | 0ffb0b0de095b97cbc5b69309bbce0a3b91d3eb4 | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
from azure.core.exceptions import HttpResponseError
from azure.ai.textanalytics import (
TextAnalyticsClient,
DetectLanguageInput,
TextDocumentInput
)
from testcase import TextAnalyticsTest, GlobalTextAnalyticsAccountPreparer
class BatchTextAnalyticsTest(TextAnalyticsTest):
@pytest.mark.live_test_only
def test_active_directory_auth(self):
token = self.generate_oauth_token()
endpoint = self.get_oauth_endpoint()
text_analytics = TextAnalyticsClient(endpoint, token)
docs = [{"id": "1", "text": "I should take my cat to the veterinarian."},
{"id": "2", "text": "Este es un document escrito en Español."},
{"id": "3", "text": "猫は幸せ"},
{"id": "4", "text": "Fahrt nach Stuttgart und dann zum Hotel zu Fu."}]
response = text_analytics.detect_languages(docs)
@GlobalTextAnalyticsAccountPreparer()
def test_successful_detect_language(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "text": "I should take my cat to the veterinarian."},
{"id": "2", "text": "Este es un document escrito en Español."},
{"id": "3", "text": "猫は幸せ"},
{"id": "4", "text": "Fahrt nach Stuttgart und dann zum Hotel zu Fu."}]
response = text_analytics.detect_languages(docs, show_stats=True)
self.assertEqual(response[0].primary_language.name, "English")
self.assertEqual(response[1].primary_language.name, "Spanish")
self.assertEqual(response[2].primary_language.name, "Japanese")
self.assertEqual(response[3].primary_language.name, "German")
self.assertEqual(response[0].primary_language.iso6391_name, "en")
self.assertEqual(response[1].primary_language.iso6391_name, "es")
self.assertEqual(response[2].primary_language.iso6391_name, "ja")
self.assertEqual(response[3].primary_language.iso6391_name, "de")
for doc in response:
self.assertIsNotNone(doc.id)
self.assertIsNotNone(doc.statistics)
self.assertIsNotNone(doc.primary_language.score)
@GlobalTextAnalyticsAccountPreparer()
def test_some_errors_detect_language(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "country_hint": "United States", "text": "I should take my cat to the veterinarian."},
{"id": "2", "text": "Este es un document escrito en Español."},
{"id": "3", "text": ""},
{"id": "4", "text": "Fahrt nach Stuttgart und dann zum Hotel zu Fu."}]
response = text_analytics.detect_languages(docs)
self.assertTrue(response[0].is_error)
self.assertFalse(response[1].is_error)
self.assertTrue(response[2].is_error)
self.assertFalse(response[3].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_all_errors_detect_language(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
text = ""
for _ in range(5121):
text += "x"
docs = [{"id": "1", "text": ""},
{"id": "2", "text": ""},
{"id": "3", "text": ""},
{"id": "4", "text": text}]
response = text_analytics.detect_languages(docs)
for resp in response:
self.assertTrue(resp.is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_successful_recognize_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "en", "text": "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975."},
{"id": "2", "language": "es", "text": "Microsoft fue fundado por Bill Gates y Paul Allen el 4 de abril de 1975."},
{"id": "3", "language": "de", "text": "Microsoft wurde am 4. April 1975 von Bill Gates und Paul Allen gegründet."}]
response = text_analytics.recognize_entities(docs, show_stats=True)
for doc in response:
self.assertEqual(len(doc.entities), 4)
self.assertIsNotNone(doc.id)
self.assertIsNotNone(doc.statistics)
for entity in doc.entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.type)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.length)
self.assertIsNotNone(entity.score)
@GlobalTextAnalyticsAccountPreparer()
def test_some_errors_recognize_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "en", "text": "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975."},
{"id": "2", "language": "Spanish", "text": "Hola"},
{"id": "3", "language": "de", "text": ""}]
response = text_analytics.recognize_entities(docs)
self.assertFalse(response[0].is_error)
self.assertTrue(response[1].is_error)
self.assertTrue(response[2].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_all_errors_recognize_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "text": ""},
{"id": "2", "language": "Spanish", "text": "Hola"},
{"id": "3", "language": "de", "text": ""}]
response = text_analytics.recognize_entities(docs)
self.assertTrue(response[0].is_error)
self.assertTrue(response[1].is_error)
self.assertTrue(response[2].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_successful_recognize_pii_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "text": "My SSN is 555-55-5555."},
{"id": "2", "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."},
{"id": "3", "text": "Is 998.214.865-68 your Brazilian CPF number?"}]
response = text_analytics.recognize_pii_entities(docs, show_stats=True)
self.assertEqual(response[0].entities[0].text, "555-55-5555")
self.assertEqual(response[0].entities[0].type, "U.S. Social Security Number (SSN)")
self.assertEqual(response[1].entities[0].text, "111000025")
self.assertEqual(response[1].entities[0].type, "ABA Routing Number")
self.assertEqual(response[2].entities[0].text, "998.214.865-68")
self.assertEqual(response[2].entities[0].type, "Brazil CPF Number")
for doc in response:
self.assertIsNotNone(doc.id)
self.assertIsNotNone(doc.statistics)
for entity in doc.entities:
self.assertIsNotNone(entity.text)
self.assertIsNotNone(entity.type)
self.assertIsNotNone(entity.offset)
self.assertIsNotNone(entity.length)
self.assertIsNotNone(entity.score)
@GlobalTextAnalyticsAccountPreparer()
def test_some_errors_recognize_pii_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "es", "text": "hola"},
{"id": "2", "text": ""},
{"id": "3", "text": "Is 998.214.865-68 your Brazilian CPF number?"}]
response = text_analytics.recognize_pii_entities(docs)
self.assertTrue(response[0].is_error)
self.assertTrue(response[1].is_error)
self.assertFalse(response[2].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_all_errors_recognize_pii_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "es", "text": "hola"},
{"id": "2", "text": ""}]
response = text_analytics.recognize_pii_entities(docs)
self.assertTrue(response[0].is_error)
self.assertTrue(response[1].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_successful_recognize_linked_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "en", "text": "Microsoft was founded by Bill Gates and Paul Allen"},
{"id": "2", "language": "es", "text": "Microsoft fue fundado por Bill Gates y Paul Allen"}]
response = text_analytics.recognize_linked_entities(docs, show_stats=True)
for doc in response:
self.assertEqual(len(doc.entities), 3)
self.assertIsNotNone(doc.id)
self.assertIsNotNone(doc.statistics)
for entity in doc.entities:
self.assertIsNotNone(entity.name)
self.assertIsNotNone(entity.matches)
self.assertIsNotNone(entity.language)
self.assertIsNotNone(entity.id)
self.assertIsNotNone(entity.url)
self.assertIsNotNone(entity.data_source)
@GlobalTextAnalyticsAccountPreparer()
def test_some_errors_recognize_linked_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "text": ""},
{"id": "2", "language": "es", "text": "Microsoft fue fundado por Bill Gates y Paul Allen"}]
response = text_analytics.recognize_linked_entities(docs)
self.assertTrue(response[0].is_error)
self.assertFalse(response[1].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_all_errors_recognize_linked_entities(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "text": ""},
{"id": "2", "language": "Spanish", "text": "Microsoft fue fundado por Bill Gates y Paul Allen"}]
response = text_analytics.recognize_linked_entities(docs)
self.assertTrue(response[0].is_error)
self.assertTrue(response[1].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_successful_extract_key_phrases(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "en", "text": "Microsoft was founded by Bill Gates and Paul Allen"},
{"id": "2", "language": "es", "text": "Microsoft fue fundado por Bill Gates y Paul Allen"}]
response = text_analytics.extract_key_phrases(docs, show_stats=True)
for phrases in response:
self.assertIn("Paul Allen", phrases.key_phrases)
self.assertIn("Bill Gates", phrases.key_phrases)
self.assertIn("Microsoft", phrases.key_phrases)
self.assertIsNotNone(phrases.id)
self.assertIsNotNone(phrases.statistics)
@GlobalTextAnalyticsAccountPreparer()
def test_some_errors_extract_key_phrases(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "English", "text": "Microsoft was founded by Bill Gates and Paul Allen"},
{"id": "2", "language": "es", "text": "Microsoft fue fundado por Bill Gates y Paul Allen"}]
response = text_analytics.extract_key_phrases(docs)
self.assertTrue(response[0].is_error)
self.assertFalse(response[1].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_all_errors_extract_key_phrases(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "English", "text": "Microsoft was founded by Bill Gates and Paul Allen"},
{"id": "2", "language": "es", "text": ""}]
response = text_analytics.extract_key_phrases(docs)
self.assertTrue(response[0].is_error)
self.assertTrue(response[1].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_successful_analyze_sentiment(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "en", "text": "Microsoft was founded by Bill Gates and Paul Allen."},
{"id": "2", "language": "en", "text": "I did not like the hotel we stayed it. It was too expensive."},
{"id": "3", "language": "en", "text": "The restaurant had really good food. I recommend you try it."}]
response = text_analytics.analyze_sentiment(docs, show_stats=True)
self.assertEqual(response[0].sentiment, "neutral")
self.assertEqual(response[1].sentiment, "negative")
self.assertEqual(response[2].sentiment, "positive")
for doc in response:
self.assertIsNotNone(doc.id)
self.assertIsNotNone(doc.statistics)
self.assertIsNotNone(doc.document_scores)
self.assertIsNotNone(doc.sentences)
@GlobalTextAnalyticsAccountPreparer()
def test_some_errors_analyze_sentiment(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "en", "text": ""},
{"id": "2", "language": "english", "text": "I did not like the hotel we stayed it. It was too expensive."},
{"id": "3", "language": "en", "text": "The restaurant had really good food. I recommend you try it."}]
response = text_analytics.analyze_sentiment(docs)
self.assertTrue(response[0].is_error)
self.assertTrue(response[1].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_all_errors_analyze_sentiment(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "1", "language": "en", "text": ""},
{"id": "2", "language": "english", "text": "I did not like the hotel we stayed it. It was too expensive."},
{"id": "3", "language": "en", "text": ""}]
response = text_analytics.analyze_sentiment(docs)
self.assertTrue(response[0].is_error)
self.assertTrue(response[1].is_error)
self.assertTrue(response[2].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_validate_input_string(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [
u"I should take my cat to the veterinarian.",
u"Este es un document escrito en Español.",
u"猫は幸せ",
u"Fahrt nach Stuttgart und dann zum Hotel zu Fu.",
u""
]
response = text_analytics.detect_languages(docs)
self.assertEqual(response[0].primary_language.name, "English")
self.assertEqual(response[1].primary_language.name, "Spanish")
self.assertEqual(response[2].primary_language.name, "Japanese")
self.assertEqual(response[3].primary_language.name, "German")
self.assertTrue(response[4].is_error)
@GlobalTextAnalyticsAccountPreparer()
def test_validate_language_input(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [
DetectLanguageInput(id="1", text="I should take my cat to the veterinarian."),
DetectLanguageInput(id="2", text="Este es un document escrito en Español."),
DetectLanguageInput(id="3", text="猫は幸せ"),
DetectLanguageInput(id="4", text="Fahrt nach Stuttgart und dann zum Hotel zu Fu.")
]
response = text_analytics.detect_languages(docs)
self.assertEqual(response[0].primary_language.name, "English")
self.assertEqual(response[1].primary_language.name, "Spanish")
self.assertEqual(response[2].primary_language.name, "Japanese")
self.assertEqual(response[3].primary_language.name, "German")
@GlobalTextAnalyticsAccountPreparer()
def test_validate_multilanguage_input(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [
TextDocumentInput(id="1", text="Microsoft was founded by Bill Gates and Paul Allen."),
TextDocumentInput(id="2", text="I did not like the hotel we stayed it. It was too expensive."),
TextDocumentInput(id="3", text="The restaurant had really good food. I recommend you try it."),
]
response = text_analytics.analyze_sentiment(docs)
self.assertEqual(response[0].sentiment, "neutral")
self.assertEqual(response[1].sentiment, "negative")
self.assertEqual(response[2].sentiment, "positive")
@GlobalTextAnalyticsAccountPreparer()
def test_mixing_inputs(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [
{"id": "1", "text": "Microsoft was founded by Bill Gates and Paul Allen."},
TextDocumentInput(id="2", text="I did not like the hotel we stayed it. It was too expensive."),
u"You cannot mix string input with the above inputs"
]
with self.assertRaises(TypeError):
response = text_analytics.analyze_sentiment(docs)
@GlobalTextAnalyticsAccountPreparer()
def test_out_of_order_ids(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [{"id": "56", "text": ":)"},
{"id": "0", "text": ":("},
{"id": "22", "text": ""},
{"id": "19", "text": ":P"},
{"id": "1", "text": ":D"}]
response = text_analytics.analyze_sentiment(docs)
in_order = ["56", "0", "22", "19", "1"]
for idx, resp in enumerate(response):
self.assertEqual(resp.id, in_order[idx])
@GlobalTextAnalyticsAccountPreparer()
def test_show_stats_and_model_version(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(response):
self.assertIsNotNone(response.model_version)
self.assertIsNotNone(response.raw_response)
self.assertEqual(response.statistics.document_count, 5)
self.assertEqual(response.statistics.transaction_count, 4)
self.assertEqual(response.statistics.valid_document_count, 4)
self.assertEqual(response.statistics.erroneous_document_count, 1)
docs = [{"id": "56", "text": ":)"},
{"id": "0", "text": ":("},
{"id": "22", "text": ""},
{"id": "19", "text": ":P"},
{"id": "1", "text": ":D"}]
response = text_analytics.analyze_sentiment(
docs,
show_stats=True,
model_version="latest",
response_hook=callback
)
@GlobalTextAnalyticsAccountPreparer()
def test_batch_size_over_limit(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = [u"hello world"] * 1050
with self.assertRaises(HttpResponseError):
response = text_analytics.detect_languages(docs)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_country_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
country_str = "\"countryHint\": \"CA\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 3)
docs = [
u"This was the best day of my life.",
u"I did not like the hotel we stayed it. It was too expensive.",
u"The restaurant was not as good as I hoped."
]
response = text_analytics.detect_languages(docs, country_hint="CA", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_dont_use_country_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
country_str = "\"countryHint\": \"\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 3)
docs = [
u"This was the best day of my life.",
u"I did not like the hotel we stayed it. It was too expensive.",
u"The restaurant was not as good as I hoped."
]
response = text_analytics.detect_languages(docs, country_hint="", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_per_item_dont_use_country_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
country_str = "\"countryHint\": \"\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 2)
country_str = "\"countryHint\": \"US\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 1)
docs = [{"id": "1", "country_hint": "", "text": "I will go to the park."},
{"id": "2", "country_hint": "", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.detect_languages(docs, response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_country_hint_and_obj_input(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
country_str = "\"countryHint\": \"CA\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 3)
docs = [
DetectLanguageInput(id="1", text="I should take my cat to the veterinarian."),
DetectLanguageInput(id="2", text="Este es un document escrito en Español."),
DetectLanguageInput(id="3", text="猫は幸せ"),
]
response = text_analytics.detect_languages(docs, country_hint="CA", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_country_hint_and_dict_input(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
country_str = "\"countryHint\": \"CA\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 3)
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.detect_languages(docs, country_hint="CA", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_country_hint_and_obj_per_item_hints(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
country_str = "\"countryHint\": \"CA\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 2)
country_str = "\"countryHint\": \"US\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 1)
docs = [
DetectLanguageInput(id="1", text="I should take my cat to the veterinarian.", country_hint="CA"),
DetectLanguageInput(id="4", text="Este es un document escrito en Español.", country_hint="CA"),
DetectLanguageInput(id="3", text="猫は幸せ"),
]
response = text_analytics.detect_languages(docs, country_hint="US", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_country_hint_and_dict_per_item_hints(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
country_str = "\"countryHint\": \"CA\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 1)
country_str = "\"countryHint\": \"US\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 2)
docs = [{"id": "1", "country_hint": "US", "text": "I will go to the park."},
{"id": "2", "country_hint": "US", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.detect_languages(docs, country_hint="CA", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_language_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
language_str = "\"language\": \"fr\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 3)
docs = [
u"This was the best day of my life.",
u"I did not like the hotel we stayed it. It was too expensive.",
u"The restaurant was not as good as I hoped."
]
response = text_analytics.analyze_sentiment(docs, language="fr", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_dont_use_language_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
language_str = "\"language\": \"\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 3)
docs = [
u"This was the best day of my life.",
u"I did not like the hotel we stayed it. It was too expensive.",
u"The restaurant was not as good as I hoped."
]
response = text_analytics.analyze_sentiment(docs, language="", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_per_item_dont_use_language_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
language_str = "\"language\": \"\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 2)
language_str = "\"language\": \"en\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 1)
docs = [{"id": "1", "language": "", "text": "I will go to the park."},
{"id": "2", "language": "", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.analyze_sentiment(docs, response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_language_hint_and_obj_input(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
language_str = "\"language\": \"de\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 3)
docs = [
TextDocumentInput(id="1", text="I should take my cat to the veterinarian."),
TextDocumentInput(id="4", text="Este es un document escrito en Español."),
TextDocumentInput(id="3", text="猫は幸せ"),
]
response = text_analytics.analyze_sentiment(docs, language="de", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_language_hint_and_dict_input(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
language_str = "\"language\": \"es\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 3)
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.analyze_sentiment(docs, language="es", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_language_hint_and_obj_per_item_hints(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
language_str = "\"language\": \"es\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 2)
language_str = "\"language\": \"en\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 1)
docs = [
TextDocumentInput(id="1", text="I should take my cat to the veterinarian.", language="es"),
TextDocumentInput(id="2", text="Este es un document escrito en Español.", language="es"),
TextDocumentInput(id="3", text="猫は幸せ"),
]
response = text_analytics.analyze_sentiment(docs, language="en", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_whole_batch_language_hint_and_dict_per_item_hints(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
def callback(resp):
language_str = "\"language\": \"es\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 2)
language_str = "\"language\": \"en\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 1)
docs = [{"id": "1", "language": "es", "text": "I will go to the park."},
{"id": "2", "language": "es", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.analyze_sentiment(docs, language="en", response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_bad_document_input(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key)
docs = "This is the wrong type"
with self.assertRaises(TypeError):
response = text_analytics.analyze_sentiment(docs)
@GlobalTextAnalyticsAccountPreparer()
def test_client_passed_default_country_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key, default_country_hint="CA")
def callback(resp):
country_str = "\"countryHint\": \"CA\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 3)
def callback_2(resp):
country_str = "\"countryHint\": \"DE\""
country = resp.http_request.body.count(country_str)
self.assertEqual(country, 3)
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.detect_languages(docs, response_hook=callback)
response = text_analytics.detect_languages(docs, country_hint="DE", response_hook=callback_2)
response = text_analytics.detect_languages(docs, response_hook=callback)
@GlobalTextAnalyticsAccountPreparer()
def test_client_passed_default_language_hint(self, resource_group, location, text_analytics_account, text_analytics_account_key):
text_analytics = TextAnalyticsClient(text_analytics_account, text_analytics_account_key, default_language="es")
def callback(resp):
language_str = "\"language\": \"es\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 3)
def callback_2(resp):
language_str = "\"language\": \"en\""
language = resp.http_request.body.count(language_str)
self.assertEqual(language, 3)
docs = [{"id": "1", "text": "I will go to the park."},
{"id": "2", "text": "I did not like the hotel we stayed it."},
{"id": "3", "text": "The restaurant had really good food."}]
response = text_analytics.analyze_sentiment(docs, response_hook=callback)
response = text_analytics.analyze_sentiment(docs, language="en", response_hook=callback_2)
response = text_analytics.analyze_sentiment(docs, response_hook=callback)
| 51.075419 | 147 | 0.667979 | 4,130 | 36,570 | 5.669249 | 0.068039 | 0.143248 | 0.143504 | 0.086102 | 0.91031 | 0.89502 | 0.862305 | 0.854489 | 0.848595 | 0.837832 | 0 | 0.01167 | 0.215012 | 36,570 | 715 | 148 | 51.146853 | 0.80395 | 0.004238 | 0 | 0.679279 | 0 | 0.001802 | 0.15054 | 0 | 0 | 0 | 0 | 0 | 0.230631 | 1 | 0.111712 | false | 0.003604 | 0.007207 | 0 | 0.120721 | 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 |
86beeefb54903309a4be77da503d0f28d22ad218 | 137 | py | Python | diff_gpmp2/learning/__init__.py | mhmukadam/dgpmp2 | b55c10f2a2fcff2cbf0e3291e0fff97fefa86661 | [
"BSD-3-Clause"
] | 31 | 2020-08-12T19:07:29.000Z | 2022-02-22T10:52:53.000Z | diff_gpmp2/learning/__init__.py | mhmukadam/dgpmp2 | b55c10f2a2fcff2cbf0e3291e0fff97fefa86661 | [
"BSD-3-Clause"
] | null | null | null | diff_gpmp2/learning/__init__.py | mhmukadam/dgpmp2 | b55c10f2a2fcff2cbf0e3291e0fff97fefa86661 | [
"BSD-3-Clause"
] | 7 | 2020-08-14T14:41:39.000Z | 2021-11-03T08:17:09.000Z | from .initialization_network import InitNet
from .learn_module_fcn import LearnModuleFCN
from .learn_module_conv import LearnModuleConv
| 34.25 | 46 | 0.883212 | 17 | 137 | 6.823529 | 0.647059 | 0.155172 | 0.258621 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094891 | 137 | 3 | 47 | 45.666667 | 0.935484 | 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 |
86bf6b6e43425723a8452bc7ec7a946c673348ff | 65 | py | Python | curve_analysis/curve_analysis/__init__.py | Cozieee/mlpp-playground | 89aa4294cbd8715a5901accc3e6953d2edfcc267 | [
"MIT"
] | null | null | null | curve_analysis/curve_analysis/__init__.py | Cozieee/mlpp-playground | 89aa4294cbd8715a5901accc3e6953d2edfcc267 | [
"MIT"
] | 1 | 2020-06-09T16:43:25.000Z | 2020-06-09T16:43:25.000Z | curve_analysis/curve_analysis/__init__.py | Cozieee/mlpp-playground | 89aa4294cbd8715a5901accc3e6953d2edfcc267 | [
"MIT"
] | 1 | 2020-06-05T20:27:20.000Z | 2020-06-05T20:27:20.000Z | from .curves import *
from .formulas import *
from .lex import *
| 16.25 | 23 | 0.723077 | 9 | 65 | 5.222222 | 0.555556 | 0.425532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184615 | 65 | 3 | 24 | 21.666667 | 0.886792 | 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 |
86c01dfeaedd6f0060d7581c7247d13242e3a6ae | 16,739 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/hrobot/tests/unit/plugins/modules/test_boot.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/hrobot/tests/unit/plugins/modules/test_boot.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/hrobot/tests/unit/plugins/modules/test_boot.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # (c) 2021 Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.internal_test_tools.tests.unit.utils.fetch_url_module_framework import (
FetchUrlCall,
BaseTestModule,
)
from ansible_collections.community.hrobot.plugins.module_utils.robot import BASE_URL
from ansible_collections.community.hrobot.plugins.modules import boot
def _amend_server_data(data):
data.update({
'server_ip': '123.123.123.123',
'server_ipv6_net': '2a01:4f8:111:4221::',
'server_number': 23,
})
return data
def create_rescue_inactive():
return _amend_server_data({
'active': False,
'arch': [64, 32],
'authorized_key': [],
'boot_time': None,
'host_key': [],
'os': ['linux', 'linuxold', 'freebsd', 'freebsdbeta', 'freebsdax', 'freebsdbetaax', 'vkvm', 'vkvmold'],
'password': None,
})
def create_rescue_active(os='linux', arch=64, authorized_key=None, host_key=None):
return _amend_server_data({
'active': True,
'arch': arch,
'authorized_key': authorized_key or [],
'boot_time': None,
'host_key': host_key or [],
'os': os,
'password': 'aBcDeFgHiJ1234',
})
def create_linux_inactive():
return {
'dist': [
'Arch Linux latest minimal',
'CentOS 7.9 minimal',
'CentOS 8.4 minimal',
'Debian 10.10 LAMP',
'Debian 10.10 minimal',
'Debian 11 base',
'Ubuntu 18.04.5 LTS minimal',
'Ubuntu 18.04.5 LTS Nextcloud',
'Ubuntu 20.04.1 LTS minimal',
],
'arch': [64],
'lang': ['en'],
'active': False,
'password': None,
'authorized_key': [],
'host_key': [],
}
def create_linux_active(dist='Arch Linux latest minimal', arch=64, lang='en', authorized_key=None, host_key=None):
return {
'dist': dist,
'arch': arch,
'lang': lang,
'active': True,
'password': 'aBcDeFgHiJ1234',
'authorized_key': authorized_key or [],
'host_key': host_key or [],
}
def create_vnc_inactive():
return {
'dist': ['CentOS-7.9', 'CentOS-8.4', 'Fedora-33', 'openSUSE-15.2'],
'arch': [64],
'lang': ['de_DE', 'en_US', 'fr_FR', 'ru_RU'],
'active': False,
'password': None,
}
def _amend_boot(data=None):
if data is None:
data = {}
if 'rescue' not in data:
data['rescue'] = create_rescue_inactive()
if 'linux' not in data:
data['linux'] = create_linux_inactive()
if 'vnc' not in data:
data['vnc'] = create_vnc_inactive()
for section in ('windows', 'plesk', 'cpanel'):
if section not in data:
data[section] = None
return {
'boot': data,
}
class TestHetznerBoot(BaseTestModule):
MOCK_ANSIBLE_MODULEUTILS_BASIC_ANSIBLEMODULE = 'ansible_collections.community.hrobot.plugins.modules.boot.AnsibleModule'
MOCK_ANSIBLE_MODULEUTILS_URLS_FETCH_URL = 'ansible_collections.community.hrobot.plugins.module_utils.robot.fetch_url'
def test_idempotent_regular(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'regular_boot': True,
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'rescue': create_linux_inactive(),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['changed'] is False
assert result['configuration_type'] == 'regular_boot'
assert result['password'] is None
def test_rescue_idempotent(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'rescue': {
'os': 'linux',
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'rescue': create_rescue_active(os='linux'),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['changed'] is False
assert result['configuration_type'] == 'rescue'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_rescue_idempotent_2(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'rescue': {
'os': 'linux',
'arch': 32,
'authorized_keys': [
'abc',
'def',
'afz',
],
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'rescue': create_rescue_active(os='linux', arch=32, authorized_key=['def', 'afz', 'abc']),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['changed'] is False
assert result['configuration_type'] == 'rescue'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_rescue_deactivate(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'regular_boot': True,
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'rescue': create_rescue_active(os='linux'),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
FetchUrlCall('DELETE', 200)
.expect_url('{0}/boot/23/rescue'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'regular_boot'
assert result['password'] is None
def test_rescue_deactivate_check_mode(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'regular_boot': True,
'_ansible_check_mode': True,
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'rescue': create_rescue_active(os='linux'),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'regular_boot'
assert result['password'] is None
def test_rescue_activate(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'rescue': {
'os': 'linux',
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot())
.expect_url('{0}/boot/23'.format(BASE_URL)),
FetchUrlCall('POST', 200)
.expect_form_value('os', 'linux')
.expect_form_value_absent('arch')
.expect_form_value_absent('authorized_key')
.result_json({
'rescue': create_rescue_active(os='linux'),
})
.expect_url('{0}/boot/23/rescue'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'rescue'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_rescue_activate_check_mode(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'rescue': {
'os': 'linux',
},
'_ansible_check_mode': True,
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot())
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'rescue'
assert result['password'] is None
def test_rescue_reactivate(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'rescue': {
'os': 'linuxold',
'arch': 32,
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'rescue': create_rescue_active(os='linux'),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
FetchUrlCall('DELETE', 200)
.expect_url('{0}/boot/23/rescue'.format(BASE_URL)),
FetchUrlCall('POST', 200)
.expect_form_value('os', 'linuxold')
.expect_form_value('arch', '32')
.expect_form_value_absent('authorized_key')
.result_json({
'rescue': create_rescue_active(os='linuxold', arch=32),
})
.expect_url('{0}/boot/23/rescue'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'rescue'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_rescue_reactivate_check_mode(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'rescue': {
'os': 'linuxold',
'arch': 32,
},
'_ansible_check_mode': True,
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'rescue': create_rescue_active(os='linux'),
}))
])
assert result['changed'] is True
assert result['configuration_type'] == 'rescue'
assert result['password'] is None
def test_install_linux_idempotent(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'install_linux': {
'dist': 'Arch Linux latest minimal',
'lang': 'en',
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'linux': create_linux_active(dist='Arch Linux latest minimal', lang='en'),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['changed'] is False
assert result['configuration_type'] == 'install_linux'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_install_linux_idempotent_2(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'install_linux': {
'dist': 'Arch Linux latest minimal',
'arch': 32,
'lang': 'de',
'authorized_keys': [
'abc',
'def',
'afz',
],
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'linux': create_linux_active(dist='Arch Linux latest minimal', arch=32, lang='de', authorized_key=['def', 'afz', 'abc']),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['changed'] is False
assert result['configuration_type'] == 'install_linux'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_install_linux_deactivate(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'regular_boot': True,
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'linux': create_linux_active(dist='Arch Linux latest minimal'),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
FetchUrlCall('DELETE', 200)
.expect_url('{0}/boot/23/linux'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'regular_boot'
assert result['password'] is None
def test_install_linux_activate(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'install_linux': {
'dist': 'Arch Linux latest minimal',
'lang': 'en',
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot())
.expect_url('{0}/boot/23'.format(BASE_URL)),
FetchUrlCall('POST', 200)
.expect_form_value('dist', 'Arch Linux latest minimal')
.expect_form_value_absent('arch')
.expect_form_value_absent('authorized_key')
.result_json({
'linux': create_linux_active(dist='Arch Linux latest minimal', lang='en'),
})
.expect_url('{0}/boot/23/linux'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'install_linux'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_install_linux_reactivate(self, mocker):
result = self.run_module_success(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'install_linux': {
'dist': 'Debian 11 base',
'arch': 32,
'lang': 'fr',
'authorized_keys': [
'asdf',
'foo bar',
],
},
}, [
FetchUrlCall('GET', 200)
.result_json(_amend_boot({
'linux': create_linux_active(dist='Arch Linux latest minimal', lang='en'),
}))
.expect_url('{0}/boot/23'.format(BASE_URL)),
FetchUrlCall('DELETE', 200)
.expect_url('{0}/boot/23/linux'.format(BASE_URL)),
FetchUrlCall('POST', 200)
.expect_form_value('dist', 'Debian 11 base')
.expect_form_value('arch', '32')
.expect_form_value('lang', 'fr')
.expect_form_present('authorized_key')
# .expect_form_value('authorized_key', 'asdf')
# .expect_form_value('authorized_key', 'foo bar')
.result_json({
'linux': create_linux_active(dist='Debian 11 base', lang='fr', arch=32, authorized_key=['foo bar', 'asdf']),
})
.expect_url('{0}/boot/23/linux'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['configuration_type'] == 'install_linux'
assert result['password'] == 'aBcDeFgHiJ1234'
def test_server_not_found(self, mocker):
result = self.run_module_failed(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'regular_boot': True,
}, [
FetchUrlCall('GET', 404)
.result_json({
'error': {
'status': 404,
'code': 'SERVER_NOT_FOUND',
'message': 'Server not found',
},
})
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['msg'] == 'This server does not exist, or you do not have access rights for it'
def test_invalid_input(self, mocker):
result = self.run_module_failed(mocker, boot, {
'hetzner_user': '',
'hetzner_password': '',
'server_number': 23,
'regular_boot': True,
}, [
FetchUrlCall('GET', 404)
.result_json({
'error': {
'status': 404,
'code': 'BOOT_NOT_AVAILABLE',
'message': 'No boot configuration available for this server',
},
})
.expect_url('{0}/boot/23'.format(BASE_URL)),
])
assert result['msg'] == 'There is no boot configuration available for this server'
| 35.463983 | 137 | 0.52542 | 1,651 | 16,739 | 5.067838 | 0.118716 | 0.063105 | 0.027489 | 0.038485 | 0.797538 | 0.760249 | 0.741484 | 0.719254 | 0.698339 | 0.689853 | 0 | 0.029915 | 0.332995 | 16,739 | 471 | 138 | 35.539278 | 0.719481 | 0.013442 | 0 | 0.75174 | 0 | 0 | 0.232419 | 0.008723 | 0 | 0 | 0 | 0 | 0.102088 | 1 | 0.053364 | false | 0.081207 | 0.009281 | 0.011601 | 0.085847 | 0.00232 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 6 |
86e53ec262227421bf7d7bda7ce0ad9086e3bdc6 | 12,662 | py | Python | tests/cvrp/classical_operators.py | fberanizo/sin5006 | 96f7980b5ff61bd4af7852c9d733521edde540eb | [
"BSD-2-Clause"
] | null | null | null | tests/cvrp/classical_operators.py | fberanizo/sin5006 | 96f7980b5ff61bd4af7852c9d733521edde540eb | [
"BSD-2-Clause"
] | null | null | null | tests/cvrp/classical_operators.py | fberanizo/sin5006 | 96f7980b5ff61bd4af7852c9d733521edde540eb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import sys, os
sys.path.insert(0, os.path.abspath('../..'))
import unittest, ga, cvrp, grid_search, re, math, numpy, itertools, matplotlib.pyplot as plt
class ClassicalOperators(unittest.TestCase):
"""Test cases for CVRP problem."""
grid_search = False
def test_1(self):
"""
Chromosome: sequence of clients separed by an 'X' when a new vehicle is assigned
Selection: roulette-wheel
Crossover operator: one-point
Mutation operator: permutation
Elitism is enabled
Termination criteria: number of generations = 100
Parameters:
population_size: 4096
reproduction rate: 0.375
crossover rate: 0
mutation rate: 0.625
"""
fname = './input/A-n32-k5.vrp'
nodes, capacity, distances, demand = self.load_test(fname)
individual_factory = cvrp.CVRPIndividualFactory(nodes, capacity, distances, demand, 'classical')
termination_criteria = ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100)
solver = ga.GeneticAlgorithm(individual_factory, population_size=4096, reproduction=0.375, crossover=0.0, mutation=0.625, elitism=True, termination_criteria=termination_criteria)
if self.grid_search:
params = {
"population_size": numpy.logspace(3, 12, base=2, num=6, dtype=int),
"operators_rate": map(lambda x: (x[0], 0.0, x[1]), filter(lambda x: sum(x) == 1.0, itertools.product(numpy.arange(.125, 0.875, .125), repeat=2))),
"elitism": [True],
"termination_criteria": [ ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100) ]
}
grid = grid_search.GridSearch(solver, params)
grid.search(0.0)
grid_scores = grid.get_grid_scores()
fname = './results/classical_operators/A-n32-k5.vrp.grid.csv'
grid_scores.to_csv(fname, sep=',', index=False)
sys.stdout.write("Finished. Results are at: ./results/classical_operators/A-n32-k5.vrp.grid.csv\n")
else:
sys.stdout.write("Starting test_1: CLASSICAL OPERATORS, ELITISM ENABLED\n")
sys.stdout.write("Input: ./tests/cvrp/A-n32-k5.vrp\n")
solver.init_population()
solver.evolve()
info = solver.get_generation_info()
fname = './results/classical_operators/A-n32-k5.vrp.csv'
info.to_csv(fname, sep=',', index=False)
plt.plot(info['generation'], info['min'], "r", label="melhor", linewidth=2)
plt.plot(info['generation'], info['mean'], "b", label="media", linewidth=2)
plt.plot(info['generation'], info['std'], "k.", label="desvio")
legend = plt.legend(loc='lower right', numpoints=1)
plt.xlabel("geracoes")
plt.ylabel("fitness")
plt.yscale('log')
plt.show()
sys.stdout.write("Finished. Results are at: ./results/classical_operators/A-n32-k5.vrp.csv\n")
assert True
def test_2(self):
"""
Chromosome: sequence of clients separed by an 'X' when a new vehicle is assigned
Selection: roulette-wheel
Crossover operator: one-point
Mutation operator: permutation
Elitism is enabled
Termination criteria: number of generations = 100
Parameters:
population_size: 4096
reproduction rate: 0.375
crossover rate: 0
mutation rate: 0.625
"""
fname = './input/B-n31-k5.vrp'
nodes, capacity, distances, demand = self.load_test(fname)
individual_factory = cvrp.CVRPIndividualFactory(nodes, capacity, distances, demand)
termination_criteria = ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100)
solver = ga.GeneticAlgorithm(individual_factory, population_size=4096, reproduction=0.375, crossover=0.0, mutation=0.625, elitism=True, termination_criteria=termination_criteria)
if self.grid_search:
params = {
"population_size": numpy.logspace(3, 12, base=2, num=6, dtype=int),
"operators_rate": map(lambda x: (x[0], 0.0, x[1]), filter(lambda x: sum(x) == 1.0, itertools.product(numpy.arange(.125, 0.875, .125), repeat=2))),
"elitism": [True],
"termination_criteria": [ ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100) ]
}
grid = grid_search.GridSearch(solver, params)
grid.search(0.0)
grid_scores = grid.get_grid_scores()
fname = './results/classical_operators/B-n31-k5.vrp.grid.csv'
grid_scores.to_csv(fname, sep=',', index=False)
sys.stdout.write("Finished. Results are at: ./results/classical_operators/B-n31-k5.vrp.grid.csv\n")
else:
sys.stdout.write("Starting test_2: CLASSICAL OPERATORS, ELITISM ENABLED\n")
sys.stdout.write("Input: ./tests/vrp/B-n31-k5.vrp\n")
solver.init_population()
solver.evolve()
info = solver.get_generation_info()
fname = './results/classical_operators/B-n31-k5.vrp.csv'
info.to_csv(fname, sep=',', index=False)
plt.plot(info['generation'], info['min'], "r", label="melhor", linewidth=2)
plt.plot(info['generation'], info['mean'], "b", label="media", linewidth=2)
plt.plot(info['generation'], info['std'], "k.", label="desvio")
legend = plt.legend(loc='lower right', numpoints=1)
plt.xlabel("geracoes")
plt.ylabel("fitness")
plt.yscale('log')
plt.show()
sys.stdout.write("Finished. Results are at: ./results/classical_operators/B-n31-k5.vrp.csv\n")
assert True
def test_3(self):
"""
Chromosome: sequence of clients separed by an 'X' when a new vehicle is assigned
Selection: roulette-wheel
Crossover operator: one-point
Mutation operator: permutation
Elitism is enabled
Termination criteria: number of generations = 100
Parameters:
population_size: 4096
reproduction rate: 0.375
crossover rate: 0
mutation rate: 0.625
"""
fname = './input/P-n16-k8.vrp'
nodes, capacity, distances, demand = self.load_test(fname)
individual_factory = cvrp.CVRPIndividualFactory(nodes, capacity, distances, demand)
termination_criteria = ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100)
solver = ga.GeneticAlgorithm(individual_factory, population_size=4096, reproduction=0.375, crossover=0.0, mutation=0.625, elitism=True, termination_criteria=termination_criteria)
if self.grid_search:
params = {
"population_size": numpy.logspace(3, 12, base=2, num=6, dtype=int),
"operators_rate": map(lambda x: (x[0], 0.0, x[1]), filter(lambda x: sum(x) == 1.0, itertools.product(numpy.arange(.125, 0.875, .125), repeat=2))),
"elitism": [True],
"termination_criteria": [ ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100) ]
}
grid = grid_search.GridSearch(solver, params)
grid.search(0.0)
grid_scores = grid.get_grid_scores()
fname = './results/classical_operators/P-n16-k8.vrp.grid.csv'
grid_scores.to_csv(fname, sep=',', index=False)
sys.stdout.write("Finished. Results are at: ./results/classical_operators/P-n16-k8.vrp.grid.csv\n")
else:
sys.stdout.write("Starting test_3: CLASSICAL OPERATORS, ELITISM ENABLED\n")
sys.stdout.write("Input: ./tests/vrp/P-n16-k8.vrp\n")
solver.init_population()
solver.evolve()
info = solver.get_generation_info()
fname = './results/classical_operators/P-n16-k8.vrp.csv'
info.to_csv(fname, sep=',', index=False)
plt.plot(info['generation'], info['min'], "r", label="melhor", linewidth=2)
plt.plot(info['generation'], info['mean'], "b", label="media", linewidth=2)
plt.plot(info['generation'], info['std'], "k.", label="desvio")
legend = plt.legend(loc='lower right', numpoints=1)
plt.xlabel("geracoes")
plt.ylabel("fitness")
plt.yscale('log')
plt.show()
sys.stdout.write("Finished. Results are at: ./results/classical_operators/P-n16-k8.vrp.csv\n")
assert True
def test_4(self):
"""
Chromosome: sequence of clients separed by an 'X' when a new vehicle is assigned
Selection: roulette-wheel
Crossover operator: one-point
Mutation operator: permutation
Elitism is enabled
Termination criteria: number of generations = 100
Parameters:
population_size: 4096
reproduction rate: 0.25
crossover rate: 0
mutation rate: 0.75
"""
fname = './input/A-n80-k10.vrp'
nodes, capacity, distances, demand = self.load_test(fname)
individual_factory = cvrp.CVRPIndividualFactory(nodes, capacity, distances, demand)
termination_criteria = ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100)
solver = ga.GeneticAlgorithm(individual_factory, population_size=4096, reproduction=0.25, crossover=0.0, mutation=0.75, elitism=True, termination_criteria=termination_criteria)
if self.grid_search:
params = {
"population_size": numpy.logspace(3, 12, base=2, num=6, dtype=int),
"operators_rate": map(lambda x: (x[0], 0.0, x[1]), filter(lambda x: sum(x) == 1.0, itertools.product(numpy.arange(.125, 0.875, .125), repeat=2))),
"elitism": [True],
"termination_criteria": [ ga.NumberOfGenerationsTerminationCriteria(number_of_generations=100) ]
}
grid = grid_search.GridSearch(solver, params)
grid.search(0.0)
grid_scores = grid.get_grid_scores()
fname = './results/classical_operators/A-n80-k10.vrp.grid.csv'
grid_scores.to_csv(fname, sep=',', index=False)
sys.stdout.write("Finished. Results are at: ./results/classical_operators/A-n80-k10.vrp.grid.csv\n")
else:
sys.stdout.write("Starting test_4: CLASSICAL OPERATORS, ELITISM ENABLED\n")
sys.stdout.write("Input: ./tests/vrp/A-n80-k10.vrp\n")
solver.init_population()
solver.evolve()
info = solver.get_generation_info()
fname = './results/classical_operators/A-n80-k10.vrp.csv'
info.to_csv(fname, sep=',', index=False)
plt.plot(info['generation'], info['min'], "r", label="melhor", linewidth=2)
plt.plot(info['generation'], info['mean'], "b", label="media", linewidth=2)
plt.plot(info['generation'], info['std'], "k.", label="desvio")
legend = plt.legend(loc='lower right', numpoints=1)
plt.xlabel("geracoes")
plt.ylabel("fitness")
plt.yscale('log')
plt.show()
sys.stdout.write("Finished. Results are at: ./results/classical_operators/A-n80-k10.vrp.csv\n")
assert True
def load_test(self, fname):
content = open(fname).read().replace('\r', ' ').replace('\n', ' ')
nodes = int(re.search('DIMENSION : ([0-9]+)', content).group(1))
capacity = int(re.search('CAPACITY : ([0-9]+)', content).group(1))
coords = re.search('NODE_COORD_SECTION\s*(.*)\s*DEMAND_SECTION', content).group(1)
coords = re.findall('([0-9]+) ([0-9]+) ([0-9]+)', coords)
distances = []
for node, x1, y1 in coords:
row = []
for node, x2, y2 in coords:
xd = int(x2) - int(x1)
yd = int(y2) - int(y1)
row.append(math.sqrt(xd*xd + yd*yd))
distances.append(row)
distances = numpy.matrix(distances)
demand_section = re.search('DEMAND_SECTION\s*(.*)\s*DEPOT_SECTION', content).group(1)
demand_section = re.findall('([0-9]+) ([0-9]+)', demand_section)
node_demand = dict()
for node, demand in demand_section:
node_demand[int(node)] = int(demand)
return nodes, capacity, distances, node_demand
if __name__ == '__main__':
unittest.main() | 46.551471 | 186 | 0.60338 | 1,496 | 12,662 | 5.006016 | 0.130348 | 0.050741 | 0.053412 | 0.035252 | 0.893844 | 0.883563 | 0.874616 | 0.872213 | 0.863266 | 0.860729 | 0 | 0.038746 | 0.262123 | 12,662 | 272 | 187 | 46.551471 | 0.762817 | 0.114753 | 0 | 0.625 | 0 | 0.045455 | 0.205708 | 0.092847 | 0 | 0 | 0 | 0 | 0.022727 | 1 | 0.028409 | false | 0 | 0.011364 | 0 | 0.056818 | 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 |
d4a94dd1cf53df8e498ba7a8529ed73ac08b195b | 18 | py | Python | src/iqapt/model/__init__.py | winterYANGWT/IQAPT-Image_Quality_Assessment_Pytorch | 11711fea8b5376373706fcb5f1ec48e108483f08 | [
"MIT"
] | 1 | 2021-11-10T08:30:40.000Z | 2021-11-10T08:30:40.000Z | src/iqapt/model/__init__.py | winterYANGWT/IQAPT-Image_Quality_Assessment_Pytorch | 11711fea8b5376373706fcb5f1ec48e108483f08 | [
"MIT"
] | null | null | null | src/iqapt/model/__init__.py | winterYANGWT/IQAPT-Image_Quality_Assessment_Pytorch | 11711fea8b5376373706fcb5f1ec48e108483f08 | [
"MIT"
] | 1 | 2022-02-05T03:18:38.000Z | 2022-02-05T03:18:38.000Z | from . import fid
| 9 | 17 | 0.722222 | 3 | 18 | 4.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 18 | 1 | 18 | 18 | 0.928571 | 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 |
d4e812f4d804d69eef8c253b3d2f6cd70c248e8f | 154 | py | Python | bonus2/collateral/filters_role/roles/my_role/filter_plugins/my_filter.py | kinther/ansible_course | 5ff96b857d7b1ddb359526fed128feefba8ebb90 | [
"Apache-2.0"
] | 14 | 2020-01-24T21:52:51.000Z | 2021-05-24T01:58:08.000Z | bonus2/collateral/filters_role/roles/my_role/filter_plugins/my_filter.py | kinther/ansible_course | 5ff96b857d7b1ddb359526fed128feefba8ebb90 | [
"Apache-2.0"
] | null | null | null | bonus2/collateral/filters_role/roles/my_role/filter_plugins/my_filter.py | kinther/ansible_course | 5ff96b857d7b1ddb359526fed128feefba8ebb90 | [
"Apache-2.0"
] | 26 | 2020-03-29T20:17:29.000Z | 2022-03-28T19:13:40.000Z | def some_filter(my_string):
return my_string.upper()
class FilterModule(object):
def filters(self):
return {"some_filter": some_filter}
| 19.25 | 43 | 0.701299 | 20 | 154 | 5.15 | 0.6 | 0.291262 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.188312 | 154 | 7 | 44 | 22 | 0.824 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.4 | 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 | 0 | 1 | 1 | 0 | 0 | 6 |
07b2ef269fe69281762487e6f53ca6d1fb686fa2 | 46 | py | Python | cblearn/embedding/wrapper/__init__.py | Conzel/cblearn | 4e75ba5533796607d7c182b37d2ab108324f2b54 | [
"MIT"
] | 7 | 2021-11-19T13:53:56.000Z | 2022-03-28T18:39:04.000Z | cblearn/embedding/wrapper/__init__.py | Conzel/cblearn | 4e75ba5533796607d7c182b37d2ab108324f2b54 | [
"MIT"
] | 20 | 2021-09-24T11:39:06.000Z | 2022-03-17T15:50:06.000Z | cblearn/embedding/wrapper/__init__.py | Conzel/cblearn | 4e75ba5533796607d7c182b37d2ab108324f2b54 | [
"MIT"
] | 3 | 2021-11-24T13:23:17.000Z | 2022-03-24T08:57:20.000Z | from ._mlds import MLDS
from ._soe import SOE
| 15.333333 | 23 | 0.782609 | 8 | 46 | 4.25 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 46 | 2 | 24 | 23 | 0.894737 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.