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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4bfd781033511a704fa511440baea1d5eab04888
| 24
|
py
|
Python
|
elliot/recommender/gan/CFGAN/__init__.py
|
gategill/elliot
|
113763ba6d595976e14ead2e3d460d9705cd882e
|
[
"Apache-2.0"
] | 175
|
2021-03-04T15:46:25.000Z
|
2022-03-31T05:56:58.000Z
|
elliot/recommender/gan/CFGAN/__init__.py
|
gategill/elliot
|
113763ba6d595976e14ead2e3d460d9705cd882e
|
[
"Apache-2.0"
] | 15
|
2021-03-06T17:53:56.000Z
|
2022-03-24T17:02:07.000Z
|
elliot/recommender/gan/CFGAN/__init__.py
|
gategill/elliot
|
113763ba6d595976e14ead2e3d460d9705cd882e
|
[
"Apache-2.0"
] | 39
|
2021-03-04T15:46:26.000Z
|
2022-03-09T15:37:12.000Z
|
from .cfgan import CFGAN
| 24
| 24
| 0.833333
| 4
| 24
| 5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 24
| 1
| 24
| 24
| 0.952381
| 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
|
4bfdc6defef1bed914ce37007aa631175db3399c
| 610
|
py
|
Python
|
tests/test_type.py
|
Cologler/typing-instancecheck-python
|
b4dcea88468b1ee43ebb36413b099e3e8508b3ce
|
[
"MIT"
] | 6
|
2018-07-08T09:38:35.000Z
|
2020-06-25T13:15:02.000Z
|
tests/test_type.py
|
Cologler/typing-instancecheck-python
|
b4dcea88468b1ee43ebb36413b099e3e8508b3ce
|
[
"MIT"
] | 1
|
2018-07-08T10:12:49.000Z
|
2018-07-08T11:31:18.000Z
|
tests/test_type.py
|
Cologler/istype-python
|
b4dcea88468b1ee43ebb36413b099e3e8508b3ce
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018~2999 - Cologler <skyoflw@gmail.com>
# ----------
#
# ----------
from typing import Type, Any
from istype import isinstanceof
def test_type():
class User:
pass
class BasicUser(User):
pass
class ProUser(User):
pass
class TeamUser(ProUser):
pass
assert isinstanceof(User, Type[User])
assert isinstanceof(BasicUser, Type[User])
assert isinstanceof(ProUser, Type[User])
assert isinstanceof(TeamUser, Type[User])
assert not isinstanceof(str, Type[User])
assert isinstanceof(str, Type[Any])
| 19.677419
| 56
| 0.631148
| 69
| 610
| 5.565217
| 0.42029
| 0.234375
| 0.182292
| 0.270833
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019108
| 0.227869
| 610
| 30
| 57
| 20.333333
| 0.796178
| 0.160656
| 0
| 0.235294
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.352941
| 1
| 0.058824
| true
| 0.235294
| 0.117647
| 0
| 0.411765
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
ef549e45904f15d910c9aeec7d32ca3fa25a1f29
| 71
|
py
|
Python
|
atlas/foundations_contrib/src/test/config/__init__.py
|
DeepLearnI/atlas
|
8aca652d7e647b4e88530b93e265b536de7055ed
|
[
"Apache-2.0"
] | 296
|
2020-03-16T19:55:00.000Z
|
2022-01-10T19:46:05.000Z
|
atlas/foundations_contrib/src/test/config/__init__.py
|
DeepLearnI/atlas
|
8aca652d7e647b4e88530b93e265b536de7055ed
|
[
"Apache-2.0"
] | 57
|
2020-03-17T11:15:57.000Z
|
2021-07-10T14:42:27.000Z
|
atlas/foundations_contrib/src/test/config/__init__.py
|
DeepLearnI/atlas
|
8aca652d7e647b4e88530b93e265b536de7055ed
|
[
"Apache-2.0"
] | 38
|
2020-03-17T21:06:05.000Z
|
2022-02-08T03:19:34.000Z
|
from test.config.test_bucket_type_fetcher import TestBucketTypeFetcher
| 35.5
| 70
| 0.915493
| 9
| 71
| 6.888889
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056338
| 71
| 2
| 70
| 35.5
| 0.925373
| 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
|
ef6752dc1d5930f80ee3a63bdcc99758b4ce9312
| 80
|
py
|
Python
|
discor_algo/discor/algorithm/__init__.py
|
fgitmichael/SelfSupevisedSkillDiscovery
|
60eee11cfd67046190dd2784bf40e97bdbed9d40
|
[
"MIT"
] | 27
|
2020-06-09T06:33:14.000Z
|
2022-03-27T05:36:27.000Z
|
discor_algo/discor/algorithm/__init__.py
|
fgitmichael/SelfSupevisedSkillDiscovery
|
60eee11cfd67046190dd2784bf40e97bdbed9d40
|
[
"MIT"
] | 6
|
2021-02-02T23:00:02.000Z
|
2022-01-13T03:13:51.000Z
|
discor_algo/discor/algorithm/__init__.py
|
fgitmichael/SelfSupevisedSkillDiscovery
|
60eee11cfd67046190dd2784bf40e97bdbed9d40
|
[
"MIT"
] | 3
|
2020-06-15T15:17:36.000Z
|
2021-03-25T11:52:07.000Z
|
from .sac import SAC
from .discor import DisCor
from .eval import EvalAlgorithm
| 20
| 31
| 0.8125
| 12
| 80
| 5.416667
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 80
| 3
| 32
| 26.666667
| 0.955882
| 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
|
324536e26e4f151be5ed7008682add31552342c4
| 20
|
py
|
Python
|
example_project/some_modules/third_modules/a30.py
|
Yuriy-Leonov/cython_imports_limit_issue
|
2f9e7c02798fb52185dabfe6ce3811c439ca2839
|
[
"MIT"
] | null | null | null |
example_project/some_modules/third_modules/a30.py
|
Yuriy-Leonov/cython_imports_limit_issue
|
2f9e7c02798fb52185dabfe6ce3811c439ca2839
|
[
"MIT"
] | null | null | null |
example_project/some_modules/third_modules/a30.py
|
Yuriy-Leonov/cython_imports_limit_issue
|
2f9e7c02798fb52185dabfe6ce3811c439ca2839
|
[
"MIT"
] | null | null | null |
class A30:
pass
| 6.666667
| 10
| 0.6
| 3
| 20
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 0.35
| 20
| 2
| 11
| 10
| 0.769231
| 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
|
32a73756c19618b7007511d84e0222404551151f
| 2,670
|
py
|
Python
|
FF_main_site/main_site.py
|
Markynice/python_testing
|
43bac522d9339cac98221cf0be48de9277ca1624
|
[
"Apache-2.0"
] | null | null | null |
FF_main_site/main_site.py
|
Markynice/python_testing
|
43bac522d9339cac98221cf0be48de9277ca1624
|
[
"Apache-2.0"
] | null | null | null |
FF_main_site/main_site.py
|
Markynice/python_testing
|
43bac522d9339cac98221cf0be48de9277ca1624
|
[
"Apache-2.0"
] | null | null | null |
import unittest
import requests
from requests.auth import HTTPBasicAuth
import HtmlTestRunner
class MainSite(unittest.TestCase):
def test_Main_page(self):
Link = requests.get("https://preprod.fashion-flash.de", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_Unser_Event_Konzept(self):
Link = requests.get("https://preprod.fashion-flash.de/wie", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_uber_uns(self):
Link = requests.get("https://preprod.fashion-flash.de/uber_uns", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_kooperationen(self):
Link = requests.get("https://preprod.fashion-flash.de/kooperationen", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_presse(self):
Link = requests.get("https://preprod.fashion-flash.de/presse", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_jobs(self):
Link = requests.get("https://preprod.fashion-flash.de/jobs", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_Main_kontakt(self):
Link = requests.get("https://preprod.fashion-flash.de/kontakt", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_Impressum(self):
Link = requests.get("https://preprod.fashion-flash.de/impressum#impressum", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_agb(self):
Link = requests.get("https://preprod.fashion-flash.de/agb#agb", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_Main_page(self):
Link = requests.get("https://preprod.fashion-flash.de/datenschutzerklarung#daten", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
def test_tickets(self):
Link = requests.get("https://preprod.fashion-flash.de/tickets", auth=HTTPBasicAuth('', ''))
Status = Link.status_code
self.assertEqual(Status,200)
if __name__ == "__main__":
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output='example_dir'))
| 39.850746
| 122
| 0.620974
| 288
| 2,670
| 5.625
| 0.163194
| 0.047531
| 0.108642
| 0.129012
| 0.77963
| 0.77963
| 0.77963
| 0.77963
| 0.77963
| 0.52963
| 0
| 0.016329
| 0.243071
| 2,670
| 66
| 123
| 40.454545
| 0.785255
| 0
| 0
| 0.470588
| 0
| 0
| 0.18015
| 0
| 0
| 0
| 0
| 0
| 0.215686
| 1
| 0.215686
| false
| 0
| 0.078431
| 0
| 0.313725
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
32b554ce54a2b28a6163d1b9e87fa1044c737d9c
| 529
|
py
|
Python
|
netensorflow/ann/macro_layer/layer_structure/layers/__init__.py
|
psigelo/NeTensorflow
|
ec8bc09cc98346484d1b682a3dfd25c68c4ded61
|
[
"MIT"
] | null | null | null |
netensorflow/ann/macro_layer/layer_structure/layers/__init__.py
|
psigelo/NeTensorflow
|
ec8bc09cc98346484d1b682a3dfd25c68c4ded61
|
[
"MIT"
] | null | null | null |
netensorflow/ann/macro_layer/layer_structure/layers/__init__.py
|
psigelo/NeTensorflow
|
ec8bc09cc98346484d1b682a3dfd25c68c4ded61
|
[
"MIT"
] | null | null | null |
from .ConvolutionalLayer import ConvolutionalLayer
from .ConvolutionalLayerWithPoolMax2x2 import ConvolutionalLayerWithPoolMax2x2
from .ConvolutionalLayerWithPoolNorm import ConvolutionalLayerWithPoolNorm
from .FullConnected import FullConnected
from .FullConnectedDropout import FullConnectedDropout
from .FullConnectedWithSoftmaxLayer import FullConnectedWithSoftmaxLayer
from .InputLayer import InputLayer
from .SoftmaxLayer import SoftmaxLayer
from .TranslatorLayerImage2OneDimension import TranslatorLayerImage2OneDimension
| 52.9
| 80
| 0.914934
| 36
| 529
| 13.444444
| 0.305556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01217
| 0.068053
| 529
| 9
| 81
| 58.777778
| 0.969574
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
32b768d9e9d8c3c4f453a9d0baf76286de1ac028
| 45
|
py
|
Python
|
flexget/plugins/generic/__init__.py
|
Jeremiad/Flexget
|
73e6e062eeb126eaec8737a6d6c94ccf3d250b03
|
[
"MIT"
] | 1,322
|
2015-01-01T22:00:25.000Z
|
2022-03-30T05:37:46.000Z
|
flexget/plugins/generic/__init__.py
|
Jeremiad/Flexget
|
73e6e062eeb126eaec8737a6d6c94ccf3d250b03
|
[
"MIT"
] | 2,384
|
2015-01-01T04:23:15.000Z
|
2022-03-31T01:06:43.000Z
|
flexget/plugins/generic/__init__.py
|
Jeremiad/Flexget
|
73e6e062eeb126eaec8737a6d6c94ccf3d250b03
|
[
"MIT"
] | 617
|
2015-01-02T15:15:07.000Z
|
2022-03-15T12:29:31.000Z
|
"""Plugins handling multiple task phases."""
| 22.5
| 44
| 0.733333
| 5
| 45
| 6.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 45
| 1
| 45
| 45
| 0.825
| 0.844444
| 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
|
32bbe9755cbf6e10a27f8528fe4ffeb7111a6081
| 40
|
py
|
Python
|
greentea/__init__.py
|
nryotaro/greentea
|
85d6b4fdfeb36e17deb530fa95c484c34a8d6677
|
[
"MIT"
] | null | null | null |
greentea/__init__.py
|
nryotaro/greentea
|
85d6b4fdfeb36e17deb530fa95c484c34a8d6677
|
[
"MIT"
] | 1
|
2020-02-06T04:54:22.000Z
|
2020-02-06T04:54:22.000Z
|
greentea/__init__.py
|
nryotaro/greentea
|
85d6b4fdfeb36e17deb530fa95c484c34a8d6677
|
[
"MIT"
] | null | null | null |
"""A microframework for abstraction."""
| 20
| 39
| 0.725
| 4
| 40
| 7.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 40
| 1
| 40
| 40
| 0.805556
| 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
|
32bf47053381d9edd6f4502ab4c1e3715be161bc
| 38,732
|
py
|
Python
|
settings/lauecollect_settings.py
|
bopopescu/Lauecollect
|
60ae2b05ea8596ba0decf426e37aeaca0bc8b6be
|
[
"MIT"
] | null | null | null |
settings/lauecollect_settings.py
|
bopopescu/Lauecollect
|
60ae2b05ea8596ba0decf426e37aeaca0bc8b6be
|
[
"MIT"
] | 1
|
2019-10-22T21:28:31.000Z
|
2019-10-22T21:39:12.000Z
|
settings/lauecollect_settings.py
|
bopopescu/Lauecollect
|
60ae2b05ea8596ba0decf426e37aeaca0bc8b6be
|
[
"MIT"
] | 2
|
2019-06-06T15:06:46.000Z
|
2020-07-20T02:03:22.000Z
|
param.alist = [0.0, 30.0, 60.0, 90.0]
param.amax = 90.0
param.amin = 0.0
param.amode = u'Single pass'
param.amotor = 'Phi'
param.astep = 30.0
param.description = u'laser 1443 nm, 1.22 mJ, X-ray 40x52 um HxV, 26.0 uJ'
param.extension = 'mccd'
param.file_basename = 'Test-11'
param.lmode = u'off/on'
param.logfile_filename = 'Test-11.log'
param.path = '/net/mx340hs/data/anfinrud_1809/Test/Test-11'
param.randomize_timeseries = False
param.ref_timepoint = -9.999999999999999e-06
param.tlist = [-1e-10, -5e-11, 0.0, 5e-11, 1e-10, 3.16e-10, 1e-09, 3.1600000000000003e-09, 1e-08, 3.1600000000000005e-08, 1.0000000000000001e-07, 3.16e-07, 1e-06, 3.16e-06, 9.999999999999999e-06, 3.16e-05, 9.999999999999999e-05, 0.000316, 0.001, 0.00316, 0.01, 0.0316, 0.06517028571428571, 0.13034057142857142]
options.ccd_bin_factor = 2
options.ccd_hardware_trigger = True
options.ccd_readout_mode = 'frame transfer'
options.collection_order = [['delay'], ['laser_on'], ['temperature']]
options.estimate_collection_time = False
options.finish_series_variable = u''
options.levels = [1.0, 0.178]
options.max_waitt_off = 0.1
options.min_waitt_off = 0.024
options.min_waitts = [0.024]
options.npasses = 1
options.npasses2 = 1
options.npulses = 200
options.npulses_off = 200
options.open_laser_safety_shutter = False
options.open_laser_shutter = True
options.periodically_read_ccd = False
options.save_raw_image = False
options.use_attenuator = False
options.use_illuminator = False
options.variable_choices = {'delay': [-9.999999999999999e-06, 0.001, -9.999999999999999e-06, 0.01], 'laser_on': [True], 'temperature': [-18.0, 11.0, 35.0], 'level': [1.0]}
options.variable_include_in_filename = ['delay', 'laser_on', 'temperature']
options.variable_return = {'repeat2': False, 'repeat': False, 'temperature': True, 'level': False}
options.variable_return_value = {'temperature': 22.0}
options.variable_wait = {'repeat': False, 'translation': False, 'xray_on': False, 'chopper_mode': False, 'angle': True, 'temperature': False, 'level': False, 'delay': False, 'laser_on': False, 'repeat2': False, 'translation_mode': False}
options.wait_for_beam = False
options.wait_for_topup = False
options.xray_detector_enabled = True
options.xray_on = [True]
temp.hardware_triggered = False
temp.settling_time = 2.0
temp.step = 0.25
temp.temperatures = [22]
temp.wait = True
align.align_at_collection_phis = True
align.align_at_collection_zs = True
align.attenuate_xray = False
align.beamsize = 0.04
align.boxsize = 15
align.ccd_bin_factor = 8
align.center_sample = 'Beamstop-2'
align.center_time = 0
align.enabled = False
align.end = -0.4
align.intepolation_dphi = 3.0
align.intepolation_dz = 0.2
align.last_scans_use = 8
align.min_scanpoints = 7
align.npoints = 3
align.npulses = 1
align.optimize = False
align.phi_range = 30.0
align.profile = []
align.scan_offset = 0.1
align.start = 0.0
align.step = 0.02
align.threshold = 4.0
align.waitt = 0.024
align.xray_level = 1.0
align.z_range = 0.12
translate.after_image_interleave = False
translate.after_image_interleave_factor = 2
translate.after_image_nspots = 7
translate.after_image_zstep = 0.035
translate.after_images = 2
translate.after_series = True
translate.alternate = False
translate.during_image_nspots = 5
translate.dz = 0.06
translate.end = -11.92
translate.hardware_triggered = True
translate.interleave = True
translate.interleave_factor = 2
translate.mode = 'linear stage'
translate.modes = ['Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Fly-thru', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-12', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Stepping-36', 'Exotic-32', 'Exotic-32', 'Exotic-64', 'Exotic-64', 'Exotic-128', 'Exotic-128', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2', 'Fly-thru-2']
translate.move_time = 0.012
translate.move_when_idle = False
translate.park_position = 13.37
translate.return_after_series = 1
translate.return_time = 0.25
translate.single = True
translate.start = 11.75
translate.step = -0.483
translate.time = 0.02
translate.x = [4.0, 4.0]
translate.y = [4.0, 4.0]
translate.z = [4.0, 4.0]
chopper.gate_start = [0.0, -3.75e-07, -9.75e-07, -1.8999999999999998e-06, -2.2e-07, -5.0000000000000004e-08, -5.0000000000000004e-08, -5.0000000000000004e-08]
chopper.gate_stop = [9.999999999999999e-06, 5.000000000000001e-07, 7.95e-07, 1.2e-06, 5.000000000000001e-07, 5.000000000000001e-07, 5.000000000000001e-07, 5.000000000000001e-07]
chopper.min_dt = [-1.9999999999999998e-05, -1.9999999999999998e-05, -1.9999999999999998e-05, -1.9999999999999998e-05, 3.17e-05, -1.9999999999999998e-05, -1.9999999999999998e-05, -20.0]
chopper.modes = [7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0]
chopper.phase = [0.0, 0.0, 6.000000000000001e-09, 9.000000000000001e-09, -1.4000000000000001e-08, 0.0, -1.841e-06, 4.972e-06]
chopper.pulses = [24.0, 1.0, 3.0, 5.0, 24.0, 1.0, 56.0, 1.0]
chopper.time = [3.5e-06, 1e-10, 3.08e-07, 6.12e-07, 3.5e-06, 1e-10, 5.000000000000001e-07, 1e-10]
chopper.use = [False, False, False, True, False, False, True, False]
chopper.variable = False
chopper.wait = True
chopper.x = [27.67, 37.28, 37.28, 37.28, 37.28, 37.28, 37.28, 33.79]
chopper.y = [30.965, 30.965, 30.89, 30.81, 30.09, 30.555, 30.555, 30.12]
pump.at_begin_of_dataset = [False, False, False]
pump.command_number = 0
pump.commands = ['peristaltic_pump.V.value += 90', '', '']
pump.enabled = True
pump.frequencies = [2.0, 117.0, 117.0]
pump.frequency = 2
pump.hardware_triggered = True
pump.ncommands = 1
pump.on = [0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0]
pump.phi1 = -60
pump.phi2 = -30
pump.phi3 = -60
pump.step = -90.0
diagnostics.PVnames = ['ring-current[mA]', 'bunch-current[mA]', 'CryoJet[K]', 'cooling-water-temp[C]', 'room-temp[C]', 'table-temp[C]', 'sample-temp[C]', 'laser-hutch-temp[F]', 'PeriscopeH[mm]', 'PeriscopeV[mm]', 'LaserX[mm]', 'LaserZ[mm]', 'sample-setpoint[C]', 'syringe-pump[uL]', 'MirrorH[mrad]', 'MirrorV[V]']
diagnostics.PVs = ['S:SRcurrentAI.VAL', 'BNCHI:BunchCurrentAI.VAL', '14IDB:oxTemp', '14Keithley1:DMM1Ch1_raw.VAL', '14Keithley1:DMM1Ch3_raw.VAL', '14Keithley1:DMM1Ch4_raw.VAL', 'temperature_controller.readT', 'G:AHU:FP5100Ai', 'PeriscopeH', 'PeriscopeV', 'LaserX', 'LaserZ', 'temperature_controller.setT', 'syringe_pump.volume', 'MirrorH', 'MirrorV']
diagnostics.PVuse = [True, True, False, False, False, False, True, False, False, False, False, False, True, False, False, False]
diagnostics.delay = False
diagnostics.enabled = False
diagnostics.laser = False
diagnostics.laser_offset = -1.277e-10
diagnostics.laser_record_waveform = False
diagnostics.laser_reference = 3.09e-09
diagnostics.laser_sampling_rate = 1000000000.0
diagnostics.laser_time_offset = -4.5000000000000003e-07
diagnostics.laser_time_range = 2.0000000000000002e-07
diagnostics.min_window = 1.0000000000000001e-07
diagnostics.timing_offset = 0.0
diagnostics.xray = False
diagnostics.xray_gate_start = -2.1999999999999975e-07
diagnostics.xray_gate_stop = 5e-07
diagnostics.xray_offset_level = 2.991666666666668e-84
diagnostics.xray_record_waveform = False
diagnostics.xray_reference = 4.682e-08
diagnostics.xray_sampling_rate = 1000000000.0
diagnostics.xray_time_offset = 0.0
diagnostics.xray_time_range = 4.9999999999999996e-06
xraycheck.at_start_of_time_series = False
xraycheck.comment = ''
xraycheck.enabled = False
xraycheck.interval = 72000.0
xraycheck.last = 1308282128.659218
xraycheck.min_intensity = 0.1
xraycheck.retract_sample = -2.5
xraycheck.run_variable = 'delay'
xraycheck.sample_motor = u'GonZ'
xraycheck.type = u'I0'
lasercheck.at_start_of_time_series = True
lasercheck.attenuator = 39.0
lasercheck.check_only = False
lasercheck.comment = 'Average error -0.003, 0.013 mm, signal/noise: 58.5. Change: LaserZ from 0.755 to 0.758, LaserX from -3.945 to -3.957 mm '
lasercheck.enabled = False
lasercheck.interval = 420.0
lasercheck.last = 1352623785.897098
lasercheck.last_image = '/data/anfinrud_1211/Data/Laue/PYP/PYP-E46Q-D/PYP-E46Q-D19-263K/beam profile.png'
lasercheck.naverage = 4
lasercheck.park_motors = [u'Phi', u'GonX']
lasercheck.park_positions = [0.0, 3.54432]
lasercheck.reprate = 40.0
lasercheck.retract_sample = True
lasercheck.sample_position = [0.0, 5.0714373125803505]
lasercheck.signal_to_noise = 10.0
lasercheck.xprofile = [(0.6416999999999999, 1.0564516129032258), (0.6370499999999999, 1.0806451612903225), (0.6324, 1.125), (0.6277499999999999, 1.153225806451613), (0.6231, 1.0766129032258065), (0.6184499999999999, 0.9919354838709677), (0.6137999999999999, 0.9193548387096774), (0.60915, 1.0443548387096775), (0.6044999999999999, 1.0584677419354838), (0.59985, 1.0786290322580645), (0.5952, 1.1189516129032258), (0.5905499999999999, 1.185483870967742), (0.5859, 1.1653225806451613), (0.5812499999999999, 1.090725806451613), (0.5766, 1.0625), (0.57195, 1.1330645161290323), (0.5672999999999999, 1.2096774193548387), (0.56265, 1.1754032258064515), (0.5579999999999999, 1.1068548387096775), (0.55335, 1.1189516129032258), (0.5487, 1.0887096774193548), (0.5440499999999999, 1.0786290322580645), (0.5394, 1.096774193548387), (0.53475, 1.1411290322580645), (0.5300999999999999, 1.1935483870967742), (0.52545, 1.2137096774193548), (0.5207999999999999, 1.1512096774193548), (0.51615, 1.1471774193548387), (0.5115, 1.1834677419354838), (0.5068499999999999, 1.1411290322580645), (0.5022, 1.1391129032258065), (0.49754999999999994, 1.1935483870967742), (0.49289999999999995, 1.2762096774193548), (0.48824999999999996, 1.1995967741935485), (0.4836, 1.2580645161290323), (0.47895, 1.3024193548387097), (0.47429999999999994, 1.1975806451612903), (0.46964999999999996, 1.2096774193548387), (0.46499999999999997, 1.2076612903225807), (0.46035, 1.2963709677419355), (0.45569999999999994, 1.2983870967741935), (0.45104999999999995, 1.2439516129032258), (0.44639999999999996, 1.0987903225806452), (0.44175, 1.1169354838709677), (0.4371, 1.2076612903225807), (0.43244999999999995, 1.1915322580645162), (0.42779999999999996, 1.2116935483870968), (0.42314999999999997, 1.217741935483871), (0.4185, 1.2298387096774193), (0.41384999999999994, 1.2762096774193548), (0.40919999999999995, 1.2862903225806452), (0.40454999999999997, 1.3266129032258065), (0.3999, 1.4173387096774193), (0.39525, 1.5383064516129032), (0.39059999999999995, 1.5181451612903225), (0.38594999999999996, 1.4778225806451613), (0.3813, 1.4798387096774193), (0.37665, 1.5221774193548387), (0.372, 1.4939516129032258), (0.36734999999999995, 1.4495967741935485), (0.36269999999999997, 1.409274193548387), (0.35805, 1.3608870967741935), (0.3534, 1.4233870967741935), (0.34874999999999995, 1.3850806451612903), (0.34409999999999996, 1.4536290322580645), (0.33945, 1.3870967741935485), (0.3348, 1.4213709677419355), (0.33015, 1.3931451612903225), (0.32549999999999996, 1.4133064516129032), (0.32084999999999997, 1.4112903225806452), (0.3162, 1.5584677419354838), (0.31155, 1.5806451612903225), (0.30689999999999995, 1.5987903225806452), (0.30224999999999996, 1.6733870967741935), (0.2976, 1.7560483870967742), (0.29295, 1.7883064516129032), (0.2883, 1.875), (0.28364999999999996, 1.9858870967741935), (0.27899999999999997, 2.066532258064516), (0.27435, 2.0745967741935485), (0.2697, 2.088709677419355), (0.26504999999999995, 2.129032258064516), (0.26039999999999996, 2.1794354838709675), (0.25575, 2.129032258064516), (0.2511, 2.0403225806451615), (0.24644999999999997, 1.9858870967741935), (0.2418, 2.0544354838709675), (0.23714999999999997, 2.0826612903225805), (0.23249999999999998, 2.1471774193548385), (0.22784999999999997, 2.1774193548387095), (0.22319999999999998, 2.1875), (0.21855, 2.159274193548387), (0.21389999999999998, 2.2278225806451615), (0.20925, 2.3528225806451615), (0.20459999999999998, 2.524193548387097), (0.19995, 2.7298387096774195), (0.19529999999999997, 3.088709677419355), (0.19065, 3.3205645161290325), (0.186, 3.5766129032258065), (0.18134999999999998, 3.9475806451612905), (0.1767, 4.272177419354839), (0.17204999999999998, 4.598790322580645), (0.1674, 4.846774193548387), (0.16274999999999998, 5.024193548387097), (0.1581, 5.203629032258065), (0.15344999999999998, 5.350806451612903), (0.1488, 5.455645161290323), (0.14415, 5.419354838709677), (0.13949999999999999, 5.397177419354839), (0.13485, 5.407258064516129), (0.13019999999999998, 5.5), (0.12555, 5.604838709677419), (0.1209, 5.887096774193548), (0.11624999999999999, 6.110887096774194), (0.11159999999999999, 6.516129032258065), (0.10694999999999999, 7.225806451612903), (0.10229999999999999, 7.983870967741935), (0.09764999999999999, 8.852822580645162), (0.093, 10.046370967741936), (0.08835, 11.328629032258064), (0.0837, 12.94758064516129), (0.07905, 14.534274193548388), (0.0744, 16.635080645161292), (0.06974999999999999, 18.798387096774192), (0.06509999999999999, 21.260080645161292), (0.06045, 23.618951612903224), (0.055799999999999995, 26.429435483870968), (0.051149999999999994, 29.094758064516128), (0.0465, 31.81048387096774), (0.04185, 34.185483870967744), (0.0372, 36.600806451612904), (0.032549999999999996, 38.743951612903224), (0.027899999999999998, 40.61693548387097), (0.02325, 41.95967741935484), (0.0186, 42.80241935483871), (0.013949999999999999, 42.98588709677419), (0.0093, 42.75403225806452), (0.00465, 42.002016129032256), (0.0, 40.79032258064516), (-0.00465, 39.122983870967744), (-0.0093, 37.24193548387097), (-0.013949999999999999, 34.88508064516129), (-0.0186, 32.506048387096776), (-0.02325, 29.870967741935484), (-0.027899999999999998, 27.266129032258064), (-0.032549999999999996, 24.449596774193548), (-0.0372, 21.72782258064516), (-0.04185, 19.197580645161292), (-0.0465, 16.838709677419356), (-0.051149999999999994, 14.491935483870968), (-0.055799999999999995, 12.34475806451613), (-0.06045, 10.262096774193548), (-0.06509999999999999, 8.683467741935484), (-0.06974999999999999, 7.258064516129032), (-0.0744, 6.256048387096774), (-0.07905, 5.229838709677419), (-0.0837, 4.844758064516129), (-0.08835, 4.473790322580645), (-0.093, 4.350806451612903), (-0.09764999999999999, 4.272177419354839), (-0.10229999999999999, 4.44758064516129), (-0.10694999999999999, 4.556451612903226), (-0.11159999999999999, 4.713709677419355), (-0.11624999999999999, 4.80241935483871), (-0.1209, 4.840725806451613), (-0.12555, 4.834677419354839), (-0.13019999999999998, 4.776209677419355), (-0.13485, 4.643145161290323), (-0.13949999999999999, 4.465725806451613), (-0.14415, 4.143145161290323), (-0.1488, 3.901209677419355), (-0.15344999999999998, 3.6794354838709675), (-0.1581, 3.372983870967742), (-0.16274999999999998, 3.026209677419355), (-0.1674, 2.776209677419355), (-0.17204999999999998, 2.560483870967742), (-0.1767, 2.278225806451613), (-0.18134999999999998, 2.002016129032258), (-0.186, 1.8790322580645162), (-0.19065, 1.7661290322580645), (-0.19529999999999997, 1.7600806451612903), (-0.19995, 1.6633064516129032), (-0.20459999999999998, 1.6411290322580645), (-0.20925, 1.6653225806451613), (-0.21389999999999998, 1.75), (-0.21855, 1.7983870967741935), (-0.22319999999999998, 1.8548387096774193), (-0.22784999999999997, 1.8366935483870968), (-0.23249999999999998, 1.7137096774193548), (-0.23714999999999997, 1.784274193548387), (-0.2418, 1.9133064516129032), (-0.24644999999999997, 1.8548387096774193), (-0.2511, 1.8286290322580645), (-0.25575, 1.7923387096774193), (-0.26039999999999996, 1.7116935483870968), (-0.26504999999999995, 1.5846774193548387), (-0.2697, 1.5241935483870968), (-0.27435, 1.471774193548387), (-0.27899999999999997, 1.469758064516129), (-0.28364999999999996, 1.3487903225806452), (-0.2883, 1.2963709677419355), (-0.29295, 1.2681451612903225), (-0.2976, 1.4153225806451613), (-0.30224999999999996, 1.3810483870967742), (-0.30689999999999995, 1.340725806451613), (-0.31155, 1.2681451612903225), (-0.3162, 1.3548387096774193), (-0.32084999999999997, 1.3366935483870968), (-0.32549999999999996, 1.340725806451613), (-0.33015, 1.3508064516129032), (-0.3348, 1.340725806451613), (-0.33945, 1.377016129032258), (-0.34409999999999996, 1.403225806451613), (-0.34874999999999995, 1.5), (-0.3534, 1.5564516129032258), (-0.35805, 1.465725806451613), (-0.36269999999999997, 1.4415322580645162), (-0.36734999999999995, 1.3991935483870968), (-0.372, 1.344758064516129), (-0.37665, 1.185483870967742), (-0.3813, 1.185483870967742), (-0.38594999999999996, 1.0806451612903225), (-0.39059999999999995, 1.1350806451612903), (-0.39525, 1.094758064516129), (-0.3999, 1.0826612903225807), (-0.40454999999999997, 1.0423387096774193), (-0.40919999999999995, 1.1431451612903225), (-0.41384999999999994, 1.153225806451613), (-0.4185, 1.1068548387096775), (-0.42314999999999997, 1.090725806451613), (-0.42779999999999996, 1.189516129032258), (-0.43244999999999995, 1.2237903225806452), (-0.4371, 1.2580645161290323), (-0.44175, 1.2379032258064515), (-0.44639999999999996, 1.3185483870967742), (-0.45104999999999995, 1.3165322580645162), (-0.45569999999999994, 1.284274193548387), (-0.46035, 1.2439516129032258), (-0.46499999999999997, 1.2560483870967742), (-0.46964999999999996, 1.2641129032258065), (-0.47429999999999994, 1.2076612903225807), (-0.47895, 1.1370967741935485), (-0.4836, 1.092741935483871), (-0.48824999999999996, 0.9778225806451613), (-0.49289999999999995, 0.9334677419354839), (-0.49754999999999994, 1.0685483870967742), (-0.5022, 1.060483870967742), (-0.5068499999999999, 1.032258064516129), (-0.5115, 1.0181451612903225), (-0.51615, 0.9375), (-0.5207999999999999, 0.9294354838709677), (-0.52545, 0.9193548387096774), (-0.5300999999999999, 1.0262096774193548), (-0.53475, 1.0725806451612903), (-0.5394, 1.1068548387096775), (-0.5440499999999999, 1.159274193548387), (-0.5487, 1.159274193548387), (-0.55335, 1.1189516129032258), (-0.5579999999999999, 1.0383064516129032), (-0.56265, 1.0524193548387097), (-0.5672999999999999, 1.0866935483870968), (-0.57195, 1.0887096774193548), (-0.5766, 1.1008064516129032), (-0.5812499999999999, 1.096774193548387), (-0.5859, 1.0100806451612903), (-0.5905499999999999, 0.9959677419354839)]
lasercheck.zprofile = [(-1.1159999999999999, 1.3796992481203008), (-1.1113499999999998, 1.4022556390977443), (-1.1067, 1.3646616541353382), (-1.10205, 1.3909774436090225), (-1.0974, 1.4473684210526316), (-1.0927499999999999, 1.3984962406015038), (-1.0880999999999998, 1.4586466165413534), (-1.0834499999999998, 1.5263157894736843), (-1.0788, 1.5), (-1.07415, 1.537593984962406), (-1.0695, 1.5526315789473684), (-1.0648499999999999, 1.5451127819548873), (-1.0601999999999998, 1.593984962406015), (-1.05555, 1.5037593984962405), (-1.0509, 1.4548872180451127), (-1.04625, 1.443609022556391), (-1.0415999999999999, 1.5338345864661653), (-1.0369499999999998, 1.5977443609022557), (-1.0323, 1.6090225563909775), (-1.02765, 1.537593984962406), (-1.023, 1.5488721804511278), (-1.0183499999999999, 1.5), (-1.0136999999999998, 1.4924812030075187), (-1.00905, 1.5451127819548873), (-1.0044, 1.5977443609022557), (-0.9997499999999999, 1.7218045112781954), (-0.9950999999999999, 1.8120300751879699), (-0.9904499999999999, 1.7030075187969924), (-0.9857999999999999, 1.631578947368421), (-0.98115, 1.7406015037593985), (-0.9764999999999999, 1.556390977443609), (-0.9718499999999999, 1.6541353383458646), (-0.9672, 1.7744360902255638), (-0.9625499999999999, 1.849624060150376), (-0.9579, 1.7255639097744362), (-0.9532499999999999, 1.7030075187969924), (-0.9485999999999999, 1.6879699248120301), (-0.94395, 1.744360902255639), (-0.9392999999999999, 1.8421052631578947), (-0.9346499999999999, 1.849624060150376), (-0.9299999999999999, 1.7857142857142858), (-0.9253499999999999, 1.7255639097744362), (-0.9207, 1.7481203007518797), (-0.9160499999999999, 1.7669172932330828), (-0.9113999999999999, 1.6203007518796992), (-0.90675, 1.6917293233082706), (-0.9020999999999999, 1.6879699248120301), (-0.89745, 1.7518796992481203), (-0.8927999999999999, 1.7330827067669172), (-0.8881499999999999, 1.8195488721804511), (-0.8835, 1.8458646616541354), (-0.8788499999999999, 1.9022556390977443), (-0.8742, 1.8984962406015038), (-0.8695499999999999, 1.849624060150376), (-0.8648999999999999, 1.8609022556390977), (-0.86025, 1.7669172932330828), (-0.8555999999999999, 1.868421052631579), (-0.85095, 1.9774436090225564), (-0.8462999999999999, 2.007518796992481), (-0.8416499999999999, 1.9661654135338347), (-0.837, 1.8195488721804511), (-0.8323499999999999, 1.7932330827067668), (-0.8276999999999999, 1.8759398496240602), (-0.82305, 2.0225563909774436), (-0.8183999999999999, 1.9849624060150375), (-0.81375, 2.018796992481203), (-0.8090999999999999, 1.9774436090225564), (-0.8044499999999999, 1.8609022556390977), (-0.7998, 1.7255639097744362), (-0.7951499999999999, 1.9022556390977443), (-0.7905, 1.981203007518797), (-0.7858499999999999, 2.026315789473684), (-0.7811999999999999, 2.030075187969925), (-0.77655, 1.9962406015037595), (-0.7718999999999999, 2.06390977443609), (-0.76725, 1.9248120300751879), (-0.7626, 1.8195488721804511), (-0.7579499999999999, 1.9473684210526316), (-0.7533, 1.913533834586466), (-0.7486499999999999, 1.9736842105263157), (-0.744, 1.9511278195488722), (-0.73935, 2.011278195488722), (-0.7346999999999999, 1.9962406015037595), (-0.73005, 1.9924812030075187), (-0.7253999999999999, 1.9887218045112782), (-0.7207499999999999, 2.0413533834586466), (-0.7161, 2.1278195488721803), (-0.7114499999999999, 2.218045112781955), (-0.7068, 2.300751879699248), (-0.7021499999999999, 2.2142857142857144), (-0.6974999999999999, 2.2293233082706765), (-0.69285, 2.142857142857143), (-0.6881999999999999, 2.1842105263157894), (-0.68355, 2.3345864661654137), (-0.6789, 2.4398496240601504), (-0.6742499999999999, 2.300751879699248), (-0.6696, 2.43609022556391), (-0.6649499999999999, 2.4473684210526314), (-0.6603, 2.443609022556391), (-0.65565, 2.319548872180451), (-0.6509999999999999, 2.454887218045113), (-0.64635, 2.5601503759398496), (-0.6416999999999999, 2.7406015037593985), (-0.6370499999999999, 2.763157894736842), (-0.6324, 2.601503759398496), (-0.6277499999999999, 2.6203007518796992), (-0.6231, 2.511278195488722), (-0.6184499999999999, 2.530075187969925), (-0.6137999999999999, 2.601503759398496), (-0.60915, 2.7030075187969924), (-0.6044999999999999, 2.8157894736842106), (-0.59985, 2.8496240601503757), (-0.5952, 2.8759398496240602), (-0.5905499999999999, 2.9022556390977443), (-0.5859, 3.018796992481203), (-0.5812499999999999, 3.011278195488722), (-0.5766, 3.112781954887218), (-0.57195, 3.3721804511278197), (-0.5672999999999999, 3.417293233082707), (-0.56265, 3.492481203007519), (-0.5579999999999999, 3.5413533834586466), (-0.55335, 3.492481203007519), (-0.5487, 3.593984962406015), (-0.5440499999999999, 3.781954887218045), (-0.5394, 3.8796992481203008), (-0.53475, 3.973684210526316), (-0.5300999999999999, 4.142857142857143), (-0.52545, 4.154135338345864), (-0.5207999999999999, 4.165413533834586), (-0.51615, 4.2556390977443606), (-0.5115, 4.274436090225564), (-0.5068499999999999, 4.428571428571429), (-0.5022, 4.447368421052632), (-0.49754999999999994, 4.511278195488722), (-0.49289999999999995, 4.567669172932331), (-0.48824999999999996, 4.68796992481203), (-0.4836, 4.695488721804511), (-0.47895, 4.804511278195489), (-0.47429999999999994, 4.962406015037594), (-0.46964999999999996, 5.2481203007518795), (-0.46499999999999997, 5.387218045112782), (-0.46035, 5.469924812030075), (-0.45569999999999994, 5.567669172932331), (-0.45104999999999995, 5.533834586466165), (-0.44639999999999996, 5.496240601503759), (-0.44175, 5.609022556390977), (-0.4371, 5.714285714285714), (-0.43244999999999995, 5.774436090225564), (-0.42779999999999996, 5.823308270676692), (-0.42314999999999997, 5.853383458646617), (-0.4185, 5.68796992481203), (-0.41384999999999994, 5.868421052631579), (-0.40919999999999995, 5.943609022556391), (-0.40454999999999997, 6.037593984962406), (-0.3999, 6.150375939849624), (-0.39525, 6.421052631578948), (-0.39059999999999995, 6.578947368421052), (-0.38594999999999996, 6.605263157894737), (-0.3813, 6.601503759398496), (-0.37665, 6.7293233082706765), (-0.372, 6.6992481203007515), (-0.36734999999999995, 6.924812030075188), (-0.36269999999999997, 7.071428571428571), (-0.35805, 7.180451127819549), (-0.3534, 7.225563909774436), (-0.34874999999999995, 7.319548872180451), (-0.34409999999999996, 7.2105263157894735), (-0.33945, 7.390977443609023), (-0.3348, 7.601503759398496), (-0.33015, 7.7518796992481205), (-0.32549999999999996, 8.052631578947368), (-0.32084999999999997, 8.428571428571429), (-0.3162, 8.612781954887218), (-0.31155, 8.894736842105264), (-0.30689999999999995, 9.097744360902256), (-0.30224999999999996, 9.236842105263158), (-0.2976, 9.357142857142858), (-0.29295, 9.68421052631579), (-0.2883, 9.966165413533835), (-0.28364999999999996, 10.30451127819549), (-0.27899999999999997, 10.25187969924812), (-0.27435, 10.466165413533835), (-0.2697, 10.545112781954888), (-0.26504999999999995, 10.703007518796992), (-0.26039999999999996, 10.8796992481203), (-0.25575, 11.289473684210526), (-0.2511, 11.338345864661655), (-0.24644999999999997, 11.61654135338346), (-0.2418, 11.672932330827068), (-0.23714999999999997, 11.75563909774436), (-0.23249999999999998, 11.68796992481203), (-0.22784999999999997, 11.921052631578947), (-0.22319999999999998, 12.172932330827068), (-0.21855, 12.492481203007518), (-0.21389999999999998, 12.571428571428571), (-0.20925, 12.766917293233083), (-0.20459999999999998, 12.729323308270677), (-0.19995, 12.823308270676693), (-0.19529999999999997, 12.906015037593985), (-0.19065, 12.966165413533835), (-0.186, 12.996240601503759), (-0.18134999999999998, 13.06766917293233), (-0.1767, 13.048872180451127), (-0.17204999999999998, 13.218045112781954), (-0.1674, 13.214285714285714), (-0.16274999999999998, 13.25563909774436), (-0.1581, 13.18796992481203), (-0.15344999999999998, 13.293233082706767), (-0.1488, 13.38345864661654), (-0.14415, 13.736842105263158), (-0.13949999999999999, 13.793233082706767), (-0.13485, 14.086466165413533), (-0.13019999999999998, 14.289473684210526), (-0.12555, 14.454887218045112), (-0.1209, 14.447368421052632), (-0.11624999999999999, 14.597744360902256), (-0.11159999999999999, 14.62781954887218), (-0.10694999999999999, 14.661654135338345), (-0.10229999999999999, 14.62781954887218), (-0.09764999999999999, 14.74436090225564), (-0.093, 14.639097744360901), (-0.08835, 14.796992481203008), (-0.0837, 14.887218045112782), (-0.07905, 15.052631578947368), (-0.0744, 15.063909774436091), (-0.06974999999999999, 15.19548872180451), (-0.06509999999999999, 15.06766917293233), (-0.06045, 15.206766917293233), (-0.055799999999999995, 15.18796992481203), (-0.051149999999999994, 15.221804511278195), (-0.0465, 15.12406015037594), (-0.04185, 15.078947368421053), (-0.0372, 15.191729323308271), (-0.032549999999999996, 15.43984962406015), (-0.027899999999999998, 15.353383458646617), (-0.02325, 15.259398496240602), (-0.0186, 15.334586466165414), (-0.013949999999999999, 15.349624060150376), (-0.0093, 15.18796992481203), (-0.00465, 15.274436090225564), (0.0, 15.045112781954888), (0.00465, 14.984962406015038), (0.0093, 15.007518796992482), (0.013949999999999999, 15.041353383458647), (0.0186, 15.011278195488721), (0.02325, 15.191729323308271), (0.027899999999999998, 15.063909774436091), (0.032549999999999996, 15.06015037593985), (0.0372, 14.977443609022556), (0.04185, 14.943609022556391), (0.0465, 14.770676691729323), (0.051149999999999994, 14.785714285714286), (0.055799999999999995, 14.706766917293233), (0.06045, 14.593984962406015), (0.06509999999999999, 14.473684210526315), (0.06974999999999999, 14.458646616541353), (0.0744, 14.360902255639099), (0.07905, 14.37218045112782), (0.0837, 14.206766917293233), (0.08835, 14.233082706766917), (0.093, 14.214285714285714), (0.09764999999999999, 14.229323308270677), (0.10229999999999999, 14.157894736842104), (0.10694999999999999, 14.31578947368421), (0.11159999999999999, 14.203007518796992), (0.11624999999999999, 14.105263157894736), (0.1209, 13.808270676691729), (0.12555, 13.710526315789474), (0.13019999999999998, 13.642857142857142), (0.13485, 13.488721804511279), (0.13949999999999999, 13.266917293233083), (0.14415, 13.1203007518797), (0.1488, 12.823308270676693), (0.15344999999999998, 12.793233082706767), (0.1581, 12.650375939849624), (0.16274999999999998, 12.590225563909774), (0.1674, 12.428571428571429), (0.17204999999999998, 12.43984962406015), (0.1767, 12.409774436090226), (0.18134999999999998, 12.097744360902256), (0.186, 11.665413533834586), (0.19065, 11.278195488721805), (0.19529999999999997, 11.172932330827068), (0.19995, 11.12781954887218), (0.20459999999999998, 10.954887218045112), (0.20925, 10.830827067669173), (0.21389999999999998, 10.631578947368421), (0.21855, 10.436090225563909), (0.22319999999999998, 10.150375939849624), (0.22784999999999997, 9.909774436090226), (0.23249999999999998, 9.597744360902256), (0.23714999999999997, 9.424812030075188), (0.2418, 9.300751879699249), (0.24644999999999997, 9.191729323308271), (0.2511, 8.800751879699249), (0.25575, 8.477443609022556), (0.26039999999999996, 8.477443609022556), (0.26504999999999995, 8.406015037593985), (0.2697, 8.274436090225564), (0.27435, 8.003759398496241), (0.27899999999999997, 7.774436090225564), (0.28364999999999996, 7.7518796992481205), (0.2883, 7.605263157894737), (0.29295, 7.616541353383458), (0.2976, 7.515037593984962), (0.30224999999999996, 7.451127819548872), (0.30689999999999995, 7.161654135338346), (0.31155, 7.067669172932331), (0.3162, 7.030075187969925), (0.32084999999999997, 7.003759398496241), (0.32549999999999996, 6.7481203007518795), (0.33015, 6.654135338345864), (0.3348, 6.402255639097745), (0.33945, 6.2781954887218046), (0.34409999999999996, 6.075187969924812), (0.34874999999999995, 5.93609022556391), (0.3534, 5.87218045112782), (0.35805, 5.7819548872180455), (0.36269999999999997, 5.518796992481203), (0.36734999999999995, 5.379699248120301), (0.372, 5.349624060150376), (0.37665, 5.338345864661654), (0.3813, 5.139097744360902), (0.38594999999999996, 4.917293233082707), (0.39059999999999995, 4.7180451127819545), (0.39525, 4.650375939849624), (0.3999, 4.345864661654136), (0.40454999999999997, 4.1992481203007515), (0.40919999999999995, 4.109022556390977), (0.41384999999999994, 4.172932330827067), (0.4185, 4.075187969924812), (0.42314999999999997, 3.9473684210526314), (0.42779999999999996, 3.7142857142857144), (0.43244999999999995, 3.518796992481203), (0.4371, 3.4022556390977443), (0.44175, 3.4135338345864663), (0.44639999999999996, 3.255639097744361), (0.45104999999999995, 3.338345864661654), (0.45569999999999994, 3.345864661654135), (0.46035, 3.18796992481203), (0.46499999999999997, 2.917293233082707), (0.46964999999999996, 2.8947368421052633), (0.47429999999999994, 2.8947368421052633), (0.47895, 2.781954887218045), (0.4836, 2.691729323308271), (0.48824999999999996, 2.763157894736842), (0.49289999999999995, 2.6766917293233083), (0.49754999999999994, 2.680451127819549), (0.5022, 2.4774436090225564), (0.5068499999999999, 2.327067669172932), (0.5115, 2.345864661654135), (0.51615, 2.218045112781955), (0.5207999999999999, 2.1240601503759398), (0.52545, 2.191729323308271), (0.5300999999999999, 2.2330827067669174), (0.53475, 2.0977443609022557), (0.5394, 1.9323308270676691), (0.5440499999999999, 1.8721804511278195), (0.5487, 1.8120300751879699), (0.55335, 1.887218045112782), (0.5579999999999999, 1.9248120300751879), (0.56265, 1.8646616541353382), (0.5672999999999999, 1.8796992481203008), (0.57195, 1.7932330827067668), (0.5766, 1.7105263157894737), (0.5812499999999999, 1.5639097744360901), (0.5859, 1.4511278195488722), (0.5905499999999999, 1.5338345864661653), (0.5952, 1.5451127819548873), (0.59985, 1.6804511278195489), (0.6044999999999999, 1.7406015037593985), (0.60915, 1.6278195488721805), (0.6137999999999999, 1.593984962406015), (0.6184499999999999, 1.6729323308270676), (0.6231, 1.6165413533834587), (0.6277499999999999, 1.586466165413534), (0.6324, 1.4398496240601504), (0.6370499999999999, 1.5), (0.6416999999999999, 1.5263157894736843), (0.64635, 1.5263157894736843), (0.6509999999999999, 1.4398496240601504), (0.65565, 1.3796992481203008), (0.6603, 1.4285714285714286), (0.6649499999999999, 1.5075187969924813), (0.6696, 1.5676691729323309), (0.6742499999999999, 1.586466165413534), (0.6789, 1.6240601503759398), (0.68355, 1.6466165413533835), (0.6881999999999999, 1.7067669172932332), (0.69285, 1.6729323308270676), (0.6974999999999999, 1.5639097744360901), (0.7021499999999999, 1.556390977443609), (0.7068, 1.4586466165413534), (0.7114499999999999, 1.5526315789473684), (0.7161, 1.537593984962406), (0.7207499999999999, 1.5526315789473684), (0.7253999999999999, 1.612781954887218), (0.73005, 1.7330827067669172), (0.7346999999999999, 1.6353383458646618), (0.73935, 1.7030075187969924), (0.744, 1.7593984962406015), (0.7486499999999999, 1.755639097744361), (0.7533, 1.6203007518796992), (0.7579499999999999, 1.6766917293233083), (0.7626, 1.5413533834586466), (0.76725, 1.586466165413534), (0.7718999999999999, 1.5488721804511278), (0.77655, 1.6015037593984962), (0.7811999999999999, 1.556390977443609), (0.7858499999999999, 1.5488721804511278), (0.7905, 1.462406015037594), (0.7951499999999999, 1.6090225563909775), (0.7998, 1.7030075187969924), (0.8044499999999999, 1.7969924812030076), (0.8090999999999999, 1.744360902255639), (0.81375, 1.6917293233082706), (0.8183999999999999, 1.5639097744360901), (0.82305, 1.650375939849624), (0.8276999999999999, 1.7067669172932332), (0.8323499999999999, 1.7105263157894737), (0.837, 1.6729323308270676), (0.8416499999999999, 1.7593984962406015), (0.8462999999999999, 1.7481203007518797), (0.85095, 1.6541353383458646), (0.8555999999999999, 1.5488721804511278), (0.86025, 1.6917293233082706), (0.8648999999999999, 1.6165413533834587), (0.8695499999999999, 1.7781954887218046), (0.8742, 1.7894736842105263), (0.8788499999999999, 1.962406015037594), (0.8835, 1.8646616541353382), (0.8881499999999999, 2.0488721804511276), (0.8927999999999999, 1.943609022556391), (0.89745, 1.8571428571428572), (0.9020999999999999, 1.8270676691729324), (0.90675, 1.8383458646616542), (0.9113999999999999, 1.8721804511278195), (0.9160499999999999, 1.9586466165413534), (0.9207, 1.7894736842105263), (0.9253499999999999, 1.7706766917293233), (0.9299999999999999, 1.7593984962406015), (0.9346499999999999, 1.8721804511278195), (0.9392999999999999, 1.8609022556390977), (0.94395, 1.7932330827067668), (0.9485999999999999, 1.8759398496240602), (0.9532499999999999, 1.8571428571428572), (0.9579, 1.8533834586466165), (0.9625499999999999, 1.7857142857142858), (0.9672, 1.736842105263158), (0.9718499999999999, 1.8458646616541354), (0.9764999999999999, 1.8571428571428572), (0.98115, 1.7330827067669172), (0.9857999999999999, 1.8270676691729324), (0.9904499999999999, 1.8571428571428572), (0.9950999999999999, 1.8383458646616542), (0.9997499999999999, 1.699248120300752), (1.0044, 1.6842105263157894), (1.00905, 1.6804511278195489), (1.0136999999999998, 1.5977443609022557), (1.0183499999999999, 1.586466165413534), (1.023, 1.6090225563909775), (1.02765, 1.7894736842105263), (1.0323, 1.6804511278195489), (1.0369499999999998, 1.6278195488721805), (1.0415999999999999, 1.5263157894736843), (1.04625, 1.4849624060150375), (1.0509, 1.5112781954887218), (1.05555, 1.5526315789473684), (1.0601999999999998, 1.481203007518797), (1.0648499999999999, 1.556390977443609), (1.0695, 1.6090225563909775), (1.07415, 1.4661654135338347), (1.0788, 1.3721804511278195), (1.0834499999999998, 1.3270676691729324), (1.0880999999999998, 1.4887218045112782), (1.0927499999999999, 1.5714285714285714), (1.0974, 1.5488721804511278), (1.10205, 1.3646616541353382), (1.1067, 1.330827067669173), (1.1113499999999998, 1.4097744360902256), (1.1159999999999999, 1.387218045112782), (1.12065, 1.5225563909774436), (1.1253, 1.5451127819548873), (1.12995, 1.5075187969924813), (1.1345999999999998, 1.368421052631579), (1.1392499999999999, 1.2142857142857142), (1.1439, 1.1390977443609023), (1.14855, 1.2969924812030076), (1.1532, 1.218045112781955), (1.1578499999999998, 1.2744360902255638), (1.1624999999999999, 1.3195488721804511), (1.16715, 1.368421052631579), (1.1718, 1.244360902255639), (1.17645, 1.1541353383458646), (1.1810999999999998, 1.1804511278195489), (1.1857499999999999, 1.2406015037593985)]
timingcheck.at_start_of_time_series = False
timingcheck.attenuator_angle = 300
timingcheck.comment = 'Timing error -1.33ps, sdev 12.8ps, 19 samples, sampling error 3.02ps'
timingcheck.enabled = False
timingcheck.interval = 420.0
timingcheck.last = 1425686749.14541
timingcheck.min_intensity = 0.1
timingcheck.retract_sample = 0.0
timingcheck.sample_motor = u''
sample_photo.enabled = False
sample_photo.frequency_orientations = 1
sample_photo.phis = (0,)
checklist.U23 = 10.741
checklist.U27 = 15.848
checklist.shg = 0.15
checklist.svg = 0.05
checklist.wbshg = 0.9
checklist.wbsvg = 0.6
| 197.612245
| 18,190
| 0.750981
| 4,904
| 38,732
| 5.895799
| 0.246737
| 0.019126
| 0.023173
| 0.032442
| 0.072908
| 0.059454
| 0.054508
| 0.053056
| 0.050704
| 0.045308
| 0
| 0.641716
| 0.069039
| 38,732
| 195
| 18,191
| 198.625641
| 0.160131
| 0
| 0
| 0
| 0
| 0.010256
| 0.061913
| 0.008159
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.015385
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
089a5477ea68a179666a146dd66ee066201ad4f2
| 5,743
|
py
|
Python
|
firework_program.py
|
korombus/blender_firework_py
|
4faccc3c7acac8c4a668c4735e7d7ec601c86d81
|
[
"MIT"
] | null | null | null |
firework_program.py
|
korombus/blender_firework_py
|
4faccc3c7acac8c4a668c4735e7d7ec601c86d81
|
[
"MIT"
] | null | null | null |
firework_program.py
|
korombus/blender_firework_py
|
4faccc3c7acac8c4a668c4735e7d7ec601c86d81
|
[
"MIT"
] | null | null | null |
firework_program = {
"50": [
{"x": 0, "y": 0},
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"150": [
{"x": 0, "y": 20}
],
"190": [
{"x": 0, "y": 15}
],
"230": [
{"x": 0, "y": 10}
],
"270": [
{"x": 0, "y": 5}
],
"310": [
{"x": 0, "y": 0}
],
"350": [
{"x": 0, "y": -5}
],
"390": [
{"x": 0, "y": -10}
],
"430": [
{"x": 0, "y": -15}
],
"470": [
{"x": 0, "y": -20}
],
"570": [
{"x": 0, "y": -20}
],
"610": [
{"x": 0, "y": -15}
],
"650": [
{"x": 0, "y": -10}
],
"690": [
{"x": 0, "y": -5}
],
"730": [
{"x": 0, "y": 0}
],
"770": [
{"x": 0, "y": 5}
],
"810": [
{"x": 0, "y": 10}
],
"850": [
{"x": 0, "y": 15}
],
"890": [
{"x": 0, "y": 20}
],
"990": [
{"x": 0, "y": 20},
{"x": 0, "y": -20}
],
"1030": [
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"1070": [
{"x": 0, "y": 10},
{"x": 0, "y": -10}
],
"1110": [
{"x": 0, "y": 5},
{"x": 0, "y": -5}
],
"1150": [
{"x": 0, "y": 0}
],
"1250": [
{"x": 0, "y": 0}
],
"1290": [
{"x": 0, "y": 5},
{"x": 0, "y": -5}
],
"1330": [
{"x": 0, "y": 10},
{"x": 0, "y": -10}
],
"1370": [
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"1410": [
{"x": 0, "y": 20},
{"x": 0, "y": -20}
],
"1510": [
{"x": 0, "y": 0},
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"1610": [
{"x": 0, "y": 20}
],
"1630": [
{"x": 0, "y": 15}
],
"1650": [
{"x": 0, "y": 10}
],
"1670": [
{"x": 0, "y": 5}
],
"1690": [
{"x": 0, "y": 0}
],
"1710": [
{"x": 0, "y": -5}
],
"1730": [
{"x": 0, "y": -10}
],
"1750": [
{"x": 0, "y": -15}
],
"1770": [
{"x": 0, "y": -20}
],
"1870": [
{"x": -10, "y": 0},
{"x": -10, "y": 15},
{"x": -10, "y": -15}
],
"1910": [
{"x": 20, "y": 0},
{"x": 20, "y": 28},
{"x": 20, "y": -28}
],
"1950": [
{"x": 90, "y": 0},
{"x": 90, "y": 50},
{"x": 90, "y": 25},
{"x": 90, "y": -50},
{"x": 90, "y": -25}
],
"1990": [
{"x": 20, "y": 0},
{"x": 20, "y": 28},
{"x": 20, "y": -28}
],
"2030": [
{"x": -10, "y": 0},
{"x": -10, "y": 15},
{"x": -10, "y": -15}
],
"2130": [
{"x": 0, "y": 20},
{"x": 0, "y": -20}
],
"2150": [
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"2170": [
{"x": 0, "y": 10},
{"x": 0, "y": -10}
],
"2190": [
{"x": 0, "y": 5},
{"x": 0, "y": -5}
],
"2210": [
{"x": 0, "y": 0}
],
"2310": [
{"x": 0, "y": 0}
],
"2330": [
{"x": 0, "y": 5},
{"x": 0, "y": -5}
],
"2350": [
{"x": 0, "y": 10},
{"x": 0, "y": -10}
],
"2370": [
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"2390": [
{"x": 0, "y": 20},
{"x": 0, "y": -20}
],
"2490": [
{"x": 0, "y": 0},
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"2590": [
{"x": 90, "y": 50},
{"x": 90, "y": -50}
],
"2610": [
{"x": 70, "y": 35},
{"x": 70, "y": -35}
],
"2630": [
{"x": 40, "y": 20},
{"x": 40, "y": -20}
],
"2650": [
{"x": 20, "y": 10},
{"x": 20, "y": -10}
],
"2670": [
{"x": 5, "y": 5},
{"x": 5, "y": -5}
],
"2690": [
{"x": -10, "y": 0}
],
"2790": [
{"x": -10, "y": 0}
],
"2810": [
{"x": 5, "y": 5},
{"x": 5, "y": -5}
],
"2830": [
{"x": 20, "y": 10},
{"x": 20, "y": -10}
],
"2850": [
{"x": 40, "y": 20},
{"x": 40, "y": -20}
],
"2870": [
{"x": 70, "y": 35},
{"x": 70, "y": -35}
],
"2890": [
{"x": 90, "y": 50},
{"x": 90, "y": -50}
],
"2910": [
{"x": 0, "y": 0},
{"x": 0, "y": 15},
{"x": 0, "y": -15}
],
"3010": [
{"x": 0, "y": 20}
],
"3020": [
{"x": 0, "y": -15}
],
"3030": [
{"x": 0, "y": 10}
],
"3040": [
{"x": 0, "y": -5}
],
"3050": [
{"x": 0, "y": 0}
],
"3060": [
{"x": 0, "y": 5}
],
"3070": [
{"x": 0, "y": -10}
],
"3080": [
{"x": 0, "y": 15}
],
"3090": [
{"x": 0, "y": -20}
],
"3190": [
{"x": 0, "y": -20}
],
"3200": [
{"x": 0, "y": 15}
],
"3210": [
{"x": 0, "y": -10}
],
"3220": [
{"x": 0, "y": 5}
],
"3230": [
{"x": 0, "y": 0}
],
"3240": [
{"x": 0, "y": -5}
],
"3250": [
{"x": 0, "y": 10}
],
"3260": [
{"x": 0, "y": -15}
],
"3270": [
{"x": 0, "y": 20}
],
"3370": [
{"x": 90, "y": 0},
{"x": 90, "y": 50},
{"x": 90, "y": 25},
{"x": 90, "y": -50},
{"x": 90, "y": -25}
],
"3410": [
{"x": 20, "y": 14},
{"x": 20, "y": -14},
{"x": 20, "y": 28},
{"x": 20, "y": -28}
],
"3450": [
{"x": -10, "y": 0},
{"x": -10, "y": 15},
{"x": -10, "y": -15}
]
}
| 17.725309
| 28
| 0.18701
| 667
| 5,743
| 1.608696
| 0.157421
| 0.173346
| 0.260019
| 0.121156
| 0.453868
| 0.453868
| 0.453868
| 0.442684
| 0.185461
| 0.185461
| 0
| 0.253874
| 0.471879
| 5,743
| 324
| 29
| 17.725309
| 0.099901
| 0
| 0
| 0.709877
| 0
| 0
| 0.108461
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
08ae63b31e4b90b041eef904dfc35380a6e4431c
| 44
|
py
|
Python
|
pre_extra_script.py
|
oskrs111/diy-co2-monitior
|
ca72bf613421732216da5af8359749af52bb49c3
|
[
"MIT"
] | 8
|
2020-11-03T09:51:59.000Z
|
2021-09-20T05:01:42.000Z
|
pre_extra_script.py
|
oskrs111/diy-co2-monitior
|
ca72bf613421732216da5af8359749af52bb49c3
|
[
"MIT"
] | 2
|
2020-11-29T08:11:41.000Z
|
2021-01-24T19:21:00.000Z
|
pre_extra_script.py
|
oskrs111/diy-co2-monitior
|
ca72bf613421732216da5af8359749af52bb49c3
|
[
"MIT"
] | 3
|
2020-11-19T12:06:42.000Z
|
2021-02-05T10:31:57.000Z
|
import os
os.system("node ./www/2header.js")
| 22
| 34
| 0.727273
| 8
| 44
| 4
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02439
| 0.068182
| 44
| 2
| 34
| 22
| 0.756098
| 0
| 0
| 0
| 0
| 0
| 0.466667
| 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
|
08e4a947174bc25f787e36630a1d2d8f83289d8b
| 821
|
py
|
Python
|
server.py
|
meugur/browser-script-caching
|
5ed7358645cc2db6f25641bda2efa11e74839789
|
[
"MIT"
] | null | null | null |
server.py
|
meugur/browser-script-caching
|
5ed7358645cc2db6f25641bda2efa11e74839789
|
[
"MIT"
] | null | null | null |
server.py
|
meugur/browser-script-caching
|
5ed7358645cc2db6f25641bda2efa11e74839789
|
[
"MIT"
] | null | null | null |
from flask import Flask, render_template, send_from_directory
app = Flask(__name__, static_url_path='')
@app.route('/')
def index():
return "Testing server"
@app.route('/test-scripts')
def test_scripts():
return render_template('test-scripts.html')
@app.route('/test-scripts-async')
def test_scripts_async():
return render_template('test-scripts-async.html')
@app.route('/test-scripts-mixed')
def test_scripts_mixed():
return render_template('test-scripts-mixed.html')
@app.route('/test-scripts-defer')
def test_scripts_defer():
return render_template('test-scripts-defer.html')
@app.route('/test-scripts-dynamic')
def test_scripts_dynamic():
return render_template('test-scripts-dynamic.html')
@app.route('/js/<path:path>')
def serve_js(path):
return send_from_directory('js', path)
| 24.878788
| 61
| 0.735688
| 114
| 821
| 5.070175
| 0.236842
| 0.285467
| 0.103806
| 0.16436
| 0.427336
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102314
| 821
| 32
| 62
| 25.65625
| 0.784261
| 0
| 0
| 0
| 0
| 0
| 0.285366
| 0.140244
| 0
| 0
| 0
| 0
| 0
| 1
| 0.304348
| false
| 0
| 0.043478
| 0.304348
| 0.652174
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
3ea78d9efdfd47e17a5972ec844bae1e80375a9a
| 161
|
py
|
Python
|
tests.py
|
fossabot/upsidedown
|
a6f06fc8be5bfb7a58859f110cfd07d230e46dd5
|
[
"MIT"
] | 23
|
2015-03-22T07:44:53.000Z
|
2022-03-04T07:55:43.000Z
|
tests.py
|
fossabot/upsidedown
|
a6f06fc8be5bfb7a58859f110cfd07d230e46dd5
|
[
"MIT"
] | 4
|
2015-06-10T22:37:45.000Z
|
2019-12-15T19:06:52.000Z
|
tests.py
|
fossabot/upsidedown
|
a6f06fc8be5bfb7a58859f110cfd07d230e46dd5
|
[
"MIT"
] | 5
|
2016-04-11T20:22:03.000Z
|
2020-04-30T20:09:18.000Z
|
from __future__ import unicode_literals
import upsidedown
assert upsidedown.transform('Hello there') == '\u01dd\u0279\u01dd\u0265\u0287 o\ua781\ua781\u01ddH';
| 26.833333
| 100
| 0.801242
| 21
| 161
| 5.904762
| 0.809524
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163265
| 0.086957
| 161
| 5
| 101
| 32.2
| 0.680272
| 0
| 0
| 0
| 0
| 0
| 0.385093
| 0.186335
| 0
| 0
| 0
| 0
| 0.333333
| 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
|
3ef158b98ce77d0529bb77b2f9534ccfdd46909a
| 159
|
py
|
Python
|
ark/main.py
|
YannickSF/Ark
|
2d2c20348a19354ee2c9eca474af8694778fc14d
|
[
"MIT"
] | null | null | null |
ark/main.py
|
YannickSF/Ark
|
2d2c20348a19354ee2c9eca474af8694778fc14d
|
[
"MIT"
] | null | null | null |
ark/main.py
|
YannickSF/Ark
|
2d2c20348a19354ee2c9eca474af8694778fc14d
|
[
"MIT"
] | null | null | null |
from ark.core.ark import Ark
from ark.core.ark_index import ArkIndex
if __name__ == '__main__':
db = Ark()
db.__add__('self')
index = ArkIndex()
| 17.666667
| 39
| 0.666667
| 23
| 159
| 4.043478
| 0.521739
| 0.150538
| 0.236559
| 0.301075
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.207547
| 159
| 8
| 40
| 19.875
| 0.738095
| 0
| 0
| 0
| 0
| 0
| 0.075949
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
410fc6c3e992c3452b379b1329a80aebdfcb42a1
| 191
|
py
|
Python
|
mayan/apps/mirroring/literals.py
|
nattangwiwat/Mayan-EDMS-recitation
|
fcf16afb56eae812fb99144d65ae1ae6749de0b7
|
[
"Apache-2.0"
] | 343
|
2015-01-05T14:19:35.000Z
|
2018-12-10T19:07:48.000Z
|
mayan/apps/mirroring/literals.py
|
nattangwiwat/Mayan-EDMS-recitation
|
fcf16afb56eae812fb99144d65ae1ae6749de0b7
|
[
"Apache-2.0"
] | 191
|
2015-01-03T00:48:19.000Z
|
2018-11-30T09:10:25.000Z
|
mayan/apps/mirroring/literals.py
|
nattangwiwat/Mayan-EDMS-recitation
|
fcf16afb56eae812fb99144d65ae1ae6749de0b7
|
[
"Apache-2.0"
] | 257
|
2019-05-14T10:26:37.000Z
|
2022-03-30T03:37:36.000Z
|
DEFAULT_MIRRORING_DOCUMENT_CACHE_LOOKUP_TIMEOUT = 10
DEFAULT_MIRRORING_NODE_CACHE_LOOKUP_TIMEOUT = 10
FILE_MODE = DIRECTORY_MODE = 0o555
MAX_FILE_DESCRIPTOR = 65535
MIN_FILE_DESCRIPTOR = 0
| 23.875
| 52
| 0.86911
| 27
| 191
| 5.555556
| 0.62963
| 0.213333
| 0.24
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081395
| 0.099476
| 191
| 7
| 53
| 27.285714
| 0.790698
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
412283a5eeadac9e3547d4c6b563f783516d71d3
| 141
|
py
|
Python
|
veyon/PySwitchTracer/servers/flask_/slaver/receptorView/view.py
|
IzayoiRin/VirtualVeyonST
|
d0c4035dba81d02135ad54f4c5a5d463e95f7925
|
[
"MIT"
] | null | null | null |
veyon/PySwitchTracer/servers/flask_/slaver/receptorView/view.py
|
IzayoiRin/VirtualVeyonST
|
d0c4035dba81d02135ad54f4c5a5d463e95f7925
|
[
"MIT"
] | null | null | null |
veyon/PySwitchTracer/servers/flask_/slaver/receptorView/view.py
|
IzayoiRin/VirtualVeyonST
|
d0c4035dba81d02135ad54f4c5a5d463e95f7925
|
[
"MIT"
] | null | null | null |
from servers.flask_.slaver.receptorView import bp
@bp.route("/receptor", methods=["GET"])
def receptor():
return "Hello from Receptor"
| 20.142857
| 49
| 0.723404
| 18
| 141
| 5.611111
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12766
| 141
| 6
| 50
| 23.5
| 0.821138
| 0
| 0
| 0
| 0
| 0
| 0.219858
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
f5c01e93ffcf4a3964189c97d37fb4f67c63befc
| 173
|
py
|
Python
|
dbt/adapters/bigquery/__init__.py
|
cpdean/dbt
|
c19a42625a3e1dcb42f2bf865541c75f3595503c
|
[
"Apache-2.0"
] | 1
|
2018-06-20T17:51:20.000Z
|
2018-06-20T17:51:20.000Z
|
dbt/adapters/bigquery/__init__.py
|
cpdean/dbt
|
c19a42625a3e1dcb42f2bf865541c75f3595503c
|
[
"Apache-2.0"
] | null | null | null |
dbt/adapters/bigquery/__init__.py
|
cpdean/dbt
|
c19a42625a3e1dcb42f2bf865541c75f3595503c
|
[
"Apache-2.0"
] | 1
|
2018-10-18T18:45:38.000Z
|
2018-10-18T18:45:38.000Z
|
from dbt.adapters.bigquery.impl import BigQueryAdapter
from dbt.adapters.bigquery.relation import BigQueryRelation
__all__ = [
BigQueryAdapter,
BigQueryRelation,
]
| 21.625
| 59
| 0.803468
| 17
| 173
| 7.941176
| 0.588235
| 0.103704
| 0.222222
| 0.340741
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132948
| 173
| 7
| 60
| 24.714286
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
eb28edaf509c96c61e3ceda3ee421a54e4ec3672
| 93
|
py
|
Python
|
fortiori/transpiler.py
|
keotl/fortiori
|
9a1dee15d627c0cce5bd4dbea83157a2c1e3a4f8
|
[
"MIT"
] | 1
|
2020-06-23T16:48:32.000Z
|
2020-06-23T16:48:32.000Z
|
fortiori/transpiler.py
|
keotl/fortiori
|
9a1dee15d627c0cce5bd4dbea83157a2c1e3a4f8
|
[
"MIT"
] | null | null | null |
fortiori/transpiler.py
|
keotl/fortiori
|
9a1dee15d627c0cce5bd4dbea83157a2c1e3a4f8
|
[
"MIT"
] | null | null | null |
class Transpiler(object):
def __init__(self, target: str):
self.target = target
| 18.6
| 36
| 0.655914
| 11
| 93
| 5.181818
| 0.727273
| 0.350877
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.236559
| 93
| 4
| 37
| 23.25
| 0.802817
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
eb3e79bff92398174e6c06a2595786a6bdc910f3
| 138
|
py
|
Python
|
theme/admin.py
|
sajib1066/django-portfolio-cms
|
346b5e69a60104d5286a56b329b877e7c37596e3
|
[
"MIT"
] | null | null | null |
theme/admin.py
|
sajib1066/django-portfolio-cms
|
346b5e69a60104d5286a56b329b877e7c37596e3
|
[
"MIT"
] | 3
|
2021-06-09T17:51:40.000Z
|
2022-03-12T00:31:00.000Z
|
theme/admin.py
|
sajib1066/django-portfolio-cms
|
346b5e69a60104d5286a56b329b877e7c37596e3
|
[
"MIT"
] | 4
|
2021-02-08T07:03:45.000Z
|
2021-09-01T05:23:52.000Z
|
from django.contrib import admin
from .models import Theme, SelectedTheme
admin.site.register(Theme)
admin.site.register(SelectedTheme)
| 19.714286
| 40
| 0.826087
| 18
| 138
| 6.333333
| 0.555556
| 0.157895
| 0.298246
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094203
| 138
| 6
| 41
| 23
| 0.912
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 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
|
deca24fc28d91227b6ccd3b5cca8448179eec3c6
| 2,105
|
py
|
Python
|
tests/server/api/v1/test_metadata_mixin.py
|
alexschiller/waterbutler
|
24014d7705aca3e99a6565fc3b9b4075ec6ec563
|
[
"Apache-2.0"
] | null | null | null |
tests/server/api/v1/test_metadata_mixin.py
|
alexschiller/waterbutler
|
24014d7705aca3e99a6565fc3b9b4075ec6ec563
|
[
"Apache-2.0"
] | 1
|
2017-11-29T20:28:35.000Z
|
2017-11-29T20:28:35.000Z
|
tests/server/api/v1/test_metadata_mixin.py
|
Johnetordoff/waterbutler
|
b505cdbcffadaba12984dcb19c9139068e6c314d
|
[
"Apache-2.0"
] | null | null | null |
import pytest
from unittest import mock
from waterbutler.server.api.v1.provider.metadata import MetadataMixin
class BaseMetadataMixinTest:
def setup_method(self, method):
self.mixin = MetadataMixin()
self.mixin.write = mock.Mock()
self.mixin.request = mock.Mock()
self.mixin.set_status = mock.Mock()
@pytest.mark.skipif
class TestHeaderMetadata(BaseMetadataMixinTest):
def test_revision(self):
pass
def test_version(self):
pass
def test_size_none(self):
pass
def test_modified_none(self):
pass
def test_content_type_default(self):
pass
def test_x_waterbutler_metadata(self):
pass
@pytest.mark.skipif
class TestGetFolder(BaseMetadataMixinTest):
def test_zip(self):
pass
def test_listing(self):
pass
@pytest.mark.skipif
class TestGetFile(BaseMetadataMixinTest):
def test_meta(self):
pass
def test_versions(self):
pass
def test_revisions(self):
pass
def test_download_file(self):
pass
@pytest.mark.skipif
class TestDownloadFile(BaseMetadataMixinTest):
def test_range(self):
pass
def test_version(self):
pass
def test_revision(self):
pass
def test_mode(self):
pass
def test_direct(self):
pass
def test_redirect(self):
pass
def test_content_type(self):
pass
def test_content_length(self):
pass
def test_display_name(self):
pass
def test_stream_name(self):
pass
def test_mime_type(self):
pass
@pytest.mark.skipif
class TestFileMetadata(BaseMetadataMixinTest):
def test_version(self):
pass
def test_revision(self):
pass
def test_return(self):
pass
@pytest.mark.skipif
class TestFileRevisions(BaseMetadataMixinTest):
def test_return(self):
pass
def test_not_coroutine(self):
pass
@pytest.mark.skipif
class TestDownloadFolderAsZip(BaseMetadataMixinTest):
def test_return(self):
pass
| 16.317829
| 69
| 0.654632
| 241
| 2,105
| 5.53527
| 0.257261
| 0.152174
| 0.181409
| 0.247376
| 0.422039
| 0.355322
| 0.122939
| 0.111694
| 0.111694
| 0.077961
| 0
| 0.00065
| 0.268884
| 2,105
| 128
| 70
| 16.445313
| 0.866147
| 0
| 0
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.37037
| false
| 0.358025
| 0.037037
| 0
| 0.506173
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
720dbea190e784e0c8ad960dcfa92c674de61dbb
| 821
|
py
|
Python
|
tests/contracts/repo.py
|
cffbots/howfairis
|
008552b7266e229bd38553631d7dfe3554df18b2
|
[
"Apache-2.0"
] | 27
|
2020-09-10T10:04:56.000Z
|
2022-02-07T23:24:13.000Z
|
tests/contracts/repo.py
|
cffbots/howfairis
|
008552b7266e229bd38553631d7dfe3554df18b2
|
[
"Apache-2.0"
] | 297
|
2020-09-07T14:10:08.000Z
|
2022-02-18T09:46:30.000Z
|
tests/contracts/repo.py
|
cffbots/howfairis
|
008552b7266e229bd38553631d7dfe3554df18b2
|
[
"Apache-2.0"
] | 6
|
2020-09-10T12:58:37.000Z
|
2022-03-11T10:17:21.000Z
|
from abc import ABC
from abc import abstractmethod
from requests_mock.mocker import Mocker
class Contract(ABC):
@abstractmethod
def test_api(self, mocker: Mocker):
pass
@abstractmethod
def test_branch(self, mocker: Mocker):
pass
@abstractmethod
def test_default_branch(self, mocker: Mocker):
pass
@abstractmethod
def test_owner(self, mocker: Mocker):
pass
@abstractmethod
def test_path(self, mocker: Mocker):
pass
@abstractmethod
def test_platform(self, mocker: Mocker):
pass
@abstractmethod
def test_raw_url_format_string(self, mocker: Mocker):
pass
@abstractmethod
def test_repo(self, mocker: Mocker):
pass
@abstractmethod
def test_url(self, mocker: Mocker):
pass
| 19.093023
| 57
| 0.657734
| 93
| 821
| 5.655914
| 0.258065
| 0.290875
| 0.359316
| 0.342205
| 0.646388
| 0.646388
| 0.646388
| 0.178707
| 0
| 0
| 0
| 0
| 0.27162
| 821
| 42
| 58
| 19.547619
| 0.879599
| 0
| 0
| 0.580645
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.290323
| false
| 0.290323
| 0.096774
| 0
| 0.419355
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
a0dd8a0bb62be9695fdb18291e4103866a1b5a7d
| 422
|
py
|
Python
|
EX 8/dictionary example.py
|
Fallinqqq/ITP-100-01-Course-Projects
|
09c2a5d9d94fd4d68aac161acbc475850784abaa
|
[
"MIT"
] | null | null | null |
EX 8/dictionary example.py
|
Fallinqqq/ITP-100-01-Course-Projects
|
09c2a5d9d94fd4d68aac161acbc475850784abaa
|
[
"MIT"
] | null | null | null |
EX 8/dictionary example.py
|
Fallinqqq/ITP-100-01-Course-Projects
|
09c2a5d9d94fd4d68aac161acbc475850784abaa
|
[
"MIT"
] | null | null | null |
# Nested Dictionary outcome: states["Texas"]["flower"]
# 'Bluebonnet'
# states["Texas"]
# {'capital': 'Austin', 'flower': 'Bluebonnet'}
"""'states = {
"california": {
"capital": "Sacramento",
"flower": "California Poppy",
},
"New York": {
"capital": "Albany",
"flower": "Rose",
},
"Texas": {
"capital": "Austin",
"flower": "Bluebonnet",
},
}''"""
| 19.181818
| 54
| 0.492891
| 31
| 422
| 6.709677
| 0.516129
| 0.230769
| 0.211538
| 0.230769
| 0.326923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.274882
| 422
| 21
| 55
| 20.095238
| 0.679739
| 0.962085
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
a0ec2e4895d4438369c9e2ddaa3bf49f6c4b2485
| 47
|
py
|
Python
|
authz/model/__init__.py
|
nimatbt/Auth-Microservice
|
449fd7c3210822d6c59940f817c978fd1715a876
|
[
"Apache-2.0"
] | null | null | null |
authz/model/__init__.py
|
nimatbt/Auth-Microservice
|
449fd7c3210822d6c59940f817c978fd1715a876
|
[
"Apache-2.0"
] | null | null | null |
authz/model/__init__.py
|
nimatbt/Auth-Microservice
|
449fd7c3210822d6c59940f817c978fd1715a876
|
[
"Apache-2.0"
] | null | null | null |
from authz.model.user import User # 18-1 : 48'
| 23.5
| 46
| 0.702128
| 9
| 47
| 3.666667
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128205
| 0.170213
| 47
| 1
| 47
| 47
| 0.717949
| 0.212766
| 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
|
9d05f521fa0d270fdc8644b006ff5738c914b976
| 223
|
py
|
Python
|
config.py
|
Shalamnik/philology-teacher-bot
|
77fe9229ab7b7858355f19ee2cbd258596872734
|
[
"MIT"
] | null | null | null |
config.py
|
Shalamnik/philology-teacher-bot
|
77fe9229ab7b7858355f19ee2cbd258596872734
|
[
"MIT"
] | null | null | null |
config.py
|
Shalamnik/philology-teacher-bot
|
77fe9229ab7b7858355f19ee2cbd258596872734
|
[
"MIT"
] | null | null | null |
from configparser import ConfigParser
class Config:
def __init__(self):
self._config = ConfigParser()
self._config.read('config.ini')
def __getitem__(self, item):
return self._config[item]
| 22.3
| 39
| 0.672646
| 25
| 223
| 5.56
| 0.52
| 0.215827
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2287
| 223
| 10
| 40
| 22.3
| 0.80814
| 0
| 0
| 0
| 0
| 0
| 0.044643
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.714286
| 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
|
9d2be824a0ee3cea5cbb93d5f9c561d9a443f0d9
| 54
|
py
|
Python
|
test.py
|
tsukasa1227/glareImage
|
e7650613d876342b35f6485807e7eb106b48df91
|
[
"MIT"
] | null | null | null |
test.py
|
tsukasa1227/glareImage
|
e7650613d876342b35f6485807e7eb106b48df91
|
[
"MIT"
] | null | null | null |
test.py
|
tsukasa1227/glareImage
|
e7650613d876342b35f6485807e7eb106b48df91
|
[
"MIT"
] | null | null | null |
#!/usr/python3
print("test")
print("test-branch")
| 6.75
| 20
| 0.62963
| 7
| 54
| 4.857143
| 0.714286
| 0.529412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021277
| 0.12963
| 54
| 7
| 21
| 7.714286
| 0.702128
| 0.240741
| 0
| 0
| 0
| 0
| 0.394737
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
9d475716ec3df6e3e65366908b242f5696c7b3b4
| 155
|
py
|
Python
|
Italiano/old/databricks_cli.py
|
Burlesco70/DataScienceCourse
|
00c1c47e0eef78aebdf3db5ccf981658ebedc5ea
|
[
"MIT"
] | 6
|
2020-04-11T18:02:57.000Z
|
2021-11-26T09:40:12.000Z
|
Italiano/old/databricks_cli.py
|
Burlesco70/DataScienceCourse
|
00c1c47e0eef78aebdf3db5ccf981658ebedc5ea
|
[
"MIT"
] | 1
|
2020-05-08T15:30:02.000Z
|
2020-05-10T09:23:15.000Z
|
Italiano/old/databricks_cli.py
|
Burlesco70/DataScienceCourse
|
00c1c47e0eef78aebdf3db5ccf981658ebedc5ea
|
[
"MIT"
] | 3
|
2019-12-05T16:02:50.000Z
|
2020-05-03T07:43:26.000Z
|
import databricks_cli as cli
host = "https://westeurope.azuredatabricks.net/?o=7194849461143097#"
token = "dapi3fbeb0f60b9d2121dc4fa02708f7c383"
| 22.142857
| 69
| 0.774194
| 14
| 155
| 8.5
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.259259
| 0.129032
| 155
| 6
| 70
| 25.833333
| 0.622222
| 0
| 0
| 0
| 0
| 0
| 0.646259
| 0.244898
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
19c781c9881553401f5d60f5dacd9f15d733e01e
| 570
|
py
|
Python
|
stockprophet/cli/__init__.py
|
chihyi-liao/stockprophet
|
891c91b2a446e3bd30bb56b88be3874d7dda1b8d
|
[
"BSD-3-Clause"
] | 1
|
2021-11-15T13:07:19.000Z
|
2021-11-15T13:07:19.000Z
|
stockprophet/cli/__init__.py
|
chihyi-liao/stockprophet
|
891c91b2a446e3bd30bb56b88be3874d7dda1b8d
|
[
"BSD-3-Clause"
] | null | null | null |
stockprophet/cli/__init__.py
|
chihyi-liao/stockprophet
|
891c91b2a446e3bd30bb56b88be3874d7dda1b8d
|
[
"BSD-3-Clause"
] | 1
|
2021-09-15T09:25:39.000Z
|
2021-09-15T09:25:39.000Z
|
import click
from .stock import commands as stock
from .ta import commands as ta
from .ba import commands as ba
from .db import commands as db
from .sim import commands as sim
from .recommender import commands as recommender
@click.group()
def entry_point():
pass
entry_point.add_command(stock.stock_group, 'stock')
entry_point.add_command(ta.ta_group, 'ta')
entry_point.add_command(ba.ba_group, 'ba')
entry_point.add_command(db.db_group, 'db')
entry_point.add_command(sim.sim_group, 'sim')
entry_point.add_command(recommender.recommender_group, 'recommender')
| 25.909091
| 69
| 0.792982
| 92
| 570
| 4.706522
| 0.195652
| 0.161663
| 0.221709
| 0.277136
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.110526
| 570
| 21
| 70
| 27.142857
| 0.854043
| 0
| 0
| 0
| 0
| 0
| 0.04386
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.0625
| true
| 0.0625
| 0.4375
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
19d4b8f52601492cf727019a9bf9674977deebc3
| 91
|
py
|
Python
|
2015/day_8/chars.py
|
ceronman/AdventOfCode2015
|
87b6d93df960045b5eff1ded107ac4e2719ee6e6
|
[
"MIT"
] | 4
|
2019-12-03T02:03:23.000Z
|
2019-12-20T11:36:00.000Z
|
2015/day_8/chars.py
|
ceronman/AdventOfCode2015
|
87b6d93df960045b5eff1ded107ac4e2719ee6e6
|
[
"MIT"
] | null | null | null |
2015/day_8/chars.py
|
ceronman/AdventOfCode2015
|
87b6d93df960045b5eff1ded107ac4e2719ee6e6
|
[
"MIT"
] | null | null | null |
import ast
print sum(len(s.strip()) - len(ast.literal_eval(s)) for s in open('input.txt'))
| 30.333333
| 79
| 0.692308
| 18
| 91
| 3.444444
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.10989
| 91
| 3
| 79
| 30.333333
| 0.765432
| 0
| 0
| 0
| 0
| 0
| 0.097826
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| null | null | 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
19f81d601acc0230a3ebc0b0d98b6bf47cc7e1ba
| 44
|
py
|
Python
|
tests/requests/models.py
|
webjunkie/django
|
5dbca13f3baa2e1bafd77e84a80ad6d8a074712e
|
[
"BSD-3-Clause"
] | 790
|
2015-01-03T02:13:39.000Z
|
2020-05-10T19:53:57.000Z
|
tests/regressiontests/requests/models.py
|
mradziej/django
|
5d38965743a369981c9a738a298f467f854a2919
|
[
"BSD-3-Clause"
] | 1,361
|
2015-01-08T23:09:40.000Z
|
2020-04-14T00:03:04.000Z
|
tests/regressiontests/requests/models.py
|
mradziej/django
|
5d38965743a369981c9a738a298f467f854a2919
|
[
"BSD-3-Clause"
] | 155
|
2015-01-08T22:59:31.000Z
|
2020-04-08T08:01:53.000Z
|
# Need a models module for the test runner.
| 22
| 43
| 0.75
| 8
| 44
| 4.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.204545
| 44
| 1
| 44
| 44
| 0.942857
| 0.931818
| 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
|
c230de7b0050f09143731c6e4e79d3571390e5d9
| 193
|
py
|
Python
|
classifier/gmm/__init__.py
|
ecohealthalliance/eha_grit
|
cb95b759222ca7a416dd7d439571e7b610dd5e23
|
[
"Apache-2.0"
] | null | null | null |
classifier/gmm/__init__.py
|
ecohealthalliance/eha_grit
|
cb95b759222ca7a416dd7d439571e7b610dd5e23
|
[
"Apache-2.0"
] | null | null | null |
classifier/gmm/__init__.py
|
ecohealthalliance/eha_grit
|
cb95b759222ca7a416dd7d439571e7b610dd5e23
|
[
"Apache-2.0"
] | null | null | null |
from classifier import sklearn_cluster
from sklearn.mixture import GMM
def classify(train, test):
clusterer = GMM()
return sklearn_cluster.classify(train, test, clusterer)
| 17.545455
| 59
| 0.73057
| 23
| 193
| 6.043478
| 0.565217
| 0.201439
| 0.244604
| 0.374101
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.202073
| 193
| 10
| 60
| 19.3
| 0.902597
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.8
| 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
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
c237f67e8938ad326fe5357d1d23ff64095fc78e
| 129
|
py
|
Python
|
src/pdf/command/encrypt.py
|
ichiro-kazusa/PDFCon
|
529c22145bfd20919b015b5ba70e8bab33feed01
|
[
"MIT"
] | null | null | null |
src/pdf/command/encrypt.py
|
ichiro-kazusa/PDFCon
|
529c22145bfd20919b015b5ba70e8bab33feed01
|
[
"MIT"
] | null | null | null |
src/pdf/command/encrypt.py
|
ichiro-kazusa/PDFCon
|
529c22145bfd20919b015b5ba70e8bab33feed01
|
[
"MIT"
] | null | null | null |
class EncryptionCommand:
"""Data Transfer Object for encryption settings"""
owner_password: str
user_password: str
| 18.428571
| 54
| 0.728682
| 14
| 129
| 6.571429
| 0.857143
| 0.23913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20155
| 129
| 6
| 55
| 21.5
| 0.893204
| 0.341085
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.666667
| 0
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
c23d756362fe853fcf0ffa8e02ad2275dd3335ef
| 171
|
py
|
Python
|
tests/test/plugin/conftest.py
|
acolytec3/brownie
|
e00e1f26f5b05e963fe50ffe198634c9e8876589
|
[
"MIT"
] | null | null | null |
tests/test/plugin/conftest.py
|
acolytec3/brownie
|
e00e1f26f5b05e963fe50ffe198634c9e8876589
|
[
"MIT"
] | null | null | null |
tests/test/plugin/conftest.py
|
acolytec3/brownie
|
e00e1f26f5b05e963fe50ffe198634c9e8876589
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python3
from pathlib import Path
import pytest
@pytest.fixture
def json_path(plugintester):
yield Path(plugintester.tmpdir).joinpath("build/tests.json")
| 17.1
| 64
| 0.77193
| 23
| 171
| 5.695652
| 0.73913
| 0.244275
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006579
| 0.111111
| 171
| 9
| 65
| 19
| 0.855263
| 0.099415
| 0
| 0
| 0
| 0
| 0.104575
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
dfe43abe2fc7ff096881ed543a5a5647c8cf00a3
| 259
|
py
|
Python
|
page/views.py
|
likelionmju/likelion-camp
|
12008b1a5df46a27dab272ccb6c3405e9d357931
|
[
"MIT"
] | null | null | null |
page/views.py
|
likelionmju/likelion-camp
|
12008b1a5df46a27dab272ccb6c3405e9d357931
|
[
"MIT"
] | 8
|
2021-04-08T21:51:23.000Z
|
2022-03-12T00:50:22.000Z
|
page/views.py
|
likelionmju/likelion-camp
|
12008b1a5df46a27dab272ccb6c3405e9d357931
|
[
"MIT"
] | 3
|
2020-07-28T15:03:52.000Z
|
2021-11-01T10:03:08.000Z
|
from django.shortcuts import render
# Create your views here.
def home(request):
return render(request, "home.html")
def introduce(request):
return render(request, 'introduce.html')
def parallax(request):
return render(request, 'parallax.html')
| 23.545455
| 44
| 0.737452
| 33
| 259
| 5.787879
| 0.484848
| 0.204188
| 0.298429
| 0.408377
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146718
| 259
| 11
| 45
| 23.545455
| 0.864253
| 0.088803
| 0
| 0
| 0
| 0
| 0.153191
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0
| 0.142857
| 0.428571
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
dffe9fff10d5b77141b4a0fd25229b49efb1222f
| 85
|
py
|
Python
|
enthought/enable/wx/quartz.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/enable/wx/quartz.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/enable/wx/quartz.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from __future__ import absolute_import
from enable.wx.quartz import *
| 21.25
| 38
| 0.823529
| 12
| 85
| 5.416667
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129412
| 85
| 3
| 39
| 28.333333
| 0.878378
| 0.141176
| 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
|
dfff5cd81625691478bf71617ab3af731eacfa7f
| 39
|
py
|
Python
|
version.py
|
steffann/ansible-junos-stdlib
|
909b3826f64326d21c7a3b0107be2e7dbc257a6c
|
[
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null |
version.py
|
steffann/ansible-junos-stdlib
|
909b3826f64326d21c7a3b0107be2e7dbc257a6c
|
[
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null |
version.py
|
steffann/ansible-junos-stdlib
|
909b3826f64326d21c7a3b0107be2e7dbc257a6c
|
[
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null |
VERSION = "2.3.0"
DATE = "2019-Dec-13"
| 13
| 20
| 0.589744
| 8
| 39
| 2.875
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.272727
| 0.153846
| 39
| 2
| 21
| 19.5
| 0.424242
| 0
| 0
| 0
| 0
| 0
| 0.410256
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a02475deadec2c1d7a13b1cdb74d71b6ba19f4a8
| 214
|
py
|
Python
|
src/Controller/ConsoleClock.py
|
anthonyf996/ChessApp
|
614f72bc641793681fd5ad7040d6a4c407c9ae9e
|
[
"MIT"
] | null | null | null |
src/Controller/ConsoleClock.py
|
anthonyf996/ChessApp
|
614f72bc641793681fd5ad7040d6a4c407c9ae9e
|
[
"MIT"
] | null | null | null |
src/Controller/ConsoleClock.py
|
anthonyf996/ChessApp
|
614f72bc641793681fd5ad7040d6a4c407c9ae9e
|
[
"MIT"
] | null | null | null |
from Clock import Clock
from time import sleep
class ConsoleClock(Clock):
def tick(self, fpsKey = "FPS" ):
sleep( self.getSeconds( self.fpsSpec[ fpsKey ] ) )
def getSeconds(self, fps):
return 1 / fps
| 21.4
| 54
| 0.686916
| 29
| 214
| 5.068966
| 0.551724
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005882
| 0.205607
| 214
| 9
| 55
| 23.777778
| 0.858824
| 0
| 0
| 0
| 0
| 0
| 0.014019
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.285714
| 0.142857
| 0.857143
| 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
|
a06adca64ab82d6405c4dbbabecde695aa41c2e6
| 59
|
py
|
Python
|
utils/my/__init__.py
|
ruixingw/rxcclib
|
73036f7a159897e490cd983a256a0a180e3060c3
|
[
"BSD-3-Clause"
] | 1
|
2019-03-15T03:47:23.000Z
|
2019-03-15T03:47:23.000Z
|
utils/my/__init__.py
|
ruixingw/rxcclib
|
73036f7a159897e490cd983a256a0a180e3060c3
|
[
"BSD-3-Clause"
] | null | null | null |
utils/my/__init__.py
|
ruixingw/rxcclib
|
73036f7a159897e490cd983a256a0a180e3060c3
|
[
"BSD-3-Clause"
] | 2
|
2021-05-27T10:19:47.000Z
|
2021-12-02T21:34:59.000Z
|
from .LTMatrix import LTMatrix
from .atomwiseList import *
| 19.666667
| 30
| 0.813559
| 7
| 59
| 6.857143
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135593
| 59
| 2
| 31
| 29.5
| 0.941176
| 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
|
a09bcca437271a4e7013f896ce8239372998083d
| 64
|
py
|
Python
|
concorde/acme/__init__.py
|
frutiger/concorde
|
9f5a763bdaf2b8e48636193db39b7fde8209156c
|
[
"Unlicense"
] | 2
|
2016-03-09T03:54:19.000Z
|
2016-04-14T09:37:01.000Z
|
concorde/acme/__init__.py
|
frutiger/concorde
|
9f5a763bdaf2b8e48636193db39b7fde8209156c
|
[
"Unlicense"
] | 1
|
2016-02-28T23:43:14.000Z
|
2016-02-28T23:43:14.000Z
|
concorde/acme/__init__.py
|
frutiger/concorde
|
9f5a763bdaf2b8e48636193db39b7fde8209156c
|
[
"Unlicense"
] | 1
|
2016-02-28T23:25:19.000Z
|
2016-02-28T23:25:19.000Z
|
# concorde.acme
from .client import Client, Error, ServerError
| 16
| 46
| 0.78125
| 8
| 64
| 6.25
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.140625
| 64
| 3
| 47
| 21.333333
| 0.909091
| 0.203125
| 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
|
a0acf3fc14deb0d155380aab465e58ad7b61cb80
| 119
|
py
|
Python
|
engine/omega_engine/core/physics/__init__.py
|
jadsonlucio/Opengl-CG-Project
|
47b50bf93b8d3a1ccef1f41f22ed3327d9496b8c
|
[
"MIT"
] | null | null | null |
engine/omega_engine/core/physics/__init__.py
|
jadsonlucio/Opengl-CG-Project
|
47b50bf93b8d3a1ccef1f41f22ed3327d9496b8c
|
[
"MIT"
] | 3
|
2021-06-08T20:54:18.000Z
|
2022-03-12T00:13:46.000Z
|
engine/omega_engine/core/physics/__init__.py
|
jadsonlucio/Opengl-CG-Project
|
47b50bf93b8d3a1ccef1f41f22ed3327d9496b8c
|
[
"MIT"
] | null | null | null |
from .particle import Particle
from .physical_constants import *
from .vectors import Vector3D
from .world import World
| 29.75
| 33
| 0.831933
| 16
| 119
| 6.125
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009615
| 0.12605
| 119
| 4
| 34
| 29.75
| 0.932692
| 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
|
2618b2fdf5af250a03bff766fca00f1f6990eba7
| 80
|
py
|
Python
|
plusseg/modeling/decoder/__init__.py
|
tonysy/SegmentationToolbox.PyTorch
|
4d487dd81d0101bc5cdb7b2337776fdf1b5546ff
|
[
"MIT"
] | 13
|
2019-07-26T11:33:15.000Z
|
2021-09-22T06:48:52.000Z
|
plusseg/modeling/decoder/__init__.py
|
tonysy/SegmentationToolbox.PyTorch
|
4d487dd81d0101bc5cdb7b2337776fdf1b5546ff
|
[
"MIT"
] | 1
|
2018-11-05T14:07:07.000Z
|
2018-11-05T14:07:07.000Z
|
plusseg/modeling/decoder/__init__.py
|
tonysy/SegmentationToolbox.PyTorch
|
4d487dd81d0101bc5cdb7b2337776fdf1b5546ff
|
[
"MIT"
] | 2
|
2019-07-26T11:33:32.000Z
|
2020-03-04T13:47:50.000Z
|
from .decoder import build_decoder
from .loss import SegmentationLossComputation
| 40
| 45
| 0.8875
| 9
| 80
| 7.777778
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0875
| 80
| 2
| 45
| 40
| 0.958904
| 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
|
261cb871c5daf70f2edb87ff8d7253b42aea0f63
| 17,266
|
py
|
Python
|
sdk/python/pulumi_aws_native/iotevents/detector_model.py
|
AaronFriel/pulumi-aws-native
|
5621690373ac44accdbd20b11bae3be1baf022d1
|
[
"Apache-2.0"
] | 29
|
2021-09-30T19:32:07.000Z
|
2022-03-22T21:06:08.000Z
|
sdk/python/pulumi_aws_native/iotevents/detector_model.py
|
AaronFriel/pulumi-aws-native
|
5621690373ac44accdbd20b11bae3be1baf022d1
|
[
"Apache-2.0"
] | 232
|
2021-09-30T19:26:26.000Z
|
2022-03-31T23:22:06.000Z
|
sdk/python/pulumi_aws_native/iotevents/detector_model.py
|
AaronFriel/pulumi-aws-native
|
5621690373ac44accdbd20b11bae3be1baf022d1
|
[
"Apache-2.0"
] | 4
|
2021-11-10T19:42:01.000Z
|
2022-02-05T10:15:49.000Z
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['DetectorModelArgs', 'DetectorModel']
@pulumi.input_type
class DetectorModelArgs:
def __init__(__self__, *,
detector_model_definition: pulumi.Input['DetectorModelDefinitionArgs'],
role_arn: pulumi.Input[str],
detector_model_description: Optional[pulumi.Input[str]] = None,
detector_model_name: Optional[pulumi.Input[str]] = None,
evaluation_method: Optional[pulumi.Input['DetectorModelEvaluationMethod']] = None,
key: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input['DetectorModelTagArgs']]]] = None):
"""
The set of arguments for constructing a DetectorModel resource.
:param pulumi.Input[str] role_arn: The ARN of the role that grants permission to AWS IoT Events to perform its operations.
:param pulumi.Input[str] detector_model_description: A brief description of the detector model.
:param pulumi.Input[str] detector_model_name: The name of the detector model.
:param pulumi.Input['DetectorModelEvaluationMethod'] evaluation_method: Information about the order in which events are evaluated and how actions are executed.
:param pulumi.Input[str] key: The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
:param pulumi.Input[Sequence[pulumi.Input['DetectorModelTagArgs']]] tags: An array of key-value pairs to apply to this resource.
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
"""
pulumi.set(__self__, "detector_model_definition", detector_model_definition)
pulumi.set(__self__, "role_arn", role_arn)
if detector_model_description is not None:
pulumi.set(__self__, "detector_model_description", detector_model_description)
if detector_model_name is not None:
pulumi.set(__self__, "detector_model_name", detector_model_name)
if evaluation_method is not None:
pulumi.set(__self__, "evaluation_method", evaluation_method)
if key is not None:
pulumi.set(__self__, "key", key)
if tags is not None:
pulumi.set(__self__, "tags", tags)
@property
@pulumi.getter(name="detectorModelDefinition")
def detector_model_definition(self) -> pulumi.Input['DetectorModelDefinitionArgs']:
return pulumi.get(self, "detector_model_definition")
@detector_model_definition.setter
def detector_model_definition(self, value: pulumi.Input['DetectorModelDefinitionArgs']):
pulumi.set(self, "detector_model_definition", value)
@property
@pulumi.getter(name="roleArn")
def role_arn(self) -> pulumi.Input[str]:
"""
The ARN of the role that grants permission to AWS IoT Events to perform its operations.
"""
return pulumi.get(self, "role_arn")
@role_arn.setter
def role_arn(self, value: pulumi.Input[str]):
pulumi.set(self, "role_arn", value)
@property
@pulumi.getter(name="detectorModelDescription")
def detector_model_description(self) -> Optional[pulumi.Input[str]]:
"""
A brief description of the detector model.
"""
return pulumi.get(self, "detector_model_description")
@detector_model_description.setter
def detector_model_description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "detector_model_description", value)
@property
@pulumi.getter(name="detectorModelName")
def detector_model_name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the detector model.
"""
return pulumi.get(self, "detector_model_name")
@detector_model_name.setter
def detector_model_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "detector_model_name", value)
@property
@pulumi.getter(name="evaluationMethod")
def evaluation_method(self) -> Optional[pulumi.Input['DetectorModelEvaluationMethod']]:
"""
Information about the order in which events are evaluated and how actions are executed.
"""
return pulumi.get(self, "evaluation_method")
@evaluation_method.setter
def evaluation_method(self, value: Optional[pulumi.Input['DetectorModelEvaluationMethod']]):
pulumi.set(self, "evaluation_method", value)
@property
@pulumi.getter
def key(self) -> Optional[pulumi.Input[str]]:
"""
The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
"""
return pulumi.get(self, "key")
@key.setter
def key(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "key", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DetectorModelTagArgs']]]]:
"""
An array of key-value pairs to apply to this resource.
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DetectorModelTagArgs']]]]):
pulumi.set(self, "tags", value)
class DetectorModel(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
detector_model_definition: Optional[pulumi.Input[pulumi.InputType['DetectorModelDefinitionArgs']]] = None,
detector_model_description: Optional[pulumi.Input[str]] = None,
detector_model_name: Optional[pulumi.Input[str]] = None,
evaluation_method: Optional[pulumi.Input['DetectorModelEvaluationMethod']] = None,
key: Optional[pulumi.Input[str]] = None,
role_arn: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DetectorModelTagArgs']]]]] = None,
__props__=None):
"""
The AWS::IoTEvents::DetectorModel resource creates a detector model. You create a *detector model* (a model of your equipment or process) using *states*. For each state, you define conditional (Boolean) logic that evaluates the incoming inputs to detect significant events. When an event is detected, it can change the state or trigger custom-built or predefined actions using other AWS services. You can define additional events that trigger actions when entering or exiting a state and, optionally, when a condition is met. For more information, see [How to Use AWS IoT Events](https://docs.aws.amazon.com/iotevents/latest/developerguide/how-to-use-iotevents.html) in the *AWS IoT Events Developer Guide*.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] detector_model_description: A brief description of the detector model.
:param pulumi.Input[str] detector_model_name: The name of the detector model.
:param pulumi.Input['DetectorModelEvaluationMethod'] evaluation_method: Information about the order in which events are evaluated and how actions are executed.
:param pulumi.Input[str] key: The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
:param pulumi.Input[str] role_arn: The ARN of the role that grants permission to AWS IoT Events to perform its operations.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DetectorModelTagArgs']]]] tags: An array of key-value pairs to apply to this resource.
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: DetectorModelArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
The AWS::IoTEvents::DetectorModel resource creates a detector model. You create a *detector model* (a model of your equipment or process) using *states*. For each state, you define conditional (Boolean) logic that evaluates the incoming inputs to detect significant events. When an event is detected, it can change the state or trigger custom-built or predefined actions using other AWS services. You can define additional events that trigger actions when entering or exiting a state and, optionally, when a condition is met. For more information, see [How to Use AWS IoT Events](https://docs.aws.amazon.com/iotevents/latest/developerguide/how-to-use-iotevents.html) in the *AWS IoT Events Developer Guide*.
:param str resource_name: The name of the resource.
:param DetectorModelArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(DetectorModelArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
detector_model_definition: Optional[pulumi.Input[pulumi.InputType['DetectorModelDefinitionArgs']]] = None,
detector_model_description: Optional[pulumi.Input[str]] = None,
detector_model_name: Optional[pulumi.Input[str]] = None,
evaluation_method: Optional[pulumi.Input['DetectorModelEvaluationMethod']] = None,
key: Optional[pulumi.Input[str]] = None,
role_arn: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DetectorModelTagArgs']]]]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = DetectorModelArgs.__new__(DetectorModelArgs)
if detector_model_definition is None and not opts.urn:
raise TypeError("Missing required property 'detector_model_definition'")
__props__.__dict__["detector_model_definition"] = detector_model_definition
__props__.__dict__["detector_model_description"] = detector_model_description
__props__.__dict__["detector_model_name"] = detector_model_name
__props__.__dict__["evaluation_method"] = evaluation_method
__props__.__dict__["key"] = key
if role_arn is None and not opts.urn:
raise TypeError("Missing required property 'role_arn'")
__props__.__dict__["role_arn"] = role_arn
__props__.__dict__["tags"] = tags
super(DetectorModel, __self__).__init__(
'aws-native:iotevents:DetectorModel',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'DetectorModel':
"""
Get an existing DetectorModel resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = DetectorModelArgs.__new__(DetectorModelArgs)
__props__.__dict__["detector_model_definition"] = None
__props__.__dict__["detector_model_description"] = None
__props__.__dict__["detector_model_name"] = None
__props__.__dict__["evaluation_method"] = None
__props__.__dict__["key"] = None
__props__.__dict__["role_arn"] = None
__props__.__dict__["tags"] = None
return DetectorModel(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="detectorModelDefinition")
def detector_model_definition(self) -> pulumi.Output['outputs.DetectorModelDefinition']:
return pulumi.get(self, "detector_model_definition")
@property
@pulumi.getter(name="detectorModelDescription")
def detector_model_description(self) -> pulumi.Output[Optional[str]]:
"""
A brief description of the detector model.
"""
return pulumi.get(self, "detector_model_description")
@property
@pulumi.getter(name="detectorModelName")
def detector_model_name(self) -> pulumi.Output[Optional[str]]:
"""
The name of the detector model.
"""
return pulumi.get(self, "detector_model_name")
@property
@pulumi.getter(name="evaluationMethod")
def evaluation_method(self) -> pulumi.Output[Optional['DetectorModelEvaluationMethod']]:
"""
Information about the order in which events are evaluated and how actions are executed.
"""
return pulumi.get(self, "evaluation_method")
@property
@pulumi.getter
def key(self) -> pulumi.Output[Optional[str]]:
"""
The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
"""
return pulumi.get(self, "key")
@property
@pulumi.getter(name="roleArn")
def role_arn(self) -> pulumi.Output[str]:
"""
The ARN of the role that grants permission to AWS IoT Events to perform its operations.
"""
return pulumi.get(self, "role_arn")
@property
@pulumi.getter
def tags(self) -> pulumi.Output[Optional[Sequence['outputs.DetectorModelTag']]]:
"""
An array of key-value pairs to apply to this resource.
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
"""
return pulumi.get(self, "tags")
| 55.877023
| 715
| 0.693038
| 2,079
| 17,266
| 5.554594
| 0.113516
| 0.073173
| 0.03637
| 0.032387
| 0.803949
| 0.755802
| 0.712071
| 0.663665
| 0.641843
| 0.627122
| 0
| 0.000074
| 0.219912
| 17,266
| 308
| 716
| 56.058442
| 0.857302
| 0.399108
| 0
| 0.405405
| 1
| 0
| 0.161516
| 0.084711
| 0
| 0
| 0
| 0
| 0
| 1
| 0.145946
| false
| 0.005405
| 0.043243
| 0.010811
| 0.281081
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
262407a53fb3fac1f8e3a5944294c32681eccfd1
| 142
|
py
|
Python
|
src/util/__init__.py
|
bobbyluig/6.A01
|
16dd8963951eca4a1312a15c216d0cc3c117d063
|
[
"MIT"
] | null | null | null |
src/util/__init__.py
|
bobbyluig/6.A01
|
16dd8963951eca4a1312a15c216d0cc3c117d063
|
[
"MIT"
] | null | null | null |
src/util/__init__.py
|
bobbyluig/6.A01
|
16dd8963951eca4a1312a15c216d0cc3c117d063
|
[
"MIT"
] | 1
|
2021-02-24T07:13:01.000Z
|
2021-02-24T07:13:01.000Z
|
from .logger import logger, logging_queue
from .reconnect import ApplicationRunner
__all__ = ['logger', 'logging_queue', 'ApplicationRunner']
| 35.5
| 58
| 0.802817
| 15
| 142
| 7.2
| 0.533333
| 0.240741
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098592
| 142
| 4
| 58
| 35.5
| 0.84375
| 0
| 0
| 0
| 0
| 0
| 0.251748
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 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
|
2625a489d75acfe89606ec201b2b2a7c206463b5
| 22
|
py
|
Python
|
pcanet/__init__.py
|
dianlujitao/PCANet_pytorch
|
358d3f82909279722c9ce0cd0688573e4c86a405
|
[
"MIT"
] | 4
|
2019-04-15T16:56:14.000Z
|
2021-08-03T13:03:15.000Z
|
pcanet/__init__.py
|
MoetaYuko/PCANet_pytorch
|
358d3f82909279722c9ce0cd0688573e4c86a405
|
[
"MIT"
] | null | null | null |
pcanet/__init__.py
|
MoetaYuko/PCANet_pytorch
|
358d3f82909279722c9ce0cd0688573e4c86a405
|
[
"MIT"
] | 3
|
2019-04-12T14:59:39.000Z
|
2019-10-05T07:37:19.000Z
|
from .pcanet import *
| 11
| 21
| 0.727273
| 3
| 22
| 5.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 22
| 1
| 22
| 22
| 0.888889
| 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
|
263c664ae69c4e2016e74613413e9417172aa318
| 36
|
py
|
Python
|
Chapter 01/Chap01_Example1.56.py
|
bpbpublications/Programming-Techniques-using-Python
|
49b785f37e95a3aad1d36cef51e219ac56e5e9f0
|
[
"MIT"
] | null | null | null |
Chapter 01/Chap01_Example1.56.py
|
bpbpublications/Programming-Techniques-using-Python
|
49b785f37e95a3aad1d36cef51e219ac56e5e9f0
|
[
"MIT"
] | null | null | null |
Chapter 01/Chap01_Example1.56.py
|
bpbpublications/Programming-Techniques-using-Python
|
49b785f37e95a3aad1d36cef51e219ac56e5e9f0
|
[
"MIT"
] | null | null | null |
# subtraction operator
print(a-b)
| 12
| 23
| 0.722222
| 5
| 36
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 36
| 2
| 24
| 18
| 0.866667
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
263e00ecfa4fcfaa8b28e4e70edc6a04087999a1
| 55
|
py
|
Python
|
packages/watchmen-dqc/src/watchmen_dqc/topic_profile/__init__.py
|
Indexical-Metrics-Measure-Advisory/watchmen
|
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
|
[
"MIT"
] | null | null | null |
packages/watchmen-dqc/src/watchmen_dqc/topic_profile/__init__.py
|
Indexical-Metrics-Measure-Advisory/watchmen
|
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
|
[
"MIT"
] | null | null | null |
packages/watchmen-dqc/src/watchmen_dqc/topic_profile/__init__.py
|
Indexical-Metrics-Measure-Advisory/watchmen
|
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
|
[
"MIT"
] | null | null | null |
from .topic_profile_service import TopicProfileService
| 27.5
| 54
| 0.909091
| 6
| 55
| 8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072727
| 55
| 1
| 55
| 55
| 0.941176
| 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
|
267e53ba04971713b1442cd3c3bf87086020c71c
| 2,080
|
py
|
Python
|
test.py
|
EricQAQ/Flask-Redis-Session
|
555084ae89bb117273d423a10df37be392ed24a6
|
[
"MIT"
] | 14
|
2015-06-22T03:52:40.000Z
|
2019-01-17T23:01:23.000Z
|
test.py
|
EricQAQ/Flask-RedisSession
|
555084ae89bb117273d423a10df37be392ed24a6
|
[
"MIT"
] | 2
|
2015-06-21T17:04:22.000Z
|
2019-02-17T11:07:10.000Z
|
test.py
|
EricQAQ/Flask-Redis-Session
|
555084ae89bb117273d423a10df37be392ed24a6
|
[
"MIT"
] | 4
|
2015-11-16T03:33:08.000Z
|
2017-04-26T08:36:49.000Z
|
__author__ = 'Eric'
from flask import Flask, session, request
from flask_redisSession import RedisSession
from datetime import timedelta
import unittest
'''
app = Flask(__name__)
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(seconds=40)
RedisSession(app)
print('++++++++++++++++++++++++++++')
print(app.config['PERMANENT_SESSION_LIFETIME'])
print('++++++++++++++++++++++++++++')
'''
class FlaskRedisSessionTestClass(unittest.TestCase):
def test_redis_session_secret_key(self):
app = Flask(__name__)
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(seconds=10)
app.config['SECRET_KEY'] = '12345'
RedisSession(app)
@app.route('/set', methods=['POST'])
def set():
session['This is a test'] = request.form['This is a test']
return 'A test!'
@app.route('/get')
def get():
return session['This is a test']
@app.route('/delete', methods=['POST'])
def delete():
del session['This is a test']
return 'The test deleted'
c = app.test_client()
self.assertEqual(c.post('/set', data={'This is a test': 'Eric'}).data, b'A test!')
self.assertEqual(c.get('/get').data, b'Eric')
c.post('/delete')
def test_redis_session_no_secret_key(self):
app = Flask(__name__)
app.config['USE_SECRET_KEY'] = False
RedisSession(app)
@app.route('/set', methods=['POST'])
def set():
session['This is a test'] = request.form['This is a test']
return 'A test!'
@app.route('/get')
def get():
return session['This is a test']
@app.route('/delete', methods=['POST'])
def delete():
del session['This is a test']
return 'The test deleted'
c = app.test_client()
self.assertEqual(c.post('/set', data={'This is a test': 'Eric'}).data, b'A test!')
self.assertEqual(c.get('/get').data, b'Eric')
c.post('/delete')
if __name__ == "__main__":
unittest.main()
| 30.588235
| 90
| 0.572115
| 251
| 2,080
| 4.561753
| 0.215139
| 0.061135
| 0.061135
| 0.09607
| 0.731878
| 0.703057
| 0.703057
| 0.703057
| 0.662009
| 0.662009
| 0
| 0.005773
| 0.250481
| 2,080
| 68
| 91
| 30.588235
| 0.728672
| 0
| 0
| 0.723404
| 0
| 0
| 0.19458
| 0.014092
| 0
| 0
| 0
| 0
| 0.085106
| 1
| 0.170213
| false
| 0
| 0.085106
| 0.042553
| 0.404255
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
cd20804047cc71b5324235fcac99f45f0cd96873
| 102
|
py
|
Python
|
apps/taiga/back/django/taiga/taiga_contrib_github_extended_auth/__init__.py
|
stephenhillier/openshift-components
|
d275f595b9f7aa3c86826376985f805fe26b4ade
|
[
"Apache-2.0"
] | 9
|
2018-03-22T15:58:32.000Z
|
2021-12-10T20:49:39.000Z
|
apps/taiga/back/django/taiga/taiga_contrib_github_extended_auth/__init__.py
|
stephenhillier/openshift-components
|
d275f595b9f7aa3c86826376985f805fe26b4ade
|
[
"Apache-2.0"
] | 28
|
2018-03-20T21:28:24.000Z
|
2020-11-26T22:14:23.000Z
|
apps/taiga/back/django/taiga/taiga_contrib_github_extended_auth/__init__.py
|
stephenhillier/openshift-components
|
d275f595b9f7aa3c86826376985f805fe26b4ade
|
[
"Apache-2.0"
] | 28
|
2018-03-22T16:06:09.000Z
|
2021-03-21T06:29:14.000Z
|
default_app_config = "taiga.taiga_contrib_github_extended_auth.apps.TaigaGithubExtendedAuthAppConfig"
| 51
| 101
| 0.911765
| 11
| 102
| 7.909091
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029412
| 102
| 1
| 102
| 102
| 0.878788
| 0
| 0
| 0
| 0
| 0
| 0.764706
| 0.764706
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
cd27d7b0e32b8a454e5b0d84214943269e6d6d06
| 207
|
py
|
Python
|
src/httpx_html/__init__.py
|
nuno-andre/requests-html
|
f8207ab4d50793f677e2b388a8f4ca27b4cc1d06
|
[
"MIT"
] | 2
|
2022-01-09T14:59:38.000Z
|
2022-03-16T20:56:07.000Z
|
src/httpx_html/__init__.py
|
nuno-andre/requests-html
|
f8207ab4d50793f677e2b388a8f4ca27b4cc1d06
|
[
"MIT"
] | 1
|
2022-01-15T23:55:23.000Z
|
2022-01-15T23:55:23.000Z
|
src/httpx_html/__init__.py
|
nuno-andre/httpx-html
|
f8207ab4d50793f677e2b388a8f4ca27b4cc1d06
|
[
"MIT"
] | null | null | null |
from .parse import HTML, Element
from .session import HTMLSession, AsyncHTMLSession, user_agent
__version__ = 0, 11, 0, 'dev1'
__all__ = ['HTML', 'Element', 'HTMLSession', 'AsyncHTMLSession', 'user_agent']
| 34.5
| 78
| 0.743961
| 24
| 207
| 6
| 0.625
| 0.152778
| 0.430556
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027473
| 0.120773
| 207
| 5
| 79
| 41.4
| 0.763736
| 0
| 0
| 0
| 0
| 0
| 0.251208
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
cd47e3b7ad2ac77f3d71a6c6c4af7f12ead40c26
| 28,161
|
py
|
Python
|
Scripts/sims4communitylib/utils/sims/common_relationship_utils.py
|
ColonolNutty/Sims4CommunityLibrary
|
684f28dc3c7deb4d9fd520e21e63942b65a91d31
|
[
"CC-BY-4.0"
] | 118
|
2019-08-31T04:33:18.000Z
|
2022-03-28T21:12:14.000Z
|
Scripts/sims4communitylib/utils/sims/common_relationship_utils.py
|
ColonolNutty/Sims4CommunityLibrary
|
684f28dc3c7deb4d9fd520e21e63942b65a91d31
|
[
"CC-BY-4.0"
] | 15
|
2019-12-05T01:29:46.000Z
|
2022-02-18T17:13:46.000Z
|
Scripts/sims4communitylib/utils/sims/common_relationship_utils.py
|
ColonolNutty/Sims4CommunityLibrary
|
684f28dc3c7deb4d9fd520e21e63942b65a91d31
|
[
"CC-BY-4.0"
] | 28
|
2019-09-07T04:11:05.000Z
|
2022-02-07T18:31:40.000Z
|
"""
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from typing import Iterator, Union
from server_commands.argument_helpers import OptionalTargetParam
from sims.sim_info import SimInfo
from sims4.commands import Command, CommandType, CheatOutput
from sims4.resources import Types
from sims4communitylib.enums.relationship_bits_enum import CommonRelationshipBitId
from sims4communitylib.enums.relationship_tracks_enum import CommonRelationshipTrackId
from sims4communitylib.modinfo import ModInfo
from sims4communitylib.utils.common_log_registry import CommonLogRegistry
from sims4communitylib.utils.common_resource_utils import CommonResourceUtils
from sims4communitylib.utils.sims.common_sim_name_utils import CommonSimNameUtils
from sims4communitylib.utils.sims.common_sim_utils import CommonSimUtils
from sims4communitylib.utils.sims.common_species_utils import CommonSpeciesUtils
class CommonRelationshipUtils:
"""Utilities for manipulating relationship bits, tracks, etc.
"""
@staticmethod
def has_met(sim_info: SimInfo, target_sim_info: SimInfo) -> bool:
"""has_met(sim_info, target_sim_info)
Determine if a Sim has met the Target Sim.
:param sim_info: The Sim to check.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim to check.
:type target_sim_info: SimInfo
:return: True, if both Sims have met each other. False, if not.
:rtype: bool
"""
return CommonRelationshipUtils.has_relationship_bit_with_sim(sim_info, target_sim_info, CommonRelationshipBitId.HAS_MET)
@staticmethod
def are_blood_relatives(sim_info_a: SimInfo, sim_info_b: SimInfo) -> bool:
"""are_blood_relatives(sim_info_a, sim_info_b)
Determine if two Sims are blood relatives.
:param sim_info_a: An instance of a Sim.
:type sim_info_a: SimInfo
:param sim_info_b: An instance of a Sim.
:type sim_info_b: SimInfo
:return: True, if Sim A is blood relative of Sim B. False, if not.
:rtype: bool
"""
if sim_info_a is None or sim_info_b is None:
return False
return not sim_info_a.incest_prevention_test(sim_info_b)
@staticmethod
def is_romantically_committed_to_any_sims(sim_info: SimInfo) -> bool:
"""is_romantically_committed_to_any_sims(sim_info)
Determine if the Sim is romantically committed to any Sims.
:param sim_info: The Sim to check.
:type sim_info: SimInfo
:return: True, if the Sim is romantically committed to any Sims. False, if not.
:rtype: bool
"""
return any(CommonRelationshipUtils.get_sim_info_of_all_sims_romantically_committed_to_generator(sim_info))
@staticmethod
def is_romantically_committed_to(sim_info: SimInfo, target_sim_info: SimInfo) -> bool:
"""is_romantically_committed_to(sim_info, target_sim_info)
Determine if a Sim is romantically committed to the Target Sim.
:param sim_info: The Sim to check.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim to check.
:type target_sim_info: SimInfo
:return: True, if the Sim is romantically committed to the Target Sim. False, if not.
:rtype: bool
"""
return target_sim_info in CommonRelationshipUtils.get_sim_info_of_all_sims_romantically_committed_to_generator(sim_info)
@staticmethod
def get_friendship_level(sim_info: SimInfo, target_sim_info: SimInfo) -> float:
"""get_friendship_level(sim_info, target_sim_info)
Retrieve the level of Friendship between two Sims.
:param sim_info: The Sim to use.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim to use.
:type target_sim_info: SimInfo
:return: The current level of friendship between two Sims.
:rtype: float
"""
track_id = CommonRelationshipUtils._determine_friendship_track(sim_info, target_sim_info)
if track_id == -1:
return -1.0
return CommonRelationshipUtils.get_relationship_level_of_sims(sim_info, target_sim_info, track_id)
@staticmethod
def get_romance_level(sim_info: SimInfo, target_sim_info: SimInfo) -> float:
"""get_romance_level(sim_info, target_sim_info)
Retrieve the level of Romance between two Sims.
:param sim_info: The Sim to use.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim to use.
:type target_sim_info: SimInfo
:return: The current level of romance between two Sims.
:rtype: float
"""
track_id = CommonRelationshipUtils._determine_romance_track(sim_info, target_sim_info)
if track_id == -1:
return -1.0
return CommonRelationshipUtils.get_relationship_level_of_sims(sim_info, target_sim_info, track_id)
@staticmethod
def calculate_average_relationship_level(sim_info: SimInfo, target_sim_info: SimInfo) -> float:
"""calculate_average_relationship_level(sim_info, target_sim_info)
Calculate an average level for Friendship and Romance between two Sims.
.. note:: Math: (Friendship Level + Romance Level)/2
.. note::
Example Levels:
Friendship Level: 10
Romance Level: 20
Average: 15
:param sim_info: The Sim to use.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim to use.
:type target_sim_info: SimInfo
:return: The average level of friendship and romance between two Sims.
:rtype: float
"""
return (CommonRelationshipUtils.get_friendship_level(sim_info, target_sim_info) + CommonRelationshipUtils.get_romance_level(sim_info, target_sim_info)) / 2
@staticmethod
def has_relationship_bit_with_any_sims(sim_info: SimInfo, relationship_bit_id: Union[int, CommonRelationshipBitId], instanced_only: bool=True) -> bool:
"""has_relationship_bit_with_any_sims(sim_info, relationship_bit_id, instance_only=True)
Determine if a Sim has the specified relationship bit with any Sims.
:param sim_info: The Sim to use.
:type sim_info: SimInfo
:param relationship_bit_id: The identifier of the Relationship Bit to check for.
:type relationship_bit_id: Union[int, CommonRelationshipBitId]
:param instanced_only: If True, only Sims that are currently loaded will be valid.
:type instanced_only: bool, optional
:return: True, if the Sim has the specified Relationship Bit with any Sims. False, if not.
:rtype: bool
"""
return any(CommonRelationshipUtils.get_sim_info_of_all_sims_with_relationship_bit_generator(sim_info, relationship_bit_id, instanced_only=instanced_only))
@staticmethod
def has_relationship_bits_with_any_sims(sim_info: SimInfo, relationship_bit_ids: Iterator[int], instanced_only: bool=True) -> bool:
"""has_relationship_bits_with_any_sims(sim_info, relationship_bit_ids, instanced_only=True)
Determine if a Sim has the specified relationship bits with any Sims.
:param sim_info: The Sim to use.
:type sim_info: SimInfo
:param relationship_bit_ids: A collection of identifier of Relationship Bits to check for.
:type relationship_bit_ids: int
:param instanced_only: If True, only Sims that are currently loaded will be valid.
:type instanced_only: bool, optional
:return: True, if the Sim has any of the specified Relationship Bits with any Sims. False, if not.
:rtype: bool
"""
return any(CommonRelationshipUtils.get_sim_info_of_all_sims_with_relationship_bits_generator(sim_info, relationship_bit_ids, instanced_only=instanced_only))
@staticmethod
def has_relationship_bit_with_sim(
sim_info: SimInfo,
target_sim_info: SimInfo,
relationship_bit_id: Union[int, CommonRelationshipBitId],
) -> bool:
"""has_relationship_bit_with_sim(sim_info, target_sim_info, relationship_bit_id)
Determine if two Sims have the specified relationship bit with each other.
:param sim_info: The Sim to check.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim of the relationship bit (The target is especially important for Unidirectional/One Way Relationship Bits).
:type target_sim_info: SimInfo
:param relationship_bit_id: The identifier of the Relationship Bit to check for.
:type relationship_bit_id: Union[int, CommonRelationshipBitId]
:return: True, if the Sim has the specified Relationship Bit with the Target Sim. False, if not.
:rtype: bool
"""
return CommonRelationshipUtils.has_relationship_bits_with_sim(sim_info, target_sim_info, (relationship_bit_id,))
@staticmethod
def has_relationship_bits_with_sim(
sim_info: SimInfo,
target_sim_info: SimInfo,
relationship_bit_ids: Iterator[Union[int, CommonRelationshipBitId]],
) -> bool:
"""has_relationship_bits_with_sim(sim_info, target_sim_info, relationship_bit_ids)
Determine if two sims have any of the specified relationship bits with each other.
:param sim_info: The Sim to check.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim of the relationship bit (The target is especially important for Unidirectional/One Way Relationship Bits).
:type target_sim_info: SimInfo
:param relationship_bit_ids: A collection of identifier of Relationship Bits to check for.
:type relationship_bit_ids: Iterator[Union[int, CommonRelationshipBitId]]
:return: True, if the Sim has any of the specified Relationship Bits with the Target Sim. False, if not.
:rtype: bool
"""
target_sim_id = CommonSimUtils.get_sim_id(target_sim_info)
relationship_bits = sim_info.relationship_tracker.get_all_bits(target_sim_id)
for relationship_bit in relationship_bits:
relationship_bit_id = getattr(relationship_bit, 'guid64', None)
if relationship_bit_id in relationship_bit_ids:
return True
return False
@staticmethod
def get_relationship_level_of_sims(
sim_info: SimInfo,
target_sim_info: SimInfo,
relationship_track_id: Union[int, CommonRelationshipTrackId]
) -> float:
"""get_relationship_level_of_sims(sim_info, target_sim_info, relationship_track_id)
Retrieve the level of a relationship track between two sims.
:param sim_info: The Sim to check.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim of the relationship track.
:type target_sim_info: SimInfo
:param relationship_track_id: An identifier for a Relationship Track to retrieve.
:type relationship_track_id: Union[int, CommonRelationshipTrackId]
:return: The current level between two Sims for the specified Relationship Track.
:rtype: float
"""
relationship_track = CommonResourceUtils.load_instance(Types.STATISTIC, relationship_track_id)
if relationship_track is None:
return 0.0
target_sim_id = CommonSimUtils.get_sim_id(target_sim_info)
return sim_info.relationship_tracker.get_relationship_score(target_sim_id, relationship_track)
@staticmethod
def change_relationship_level_of_sims(
sim_info: SimInfo,
target_sim_info: SimInfo,
relationship_track_id: Union[int, CommonRelationshipTrackId],
level: float
) -> bool:
"""change_relationship_level_of_sims(sim_info, target_sim_info, relationship_track_id, level)
Change the level of a relationship track between two Sims.
:param sim_info: The sim that owns the relationship track.
:type sim_info: SimInfo
:param target_sim_info: The target of the relationship track.
:type target_sim_info: SimInfo
:param relationship_track_id: The identifier of the Relationship Track to change.
:type relationship_track_id: : Union[int, CommonRelationshipTrackId]
:param level: The amount to add to the relationship track (Can be positive or negative).
:type level: float
:return: True, if the relationship track was changed successfully. False, if not.
:rtype: bool
"""
relationship_track = CommonResourceUtils.load_instance(Types.STATISTIC, relationship_track_id)
if relationship_track is None:
return False
target_sim_id = CommonSimUtils.get_sim_id(target_sim_info)
sim_info.relationship_tracker.add_relationship_score(target_sim_id, level, relationship_track)
return True
@staticmethod
def set_relationship_level_of_sims(
sim_info: SimInfo,
target_sim_info: SimInfo,
relationship_track_id: Union[int, CommonRelationshipTrackId],
level: float
) -> bool:
"""set_relationship_level_of_sims(sim_info, target_sim_info, relationship_track_id, level)
Set the level of a relationship track between two Sims.
:param sim_info: The sim that owns the relationship track.
:type sim_info: SimInfo
:param target_sim_info: The target of the relationship track.
:type target_sim_info: SimInfo
:param relationship_track_id: The identifier of the Relationship Track to set.
:type relationship_track_id: : Union[int, CommonRelationshipTrackId]
:param level: The amount to set the relationship track to (Can be positive or negative).
:type level: float
:return: True, if the relationship track was set successfully. False, if not.
:rtype: bool
"""
relationship_track = CommonResourceUtils.load_instance(Types.STATISTIC, relationship_track_id)
if relationship_track is None:
return False
target_sim_id = CommonSimUtils.get_sim_id(target_sim_info)
sim_info.relationship_tracker.set_relationship_score(target_sim_id, level, relationship_track)
return True
@staticmethod
def add_relationship_bit(
sim_info: SimInfo,
target_sim_info: SimInfo,
relationship_bit_id: Union[int, CommonRelationshipBitId]
) -> bool:
"""add_relationship_bit(sim_info, target_sim_info, relationship_bit_id)
Add a relationship bit between two sims.
.. note::
If the relationship bit is UNIDIRECTIONAL, it will only be added to sim_info in the direction of the Target.
i.e. Sim will have relationship bit towards Target, but Target will not have relationship bit towards Sim.
One example is the Caregiver relationship:
- Sim is caregiver of Target.
- Target is being cared for by Sim.
:param sim_info: The source Sim of the Relationship Bit.
:type sim_info: SimInfo
:param target_sim_info: The target Sim of the Relationship Bit.
:type target_sim_info: SimInfo
:param relationship_bit_id: The identifier of the Relationship Bit to add.
:type relationship_bit_id: Union[int, CommonRelationshipBitId]
:return: True, if the relationship bit was added successfully. False, if not.
:rtype: bool
"""
relationship_bit_instance = CommonResourceUtils.load_instance(Types.RELATIONSHIP_BIT, relationship_bit_id)
if relationship_bit_instance is None:
return False
target_sim_id = CommonSimUtils.get_sim_id(target_sim_info)
sim_info.relationship_tracker.add_relationship_bit(target_sim_id, relationship_bit_instance)
return True
@staticmethod
def remove_relationship_bit(
sim_info: SimInfo,
target_sim_info: SimInfo,
relationship_bit_id: Union[int, CommonRelationshipBitId]
) -> bool:
"""remove_relationship_bit(sim_info, target_sim_info, relationship_bit_id)
Remove a relationship bit between two sims.
.. note::
If the relationship bit is UNIDIRECTIONAL, it will only be removed from sim_info in the direction of the Target.
i.e. Sim will have no longer have relationship bit towards Target, but Target will still have relationship bit towards Sim.
One example is the Caregiver relationship:
- Sim is caregiver of Target.
- Target is being cared for by Sim.
:param sim_info: The source Sim of the Relationship Bit.
:type sim_info: SimInfo
:param target_sim_info: The target Sim of the Relationship Bit.
:type target_sim_info: SimInfo
:param relationship_bit_id: The identifier of the Relationship Bit to remove.
:type relationship_bit_id: Union[int, CommonRelationshipBitId]
:return: True, if the relationship bit was removed successfully. False, if not.
:rtype: bool
"""
relationship_bit_instance = CommonResourceUtils.load_instance(Types.RELATIONSHIP_BIT, relationship_bit_id)
if relationship_bit_instance is None:
return False
target_sim_id = CommonSimUtils.get_sim_id(target_sim_info)
sim_info.relationship_tracker.remove_relationship_bit(target_sim_id, relationship_bit_instance)
return True
@staticmethod
def get_sim_info_of_all_sims_with_relationship_bit_generator(sim_info: SimInfo, relationship_bit_id: Union[int, CommonRelationshipBitId], instanced_only: bool=True) -> Iterator[SimInfo]:
"""get_sim_info_of_all_sims_with_relationship_bit_generator(sim_info, relationship_bit_id, instanced_only=True)
Retrieve an Iterator of SimInfo for all Sims that have the specified relationship bit with the specified Sim.
.. note::
For UNIDIRECTIONAL relationship bits, the direction is sim_info has relationship bit with target_sim_info
Caregiver example:
- The Caregiver has a relationship bit pointed at Toddler (The Caregiver would show "caregiving ward" when hovering over the Toddler in the relationships panel)
- The Toddler would NOT have the relationship bit.
- Sim is Caregiver of Toddler.
:param sim_info: The Sim to locate the relationship bit on.
:type sim_info: SimInfo
:param relationship_bit_id: The identifier of the relationship bit to locate connections with.
:type relationship_bit_id: Union[int, CommonRelationshipBitId]
:param instanced_only: If True, only Sims that are currently loaded will be returned.
:type instanced_only: bool, optional
:return: An iterable of Sims that have the specified relationship bit with the specified Sim.
:rtype: Iterator[SimInfo]
"""
return CommonRelationshipUtils.get_sim_info_of_all_sims_with_relationship_bits_generator(sim_info, (relationship_bit_id, ), instanced_only=instanced_only)
@staticmethod
def get_sim_info_of_all_sims_with_relationship_bits_generator(sim_info: SimInfo, relationship_bit_ids: Iterator[Union[int, CommonRelationshipBitId]], instanced_only: bool=True) -> Iterator[SimInfo]:
"""get_sim_info_of_all_sims_with_relationship_bits_generator(sim_info, relationship_bit_ids, instanced_only=True)
Retrieve an Iterator of SimInfo for all Sims that have the specified relationship bits with the specified Sim.
.. note::
For UNIDIRECTIONAL relationship bits, the direction is sim_info has relationship bit with target_sim_info
Caregiver example:
- The Caregiver has a relationship bit pointed at Toddler (The Caregiver would show "caregiving ward" when hovering over the toddler in the relationships panel)
- The toddler would NOT have the relationship bit.
- Sim is Caregiver of Toddler.
:param sim_info: The Sim to locate relationship bits on.
:type sim_info: SimInfo
:param relationship_bit_ids: A collection of identifiers for relationship bits to locate connections with.
:type relationship_bit_ids: Iterator[Union[int, CommonRelationshipBitId]]
:param instanced_only: If True, only Sims that are currently loaded will be returned.
:type instanced_only: bool, optional
:return: An iterable of Sims that have any of the specified relationship bits with the specified Sim.
:rtype: Iterator[SimInfo]
"""
if sim_info is None:
return tuple()
sim_id = CommonSimUtils.get_sim_id(sim_info)
for relationship in sim_info.relationship_tracker:
if relationship.sim_id_a != sim_id:
target_sim_id = relationship.sim_id_a
else:
target_sim_id = relationship.sim_id_b
target_sim_info = CommonSimUtils.get_sim_info(target_sim_id)
if target_sim_info is None:
continue
if instanced_only and CommonSimUtils.get_sim_instance(target_sim_info) is None:
continue
for relationship_bit_id in relationship_bit_ids:
relationship_bit_instance = CommonResourceUtils.load_instance(Types.RELATIONSHIP_BIT, relationship_bit_id)
if relationship_bit_instance is None:
continue
if relationship.has_bit(sim_id, relationship_bit_instance):
yield target_sim_info
break
@staticmethod
def has_positive_romantic_combo_relationship_bit_with(sim_info: SimInfo, target_sim_info: SimInfo) -> bool:
"""has_positive_romantic_combo_relationship_bit_with(sim_info, target_sim_info)
Determine if a Sim has a positive romantic combo with the Target Sim.
.. note::
Positive Romantic Combo Relationship Bits:
- Soul Mates
- Lovers
- Sweethearts
- Love Birds
:param sim_info: The Sim to check.
:type sim_info: SimInfo
:param target_sim_info: The Target Sim to check.
:type target_sim_info: SimInfo
:return: True, if the Sims have positive romantic combo relationship bits with each other. False, if not.
:rtype: bool
"""
return CommonRelationshipUtils.has_relationship_bits_with_sim(sim_info, target_sim_info, (
CommonRelationshipBitId.ROMANTIC_COMBO_SOUL_MATES,
CommonRelationshipBitId.ROMANTIC_COMBO_LOVERS,
CommonRelationshipBitId.ROMANTIC_COMBO_SWEETHEARTS,
CommonRelationshipBitId.ROMANTIC_COMBO_LOVEBIRDS
))
@staticmethod
def get_sim_info_of_all_sims_romantically_committed_to_generator(sim_info: SimInfo, instanced_only: bool=True) -> Iterator[SimInfo]:
"""get_sim_info_of_all_sims_romantically_committed_to_generator(sim_info, instanced_only=True)
Retrieve a SimInfo object for all Sims romantically committed with the specified Sim.
.. note::
Romantic Commitments:
- Married
- Getting Married
- Engaged
- Significant Other
:param sim_info: The Sim to locate romantically involved Sims with.
:type sim_info: SimInfo
:param instanced_only: If True, only Sims that are currently loaded will be returned.
:type instanced_only: bool, optional
:return: An iterable of Sims the specified Sim is romantically committed to.
:rtype: Iterator[SimInfo]
"""
romance_relationship_ids = (
CommonRelationshipBitId.ROMANTIC_MARRIED,
CommonRelationshipBitId.ROMANTIC_GETTING_MARRIED,
CommonRelationshipBitId.ROMANTIC_ENGAGED,
CommonRelationshipBitId.ROMANTIC_SIGNIFICANT_OTHER
)
for target_sim_info in CommonRelationshipUtils.get_sim_info_of_all_sims_with_relationship_bits_generator(sim_info, romance_relationship_ids, instanced_only=instanced_only):
yield target_sim_info
@staticmethod
def _determine_friendship_track(sim_info_a: SimInfo, sim_info_b: SimInfo) -> Union[CommonRelationshipTrackId, int]:
if CommonSpeciesUtils.is_human(sim_info_a):
if CommonSpeciesUtils.is_animal(sim_info_b):
return CommonRelationshipTrackId.SIM_TO_PET_FRIENDSHIP
elif CommonSpeciesUtils.is_human(sim_info_b):
return CommonRelationshipTrackId.FRIENDSHIP
elif CommonSpeciesUtils.is_animal(sim_info_a):
if CommonSpeciesUtils.is_animal(sim_info_b):
return -1
elif CommonSpeciesUtils.is_human(sim_info_b):
return CommonRelationshipTrackId.SIM_TO_PET_FRIENDSHIP
return -1
@staticmethod
def _determine_romance_track(sim_info_a: SimInfo, sim_info_b: SimInfo) -> Union[CommonRelationshipTrackId, int]:
if CommonSpeciesUtils.is_human(sim_info_a) and CommonSpeciesUtils.is_human(sim_info_b):
return CommonRelationshipTrackId.ROMANCE
return -1
log = CommonLogRegistry().register_log(ModInfo.get_identity(), 'common_relationship_commands')
log.enable()
@Command('s4clib.print_relationship_bits', command_type=CommandType.Live)
def _common_print_relationship_bits(opt_sim: OptionalTargetParam=None, _connection: int=None):
from server_commands.argument_helpers import get_optional_target
output = CheatOutput(_connection)
sim_info = CommonSimUtils.get_sim_info(get_optional_target(opt_sim, _connection))
if sim_info is None:
output('Failed, no Sim was specified or the specified Sim was not found!')
return
output('Printing relationships of Sim {}'.format(CommonSimNameUtils.get_full_name(sim_info)))
sim_id_a = CommonSimUtils.get_sim_id(sim_info)
text = ''
for relationship in sim_info.relationship_tracker:
sim_info_b = relationship.get_other_sim_info(sim_id_a)
try:
sim_a_name = CommonSimNameUtils.get_full_name(sim_info)
sim_b_name = CommonSimNameUtils.get_full_name(sim_info_b)
bi_direction_bits = relationship._bi_directional_relationship_data._bits
inner_text = '\n---------------------Relationship ({} to {})---------------------'.format(sim_a_name, sim_b_name)
if bi_direction_bits:
inner_text += '\n Bi-Directional Bits:'
for (key, value) in bi_direction_bits.items():
bit_type = type(value)
inner_text += '\n - {} ({})'.format(key.__name__, bit_type.__mro__[1].__name__)
inner_text += '\n'
sim_a_relationship_bits = relationship._sim_a_relationship_data._bits
if sim_a_relationship_bits:
inner_text += '\n Unidirectional Bits Sim A (What {} is to {}):'.format(sim_b_name, sim_a_name)
for (key, value) in sim_a_relationship_bits.items():
bit_type = type(value)
inner_text += '\n - {} ({})'.format(key.__name__, bit_type.__mro__[1].__name__)
inner_text += '\n'
sim_b_relationship_bits = relationship._sim_b_relationship_data._bits
if sim_b_relationship_bits:
inner_text += '\n Unidirectional Bits Sim B (What {} is to {}):'.format(sim_a_name, sim_b_name)
for (key, value) in sim_b_relationship_bits.items():
bit_type = type(value)
inner_text += '\n - {} ({})'.format(key.__name__, bit_type.__mro__[1].__name__)
inner_text += '\n'
output(inner_text)
text += inner_text
except Exception as ex:
output('An error occurred {}'.format(ex))
log.format_error_with_message('Failed to print relationships', sim_info_b=sim_info_b, exception=ex)
log.debug(text)
output('Done')
| 47.730508
| 202
| 0.704449
| 3,542
| 28,161
| 5.303219
| 0.075663
| 0.085711
| 0.052598
| 0.027683
| 0.809306
| 0.776086
| 0.735253
| 0.705707
| 0.648744
| 0.610573
| 0
| 0.002038
| 0.233408
| 28,161
| 589
| 203
| 47.811545
| 0.868075
| 0.434644
| 0
| 0.462185
| 0
| 0
| 0.03176
| 0.008369
| 0
| 0
| 0
| 0
| 0
| 1
| 0.096639
| false
| 0
| 0.058824
| 0
| 0.310924
| 0.012605
| 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
|
26d4906edf1d5b6d89de3ed3fabcb7cc558a3793
| 278
|
py
|
Python
|
modules/__init__.py
|
ongzhixian/python-apps
|
11a0d0ce656a7e9d7bdff18dd29feaa2bb436ae6
|
[
"MIT"
] | null | null | null |
modules/__init__.py
|
ongzhixian/python-apps
|
11a0d0ce656a7e9d7bdff18dd29feaa2bb436ae6
|
[
"MIT"
] | null | null | null |
modules/__init__.py
|
ongzhixian/python-apps
|
11a0d0ce656a7e9d7bdff18dd29feaa2bb436ae6
|
[
"MIT"
] | null | null | null |
################################################################################
# Define package composition
################################################################################
__all__ = ["toto_data", "sw_news_data", "toto_news_data", "ses_data", "project_mgmt"]
| 46.333333
| 85
| 0.309353
| 16
| 278
| 4.6875
| 0.6875
| 0.213333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05036
| 278
| 5
| 86
| 55.6
| 0.284091
| 0.093525
| 0
| 0
| 0
| 0
| 0.611111
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
26d5f0ce951788600864e2b34cae82291c53c302
| 72
|
py
|
Python
|
etc/ext_suffix.py
|
gerrymanoim/libpy
|
ffe19d53aa9602893aecc2dd8c9feda90e06b262
|
[
"Apache-2.0"
] | 71
|
2020-06-26T00:36:33.000Z
|
2021-12-02T13:57:02.000Z
|
etc/ext_suffix.py
|
stefan-jansen/libpy
|
e174ee103db76a9d0fcd29165d54c676ed1f2629
|
[
"Apache-2.0"
] | 32
|
2020-06-26T18:59:15.000Z
|
2022-03-01T19:02:44.000Z
|
etc/ext_suffix.py
|
gerrymanoim/libpy
|
ffe19d53aa9602893aecc2dd8c9feda90e06b262
|
[
"Apache-2.0"
] | 24
|
2020-06-26T17:01:57.000Z
|
2022-02-15T00:25:27.000Z
|
import sysconfig
print(sysconfig.get_config_var('EXT_SUFFIX') or '.so')
| 24
| 54
| 0.791667
| 11
| 72
| 4.909091
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.069444
| 72
| 2
| 55
| 36
| 0.80597
| 0
| 0
| 0
| 0
| 0
| 0.180556
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
f83ad50c67085bfb9e31d1a1bf1c5fae5dce3a9a
| 26,415
|
py
|
Python
|
doc/jupyter_execute/examples/cicd/sig-mlops-jenkins-classic/jenkins_classic.py
|
edshee/seldon-core
|
78c10fbca16a5e2a0c25b9673aa3deb220070e26
|
[
"Apache-2.0"
] | null | null | null |
doc/jupyter_execute/examples/cicd/sig-mlops-jenkins-classic/jenkins_classic.py
|
edshee/seldon-core
|
78c10fbca16a5e2a0c25b9673aa3deb220070e26
|
[
"Apache-2.0"
] | null | null | null |
doc/jupyter_execute/examples/cicd/sig-mlops-jenkins-classic/jenkins_classic.py
|
edshee/seldon-core
|
78c10fbca16a5e2a0c25b9673aa3deb220070e26
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
# coding: utf-8
# # MLOps with Seldon and Jenkins Classic
#
# This repository shows how you can build a Jenkins Classic pipeline to enable Continuous Integration and Continuous Delivery (CI/CD) on your Machine Learning models leveraging Seldon for deployment.
# This CI/CD pipeline will allow you to:
#
# - Run unit tests using Jenkins Classic.
# - Run end-to-end tests for your model with KIND (Kubernetes in Docker).
# - Promote your model as a across multiple (staging / prod) environments.
#
# To showcase these features we will implement add continuous integration and delivery to three different models.
# You can find these under the `/models` folder.
# As we shall see, each of them will require a [different approach to deployment](#Use-Cases).
# ## CI/CD Pipeline
#
# The diagram below provides a high level overview of the CI/CD pipeline.
# It includes an overview of all the different types of repositories, together with the stakeholders that are the primary contributors of each, as well as the Kubernetes environments in which the applications are deployed.
#
# The key pieces to note on the diagram are:
#
# - There are different types of environments with different restrictions and behaviours, e.g. staging and production.
# - It’s possible to have more than one environment for each type (as the type is just what would give it a specific type of config/behaviour).
# - The environments are by default in the same cluster (as namespaces), however it’s also possible to configure them across different clusters.
# - Each of the green boxes is a single repository, but it can also have a mono-repo approach, whereby each of the white boxes is a folder within a repo.
# 
# ### Model implementation repository
#
# From a high-level point of view, when a model implementation repository is updated by a Data Scientist or ML Engineer, the Jenkins CI will push changes to the [GitOps repository](#gitops-repository). This enables the following workflow:
#
# 1. A Data Scientist or ML Engineer trains a new model.
# 2. The Data Scientist or ML Engineer pushes the updated configuration to the model implementation repository.
# 3. The CI tool automatically builds and tests the model implementation.
# 4. The CI tool automatically pushes the change into the GitOps staging repository.
# 5. The CI tool automatically opens a PR into the GitOps production repository.
#
# One key point to highlight which may not be obvious by just looking at the diagram is that in this phase of model implementation, the example above showcases how we can leverage a re-usable model server - that is, reusing a pre-built docker image instead of building one every time.
# If there are more custom requirements, the user is in full control of the steps performed by the CI Platform Jenkins.
# This means that it is also possible to build s2i wrapped components which may require training the image every time.
#
# To gain a better understanding of how the CI/CD pipeline is implemented on each model implementation repository you can check the documented [deep dive](#diving-into-our-cicd-pipeline).
#
# #### Why a new repo for every model?
#
# A new model implementation repo is currently created because it provides us with a way to separate the “Model Deployment” phase and the “Model Training/Experimentation” phase, and allows us to use the repo as the integration between any frameworks that can serve as sources of models (MLFlow, Kubeflow, Spark, etc).
# The repo is able to store any metadata, IDs, and configuration files required, and is processed through the CI pipeline every time it is modified.
#
# #### Building a docker image in model implementation repository
#
# Whilst most of the times users of this approach will be leveraging re-usable model servers such as the SKLearn model server, it is also possible to build a docker image every single time (i.e. build a non-reusable model every time a model changes).
# This can be be done by adding the relevant steps which would most often include the s2i utility.
# This may be desired if there are non-standard linux libraries or non-standard depdencies that need to be re-installed every time.
# ### GitOps repository
#
# The state of each of our environments (e.g. production or staging) is stored on a GitOps repository.
# This repository contains all the different Kubernetes resources that have been deployed to each cluster.
# It is linked through [ArgoCD](#ArgoCD) to each of our Kubernetes clusters (or namespaces) so that a change in the repository triggers an update of our environment.
#
# When the deployment configuration of a machine learning model implementation is updated, this will automatically make the changes available through a PR to the respective manager/tech-lead/approver.
# This step will enable the end to end machine learning model promotion to be reviewed and approved by the respective individual.
#
# The manager/tech-lead will have to approve the PR before it can be merged.
# Once it’s approved, it will be merged into the GitOps repo, which will immediately trigger the update in the production namespace/cluster.
#
# You can see an example of a GitOps repository in the [SeldonIO/seldon-gitops](https://github.com/SeldonIO/seldon-gitops) repository.
# #### Re-usable model server repository
#
# If there is a need for a new reusable model server, then it’s possible to do so by creating a repository which would follow a different path.
# This would be different to the model implementation repository as it would only be built once in a while, whilst the model server would be built multiple times.
# ### Set up
#
# As a pre-requisite you need to ensure that have access to a Kubernetes cluster.
# In particular, this guide requires the following pre-requisites:
#
# - A Kubernetes cluster running v1.13+.
# - Jenkins Classic installed in your cluster. You can find instructions on how to install and configure it on the [Installing Jenkins on your K8s cluster](#Installing-Jenkins-on-your-K8s-cluster) section.
# - Seldon Core v0.5.1 installed in your cluster.
# ### Use cases
#
# This guide goes through three different methods to build and deploy your model.
# Each of these can be found under the `./models/` of this repository.
#
# - Using Seldon pre-built re-usable model servers (`./models/news_classifier`).
# - Using custom re-usable servers (`./models/images_classifier`).
# - Using custom servers with an embedded model.
# ## Diving into our CI/CD Pipeline
#
# On this section we will dive into the internals of the CI/CD pipeline for our [model implementation repositories](#Model-implementation-repository).
# This includes a detailed description of the `Jenkinsfile`, as well as a look into our suggested testing methodology.
#
# Note that this will cover a generic example.
# However, as we shall see, specialising this approach into any of our [three main use cases](#Use-cases) will be straightforward.
#
# We leverage [Jenkins Pipelines](https://jenkins.io/doc/book/pipeline/) in order to run our continuous integration and delivery automation.
# From a high-level point of view, the pipeline configuration will be responsible for:
#
# - Define a **replicable** test and build environment.
# - Run the unit and integration tests (if applicable).
# - Promote the application into our staging and production environments.
#
# We can see a `Jenkinsfile` below taken from the `./models/news_classifier` example.
# This `Jenkinsfile` defines a pipeline which takes into account all of the points mentioned above.
# The following sections will dive into each of the sections in a much higher detail.
# In[1]:
get_ipython().run_cell_magic('writefile', './models/news_classifier/Jenkinsfile', "pipeline {\n agent {\n kubernetes {\n defaultContainer 'core-builder'\n yamlFile 'models/news_classifier/podTemplate.yaml'\n }\n }\n\n stages {\n stage('Test') {\n steps {\n sh '''\n cd models/news_classifier\n make install_dev test\n '''\n }\n }\n\n stage('Test integration') {\n steps {\n sh '''\n cd models/news_classifier\n ./integration/kind_test_all.sh\n '''\n }\n }\n\n stage('Promote application') {\n steps {\n withCredentials([[$class: 'UsernamePasswordMultiBinding',\n credentialsId: 'github-access',\n usernameVariable: 'GIT_USERNAME',\n passwordVariable: 'GIT_PASSWORD']]) {\n sh '''\n cd models/news_classifier\n ./promote_application.sh\n '''\n }\n }\n }\n\n }\n}")
# In[2]:
get_ipython().run_cell_magic('writefile', './models/news_classifier/podTemplate.yaml', 'apiVersion: v1\nkind: Pod\nmetadata:\n name: test-pod\nspec:\n containers:\n - name: core-builder\n image: seldonio/core-builder:0.8\n resources:\n limits:\n cpu: 500m\n memory: 1500Mi\n ephemeral-storage: "15Gi"\n requests:\n cpu: 200m\n memory: 1500Mi\n ephemeral-storage: "15Gi"\n securityContext:\n privileged: true\n tty: true\n volumeMounts:\n - mountPath: /lib/modules\n name: modules\n readOnly: true\n - mountPath: /sys/fs/cgroup\n name: cgroup\n - mountPath: /var/lib/docker\n name: dind-storage\n volumes:\n - name: modules\n hostPath:\n path: /lib/modules\n - name: cgroup\n hostPath:\n path: /sys/fs/cgroup\n - name: dind-storage\n emptyDir: {}')
# ### Replicable test and build environment
#
# In order to ensure that our test environments are versioned and replicable, we make use of the [Jenkins Kubernetes plugin](https://github.com/jenkinsci/kubernetes-plugin).
# This will allow us to create a Docker image with all the necessary tools for testing and building our models.
# Using this image, we will then spin up a separate pod, where all our build instructions will be ran.
# We will use the `podTemplate()` object in the Jenkins Pipeline configuration to define the requirements of this pod
#
# Since it leverages Kubernetes underneath, this also ensure that our CI/CD pipelines are easily scalable.
# ### Integration tests
#
# Now that we have a model that we want to be able to deploy, we want to make sure that we run end-to-end tests on that model to make sure everything works as expected.
# For this we will leverage the same framework that the Kubernetes team uses to test Kubernetes itself: [KIND](https://kind.sigs.k8s.io/).
#
# KIND stands for Kubernetes-in-Docker, and is used to isolate a Kubernetes environent for end-to-end tests.
# In our case, we will use this isolated environment to test our model.
#
# The steps we'll have to carry out include:
#
# 1. Enable Docker within your CI/CD pod.
# 2. Add an integration test stage.
# 3. Leverage the `kind_test_all.sh` script that creates a KIND cluster and runs the tests.
#
# #### Add integration stage to Jenkins
#
# We can leverage Jenkins Pipelines to manage the different stages of our CI/CD pipeline.
# In particular, to add an integration stage, we can use the `stage()` object:
#
# ```groovy
# stage('Test integration') {
# steps {
# sh '''
# cd models/news_classifier
# ./integration/kind_test_all.sh
# '''
# }
# }
# ```
# #### Enable Docker
#
# To test our models, we will need to build their respective containers, for which we will need Docker.
# In order to do so, we will first need to mount a few volumes into the CI/CD container.
# These basically consist of the core components that docker will need to be able to run.
# To mount them we will add these entries into the `podTemplate.yaml` file.
#
# Please also note that we set container to run in `privileged` mode.
#
#
# ```yaml
# ApiVersion: v1
# ...
# spec:
# containers:
# - name: core-builder
# ...
# securityContext:
# privileged: true
# ...
# volumeMounts:
# - mountPath: /lib/modules
# name: modules
# readOnly: true
# - mountPath: /sys/fs/cgroup
# name: cgroup
# - mountPath: /var/lib/docker
# name: dind-storage
# volumes:
# - name: modules
# hostPath:
# path: /lib/modules
# - name: cgroup
# hostPath:
# path: /sys/fs/cgroup
# - name: dind-storage
# emptyDir: {}
# ```
# #### Run tests in Kind
#
# The `kind_run_all.sh` may seem complicated at first, but it's actually quite simple.
# All the script does is set-up a kind cluster with all dependencies, deploy the model and clean everything up.
# Let's break down each of the components within the script.
# We first start the docker daemon and wait until Docker is running (using `docker ps q` for guidance.
#
# ```bash
# ## FIRST WE START THE DOCKER DAEMON
# service docker start
# ## the service can be started but the docker socket not ready, wait for ready
# WAIT_N=0
# while true; do
# # docker ps -q should only work if the daemon is ready
# docker ps -q > /dev/null 2>&1 && break
# if [[ ${WAIT_N} -lt 5 ]]; then
# WAIT_N=$((WAIT_N+1))
# echo "[SETUP] Waiting for Docker to be ready, sleeping for ${WAIT_N} seconds ..."
# sleep ${WAIT_N}
# else
# echo "[SETUP] Reached maximum attempts, not waiting any longer ..."
# break
# fi
# done
# ```
# Once we're running a docker daemon, we can run the command to create our KIND cluster, and install all the components.
# This will set up a Kubernetes cluster using the docker daemon (using containers as Nodes), and then install Ambassador + Seldon Core.
#
#
# ```bash
# ########################################
# ## AVOID EXIT ON ERROR FOR FOLLOWING CMDS
# set +o errexit
#
# ## START CLUSTER
# make kind_create_cluster
# KIND_EXIT_VALUE=$?
#
# ## Ensure we reach the kubeconfig path
# export KUBECONFIG=$(kind get kubeconfig-path)
#
# ## ONLY RUN THE FOLLOWING IF SUCCESS
# if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then
# # KIND CLUSTER SETUP
# make kind_setup
# SETUP_EXIT_VALUE=$?
# ```
# We can now run the tests; for this we run all the dev installations and kick off our tests (which we'll add inside of the integration folder).
#
# ```bash
# # BUILD S2I BASE IMAGES
# make build
# S2I_EXIT_VALUE=$?
#
# ## INSTALL ALL REQUIRED DEPENDENCIES
# make install_integration_dev
# INSTALL_EXIT_VALUE=$?
#
# ## RUNNING TESTS AND CAPTURING ERROR
# make test
# TEST_EXIT_VALUE=$?
# fi
# ```
#
# Finally we just clean everything, including the cluster, the containers and the docker daemon.
#
# ```bash
# ## DELETE KIND CLUSTER
# make kind_delete_cluster
# DELETE_EXIT_VALUE=$?
#
# ########################################
# ## EXIT STOPS COMMANDS FROM HERE ONWARDS
# set -o errexit
#
# ## CLEANING DOCKER
# docker ps -aq | xargs -r docker rm -f || true
# service docker stop || true
# ```
# ### Promote your application
#
# After running our integration tests, the last step is to promote our model to our staging and production environments.
# For that, we will leverage our [GitOps repository](#GitOps-repository) where the state of each environment is stored.
#
# In particular, we will:
#
# - Push a change to the staging GitOps repository, which will update the staging environment instantly.
# - Submit a PR to the production GitOps repository, which will wait for a Tech Lead / Manager approval.
#
# This will be handled by the `promote_application.sh` script, which can be seen below.
# In[13]:
get_ipython().run_cell_magic('writefile', './models/news_classifier/promote_application.sh', '##!/bin/bash\n\n## ENSURE WE ARE IN THE DIR OF SCRIPT\ncd -P -- "$(dirname -- "$0")"\n## SO WE CAN MOVE RELATIVE TO THE ACTUAL BASE DIR\n\nexport GITOPS_REPO="seldon-gitops"\nexport GITOPS_ORG="adriangonz"\nexport STAGING_FOLDER="staging"\nexport PROD_FOLDER="production"\n\n## This is the user that is going to be assigned to PRs\nexport GIT_MANAGER="adriangonz"\n\nexport UUID=$(cat /proc/sys/kernel/random/uuid)\n\ngit clone https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${GITOPS_ORG}/${GITOPS_REPO}\n\ncd ${GITOPS_REPO}\ncp -r ../charts/* ${STAGING_FOLDER}/.\nls ${STAGING_FOLDER}\n\n## Check if any modifications identified\ngit add -N ${STAGING_FOLDER}/\ngit --no-pager diff --exit-code --name-only origin/master ${STAGING_FOLDER}\nSTAGING_MODIFIED=$?\nif [[ $STAGING_MODIFIED -eq 0 ]]; then\n echo "Staging env not modified"\n exit 0\nfi\n\n## Adding changes to staging repo automatically\ngit add ${STAGING_FOLDER}/\ngit commit -m \'{"Action":"Deployment created","Message":"","Author":"","Email":""}\'\ngit push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${GITOPS_ORG}/${GITOPS_REPO}\n\n## Add PR to prod\ncp -r ../charts/* production/.\n\n## Create branch and push\ngit checkout -b ${UUID}\ngit add ${PROD_FOLDER}/\ngit commit -m \'{"Action":"Moving deployment to production repo","Message":"","Author":"","Email":""}\'\ngit push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${GITOPS_ORG}/${GITOPS_REPO} ${UUID}\n\n## Create pull request\nexport PR_RESULT=$(curl \\\n -u ${GIT_USERNAME}:${GIT_PASSWORD} \\\n -v -H "Content-Type: application/json" \\\n -X POST -d "{\\"title\\": \\"SeldonDeployment Model Promotion Request - UUID: ${UUID}\\", \\"body\\": \\"This PR contains the deployment for the Seldon Deploy model and has been allocated for review and approval for relevant manager.\\", \\"head\\": \\"${UUID}\\", \\"base\\": \\"master\\" }" \\\n https://api.github.com/repos/$GITOPS_ORG/$GITOPS_REPO/pulls)\nexport ISSUE_NUMBER=$(echo \\\n $PR_RESULT |\n python -c \'import json,sys;obj=json.load(sys.stdin);print(obj["number"])\')\n\n## Assign PR to relevant user\ncurl \\\n -u ${GIT_USERNAME}:${GIT_PASSWORD} \\\n -v -H "Content-Type: application/json" \\\n -X POST -d "{\\"assignees\\": [\\"${GIT_MANAGER}\\"] }" \\\n https://api.github.com/repos/$GITOPS_ORG/$GITOPS_REPO/issues/$ISSUE_NUMBER')
# ## Creating a CI/CD pipeline
#
# In order to add a pipeline to Jenkins, you just have to go to the "Manage Jenkins" configuration dashboard, and click on "New Item" to create a new pipeline.
# 
#
# In the first menu, we'll add a name.
# For example, we can create a new pipeline with name `news_classifier`.
# We will then be able to add the specific details.
# Most of these will remain on "default", but we will need to change a couple of them to add a GitHub trigger, Docker access and to point to the right folder within the repository.
#
# Firstly, we will change the following:
#
# * GitHub hook trigger for GITScm polling.
# * Tick "This project is parameterised", and then when you see the next dialog:
# * Click on the "Add parameter" dropdown, and select "Credential Parameter".
# * This will open yet another box, where you want to provide the following details:
# * name: `docker-access`
# * Credential type "Username and Password"
# * Tick: required
# * Default value: Click on the "Add" dropdown, and then on "Jenkins provider":
# * This has opened another dialog box, where you want to add your docker credentials.
# * For this you need to make sure that the current selected option is "Username and Password".
# * There you have to enter your Docker username, and for password it's advised to use a Docker API Key.
# 
# Lastly, we will need to point to the right `Jenkinsfile`.
# Note that since we are working with a monorepository, where multiple model implementations are tracked, we will need to point our pipeline to the `./models/news_classifier` folder.
# If we were working with a single model implementation repository, we would only need to point to the global repo.
#
# * Select "Pipeline script from SCM" from dropdown.
# * Add the repository as SCM (in this case https://github.com/SeldonIO/sig-mlops-jenkins-classic/)
# * Point to the right `Jenkinsfile` under "Script Path". In this case, `models/news_classifier/Jenkinsfile`.
# * If needed, add credentials that will allow to access private repos.
# 
# ### Running pipeline
#
# In order to trigger a new build, we can do it manually by clicking on "Build with Parameters" and then on "Build" or we can just push a new change to our GitHub repo.
# This will take us to a view where we can see some details about each of the stages of the latest builds.
# 
# ## Installing Jenkins on your K8s cluster
#
# If you already have access to a cluster but which doesn't have Jenkins installed, you can do so easily using Helm.
# In particular, you will need to run the following:
# In[ ]:
get_ipython().run_cell_magic('bash', '', 'helm install \\\n --name "jenkins" stable/jenkins \\\n --namespace "jenkins" \\\n --set "rbac.create=true" \\\n --set "master.adminUser=admin" \\\n --set "master.adminPassword=admin" \\\n --set "master.serviceType=LoadBalancer"')
# This will install Jenkins and all the required services in the cluster.
# To get the Load Balancer where it can be accessed you can run:
# In[ ]:
get_ipython().run_cell_magic('bash', '', 'kubectl get svc -n jenkins | grep jenkins')
# ### Further configuration
#
# If you wish to set up automated pipeline triggers, you will have to install the "GitHub" plugin (there are quite a few github related ones but the one you want is the one called plainly "GitHub", which then will allow for triggering pipelines automatically on commit.
#
# - Install the GitHub Plugin [(for automated webhook triggers)](https://plugins.jenkins.io/github/).
# - Provide a GitHub token with read access so it can clone relevant repositories.
# - Set-up webhooks so that GitHub can send push requests.
#
# Additionally, you will need to configure your Git's `name` and `email` as part of Jenkins settings.
#
# 
# #### Make sure plugins are updated
#
# If you try to run a pipeline and you get an error such as "No Such DSL Method", or any strange Java exception when running a pipeline, the most probably reason is due to current plugins not being up to date.
#
# Updating your plugins can be done by going to "Manage Jenkins" -> "Plugins", and then selecct all the plugins and click "Update and load after restart". This will take you to another screen - there you should tick the checkbox that reads "restart after plugins are downloaded and installed".
#
# Once you update our plugins you should be ready to go.
# ## ArgoCD
#
# A key point of this approach to MLOps relies on having a GitOps repository which gets synced with our Kubernetes cluster.
# To achieve this we leverage [ArgoCD](https://argo-cd.readthedocs.io/en/stable/), which will take care of setting up webhooks with your GitOps repository so that on every change it triggers a synchronisation between the resources you've pushed and what's deployed on the cluster.
# ### Installation
#
# If you don't have it already, you can install ArgoCD following the [official documentation](https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd):
# In[ ]:
get_ipython().run_cell_magic('bash', '', 'kubectl create namespace argocd\nkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml')
# Additionally, you will need to install the accompanying CLI tool.
# This tool will allow you to easily link your GitOps repository taking care of the entire process.
# The instructions to install it will vary between different platforms.
# The official documentation shows the [recommended method](https://argo-cd.readthedocs.io/en/stable/cli_installation/) on each of the major ones.
# ### Setting up GitOps repository
#
# To set up the GitOps repository so that it's tracked by ArgoCD we will use the `argocd` CLI tool.
# We will assume that the `GITHUB_ORG` and `REPONAME` environment variables have been created and that the repository has already been created and can be found in the `https://github.com/$GITHUB_ORG/$REPONAME` url.
# In[ ]:
get_ipython().run_cell_magic('bash', '', 'export GITHUB_ORG=SeldonIO\nexport REPONAME=seldon-gitops')
# #### Private repositories (optional)
#
# If your repository is private, we will first need to provide the right credentials for ArgoCD to use.
# We can do so either using a [user / password login](https://argo-cd.readthedocs.io/en/stable/user-guide/private-repositories/#https-username-and-password-credential) or using [SSH keys](https://argo-cd.readthedocs.io/en/stable/user-guide/private-repositories/#tls-client-certificates-for-https-repositories).
# Note that, for the former, we can also use a [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) instead of the password.
#
# As an example, we will add our GitOps repository using a personal access token.
# We will assume that the environment variables `GITHUB_USER` and `GITHUB_TOKEN` are set.
# In[ ]:
get_ipython().run_cell_magic('bash', '', 'export GITHUB_USER=john.doe\nexport GITHUB_TOKEN=12341234\n\nargocd repo add https://github.com/$GITHUB_ORG/$REPONAME --username $GITHUB_USER --password $GITHUB_TOKEN')
# #### Create ArgoCD projects
#
# The next step is to create two projects within ArgoCD to manage the staging and production environments respectively.
# Each of them will be linked to a folder within our GitOps repository.
# In[ ]:
get_ipython().run_cell_magic('bash', '', 'argocd app create seldon-staging \\\n --repo https://github.com/$GITHUB_ORG/$REPONAME \\\n --path staging \\\n --dest-namespace staging\nargocd app create seldon-production \\\n --repo https://github.com/$GITHUB_ORG/$REPONAME \\\n --path production \\\n --dest-namespace production')
# Note that we could also sync our `staging` and `production` environment differently.
# For example, we could have them on separate repositories or separate branches.
# In this case we would also need to update the `promote_application.sh` script so that it knows how it should promote the respective model between environments.
| 58.182819
| 2,436
| 0.719175
| 3,989
| 26,415
| 4.728253
| 0.205315
| 0.002651
| 0.002068
| 0.008112
| 0.127724
| 0.08393
| 0.068554
| 0.057844
| 0.04899
| 0.036636
| 0
| 0.003092
| 0.179595
| 26,415
| 453
| 2,437
| 58.311258
| 0.867242
| 0.752338
| 0
| 0
| 0
| 1.111111
| 0.844905
| 0.165802
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.444444
| 0.111111
| 0
| 0.111111
| 0.111111
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
f86ba8ebcc560fa1396f171ff55303491d1df89d
| 48
|
py
|
Python
|
tests/__init__.py
|
itsallcode-nl/python-api-machine
|
6ce5d924cc01622f832dd6e9bc2878b003dfcb75
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
itsallcode-nl/python-api-machine
|
6ce5d924cc01622f832dd6e9bc2878b003dfcb75
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
itsallcode-nl/python-api-machine
|
6ce5d924cc01622f832dd6e9bc2878b003dfcb75
|
[
"MIT"
] | null | null | null |
"""Unit test package for python_api_machine."""
| 24
| 47
| 0.75
| 7
| 48
| 4.857143
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104167
| 48
| 1
| 48
| 48
| 0.790698
| 0.854167
| 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
|
f877b6d7a0f4206df7c2e42c466daad4789bd0d9
| 95
|
py
|
Python
|
onegreek/old.comments/old.comments/admin.py
|
goldhand/onegreek
|
1ad105f15608284a9e80802734f0c6222413a4a0
|
[
"BSD-3-Clause"
] | 1
|
2019-06-13T11:46:08.000Z
|
2019-06-13T11:46:08.000Z
|
onegreek/old.comments/old.comments/admin.py
|
goldhand/onegreek
|
1ad105f15608284a9e80802734f0c6222413a4a0
|
[
"BSD-3-Clause"
] | null | null | null |
onegreek/old.comments/old.comments/admin.py
|
goldhand/onegreek
|
1ad105f15608284a9e80802734f0c6222413a4a0
|
[
"BSD-3-Clause"
] | null | null | null |
from django.contrib import admin
from .models import PComment
admin.site.register(PComment)
| 13.571429
| 32
| 0.810526
| 13
| 95
| 5.923077
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126316
| 95
| 6
| 33
| 15.833333
| 0.927711
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f889afd041bf517bd503fb60aa6dcef53f7b6ed1
| 338
|
py
|
Python
|
components/collector/tests/source_collectors/axe_selenium_python/base.py
|
Erik-Stel/quality-time
|
602b6970e5d9088cb89cc6d488337349e54e1c9a
|
[
"Apache-2.0"
] | null | null | null |
components/collector/tests/source_collectors/axe_selenium_python/base.py
|
Erik-Stel/quality-time
|
602b6970e5d9088cb89cc6d488337349e54e1c9a
|
[
"Apache-2.0"
] | null | null | null |
components/collector/tests/source_collectors/axe_selenium_python/base.py
|
Erik-Stel/quality-time
|
602b6970e5d9088cb89cc6d488337349e54e1c9a
|
[
"Apache-2.0"
] | null | null | null |
"""Base class for unit tests for the Axe report generated by axe-selenium-python."""
from ..source_collector_test_case import SourceCollectorTestCase
class AxeSeleniumPythonTestCase(SourceCollectorTestCase): # skipcq: PTC-W0046
"""Base class for testing axe-selenium-python collectors."""
SOURCE_TYPE = "axe_selenium_python"
| 33.8
| 84
| 0.786982
| 40
| 338
| 6.5
| 0.65
| 0.126923
| 0.196154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013559
| 0.127219
| 338
| 9
| 85
| 37.555556
| 0.867797
| 0.449704
| 0
| 0
| 1
| 0
| 0.108571
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f8a4b65adbf838e98fb45de48f00d4d04be2dfd6
| 91
|
py
|
Python
|
projeto_django/mymdb/django/core/admin.py
|
Edely/django-rest-framework
|
147bede1a714b3b12b2e7d5b985379d41df44a2e
|
[
"BSD-3-Clause"
] | null | null | null |
projeto_django/mymdb/django/core/admin.py
|
Edely/django-rest-framework
|
147bede1a714b3b12b2e7d5b985379d41df44a2e
|
[
"BSD-3-Clause"
] | null | null | null |
projeto_django/mymdb/django/core/admin.py
|
Edely/django-rest-framework
|
147bede1a714b3b12b2e7d5b985379d41df44a2e
|
[
"BSD-3-Clause"
] | null | null | null |
from django.contrib import admin
from core.models import Movie
admin.site.register(Movie)
| 18.2
| 32
| 0.824176
| 14
| 91
| 5.357143
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.10989
| 91
| 4
| 33
| 22.75
| 0.925926
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f8c5ee7635c8fd99698e4c904c66afa324b916e7
| 187
|
py
|
Python
|
userprofile/admin.py
|
1919kiran/healthcare-portal
|
547d734762b6698adf8f5a7a45418e8553ca9397
|
[
"MIT"
] | null | null | null |
userprofile/admin.py
|
1919kiran/healthcare-portal
|
547d734762b6698adf8f5a7a45418e8553ca9397
|
[
"MIT"
] | 9
|
2019-12-04T22:36:31.000Z
|
2022-02-10T07:39:23.000Z
|
userprofile/admin.py
|
1919kiran/healthcare-portal
|
547d734762b6698adf8f5a7a45418e8553ca9397
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from userprofile.models import DoctorModel, PatientModel
# Register your models here.
admin.site.register(DoctorModel)
admin.site.register(PatientModel)
| 26.714286
| 56
| 0.839572
| 23
| 187
| 6.826087
| 0.565217
| 0.11465
| 0.216561
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 187
| 6
| 57
| 31.166667
| 0.923529
| 0.139037
| 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
|
3e0dd105f39840f21e9623f1e0ecdda304ae011d
| 200
|
py
|
Python
|
podcasts/admin.py
|
jrigden/podir
|
1c6ef75d39996792702858df0b3d8e04a334c171
|
[
"MIT"
] | null | null | null |
podcasts/admin.py
|
jrigden/podir
|
1c6ef75d39996792702858df0b3d8e04a334c171
|
[
"MIT"
] | null | null | null |
podcasts/admin.py
|
jrigden/podir
|
1c6ef75d39996792702858df0b3d8e04a334c171
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import Category, Episode, Podcast
admin.site.register(Category)
admin.site.register(Episode)
admin.site.register(Podcast)
| 20
| 46
| 0.805
| 27
| 200
| 5.962963
| 0.481481
| 0.167702
| 0.31677
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105
| 200
| 9
| 47
| 22.222222
| 0.899441
| 0.13
| 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
|
3e4683b31ca52b36039ae0f6dfabf419ae669d19
| 48
|
py
|
Python
|
nitropy.py
|
daringer/pynitrokey
|
dc6bb282c9e08f9de675e17f4ee3b8aca190c1e5
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
nitropy.py
|
daringer/pynitrokey
|
dc6bb282c9e08f9de675e17f4ee3b8aca190c1e5
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
nitropy.py
|
daringer/pynitrokey
|
dc6bb282c9e08f9de675e17f4ee3b8aca190c1e5
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
from pynitrokey.cli import nitropy
nitropy()
| 8
| 34
| 0.770833
| 6
| 48
| 6.166667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 48
| 5
| 35
| 9.6
| 0.925
| 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
|
3e9170f7c6af6cf167dc763436ce1a91e0be5bf5
| 135
|
py
|
Python
|
homepage/admin.py
|
tdavn/portfolio_django
|
cdbadd53d5137b15955717c15f4d3991ac5a9b7d
|
[
"MIT"
] | null | null | null |
homepage/admin.py
|
tdavn/portfolio_django
|
cdbadd53d5137b15955717c15f4d3991ac5a9b7d
|
[
"MIT"
] | null | null | null |
homepage/admin.py
|
tdavn/portfolio_django
|
cdbadd53d5137b15955717c15f4d3991ac5a9b7d
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from homepage import models
admin.site.register(models.ContactMessage)
# Register your models here.
| 19.285714
| 42
| 0.822222
| 18
| 135
| 6.166667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118519
| 135
| 6
| 43
| 22.5
| 0.932773
| 0.192593
| 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
|
e41976e69582a2bebe04232bd3c63e3b9a815244
| 28
|
py
|
Python
|
pufferfish/version.py
|
JohnUrban/pufferfish
|
27de965b34e87f775ca52daaf544a108a310e9db
|
[
"MIT"
] | null | null | null |
pufferfish/version.py
|
JohnUrban/pufferfish
|
27de965b34e87f775ca52daaf544a108a310e9db
|
[
"MIT"
] | null | null | null |
pufferfish/version.py
|
JohnUrban/pufferfish
|
27de965b34e87f775ca52daaf544a108a310e9db
|
[
"MIT"
] | null | null | null |
__version__="0.1.20200925"
| 9.333333
| 26
| 0.75
| 4
| 28
| 4.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.384615
| 0.071429
| 28
| 2
| 27
| 14
| 0.269231
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e455917aeed9a05156a25edbfe5a1f53c055b129
| 173
|
py
|
Python
|
src/ihcWrappers/responseData.py
|
F9R/ihcpmslib-wrappers
|
4a5e37ab2ecc8c8c1a8437992e45b9271ec18826
|
[
"BSD-2-Clause"
] | 1
|
2022-02-09T06:41:20.000Z
|
2022-02-09T06:41:20.000Z
|
src/ihcWrappers/responseData.py
|
F9R/ihcpmslib-wrappers
|
4a5e37ab2ecc8c8c1a8437992e45b9271ec18826
|
[
"BSD-2-Clause"
] | null | null | null |
src/ihcWrappers/responseData.py
|
F9R/ihcpmslib-wrappers
|
4a5e37ab2ecc8c8c1a8437992e45b9271ec18826
|
[
"BSD-2-Clause"
] | null | null | null |
class ResponseDataWrapper:
def __init__(self, responseData) -> None:
self._rd = responseData
@property
def Raw(self) -> str:
return self._rd.Raw
| 24.714286
| 45
| 0.641618
| 19
| 173
| 5.526316
| 0.631579
| 0.114286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.260116
| 173
| 7
| 46
| 24.714286
| 0.820313
| 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
|
e4674a2241c5acef7186c44a28ec1661c378af7b
| 45
|
py
|
Python
|
compilerTest.py
|
Kaarel94/Ozobot-Python
|
4290a55df9447404fbe3326870338c55d6d634cc
|
[
"MIT"
] | 32
|
2017-04-09T07:10:40.000Z
|
2022-03-08T08:09:34.000Z
|
compilerTest.py
|
Kaarel94/Ozobot-Python
|
4290a55df9447404fbe3326870338c55d6d634cc
|
[
"MIT"
] | 1
|
2017-12-20T16:58:53.000Z
|
2018-02-09T15:26:44.000Z
|
compilerTest.py
|
Kaarel94/Ozobot-Python
|
4290a55df9447404fbe3326870338c55d6d634cc
|
[
"MIT"
] | 10
|
2017-04-09T19:02:19.000Z
|
2022-03-22T20:58:19.000Z
|
import ozopython
ozopython.run("test.ozopy")
| 15
| 27
| 0.8
| 6
| 45
| 6
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 45
| 3
| 27
| 15
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0.217391
| 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
|
e471b7dc9eb9b6fb0b9b88cc3f85915a8a7f5d4f
| 253
|
py
|
Python
|
backend/hmobiweb/apps/monitoring_solutions/apps.py
|
starkyller/dissertacao
|
b182b29171942066f59e8d222039a431dd3fe203
|
[
"MIT"
] | null | null | null |
backend/hmobiweb/apps/monitoring_solutions/apps.py
|
starkyller/dissertacao
|
b182b29171942066f59e8d222039a431dd3fe203
|
[
"MIT"
] | null | null | null |
backend/hmobiweb/apps/monitoring_solutions/apps.py
|
starkyller/dissertacao
|
b182b29171942066f59e8d222039a431dd3fe203
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class MonitoringSolutionsConfig(AppConfig):
#name = 'monitoring_solutions'
name = 'apps.monitoring_solutions'
verbose_name = _('Monitoring Solutions')
| 36.142857
| 55
| 0.790514
| 27
| 253
| 7.185185
| 0.592593
| 0.293814
| 0.237113
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134387
| 253
| 7
| 56
| 36.142857
| 0.885845
| 0.114625
| 0
| 0
| 0
| 0
| 0.200893
| 0.111607
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
90474e7654f95062a863dddc69d0a18f58117b10
| 175
|
py
|
Python
|
func_over.py
|
evanascence27/py_prog
|
d6eb7cc3d399ba3ff5c1214e5aed6f9acc75596c
|
[
"MIT"
] | null | null | null |
func_over.py
|
evanascence27/py_prog
|
d6eb7cc3d399ba3ff5c1214e5aed6f9acc75596c
|
[
"MIT"
] | null | null | null |
func_over.py
|
evanascence27/py_prog
|
d6eb7cc3d399ba3ff5c1214e5aed6f9acc75596c
|
[
"MIT"
] | null | null | null |
class Math:
def Sum(a,b):
return a+b
def Sum(a,b,c):
return a+b+c
def Sum(a,b,c,d):
return a+b+c+d
ob=Math()
print(ob.Sum(11,22))
| 17.5
| 23
| 0.474286
| 36
| 175
| 2.305556
| 0.361111
| 0.144578
| 0.144578
| 0.289157
| 0.216867
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035088
| 0.348571
| 175
| 9
| 24
| 19.444444
| 0.692982
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 0.777778
| 0.111111
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
5f6cfb01c125c0140459a81fd6cfaba38dbbfd9f
| 46
|
py
|
Python
|
code/abc153_a_02.py
|
KoyanagiHitoshi/AtCoder
|
731892543769b5df15254e1f32b756190378d292
|
[
"MIT"
] | 3
|
2019-08-16T16:55:48.000Z
|
2021-04-11T10:21:40.000Z
|
code/abc153_a_02.py
|
KoyanagiHitoshi/AtCoder
|
731892543769b5df15254e1f32b756190378d292
|
[
"MIT"
] | null | null | null |
code/abc153_a_02.py
|
KoyanagiHitoshi/AtCoder
|
731892543769b5df15254e1f32b756190378d292
|
[
"MIT"
] | null | null | null |
H,A=map(int,input().split())
print((H+A-1)//A)
| 23
| 28
| 0.586957
| 11
| 46
| 2.454545
| 0.727273
| 0.148148
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022222
| 0.021739
| 46
| 2
| 29
| 23
| 0.577778
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
5fc67faa880ffa9300a093aa0ef1f67c3a76eb0c
| 169
|
py
|
Python
|
html/semantics/forms/form-submission-0/resources/file-submission.py
|
ziransun/wpt
|
ab8f451eb39eb198584d547f5d965ef54df2a86a
|
[
"BSD-3-Clause"
] | 8
|
2019-04-09T21:13:05.000Z
|
2021-11-23T17:25:18.000Z
|
html/semantics/forms/form-submission-0/resources/file-submission.py
|
ziransun/wpt
|
ab8f451eb39eb198584d547f5d965ef54df2a86a
|
[
"BSD-3-Clause"
] | 21
|
2021-03-31T19:48:22.000Z
|
2022-03-12T00:24:53.000Z
|
html/semantics/forms/form-submission-0/resources/file-submission.py
|
ziransun/wpt
|
ab8f451eb39eb198584d547f5d965ef54df2a86a
|
[
"BSD-3-Clause"
] | 11
|
2019-04-12T01:20:16.000Z
|
2021-11-23T17:25:02.000Z
|
def main(request, response):
return ([("Content-Type", "text/html")], "<script>parent.postMessage(\"" + str(request.POST.first("testinput")) + "\", '*');</script>")
| 56.333333
| 139
| 0.615385
| 18
| 169
| 5.777778
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094675
| 169
| 2
| 140
| 84.5
| 0.679739
| 0
| 0
| 0
| 0
| 0
| 0.568047
| 0.301775
| 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
|
395dfcf0ef1c8d8e22e6ffa1f361278bc0e68f61
| 167
|
py
|
Python
|
nnreslib/graph/fit_graph/__init__.py
|
xausssr/nnreslib
|
2b3932df41369c329040603154418bb5512506b8
|
[
"MIT"
] | null | null | null |
nnreslib/graph/fit_graph/__init__.py
|
xausssr/nnreslib
|
2b3932df41369c329040603154418bb5512506b8
|
[
"MIT"
] | 3
|
2021-07-25T20:40:44.000Z
|
2021-07-26T08:36:03.000Z
|
nnreslib/graph/fit_graph/__init__.py
|
xausssr/nnreslib
|
2b3932df41369c329040603154418bb5512506b8
|
[
"MIT"
] | null | null | null |
from .fit_graph import FitGraph
from ...utils.utils import load_all_modules_from_package
load_all_modules_from_package(__file__, __package__)
__all__ = ["FitGraph"]
| 23.857143
| 56
| 0.832335
| 23
| 167
| 5.130435
| 0.478261
| 0.118644
| 0.237288
| 0.305085
| 0.423729
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08982
| 167
| 6
| 57
| 27.833333
| 0.776316
| 0
| 0
| 0
| 0
| 0
| 0.047904
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
397c05373d4b4fe933e0194433d280139a38835d
| 10,448
|
py
|
Python
|
attributionpriors/eager_ops.py
|
ch6845/attributionpriors
|
681cccb22e71ccaa6627001585b01952acacad54
|
[
"MIT"
] | 105
|
2019-06-26T03:38:40.000Z
|
2022-03-24T17:30:53.000Z
|
expl-reg/attributionpriors/eager_ops.py
|
INK-USC/expl-refinement
|
815a7892a8d4c42fb429856746212a44f67d2547
|
[
"MIT"
] | 4
|
2019-10-07T20:05:09.000Z
|
2021-04-29T11:47:09.000Z
|
expl-reg/attributionpriors/eager_ops.py
|
INK-USC/expl-refinement
|
815a7892a8d4c42fb429856746212a44f67d2547
|
[
"MIT"
] | 12
|
2019-06-28T04:22:08.000Z
|
2021-11-25T02:02:44.000Z
|
import tensorflow as tf
import numpy as np
def _index_predictions(predictions, labels):
'''
Indexes predictions, a [batch_size, num_classes]-shaped tensor,
by labels, a [batch_size]-shaped tensor that indicates which
class each sample should be indexed by.
Args:
predictions: A [batch_size, num_classes]-shaped tensor. The input to a model.
labels: A [batch_size, num_classes]-shaped tensor.
The tensor used to index predictions, in one-hot encoding form.
Returns:
A tensor of shape [batch_size] representing the predictions indexed by the labels.
'''
current_batch_size = tf.shape(predictions)[0]
sample_indices = tf.range(current_batch_size)
sparse_labels = tf.argmax(labels, axis=-1)
indices_tensor = tf.stack([sample_indices, tf.cast(sparse_labels, tf.int32)], axis=1)
predictions_indexed = tf.gather_nd(predictions, indices_tensor)
return predictions_indexed
@tf.function
def gradients(inputs, labels, model, index_true_class=True, multiply_by_input=False):
'''
Computes the gradients of the output with respect to the input. Optionally mulitplies those
gradients by the input to the model.
Args:
inputs: A [batch_size, ...]-shaped tensor. The input to a model.
labels: A [batch_size]-shaped tensor. The true class labels, assuming a multi-class problem.
model: A tf.keras.Model object, or a subclass object thereof.
index_true_class: Whether or not to take the gradients of the output with respect to the true
class. True by default. This should be set to True in the multi-class setting, and False
in the regression setting.
multiply_by_input: Whether or not to multiply the gradients by the input to the model.
Defaults to False.
Returns:
A tensor the same shape as the input representing the gradients of the output with
respect to the input.
'''
with tf.GradientTape() as tape:
tape.watch(inputs)
predictions = model(inputs, training=True)
if index_true_class:
predictions_indexed = _index_predictions(predictions, labels)
else:
predictions_indexed = predictions
input_gradients = tape.gradient(predictions_indexed, inputs)
if multiply_by_input:
input_gradients = input_gradients * inputs
return input_gradients
@tf.function
def gradients_multi_output(inputs, model, num_classes, multiply_by_input=False):
'''
Computes the gradients of the output with respect to the input. Optionally mulitplies those
gradients by the input to the model.
Args:
inputs: A [batch_size, ...]-shaped tensor. The input to a model.
model: A tf.keras.Model object, or a subclass object thereof.
num_classes: The numver of classes to take the gradient with respect to
multiply_by_input: Whether or not to multiply the gradients by the input to the model.
Defaults to False.
Returns:
A tensor the same shape as the input representing the gradients of the output with
respect to the input.
'''
with tf.GradientTape(persistent=True) as tape:
tape.watch(inputs)
predictions = model(inputs, training=True)
predictions_indexed = []
for output_class in range(num_classes):
predictions_indexed.append(predictions[:, output_class])
gradients_array = []
for output_class in range(num_classes):
input_gradients = tape.gradient(predictions_indexed[output_class], inputs)
if multiply_by_input:
input_gradients = input_gradients * inputs
gradients_array.append(input_gradients)
del tape
stacked_gradients = tf.stack(gradients_array, axis=1)
return stacked_gradients
@tf.function
def expected_gradients(inputs, labels, model, index_true_class=True):
'''
Given a batch of inputs and labels, and a model,
symbolically computes a single sample of expected gradients.
Args:
inputs: A [batch_size, ...]-shaped tensor. The input to a model.
labels: A [batch_size, num_classes]-shaped tensor.
The true class labels in one-hot encoding form,
assuming a multi-class problem.
model: A tf.keras.Model object, or a subclass object thereof.
index_true_class: Whether or not to take the gradients of the output with respect to the true
class. True by default. This should be set to True in the multi-class setting, and False
in the regression setting.
Returns:
A tensor the same shape as the input representing a single sample of expected gradients
of the output of the model with respect to the input.
'''
current_batch_size = tf.shape(inputs)[0]
#Here we have to compute the interpolated input into the model
references = tf.roll(inputs, shift=1, axis=0)
alphas = tf.random.uniform(shape=(current_batch_size, 1, 1, 1), minval=0.0, maxval=1.0, dtype=tf.float32)
interpolated_inputs = alphas * inputs + (1.0 - alphas) * references
with tf.GradientTape() as tape:
tape.watch(interpolated_inputs)
predictions = model(interpolated_inputs, training=True)
if index_true_class:
predictions_indexed = _index_predictions(predictions, labels)
else:
predictions_indexed = predictions
input_gradients = tape.gradient(predictions_indexed, interpolated_inputs)
difference_from_reference = inputs - references
expected_gradients = input_gradients * difference_from_reference
return expected_gradients
def expected_gradients_full(inputs, references, model, k=100, index_true_class=False, labels=None):
'''
Given a batch of inputs and labels, and a model,
symbolically computes expected gradients with k references.
Args:
inputs: A [batch_size, ...]-shaped tensor. The input to a model.
references: A numpy array representing background training data to sample from.
model: A tf.keras.Model object, or a subclass object thereof.
k: The number of samples to use when computing expected gradients.
index_true_class: Whether or not to take the gradients of the output with respect to the true
class. True by default. This should be set to True in the multi-class setting, and False
in the regression setting.
labels: A [batch_size, num_classes]-shaped tensor.
The true class labels in one-hot encoding,
assuming a multi-class problem.
Returns:
A tensor the same shape as the input representing the expected gradients
feature attributions with respect to the output predictions.
'''
eg_array = []
for i in range(tf.shape(inputs)[0]):
sample_indices = np.random.choice(references.shape[0], size=k, replace=False)
sample_references = references[sample_indices]
alphas = tf.random.uniform(shape=(k, 1, 1, 1), minval=0.0, maxval=1.0, dtype=tf.float32)
current_input = tf.expand_dims(inputs[i], axis=0)
interpolated_inputs = alphas * current_input + (1.0 - alphas) * sample_references
with tf.GradientTape() as tape:
tape.watch(interpolated_inputs)
predictions = model(interpolated_inputs, training=False)
if index_true_class:
current_labels = tf.expand_dims(labels[i, :], axis=0)
current_labels = tf.tile(current_labels, multiples=(k, 1))
predictions_indexed = _index_predictions(predictions, current_labels)
else:
predictions_indexed = predictions
input_gradients = tape.gradient(predictions_indexed, interpolated_inputs)
difference_from_reference = current_input - sample_references
expected_gradients_samples = input_gradients * difference_from_reference
expected_gradients = tf.reduce_mean(expected_gradients_samples, axis=0)
eg_array.append(expected_gradients)
return tf.stack(eg_array, axis=0)
def expected_gradients_multi_output(inputs, references, model, num_classes, k=100):
'''
Given a batch of inputs and labels, and a model,
symbolically computes expected gradients with k references. Unlike
expected_gradients_full, this function is used when you want the
expected gradients values with respect to all output classes, not just a single one.
Args:
inputs: A [batch_size, ...]-shaped tensor. The input to a model.
references: A numpy array representing background training data to sample from.
model: A tf.keras.Model object, or a subclass object thereof.
num_classes: The number of classes to take expected gradients with respect to.
k: The number of samples to use when computing expected gradients.
Returns:
A tensor the same shape as the input representing the expected gradients
feature attributions with respect to the output predictions.
'''
eg_array = []
for i in range(tf.shape(inputs)[0]):
sample_indices = np.random.choice(references.shape[0], size=k, replace=False)
sample_references = references[sample_indices]
predictions_indexed = []
alphas = tf.random.uniform(shape=(k, 1, 1, 1), minval=0.0, maxval=1.0, dtype=tf.float32)
current_input = tf.expand_dims(inputs[i], axis=0)
interpolated_inputs = alphas * current_input + (1.0 - alphas) * sample_references
with tf.GradientTape(persistent=True) as tape:
tape.watch(interpolated_inputs)
predictions = model(interpolated_inputs, training=False)
for output_class in range(num_classes):
predictions_indexed.append(predictions[:, output_class])
sample_eg_array = []
for output_class in range(num_classes):
input_gradients = tape.gradient(predictions_indexed[output_class], interpolated_inputs)
difference_from_reference = current_input - sample_references
expected_gradients_samples = input_gradients * difference_from_reference
expected_gradients = tf.reduce_mean(expected_gradients_samples, axis=0)
sample_eg_array.append(expected_gradients)
del tape
eg_array.append(tf.stack(sample_eg_array, axis=0))
return tf.stack(eg_array, axis=0)
| 45.034483
| 114
| 0.69554
| 1,377
| 10,448
| 5.126362
| 0.11329
| 0.057799
| 0.023941
| 0.022666
| 0.792605
| 0.752231
| 0.734948
| 0.727865
| 0.704916
| 0.700949
| 0
| 0.007634
| 0.235165
| 10,448
| 232
| 115
| 45.034483
| 0.875735
| 0.431662
| 0
| 0.640777
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.058252
| false
| 0
| 0.019417
| 0
| 0.135922
| 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
|
39a63e659c759c346337d88c22fc5c1f930162c1
| 276
|
py
|
Python
|
nlu/components/utils/ner_to_chunk_converter_licensed/ner_to_chunk_converter_licensed.py
|
milyiyo/nlu
|
d209ed11c6a84639c268f08435552248391c5573
|
[
"Apache-2.0"
] | 480
|
2020-08-24T02:36:40.000Z
|
2022-03-30T08:09:43.000Z
|
nlu/components/utils/ner_to_chunk_converter_licensed/ner_to_chunk_converter_licensed.py
|
milyiyo/nlu
|
d209ed11c6a84639c268f08435552248391c5573
|
[
"Apache-2.0"
] | 28
|
2020-09-26T18:55:43.000Z
|
2022-03-26T01:05:45.000Z
|
nlu/components/utils/ner_to_chunk_converter_licensed/ner_to_chunk_converter_licensed.py
|
milyiyo/nlu
|
d209ed11c6a84639c268f08435552248391c5573
|
[
"Apache-2.0"
] | 76
|
2020-09-25T22:55:12.000Z
|
2022-03-17T20:25:52.000Z
|
from sparknlp_jsl.annotator import NerConverterInternal
class NerToChunkConverterLicensed:
@staticmethod
def get_default_model():
return NerConverterInternal() \
.setInputCols(["sentence", "token", "ner"]) \
.setOutputCol("entities")
| 30.666667
| 57
| 0.684783
| 21
| 276
| 8.857143
| 0.952381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.213768
| 276
| 8
| 58
| 34.5
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0.086957
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| true
| 0
| 0.142857
| 0.142857
| 0.571429
| 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
| 0
| 1
| 1
| 0
|
0
| 5
|
f2d11e35da2645e352c2699ab26c56abfb2d2a8e
| 24
|
py
|
Python
|
samples/__init__.py
|
shenqiang-Yuan/GPA
|
ad8bb4540ef4126c817c5fe007dad93a5a7ddc2a
|
[
"MIT"
] | null | null | null |
samples/__init__.py
|
shenqiang-Yuan/GPA
|
ad8bb4540ef4126c817c5fe007dad93a5a7ddc2a
|
[
"MIT"
] | null | null | null |
samples/__init__.py
|
shenqiang-Yuan/GPA
|
ad8bb4540ef4126c817c5fe007dad93a5a7ddc2a
|
[
"MIT"
] | null | null | null |
from . import read_clips
| 24
| 24
| 0.833333
| 4
| 24
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 24
| 1
| 24
| 24
| 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
|
f2f1d74f4346fab64f9c0ff25b63fcdd4e8601ec
| 164
|
py
|
Python
|
venv/Lib/site-packages/statsmodels/formula/__init__.py
|
EkremBayar/bayar
|
aad1a32044da671d0b4f11908416044753360b39
|
[
"MIT"
] | 6,931
|
2015-01-01T11:41:55.000Z
|
2022-03-31T17:03:24.000Z
|
venv/Lib/site-packages/statsmodels/formula/__init__.py
|
EkremBayar/bayar
|
aad1a32044da671d0b4f11908416044753360b39
|
[
"MIT"
] | 6,137
|
2015-01-01T00:33:45.000Z
|
2022-03-31T22:53:17.000Z
|
venv/Lib/site-packages/statsmodels/formula/__init__.py
|
EkremBayar/bayar
|
aad1a32044da671d0b4f11908416044753360b39
|
[
"MIT"
] | 2,608
|
2015-01-02T21:32:31.000Z
|
2022-03-31T07:38:30.000Z
|
__all__ = ['handle_formula_data', 'test']
from .formulatools import handle_formula_data
from statsmodels.tools._testing import PytestTester
test = PytestTester()
| 23.428571
| 51
| 0.810976
| 19
| 164
| 6.526316
| 0.631579
| 0.209677
| 0.274194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103659
| 164
| 6
| 52
| 27.333333
| 0.843537
| 0
| 0
| 0
| 0
| 0
| 0.140244
| 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
|
f2f2aa44b176a690864ca98447cb2224a759469d
| 271
|
py
|
Python
|
mocket/__init__.py
|
BlueOwlDev/python-mocket
|
7075f206394c6f226b975a2955821a2609023e24
|
[
"BSD-3-Clause"
] | null | null | null |
mocket/__init__.py
|
BlueOwlDev/python-mocket
|
7075f206394c6f226b975a2955821a2609023e24
|
[
"BSD-3-Clause"
] | null | null | null |
mocket/__init__.py
|
BlueOwlDev/python-mocket
|
7075f206394c6f226b975a2955821a2609023e24
|
[
"BSD-3-Clause"
] | null | null | null |
try:
# Py2
from mocket import Mocket, MocketEntry, Mocketizer, mocketize
except ImportError:
# Py3
from mocket.mocket import Mocket, MocketEntry, Mocketizer, mocketize
__all__ = ("mocketize", "Mocket", "MocketEntry", "Mocketizer")
__version__ = "3.9.3"
| 24.636364
| 72
| 0.712177
| 29
| 271
| 6.37931
| 0.517241
| 0.275676
| 0.437838
| 0.313514
| 0.518919
| 0.518919
| 0
| 0
| 0
| 0
| 0
| 0.022422
| 0.177122
| 271
| 10
| 73
| 27.1
| 0.807175
| 0.02583
| 0
| 0
| 0
| 0
| 0.157088
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
8466bec847d8d3f8aaf5820b4c9e87e66b3b6e6a
| 439
|
py
|
Python
|
model_factory/models/__init__.py
|
yinochaos/model_factory
|
d8ff8b049cef9b2c19d6dc303874aee6401dc5ef
|
[
"Apache-2.0"
] | null | null | null |
model_factory/models/__init__.py
|
yinochaos/model_factory
|
d8ff8b049cef9b2c19d6dc303874aee6401dc5ef
|
[
"Apache-2.0"
] | null | null | null |
model_factory/models/__init__.py
|
yinochaos/model_factory
|
d8ff8b049cef9b2c19d6dc303874aee6401dc5ef
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import, division, print_function
__all__ = ['ClassiferModel', 'SeqlabelModel', 'Seq2seqModel', 'GANModel', 'RLModel']
from model_factory.models.classifier_model import ClassiferModel
from model_factory.models.seqlabel_model import SeqlabelModel
from model_factory.models.seq2seq_model import Seq2seqModel
from model_factory.models.gan_model import GANModel
from model_factory.models.rl_model import RLModel
| 54.875
| 84
| 0.85877
| 54
| 439
| 6.611111
| 0.388889
| 0.12605
| 0.22409
| 0.308123
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007389
| 0.075171
| 439
| 7
| 85
| 62.714286
| 0.871921
| 0
| 0
| 0
| 0
| 0
| 0.123007
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.857143
| 0
| 0.857143
| 0.142857
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
fff69e2a77691bba715d938e103bdba54144e456
| 121
|
py
|
Python
|
old/09/01.py
|
systemquant/book-pandas-for-finance
|
90b7eb9be1de20a12ae72b9bb5d51424a979b174
|
[
"MIT"
] | 10
|
2021-02-04T12:49:56.000Z
|
2022-03-26T11:28:11.000Z
|
old/09/01.py
|
systemquant/book-pandas-for-finance
|
90b7eb9be1de20a12ae72b9bb5d51424a979b174
|
[
"MIT"
] | 1
|
2022-03-24T03:47:14.000Z
|
2022-03-24T03:54:52.000Z
|
old/09/01.py
|
systemquant/book-pandas-for-finance
|
90b7eb9be1de20a12ae72b9bb5d51424a979b174
|
[
"MIT"
] | 4
|
2021-07-17T16:50:15.000Z
|
2022-03-22T05:55:34.000Z
|
from pykrx import stock
business_day = stock.get_business_days(2010, 1)
print(business_day[0])
print(business_day[-1])
| 17.285714
| 47
| 0.785124
| 20
| 121
| 4.5
| 0.6
| 0.366667
| 0.355556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.06422
| 0.099174
| 121
| 6
| 48
| 20.166667
| 0.761468
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0.5
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
fffa4ecce609cc8c5785614f9902751c024250f9
| 522
|
py
|
Python
|
python/docs.py
|
robotlightsyou/test
|
015f13943fc402d8ce86c5f6d2f5a7d032b3340a
|
[
"MIT"
] | 2
|
2019-05-26T15:09:34.000Z
|
2021-09-12T08:01:23.000Z
|
python/docs.py
|
robotlightsyou/test
|
015f13943fc402d8ce86c5f6d2f5a7d032b3340a
|
[
"MIT"
] | null | null | null |
python/docs.py
|
robotlightsyou/test
|
015f13943fc402d8ce86c5f6d2f5a7d032b3340a
|
[
"MIT"
] | 1
|
2021-04-11T20:28:21.000Z
|
2021-04-11T20:28:21.000Z
|
"""
DOC
Module
"""
class Class:
"""
DOC
Class
"""
def __init__(self):
"""
DOC
__init__
"""
def __iter__(self):
"""
DOC
__iter__
"""
def call(selfs, foo, bar, baz):
"""
DOC
call
"""
print(__doc__)
print('\n---\n')
print(Class.__doc__)
print('\n---\n')
print(Class.__init__.__doc__)
print('\n---\n')
print(Class.__iter__.__doc__)
print('\n---\n')
print(Class.call.__doc__)
print('\n---\n')
| 11.6
| 35
| 0.463602
| 56
| 522
| 3.535714
| 0.25
| 0.20202
| 0.227273
| 0.252525
| 0.40404
| 0.40404
| 0
| 0
| 0
| 0
| 0
| 0
| 0.335249
| 522
| 44
| 36
| 11.863636
| 0.570605
| 0.105364
| 0
| 0.357143
| 0
| 0
| 0.100865
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.214286
| false
| 0
| 0
| 0
| 0.285714
| 0.714286
| 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
| 0
| 1
|
0
| 5
|
0816ad86df1c51ae5c438e7f984fc601ab28b084
| 126
|
py
|
Python
|
src/tom/credential.py
|
SEIAROTg/Mail.im
|
1ad31c5f82dd440100a16e5704a4e22fc8105ead
|
[
"MIT"
] | null | null | null |
src/tom/credential.py
|
SEIAROTg/Mail.im
|
1ad31c5f82dd440100a16e5704a4e22fc8105ead
|
[
"MIT"
] | null | null | null |
src/tom/credential.py
|
SEIAROTg/Mail.im
|
1ad31c5f82dd440100a16e5704a4e22fc8105ead
|
[
"MIT"
] | null | null | null |
from typing import NamedTuple
class Credential(NamedTuple):
host: str
port: int
username: str
password: str
| 14
| 29
| 0.690476
| 15
| 126
| 5.8
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.253968
| 126
| 8
| 30
| 15.75
| 0.925532
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.166667
| 0.166667
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
0847514a7e0da3aaae5bdfc4a2768a2c2b84aaf2
| 117
|
py
|
Python
|
test_grouping.py
|
markomijaljevic/pytest_examples
|
6882c183ac4717ab2b95fbc4137ddb7e759bcd3b
|
[
"MIT"
] | null | null | null |
test_grouping.py
|
markomijaljevic/pytest_examples
|
6882c183ac4717ab2b95fbc4137ddb7e759bcd3b
|
[
"MIT"
] | null | null | null |
test_grouping.py
|
markomijaljevic/pytest_examples
|
6882c183ac4717ab2b95fbc4137ddb7e759bcd3b
|
[
"MIT"
] | null | null | null |
import pytest
@pytest.mark.one
def test_true():
assert True
@pytest.mark.two
def test_false():
assert False
| 13
| 17
| 0.717949
| 18
| 117
| 4.555556
| 0.555556
| 0.243902
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179487
| 117
| 9
| 18
| 13
| 0.854167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 1
| 0.285714
| true
| 0
| 0.142857
| 0
| 0.428571
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f230d13b83b27eab0a372096cee774eb318e7ef3
| 76
|
py
|
Python
|
djangobotcfg/__init__.py
|
henriquebastos/django-buildmaster
|
a3169509e2a8fb2623cde0a99c4087ef04b0be38
|
[
"BSD-3-Clause"
] | 1
|
2018-04-18T20:18:59.000Z
|
2018-04-18T20:18:59.000Z
|
djangobotcfg/__init__.py
|
henriquebastos/django-buildmaster
|
a3169509e2a8fb2623cde0a99c4087ef04b0be38
|
[
"BSD-3-Clause"
] | null | null | null |
djangobotcfg/__init__.py
|
henriquebastos/django-buildmaster
|
a3169509e2a8fb2623cde0a99c4087ef04b0be38
|
[
"BSD-3-Clause"
] | null | null | null |
from . import builders, buildsteps, changesource, schedulers, slaves, status
| 76
| 76
| 0.815789
| 8
| 76
| 7.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 76
| 1
| 76
| 76
| 0.911765
| 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
|
f23eae1451b246cd0ae7c253ef319bdc85d25e8c
| 82
|
py
|
Python
|
steganossaurus/utils.py
|
Djsouls/steganossaurus
|
f7258467a167e63116fa4d1bbec1f9e94734446f
|
[
"MIT"
] | null | null | null |
steganossaurus/utils.py
|
Djsouls/steganossaurus
|
f7258467a167e63116fa4d1bbec1f9e94734446f
|
[
"MIT"
] | null | null | null |
steganossaurus/utils.py
|
Djsouls/steganossaurus
|
f7258467a167e63116fa4d1bbec1f9e94734446f
|
[
"MIT"
] | null | null | null |
def image_needed_size(byte_list, channels):
return (byte_list * 4) / channels
| 27.333333
| 43
| 0.743902
| 12
| 82
| 4.75
| 0.75
| 0.280702
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014493
| 0.158537
| 82
| 2
| 44
| 41
| 0.811594
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
f2845f5c1f3c926d85d832402b15b526d9572238
| 47
|
py
|
Python
|
run_app.py
|
matthistuff/Decaying-Shelters-Rhino
|
38f5669f34da886bf4740f7fcaa9383872a1bf5b
|
[
"MIT"
] | null | null | null |
run_app.py
|
matthistuff/Decaying-Shelters-Rhino
|
38f5669f34da886bf4740f7fcaa9383872a1bf5b
|
[
"MIT"
] | 1
|
2019-04-23T02:25:54.000Z
|
2019-04-23T12:41:50.000Z
|
run_app.py
|
matthistuff/Decaying-Shelters-Rhino
|
38f5669f34da886bf4740f7fcaa9383872a1bf5b
|
[
"MIT"
] | null | null | null |
from core import simulation
simulation.DSSim()
| 15.666667
| 27
| 0.829787
| 6
| 47
| 6.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106383
| 47
| 3
| 28
| 15.666667
| 0.928571
| 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
|
f2b13fb6417347f5b116ac05b7b3c8d2d6d79551
| 172
|
py
|
Python
|
UIU/cen_uiu/modules/system.py
|
neotje/CEN
|
00224668b6bc4bc0ecbe0df01137873b3a21b451
|
[
"MIT"
] | null | null | null |
UIU/cen_uiu/modules/system.py
|
neotje/CEN
|
00224668b6bc4bc0ecbe0df01137873b3a21b451
|
[
"MIT"
] | 12
|
2021-07-03T21:15:39.000Z
|
2021-11-04T17:40:45.000Z
|
UIU/cen_uiu/modules/system.py
|
neotje/CEN
|
00224668b6bc4bc0ecbe0df01137873b3a21b451
|
[
"MIT"
] | null | null | null |
import os
import threading
def reboot():
os.system(f"sudo systemctl reboot")
def shutdown():
os.system(f"sudo systemctl poweroff")
def softReboot():
exit(10)
| 15.636364
| 41
| 0.697674
| 24
| 172
| 5
| 0.583333
| 0.133333
| 0.15
| 0.216667
| 0.366667
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014184
| 0.180233
| 172
| 11
| 42
| 15.636364
| 0.836879
| 0
| 0
| 0
| 0
| 0
| 0.254335
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.375
| true
| 0
| 0.25
| 0
| 0.625
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
f2c8218f54d064cdcda1578071a97dab958f673e
| 95
|
py
|
Python
|
tools/test/topos/regionabc-onos.py
|
ariscahyadi/onos-1.14-with-indopronos-app
|
6fa525623abe3e2359c17f6187ce756985fe7053
|
[
"Apache-2.0"
] | 1,091
|
2015-01-06T11:10:40.000Z
|
2022-03-30T09:09:05.000Z
|
tools/test/topos/regionabc-onos.py
|
ariscahyadi/onos-1.14-with-indopronos-app
|
6fa525623abe3e2359c17f6187ce756985fe7053
|
[
"Apache-2.0"
] | 39
|
2015-02-13T19:58:32.000Z
|
2022-03-02T02:38:07.000Z
|
tools/test/topos/regionabc-onos.py
|
ariscahyadi/onos-1.14-with-indopronos-app
|
6fa525623abe3e2359c17f6187ce756985fe7053
|
[
"Apache-2.0"
] | 914
|
2015-01-05T19:42:35.000Z
|
2022-03-30T09:25:18.000Z
|
#!/usr/bin/python
from onosnet import run
from regionabc import RegionABC
run( RegionABC() )
| 13.571429
| 31
| 0.757895
| 13
| 95
| 5.538462
| 0.615385
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147368
| 95
| 6
| 32
| 15.833333
| 0.888889
| 0.168421
| 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
|
4b99c7beb40a7b4482d19b51aa0cba1e457f64d0
| 313
|
py
|
Python
|
ProteinFeatureAnalyzer/features/__init__.py
|
Kortemme-Lab/protein_feature_analysis
|
fa2ae8bc6eb7ecf17e8bf802ab30814461868114
|
[
"MIT"
] | 6
|
2018-08-26T21:38:23.000Z
|
2021-08-13T02:43:38.000Z
|
ProteinFeatureAnalyzer/features/__init__.py
|
Kortemme-Lab/protein_feature_analysis
|
fa2ae8bc6eb7ecf17e8bf802ab30814461868114
|
[
"MIT"
] | null | null | null |
ProteinFeatureAnalyzer/features/__init__.py
|
Kortemme-Lab/protein_feature_analysis
|
fa2ae8bc6eb7ecf17e8bf802ab30814461868114
|
[
"MIT"
] | 1
|
2018-01-06T05:46:55.000Z
|
2018-01-06T05:46:55.000Z
|
from .RamachandranFeature import RamachandranFeature
from .BackboneMicroEnvironmentFeature import BackboneMicroEnvironmentFeature
from .StructuralHomologFeature import StructuralHomologFeature
from .ParametricDesignFeature import ParametricDesignFeature
from . import machine_learning
from . import geometry
| 26.083333
| 76
| 0.888179
| 23
| 313
| 12.043478
| 0.391304
| 0.072202
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.092652
| 313
| 11
| 77
| 28.454545
| 0.975352
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
4b9cadca825bcdf82facc5fd3f43d29ca9bba0f7
| 98
|
py
|
Python
|
temporary/__init__.py
|
mojtabah/temporary
|
02b63e247f5c21fc33943697ce9f96e317a3824a
|
[
"BSD-3-Clause"
] | null | null | null |
temporary/__init__.py
|
mojtabah/temporary
|
02b63e247f5c21fc33943697ce9f96e317a3824a
|
[
"BSD-3-Clause"
] | null | null | null |
temporary/__init__.py
|
mojtabah/temporary
|
02b63e247f5c21fc33943697ce9f96e317a3824a
|
[
"BSD-3-Clause"
] | null | null | null |
"""
temporary - an example repo for MSF Devops
"""
from .math import *
from .string_util import *
| 16.333333
| 42
| 0.704082
| 14
| 98
| 4.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183673
| 98
| 6
| 43
| 16.333333
| 0.85
| 0.428571
| 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
|
4ba25860ded369a0cba278edc78b1051abf69301
| 49
|
py
|
Python
|
5/5-2(whilePractice2).py
|
sukio-1024/codeitPy
|
43f4c6d5205eab9cb4780ceb8799b04ce7b10acb
|
[
"MIT"
] | null | null | null |
5/5-2(whilePractice2).py
|
sukio-1024/codeitPy
|
43f4c6d5205eab9cb4780ceb8799b04ce7b10acb
|
[
"MIT"
] | null | null | null |
5/5-2(whilePractice2).py
|
sukio-1024/codeitPy
|
43f4c6d5205eab9cb4780ceb8799b04ce7b10acb
|
[
"MIT"
] | null | null | null |
i = 100
while (i % 23) != 0:
i += 1
print(i)
| 9.8
| 20
| 0.428571
| 10
| 49
| 2.1
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.21875
| 0.346939
| 49
| 4
| 21
| 12.25
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4ba7b89646ddfba012a56cbdddabfc18270549af
| 260
|
py
|
Python
|
kqueen/auth/__init__.py
|
LaudateCorpus1/kqueen
|
8841c069bb5a53ae18affc0222356956220bbd47
|
[
"MIT"
] | 140
|
2017-09-28T06:07:40.000Z
|
2022-01-17T09:10:39.000Z
|
kqueen/auth/__init__.py
|
LaudateCorpus1/kqueen
|
8841c069bb5a53ae18affc0222356956220bbd47
|
[
"MIT"
] | 128
|
2017-09-26T06:51:30.000Z
|
2018-10-11T13:15:13.000Z
|
kqueen/auth/__init__.py
|
LaudateCorpus1/kqueen
|
8841c069bb5a53ae18affc0222356956220bbd47
|
[
"MIT"
] | 39
|
2017-10-02T13:57:19.000Z
|
2021-11-30T05:30:52.000Z
|
from .common import authenticate, identity, encrypt_password, is_authorized
from .ldap import LDAPAuth
from .local import LocalAuth
__all__ = [
'authenticate',
'identity',
'encrypt_password',
'is_authorized',
'LDAPAuth',
'LocalAuth'
]
| 20
| 75
| 0.707692
| 26
| 260
| 6.769231
| 0.538462
| 0.227273
| 0.306818
| 0.397727
| 0.534091
| 0.534091
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192308
| 260
| 12
| 76
| 21.666667
| 0.838095
| 0
| 0
| 0
| 0
| 0
| 0.253846
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.181818
| 0.272727
| 0
| 0.272727
| 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
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
29be3f492ff397f192db659c2316ff93d32909f7
| 35,912
|
py
|
Python
|
tests/unit_tests/test_parsers.py
|
drahoja9/BI-OOP-CAD
|
afec7d44b1c5502a6bf94f78759c46337f750ea3
|
[
"MIT"
] | null | null | null |
tests/unit_tests/test_parsers.py
|
drahoja9/BI-OOP-CAD
|
afec7d44b1c5502a6bf94f78759c46337f750ea3
|
[
"MIT"
] | null | null | null |
tests/unit_tests/test_parsers.py
|
drahoja9/BI-OOP-CAD
|
afec7d44b1c5502a6bf94f78759c46337f750ea3
|
[
"MIT"
] | null | null | null |
import pytest
from app.parsers.cli_parser import CliParser
from app.parsers.low_level_parsers import StringParser, NatParser, IntParser
from app.parsers.point_parsers import ParserPoint
from app.parsers.parse_results import Success, Failure
from app.parsers.point_parsers import PointParser, AbsoluteParserPoint, RelativeParserPoint
from app.parsers.color_parser import RgbColorParser
from app.parsers.command_parsers import CommandParser
from app.controller import Controller
from app.commands import PrintDotCommand, PrintRectCommand, PrintCircleCommand, PrintLineCommand, PrintPolylineCommand, \
RemoveShapeCommand, ListShapeCommand, MoveShapeCommand, ClearCommand, InvalidCommand, SaveCommand, LoadCommand,\
QuitCommand
from app.shape_factory import DimensionsRectFactory, DimensionsCircleFactory
@pytest.fixture
def controller() -> Controller:
controller: Controller = "controller"
return controller
@pytest.fixture
def cli_parser() -> CliParser:
controller: Controller = "controller"
return CliParser(controller, RgbColorParser())
# --------------- Low level parsers tests ---------------
def test_string_parser():
"""
Test StringParser used for parsing exact word from the beginning of a given string.
"""
# Test invalid inputs without a delimiter
invalid_inputs = [('rect', 'recta'), ('rect', 'list rect'), ('rect', 'rect, '), ('rect', 'rect('),
('rect', 'RECT'), ('rect', 'circle'), ('rect', ' circle'),
('rect', 'rect10,20 30,40')]
for expected, actual in invalid_inputs:
parser = StringParser(expected, '')
result = parser.parse_input(actual)
assert isinstance(result, Failure)
# Test valid inputs without a delimiter
valid_inputs = [('rect', 'rect +10 -10', '+10 -10'), ('rect', 'rect anything ', 'anything '),
('rect', 'rect +1002', '+1002'), ('rect', ' rect + 1 0 1 2', '+ 1 0 1 2'),
('rect', ' rect', ''), ('rect', ' rect +10', '+10')]
for expected, actual, remainder in valid_inputs:
parser = StringParser(expected, '')
result = parser.parse_input(actual)
assert result == Success(expected, remainder)
# Test invalid inputs with a delimiter
invalid_inputs = [('rgb', '(', 'rg b(20,20,20)'), ('rgb', '(', ' rgb2(0...'),
('rgb', '(', 'rgb 20...')]
for expected, delimiter, actual in invalid_inputs:
parser = StringParser(expected, delimiter)
result = parser.parse_input(actual)
assert isinstance(result, Failure)
# Test valid inputs with a delimiter
valid_inputs = [('rgb', '(', 'rgb(20,20,20)', '20,20,20)'), ('rgb', '(', ' rgb(20...', '20...'),
('rgb', '(', 'rgb (20...', '20...'), ('rgb', '(', 'rgb ( 20...', '20...')]
for expected, delimiter, actual, remainder in valid_inputs:
parser = StringParser(expected, delimiter)
result = parser.parse_input(actual)
assert result == Success(expected, remainder)
def test_nat_parser():
"""
Test NatParser's method "parse_input" used for parsing natural numbers (^\d+(\s+|$)) from a string.
"""
parser = NatParser()
# Test invalid inputs without a delimiter
invalid_inputs = ['+10', '-10', '+1 ', '-1', '+10.5', '10.5', '+ 10', '- 10', '+-10', '+- 10', '1-0', '10+',
'+10+10', 'k10', 'k 10', 'k+10', 'k +10', 'k + 10', 'k1k0', '1k0', 'k 10+', 'k1', ' +10',
'10k', '10-k', '1k', '+10lalala', "", "lala", " ", " ", "+",
'10#', '10$', '10^^', '10^4', '10>', # special characters
'10.', '10:', '10-', '1/', '1\\', '10\"', "10\'", '10?', '1!', # word delimiters
'10(', '10)', '10{', '10}', '10[', '10]'] # brackets
for cli_input in invalid_inputs:
result = parser.parse_input(cli_input)
assert isinstance(result, Failure)
# Test invalid inputs with a delimiter
invalid_inputs = [('+10_', '.'), ('10_', ','), ('10.$', '$'), ('10, 20', ' ')]
for cli_input, delimiter in invalid_inputs:
parser = NatParser(delimiter)
result = parser.parse_input(cli_input)
assert isinstance(result, Failure)
# Test valid inputs
valid_inputs = [('10,+20', ',', 10, '+20'), ('10 some string +10 yes', ' ', 10, 'some string +10 yes'),
('10A delimiterA remainder', 'A delimiter', 10, 'A remainder'),
('10', '', 10, ''), (' 10 ', '', 10, ''),
(' 10', '', 10, ''), ('10 ', '', 10, ''), ('10, 12, ', ',', 10, '12, '),
(' 10 , 20', ',', 10, '20'), (' 10,20', ',', 10, '20'), (' 10 ,20 ', ',', 10, '20 '),
(' 10, 20', ',', 10, '20'), ('10, ', ',', 10, '')]
for cli_input, delimiter, expected, remainder in valid_inputs:
parser = NatParser(delimiter)
result = parser.parse_input(cli_input)
assert result == Success(expected, remainder)
def test_int_parser():
"""
Test IntParser's method "parse_input" used for parsing integer ([+-]\d+(\s+|$)) from a string.
"""
# Test invalid inputs without a delimiter
invalid_inputs = ['10', '+10.5', '10.5', '+ 10', '+-10', '+- 10', '1-0', '10+', '10 +', '+10+10',
'k10', 'k 10', 'k+10', 'k +10', 'k + 10', 'k1k0', '1k0', 'k 10+', 'k1',
'10k', '10 k', '10 +k', '10-k', '1k', '+10lalala', "", "lala", " ", " ", "+",
'+10#', '+10$', '+10^^', '+10^4', '+10>', # special characters
'+10.', '+10:', '+10-', '+1/', '+1\\', '+10\"', "+10\'", '+10?', '+1!', # word delimiters
'+10(', '+10)', '+10{', '+10}', '+10[', '+10]'] # brackets
for cli_input in invalid_inputs:
parser = IntParser()
result = parser.parse_input(cli_input)
assert isinstance(result, Failure)
# Test invalid inputs with a delimiter
invalid_inputs = [('+10_', '.'), ('-10_', ','), ('-10.$', '$'), ('-10, -20', ' '), ('-10', '-10')]
for cli_input, delimiter in invalid_inputs:
parser = IntParser(delimiter)
result = parser.parse_input(cli_input)
assert isinstance(result, Failure)
# Test valid inputs
valid_inputs = [('+10,+20', ',', 10, '+20'), ('-1005+200', '+', -1005, '200'),
('-10 some string +10 yes', ' ', -10, 'some string +10 yes'),
('-10A delimiterA remainder', 'A delimiter', -10, 'A remainder'),
('+10', '', 10, ''), (' +10 ', '', 10, ''),
(' +10', '', 10, ''), ('+10 ', '', 10, ''), ('-10, 12, ', ',', -10, '12, '),
(' +10 , 20', ',', 10, '20'), (' -10,20', ',', -10, '20'), (' -10 ,20 ', ',', -10, '20 '),
(' +10, 20', ',', 10, '20'), ('+10, ', ',', 10, '')]
for cli_input, delimiter, expected, remainder in valid_inputs:
parser = IntParser(delimiter)
result = parser.parse_input(cli_input)
assert result == Success(expected, remainder)
# --------------- ColorParsers test ---------------
def test_rgb_color_parser():
"""
Test RgbColorParser's parsing of color in 'rgb([0,255],[0,255],[0,255])' format.
"""
parser = RgbColorParser()
# Test invalid inputs
invalid_inputs = ["r gb(0,1,2)", "rgb 0,1,2)", "rgb(0,1,2", "rgb(-5,1,2)", "rgb(-5,-1-2)", "rgb(256,1,2)",
"rgb(0,256,2)", "rgb(0,1,256)", "rgb(260,300,600)"]
for cli_input in invalid_inputs:
result = parser.parse_color(cli_input)
assert result == Failure("rgb([0,255],[0,255],[0,255])", cli_input)
valid_inputs = [("rgb(0,1,2)", (0, 1, 2), ""), ("rgb(255,255,255)", (255, 255, 255), ""),
(" rgb( 0,1,2)", (0, 1, 2), ""), ("rgb (0, 1,2 )", (0, 1, 2), ""),
("rgb (0,1,2)", (0, 1, 2), ""),
("rgb (20,30,40) something else", (20, 30, 40), "something else"),
("rgb ( 0 ,1 , 2 ) something", (0, 1, 2), "something")]
# Test valid inputs
for cli_input, expected, remainder in valid_inputs:
result = parser.parse_color(cli_input)
assert result == Success(expected, remainder)
# --------------- PointParser tests ---------------
def test_point_parser_absolute_points():
"""
Test PointParser's parsing of absolute points.
"""
parser = PointParser()
# Test invalid inputs
invalid_inputs = ['1020', '10 20', '10.20', '10', '10,', 'x,20', '10,y', 'x,y']
for cli_input in invalid_inputs:
result = parser.parse_point(cli_input)
assert result == Failure("x,y or (+-)x,(+-)y", cli_input)
# Test valid inputs
valid_inputs = [('10,20', AbsoluteParserPoint(10, 20), ''),
('10,20 ', AbsoluteParserPoint(10, 20), ''),
('10 ,20', AbsoluteParserPoint(10, 20), ''),
('10, 20', AbsoluteParserPoint(10, 20), ''),
('10 , 20', AbsoluteParserPoint(10, 20), ''),
(' 10 , 20', AbsoluteParserPoint(10, 20), ''),
(' 10 , 20 something', AbsoluteParserPoint(10, 20), 'something'),
('100,250 something', AbsoluteParserPoint(100, 250), 'something'),
('0,0', AbsoluteParserPoint(0, 0), ''),
('10,20 30,40', AbsoluteParserPoint(10, 20), '30,40')]
for cli_input, expected, remainder in valid_inputs:
result = parser.parse_point(cli_input)
assert result == Success(expected, remainder)
def test_point_parser_relative_points():
"""
Test PointParser's parsing of relative points.
"""
parser = PointParser()
# Test invalid inputs
invalid_inputs = ['-10 -20', '-10.-20', '+10', '+ 10,-20', '+10,- 20',
'-10,', '+x,-20', '-10,+y', '-x,-y']
for cli_input in invalid_inputs:
result = parser.parse_point(cli_input)
assert result == Failure("x,y or (+-)x,(+-)y", cli_input)
# Test valid inputs
valid_inputs = [('-10,+20', RelativeParserPoint(-10, 20), ''),
('+10,+20 ', RelativeParserPoint(10, 20), ''),
('-10 ,-20', RelativeParserPoint(-10, -20), ''),
('+10, -20', RelativeParserPoint(10, -20), ''),
('-10 , +20', RelativeParserPoint(-10, 20), ''),
(' +10 , -20', RelativeParserPoint(10, -20), ''),
(' +10 , -20 something', RelativeParserPoint(10, -20), 'something'),
('+100,-250 something', RelativeParserPoint(100, -250), 'something'),
('-0,+0', RelativeParserPoint(0, 0), ''),
('+10,-20 30,40', RelativeParserPoint(10, -20), '30,40')]
for cli_input, expected, remainder in valid_inputs:
result = parser.parse_point(cli_input)
assert result == Success(expected, remainder)
# --------------- RelativeParserPoint to AbsoluteParserPoint conversion tests ---------------
def test_relative_parser_point_conversion():
points = [(RelativeParserPoint(10, 20), ParserPoint(0, 0), AbsoluteParserPoint(10, 20)),
(RelativeParserPoint(-10, 10), ParserPoint(10, -10), AbsoluteParserPoint(0, 0)),
(RelativeParserPoint(10, -10), ParserPoint(-10, 10), AbsoluteParserPoint(0, 0)),
(RelativeParserPoint(10, 20), ParserPoint(10, 20), AbsoluteParserPoint(20, 40)),
(RelativeParserPoint(10, 20), ParserPoint(-10, -20), AbsoluteParserPoint(0, 0))]
for relative_point, predecessor_point, result_point in points:
assert relative_point.convert_to_absolute(predecessor_point) == result_point
def test_absolute_parser_point_conversion():
points = [(AbsoluteParserPoint(10, 20), ParserPoint(0, 0), AbsoluteParserPoint(10, 20)),
(AbsoluteParserPoint(10, 20), ParserPoint(30, 40), AbsoluteParserPoint(10, 20)),
(AbsoluteParserPoint(10, 20), ParserPoint(-10, -20), AbsoluteParserPoint(10, 20))]
for absolute_point, predecessor_point, result_point in points:
assert absolute_point.convert_to_absolute(predecessor_point) == result_point
# --------------- ShapeCommandParsers tests ---------------
def test_circle_parser(controller: Controller, cli_parser: CliParser):
# Test invalid inputs, two points as parameters
invalid_inputs = ["circle 10,-20 30,40", "circle 10,20 30,+40", "circle 10,20 30.40", "circle 10 20 30,40",
"circle10,20 30,40", "circle 10,20", "circlee 10,20 30,40", "circle something",
"circle 10,20 30,40 rgb(0,0,-1)", "circle 10,20 30,40 rgb(0,0,0",
"circle 10,20 30,40 rgb 0,0,0", "circle 10,20 30,40 rgb(0,1)",
"circle 10,20 30,40rgb(0,1,2)", "circle 10,20 30,40 rgb(1a,2,3)",
"circle 10,20 30,40,rgb(0,2,3)", "circle 10,20 30,40 rgb(256,0,1)",
"circle 10,20 30,40 rgb(2.0.1)", "circle 10,20 30,40 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, two points as parameters
valid_inputs = [("circle 10,20 30,40", PrintCircleCommand(controller, 10, 20, (0, 0, 0), end_x=30, end_y=40)),
("circle 10, 20 -10,-20", PrintCircleCommand(controller, 10, 20, (0, 0, 0), end_x=0, end_y=0)),
("circle -5,-5 +5, +5", PrintCircleCommand(controller, -5, -5, (0, 0, 0), end_x=0, end_y=0)),
("circle -5 ,-5 10,20 ", PrintCircleCommand(controller, -5, -5, (0, 0, 0), end_x=10, end_y=20)),
("circle 10 ,20 30, 40 rgb (10,20,30)", PrintCircleCommand(controller, 10, 20, (10, 20, 30),
end_x=30, end_y=40)),
(" circle 10,20 -10, -20 rgb( 0, 0 , 0 ) ", PrintCircleCommand(controller, 10, 20, (0, 0, 0),
end_x=0, end_y=0))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
# Test invalid inputs, one point and one natural number (radius) as parameters
invalid_inputs = ["circle 10,20 30 40", "circle 10,20 +30", "circle 10,20 -30", "circle 10,20",
"circle10,20 30", "circlee 10,20 30", "circle 10,20 something",
"circle 10,20 30 rgb(0,0,-1)", "circle 10,20 30 rgb(0,0,0",
"circle 10,20 30 rgb 0,0,0", "circle 10,20 30 rgb(0,1)", "circle 10,20 30rgb(0,1,2)",
"circle 10,20 30 rgb(1a,2,3)", "circle 10,20 30,rgb(0,2,3)", "circle 10,20 30 rgb(256,0,1)",
"circle 10,20 30 rgb(2.0.1)", "circle 10,20 30 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, one point and one natural number (radius) as parameters
valid_inputs = [("circle 10, 20 30", PrintCircleCommand(controller, 10, 20, (0, 0, 0),
DimensionsCircleFactory, radius=30)),
("circle -5 ,-5 30 ", PrintCircleCommand(controller, -5, -5, (0, 0, 0),
DimensionsCircleFactory, radius=30)),
(" circle 10 , 20 30 rgb (10, 20,30)", PrintCircleCommand(controller, 10, 20, (10, 20, 30),
DimensionsCircleFactory, radius=30)),
("circle 10, 20 30 rgb (0, 0 , 0 ) ", PrintCircleCommand(controller, 10, 20, (0, 0, 0),
DimensionsCircleFactory, radius=30))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
def test_rect_parser(controller: Controller, cli_parser: CliParser):
"""
:return:
"""
# Test invalid inputs, two points as parameters
invalid_inputs = ["rect 10,-20 30,40", "rect 10,20 30,+40", "rect 10,20 30.40", "rect 10 20 30,40",
"rect10,20 30,40", "rect 10,20", "rectt 10,20 30,40", "rect something",
"rect 10,20 30,40 rgb(0,0,-1)", "rect 10,20 30,40 rgb(0,0,0", "rect 10,20 30,40 rgb 0,0,0",
"rect 10,20 30,40 rgb(0,1)", "rect 10,20 30,40rgb(0,1,2)",
"rect 10,20 30,40 rgb(1a,2,3)", "rect 10,20 30,40,rgb(0,2,3)",
"rect 10,20 30,40 rgb(256,0,1)", "rect 10,20 30,40 rgb(2.0.1)",
"rect 10,20 30,40 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, two points as parameters
valid_inputs = [("rect 10,20 30,40", PrintRectCommand(controller, 10, 20, (0, 0, 0), end_x=30, end_y=40)),
("rect 10 , 20 -10 ,-20", PrintRectCommand(controller, 10, 20, (0, 0, 0), end_x=0, end_y=0)),
(" rect -5 ,-5 +5,+5 ", PrintRectCommand(controller, -5, -5, (0, 0, 0), end_x=0, end_y=0)),
("rect -5,-5 10, 20", PrintRectCommand(controller, -5, -5, (0, 0, 0), end_x=10, end_y=20)),
("rect 10,20 30,40 rgb (10,20,30)", PrintRectCommand(controller, 10, 20, (10, 20, 30),
end_x=30, end_y=40)),
(" rect 10,20 -10 , -20 rgb(0 , 0 ,0 ) ", PrintRectCommand(controller, 10, 20, (0, 0, 0),
end_x=0, end_y=0))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
# Test invalid inputs, one point and two natural numbers (width and height) as parameters
invalid_inputs = ["rect 10,-20 30 40", "rect 10,20 30 +40", "rect 10,20 -30 40", "rect 10 20 30 40",
"rect10,20 30 40", "rect 10,20", "rect 10,20 30",
"rectt 10,20 30 40", "rect 10,20 something", "rect 10,20 30 something",
"rect 10,20 30 40 rgb(0,0,-1)", "rect 10,20 30 40 rgb(0,0,0", "rect 10,20 30 40 rgb 0,0,0",
"rect 10,20 30 40 rgb(0,1)", "rect 10,20 30 40rgb(0,1,2)", "rect 10,20 30 40 rgb(1a,2,3)",
"rect 10,20 30 40,rgb(0,2,3)", "rect 10,20 30 40 rgb(256,0,1)",
"rect 10,20 30 40 rgb(2.0.1)", "rect 10,20 30 40 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, one point and two natural numbers (width and height) as parameters
valid_inputs = [("rect 10 ,20 20 20", PrintRectCommand(controller, 10, 20, (0, 0, 0),
DimensionsRectFactory, width=20, height=20)),
("rect -10, -20 10 20", PrintRectCommand(controller, -10, -20, (0, 0, 0),
DimensionsRectFactory, width=10, height=20)),
(" rect +10, +20 0 5 ", PrintRectCommand(controller, 10, 20, (0, 0, 0),
DimensionsRectFactory, width=0, height=5)),
("rect +10, -20 20 20 rgb( 10,20,30 )", PrintRectCommand(controller, 10, -20, (10, 20, 30),
DimensionsRectFactory, width=20,
height=20)),
("rect -10 , +20 1000 2 rgb ( 0 , 0 ,0 )", PrintRectCommand(controller, -10, 20, (0, 0, 0),
DimensionsRectFactory, width=1000,
height=2)),
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
def test_dot_parser(controller: Controller, cli_parser: CliParser):
"""
:return:
"""
# Test invalid inputs
invalid_inputs = ["dot 10,-20", "dot +10,20", "dot 10.20", "dot 10 20",
"dot10,20", "dot 10,20 30,40", "dott 10,20", "dot something",
"dot 10,20 rgb(0,0,-1)", "dot 10,20 30,40 rgb(0,0,0", "dot 10,20 rgb 0,0,0",
"dot 10,20 rgb(0,1)", "dot 10,20rgb(0,1,2)", "dot 10,20 rgb(1a,2,3)",
"dot 10,20,rgb(0,2,3)", "dot 10,20 rgb(256,0,1)",
"dot 10,20 rgb(2.0.1)", "dot 10,20 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs
valid_inputs = [("dot 10, 20", PrintDotCommand(controller, 10, 20, (0, 0, 0))),
("dot -10 ,+20", PrintDotCommand(controller, -10, +20, (0, 0, 0))),
(" dot -5,-5 ", PrintDotCommand(controller, -5, -5, (0, 0, 0))),
("dot 10,20 rgb (10,20,30) ", PrintDotCommand(controller, 10, 20, (10, 20, 30))),
("dot -10 , -20 rgb ( 0 , 0, 0 ) ", PrintDotCommand(controller, -10, -20, (0, 0, 0)))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
def test_line_parser(controller: Controller, cli_parser: CliParser):
invalid_inputs = ["line 10,-20 30,40", "line 10,20 30,+40", "line 10,20 30.40", "line 10 20 30,40",
"line10,20 30,40", "line 10,20", "linet 10,20 30,40", "line something",
"line 10,20 30,40 rgb(0,0,-1)", "line 10,20 30,40 rgb(0,0,0", "line 10,20 30,40 rgb 0,0,0",
"line 10,20 30,40 rgb(0,1)", "line 10,20 30,40rgb(0,1,2)", "line 10,20 30,40 rgb(1a,2,3)",
"line 10,20 30,40,rgb(0,2,3)", "line 10,20 30,40 rgb(256,0,1)",
"line 10,20 30,40 rgb(2.0.1)", "line 10,20 30,40 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, two points
valid_inputs = [("line 10 ,20 30,40", PrintLineCommand(controller, 10, 20, 30, 40, (0, 0, 0))),
("line 10, 20 -10, -20", PrintLineCommand(controller, 10, 20, 0, 0, (0, 0, 0))),
(" line -5,-5 +5,+5 ", PrintLineCommand(controller, -5, -5, 0, 0, (0, 0, 0))),
("line -5,-5 10,20", PrintLineCommand(controller, -5, -5, 10, 20, (0, 0, 0))),
(" line 10, 20 30, 40 rgb(10,20, 30)", PrintLineCommand(controller, 10, 20, 30, 40, (10, 20, 30))),
("line 10, 20 -10 , -20 rgb ( 0, 0 , 0 ) ", PrintLineCommand(controller, 10, 20, 0, 0, (0, 0, 0)))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
# Test invalid inputs, three points
invalid_inputs = ["line 10,20 30,40 50,-60", "line 10,20 30,40 50,+60", "line 10,20 30,40 50.60",
"line 10,20 30,40 50 60", "line 10,20 30,40 something",
"line 10,20 30,40 50,60 rgb(0,0,-1)", "line 10,20 30,40 50,60 rgb(0,0,0",
"line 10,20 30,40 rgb 0,0,0", "line 10,20 30,40 50,60 rgb(0,1)",
"line 10,20 30,40 50,60 rgb(1a,2,3)", "line 10,20 30,40,50,60 rgb(0,2,3)",
"line 10,20 30,40 50,60 rgb(256,0,1)", "line 10,20 30,40 50,60 rgb(2.0.1)",
"line 10,20 30,40 50,60rgb(0,1,2)", "line 10,20 30,40 50,60 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, three points
valid_inputs = [("line 10,20 30 ,40 50, 60",
PrintPolylineCommand(controller, [(10, 20), (30, 40), (50, 60)], (0, 0, 0))),
(" line 10 ,20 -10,-20 10,20",
PrintPolylineCommand(controller, [(10, 20), (0, 0), (10, 20)], (0, 0, 0))),
("line -5, -5 +5,+5 5 ,5",
PrintPolylineCommand(controller, [(-5, -5), (0, 0), (5, 5)], (0, 0, 0))),
("line -5 , -5 10,20 -10,-20",
PrintPolylineCommand(controller, [(-5, -5), (10, 20), (0, 0)], (0, 0, 0))),
("line 10,20 30 ,40 50,60 rgb (10 ,20,30)",
PrintPolylineCommand(controller, [(10, 20), (30, 40), (50, 60)], (10, 20, 30))),
("line 10 ,20 -10, -20 +30 ,+40 rgb ( 0, 0 , 0 ) ",
PrintPolylineCommand(controller, [(10, 20), (0, 0), (30, 40)], (0, 0, 0))),
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
# Test invalid inputs, four points
invalid_inputs = ["line 10,20 30,40 50,60 70,-80", "line 10,20 30,40 50,60 70,+80",
"line 10,20 30,40 50,60 70.80", "line 10,20 30,40 50,60 70 80",
"line 10,20 30,40 50,60 something",
"line 10,20 30,40 50,60 70,80 rgb(0,0,-1)", "line 10,20 30,40 50,60 70,80 rgb(0,0,0",
"line 10,20 30,40 50,60 70,80 rgb 0,0,0", "line 10,20 30,40 50,60 70,80 rgb(0,1)",
"line 10,20 30,40 50,60 70,80 rgb(1a,2,3)", "line 10,20 30,40,50,60 70,80 rgb(0,2,3)",
"line 10,20 30,40 50,60 70,80 rgb(256,0,1)", "line 10,20 30,40 50,60 70,80 rgb(2.0.1)",
"line 10,20 30,40 50,60 70,80rgb(0,1,2)", "line 10,20 30,40 50,60 70,80 rgb(123)"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, four points
valid_inputs = [("line 10,20 30,40 50,60 70,80",
PrintPolylineCommand(controller, [(10, 20), (30, 40), (50, 60), (70, 80)], (0, 0, 0))),
("line 10,20 -10,-20 10,20 -10,-20 ",
PrintPolylineCommand(controller, [(10, 20), (0, 0), (10, 20), (0, 0)], (0, 0, 0))),
("line -5,-5 +5 , +5 5 ,5 -5,-5",
PrintPolylineCommand(controller, [(-5, -5), (0, 0), (5, 5), (0, 0)], (0, 0, 0))),
("line -5 ,-5 10,20 -10,-20 10,20",
PrintPolylineCommand(controller, [(-5, -5), (10, 20), (0, 0), (10, 20)], (0, 0, 0))),
("line 10,20 30,40 50,60 70,80 rgb(10,20,30)",
PrintPolylineCommand(controller, [(10, 20), (30, 40), (50, 60), (70, 80)], (10, 20, 30))),
(" line 10, 20 -10 , -20 +30,+40 -30 , -40 rgb (0 ,0 ,0 )",
PrintPolylineCommand(controller, [(10, 20), (0, 0), (30, 40), (0, 0)], (0, 0, 0))),
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
# --------------- Other CommandParsers tests ---------------
def test_move_shape_parser(controller: Controller, cli_parser: CliParser):
# Test invalid inputs, two points as parameters
invalid_inputs = ["move 10,-20 30,40", "move 10,20 30,+40", "move 10,20 30.40", "move 10 20 30,40",
"move10,20 30,40", "move 10,20", "movee 10,20 30,40", "move something",
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs, two points as parameters
valid_inputs = [("move 10,20 30,40", MoveShapeCommand(controller, 10, 20, 30, 40)),
("move 10,20 -10,-20", MoveShapeCommand(controller, 10, 20, 0, 0)),
("move 10 ,20 30, 40", MoveShapeCommand(controller, 10, 20, 30, 40)),
(" move 10, 20 30 ,40 ", MoveShapeCommand(controller, 10, 20, 30, 40)),
("move 10 , 20 30 , 40", MoveShapeCommand(controller, 10, 20, 30, 40)),
("move -5,-5 +5,+5", MoveShapeCommand(controller, -5, -5, 0, 0)),
("move -5,-5 10,20", MoveShapeCommand(controller, -5, -5, 10, 20))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
def test_remove_shape_parser(controller: Controller, cli_parser: CliParser):
# Test invalid inputs
invalid_inputs = ["remove 10,-20", "remove +10,20", "remove 10.20", "remove 10 20",
"remove10,20", "remove 10,20 30,40", "removet 10,20", "remove something",
"remove 10,20 something"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs
valid_inputs = [("remove 10,20", RemoveShapeCommand(controller, 10, 20)),
("remove 10, 20", RemoveShapeCommand(controller, 10, 20)),
(" remove 10 ,20 ", RemoveShapeCommand(controller, 10, 20)),
(" remove 10 , 20", RemoveShapeCommand(controller, 10, 20)),
("remove -10,+20", RemoveShapeCommand(controller, -10, +20)),
("remove -5,-5", RemoveShapeCommand(controller, -5, -5))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
def test_list_shape_parser(controller: Controller, cli_parser: CliParser):
# Test invalid inputs
invalid_inputs = ["ls 10,-20", "ls +10,20", "ls 10.20", "ls 10 20",
"ls10,20", "ls 10,20 30,40", "lst 10,20", "ls 10,20 something",
"ls something", "l s"
]
for cli_input in invalid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == InvalidCommand(controller)
# Test valid inputs
valid_inputs = [("ls 10,20", ListShapeCommand(controller, 10, 20)),
("ls 10 ,20 ", ListShapeCommand(controller, 10, 20)),
(" ls 10 , 20", ListShapeCommand(controller, 10, 20)),
("ls -10,+20", ListShapeCommand(controller, -10, +20)),
("ls -5,-5", ListShapeCommand(controller, -5, -5)),
("ls", ListShapeCommand(controller)),
("ls ", ListShapeCommand(controller)),
(" ls ", ListShapeCommand(controller))
]
for cli_input, expected in valid_inputs:
command = cli_parser.parse_input(cli_input)
assert command == expected
def test_clear_parser(controller: Controller, cli_parser: CliParser):
# Test valid inputs
assert cli_parser.parse_input("clear") == ClearCommand(controller)
assert cli_parser.parse_input(" clear") == ClearCommand(controller)
assert cli_parser.parse_input(" clear ") == ClearCommand(controller)
# Test invalid inputs
assert cli_parser.parse_input("clear something") == InvalidCommand(controller)
assert cli_parser.parse_input("clearsomething") == InvalidCommand(controller)
def test_quit_parser(controller: Controller, cli_parser: CliParser):
# Test valid inputs
assert cli_parser.parse_input("quit") == QuitCommand(controller)
assert cli_parser.parse_input(" quit") == QuitCommand(controller)
assert cli_parser.parse_input(" quit ") == QuitCommand(controller)
# Test invalid inputs
assert cli_parser.parse_input("quit something") == InvalidCommand(controller)
assert cli_parser.parse_input("quitsomething") == InvalidCommand(controller)
def test_save_parser(controller: Controller, cli_parser: CliParser):
# Test valid inputs
assert cli_parser.parse_input("save") == SaveCommand(controller)
assert cli_parser.parse_input(" save") == SaveCommand(controller)
assert cli_parser.parse_input(" save ") == SaveCommand(controller)
assert cli_parser.parse_input("save filename") == SaveCommand(controller, "filename")
assert cli_parser.parse_input(" save filename something") == SaveCommand(controller, "filename something")
# Test invalid inputs
assert cli_parser.parse_input("savesomething") == InvalidCommand(controller)
def test_load_parser(controller: Controller, cli_parser: CliParser):
# Test valid inputs
assert cli_parser.parse_input("load") == LoadCommand(controller)
assert cli_parser.parse_input(" load") == LoadCommand(controller)
assert cli_parser.parse_input(" load ") == LoadCommand(controller)
assert cli_parser.parse_input("load filename") == LoadCommand(controller, "filename")
assert cli_parser.parse_input(" load filename something") == LoadCommand(controller, "filename something")
# Test invalid inputs
assert cli_parser.parse_input("loadsomething") == InvalidCommand(controller)
def test_points_conversion(controller: Controller):
"""
Test CommandParser's conversion of RelativeParserPoints to AbsoluteParserPoints.
"""
parser = CommandParser(controller)
# Convert only RelativeParserPoints
points_before_conversion = [RelativeParserPoint(-10, 20), RelativeParserPoint(10, -20), RelativeParserPoint(-5, -5)]
points_after_conversion = [AbsoluteParserPoint(-10, 20), AbsoluteParserPoint(0, 0), AbsoluteParserPoint(-5, -5)]
assert parser.convert_points(points_before_conversion) == points_after_conversion
# Convert RelativeParserPoints and AbsoluteParserPoints, first point is relative
points_before_conversion = [RelativeParserPoint(-10, 20), AbsoluteParserPoint(10, -20), RelativeParserPoint(-5, -5)]
points_after_conversion = [AbsoluteParserPoint(-10, 20), AbsoluteParserPoint(10, -20), AbsoluteParserPoint(5, -25)]
assert parser.convert_points(points_before_conversion) == points_after_conversion
# Convert RelativeParserPoints and AbsoluteParserPoints, first point is absolute
points_before_conversion = [AbsoluteParserPoint(-10, 20), RelativeParserPoint(10, -20), RelativeParserPoint(-5, -5)]
points_after_conversion = [AbsoluteParserPoint(-10, 20), AbsoluteParserPoint(0, 0), AbsoluteParserPoint(-5, -5)]
assert parser.convert_points(points_before_conversion) == points_after_conversion
# Convert only AbsoluteParserPoints
points_before_conversion = [AbsoluteParserPoint(-10, 20), AbsoluteParserPoint(0, 0), AbsoluteParserPoint(-5, -5)]
points_after_conversion = [AbsoluteParserPoint(-10, 20), AbsoluteParserPoint(0, 0), AbsoluteParserPoint(-5, -5)]
assert parser.convert_points(points_before_conversion) == points_after_conversion
# Empty list conversion
try:
parser.convert_points([])
assert False
except AttributeError:
assert True
| 54.995406
| 121
| 0.543384
| 4,463
| 35,912
| 4.281201
| 0.048622
| 0.077877
| 0.051185
| 0.052756
| 0.840948
| 0.815199
| 0.772544
| 0.732559
| 0.667661
| 0.631025
| 0
| 0.139485
| 0.2933
| 35,912
| 652
| 122
| 55.079755
| 0.613381
| 0.076019
| 0
| 0.367171
| 0
| 0.017279
| 0.221478
| 0.000849
| 0
| 0
| 0
| 0
| 0.146868
| 1
| 0.047516
| false
| 0
| 0.023758
| 0
| 0.075594
| 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
|
29decfd1b33175f9c7e044678bf834df1bcb32bc
| 234
|
py
|
Python
|
api/contract/admin.py
|
sttpforever/Account_lite
|
2f4f42b50d4aff4aabaeb9325abefcf866cd4612
|
[
"MIT"
] | null | null | null |
api/contract/admin.py
|
sttpforever/Account_lite
|
2f4f42b50d4aff4aabaeb9325abefcf866cd4612
|
[
"MIT"
] | null | null | null |
api/contract/admin.py
|
sttpforever/Account_lite
|
2f4f42b50d4aff4aabaeb9325abefcf866cd4612
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import MyUser, Project, Customer, Bank, Check
admin.site.register(Project)
admin.site.register(Customer)
admin.site.register(Bank)
admin.site.register(Check)
admin.site.register(MyUser)
| 23.4
| 58
| 0.807692
| 33
| 234
| 5.727273
| 0.393939
| 0.238095
| 0.449735
| 0.232804
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081197
| 234
| 9
| 59
| 26
| 0.87907
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.285714
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
29e42a7ee76ba009bbc7ab470a4df86475408614
| 6,233
|
py
|
Python
|
backend/app/app/tests/api/api_v1/test_endpoints.py
|
totalhack/zar
|
e50a5f96f9df1316ca4205309920401c19db6e31
|
[
"MIT"
] | 1
|
2020-11-02T14:31:30.000Z
|
2020-11-02T14:31:30.000Z
|
backend/app/app/tests/api/api_v1/test_endpoints.py
|
totalhack/zar
|
e50a5f96f9df1316ca4205309920401c19db6e31
|
[
"MIT"
] | null | null | null |
backend/app/app/tests/api/api_v1/test_endpoints.py
|
totalhack/zar
|
e50a5f96f9df1316ca4205309920401c19db6e31
|
[
"MIT"
] | null | null | null |
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
from tlbx import st, pp
from app.core.config import settings
from app.number_pool import NumberPoolResponseStatus
SAMPLE_PAGE_REQUEST = {
"type": "page",
"properties": {
"title": "Page One",
"url": "http://localhost:8080/one",
"path": "/one",
"hash": "",
"search": "",
"width": 1680,
"height": 619,
"referrer": "http://localhost:8080/one",
"zar": {
"cid": {
"id": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"t": 1604071692653,
"origReferrer": "http://localhost:8080/one",
"isNew": True,
"visits": 1,
},
"sid": {
"id": "d3901827-c280-446e-bd8f-fcf8deb12f2d",
"t": 1604071692653,
"origReferrer": "http://localhost:8080/one",
"isNew": True,
"visits": 1,
},
"vid": {
"id": "kgwevbe3.ryqmjkraheq",
"t": 1604071692651,
"origReferrer": "http://localhost:8080/one",
"isNew": True,
"visits": 1,
},
},
},
"options": {},
"userId": None,
"anonymousId": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"meta": {"timestamp": 1604071694775},
}
def test_endpoint_page(client: TestClient) -> None:
resp = client.post(f"{settings.API_V1_STR}/page", json=SAMPLE_PAGE_REQUEST)
assert resp.status_code == 200
data = resp.json()
pp(data)
assert data.get("id", None)
SAMPLE_TRACK_REQUEST = {
"type": "track",
"event": "event1",
"properties": {
"attr1": "val1",
"attr2": "val2",
"zar": {
"cid": {
"id": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"t": 1604071705447,
"origReferrer": "http://localhost:8080/one",
"isNew": False,
"visits": 3,
},
"sid": {
"id": "d3901827-c280-446e-bd8f-fcf8deb12f2d",
"t": 1604071692653,
"origReferrer": "http://localhost:8080/one",
"isNew": True,
"visits": 1,
},
"vid": {
"id": "kgwevbe3.ryqmjkraheq",
"t": 1604071692651,
"origReferrer": "http://localhost:8080/one",
"isNew": True,
"visits": 1,
},
},
"anonymousId": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"category": "All",
},
"options": {},
"userId": None,
"anonymousId": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"meta": {"timestamp": 1604072961820},
}
def test_endpoint_track(client: TestClient) -> None:
resp = client.post(f"{settings.API_V1_STR}/track", json=SAMPLE_TRACK_REQUEST)
assert resp.status_code == 200
data = resp.json()
pp(data)
assert data.get("id", None)
SAMPLE_NUMBER_POOL_REQUEST = {
"pool_id": "1",
"number": None,
"context": {"foo": "bar", "baz": "bar"},
"properties": {
"attr1": "val1",
"attr2": "val2",
"zar": {
"cid": {
"id": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"t": 1604071705447,
"origReferrer": "http://localhost:8080/one",
"isNew": False,
"visits": 3,
},
"sid": {
"id": "d3901827-c280-446e-bd8f-fcf8deb12f2d",
"t": 1604071692653,
"origReferrer": "http://localhost:8080/one",
"isNew": True,
"visits": 1,
},
"vid": {
"id": "kgwevbe3.ryqmjkraheq",
"t": 1604071692651,
"origReferrer": "http://localhost:8080/one",
"isNew": True,
"visits": 1,
},
},
"anonymousId": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"category": "All",
},
"options": {},
"userId": None,
"anonymousId": "29d7dfba-47ed-4305-ad91-e0625101afbf",
"meta": {"timestamp": 1604072961820},
}
def test_endpoint_number_pool(client: TestClient) -> None:
resp = client.post(
f"{settings.API_V1_STR}/number_pool", json=SAMPLE_NUMBER_POOL_REQUEST
)
assert resp.status_code == 200
data = resp.json()
pp(data)
assert data.get("status", None) == NumberPoolResponseStatus.SUCCESS
SAMPLE_TRACK_CALL_REQUEST = {
"key": "abc",
"call_id": "1234",
"call_from": "5551235555",
"call_to": "5551235556",
}
def test_endpoint_call_track_error(client: TestClient) -> None:
resp = client.post(
f"{settings.API_V1_STR}/track_call", json=SAMPLE_TRACK_CALL_REQUEST
)
assert resp.status_code == 200
data = resp.json()
pp(data)
# We didn't create a number context so this should respond with an error
assert data.get("status", None) == NumberPoolResponseStatus.ERROR
def test_endpoint_call_track_success(client: TestClient) -> None:
resp = client.get(
f"{settings.API_V1_STR}/reset_pool",
params=dict(key="abc", pool_id=1, preserve=False),
)
assert resp.status_code == 200
resp = client.post(
f"{settings.API_V1_STR}/number_pool", json=SAMPLE_NUMBER_POOL_REQUEST
)
assert resp.status_code == 200
data = resp.json()
pp(data)
assert data.get("status", None) == NumberPoolResponseStatus.SUCCESS
number = data["number"]
track_call_req = SAMPLE_TRACK_CALL_REQUEST.copy()
track_call_req["call_to"] = number
pp(track_call_req)
resp = client.post(f"{settings.API_V1_STR}/track_call", json=track_call_req)
assert resp.status_code == 200
data = resp.json()
pp(data)
assert data.get("status", None) == NumberPoolResponseStatus.SUCCESS
# route context should come into play on this one
resp = client.post(f"{settings.API_V1_STR}/track_call", json=track_call_req)
assert resp.status_code == 200
data = resp.json()
pp(data)
assert data.get("status", None) == NumberPoolResponseStatus.SUCCESS
| 29.966346
| 81
| 0.54051
| 630
| 6,233
| 5.207937
| 0.209524
| 0.043584
| 0.056995
| 0.067053
| 0.755867
| 0.719902
| 0.705578
| 0.705578
| 0.705578
| 0.693386
| 0
| 0.112297
| 0.308519
| 6,233
| 207
| 82
| 30.111111
| 0.648956
| 0.018931
| 0
| 0.629834
| 0
| 0
| 0.275896
| 0.10522
| 0
| 0
| 0
| 0
| 0.082873
| 1
| 0.027624
| false
| 0
| 0.027624
| 0
| 0.055249
| 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
|
29f6122a6d2aab376f6acd5eeb28c6718c45b614
| 41
|
py
|
Python
|
22.py
|
qi15176370875/text
|
aec39c6d269b8f69793b294c2105bee15d202c71
|
[
"MIT"
] | 2
|
2019-03-04T09:33:19.000Z
|
2019-03-04T09:33:24.000Z
|
22.py
|
qi15176370875/text
|
aec39c6d269b8f69793b294c2105bee15d202c71
|
[
"MIT"
] | null | null | null |
22.py
|
qi15176370875/text
|
aec39c6d269b8f69793b294c2105bee15d202c71
|
[
"MIT"
] | null | null | null |
a = 11220
b = 15165
c = 15616
c = 225565
| 8.2
| 10
| 0.609756
| 8
| 41
| 3.125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.724138
| 0.292683
| 41
| 4
| 11
| 10.25
| 0.137931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4b03a01bc6ebcf4ad53a41a9d3fcd311da2d348c
| 71
|
py
|
Python
|
calculate.py
|
cu-swe4s-fall-2020/version-control-nabbsophie
|
53c763e9f0af9977c05f55dc0109d0724b385b7f
|
[
"MIT"
] | null | null | null |
calculate.py
|
cu-swe4s-fall-2020/version-control-nabbsophie
|
53c763e9f0af9977c05f55dc0109d0724b385b7f
|
[
"MIT"
] | null | null | null |
calculate.py
|
cu-swe4s-fall-2020/version-control-nabbsophie
|
53c763e9f0af9977c05f55dc0109d0724b385b7f
|
[
"MIT"
] | 1
|
2020-09-09T03:10:15.000Z
|
2020-09-09T03:10:15.000Z
|
import math_lib as ml
x3 = print(ml.add(3,2))
x4 = print(ml.div(34,2))
| 17.75
| 24
| 0.661972
| 17
| 71
| 2.705882
| 0.764706
| 0.304348
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114754
| 0.140845
| 71
| 3
| 25
| 23.666667
| 0.639344
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.666667
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
4b18d0d75b3cce3a79458d0da29830294a547840
| 26,912
|
py
|
Python
|
muse_for_anything/api/v1_api/taxonomy_helpers.py
|
baireutherjonas/muse-for-anything
|
a625b4fc6468d74fa12886dc465d5694eed86e04
|
[
"MIT"
] | null | null | null |
muse_for_anything/api/v1_api/taxonomy_helpers.py
|
baireutherjonas/muse-for-anything
|
a625b4fc6468d74fa12886dc465d5694eed86e04
|
[
"MIT"
] | 1
|
2021-11-14T18:55:44.000Z
|
2021-11-14T18:55:44.000Z
|
muse_for_anything/api/v1_api/taxonomy_helpers.py
|
baireutherjonas/muse-for-anything
|
a625b4fc6468d74fa12886dc465d5694eed86e04
|
[
"MIT"
] | 1
|
2021-09-08T13:49:52.000Z
|
2021-09-08T13:49:52.000Z
|
from typing import Any, Dict, List, Optional, Union
from flask import url_for
from muse_for_anything.db.models.namespace import Namespace
from muse_for_anything.api.v1_api.namespace_helpers import query_params_to_api_key
from muse_for_anything.api.base_models import (
ApiLink,
ApiResponse,
)
from muse_for_anything.api.v1_api.models.ontology import (
TaxonomyData,
TaxonomyItemData,
TaxonomyItemRelationData,
TaxonomyItemRelationSchema,
TaxonomyItemSchema,
TaxonomySchema,
)
from muse_for_anything.db.models.taxonomies import (
Taxonomy,
TaxonomyItem,
TaxonomyItemRelation,
TaxonomyItemVersion,
)
def taxonomy_page_params_to_key(
namespace: str, query_params: Optional[Dict[str, Union[str, int]]] = None
) -> Dict[str, str]:
if query_params is None:
query_params = {}
start_key = query_params_to_api_key(query_params)
start_key["namespaceId"] = namespace
return start_key
def nav_links_for_taxonomy_page(namespace: Namespace) -> List[ApiLink]:
nav_links: List[ApiLink] = [
ApiLink(
href=url_for(
"api-v1.NamespaceView",
namespace=str(namespace.id),
_external=True,
),
rel=("up",),
resource_type="ont-namespace",
resource_key={"namespaceId": str(namespace.id)},
schema=url_for("api-v1.ApiSchemaView", schema_id="Namespace", _external=True),
name=namespace.name,
),
]
return nav_links
def create_action_link_for_taxonomy_page(namespace: Namespace) -> ApiLink:
return ApiLink(
href=url_for(
"api-v1.TaxonomiesView",
namespace=str(namespace.id),
_external=True,
),
rel=("create", "post"),
resource_type="ont-taxonomy",
resource_key={"namespaceId": str(namespace.id)},
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
)
def action_links_for_taxonomy_page(namespace: Namespace) -> List[ApiLink]:
actions: List[ApiLink] = []
if namespace.deleted_on is None:
# namespace is not deleted
actions.append(create_action_link_for_taxonomy_page(namespace=namespace))
return actions
def taxonomy_to_key(taxonomy: Taxonomy) -> Dict[str, str]:
return {"namespaceId": str(taxonomy.namespace_id), "taxonomyId": str(taxonomy.id)}
def nav_links_for_taxonomy(taxonomy: Taxonomy) -> List[ApiLink]:
nav_links: List[ApiLink] = [
ApiLink(
href=url_for(
"api-v1.TaxonomiesView",
namespace=str(taxonomy.namespace_id),
_external=True,
),
rel=("up", "page", "first", "collection"),
resource_type="ont-taxonomy",
resource_key={"namespaceId": str(taxonomy.namespace_id)},
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
),
ApiLink(
href=url_for(
"api-v1.TaxonomyItemsView",
namespace=str(taxonomy.namespace_id),
taxonomy=str(taxonomy.id),
_external=True,
),
rel=("nav", "page", "first", "collection"),
resource_type="ont-taxonomy-item",
resource_key={
"namespaceId": str(taxonomy.namespace_id),
"taxonomyId": str(taxonomy.id),
},
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomyItemSchema", _external=True
),
),
ApiLink(
href=url_for(
"api-v1.NamespaceView",
namespace=str(taxonomy.namespace_id),
_external=True,
),
rel=("nav",),
resource_type="ont-namespace",
resource_key={"namespaceId": str(taxonomy.namespace_id)},
schema=url_for("api-v1.ApiSchemaView", schema_id="Namespace", _external=True),
name=taxonomy.namespace.name,
),
]
return nav_links
def taxonomy_item_to_key(item: TaxonomyItem) -> Dict[str, str]:
return {
"namespaceId": str(item.taxonomy.namespace_id),
"taxonomyId": str(item.taxonomy_id),
"taxonomyItemId": str(item.id),
}
def taxonomy_item_to_api_link(item: TaxonomyItem) -> ApiLink:
return ApiLink(
href=url_for(
"api-v1.TaxonomyItemView",
namespace=str(item.taxonomy.namespace_id),
taxonomy=str(item.taxonomy_id),
taxonomy_item=str(item.id),
_external=True,
),
rel=tuple(),
resource_type="ont-taxonomy-item",
resource_key=taxonomy_item_to_key(item),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomyItemSchema", _external=True
),
name=item.name,
)
def taxonomy_to_items_links(taxonomy: Taxonomy) -> List[ApiLink]:
return [taxonomy_item_to_api_link(item) for item in taxonomy.current_items]
def taxonomy_to_taxonomy_data(taxonomy: Taxonomy) -> TaxonomyData:
return TaxonomyData(
self=ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=str(taxonomy.namespace_id),
taxonomy=str(taxonomy.id),
_external=True,
),
rel=tuple(),
resource_type="ont-taxonomy",
resource_key=taxonomy_to_key(taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
name=taxonomy.name,
),
name=taxonomy.name,
description=taxonomy.description,
created_on=taxonomy.created_on,
updated_on=taxonomy.updated_on,
deleted_on=taxonomy.deleted_on,
items=taxonomy_to_items_links(taxonomy),
)
def action_links_for_taxonomy(taxonomy: Taxonomy) -> List[ApiLink]:
actions: List[ApiLink] = []
if taxonomy.namespace.deleted_on is None:
# namespace is modifyable
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomiesView",
namespace=str(taxonomy.namespace_id),
_external=True,
),
rel=("create", "post"),
resource_type="ont-taxonomy",
resource_key={"namespaceId": str(taxonomy.namespace_id)},
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
)
)
resource_key = taxonomy_to_key(taxonomy)
if taxonomy.deleted_on is None:
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=str(taxonomy.namespace_id),
taxonomy=str(taxonomy.id),
_external=True,
),
rel=("update", "put"),
resource_type="ont-taxonomy",
resource_key=resource_key,
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
name=taxonomy.name,
)
)
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=str(taxonomy.namespace_id),
taxonomy=str(taxonomy.id),
_external=True,
),
rel=("delete",),
resource_type="ont-taxonomy",
resource_key=resource_key,
name=taxonomy.name,
)
)
actions.append(create_action_link_for_taxonomy_item_page(taxonomy))
else:
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=str(taxonomy.namespace_id),
taxonomy=str(taxonomy.id),
_external=True,
),
rel=("restore", "post"),
resource_type="ont-taxonomy",
resource_key=resource_key,
name=taxonomy.name,
)
)
return actions
def taxonomy_to_api_response(taxonomy: Taxonomy) -> ApiResponse:
taxonomy_data = taxonomy_to_taxonomy_data(taxonomy)
raw_taxonomy: Dict[str, Any] = TaxonomySchema().dump(taxonomy_data)
return ApiResponse(
links=(
*nav_links_for_taxonomy(taxonomy),
*action_links_for_taxonomy(taxonomy),
),
data=raw_taxonomy,
)
def taxonomy_item_page_params_to_key(
namespace: str,
taxonomy: str,
query_params: Optional[Dict[str, Union[str, int]]] = None,
) -> Dict[str, str]:
if query_params is None:
query_params = {}
start_key = query_params_to_api_key(query_params)
start_key["namespaceId"] = namespace
start_key["taxonomyId"] = taxonomy
return start_key
def nav_links_for_taxonomy_item_page(taxonomy: Taxonomy) -> List[ApiLink]:
nav_links: List[ApiLink] = [
ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=str(taxonomy.namespace_id),
taxonomy=str(taxonomy.id),
_external=True,
),
rel=("up",),
resource_type="ont-taxonomy",
resource_key=taxonomy_to_key(taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
name=taxonomy.name,
),
ApiLink(
href=url_for(
"api-v1.NamespaceView",
namespace=str(taxonomy.namespace_id),
_external=True,
),
rel=("nav",),
resource_type="ont-namespace",
resource_key={"namespaceId": str(taxonomy.namespace_id)},
schema=url_for("api-v1.ApiSchemaView", schema_id="Namespace", _external=True),
name=taxonomy.namespace.name,
),
]
return nav_links
def create_action_link_for_taxonomy_item_page(taxonomy: Taxonomy) -> ApiLink:
return ApiLink(
href=url_for(
"api-v1.TaxonomyItemsView",
namespace=str(taxonomy.namespace_id),
taxonomy=str(taxonomy.id),
_external=True,
),
rel=("create", "post"),
resource_type="ont-taxonomy-item",
resource_key=taxonomy_to_key(taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomyItemSchema", _external=True
),
)
def action_links_for_taxonomy_item_page(taxonomy: Taxonomy) -> List[ApiLink]:
actions: List[ApiLink] = []
if taxonomy.deleted_on is None and taxonomy.namespace.deleted_on is None:
# taxonomy and namespace are not deleted
actions.append(create_action_link_for_taxonomy_item_page(taxonomy=taxonomy))
return actions
def taxonomy_item_version_to_key(item: TaxonomyItemVersion) -> Dict[str, str]:
return {
"namespaceId": str(item.taxonomy_item.taxonomy.namespace_id),
"taxonomyId": str(item.taxonomy_item.taxonomy_id),
"taxonomyItemId": str(item.taxonomy_item.id),
"version": str(item.version),
}
def taxonomy_item_version_to_api_link(item: TaxonomyItemVersion) -> ApiLink:
return ApiLink(
href=url_for(
"api-v1.TaxonomyItemVersionView",
namespace=str(item.taxonomy_item.taxonomy.namespace_id),
taxonomy=str(item.taxonomy_item.taxonomy_id),
taxonomy_item=str(item.taxonomy_item_id),
version=str(item.version),
_external=True,
),
rel=tuple(),
resource_type="ont-taxonomy-item-version",
resource_key=taxonomy_item_version_to_key(item),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomyItemSchema", _external=True
),
name=item.name,
)
def taxonomy_item_relation_to_api_link(relation: TaxonomyItemRelation) -> ApiLink:
resource_key = taxonomy_item_to_key(relation.taxonomy_item_source)
resource_key["relationId"] = str(relation.id)
return ApiLink(
href=url_for(
"api-v1.TaxonomyItemRelationView",
namespace=str(relation.taxonomy_item_source.taxonomy.namespace_id),
taxonomy=str(relation.taxonomy_item_source.taxonomy_id),
taxonomy_item=str(relation.taxonomy_item_source_id),
relation=str(relation.id),
_external=True,
),
rel=tuple(),
resource_type="ont-taxonomy-item-relation",
resource_key=resource_key,
)
def taxonomy_item_to_taxonomy_item_data(
item: Union[TaxonomyItem, TaxonomyItemVersion]
) -> TaxonomyItemData:
is_taxonomy_item = isinstance(item, TaxonomyItem)
self_link: ApiLink
if is_taxonomy_item:
self_link = taxonomy_item_to_api_link(item)
else:
self_link = taxonomy_item_version_to_api_link(item)
updated_on = item.updated_on if is_taxonomy_item else item.created_on
tax_item: TaxonomyItem = item if is_taxonomy_item else item.taxonomy_item
parents = [
taxonomy_item_to_api_link(parent.taxonomy_item_source)
for parent in tax_item.current_ancestors
]
children = [
taxonomy_item_relation_to_api_link(child) for child in tax_item.current_related
]
return TaxonomyItemData(
self=self_link,
name=item.name,
description=item.description,
sort_key=item.sort_key,
version=item.version,
parents=parents,
children=children,
created_on=item.created_on,
updated_on=updated_on,
deleted_on=item.deleted_on,
)
def nav_links_for_taxonomy_item(item: TaxonomyItem) -> List[ApiLink]:
namespace_id = str(item.taxonomy.namespace_id)
nav_links: List[ApiLink] = [
ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
_external=True,
),
rel=("up",),
resource_type="ont-taxonomy",
resource_key=taxonomy_to_key(item.taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
name=item.taxonomy.name,
),
ApiLink(
href=url_for(
"api-v1.TaxonomiesView",
namespace=namespace_id,
_external=True,
),
rel=("nav", "page", "first", "collection"),
resource_type="ont-taxonomy",
resource_key={"namespaceId": namespace_id},
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
),
ApiLink(
href=url_for(
"api-v1.NamespaceView",
namespace=namespace_id,
_external=True,
),
rel=("nav",),
resource_type="ont-namespace",
resource_key={"namespaceId": namespace_id},
schema=url_for("api-v1.ApiSchemaView", schema_id="Namespace", _external=True),
name=item.taxonomy.namespace.name,
),
]
return nav_links
def action_links_for_taxonomy_item(item: TaxonomyItem) -> List[ApiLink]:
actions: List[ApiLink] = []
if item.taxonomy.namespace.deleted_on is None and item.taxonomy.deleted_on is None:
# namespace and taxonomy are modifyable
namespace_id = str(item.taxonomy.namespace_id)
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyItemsView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
_external=True,
),
rel=("create", "post"),
resource_type="ont-taxonomy-item",
resource_key=taxonomy_to_key(item.taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomyItemSchema", _external=True
),
)
)
resource_key = taxonomy_item_to_key(item)
if item.deleted_on is None:
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyItemView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
taxonomy_item=str(item.id),
_external=True,
),
rel=("update", "put"),
resource_type="ont-taxonomy-item",
resource_key=resource_key,
schema=url_for(
"api-v1.ApiSchemaView",
schema_id="TaxonomyItemSchema",
_external=True,
),
name=item.name,
)
)
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyItemView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
taxonomy_item=str(item.id),
_external=True,
),
rel=("delete",),
resource_type="ont-taxonomy-item",
resource_key=resource_key,
name=item.name,
)
)
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyItemRelationsView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
taxonomy_item=str(item.id),
_external=True,
),
rel=("create", "post"),
resource_type="ont-taxonomy-item-relation",
resource_key=taxonomy_item_to_key(item),
schema=url_for(
"api-v1.ApiSchemaView",
schema_id="TaxonomyItemRelationPostSchema",
_external=True,
),
)
)
else:
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyItemView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
taxonomy_item=str(item.id),
_external=True,
),
rel=("restore", "post"),
resource_type="ont-taxonomy-item",
resource_key=resource_key,
name=item.name,
)
)
return actions
def nav_links_for_taxonomy_item_version(
item_version: TaxonomyItemVersion,
) -> List[ApiLink]:
item = item_version.taxonomy_item
namespace_id = str(item.taxonomy.namespace_id)
nav_links: List[ApiLink] = [
# TODO up navigation link to versions page
ApiLink(
href=url_for(
"api-v1.TaxonomyItemView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
taxonomy_item=str(item.id),
_external=True,
),
rel=("nav",),
resource_type="ont-taxonomy-item",
resource_key=taxonomy_to_key(item.taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomyItemSchema", _external=True
),
name=item.name,
),
ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
_external=True,
),
rel=("up",),
resource_type="ont-taxonomy",
resource_key=taxonomy_to_key(item.taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
name=item.taxonomy.name,
),
ApiLink(
href=url_for(
"api-v1.TaxonomiesView",
namespace=namespace_id,
_external=True,
),
rel=("nav", "page", "first", "collection"),
resource_type="ont-taxonomy",
resource_key={"namespaceId": namespace_id},
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
),
ApiLink(
href=url_for(
"api-v1.NamespaceView",
namespace=namespace_id,
_external=True,
),
rel=("nav",),
resource_type="ont-namespace",
resource_key={"namespaceId": namespace_id},
schema=url_for("api-v1.ApiSchemaView", schema_id="Namespace", _external=True),
name=item.taxonomy.namespace.name,
),
]
return nav_links
def action_links_for_taxonomy_item_version(
item_version: TaxonomyItemVersion,
) -> List[ApiLink]:
actions: List[ApiLink] = []
# TODO
return actions
def taxonomy_item_to_api_response(item: TaxonomyItem) -> ApiResponse:
taxonomy_item_data = taxonomy_item_to_taxonomy_item_data(item)
raw_taxonomy_item: Dict[str, Any] = TaxonomyItemSchema().dump(taxonomy_item_data)
return ApiResponse(
links=(
*nav_links_for_taxonomy_item(item),
*action_links_for_taxonomy_item(item),
),
data=raw_taxonomy_item,
)
def create_action_link_for_taxonomy_item_relation_page(
namespace: str, taxonomy: str, taxonomy_item: str
) -> ApiLink:
return ApiLink(
href=url_for(
"api-v1.TaxonomyItemRelationsView",
namespace=namespace,
taxonomy=taxonomy,
taxonomy_item=taxonomy_item,
_external=True,
),
rel=("create", "post"),
resource_type="ont-taxonomy-item-relation",
resource_key={
"namespaceId": namespace,
"taxonomyId": taxonomy,
"taxonomyItemId": taxonomy_item,
},
schema=url_for(
"api-v1.ApiSchemaView",
schema_id="TaxonomyItemRelationPostSchema",
_external=True,
),
)
def nav_links_for_taxonomy_item_relation(
relation: TaxonomyItemRelation,
) -> List[ApiLink]:
taxonomy = relation.taxonomy_item_source.taxonomy
namespace_id = str(taxonomy.namespace_id)
nav_links: List[ApiLink] = [
ApiLink(
href=url_for(
"api-v1.TaxonomyView",
namespace=namespace_id,
taxonomy=str(taxonomy.id),
_external=True,
),
rel=("up",),
resource_type="ont-taxonomy",
resource_key=taxonomy_to_key(taxonomy),
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
name=taxonomy.name,
),
ApiLink(
href=url_for(
"api-v1.TaxonomiesView",
namespace=namespace_id,
_external=True,
),
rel=("nav", "page", "first", "collection"),
resource_type="ont-taxonomy",
resource_key={"namespaceId": namespace_id},
schema=url_for(
"api-v1.ApiSchemaView", schema_id="TaxonomySchema", _external=True
),
),
ApiLink(
href=url_for(
"api-v1.NamespaceView",
namespace=namespace_id,
_external=True,
),
rel=("nav",),
resource_type="ont-namespace",
resource_key={"namespaceId": namespace_id},
schema=url_for("api-v1.ApiSchemaView", schema_id="Namespace", _external=True),
name=taxonomy.namespace.name,
),
]
return nav_links
def action_links_for_taxonomy_item_relation(
relation: TaxonomyItemRelation,
) -> List[ApiLink]:
actions: List[ApiLink] = []
item: TaxonomyItem = relation.taxonomy_item_source
if (
item.taxonomy.namespace.deleted_on is None
and item.taxonomy.deleted_on is None
and item.deleted_on is None
):
# namespace and taxonomy and item are modifyable
namespace_id = str(item.taxonomy.namespace_id)
resource_key = taxonomy_item_to_key(item)
resource_key["relationId"] = str(relation.id)
if item.deleted_on is None:
actions.append(
ApiLink(
href=url_for(
"api-v1.TaxonomyItemRelationView",
namespace=namespace_id,
taxonomy=str(item.taxonomy_id),
taxonomy_item=str(item.id),
relation=str(relation.id),
_external=True,
),
rel=("delete",),
resource_type="ont-taxonomy-item-relation",
resource_key=resource_key,
)
)
return actions
def taxonomy_item_relation_to_taxonomy_item_relation_data(
relation: TaxonomyItemRelation,
) -> TaxonomyItemRelationData:
return TaxonomyItemRelationData(
self=taxonomy_item_relation_to_api_link(relation),
source_item=taxonomy_item_to_api_link(relation.taxonomy_item_source),
target_item=taxonomy_item_to_api_link(relation.taxonomy_item_target),
created_on=relation.created_on,
deleted_on=relation.deleted_on,
)
def taxonomy_item_relation_to_api_response(relation: TaxonomyItemRelation) -> ApiResponse:
relation_data = taxonomy_item_relation_to_taxonomy_item_relation_data(relation)
raw_relation: Dict[str, Any] = TaxonomyItemRelationSchema().dump(relation_data)
return ApiResponse(
links=(
*nav_links_for_taxonomy_item_relation(relation),
*action_links_for_taxonomy_item_relation(relation),
),
data=raw_relation,
)
| 33.55611
| 90
| 0.559007
| 2,571
| 26,912
| 5.569428
| 0.047452
| 0.081291
| 0.037712
| 0.046093
| 0.847056
| 0.815141
| 0.764648
| 0.71248
| 0.651023
| 0.567987
| 0
| 0.003503
| 0.342338
| 26,912
| 801
| 91
| 33.598003
| 0.805526
| 0.0081
| 0
| 0.710674
| 0
| 0
| 0.104662
| 0.024657
| 0
| 0
| 0
| 0.001248
| 0
| 1
| 0.042135
| false
| 0
| 0.009831
| 0.015449
| 0.094101
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d9b3c5fccb880173138cdaa412c4f85fd453cff0
| 2,580
|
py
|
Python
|
telestream_cloud_flip_sdk/telestream_cloud_flip/__init__.py
|
pandastream/telestream-cloud-python-sdk
|
ce0ad503299661a0f622661359367173c06889fc
|
[
"MIT"
] | null | null | null |
telestream_cloud_flip_sdk/telestream_cloud_flip/__init__.py
|
pandastream/telestream-cloud-python-sdk
|
ce0ad503299661a0f622661359367173c06889fc
|
[
"MIT"
] | 2
|
2016-07-06T14:13:31.000Z
|
2018-03-07T12:54:58.000Z
|
telestream_cloud_flip_sdk/telestream_cloud_flip/__init__.py
|
Telestream/telestream-cloud-python-sdk
|
ce0ad503299661a0f622661359367173c06889fc
|
[
"MIT"
] | null | null | null |
# coding: utf-8
# flake8: noqa
"""
Flip API
Flip # noqa: E501
The version of the OpenAPI document: 3.1
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
__version__ = "2.1.0"
# import apis into sdk package
from telestream_cloud_flip.api.flip_api import FlipApi
# import ApiClient
from telestream_cloud_flip.api_client import ApiClient
from telestream_cloud_flip.configuration import Configuration
from telestream_cloud_flip.exceptions import OpenApiException
from telestream_cloud_flip.exceptions import ApiTypeError
from telestream_cloud_flip.exceptions import ApiValueError
from telestream_cloud_flip.exceptions import ApiKeyError
from telestream_cloud_flip.exceptions import ApiException
# import models into sdk package
from telestream_cloud_flip.models.canceled_response import CanceledResponse
from telestream_cloud_flip.models.copy_profile_body import CopyProfileBody
from telestream_cloud_flip.models.count_response import CountResponse
from telestream_cloud_flip.models.create_encoding_body import CreateEncodingBody
from telestream_cloud_flip.models.create_video_body import CreateVideoBody
from telestream_cloud_flip.models.deleted_response import DeletedResponse
from telestream_cloud_flip.models.encoding import Encoding
from telestream_cloud_flip.models.encoding_signed_url import EncodingSignedUrl
from telestream_cloud_flip.models.encoding_signed_urls import EncodingSignedUrls
from telestream_cloud_flip.models.error import Error
from telestream_cloud_flip.models.extra_file import ExtraFile
from telestream_cloud_flip.models.factory import Factory
from telestream_cloud_flip.models.paginated_encodings_collection import PaginatedEncodingsCollection
from telestream_cloud_flip.models.paginated_factory_collection import PaginatedFactoryCollection
from telestream_cloud_flip.models.paginated_profiles_collection import PaginatedProfilesCollection
from telestream_cloud_flip.models.paginated_video_collection import PaginatedVideoCollection
from telestream_cloud_flip.models.paginated_workflows_collection import PaginatedWorkflowsCollection
from telestream_cloud_flip.models.profile import Profile
from telestream_cloud_flip.models.resubmit_video_body import ResubmitVideoBody
from telestream_cloud_flip.models.retried_response import RetriedResponse
from telestream_cloud_flip.models.signed_video_url import SignedVideoUrl
from telestream_cloud_flip.models.update_encoding_body import UpdateEncodingBody
from telestream_cloud_flip.models.video import Video
| 46.071429
| 100
| 0.887597
| 323
| 2,580
| 6.767802
| 0.275542
| 0.198536
| 0.269442
| 0.326167
| 0.497713
| 0.333028
| 0.073193
| 0
| 0
| 0
| 0
| 0.004207
| 0.078682
| 2,580
| 55
| 101
| 46.909091
| 0.91544
| 0.099612
| 0
| 0
| 1
| 0
| 0.002183
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.969697
| 0
| 0.969697
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d9c0fcf1d9424596691d685b5e2bbc5da2e8f1c2
| 158
|
py
|
Python
|
src/third_party/ConvONets/utils/libmesh/__init__.py
|
UT-Austin-RPL/Ditto
|
c9bd94ede2aa4343f59f52bc1e3b1e3eccd96484
|
[
"MIT"
] | 42
|
2022-02-17T01:42:39.000Z
|
2022-03-29T00:35:33.000Z
|
src/third_party/ConvONets/utils/libmesh/__init__.py
|
UT-Austin-RPL/Ditto
|
c9bd94ede2aa4343f59f52bc1e3b1e3eccd96484
|
[
"MIT"
] | 5
|
2022-03-07T10:18:01.000Z
|
2022-03-28T23:24:25.000Z
|
src/third_party/ConvONets/utils/libmesh/__init__.py
|
UT-Austin-RPL/Ditto
|
c9bd94ede2aa4343f59f52bc1e3b1e3eccd96484
|
[
"MIT"
] | 7
|
2022-02-18T09:30:22.000Z
|
2022-03-25T21:22:14.000Z
|
from .inside_mesh import MeshIntersector, TriangleIntersector2d, check_mesh_contains
__all__ = [check_mesh_contains, MeshIntersector, TriangleIntersector2d]
| 39.5
| 84
| 0.873418
| 15
| 158
| 8.6
| 0.6
| 0.55814
| 0.263566
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013699
| 0.075949
| 158
| 3
| 85
| 52.666667
| 0.869863
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
d9cd83f520baca3cef365fa9020e4acadc7e3f92
| 265
|
py
|
Python
|
torchwi/io/__init__.py
|
pkgpl/TorchWI
|
772f2f26b2faf7487a1eec6b1c4821ebaf6dd44f
|
[
"MIT"
] | 5
|
2020-11-04T07:24:01.000Z
|
2022-01-07T05:55:18.000Z
|
torchwi/io/__init__.py
|
pkgpl/TorchWI
|
772f2f26b2faf7487a1eec6b1c4821ebaf6dd44f
|
[
"MIT"
] | 5
|
2021-04-28T05:34:28.000Z
|
2022-03-10T04:47:24.000Z
|
torchwi/io/__init__.py
|
pkgpl/TorchWI
|
772f2f26b2faf7487a1eec6b1c4821ebaf6dd44f
|
[
"MIT"
] | null | null | null |
from .logger import MainLogger, JobLogger
from .parser import CFGParser
from .FreqDataloader import FreqDataset
from .TimeDataloader import TimeDataset, TimeForwardDataset
from .TimeDataloader import time_forward_distributed_dataloader, time_distributed_dataloader
| 44.166667
| 92
| 0.883019
| 28
| 265
| 8.178571
| 0.571429
| 0.157205
| 0.209607
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086792
| 265
| 5
| 93
| 53
| 0.946281
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
d9fe6e91e0f788e83725aabef56cbf48c9a110aa
| 238
|
py
|
Python
|
dydx3/eth_signing/__init__.py
|
formula-tech/dydx-v3-python
|
95800e3620c2b1f53053b78f35de6e4c43dfdc1a
|
[
"Apache-2.0"
] | 1
|
2022-01-04T10:35:36.000Z
|
2022-01-04T10:35:36.000Z
|
dydx3/eth_signing/__init__.py
|
formula-tech/dydx-v3-python
|
95800e3620c2b1f53053b78f35de6e4c43dfdc1a
|
[
"Apache-2.0"
] | null | null | null |
dydx3/eth_signing/__init__.py
|
formula-tech/dydx-v3-python
|
95800e3620c2b1f53053b78f35de6e4c43dfdc1a
|
[
"Apache-2.0"
] | 1
|
2022-01-21T10:49:48.000Z
|
2022-01-21T10:49:48.000Z
|
from dydx3.eth_signing.eth_prive_action import SignEthPrivateAction
from dydx3.eth_signing.onboarding_action import SignOnboardingAction
from dydx3.eth_signing.signers import SignWithKey
from dydx3.eth_signing.signers import SignWithWeb3
| 47.6
| 68
| 0.89916
| 31
| 238
| 6.677419
| 0.419355
| 0.173913
| 0.231884
| 0.36715
| 0.309179
| 0.309179
| 0
| 0
| 0
| 0
| 0
| 0.022523
| 0.067227
| 238
| 4
| 69
| 59.5
| 0.90991
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 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
|
8a145f66ade4f0d8f96e37f83263ead0f490fb8f
| 181
|
py
|
Python
|
term_app/kivy_soil/app_recycleview/__init__.py
|
Bakterija/term_app
|
9044ffdfaad750a1c47211aa56eab6c132ec8cec
|
[
"MIT"
] | 1
|
2017-06-23T15:16:13.000Z
|
2017-06-23T15:16:13.000Z
|
app_recycleview/__init__.py
|
Bakterija/kivy_soil
|
75b9376290fc720010525e1e96fec482f6304ffd
|
[
"Unlicense"
] | null | null | null |
app_recycleview/__init__.py
|
Bakterija/kivy_soil
|
75b9376290fc720010525e1e96fec482f6304ffd
|
[
"Unlicense"
] | null | null | null |
from .recycleview import AppRecycleView
from .recyclebox import AppRecycleBoxLayout
from .viewclass import AppRecycleViewClass
from .single_select_box import SingleSelectRecycleBox
| 36.2
| 53
| 0.889503
| 18
| 181
| 8.833333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088398
| 181
| 4
| 54
| 45.25
| 0.963636
| 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
|
8a1480fd76daa3a412d3daebeb25dcd5da58a915
| 28
|
py
|
Python
|
backend/server/apps/ml/income_classifier/__init__.py
|
IndraP24/Adult-Income-Prediction-Web-App
|
1636f6f0fde814bfdd8dacd0d4bb68b288f6c4fe
|
[
"MIT"
] | null | null | null |
backend/server/apps/ml/income_classifier/__init__.py
|
IndraP24/Adult-Income-Prediction-Web-App
|
1636f6f0fde814bfdd8dacd0d4bb68b288f6c4fe
|
[
"MIT"
] | null | null | null |
backend/server/apps/ml/income_classifier/__init__.py
|
IndraP24/Adult-Income-Prediction-Web-App
|
1636f6f0fde814bfdd8dacd0d4bb68b288f6c4fe
|
[
"MIT"
] | null | null | null |
from .random_forest import *
| 28
| 28
| 0.821429
| 4
| 28
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 28
| 1
| 28
| 28
| 0.88
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.