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
d27a924ab8073f72acea650a72bd4e2c5fe697de
229
py
Python
pygui/widget/editor/addins/__init__.py
clark3493/pygui
7de660341dfd1486de269edd116f642805e9ecb0
[ "MIT" ]
null
null
null
pygui/widget/editor/addins/__init__.py
clark3493/pygui
7de660341dfd1486de269edd116f642805e9ecb0
[ "MIT" ]
null
null
null
pygui/widget/editor/addins/__init__.py
clark3493/pygui
7de660341dfd1486de269edd116f642805e9ecb0
[ "MIT" ]
null
null
null
from .file_handler import FileHandler from .line_number import LineNumbers from .popup_menu import Popup from .scrollbar import Scrollbar from .stationery_functions import StationeryFunctions from .syntax import PythonSyntaxColor
38.166667
53
0.873362
28
229
7
0.571429
0
0
0
0
0
0
0
0
0
0
0
0.100437
229
6
54
38.166667
0.951456
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
96770bbaa3839b8bb17f81ef5130eb16f24cb12e
81
py
Python
abc/183/B.py
tonko2/AtCoder
5d617072517881d226d7c8af09cb88684d41af7e
[ "Xnet", "X11", "CECILL-B" ]
2
2022-01-22T07:56:58.000Z
2022-01-24T00:29:37.000Z
abc/183/B.py
tonko2/AtCoder
5d617072517881d226d7c8af09cb88684d41af7e
[ "Xnet", "X11", "CECILL-B" ]
null
null
null
abc/183/B.py
tonko2/AtCoder
5d617072517881d226d7c8af09cb88684d41af7e
[ "Xnet", "X11", "CECILL-B" ]
null
null
null
Sx, Sy, Gx, Gy = map(int, input().split()) print((Sy * Gx + Gy * Sx) / (Gy + Sy))
40.5
42
0.506173
15
81
2.733333
0.6
0.195122
0.292683
0
0
0
0
0
0
0
0
0
0.209877
81
2
43
40.5
0.640625
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
9683c66a456bc7ca58f3ffc4a5430175eb93d3ef
1,027
py
Python
boto3_type_annotations/boto3_type_annotations/opsworks/waiter.py
cowboygneox/boto3_type_annotations
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
[ "MIT" ]
119
2018-12-01T18:20:57.000Z
2022-02-02T10:31:29.000Z
boto3_type_annotations/boto3_type_annotations/opsworks/waiter.py
cowboygneox/boto3_type_annotations
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
[ "MIT" ]
15
2018-11-16T00:16:44.000Z
2021-11-13T03:44:18.000Z
boto3_type_annotations/boto3_type_annotations/opsworks/waiter.py
cowboygneox/boto3_type_annotations
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
[ "MIT" ]
11
2019-05-06T05:26:51.000Z
2021-09-28T15:27:59.000Z
from typing import Dict from typing import List from botocore.waiter import Waiter class AppExists(Waiter): def wait(self, StackId: str = None, AppIds: List = None, WaiterConfig: Dict = None): pass class DeploymentSuccessful(Waiter): def wait(self, StackId: str = None, AppId: str = None, DeploymentIds: List = None, WaiterConfig: Dict = None): pass class InstanceOnline(Waiter): def wait(self, StackId: str = None, LayerId: str = None, InstanceIds: List = None, WaiterConfig: Dict = None): pass class InstanceRegistered(Waiter): def wait(self, StackId: str = None, LayerId: str = None, InstanceIds: List = None, WaiterConfig: Dict = None): pass class InstanceStopped(Waiter): def wait(self, StackId: str = None, LayerId: str = None, InstanceIds: List = None, WaiterConfig: Dict = None): pass class InstanceTerminated(Waiter): def wait(self, StackId: str = None, LayerId: str = None, InstanceIds: List = None, WaiterConfig: Dict = None): pass
30.205882
114
0.684518
124
1,027
5.669355
0.217742
0.109531
0.110953
0.145092
0.715505
0.715505
0.715505
0.522048
0.522048
0.522048
0
0
0.212269
1,027
33
115
31.121212
0.868974
0
0
0.47619
0
0
0
0
0
0
0
0
0
1
0.285714
false
0.285714
0.142857
0
0.714286
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
968515ced5e758da6ca98e12e7cb521b52ceecef
167
py
Python
products/admin.py
Marlinekhavele/shop
3d8717cdeea41140d3a00342cd190832fbfc9d0f
[ "Unlicense" ]
null
null
null
products/admin.py
Marlinekhavele/shop
3d8717cdeea41140d3a00342cd190832fbfc9d0f
[ "Unlicense" ]
null
null
null
products/admin.py
Marlinekhavele/shop
3d8717cdeea41140d3a00342cd190832fbfc9d0f
[ "Unlicense" ]
null
null
null
from django.contrib import admin from .models import (ProductSize,Product) # Register your models here. admin.site.register(ProductSize) admin.site.register(Product)
23.857143
41
0.814371
22
167
6.181818
0.545455
0.132353
0.25
0
0
0
0
0
0
0
0
0
0.095808
167
7
42
23.857143
0.900662
0.155689
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
968d72381c29c737400868a781691068708e1cc1
42
py
Python
CIFAR_10/models/__init__.py
wd-doylle/NeuronClustering
910bae6a9c7c445dc0428b2102e9f2ecbdbad6f0
[ "BSD-3-Clause" ]
40
2018-03-15T02:49:08.000Z
2021-12-20T14:01:14.000Z
CIFAR_10/models/__init__.py
wd-doylle/NeuronClustering
910bae6a9c7c445dc0428b2102e9f2ecbdbad6f0
[ "BSD-3-Clause" ]
2
2018-05-10T05:15:04.000Z
2018-11-06T12:41:04.000Z
CIFAR_10/models/__init__.py
wd-doylle/NeuronClustering
910bae6a9c7c445dc0428b2102e9f2ecbdbad6f0
[ "BSD-3-Clause" ]
17
2018-03-14T21:24:01.000Z
2021-07-04T00:27:21.000Z
from .ConvNet import * from .NIN import *
14
22
0.714286
6
42
5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.190476
42
2
23
21
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
96a42aba8e41b987f56ae9fdf4f22534b9fda220
37
py
Python
example_processing/meld/emissor/plugins/meld/__init__.py
cltl/GMRCAnnotation
cc4c7f0c9cbbce0eb6c7dee4d39d128f91b85839
[ "MIT" ]
null
null
null
example_processing/meld/emissor/plugins/meld/__init__.py
cltl/GMRCAnnotation
cc4c7f0c9cbbce0eb6c7dee4d39d128f91b85839
[ "MIT" ]
18
2021-01-12T15:18:07.000Z
2021-03-23T12:30:57.000Z
example_processing/meld/emissor/plugins/meld/__init__.py
cltl/EMISSOR
68504c859c36b1b65b2c0002d065028b3d5b5d08
[ "MIT" ]
null
null
null
from .plugin import MeldExamplePlugin
37
37
0.891892
4
37
8.25
1
0
0
0
0
0
0
0
0
0
0
0
0.081081
37
1
37
37
0.970588
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
96b3e4063b6874d8076513e648232664229f3fa7
2,783
py
Python
apis/ping_app.py
erwan-lemonnier/klue-microservice-helloworld
df1346e6c42c9f11c41d50653a5b46ea5c6cd2a4
[ "BSD-2-Clause" ]
null
null
null
apis/ping_app.py
erwan-lemonnier/klue-microservice-helloworld
df1346e6c42c9f11c41d50653a5b46ea5c6cd2a4
[ "BSD-2-Clause" ]
null
null
null
apis/ping_app.py
erwan-lemonnier/klue-microservice-helloworld
df1346e6c42c9f11c41d50653a5b46ea5c6cd2a4
[ "BSD-2-Clause" ]
null
null
null
# This is an auto-generated file - DO NOT EDIT!!! from flask_cors import cross_origin from typing import Optional from pydantic import BaseModel from pymacaron.endpoint import pymacaron_flask_endpoint from pymacaron.log import pymlogger log = pymlogger(__name__) def load_endpoints(app=None, error_callback=None): from pymacaron import apipool from pymacaron.api import do_ping as f_pymacaron_api_do_ping from pymacaron.api import do_version as f_pymacaron_api_do_version from pymacaron.api import do_version as f_pymacaron_api_do_version_via_requires_auth from pymacaron.auth import requires_auth f_pymacaron_api_do_version_via_requires_auth = requires_auth(f_pymacaron_api_do_version_via_requires_auth) @app.route("/ping", methods=["GET"]) @cross_origin(headers=["Content-Type", "Authorization"]) def endpoint_get__ping(): return pymacaron_flask_endpoint( api_name="ping", f=f_pymacaron_api_do_ping, path_args={ }, form_args={ }, body_model_name=None, query_model=None, produces="application/json", result_models=[ apipool.ping.Ok, apipool.ping.Error, ], error_callback=error_callback, ) log.info("Binding [ping] GET /ping ==> pymacaron.api.do_ping") @app.route("/version", methods=["GET"]) @cross_origin(headers=["Content-Type", "Authorization"]) def endpoint_get__version(): return pymacaron_flask_endpoint( api_name="ping", f=f_pymacaron_api_do_version, path_args={ }, form_args={ }, body_model_name=None, query_model=None, produces="application/json", result_models=[ apipool.ping.Version, apipool.ping.Error, ], error_callback=error_callback, ) log.info("Binding [ping] GET /version ==> pymacaron.api.do_version") @app.route("/auth/version", methods=["GET"]) @cross_origin(headers=["Content-Type", "Authorization"]) def endpoint_get__auth_version(): return pymacaron_flask_endpoint( api_name="ping", f=f_pymacaron_api_do_version_via_requires_auth, path_args={ }, form_args={ }, body_model_name=None, query_model=None, produces="application/json", result_models=[ apipool.ping.Version, apipool.ping.Error, ], error_callback=error_callback, ) log.info("Binding [ping] GET /auth/version ==> pymacaron.api.do_version")
31.625
110
0.614445
311
2,783
5.151125
0.199357
0.104869
0.09613
0.074906
0.76779
0.702247
0.702247
0.702247
0.683521
0.683521
0
0
0.292131
2,783
87
111
31.988506
0.813198
0.016888
0
0.520548
1
0
0.123263
0.025238
0
0
0
0
0
1
0.054795
false
0
0.136986
0.041096
0.232877
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
96bd2f9f764f169165c9a69c61292f823b044db0
86
py
Python
psi/controller/devices/api.py
bburan/psiexperiment
9b70f7f0b4a4379d8c3fc463e1df272153afd247
[ "MIT" ]
5
2016-05-26T13:46:00.000Z
2020-03-03T13:07:47.000Z
psi/controller/devices/api.py
bburan/psiexperiment
9b70f7f0b4a4379d8c3fc463e1df272153afd247
[ "MIT" ]
2
2018-04-17T15:06:35.000Z
2019-03-25T18:13:10.000Z
psi/controller/devices/api.py
psiexperiment/psiexperiment
2701558e1d0637b8a5d6762912dfb5c183f3be87
[ "MIT" ]
3
2020-04-17T15:03:36.000Z
2022-01-14T23:19:29.000Z
import enaml with enaml.imports(): from .pellet_dispenser import PelletDispenser
17.2
49
0.790698
10
86
6.7
0.8
0
0
0
0
0
0
0
0
0
0
0
0.151163
86
4
50
21.5
0.917808
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
739cb7f958019b8b060beca3b8553e3015da604c
1,950
py
Python
dags/kd01-dags/factor-analysis-test-task.py
ywf5566/airflow
e7872dddbf275729b2c42e2a4ff602a6df7d1536
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
null
null
null
dags/kd01-dags/factor-analysis-test-task.py
ywf5566/airflow
e7872dddbf275729b2c42e2a4ff602a6df7d1536
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
null
null
null
dags/kd01-dags/factor-analysis-test-task.py
ywf5566/airflow
e7872dddbf275729b2c42e2a4ff602a6df7d1536
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from airflow import DAG from airflow.operators.bash_operator import BashOperator from datetime import datetime default_args = { 'owner': 'afroot01' } dag = DAG( 'factor-analysis-test-task', default_args=default_args, description='factor-analysis-test-task', schedule_interval=None, start_date=datetime(2020, 12, 16) ) # ==========================================================tasks====================================================== fac_daily_kd_deap_factor_1196 = BashOperator(task_id="fac_daily_kd_deap_factor_1196", bash_command="sh /usr/lib/quant/factor/factor-analysis/factor_analysis_service/tool/factor_analysis.sh 3057145 ", dag=dag) fac_daily_kd_deap_factor_1156 = BashOperator(task_id="fac_daily_kd_deap_factor_1156", bash_command="sh /usr/lib/quant/factor/factor-analysis/factor_analysis_service/tool/factor_analysis.sh 3057105 ", dag=dag) fac_daily_kd_deap_factor_1157 = BashOperator(task_id="fac_daily_kd_deap_factor_1157", bash_command="sh /usr/lib/quant/factor/factor-analysis/factor_analysis_service/tool/factor_analysis.sh 3057106 ", dag=dag) fac_daily_kd_deap_factor_1182 = BashOperator(task_id="fac_daily_kd_deap_factor_1182", bash_command="sh /usr/lib/quant/factor/factor-analysis/factor_analysis_service/tool/factor_analysis.sh 3057131 ", dag=dag) fac_daily_kd_deap_factor_1178 = BashOperator(task_id="fac_daily_kd_deap_factor_1178", bash_command="sh /usr/lib/quant/factor/factor-analysis/factor_analysis_service/tool/factor_analysis.sh 3057127 ", dag=dag) fac_daily_kd_deap_factor_1165 = BashOperator(task_id="fac_daily_kd_deap_factor_1165", bash_command="sh /usr/lib/quant/factor/factor-analysis/factor_analysis_service/tool/factor_analysis.sh 3057114 ", dag=dag) fac_daily_kd_deap_factor_1166 = BashOperator(task_id="fac_daily_kd_deap_factor_1166", bash_command="sh /usr/lib/quant/factor/factor-analysis/factor_analysis_service/tool/factor_analysis.sh 3057115 ", dag=dag)
81.25
208
0.780513
285
1,950
4.950877
0.196491
0.228207
0.09922
0.138909
0.774628
0.774628
0.720765
0.610206
0.421687
0.421687
0
0.063284
0.06
1,950
23
209
84.782609
0.706492
0.071282
0
0
0
0.35
0.522677
0.469027
0
0
0
0
0
1
0
false
0
0.15
0
0.15
0
0
0
0
null
1
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
73afdd033827fb68a101a374d6f2e3e4dcf4af78
39
py
Python
poco/services/batch/similarity_calculation/upload_item_similarities_result.py
sunliwen/poco
a4b8c4ede63711eea42a444fb9d922c350855364
[ "MIT" ]
null
null
null
poco/services/batch/similarity_calculation/upload_item_similarities_result.py
sunliwen/poco
a4b8c4ede63711eea42a444fb9d922c350855364
[ "MIT" ]
7
2019-03-22T06:26:39.000Z
2021-06-10T19:36:06.000Z
poco/services/batch/similarity_calculation/upload_item_similarities_result.py
sunliwen/poco
a4b8c4ede63711eea42a444fb9d922c350855364
[ "MIT" ]
1
2017-10-25T03:43:51.000Z
2017-10-25T03:43:51.000Z
import sys from common import utils
6.5
24
0.769231
6
39
5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.230769
39
5
25
7.8
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
73f7fb750a58a9e2598dfad1b291342caab922ad
47
py
Python
compilerTest.py
malakhajji565/Ozobot-Python
97ff7324039b0402fcdc4cd1c9ad05eddc5735ac
[ "MIT" ]
null
null
null
compilerTest.py
malakhajji565/Ozobot-Python
97ff7324039b0402fcdc4cd1c9ad05eddc5735ac
[ "MIT" ]
null
null
null
compilerTest.py
malakhajji565/Ozobot-Python
97ff7324039b0402fcdc4cd1c9ad05eddc5735ac
[ "MIT" ]
null
null
null
import ozopython ozopython.run("mycode.ozopy")
15.666667
29
0.808511
6
47
6.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.06383
47
3
29
15.666667
0.863636
0
0
0
0
0
0.25
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
fb758c4d1c722fcd2216be17ad6ed786e47e115c
47
py
Python
deep_nilmtk/models/tensorflow/__init__.py
DBRTII/Deep-NILMtk
cf6c50ec9891c17f9c626e23c0e1b6f488fefcb3
[ "MIT" ]
1
2022-03-18T08:56:18.000Z
2022-03-18T08:56:18.000Z
deep_nilmtk/models/tensorflow/__init__.py
DBRTII/Deep-NILMtk
cf6c50ec9891c17f9c626e23c0e1b6f488fefcb3
[ "MIT" ]
null
null
null
deep_nilmtk/models/tensorflow/__init__.py
DBRTII/Deep-NILMtk
cf6c50ec9891c17f9c626e23c0e1b6f488fefcb3
[ "MIT" ]
null
null
null
from .seq2seq import * from .seq2point import *
23.5
24
0.765957
6
47
6
0.666667
0
0
0
0
0
0
0
0
0
0
0.05
0.148936
47
2
24
23.5
0.85
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
fb81b5563cd105cebee23dcc298a8783b2e0528c
190
py
Python
utils/log.py
JackonYang/django2-python3-docker-tmpl
23c055be9f1d4e3cb90fae8267e98b4b9c0be0c9
[ "MIT" ]
7
2018-12-12T22:19:52.000Z
2021-01-15T12:52:13.000Z
utils/log.py
JackonYang/django2-python3-docker-tmpl
23c055be9f1d4e3cb90fae8267e98b4b9c0be0c9
[ "MIT" ]
1
2021-12-04T08:59:00.000Z
2021-12-07T11:20:18.000Z
projects/writer-infra-2021/utils/log.py
JackonYang/projects-in-one
edca9a313bfc80ddd5c1ca20cdfb0e0a12f8fc62
[ "MIT" ]
1
2021-01-15T12:51:27.000Z
2021-01-15T12:51:27.000Z
# -*- coding: utf-8 -*- import logging from django.conf import settings class RequireRollbarEnabled(logging.Filter): def filter(self, record): return settings.ROLLBAR_ENABLED
19
44
0.726316
22
190
6.227273
0.818182
0
0
0
0
0
0
0
0
0
0
0.006369
0.173684
190
9
45
21.111111
0.866242
0.110526
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.4
0.2
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
5
fbbef82ecf88f0ee76c4a697ea2b31ff2157bdbf
367
gyp
Python
library/boost-math/1.57.0.gyp
KjellSchubert/bru
dd70b721d07fbd27c57c845cc3a29cd8f2dfc587
[ "MIT" ]
3
2015-01-06T15:22:16.000Z
2015-11-27T18:13:04.000Z
library/boost-math/1.57.0.gyp
KjellSchubert/bru
dd70b721d07fbd27c57c845cc3a29cd8f2dfc587
[ "MIT" ]
7
2015-02-10T15:13:38.000Z
2021-05-30T07:51:13.000Z
library/boost-math/1.57.0.gyp
KjellSchubert/bru
dd70b721d07fbd27c57c845cc3a29cd8f2dfc587
[ "MIT" ]
3
2015-01-29T17:19:53.000Z
2016-01-06T12:50:06.000Z
{ "targets": [ { "target_name": "boost-math", "type": "none", "dependencies": [ "../boost-lexical_cast-math/boost-lexical_cast-math.gyp:*" ], "export_dependent_settings": [ "../boost-lexical_cast-math/boost-lexical_cast-math.gyp:*" ] } ] }
26.214286
74
0.441417
29
367
5.344828
0.482759
0.309677
0.412903
0.516129
0.554839
0.554839
0.554839
0.554839
0.554839
0
0
0
0.39782
367
14
75
26.214286
0.701357
0
0
0.142857
0
0
0.502717
0.372283
0
0
0
0
0
1
0
true
0
0
0
0
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
0
1
0
0
0
0
0
0
5
83a9fa9512fbdc47b22c0e086b6ae4e6d9cf3224
3,308
py
Python
blockcypher/__init__.py
ab77/blockcypher-python
3849979b73f51214bf84da022113ae89bc0a75d7
[ "Apache-2.0" ]
190
2015-02-04T23:29:59.000Z
2022-03-30T12:43:07.000Z
blockcypher/__init__.py
artemkoval1994/BTC-WALLET-GENERATOR
1e9da17fc76b3fa0cb2f6fef5e8e93cee8b8842a
[ "Apache-2.0" ]
76
2015-01-05T06:07:55.000Z
2021-09-19T20:36:34.000Z
blockcypher/__init__.py
artemkoval1994/BTC-WALLET-GENERATOR
1e9da17fc76b3fa0cb2f6fef5e8e93cee8b8842a
[ "Apache-2.0" ]
112
2015-01-30T05:13:51.000Z
2022-03-14T23:28:43.000Z
# Not DRY, but best compromise for removing the learning curve for the library """ With this you can write code like the following: >>> import blockcypher >>> blockcypher.get_latest_block_height() """ # Main methods used from .api import get_token_info from .api import get_address_details from .api import get_addresses_details from .api import get_address_overview from .api import get_address_full from .api import get_transaction_details from .api import get_transactions_details from .api import get_block_overview from .api import get_blocks_overview from .api import get_block_details from .api import get_blockchain_overview from .api import get_blockchain_fee_estimates from .api import get_blockchain_high_fee from .api import get_blockchain_medium_fee from .api import get_blockchain_low_fee from .api import get_latest_block_height from .api import get_latest_block_hash from .api import get_total_balance from .api import get_unconfirmed_balance from .api import get_confirmed_balance from .api import get_num_confirmed_transactions from .api import get_num_unconfirmed_transactions from .api import get_total_num_transactions from .api import generate_new_address from .api import derive_hd_address from .api import get_num_confirmations from .api import get_confidence from .api import get_miner_preference from .api import get_receive_count from .api import get_satoshis_transacted from .api import get_satoshis_in_fees from .api import get_merkle_root from .api import get_bits from .api import get_nonce from .api import get_prev_block_hash from .api import get_block_hash from .api import get_block_height from .api import get_broadcast_transactions from .api import get_broadcast_transaction_hashes from .api import subscribe_to_address_webhook from .api import subscribe_to_wallet_webhook from .api import list_webhooks from .api import get_webhook_info from .api import unsubscribe_from_webhook from .api import pushtx from .api import decodetx from .api import get_forwarding_address from .api import create_forwarding_address from .api import create_forwarding_address_with_details from .api import get_forwarding_address_details from .api import list_forwarding_addresses from .api import delete_forwarding_address from .api import send_faucet_coins from .api import list_wallet_names from .api import create_wallet_from_address from .api import create_hd_wallet from .api import get_wallet_addresses from .api import get_wallet_balance from .api import get_wallet_transactions from .api import get_latest_paths_from_hd_wallet_addresses from .api import add_address_to_wallet from .api import remove_address_from_wallet from .api import delete_wallet from .api import generate_multisig_address from .api import create_unsigned_tx from .api import verify_unsigned_tx from .api import get_input_addresses from .api import make_tx_signatures from .api import broadcast_signed_transaction from .api import simple_spend from .api import simple_spend_p2sh from .api import embed_data from .api import get_metadata from .api import put_metadata from .api import delete_metadata from .utils import from_base_unit from .utils import satoshis_to_btc from .utils import wei_to_ether from .utils import is_valid_hash from .utils import is_valid_address from .utils import is_valid_eth_address
36.351648
78
0.860943
529
3,308
5.05104
0.219282
0.196482
0.364895
0.275449
0.514596
0.132111
0.053892
0.033308
0
0
0
0.000339
0.108827
3,308
90
79
36.755556
0.906038
0.06318
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f7c2d6d8f2a710055da1433ebd8768102e770332
92
py
Python
src/robots/concurrency/__init__.py
severin-lemaignan/pyrobots
d5dd3bd54375e85802de7225556ad519b8b4e89d
[ "0BSD" ]
11
2017-03-06T17:19:59.000Z
2021-11-04T07:45:33.000Z
src/robots/concurrency/__init__.py
severin-lemaignan/pyrobots
d5dd3bd54375e85802de7225556ad519b8b4e89d
[ "0BSD" ]
2
2018-08-18T12:43:47.000Z
2019-04-23T13:03:26.000Z
src/robots/concurrency/__init__.py
severin-lemaignan/pyrobots
d5dd3bd54375e85802de7225556ad519b8b4e89d
[ "0BSD" ]
3
2018-04-24T10:25:53.000Z
2021-08-25T04:34:35.000Z
# coding=utf-8 from .action import action from .concurrency import * from .signals import *
18.4
26
0.76087
13
92
5.384615
0.615385
0
0
0
0
0
0
0
0
0
0
0.012821
0.152174
92
4
27
23
0.884615
0.130435
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f7eea64af104abc6c40c0f529fe8af95a2b067db
39
py
Python
dgp/lib/__init__.py
DynamicGravitySystems/DGP
5c0b566b846eb25f1e5ede64b2caaaa6a3352a29
[ "Apache-2.0" ]
7
2017-08-15T21:51:40.000Z
2020-10-28T00:40:23.000Z
dgp/lib/__init__.py
DynamicGravitySystems/DGP
5c0b566b846eb25f1e5ede64b2caaaa6a3352a29
[ "Apache-2.0" ]
63
2017-08-11T15:12:03.000Z
2020-05-23T19:03:46.000Z
dgp/lib/__init__.py
cbertinato/DGP
5bb8a30895365eccdd452970c45e248903fca8af
[ "Apache-2.0" ]
4
2018-03-29T21:30:26.000Z
2020-10-27T20:15:23.000Z
# coding: utf-8 # lib package __init__
13
22
0.717949
6
39
4
1
0
0
0
0
0
0
0
0
0
0
0.03125
0.179487
39
2
23
19.5
0.71875
0.871795
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
f7f7d1817f4059106fc1ec05748d9b67eb5f4663
243
py
Python
loopchain/blockchain/transactions/v3/__init__.py
windies21/loopchain
6e96c8a7e006747af04187155678f2fae59e1389
[ "Apache-2.0" ]
105
2018-04-03T05:29:08.000Z
2022-01-28T17:33:20.000Z
loopchain/blockchain/transactions/v3/__init__.py
laurenceyoon/loopchain
e87032779be4715c135c2c91d2757d9c63bf4e31
[ "Apache-2.0" ]
135
2018-09-04T07:11:02.000Z
2021-12-15T06:25:47.000Z
loopchain/blockchain/transactions/v3/__init__.py
laurenceyoon/loopchain
e87032779be4715c135c2c91d2757d9c63bf4e31
[ "Apache-2.0" ]
46
2018-05-07T09:12:07.000Z
2022-02-23T09:58:37.000Z
from .transaction import Transaction, HASH_SALT from .transaction_builder import TransactionBuilder from .transaction_serializer import TransactionSerializer from .transaction_verifier import TransactionVerifier version = Transaction.version
34.714286
57
0.884774
24
243
8.791667
0.5
0.28436
0
0
0
0
0
0
0
0
0
0
0.08642
243
6
58
40.5
0.95045
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
f7fcf5be5f4ea2467d0ae6c51612ad43b19030c2
82
py
Python
core/arxiv/submission/services/stream/__init__.py
NeolithEra/arxiv-submission-core
d4f20be62a882d2d5f3d1584eda69e7d90ca2c12
[ "MIT" ]
14
2019-05-26T22:52:17.000Z
2021-11-05T12:26:46.000Z
core/arxiv/submission/services/stream/__init__.py
NeolithEra/arxiv-submission-core
d4f20be62a882d2d5f3d1584eda69e7d90ca2c12
[ "MIT" ]
30
2018-01-31T19:16:08.000Z
2018-12-08T08:41:04.000Z
core/arxiv/submission/services/stream/__init__.py
NeolithEra/arxiv-submission-core
d4f20be62a882d2d5f3d1584eda69e7d90ca2c12
[ "MIT" ]
8
2019-01-10T22:01:39.000Z
2021-11-20T21:44:51.000Z
"""Emits events to the submission stream.""" from .stream import StreamPublisher
20.5
44
0.768293
10
82
6.3
0.9
0
0
0
0
0
0
0
0
0
0
0
0.134146
82
3
45
27.333333
0.887324
0.463415
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
792c3a2dab0c7b7220b5a30f908335dfc4d7c0d5
18,354
py
Python
tests/integration/test_async_http_client.py
kevinheavey/solana-py
f74631188ebfcdd7d94d0be50c85bf5ebd47485c
[ "MIT" ]
null
null
null
tests/integration/test_async_http_client.py
kevinheavey/solana-py
f74631188ebfcdd7d94d0be50c85bf5ebd47485c
[ "MIT" ]
null
null
null
tests/integration/test_async_http_client.py
kevinheavey/solana-py
f74631188ebfcdd7d94d0be50c85bf5ebd47485c
[ "MIT" ]
null
null
null
"""Tests for the HTTP API Client.""" import pytest import solana.system_program as sp from solana.rpc.api import DataSliceOpt from solana.rpc.async_api import AsyncClient from solana.keypair import Keypair from solana.rpc.core import RPCException from solana.rpc.types import RPCError from solana.transaction import Transaction from solana.rpc.commitment import Finalized from spl.token.constants import WRAPPED_SOL_MINT from .utils import AIRDROP_AMOUNT, assert_valid_response @pytest.mark.integration @pytest.mark.asyncio async def test_request_air_drop(async_stubbed_sender: Keypair, test_http_client_async: AsyncClient): """Test air drop to async_stubbed_sender.""" resp = await test_http_client_async.request_airdrop(async_stubbed_sender.public_key, AIRDROP_AMOUNT) assert_valid_response(resp) await test_http_client_async.confirm_transaction(resp["result"]) balance = await test_http_client_async.get_balance(async_stubbed_sender.public_key) assert balance["result"]["value"] == AIRDROP_AMOUNT @pytest.mark.integration @pytest.mark.asyncio async def test_request_air_drop_prefetched_blockhash(async_stubbed_sender_prefetched_blockhash, test_http_client_async): """Test air drop to async_stubbed_sender.""" resp = await test_http_client_async.request_airdrop( async_stubbed_sender_prefetched_blockhash.public_key, AIRDROP_AMOUNT ) assert_valid_response(resp) await test_http_client_async.confirm_transaction(resp["result"]) balance = await test_http_client_async.get_balance(async_stubbed_sender_prefetched_blockhash.public_key) assert balance["result"]["value"] == AIRDROP_AMOUNT @pytest.mark.integration @pytest.mark.asyncio async def test_request_air_drop_cached_blockhash( async_stubbed_sender_cached_blockhash, test_http_client_async_cached_blockhash ): """Test air drop to async_stubbed_sender.""" resp = await test_http_client_async_cached_blockhash.request_airdrop( async_stubbed_sender_cached_blockhash.public_key, AIRDROP_AMOUNT ) assert_valid_response(resp) await test_http_client_async_cached_blockhash.confirm_transaction(resp["result"]) balance = await test_http_client_async_cached_blockhash.get_balance( async_stubbed_sender_cached_blockhash.public_key ) assert balance["result"]["value"] == AIRDROP_AMOUNT @pytest.mark.integration @pytest.mark.asyncio async def test_send_invalid_transaction(test_http_client_async): """Test sending an invalid transaction to localnet.""" # Create transfer tx to transfer lamports from stubbed sender to stubbed_receiver with pytest.raises(RPCException) as exc_info: await test_http_client_async.send_raw_transaction(b"foo") assert exc_info.value.args[0].keys() == RPCError.__annotations__.keys() # pylint: disable=no-member @pytest.mark.integration @pytest.mark.asyncio async def test_send_transaction_and_get_balance(async_stubbed_sender, async_stubbed_receiver, test_http_client_async): """Test sending a transaction to localnet.""" # Create transfer tx to transfer lamports from stubbed sender to async_stubbed_receiver transfer_tx = Transaction().add( sp.transfer( sp.TransferParams( from_pubkey=async_stubbed_sender.public_key, to_pubkey=async_stubbed_receiver, lamports=1000 ) ) ) resp = await test_http_client_async.send_transaction(transfer_tx, async_stubbed_sender) assert_valid_response(resp) # Confirm transaction await test_http_client_async.confirm_transaction(resp["result"]) # Check balances resp = await test_http_client_async.get_balance(async_stubbed_sender.public_key) assert_valid_response(resp) assert resp["result"]["value"] == 9999994000 resp = await test_http_client_async.get_balance(async_stubbed_receiver) assert_valid_response(resp) assert resp["result"]["value"] == 954 @pytest.mark.integration @pytest.mark.asyncio async def test_send_transaction_prefetched_blockhash( async_stubbed_sender_prefetched_blockhash, async_stubbed_receiver_prefetched_blockhash, test_http_client_async ): """Test sending a transaction to localnet.""" # Create transfer tx to transfer lamports from stubbed sender to async_stubbed_receiver transfer_tx = Transaction().add( sp.transfer( sp.TransferParams( from_pubkey=async_stubbed_sender_prefetched_blockhash.public_key, to_pubkey=async_stubbed_receiver_prefetched_blockhash, lamports=1000, ) ) ) resp = await test_http_client_async.send_transaction(transfer_tx, async_stubbed_sender_prefetched_blockhash) assert_valid_response(resp) # Confirm transaction await test_http_client_async.confirm_transaction(resp["result"]) # Check balances resp = await test_http_client_async.get_balance(async_stubbed_sender_prefetched_blockhash.public_key) assert_valid_response(resp) assert resp["result"]["value"] == 9999994000 resp = await test_http_client_async.get_balance(async_stubbed_receiver_prefetched_blockhash) assert_valid_response(resp) assert resp["result"]["value"] == 954 @pytest.mark.integration @pytest.mark.asyncio async def test_send_transaction_cached_blockhash( async_stubbed_sender_cached_blockhash, async_stubbed_receiver_cached_blockhash, test_http_client_async_cached_blockhash, ): """Test sending a transaction to localnet.""" # Create transfer tx to transfer lamports from stubbed sender to stubbed_receiver transfer_tx = Transaction().add( sp.transfer( sp.TransferParams( from_pubkey=async_stubbed_sender_cached_blockhash.public_key, to_pubkey=async_stubbed_receiver_cached_blockhash, lamports=1000, ) ) ) assert len(test_http_client_async_cached_blockhash.blockhash_cache.unused_blockhashes) == 0 assert len(test_http_client_async_cached_blockhash.blockhash_cache.used_blockhashes) == 0 resp = await test_http_client_async_cached_blockhash.send_transaction( transfer_tx, async_stubbed_sender_cached_blockhash ) # we could have got a new blockhash or not depending on network latency and luck assert len(test_http_client_async_cached_blockhash.blockhash_cache.unused_blockhashes) in (0, 1) assert len(test_http_client_async_cached_blockhash.blockhash_cache.used_blockhashes) == 1 assert_valid_response(resp) # Confirm transaction await test_http_client_async_cached_blockhash.confirm_transaction(resp["result"]) # Check balances resp = await test_http_client_async_cached_blockhash.get_balance(async_stubbed_sender_cached_blockhash.public_key) assert_valid_response(resp) assert resp["result"]["value"] == 9999994000 # Second transaction transfer_tx = Transaction().add( sp.transfer( sp.TransferParams( from_pubkey=async_stubbed_sender_cached_blockhash.public_key, to_pubkey=async_stubbed_receiver_cached_blockhash, lamports=2000, ) ) ) resp = await test_http_client_async_cached_blockhash.get_balance(async_stubbed_receiver_cached_blockhash) assert_valid_response(resp) assert resp["result"]["value"] == 954 resp = await test_http_client_async_cached_blockhash.send_transaction( transfer_tx, async_stubbed_sender_cached_blockhash ) # we could have got a new blockhash or not depending on network latency and luck assert len(test_http_client_async_cached_blockhash.blockhash_cache.unused_blockhashes) in (0, 1) assert len(test_http_client_async_cached_blockhash.blockhash_cache.used_blockhashes) in (1, 2) assert_valid_response(resp) # Confirm transaction resp = await test_http_client_async_cached_blockhash.confirm_transaction(resp["result"]) # Check balances resp = await test_http_client_async_cached_blockhash.get_balance(async_stubbed_sender_cached_blockhash.public_key) assert_valid_response(resp) assert resp["result"]["value"] == 9999987000 @pytest.mark.integration @pytest.mark.asyncio async def test_send_raw_transaction_and_get_balance( async_stubbed_sender, async_stubbed_receiver, test_http_client_async ): """Test sending a raw transaction to localnet.""" # Get a recent blockhash resp = await test_http_client_async.get_recent_blockhash(Finalized) assert_valid_response(resp) recent_blockhash = resp["result"]["value"]["blockhash"] # Create transfer tx transfer lamports from stubbed sender to async_stubbed_receiver transfer_tx = Transaction(recent_blockhash=recent_blockhash).add( sp.transfer( sp.TransferParams( from_pubkey=async_stubbed_sender.public_key, to_pubkey=async_stubbed_receiver, lamports=1000 ) ) ) # Sign transaction transfer_tx.sign(async_stubbed_sender) # Send raw transaction resp = await test_http_client_async.send_raw_transaction(transfer_tx.serialize()) assert_valid_response(resp) # Confirm transaction resp = await test_http_client_async.confirm_transaction(resp["result"]) # Check balances resp = await test_http_client_async.get_balance(async_stubbed_sender.public_key) assert_valid_response(resp) assert resp["result"]["value"] == 9999988000 resp = await test_http_client_async.get_balance(async_stubbed_receiver) assert_valid_response(resp) assert resp["result"]["value"] == 1954 @pytest.mark.integration @pytest.mark.asyncio async def test_confirm_bad_signature(test_http_client_async: AsyncClient) -> None: """Test that RPCException is raised when trying to confirm an invalid signature.""" with pytest.raises(RPCException) as exc_info: await test_http_client_async.confirm_transaction("foo") err_object = exc_info.value.args[0] assert err_object == {"code": -32602, "message": "Invalid param: WrongSize"} @pytest.mark.integration @pytest.mark.asyncio async def test_get_block_commitment(test_http_client_async): """Test get block commitment.""" resp = await test_http_client_async.get_block_commitment(5) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_block_time(test_http_client_async): """Test get block time.""" resp = await test_http_client_async.get_block_time(5) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_cluster_nodes(test_http_client_async): """Test get cluster nodes.""" resp = await test_http_client_async.get_cluster_nodes() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_confirmed_block(test_http_client_async): """Test get confirmed block.""" resp = await test_http_client_async.get_confirmed_block(1) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_confirmed_block_with_encoding(test_http_client_async): """Test get confrimed block with encoding.""" resp = await test_http_client_async.get_confirmed_block(1, encoding="base64") assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_confirmed_blocks(test_http_client_async): """Test get confirmed blocks.""" resp = await test_http_client_async.get_confirmed_blocks(5, 10) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_confirmed_signature_for_address2(test_http_client_async): """Test get confirmed signature for address2.""" resp = await test_http_client_async.get_confirmed_signature_for_address2( "Vote111111111111111111111111111111111111111", limit=1 ) assert_valid_response(resp) # TODO(michael): This RPC call is only available in solana-core v1.7 or newer. # @pytest.mark.integration # @pytest.mark.asyncio # async def test_get_signatures_for_address(test_http_client_async_async): # """Test get signatures for addresses.""" # resp = await test_http_client_async_async.get_signatures_for_address( # "Vote111111111111111111111111111111111111111", limit=1 # ) # assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_epoch_info(test_http_client_async): """Test get epoch info.""" resp = await test_http_client_async.get_epoch_info() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_epoch_schedule(test_http_client_async): """Test get epoch schedule.""" resp = await test_http_client_async.get_epoch_schedule() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_fee_calculator_for_blockhash(test_http_client_async): """Test get fee calculator for blockhash.""" resp = await test_http_client_async.get_recent_blockhash(Finalized) assert_valid_response(resp) resp = await test_http_client_async.get_fee_calculator_for_blockhash(resp["result"]["value"]["blockhash"]) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_slot(test_http_client_async): """Test get slot.""" resp = await test_http_client_async.get_slot() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_fees(test_http_client_async): """Test get fees.""" resp = await test_http_client_async.get_fees() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_first_available_block(test_http_client_async): """Test get first available block.""" resp = await test_http_client_async.get_first_available_block() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_genesis_hash(test_http_client_async): """Test get genesis hash.""" resp = await test_http_client_async.get_genesis_hash() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_identity(test_http_client_async): """Test get identity.""" resp = await test_http_client_async.get_genesis_hash() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_inflation_governor(test_http_client_async): """Test get inflation governor.""" resp = await test_http_client_async.get_inflation_governor() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_inflation_rate(test_http_client_async): """Test get inflation rate.""" resp = await test_http_client_async.get_inflation_rate() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_largest_accounts(test_http_client_async): """Test get largest accounts.""" resp = await test_http_client_async.get_largest_accounts() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_leader_schedule(test_http_client_async): """Test get leader schedule.""" resp = await test_http_client_async.get_leader_schedule() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_minimum_balance_for_rent_exemption(test_http_client_async): """Test get minimum balance for rent exemption.""" resp = await test_http_client_async.get_minimum_balance_for_rent_exemption(50) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_slot_leader(test_http_client_async): """Test get slot leader.""" resp = await test_http_client_async.get_slot_leader() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_supply(test_http_client_async): """Test get slot leader.""" resp = await test_http_client_async.get_supply() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_token_largest_accounts(test_http_client_async): """Test get token largest accounts.""" resp = await test_http_client_async.get_token_largest_accounts(WRAPPED_SOL_MINT) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_token_supply(test_http_client_async): """Test get token supply.""" resp = await test_http_client_async.get_token_supply(WRAPPED_SOL_MINT) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_transaction_count(test_http_client_async): """Test get transactinon count.""" resp = await test_http_client_async.get_transaction_count() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_version(test_http_client_async): """Test get version.""" resp = await test_http_client_async.get_version() assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_account_info(async_stubbed_sender, test_http_client_async): """Test get_account_info.""" resp = await test_http_client_async.get_account_info(async_stubbed_sender.public_key) assert_valid_response(resp) resp = await test_http_client_async.get_account_info(async_stubbed_sender.public_key, encoding="jsonParsed") assert_valid_response(resp) resp = await test_http_client_async.get_account_info(async_stubbed_sender.public_key, data_slice=DataSliceOpt(1, 1)) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_multiple_accounts(async_stubbed_sender, test_http_client_async): """Test get_multiple_accounts.""" pubkeys = [async_stubbed_sender.public_key] * 2 resp = await test_http_client_async.get_multiple_accounts(pubkeys) assert_valid_response(resp) resp = await test_http_client_async.get_multiple_accounts(pubkeys, encoding="jsonParsed") assert_valid_response(resp) resp = await test_http_client_async.get_multiple_accounts(pubkeys, data_slice=DataSliceOpt(1, 1)) assert_valid_response(resp) @pytest.mark.integration @pytest.mark.asyncio async def test_get_vote_accounts(test_http_client_async): """Test get vote accounts.""" resp = await test_http_client_async.get_vote_accounts() assert_valid_response(resp)
38.078838
120
0.780484
2,435
18,354
5.485832
0.080493
0.066477
0.116335
0.157883
0.892125
0.861431
0.826621
0.741728
0.687678
0.663123
0
0.012649
0.138498
18,354
481
121
38.158004
0.832153
0.070884
0
0.564955
0
0
0.021089
0.002748
0
0
0
0.002079
0.220544
1
0
false
0
0.033233
0
0.033233
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7936a8786af8bba2b50adf0aa9f93a95251b40f1
2,827
py
Python
tests/test_authentication.py
KaiPrince/AWF-FinalProject
c6d1eb8341d0116466c8d17969184492888ba6ae
[ "MIT" ]
null
null
null
tests/test_authentication.py
KaiPrince/AWF-FinalProject
c6d1eb8341d0116466c8d17969184492888ba6ae
[ "MIT" ]
null
null
null
tests/test_authentication.py
KaiPrince/AWF-FinalProject
c6d1eb8341d0116466c8d17969184492888ba6ae
[ "MIT" ]
null
null
null
""" * Project Name: AWF-FinalProject * File Name: test_authentication.py * Programmer: Philip Arff * Date: Tue, Apr 20, 2021 * Description: This tests the user authentication """ def test_login(client, db, mocker): # Arrange expected_token = "xxxxx.yyyyy.zzzzz" mocker.patch("main.issue_jwt_token", new=lambda _: expected_token) # Act response = client.post( "/api/login", json={"username": "alice", "password": "simple_password"} ) # Assert assert response.status_code == 200 assert response.json() == expected_token def test_get_user_valid_auth(client): """ Calls the get user route with a valid auth token. """ # Arrange user_id = 1 token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ.RAuDG1t4uERT9Za3P4MzvLiUYAv3dtyHQBp4N45MhhA" # Act response = client.get(f"api/users/{user_id}", headers={"auth-token": token}) # Assert assert response.status_code == 200 def test_get_user_bad_auth(client): """ Calls the get user route with an invalid auth token. """ # Arrange user_id = 1 token = "bad_token" # Act response = client.get(f"api/users/{user_id}", headers={"auth-token": token}) # Assert assert response.status_code == 401 def test_delete_valid_auth(client): """ Calls the delete user route with a valid auth token. """ # Arrange user_id = 1 token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ.RAuDG1t4uERT9Za3P4MzvLiUYAv3dtyHQBp4N45MhhA" # Act response = client.delete(f"api/users/{user_id}", headers={"auth-token": token}) # Assert assert response.status_code == 200 def test_delete_bad_auth(client): """ Calls the delete user route with an invalid auth token. """ # Arrange user_id = 1 token = "bad_auth" # Act response = client.delete(f"api/users/{user_id}", headers={"auth-token": token}) # Assert assert response.status_code == 401 def test_update_valid_auth(client): """ Calls the update user route with a valid auth token. """ # Arrange user_id = 1 token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ.RAuDG1t4uERT9Za3P4MzvLiUYAv3dtyHQBp4N45MhhA" # Act response = client.put( f"api/users/{user_id}", headers={"auth-token": token}, json={"username": "alice", "password": "new_password"}, ) # Assert assert response.status_code == 200 def test_update_bad_auth(client): """ Calls the update user route with an invalid auth token. """ # Arrange user_id = 1 token = "bad_auth" # Act response = client.put( f"api/users/{user_id}", headers={"auth-token": token}, json={"username": "alice", "password": "new_password"}, ) # Assert assert response.status_code == 401
25.93578
113
0.666785
337
2,827
5.436202
0.216617
0.058952
0.064956
0.099345
0.790939
0.777838
0.776201
0.753821
0.673035
0.673035
0
0.036421
0.2133
2,827
108
114
26.175926
0.78732
0.223205
0
0.652174
0
0
0.302533
0.139306
0
0
0
0
0.173913
1
0.152174
false
0.065217
0
0
0.152174
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
f721b154eb6f80cea86ed321cc3199bcce85024f
300
py
Python
01-code-scripts/example.py
calekochenour/python-formatter-env
9cc0b484e9b8b8d17a8abe5d2f9f49af953a7790
[ "BSD-3-Clause" ]
null
null
null
01-code-scripts/example.py
calekochenour/python-formatter-env
9cc0b484e9b8b8d17a8abe5d2f9f49af953a7790
[ "BSD-3-Clause" ]
null
null
null
01-code-scripts/example.py
calekochenour/python-formatter-env
9cc0b484e9b8b8d17a8abe5d2f9f49af953a7790
[ "BSD-3-Clause" ]
null
null
null
def example_function(first_parameter, second_parameter, third_parameter, fourth_parameter, fifth_parameter): """Example function to test the code formatter.""" parameter_sum = first_parameter + second_parameter + third_parameter + fourth_parameter + fifth_parameter return parameter_sum
50
109
0.806667
35
300
6.542857
0.457143
0.131004
0.174672
0.253275
0.628821
0.628821
0.628821
0.628821
0.628821
0.628821
0
0
0.13
300
5
110
60
0.877395
0.146667
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
f72edcdbbb2b57a739aa3dd65eb9b81da1a7a756
245
py
Python
kubetools/dev/__main__.py
EDITD/kubetools
3a87ed3b233aed152af9e52a4c1d5844a9c26437
[ "MIT" ]
5
2020-04-20T21:24:14.000Z
2022-01-29T15:35:02.000Z
kubetools/dev/__main__.py
EDITD/kubetools
3a87ed3b233aed152af9e52a4c1d5844a9c26437
[ "MIT" ]
69
2019-12-17T16:16:21.000Z
2022-03-23T11:19:49.000Z
kubetools/dev/__main__.py
EDITD/kubetools
3a87ed3b233aed152af9e52a4c1d5844a9c26437
[ "MIT" ]
1
2022-01-14T04:12:15.000Z
2022-01-14T04:12:15.000Z
#!/usr/bin/env python from kubetools.dev import dev from kubetools.main import run_cli # Import click command groups from kubetools.dev import ( # noqa: F401, I100, I202 container, environment, logs, scripts, ) run_cli(dev)
15.3125
53
0.706122
34
245
5.029412
0.647059
0.22807
0.187135
0.25731
0
0
0
0
0
0
0
0.046392
0.208163
245
15
54
16.333333
0.835052
0.289796
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
0
0
5
f730942a921d93e237889ddabf84129fe2aacd58
26
py
Python
e.py
Flonky/e
0954acd82ebd74e6a433aa778a3844dc7b8acc60
[ "MIT" ]
1
2022-03-24T18:18:29.000Z
2022-03-24T18:18:29.000Z
e.py
Flonky/e
0954acd82ebd74e6a433aa778a3844dc7b8acc60
[ "MIT" ]
null
null
null
e.py
Flonky/e
0954acd82ebd74e6a433aa778a3844dc7b8acc60
[ "MIT" ]
null
null
null
while True: print("e")
13
14
0.576923
4
26
3.75
1
0
0
0
0
0
0
0
0
0
0
0
0.230769
26
2
14
13
0.75
0
0
0
0
0
0.037037
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
f73de756b772563bfb53c4366c455e3be0662e8f
141
py
Python
pandana/utils/__init__.py
HEPonHPC/pandana
8ee68071892f2a34b54a09ac54033f5d14d42019
[ "Apache-2.0" ]
2
2021-04-23T19:36:57.000Z
2021-06-30T15:57:35.000Z
pandana/utils/__init__.py
HEPonHPC/pandana
8ee68071892f2a34b54a09ac54033f5d14d42019
[ "Apache-2.0" ]
null
null
null
pandana/utils/__init__.py
HEPonHPC/pandana
8ee68071892f2a34b54a09ac54033f5d14d42019
[ "Apache-2.0" ]
null
null
null
"""Make everything from submodules appear at the top level. """ from pandana.utils.mpiutils import * from pandana.utils.pandasutils import *
28.2
59
0.780142
19
141
5.789474
0.736842
0.2
0.290909
0
0
0
0
0
0
0
0
0
0.12766
141
4
60
35.25
0.894309
0.397163
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
0
0
0
5
f7a051c864b326fba4b8d1271e63626f1239239c
122
py
Python
species/admin.py
sohansubhash/dex
7c43b3252960d1a1a2e988ccfda4b49db8b53398
[ "BSD-2-Clause" ]
null
null
null
species/admin.py
sohansubhash/dex
7c43b3252960d1a1a2e988ccfda4b49db8b53398
[ "BSD-2-Clause" ]
null
null
null
species/admin.py
sohansubhash/dex
7c43b3252960d1a1a2e988ccfda4b49db8b53398
[ "BSD-2-Clause" ]
null
null
null
from django.contrib import admin from .models import Species admin.site.register(Species) # Register your models here.
15.25
32
0.795082
17
122
5.705882
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.139344
122
7
33
17.428571
0.92381
0.213115
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e39e7670b188ecc07677a1659a59fdb60e4d6b9c
220
py
Python
App/admin.py
Aishu1412/WomenHealthCare
a972c2b12d8afe2bdb0b74a51f85dd7ad0edf39c
[ "MIT" ]
3
2018-01-07T16:42:55.000Z
2021-05-31T14:21:11.000Z
App/admin.py
Aishu1412/WomenHealthCare
a972c2b12d8afe2bdb0b74a51f85dd7ad0edf39c
[ "MIT" ]
null
null
null
App/admin.py
Aishu1412/WomenHealthCare
a972c2b12d8afe2bdb0b74a51f85dd7ad0edf39c
[ "MIT" ]
2
2017-01-02T20:39:02.000Z
2019-08-21T02:02:24.000Z
from django.contrib import admin from .models import * admin.site.register(ModelUser) admin.site.register(ModelDiscuss) admin.site.register(ModelTag) admin.site.register(ModelQuestion) admin.site.register(ModelAnswer)
22
34
0.827273
28
220
6.5
0.464286
0.247253
0.467033
0
0
0
0
0
0
0
0
0
0.068182
220
9
35
24.444444
0.887805
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.285714
0
0.285714
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
0
0
0
0
0
5
5405675a9e5e4dbee7ce862ebd5ef9103f6b9be0
252
py
Python
configs/imagenet/cosine.py
tdye24/deep-gradient-compression
f9bf3450cbadd008b0e6c3398f09e87be1c77f07
[ "Apache-2.0" ]
145
2020-06-22T15:56:12.000Z
2022-03-22T15:44:39.000Z
configs/imagenet/cosine.py
ahmedcs/deep-gradient-compression
f9aa284a3ad044e5861416168085375801649d95
[ "Apache-2.0" ]
4
2021-03-30T07:03:56.000Z
2021-11-02T13:52:19.000Z
configs/imagenet/cosine.py
ahmedcs/deep-gradient-compression
f9aa284a3ad044e5861416168085375801649d95
[ "Apache-2.0" ]
37
2020-06-23T00:21:37.000Z
2022-01-22T14:31:09.000Z
import torch from torchpack.mtpack.utils.config import Config, configs # scheduler configs.train.scheduler = Config(torch.optim.lr_scheduler.CosineAnnealingLR) configs.train.scheduler.T_max = configs.train.num_epochs - configs.train.warmup_lr_epochs
31.5
89
0.837302
34
252
6.058824
0.529412
0.23301
0.203884
0
0
0
0
0
0
0
0
0
0.075397
252
7
90
36
0.88412
0.035714
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
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
0
0
0
5
540b71b377d7a0757d4decab05756acd0e641a37
167
py
Python
xbmcdynamo/git.py
Larusso/xbmc-dynamo
cc54d7e1560d46a4629926a3460d7dddc278ab03
[ "MIT" ]
null
null
null
xbmcdynamo/git.py
Larusso/xbmc-dynamo
cc54d7e1560d46a4629926a3460d7dddc278ab03
[ "MIT" ]
null
null
null
xbmcdynamo/git.py
Larusso/xbmc-dynamo
cc54d7e1560d46a4629926a3460d7dddc278ab03
[ "MIT" ]
null
null
null
import sh def lo(): return 'Manne' def current_branch(): branch = git('symbolic-ref', '--short', '-q', 'HEAD') if branch: branch = branch.strip() return branch
16.7
54
0.646707
23
167
4.652174
0.695652
0.336449
0
0
0
0
0
0
0
0
0
0
0.167665
167
10
55
16.7
0.769784
0
0
0
0
0
0.178571
0
0
0
0
0
0
1
0.25
false
0
0.125
0.125
0.625
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
5829091fe54bdcb107204e2fa1b36ad35fd471ee
13,140
py
Python
tests/storages_tests/rdb_tests/test_models.py
rafaeldelrey/optuna
c56302ae103b5f045e42314e8f9d636aeb632ea2
[ "MIT" ]
1
2019-12-12T16:14:31.000Z
2019-12-12T16:14:31.000Z
tests/storages_tests/rdb_tests/test_models.py
Amiralae/optuna
5bc8b58876300479faf7cb172e775071419e3300
[ "MIT" ]
null
null
null
tests/storages_tests/rdb_tests/test_models.py
Amiralae/optuna
5bc8b58876300479faf7cb172e775071419e3300
[ "MIT" ]
null
null
null
from datetime import datetime import pytest from sqlalchemy import create_engine from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import Session from optuna.storages.rdb.models import BaseModel from optuna.storages.rdb.models import StudyModel from optuna.storages.rdb.models import StudySystemAttributeModel from optuna.storages.rdb.models import TrialModel from optuna.storages.rdb.models import TrialSystemAttributeModel from optuna.storages.rdb.models import TrialUserAttributeModel from optuna.storages.rdb.models import VersionInfoModel from optuna.structs import StudyDirection from optuna.structs import TrialState @pytest.fixture def session(): # type: () -> Session engine = create_engine('sqlite:///:memory:') BaseModel.metadata.create_all(engine) return Session(bind=engine) class TestStudySystemAttributeModel(object): @staticmethod def test_find_by_study_and_key(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study') session.add( StudySystemAttributeModel(study_id=study.study_id, key='sample-key', value_json='1')) session.commit() attr = StudySystemAttributeModel.find_by_study_and_key(study, 'sample-key', session) assert attr is not None and '1' == attr.value_json assert StudySystemAttributeModel.find_by_study_and_key(study, 'not-found', session) is None @staticmethod def test_where_study_id(session): # type: (Session) -> None sample_study = StudyModel(study_id=1, study_name='test-study') empty_study = StudyModel(study_id=2, study_name='test-study') session.add( StudySystemAttributeModel( study_id=sample_study.study_id, key='sample-key', value_json='1')) assert 1 == len(StudySystemAttributeModel.where_study_id(sample_study.study_id, session)) assert 0 == len(StudySystemAttributeModel.where_study_id(empty_study.study_id, session)) # Check the case of unknown study_id. assert 0 == len(StudySystemAttributeModel.where_study_id(-1, session)) @staticmethod def test_cascade_delete_on_study(session): # type: (Session) -> None study_id = 1 study = StudyModel(study_id=study_id, study_name='test-study', direction=StudyDirection.MINIMIZE) study.system_attributes.append(StudySystemAttributeModel( study_id=study_id, key='sample-key1', value_json='1')) study.system_attributes.append(StudySystemAttributeModel( study_id=study_id, key='sample-key2', value_json='2')) session.add(study) session.commit() assert 2 == len(StudySystemAttributeModel.where_study_id(study_id, session)) session.delete(study) session.commit() assert 0 == len(StudySystemAttributeModel.where_study_id(study_id, session)) class TestTrialModel(object): @staticmethod def test_default_datetime(session): # type: (Session) -> None datetime_1 = datetime.now() session.add(TrialModel(state=TrialState.RUNNING)) session.commit() datetime_2 = datetime.now() trial_model = session.query(TrialModel).first() assert datetime_1 < trial_model.datetime_start < datetime_2 assert trial_model.datetime_complete is None @staticmethod def test_count(session): # type: (Session) -> None study_1 = StudyModel(study_id=1, study_name='test-study-1') study_2 = StudyModel(study_id=2, study_name='test-study-2') session.add(TrialModel(study_id=study_1.study_id, state=TrialState.COMPLETE)) session.add(TrialModel(study_id=study_1.study_id, state=TrialState.RUNNING)) session.add(TrialModel(study_id=study_2.study_id, state=TrialState.RUNNING)) session.commit() assert 3 == TrialModel.count(session) assert 2 == TrialModel.count(session, study=study_1) assert 1 == TrialModel.count(session, state=TrialState.COMPLETE) @staticmethod def test_count_past_trials(session): # type: (Session) -> None study_1 = StudyModel(study_id=1, study_name='test-study-1') study_2 = StudyModel(study_id=2, study_name='test-study-2') trial_1_1 = TrialModel(study_id=study_1.study_id, state=TrialState.COMPLETE) session.add(trial_1_1) session.commit() assert 0 == trial_1_1.count_past_trials(session) trial_1_2 = TrialModel(study_id=study_1.study_id, state=TrialState.RUNNING) session.add(trial_1_2) session.commit() assert 1 == trial_1_2.count_past_trials(session) trial_2_1 = TrialModel(study_id=study_2.study_id, state=TrialState.RUNNING) session.add(trial_2_1) session.commit() assert 0 == trial_2_1.count_past_trials(session) @staticmethod def test_cascade_delete_on_study(session): # type: (Session) -> None study_id = 1 study = StudyModel(study_id=study_id, study_name='test-study', direction=StudyDirection.MINIMIZE) study.trials.append(TrialModel(study_id=study.study_id, state=TrialState.COMPLETE)) study.trials.append(TrialModel(study_id=study.study_id, state=TrialState.RUNNING)) session.add(study) session.commit() assert 2 == len(TrialModel.where_study(study, session)) session.delete(study) session.commit() assert 0 == len(TrialModel.where_study(study, session)) class TestTrialUserAttributeModel(object): @staticmethod def test_find_by_trial_and_key(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study') trial = TrialModel(study_id=study.study_id) session.add( TrialUserAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() attr = TrialUserAttributeModel.find_by_trial_and_key(trial, 'sample-key', session) assert attr is not None assert '1' == attr.value_json assert TrialUserAttributeModel.find_by_trial_and_key(trial, 'not-found', session) is None @staticmethod def test_where_study(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=1, study_id=study.study_id, state=TrialState.COMPLETE) session.add(study) session.add(trial) session.add( TrialUserAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() user_attributes = TrialUserAttributeModel.where_study(study, session) assert 1 == len(user_attributes) assert 'sample-key' == user_attributes[0].key assert '1' == user_attributes[0].value_json @staticmethod def test_where_trial(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=1, study_id=study.study_id, state=TrialState.COMPLETE) session.add( TrialUserAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() user_attributes = TrialUserAttributeModel.where_trial(trial, session) assert 1 == len(user_attributes) assert 'sample-key' == user_attributes[0].key assert '1' == user_attributes[0].value_json @staticmethod def test_all(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=1, study_id=study.study_id, state=TrialState.COMPLETE) session.add( TrialUserAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() user_attributes = TrialUserAttributeModel.all(session) assert 1 == len(user_attributes) assert 'sample-key' == user_attributes[0].key assert '1' == user_attributes[0].value_json @staticmethod def test_cascade_delete_on_trial(session): # type: (Session) -> None trial_id = 1 study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=trial_id, study_id=study.study_id, state=TrialState.COMPLETE) trial.user_attributes.append(TrialUserAttributeModel( trial_id=trial_id, key='sample-key1', value_json='1')) trial.user_attributes.append(TrialUserAttributeModel( trial_id=trial_id, key='sample-key2', value_json='2')) study.trials.append(trial) session.add(study) session.commit() assert 2 == len(TrialUserAttributeModel.where_trial_id(trial_id, session)) session.delete(trial) session.commit() assert 0 == len(TrialUserAttributeModel.where_trial_id(trial_id, session)) class TestTrialSystemAttributeModel(object): @staticmethod def test_find_by_trial_and_key(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study') trial = TrialModel(study_id=study.study_id) session.add( TrialSystemAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() attr = TrialSystemAttributeModel.find_by_trial_and_key(trial, 'sample-key', session) assert attr is not None assert '1' == attr.value_json assert TrialSystemAttributeModel.find_by_trial_and_key(trial, 'not-found', session) is None @staticmethod def test_where_study(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=1, study_id=study.study_id, state=TrialState.COMPLETE) session.add(study) session.add(trial) session.add( TrialSystemAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() system_attributes = TrialSystemAttributeModel.where_study(study, session) assert 1 == len(system_attributes) assert 'sample-key' == system_attributes[0].key assert '1' == system_attributes[0].value_json @staticmethod def test_where_trial(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=1, study_id=study.study_id, state=TrialState.COMPLETE) session.add( TrialSystemAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() system_attributes = TrialSystemAttributeModel.where_trial(trial, session) assert 1 == len(system_attributes) assert 'sample-key' == system_attributes[0].key assert '1' == system_attributes[0].value_json @staticmethod def test_all(session): # type: (Session) -> None study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=1, study_id=study.study_id, state=TrialState.COMPLETE) session.add( TrialSystemAttributeModel(trial_id=trial.trial_id, key='sample-key', value_json='1')) session.commit() system_attributes = TrialSystemAttributeModel.all(session) assert 1 == len(system_attributes) assert 'sample-key' == system_attributes[0].key assert '1' == system_attributes[0].value_json @staticmethod def test_cascade_delete_on_trial(session): # type: (Session) -> None trial_id = 1 study = StudyModel(study_id=1, study_name='test-study', direction=StudyDirection.MINIMIZE) trial = TrialModel(trial_id=trial_id, study_id=study.study_id, state=TrialState.COMPLETE) trial.system_attributes.append(TrialSystemAttributeModel( trial_id=trial_id, key='sample-key1', value_json='1')) trial.system_attributes.append(TrialSystemAttributeModel( trial_id=trial_id, key='sample-key2', value_json='2')) study.trials.append(trial) session.add(study) session.commit() assert 2 == len(TrialSystemAttributeModel.where_trial_id(trial_id, session)) session.delete(trial) session.commit() assert 0 == len(TrialSystemAttributeModel.where_trial_id(trial_id, session)) class TestVersionInfoModel(object): @staticmethod def test_version_info_id_constraint(session): # type: (Session) -> None session.add(VersionInfoModel(schema_version=1, library_version='0.0.1')) session.commit() # Test check constraint of version_info_id. session.add(VersionInfoModel(version_info_id=2, schema_version=2, library_version='0.0.2')) pytest.raises(IntegrityError, lambda: session.commit())
38.086957
99
0.6879
1,568
13,140
5.54273
0.066327
0.062824
0.03728
0.039351
0.836267
0.81291
0.766655
0.724197
0.678978
0.646416
0
0.013411
0.205556
13,140
344
100
38.197674
0.81914
0.040259
0
0.632911
0
0
0.042418
0
0
0
0
0
0.189873
1
0.080169
false
0
0.059072
0
0.164557
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
583e6da79f0b66bc44d83d604d5e34984132d4b4
11,233
py
Python
tests/processing_components/test_pointing.py
ska-telescope/algorithm-reference-library
1b2c8d6079249202864abf8c60cdea40f0f123cb
[ "Apache-2.0" ]
22
2016-12-14T11:20:07.000Z
2021-08-13T15:23:41.000Z
tests/processing_components/test_pointing.py
ska-telescope/algorithm-reference-library
1b2c8d6079249202864abf8c60cdea40f0f123cb
[ "Apache-2.0" ]
30
2017-06-27T09:15:38.000Z
2020-09-11T18:16:37.000Z
tests/processing_components/test_pointing.py
SKA-ScienceDataProcessor/algorithm-reference-library
1b2c8d6079249202864abf8c60cdea40f0f123cb
[ "Apache-2.0" ]
20
2017-07-02T03:45:49.000Z
2019-12-11T17:19:01.000Z
""" Unit tests for pointing """ import logging import unittest import astropy.units as u import numpy from astropy.coordinates import SkyCoord from data_models.polarisation import PolarisationFrame from processing_components.calibration.pointing import create_pointingtable_from_blockvisibility from processing_components.imaging.primary_beams import create_vp from processing_components.simulation.configurations import create_named_configuration from processing_components.simulation.pointing import simulate_gaintable_from_pointingtable from processing_components.simulation.testing_support import create_test_image, simulate_pointingtable from processing_components.simulation.testing_support import create_test_skycomponents_from_s3 from processing_components.skycomponent.operations import create_skycomponent from processing_components.visibility.base import create_blockvisibility from processing_library.image.operations import create_image log = logging.getLogger(__name__) class TestPointing(unittest.TestCase): def setUp(self): from data_models.parameters import arl_path self.doplot = True self.midcore = create_named_configuration('MID', rmax=300.0) self.nants = len(self.midcore.names) self.dir = arl_path('test_results') self.ntimes = 300 self.times = numpy.linspace(-12.0, 12.0, self.ntimes) * numpy.pi / (12.0) self.frequency = numpy.array([1e9]) self.channel_bandwidth = numpy.array([1e7]) self.phasecentre = SkyCoord(ra=+15.0 * u.deg, dec=-45.0 * u.deg, frame='icrs', equinox='J2000') self.vis = create_blockvisibility(self.midcore, self.times, self.frequency, channel_bandwidth=self.channel_bandwidth, phasecentre=self.phasecentre, weight=1.0, polarisation_frame=PolarisationFrame('stokesI')) self.vis.data['vis'] *= 0.0 # Create model self.model = create_image(npixel=512, cellsize=0.00015, polarisation_frame=PolarisationFrame("stokesI"), frequency=self.frequency, channel_bandwidth=self.channel_bandwidth, phasecentre=self.phasecentre) def test_create_pointingtable(self): beam = create_test_image(cellsize=0.0015, phasecentre=self.vis.phasecentre, frequency=self.frequency) for telescope in ['MID', 'LOW', 'ASKAP']: vp = create_vp(beam, telescope) pt = create_pointingtable_from_blockvisibility(self.vis, vp) pt = simulate_pointingtable(pt, 0.1, static_pointing_error=[0.01, 0.001]) assert pt.pointing.shape == (self.ntimes, self.nants, 1, 1, 2), pt.pointing.shape def test_create_gaintable_from_pointingtable(self): s3_components = create_test_skycomponents_from_s3(flux_limit=5.0, phasecentre=self.phasecentre, frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI'), radius=0.2) pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.01, static_pointing_error=[0.001,0.0001]) vp = create_vp(self.model, 'MID') gt = simulate_gaintable_from_pointingtable(self.vis, s3_components, pt, vp) assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape def test_create_gaintable_from_pointingtable_dynamic(self): comp = create_skycomponent(direction=self.phasecentre, flux=[[1.0]], frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI')) pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.01, static_pointing_error=None, global_pointing_error=[0.0, 0.0]) vp = create_vp(self.model, 'MID') gt = simulate_gaintable_from_pointingtable(self.vis, [comp], pt, vp) if self.doplot: import matplotlib.pyplot as plt plt.clf() plt.plot(gt[0].time, numpy.real(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.plot(gt[0].time, numpy.imag(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.title('test_create_gaintable_from_pointingtable_dynamic') plt.show() assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape def test_create_gaintable_from_pointingtable_dynamic_radec(self): comp = create_skycomponent(direction=self.phasecentre, flux=[[1.0]], frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI')) pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.01, static_pointing_error=None, global_pointing_error=[0.0, 0.0]) vp = create_vp(self.model, 'MID', use_local=False) gt = simulate_gaintable_from_pointingtable(self.vis, [comp], pt, vp, use_radec=True) if self.doplot: import matplotlib.pyplot as plt plt.clf() plt.plot(gt[0].time, numpy.real(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.plot(gt[0].time, numpy.imag(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.title('test_create_gaintable_from_pointingtable_dynamic_radec') plt.show() assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape def test_create_gaintable_from_pointingtable_static(self): comp = create_skycomponent(direction=self.phasecentre, flux=[[1.0]], frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI')) pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.0, static_pointing_error=[0.01, 0.001], global_pointing_error=[0.0, 0.0]) vp = create_vp(self.model, 'MID') gt = simulate_gaintable_from_pointingtable(self.vis, [comp], pt, vp) if self.doplot: import matplotlib.pyplot as plt plt.clf() plt.plot(gt[0].time, numpy.real(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.plot(gt[0].time, numpy.imag(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.title('test_create_gaintable_from_pointingtable_static') plt.show() assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape def test_create_gaintable_from_pointingtable_dynamic_static(self): comp = create_skycomponent(direction=self.phasecentre, flux=[[1.0]], frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI')) pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.01, static_pointing_error=[0.01, 0.001], global_pointing_error=[0.0, 0.0]) vp = create_vp(self.model, 'MID') gt = simulate_gaintable_from_pointingtable(self.vis, [comp], pt, vp) if self.doplot: import matplotlib.pyplot as plt plt.clf() plt.plot(gt[0].time, numpy.real(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.plot(gt[0].time, numpy.imag(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.title('test_create_gaintable_from_pointingtable_dynamic_static') plt.show() assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape def test_create_gaintable_from_pointingtable_global(self): comp = create_skycomponent(direction=self.phasecentre, flux=[[1.0]], frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI')) import matplotlib.pyplot as plt pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.0, static_pointing_error=None, global_pointing_error=[0.0, 0.01]) vp = create_vp(self.model, 'MID') gt = simulate_gaintable_from_pointingtable(self.vis, [comp], pt, vp) if self.doplot: plt.clf() plt.plot(gt[0].time, numpy.real(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.plot(gt[0].time, numpy.imag(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.title('test_create_gaintable_from_pointingtable_global') plt.show() assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape def test_create_gaintable_from_pointingtable_global_dynamic(self): comp = create_skycomponent(direction=self.phasecentre, flux=[[1.0]], frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI')) pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.01, static_pointing_error=None, global_pointing_error=[0.0, 0.01]) vp = create_vp(self.model, 'MID') gt = simulate_gaintable_from_pointingtable(self.vis, [comp], pt, vp) if self.doplot: import matplotlib.pyplot as plt plt.clf() plt.plot(gt[0].time, numpy.real(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.plot(gt[0].time, numpy.imag(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.title('test_create_gaintable_from_pointingtable_global_dynamic') plt.show() assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape def test_create_gaintable_from_pointingtable_GRASP(self): comp = create_skycomponent(direction=self.phasecentre, flux=[[1.0]], frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI')) pt = create_pointingtable_from_blockvisibility(self.vis) pt = simulate_pointingtable(pt, pointing_error=0.0, static_pointing_error=None, global_pointing_error=[0.0, 0.01]) vp = create_vp(self.model, 'MID_GRASP') gt = simulate_gaintable_from_pointingtable(self.vis, [comp], pt, vp) if self.doplot: import matplotlib.pyplot as plt plt.clf() plt.plot(gt[0].time, numpy.real(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.plot(gt[0].time, numpy.imag(1.0 / gt[0].gain[:, 0, 0, 0, 0]), '.') plt.title('test_create_gaintable_from_pointingtable_global_dynamic') plt.show() assert gt[0].gain.shape == (self.ntimes, self.nants, 1, 1, 1), gt[0].gain.shape if __name__ == '__main__': unittest.main()
54.529126
112
0.61622
1,370
11,233
4.849635
0.10438
0.019266
0.01761
0.010837
0.754214
0.742926
0.742926
0.710415
0.710415
0.710415
0
0.037396
0.2644
11,233
205
113
54.795122
0.766671
0.003294
0
0.585799
0
0
0.046572
0.03227
0
0
0
0
0.053254
1
0.059172
false
0
0.136095
0
0.201183
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5845a9097e9d1860e2edea339dc2a7f4a7bce339
153
py
Python
incrowd/chat_server/admin.py
incrowdio/incrowd
711e99c55b9da815af7749a2930d4184e235fa68
[ "Apache-2.0" ]
4
2015-03-10T04:24:07.000Z
2016-09-18T16:41:12.000Z
incrowd/chat_server/admin.py
incrowdio/incrowd
711e99c55b9da815af7749a2930d4184e235fa68
[ "Apache-2.0" ]
27
2015-01-03T09:52:50.000Z
2021-06-10T20:37:08.000Z
incrowd/chat_server/admin.py
incrowdio/incrowd
711e99c55b9da815af7749a2930d4184e235fa68
[ "Apache-2.0" ]
2
2015-09-07T21:06:51.000Z
2016-03-10T11:31:57.000Z
from __future__ import unicode_literals from django.contrib import admin from chat_server.models import ChatMessage admin.site.register(ChatMessage)
17
42
0.849673
20
153
6.2
0.7
0
0
0
0
0
0
0
0
0
0
0
0.111111
153
8
43
19.125
0.911765
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
5855a718f19fd271a7d90653c654f8cb39f399af
83
py
Python
src/polls/forLoop5.py
Prince-linux/python-learning
75335ed497081b557400a05320b52b8889c3e1f4
[ "MIT" ]
1
2015-08-27T13:03:27.000Z
2015-08-27T13:03:27.000Z
src/polls/forLoop5.py
Prince-linux/python-learning
75335ed497081b557400a05320b52b8889c3e1f4
[ "MIT" ]
22
2015-08-23T18:17:30.000Z
2015-09-16T13:38:36.000Z
src/polls/forLoop5.py
Prince-linux/python-learning
75335ed497081b557400a05320b52b8889c3e1f4
[ "MIT" ]
null
null
null
for i in range(201, 0, -2): print(i) for i in range(100, 0, -1): print(i)
13.833333
27
0.53012
18
83
2.444444
0.555556
0.181818
0.272727
0.5
0
0
0
0
0
0
0
0.166667
0.277108
83
5
28
16.6
0.566667
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
587459d5f7a6bd9cf3276d7457144c3d311a145c
31
py
Python
boa_web/managerAPI/Ads.py
atharva-naik/boa_web
5718135d0e52440a2018b63eabe14cd3f78671bd
[ "MIT" ]
null
null
null
boa_web/managerAPI/Ads.py
atharva-naik/boa_web
5718135d0e52440a2018b63eabe14cd3f78671bd
[ "MIT" ]
null
null
null
boa_web/managerAPI/Ads.py
atharva-naik/boa_web
5718135d0e52440a2018b63eabe14cd3f78671bd
[ "MIT" ]
null
null
null
# wrapper around Adsense maybe?
31
31
0.806452
4
31
6.25
1
0
0
0
0
0
0
0
0
0
0
0
0.129032
31
1
31
31
0.925926
0.935484
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
587c858828fcc7b0abe3687c66e3f758b40d3b9b
15,894
py
Python
tests/test_graphql_middleware.py
netsaj/graphene-bottle
9b2b3da4c211856f27e6bdf18a90a7d7771cb57a
[ "MIT" ]
7
2017-09-10T14:47:36.000Z
2020-03-13T16:55:54.000Z
tests/test_graphql_middleware.py
netsaj/graphene-bottle
9b2b3da4c211856f27e6bdf18a90a7d7771cb57a
[ "MIT" ]
1
2020-02-14T12:48:57.000Z
2020-02-14T12:48:57.000Z
tests/test_graphql_middleware.py
netsaj/graphene-bottle
9b2b3da4c211856f27e6bdf18a90a7d7771cb57a
[ "MIT" ]
3
2019-11-10T23:32:28.000Z
2021-05-07T13:46:13.000Z
import pytest import json try: from urllib import urlencode except ImportError: from urllib.parse import urlencode from .app import create_app def encode_get_url(**params): return '/graphql?' + urlencode(params) @pytest.fixture def client(): return create_app(test_mode=True) def test_allows_get_with_query_param(client): response = client.get(encode_get_url(query='{ hello }')) assert response.status_code == 200 assert response.content_type == 'application/json' assert response.json == { 'data': {'hello': "Hello stranger"} } def test_allows_get_with_variable_values(client): response = client.get(encode_get_url( query='query helloName($name: String){ hello(name: $name) }', variables=json.dumps({'name': "Dolly"}) )) assert response.status_code == 200 assert response.content_type == 'application/json' assert response.json == { 'data': {'hello': "Hello Dolly"} } def test_allows_get_with_operation_name(client): response = client.get(encode_get_url( query=''' query helloYou { hello(name: "You"), ...shared } query helloWorld { hello(name: "World"), ...shared } query helloDolly { hello(name: "Dolly"), ...shared } fragment shared on SystemQueries { shared: hello(name: "Everyone") } ''', operationName='helloWorld' )) assert response.status_code == 200 assert response.content_type == 'application/json' assert response.json == { 'data': { 'hello': 'Hello World', 'shared': 'Hello Everyone' } } def test_reports_validation_errors(client): response = client.get(encode_get_url( query='{ hello, unknownOne, unknownTwo }' ), expect_errors=True) assert response.status_code == 400 assert response.content_type == 'application/json' assert response.json == { 'data': None, 'errors': [ { 'message': 'Cannot query field "unknownOne" on type "SystemQueries".', 'locations': [{'line': 1, 'column': 10}] }, { 'message': 'Cannot query field "unknownTwo" on type "SystemQueries".', 'locations': [{'line': 1, 'column': 22}] } ] } # def test_errors_when_missing_operation_name(client): # response = client.get(encode_get_url( # query=''' # query TestQuery { hello } # mutation TestMutation { writeTest { test } } # ''' # ), # expect_errors=True) # assert response.status_code == 400 # assert response.content_type == 'application/json' # assert response.json == { # 'errors': [ # { # 'message': 'Must provide operation name if query contains multiple operations.' # } # ] # } # def test_errors_when_sending_a_mutation_via_get(client): # response = client.get(url_string( # query=''' # mutation TestMutation { writeTest { test } } # ''' # )) # assert response.status_code == 405 # assert response_json(response) == { # 'errors': [ # { # 'message': 'Can only perform a mutation operation from a POST request.' # } # ] # } # def test_errors_when_selecting_a_mutation_within_a_get(client): # response = client.get(url_string( # query=''' # query TestQuery { test } # mutation TestMutation { writeTest { test } } # ''', # operationName='TestMutation' # )) # assert response.status_code == 405 # assert response_json(response) == { # 'errors': [ # { # 'message': 'Can only perform a mutation operation from a POST request.' # } # ] # } # def test_allows_mutation_to_exist_within_a_get(client): # response = client.get(url_string( # query=''' # query TestQuery { test } # mutation TestMutation { writeTest { test } } # ''', # operationName='TestQuery' # )) # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello World"} # } # def test_allows_post_with_json_encoding(client): # response = client.post(url_string(), data=j(query='{test}'), content_type='application/json') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello World"} # } # def test_allows_sending_a_mutation_via_post(client): # response = client.post(url_string(), data=j(query='mutation TestMutation { writeTest { test } }'), content_type='application/json') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'writeTest': {'test': 'Hello World'}} # } # def test_allows_post_with_url_encoding(client): # response = client.post(url_string(), data=urlencode(dict(query='{test}')), content_type='application/x-www-form-urlencoded') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello World"} # } # def test_supports_post_json_query_with_string_variables(client): # response = client.post(url_string(), data=j( # query='query helloWho($who: String){ test(who: $who) }', # variables=json.dumps({'who': "Dolly"}) # ), content_type='application/json') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello Dolly"} # } # def test_supports_post_json_query_with_json_variables(client): # response = client.post(url_string(), data=j( # query='query helloWho($who: String){ test(who: $who) }', # variables={'who': "Dolly"} # ), content_type='application/json') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello Dolly"} # } # def test_supports_post_url_encoded_query_with_string_variables(client): # response = client.post(url_string(), data=urlencode(dict( # query='query helloWho($who: String){ test(who: $who) }', # variables=json.dumps({'who': "Dolly"}) # )), content_type='application/x-www-form-urlencoded') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello Dolly"} # } # def test_supports_post_json_quey_with_get_variable_values(client): # response = client.post(url_string( # variables=json.dumps({'who': "Dolly"}) # ), data=j( # query='query helloWho($who: String){ test(who: $who) }', # ), content_type='application/json') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello Dolly"} # } # def test_post_url_encoded_query_with_get_variable_values(client): # response = client.post(url_string( # variables=json.dumps({'who': "Dolly"}) # ), data=urlencode(dict( # query='query helloWho($who: String){ test(who: $who) }', # )), content_type='application/x-www-form-urlencoded') # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello Dolly"} # } # def test_supports_post_raw_text_query_with_get_variable_values(client): # response = client.post(url_string( # variables=json.dumps({'who': "Dolly"}) # ), # data='query helloWho($who: String){ test(who: $who) }', # content_type='application/graphql' # ) # assert response.status_code == 200 # assert response_json(response) == { # 'data': {'test': "Hello Dolly"} # } # def test_allows_post_with_operation_name(client): # response = client.post(url_string(), data=j( # query=''' # query helloYou { test(who: "You"), ...shared } # query helloWorld { test(who: "World"), ...shared } # query helloDolly { test(who: "Dolly"), ...shared } # fragment shared on QueryRoot { # shared: test(who: "Everyone") # } # ''', # operationName='helloWorld' # ), content_type='application/json') # assert response.status_code == 200 # assert response_json(response) == { # 'data': { # 'test': 'Hello World', # 'shared': 'Hello Everyone' # } # } # def test_allows_post_with_get_operation_name(client): # response = client.post(url_string( # operationName='helloWorld' # ), data=''' # query helloYou { test(who: "You"), ...shared } # query helloWorld { test(who: "World"), ...shared } # query helloDolly { test(who: "Dolly"), ...shared } # fragment shared on QueryRoot { # shared: test(who: "Everyone") # } # ''', # content_type='application/graphql') # assert response.status_code == 200 # assert response_json(response) == { # 'data': { # 'test': 'Hello World', # 'shared': 'Hello Everyone' # } # } # @pytest.mark.parametrize('app', [create_app(pretty=True)]) # def test_supports_pretty_printing(client): # response = client.get(url_string(query='{test}')) # assert response.data.decode() == ( # '{\n' # ' "data": {\n' # ' "test": "Hello World"\n' # ' }\n' # '}' # ) # @pytest.mark.parametrize('app', [create_app(pretty=False)]) # def test_not_pretty_by_default(client): # response = client.get(url_string(query='{test}')) # assert response.data.decode() == ( # '{"data":{"test":"Hello World"}}' # ) # def test_supports_pretty_printing_by_request(client): # response = client.get(url_string(query='{test}', pretty='1')) # assert response.data.decode() == ( # '{\n' # ' "data": {\n' # ' "test": "Hello World"\n' # ' }\n' # '}' # ) # def test_handles_field_errors_caught_by_graphql(client): # response = client.get(url_string(query='{thrower}')) # assert response.status_code == 200 # assert response_json(response) == { # 'data': None, # 'errors': [{'locations': [{'column': 2, 'line': 1}], 'message': 'Throws!'}] # } # def test_handles_syntax_errors_caught_by_graphql(client): # response = client.get(url_string(query='syntaxerror')) # assert response.status_code == 400 # assert response_json(response) == { # 'errors': [{'locations': [{'column': 1, 'line': 1}], # 'message': 'Syntax Error GraphQL request (1:1) ' # 'Unexpected Name "syntaxerror"\n\n1: syntaxerror\n ^\n'}] # } # def test_handles_errors_caused_by_a_lack_of_query(client): # response = client.get(url_string()) # assert response.status_code == 400 # assert response_json(response) == { # 'errors': [{'message': 'Must provide query string.'}] # } # def test_handles_batch_correctly_if_is_disabled(client): # response = client.post(url_string(), data='[]', content_type='application/json') # assert response.status_code == 400 # assert response_json(response) == { # 'errors': [{'message': 'Batch GraphQL requests are not enabled.'}] # } # def test_handles_incomplete_json_bodies(client): # response = client.post(url_string(), data='{"query":', content_type='application/json') # assert response.status_code == 400 # assert response_json(response) == { # 'errors': [{'message': 'POST body sent invalid JSON.'}] # } # def test_handles_plain_post_text(client): # response = client.post(url_string( # variables=json.dumps({'who': "Dolly"}) # ), # data='query helloWho($who: String){ test(who: $who) }', # content_type='text/plain' # ) # assert response.status_code == 400 # assert response_json(response) == { # 'errors': [{'message': 'Must provide query string.'}] # } # def test_handles_poorly_formed_variables(client): # response = client.get(url_string( # query='query helloWho($who: String){ test(who: $who) }', # variables='who:You' # )) # assert response.status_code == 400 # assert response_json(response) == { # 'errors': [{'message': 'Variables are invalid JSON.'}] # } # def test_handles_unsupported_http_methods(client): # response = client.put(url_string(query='{test}')) # assert response.status_code == 405 # assert response.headers['Allow'] in ['GET, POST', 'HEAD, GET, POST, OPTIONS'] # assert response_json(response) == { # 'errors': [{'message': 'GraphQL only supports GET and POST requests.'}] # } # def test_passes_request_into_request_context(client): # response = client.get(url_string(query='{request}', q='testing')) # assert response.status_code == 200 # assert response_json(response) == { # 'data': { # 'request': 'testing' # } # } # @pytest.mark.parametrize('app', [create_app(get_context=lambda:"CUSTOM CONTEXT")]) # def test_supports_pretty_printing(client): # response = client.get(url_string(query='{context}')) # assert response.status_code == 200 # assert response_json(response) == { # 'data': { # 'context': 'CUSTOM CONTEXT' # } # } # def test_post_multipart_data(client): # query = 'mutation TestMutation { writeTest { test } }' # response = client.post( # url_string(), # data= { # 'query': query, # 'file': (StringIO(), 'text1.txt'), # }, # content_type='multipart/form-data' # ) # assert response.status_code == 200 # assert response_json(response) == {'data': {u'writeTest': {u'test': u'Hello World'}}} # @pytest.mark.parametrize('app', [create_app(batch=True)]) # def test_batch_allows_post_with_json_encoding(client): # response = client.post( # url_string(), # data=jl( # # id=1, # query='{test}' # ), # content_type='application/json' # ) # assert response.status_code == 200 # assert response_json(response) == [{ # # 'id': 1, # 'data': {'test': "Hello World"} # }] # @pytest.mark.parametrize('app', [create_app(batch=True)]) # def test_batch_supports_post_json_query_with_json_variables(client): # response = client.post( # url_string(), # data=jl( # # id=1, # query='query helloWho($who: String){ test(who: $who) }', # variables={'who': "Dolly"} # ), # content_type='application/json' # ) # assert response.status_code == 200 # assert response_json(response) == [{ # # 'id': 1, # 'data': {'test': "Hello Dolly"} # }] # @pytest.mark.parametrize('app', [create_app(batch=True)]) # def test_batch_allows_post_with_operation_name(client): # response = client.post( # url_string(), # data=jl( # # id=1, # query=''' # query helloYou { test(who: "You"), ...shared } # query helloWorld { test(who: "World"), ...shared } # query helloDolly { test(who: "Dolly"), ...shared } # fragment shared on QueryRoot { # shared: test(who: "Everyone") # } # ''', # operationName='helloWorld' # ), # content_type='application/json' # ) # assert response.status_code == 200 # assert response_json(response) == [{ # # 'id': 1, # 'data': { # 'test': 'Hello World', # 'shared': 'Hello Everyone' # } # }]
30.802326
137
0.578709
1,642
15,894
5.392814
0.109013
0.118577
0.079051
0.089441
0.813439
0.77572
0.761942
0.715189
0.686844
0.666629
0
0.010249
0.26337
15,894
515
138
30.862136
0.746071
0.79961
0
0.231884
0
0
0.265349
0
0
0
0
0
0.173913
1
0.086957
false
0
0.086957
0.028986
0.202899
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
546b8e7949ced57eadf7ef5b4390a29ffd7236b8
13,165
py
Python
jams/kernel_regression.py
MuellerSeb/jams_python
1bca04557da79d8f8a4c447f5ccc517c40ab7dfc
[ "MIT" ]
null
null
null
jams/kernel_regression.py
MuellerSeb/jams_python
1bca04557da79d8f8a4c447f5ccc517c40ab7dfc
[ "MIT" ]
null
null
null
jams/kernel_regression.py
MuellerSeb/jams_python
1bca04557da79d8f8a4c447f5ccc517c40ab7dfc
[ "MIT" ]
null
null
null
#!/usr/bin/env python from __future__ import division, absolute_import, print_function import numpy as np import scipy.optimize as opt # fmin_tnc from jams.division import division def kernel_regression(x, y, h=None, silverman=False, xout=None): """ Multi-dimensional non-parametric kernel regression. Optimal bandwidth can be estimated by cross-validation or by using Silverman''s rule-of-thumb. Definition ---------- def kernel_regression(x, y, h=None, silverman=False): Input ----- x ndarray(n,k) of independent values y array(n) of dependent values Optional Input -------------- h None: determine optimal h float > 0: use for calculating regression values silverman False: determine h via cross-validation True: use Silverman''s rule-of-thumb Output ------ Fitted values at x References ---------- Haerdle, W., & Mueller, M. (2000). Multivariate and semiparametric kernel regression. In M. G. Schimek (Ed.), Smoothing and regression: Approaches, computation, and application (pp. 357-392). Hoboken, NJ, USA: John Wiley & Sons, Inc. doi:10.1002/9781118150658.ch12 Examples -------- >>> import numpy as np >>> x = np.zeros((10,2)) >>> x[:,0] = np.arange(10,dtype=np.float)/9. >>> x[:,1] = 1./(np.arange(10,dtype=np.float)/9.+0.1) >>> y = 1. + x[:,0]**2 - np.sin(x[:,1])**2 >>> h = kernel_regression_h(x,y) >>> print(np.allclose(h, [0.172680, 9.516907], atol=0.0001)) True >>> yk = kernel_regression(x,y,h) >>> print(np.allclose(yk[0:6], [0.52241, 0.52570, 0.54180, 0.51781, 0.47644, 0.49230], atol=0.0001)) True >>> yk = kernel_regression(x,y) >>> print(np.allclose(yk[0:6], [0.52241, 0.52570, 0.54180, 0.51781, 0.47644, 0.49230], atol=0.0001)) True >>> h = kernel_regression_h(x,y,silverman=True) >>> print(np.allclose(h, [0.229190, 1.903381], atol=0.0001)) True >>> yk = kernel_regression(x,y,h) >>> print(np.allclose(yk[0:6], [0.691153, 0.422809, 0.545844, 0.534315, 0.521494, 0.555426], atol=0.0001)) True >>> ss = np.shape(x) >>> nn = 5 >>> xx = np.empty((nn,ss[1])) >>> xx[:,0] = np.amin(x[:,0]) + (np.amax(x[:,0])-np.amin(x[:,0])) * np.arange(nn,dtype=np.float)/np.float(nn) >>> xx[:,1] = np.amin(x[:,1]) + (np.amax(x[:,1])-np.amin(x[:,1])) * np.arange(nn,dtype=np.float)/np.float(nn) >>> yk = kernel_regression(x,y,h,xout=xx) >>> print(np.allclose(yk, [0.605485, 0.555235, 0.509529, 0.491191, 0.553325], atol=0.0001)) True License ------- This file is part of the JAMS Python package, distributed under the MIT License. The JAMS Python package originates from the former UFZ Python library, Department of Computational Hydrosystems, Helmholtz Centre for Environmental Research - UFZ, Leipzig, Germany. Copyright (c) 2012-2014 Matthias Cuntz - mc (at) macu (dot) de Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. History ------- Written, MC, Jun 2012 - inspired by Matlab routines of Yingying Dong, Boston College and Yi Cao, Cranfield University Modified, MC, Feb 2013 - ported to Python 3 MC, Apr 2014 - assert """ # # Check input ss = np.shape(x) n = ss[0] assert n == np.size(y), 'size(x,0) != size(y): '+str(n)+' != '+str(np.size(y)) if np.size(ss) == 1: # to deal with 1d-arrays xx = x[:,np.newaxis] else: xx = x ss = np.shape(xx) d = ss[1] # # determine h if h is None: hh = kernel_regression_h(xx,y,silverman=silverman) else: if np.size(np.shape(h))==0: hh = np.repeat(h,d) else: hh = np.array(h) assert np.size(hh) == d, 'size(h) must be 1 or size(x,1): ' # # Calc regression if xout is None: xxout = xx else: if np.size(np.shape(xout)) == 1: xxout = xout[:,np.newaxis] else: xxout = xout ssout = np.shape(xxout) nout = ssout[0] dout = ssout[1] assert d == dout, 'size(x,1) != size(xout,1): '+str(d)+' != '+str(dout) # allocate output out = np.empty(nout) # Loop through each regression point for i in range(nout): # scaled deference from regression point z = (xx - xxout[i,:]) / hh # nadaraya-watson estimator of gaussian multivariate kernel out[i] = nadaraya_watson(z, y) # return out def kernel_regression_h(x, y, silverman=False): """ Optimal bandwidth for multi-dimensional non-parametric kernel regression using cross-validation or Silverman''s rule-of-thumb. Definition ---------- def kernel_regression_h(x, y): Input ----- x ndarray(n,k) of independent values y array(n) of dependent values Optional Input -------------- silverman False: determine h via cross-validation True: use Silverman''s rule-of-thumb Output ------ Optimal bandwidth. If multidimensional regression then h is vector, assuming diagonal bandwith matrix. References ---------- Haerdle, W., & Mueller, M. (2000). Multivariate and semiparametric kernel regression. In M. G. Schimek (Ed.), Smoothing and regression: Approaches, computation, and application (pp. 357-392). Hoboken, NJ, USA: John Wiley & Sons, Inc. doi:10.1002/9781118150658.ch12 Examples -------- >>> import numpy as np >>> x = np.zeros((10,2)) >>> x[:,0] = np.arange(10,dtype=np.float)/9. >>> x[:,1] = 1./(np.arange(10,dtype=np.float)/9.+0.1) >>> y = 1. + x[:,0]**2 - np.sin(x[:,1])**2 >>> h = kernel_regression_h(x,y) >>> print(np.allclose(h, [0.172680, 9.516907], atol=0.0001)) True >>> h = kernel_regression_h(x,y,silverman=True) >>> print(np.allclose(h, [0.229190, 1.903381], atol=0.0001)) True License ------- This file is part of the JAMS Python package, distributed under the MIT License. The JAMS Python package originates from the former UFZ Python library, Department of Computational Hydrosystems, Helmholtz Centre for Environmental Research - UFZ, Leipzig, Germany. Copyright (c) 2012-2018 Matthias Cuntz - mc (at) macu (dot) de Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. History ------- Written, MC, Jun 2012 - inspired by Matlab routines of Yingying Dong, Boston College and Yi Cao, Cranfield University Modified, MC, Feb 2013 - ported to Python 3 MC, Apr 2014 - assert MC, Jan 2018 - bug in boot_h: x.size->x.shape[0] """ # # Check input ss = np.shape(x) n = ss[0] assert x.shape[0] == np.size(y), 'size(x,0) != size(y): '+str(n)+' != '+str(np.size(y)) if np.ndim(x) == 1: # to deal with 1d-arrays xx = x[:,np.newaxis] else: xx = x d = xx.shape[1] # # Silvermann (1986), Scott (1992), Bowman and Azzalini (1997) # Very similar to stats.gaussian_kde h = (4./np.float(d+2)/np.float(n))**(1./np.float(d+4)) * np.std(xx,axis=0,ddof=1) # if not silverman: # Find the optimal h bounds = [(0.2*i,5.0*i) for i in h] if n<=100: h, nfeval, rc = opt.fmin_tnc(cross_valid_h, h, bounds=bounds, args=(xx, y), approx_grad=True, disp=False, maxfun=1000, xtol=1e-10, ftol=1e-10) else: h, nfeval, rc = opt.fmin_tnc(boot_h, h, bounds=bounds, args=(xx, y), approx_grad=True, disp=False, maxfun=1000, xtol=1e-10, ftol=1e-10) # return h def cross_valid_h(h, x, y): """ Helper function that calculates cross-validation function for the Nadaraya-Watson estimator, which is basically the mean square error where model estimate is replaced by the jackknife estimate (Haerdle et al. 2000). """ n = x.shape[0] # allocate output out = np.empty(n) # Loop through each regression point for i in range(n): # all-1 points xx = np.delete(x,i,axis=0) yy = np.delete(y,i,axis=0) z = (xx - x[i,:]) / h out[i] = nadaraya_watson(z, yy) cv = np.sum((y-out)**2) / np.float(n) # return cv def boot_h(h, x, y): """ Helper function that calculates bootstrap function for the Nadaraya-Watson estimator, which is basically the mean square error where model estimate is replaced by the jackknife estimate (Haerdle et al. 2000). This does basically cross_valid_h for 100 random points. """ n = 100 ind = np.random.randint(x.shape[0],size=n) # allocate output out = np.empty(n) # Loop through each bootstrap point for i in range(n): # all-1 points xx = np.delete(x,i,axis=0) yy = np.delete(y,i,axis=0) z = (xx - x[i,:]) / h out[i] = nadaraya_watson(z, yy) cv = np.sum((y[ind]-out)**2) / np.float(n) # return cv def nadaraya_watson(z, y): """ Helper function that calculates the Nadaraya-Watson estimator for a given kernel. Until now there is only the gaussian kernel. """ kerf = (1./np.sqrt(2.*np.pi)) * np.exp(-0.5*z*z) w = np.prod(kerf,1) out = division(np.dot(w,y), np.sum(w), np.nan) # return out if __name__ == '__main__': import doctest doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE) # nn = 1000 # x = np.zeros((nn,2)) # x[:,0] = np.arange(nn,dtype=np.float)/float(nn-1) # x[:,1] = 1./(x[:,0]+0.1) # y = 1. + x[:,0]**2 - np.sin(x[:,1])**2 # h = kernel_regression_h(x,y) # print(h) # yy = kernel_regression(x,y,h,xout=x) # print(yy[0], yy[-1]) # print(kernel_regression(x,y)) # h = kernel_regression_h(x,y,silverman=True) # print(h) # print(kernel_regression(x,y,h)) # ss = np.shape(x) # nn = 5 # xx = np.empty((nn,ss[1])) # xx[:,0] = np.amin(x[:,0]) + (np.amax(x[:,0])-np.amin(x[:,0])) * np.arange(nn,dtype=np.float)/np.float(nn) # xx[:,1] = np.amin(x[:,1]) + (np.amax(x[:,1])-np.amin(x[:,1])) * np.arange(nn,dtype=np.float)/np.float(nn) # print(kernel_regression(x,y,h,xout=xx))
36.569444
117
0.574554
1,860
13,165
4.033333
0.210753
0.049054
0.022661
0.023994
0.78819
0.77606
0.739136
0.732471
0.714609
0.667955
0
0.057134
0.294037
13,165
359
118
36.671309
0.750054
0.644512
0
0.397727
0
0
0.036904
0
0
0
0
0
0.045455
1
0.056818
false
0
0.056818
0
0.170455
0.011364
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
548736d777ce94aa7c904ef922ba0079338cf146
278
py
Python
grr/client/grr_response_client/windows/registry_init.py
khanhgithead/grr
8ad8a4d2c5a93c92729206b7771af19d92d4f915
[ "Apache-2.0" ]
4,238
2015-01-01T15:34:50.000Z
2022-03-31T08:18:05.000Z
grr/client/grr_response_client/windows/registry_init.py
khanhgithead/grr
8ad8a4d2c5a93c92729206b7771af19d92d4f915
[ "Apache-2.0" ]
787
2015-01-02T21:34:24.000Z
2022-03-02T13:26:38.000Z
grr/client/grr_response_client/windows/registry_init.py
khanhgithead/grr
8ad8a4d2c5a93c92729206b7771af19d92d4f915
[ "Apache-2.0" ]
856
2015-01-02T02:50:11.000Z
2022-03-31T11:11:53.000Z
#!/usr/bin/env python """This module contains windows specific client code.""" from grr_response_client.windows import regconfig from grr_response_core.lib import config_parser def RegisterPlugins(): config_parser.RegisterParserClass("reg", regconfig.RegistryConfigParser)
27.8
74
0.820144
34
278
6.529412
0.735294
0.063063
0.135135
0
0
0
0
0
0
0
0
0
0.093525
278
9
75
30.888889
0.880952
0.255396
0
0
0
0
0.014925
0
0
0
0
0
0
1
0.25
true
0
0.5
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
5
548791ea84da096caa23b6ae61d1744eac2328b4
254
py
Python
grades/admin.py
amitpeshwani/question_template
b906dad9140e81ef2d520b9f146c8fa3376b7700
[ "Python-2.0" ]
1
2022-03-21T11:14:17.000Z
2022-03-21T11:14:17.000Z
grades/admin.py
amitpeshwani/question_template
b906dad9140e81ef2d520b9f146c8fa3376b7700
[ "Python-2.0" ]
null
null
null
grades/admin.py
amitpeshwani/question_template
b906dad9140e81ef2d520b9f146c8fa3376b7700
[ "Python-2.0" ]
null
null
null
from django.contrib import admin from grades.models import GradingSystem, GradeRange class GradingSystemAdmin(admin.ModelAdmin): readonly_fields = ('creator',) admin.site.register(GradingSystem, GradingSystemAdmin) admin.site.register(GradeRange)
25.4
54
0.818898
27
254
7.666667
0.62963
0.222222
0.164251
0
0
0
0
0
0
0
0
0
0.094488
254
9
55
28.222222
0.9
0
0
0
0
0
0.027559
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
5489e9dc520111d9647f5d20d352c8c111c7ec33
33
py
Python
etsi0014_server/asgi.py
NovusQ/etsi0014_server
a306425e542c16555ab9754e2d7e6076b7f0a481
[ "MIT" ]
null
null
null
etsi0014_server/asgi.py
NovusQ/etsi0014_server
a306425e542c16555ab9754e2d7e6076b7f0a481
[ "MIT" ]
null
null
null
etsi0014_server/asgi.py
NovusQ/etsi0014_server
a306425e542c16555ab9754e2d7e6076b7f0a481
[ "MIT" ]
null
null
null
from .main import app app = app
8.25
21
0.69697
6
33
3.833333
0.666667
0.521739
0
0
0
0
0
0
0
0
0
0
0.242424
33
3
22
11
0.92
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
54b3fb1a9110cda51f9442e933eeb418e8bfaef1
172
py
Python
pymc/examples/run_simple_von_mises.py
matthew-brett/pymc
3a31613f056e7993a449d89bafef5fdaa40d47e9
[ "MIT" ]
5
2015-12-03T09:42:44.000Z
2021-06-06T19:23:29.000Z
pymc/examples/run_simple_von_mises.py
matthew-brett/pymc
3a31613f056e7993a449d89bafef5fdaa40d47e9
[ "MIT" ]
1
2016-09-27T02:00:41.000Z
2016-09-27T02:15:32.000Z
pymc/examples/run_simple_von_mises.py
matthew-brett/pymc
3a31613f056e7993a449d89bafef5fdaa40d47e9
[ "MIT" ]
1
2017-10-27T13:27:32.000Z
2017-10-27T13:27:32.000Z
import pymc import simple_von_mises model=pymc.MCMC(simple_von_mises) model.sample(iter=1000, burn=500, thin=2) print 'mu',model.mu.value print 'kappa',model.kappa.value
19.111111
41
0.790698
30
172
4.4
0.6
0.136364
0.212121
0.287879
0
0
0
0
0
0
0
0.050633
0.081395
172
8
42
21.5
0.78481
0
0
0
0
0
0.040698
0
0
0
0
0
0
0
null
null
0
0.333333
null
null
0.333333
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
5
54b54a30103fbc7693f4f27d38c13536bcd9170d
175
py
Python
allauth/socialaccount/providers/edmodo_provider/urls.py
Fuzzwah/django-allauth
071cbef1388bb61a563d3e41197bd5b7c26664d2
[ "MIT" ]
null
null
null
allauth/socialaccount/providers/edmodo_provider/urls.py
Fuzzwah/django-allauth
071cbef1388bb61a563d3e41197bd5b7c26664d2
[ "MIT" ]
null
null
null
allauth/socialaccount/providers/edmodo_provider/urls.py
Fuzzwah/django-allauth
071cbef1388bb61a563d3e41197bd5b7c26664d2
[ "MIT" ]
null
null
null
from allauth.socialaccount.providers.oauth2_provider.urls import default_urlpatterns from .provider import EdmodoProvider urlpatterns = default_urlpatterns(EdmodoProvider)
25
84
0.874286
18
175
8.333333
0.611111
0.24
0
0
0
0
0
0
0
0
0
0.006211
0.08
175
6
85
29.166667
0.925466
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
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
0
0
1
0
1
0
0
5
54c742a5b8a6613c3f70f51340d181f47a0826fc
242
py
Python
poop/hfdp/command/diner_lambda/waitress.py
cassiobotaro/poop
fc218fbf638c50da8ea98dab7de26ad2a52e83f5
[ "MIT" ]
37
2020-12-27T00:13:07.000Z
2022-01-31T19:30:18.000Z
poop/hfdp/command/diner_lambda/waitress.py
cassiobotaro/poop
fc218fbf638c50da8ea98dab7de26ad2a52e83f5
[ "MIT" ]
null
null
null
poop/hfdp/command/diner_lambda/waitress.py
cassiobotaro/poop
fc218fbf638c50da8ea98dab7de26ad2a52e83f5
[ "MIT" ]
7
2020-12-26T22:33:47.000Z
2021-11-07T01:29:59.000Z
from poop.hfdp.command.diner_lambda.order import Order class Waitress: def __init__(self) -> None: self.order: Order | None = None def take_order(self, order: Order) -> None: self.order = order self.order()
22
54
0.640496
32
242
4.65625
0.46875
0.241611
0.281879
0.241611
0
0
0
0
0
0
0
0
0.252066
242
10
55
24.2
0.823204
0
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.571429
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
49a41ad64e79bf1d5bec57a6458d755706772f87
138
py
Python
backend/env/lib/python3.8/site-packages/zmq/tests/asyncio/test_asyncio.py
lubitelpospat/CFM-source
4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03
[ "MIT" ]
130
2018-02-03T10:25:54.000Z
2022-03-25T22:27:22.000Z
backend/env/lib/python3.8/site-packages/zmq/tests/asyncio/test_asyncio.py
lubitelpospat/CFM-source
4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03
[ "MIT" ]
26
2020-03-24T18:07:06.000Z
2022-03-12T00:12:27.000Z
backend/env/lib/python3.8/site-packages/zmq/tests/asyncio/test_asyncio.py
lubitelpospat/CFM-source
4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03
[ "MIT" ]
64
2018-04-25T08:51:57.000Z
2022-01-29T14:13:57.000Z
"""Test asyncio support""" try: from ._test_asyncio import TestAsyncIOSocket, TestAsyncioAuthentication except SyntaxError: pass
19.714286
75
0.775362
13
138
8.076923
0.846154
0.209524
0
0
0
0
0
0
0
0
0
0
0.152174
138
6
76
23
0.897436
0.144928
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.25
0
0.25
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
49db8a042557ebcb1373bd0faf85fa03fe2d10e7
169
py
Python
setup.py
ntapiam/o3iss
b0bfc8225ff9676cc710388ed90eecfaf8534fe9
[ "MIT" ]
null
null
null
setup.py
ntapiam/o3iss
b0bfc8225ff9676cc710388ed90eecfaf8534fe9
[ "MIT" ]
null
null
null
setup.py
ntapiam/o3iss
b0bfc8225ff9676cc710388ed90eecfaf8534fe9
[ "MIT" ]
null
null
null
from setuptools import setup from setuptools_rust import RustExtension, Binding setup( rust_extensions=[RustExtension("o3iss.o3iss", binding=Binding.RustCPython)] )
28.166667
79
0.816568
19
169
7.157895
0.526316
0.205882
0
0
0
0
0
0
0
0
0
0.013158
0.100592
169
5
80
33.8
0.881579
0
0
0
0
0
0.065089
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
b72cb1ae84b4bb2e4b0421cc145fdec53258f3a0
62
py
Python
vv/conf/__init__.py
synw/django-vitevue
231da517dc3a3087548165bc1213d6752d4fbfb0
[ "MIT" ]
30
2017-05-21T19:43:53.000Z
2022-03-13T18:48:40.000Z
vv/conf/__init__.py
synw/django-vitevue
231da517dc3a3087548165bc1213d6752d4fbfb0
[ "MIT" ]
null
null
null
vv/conf/__init__.py
synw/django-vitevue
231da517dc3a3087548165bc1213d6752d4fbfb0
[ "MIT" ]
null
null
null
# flake8: noqa F401 from vv.conf.manager import VvConfManager
20.666667
41
0.806452
9
62
5.555556
1
0
0
0
0
0
0
0
0
0
0
0.074074
0.129032
62
2
42
31
0.851852
0.274194
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3f7f29a1bf57d1f161bf78d17bb1a5545a96cb5c
80
py
Python
ardomino/__init__.py
rshk/ardomino-api
cd0cba057b56e412b2e10868d5995c71ffa62440
[ "BSD-3-Clause" ]
1
2019-06-13T15:55:31.000Z
2019-06-13T15:55:31.000Z
ardomino/__init__.py
rshk/ardomino-api
cd0cba057b56e412b2e10868d5995c71ffa62440
[ "BSD-3-Clause" ]
null
null
null
ardomino/__init__.py
rshk/ardomino-api
cd0cba057b56e412b2e10868d5995c71ffa62440
[ "BSD-3-Clause" ]
null
null
null
from .models import db, SensorReading from .api import api from .app import app
20
37
0.7875
13
80
4.846154
0.538462
0
0
0
0
0
0
0
0
0
0
0
0.1625
80
3
38
26.666667
0.940299
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3f8872f3cfa17b343dd801778730afe30ba6c7ff
19
py
Python
tests/unit/rq_examples/__init__.py
evansde77/rq_examples
0e9e15310d56a3c50161ab410ac8f69987398bac
[ "Apache-2.0" ]
null
null
null
tests/unit/rq_examples/__init__.py
evansde77/rq_examples
0e9e15310d56a3c50161ab410ac8f69987398bac
[ "Apache-2.0" ]
2
2016-09-07T15:59:19.000Z
2016-09-07T16:07:41.000Z
tests/unit/golems/__init__.py
evansde77/golems
01355c900662efc58542adce71e59e153802ba2b
[ "Apache-2.0" ]
null
null
null
#created by cirrus
9.5
18
0.789474
3
19
5
1
0
0
0
0
0
0
0
0
0
0
0
0.157895
19
1
19
19
0.9375
0.894737
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
3fb1bc9e12a65a0da06e5c2a47e98abbeb3b89a4
25
py
Python
peano/__init__.py
tannakaken/peanocurvestroke
1ff5d0cccfa6b555948554eb6408c01c27feb818
[ "MIT" ]
1
2019-09-15T05:39:59.000Z
2019-09-15T05:39:59.000Z
peano/__init__.py
tannakaken/peanocurvestroke
1ff5d0cccfa6b555948554eb6408c01c27feb818
[ "MIT" ]
null
null
null
peano/__init__.py
tannakaken/peanocurvestroke
1ff5d0cccfa6b555948554eb6408c01c27feb818
[ "MIT" ]
null
null
null
from peano.main import *
12.5
24
0.76
4
25
4.75
1
0
0
0
0
0
0
0
0
0
0
0
0.16
25
1
25
25
0.904762
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3fd00e11c764a68a38ff8d0fec5cd211e04f79f4
12,120
py
Python
balukaa/ledger/tests.py
shaj/balukaa
76d3509e1a3079f9f4f4192f11bf7dd81dfc5fa8
[ "MIT" ]
null
null
null
balukaa/ledger/tests.py
shaj/balukaa
76d3509e1a3079f9f4f4192f11bf7dd81dfc5fa8
[ "MIT" ]
null
null
null
balukaa/ledger/tests.py
shaj/balukaa
76d3509e1a3079f9f4f4192f11bf7dd81dfc5fa8
[ "MIT" ]
null
null
null
from datetime import date from decimal import Decimal from django.test import TestCase from django.utils import timezone from .models import LedgerAccount, LedgerEntry ACCOUNTS = [ (50, 'Касса', 'Кассы', LedgerAccount.AccountTypes.ACTIVE), (51, 'РСчет', 'Расчетные счета', LedgerAccount.AccountTypes.ACTIVE), (60, 'Поставщики', 'Расчеты с поставщиками и подрядчиками', LedgerAccount.AccountTypes.VARIABLE), (41, 'Товары', 'Товары для продажи', LedgerAccount.AccountTypes.ACTIVE), (62, 'Покупатели', 'Расчеты с покупателями и заказчиками', LedgerAccount.AccountTypes.VARIABLE), (66, 'КЗаймы', 'Расчеты по краткосрочным кредитам и займам', LedgerAccount.AccountTypes.SOURCE), (67, 'ДЗаймы', 'Расчеты по долгосрочным кредитам и займам', LedgerAccount.AccountTypes.SOURCE), ] # Create your tests here. class TestAccounts(TestCase): def test_main(self): self.assertEqual(LedgerAccount.objects.count(), 0) class TestEntries(TestCase): def setUp(self): self.accounts = dict() for el in ACCOUNTS: self.accounts[str(el[0])] = LedgerAccount.objects.create( number=el[0], name=el[1], full_name=el[2], type=el[3] ) def test_main_one(self): LedgerEntry.objects.create( date=date(2021, 1, 11), account_one=self.accounts['50'], # Касса account_two=self.accounts['60'], # Поставщики type=LedgerEntry.EntryTypes.FALL.value, amount=500.00, status=False # created_at=timezone.now(), # updated_at=timezone.now(), ) self.assertEqual(LedgerEntry.objects.count(), 1) ENTRIES1 = [ (date(2021, 1, 11), '51', '50', LedgerEntry.EntryTypes.MOVE, '1100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 13), '50', '60', LedgerEntry.EntryTypes.FALL, '1200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 15), '41', '60', LedgerEntry.EntryTypes.RISE, '1300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 17), '41', '62', LedgerEntry.EntryTypes.FALL, '1400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 19), '51', '50', LedgerEntry.EntryTypes.MOVE, '2100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 21), '50', '60', LedgerEntry.EntryTypes.FALL, '2200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 23), '41', '60', LedgerEntry.EntryTypes.RISE, '2300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.ENABLE), (date(2021, 2, 10), '41', '62', LedgerEntry.EntryTypes.FALL, '2400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.ENABLE), (date(2021, 2, 12), '51', '50', LedgerEntry.EntryTypes.MOVE, '3100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.ENABLE), (date(2021, 2, 14), '50', '60', LedgerEntry.EntryTypes.FALL, '3200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.ENABLE), (date(2021, 2, 16), '41', '60', LedgerEntry.EntryTypes.RISE, '3300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.ENABLE), (date(2021, 2, 18), '41', '62', LedgerEntry.EntryTypes.FALL, '3400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 11), '51', '50', LedgerEntry.EntryTypes.MOVE, '4100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 13), '50', '60', LedgerEntry.EntryTypes.FALL, '4200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 15), '41', '60', LedgerEntry.EntryTypes.RISE, '4300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 17), '41', '62', LedgerEntry.EntryTypes.FALL, '4400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.ENABLE), ] class TestAccountCard(TestCase): """ Тестирование функций, относящихся к формированию отчета "Карточка счета" """ def setUp(self) -> None: self.accounts = dict() for el in ACCOUNTS: self.accounts[str(el[0])] = LedgerAccount.objects.create( number=el[0], name=el[1], full_name=el[2], type=el[3] ) def test_initdb(self): for el in ENTRIES1: LedgerEntry.objects.create( date=el[0], account_one=self.accounts[el[1]], account_two=self.accounts[el[2]], type=el[3], amount=el[4], comment=el[5], status=el[6] ) self.assertEqual(LedgerEntry.objects.count(), len(ENTRIES1)) def test_empty_entries(self): self.assertEqual(LedgerEntry.objects.count(), 0) arrival = self.accounts['50'].get_arrival(date(2021, 1, 1), date(2022, 1, 1)) self.assertEqual(str(arrival), '0.00') expense = self.accounts['50'].get_expense(date(2021, 1, 1), date(2022, 1, 1)) self.assertEqual(str(expense), '0.00') balance = self.accounts['50'].get_remains(date(2021, 1, 1), date(2022, 1, 1)) d = { 'arrival': Decimal('0.00'), 'expense': Decimal('0.00'), 'balance': Decimal('0.00'), } self.assertDictEqual(balance, d) class TestACard_Entries1(TestCase): def setUp(self) -> None: self.accounts = dict() for el in ACCOUNTS: self.accounts[str(el[0])] = LedgerAccount.objects.create( number=el[0], name=el[1], full_name=el[2], type=el[3] ) for el in ENTRIES1: LedgerEntry.objects.create( date=el[0], account_one=self.accounts[el[1]], account_two=self.accounts[el[2]], type=el[3], amount=el[4], comment=el[5], status=el[6] ) def test_balance_output_format(self): arrival = self.accounts['50'].get_arrival(date(2021, 1, 1), date(2022, 1, 1)) self.assertEqual(str(arrival), '10400.04') expense = self.accounts['50'].get_expense(date(2021, 1, 1), date(2022, 1, 1)) self.assertEqual(str(expense), '10800.08') balance = self.accounts['50'].get_remains(date(2021, 1, 1), date(2022, 1, 1)) self.assertEqual(str(balance['arrival']), '10400.04') self.assertEqual(str(balance['expense']), '10800.08') self.assertEqual(str(balance['balance']), '-400.04') def test_balance(self): balance = self.accounts['50'].get_remains(date(2021, 1, 1), date(2022, 1, 1)) # pprint(balance) d = { 'arrival': Decimal('10400.04'), 'expense': Decimal('10800.08'), 'balance': Decimal('-400.04'), } self.assertDictEqual(balance, d) def test_balance_datelimit_50(self): balance = self.accounts['50'].get_remains(date(2021, 1, 17), date(2021, 3, 11)) # pprint(balance) d = { 'arrival': Decimal('9300.03'), 'expense': Decimal('5400.04'), 'balance': Decimal('3899.99'), } self.assertDictEqual(balance, d) def test_balance_datelimit_wrong_date(self): balance = self.accounts['51'].get_remains(date(2021, 1, 17), date(2021, 1, 1)) # pprint(balance) d = { 'arrival': Decimal('0.00'), 'expense': Decimal('0.00'), 'balance': Decimal('0.00'), } self.assertDictEqual(balance, d) def test_balance_datelimit_zero_summ(self): balance = self.accounts['60'].get_remains(date(2021, 1, 16), date(2021, 1, 20)) # pprint(balance) d = { 'arrival': Decimal('0.00'), 'expense': Decimal('0.00'), 'balance': Decimal('0.00'), } self.assertDictEqual(balance, d) def test_balance_datelimit_enother_account(self): balance = self.accounts['62'].get_remains(date(2021, 1, 17), date(2021, 3, 11)) # pprint(balance) d = { 'arrival': Decimal('5600.06'), 'expense': Decimal('7200.12'), 'balance': Decimal('-1600.06'), } self.assertDictEqual(balance, d) ENTRIES2 = [ (date(2021, 1, 11), '51', '50', LedgerEntry.EntryTypes.MOVE, '1100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 13), '50', '60', LedgerEntry.EntryTypes.FALL, '1200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 15), '41', '60', LedgerEntry.EntryTypes.RISE, '1300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 17), '41', '62', LedgerEntry.EntryTypes.FALL, '1400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 19), '51', '50', LedgerEntry.EntryTypes.MOVE, '2100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 21), '50', '60', LedgerEntry.EntryTypes.FALL, '2200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.ENABLE), (date(2021, 1, 23), '41', '60', LedgerEntry.EntryTypes.RISE, '2300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.DISABLE), (date(2021, 2, 10), '41', '62', LedgerEntry.EntryTypes.FALL, '2400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.DISABLE), (date(2021, 2, 12), '51', '50', LedgerEntry.EntryTypes.MOVE, '3100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.DISABLE), (date(2021, 2, 14), '50', '60', LedgerEntry.EntryTypes.FALL, '3200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.DISABLE), (date(2021, 2, 16), '41', '60', LedgerEntry.EntryTypes.RISE, '3300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.ENABLE), (date(2021, 2, 18), '41', '62', LedgerEntry.EntryTypes.FALL, '3400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 11), '51', '50', LedgerEntry.EntryTypes.MOVE, '4100.01', 'Снятие с рсчета в кассу', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 13), '50', '60', LedgerEntry.EntryTypes.FALL, '4200.02', 'Оплата из кассы поставщику', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 15), '41', '60', LedgerEntry.EntryTypes.RISE, '4300.03', 'Поступление товара от поставщика', LedgerEntry.Statuses.ENABLE), (date(2021, 3, 17), '41', '62', LedgerEntry.EntryTypes.FALL, '4400.04', 'Отгрузка товара покупателю', LedgerEntry.Statuses.ENABLE), ] class TestACard_Entries2(TestCase): def setUp(self) -> None: self.accounts = dict() for el in ACCOUNTS: self.accounts[str(el[0])] = LedgerAccount.objects.create( number=el[0], name=el[1], full_name=el[2], type=el[3] ) for el in ENTRIES2: LedgerEntry.objects.create( date=el[0], account_one=self.accounts[el[1]], account_two=self.accounts[el[2]], type=el[3], amount=el[4], comment=el[5], status=el[6] ) def test_balance_datelimit_51(self): balance = self.accounts['51'].get_remains(date(2021, 1, 17), date(2021, 3, 11)) # pprint(balance) d = { 'arrival': Decimal('0.00'), 'expense': Decimal('6200.02'), 'balance': Decimal('-6200.02'), } self.assertDictEqual(balance, d) def test_balance_datelimit_67(self): balance = self.accounts['67'].get_remains(date(2021, 1, 17), date(2021, 3, 11)) # pprint(balance) d = { 'arrival': Decimal('0.00'), 'expense': Decimal('4800.08'), 'balance': Decimal('-4800.08'), } self.assertDictEqual(balance, d)
41.506849
101
0.592739
1,430
12,120
4.981818
0.134965
0.058394
0.0379
0.105839
0.778214
0.759545
0.742701
0.73849
0.717434
0.716592
0
0.106982
0.247277
12,120
291
102
41.649485
0.673901
0.023102
0
0.604082
0
0
0.157115
0
0
0
0
0
0.077551
1
0.065306
false
0
0.020408
0
0.106122
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
3fd0b51ae79c3de6fccfa6ed97b2807a63e95fff
209
py
Python
Desafio 034.py
giovannibn/Curso_em_video
57455f384c21f6d94d59e2d2199afcab9b9179bb
[ "MIT" ]
null
null
null
Desafio 034.py
giovannibn/Curso_em_video
57455f384c21f6d94d59e2d2199afcab9b9179bb
[ "MIT" ]
null
null
null
Desafio 034.py
giovannibn/Curso_em_video
57455f384c21f6d94d59e2d2199afcab9b9179bb
[ "MIT" ]
null
null
null
salario=float(input('Digite seu salário')) if salario<=1250: print('Seu salário com aumento será de R$ {}'.format(salario*1.15)) else: print('Seu salário com aumento será de R$ {}'.format(salario*1.1))
41.8
71
0.69378
34
209
4.264706
0.529412
0.206897
0.206897
0.248276
0.634483
0.634483
0.634483
0.634483
0.634483
0.634483
0
0.05
0.138756
209
5
72
41.8
0.755556
0
0
0
0
0
0.438095
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
0
0
0
null
1
1
1
0
0
0
0
0
1
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
5
3fd3ab112a772a2d0e3cfc7d27fcfbd2e5345e73
279
py
Python
backend/tasker_business/admin.py
crowdbotics-apps/lean-29662
5e49cbd9ef911e2f53476a63cf0b7c58d3ee5d58
[ "FTL", "AML", "RSA-MD" ]
null
null
null
backend/tasker_business/admin.py
crowdbotics-apps/lean-29662
5e49cbd9ef911e2f53476a63cf0b7c58d3ee5d58
[ "FTL", "AML", "RSA-MD" ]
24
2021-08-16T04:34:36.000Z
2021-10-31T17:23:31.000Z
backend/tasker_business/admin.py
crowdbotics-apps/lean-29662
5e49cbd9ef911e2f53476a63cf0b7c58d3ee5d58
[ "FTL", "AML", "RSA-MD" ]
null
null
null
from django.contrib import admin from .models import TaskerAvailability, TaskerSkill, Timeslot, BusinessPhoto admin.site.register(TaskerSkill) admin.site.register(TaskerAvailability) admin.site.register(BusinessPhoto) admin.site.register(Timeslot) # Register your models here.
27.9
76
0.83871
32
279
7.3125
0.4375
0.153846
0.290598
0.25641
0
0
0
0
0
0
0
0
0.078853
279
9
77
31
0.910506
0.09319
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3fefc621d072649beb881951d30b766028c67eca
62
py
Python
03_Day_Operators/13.py
diegofregolente/30-Days-Of-Python
e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267
[ "Apache-2.0" ]
null
null
null
03_Day_Operators/13.py
diegofregolente/30-Days-Of-Python
e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267
[ "Apache-2.0" ]
null
null
null
03_Day_Operators/13.py
diegofregolente/30-Days-Of-Python
e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267
[ "Apache-2.0" ]
null
null
null
a, b = 'python', 'jargon' print('on' in a and 'on' in b) # 13
31
36
0.548387
13
62
2.615385
0.692308
0.235294
0
0
0
0
0
0
0
0
0
0.041667
0.225806
62
2
36
31
0.666667
0.032258
0
0
0
0
0.271186
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
3ffe126ba0443207aa426d0f3e2b19272de6236d
31
py
Python
PaddleCV/tracking/ltr/data/__init__.py
suytingwan/models
ccdbfe77d071cc19b55fb9f4b738912e35d982ef
[ "Apache-2.0" ]
5
2021-09-28T13:28:01.000Z
2021-12-21T07:25:44.000Z
PaddleCV/tracking/ltr/data/__init__.py
suytingwan/models
ccdbfe77d071cc19b55fb9f4b738912e35d982ef
[ "Apache-2.0" ]
1
2019-11-18T03:03:37.000Z
2019-11-18T03:03:37.000Z
PaddleCV/tracking/ltr/data/__init__.py
suytingwan/models
ccdbfe77d071cc19b55fb9f4b738912e35d982ef
[ "Apache-2.0" ]
4
2021-08-11T08:25:10.000Z
2021-10-16T07:41:59.000Z
from .loader import LTRLoader
15.5
30
0.806452
4
31
6.25
1
0
0
0
0
0
0
0
0
0
0
0
0.16129
31
1
31
31
0.961538
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
b75bc16268f53ec1b7ca372295be63dc91ab3ead
134
py
Python
hpe_benchmark/models/__init__.py
anotherTK/human-pose-estimation.pytorch
9c2b1fa6b5b4d70cd5f4c72a915f953a4257a994
[ "MIT" ]
null
null
null
hpe_benchmark/models/__init__.py
anotherTK/human-pose-estimation.pytorch
9c2b1fa6b5b4d70cd5f4c72a915f953a4257a994
[ "MIT" ]
null
null
null
hpe_benchmark/models/__init__.py
anotherTK/human-pose-estimation.pytorch
9c2b1fa6b5b4d70cd5f4c72a915f953a4257a994
[ "MIT" ]
null
null
null
from .mspn import MSPN from .p_resnet import PRESN from .hrnet import PHRN from .efficient import PEFFN from .build import build_model
26.8
30
0.820896
22
134
4.909091
0.545455
0
0
0
0
0
0
0
0
0
0
0
0.141791
134
5
30
26.8
0.93913
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b777a4435e6d415ed4ec34f904d7f103a333e912
64
py
Python
7_kyu/Binary_Addition.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/Binary_Addition.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/Binary_Addition.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
def add_binary(a: int,b: int) -> str: return format(a+b,"b")
32
37
0.609375
13
64
2.923077
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.171875
64
2
38
32
0.716981
0
0
0
0
0
0.015385
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
b79247a8aa42a25237f0e2c9a0d685d0a95e17c6
137
py
Python
sarabande/__init__.py
James11222/sarabande
387cafede311be8c7069e5ae6fe3cf42c198ccda
[ "MIT" ]
null
null
null
sarabande/__init__.py
James11222/sarabande
387cafede311be8c7069e5ae6fe3cf42c198ccda
[ "MIT" ]
null
null
null
sarabande/__init__.py
James11222/sarabande
387cafede311be8c7069e5ae6fe3cf42c198ccda
[ "MIT" ]
null
null
null
from sarabande.utils import * from sarabande.main import measure from sarabande.full_PCF_parallel import calc_zeta_parallel as calc_zeta
34.25
71
0.868613
21
137
5.428571
0.571429
0.342105
0
0
0
0
0
0
0
0
0
0
0.10219
137
3
72
45.666667
0.926829
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
b7d911adc2686df6e13002f2c59ac1f17b4b26fb
174
py
Python
src/tekisuto/preprocessing/__init__.py
AU-DATALAB/newsFluxus
20522b2c8c830d2377a9620d149a515baaaa9cf4
[ "MIT" ]
null
null
null
src/tekisuto/preprocessing/__init__.py
AU-DATALAB/newsFluxus
20522b2c8c830d2377a9620d149a515baaaa9cf4
[ "MIT" ]
null
null
null
src/tekisuto/preprocessing/__init__.py
AU-DATALAB/newsFluxus
20522b2c8c830d2377a9620d149a515baaaa9cf4
[ "MIT" ]
null
null
null
from .casefolder import CaseFolder from .lemmatizer import Lemmatizer from .regxfilter import RegxFilter from .tokenizer import Tokenizer from .swfilter import StopWordFilter
34.8
36
0.862069
20
174
7.5
0.4
0
0
0
0
0
0
0
0
0
0
0
0.109195
174
5
36
34.8
0.967742
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4d4a342f9a9b681a70995bd1af3d22d025801b12
258
py
Python
04/s4.py
sasa-buklijas/57-challenges-to-develop-your-coding-skills
dda51fd2ca5c4f2a6befc5b501c4340f25b29753
[ "MIT" ]
3
2018-08-27T10:28:31.000Z
2019-01-09T21:22:29.000Z
04/s4.py
sasa-buklijas/57-challenges-to-develop-your-coding-skills
dda51fd2ca5c4f2a6befc5b501c4340f25b29753
[ "MIT" ]
null
null
null
04/s4.py
sasa-buklijas/57-challenges-to-develop-your-coding-skills
dda51fd2ca5c4f2a6befc5b501c4340f25b29753
[ "MIT" ]
1
2019-02-07T22:15:21.000Z
2019-02-07T22:15:21.000Z
noun = raw_input("Enter a noun: ") verb = raw_input("Enter a verb: ") adjective = raw_input("Enter an adjective: ") adverb = raw_input("Enter an adverb: ") print "Do you " + verb + " your " + adjective + " " + noun + " " + adverb + " ? That's hilarious!"
32.25
99
0.616279
35
258
4.428571
0.457143
0.206452
0.335484
0.180645
0
0
0
0
0
0
0
0
0.209302
258
7
100
36.857143
0.759804
0
0
0
0
0
0.389105
0
0
0
0
0
0
0
null
null
0
0
null
null
0.2
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
4d7a4c27e98cf50b630a9722ba33e2b4efe29e39
120
py
Python
handlers/FeedTypes.py
zd08135/qihoo360-problem
918fa984df91eff0738dafaca091766bf1ac353d
[ "MIT" ]
null
null
null
handlers/FeedTypes.py
zd08135/qihoo360-problem
918fa984df91eff0738dafaca091766bf1ac353d
[ "MIT" ]
null
null
null
handlers/FeedTypes.py
zd08135/qihoo360-problem
918fa984df91eff0738dafaca091766bf1ac353d
[ "MIT" ]
null
null
null
class FeedType: FOLLOW = "follow" CREATE_REPOSITORY = "create_repository" CREATE_FORK = "create_fork"
17.142857
43
0.675
12
120
6.416667
0.5
0.415584
0.571429
0
0
0
0
0
0
0
0
0
0.241667
120
7
44
17.142857
0.846154
0
0
0
0
0
0.283333
0
0
0
0
0
0
1
0
false
0
0
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
4dad92bd87c7777b49dc8844beca2e07a2ec29bb
126
py
Python
server/mocks/mock_script.py
Aramis13/green-specs
469b39950a9d40f6923f7ee4f8da4dbd40b1bc12
[ "MIT" ]
3
2020-03-28T18:19:14.000Z
2020-05-23T18:23:29.000Z
server/mocks/mock_script.py
Aramis13/green-specs
469b39950a9d40f6923f7ee4f8da4dbd40b1bc12
[ "MIT" ]
41
2020-04-01T08:24:40.000Z
2020-06-01T18:23:29.000Z
server/mocks/mock_script.py
Aramis13/green-specs
469b39950a9d40f6923f7ee4f8da4dbd40b1bc12
[ "MIT" ]
null
null
null
import sys print('This is a mock python script!') print('First param: ' + sys.argv[1]) print('Second param: ' + sys.argv[2])
21
38
0.666667
21
126
4
0.714286
0.190476
0.285714
0
0
0
0
0
0
0
0
0.018692
0.150794
126
5
39
25.2
0.766355
0
0
0
0
0
0.444444
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0.75
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
4debcdac71280a8593edadb2c665b1ce48696490
40
py
Python
jupiter/domain/recurring_tasks/__init__.py
horia141/jupiter
2c721d1d44e1cd2607ad9936e54a20ea254741dc
[ "MIT" ]
15
2019-05-05T14:34:58.000Z
2022-02-25T09:57:28.000Z
jupiter/domain/recurring_tasks/__init__.py
horia141/jupiter
2c721d1d44e1cd2607ad9936e54a20ea254741dc
[ "MIT" ]
3
2020-02-22T16:09:39.000Z
2021-12-18T21:33:06.000Z
jupiter/domain/recurring_tasks/__init__.py
horia141/jupiter
2c721d1d44e1cd2607ad9936e54a20ea254741dc
[ "MIT" ]
null
null
null
"""Domain logic for recurring tasks."""
20
39
0.7
5
40
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.125
40
1
40
40
0.8
0.825
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
4df5500935f268041187bc309efd05df3bf28444
122
py
Python
users-backend/users/admin_api/mutation.py
pythonitalia/pycon
14e03b2158916f9437fdbde70e48e5bf5266997e
[ "MIT" ]
56
2018-01-20T17:18:40.000Z
2022-03-28T22:42:04.000Z
users-backend/users/admin_api/mutation.py
pythonitalia/pycon
14e03b2158916f9437fdbde70e48e5bf5266997e
[ "MIT" ]
2,029
2018-01-20T11:37:24.000Z
2022-03-31T04:10:51.000Z
users-backend/users/admin_api/mutation.py
pythonitalia/pycon
14e03b2158916f9437fdbde70e48e5bf5266997e
[ "MIT" ]
17
2018-03-17T09:44:28.000Z
2021-12-27T19:57:35.000Z
from strawberry.tools import create_type from .mutations.login import login Mutation = create_type("Mutation", [login])
20.333333
43
0.795082
16
122
5.9375
0.5625
0.210526
0
0
0
0
0
0
0
0
0
0
0.114754
122
5
44
24.4
0.87963
0
0
0
0
0
0.065574
0
0
0
0
0
0
1
0
false
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
0
0
1
0
1
0
0
5
127d7d1e5a28d0e21d9eb04a7a282dce1b4669b2
151
py
Python
Whole-App-Acceleration/apps/resnet50/build_flow/DPUCADF8H_u200/scripts/utility/readme_gen/gs_summary.py
hito0512/Vitis-AI
996459fb96cb077ed2f7e789d515893b1cccbc95
[ "Apache-2.0" ]
848
2019-12-03T00:16:17.000Z
2022-03-31T22:53:17.000Z
dsa/WAA-TRD/proj/build/classification-pre_DPUv3int8/scripts/utility/readme_gen/gs_summary.py
wangyifan778/Vitis-AI
f61061eef7550d98bf02a171604c9a9f283a7c47
[ "Apache-2.0" ]
656
2019-12-03T00:48:46.000Z
2022-03-31T18:41:54.000Z
dsa/WAA-TRD/proj/build/classification-pre_DPUv3int8/scripts/utility/readme_gen/gs_summary.py
wangyifan778/Vitis-AI
f61061eef7550d98bf02a171604c9a9f283a7c47
[ "Apache-2.0" ]
506
2019-12-03T00:46:26.000Z
2022-03-30T10:34:56.000Z
#!/usr/bin/env python import os, re import fnmatch import json import sys sys.path.append(".") import gs_summary_util gs_summary_util.genReadMe(".")
13.727273
30
0.761589
24
151
4.625
0.666667
0.162162
0.234234
0
0
0
0
0
0
0
0
0
0.112583
151
10
31
15.1
0.828358
0.13245
0
0
0
0
0.015385
0
0
0
0
0
0
1
0
true
0
0.714286
0
0.714286
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
0
1
0
1
0
0
5
12c3991f9b56656e3605c7a260cc0f44466f36ff
12,774
py
Python
datasets/race_and_economic_opportunity/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers_dag.py
renovate-bot/public-datasets-pipelines
d2b5e527d9d2dcc8e01f5209e7b9409dfe2b62a8
[ "Apache-2.0" ]
90
2021-04-09T19:20:19.000Z
2022-03-31T16:03:14.000Z
datasets/race_and_economic_opportunity/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers_dag.py
renovate-bot/public-datasets-pipelines
d2b5e527d9d2dcc8e01f5209e7b9409dfe2b62a8
[ "Apache-2.0" ]
125
2021-04-19T20:33:26.000Z
2022-03-30T21:45:49.000Z
datasets/race_and_economic_opportunity/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers_dag.py
renovate-bot/public-datasets-pipelines
d2b5e527d9d2dcc8e01f5209e7b9409dfe2b62a8
[ "Apache-2.0" ]
54
2021-04-29T23:17:36.000Z
2022-03-31T05:15:23.000Z
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from airflow import DAG from airflow.contrib.operators import gcs_to_bq, kubernetes_pod_operator default_args = { "owner": "Google", "depends_on_past": False, "start_date": "2021-03-01", } with DAG( dag_id="race_and_economic_opportunity.national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers", default_args=default_args, max_active_runs=1, schedule_interval="@daily", catchup=False, default_view="graph", ) as dag: # Run CSV transform within kubernetes pod income_transition_transform_csv = kubernetes_pod_operator.KubernetesPodOperator( task_id="income_transition_transform_csv", startup_timeout_seconds=600, name="race_and_economic_opportunity_national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers", namespace="default", affinity={ "nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { "nodeSelectorTerms": [ { "matchExpressions": [ { "key": "cloud.google.com/gke-nodepool", "operator": "In", "values": ["pool-e2-standard-4"], } ] } ] } } }, image_pull_policy="Always", image="{{ var.json.race_and_economic_opportunity.container_registry.run_csv_transform_kub }}", env_vars={ "SOURCE_URL": "https://www2.census.gov/ces/opportunity/table_3-2.csv", "SOURCE_FILE": "files/data.csv", "TARGET_FILE": "files/data_output.csv", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "TARGET_GCS_PATH": "data/race_and_economic_opportunity/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers/data_output.csv", "CSV_HEADERS": '["kid_race","gender","count","kir_q1","kir_q2","kir_q3","kir_q4","kir_q5","kfr_q1","kfr_q2","kfr_q3","kfr_q4","kfr_q5","par_q1","par_q2","par_q3","par_q4","par_q5","kir_q1_cond_par_q1","kir_q1_cond_par_q2","kir_q1_cond_par_q3","kir_q1_cond_par_q4","kir_q1_cond_par_q5","kir_q2_cond_par_q1","kir_q2_cond_par_q2","kir_q2_cond_par_q3","kir_q2_cond_par_q4","kir_q2_cond_par_q5","kir_q3_cond_par_q1","kir_q3_cond_par_q2","kir_q3_cond_par_q3","kir_q3_cond_par_q4","kir_q3_cond_par_q5","kir_q4_cond_par_q1","kir_q4_cond_par_q2","kir_q4_cond_par_q3","kir_q4_cond_par_q4","kir_q4_cond_par_q5","kir_q5_cond_par_q1","kir_q5_cond_par_q2","kir_q5_cond_par_q3","kir_q5_cond_par_q4","kir_q5_cond_par_q5","kfr_q1_cond_par_q1","kfr_q1_cond_par_q2","kfr_q1_cond_par_q3","kfr_q1_cond_par_q4","kfr_q1_cond_par_q5","kfr_q2_cond_par_q1","kfr_q2_cond_par_q2","kfr_q2_cond_par_q3","kfr_q2_cond_par_q4","kfr_q2_cond_par_q5","kfr_q3_cond_par_q1","kfr_q3_cond_par_q2","kfr_q3_cond_par_q3","kfr_q3_cond_par_q4","kfr_q3_cond_par_q5","kfr_q4_cond_par_q1","kfr_q4_cond_par_q2","kfr_q4_cond_par_q3","kfr_q4_cond_par_q4","kfr_q4_cond_par_q5","kfr_q5_cond_par_q1","kfr_q5_cond_par_q2","kfr_q5_cond_par_q3","kfr_q5_cond_par_q4","kfr_q5_cond_par_q5"]', "RENAME_MAPPINGS": '{"kid_race": "kid_race","gender": "gender","count": "count","kir_q1": "kir_q1","kir_q2": "kir_q2","kir_q3": "kir_q3","kir_q4": "kir_q4","kir_q5": "kir_q5","kfr_q1": "kfr_q1","kfr_q2": "kfr_q2","kfr_q3": "kfr_q3","kfr_q4": "kfr_q4","kfr_q5": "kfr_q5","par_q1": "par_q1","par_q2": "par_q2","par_q3": "par_q3","par_q4": "par_q4","par_q5": "par_q5","kir_q1_cond_par_q1": "kir_q1_cond_par_q1","kir_q1_cond_par_q2": "kir_q1_cond_par_q2","kir_q1_cond_par_q3": "kir_q1_cond_par_q3","kir_q1_cond_par_q4": "kir_q1_cond_par_q4","kir_q1_cond_par_q5": "kir_q1_cond_par_q5","kir_q2_cond_par_q1": "kir_q2_cond_par_q1","kir_q2_cond_par_q2": "kir_q2_cond_par_q2","kir_q2_cond_par_q3": "kir_q2_cond_par_q3","kir_q2_cond_par_q4": "kir_q2_cond_par_q4","kir_q2_cond_par_q5": "kir_q2_cond_par_q5","kir_q3_cond_par_q1": "kir_q3_cond_par_q1","kir_q3_cond_par_q2": "kir_q3_cond_par_q2","kir_q3_cond_par_q3": "kir_q3_cond_par_q3","kir_q3_cond_par_q4": "kir_q3_cond_par_q4","kir_q3_cond_par_q5": "kir_q3_cond_par_q5","kir_q4_cond_par_q1": "kir_q4_cond_par_q1","kir_q4_cond_par_q2": "kir_q4_cond_par_q2","kir_q4_cond_par_q3": "kir_q4_cond_par_q3","kir_q4_cond_par_q4": "kir_q4_cond_par_q4","kir_q4_cond_par_q5": "kir_q4_cond_par_q5","kir_q5_cond_par_q1": "kir_q5_cond_par_q1","kir_q5_cond_par_q2": "kir_q5_cond_par_q2","kir_q5_cond_par_q3": "kir_q5_cond_par_q3","kir_q5_cond_par_q4": "kir_q5_cond_par_q4","kir_q5_cond_par_q5": "kir_q5_cond_par_q5","kfr_q1_cond_par_q1": "kfr_q1_cond_par_q1","kfr_q1_cond_par_q2": "kfr_q1_cond_par_q2","kfr_q1_cond_par_q3": "kfr_q1_cond_par_q3","kfr_q1_cond_par_q4": "kfr_q1_cond_par_q4","kfr_q1_cond_par_q5": "kfr_q1_cond_par_q5","kfr_q2_cond_par_q1": "kfr_q2_cond_par_q1","kfr_q2_cond_par_q2": "kfr_q2_cond_par_q2","kfr_q2_cond_par_q3": "kfr_q2_cond_par_q3","kfr_q2_cond_par_q4": "kfr_q2_cond_par_q4","kfr_q2_cond_par_q5": "kfr_q2_cond_par_q5","kfr_q3_cond_par_q1": "kfr_q3_cond_par_q1","kfr_q3_cond_par_q2": "kfr_q3_cond_par_q2","kfr_q3_cond_par_q3": "kfr_q3_cond_par_q3","kfr_q3_cond_par_q4": "kfr_q3_cond_par_q4","kfr_q3_cond_par_q5": "kfr_q3_cond_par_q5","kfr_q4_cond_par_q1": "kfr_q4_cond_par_q1","kfr_q4_cond_par_q2": "kfr_q4_cond_par_q2","kfr_q4_cond_par_q3": "kfr_q4_cond_par_q3","kfr_q4_cond_par_q4": "kfr_q4_cond_par_q4","kfr_q4_cond_par_q5": "kfr_q4_cond_par_q5","kfr_q5_cond_par_q1": "kfr_q5_cond_par_q1","kfr_q5_cond_par_q2": "kfr_q5_cond_par_q2","kfr_q5_cond_par_q3": "kfr_q5_cond_par_q3","kfr_q5_cond_par_q4": "kfr_q5_cond_par_q4","kfr_q5_cond_par_q5": "kfr_q5_cond_par_q5"}', "PIPELINE_NAME": "national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers", }, resources={"limit_memory": "2G", "limit_cpu": "1"}, ) # Task to load CSV data to a BigQuery table load_income_transition_to_bq = gcs_to_bq.GoogleCloudStorageToBigQueryOperator( task_id="load_income_transition_to_bq", bucket="{{ var.value.composer_bucket }}", source_objects=[ "data/race_and_economic_opportunity/national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers/data_output.csv" ], source_format="CSV", destination_project_dataset_table="race_and_economic_opportunity.national_child_and_parent_income_transition_matrices_by_race_and_gender_for_children_with_mothers", skip_leading_rows=1, write_disposition="WRITE_TRUNCATE", schema_fields=[ {"name": "kid_race", "type": "STRING", "mode": "NULLABLE"}, {"name": "gender", "type": "STRING", "mode": "NULLABLE"}, {"name": "count", "type": "INTEGER", "mode": "NULLABLE"}, {"name": "kir_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q1_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q1_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q1_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q1_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q1_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q2_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q2_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q2_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q2_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q2_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q3_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q3_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q3_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q3_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q3_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q4_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q4_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q4_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q4_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q4_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q5_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q5_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q5_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q5_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kir_q5_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q1_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q1_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q1_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q1_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q1_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q2_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q2_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q2_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q2_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q2_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q3_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q3_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q3_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q3_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q3_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q4_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q4_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q4_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q4_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q4_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q5_cond_par_q1", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q5_cond_par_q2", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q5_cond_par_q3", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q5_cond_par_q4", "type": "FLOAT", "mode": "NULLABLE"}, {"name": "kfr_q5_cond_par_q5", "type": "FLOAT", "mode": "NULLABLE"}, ], ) income_transition_transform_csv >> load_income_transition_to_bq
81.363057
2,529
0.64553
1,902
12,774
3.785489
0.107256
0.194444
0.148889
0.189583
0.77125
0.717083
0.713611
0.695278
0.653611
0.383056
0
0.046322
0.175278
12,774
156
2,530
81.884615
0.637114
0.049319
0
0.015038
0
0.015038
0.64817
0.36123
0
0
0
0
0
1
0
false
0
0.015038
0
0.015038
0
0
0
0
null
0
0
1
0
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
12e2c7244d76d398a10b056de9066c25fd9b4172
3,513
py
Python
tests/train_from_tfrecords_unittest.py
CNES/decloud
6b06ae98bfe68821b4ebd0e7ba06723809cb9b42
[ "Apache-2.0" ]
8
2022-02-25T13:15:07.000Z
2022-03-20T18:29:49.000Z
tests/train_from_tfrecords_unittest.py
CNES/decloud
6b06ae98bfe68821b4ebd0e7ba06723809cb9b42
[ "Apache-2.0" ]
1
2022-02-25T13:21:33.000Z
2022-02-25T13:21:33.000Z
tests/train_from_tfrecords_unittest.py
CNES/decloud
6b06ae98bfe68821b4ebd0e7ba06723809cb9b42
[ "Apache-2.0" ]
1
2022-03-31T23:43:12.000Z
2022-03-31T23:43:12.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import unittest from decloud.models import train_from_tfrecords from .decloud_unittest import DecloudTest SAVEDMODEL_FILENAME = "saved_model.pb" def is_savedmodel_written(args_list): out_savedmodel = "/tmp/savedmodel" base_args = ["--logdir", "/tmp/logdir", "--out_savedmodel", out_savedmodel, "--epochs", "1", "-bt", "1", "-bv", "1", "--strategy", "singlecpu"] train_from_tfrecords.main(args_list + base_args) for dir, sub_dirs, files in os.walk(out_savedmodel): if SAVEDMODEL_FILENAME in files: return True return False OS2_TFREC_PTH = "baseline/TFRecord/CRGA" OS2_ALL_BANDS_TFREC_PTH = "/baseline/TFRecord/CRGA_all_bands" MERANER_ALL_BANDS_TFREC_PTH = "/baseline/TFRecord/CRGA_all_bands" class TrainFromTFRecordsTest(DecloudTest): def test_trainFromTFRecords_os1_unet(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(OS2_TFREC_PTH), "--model", "crga_os1_unet"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) def test_trainFromTFRecords_os2_david(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(OS2_TFREC_PTH), "--model", "crga_os2_david"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) def test_trainFromTFRecords_os2_unet(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(OS2_TFREC_PTH), "--model", "crga_os2_unet"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) def test_trainFromTFRecords_os1_unet_all_bands(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(OS2_ALL_BANDS_TFREC_PTH), "--model", "crga_os1_unet_all_bands"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) def test_trainFromTFRecords_os2_david_all_bands(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(OS2_ALL_BANDS_TFREC_PTH), "--model", "crga_os2_david_all_bands"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) def test_trainFromTFRecords_os2_unet_all_bands(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(OS2_ALL_BANDS_TFREC_PTH), "--model", "crga_os2_unet_all_bands"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) def test_trainFromTFRecords_meraner_unet(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(MERANER_ALL_BANDS_TFREC_PTH), "--model", "meraner_unet"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) def test_trainFromTFRecords_meraner_unet_all_bands(self): self.assertTrue(is_savedmodel_written(["--training_record", self.get_path(MERANER_ALL_BANDS_TFREC_PTH), "--model", "meraner_unet_all_bands"]), "File {} not found !".format(SAVEDMODEL_FILENAME)) if __name__ == '__main__': unittest.main()
45.623377
111
0.610589
372
3,513
5.333333
0.201613
0.068548
0.08619
0.080645
0.759073
0.724294
0.71623
0.71623
0.71623
0.649698
0
0.009843
0.276971
3,513
76
112
46.223684
0.77126
0.01224
0
0.285714
0
0
0.197232
0.051903
0
0
0
0
0.142857
1
0.160714
false
0
0.071429
0
0.285714
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
4209091620d5293f075e658033655b6d6ba4ac1d
182
py
Python
src/events/__init__.py
KenyC/Shajara
ec5ab94e92cf154aef63ac2278fddff901f6328c
[ "MIT" ]
null
null
null
src/events/__init__.py
KenyC/Shajara
ec5ab94e92cf154aef63ac2278fddff901f6328c
[ "MIT" ]
null
null
null
src/events/__init__.py
KenyC/Shajara
ec5ab94e92cf154aef63ac2278fddff901f6328c
[ "MIT" ]
null
null
null
from .synchronizer import * from .text_edit import * from .transducer_combo_box import * from .view import * from .buttons import *
22.75
35
0.56044
18
182
5.5
0.555556
0.40404
0
0
0
0
0
0
0
0
0
0
0.384615
182
7
36
26
0.883929
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
4219e99cccc32d27b0d2f4c5fead5592824af84d
3,624
py
Python
models/generator.py
bybrooks/mol-cycle-gan
47d71a6383f4dc81c7146100787005e91642f041
[ "MIT" ]
null
null
null
models/generator.py
bybrooks/mol-cycle-gan
47d71a6383f4dc81c7146100787005e91642f041
[ "MIT" ]
null
null
null
models/generator.py
bybrooks/mol-cycle-gan
47d71a6383f4dc81c7146100787005e91642f041
[ "MIT" ]
null
null
null
from keras.layers import Input from keras.layers.core import Dense from keras.models import Model from .networks_utils import (residual_dense_block, dense_layer) def resnet_generator_FC_bigger(input_shape=(56,), use_dropout=False, use_batch_norm=True, use_leaky_relu=False): inputs = Input(shape=input_shape) embedding = inputs embedding = dense_layer(embedding, units=56, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = dense_layer(embedding, units=56, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) outputs = Dense(units=input_shape[0], activation=None)(embedding) return Model(inputs=inputs, outputs=outputs), inputs, outputs def resnet_generator_FC_smaller(input_shape=(56,), use_dropout=False, use_batch_norm=True, use_leaky_relu=False): inputs = Input(shape=input_shape) embedding = inputs embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) outputs = Dense(units=input_shape[0], activation=None)(embedding) return Model(inputs=inputs, outputs=outputs), inputs, outputs def resnet_generator_FC_smallest(input_shape=(56,), use_dropout=False, use_batch_norm=True, use_leaky_relu=False): inputs = Input(shape=input_shape) embedding = inputs embedding = residual_dense_block(embedding, units=56, use_dropout=use_dropout, use_batch_norm=use_batch_norm, use_leaky_relu=use_leaky_relu) outputs = Dense(units=input_shape[0], activation=None)(embedding) return Model(inputs=inputs, outputs=outputs), inputs, outputs # call resnet_generator_FC_smallest(when arg.network_type = "FC_smallest") def resnet_generator(network_type='FC_smaller', **args): assert network_type in {'FC_smaller', 'FC_smallest', 'FC_bigger'}, "NOT IMPLEMENTED FOR THIS 'network_type'!!!" generators = { "FC_smaller": resnet_generator_FC_smaller, "FC_smallest": resnet_generator_FC_smallest, "FC_bigger": resnet_generator_FC_bigger, } return generators[network_type](**args) # resnet_generator_FC_smallest(generator_params)
48.972973
115
0.699503
462
3,624
5.069264
0.114719
0.085397
0.128096
0.140905
0.773271
0.773271
0.773271
0.773271
0.773271
0.773271
0
0.010981
0.221026
3,624
73
116
49.643836
0.818633
0.032837
0
0.686275
0
0
0.031982
0
0
0
0
0
0.019608
1
0.078431
false
0
0.078431
0
0.235294
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
424865d37cc79b613c6156f110354b0ce7d6d6d6
33,033
py
Python
polynomials_on_simplices/piecewise_polynomial/piecewise_polynomial_bernstein_basis.py
FAndersson/polynomials_on_simplices
f015a4772c817bfa99b0d6b726667a38a174b064
[ "MIT" ]
1
2021-03-17T11:41:21.000Z
2021-03-17T11:41:21.000Z
polynomials_on_simplices/piecewise_polynomial/piecewise_polynomial_bernstein_basis.py
FAndersson/polynomials_on_simplices
f015a4772c817bfa99b0d6b726667a38a174b064
[ "MIT" ]
null
null
null
polynomials_on_simplices/piecewise_polynomial/piecewise_polynomial_bernstein_basis.py
FAndersson/polynomials_on_simplices
f015a4772c817bfa99b0d6b726667a38a174b064
[ "MIT" ]
null
null
null
r"""Discontinuous Galerkin finite elements (piecewise polynomials) on a simplicial domain (triangulation) :math:`\mathcal{T}`, i.e. elements of :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` or :math:`D\mathcal{P}_r (\mathcal{T})`, expressed using the Bernstein polynomial basis. """ import numbers import numpy as np import polynomials_on_simplices.algebra.multiindex as multiindex from polynomials_on_simplices.geometry.mesh.simplicial_complex import simplex_vertices from polynomials_on_simplices.piecewise_polynomial.piecewise_polynomial import ( PiecewisePolynomialBase, generate_inverse_local_to_global_map, generate_local_to_global_map) from polynomials_on_simplices.polynomial.polynomials_simplex_bernstein_basis import ( PolynomialBernsteinSimplex, bernstein_basis_simplex, dual_bernstein_basis_fn_simplex, get_dimension, zero_polynomial_simplex) from polynomials_on_simplices.polynomial.polynomials_unit_simplex_bernstein_basis import ( unique_identifier_bernstein_basis) class PiecewisePolynomialBernstein(PiecewisePolynomialBase): r""" Implementation of the abstract piecewise polynomial base class using the Bernstein polynomial basis on the unit simplex. .. math:: p(x) = \sum_{i = 1}^N a_i \phi_i(x), where the basis :math:`\{ \phi_i \}_{i = 1}^N` for the space of piecewise polynomials is constructed from the Bernstein polynomial basis and the local-to-global map. See :class:`~polynomials_on_simplices.piecewise_polynomial.piecewise_polynomial.PiecewisePolynomialBase` and :func:`~polynomials_on_simplices.piecewise_polynomial.piecewise_polynomial.generate_local_to_global_map` for details. """ def __init__(self, coeff, triangles, vertices, r, tau=None, boundary_simplices=None, keep_boundary_dofs_last=False, support=None, bsp_tree=None, basis_polynomials=None): r""" :param coeff: Coefficients for the piecewise polynomial in the :math:`\{ \phi_i \}_{i = 1}^N` basis derived from the Bernstein basis for :math:`\mathcal{P}_r (\Delta_c^m)` and the local-to-global map :math:`\tau`. :type coeff: List[Union[Scalar, Vector]] :param triangles: Triangles (or in general simplices) in the mesh :math:`\mathcal{T}` (num_triangles by m + 1 array of indices). :param vertices: Vertices in the mesh :math:`\mathcal{T}` (num_vertices by m array of scalars). :param int r: Degree of each polynomial in the piecewise polynomial. :param tau: Local-to-global map for mapping local basis functions to the index of the corresponding global basis function. Will be generated if not supplied. :type tau: Optional[Callable :math:`\tau(j, \nu)`] :param boundary_simplices: List of simplices or subsimplices on which the piecewise polynomial function should vanish (for an element of :math:`D\mathcal{P}_{r, 0} (\mathcal{T})`) or which should be treated separately (if `keep_boundary_dofs_last` is set to True). Each simplex or subsimplex is specified as a list of vertex indices of the vertices that form the simplex. :type boundary_simplices: List[List[int]] :param bool keep_boundary_dofs_last: Whether or not to collect all global basis functions associated with any boundary simplex last in the enumeration of all basis functions. Enumerating basis functions associated with boundary simplices last is useful for handling :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` as a subset of :math:`D\mathcal{P}_r (\mathcal{T})` in a practical way. :param Optional[Set[int]] support: Indices of the triangles in the triangulation where the piecewise polynomial is supported. Will be generated if not supplied. :param bsp_tree: Optional implementation detail. A binary space partitioning tree built around the triangulation for quicker lookup of triangle a point lies in. Will be generated if not supplied. :param basis_polynomials: Precomputed basis polynomials for each triangle in the given triangulation. Will be generated where necessary if not supplied. :type basis_polynomials: Optional[Dict[int, List[ :class:`~.polynomial.polynomials_simplex_bernstein_basis.PolynomialBernsteinSimplex`]]] """ PiecewisePolynomialBase.__init__(self, coeff, triangles, vertices, r, tau, boundary_simplices, keep_boundary_dofs_last, support, bsp_tree) # Compute basis polynomials if basis_polynomials is not None: for j in self.triangles_in_the_support: self._basis_polynomials[j] = basis_polynomials[j] else: for j in self.triangles_in_the_support: self._basis_polynomials[j] = bernstein_basis_simplex(self.r, simplex_vertices(triangles[j], self.vertices)) def basis(self): r""" Get basis for the space :math:`\mathcal{P}_r (\Delta_c^m)` used to express the piecewise polynomial. :return: Unique identifier for the basis used. :rtype: str """ return unique_identifier_bernstein_basis() def __mul__(self, other): """ Multiplication of this piecewise polynomial with another piecewise polynomial (only if n = 1), a scalar, or a vector (only if n = 1), self * other. :param other: Piecewise polynomial, scalar or vector we should multiply this piecewise polynomial with. :return: Product of this piecewise polynomial with other. :rtype: Instance of self.__class__ """ if isinstance(other, numbers.Number) or isinstance(other, np.ndarray): return self.multiply_with_constant(other) # Multiplication of two piecewise polynomials # Multiplied piecewise polynomials need to have the same domain dimension assert self.domain_dimension() == other.domain_dimension() # And the same underlying triangle mesh assert self.triangles.data == other.triangles.data assert self.vertices.data == other.vertices.data assert ((self.boundary_simplices is None and other.boundary_simplices is None) or (self.boundary_simplices.data == other.boundary_simplices.data)) assert self.keep_boundary_dofs_last == other.keep_boundary_dofs_last # Cannot multiply two vector valued piecewise polynomials assert self.target_dimension() == 1 assert other.target_dimension() == 1 m = self.domain_dimension() r = self.degree() + other.degree() # New local-to-global map for the product piecewise polynomial if self.keep_boundary_dofs_last: tau, num_dofs, num_internal_dofs = self.__class__.generate_local_to_global_map(self.triangles, r, self.boundary_simplices, self.keep_boundary_dofs_last) else: tau, num_dofs = self.__class__.generate_local_to_global_map(self.triangles, r, self.boundary_simplices) coeff = np.zeros(num_dofs) support = self.support().intersection(other.support()) for j in support: p = self.restrict_to_simplex(j) q = other.restrict_to_simplex(j) pq_coeff = (p * q).coeff k = 0 for nu in multiindex.generate_all(m, r): i = tau(j, nu) coeff[i] = pq_coeff[k] k += 1 return self.__class__(coeff, self.triangles, self.vertices, r, tau, self.boundary_simplices, self.keep_boundary_dofs_last, support, self._bsp_tree) def __pow__(self, exp): r""" Raise the piecewise polynomial to a power. .. math:: (p^{\mu})(x) = p(x)^{\mu} = p_1(x)^{\mu_1} p_2(x)^{\mu_2} \ldots p_n(x)^{\mu_n}. :param exp: Power we want the raise the piecewise polynomial to (natural number or multi-index depending on the dimension of the target of the piecewise polynomial). :type exp: int or :class:`~polynomials_on_simplices.algebra.multiindex.MultiIndex` or Tuple[int, ...] :return: This piecewise polynomial raised to the given power. :rtype: Instance of self.__class__ """ if isinstance(exp, numbers.Integral): assert exp >= 0 assert self.target_dimension() == 1 if exp == 0: return self.get_unit_piecewise_polynomial_bernstein(self.triangles, self.vertices, 1, None, self.boundary_simplices, self.keep_boundary_dofs_last, self._bsp_tree) if exp == 1: return self.__class__(self.coeff, self.triangles, self.vertices, self.r, self.tau, self.boundary_simplices, self.keep_boundary_dofs_last, self.support(), self._bsp_tree, self._basis_polynomials) return self * self**(exp - 1) else: n = self.target_dimension() assert len(exp) == n assert [entry >= 0 for entry in exp] norm_exp = multiindex.norm(exp) if norm_exp == 0: return self.get_unit_piecewise_polynomial_bernstein(self.triangles, self.vertices, 1, None, self.boundary_simplices, self.keep_boundary_dofs_last, self._bsp_tree) for i in range(len(exp)): if exp[i] == 0: continue ei = multiindex.unit_multiindex(n, i) return (self.__class__(self.coeff[:, i], self.triangles, self.vertices, self.r, self.tau, self.boundary_simplices, self.keep_boundary_dofs_last, self.support(), self._bsp_tree, self._basis_polynomials) * self**(exp - ei)) def degree_elevate(self, s): r""" Express the piecewise polynomial using a higher degree polynomial basis. Let :math:`p(x)` be this piecewise polynomial. Let :math:`\{ \bar{\varphi}_{\nu, r} \}_{\substack{\nu \in \mathbb{N}_0^m \\ |\nu| \leq r}}` be the polynomial basis for :math:`\mathcal{P}_r(\Delta_c^m)` used for this piecewise polynomial, and let :math:`\{ \bar{\varphi}_{\nu, s} \}_{\substack{\nu \in \mathbb{N}_0^m \\ |\nu| \leq s}}, s \geq r` be the corresponding higher degree polynomial basis for :math:`\mathcal{P}_s(\Delta_c^m)`. Then this function returns a piecewise polynomial :math:`q` using the basis :math:`\{ \bar{\varphi}_{\nu, s} \}` such that :math:`p(x) = q(x) \, \forall x \in \mathbb{R}^m`. :param int s: New degree for the basic polynomial basis the piecewise polynomial should use. :return: Elevation of this piecewise polynomial to the higher degree basis. :rtype: Instance of self.__class__ """ assert s >= self.degree() if s == self.degree(): return self.__class__(self.coeff, self.triangles, self.vertices, self.r, self.tau, self.boundary_simplices, self.keep_boundary_dofs_last, self.support(), self._bsp_tree, self._basis_polynomials) # New local-to-global map for the higher degree piecewise polynomial if self.keep_boundary_dofs_last: tau, num_dofs, num_internal_dofs = self.__class__.generate_local_to_global_map(self.triangles, s, self.boundary_simplices, self.keep_boundary_dofs_last) else: tau, num_dofs = self.__class__.generate_local_to_global_map(self.triangles, s, self.boundary_simplices) m = self.domain_dimension() n = self.target_dimension() if n == 1: coeff = np.zeros(num_dofs) else: coeff = np.zeros((num_dofs, n)) mis = multiindex.generate_all(m, s) for j in range(len(self.triangles)): p = self.restrict_to_simplex(j).degree_elevate(s) for k in range(len(p.coeff)): i = tau(j, mis[k]) coeff[i] = p.coeff[k] return self.__class__(coeff, self.triangles, self.vertices, s, tau, self.boundary_simplices, self.keep_boundary_dofs_last, self.support(), self._bsp_tree) def restrict_to_simplex(self, i): r""" Restriction of the piecewise polynomial to a specified simplex :math:`T_i \in \mathcal{T}`. :param int i: Index of the simplex we want to restrict the piecewise polynomial to (in :math:`0, 1, \ldots, | \mathcal{T} | - 1`). :return: Polynomial which agrees with the piecewise polynomial on the simplex :math:`T_i`. :rtype: :class:`~.polynomial.polynomials_simplex_bernstein_basis.PolynomialBernsteinSimplex`. """ assert i < len(self.triangles) tri_vertices = simplex_vertices(self.triangles[i], self.vertices) m = self.domain_dimension() n = self.target_dimension() r = self.degree() if i not in self.support(): return zero_polynomial_simplex(tri_vertices, r, n) dim = get_dimension(r, m) if n == 1: coeff = np.zeros(dim) else: coeff = np.zeros((dim, n)) mis = multiindex.generate_all(m, r) for k in range(len(mis)): idx = self.tau(i, mis[k]) coeff[k] = self.coeff[idx] return PolynomialBernsteinSimplex(coeff, tri_vertices, r) @staticmethod def get_unit_piecewise_polynomial_bernstein(triangles, vertices, n=1, tau=None, boundary_simplices=None, keep_boundary_dofs_last=False, bsp_tree=None): r""" Get the piecewise polynomial of degree r on the given triangulation :math:`\mathcal{T}`, where the polynomials on each simplex is expressed in the Bernstein basis, which is identically one. See :func:`unit_piecewise_polynomial_bernstein`. """ return unit_piecewise_polynomial_bernstein(triangles, vertices, n, tau, boundary_simplices, keep_boundary_dofs_last, bsp_tree) def piecewise_polynomial_bernstein_basis_fn(triangles, vertices, r, i, tau=None, num_dofs=None, boundary_simplices=None, keep_boundary_dofs_last=False, bsp_tree=None, basis_polynomials=None): r""" Generate a basis function for the space of piecewise polynomials of degree r on the given triangulation :math:`\mathcal{T}`, where the polynomials on each simplex is expressed in the Bernstein basis. :param triangles: Triangles (or in general simplices) in the mesh :math:`\mathcal{T}` (num_triangles by m + 1 array of indices). :param vertices: Vertices in the mesh :math:`\mathcal{T}` (num_vertices by m array of scalars). :param int r: Degree of each polynomial in the piecewise polynomial. :param int i: Index of the basis function that should be generated. :param tau: Local-to-global map for mapping local basis functions to the index of the corresponding global basis function. Will be generated if not supplied. :type tau: Optional[Callable :math:`\tau(j, \nu)`] :param Optional[int] num_dofs: Dimension of the space of piecewise polynomials on the given triangulation. Will be computed if not supplied. :param boundary_simplices: List of simplices or subsimplices on which the piecewise polynomial functions should vanish (for :math:`D\mathcal{P}_{r, 0} (\mathcal{T})`) or which should be treated separately (if `keep_boundary_dofs_last` is set to True). Each simplex or subsimplex is specified as a list of vertex indices of the vertices that form the simplex. :type boundary_simplices: List[List[int]] :param bool keep_boundary_dofs_last: Whether or not to collect all global basis functions associated with any boundary simplex last in the enumeration of all basis functions. Enumerating basis functions associated with boundary simplices last is useful for handling :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` as a subset of :math:`D\mathcal{P}_r (\mathcal{T})` in a practical way. :param bsp_tree: Optional implementation detail. A binary space partitioning tree built around the triangulation :math:`\mathcal{T}` for quicker lookup of triangle a point lies in. Will be generated if not supplied. :param basis_polynomials: Precomputed basis polynomials for each triangle in the given triangulation. Will be generated where necessary if not supplied. :type basis_polynomials: Optional[Dict[int, List[ :class:`~polynomials_on_simplices.polynomial.polynomials_simplex_bernstein_basis.PolynomialBernsteinSimplex`]]] :return: Basis function. :rtype: :class:`PiecewisePolynomialBernstein`. """ if tau is None or num_dofs is None: if keep_boundary_dofs_last: tau, num_dofs, num_interior_dofs = generate_local_to_global_map(triangles, r, boundary_simplices, keep_boundary_dofs_last) else: tau, num_dofs = generate_local_to_global_map(triangles, r, boundary_simplices) coeff = np.zeros(num_dofs) coeff[i] = 1 return PiecewisePolynomialBernstein(coeff, triangles, vertices, r, tau, boundary_simplices, keep_boundary_dofs_last, bsp_tree=bsp_tree, basis_polynomials=basis_polynomials) def piecewise_polynomial_bernstein_basis(triangles, vertices, r, tau=None, num_dofs=None, boundary_simplices=None, keep_boundary_dofs_last=False, bsp_tree=None): r""" Generate all basis functions for the space of piecewise polynomials of degree r on the given triangulation :math:`\mathcal{T}`, where the polynomials on each simplex is expressed in the Bernstein basis. :param triangles: Triangles (or in general simplices) in the mesh :math:`\mathcal{T}` (num_triangles by m + 1 array of indices). :param vertices: Vertices in the mesh :math:`\mathcal{T}` (num_vertices by m array of scalars). :param int r: Degree of each polynomial in the piecewise polynomial. :param tau: Local-to-global map for mapping local basis functions to the index of the corresponding global basis function. Will be generated if not supplied. :type tau: Optional[Callable :math:`\tau(j, \nu)`] :param Optional[int] num_dofs: Dimension of the space of piecewise polynomials on the given triangulation. Will be computed if not supplied. :param boundary_simplices: List of simplices or subsimplices on which the piecewise polynomial functions should vanish (for :math:`D\mathcal{P}_{r, 0} (\mathcal{T})`) or which should be treated separately (if `keep_boundary_dofs_last` is set to True). Each simplex or subsimplex is specified as a list of vertex indices of the vertices that form the simplex. :type boundary_simplices: List[List[int]] :param bool keep_boundary_dofs_last: Whether or not to collect all global basis functions associated with any boundary simplex last in the enumeration of all basis functions. Enumerating basis functions associated with boundary simplices last is useful for handling :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` as a subset of :math:`D\mathcal{P}_r (\mathcal{T})` in a practical way. :param bsp_tree: Optional implementation detail. A binary space partitioning tree built around the triangulation :math:`\mathcal{T}` for quicker lookup of triangle a point lies in. Will be generated if not supplied. :rtype: List[:class:`PiecewisePolynomialBernstein`]. """ basis = [] if tau is None or num_dofs is None: if keep_boundary_dofs_last: tau, num_dofs, num_interior_dofs = generate_local_to_global_map(triangles, r, boundary_simplices, keep_boundary_dofs_last) else: tau, num_dofs = generate_local_to_global_map(triangles, r, boundary_simplices) basis_polynomials = {} for j in range(len(triangles)): tri_vertices = simplex_vertices(triangles[j], vertices) basis_polynomials[j] = bernstein_basis_simplex(r, tri_vertices) for i in range(num_dofs): basis.append(piecewise_polynomial_bernstein_basis_fn(triangles, vertices, r, i, tau, num_dofs, boundary_simplices, keep_boundary_dofs_last, bsp_tree=bsp_tree, basis_polynomials=basis_polynomials)) return basis def dual_piecewise_polynomial_bernstein_basis_fn(triangles, vertices, r, i, tau=None, num_dofs=None, tau_inv=None, boundary_simplices=None, keep_boundary_dofs_last=False): r""" Generate a dual basis function to the basis for the space of piecewise polynomials of degree r on the given triangulation :math:`\mathcal{T}, D \mathcal{P}_r(\mathcal{T})` or :math:`D \mathcal{P}_{r, 0}(\mathcal{T})`, where the polynomials on each simplex is expressed in the Bernstein basis. I.e. the linear map :math:`\phi_i^* : D \mathcal{P}_r(\mathcal{T}) \to \mathbb{R}` that satisfies .. math:: \phi_i^* (\phi_j) = \delta_{ij}, where :math:`\phi_j` is the j:th Bernstein basis function for the space of piecewise polynomials of degree r (see :func:`piecewise_polynomial_bernstein_basis_fn`). :param triangles: Triangles (or in general simplices) in the mesh :math:`\mathcal{T}` (num_triangles by m + 1 array of indices). :param vertices: Vertices in the mesh :math:`\mathcal{T}` (num_vertices by m array of scalars). :param int r: Degree of each polynomial in the piecewise polynomial. :param int i: Index of the dual basis function that should be generated. :param tau: Local-to-global map for mapping local basis functions to the index of the corresponding global basis function. Will be generated if not supplied. :type tau: Optional[Callable :math:`\tau(j, \nu)`] :param Optional[int] num_dofs: Dimension of the space of piecewise polynomials on the given triangulation. Will be computed if not supplied. :param tau_inv: Inverse of the local-to-global map. Will be generated if not supplied. :type tau_inv: Optional[Callable :math:`\tau^{-1}(i)`] :param boundary_simplices: List of simplices or subsimplices on which the piecewise polynomial functions should vanish (for :math:`D\mathcal{P}_{r, 0} (\mathcal{T})`) or which should be treated separately (if `keep_boundary_dofs_last` is set to True). Each simplex or subsimplex is specified as a list of vertex indices of the vertices that form the simplex. :type boundary_simplices: List[List[int]] :param bool keep_boundary_dofs_last: Whether or not to collect all global basis functions associated with any boundary simplex last in the enumeration of all basis functions. Enumerating basis functions associated with boundary simplices last is useful for handling :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` as a subset of :math:`D\mathcal{P}_r (\mathcal{T})` in a practical way. :return: The i:th dual Bernstein basis function as specified by mu and r. :rtype: Callable :math:`\phi_i^*(p)`. """ if tau is None or num_dofs is None: if keep_boundary_dofs_last: tau, num_dofs, num_interior_dofs = generate_local_to_global_map(triangles, r, boundary_simplices, keep_boundary_dofs_last) else: tau, num_dofs = generate_local_to_global_map(triangles, r, boundary_simplices) if tau_inv is None: tau_inv = generate_inverse_local_to_global_map(tau, len(triangles), num_dofs, r, len(vertices[0])) j, nu = tau_inv(i) q = dual_bernstein_basis_fn_simplex(nu, r, simplex_vertices(triangles[j], vertices)) def phi_star(p): p_j = p.restrict_to_simplex(j) return q(p_j) return phi_star def dual_piecewise_polynomial_bernstein_basis(triangles, vertices, r, tau=None, num_dofs=None, tau_inv=None, boundary_simplices=None, keep_boundary_dofs_last=False): r""" Generate all dual basis functions to the basis of piecewise polynomials of degree r on the given triangulation :math:`\mathcal{T}, D \mathcal{P}_r(\mathcal{T})` or :math:`D \mathcal{P}_{r, 0}(\mathcal{T})`, where the polynomials on each simplex is expressed in the Bernstein basis. See :func:`dual_piecewise_polynomial_bernstein_basis_fn`. :param triangles: Triangles (or in general simplices) in the mesh :math:`\mathcal{T}` (num_triangles by m + 1 array of indices). :param vertices: Vertices in the mesh :math:`\mathcal{T}` (num_vertices by m array of scalars). :param int r: Degree of each polynomial in the piecewise polynomial. :param tau: Local-to-global map for mapping local basis functions to the index of the corresponding global basis function. Will be generated if not supplied. :type tau: Optional[Callable :math:`\tau(j, \nu)`] :param Optional[int] num_dofs: Dimension of the space of piecewise polynomials on the given triangulation. Will be computed if not supplied. :param tau_inv: Inverse of the local-to-global map. Will be generated if not supplied. :type tau_inv: Optional[Callable :math:`\tau^{-1}(i)`] :param boundary_simplices: List of simplices or subsimplices on which the piecewise polynomial functions should vanish (for :math:`D\mathcal{P}_{r, 0} (\mathcal{T})`) or which should be treated separately (if `keep_boundary_dofs_last` is set to True). Each simplex or subsimplex is specified as a list of vertex indices of the vertices that form the simplex. :type boundary_simplices: List[List[int]] :param bool keep_boundary_dofs_last: Whether or not to collect all global basis functions associated with any boundary simplex last in the enumeration of all basis functions. Enumerating basis functions associated with boundary simplices last is useful for handling :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` as a subset of :math:`D\mathcal{P}_r (\mathcal{T})` in a practical way. :return: List of dual base functions. :rtype: List[Callable :math:`\phi_i^*(p)`]. """ basis = [] if tau is None or num_dofs is None: if keep_boundary_dofs_last: tau, num_dofs, num_interior_dofs = generate_local_to_global_map(triangles, r, boundary_simplices, keep_boundary_dofs_last) else: tau, num_dofs = generate_local_to_global_map(triangles, r, boundary_simplices) if tau_inv is None: try: m = len(vertices[0]) except TypeError: m = 1 tau_inv = generate_inverse_local_to_global_map(tau, len(triangles), num_dofs, r, m) for i in range(num_dofs): basis.append(dual_piecewise_polynomial_bernstein_basis_fn(triangles, vertices, r, i, tau, num_dofs, tau_inv, boundary_simplices, keep_boundary_dofs_last)) return basis def zero_piecewise_polynomial_bernstein(triangles, vertices, n=1, tau=None, boundary_simplices=None, keep_boundary_dofs_last=False, bsp_tree=None): r""" Get the piecewise polynomial of degree r on the given triangulation :math:`\mathcal{T}`, where the polynomials on each simplex is expressed in the Bernstein basis, which is identically zero. :param triangles: Triangles (or in general simplices) in the mesh :math:`\mathcal{T}` (num_triangles by m + 1 array of indices). :param vertices: Vertices in the mesh :math:`\mathcal{T}` (num_vertices by m array of scalars). :param int n: Dimension of the target of the piecewise polynomial. :param tau: Local-to-global map for mapping local basis functions to the index of the corresponding global basis function. Will be generated if not supplied. :type tau: Optional[Callable :math:`\tau(j, \nu)`] :param boundary_simplices: List of simplices or subsimplices on which the piecewise polynomial functions should vanish (for :math:`D\mathcal{P}_{r, 0} (\mathcal{T})`) or which should be treated separately (if `keep_boundary_dofs_last` is set to True). Each simplex or subsimplex is specified as a list of vertex indices of the vertices that form the simplex. :type boundary_simplices: List[List[int]] :param bool keep_boundary_dofs_last: Whether or not to collect all global basis functions associated with any boundary simplex last in the enumeration of all basis functions. Enumerating basis functions associated with boundary simplices last is useful for handling :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` as a subset of :math:`D\mathcal{P}_r (\mathcal{T})` in a practical way. :param bsp_tree: Optional implementation detail. A binary space partitioning tree built around the triangulation :math:`\mathcal{T}` for quicker lookup of triangle a point lies in. Will be generated if not supplied. :return: The zero piecewise polynomial. :rtype: :class:`PiecewisePolynomialBernstein`. """ dim = len(triangles) if n == 1: coeff = np.zeros(dim) else: coeff = np.zeros((dim, n)) support = set() return PiecewisePolynomialBernstein(coeff, triangles, vertices, 0, tau, boundary_simplices, keep_boundary_dofs_last, support, bsp_tree) def unit_piecewise_polynomial_bernstein(triangles, vertices, n=1, tau=None, boundary_simplices=None, keep_boundary_dofs_last=False, bsp_tree=None): r""" Get the piecewise polynomial of degree r on the given triangulation :math:`\mathcal{T}`, where the polynomials on each simplex is expressed in the Bernstein basis, which is identically one. :param triangles: Triangles (or in general simplices) in the mesh :math:`\mathcal{T}` (num_triangles by m + 1 array of indices). :param vertices: Vertices in the mesh :math:`\mathcal{T}` (num_vertices by m array of scalars). :param int n: Dimension of the target of the piecewise polynomial. :param tau: Local-to-global map for mapping local basis functions to the index of the corresponding global basis function. Will be generated if not supplied. :type tau: Optional[Callable :math:`\tau(j, \nu)`] :param boundary_simplices: List of simplices or subsimplices on which the piecewise polynomial functions should vanish (for :math:`D\mathcal{P}_{r, 0} (\mathcal{T})`) or which should be treated separately (if `keep_boundary_dofs_last` is set to True). Each simplex or subsimplex is specified as a list of vertex indices of the vertices that form the simplex. :type boundary_simplices: List[List[int]] :param bool keep_boundary_dofs_last: Whether or not to collect all global basis functions associated with any boundary simplex last in the enumeration of all basis functions. Enumerating basis functions associated with boundary simplices last is useful for handling :math:`D\mathcal{P}_{r, 0} (\mathcal{T})` as a subset of :math:`D\mathcal{P}_r (\mathcal{T})` in a practical way. :param bsp_tree: Optional implementation detail. A binary space partitioning tree built around the triangulation :math:`\mathcal{T}` for quicker lookup of triangle a point lies in. Will be generated if not supplied. :return: The unit piecewise polynomial. :rtype: :class:`PiecewisePolynomialBernstein`. """ dim = len(triangles) if n == 1: coeff = np.ones(dim) else: coeff = np.ones((dim, n)) support = set(range(len(triangles))) return PiecewisePolynomialBernstein(coeff, triangles, vertices, 0, tau, boundary_simplices, keep_boundary_dofs_last, support, bsp_tree)
62.444234
121
0.662731
4,373
33,033
4.844043
0.061971
0.057405
0.037766
0.047208
0.801492
0.758014
0.734079
0.702969
0.682104
0.67252
0
0.00272
0.2542
33,033
528
122
62.5625
0.85712
0.55499
0
0.380342
0
0
0
0
0
0
0
0
0.055556
1
0.059829
false
0
0.029915
0
0.179487
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
429149c16905c3d4c38e58a75577a011d52a234e
157
py
Python
web_test - lipei/data/lian_data.py
wl027728/web_demo_wl
52bae068afc4bd67f6a2e5b1d29ab7e78f1776f8
[ "MIT" ]
null
null
null
web_test - lipei/data/lian_data.py
wl027728/web_demo_wl
52bae068afc4bd67f6a2e5b1d29ab7e78f1776f8
[ "MIT" ]
null
null
null
web_test - lipei/data/lian_data.py
wl027728/web_demo_wl
52bae068afc4bd67f6a2e5b1d29ab7e78f1776f8
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Create Time: 2020/6/24 10:11 Author: 作者 """ lian_data = [('3401030307','000000','PZKF20340100130000000004','3401000102')]
26.166667
77
0.624204
18
157
5.388889
1
0
0
0
0
0
0
0
0
0
0
0.432836
0.146497
157
6
77
26.166667
0.291045
0.394904
0
0
0
0
0.625
0.3
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
c40999b2ef3fd29b526593622532b65435cd7d82
114
py
Python
navitia_client/places_nearby.py
leonardbinet/navitia-python
f3886793c84b541ed3d410a1732e12ac4b5e3dde
[ "MIT" ]
9
2017-01-10T14:40:31.000Z
2022-02-14T19:25:18.000Z
navitia_client/places_nearby.py
leonardbinet/navitia-python
f3886793c84b541ed3d410a1732e12ac4b5e3dde
[ "MIT" ]
2
2016-12-15T15:05:58.000Z
2019-05-30T10:30:21.000Z
navitia_client/places_nearby.py
leonardbinet/navitia-python
f3886793c84b541ed3d410a1732e12ac4b5e3dde
[ "MIT" ]
3
2017-10-06T10:45:38.000Z
2021-01-21T14:29:43.000Z
# https://api.sncf.com/v1/coverage/sncf/stop_points/stop_point:OCE:SP:CorailIntercit%C3%A9-87116137/places_nearby
57
113
0.824561
19
114
4.789474
0.894737
0
0
0
0
0
0
0
0
0
0
0.098214
0.017544
114
1
114
114
0.714286
0.973684
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
c461cc47cfe196fc537a32747572ec18a6a177ca
230
py
Python
python/testData/inspections/PyMethodParametersInspectionClassGetItem/test.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/inspections/PyMethodParametersInspectionClassGetItem/test.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/inspections/PyMethodParametersInspectionClassGetItem/test.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
class QuestBase: def __class_getitem__(cls, item): pass class QuestBase: def __class_getitem__(<weak_warning descr="Usually first parameter of such methods is named 'cls'">self</weak_warning>, item): pass
28.75
130
0.713043
30
230
5.066667
0.633333
0.184211
0.223684
0.289474
0.381579
0
0
0
0
0
0
0
0.2
230
8
131
28.75
0.826087
0
0
0.666667
0
0
0.233766
0
0
0
0
0
0
0
null
null
0.333333
0
null
null
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
5
c473a23968b910e977312bf9d13fa79ec792c4fd
180
py
Python
tests/test_potential_field_planning.py
ryuichiueda/PythonRobotics
67d7d5c6105f6fd436435eef71651059f4ca9d54
[ "MIT" ]
1
2021-09-14T18:08:20.000Z
2021-09-14T18:08:20.000Z
tests/test_potential_field_planning.py
ryuichiueda/PythonRobotics
67d7d5c6105f6fd436435eef71651059f4ca9d54
[ "MIT" ]
null
null
null
tests/test_potential_field_planning.py
ryuichiueda/PythonRobotics
67d7d5c6105f6fd436435eef71651059f4ca9d54
[ "MIT" ]
null
null
null
import conftest # Add root path to sys.path from PathPlanning.PotentialFieldPlanning import potential_field_planning as m def test1(): m.show_animation = False m.main()
22.5
77
0.766667
25
180
5.4
0.84
0
0
0
0
0
0
0
0
0
0
0.006711
0.172222
180
7
78
25.714286
0.899329
0.138889
0
0
0
0
0
0
0
0
0
0
0
1
0.2
true
0
0.4
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
6749a8d96fd5845e9b59e0298fb675b14bf79a95
166
py
Python
folio/admin.py
Kenneth-joseph/Myport
ad9d6fbb58b2e6ea83d0abc28f524395d90cff28
[ "Unlicense" ]
null
null
null
folio/admin.py
Kenneth-joseph/Myport
ad9d6fbb58b2e6ea83d0abc28f524395d90cff28
[ "Unlicense" ]
4
2020-06-06T00:43:02.000Z
2021-09-08T01:40:19.000Z
folio/admin.py
Kenneth-joseph/Myport
ad9d6fbb58b2e6ea83d0abc28f524395d90cff28
[ "Unlicense" ]
null
null
null
from django.contrib import admin from .models import Project, Profile, Rating admin.site.register(Profile) admin.site.register(Project) admin.site.register(Rating)
20.75
44
0.813253
23
166
5.869565
0.478261
0.2
0.377778
0
0
0
0
0
0
0
0
0
0.090361
166
7
45
23.714286
0.89404
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
6759b485e1f1a41f2008025149868a317ede5d49
464
py
Python
Secao20_TestesComPython/Unittest.py
PauloFTeixeira/curso_python
9040c7dcc5262620f6330bb9637710bb8899bc6b
[ "MIT" ]
null
null
null
Secao20_TestesComPython/Unittest.py
PauloFTeixeira/curso_python
9040c7dcc5262620f6330bb9637710bb8899bc6b
[ "MIT" ]
null
null
null
Secao20_TestesComPython/Unittest.py
PauloFTeixeira/curso_python
9040c7dcc5262620f6330bb9637710bb8899bc6b
[ "MIT" ]
null
null
null
""" Unittest => Testes unitários É a forma de se testar unidade individuais de código Para criar os testes, cria-se classes que herdam de unittest.TestCase e a partir de então ganhamos todos os assertions presentes no módulos. Para rodar os testes, utiliza unittest.main() Todas as formas de testes https://docs.python.org/3/library.unitest.html Por convenção, todos os teste se iniciam com o nome test_ """ def comer(): pass def dormir(): pass
18.56
99
0.74569
74
464
4.662162
0.743243
0.046377
0
0
0
0
0
0
0
0
0
0.002646
0.185345
464
24
100
19.333333
0.910053
0.875
0
0.5
0
0
0
0
0
0
0
0.083333
0
1
0.5
true
0.5
0
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
1
1
1
0
0
0
0
0
5
67d45e62767d63e69f80266fbc10b681fc0c892e
37
py
Python
Chapter -8 Dataframe/usemodule.py
jaiswalIT02/pythonprograms
bc94e52121202b04c3e9112d9786f93ed6707f7a
[ "MIT" ]
null
null
null
Chapter -8 Dataframe/usemodule.py
jaiswalIT02/pythonprograms
bc94e52121202b04c3e9112d9786f93ed6707f7a
[ "MIT" ]
null
null
null
Chapter -8 Dataframe/usemodule.py
jaiswalIT02/pythonprograms
bc94e52121202b04c3e9112d9786f93ed6707f7a
[ "MIT" ]
null
null
null
import exelmodule as ex ex.hellofn()
12.333333
23
0.783784
6
37
4.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.135135
37
2
24
18.5
0.90625
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
67f925d1afb034f2409905a49958fef41bec5268
161
py
Python
split/x32/exploit.py
limitedeternity/ROPEmporium
d8c1c7fe9122166af7a4e365356678f3a2a15f43
[ "MIT" ]
null
null
null
split/x32/exploit.py
limitedeternity/ROPEmporium
d8c1c7fe9122166af7a4e365356678f3a2a15f43
[ "MIT" ]
null
null
null
split/x32/exploit.py
limitedeternity/ROPEmporium
d8c1c7fe9122166af7a4e365356678f3a2a15f43
[ "MIT" ]
null
null
null
import struct cmd = 0x0804a030 system = 0x080483e0 smash_offset = 44 print "\x90" * smash_offset + struct.pack("<I", system) + "AAAA" + struct.pack("<I", cmd)
20.125
89
0.68323
22
161
4.909091
0.636364
0.203704
0.203704
0
0
0
0
0
0
0
0
0.147059
0.15528
161
7
90
23
0.647059
0
0
0
0
0
0.074534
0
0
0
0.124224
0
0
0
null
null
0
0.2
null
null
0.2
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
c02d7e009a6bc673473a1fe721725554857ecceb
148
py
Python
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/features/effort_estimation/api.py
osoco/better-ways-of-thinking-about-software
83e70d23c873509e22362a09a10d3510e10f6992
[ "MIT" ]
3
2021-12-15T04:58:18.000Z
2022-02-06T12:15:37.000Z
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/features/effort_estimation/api.py
osoco/better-ways-of-thinking-about-software
83e70d23c873509e22362a09a10d3510e10f6992
[ "MIT" ]
null
null
null
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/features/effort_estimation/api.py
osoco/better-ways-of-thinking-about-software
83e70d23c873509e22362a09a10d3510e10f6992
[ "MIT" ]
1
2019-01-02T14:38:50.000Z
2019-01-02T14:38:50.000Z
""" API entry point to the effort_estimation app. """ # pylint: disable=unused-import from .block_transformers import EffortEstimationTransformer
18.5
59
0.797297
17
148
6.823529
0.941176
0
0
0
0
0
0
0
0
0
0
0
0.121622
148
7
60
21.142857
0.892308
0.513514
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c03e1477d7c114fd2e0ffc8458bbd0bfc88fec3e
38
py
Python
tests/storage/__init__.py
dysnix/static-transfer-learning
30472bfa839392cedcfac0607bca628a87754fbe
[ "MIT" ]
null
null
null
tests/storage/__init__.py
dysnix/static-transfer-learning
30472bfa839392cedcfac0607bca628a87754fbe
[ "MIT" ]
13
2019-10-23T05:23:20.000Z
2022-02-10T01:41:24.000Z
tests/storage/__init__.py
dysnix/static-transfer-learning
30472bfa839392cedcfac0607bca628a87754fbe
[ "MIT" ]
1
2019-08-29T13:47:12.000Z
2019-08-29T13:47:12.000Z
class BaseStorage(object): pass
7.6
26
0.684211
4
38
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.236842
38
4
27
9.5
0.896552
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
c069c9fb40a86d53bea06fb25134dcf8e242fc24
275
py
Python
tensor/lda.py
CodePrometheus/Starry-PyTorch
8d845547b044ca89472246a6a351546e2d3479b2
[ "MIT" ]
null
null
null
tensor/lda.py
CodePrometheus/Starry-PyTorch
8d845547b044ca89472246a6a351546e2d3479b2
[ "MIT" ]
null
null
null
tensor/lda.py
CodePrometheus/Starry-PyTorch
8d845547b044ca89472246a6a351546e2d3479b2
[ "MIT" ]
null
null
null
""" 和nlp中的LDA区分开来, 其LDA是隐含狄利克雷分布(Latent Dirichlet Allocation,简称LDA),是一种处理文档的主题模型 ----- LDA是一种监督学习的降维技术,也就是说它的数据集的每个样本是有类别输出的。这点和PCA不同。PCA是不考虑样本类别输出的无监督降维技术。 LDA的思想可以用一句话概括,就是“投影后类内方差最小,类间方差最大” 将数据在低维度上进行投影,投影后希望每一种类别数据的投影点尽可能的接近,而不同类别的数据的类别中心之间的距离尽可能的大 与PCA不同,更关心分类而不是方差 """
30.555556
76
0.861818
20
275
11.85
1
0
0
0
0
0
0
0
0
0
0
0
0.04
275
8
77
34.375
0.897727
0.967273
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
22403c6047bd75732a3185520dde9176fff9528a
44
py
Python
mechanize-0.4.7/mechanize/_version.py
Spam-Bombers/Email-Bomb
1712eb64a9822506693aa7b9764a1327a101836a
[ "MIT" ]
1
2022-02-27T06:26:55.000Z
2022-02-27T06:26:55.000Z
mechanize-0.4.7/mechanize/_version.py
Spam-Bombers/Email-Bomb
1712eb64a9822506693aa7b9764a1327a101836a
[ "MIT" ]
null
null
null
mechanize-0.4.7/mechanize/_version.py
Spam-Bombers/Email-Bomb
1712eb64a9822506693aa7b9764a1327a101836a
[ "MIT" ]
null
null
null
"0.4.7" __version__ = (0, 4, 7, None, None)
14.666667
35
0.568182
9
44
2.333333
0.555556
0.190476
0.285714
0
0
0
0
0
0
0
0
0.166667
0.181818
44
2
36
22
0.416667
0.113636
0
0
0
0
0.113636
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
97e4e33563510d2c2a66fd1437d1274c14c4fe42
3,744
py
Python
util/test/tests/Vulkan/VK_Image_Layouts.py
hbina/renderdoc
3f71e1739cfda98761ce7dc3a572f709125c93f2
[ "MIT" ]
6,181
2015-01-07T11:49:11.000Z
2022-03-31T21:46:55.000Z
util/test/tests/Vulkan/VK_Image_Layouts.py
hbina/renderdoc
3f71e1739cfda98761ce7dc3a572f709125c93f2
[ "MIT" ]
2,015
2015-01-16T01:45:25.000Z
2022-03-25T12:01:06.000Z
util/test/tests/Vulkan/VK_Image_Layouts.py
hbina/renderdoc
3f71e1739cfda98761ce7dc3a572f709125c93f2
[ "MIT" ]
1,088
2015-01-06T08:36:25.000Z
2022-03-30T03:31:21.000Z
import rdtest import renderdoc as rd class VK_Image_Layouts(rdtest.TestCase): demos_test_name = 'VK_Image_Layouts' def get_capture_options(self): opts = rd.CaptureOptions() # Ref all resources to pull in the image with unbound data opts.refAllResources = True return opts def check_capture(self): self.controller.SetFrameEvent(0, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() # Check that the layout is reported correctly at the start of the frame for img in pipe.images: img: rd.VKImageData res = self.get_resource(img.resourceId) if res.name == "Image:Preinitialised": if img.layouts[0].name != "VK_IMAGE_LAYOUT_PREINITIALIZED": raise rdtest.TestFailureException("Pre-initialised image is in {} layout".format(img.layouts[0].name)) elif res.name == "Image:Undefined": if img.layouts[0].name != "VK_IMAGE_LAYOUT_UNDEFINED": raise rdtest.TestFailureException("Undefined image is in {} layout".format(img.layouts[0].name)) elif res.name == "Image:Swapchain": if img.layouts[0].name != "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR": raise rdtest.TestFailureException("Swapchain image is in {} layout".format(img.layouts[0].name)) action = self.find_action("Before Transition") self.check(action is not None) self.controller.SetFrameEvent(action.eventId, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() # Check that the layout is reported correctly before transitions still for img in pipe.images: img: rd.VKImageData res = self.get_resource(img.resourceId) if res.name == "Image:Preinitialised": if img.layouts[0].name != "VK_IMAGE_LAYOUT_PREINITIALIZED": raise rdtest.TestFailureException("Pre-initialised image is in {} layout".format(img.layouts[0].name)) elif res.name == "Image:Undefined": if img.layouts[0].name != "VK_IMAGE_LAYOUT_UNDEFINED": raise rdtest.TestFailureException("Undefined image is in {} layout".format(img.layouts[0].name)) elif res.name == "Image:Swapchain": if img.layouts[0].name != "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR": raise rdtest.TestFailureException("Swapchain image is in {} layout".format(img.layouts[0].name)) action = self.find_action("vkCmdDraw") self.check(action is not None) self.controller.SetFrameEvent(action.eventId, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() # Check that after transitions, the images are in the right state for img in pipe.images: img: rd.VKImageData res = self.get_resource(img.resourceId) if res.name == "Image:Preinitialised": if img.layouts[0].name != "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL": raise rdtest.TestFailureException("Pre-initialised image is in {} layout".format(img.layouts[0].name)) elif res.name == "Image:Undefined": if img.layouts[0].name != "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL": raise rdtest.TestFailureException("Undefined image is in {} layout".format(img.layouts[0].name)) elif img.resourceId == pipe.currentPass.framebuffer.attachments[0].imageResourceId: if img.layouts[0].name != "VK_IMAGE_LAYOUT_GENERAL": raise rdtest.TestFailureException("Rendered swapchain image is in {} layout".format(img.layouts[0].name))
48
125
0.640759
439
3,744
5.353075
0.214123
0.076596
0.084255
0.114894
0.785957
0.785957
0.785957
0.785957
0.773191
0.766383
0
0.007189
0.256944
3,744
77
126
48.623377
0.837527
0.069177
0
0.690909
0
0
0.215517
0.076724
0
0
0
0
0
1
0.036364
false
0.018182
0.036364
0
0.127273
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
97e5610da33ef1add26e1e9741bf84a720eca1f5
115
py
Python
tests/conftest.py
biocommons/hgvs-installation-test
edbb95ac18cee1be6de6fc878151e7712ca757c5
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
biocommons/hgvs-installation-test
edbb95ac18cee1be6de6fc878151e7712ca757c5
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
biocommons/hgvs-installation-test
edbb95ac18cee1be6de6fc878151e7712ca757c5
[ "Apache-2.0" ]
null
null
null
import pytest from hgvs.parser import Parser @pytest.fixture(scope="session") def parser(): return Parser()
12.777778
32
0.730435
15
115
5.6
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.156522
115
8
33
14.375
0.865979
0
0
0
0
0
0.06087
0
0
0
0
0
0
1
0.2
true
0
0.4
0.2
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
1
0
0
0
5
3f1315b0b93c22cf5f37d13c738fdd88e08bc89d
223
py
Python
bilevelmri/lower_level/__init__.py
fsherry/bilevelmri
7afad2b9ed3c350499cf382b17dbe1bc5ddede3d
[ "BSD-2-Clause" ]
8
2020-07-07T23:56:01.000Z
2022-03-21T11:17:44.000Z
bilevelmri/lower_level/__init__.py
fsherry/bilevelmri
7afad2b9ed3c350499cf382b17dbe1bc5ddede3d
[ "BSD-2-Clause" ]
null
null
null
bilevelmri/lower_level/__init__.py
fsherry/bilevelmri
7afad2b9ed3c350499cf382b17dbe1bc5ddede3d
[ "BSD-2-Clause" ]
4
2020-12-14T07:48:50.000Z
2021-06-08T19:40:28.000Z
from ._diff_solver import lower_level_solver from ._lower_level_solver import lower_level_objective, lower_level_objective_grad __all__ = [ 'lower_level_solver', 'lower_level_objective', 'lower_level_objective_grad' ]
31.857143
82
0.843049
30
223
5.5
0.3
0.424242
0.460606
0.266667
0.509091
0.509091
0.509091
0
0
0
0
0
0.09417
223
6
83
37.166667
0.816832
0
0
0
0
0
0.29148
0.210762
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
3f1b9151ba32416e3ac443ee4b79d94033747973
230
py
Python
test/login.py
Baiyujun520/test17
774610c744320f463ff0fd705998b976bf1e46bb
[ "MIT" ]
null
null
null
test/login.py
Baiyujun520/test17
774610c744320f463ff0fd705998b976bf1e46bb
[ "MIT" ]
null
null
null
test/login.py
Baiyujun520/test17
774610c744320f463ff0fd705998b976bf1e46bb
[ "MIT" ]
null
null
null
def one(): print('这是第一个功能') def two(): print('第二个功能已经完成') def three(): print('第三个功能已经实现') def four(): print('第四个功能正在完成') def five(): pass def new(): print('新功能上线') def end(): print('项目成功完成,成功上线')
10.952381
24
0.56087
28
230
4.607143
0.607143
0
0
0
0
0
0
0
0
0
0
0
0.23913
230
20
25
11.5
0.737143
0
0
0
0
0
0.217391
0
0
0
0
0
0
1
0.5
true
0.071429
0
0
0.5
0.428571
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
0
0
1
0
5
3f214c7f4cef557f939aff0637e5a2a31668286a
19
py
Python
cake/functions/basic/__init__.py
polo-sec/Cake
ab3ae8e53b9399ee011f77d6b6e918762e52da78
[ "MIT" ]
6
2021-01-21T21:18:00.000Z
2022-02-15T23:22:23.000Z
hsfm/trig/__init__.py
friedrichknuth/hsfm
4725766fcde81e411b0aa07e9091f6c884382d1e
[ "MIT" ]
15
2020-12-30T22:36:08.000Z
2022-02-23T05:47:14.000Z
cake/functions/basic/__init__.py
polo-sec/Cake
ab3ae8e53b9399ee011f77d6b6e918762e52da78
[ "MIT" ]
1
2022-03-08T21:32:25.000Z
2022-03-08T21:32:25.000Z
from .trig import *
19
19
0.736842
3
19
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.157895
19
1
19
19
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3f3ee4066786d6bad9977c9a57ad1d7ab472ac3b
158,869
py
Python
lib/modules/ics/veeder_root_guardian_ast/files/commands.py
securestep9/OWASP-Honeypot
bb2de32ed83f47c04f654ae4b9d56c0af3e0010f
[ "Apache-2.0" ]
null
null
null
lib/modules/ics/veeder_root_guardian_ast/files/commands.py
securestep9/OWASP-Honeypot
bb2de32ed83f47c04f654ae4b9d56c0af3e0010f
[ "Apache-2.0" ]
null
null
null
lib/modules/ics/veeder_root_guardian_ast/files/commands.py
securestep9/OWASP-Honeypot
bb2de32ed83f47c04f654ae4b9d56c0af3e0010f
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import random from config import module_configuration # todo: (dynamic && logical) numbers - output numbers must change randomly and logically, we need to analysis a real # device to figure out the logic for each command. # todo: add docs - add docs to functions # Ref: http://docs.veeder.com/gold/download.cfm?doc_id=4438 # S00100 Reset # S00200 Clear Reset Flag # S00300 Remote Alarm Reset # I10100 System Status Report # I20100 Inventory # I20200 Delivery # I20400 Shift Inventory # I20500 Tank Status # I20600 Tank Alarm History # I30100 Sensor Status # I30200 Sensor Alarm History # I40600 Relay Status # S50100 Set Time of Day # IA0100 Tank Diagnostics # IB0100 Sensor Diagnostics def now(model="%b %d, %Y %I:%M %p"): return datetime.datetime.now().strftime(model) def generate_randomize_float(number, plus, minus): return "%.2f" % random.uniform(number + minus, number + plus) def generate_randomize_int(number, plus, minus): return "%d" % random.randint(number + minus, number + plus) def I10100(): return "".join( [ '\x01\r\nI10100\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'SYSTEM STATUS REPORT', '\r\n\r\n', 'D 8:ALARM CLEAR WARNING', '\r\n\r\n', '\x03' ] ) def I10200(): return "".join( [ '\x01\r\nI10200\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'SYSTEM CONFIGURATION', '\r\n\r\n', 'SLOT BOARD TYPE POWER ON RESET CURRENT\r\n', ' 1 PLLD SENSOR BD 3882 3864\r\n', ' 2 INTERSTITIAL BD 202440 201698\r\n', ' 3 8SMARTSENSOR BD 39681 39594\r\n', ' 4 4 PROBE / G.T. 164489 164087\r\n', ' 5 UNUSED 9922452 9806112\r\n', ' 6 UNUSED 9895411 9794026\r\n', ' 7 UNUSED 9911016 9789239\r\n', ' 8 UNUSED 9892610 9806957\r\n', ' 9 PLLD POWER BD 100307 100205\r\n', ' 10 PLLD POWER BD 100133 99984\r\n', ' 11 UNUSED 9902247 9793640\r\n', ' 12 UNUSED 9906330 9807243\r\n', ' 13 UNUSED 9885509 9793619\r\n', ' 14 UNUSED 9904257 9790045\r\n', ' 15 UNUSED 9893889 9800940\r\n', ' 16 UNUSED 9890811 9786016\r\n', ' COMM 1 ELEC DISP INT. 100852 100802\r\n', ' COMM 2 SERIAL SAT BD 481672 480551\r\n', ' COMM 3 UNUSED 9906416 9803929\r\n', ' COMM 4 UNUSED 9884056 9782746\r\n', ' COMM 5 UNUSED 9898186 9806203\r\n', ' COMM 6 UNUSED 9890469 9786623\r\n', '\r\n', '\x03' ] ) def I11100(): return "".join( [ '\x01\r\nI11100\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'PRIORITY ALARM HISTORY\r\n', 'ID CATEGORY DESCRIPTION ALARM TYPE STATE DATE TIME\r\n', 'Q 4 OTHER DIESEL PERIODIC LINE FAIL CLEAR 7-09-18 2:49PM\r\n', 'Q 4 OTHER DIESEL PERIODIC LINE FAIL ALARM 7-09-18 4:36AM\r\n', 'Q 4 OTHER DIESEL PLLD SHUTDOWN ALARM CLEAR 6-19-18 9:01AM\r\n', 'Q 4 OTHER DIESEL GROSS LINE FAIL CLEAR 6-19-18 9:01AM\r\n', 'Q 4 OTHER DIESEL PLLD SHUTDOWN ALARM ALARM 6-19-18 8:46AM\r\n', 'Q 4 OTHER DIESEL GROSS LINE FAIL ALARM 6-19-18 8:46AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 5-10-18 11:29AM\r\n', 'Q 3 OTHER SUPREME GROSS LINE FAIL CLEAR 5-10-18 11:29AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM CLEAR 5-10-18 11:24AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM ALARM 5-10-18 10:52AM\r\n', 'Q 3 OTHER SUPREME GROSS LINE FAIL ALARM 5-10-18 10:52AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM ALARM 5-10-18 10:43AM\r\n', 'Q 4 OTHER DIESEL PLLD SHUTDOWN ALARM CLEAR 4-19-18 11:34AM\r\n', 'Q 4 OTHER DIESEL GROSS LINE FAIL CLEAR 4-19-18 11:34AM\r\n', 'Q 2 OTHER PLUS PLLD SHUTDOWN ALARM CLEAR 4-19-18 11:33AM\r\n', 'Q 2 OTHER PLUS GROSS LINE FAIL CLEAR 4-19-18 11:33AM\r\n', 'Q 1 OTHER REGULAR PLLD SHUTDOWN ALARM CLEAR 4-19-18 11:33AM\r\n', 'Q 1 OTHER REGULAR GROSS LINE FAIL CLEAR 4-19-18 11:33AM\r\n', 'L 2 ANNULAR PLUS ANNULAR FUEL ALARM CLEAR 4-19-18 11:09AM\r\n', 'L 2 ANNULAR PLUS ANNULAR FUEL ALARM ALARM 4-19-18 11:06AM\r\n', 'L 1 ANNULAR REGULAR ANNULAR FUEL ALARM CLEAR 4-19-18 11:01AM\r\n', 'L 1 ANNULAR REGULAR ANNULAR FUEL ALARM ALARM 4-19-18 11:00AM\r\n', 'L 4 ANNULAR DIESEL ANNULAR FUEL ALARM CLEAR 4-19-18 10:55AM\r\n', 'L 4 ANNULAR DIESEL ANNULAR FUEL ALARM ALARM 4-19-18 10:51AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM CLEAR 4-19-18 10:46AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM ALARM 4-19-18 10:45AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN WATER ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN WATER ALARM ALARM 4-19-18 10:45AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM ALARM 4-19-18 10:45AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN FUEL ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN FUEL ALARM ALARM 4-19-18 10:45AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM ALARM 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM ALARM 4-19-18 10:44AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:43AM\r\n', 's 6 OTHER 3,4 PAN WATER ALARM CLEAR 4-19-18 10:43AM\r\n', 's 6 OTHER 3,4 PAN WATER ALARM ALARM 4-19-18 10:42AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM ALARM 4-19-18 10:42AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:42AM\r\n', 's 6 OTHER 3,4 PAN FUEL ALARM CLEAR 4-19-18 10:42AM\r\n', 's 6 OTHER 3,4 PAN FUEL ALARM ALARM 4-19-18 10:42AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM ALARM 4-19-18 10:42AM\r\ns', ' 7 OTHER 5,6 PAN-DIESEL WATER ALARM CLEAR 4-19-18 10:41AM\r\n', 's 7 OTHER 5,6 PAN-DIESEL WATER ALARM ALARM 4-19-18 10:41AM\r\n', 's 7 OTHER 5,6 PAN-DIESEL FUEL ALARM CLEAR 4-19-18 10:41AM\r\n', 's 7 OTHER 5,6 PAN-DIESEL FUEL ALARM ALARM 4-19-18 10:41AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:40AM\r\n', 's 5 OTHER 1,2 PAN WATER ALARM CLEAR 4-19-18 10:40AM\r\n', '\r\n', '\x03' ] ) def I11200(): return "".join( [ '\x01\r\nI11200\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'NON-PRIORITY ALARM HISTORY\r\n', 'ID CATEGORY DESCRIPTION ALARM TYPE STATE DATE TIME\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED CLEAR 8-02-18 5:36AM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED ALARM 8-02-18 5:09AM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 7-24-18 4:17PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED ALARM 7-24-18 1:36PM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED CLEAR 6-29-18 5:40PM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED ALARM 6-29-18 2:58AM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 6-20-18 12:15AM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 6-19-18 6:29PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 6-14-18 3:11PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED ALARM 6-14-18 1:56PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 6-06-18 5:50PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 6-06-18 1:52PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 5-18-18 6:11AM\r\n', ' SYSTEM PAPER OUT CLEAR 5-18-18 6:11AM\r\n', ' SYSTEM PRINTER ERROR ALARM 5-18-18 6:10AM\r\n', ' SYSTEM PAPER OUT ALARM 5-18-18 6:10AM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 5-15-18 10:03PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 5-15-18 9:58PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED ALARM 5-15-18 6:56PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 5-15-18 6:49PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 5-11-18 3:08PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 5-11-18 3:07PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED ALARM 5-11-18 12:07PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 5-10-18 10:52PM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED CLEAR 5-08-18 1:08PM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED ALARM 5-07-18 3:16PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-26-18 10:47PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 4-26-18 12:43PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-23-18 8:34PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 4-23-18 6:29PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 4-20-18 6:15PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED ALARM 4-20-18 5:50PM\r\n', 's 1 OTHER REGULAR STP SUMP WATER WARNING CLEAR 4-19-18 10:31AM\r\n', 's 1 OTHER REGULAR STP SUMP WATER WARNING ALARM 4-19-18 10:31AM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-14-18 11:34PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 4-14-18 2:39PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-10-18 9:03PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED ALARM 4-10-18 11:01AM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 4-04-18 12:33AM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED ALARM 4-03-18 11:06PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR ALARM 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PAPER OUT CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR ALARM 3-30-18 9:58PM\r\n', ' SYSTEM PAPER OUT ALARM 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR ALARM 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PAPER OUT CLEAR 3-30-18 9:58PM\r\n', '\r\n', '\x03' ] ) def I11300(): return "".join( [ '\x01\r\nI11300\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'ACTIVE ALARMS REPORT', '\r\n\r\n', 'ID CATEGORY DESCRIPTION ALARM TYPE DATE TIME\r\n', 'D 8 OTHER VEEDER ROOT (FMS) ALARM CLEAR WARNING \r\n\r\n', '\r\n', '\x03' ] ) def I11400(): return "".join( [ '\x01\r\nI11400\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'CLEARED ALARMS REPORT', '\r\n\r\n', 'ID CATEGORY DESCRIPTION ALARM TYPE STATE DATE TIME\r\n', 'Q 4 OTHER DIESEL PERIODIC LINE FAIL CLEAR 7-09-18 2:49PM\r\n', 'Q 4 OTHER DIESEL PLLD SHUTDOWN ALARM CLEAR 6-19-18 9:01AM\r\n', 'Q 4 OTHER DIESEL GROSS LINE FAIL CLEAR 6-19-18 9:01AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 5-10-18 11:29AM\r\n', 'Q 3 OTHER SUPREME GROSS LINE FAIL CLEAR 5-10-18 11:29AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM CLEAR 5-10-18 11:24AM\r\n', 'Q 4 OTHER DIESEL PLLD SHUTDOWN ALARM CLEAR 4-19-18 11:34AM\r\n', 'Q 4 OTHER DIESEL GROSS LINE FAIL CLEAR 4-19-18 11:34AM\r\n', 'Q 2 OTHER PLUS PLLD SHUTDOWN ALARM CLEAR 4-19-18 11:33AM\r\n', 'Q 2 OTHER PLUS GROSS LINE FAIL CLEAR 4-19-18 11:33AM\r\n', 'Q 1 OTHER REGULAR PLLD SHUTDOWN ALARM CLEAR 4-19-18 11:33AM\r\n', 'Q 1 OTHER REGULAR GROSS LINE FAIL CLEAR 4-19-18 11:33AM\r\n', 'L 2 ANNULAR PLUS ANNULAR FUEL ALARM CLEAR 4-19-18 11:09AM\r\n', 'L 1 ANNULAR REGULAR ANNULAR FUEL ALARM CLEAR 4-19-18 11:01AM\r\n', 'L 4 ANNULAR DIESEL ANNULAR FUEL ALARM CLEAR 4-19-18 10:55AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM CLEAR 4-19-18 10:46AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN WATER ALARM CLEAR 4-19-18 10:45AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN FUEL ALARM CLEAR 4-19-18 10:45AM\r\n', 's 8 OTHER 7,8 PAN INSTALL ALARM CLEAR 4-19-18 10:45AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:43AM\r\n', 's 6 OTHER 3,4 PAN WATER ALARM CLEAR 4-19-18 10:43AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:42AM\r\n', 's 6 OTHER 3,4 PAN FUEL ALARM CLEAR 4-19-18 10:42AM\r\n', 's 7 OTHER 5,6 PAN-DIESEL WATER ALARM CLEAR 4-19-18 10:41AM\r\n', 's 7 OTHER 5,6 PAN-DIESEL FUEL ALARM CLEAR 4-19-18 10:41AM\r\n', 'Q 3 OTHER SUPREME PLLD SHUTDOWN ALARM CLEAR 4-19-18 10:40AM\r\n', 's 5 OTHER 1,2 PAN WATER ALARM CLEAR 4-19-18 10:40AM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED CLEAR 8-02-18 5:36AM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 7-24-18 4:17PM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED CLEAR 6-29-18 5:40PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 6-20-18 12:15AM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 6-14-18 3:11PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 6-06-18 5:50PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 5-18-18 6:11AM\r\n', ' SYSTEM PAPER OUT CLEAR 5-18-18 6:11AM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 5-15-18 10:03PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 5-15-18 9:58PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 5-11-18 3:08PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 5-11-18 3:07PM\r\n', 'T 4 TANK DIESEL DELIVERY NEEDED CLEAR 5-08-18 1:08PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-26-18 10:47PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-23-18 8:34PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 4-20-18 6:15PM\r\n', 's 1 OTHER REGULAR STP SUMP WATER WARNING CLEAR 4-19-18 10:31AM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-14-18 11:34PM\r\n', 'T 3 TANK SUPREME DELIVERY NEEDED CLEAR 4-10-18 9:03PM\r\n', 'T 1 TANK REGULAR DELIVERY NEEDED CLEAR 4-04-18 12:33AM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PAPER OUT CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PRINTER ERROR CLEAR 3-30-18 9:58PM\r\n', ' SYSTEM PAPER OUT CLEAR 3-30-18 9:58PM\r\n', '\r\n', '\x03' ] ) def I20100(): return "".join( [ "\x01\r\nI20100\r\n", now(), "\r\n\r\n", module_configuration()["company_name_address"], "\r\n\r\n", "IN-TANK INVENTORY \r\n", "\r\n", "TANK PRODUCT VOLUME TC VOLUME ULLAGE HEIGHT WATER TEMP\r\n", " 1 REGULAR {0} 0 {1} {2} 0.00 {3}\r\n".format( generate_randomize_int(1693, 200, -200), generate_randomize_int(9755, 100, -200), generate_randomize_float(18.75, 3.50, -3.50), generate_randomize_float(76.26, 15.50, -15.50) ), " 2 PLUS {0} 0 {1} {2} {3} {4}\r\n".format( generate_randomize_int(1788, 200, -200), generate_randomize_int(6003, 100, -200), generate_randomize_float(25.65, 5.50, -6.50), generate_randomize_float(0.89, 0.10, -0.30), generate_randomize_float(74.02, 20.00, -20.00) ), " 3 SUPREME {0} 0 {1} {2} {3} {4}\r\n".format( generate_randomize_int(1748, 200, -200), generate_randomize_int(7871, 100, -200), generate_randomize_float(21.71, 5.50, -6.50), generate_randomize_float(0.76, 0.21, -0.30), generate_randomize_float(75.99, 20.00, -20.00) ), " 4 DIESEL {0} 0 {1} {2} 0.00 {3}\r\n".format( generate_randomize_int(2147, 200, -200), generate_randomize_int(7472, 100, -200), generate_randomize_float(25.04, 3.50, -3.50), generate_randomize_float(75.48, 15.50, -15.50) ), "\r\n", "\x03" ] ) def I20200(): return "".join( [ '\x01\r\nI20200\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'DELIVERY REPORT', '\r\n\r\n', 'T 1:REGULAR\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 7, 2018 5:29 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: AUG 7, 2018 4:55 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: AUG 4, 2018 10:03 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: AUG 4, 2018 9:38 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: AUG 2, 2018 5:53 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: AUG 2, 2018 5:35 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: AUG 1, 2018 1:23 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: AUG 1, 2018 1:09 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: JUL 29, 2018 1:04 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: JUL 29, 2018 12:32 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: JUL 25, 2018 2:22 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: JUL 25, 2018 1:54 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: JUL 24, 2018 4:29 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: JUL 24, 2018 4:16 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: JUL 21, 2018 9:05 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: JUL 21, 2018 8:41 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: JUL 18, 2018 2:27 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: JUL 18, 2018 2:00 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), ' END: JUL 17, 2018 2:35 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(9001, 500, -1000), generate_randomize_int(8908, 500, -1000), generate_randomize_float(74.67, 23.50, -14.50), generate_randomize_float(65.05, 26.50, -13.50) ), ' START: JUL 17, 2018 2:19 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1693, 500, -500), generate_randomize_int(1674, 500, -500), generate_randomize_float(76.24, 23.50, -14.50), generate_randomize_float(18.75, 26.50, -8.50) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(7308, 1000, -1000), generate_randomize_int(7234, 1000, -1000), ), 'T 2:PLUS\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 4, 2018 9:50 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: AUG 4, 2018 9:38 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: AUG 1, 2018 1:21 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: AUG 1, 2018 1:10 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 26, 2018 4:17 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 26, 2018 4:05 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 21, 2018 9:01 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 21, 2018 8:50 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 14, 2018 7:02 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 14, 2018 6:53 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 11, 2018 1:46 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 11, 2018 1:34 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 2, 2018 6:01 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 2, 2018 5:51 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUN 27, 2018 4:50 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUN 27, 2018 4:41 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUN 24, 2018 3:33 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUN 24, 2018 3:24 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUN 21, 2018 11:29 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUN 21, 2018 11:18 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), 'T 3:SUPREME\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 7, 2018 5:09 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: AUG 7, 2018 5:01 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: AUG 4, 2018 9:55 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: AUG 4, 2018 9:45 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: AUG 2, 2018 5:52 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: AUG 2, 2018 5:45 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 29, 2018 12:45 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 29, 2018 12:34 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 25, 2018 1:57 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 25, 2018 1:51 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 24, 2018 4:33 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 24, 2018 4:25 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 18, 2018 2:03 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 18, 2018 1:54 PM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 14, 2018 7:05 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 14, 2018 6:52 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 11, 2018 1:49 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 11, 2018 1:40 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), ' END: JUL 7, 2018 5:41 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(2583, 500, -500), generate_randomize_int(2554, 500, -500), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 7, 2018 5:30 AM {0} {1} {2} {3} {4}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(1196, 20, -190), generate_randomize_int(1181, 25, -180) ), 'T 4:DIESEL\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 2, 2018 5:51 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: AUG 2, 2018 5:36 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1500, 500, -480), generate_randomize_int(1500, 500, -480), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: JUL 21, 2018 8:54 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 21, 2018 8:40 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: JUL 9, 2018 3:02 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUL 9, 2018 2:39 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: JUN 29, 2018 5:52 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUN 29, 2018 5:39 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: JUN 20, 2018 12:18 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUN 20, 2018 12:04 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: JUN 12, 2018 4:22 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUN 12, 2018 4:07 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: JUN 4, 2018 6:35 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: JUN 4, 2018 6:22 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: MAY 23, 2018 9:06 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: MAY 23, 2018 8:51 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: MAY 13, 2018 6:20 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: MAY 13, 2018 6:07 AM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), ' END: MAY 8, 2018 1:19 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(3267, 500, -2200), generate_randomize_int(3267, 500, -2200), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' START: MAY 8, 2018 1:07 PM {0} {1} 0.00 {2} {3}\r\n'.format( generate_randomize_int(1387, 500, -366), generate_randomize_int(1373, 500, -320), generate_randomize_float(0.89, 0.13, -0.13), generate_randomize_float(75.49, 2.10, -2.10), generate_randomize_float(33.18, 5.50, -10.70) ), ' AMOUNT: {0} {1}\r\n\r\n'.format( generate_randomize_int(2279, 500, -500), generate_randomize_int(2260, 500, -500) ), '\r\n', '\x03' ] ) def I20300(): return "".join( [ '\x01\r\nI20300\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'TANK 1 REGULAR \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n', '\r\n\r\n', 'TANK 2 PLUS \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n', '\r\n\r\n', 'TANK 3 SUPREME \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n', '\r\n\r\n', 'TANK 4 DIESEL \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n', '\r\n\r\n', '\r\n', '\x03' ] ) def I20400(): return "".join( [ '\x01\r\nI20400\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', ' SHIFT REPORT \r\n\r\n', 'SHIFT 1 TIME: 12:00 AM \r\n\r\n', 'TANK PRODUCT\r\n\r\n', ' 1 REGULAR VOLUME TC VOLUME ULLAGE HEIGHT WATER TEMP\r\n', 'SHIFT 1 STARTING VALUES {0} {1} {2} {3} 0.00 {4}\r\n'.format( generate_randomize_int(4672, 500, -2200), generate_randomize_int(4621, 500, -2200), generate_randomize_int(6776, 500, -2200), generate_randomize_float(38.44, 6.10, -12.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' ENDING VALUES {0} {1} {2} {3} 0.00 {4}\r\n'.format( generate_randomize_int(1724, 500, -500), generate_randomize_int(1704, 500, -500), generate_randomize_int(9724, 500, -2200), generate_randomize_float(18.99, 6.10, -4.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' DELIVERY VALUE 0\r\n', ' TOTALS {0}\r\n\r\n'.format( generate_randomize_int(2948, 500, -1500) ), ' 2 PLUS VOLUME TC VOLUME ULLAGE HEIGHT WATER TEMP\r\n', 'SHIFT 1 STARTING VALUES {0} {1} {2} {3} {4} {5}\r\n'.format( generate_randomize_int(2133, 500, -2200), generate_randomize_int(2111, 500, -2200), generate_randomize_int(5658, 500, -2200), generate_randomize_float(29.00, 6.10, -12.10), generate_randomize_float(0.89, 0.10, -0.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' ENDING VALUES {0} {1} {2} {3} {4} {5}\r\n'.format( generate_randomize_int(2133, 500, -2200), generate_randomize_int(2111, 500, -2200), generate_randomize_int(5658, 500, -2200), generate_randomize_float(29.00, 6.10, -12.10), generate_randomize_float(0.89, 0.10, -0.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' DELIVERY VALUE 0\r\n', ' TOTALS {0}\r\n\r\n'.format( generate_randomize_int(400, 200, -200) ), ' 3 SUPREME VOLUME TC VOLUME ULLAGE HEIGHT WATER TEMP\r\n', 'SHIFT 1 STARTING VALUES {0} {1} {2} {3} {4} {5}\r\n'.format( generate_randomize_int(2133, 500, -2200), generate_randomize_int(2111, 500, -2200), generate_randomize_int(5658, 500, -2200), generate_randomize_float(29.00, 6.10, -12.10), generate_randomize_float(0.89, 0.10, -0.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' ENDING VALUES {0} {1} {2} {3} {4} {5}\r\n'.format( generate_randomize_int(2133, 500, -2200), generate_randomize_int(2111, 500, -2200), generate_randomize_int(5658, 500, -2200), generate_randomize_float(29.00, 6.10, -12.10), generate_randomize_float(0.89, 0.10, -0.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' DELIVERY VALUE 0\r\n', ' TOTALS {0}\r\n\r\n'.format( generate_randomize_int(439, 200, -200) ), ' 4 DIESEL VOLUME TC VOLUME ULLAGE HEIGHT WATER TEMP\r\n', 'SHIFT 1 STARTING VALUES {0} {1} {2} {3} {4} {5}\r\n'.format( generate_randomize_int(2133, 500, -2200), generate_randomize_int(2111, 500, -2200), generate_randomize_int(5658, 500, -2200), generate_randomize_float(29.00, 6.10, -12.10), generate_randomize_float(0.89, 0.10, -0.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' ENDING VALUES {0} {1} {2} {3} {4} {5}\r\n'.format( generate_randomize_int(2133, 500, -2200), generate_randomize_int(2111, 500, -2200), generate_randomize_int(5658, 500, -2200), generate_randomize_float(29.00, 6.10, -12.10), generate_randomize_float(0.89, 0.10, -0.10), generate_randomize_float(75.53, 2.50, -3.70) ), ' DELIVERY VALUE 0\r\n', ' TOTALS {0}\r\n'.format( generate_randomize_int(312, 200, -200) ), '\r\n', '\x03' ] ) def I20500(): return "".join( [ '\x01\r\nI20500\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'TANK PRODUCT STATUS\r\n\r\n', ' 1 REGULAR NORMAL\r\n\r\n', ' 2 PLUS NORMAL\r\n\r\n 3', ' SUPREME NORMAL\r\n\r\n', ' 4 DIESEL NORMAL\r\n\r\n', '\r\n', '\x03' ] ) def I20600(): return "".join( [ '\x01\r\nI20600\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n\r\n', 'TANK ALARM HISTORY\r\n\r\n', 'TANK 1 REGULAR \r\n\r\n', ' OVERFILL ALARM FEB 8, 2018 5:29 AM\r\n\r\n', ' LOW PRODUCT ALARM OCT 12, 2017 2:32 PM\r\n', ' SEP 18, 2017 4:09 PM\r\n\r\n', ' SUDDEN LOSS ALARM FEB 21, 2017 8:02 AM\r\n\r\n', ' PROBE OUT FEB 21, 2017 8:02 AM\r\n\r\n', ' DELIVERY NEEDED JUL 24, 2018 1:36 PM\r\n', ' JUN 14, 2018 1:56 PM\r\n', ' MAY 15, 2018 6:56 PM\r\n\r\n', 'TANK 2 PLUS \r\n\r\n', ' HIGH WATER ALARM APR 20, 2017 2:10 PM\r\n\r\n', ' OVERFILL ALARM APR 20, 2017 2:03 PM\r\n\r\n', ' LOW PRODUCT ALARM APR 20, 2017 2:01 PM\r\n', ' FEB 21, 2017 8:21 AM\r\n\r\n', ' HIGH PRODUCT ALARM APR 20, 2017 2:04 PM\r\n\r\n', ' INVALID FUEL LEVEL APR 20, 2017 2:01 PM\r\n\r\n', ' PROBE OUT APR 20, 2017 2:33 PM\r\n', ' APR 20, 2017 2:00 PM\r\n\r\n', ' HIGH WATER WARNING APR 20, 2017 2:10 PM\r\n\r\n', ' DELIVERY NEEDED OCT 7, 2017 7:12 PM\r\n', ' SEP 18, 2017 5:44 PM\r\n', ' JUN 26, 2017 5:31 PM\r\n\r\n', ' MAX PRODUCT ALARM APR 20, 2017 2:04 PM\r\n\r\n', 'TANK 3 SUPREME \r\n\r\n', ' HIGH WATER ALARM APR 20, 2017 2:11 PM\r\n\r\n', ' OVERFILL ALARM APR 20, 2017 2:04 PM\r\n\r\n', ' LOW PRODUCT ALARM MAY 20, 2017 4:38 PM\r\n', ' APR 20, 2017 2:03 PM\r\n\r\n', ' SUDDEN LOSS ALARM APR 20, 2017 2:02 PM\r\n\r\n', ' HIGH PRODUCT ALARM APR 20, 2017 2:04 PM\r\n\r\n', ' INVALID FUEL LEVEL APR 20, 2017 2:03 PM\r\n\r\n', ' PROBE OUT APR 20, 2017 2:30 PM\r\n', ' APR 20, 2017 2:02 PM\r\n\r\n', ' HIGH WATER WARNING APR 20, 2017 2:11 PM\r\n\r\n', ' DELIVERY NEEDED JUN 19, 2018 6:29 PM\r\n', ' JUN 6, 2018 1:52 PM\r\n', ' MAY 15, 2018 6:49 PM\r\n\r\n', ' MAX PRODUCT ALARM APR 20, 2017 2:04 PM\r\n\r\n', 'TANK 4 DIESEL \r\n\r\n', ' LOW PRODUCT ALARM AUG 11, 2017 9:40 AM\r\n', ' AUG 11, 2017 9:02 AM\r\n', ' AUG 11, 2017 8:55 AM\r\n\r\n', ' SUDDEN LOSS ALARM AUG 11, 2017 8:55 AM\r\n\r\n', ' INVALID FUEL LEVEL AUG 11, 2017 9:40 AM\r\n', ' AUG 11, 2017 9:02 AM\r\n', ' AUG 11, 2017 8:55 AM\r\n\r\n', ' PROBE OUT AUG 11, 2017 8:56 AM\r\n\r\n', ' DELIVERY NEEDED AUG 2, 2018 5:09 AM\r\n', ' JUN 29, 2018 2:58 AM\r\n', ' MAY 7, 2018 3:16 PM\r\n\r\n', '\r\n', '\x03' ] ) def I20700(): return "".join( [ '\x01\r\nI20700\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n\r\n', 'TANK LEAK TEST HISTORY\r\n\r\n', 'T 1:REGULAR\r\n\r\n', 'LAST GROSS TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST ANNUAL TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'FULLEST ANNUAL TEST PASS\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST PERIODIC TEST PASS:\r\n\r\n', 'NO TEST PASSED\r\n\r\n\r\n', 'FULLEST PERIODIC TEST\r\n', 'PASSED EACH MONTH:\r\n\r\n', 'TEST START TIME HOURS VOLUME % VOLUME TEST TYPE\r\n\r\n\r\n\r\n', 'TANK LEAK TEST HISTORY\r\n\r\n', 'T 2:PLUS\r\n\r\n', 'LAST GROSS TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST ANNUAL TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'FULLEST ANNUAL TEST PASS\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST PERIODIC TEST PASS:\r\n\r\n', 'NO TEST PASSED\r\n\r\n\r\n', 'FULLEST PERIODIC TEST\r\n', 'PASSED EACH MONTH:\r\n\r\n', 'TEST START TIME HOURS VOLUME % VOLUME TEST TYPE\r\n\r\n\r\n\r\n', 'TANK LEAK TEST HISTORY\r\n\r\n', 'T 3:SUPREME\r\n\r\n', 'LAST GROSS TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST ANNUAL TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'FULLEST ANNUAL TEST PASS\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST PERIODIC TEST PASS:\r\n\r\n', 'NO TEST PASSED\r\n\r\n\r\n', 'FULLEST PERIODIC TEST\r\n', 'PASSED EACH MONTH:\r\n\r\n', 'TEST START TIME HOURS VOLUME % VOLUME TEST TYPE\r\n\r\n\r\n\r\n', 'TANK LEAK TEST HISTORY\r\n\r\n', 'T 4:DIESEL\r\n\r\n', 'LAST GROSS TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST ANNUAL TEST PASSED:\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'FULLEST ANNUAL TEST PASS\r\n\r\n', 'NO TEST PASSED\r\n\r\n', 'LAST PERIODIC TEST PASS:\r\n\r\n', 'NO TEST PASSED\r\n\r\n\r\n', 'FULLEST PERIODIC TEST\r\n', 'PASSED EACH MONTH:\r\n\r\n', 'TEST START TIME HOURS VOLUME % VOLUME TEST TYPE\r\n\r\n\r\n\r\n', '\r\n', '\x03' ] ) def I20800(): return "".join( [ '\x01\r\nI20800\r\n', now(), '\r\n\r\n', 'PREVIOUS IN TANK LEAK TEST RESULTS\r\n\r\n', 'TANK 1 REGULAR \r\n', 'TEST TYPE START TIME RESULT RATE HOURS VOLUME\r\n', ' ANNUAL NO TEST DATA AVAILABLE\r\n', ' PERIODIC NO TEST DATA AVAILABLE\r\n', ' GROSS NO TEST DATA AVAILABLE\r\n\r\n', 'TANK 2 PLUS \r\n', 'TEST TYPE START TIME RESULT RATE HOURS VOLUME\r\n', ' ANNUAL NO TEST DATA AVAILABLE\r\n', ' PERIODIC NO TEST DATA AVAILABLE\r\n', ' GROSS NO TEST DATA AVAILABLE\r\n\r\n', 'TANK 3 SUPREME \r\n', 'TEST TYPE START TIME RESULT RATE HOURS VOLUME\r\n', ' ANNUAL NO TEST DATA AVAILABLE\r\n', ' PERIODIC NO TEST DATA AVAILABLE\r\n', ' GROSS NO TEST DATA AVAILABLE\r\n\r\n', 'TANK 4 DIESEL \r\n', 'TEST TYPE START TIME RESULT RATE HOURS VOLUME\r\n', ' ANNUAL NO TEST DATA AVAILABLE\r\n', ' PERIODIC NO TEST DATA AVAILABLE\r\n', ' GROSS NO TEST DATA AVAILABLE\r\n\r\n', '\r\n', '\x03' ] ) def I20900(): return "".join( [ '\x01\r\nI20900\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'TANK 1 REGULAR \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n\r\n\r\n', 'TANK 2 PLUS \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n\r\n\r\n', 'TANK 3 SUPREME \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n\r\n\r\n', 'TANK 4 DIESEL \r\n', ' TEST STATUS: OFF \r\n', 'LEAK DATA NOT AVAILABLE ON THIS TANK\r\n\r\n\r\n', '\r\n', '\x03' ] ) def I20C00(): return "".join( [ '\x01\r\nI20C00\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'LAST DELIVERY REPORT\r\n\r\n', 'T 1:REGULAR\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 7, 2018 5:29 AM 9001 8908 0.00 74.67 65.05\r\n', ' START: AUG 7, 2018 4:55 AM 1693 1674 0.00 76.24 18.75\r\n', ' AMOUNT: 7308 7234\r\n\r\n', 'T 2:PLUS\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 4, 2018 9:50 AM 2583 2554 0.89 75.49 33.18\r\n', ' START: AUG 4, 2018 9:38 AM 1387 1373 0.89 74.06 21.55\r\n', ' AMOUNT: 1196 1181\r\n\r\n', 'T 3:SUPREME\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 7, 2018 5:09 AM 2991 2955 0.76 76.83 31.61\r\n', ' START: AUG 7, 2018 5:01 AM 1748 1728 0.76 75.98 21.71\r\n', ' AMOUNT: 1243 1227\r\n\r\n', 'T 4:DIESEL\r\n', 'INCREASE DATE / TIME GALLONS TC GALLONS WATER TEMP DEG F HEIGHT\r\n\r\n', ' END: AUG 2, 2018 5:51 AM 3267 3240 0.00 77.40 33.67\r\n', ' START: AUG 2, 2018 5:36 AM 988 980 0.00 76.85 14.70\r\n', ' AMOUNT: 2279 2260\r\n\r\n', '\r\n', '\x03' ] ) def I20D00(): return "".join( [ '\x01\r\nI20D00\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def I25100(): return "".join( [ '\x01\r\nI25100\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'CSLD TEST RESULTS\r\n', 'TANK PRODUCT RESULT\r\n', '\r\n', '\x03' ] ) def I30100(): return "".join( [ '\x01\r\nI30100\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'LIQUID STATUS REPORT\r\n\r\n', 'SENSOR LOCATION STATUS\r\n', ' 1 REGULAR ANNULAR SENSOR NORMAL\r\n', ' 2 PLUS ANNULAR SENSOR NORMAL\r\n', ' 3 SUPER ANNULAR SENSOR NORMAL\r\n', ' 4 DIESEL ANNULAR SENSOR NORMAL\r\n', '\r\n', '\x03' ] ) def I30200(): return "".join( [ '\x01\r\nI30200\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'LIQUID ALARM HISTORY REPORT\r\n\r\n', 'SENSOR LOCATION\r\n', ' 1 REGULAR ANNULAR \r\n', ' APR 19, 2018 11:00 AM FUEL ALARM\r\n', ' APR 20, 2017 12:49 PM FUEL ALARM\r\n', ' JAN 5, 2017 10:15 AM SETUP DATA WARNING \r\n', ' 2 PLUS ANNULAR \r\n', ' APR 19, 2018 11:06 AM FUEL ALARM\r\n', ' APR 20, 2017 12:54 PM FUEL ALARM\r\n', ' JAN 5, 2017 10:15 AM SETUP DATA WARNING \r\n', ' 3 SUPER ANNULAR \r\n', ' APR 20, 2017 1:04 PM FUEL ALARM\r\n', ' APR 20, 2017 1:03 PM FUEL ALARM\r\n', ' APR 20, 2017 1:01 PM FUEL ALARM\r\n', ' 4 DIESEL ANNULAR \r\n', ' APR 19, 2018 10:51 AM FUEL ALARM\r\n', ' APR 20, 2017 1:13 PM FUEL ALARM\r\n', ' JAN 5, 2017 10:15 AM SETUP DATA WARNING \r\n', '\r\n', '\x03' ] ) def I50100(): return "".join( [ '\x01\r\nI50100\r\n', now(), '\r\n\r\n', 'SYSTEM DATE AND TIME\r\n\r\n', '\r\n', '\x03', ] ) def I50A00(): return "".join( [ '\x01\r\nI50A00\r\n', now(), '\r\n\r\n', 'ANNUAL TEST WARNING: DAYS = 355\r\n', '\r\n', '\x03' ] ) def I50B00(): return "".join( [ '\x01\r\nI50B00\r\n', now(), '\r\n\r\n', 'ANNUAL TEST ALARM: DAYS = 365\r\n', '\r\n', '\x03' ] ) def I50C00(): return "".join( [ '\x01\r\nI50C00\r\n', now(), '\r\n\r\n', 'REMOTE PRINTER\r\n', 'DISABLED\r\n', '\r\n', '\x03' ] ) def I50E00(): return "".join( [ '\x01\r\nI50E00\r\n', now(), '\r\n\r\n', 'TEMP COMPENSATION\r\n', 'VALUE (DEG F ): 60.0\r\n', '\r\n', '\x03' ] ) def I50F00(): return "".join( [ '\x01\r\nI50F00\r\n', now(), '\r\n\r\n', 'MON DD YYYY HH:MM:SS xM\r\n', '\r\n', '\x03' ] ) def I51400(): return "".join( [ '\x01\r\nI51400\r\n', now(), '\r\n\r\n', 'H-PROTOCOL DATA FORMAT\r\n', 'HEIGHT\r\n', '\r\n', '\x03' ] ) def I51700(): return "".join( [ '\x01\r\nI51700\r\n', now(), '\r\n\r\n', 'SYSTEM TYPE AND LANGUAGE FLAG\r\n\r\n', 'SYSTEM UNITS\r\n', ' U.S.\r\n', 'SYSTEM LANGUAGE\r\n', ' ENGLISH\r\n', 'SYSTEM DATE/TIME FORMAT\r\n', 'MON DD YYYY HH:MM:SS xM\r\n', '\r\n', '\x03' ] ) def I51A00(): return "".join( [ '\x01\r\nI51A00\r\n', now(), '\r\n\r\n', 'DAYLIGHT SAVING TIME\r\n', 'ENABLED ON\r\n', '\r\n', '\x03' ] ) def I51B00(): return "".join( [ '\x01\r\nI51B00\r\n', now(), '\r\n\r\n', 'DAYLIGHT SAVING TIME\r\n\r\n', 'START DATE MAR WEEK 2 SUN 2:00 AM\r\n\r\n', 'END DATE NOV WEEK 1 SUN 2:00 AM\r\n', '\r\n', '\x03' ] ) def I51C00(): return "".join( [ '\x01\r\nI51C00\r\n', now(), '\r\n\r\n', 'TICKETED DELIVERY\r\n', 'DISABLED\r\n', '\r\n', '\x03' ] ) def I51F00(): return "".join( [ '\x01\r\nI51F00\r\n', now(), '\r\n\r\n', 'EURO PROTOCOL PREFIX\r\n', 'S\r\n', '\r\n', '\x03' ] ) def I53100(): return "".join( [ '\x01\r\nI53100\r\n', now(), '\r\n\r\n', 'RS-232 END OF MESSAGE\r\n', 'DISABLED\r\n', '\r\n', '\x03' ] ) def I60100(): return "".join( [ '\x01\r\nI60100\r\n', now(), '\r\n\r\n', 'TANK CONFIGURATION', '\r\n\r\n', 'DEVICE LABEL CONFIGURED\r\n', ' 1 REGULAR ON\r\n', ' 2 PLUS ON\r\n', ' 3 SUPREME ON\r\n', ' 4 DIESEL ON\r\n', '\r\n', '\x03' ] ) def I60200(): return "".join( [ '\x01\r\nI60200\r\n', now(), '\r\n\r\n', 'TANK PRODUCT LABEL', '\r\n\r\n', 'TANK PRODUCT LABEL \r\n', ' 1 REGULAR \r\n', ' 2 PLUS \r\n', ' 3 SUPREME \r\n', ' 4 DIESEL ', '\r\n', '\x03' ] ) def I60300(): return "".join( [ '\x01\r\nI60300\r\n', now(), '\r\n\r\n', 'TANK PRODUCT CODE', '\r\n\r\n', 'TANK PRODUCT LABEL \r\n', ' 1 REGULAR 1\r\n', ' 2 PLUS 2\r\n', ' 3 SUPREME 3\r\n', ' 4 DIESEL 4', '\r\n', '\x03' ] ) def I60400(): return "".join( [ '\x01\r\nI60400\r\n', now(), '\r\n\r\n', 'TANK FULL VOLUME', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 11682\r\n', ' 2 PLUS 7950\r\n', ' 3 SUPREME 9816\r\n', ' 4 DIESEL 9816', '\r\n', '\x03' ] ) def I60500(): return "".join( [ '\x01\r\nI60500\r\n', now(), '\r\n\r\n', 'TANK 4 POINT VOLUMES', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 11682 9479 5856 2243\r\n', ' 2 PLUS 7950 6473 3986 1505\r\n', ' 3 SUPREME 9816 7976 4921 1874\r\n', ' 4 DIESEL 9816 7976 4921 1874\r\n', '\r\n', '\x03' ] ) def I60600(): return "".join( [ '\x01\r\nI60600\r\n', now(), '\r\n\r\n', 'TANK 20 POINT VOLUMES', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 11682 0 0 0\r\n', ' 0 9479 0 0\r\n', ' 0 0 5856 0\r\n', ' 0 0 0 2243\r\n', ' 0 0 0 0\r\n', ' 2 PLUS 7950 0 0 0\r\n', ' 0 6473 0 0\r\n', ' 0 0 3986 0\r\n', ' 0 0 0 1505\r\n', ' 0 0 0 0\r\n', ' 3 SUPREME 9816 0 0 0\r\n', ' 0 7976 0 0\r\n', ' 0 0 4921 0\r\n', ' 0 0 0 1874\r\n', ' 0 0 0 0\r\n', ' 4 DIESEL 9816 0 0 0\r\n', ' 0 7976 0 0\r\n', ' 0 0 4921 0\r\n', ' 0 0 0 1874\r\n', ' 0 0 0 0\r\n', '\r\n', '\x03' ] ) def I60700(): return "".join( [ '\x01\r\nI60700\r\n', now(), '\r\n\r\n', 'TANK DIAMETER', '\r\n\r\n', 'TANK PRODUCT LABEL INCHES\r\n', ' 1 REGULAR 91.13\r\n', ' 2 PLUS 91.13\r\n', ' 3 SUPREME 91.13\r\n', ' 4 DIESEL 91.13', '\r\n', '\x03' ] ) def I60800(): return "".join( [ '\x01\r\nI60800\r\n', now(), '\r\n\r\n', 'TANK TILT', '\r\n\r\n', 'TANK PRODUCT LABEL INCHES\r\n', ' 1 REGULAR 0.00\r\n', ' 2 PLUS 0.00\r\n', ' 3 SUPREME 0.00\r\n', ' 4 DIESEL 0.00', '\r\n', '\x03' ] ) def I60900(): return "".join( [ '\x01\r\nI60900\r\n', now(), '\r\n\r\n', 'TANK THERMAL COEFFICIENT', '\r\n\r\n', 'TANK PRODUCT LABEL \r\n', ' 1 REGULAR 0.000700\r\n', ' 2 PLUS 0.000700\r\n', ' 3 SUPREME 0.000700\r\n', ' 4 DIESEL 0.000450', '\r\n', '\x03' ] ) def I60A00(): return "".join( [ '\x01\r\nI60A00\r\n', now(), '\r\n\r\n' 'TANK FULL VOLUME', '\r\n\r\n', 'TANK PRODUCT LABEL TANK PROFILE GALLONS\r\r\n', ' 1 REGULAR 4 PTS 11682\r\r\n', ' 2 PLUS 4 PTS 7950\r\r\n', ' 3 SUPREME 4 PTS 9816\r\r\n', ' 4 DIESEL 4 PTS 9816\r\r\n', '\r\n', '\x03' ] ) def I60B00(): return "".join( [ ] ) def I60C00(): return "".join( [ '\x01\r\nI60B00\r\n', now(), '\r\n\r\n', 'STICK HEIGHT OFFSET ENABLE STATUS\r\n', 'DISABLED\r\n', '\r\n', '\x03' ] ) def I61000(): return "".join( [ '\x01\r\nI61000\r\n', now(), '\r\n\r\n', 'TANK DELIVERY DELAY', '\r\n\r\n', 'TANK PRODUCT LABEL \r\n', ' 1 REGULAR 3\r\n', ' 2 PLUS 3\r\n', ' 3 SUPREME 3\r\n', ' 4 DIESEL 3', '\r\n', '\x03' ] ) def I61100(): return "".join( [ '\x01\r\nI61100\r\n', now(), '\r\n\r\n', 'LEAK TEST METHOD', '\r\n', '- - - - - - - - - - - -\r\n', 'TEST ON DATE : ALL TANK\r\n', 'FEB 4, 2005\r\n', 'START TIME : DISABLED\r\n', 'TEST RATE :0.20 GAL/HR\r\n', 'DURATION : 2 HOURS\r\n\r\n', 'TST EARLY STOP:DISABLED\r\n', '\r\n', '\x03' ] ) def I61200(): return "".join( [ '\x01\r\nI61200\r\n', now(), '\r\n\r\n', 'TANK MANIFOLDED PARTNERS', '\r\n\r\n', 'TANK PRODUCT LABEL SIPHON MANIFOLDED TANKS LINE MANIFOLDED TANKS \r\n', ' 1 REGULAR NONE NONE \r\n', ' 2 PLUS NONE NONE \r\n', ' 3 SUPREME NONE NONE \r\n', ' 4 DIESEL NONE NONE ', '\r\n', '\x03' ] ) def I61300(): return "".join( [ '\x01\r\nI61300\r\n', now(), '\r\n', 'CSLD PROBABLITY OF DETECTION\r\n\r\n', '\r\n', '\x03' ] ) def I61400(): return "".join( [ '\x01\r\nI61400\r\n', now(), '\r\n', 'CSLD CLIMATE FACTOR\r\n\r\n', '\r\n', '\x03' ] ) def I61500(): return "".join( [ '\x01\r\nI61500\r\n', now(), '\r\n\r\n', 'TANK PRODUCT LABEL METER DATA \r\n', ' 1 REGULAR YES\r\n', ' 2 PLUS YES\r\n', ' 3 SUPREME YES\r\n', ' 4 DIESEL YES\r\n', '\r\n', '\x03' ] ) def I61600(): return "".join( [ '\x01\r\nI61600\r\n', now(), '\r\n\r\n', 'TANK PRODUCT LABEL CAL UPDATE\r\n', ' 1 REGULAR NEVER\r\n', ' 2 PLUS NEVER\r\n', ' 3 SUPREME NEVER\r\n', ' 4 DIESEL NEVER\r\n', '\r\n', '\x03' ] ) def I61700(): return "".join( [ '\x01\r\nI61700\r\n', now(), '\r\n', 'CSLD CUSTOM PROBABLITY OF DETECTION\r\n\r\n', '\r\n', '\x03' ] ) def I61800(): return "".join( [ '\x01\r\nI61800\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def I61900(): return "".join( [ '\x01\r\nI61900\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def I61A00(): return "".join( [ '\x01\r\nI61A00\r\n', now(), '\r\n\r\n', 'IN-TANK LEAK TEST EARLY STOP', '\r\n\r\n', 'TANK PRODUCT LABEL TST EARLY STOP:\r\n', ' 1 REGULAR DISABLED\r\n', ' 2 PLUS DISABLED\r\n', ' 3 SUPREME DISABLED\r\n', ' 4 DIESEL DISABLED', '\r\n', '\x03' ] ) def I61B00(): return "".join( [ '\x01\r\nI61B00\r\n', now(), '\r\n\r\n', 'IN-TANK LEAK GROSS TEST AUTO-CONFIRM\r\n\r\n', '\r\n', '\x03' ] ) def I61C00(): return "".join( [ '\x01\r\nI61C00\r\n', now(), '\r\n\r\n', 'CSLD REPORT ONLY\r\n\r\n', '\r\n', '\x03' ] ) def I61D00(): return "".join( [ '\x01\r\nI61D00\r\n', now(), '\r\n\r\n', 'TANK MANIFOLDED PARTNERS', '\r\n\r\n', 'TANK PRODUCT LABEL SIPHON MANIFOLDED TANKS LINE MANIFOLDED TANKS \r\n', ' 1 REGULAR NONE NONE \r\n', ' 2 PLUS NONE NONE \r\n', ' 3 SUPREME NONE NONE \r\n', ' 4 DIESEL NONE NONE ', '\r\n', '\x03' ] ) def I62100(): return "".join( [ '\x01\r\nI62100\r\n', now(), '\r\n\r\n', 'TANK LOW PRODUCT LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 600\r\n', ' 2 PLUS 450\r\n', ' 3 SUPREME 600\r\n', ' 4 DIESEL 600', '\r\n', '\x03' ] ) def I62200(): return "".join( [ '\x01\r\nI62200\r\n', now(), '\r\n\r\n', 'TANK HIGH PRODUCT LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 11097\r\n', ' 2 PLUS 7552\r\n', ' 3 SUPREME 9325\r\n', ' 4 DIESEL 9325', '\r\n', '\x03' ] ) def I62300(): return "".join( [ '\x01\r\nI62300\r\n', now(), '\r\n\r\n', 'TANK OVERFILL LEVEL LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR {0}\r\n'.format( generate_randomize_int(10513, 1000, -2000) ), ' 2 PLUS {0}\r\n'.format( generate_randomize_int(10513, 1000, -2000) ), ' 3 SUPREME {0}\r\n'.format( generate_randomize_int(10513, 1000, -2000) ), ' 4 DIESEL {0}'.format( generate_randomize_int(10513, 1000, -2000) ), '\r\n', '\x03' ] ) def I62400(): return "".join( [ '\x01\r\nI62400\r\n', now(), '\r\n\r\n', 'TANK HIGH WATER LEVEL LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL INCHES\r\n', ' 1 REGULAR 2.0\r\n', ' 2 PLUS 2.0\r\n', ' 3 SUPREME 2.0\r\n', ' 4 DIESEL 2.0', '\r\n', '\x03' ] ) def I62500(): return "".join( [ '\x01\r\nI62500\r\n', now(), '\r\n\r\n', 'TANK SUDDEN LOSS LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 99\r\n', ' 2 PLUS 99\r\n', ' 3 SUPREME 99\r\n', ' 4 DIESEL 99', '\r\n', '\x03' ] ) def I62600(): return "".join( [ '\x01\r\nI62600\r\n', now(), '\r\n\r\n', 'TANK LEAK ALARM LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 15\r\n', ' 2 PLUS 15\r\n', ' 3 SUPREME 15\r\n', ' 4 DIESEL 15', '\r\n', '\x03' ] ) def I62700(): return "".join( [ '\x01\r\nI62700\r\n', now(), '\r\n\r\n', 'TANK HIGH WATER WARNING LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL INCHES\r\n', ' 1 REGULAR 1.5\r\n', ' 2 PLUS 1.5\r\n' ' 3 SUPREME 1.5\r\n', ' 4 DIESEL 1.5', '\r\n', '\x03' ] ) def I62800(): return "".join( [ '\x01\r\nI62800\r\n', 'AUG 7, 2018 6:08 AM', '\r\n\r\n', 'TANK MAXIMUM VOLUME LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR {0}\r\n'.format( generate_randomize_int(11448, 1000, -2000) ), ' 2 PLUS {0}\r\n'.format( generate_randomize_int(7791, 1000, -2000) ), ' 3 SUPREME {0}\r\n'.format( generate_randomize_int(9619, 1000, -2000) ), ' 4 DIESEL {0}'.format( generate_randomize_int(9619, 1000, -2000) ), '\r\n', '\x03' ] ) def I62900(): return "".join( [ '\x01\r\nI62900\r\n', now(), '\r\n\r\n', 'TANK DELIVERY REQUIRED LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 1141\r\n', ' 2 PLUS 803\r\n', ' 3 SUPREME 981\r\n', ' 4 DIESEL 988', '\r\n', '\x03' ] ) def I62A00(): return "".join( [ '\x01\r\nI62A00\r\n', now(), '\r\n\r\n', 'ANNUAL LEAK TEST MIN VOLUME', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 0\r\n', ' 2 PLUS 0\r\n', ' 3 SUPREME 0\r\n', ' 4 DIESEL 0', '\r\n', '\x03' ] ) def I62B00(): return "".join( [ '\x01\r\nI62B00\r\n', now(), '\r\n\r\n', 'TANK LAST ANNUAL TEST', '\r\n\r\n', 'TANK PRODUCT LABEL DATE \r\n', ' 1 REGULAR ??? 0, 0\r\n', ' 2 PLUS ??? 0, 0\r\n', ' 3 SUPREME ??? 0, 0\r\n', ' 4 DIESEL ??? 0, 0\r\n', '\r\n', '\x03' ] ) def I62C00(): return "".join( [ '\x01\r\nI62C00\r\n', now(), '\r\n\r\n', 'TANK PERIODIC TEST TYPE', '\r\n\r\n', 'TANK PRODUCT LABEL PERIODIC TEST TYPE\r\n', ' 1 REGULAR STANDARD\r\n', ' 2 PLUS STANDARD\r\n', ' 3 SUPREME STANDARD\r\n', ' 4 DIESEL STANDARD\r\n', '\r\n', '\x03' ] ) def I62D00(): return "".join( [ '\x01\r\nI62D00\r\n', now(), '\r\n\r\n', 'TANK LEAK TEST FAIL ALARMS', '\r\n\r\n', 'TANK PRODUCT LABEL \r\n', ' 1 REGULAR GROSS TEST FAIL ALARM ENABLED\r\n', ' PERIODIC TEST FAIL ALARM DISABLED\r\n', ' ANNUAL TEST FAIL ALARM DISABLED\r\n\r\n', ' 2 PLUS GROSS TEST FAIL ALARM ENABLED\r\n', ' PERIODIC TEST FAIL ALARM DISABLED\r\n', ' ANNUAL TEST FAIL ALARM DISABLED\r\n\r\n', ' 3 SUPREME GROSS TEST FAIL ALARM ENABLED\r\n', ' PERIODIC TEST FAIL ALARM DISABLED\r\n', ' ANNUAL TEST FAIL ALARM DISABLED\r\n\r\n', ' 4 DIESEL GROSS TEST FAIL ALARM ENABLED\r\n', ' PERIODIC TEST FAIL ALARM DISABLED\r\n', ' ANNUAL TEST FAIL ALARM DISABLED\r\n\r\n', '\r\n', '\x03' ] ) def I62E00(): return "".join( [ '\x01\r\nI62E00\r\n', now(), '\r\n\r\n', 'CAP0 PROBE CONDUCTIVE BOOT FLAG', '\r\n\r\n', 'TANK PRODUCT LABEL CAP0 CONDUCTIVE BOOT:\r\n', '\r\n', '\x03' ] ) def I62F00(): return "".join( [ '\x01\r\nI62F00\r\n', now(), '\r\n\r\n', 'MAG PROBE FLOAT SIZE', '\r\n\r\n', 'TANK PRODUCT LABEL FLOAT SIZE:\r\n', ' 1 REGULAR 4.0 INCHES\r\n', ' 2 PLUS 4.0 INCHES\r\n', ' 3 SUPREME 4.0 INCHES\r\n', ' 4 DIESEL 4.0 INCHES\r\n', '\r\n', '\x03' ] ) def I63100(): return "".join( [ '\x01\r\nI63100\r\n', now(), '\r\n\r\n', 'TANK LEAK TEST AVERAGING', '\r\n\r\n', 'TANK PRODUCT LABEL ANNUAL PERIODIC\r\n', ' 1 REGULAR OFF OFF\r\n', ' 2 PLUS OFF OFF\r\n', ' 3 SUPREME OFF OFF\r\n', ' 4 DIESEL OFF OFF\r\n', '\r\n', '\x03' ] ) def I63200(): return "".join( [ '\x01\r\nI63200\r\n', now(), '\r\n\r\n', 'TANK TEST SIPHON BREAK', '\r\n\r\n', 'TANK PRODUCT LABEL SIPHON BREAK\r\n', ' 1 REGULAR OFF\r\n', ' 2 PLUS OFF\r\n', ' 3 SUPREME OFF\r\n', ' 4 DIESEL OFF\r\n', '\r\n', '\x03' ] ) def I63300(): return "".join( [ '\x01\r\nI63300\r\n', now(), '\r\n\r\n', 'LEAK TEST REPORT FORMAT: NORMAL\r\n', '\r\n', '\x03' ] ) def I63400(): return "".join( [ '\x01\r\nI63400\r\n', now(), '\r\n\r\n', 'RECONCILIATION WARNING LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 0\r\n', ' 2 PLUS 0\r\n', ' 3 SUPREME 0\r\n', ' 4 DIESEL 0', '\r\n', '\x03' ] ) def I63500(): return "".join( [ '\x01\r\nI63500\r\n', now(), '\r\n\r\n', 'RECONCILIATION ALARM LIMIT', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 1\r\n', ' 2 PLUS 1\r\n', ' 3 SUPREME 1\r\n', ' 4 DIESEL 1', '\r\n', '\x03' ] ) def I63600(): return "".join( [ '\x01\r\nI63600\r\n', now(), '\r\n\r\n', 'PERIODIC LEAK TEST MIN VOLUME', '\r\n\r\n', 'TANK PRODUCT LABEL GALLONS\r\n', ' 1 REGULAR 0\r\n', ' 2 PLUS 0\r\n', ' 3 SUPREME 0\r\n', ' 4 DIESEL 0', '\r\n', '\x03' ] ) def I77100(): return "".join( [ '\x01\r\nI77100\r\n', now(), '\r\n\r\n', '\x03' ] ) def I85100(): return "".join( [ '\x01\r\nI85100\r\n', now(), '\r\n\r\n', 'RESTORE SETUP DATA: DISABLED\r\n', '\r\n', '\x03' ] ) def I85200(): return "".join( [ '\x01\r\nI85200\r\n', 'AUG 7, 2018 6:05 AM', '\r\n\r\n', 'SAVE SETUP DATA: DISABLED\r\n', '\r\n', '\x03' ] ) def I85300(): return "".join( [ '\x01\r\nI85300\r\n', 'AUG 7, 2018 6:02 AM', '\r\n\r\n', 'CLEAR SETUP DATA: DISABLED\r\n', '\r\n', '\x03' ] ) def I88100(): return "".join( [ '\x01\r\nI88100\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def I88200(): return "".join( [ '\x01\r\nI88200\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def I90100(): return "".join( [ '\x01\r\nI90100\r\n', now(), '\r\n\r\n', ' I/O RAM PROM\r\n', 'SYSTEM BOARD PASS PASS PASS', '\r\n', '\x03' ] ) def I90200(): return "".join( [ '\x01\r\nI90200\r\n', now(), '\r\n', 'SOFTWARE REVISION LEVEL\r\n', 'VERSION 324.02\r\n', 'SOFTWARE# 346324-100-C \r\n', 'CREATED - 05.02.04.13.57\r\n\r\n', 'S-MODULE# 330160-160-A\r\n', 'SYSTEM FEATURES:\r\n', ' PERIODIC IN-TANK TESTS\r\n', ' ANNUAL IN-TANK TESTS\r\n', ' BIR\r\n', 'PLLD \r\n', ' 0.10 AUTO\r\n', ' 0.20 REPETITIV\r\n', 'WPLLD \r\n', ' 0.10 AUTO\r\n', ' 0.20 REPETITIV\r\n', '\r\n', '\x03' ] ) def I90300(): return "".join( [ '\x01\r\nI90300\r\n', now(), '\r\n', ' PC DIAGNOSTIC DATA \r\n', ' PERIPHERAL CONTROLLER \r\n', '- - - - - - - - - - - -\r\n\r\n', 'PC SWARE# 330269-002-B \r\n', 'CREATED - 94.12.16.13.26\r\n', 'PC ROM CHECKSUM = PASSED\r\n\r\n', 'PC RESET COUNTS = 29\r\n', 'PC COMM ERRORS = 12\r\n', 'MC CKSUM ERRS = 1\r\n', 'MC->PC COMMS = 456404704\r\n', 'MC<-PC COMMS = 456410994', '\r\n', '\x03' ] ) def I90400(): return "".join( [ '\x01\r\nI90400\r\n', now(), '\r\n', ' WPLLD DIAGNOSTIC DATA \r\n', '- - - - - - - - - - - -\r\n', '#: \r\n\r\n', 'PC COMM ERRORS = 0\r\n\r\n\r\n\r\n', '\r\n', '\x03' ] ) def I90500(): return "".join( [ '\x01\r\nI90500\r\n', now(), '\r\n', 'SOFTWARE REVISION LEVEL\r\n', 'VERSION 324.02\r\n', 'SOFTWARE# 346324-100-C \r\n', 'CREATED - 05.02.04.13.57\r\n\r\n', 'S-MODULE# 330160-160-A\r\n', 'SYSTEM FEATURES:\r\n', ' PERIODIC IN-TANK TESTS\r\n', ' ANNUAL IN-TANK TESTS\r\n', ' BIR\r\n', 'PLLD \r\n', ' 0.10 AUTO\r\n', ' 0.20 REPETITIV\r\n', 'WPLLD \r\n', ' 0.10 AUTO\r\n', ' 0.20 REPETITIV\r\n', '\r\n', '\x03' ] ) def IA0100(): return "".join( [ '\x01\r\nIA0100\r\n', now(), '\r\n', ' TYPE CODE LENGTH SERIAL NO. D/CODE\r\n', 'TANK 1 REGULAR MAG C000 96.00 817402 2354\r\n', 'TANK 2 PLUS MAG C000 96.00 817403 2354\r\n', 'TANK 3 SUPREME MAG C000 96.00 817404 2354\r\n', 'TANK 4 DIESEL MAG C000 96.00 817401 2354\r\n', '\r\n', '\x03' ] ) def IA0200(): return "".join( [ '\x01\r\nIA0200\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG GRADIENT = 350.9800\r\n', 'TANK 2 PLUS MAG GRADIENT = 350.7600\r\n', 'TANK 3 SUPREME MAG GRADIENT = 350.4000\r\n', 'TANK 4 DIESEL MAG GRADIENT = 350.9000\r\n', '\r\n', '\x03' ] ) def IA0300(): return "".join( [ '\x01\r\nIA0300\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG GRADIENT = 350.9800\r\n', 'TANK 2 PLUS MAG GRADIENT = 350.7600\r\n', 'TANK 3 SUPREME MAG GRADIENT = 350.4000\r\n', 'TANK 4 DIESEL MAG GRADIENT = 350.9000\r\n', '\r\n', '\x03' ] ) def IA0400(): return "".join( [ '\x01\r\nIA0400\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG \r\n', 'TANK 2 PLUS MAG \r\n', 'TANK 3 SUPREME MAG \r\n', 'TANK 4 DIESEL MAG \r\n', '\r\n', '\x03' ] ) def IA0500(): return "".join( [ '\x01\r\nIA0500\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG \r\n', 'TANK 2 PLUS MAG \r\n', 'TANK 3 SUPREME MAG \r\n', 'TANK 4 DIESEL MAG \r\n', '\r\n', '\x03', ] ) def IA0600(): return "".join( [ '\x01\r\nIA0600\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG \r\n', 'TANK 2 PLUS MAG \r\n', 'TANK 3 SUPREME MAG \r\n', 'TANK 4 DIESEL MAG \r\n', '\r\n', '\x03' ] ) def IA0700(): return "".join( [ '\x01\r\nIA0700\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG \r\n', 'ORIG REF DISTANCE JAN 5, 2017 103.53\r\n', 'CURR REF DISTANCE AUG 6, 2018 103.57\r\n', 'TANK 2 PLUS MAG \r\n', 'ORIG REF DISTANCE JAN 5, 2017 103.64\r\n', 'CURR REF DISTANCE AUG 6, 2018 103.68\r\n', 'TANK 3 SUPREME MAG \r\n', 'ORIG REF DISTANCE JAN 5, 2017 103.71\r\n', 'CURR REF DISTANCE AUG 6, 2018 103.74\r\n', 'TANK 4 DIESEL MAG \r\n', 'ORIG REF DISTANCE JAN 5, 2017 103.68\r\n', 'CURR REF DISTANCE AUG 6, 2018 103.73\r\n', '\r\n', '\x03' ] ) def IA1000(): return "".join( [ '\x01\r\nIA1000\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG NUMBER OF SAMPLES = 21472\r\n', ' 1311.000 22713.000 22712.000 22712.000 22712.000 22712.000 22713.000 22712.000\r\n', '22712.000 22711.000 22712.000 44113.000 12960.000 15817.000 17370.000 17497.000\r\n', '17402.000 17389.000 44118.000 \r\n' 'TANK 2 PLUS MAG NUMBER OF SAMPLES = 35905\r\n', ' 1419.000 8868.000 8868.000 8868.000 8869.000 8869.000 8864.000 8864.000\r\n', ' 8865.000 8865.000 8866.000 44250.000 13937.000 14943.000 15675.000 16002.000\r\n', '16468.000 17777.000 44254.000 \r\n', 'TANK 3 SUPREME MAG NUMBER OF SAMPLES = 33548\r\n', ' 1375.000 10990.000 10989.000 10990.000 10990.000 10990.000 10990.000 10990.000\r\n', '10990.000 10989.000 10990.000 44554.000 13429.000 14972.000 15683.000 16084.000\r\n', '17042.000 17368.000 44554.000 \r\n', 'TANK 4 DIESEL MAG NUMBER OF SAMPLES = 14929\r\n', ' 1347.000 8691.000 8692.000 8692.000 8692.000 8692.000 8692.000 8692.000\r\n', ' 8692.000 8692.000 8692.000 43826.000 12441.000 14140.000 14504.000 14709.000\r\n', '15049.000 16946.000 43831.000 \r\n', '\r\n', '\x03' ] ) def IA1100(): return "".join( [ '\x01\r\nIA1100\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG NUMBER OF SAMPLES = 5\r\n', ' 1310.000 22715.199 22715.199 22714.801 22714.801 22714.801 22715.199 22715.199\r\n', '22715.000 22715.199 22715.400 44114.801 12961.200 15817.800 17372.000 17498.600\r\n', '17403.000 17390.400 44118.199 \r\n', 'TANK 2 PLUS MAG NUMBER OF SAMPLES = 5\r\n', ' 1419.000 8868.200 8868.200 8868.400 8868.200 8868.200 8872.200 8872.400\r\n', ' 8872.400 8872.000 8872.000 44249.398 13937.000 14943.600 15676.000 16003.000\r\n', '16466.000 17774.801 44252.801 \r\n', 'TANK 3 SUPREME MAG NUMBER OF SAMPLES = 5\r\n', ' 1375.000 10989.800 10989.600 10989.800 10989.400 10989.000 10990.000 10989.800\r\n', '10990.000 10989.800 10989.800 44552.199 13431.000 14974.600 15684.000 16082.400\r\n', '17044.600 17366.400 44555.602 \r\n', 'TANK 4 DIESEL MAG NUMBER OF SAMPLES = 5\r\n', ' 1346.000 8692.000 8692.000 8692.200 8692.000 8692.000 8692.000 8692.000\r\n', ' 8692.000 8692.000 8692.200 43827.398 12443.000 14139.000 14506.600 14710.199\r\n', '15049.400 16948.000 43830.398 \r\n', '\r\n', '\x03' ] ) def IA1200(): return "".join( [ '\x01\r\nIA1200\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG NUMBER OF SAMPLES = 20\r\n', ' 1310.050 22689.100 22689.100 22689.301 22689.500 22689.699 22689.400 22689.449\r\n', '22689.350 22689.250 22689.350 44115.250 12965.850 15803.250 17387.949 17499.900\r\n', '17402.150 17390.500 44119.102 \r\n', 'TANK 2 PLUS MAG NUMBER OF SAMPLES = 20', '\r\n', ' 1419.000 8868.000 8868.000 8868.000 8868.150 8868.200 8868.150 8868.050\r\n', ' 8868.000 8868.050 8868.450 44249.500 13939.350 14941.100 15671.350 16000.199\r\n', '16459.199 17764.699 44252.500 \r\n', 'TANK 3 SUPREME MAG NUMBER OF SAMPLES = 20\r\n', ' 1375.000 10966.000 10966.150 10966.300 10966.000 10966.300 10968.300 10968.250\r\n', '10968.300 10968.100 10968.450 44552.949 13434.800 14971.900 15678.500 16077.300\r\n', '17038.801 17370.650 44556.250 \r\n', 'TANK 4 DIESEL MAG NUMBER OF SAMPLES = 20\r\n', ' 1346.850 8569.400 8569.050 8569.550 8569.450 8569.350 8607.650 8607.500\r\n', ' 8607.450 8607.850 8607.700 43828.000 12394.300 14136.650 14506.800 14711.050\r\n', '15048.199 16941.000 43830.801 \r\n', '\r\n', '\x03' ] ) def IA1300(): return "".join( [ '\x01\r\nIA1300\r\n', now(), 'TANK 1 REGULAR MAG NUMBER OF SAMPLES = 22000\r\n', ' 1309.544 8495.360 8495.391 8495.426 8495.444 8495.459 8141.306 8141.313\r\n', ' 8141.318 8141.329 8141.326 44130.418 12982.622 14662.228 15316.570 15745.305\r\n', '16043.447 16734.730 44134.391 \r\n', 'TANK 2 PLUS MAG NUMBER OF SAMPLES = 36406\r\n', ' 1419.385 8963.937 8963.943 8963.941 8963.942 8963.945 9702.666 9702.666\r\n', ' 9702.664 9702.662 9702.665 44249.879 14269.152 14997.830 15690.572 16061.698\r\n', '16677.355 17736.182 44253.391 \r\n', 'TANK 3 SUPREME MAG NUMBER OF SAMPLES = 34028\r\n', ' 1374.816 7891.065 7891.068 7891.069 7891.076 7891.079 7752.301 7752.302\r\n', ' 7752.299 7752.303 7752.297 44553.336 13913.104 14784.168 15222.324 15357.686\r\n', '15891.219 16851.512 44556.688 \r\n', 'TANK 4 DIESEL MAG NUMBER OF SAMPLES = 15394\r\n', ' 1346.628 8690.236 8690.261 8690.289 8690.277 8690.271 8710.821 8710.803\r\n', ' 8710.777 8710.807 8710.799 43987.930 12486.401 14191.391 14560.227 14764.843\r\n', '15104.500 17004.602 43990.926 \r\n', '\r\n', '\x03' ] ) def IA1400(): return "".join( [ '\x01\r\nIA1400\r\n', now(), '\r\n\r\n', 'MAG PROBE OPTIONS TABLE', '\r\n\r\n', 'TNK LOW\r\n', 'NUM TEMP\r\n\r\n', ' 1 NO \r\n', ' 2 NO \r\n', ' 3 NO \r\n', ' 4 NO ', '\r\n', '\x03' ] ) def IA1500(): return "".join( [ '\x01\r\nIA1500\r\n', now(), '\r\n', 'IN-TANK DIAGNOSTIC \r\n', '- - - - - - - - - - - -\r\n', 'PROBE DIAGNOSTICS\r\n', 'T 1: PROBE TYPE MAG1\r\n', 'SERIAL NUMBER 817402\r\n', 'LENGTH 96.00\r\n', 'DATE CODE = 9044\r\n', 'ID CHAN = 0xC000\r\n', 'GRADIENT = 350.9800\r\n', 'PROBE INIT:\r\n', ' FEB 21,2017 11:26AM\r\n\r\n', 'NUM SAMPLES = 20\r\n\r\n', 'C00 1310.0 C01 22687.8\r\n', 'C02 22687.7 C03 22687.8\r\n', 'C04 22687.8 C05 22687.9\r\n', 'C06 22697.3 C07 22697.2\r\n', 'C08 22697.3 C09 22697.3\r\n', 'C10 22697.4 C11 44115.0\r\n', 'C12 12963.5 C13 15812.9\r\n', 'C14 17375.7 C15 17497.8\r\n', 'C16 17402.3 C17 17390.3\r\n', 'C18 44118.0\r\n\r\n', 'SAMPLES READ =39406095\r\n', 'SAMPLES USED =39229006\r\n', 'LAST ERROR =39400891\r\n', 'LAST SAMPLE ERROR TIME:\r\n', ' AUG 7,2018 4:09AM\r\n\r\n', 'TEMP SENSOR DATA\r\n', 'T6: 84.886 F\r\n', 'T5: 78.259 F\r\n', 'T4: 74.755 F\r\n', 'T3: 74.484 F\r\n', 'T2: 74.696 F\r\n', 'T1: 74.723 F\r\n\r\n' 'ORIG REF DISTANCE \r\n', 'JAN 5, 2017 103.53\r\n', 'CURR REF DISTANCE \r\n', 'AUG 6, 2018 103.57\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n', 'IN-TANK DIAGNOSTIC \r\n', '- - - - - - - - - - - -\r\n', 'PROBE DIAGNOSTICS\r\n', 'T 2: PROBE TYPE MAG1\r\n', 'SERIAL NUMBER 817403\r\n', 'LENGTH 96.00\r\n', 'DATE CODE = 9044\r\n', 'ID CHAN = 0xC000\r\n', 'GRADIENT = 350.7600\r\n', 'PROBE INIT:\r\n', ' APR 20,2017 2:33PM\r\n\r\n', 'NUM SAMPLES = 20\r\n\r\n', 'C00 1419.0 C01 8868.3\r\n', 'C02 8868.0 C03 8868.0\r\n', 'C04 8868.2 C05 8868.0\r\n', 'C06 8868.8 C07 8869.3\r\n', 'C08 8868.7 C09 8868.8\r\n', 'C10 8868.7 C11 44249.1\r\n', 'C12 13937.4 C13 14943.4\r\n', 'C14 15675.3 C15 16003.3\r\n', 'C16 16464.2 C17 17767.3\r\n', 'C18 44252.4\r\n\r\n', 'SAMPLES READ =38281632\r\n', 'SAMPLES USED =38122605\r\n', 'LAST ERROR =38278301\r\n', 'LAST SAMPLE ERROR TIME:\r\n', ' AUG 7,2018 4:45AM\r\n\r\n', 'TEMP SENSOR DATA\r\n', 'T6: 82.681 F\r\n', 'T5: 80.349 F\r\n', 'T4: 78.679 F\r\n', 'T3: 77.937 F\r\n', 'T2: 76.901 F\r\n', 'T1: 74.008 F\r\n\r\n', 'ORIG REF DISTANCE \r\n', 'JAN 5, 2017 103.64\r\n', 'CURR REF DISTANCE \r\n', 'AUG 6, 2018 103.68\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n', 'IN-TANK DIAGNOSTIC \r\n', '- - - - - - - - - - - -\r\n', 'PROBE DIAGNOSTICS\r\n', 'T 3: PROBE TYPE MAG1\r\n', 'SERIAL NUMBER 817404\r\n', 'LENGTH 96.00\r\n', 'DATE CODE = 9044\r\n', 'ID CHAN = 0xC000\r\n', 'GRADIENT = 350.4000\r\n', 'PROBE INIT:\r\n', ' APR 20,2017 2:31PM\r\n\r\n', 'NUM SAMPLES = 20\r\n\r\n', 'C00 1375.0 C01 10972.0\r\n', 'C02 10972.0 C03 10972.0\r\n', 'C04 10971.8 C05 10972.0\r\n', 'C06 10987.1 C07 10987.3\r\n', 'C08 10986.7 C09 10987.3\r\n', 'C10 10987.1 C11 44552.3\r\n', 'C12 13432.9 C13 14973.3\r\n', 'C14 15682.0 C15 16082.4\r\n', 'C16 17043.2 C17 17367.3\r\n', 'C18 44555.9\r\n\r\n', 'SAMPLES READ =37315717\r\n', 'SAMPLES USED =37080015\r\n', 'LAST ERROR =37301681\r\n', 'LAST SAMPLE ERROR TIME:\r\n', ' AUG 7,2018 12:55AM\r\n\r\n', 'TEMP SENSOR DATA\r\n', 'T6: 84.082 F\r\n', 'T5: 80.515 F\r\n', 'T4: 78.907 F\r\n', 'T3: 78.006 F\r\n', 'T2: 75.867 F\r\n', 'T1: 75.152 F\r\n\r\n', 'ORIG REF DISTANCE \r\n', 'JAN 5, 2017 103.71\r\n', 'CURR REF DISTANCE \r\n', 'AUG 6, 2018 103.74', '\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n', 'IN-TANK DIAGNOSTIC \r\n', '- - - - - - - - - - - -\r\n', 'PROBE DIAGNOSTICS\r\n', 'T 4: PROBE TYPE MAG1\r\n', 'SERIAL NUMBER 817401\r\n', 'LENGTH 96.00\r\n', 'DATE CODE = 9044\r\n', 'ID CHAN = 0xC000\r\n', 'GRADIENT = 350.9000\r\n', 'PROBE INIT:\r\n', ' AUG 11,2017 9:00AM\r\n\r\n', 'NUM SAMPLES = 20\r\n\r\n', 'C00 1347.0 C01 8641.9\r\n', 'C02 8642.3 C03 8642.3\r\n', 'C04 8642.0 C05 8642.2\r\n', 'C06 8673.7 C07 8673.5\r\n', 'C08 8673.7 C09 8673.4\r\n', 'C10 8673.5 C11 43828.0\r\n', 'C12 12438.9 C13 14138.4\r\n', 'C14 14505.9 C15 14710.0\r\n', 'C16 15050.5 C17 16948.8\r\n', 'C18 43831.1\r\n\r\n', 'SAMPLES READ =35758710\r\n', 'SAMPLES USED =35301496\r\n', 'LAST ERROR =35756651\r\n', 'LAST SAMPLE ERROR TIME:\r\n', ' AUG 7,2018 5:09AM\r\n\r\n', 'TEMP SENSOR DATA\r\n', 'T6: 85.950 F\r\n', 'T5: 81.895 F\r\n', 'T4: 81.036 F\r\n', 'T3: 80.561 F\r\n', 'T2: 79.773 F\r\n', 'T1: 75.457 F\r\n\r\n', 'ORIG REF DISTANCE \r\n', 'JAN 5, 2017 103.68\r\n', 'CURR REF DISTANCE \r\n', 'AUG 6, 2018 103.73', '\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n', '\r\n', '\x03' ] ) def IA2000(): return "".join( [ '\x01\r\nIA2000\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG PRESENT LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', 'TANK 2 PLUS MAG PRESENT LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', 'TANK 3 SUPREME MAG PRESENT LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', 'TANK 4 DIESEL MAG PRESENT LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', '\r\n', '\x03' ] ) def IA2100(): return "".join( [ '\x01\r\nIA2100\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG STORED LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', 'TANK 2 PLUS MAG STORED LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', 'TANK 3 SUPREME MAG STORED LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', 'TANK 4 DIESEL MAG STORED LEAK TEST ANALYSIS REPORT\r\n', ' 0.10 GAL/HR FLAGS:\r\n', ' 0.20 GAL/HR FLAGS:\r\n\r\n', '\r\n', '\x03' ] ) def IA2200(): return "".join( [ '\x01\r\nIA2200\r\n', now(), '\r\n', 'TANK 1 REGULAR MAG GROSS LEAK TEST ANALYSIS REPORT\r\n\r\n', ' GROSS LEAK TEST FLAGS:\r\n\r\n\r\n\r\n', 'TANK 2 PLUS MAG GROSS LEAK TEST ANALYSIS REPORT\r\n\r\n', ' GROSS LEAK TEST FLAGS:\r\n\r\n\r\n\r\n', 'TANK 3 SUPREME MAG GROSS LEAK TEST ANALYSIS REPORT\r\n\r\n', ' GROSS LEAK TEST FLAGS:\r\n\r\n\r\n\r\n', 'TANK 4 DIESEL MAG GROSS LEAK TEST ANALYSIS REPORT\r\n\r\n', ' GROSS LEAK TEST FLAGS:\r\n\r\n\r\n\r\n', '\r\n', '\x03' ] ) def IA5100(): return "".join( [ '\x01\r\nIA5100\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def IA5200(): return "".join( [ '\x01\r\nIA5200\r\n', now(), '\r\n\r\n\r\n', 'CSLD DIAGNOSTICS: RATE TEST\r\n\r\n', 'TK DATE LRATE INTVL ST AVLRTE VOL C1 C3 FDBK ACPT THPUT EVAP RJT\r\n', '\r\n', '\x03' ] ) def IA5300(): return "".join( [ '\x01\r\nIA5300\r\n', now(), '\r\n\r\n\r\n', 'CSLD DIAGNOSTICS: VOLUME TABLE\r\n', '\r\n', '\x03' ] ) def IA5400(): return "".join( [ '\x01\r\nIA5400\r\n', now(), '\r\n\r\n\r\n', 'CSLD DIAGNOSTICS: MOVING AVERAGE TABLE\r\n\r\n', 'T 1:REGULAR \r\n', ' TIME SMPLS TCVOL HEIGHT AVGTEMP TOPTEMP BDTEMP\r\n', '180807054001 24 8901.49 64.999 74.64 78.17 84.91 \r\n', '180807054031 27 8900.02 64.989 74.64 78.17 84.91 \r\n', '180807054101 22 8900.14 64.990 74.64 78.18 84.91 \r\n', '180807054131 23 8900.21 64.990 74.63 78.18 84.91 \r\n', '180807054201 26 8901.06 64.996 74.63 78.18 84.91 \r\n', '180807054231 22 8900.76 64.994 74.63 78.18 84.91 \r\n', '180807054301 22 8900.63 64.993 74.63 78.18 84.91 \r\n', '180807054331 20 8900.25 64.990 74.63 78.18 84.91 \r\n', '180807054401 26 8901.30 64.998 74.63 78.19 84.90 \r\n', '180807054431 26 8900.70 64.993 74.63 78.19 84.90 \r\n', '180807054501 24 8900.04 64.989 74.63 78.19 84.90 \r\n', '180807054531 26 8899.87 64.988 74.63 78.19 84.90 \r\n', '180807054601 24 8900.89 64.995 74.63 78.20 84.90 \r\n', '180807054631 25 8901.07 64.996 74.63 78.20 84.90 \r\n', '180807054701 24 8899.83 64.988 74.63 78.20 84.90 \r\n', '180807054731 24 8899.98 64.989 74.63 78.20 84.90 \r\n', '180807054801 23 8898.95 64.982 74.63 78.20 84.90 \r\n', '180807054831 24 8900.29 64.991 74.63 78.21 84.90 \r\n', '180807054901 23 8900.07 64.989 74.63 78.21 84.90 \r\n', '180807054931 28 8900.87 64.995 74.64 78.21 84.90 \r\n', '180807055001 25 8901.14 64.997 74.64 78.22 84.90 \r\n', '180807055031 23 8900.46 64.992 74.64 78.22 84.90 \r\n', '180807055101 24 8899.82 64.988 74.64 78.22 84.90 \r\n', '180807055131 24 8900.34 64.992 74.65 78.22 84.90 \r\n', '180807055201 24 8900.93 64.996 74.65 78.23 84.90 \r\n', '180807055231 23 8899.65 64.987 74.65 78.23 84.90 \r\n', '180807055301 20 8900.50 64.993 74.65 78.23 84.89 \r\n', '180807055331 22 8900.23 64.991 74.65 78.24 84.89 \r\n', '180807055401 23 8899.99 64.990 74.66 78.24 84.89 \r\n', '180807055431 22 8900.11 64.991 74.66 78.24 84.89 \r\n', '180807055501 24 8896.92 64.969 74.66 78.25 84.89 \r\n', '180807055531 19 8893.25 64.944 74.66 78.25 84.89 \r\n', '180807055601 24 8889.86 64.921 74.66 78.25 84.89 \r\n', '180807055631 21 8889.15 64.916 74.66 78.25 84.89 \r\n', '180807055701 23 8888.83 64.914 74.66 78.26 84.89 \r\n', '180807055731 23 8888.67 64.913 74.66 78.26 84.89 \r\n', '180807055801 20 8888.80 64.914 74.66 78.26 84.88 \r\n', '180807055831 24 8889.11 64.916 74.66 78.26 84.88 \r\n', '180807055901 25 8889.56 64.919 74.66 78.27 84.88 \r\n', '180807055931 24 8888.95 64.915 74.65 78.27 84.89 \r\n', '180807060010 17 8889.54 64.919 74.65 78.28 84.88 \r\n', '180807060040 23 8888.88 64.914 74.65 78.28 84.88 \r\n', '180807060110 24 8889.36 64.917 74.65 78.28 84.88 \r\n', '180807060140 15 8888.98 64.915 74.65 78.28 84.88 \r\n', '180807060210 17 8889.41 64.918 74.65 78.29 84.88 \r\n', '180807060240 13 8888.86 64.914 74.65 78.29 84.88 \r\n', 'MOVING AVERAGE: 0.00\r\n\r\n', 'DISPENSE STATE: ACTIVE * 411.329926\r\n\r\n', 'T 2:PLUS \r\n', ' TIME SMPLS TCVOL HEIGHT AVGTEMP TOPTEMP BDTEMP\r\n', '180807054001 23 1770.50 25.654 73.99 80.30 82.68 \r\n', '180807054031 25 1770.51 25.654 73.99 80.30 82.68 \r\n', '180807054101 22 1770.51 25.654 73.99 80.30 82.68 \r\n', '180807054131 21 1770.53 25.654 73.99 80.30 82.68 \r\n', '180807054201 24 1770.53 25.654 73.99 80.31 82.68 \r\n', '180807054231 22 1770.51 25.654 73.99 80.31 82.68 \r\n', '180807054301 22 1770.51 25.654 73.99 80.31 82.68 \r\n', '180807054331 20 1770.51 25.654 73.99 80.31 82.68 \r\n', '180807054401 23 1770.52 25.654 73.99 80.31 82.68 \r\n', '180807054431 27 1770.54 25.654 73.99 80.32 82.68 \r\n', '180807054501 23 1770.50 25.654 73.99 80.32 82.68 \r\n', '180807054531 24 1770.52 25.654 73.99 80.32 82.68 \r\n', '180807054601 24 1770.54 25.654 73.99 80.32 82.68 \r\n', '180807054631 25 1770.49 25.654 73.99 80.32 82.68 \r\n', '180807054701 24 1770.51 25.654 73.99 80.33 82.68 \r\n', '180807054731 25 1770.54 25.654 73.99 80.33 82.68 \r\n', '180807054801 22 1770.51 25.654 73.99 80.33 82.68 \r\n', '180807054831 23 1770.52 25.654 73.99 80.33 82.68 \r\n', '180807054901 24 1770.50 25.654 73.99 80.33 82.68 \r\n', '180807054931 27 1770.52 25.654 73.99 80.34 82.68 \r\n', '180807055001 24 1770.50 25.654 73.99 80.34 82.68 \r\n', '180807055031 23 1770.50 25.654 73.99 80.34 82.68 \r\n', '180807055101 23 1770.53 25.654 73.99 80.34 82.68 \r\n', '180807055131 22 1769.20 25.641 73.99 80.34 82.68 \r\n', '180807055201 23 1765.00 25.599 73.99 80.34 82.68 \r\n', '180807055231 23 1761.32 25.562 73.99 80.34 82.68 \r\n', '180807055301 20 1760.49 25.553 73.99 80.35 82.68 \r\n', '180807055331 22 1760.33 25.552 73.99 80.35 82.68 \r\n', '180807055401 21 1760.53 25.554 73.99 80.35 82.68 \r\n', '180807055431 21 1760.41 25.553 73.99 80.35 82.68 \r\n', '180807055501 22 1760.46 25.553 73.99 80.35 82.68 \r\n', '180807055531 21 1760.49 25.553 74.00 80.35 82.68 \r\n', '180807055601 22 1760.46 25.553 74.00 80.35 82.68 \r\n', '180807055631 20 1760.41 25.553 74.00 80.35 82.68 \r\n', '180807055701 22 1760.34 25.552 74.00 80.35 82.68 \r\n', '180807055731 21 1760.45 25.553 74.01 80.35 82.68 \r\n', '180807055801 20 1760.40 25.553 74.01 80.35 82.68 \r\n', '180807055831 22 1760.37 25.552 74.01 80.35 82.68 \r\n', '180807055901 22 1760.39 25.553 74.01 80.35 82.68 \r\n', '180807055931 22 1760.42 25.553 74.01 80.35 82.68 \r\n', '180807060010 17 1760.40 25.553 74.01 80.35 82.68 \r\n', '180807060040 23 1760.44 25.553 74.01 80.35 82.68 \r\n', '180807060110 23 1760.43 25.553 74.01 80.36 82.68 \r\n', '180807060140 14 1760.40 25.553 74.01 80.36 82.68 \r\n', '180807060210 17 1760.41 25.553 74.02 80.36 82.68 \r\n', '180807060240 13 1760.42 25.553 74.02 80.36 82.67 \r\n', 'MOVING AVERAGE: 0.00\r\n\r\n', 'DISPENSE STATE: ACTIVE * 0.046480\r\n\r\n', 'T 3:SUPREME \r\n', ' TIME SMPLS TCVOL HEIGHT AVGTEMP TOPTEMP BDTEMP\r\n', '180807054001 19 2960.48 31.632 75.54 80.47 84.09 \r\n', '180807054031 24 2960.51 31.632 75.54 80.47 84.08 \r\n', '180807054101 22 2960.53 31.633 75.54 80.47 84.08 \r\n', '180807054131 22 2960.54 31.633 75.54 80.47 84.08 \r\n', '180807054201 24 2960.48 31.632 75.54 80.47 84.08 \r\n', '180807054231 22 2960.55 31.633 75.54 80.47 84.08 \r\n', '180807054301 21 2960.50 31.632 75.54 80.48 84.08 \r\n', '180807054331 21 2960.46 31.632 75.54 80.48 84.08 \r\n', '180807054401 24 2960.51 31.632 75.54 80.48 84.08 \r\n', '180807054431 25 2960.49 31.632 75.54 80.48 84.08 \r\n', '180807054501 22 2960.39 31.632 75.55 80.48 84.08 \r\n', '180807054531 24 2960.42 31.632 75.55 80.48 84.08 \r\n', '180807054601 23 2960.56 31.633 75.55 80.49 84.08 \r\n', '180807054631 24 2960.49 31.632 75.55 80.49 84.08 \r\n', '180807054701 24 2960.44 31.632 75.55 80.49 84.08 \r\n', '180807054731 24 2960.44 31.632 75.55 80.49 84.09 \r\n', '180807054801 21 2960.55 31.633 75.55 80.49 84.09 \r\n', '180807054831 24 2960.59 31.633 75.55 80.49 84.09 \r\n', '180807054901 24 2960.43 31.632 75.55 80.50 84.09 \r\n', '180807054931 24 2960.48 31.632 75.55 80.50 84.09 \r\n', '180807055001 23 2960.47 31.632 75.55 80.50 84.09 \r\n', '180807055031 21 2960.50 31.632 75.55 80.50 84.09 \r\n', '180807055101 23 2960.48 31.632 75.55 80.50 84.09 \r\n', '180807055131 21 2960.44 31.632 75.55 80.51 84.09 \r\n', '180807055201 23 2960.49 31.632 75.55 80.51 84.09 \r\n', '180807055231 23 2960.52 31.633 75.55 80.51 84.09 \r\n', '180807055301 20 2960.56 31.633 75.55 80.51 84.09 \r\n', '180807055331 23 2960.53 31.633 75.55 80.51 84.09 \r\n', '180807055401 23 2960.54 31.633 75.55 80.51 84.09 \r\n', '180807055431 20 2960.52 31.633 75.55 80.51 84.09 \r\n', '180807055501 22 2960.49 31.632 75.55 80.51 84.09 \r\n', '180807055531 19 2960.50 31.632 75.55 80.51 84.09 \r\n', '180807055601 21 2960.46 31.632 75.55 80.51 84.08 \r\n', '180807055631 21 2959.22 31.623 75.55 80.51 84.08 \r\n', '180807055701 18 2956.04 31.598 75.55 80.51 84.08 \r\n', '180807055731 20 2953.59 31.580 75.55 80.52 84.08 \r\n', '180807055801 18 2951.81 31.566 75.55 80.52 84.08 \r\n', '180807055831 22 2951.83 31.566 75.55 80.52 84.08 \r\n', '180807055901 22 2951.78 31.566 75.55 80.52 84.08 \r\n', '180807055931 20 2951.86 31.567 75.55 80.52 84.08 \r\n', '180807060010 17 2951.76 31.566 75.55 80.52 84.08 \r\n', '180807060040 20 2951.79 31.566 75.55 80.52 84.08 \r\n', '180807060110 24 2951.74 31.566 75.55 80.52 84.08 \r\n', '180807060140 12 2951.85 31.567 75.55 80.52 84.08 \r\n', '180807060210 15 2951.85 31.567 75.55 80.52 84.08 \r\n', '180807060240 11 2951.85 31.567 75.55 80.52 84.08 \r\n', 'MOVING AVERAGE: 0.00\r\n\r\n', 'DISPENSE STATE: ACTIVE * 329.783142\r\n\r\n', 'T 4:DIESEL \r\n', ' TIME SMPLS TCVOL HEIGHT AVGTEMP TOPTEMP BDTEMP\r\n', '180807054001 21 2132.36 25.041 75.46 81.89 85.91 \r\n', '180807054031 23 2132.39 25.041 75.46 81.89 85.91 \r\n', '180807054101 21 2132.38 25.041 75.46 81.89 85.92 \r\n', '180807054131 21 2132.37 25.041 75.46 81.89 85.92 \r\n', '180807054201 23 2132.38 25.041 75.46 81.89 85.92 \r\n', '180807054231 19 2132.38 25.041 75.46 81.89 85.92 \r\n', '180807054301 22 2132.34 25.040 75.46 81.89 85.92 \r\n', '180807054331 20 2132.36 25.041 75.46 81.89 85.92 \r\n', '180807054401 23 2132.36 25.040 75.46 81.89 85.92 \r\n', '180807054431 21 2132.35 25.040 75.46 81.89 85.92 \r\n', '180807054501 21 2132.36 25.041 75.46 81.89 85.92 \r\n', '180807054531 23 2132.38 25.041 75.46 81.89 85.92 \r\n', '180807054601 21 2132.39 25.041 75.46 81.89 85.93 \r\n', '180807054631 24 2132.36 25.041 75.46 81.89 85.93 \r\n', '180807054701 20 2132.37 25.041 75.46 81.89 85.93 \r\n', '180807054731 23 2132.35 25.040 75.46 81.89 85.93 \r\n', '180807054801 20 2132.36 25.041 75.46 81.89 85.93 \r\n', '180807054831 26 2132.36 25.040 75.46 81.90 85.93 \r\n', '180807054901 21 2132.37 25.041 75.46 81.89 85.93 \r\n', '180807054931 21 2132.36 25.041 75.46 81.89 85.93 \r\n', '180807055001 21 2132.39 25.041 75.46 81.89 85.93 \r\n', '180807055031 22 2132.36 25.041 75.46 81.89 85.93 \r\n', '180807055101 22 2132.38 25.041 75.46 81.89 85.93 \r\n', '180807055131 19 2132.38 25.041 75.46 81.89 85.94 \r\n', '180807055201 22 2132.37 25.041 75.46 81.89 85.94 \r\n', '180807055231 22 2132.35 25.040 75.46 81.89 85.94 \r\n', '180807055301 20 2132.33 25.040 75.46 81.89 85.94 \r\n', '180807055331 20 2132.38 25.041 75.46 81.89 85.94 \r\n', '180807055401 23 2132.35 25.040 75.46 81.89 85.94 \r\n', '180807055431 20 2132.38 25.041 75.46 81.89 85.94 \r\n', '180807055501 21 2132.15 25.039 75.46 81.89 85.94 \r\n', '180807055531 21 2129.29 25.015 75.46 81.89 85.94 \r\n', '180807055601 19 2125.52 24.985 75.46 81.89 85.94 \r\n', '180807055631 18 2121.54 24.952 75.46 81.90 85.94 \r\n', '180807055701 18 2117.87 24.922 75.46 81.90 85.95 \r\n', '180807055731 21 2114.96 24.898 75.46 81.90 85.95 \r\n', '180807055801 18 2114.18 24.892 75.46 81.89 85.96 \r\n', '180807055831 21 2110.73 24.863 75.46 81.89 85.97 \r\n', '180807055901 22 2107.05 24.833 75.46 81.90 85.99 \r\n', '180807055931 20 2103.34 24.803 75.46 81.90 86.00 \r\n', '180807060010 16 2099.66 24.772 75.46 81.90 86.01 \r\n', '180807060040 20 2095.21 24.736 75.47 81.90 86.03 \r\n', '180807060140 11 2088.59 24.682 75.47 81.90 86.07 \r\n', '180807060210 15 2088.25 24.679 75.48 81.90 86.09 \r\n', '180807060240 11 2088.22 24.679 75.49 81.90 86.10 \r\n', '180807060310 15 2088.25 24.679 75.49 81.90 86.12 \r\n', 'MOVING AVERAGE: 0.00\r\n\r\nDISPENSE STATE: ACTIVE * 5436.755859\r\n', '\r\n', '\x03' ] ) def IA5500(): return "".join( [ '\x01\r\nIA5500\r\n', now(), '\r\n\r\n\r\n', 'CSLD DIAGNOSTICS: LEAK TEST STATUS', '\r\n\r\n', 'TANK TEST STATUS DURATION\r\n', '\r\n', '\x03' ] ) def IA9100(): return "".join( [ '\x01\r\nIA9100\r\n', now(), '\r\n\r\n', module_configuration()["company_name_address"], '\r\n\r\n', 'POWER OUTAGE REPORT\r\n\r\n', 'T 1:REGULAR \r\n', 'INCREASE DATE / TIME FUEL VOLUME WATER VOLUME TEMP DEG F\r\n\r\n', 'POWER REMOVED: MAY 18, 2017 8:53:15 AM 3960 0 70.3\r\n', 'POWER RESTORED: MAY 18, 2017 9:36:15 AM 3960 0 70.2\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', 'POWER REMOVED: JAN 1, 1970 12:00:00 AM 0 0 0.0\r\n', 'POWER RESTORED: JAN 5, 2017 9:57:15 AM 0 0 52.0\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', 'T 2:PLUS \r\n', 'INCREASE DATE / TIME FUEL VOLUME WATER VOLUME TEMP DEG F\r\n\r\n', 'POWER REMOVED: MAY 18, 2017 8:53:15 AM 2055 0 65.3\r\n', 'POWER RESTORED: MAY 18, 2017 9:36:15 AM 2055 0 65.3\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', 'POWER REMOVED: JAN 1, 1970 12:00:00 AM 0 0 0.0\r\n', 'POWER RESTORED: JAN 5, 2017 9:57:15 AM 0 0 54.3\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', 'T 3:SUPREME \r\n', 'INCREASE DATE / TIME FUEL VOLUME WATER VOLUME TEMP DEG F\r\n\r\n', 'POWER REMOVED: MAY 18, 2017 8:53:15 AM 1967 14 66.5\r\n', 'POWER RESTORED: MAY 18, 2017 9:36:15 AM 1967 15 66.5\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', 'POWER REMOVED: JAN 1, 1970 12:00:00 AM 0 0 0.0\r\n', 'POWER RESTORED: JAN 5, 2017 9:57:15 AM 0 0 53.2\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', 'T 4:DIESEL \r\n', 'INCREASE DATE / TIME FUEL VOLUME WATER VOLUME TEMP DEG F\r\n\r\n', 'POWER REMOVED: MAY 18, 2017 8:53:15 AM 3661 0 69.9\r\n', 'POWER RESTORED: MAY 18, 2017 9:36:15 AM 3661 0 69.9\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', 'POWER REMOVED: JAN 1, 1970 12:00:00 AM 0 0 0.0\r\n', 'POWER RESTORED: JAN 5, 2017 9:57:15 AM 0 0 55.0\r\n', 'GROSS VOLUME CHANGE: 0\r\n\r\n', '\r\n', '\x03' ] ) def S00100(): return "".join( [ '\x01\r\nS00100\r\n', now(), '\r\n', # '\x03' # todo: must re-check \x03 not exist? ] ) def S00200(): return "".join( [ '\x01\r\nS00200\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def S00300(): return "".join( [ '\x01\r\nS00300\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def S01000(): return "".join( [ '\x01\r\nS01000\r\n', now(), '\r\n', '\r\n', '\x03' ] ) def S05100(): return "".join( [ '\x01\r\nS05100\r\n', now(), '\r\n\r\n', 'DELIVERY REPORTS ERASED', '\r\n', '\r\n', '\x03' ] ) def S05200(): return "".join( [ '\x01\r\nS05200\r\n', now(), '\r\n', 'TANK PRODUCT LABEL \r\n', ' 1 REGULAR LEAK TEST START\r\n', ' TEST BY EXTERN INTERFACE\r\n\r\n', ' 2 PLUS LEAK TEST START\r\n', ' TEST BY EXTERN INTERFACE\r\n\r\n', ' 3 SUPREME LEAK TEST START\r\n', ' TEST BY EXTERN INTERFACE\r\n\r\n', ' 4 DIESEL LEAK TEST START\r\n', ' TEST BY EXTERN INTERFACE\r\n\r\n', '\r\n', '\x03' ] ) def S05300(): return "".join( [ '\x01\r\nS05300\r\n', now(), '\r\n', 'TANK PRODUCT LABEL \r\n', ' 1 REGULAR LEAK TEST WAS NOT IN PROGRESS\r\n', ' 2 PLUS LEAK TEST WAS NOT IN PROGRESS\r\n', ' 3 SUPREME LEAK TEST WAS NOT IN PROGRESS\r\n' ' 4 DIESEL LEAK TEST WAS NOT IN PROGRESS\r\n', '\r\n', '\x03' ] )
43.490008
116
0.398586
20,117
158,869
3.092409
0.069444
0.071564
0.026764
0.035621
0.766726
0.737132
0.716026
0.694551
0.666308
0.635316
0
0.270955
0.471407
158,869
3,652
117
43.501917
0.469843
0.004293
0
0.546611
0
0.110684
0.516445
0.001821
0
0
0.000152
0.000274
0
1
0.036401
false
0.011246
0.000888
0.036401
0.07369
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
4511476e18639ab066945f205e8a3616c9eef551
70
py
Python
nilmtk_contrib/__init__.py
PiaDiepman/NILMTK-contrib
cd0b4337c9d87d71b3e88ad6581e5377ed8d82aa
[ "Apache-2.0" ]
75
2019-07-05T06:43:10.000Z
2022-03-30T09:18:51.000Z
nilmtk_contrib/__init__.py
PiaDiepman/NILMTK-contrib
cd0b4337c9d87d71b3e88ad6581e5377ed8d82aa
[ "Apache-2.0" ]
52
2019-06-10T14:36:40.000Z
2022-03-25T16:28:05.000Z
nilmtk_contrib/__init__.py
PiaDiepman/NILMTK-contrib
cd0b4337c9d87d71b3e88ad6581e5377ed8d82aa
[ "Apache-2.0" ]
50
2019-06-14T05:31:28.000Z
2022-03-23T17:38:39.000Z
from . import disaggregate from .version import version as __version__
35
43
0.842857
9
70
6.111111
0.555556
0
0
0
0
0
0
0
0
0
0
0
0.128571
70
2
43
35
0.901639
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
18ada577d79d4187c2634a9e8a0275b6c2d798e5
128
py
Python
src/HABApp/core/lib/__init__.py
DerOetzi/HABApp
a123fbfa9928ebb3cda9a84f6984dcba593c8236
[ "Apache-2.0" ]
44
2018-12-13T08:46:44.000Z
2022-03-07T03:23:21.000Z
src/HABApp/core/lib/__init__.py
DerOetzi/HABApp
a123fbfa9928ebb3cda9a84f6984dcba593c8236
[ "Apache-2.0" ]
156
2019-03-02T20:53:31.000Z
2022-03-23T13:13:58.000Z
src/HABApp/core/lib/__init__.py
DerOetzi/HABApp
a123fbfa9928ebb3cda9a84f6984dcba593c8236
[ "Apache-2.0" ]
18
2019-03-08T07:13:21.000Z
2022-03-22T19:52:31.000Z
from .funcs import list_files, sort_files from .pending_future import PendingFuture from .rgb_hsv import hsb_to_rgb, rgb_to_hsb
32
43
0.851563
22
128
4.590909
0.590909
0
0
0
0
0
0
0
0
0
0
0
0.109375
128
3
44
42.666667
0.885965
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
18b04ba043feac0c69ea9e8cbce57fd39fd34770
81
py
Python
servercraft/code_model/__init__.py
jumphone/ServerCraft
a5031d433a8344229411602fd7257f231f4e92d6
[ "Apache-2.0" ]
1
2016-11-02T22:27:22.000Z
2016-11-02T22:27:22.000Z
servercraft/code_model/__init__.py
jumphone/ServerCraft
a5031d433a8344229411602fd7257f231f4e92d6
[ "Apache-2.0" ]
null
null
null
servercraft/code_model/__init__.py
jumphone/ServerCraft
a5031d433a8344229411602fd7257f231f4e92d6
[ "Apache-2.0" ]
null
null
null
from urls import * from views import * from script import * from models import *
16.2
20
0.753086
12
81
5.083333
0.5
0.491803
0
0
0
0
0
0
0
0
0
0
0.197531
81
4
21
20.25
0.938462
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
18cbeb269f0ef67233d0f0cb7149598efe563d4d
242
py
Python
django_fire/exceptions.py
lordpeara/django-fire
d5ee014cda9169ab093e1d032b2e76545f03a696
[ "MIT" ]
1
2020-06-29T07:19:57.000Z
2020-06-29T07:19:57.000Z
django_fire/exceptions.py
lordpeara/django-fire
d5ee014cda9169ab093e1d032b2e76545f03a696
[ "MIT" ]
1
2020-06-26T14:42:59.000Z
2020-06-26T14:42:59.000Z
django_fire/exceptions.py
lordpeara/django-fire
d5ee014cda9169ab093e1d032b2e76545f03a696
[ "MIT" ]
null
null
null
from django.core.exceptions import PermissionDenied class FireException(Exception): """Base exception for django_fire """ class FiredPassword(FireException, PermissionDenied): """Password is fired by staff's operation """
20.166667
53
0.739669
25
242
7.12
0.8
0
0
0
0
0
0
0
0
0
0
0
0.169421
242
11
54
22
0.885572
0.305785
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
18f9a68a6ab7dd69767db5c58ea41fdeaeaf316c
817
py
Python
services/ingest-file/tests/test_csv.py
jalmquist/aleph
28a56bc7edd77dbd7910c94dac40916032edc177
[ "MIT" ]
7
2020-02-18T14:35:10.000Z
2020-03-09T22:53:10.000Z
services/ingest-file/tests/test_csv.py
jalmquist/aleph
28a56bc7edd77dbd7910c94dac40916032edc177
[ "MIT" ]
4
2021-09-08T02:07:35.000Z
2022-03-12T00:33:46.000Z
services/ingest-file/tests/test_csv.py
jalmquist/aleph
28a56bc7edd77dbd7910c94dac40916032edc177
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from .support import TestCase class CSVIngestorTest(TestCase): def test_simple_csv(self): fixture_path, entity = self.fixture('countries.csv') self.manager.ingest(fixture_path, entity) self.assertEqual( entity.first('processingStatus'), self.manager.STATUS_SUCCESS ) self.assertTrue(entity.has('csvHash')) self.assertEqual(int(entity.first('rowCount')), 257) def test_nonutf_csv(self): fixture_path, entity = self.fixture('countries_nonutf.csv') self.manager.ingest(fixture_path, entity) self.assertEqual( entity.first('processingStatus'), self.manager.STATUS_SUCCESS ) self.assertTrue(entity.has('csvHash')) self.assertEqual(int(entity.first('rowCount')), 22)
34.041667
73
0.659731
89
817
5.932584
0.370787
0.05303
0.128788
0.159091
0.810606
0.810606
0.810606
0.810606
0.643939
0.643939
0
0.009317
0.21175
817
23
74
35.521739
0.810559
0.025704
0
0.444444
0
0
0.119647
0
0
0
0
0
0.333333
1
0.111111
false
0
0.055556
0
0.222222
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7a04c57f42733ca11beda76a4635593afcb9fa9b
140
py
Python
Class/generatorClass.py
alexsanderthorne/phytonAvancado
057dda161f1617c71d5faa84f79991b01c72da44
[ "Apache-2.0" ]
null
null
null
Class/generatorClass.py
alexsanderthorne/phytonAvancado
057dda161f1617c71d5faa84f79991b01c72da44
[ "Apache-2.0" ]
7
2021-09-05T15:15:29.000Z
2021-11-18T01:26:01.000Z
Class/generatorClass.py
alexsanderthorne/phytonAvancado
057dda161f1617c71d5faa84f79991b01c72da44
[ "Apache-2.0" ]
null
null
null
class Gen: def __init__(self, n): self.n = n self.last = 0 def __next__(self): return self.next()
15.555556
30
0.485714
18
140
3.333333
0.555556
0.166667
0
0
0
0
0
0
0
0
0
0.012048
0.407143
140
8
31
17.5
0.710843
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.166667
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
e139ea278228541fffb6f73dade99917be30a89a
150
py
Python
tests/unit/fixtures/database.py
Alex92rus/desktop_shop
305caf263b56b279e46d5945285189673b868988
[ "MIT" ]
null
null
null
tests/unit/fixtures/database.py
Alex92rus/desktop_shop
305caf263b56b279e46d5945285189673b868988
[ "MIT" ]
null
null
null
tests/unit/fixtures/database.py
Alex92rus/desktop_shop
305caf263b56b279e46d5945285189673b868988
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Sat Dec 11 21:48:24 2021 @author: richa """ import pytest @pytest.fixture def pepper(): return "secret"
11.538462
35
0.626667
22
150
4.272727
0.954545
0
0
0
0
0
0
0
0
0
0
0.108333
0.2
150
12
36
12.5
0.675
0.493333
0
0
0
0
0.088235
0
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
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
5
e17e1b8634e8252c101db56fa48314ef1e7b819e
101
py
Python
x7/geom/shell_tools.py
gribbg/x7-geom
a01ef29dc47f1587e3390b552decf92db0bbaa20
[ "BSD-2-Clause" ]
null
null
null
x7/geom/shell_tools.py
gribbg/x7-geom
a01ef29dc47f1587e3390b552decf92db0bbaa20
[ "BSD-2-Clause" ]
null
null
null
x7/geom/shell_tools.py
gribbg/x7-geom
a01ef29dc47f1587e3390b552decf92db0bbaa20
[ "BSD-2-Clause" ]
null
null
null
"""Shell tools for geom""" from .plot_utils import plot, plot_show __all__ = ['plot', 'plot_show']
16.833333
39
0.693069
15
101
4.2
0.666667
0.253968
0.380952
0
0
0
0
0
0
0
0
0
0.148515
101
5
40
20.2
0.732558
0.19802
0
0
0
0
0.173333
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
e1988b08da980141bfa9d82b68f6ee5c9d5857db
526
py
Python
src/Python/501-600/520.DetectCapitalUse.py
Peefy/PeefyLeetCode
92156e4b48ba19e3f02e4286b9f733e9769a1dee
[ "Apache-2.0" ]
2
2018-05-03T07:50:03.000Z
2018-06-17T04:32:13.000Z
src/Python/501-600/520.DetectCapitalUse.py
Peefy/PeefyLeetCode
92156e4b48ba19e3f02e4286b9f733e9769a1dee
[ "Apache-2.0" ]
null
null
null
src/Python/501-600/520.DetectCapitalUse.py
Peefy/PeefyLeetCode
92156e4b48ba19e3f02e4286b9f733e9769a1dee
[ "Apache-2.0" ]
3
2018-11-09T14:18:11.000Z
2021-11-17T15:23:52.000Z
class Solution: def detectCapitalUse(self, word): """ :type word: str :rtype: bool """ return if word.islower() or word.isupper() or (len(word)>1 and word.title() == word) if __name__ == '__main__': solution = Solution() print(solution.detectCapitalUse('USA')) print(solution.detectCapitalUse('leetcode')) print(solution.detectCapitalUse('Google')) print(solution.detectCapitalUse('FlaG')) print(solution.detectCapitalUse('mL')) else: pass
27.684211
92
0.623574
53
526
6.037736
0.54717
0.203125
0.453125
0
0
0
0
0
0
0
0
0.002481
0.23384
526
18
93
29.222222
0.791563
0
0
0
0
0
0.066667
0
0
0
0
0
0
0
null
null
0.083333
0
null
null
0.416667
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
1
0
0
1
0
0
0
1
0
5
e19eb92bcd1e49934c2fb2ed3314650a18f9b6f7
3,104
py
Python
select_cluster.py
beratkurar/unsupervised_deep_learning_for_page_segmentation
e6446a5e93333d4f812882cfc70934b23ef774be
[ "MIT" ]
3
2020-07-23T08:06:58.000Z
2021-07-16T10:57:40.000Z
select_cluster.py
beratkurar/unsupervised_deep_learning_for_page_segmentation
e6446a5e93333d4f812882cfc70934b23ef774be
[ "MIT" ]
2
2020-07-23T08:06:50.000Z
2021-09-17T09:55:46.000Z
select_cluster.py
beratkurar/unsupervised_deep_learning_for_page_segmentation
e6446a5e93333d4f812882cfc70934b23ef774be
[ "MIT" ]
1
2021-11-15T15:46:24.000Z
2021-11-15T15:46:24.000Z
import cv2 import numpy as np import os def select_cluster(org_folder,vis_folder,page_name,maintext_folder,overlap_folder): vis_img=cv2.imread(os.path.join(vis_folder,page_name)) org_img=cv2.imread(os.path.join(org_folder,page_name),0) ret, thresh = cv2.threshold(org_img, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU) rows,cols,ch=vis_img.shape red=vis_img[:,:,2] green=vis_img[:,:,1] blue=vis_img[:,:,0] # book1_page1.png # maintext=np.zeros((rows,cols),dtype=np.uint8) # s=(blue<18) # maintext[s]=255 # cv2.imwrite(os.path.join(maintext_folder,page_name),maintext) # cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) # book1_page11.png # maintext=np.zeros((rows,cols),dtype=np.uint8) # s=(blue<19)&(green>37) # maintext[s]=255 # cv2.imwrite(os.path.join(maintext_folder,page_name),maintext) # cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) # book1_page16.png # maintext=np.zeros((rows,cols),dtype=np.uint8) # s=(blue<29) # maintext[s]=255 # cv2.imwrite(os.path.join(maintext_folder,page_name),maintext) # cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) # book1_page18.png # maintext=np.zeros((rows,cols),dtype=np.uint8) # s=(blue<118) # maintext[s]=255 # cv2.imwrite(os.path.join(maintext_folder,page_name),maintext) # cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) # book1_page7.png # maintext=np.zeros((rows,cols),dtype=np.uint8) # s=(blue<59) # maintext[s]=255 # cv2.imwrite(os.path.join(maintext_folder,page_name),maintext) # cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) # book1_page8.png maintext=np.zeros((rows,cols),dtype=np.uint8) s=(blue<59) maintext[s]=255 cv2.imwrite(os.path.join(maintext_folder,page_name[:-4]+'.png'),maintext) cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) # book2_page2.png # maintext=np.zeros((rows,cols),dtype=np.uint8) # s=(blue<220) # maintext[s]=255 # cv2.imwrite(os.path.join(maintext_folder,page_name[:-4]+'.png'),maintext) # cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) # book3_page1.jpg # maintext=np.zeros((rows,cols),dtype=np.uint8) # s=(blue<20)&(green>40) # maintext[s]=255 # cv2.imwrite(os.path.join(maintext_folder,page_name[:-4]+'.png'),maintext) # cv2.imwrite(os.path.join(overlap_folder,page_name),maintext&thresh) vis_folder='output_10_10/cv2_vis2' org_folder='complex_test' maintext_folder='complex_maintext_4' overlap_folder='complex_maintext_overlap_4' #page_name='book1_page1.png' #page_name='book1_page11.png' #page_name='book1_page16.png' #page_name='book1_page18.png' #page_name='book1_page7.png' page_name='book1_page8.jpg' #page_name='book2_page2.jpg' #page_name='book3_page1.jpg' select_cluster(org_folder,vis_folder,page_name,maintext_folder,overlap_folder)
34.488889
90
0.693621
465
3,104
4.425806
0.148387
0.108844
0.136054
0.124393
0.725948
0.725948
0.704568
0.704568
0.704568
0.704568
0
0.050303
0.148196
3,104
89
91
34.876404
0.728064
0.588918
0
0
0
0
0.084731
0.041483
0
0
0
0
0
1
0.045455
false
0
0.136364
0
0.181818
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
e1aa72a93c28bdbf18ed7635678e5fbf43f18073
87
py
Python
dev/tools/leveleditor/pandac/libotpModules.py
CrankySupertoon01/Toontown-2
60893d104528a8e7eb4aced5d0015f22e203466d
[ "MIT" ]
1
2021-02-13T22:40:50.000Z
2021-02-13T22:40:50.000Z
dev/tools/leveleditor/pandac/libotpModules.py
CrankySupertoonArchive/Toontown-2
60893d104528a8e7eb4aced5d0015f22e203466d
[ "MIT" ]
1
2018-07-28T20:07:04.000Z
2018-07-30T18:28:34.000Z
dev/tools/leveleditor/pandac/libotpModules.py
CrankySupertoonArchive/Toontown-2
60893d104528a8e7eb4aced5d0015f22e203466d
[ "MIT" ]
2
2019-12-02T01:39:10.000Z
2021-02-13T22:41:00.000Z
from extension_native_helpers import * Dtool_PreloadDLL('libotp') from libotp import *
21.75
38
0.827586
11
87
6.272727
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.103448
87
3
39
29
0.884615
0
0
0
0
0
0.068966
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e1d11b3503f368a867cfda08408f70c6d4b38252
938
py
Python
pirates/leveleditor/worldData/pvp_deathmatchWorld2.py
Willy5s/Pirates-Online-Rewritten
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
[ "BSD-3-Clause" ]
81
2018-04-08T18:14:24.000Z
2022-01-11T07:22:15.000Z
pirates/leveleditor/worldData/pvp_deathmatchWorld2.py
Willy5s/Pirates-Online-Rewritten
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
[ "BSD-3-Clause" ]
4
2018-09-13T20:41:22.000Z
2022-01-08T06:57:00.000Z
pirates/leveleditor/worldData/pvp_deathmatchWorld2.py
Willy5s/Pirates-Online-Rewritten
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
[ "BSD-3-Clause" ]
26
2018-05-26T12:49:27.000Z
2021-09-11T09:11:59.000Z
from pandac.PandaModules import Point3, VBase3 objectStruct = {'Objects': {'1170792960.0jubutler': {'Type': 'Region','Name': 'default','Objects': {'1170792960.0jubutler0': {'Type': 'Island','Name': 'pvp_deathmatchIsland2','File': 'pvp_deathmatchIsland2','Hpr': Point3(0.0, 0.0, 0.0),'Objects': {'1170795520.0jubutler': {'Type': 'LOD Sphere','Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(0.0, 0.0, 580.947),'Radi': [11520, 12520, 13520],'Scale': VBase3(1.0, 1.0, 1.0)}},'Pos': Point3(-22.813, -228.489, 4.766),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/islands/pir_m_are_isl_driftwood'}}},'Visual': {}}},'Layers': {},'ObjectIds': {'1170792960.0jubutler': '["Objects"]["1170792960.0jubutler"]','1170792960.0jubutler0': '["Objects"]["1170792960.0jubutler"]["Objects"]["1170792960.0jubutler0"]','1170795520.0jubutler': '["Objects"]["1170792960.0jubutler"]["Objects"]["1170792960.0jubutler0"]["Objects"]["1170795520.0jubutler"]'}}
469
891
0.676972
119
938
5.285714
0.420168
0.041335
0.047695
0.044515
0.286169
0.27027
0.101749
0.101749
0
0
0
0.23622
0.052239
938
2
891
469
0.471316
0
0
0
0
0
0.58147
0.355698
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
becba5b848d368516f30ba8a90d4afcd7f0bba98
1,543
py
Python
insights/parsers/ls_sys_firmware.py
sagaraivale/insights-core
852a9669c998acf995e316bd407aeb4dbc6c485e
[ "Apache-2.0" ]
1
2018-03-26T12:59:24.000Z
2018-03-26T12:59:24.000Z
insights/parsers/ls_sys_firmware.py
sagaraivale/insights-core
852a9669c998acf995e316bd407aeb4dbc6c485e
[ "Apache-2.0" ]
null
null
null
insights/parsers/ls_sys_firmware.py
sagaraivale/insights-core
852a9669c998acf995e316bd407aeb4dbc6c485e
[ "Apache-2.0" ]
null
null
null
""" LsSysFirmware - command ``ls /sys/firmware`` ============================================ The ``ls -lanR /sys/firmware`` command provides information for the listing of the ``/sys/firmware`` directory. Sample input is shown in the Examples. See ``FileListing`` class for additional information. Examples: >>> LS_SYS_FIRMWARE = ''' ... /sys/firmware: ... total 0 ... drwxr-xr-x. 5 0 0 0 Dec 22 17:56 . ... dr-xr-xr-x. 13 0 0 0 Dec 22 17:56 .. ... drwxr-xr-x. 5 0 0 0 Dec 22 17:56 acpi ... drwxr-xr-x. 3 0 0 0 Dec 22 17:57 dmi ... drwxr-xr-x. 10 0 0 0 Dec 22 17:57 memmap ... ... /sys/firmware/acpi: ... total 0 ... drwxr-xr-x. 5 0 0 0 Dec 22 17:56 . ... drwxr-xr-x. 5 0 0 0 Dec 22 17:56 .. ... drwxr-xr-x. 6 0 0 0 Feb 10 15:54 hotplug ... drwxr-xr-x. 2 0 0 0 Feb 10 15:54 interrupts ... -r--r--r--. 1 0 0 4096 Feb 10 15:54 pm_profile ... drwxr-xr-x. 3 0 0 0 Dec 22 17:56 tables ... ''' >>> ls_sys_firmware = LsSysFirmware(context_wrap(LS_SYS_FIRMWARE)) >>> "acpi" in ls_sys_firmware False >>> "/sys/firmware/acpi" in ls_sys_firmware True >>> ls_sys_firmware.dirs_of("/sys/firmware") ['.', '..', 'acpi', 'dmi', 'memmap'] >>> ls_sys_firmware.files_of("/sys/firmware/acpi") ['pm_profile'] """ from .. import parser from .. import FileListing from insights.specs import Specs @parser(Specs.ls_sys_firmware) class LsSysFirmware(FileListing): """Parses output of ``ls -lanR /sys/firmware`` command.""" pass
31.489796
78
0.583927
248
1,543
3.548387
0.274194
0.047727
0.034091
0.054545
0.343182
0.288636
0.288636
0.175
0.175
0.175
0
0.09799
0.226183
1,543
48
79
32.145833
0.639028
0.885288
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.166667
0.5
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
bee90eed2f83be1bb9394932ee040a498a73743c
35
py
Python
Chapter1/C-1/19.py
GeorgeGkas/Data_Structures_and_Algorithms_in_Python
c4f8b590ab2dd008504e639607c62d5e5760009a
[ "MIT" ]
1
2017-05-18T09:43:38.000Z
2017-05-18T09:43:38.000Z
Chapter1/C-1/19.py
GeorgeGkas/Data_Structures_and_Algorithms_in_Python
c4f8b590ab2dd008504e639607c62d5e5760009a
[ "MIT" ]
null
null
null
Chapter1/C-1/19.py
GeorgeGkas/Data_Structures_and_Algorithms_in_Python
c4f8b590ab2dd008504e639607c62d5e5760009a
[ "MIT" ]
null
null
null
[chr(x) for x in range(97, 97+26)]
17.5
34
0.6
9
35
2.333333
0.777778
0
0
0
0
0
0
0
0
0
0
0.206897
0.171429
35
1
35
35
0.517241
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5