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
088eb1e14f7102226a7cfb1e08fa32e180f20d7f
125
py
Python
Simple/list.py
amal029/DataStructuresAndAlgorithmsInPython
ccf36ae9e6d1ab8c2be09315f4ad6ac715e222fd
[ "MIT" ]
null
null
null
Simple/list.py
amal029/DataStructuresAndAlgorithmsInPython
ccf36ae9e6d1ab8c2be09315f4ad6ac715e222fd
[ "MIT" ]
null
null
null
Simple/list.py
amal029/DataStructuresAndAlgorithmsInPython
ccf36ae9e6d1ab8c2be09315f4ad6ac715e222fd
[ "MIT" ]
null
null
null
class List: def __init__(self): pass def add(self, x): pass def remove(self, y): pass
11.363636
24
0.488
16
125
3.5625
0.625
0.245614
0
0
0
0
0
0
0
0
0
0
0.416
125
10
25
12.5
0.780822
0
0
0.428571
0
0
0
0
0
0
0
0
0
1
0.428571
false
0.428571
0
0
0.571429
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
1
0
0
1
0
0
5
08ad212a0f75ea37a4d003f259cbe61e56b54ec5
109
py
Python
gameServer/playerCode/__init__.py
hydrogen602/settlersPy
5a1df6162d35b6ae9eeefd11c9a0a9ba7a19019c
[ "MIT" ]
null
null
null
gameServer/playerCode/__init__.py
hydrogen602/settlersPy
5a1df6162d35b6ae9eeefd11c9a0a9ba7a19019c
[ "MIT" ]
null
null
null
gameServer/playerCode/__init__.py
hydrogen602/settlersPy
5a1df6162d35b6ae9eeefd11c9a0a9ba7a19019c
[ "MIT" ]
null
null
null
from .player import Player from .inventory import ExpandedInventory from .playerManager import PlayerManager
27.25
40
0.862385
12
109
7.833333
0.5
0
0
0
0
0
0
0
0
0
0
0
0.110092
109
4
41
27.25
0.969072
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
3e991bce0533b2d91c0e84d3e19f61b5a3dd199c
38
py
Python
kddirkit/networks/models/__init__.py
JohannesLiu/HNRE-Pytorch
395f026e54e02a631db522a828b1e017ffca6e59
[ "MIT" ]
1
2021-03-03T14:06:45.000Z
2021-03-03T14:06:45.000Z
kddirkit/networks/models/__init__.py
JohannesLiu/HNRE-Pytorch
395f026e54e02a631db522a828b1e017ffca6e59
[ "MIT" ]
null
null
null
kddirkit/networks/models/__init__.py
JohannesLiu/HNRE-Pytorch
395f026e54e02a631db522a828b1e017ffca6e59
[ "MIT" ]
null
null
null
from kddirkit.networks.models import *
38
38
0.842105
5
38
6.4
1
0
0
0
0
0
0
0
0
0
0
0
0.078947
38
1
38
38
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3eabe9af5b0e4441a04ef13d4107b7041866d117
1,365
py
Python
reader/irtac.py
galilley/scipro
0dda1461e7a22e853e475bdb41f5ca713eb39129
[ "BSD-3-Clause" ]
null
null
null
reader/irtac.py
galilley/scipro
0dda1461e7a22e853e475bdb41f5ca713eb39129
[ "BSD-3-Clause" ]
null
null
null
reader/irtac.py
galilley/scipro
0dda1461e7a22e853e475bdb41f5ca713eb39129
[ "BSD-3-Clause" ]
2
2017-06-20T18:03:26.000Z
2022-03-11T08:51:21.000Z
# -*- coding: utf-8 -*- from numpy import array, double def fread(filename): '''This function read data from Irtac .dat files''' fp = open(filename, 'r') fstr = fp.readline() #read first row while not fstr.strip() == 'Series: IAC': fstr = fp.readline() fstr = fp.readline() #read title datay = [] fstr = fp.readline() while fstr: if fstr.strip() == '': break fstr = fstr.strip().split('\t') datay.append(fstr[1]) fstr = fp.readline() datay = array(datay).astype(double) while not fstr.strip() == 'Series: Position': fstr = fp.readline() fstr = fp.readline() #read title datax = [] fstr = fp.readline() while fstr: if fstr.strip() == '': break fstr = fstr.strip().split('\t') datax.append(fstr[1]) fstr = fp.readline() fp.close() return datax, datay def freadxy(filename): '''This function read data from Irtac xy .dat files''' fp = open(filename, 'r') fstr = fp.readline() #read first row while not fstr.strip() == 'Series: IAC': fstr = fp.readline() fstr = fp.readline() #read title datax = [] datay = [] fstr = fp.readline() while fstr: if fstr.strip() == '': break fstr = fstr.strip().split('\t') datax.append(fstr[0]) datay.append(fstr[1]) fstr = fp.readline() fp.close() datax = array(datax).astype(double) datay = array(datay).astype(double) return datax, datay
20.373134
55
0.621978
189
1,365
4.492063
0.243386
0.09894
0.23086
0.106007
0.853946
0.763251
0.763251
0.634865
0.57126
0.515901
0
0.00457
0.198535
1,365
66
56
20.681818
0.771481
0.128205
0
0.857143
0
0
0.039182
0
0
0
0
0
0
1
0.040816
false
0
0.020408
0
0.102041
0
0
0
0
null
0
1
0
1
1
1
0
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
3eccbcb5d08b309d4982043684ae770c18fa9fcb
99
py
Python
JOI/joi2007yo_a.py
ryosuke0825/atcoder_python
185cdbe7db44ecca1aaf357858d16d31ce515ddb
[ "MIT" ]
null
null
null
JOI/joi2007yo_a.py
ryosuke0825/atcoder_python
185cdbe7db44ecca1aaf357858d16d31ce515ddb
[ "MIT" ]
null
null
null
JOI/joi2007yo_a.py
ryosuke0825/atcoder_python
185cdbe7db44ecca1aaf357858d16d31ce515ddb
[ "MIT" ]
null
null
null
A = list(map(int, input().split())) B = list(map(int, input().split())) print(max(sum(A), sum(B)))
24.75
35
0.585859
18
99
3.222222
0.555556
0.241379
0.344828
0.517241
0.689655
0
0
0
0
0
0
0
0.10101
99
3
36
33
0.651685
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
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
f5ccb18d2d2709ed28c2f3b105034f9a17561fef
127
py
Python
src/server/app/repository/ShortcutRepository.py
MatthiasRiener/DigiPen
9b4aff4a1c431e06d73733dc3dd3f3f3d4631704
[ "MIT" ]
null
null
null
src/server/app/repository/ShortcutRepository.py
MatthiasRiener/DigiPen
9b4aff4a1c431e06d73733dc3dd3f3f3d4631704
[ "MIT" ]
null
null
null
src/server/app/repository/ShortcutRepository.py
MatthiasRiener/DigiPen
9b4aff4a1c431e06d73733dc3dd3f3f3d4631704
[ "MIT" ]
null
null
null
from ..helper.helpers import getShortcutsFromJson shortcuts = getShortcutsFromJson() def getShortcuts(): return shortcuts
21.166667
49
0.80315
11
127
9.272727
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.125984
127
6
50
21.166667
0.918919
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
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
0
0
0
1
1
0
0
5
f5e2e8eeb0f36e18301e4aa5fc3a3f7861de1894
43
py
Python
run.py
fengzhongdege/mobao
e1117ab992d2baac21998423a88ee5efcfcfeaa5
[ "Apache-2.0" ]
null
null
null
run.py
fengzhongdege/mobao
e1117ab992d2baac21998423a88ee5efcfcfeaa5
[ "Apache-2.0" ]
null
null
null
run.py
fengzhongdege/mobao
e1117ab992d2baac21998423a88ee5efcfcfeaa5
[ "Apache-2.0" ]
null
null
null
from mobao import app app.run(debug=True)
10.75
21
0.767442
8
43
4.125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.139535
43
3
22
14.333333
0.891892
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
eb19b103b15880d65ee680f320bfae07df2eae2b
158
py
Python
src/multi_process_3.py
scy6500/large-scale-lm-tutorials
c2ab01a2f272770bbeefe446feed0eb775fc9bd9
[ "Apache-2.0" ]
128
2021-10-29T18:33:15.000Z
2022-03-27T02:45:24.000Z
src/multi_process_3.py
scy6500/large-scale-lm-tutorials
c2ab01a2f272770bbeefe446feed0eb775fc9bd9
[ "Apache-2.0" ]
null
null
null
src/multi_process_3.py
scy6500/large-scale-lm-tutorials
c2ab01a2f272770bbeefe446feed0eb775fc9bd9
[ "Apache-2.0" ]
13
2021-10-30T11:07:29.000Z
2022-03-30T06:56:40.000Z
""" src/multi_process_3.py """ # 코드 전체가 서브프로세스가 됩니다. import os # RANK, LOCAL_RANK, WORLD_SIZE 등의 변수가 자동으로 설정됩니다. print(f"hello world, {os.environ['RANK']}")
17.555556
49
0.696203
27
158
3.925926
0.851852
0
0
0
0
0
0
0
0
0
0
0.007353
0.139241
158
9
50
17.555556
0.772059
0.575949
0
0
0
0
0.559322
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
de24e9c7463d3444c42c5938504296abf559e2db
43
py
Python
src/aves/visualization/primitives/__init__.py
sergioangulo/aves
43a14ec9c82929136a39590b15fe7f92182aae20
[ "CC-BY-3.0" ]
34
2020-10-23T08:57:03.000Z
2022-03-23T17:07:20.000Z
src/aves/visualization/primitives/__init__.py
sergioangulo/aves
43a14ec9c82929136a39590b15fe7f92182aae20
[ "CC-BY-3.0" ]
3
2021-12-02T22:42:25.000Z
2021-12-10T02:37:01.000Z
src/aves/visualization/primitives/__init__.py
sergioangulo/aves
43a14ec9c82929136a39590b15fe7f92182aae20
[ "CC-BY-3.0" ]
11
2021-03-25T02:40:34.000Z
2022-01-03T22:41:29.000Z
from .renderstrategy import RenderStrategy
21.5
42
0.883721
4
43
9.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.093023
43
1
43
43
0.974359
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
de5c03cd3e69b9a071eba0a59895cfdf95274bea
79
py
Python
bin/import_data.py
daeatel/skool
765ede04722fb987ff470eeaf46c1492e83416b1
[ "MIT" ]
null
null
null
bin/import_data.py
daeatel/skool
765ede04722fb987ff470eeaf46c1492e83416b1
[ "MIT" ]
null
null
null
bin/import_data.py
daeatel/skool
765ede04722fb987ff470eeaf46c1492e83416b1
[ "MIT" ]
null
null
null
#! /usr/bin/env python from skool.data import * import_sites() import_pages()
13.166667
24
0.734177
12
79
4.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.126582
79
5
25
15.8
0.811594
0.265823
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
de78a9c272ef9b708ba95b414fd46ba99850bbfa
90
py
Python
torch_template/templates/__init__.py
misads/torch_template
959be6d4bc368c1c3310c3902cc04271cca0941f
[ "MIT" ]
4
2020-01-09T13:45:04.000Z
2020-09-24T12:08:59.000Z
torch_template/templates/__init__.py
misads/torch_template
959be6d4bc368c1c3310c3902cc04271cca0941f
[ "MIT" ]
null
null
null
torch_template/templates/__init__.py
misads/torch_template
959be6d4bc368c1c3310c3902cc04271cca0941f
[ "MIT" ]
null
null
null
from .dataloader import dataset from .network import Model from .options import options
15
31
0.811111
12
90
6.083333
0.583333
0
0
0
0
0
0
0
0
0
0
0
0.155556
90
5
32
18
0.960526
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
7205ea704ad09c8693bc3115e9649a2933c457b2
274
py
Python
cmds/__init__.py
Jinwithyoo/han
931a271e56134dcc35029bf75260513b60884f6c
[ "BSD-3-Clause" ]
145
2015-01-05T11:48:05.000Z
2022-02-08T07:52:16.000Z
cmds/__init__.py
Jinwithyoo/han
931a271e56134dcc35029bf75260513b60884f6c
[ "BSD-3-Clause" ]
13
2015-03-25T14:56:01.000Z
2018-08-09T14:53:22.000Z
cmds/__init__.py
Jinwithyoo/han
931a271e56134dcc35029bf75260513b60884f6c
[ "BSD-3-Clause" ]
31
2015-02-23T23:21:10.000Z
2020-06-26T10:08:23.000Z
def cmdclass(): import cmds.repl import cmds.gentest import cmds.stat import cmds.profile return dict(repl=cmds.repl.repl, gen_test=cmds.gentest.gen_test, stat=cmds.stat.stat, profile=cmds.profile.profile)
27.4
47
0.609489
34
274
4.852941
0.352941
0.242424
0
0
0
0
0
0
0
0
0
0
0.30292
274
9
48
30.444444
0.863874
0
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
true
0
0.444444
0
0.666667
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
7211b6ab2d89540248e8fe7cd671fe8ee540998f
36
py
Python
xframes/deps/pandas_mock.py
cchayden/xframes
1656cc69c814bda8132362b3a22f7cdf8a24637f
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
xframes/deps/pandas_mock.py
cchayden/xframes
1656cc69c814bda8132362b3a22f7cdf8a24637f
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
xframes/deps/pandas_mock.py
cchayden/xframes
1656cc69c814bda8132362b3a22f7cdf8a24637f
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
# Substitute when pandas is missing
18
35
0.805556
5
36
5.8
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
36
1
36
36
0.966667
0.916667
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
721357ac682d4a0d5e4cef4b19797a7dd42d8035
87
py
Python
foo/foo.py
nalbarr/hello-shapes-python
438cc4207fc9d8bf2019a821a3c2fbab7f4c432d
[ "MIT" ]
null
null
null
foo/foo.py
nalbarr/hello-shapes-python
438cc4207fc9d8bf2019a821a3c2fbab7f4c432d
[ "MIT" ]
null
null
null
foo/foo.py
nalbarr/hello-shapes-python
438cc4207fc9d8bf2019a821a3c2fbab7f4c432d
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ foo.py """ def bar(): """Foo. bar.""" return True
9.666667
23
0.425287
11
87
3.363636
0.818182
0
0
0
0
0
0
0
0
0
0
0.015625
0.264368
87
8
24
10.875
0.5625
0.448276
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
1
0
0
5
721408b737c435f2643c110e06709427448ee6b6
146
py
Python
src/sage/games/all.py
bopopescu/sage
2d495be78e0bdc7a0a635454290b27bb4f5f70f0
[ "BSL-1.0" ]
3
2016-06-19T14:48:31.000Z
2022-01-28T08:46:01.000Z
src/sage/games/all.py
bopopescu/sage
2d495be78e0bdc7a0a635454290b27bb4f5f70f0
[ "BSL-1.0" ]
2
2018-10-30T13:40:20.000Z
2020-07-23T12:13:30.000Z
src/sage/games/all.py
bopopescu/sage
2d495be78e0bdc7a0a635454290b27bb4f5f70f0
[ "BSL-1.0" ]
7
2021-11-08T10:01:59.000Z
2022-03-03T11:25:52.000Z
from __future__ import absolute_import from .sudoku import Sudoku, sudoku from .sudoku_backtrack import backtrack_all from .hexad import Minimog
24.333333
43
0.849315
20
146
5.85
0.45
0.17094
0
0
0
0
0
0
0
0
0
0
0.123288
146
5
44
29.2
0.914063
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
72234baaf6f48e59c63f0385f4fe2674fe28bf7c
207
py
Python
scripts/portal/evantalk00.py
Snewmy/swordie
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
[ "MIT" ]
2
2020-08-25T06:55:19.000Z
2021-03-15T14:37:34.000Z
scripts/portal/evantalk00.py
Snewmy/swordie
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
[ "MIT" ]
null
null
null
scripts/portal/evantalk00.py
Snewmy/swordie
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
[ "MIT" ]
3
2020-08-25T06:55:25.000Z
2020-12-01T13:07:43.000Z
# Portal & Balloon Msgs for Evan Intro | Dream World: Dream Forest Entrance (900010000) # Author: Tiger # "Huh? Where am I?" sm.avatarOriented("Effect/OnUserEff.img/guideEffect/evanTutorial/evanBalloon00")
34.5
87
0.768116
26
207
6.115385
0.961538
0
0
0
0
0
0
0
0
0
0
0.06044
0.120773
207
5
88
41.4
0.813187
0.570048
0
0
0
0
0.694118
0.694118
0
0
0
0
0
1
0
true
0
0
0
0
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
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
7245ae830028bb05bbdca08b58cf4f9b5629f40c
6,118
py
Python
tests/test_tcpsyn.py
zenaix/ICSuit
792b498df7f0e700b77f147e4f888b950f3ba296
[ "Apache-2.0" ]
1
2021-02-21T11:19:23.000Z
2021-02-21T11:19:23.000Z
tests/test_tcpsyn.py
zenaix/ICSuit
792b498df7f0e700b77f147e4f888b950f3ba296
[ "Apache-2.0" ]
null
null
null
tests/test_tcpsyn.py
zenaix/ICSuit
792b498df7f0e700b77f147e4f888b950f3ba296
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- import os import sys import time import threading from context import icsuit from icsuit.module.probe.nostate import tcpsyn class Tester(object): def __init__(self): pass def test_tcpsyn1(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "1" tcpsyn.option["TARGET_IP"] = "10.13.22.196/27" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn5(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "5" tcpsyn.option["TARGET_IP"] = "10.13.22.196/27" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn9(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "9" tcpsyn.option["TARGET_IP"] = "10.13.22.196/24" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn10(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "10" tcpsyn.option["TARGET_IP"] = "10.13.22.196/24" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn50(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "50" tcpsyn.option["TARGET_IP"] = "10.13.22.196/24" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn90(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "90" tcpsyn.option["TARGET_IP"] = "10.13.22.196/20" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn100(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "100" tcpsyn.option["TARGET_IP"] = "10.13.22.196/20" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn500(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "500" tcpsyn.option["TARGET_IP"] = "10.13.22.196/20" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn900(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "900" tcpsyn.option["TARGET_IP"] = "10.13.22.196/16" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn1000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "1000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/16" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn5000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "5000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/16" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn9000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "9000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/14" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn10000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "10000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/14" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn20000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "20000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/14" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn49000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "49000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/13" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn50000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "50000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/13" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn75000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "75000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/11" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn99000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "99000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/11" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn100000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "100000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/11" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn150000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "150000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/11" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def test_tcpsyn200000(self): os.chdir('..') t = time.time() tcpsyn.option["BANDWIDTH"] = "200000" tcpsyn.option["TARGET_IP"] = "10.13.22.196/11" tcpsyn.start(None, tcpsyn.option) os.chdir('tests') def run(self): lock = threading.Lock() self.test_tcpsyn1() self.test_tcpsyn5() self.test_tcpsyn9() self.test_tcpsyn10() self.test_tcpsyn50() self.test_tcpsyn90() self.test_tcpsyn100() self.test_tcpsyn500() self.test_tcpsyn900() self.test_tcpsyn1000() self.test_tcpsyn5000() self.test_tcpsyn9000() self.test_tcpsyn10000() self.test_tcpsyn20000() self.test_tcpsyn49000() self.test_tcpsyn50000() self.test_tcpsyn75000() self.test_tcpsyn99000() self.test_tcpsyn100000() self.test_tcpsyn150000() self.test_tcpsyn200000() if __name__ == '__main__': Tester().run()
28.995261
54
0.555737
733
6,118
4.536153
0.120055
0.227368
0.069474
0.075789
0.74406
0.74406
0.74406
0.74406
0.74406
0.485113
0
0.105382
0.277215
6,118
210
55
29.133333
0.64654
0.003432
0
0.580111
0
0
0.151928
0
0
0
0
0
0
1
0.127072
false
0.005525
0.033149
0
0.165746
0
0
0
0
null
1
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
0
0
0
0
0
0
0
0
5
a0d194cb870cc864efb823dfc99b8a05b297268c
1,999
py
Python
tifa/apps/admin/discount.py
twocucao/tifa
f703fd27f54000e7d51f06d2456d09cc79e0ab72
[ "MIT" ]
71
2020-04-16T04:28:45.000Z
2022-03-31T22:45:11.000Z
tifa/apps/admin/discount.py
twocucao/tifa
f703fd27f54000e7d51f06d2456d09cc79e0ab72
[ "MIT" ]
6
2021-05-13T06:32:38.000Z
2022-03-04T01:18:34.000Z
tifa/apps/admin/discount.py
twocucao/tifa
f703fd27f54000e7d51f06d2456d09cc79e0ab72
[ "MIT" ]
12
2021-05-01T08:43:11.000Z
2022-03-29T00:58:54.000Z
from fastapi_utils.api_model import APIModel from tifa.apps.admin.local import g from tifa.apps.admin.router import bp from tifa.models.discount import DiscountVoucher class TVoucher(APIModel): id: str name: str @bp.list("/vouchers", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def vouchers_page(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.item("/voucher", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_item(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.op("/voucher/translate", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_translate(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.op("/voucher/create", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_create(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.op("/voucher/update", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_update(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.op("/voucher/delete", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_delete(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.op("/voucher/bulk_delete", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_bulk_delete(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.op("/voucher_catalog/add", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_catalog_add(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} @bp.op("/voucher_catalog/remove", out=TVoucher, summary="Voucher", tags=["Voucher"]) async def voucher_catalog_remove(): ins = await g.adal.first_or_404(DiscountVoucher) return {"items": ins} """ voucherVoucherListingUpdate(...): VoucherVoucherListingUpdate """
28.557143
84
0.711856
265
1,999
5.237736
0.188679
0.071326
0.116715
0.162104
0.757205
0.757205
0.757205
0.757205
0.725504
0.57853
0
0.015482
0.127564
1,999
69
85
28.971014
0.78039
0
0
0.418605
0
0
0.162694
0.011917
0
0
0
0
0
1
0
false
0
0.093023
0
0.372093
0
0
0
0
null
0
0
1
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
0
0
0
0
0
0
0
0
5
a0e094c7cd12b930300b5f7895bddf9a8e61896e
7,177
py
Python
tests/function_test.py
justanhduc/neuralnet-pytorch
cbb0c5a540a0ba91cb4dd20684bb00692305d193
[ "MIT" ]
28
2019-01-07T04:07:55.000Z
2021-11-09T15:16:11.000Z
tests/function_test.py
justanhduc/neuralnet-pytorch
cbb0c5a540a0ba91cb4dd20684bb00692305d193
[ "MIT" ]
9
2019-12-25T08:00:33.000Z
2021-11-23T09:02:34.000Z
tests/function_test.py
justanhduc/neuralnet-pytorch
cbb0c5a540a0ba91cb4dd20684bb00692305d193
[ "MIT" ]
3
2020-08-07T12:49:05.000Z
2022-03-07T21:32:39.000Z
import torch as T import numpy as np from torch import testing import pytest import neuralnet_pytorch as nnt from neuralnet_pytorch import cuda_available dev = ('cpu', 'cuda') if cuda_available else ('cpu',) @pytest.mark.parametrize('device', dev) def test_ravel_index(device): shape = (2, 4, 5, 3) a = T.arange(np.prod(shape)).reshape(*shape).to(device) indices = [[1, 0, 1, 1, 0], [1, 3, 3, 2, 1], [1, 1, 4, 0, 3], [1, 2, 2, 2, 0]] linear_indices = nnt.utils.ravel_index(T.tensor(indices), shape) testing.assert_allclose(linear_indices.type_as(a), a[indices]) @pytest.mark.parametrize('device', dev) def test_shape_pad(device): shape = (10, 10) a = T.rand(*shape).to(device) padded = nnt.utils.shape_padleft(a) expected = a.unsqueeze(0) testing.assert_allclose(padded, expected) testing.assert_allclose(padded.shape, expected.shape) padded = nnt.utils.shape_padleft(a, 2) expected = a.unsqueeze(0).unsqueeze(0) testing.assert_allclose(padded, expected) testing.assert_allclose(padded.shape, expected.shape) padded = nnt.utils.shape_padleft(a, 5) expected = a.unsqueeze(0).unsqueeze(0).unsqueeze(0).unsqueeze(0).unsqueeze(0) testing.assert_allclose(padded, expected) testing.assert_allclose(padded.shape, expected.shape) padded = nnt.utils.shape_padright(a) expected = a.unsqueeze(-1) testing.assert_allclose(padded, expected) testing.assert_allclose(padded.shape, expected.shape) padded = nnt.utils.shape_padright(a, 2) expected = a.unsqueeze(-1).unsqueeze(-1) testing.assert_allclose(padded, expected) testing.assert_allclose(padded.shape, expected.shape) padded = nnt.utils.shape_padright(a, 5) expected = a.unsqueeze(-1).unsqueeze(-1).unsqueeze(-1).unsqueeze(-1).unsqueeze(-1) testing.assert_allclose(padded, expected) testing.assert_allclose(padded.shape, expected.shape) @pytest.mark.parametrize('device', dev) def test_dimshuffle(device): shape = (64, 512) a = T.rand(*shape).to(device) dimshuffled = nnt.utils.dimshuffle(a, (0, 1, 'x', 'x')) expected = a.unsqueeze(2).unsqueeze(2) testing.assert_allclose(dimshuffled, expected) testing.assert_allclose(dimshuffled.shape, expected.shape) dimshuffled = nnt.utils.dimshuffle(a, (1, 0, 'x', 'x')) expected = a.permute(1, 0).unsqueeze(2).unsqueeze(2) testing.assert_allclose(dimshuffled, expected) testing.assert_allclose(dimshuffled.shape, expected.shape) dimshuffled = nnt.utils.dimshuffle(a, (0, 'x', 1, 'x')) expected = a.unsqueeze(2).permute(0, 2, 1).unsqueeze(3) testing.assert_allclose(dimshuffled, expected) testing.assert_allclose(dimshuffled.shape, expected.shape) dimshuffled = nnt.utils.dimshuffle(a, (1, 'x', 'x', 0)) expected = a.permute(1, 0).unsqueeze(1).unsqueeze(1) testing.assert_allclose(dimshuffled, expected) testing.assert_allclose(dimshuffled.shape, expected.shape) dimshuffled = nnt.utils.dimshuffle(a, (1, 'x', 0, 'x', 'x')) expected = a.permute(1, 0).unsqueeze(1).unsqueeze(3).unsqueeze(3) testing.assert_allclose(dimshuffled, expected) testing.assert_allclose(dimshuffled.shape, expected.shape) @pytest.mark.parametrize('device', dev) def test_flatten(device): shape = (10, 4, 2, 3, 6) a = T.rand(*shape).to(device) flatten = nnt.Flatten(2, input_shape=(None,) + shape[1:]) expected = T.flatten(a, 2) testing.assert_allclose(flatten(a), expected) testing.assert_allclose((shape[0],) + flatten.output_shape[1:], expected.shape) flatten = nnt.Flatten(4, input_shape=(None,) + shape[1:]) expected = T.flatten(a, 4) testing.assert_allclose(flatten(a), expected) testing.assert_allclose((shape[0],) + flatten.output_shape[1:], expected.shape) flatten = nnt.Flatten(input_shape=shape) expected = T.flatten(a) testing.assert_allclose(flatten(a), expected) testing.assert_allclose(flatten.output_shape, expected.shape) flatten = nnt.Flatten(1, 3, input_shape=shape) expected = T.flatten(a, 1, 3) testing.assert_allclose(flatten(a), expected) testing.assert_allclose(flatten.output_shape, expected.shape) @pytest.mark.parametrize('device', dev) def test_reshape(device): shape = (10, 3, 9, 9) a = T.rand(*shape).to(device) newshape = (-1, 9, 9) reshape = nnt.Reshape(newshape, input_shape=(None,) + shape[1:]) expected = T.reshape(a, newshape) testing.assert_allclose(reshape(a), expected) testing.assert_allclose(reshape.output_shape[1:], expected.shape[1:]) newshape = (10, -1, 9) reshape = nnt.Reshape(newshape, input_shape=shape) expected = T.reshape(a, newshape) testing.assert_allclose(reshape(a), expected) testing.assert_allclose(reshape.output_shape, expected.shape) newshape = (9, 9, -1) reshape = nnt.Reshape(newshape, input_shape=shape) expected = T.reshape(a, newshape) testing.assert_allclose(reshape(a), expected) testing.assert_allclose(reshape.output_shape[1:], expected.shape[1:]) @pytest.mark.parametrize('device', dev) def test_batch_pairwise_distance(device): xyz = T.rand(1, 4, 3).to(device) actual = nnt.utils.batch_pairwise_sqdist(xyz, xyz, c_code=False) testing.assert_allclose(T.diag(actual[0]), T.zeros(actual.shape[1]).to(device)) if dev != 'cuda' or not nnt.cuda_ext_available: pytest.skip('Requires CUDA extension to be installed') xyz1 = T.rand(10, 4000, 3).to(device).requires_grad_(True) xyz2 = T.rand(10, 5000, 3).to(device) expected = nnt.utils.batch_pairwise_sqdist(xyz1, xyz2, c_code=False) actual = nnt.utils.batch_pairwise_sqdist(xyz1, xyz2, c_code=True) testing.assert_allclose(actual, expected) expected_cost = T.sum(expected) expected_cost.backward() expected_grad = xyz1.grad xyz1.grad.zero_() actual_cost = T.sum(actual) actual_cost.backward() actual_grad = xyz1.grad testing.assert_allclose(actual_grad, expected_grad) for _ in range(10): t1 = nnt.utils.time_cuda_module(nnt.utils.batch_pairwise_sqdist, xyz1, xyz2, c_code=False) t2 = nnt.utils.time_cuda_module(nnt.utils.batch_pairwise_sqdist, xyz1, xyz2, c_code=True) print('pt: %f, cpp: %f' % (t1, t2)) @pytest.mark.skipif(not nnt.cuda_ext_available, reason='Requires CUDA extension to be installed') @pytest.mark.parametrize('device', dev) def test_pointcloud_to_voxel(device): xyz = T.rand(10, 4000, 3).to(device).requires_grad_(True) pc = xyz * 2. - 1. expected = nnt.utils.pc2vox_fast(pc, c_code=False) actual = nnt.utils.pc2vox_fast(pc, c_code=True) testing.assert_allclose(actual, expected) expected_cost = T.sum(expected) expected_cost.backward(retain_graph=True) expected_grad = xyz.grad xyz.grad.zero_() actual_cost = T.sum(actual) actual_cost.backward() actual_grad = xyz.grad testing.assert_allclose(actual_grad, expected_grad) for _ in range(10): t1 = nnt.utils.time_cuda_module(nnt.utils.pc2vox_fast, pc, c_code=False) t2 = nnt.utils.time_cuda_module(nnt.utils.pc2vox_fast, pc) print('pt: %f, cpp: %f' % (t1, t2))
37.186528
98
0.70085
1,015
7,177
4.815764
0.112315
0.111702
0.180442
0.106792
0.823854
0.804419
0.746318
0.682488
0.65446
0.628887
0
0.029669
0.154661
7,177
192
99
37.380208
0.776001
0
0
0.436242
0
0
0.024383
0
0
0
0
0
0.281879
1
0.04698
false
0
0.040268
0
0.087248
0.013423
0
0
0
null
0
1
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
9d0b0ae3308e1f9e573ee0a0de4f63e286fedc98
1,763
py
Python
tests/integration/test_ignore.py
gazpachoking/vcrpy
7306205b8af8a8ac630bad8e9ac2bacd8718eaf2
[ "MIT" ]
null
null
null
tests/integration/test_ignore.py
gazpachoking/vcrpy
7306205b8af8a8ac630bad8e9ac2bacd8718eaf2
[ "MIT" ]
null
null
null
tests/integration/test_ignore.py
gazpachoking/vcrpy
7306205b8af8a8ac630bad8e9ac2bacd8718eaf2
[ "MIT" ]
null
null
null
import base64 import pytest from six.moves.urllib.request import urlopen, Request from six.moves.urllib.error import HTTPError import vcr def test_ignore_localhost(tmpdir, httpserver): httpserver.serve_content('Hello!') cass_file = str(tmpdir.join('filter_qs.yaml')) with vcr.use_cassette(cass_file, ignore_localhost=True) as cass: urlopen(httpserver.url) assert len(cass) == 0 urlopen('http://httpbin.org') assert len(cass) == 1 def test_ignore_httpbin(tmpdir, httpserver): httpserver.serve_content('Hello!') cass_file = str(tmpdir.join('filter_qs.yaml')) with vcr.use_cassette( cass_file, ignore_hosts=['httpbin.org'] ) as cass: urlopen('http://httpbin.org') assert len(cass) == 0 urlopen(httpserver.url) assert len(cass) == 1 def test_ignore_localhost_and_httpbin(tmpdir, httpserver): httpserver.serve_content('Hello!') cass_file = str(tmpdir.join('filter_qs.yaml')) with vcr.use_cassette( cass_file, ignore_hosts=['httpbin.org'], ignore_localhost=True ) as cass: urlopen('http://httpbin.org') urlopen(httpserver.url) assert len(cass) == 0 def test_ignore_localhost_twice(tmpdir, httpserver): httpserver.serve_content('Hello!') cass_file = str(tmpdir.join('filter_qs.yaml')) with vcr.use_cassette(cass_file, ignore_localhost=True) as cass: urlopen(httpserver.url) assert len(cass) == 0 urlopen('http://httpbin.org') assert len(cass) == 1 with vcr.use_cassette(cass_file, ignore_localhost=True) as cass: assert len(cass) == 1 urlopen(httpserver.url) urlopen('http://httpbin.org') assert len(cass) == 1
31.482143
68
0.663074
227
1,763
4.977974
0.193833
0.063717
0.10354
0.079646
0.813274
0.812389
0.748673
0.653097
0.622124
0.622124
0
0.007942
0.214407
1,763
55
69
32.054545
0.807942
0
0
0.75
0
0
0.108905
0
0
0
0
0
0.1875
1
0.083333
false
0
0.104167
0
0.1875
0
0
0
0
null
0
0
0
1
1
1
0
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
9d152405b4edc5ce8a944b8278de72ab40748cb0
125
py
Python
education/admin.py
berylvirgo/mg03-project
98cf21ec7466a3e1631ab7b29c0b798490a983c3
[ "MIT" ]
null
null
null
education/admin.py
berylvirgo/mg03-project
98cf21ec7466a3e1631ab7b29c0b798490a983c3
[ "MIT" ]
null
null
null
education/admin.py
berylvirgo/mg03-project
98cf21ec7466a3e1631ab7b29c0b798490a983c3
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Note, Message admin.site.register(Note) admin.site.register(Message)
15.625
33
0.8
18
125
5.555556
0.555556
0.18
0.34
0
0
0
0
0
0
0
0
0
0.112
125
7
34
17.857143
0.900901
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
9d32f5db8665532807786f45b2d0a19278e88738
2,873
py
Python
Chapter12/plotting.py
Nitin-Mane/Python-Deep-Learning-Projects
f4ff04e611ff029bbbd9665fcc4139df935bcad1
[ "MIT" ]
188
2018-06-22T12:11:55.000Z
2022-03-09T12:22:38.000Z
Chapter12/plotting.py
shobhitsrivastava-ds/Python-Deep-Learning-Projects
7a3def53c5059179dc70c052fb9f01a56c890054
[ "MIT" ]
5
2020-09-26T01:29:34.000Z
2022-02-10T02:20:32.000Z
Chapter12/plotting.py
shobhitsrivastava-ds/Python-Deep-Learning-Projects
7a3def53c5059179dc70c052fb9f01a56c890054
[ "MIT" ]
145
2018-07-18T18:05:36.000Z
2022-03-11T13:08:36.000Z
"""This module contains functions to plot the joints and the limbs.""" import cv2 as cv import numpy as np def plot_limb(img, joints, i, j, color): """Limb plot function.""" cv.line(img, joints[i], joints[j], (255, 255, 255), thickness=2, lineType=16) cv.line(img, joints[i], joints[j], color, thickness=1, lineType=16) return img def plot_joints(img, joints, groundtruth=True, text_scale=0.5): """Joint and Limb plot function.""" h, w, c = img.shape if groundtruth: # left hand to left elbow img = plot_limb(img, joints, 0, 1, (0, 255, 0)) # left elbow to left shoulder img = plot_limb(img, joints, 1, 2, (0, 255, 0)) # left shoulder to right shoulder img = plot_limb(img, joints, 2, 4, (0, 255, 0)) # right shoulder to right elbow img = plot_limb(img, joints, 4, 5, (0, 255, 0)) # right elbow to right hand img = plot_limb(img, joints, 5, 6, (0, 255, 0)) # neck coordinate neck = tuple((np.array(joints[2]) + np.array(joints[4])) // 2) joints.append(neck) # neck to head img = plot_limb(img, joints, 3, 7, (0, 255, 0)) joints.pop() # joints for j, joint in enumerate(joints): # plot joints cv.circle(img, joint, 5, (0, 255, 0), -1) # plot joint number black cv.putText(img, '%d' % j, joint, cv.FONT_HERSHEY_SIMPLEX, text_scale, (0, 0, 0), thickness=2, lineType=16) # plot joint number white cv.putText(img, '%d' % j, joint, cv.FONT_HERSHEY_SIMPLEX, text_scale, (255, 255, 255), thickness=1, lineType=16) else: # left hand to left elbow img = plot_limb(img, joints, 0, 1, (0, 0, 255)) # left elbow to left shoulder img = plot_limb(img, joints, 1, 2, (0, 0, 255)) # left shoulder to right shoulder img = plot_limb(img, joints, 2, 4, (0, 0, 255)) # right shoulder to right elbow img = plot_limb(img, joints, 4, 5, (0, 0, 255)) # right elbow to right hand img = plot_limb(img, joints, 5, 6, (0, 0, 255)) # neck coordinate neck = tuple((np.array(joints[2]) + np.array(joints[4])) // 2) joints.append(neck) # neck to head img = plot_limb(img, joints, 3, 7, (0, 0, 255)) joints.pop() # joints for j, joint in enumerate(joints): # plot joints cv.circle(img, joint, 5, (0, 0, 255), -1) # plot joint number black cv.putText(img, '%d' % j, joint, cv.FONT_HERSHEY_SIMPLEX, text_scale, (0, 0, 0), thickness=3, lineType=16) # plot joint number white cv.putText(img, '%d' % j, joint, cv.FONT_HERSHEY_SIMPLEX, text_scale, (255, 255, 255), thickness=1, lineType=16) return img
33.022989
77
0.557953
424
2,873
3.716981
0.169811
0.091371
0.090736
0.140228
0.799492
0.799492
0.775381
0.746193
0.746193
0.746193
0
0.079158
0.305256
2,873
86
78
33.406977
0.710421
0.204316
0
0.380952
0
0
0.003557
0
0
0
0
0
0
1
0.047619
false
0
0.047619
0
0.142857
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
9d33060bd7fcb4fd420cffefac02b76f2d7252f1
233
py
Python
Matplotlib/Matplotlib-MultipleHistograms.py
H2oPtic/Codecademy
835214080f332a60e26fb8f9758d03acb9075b9b
[ "MIT" ]
null
null
null
Matplotlib/Matplotlib-MultipleHistograms.py
H2oPtic/Codecademy
835214080f332a60e26fb8f9758d03acb9075b9b
[ "MIT" ]
null
null
null
Matplotlib/Matplotlib-MultipleHistograms.py
H2oPtic/Codecademy
835214080f332a60e26fb8f9758d03acb9075b9b
[ "MIT" ]
null
null
null
rom matplotlib import pyplot as plt from script import sales_times1 from script import sales_times2 plt.hist(sales_times1, bins=20, alpha=0.4, normed=True) plt.hist(sales_times2, bins=20, alpha=0.4, normed=True) plt.show()
25.888889
56
0.759657
40
233
4.325
0.5
0.115607
0.184971
0.242775
0.300578
0.300578
0.300578
0.300578
0
0
0
0.06
0.141631
233
8
57
29.125
0.805
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
5
9d37e79abf2e368906bfba49cab18a6b8f218708
59
py
Python
06/py/problem6.py
mkhan45/project_euler
3ee18a040224fc3f8f1f31c1761093df23e53147
[ "MIT" ]
null
null
null
06/py/problem6.py
mkhan45/project_euler
3ee18a040224fc3f8f1f31c1761093df23e53147
[ "MIT" ]
null
null
null
06/py/problem6.py
mkhan45/project_euler
3ee18a040224fc3f8f1f31c1761093df23e53147
[ "MIT" ]
null
null
null
print(sum(range(101))**2 - sum(x * x for x in range(101)))
29.5
58
0.610169
13
59
2.769231
0.615385
0.444444
0
0
0
0
0
0
0
0
0
0.14
0.152542
59
1
59
59
0.58
0
0
0
0
0
0
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
9d51d095799c98e6857698ec78cdbf448c418a9a
39
py
Python
core/utils/view/__init__.py
CaedenPH/JesterBot
0adb838723085599b6a15e3b76855a5f75628d77
[ "MIT" ]
15
2021-07-16T14:08:08.000Z
2022-03-25T17:27:27.000Z
core/utils/view/__init__.py
CaedenPH/JesterBot
0adb838723085599b6a15e3b76855a5f75628d77
[ "MIT" ]
2
2022-02-05T11:24:10.000Z
2022-02-05T22:55:16.000Z
core/utils/view/__init__.py
CaedenPH/JesterBot
0adb838723085599b6a15e3b76855a5f75628d77
[ "MIT" ]
6
2021-07-02T20:52:57.000Z
2022-02-20T11:15:06.000Z
from .dropdown_help import DropdownView
39
39
0.897436
5
39
6.8
1
0
0
0
0
0
0
0
0
0
0
0
0.076923
39
1
39
39
0.944444
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
19f8956f2f0c6ec641d268e18bd633fd0b036fff
86
py
Python
nsdcode/__init__.py
kjamison/nsdcode
3f34e17bf4ee2492910bffebf104a2cb7a8fa823
[ "BSD-2-Clause" ]
3
2021-12-24T00:23:41.000Z
2022-03-30T02:22:15.000Z
nsdcode/__init__.py
kjamison/nsdcode
3f34e17bf4ee2492910bffebf104a2cb7a8fa823
[ "BSD-2-Clause" ]
15
2019-11-05T16:32:50.000Z
2021-09-08T13:51:49.000Z
nsdcode/__init__.py
kjamison/nsdcode
3f34e17bf4ee2492910bffebf104a2cb7a8fa823
[ "BSD-2-Clause" ]
2
2021-03-15T20:33:20.000Z
2021-09-05T14:56:47.000Z
from .version import version as __version__ # noqa from .nsd_mapdata import * #noqa
28.666667
51
0.767442
12
86
5.083333
0.583333
0
0
0
0
0
0
0
0
0
0
0
0.174419
86
3
52
28.666667
0.859155
0.093023
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
dfab192ea9d8f6eed268b3c6706cf0c011de0443
119
py
Python
api/app.py
lonkaars/po-4-op-een-rij
5cd9eaf116422c82ab68ffcf2dff22e04781b6c5
[ "MIT" ]
4
2021-02-04T10:33:45.000Z
2021-03-25T11:26:27.000Z
api/app.py
lonkaars/connect-4
5cd9eaf116422c82ab68ffcf2dff22e04781b6c5
[ "MIT" ]
21
2021-04-05T17:16:04.000Z
2021-06-12T12:47:22.000Z
api/app.py
lonkaars/connect-4
5cd9eaf116422c82ab68ffcf2dff22e04781b6c5
[ "MIT" ]
2
2021-04-23T07:06:11.000Z
2021-04-27T08:44:26.000Z
from flask import Flask from flask_socketio import SocketIO # Flask app wrapper (same as db.py) app = Flask(__name__)
19.833333
35
0.781513
19
119
4.631579
0.578947
0.204545
0
0
0
0
0
0
0
0
0
0
0.159664
119
5
36
23.8
0.88
0.277311
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
dfeac540aa81f5273627a7c1563cda6d9b153069
168
py
Python
Web Setup/DjangoWebApp/home/views.py
oluwatosinehindero/DataScienceClass
cb0fdc8103cb82c0a6519e28bbd872bf9c642ff5
[ "MIT" ]
2
2021-06-07T22:36:44.000Z
2021-07-09T03:03:48.000Z
Web Setup/DjangoWebApp/home/views.py
oluwatosinehindero/DataScienceClass
cb0fdc8103cb82c0a6519e28bbd872bf9c642ff5
[ "MIT" ]
null
null
null
Web Setup/DjangoWebApp/home/views.py
oluwatosinehindero/DataScienceClass
cb0fdc8103cb82c0a6519e28bbd872bf9c642ff5
[ "MIT" ]
30
2021-06-01T09:32:11.000Z
2021-10-04T11:31:08.000Z
from django.shortcuts import render from django.http import HttpResponse def test_view(request): return HttpResponse('Hello Fellows, welcome to my testing page!')
28
69
0.797619
23
168
5.782609
0.826087
0.150376
0
0
0
0
0
0
0
0
0
0
0.136905
168
5
70
33.6
0.917241
0
0
0
0
0
0.25
0
0
0
0
0
0
1
0.25
false
0
0.5
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
0
0
0
5
a03eac06637f961647b0f0ca1db741a5c378a51c
148
py
Python
sci_util/log_util/stdout.py
iViolinSolo/python-util
97a0393b2eb375ad84b9c13104e14678ecf17102
[ "MIT" ]
null
null
null
sci_util/log_util/stdout.py
iViolinSolo/python-util
97a0393b2eb375ad84b9c13104e14678ecf17102
[ "MIT" ]
null
null
null
sci_util/log_util/stdout.py
iViolinSolo/python-util
97a0393b2eb375ad84b9c13104e14678ecf17102
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: violinsolo # Created on 2020/7/1 import sys def loge(content): print(content, sys.stderr)
14.8
30
0.655405
22
148
4.409091
0.909091
0
0
0
0
0
0
0
0
0
0
0.056911
0.168919
148
9
31
16.444444
0.731707
0.52027
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
a04473ca9968a3f6cdfaa6e9d9fd624b80ab283b
452
py
Python
dynclipy/tests/test_main.py
dynverse/dynclipy
42a118a52797ab68acaa9b5dbba2d1b13e042665
[ "MIT" ]
null
null
null
dynclipy/tests/test_main.py
dynverse/dynclipy
42a118a52797ab68acaa9b5dbba2d1b13e042665
[ "MIT" ]
null
null
null
dynclipy/tests/test_main.py
dynverse/dynclipy
42a118a52797ab68acaa9b5dbba2d1b13e042665
[ "MIT" ]
null
null
null
from unittest import TestCase import dynclipy # class TestMain(TestCase): # def test_main(self): # # TODO: add test dataset and definition from dyncli here!! # args = ["--dataset", "~/example/test.loom", "--dimred", "landmark_mds", "--output", "~/example/output.h4"] # definition = "/home/wouters/thesis/projects/dynverse/methods/ti_angle/definition.yml" # task = dynclipy.main(args, definition) # dynclipy.check_conversion_rpy2py(task)
34.769231
108
0.714602
55
452
5.781818
0.709091
0
0
0
0
0
0
0
0
0
0
0.005076
0.128319
452
13
109
34.769231
0.80203
0.856195
0
0
0
0
0
0
0
0
0
0.076923
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
1
0
1
0
0
5
a09affe861f5f5971f7121b91794b56f0bd57c8c
11
py
Python
tests/roots/test-apidoc-pep420/a/b/e/f.py
samdoran/sphinx
4c91c038b220d07bbdfe0c1680af42fe897f342c
[ "BSD-2-Clause" ]
4,973
2015-01-03T15:44:00.000Z
2022-03-31T03:11:51.000Z
tests/roots/test-apidoc-pep420/a/b/e/f.py
samdoran/sphinx
4c91c038b220d07bbdfe0c1680af42fe897f342c
[ "BSD-2-Clause" ]
7,850
2015-01-02T08:09:25.000Z
2022-03-31T18:57:40.000Z
tests/roots/test-apidoc-pep420/a/b/e/f.py
samdoran/sphinx
4c91c038b220d07bbdfe0c1680af42fe897f342c
[ "BSD-2-Clause" ]
2,179
2015-01-03T15:26:53.000Z
2022-03-31T12:22:44.000Z
"Module f"
5.5
10
0.636364
2
11
3.5
1
0
0
0
0
0
0
0
0
0
0
0
0.181818
11
1
11
11
0.777778
0.727273
0
0
0
0
0.727273
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
26114f4f8a0a44ebb4fa3d8ced8d67e46f3f9fda
136
py
Python
happ/signals.py
Mafioso/happ-backend
3a3a57add4ec55985cc37db79c71430ed78b1ee3
[ "MIT" ]
1
2017-10-22T06:12:33.000Z
2017-10-22T06:12:33.000Z
happ/signals.py
Mafioso/happ-backend
3a3a57add4ec55985cc37db79c71430ed78b1ee3
[ "MIT" ]
null
null
null
happ/signals.py
Mafioso/happ-backend
3a3a57add4ec55985cc37db79c71430ed78b1ee3
[ "MIT" ]
null
null
null
from mongoengine import signals from .models import FileObject signals.post_delete.connect(FileObject.post_delete, sender=FileObject)
22.666667
70
0.852941
17
136
6.705882
0.588235
0.175439
0
0
0
0
0
0
0
0
0
0
0.088235
136
5
71
27.2
0.919355
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
2618fb267f7107a734dfd6dd282377fd694b5426
2,498
py
Python
tests/test_create_prodigy_data.py
wellcometrust/grants_tagger
b0701a0752d6196bf9aa64958843029390c82ef4
[ "MIT" ]
2
2021-06-15T10:20:01.000Z
2022-02-23T16:13:42.000Z
tests/test_create_prodigy_data.py
wellcometrust/grants_tagger
b0701a0752d6196bf9aa64958843029390c82ef4
[ "MIT" ]
168
2020-07-01T10:06:36.000Z
2022-03-31T13:47:42.000Z
tests/test_create_prodigy_data.py
wellcometrust/grants_tagger
b0701a0752d6196bf9aa64958843029390c82ef4
[ "MIT" ]
null
null
null
import tempfile import os.path import pickle import json from sklearn.preprocessing import MultiLabelBinarizer from grants_tagger.create_prodigy_data import create_prodigy_data DATA = [ {"text": "One", "tags": ["T1", "T2"], "meta": {"Grant_ID": 1}} ] def test_create_prodigy_data_teach(): mode = "teach" with tempfile.TemporaryDirectory() as tmp_dir: data_path = os.path.join(tmp_dir, "data.jsonl") label_binarizer_path = os.path.join(tmp_dir, "label_binarizer.pkl") output_path = os.path.join(tmp_dir, "out.jsonl") label_binarizer = MultiLabelBinarizer() label_binarizer.fit([example["tags"] for example in DATA]) with open(label_binarizer_path, "wb") as f: f.write(pickle.dumps(label_binarizer)) with open(data_path, "w") as f: for line in DATA: f.write(json.dumps(line)+"\n") create_prodigy_data(data_path, label_binarizer_path, output_path, mode) out_data = [] with open(output_path) as f: for line in f: out_data.append(json.loads(line)) assert len(out_data) == 1 assert out_data[0]["text"] == "One" assert out_data[0]["meta"]["grant_id"] == 1 assert "tags" not in out_data[0] def test_create_prodigy_data_train(): mode = "train" with tempfile.TemporaryDirectory() as tmp_dir: data_path = os.path.join(tmp_dir, "data.jsonl") label_binarizer_path = os.path.join(tmp_dir, "label_binarizer.pkl") output_path = os.path.join(tmp_dir, "out.jsonl") label_binarizer = MultiLabelBinarizer() label_binarizer.fit([example["tags"] for example in DATA]) with open(label_binarizer_path, "wb") as f: f.write(pickle.dumps(label_binarizer)) with open(data_path, "w") as f: for line in DATA: f.write(json.dumps(line)+"\n") create_prodigy_data(data_path, label_binarizer_path, output_path, mode) out_data = [] with open(output_path) as f: for line in f: out_data.append(json.loads(line)) assert len(out_data) == 2 assert out_data[0]["text"] == "One" assert out_data[0]["answer"] == "accept" assert out_data[1]["text"] == "One" assert out_data[1]["answer"] == "accept" assert "T1" in [out_data[0]["label"], out_data[1]["label"]] assert "T2" in [out_data[0]["label"], out_data[1]["label"]]
32.441558
79
0.618094
341
2,498
4.304985
0.181818
0.081063
0.038147
0.057221
0.792916
0.746594
0.746594
0.746594
0.746594
0.708447
0
0.010123
0.248599
2,498
76
80
32.868421
0.771977
0
0
0.607143
0
0
0.086469
0
0
0
0
0
0.196429
1
0.035714
false
0
0.107143
0
0.142857
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
2636bd152bd38712dde4b6652326f8e84a91a6b4
228
py
Python
problems/717_1_bit_and_2_bit_characters.py
wasi0013/leet_code
c589c10f06043fa0ac7643e09ae3903d77c2f8e9
[ "MIT" ]
null
null
null
problems/717_1_bit_and_2_bit_characters.py
wasi0013/leet_code
c589c10f06043fa0ac7643e09ae3903d77c2f8e9
[ "MIT" ]
null
null
null
problems/717_1_bit_and_2_bit_characters.py
wasi0013/leet_code
c589c10f06043fa0ac7643e09ae3903d77c2f8e9
[ "MIT" ]
null
null
null
class Solution: def isOneBitCharacter(self, bits: List[int]) -> bool: def process_bit(bit, ans): return not ans if bit else True return reduce(process_bit, bits[:-1:], True)
25.333333
59
0.565789
28
228
4.535714
0.678571
0.15748
0
0
0
0
0
0
0
0
0
0.006579
0.333333
228
8
60
28.5
0.828947
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0
0.2
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
26455c0580bcfd6916abcb08936f04aaad3495b6
2,401
py
Python
tests/libkge/embedding/test_kge_pipeline.py
samehkamaleldin/libkge
c80e82a894ddc4160cc03034206e3c1f05d32b42
[ "Apache-2.0" ]
12
2019-10-08T08:42:04.000Z
2021-12-16T06:50:17.000Z
benchmarking/libkge/tests/libkge/embedding/test_kge_pipeline.py
hpi-sam/GNN-Effectants
e1204cb78bb91ffe3126df62d2d14b20da950694
[ "MIT" ]
null
null
null
benchmarking/libkge/tests/libkge/embedding/test_kge_pipeline.py
hpi-sam/GNN-Effectants
e1204cb78bb91ffe3126df62d2d14b20da950694
[ "MIT" ]
3
2020-03-11T02:34:38.000Z
2021-01-24T15:09:44.000Z
# -*- coding: utf-8 -*- from libkge.util import KgDataset from libkge.embedding import TransE, DistMult, ComplEx, TriModel, DistMult_MCL, ComplEx_MCL, TriModel_MCL import numpy as np triples = np.array([ ['a', 'friend-of', 'b'], ['a', 'parent-of', 'c'], ['k', 'brother-of', 'c'], ['a', 'parent-of', 'k'], ['k', 'friend-of', 'r'], ['m', 'friend-of', 'c'], ['b', 'friend-of', 'p'], ['f', 'brother-of', 'c'], ['j', 'parent-of', 't'], ['b', 'friend-of', 'k'], ['n', 'friend-of', 'd'], ['b', 'friend-of', 'c'] ]) def test_transe_pipeline(): """ """ dataset = KgDataset() dataset.load_triples(triples) train_data = dataset.data["default"] kge_model = TransE() kge_model.fit(train_data) train_data_scores = kge_model.predict(train_data) def test_distmult_pipeline(): """ """ dataset = KgDataset() dataset.load_triples(triples) train_data = dataset.data["default"] kge_model = DistMult() kge_model.fit(train_data) train_data_scores = kge_model.predict(train_data) def test_complex_pipeline(): """ """ dataset = KgDataset() dataset.load_triples(triples) train_data = dataset.data["default"] kge_model = ComplEx() kge_model.fit(train_data) train_data_scores = kge_model.predict(train_data) def test_trimodel_pipeline(): """ """ dataset = KgDataset() dataset.load_triples(triples) train_data = dataset.data["default"] kge_model = TriModel() kge_model.fit(train_data) train_data_scores = kge_model.predict(train_data) def test_distmult_mcl_pipeline(): """ """ dataset = KgDataset() dataset.load_triples(triples) train_data = dataset.data["default"] kge_model = DistMult_MCL() kge_model.fit(train_data) train_data_scores = kge_model.predict(train_data) def test_complex_mcl_pipeline(): """ """ dataset = KgDataset() dataset.load_triples(triples) train_data = dataset.data["default"] kge_model = ComplEx_MCL() kge_model.fit(train_data) train_data_scores = kge_model.predict(train_data) def test_trimodel_mcl_pipeline(): """ """ dataset = KgDataset() dataset.load_triples(triples) train_data = dataset.data["default"] kge_model = TriModel_MCL() kge_model.fit(train_data) train_data_scores = kge_model.predict(train_data)
22.866667
105
0.6389
300
2,401
4.826667
0.16
0.174033
0.116022
0.149862
0.796271
0.796271
0.796271
0.796271
0.796271
0.796271
0
0.000522
0.201583
2,401
104
106
23.086538
0.754825
0.008746
0
0.530303
0
0
0.079773
0
0
0
0
0
0
1
0.106061
false
0
0.045455
0
0.151515
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
265f2911534440d8a7cae42ea9ec68f67667812f
166
py
Python
profiles_app/admin.py
Vaibhav-Kotadiya/profiles-rest-api
dd793a39850e340fcd0d2d0ca450fb2860f28562
[ "MIT" ]
null
null
null
profiles_app/admin.py
Vaibhav-Kotadiya/profiles-rest-api
dd793a39850e340fcd0d2d0ca450fb2860f28562
[ "MIT" ]
3
2021-06-04T22:55:15.000Z
2021-09-22T18:54:52.000Z
profiles_app/admin.py
Vaibhav-Kotadiya/profiles-rest-api
dd793a39850e340fcd0d2d0ca450fb2860f28562
[ "MIT" ]
null
null
null
from django.contrib import admin from profiles_app.models import UserProfile, ProfileFeedItem admin.site.register(UserProfile) admin.site.register(ProfileFeedItem)
23.714286
60
0.855422
20
166
7.05
0.6
0.12766
0.241135
0
0
0
0
0
0
0
0
0
0.078313
166
6
61
27.666667
0.921569
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
cd2be2b32350d9a47e5d7ce6055bb65a7b1560f4
101
py
Python
contiamo/__init__.py
contiamo/contiamo-client-python
8409f28ca2437bc1125cdc507629397389b26054
[ "MIT" ]
1
2018-03-16T14:26:17.000Z
2018-03-16T14:26:17.000Z
contiamo/__init__.py
contiamo/contiamo-client-python
8409f28ca2437bc1125cdc507629397389b26054
[ "MIT" ]
11
2018-03-15T12:40:53.000Z
2019-12-20T09:50:45.000Z
contiamo/__init__.py
contiamo/contiamo-client-python
8409f28ca2437bc1125cdc507629397389b26054
[ "MIT" ]
3
2017-04-04T15:56:58.000Z
2017-08-15T07:43:07.000Z
from contiamo import resources, public, data import logging logging.basicConfig(level=logging.WARN)
20.2
44
0.831683
13
101
6.461538
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.09901
101
4
45
25.25
0.923077
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
cd3181d5dae21ff83b96d43523d805f8c70c7587
83
py
Python
terrascript/ns1/r.py
GarnerCorp/python-terrascript
ec6c2d9114dcd3cb955dd46069f8ba487e320a8c
[ "BSD-2-Clause" ]
null
null
null
terrascript/ns1/r.py
GarnerCorp/python-terrascript
ec6c2d9114dcd3cb955dd46069f8ba487e320a8c
[ "BSD-2-Clause" ]
null
null
null
terrascript/ns1/r.py
GarnerCorp/python-terrascript
ec6c2d9114dcd3cb955dd46069f8ba487e320a8c
[ "BSD-2-Clause" ]
1
2018-11-15T16:23:05.000Z
2018-11-15T16:23:05.000Z
from terrascript import _resource class ns1_zone(_resource): pass zone = ns1_zone
16.6
33
0.819277
12
83
5.333333
0.666667
0.21875
0
0
0
0
0
0
0
0
0
0.027778
0.13253
83
4
34
20.75
0.861111
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.333333
0.333333
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
5
cd4a97eb4db785457b3bccd6276c256066476c9e
252
py
Python
flask_philo/db/__init__.py
maigfrga/flask-philo
f46d766c0f2607a5df193d532abb7b9cb576f909
[ "Apache-2.0" ]
1
2018-08-28T11:03:18.000Z
2018-08-28T11:03:18.000Z
flask_philo/db/__init__.py
maigfrga/flask-philo
f46d766c0f2607a5df193d532abb7b9cb576f909
[ "Apache-2.0" ]
32
2016-09-30T14:42:21.000Z
2017-11-02T14:34:34.000Z
flask_philo/db/__init__.py
maigfrga/flask-philo
f46d766c0f2607a5df193d532abb7b9cb576f909
[ "Apache-2.0" ]
7
2016-06-28T10:03:21.000Z
2017-01-23T17:29:29.000Z
from .postgresql.connection import initialize as init_pg from .redis.connection import initialize as init_rd from .elasticsearch.connection import initialize as init_el def init_db(g, app): init_pg(g, app) init_rd(g, app) init_el(g, app)
25.2
59
0.761905
41
252
4.512195
0.390244
0.086486
0.421622
0.454054
0.518919
0
0
0
0
0
0
0
0.162698
252
9
60
28
0.876777
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0.428571
0
0.571429
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
0
0
1
0
1
0
0
5
cd640f7ff24468a579c2021fdc85da76d5e88f07
188
py
Python
ofx2xlsmbr/reader/IReaderCashFlow.py
rmusmanno/ofx2xlsmbr
15d45148f6ad77ee300a42215c3098576ff9d7c4
[ "MIT" ]
null
null
null
ofx2xlsmbr/reader/IReaderCashFlow.py
rmusmanno/ofx2xlsmbr
15d45148f6ad77ee300a42215c3098576ff9d7c4
[ "MIT" ]
1
2021-03-31T19:12:01.000Z
2021-03-31T19:12:01.000Z
ofx2xlsmbr/reader/IReaderCashFlow.py
rmusmanno/ofx2xlsmbr
15d45148f6ad77ee300a42215c3098576ff9d7c4
[ "MIT" ]
null
null
null
import abc from ofx2xlsmbr.model.CashFlow import CashFlow class IReaderCashFlow(metaclass=abc.ABCMeta): @abc.abstractmethod def read(self, factory, ofx) -> CashFlow: pass
23.5
46
0.739362
22
188
6.318182
0.772727
0
0
0
0
0
0
0
0
0
0
0.006452
0.175532
188
8
47
23.5
0.890323
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.166667
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
5
cd84cd0e7cefa1f5f6a7b4ca63de8e8f9e53911b
14
py
Python
scripts/julia_modules/st16SseqJuliaTools/src/fake_for_sonar/bla.py
GediminasA/st16Sseqanalysis
6526d49eeb04cb1d1535937df7ea86e2214a6485
[ "MIT" ]
null
null
null
scripts/julia_modules/st16SseqJuliaTools/src/fake_for_sonar/bla.py
GediminasA/st16Sseqanalysis
6526d49eeb04cb1d1535937df7ea86e2214a6485
[ "MIT" ]
null
null
null
scripts/julia_modules/st16SseqJuliaTools/src/fake_for_sonar/bla.py
GediminasA/st16Sseqanalysis
6526d49eeb04cb1d1535937df7ea86e2214a6485
[ "MIT" ]
null
null
null
print("True")
7
13
0.642857
2
14
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.071429
14
1
14
14
0.692308
0
0
0
0
0
0.285714
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
2695bb199cf084b4083e2263c3ba0fb0a5b1fde1
1,635
py
Python
ChimeraExtension.py
gpsgibb/tetr_lev00_Chimera_plugin
76206242bc28dc1e6aac8efb2c88af4f50afafc2
[ "BSD-2-Clause" ]
5
2018-03-29T13:58:18.000Z
2021-02-15T02:03:06.000Z
ChimeraExtension.py
gpsgibb/Tetr-Chimera_plugin
76206242bc28dc1e6aac8efb2c88af4f50afafc2
[ "BSD-2-Clause" ]
1
2021-02-20T05:03:45.000Z
2021-02-20T05:03:45.000Z
ChimeraExtension.py
gpsgibb/Tetr-Chimera_plugin
76206242bc28dc1e6aac8efb2c88af4f50afafc2
[ "BSD-2-Clause" ]
3
2018-10-10T13:59:02.000Z
2021-04-22T08:06:38.000Z
# -*- coding: utf-8 -*- """ Created on Tue May 31 10:40:14 2016 @author: jeremy """ import chimera.extension class TetrEMO(chimera.extension.EMO): def name(self): return 'Tetr' def description(self): return 'Run the Tetr utility' def categories(self): return ['Utilities'] def icon(self): return self.path('TetrLogo.tiff') def activate(self): # Comment out if no GUI is needed from chimera.dialogs import display display(self.module("gui").TetrDialog.name) return None # Register chimera.extension.manager.registerExtension(TetrEMO(__file__)) from Midas.midas_text import addCommand def cmdTetr(cmdName, args): from Tetr import runTetr from Midas.midas_text import doExtensionFunc doExtensionFunc(runTetr, args) addCommand("tetr", cmdTetr, changesDisplay=True) class Lev00EMO(chimera.extension.EMO): def name(self): return 'Lev00' def description(self): return 'Run the Lev00 utility' def categories(self): return ['Utilities'] def icon(self): return self.path('Lev00Logo.tiff') def activate(self): # Comment out if no GUI is needed from chimera.dialogs import display display(self.module("gui").Lev00Dialog.name) return None # Register chimera.extension.manager.registerExtension(Lev00EMO(__file__)) from Midas.midas_text import addCommand def cmdTetr(cmdName, args): from Tetr import runTetr from Midas.midas_text import doExtensionFunc doExtensionFunc(runTetr, args) addCommand("lev00", cmdTetr, changesDisplay=True)
22.094595
63
0.686239
195
1,635
5.692308
0.34359
0.072072
0.05045
0.064865
0.796396
0.796396
0.742342
0.677477
0.565766
0.565766
0
0.021094
0.217125
1,635
73
64
22.39726
0.846094
0.096024
0
0.634146
0
0
0.075034
0
0
0
0
0
0
1
0.292683
false
0
0.219512
0.195122
0.804878
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
26a2f9896a4625d1ba02cbcd6673f265eed2f509
15,626
py
Python
functions.py
kunovg/EcoBici
f0f22ccff46320e5f9ef238424dc83ca9ddbf50d
[ "MIT" ]
null
null
null
functions.py
kunovg/EcoBici
f0f22ccff46320e5f9ef238424dc83ca9ddbf50d
[ "MIT" ]
null
null
null
functions.py
kunovg/EcoBici
f0f22ccff46320e5f9ef238424dc83ca9ddbf50d
[ "MIT" ]
null
null
null
# encoding=utf-8 import json import pandas as pd import models as m from sqlalchemy import and_, func, or_, extract import datetime as dt def weekday_name(weekday): days = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'] return days[weekday] def get_stations(): s = m.s.query(m.Station) df = pd.read_sql(s.statement, s.session.bind) return df def analyze_departures_by_station(years, stations): """ Numero de salidas por estación durante un año """ for year in years: # Leer todos los viajes realizados en X año print('Leyendo datos del año {}'.format(year)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year) )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Crear una columna que represente el día de la semana en que se hizo el viaje # 0 es Lunes y 6 es Domingo df_year['weekday'] = df_year['departure_time'].apply(lambda x: x.weekday()) dict_year = {} for s in stations: print(s, year) dict_year[str(s)] = {weekday_name(d): len( df_year[(df_year.departure_station == s) & (df_year.weekday == d)].index) for d in range(7) } # Guardar los datos with open('data/salidas_{}.json'.format(year), 'w') as file: json.dump(dict_year, file) def analyze_arrivals_by_station(years, stations): """ Numero de llegadas por estación durante un año """ for year in years: # Leer todos los viajes realizados en X año print('Leyendo datos del año {}'.format(year)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year) )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Crear una columna que represente el día de la semana en que se hizo el viaje # 0 es Lunes y 6 es Domingo df_year['weekday'] = df_year['departure_time'].apply(lambda x: x.weekday()) dict_year = {} for s in stations: print(s, year) dict_year[str(s)] = {weekday_name(d): len( df_year[(df_year.arrival_station == s) & (df_year.weekday == d)].index) for d in range(7) } # Guardar los datos with open('data/llegadas_{}.json'.format(year), 'w') as file: json.dump(dict_year, file) def analyze_trips_by_week(years): """ Numero de viajes por semana """ result = {} for year in years: # Leer todos los viajes realizados en X año print('Leyendo datos del año {}'.format(year)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year) )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Crear una columna que represente el número de la semana en el año df_year['week'] = df_year['departure_time'].apply(lambda x: int(x.strftime('%W'))) result[year] = {str(w): len(df_year[df_year.week == w].index) for w in range(54)} # Guardar los datos with open('data/viajes_por_semana.json', 'w') as file: json.dump(result, file) def analyze_trips_by_weekday(years, weekdays): """ Numero de viajes por día de la semana durante un año """ for year in years: # Leer todos los viajes realizados en X año print('Leyendo datos del año {}'.format(year)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year) )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Crear una columna que represente el día de la semana en que se hizo el viaje # 0 es Lunes y 6 es Domingo df_year['weekday'] = df_year['departure_time'].apply(lambda x: x.weekday()) dict_year = {} for weekday in weekdays: print(weekday, year) trips = df_year[df_year.weekday == weekday] dict_year[weekday_name(weekday)] = len(trips.index) # Guardar los datos with open('data/trips_weekday_{}.json'.format(year), 'w') as file: json.dump(dict_year, file) def analyze_trip_distribution(weekday, years): """ Número de viajes en diferentes weekdays de años """ def all_weekdays(year, weekday): """ Todos los weekdays de un año """ d = dt.datetime(year, 1, 1) # January 1st diff = weekday - d.weekday() d += dt.timedelta(days=diff if diff >= 0 else 7+diff) while d.year == year: yield d d += dt.timedelta(days=7) result = {} for year in years: # Leer todos los viajes realizados en X año print('Leyendo datos del año {}'.format(year)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year) )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Crear una columna que represente la fecha del viaje df_year['day'] = df_year['departure_time'].apply(lambda x: x.strftime('%Y-%m-%d')) print('Analizando datos del año {}'.format(year)) result = {**result, **{ d.strftime('%Y-%m-%d'): len(df_year[df_year.day == d.strftime('%Y-%m-%d')].index) for d in all_weekdays(int(year), weekday) }} # Guardar los datos with open('data/trip_distribution_{}.json'.format(weekday_name(weekday)), 'w') as file: json.dump(result, file, sort_keys=True) def analyze_trips_by_moments(weekday, intervalo, years): """ Numero de viajes en determinados lapsos del día por un año """ def generate_time_lapse(intervalo): """ Regresa un array de strings en formato %H:%M """ delta = dt.timedelta(minutes=intervalo) # 1440 minutos en un día start = dt.datetime.now().replace(hour=0, minute=0) tiempos = [(start + i * delta).strftime('%H:%M') for i in range(int(1440 / intervalo))] tiempos.append('23:59:59') # Último momento del día return tiempos tiempos, result = generate_time_lapse(intervalo), {} for year in years: # Leer todos los viajes realizados en X año print('Leyendo datos del año {}'.format(year)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year), func.to_char(m.Trip.departure_time, 'ID') == str(weekday+1) # En SQL van de 1 a 7 )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Crear una columna que represente el día de la semana en que se hizo el viaje # 0 es Lunes y 6 es Domingo df_year['weekday'] = df_year['departure_time'].apply(lambda x: x.weekday()) # Set DatetimeIndex df_year.set_index('departure_time', inplace=True) print('Analizando datos del año {}'.format(year)) result[year] = {tiempos[t]: len(df_year[df_year.weekday == weekday].between_time( tiempos[t], tiempos[t+1]).index) for t in range(len(tiempos)-1)} with open('data/trips_during_weekday_{}.json'.format(weekday_name(weekday)), 'w') as file: json.dump(result, file) def analyze_trips_by_moments_for_day(days, intervalo): """ Numero de viajes en determinados lapsos para un dia en especifico(datetime) """ def generate_time_lapse(intervalo): """ Regresa un array de strings en formato %H:%M """ delta = dt.timedelta(minutes=intervalo) # 1440 minutos en un día start = dt.datetime.now().replace(hour=0, minute=0) tiempos = [(start + i * delta).strftime('%H:%M') for i in range(int(1440 / intervalo))] tiempos.append('23:59:59') # Último momento del día return tiempos tiempos, result = generate_time_lapse(intervalo), {} for day in days: start, end = day.replace(hour=0, minute=0, second=0), day.replace(hour=23, minute=59, second=59) # Leer todos los viajes realizados en X día print('Leyendo datos del día {}'.format(day)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= start, m.Trip.departure_time <= end )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Set DatetimeIndex df_year.set_index('departure_time', inplace=True) print('Analizando datos del día {}'.format(day)) result[day.strftime('%Y-%m-%d')] = {tiempos[t]: len(df_year.between_time(tiempos[t], tiempos[t+1]).index) for t in range(len(tiempos)-1)} with open('data/trips_during_days.json', 'w') as file: json.dump(result, file) def analyze_trips_by_moments_day_station(day, station, intervalo): """ Numero de viajes en determinados lapsos del día para cierta estación""" def generate_time_lapse(intervalo): """ Regresa un array de strings en formato %H:%M """ delta = dt.timedelta(minutes=intervalo) # 1440 minutos en un día start = dt.datetime.now().replace(hour=0, minute=0) tiempos = [(start + i * delta).strftime('%H:%M') for i in range(int(1440 / intervalo))] tiempos.append('23:59:59') # Para que no exista un overlapping con el primer intervalo return tiempos tiempos, result = generate_time_lapse(intervalo), {} start, end = day.replace(hour=0, minute=0, second=0), day.replace(hour=23, minute=59, second=59) # Leer todos los viajes de X estación durante Y día print('Leyendo datos del día {} estación {}'.format(day, station)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= start, m.Trip.departure_time <= end)).filter(or_( m.Trip.departure_station == station, m.Trip.arrival_station == station )) df_year = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Set DatetimeIndex df_year.set_index('departure_time', inplace=True) for t in range(len(tiempos)-1): salidas = df_year[df_year.departure_station == station].between_time(tiempos[t], tiempos[t+1]).index llegadas = df_year[df_year.arrival_station == station].between_time(tiempos[t], tiempos[t+1]).index result[tiempos[t]] = {'salidas': len(salidas), 'llegadas': len(llegadas)} with open('data/trips_{}_station_{}.json'.format(day.strftime('%Y-%m-%d'), station), 'w') as file: json.dump(result, file) def most_common_trips(weekday, year): """ Los viajes más comunes en cierto weekday """ def stations(s1, s2): return '{}-{}'.format(s1, s2) if s1 < s2 else '{}-{}'.format(s2, s1) print('Leyendo datos weekday: {}\taño: {}'.format(weekday, year)) trips = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year), func.to_char(m.Trip.departure_time, 'ID') == str(weekday+1) # En SQL van de 1 a 7 )) df = pd.read_sql(trips.statement, trips.session.bind) df['stations'] = df.apply(lambda row: stations(row['departure_station'], row['arrival_station']), axis=1) return df['stations'].value_counts() def bicycle_data(bicycle_id): print('Leyendo viajes de la bicicleta {}'.format(bicycle_id)) trips = m.s.query(m.Trip).filter_by(bicycle_id=bicycle_id) df = pd.read_sql(trips.statement, trips.session.bind).sort_values(by='departure_time') if len(df) == 0: return {} df['trip_length'] = df.apply(lambda row: (row['arrival_time'] - row['departure_time']).total_seconds(), axis=1) return { 'first_trip': df['departure_time'].iloc[0], 'last_trip': df['departure_time'].iloc[-1], 'total_time': df['trip_length'].sum(), 'total_trips': len(df), } def analyze_trips_by_moments_week_station(day, station, intervalo): """ Numero de viajes por lapsos durante toda una semana para cierta estación""" def generate_time_lapse(intervalo): """ Regresa un array de strings en formato %H:%M """ delta = dt.timedelta(minutes=intervalo) # 1440 minutos en un día start = dt.datetime.now().replace(hour=0, minute=0) tiempos = [(start + i * delta).strftime('%H:%M') for i in range(int(1440 / intervalo))] tiempos.append('23:59:59') # Para que no exista un overlapping con el primer intervalo return tiempos tiempos, result = generate_time_lapse(intervalo), {} start, end = day.replace(hour=0, minute=0, second=0), day.replace(hour=23, minute=59, second=59) + dt.timedelta(days=7) # Leer todos los viajes de X estación durante Y día print('Leyendo datos de la semana {} estación {}'.format(day, station)) trips_per_year = m.s.query(m.Trip).filter(and_( m.Trip.departure_time >= start, m.Trip.departure_time <= end)).filter(or_( m.Trip.departure_station == station, m.Trip.arrival_station == station )) df = pd.read_sql(trips_per_year.statement, trips_per_year.session.bind) # Set DatetimeIndex df.set_index('departure_time', inplace=True) for dia in range(7): result[str(dia)] = {} df2 = df.ix[(day + dt.timedelta(days=dia)).strftime('%Y-%m-%d'):(day + dt.timedelta(days=dia)).strftime('%Y-%m-%d')] for t in range(len(tiempos)-1): salidas = df2[df2.departure_station == station].between_time(tiempos[t], tiempos[t+1]).index llegadas = df2[df2.arrival_station == station].between_time(tiempos[t], tiempos[t+1]).index result[str(dia)][tiempos[t]] = {'salidas': len(salidas), 'llegadas': len(llegadas)} with open('data/trips_week_{}_station_{}.json'.format(day.strftime('%Y-%m-%d'), station), 'w') as file: json.dump(result, file) def trips_by_hour(hour, year, exclude_days=['6', '7']): trips = m.s.query(m.Trip).filter(and_( hour == extract('hour', m.Trip.departure_time), m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year), ~func.to_char(m.Trip.departure_time, 'ID').in_(exclude_days) )) return pd.read_sql(trips.statement, trips.session.bind) def trips_between_minutes(h1, m1, h2, m2, year, exclude_days=['6', '7']): """ Returns trips in a year, during specific times""" trips = m.s.query(m.Trip).filter(and_( extract('hour', m.Trip.departure_time) >= h1, extract('minute', m.Trip.departure_time) >= m1, extract('hour', m.Trip.departure_time) <= h2, extract('minute', m.Trip.departure_time) <= m2, m.Trip.departure_time >= '{}-01-01 00:00:00'.format(year), m.Trip.departure_time <= '{}-12-31 23:59:59'.format(year), ~func.to_char(m.Trip.departure_time, 'ID').in_(exclude_days) )) return pd.read_sql(trips.statement, trips.session.bind)
46.784431
124
0.627864
2,275
15,626
4.174505
0.097143
0.026324
0.051595
0.062546
0.817732
0.789828
0.744551
0.722333
0.692008
0.676845
0
0.027992
0.227249
15,626
333
125
46.924925
0.758509
0.141815
0
0.57438
0
0
0.116619
0.017101
0
0
0
0.003003
0
1
0.086777
false
0
0.020661
0.004132
0.157025
0.070248
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
26c10adb4f044f334f8a6be6f3e9ccf4645619e4
76
py
Python
utils/models/fast_r_cnn.py
wufanyou/growth-ring-detection
27989870e12ab149413363a99080f7684db6cf1a
[ "MIT" ]
null
null
null
utils/models/fast_r_cnn.py
wufanyou/growth-ring-detection
27989870e12ab149413363a99080f7684db6cf1a
[ "MIT" ]
null
null
null
utils/models/fast_r_cnn.py
wufanyou/growth-ring-detection
27989870e12ab149413363a99080f7684db6cf1a
[ "MIT" ]
null
null
null
from torchvision.models.detection.transform import GeneralizedRCNNTransform
38
75
0.907895
7
76
9.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.052632
76
1
76
76
0.958333
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
26faf9e36dc282bdcc60fe87129424b192059fc6
58
py
Python
src/pyvsystems_play/services/pyvsys_services.py
bfmcneill/pyvsystems_play
8ad9e2e1a8e877c544f263edfe52b3f6d18fa2e7
[ "MIT" ]
null
null
null
src/pyvsystems_play/services/pyvsys_services.py
bfmcneill/pyvsystems_play
8ad9e2e1a8e877c544f263edfe52b3f6d18fa2e7
[ "MIT" ]
null
null
null
src/pyvsystems_play/services/pyvsys_services.py
bfmcneill/pyvsystems_play
8ad9e2e1a8e877c544f263edfe52b3f6d18fa2e7
[ "MIT" ]
null
null
null
from pyvsystems_play.settings import DEBUG print(DEBUG)
11.6
42
0.827586
8
58
5.875
0.875
0
0
0
0
0
0
0
0
0
0
0
0.12069
58
4
43
14.5
0.921569
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
f865a81f4faa1c69f3f0c1b14df6fc72b8d8a367
98
py
Python
src/marion/marion/issuers/__init__.py
OmenApps/marion
f501674cafbd91f0bbad7454e4dcf3527cf4445e
[ "MIT" ]
7
2021-04-06T20:33:31.000Z
2021-09-30T23:29:24.000Z
src/marion/marion/issuers/__init__.py
OmenApps/marion
f501674cafbd91f0bbad7454e4dcf3527cf4445e
[ "MIT" ]
23
2020-09-09T15:01:50.000Z
2022-01-03T08:58:36.000Z
src/marion/marion/issuers/__init__.py
OmenApps/marion
f501674cafbd91f0bbad7454e4dcf3527cf4445e
[ "MIT" ]
2
2020-12-14T10:07:07.000Z
2021-06-29T00:20:43.000Z
"""Issuer shortcuts for the marion application""" from .dummy import DummyDocument # noqa: F401
24.5
49
0.755102
12
98
6.166667
1
0
0
0
0
0
0
0
0
0
0
0.036145
0.153061
98
3
50
32.666667
0.855422
0.561224
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
f889ee71fce95523d6c5140c4e78127d7205a146
16
py
Python
print.py
Khomynets/marco_biondo
a5e30d7f4669be2eb87bb46b469ad6da92d96132
[ "MIT" ]
null
null
null
print.py
Khomynets/marco_biondo
a5e30d7f4669be2eb87bb46b469ad6da92d96132
[ "MIT" ]
null
null
null
print.py
Khomynets/marco_biondo
a5e30d7f4669be2eb87bb46b469ad6da92d96132
[ "MIT" ]
null
null
null
print ("marko")
8
15
0.625
2
16
5
1
0
0
0
0
0
0
0
0
0
0
0
0.125
16
1
16
16
0.714286
0
0
0
0
0
0.3125
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
f89b5b576ac3b98575ced3eae434e280210cb697
264
py
Python
src/tests.py
GlenDC/threefold-wallet-electron
440662a793d98781eb3bbf415ba8a482abed0288
[ "MIT" ]
null
null
null
src/tests.py
GlenDC/threefold-wallet-electron
440662a793d98781eb3bbf415ba8a482abed0288
[ "MIT" ]
201
2019-05-20T15:06:05.000Z
2019-07-16T12:48:59.000Z
src/tests.py
GlenDC/threefold-wallet-electron
440662a793d98781eb3bbf415ba8a482abed0288
[ "MIT" ]
1
2019-12-20T21:45:39.000Z
2019-12-20T21:45:39.000Z
import tfchain.tests.encoding as testencoding import tfchain.tests.crypto as testcrypto import tfchain.tests.types as testtypes import tfchain.tests as tftests def tests(): testencoding.tests() testcrypto.tests() testtypes.tests() tftests.tests()
24
45
0.768939
33
264
6.151515
0.363636
0.256158
0.35468
0
0
0
0
0
0
0
0
0
0.147727
264
10
46
26.4
0.902222
0
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
true
0
0.444444
0
0.555556
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f8bc3a5abd958896c7334d27dedb0d7efa63344c
324
py
Python
echopype/echodata/api.py
stuara/echopype
e01d57592385324b5747fb5c98d498ff50c42194
[ "Apache-2.0" ]
1
2020-06-20T20:50:24.000Z
2020-06-20T20:50:24.000Z
echopype/echodata/api.py
stuara/echopype
e01d57592385324b5747fb5c98d498ff50c42194
[ "Apache-2.0" ]
3
2020-12-18T03:22:57.000Z
2021-08-12T21:04:44.000Z
echopype/echodata/api.py
stuara/echopype
e01d57592385324b5747fb5c98d498ff50c42194
[ "Apache-2.0" ]
1
2020-11-13T22:35:55.000Z
2020-11-13T22:35:55.000Z
from .echodata import EchoData def open_converted(converted_raw_path, storage_options=None): """Create an EchoData object from a single converted zarr/nc files.""" # TODO: combine multiple files when opening return EchoData( converted_raw_path=converted_raw_path, storage_options=storage_options )
32.4
78
0.765432
42
324
5.666667
0.595238
0.151261
0.201681
0.193277
0.252101
0
0
0
0
0
0
0
0.169753
324
9
79
36
0.884758
0.330247
0
0
0
0
0
0
0
0
0
0.111111
0
1
0.2
false
0
0.2
0
0.6
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
1
0
0
0
0
0
0
0
1
0
0
5
3e6f9c9a545d20b2142a0efbdb8bac3573893cf9
19
py
Python
PySigmoid/Math/__init__.py
mightymercado/PythonPosit
7e126c71c01bda4192a9cd079d12e61d936801e6
[ "MIT" ]
24
2017-11-20T03:24:41.000Z
2022-01-29T04:25:08.000Z
PySigmoid/Math/__init__.py
mightymercado/PythonPosit
7e126c71c01bda4192a9cd079d12e61d936801e6
[ "MIT" ]
14
2018-02-04T15:19:27.000Z
2021-05-04T18:19:24.000Z
PySigmoid/Math/__init__.py
mightymercado/PythonPosit
7e126c71c01bda4192a9cd079d12e61d936801e6
[ "MIT" ]
9
2018-02-01T14:18:32.000Z
2021-12-30T06:01:06.000Z
from .Math import *
19
19
0.736842
3
19
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.157895
19
1
19
19
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3e88e3d585c0a619dfe77f27011f546c7c468b68
184
py
Python
src/checks.py
AWhiteFox/discord-mafia-bot
6b7882be7702ea2691d389e8078516b284de86c8
[ "MIT" ]
1
2020-11-18T18:02:44.000Z
2020-11-18T18:02:44.000Z
src/checks.py
AWhiteFox/discord-mafia-bot
6b7882be7702ea2691d389e8078516b284de86c8
[ "MIT" ]
2
2020-05-05T22:01:53.000Z
2020-05-05T22:03:19.000Z
src/checks.py
AWhiteFox/discord-mafia-bot
6b7882be7702ea2691d389e8078516b284de86c8
[ "MIT" ]
null
null
null
from discord.ext import commands def voice_only(): def predicate(ctx): return ctx.guild is not None and ctx.author.voice is not None return commands.check(predicate)
23
69
0.722826
28
184
4.714286
0.642857
0.075758
0.136364
0
0
0
0
0
0
0
0
0
0.206522
184
7
70
26.285714
0.90411
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0.2
0.2
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
e43377198e0d787e207f37f3d627b150222a1a64
230
py
Python
05modules/01modulos.py
dlunna/al.d20.py
621c1b29ab645ec3017c3b38a49aaffd3496387e
[ "MIT" ]
null
null
null
05modules/01modulos.py
dlunna/al.d20.py
621c1b29ab645ec3017c3b38a49aaffd3496387e
[ "MIT" ]
null
null
null
05modules/01modulos.py
dlunna/al.d20.py
621c1b29ab645ec3017c3b38a49aaffd3496387e
[ "MIT" ]
null
null
null
# Python modules #import datetime #print(datetime.date.today()) #print(datetime.timedelta(minutes=69)) #del modulo datetima importa el metodo from datetime import timedelta, date print(timedelta(minutes=100)) print(date.today())
23
38
0.786957
31
230
5.83871
0.580645
0.143646
0
0
0
0
0
0
0
0
0
0.023923
0.091304
230
9
39
25.555556
0.842105
0.569565
0
0
0
0
0
0
0
0
0
0.111111
0
1
0
true
0
0.333333
0
0.333333
0.666667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
1
0
0
1
0
5
e472ff6a973759b5e2de094334deb340407cf006
109
py
Python
sunpy/database/setup_package.py
Naman9639/sunpy
24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56
[ "BSD-2-Clause" ]
null
null
null
sunpy/database/setup_package.py
Naman9639/sunpy
24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56
[ "BSD-2-Clause" ]
null
null
null
sunpy/database/setup_package.py
Naman9639/sunpy
24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56
[ "BSD-2-Clause" ]
null
null
null
def get_package_data(): return { _ASTROPY_PACKAGE_NAME_ + '.database.tests': ['test_table.txt']}
27.25
71
0.669725
13
109
5.076923
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.183486
109
3
72
36.333333
0.741573
0
0
0
0
0
0.266055
0
0
0
0
0
0
1
0.333333
true
0
0
0.333333
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
0
0
0
5
e4dd26264c7007d2d814faa77395640fddac349d
385
py
Python
utils/io/path.py
akyruu/blender-cartography-addon
4f34b029d9b6a72619227ab3ceaed9393506934e
[ "Apache-2.0" ]
null
null
null
utils/io/path.py
akyruu/blender-cartography-addon
4f34b029d9b6a72619227ab3ceaed9393506934e
[ "Apache-2.0" ]
null
null
null
utils/io/path.py
akyruu/blender-cartography-addon
4f34b029d9b6a72619227ab3ceaed9393506934e
[ "Apache-2.0" ]
null
null
null
""" Module for utility path methods """ import os # METHODS ===================================================================== def workspace() -> os.path: return os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..')) def get(path: str) -> os.path: return os.path.join(workspace(), path) if path.startswith('@') else os.path.realpath(path)
25.666667
95
0.548052
46
385
4.5
0.413043
0.231884
0.202899
0.135266
0.173913
0
0
0
0
0
0
0
0.114286
385
14
96
27.5
0.607038
0.285714
0
0
0
0
0.022472
0
0
0
0
0
0
1
0.4
false
0
0.2
0.4
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
9004cecbe4b37349bc93837a86a0583a2d8d0674
245
py
Python
user_management/api/avatar/urls/__init__.py
incuna/django-user-management
28cd481d333fa313601825dab4b05f3e51974fe8
[ "BSD-2-Clause" ]
52
2015-01-12T11:30:47.000Z
2021-10-31T09:27:42.000Z
user_management/api/avatar/urls/__init__.py
WebDevSand/django-user-management
28cd481d333fa313601825dab4b05f3e51974fe8
[ "BSD-2-Clause" ]
81
2015-01-05T17:35:21.000Z
2020-08-21T02:29:10.000Z
user_management/api/avatar/urls/__init__.py
WebDevSand/django-user-management
28cd481d333fa313601825dab4b05f3e51974fe8
[ "BSD-2-Clause" ]
23
2015-01-20T21:04:35.000Z
2021-12-09T21:15:08.000Z
from django.conf.urls import include, url app_name = 'user_management_api_avatar' urlpatterns = [ url(r'', include('user_management.api.avatar.urls.profile_avatar')), url(r'', include('user_management.api.avatar.urls.user_avatar')), ]
27.222222
72
0.742857
34
245
5.117647
0.470588
0.241379
0.293103
0.396552
0.436782
0.436782
0.436782
0.436782
0
0
0
0
0.106122
245
8
73
30.625
0.794521
0
0
0
0
0
0.469388
0.469388
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
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
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
90098e85740166da721c959041a0b548592af4ca
294
py
Python
conftest.py
chadmcinnis/folio_migration_tools
39ee044a713a34c323324a956e3e8b54ee05c194
[ "MIT" ]
1
2022-03-30T07:48:33.000Z
2022-03-30T07:48:33.000Z
conftest.py
chadmcinnis/folio_migration_tools
39ee044a713a34c323324a956e3e8b54ee05c194
[ "MIT" ]
76
2022-02-04T16:36:49.000Z
2022-03-31T11:20:29.000Z
conftest.py
chadmcinnis/folio_migration_tools
39ee044a713a34c323324a956e3e8b54ee05c194
[ "MIT" ]
1
2022-02-02T17:19:05.000Z
2022-02-02T17:19:05.000Z
def pytest_addoption(parser): parser.addoption("--password", action="store") parser.addoption("--tenant_id", action="store") parser.addoption("--okapi_url", action="store") parser.addoption("--username", action="store") # parser.addoption("--folio_release", action="store")
42
57
0.687075
32
294
6.1875
0.4375
0.378788
0.343434
0.525253
0
0
0
0
0
0
0
0
0.112245
294
6
58
49
0.758621
0.173469
0
0
0
0
0.257261
0
0
0
0
0
0
1
0.2
false
0.2
0
0
0.2
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
9049ac63978dd50f18ae7a460d790848d7440a1f
43
py
Python
Bonus/4.py
HackerUSA-CE/10.7.7-activity-starter
701a3668ac03aa1d18211ea2ff0f71182633c2da
[ "MIT" ]
null
null
null
Bonus/4.py
HackerUSA-CE/10.7.7-activity-starter
701a3668ac03aa1d18211ea2ff0f71182633c2da
[ "MIT" ]
null
null
null
Bonus/4.py
HackerUSA-CE/10.7.7-activity-starter
701a3668ac03aa1d18211ea2ff0f71182633c2da
[ "MIT" ]
1
2022-01-29T05:03:44.000Z
2022-01-29T05:03:44.000Z
# Write your solution for algorithm 4 below
43
43
0.813953
7
43
5
1
0
0
0
0
0
0
0
0
0
0
0.027778
0.162791
43
1
43
43
0.944444
0.953488
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
5f8a2761f44e0683018bd108c53685582a3ff021
1,114
py
Python
mlflow/Ops/linalg.py
BBBBlarry/mlflow
e8f5b9450ba6d3b68fe0cbb530840c0a760d3b08
[ "MIT" ]
null
null
null
mlflow/Ops/linalg.py
BBBBlarry/mlflow
e8f5b9450ba6d3b68fe0cbb530840c0a760d3b08
[ "MIT" ]
null
null
null
mlflow/Ops/linalg.py
BBBBlarry/mlflow
e8f5b9450ba6d3b68fe0cbb530840c0a760d3b08
[ "MIT" ]
null
null
null
import numpy as np from ..utils import * class Sigmoid(): def __init__(self): pass def run(self, a): return 1.0 / (1.0 + np.exp(-a)) def pass_gradients(self, out_tensor, in_tensor): assert not out_tensor.get_gradients() is None out_tensor_grad = out_tensor.get_gradients() in_tensor.set_gradients(out_tensor_grad * out_tensor.data * (1.0 - out_tensor.data)) class Matmul(): def __init__(self): pass def run(self, a, b): return np.dot(a, b) def pass_gradients(self, out_tensor, in_tensor_1, in_tensor_2): assert not out_tensor.get_gradients() is None out_tensor_grad = out_tensor.get_gradients() in_tensor_1.set_gradients(np.dot(out_tensor_grad, in_tensor_2.data.T)) in_tensor_2.set_gradients(np.dot(in_tensor_1.data.T, out_tensor_grad)) class Sum(): def __init__(self): pass def run(self, a): return np.sum(a) def pass_gradients(self, out_tensor, in_tensor): assert not out_tensor.get_gradients() is None out_tensor_grad = out_tensor.get_gradients() assert is_scalar(out_tensor_grad) in_tensor.set_gradients(np.full(in_tensor.data.shape, out_tensor_grad))
23.702128
86
0.746858
192
1,114
3.96875
0.203125
0.224409
0.136483
0.165354
0.646982
0.562992
0.562992
0.562992
0.480315
0.396325
0
0.0125
0.138241
1,114
46
87
24.217391
0.78125
0
0
0.516129
0
0
0
0
0
0
0
0
0.129032
1
0.290323
false
0.193548
0.064516
0.096774
0.548387
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
1
0
0
1
0
0
5
5fa772cde42df4098aeed7b4fdddbef33fc68209
228
py
Python
ed_bgs/__init__.py
Athanasius/edbgs-mgr
1bb5d34730c15ea486c68d82ff8dac8620da2a68
[ "CC-BY-4.0" ]
1
2022-02-09T07:12:50.000Z
2022-02-09T07:12:50.000Z
ed_bgs/__init__.py
Athanasius/edbgs-mgr
1bb5d34730c15ea486c68d82ff8dac8620da2a68
[ "CC-BY-4.0" ]
null
null
null
ed_bgs/__init__.py
Athanasius/edbgs-mgr
1bb5d34730c15ea486c68d82ff8dac8620da2a68
[ "CC-BY-4.0" ]
null
null
null
"""Top level Elite BGS module.""" from ed_bgs.bgs import BGS # noqa: F401 from ed_bgs.database import Database # noqa: F401 from ed_bgs.elitebgs_app import EliteBGS # noqa: F401 from ed_bgs.spansh import Spansh # noqa: F401
38
54
0.754386
38
228
4.394737
0.368421
0.143713
0.215569
0.251497
0.305389
0
0
0
0
0
0
0.062827
0.162281
228
5
55
45.6
0.811518
0.315789
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
39e7db11efdd21286d5953d6fe5b4a069db9fc5c
26
py
Python
tests/syntax/def_dotted_argument.py
matan-h/friendly
3ab0fc6541c837271e8865e247750007acdd18fb
[ "MIT" ]
287
2019-04-08T13:18:29.000Z
2021-03-14T19:10:21.000Z
tests/syntax/def_dotted_argument.py
matan-h/friendly
3ab0fc6541c837271e8865e247750007acdd18fb
[ "MIT" ]
191
2019-04-08T14:39:18.000Z
2021-03-14T22:14:56.000Z
tests/syntax/def_dotted_argument.py
matan-h/friendly
3ab0fc6541c837271e8865e247750007acdd18fb
[ "MIT" ]
9
2019-04-08T12:54:08.000Z
2020-11-20T02:26:27.000Z
def test(x.y): pass
5.2
14
0.5
5
26
2.6
1
0
0
0
0
0
0
0
0
0
0
0
0.346154
26
4
15
6.5
0.764706
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0.5
0
null
null
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
1
0
0
1
0
0
0
0
0
5
f2cd7d9f2204ad15b6b5e1ab570257f8e1cd447b
18
py
Python
python/file-tests/localMod.py
CodeSteak/write-your-python-program
13a10f1e8f4fe23c66a8762854c8bb12f0fb9ff4
[ "BSD-3-Clause" ]
1
2021-09-30T10:17:57.000Z
2021-09-30T10:17:57.000Z
python/file-tests/localMod.py
CodeSteak/write-your-python-program
13a10f1e8f4fe23c66a8762854c8bb12f0fb9ff4
[ "BSD-3-Clause" ]
47
2020-11-16T14:02:52.000Z
2022-03-18T12:44:38.000Z
python/file-tests/localMod.py
CodeSteak/write-your-python-program
13a10f1e8f4fe23c66a8762854c8bb12f0fb9ff4
[ "BSD-3-Clause" ]
4
2020-10-28T13:54:44.000Z
2022-01-20T17:36:24.000Z
print('localMod')
9
17
0.722222
2
18
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.055556
18
1
18
18
0.764706
0
0
0
0
0
0.444444
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
f2d76a9a58d8b637f3658ae606b842419d8434cc
28
py
Python
terrascript/external/r.py
hugovk/python-terrascript
08fe185904a70246822f5cfbdc9e64e9769ec494
[ "BSD-2-Clause" ]
4
2022-02-07T21:08:14.000Z
2022-03-03T04:41:28.000Z
terrascript/external/r.py
hugovk/python-terrascript
08fe185904a70246822f5cfbdc9e64e9769ec494
[ "BSD-2-Clause" ]
null
null
null
terrascript/external/r.py
hugovk/python-terrascript
08fe185904a70246822f5cfbdc9e64e9769ec494
[ "BSD-2-Clause" ]
2
2022-02-06T01:49:42.000Z
2022-02-08T14:15:00.000Z
# terrascript/external/r.py
14
27
0.785714
4
28
5.5
1
0
0
0
0
0
0
0
0
0
0
0
0.071429
28
1
28
28
0.846154
0.892857
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
8432abd50f742a113b63d6c7c69e08f618f3e3b5
26
py
Python
mongos/datumsets/__init__.py
s-geronimoanderson/compat-id
3ae52dd3d3e92285de425304ccde02f87d2ae880
[ "Apache-2.0" ]
null
null
null
mongos/datumsets/__init__.py
s-geronimoanderson/compat-id
3ae52dd3d3e92285de425304ccde02f87d2ae880
[ "Apache-2.0" ]
null
null
null
mongos/datumsets/__init__.py
s-geronimoanderson/compat-id
3ae52dd3d3e92285de425304ccde02f87d2ae880
[ "Apache-2.0" ]
null
null
null
from . import fashion_acg
13
25
0.807692
4
26
5
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
26
1
26
26
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
845b395428a8c870b6976b0e91737985fd9f66df
664
py
Python
trainer/base.py
DSciLab/TDDA
193e5dc26c5c0b291c6323e2607a6eb77b2e067e
[ "MIT" ]
null
null
null
trainer/base.py
DSciLab/TDDA
193e5dc26c5c0b291c6323e2607a6eb77b2e067e
[ "MIT" ]
null
null
null
trainer/base.py
DSciLab/TDDA
193e5dc26c5c0b291c6323e2607a6eb77b2e067e
[ "MIT" ]
null
null
null
from mlutils import Trainer class BaseTrainer(Trainer): def __init__(self, opt): super().__init__(opt) def train_step(self, item): # return loss, preds, labels, .... raise NotImplementedError def eval_step(self, item): # return loss, preds, labels, .... raise NotImplementedError def inference(self, image): raise NotImplementedError def on_epoch_begin(self): raise NotImplementedError def on_epoch_end(self): raise NotImplementedError def on_training_begin(self): raise NotImplementedError def on_training_end(self): raise NotImplementedError
22.896552
42
0.661145
70
664
6.014286
0.4
0.39905
0.384798
0.275534
0.674584
0.581948
0.285036
0.285036
0.285036
0.285036
0
0
0.260542
664
29
43
22.896552
0.857434
0.097892
0
0.388889
0
0
0
0
0
0
0
0
0
1
0.444444
false
0
0.055556
0
0.555556
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
ffbed26cc63863ee3a192bc659763f9b541c38fb
226
py
Python
code/class4/patterns_find_smallest.py
jeremypedersen/pythonBootcamp
5d9a3219911cdd2d733b143d4b5b0fa857cf9b29
[ "CC-BY-4.0" ]
null
null
null
code/class4/patterns_find_smallest.py
jeremypedersen/pythonBootcamp
5d9a3219911cdd2d733b143d4b5b0fa857cf9b29
[ "CC-BY-4.0" ]
null
null
null
code/class4/patterns_find_smallest.py
jeremypedersen/pythonBootcamp
5d9a3219911cdd2d733b143d4b5b0fa857cf9b29
[ "CC-BY-4.0" ]
null
null
null
smallest_so_far = -1 print('Before', smallest_so_far) for the_num in [9, 41, 12, 3, 74, 15]: if the_num < smallest_so_far: smallest_so_far = the_num print(smallest_so_far, the_num) print('After', smallest_so_far)
25.111111
38
0.716814
41
226
3.560976
0.439024
0.410959
0.534247
0.219178
0.328767
0.328767
0
0
0
0
0
0.058511
0.168142
226
8
39
28.25
0.718085
0
0
0
0
0
0.048673
0
0
0
0
0
0
1
0
false
0
0
0
0
0.428571
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
ffcd4d44ab923d9d1cae65553997b8999507d78d
27
py
Python
dbbact_server/__init__.py
amnona/dbBact
4cae61c26352a7f2d032ef74aee860c66583c616
[ "MIT" ]
null
null
null
dbbact_server/__init__.py
amnona/dbBact
4cae61c26352a7f2d032ef74aee860c66583c616
[ "MIT" ]
3
2021-02-14T11:55:51.000Z
2022-01-21T09:52:32.000Z
dbbact_server/__init__.py
amnona/dbbact-server
54dc776444b061373d928aab63c4284d8837671a
[ "MIT" ]
null
null
null
__version__ = '2020.02.06'
13.5
26
0.703704
4
27
3.75
1
0
0
0
0
0
0
0
0
0
0
0.333333
0.111111
27
1
27
27
0.291667
0
0
0
0
0
0.37037
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
ffe550cb1e34c982e4d54dba0d28b2f2ff3177ab
121
py
Python
src/test/resources/sikuli-images/win-10-calculator.sikuli/win-10-calculator.py
marcoslimaqa/sikulifactory
7a2be779f8b3148547c33bb534d56adef1a64e1a
[ "MIT" ]
11
2017-09-04T09:58:28.000Z
2021-12-08T13:30:14.000Z
src/test/resources/sikuli-images/win-10-calculator.sikuli/win-10-calculator.py
marcoslimaqa/sikulifactory
7a2be779f8b3148547c33bb534d56adef1a64e1a
[ "MIT" ]
null
null
null
src/test/resources/sikuli-images/win-10-calculator.sikuli/win-10-calculator.py
marcoslimaqa/sikulifactory
7a2be779f8b3148547c33bb534d56adef1a64e1a
[ "MIT" ]
5
2019-07-10T02:33:03.000Z
2020-12-04T05:19:59.000Z
"menu.png" "scientific.png" "sin-button.png" "sin-button-large.png" "cos-button.png" "cos-button-large.png" "number7.png"
17.285714
22
0.727273
20
121
4.4
0.4
0.136364
0.272727
0
0
0
0
0
0
0
0
0.008696
0.049587
121
7
23
17.285714
0.756522
0.066116
0
0
0
0
0.827869
0
0
0
0
0
0
1
0
true
0
0
0
0
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
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
0849c10814dce2b5e7c85252a80c68f6439655a2
41
py
Python
Python/bazinga.py
siansiansu/Bazinga
01591f08ad09d5f27c00f066bf296c956c28360e
[ "MIT" ]
null
null
null
Python/bazinga.py
siansiansu/Bazinga
01591f08ad09d5f27c00f066bf296c956c28360e
[ "MIT" ]
null
null
null
Python/bazinga.py
siansiansu/Bazinga
01591f08ad09d5f27c00f066bf296c956c28360e
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 print("Bazinga!")
13.666667
22
0.682927
6
41
4.666667
1
0
0
0
0
0
0
0
0
0
0
0.026316
0.073171
41
2
23
20.5
0.710526
0.512195
0
0
0
0
0.421053
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
f23a87ead4f9504bcf5271cac7c92cf0697c343c
52
py
Python
rlutils/tf/future/__init__.py
vermouth1992/rl-util
4c06ab8f5c96a44e58f88cf30146bcb837057112
[ "Apache-2.0" ]
null
null
null
rlutils/tf/future/__init__.py
vermouth1992/rl-util
4c06ab8f5c96a44e58f88cf30146bcb837057112
[ "Apache-2.0" ]
null
null
null
rlutils/tf/future/__init__.py
vermouth1992/rl-util
4c06ab8f5c96a44e58f88cf30146bcb837057112
[ "Apache-2.0" ]
null
null
null
from .optimizer import get_adam_optimizer, minimize
26
51
0.865385
7
52
6.142857
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.096154
52
1
52
52
0.914894
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
f24a48dcf5ce45029877bbadffaa7f2ea70cdfef
117
py
Python
the_bored_qa/__init__.py
qxf2/the-bored-qa
9377874c91af1cf46d9b84bdb44a7864a9b38206
[ "MIT" ]
2
2020-03-03T04:28:16.000Z
2021-07-02T06:31:30.000Z
the_bored_qa/__init__.py
qxf2/the-bored-qa
9377874c91af1cf46d9b84bdb44a7864a9b38206
[ "MIT" ]
null
null
null
the_bored_qa/__init__.py
qxf2/the-bored-qa
9377874c91af1cf46d9b84bdb44a7864a9b38206
[ "MIT" ]
4
2020-03-06T07:46:53.000Z
2021-07-02T06:31:32.000Z
""" The bored QA app starts here! """ from flask import Flask app = Flask(__name__) from the_bored_qa import views
13
30
0.735043
19
117
4.210526
0.578947
0.2
0.25
0
0
0
0
0
0
0
0
0
0.179487
117
8
31
14.625
0.833333
0.247863
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
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
0
0
1
0
1
0
0
5
f286b5f16ebff4ad214164d00a5d5bbe9ae0f1c3
304
py
Python
credentials.py
KanayBhandari/discord_bot_project
4baa62c963c532b08060689bed872e36e72460f9
[ "MIT" ]
null
null
null
credentials.py
KanayBhandari/discord_bot_project
4baa62c963c532b08060689bed872e36e72460f9
[ "MIT" ]
null
null
null
credentials.py
KanayBhandari/discord_bot_project
4baa62c963c532b08060689bed872e36e72460f9
[ "MIT" ]
null
null
null
sender_email = "" password = "" # Cypher CONSUMER_KEY = 'z8ZgAt3HrHFI9uBe60CIvUqO6' CONSUMER_SECRET = 'Gj8cJPT6pzUO59qJAUMHaD8AKw9SDOZYyn9IC7FdZKCTsbsqM6' ACCESS_TOKEN = '1238387229430394882-3o9CxExjzdFGaI6XjDSFsv3MGhut0M' ACCESS_TOKEN_SECRET = 'E6x16DU5SC4Fi87dQagoHrEYg9h4cN2eF5tBhMDC5uwDa'
30.4
71
0.832237
18
304
13.722222
0.777778
0.089069
0
0
0
0
0
0
0
0
0
0.186813
0.101974
304
9
72
33.777778
0.717949
0.019737
0
0
0
0
0.592334
0.592334
0
0
0
0
0
1
0
false
0.166667
0
0
0
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
f29bd3c6e677fa64dcdf1dd8716b99102f777328
87
py
Python
tests/markers.py
Sathishzus/covid-telebot
0265b2a19a0af7e10baa2ec3ba8b2f726620cec2
[ "MIT" ]
3
2020-06-23T21:24:20.000Z
2020-09-03T02:09:31.000Z
tests/markers.py
Sathishzus/covid-telebot
0265b2a19a0af7e10baa2ec3ba8b2f726620cec2
[ "MIT" ]
18
2020-04-26T09:55:14.000Z
2022-01-19T10:05:00.000Z
tests/markers.py
Sathishzus/covid-telebot
0265b2a19a0af7e10baa2ec3ba8b2f726620cec2
[ "MIT" ]
1
2020-12-17T10:06:37.000Z
2020-12-17T10:06:37.000Z
import _pytest.mark import pytest unit: _pytest.mark.MarkDecorator = pytest.mark.unit
17.4
51
0.816092
12
87
5.75
0.416667
0.434783
0
0
0
0
0
0
0
0
0
0
0.103448
87
4
52
21.75
0.884615
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
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f29e5db01e524cb39d260f9879e7735cbf057ff3
250
py
Python
nba_kmeans/data_scrap.py
DAndresSanchez/NBA_KMeans
5c99fbadc9e548906fd61b6e2a2c6c67ea8c5d9f
[ "MIT" ]
1
2020-09-30T15:36:30.000Z
2020-09-30T15:36:30.000Z
nba_kmeans/data_scrap.py
DAndresSanchez/NBA_KMeans
5c99fbadc9e548906fd61b6e2a2c6c67ea8c5d9f
[ "MIT" ]
2
2021-06-08T21:38:09.000Z
2021-09-08T02:04:25.000Z
nba_kmeans/data_scrap.py
DAndresSanchez/NBA_KMeans
5c99fbadc9e548906fd61b6e2a2c6c67ea8c5d9f
[ "MIT" ]
1
2020-05-24T13:52:53.000Z
2020-05-24T13:52:53.000Z
from nba_kmeans.stats_season import stats_season from nba_kmeans.stats_season_adv import stats_season_adv stats_bas = stats_season(2019) stats_bas.to_csv('data/stats_bas.csv') stats_adv = stats_season_adv(2019) stats_adv.to_csv('data/stats_adv.csv')
35.714286
56
0.848
45
250
4.288889
0.266667
0.341969
0.217617
0.186529
0.248705
0
0
0
0
0
0
0.034188
0.064
250
7
57
35.714286
0.790598
0
0
0
0
0
0.143426
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
4b3d959cda51171430bc7f5a48deb590e94d82d5
331
py
Python
udemy/01_walkthrough/indentation.py
inderpal2406/python
7bd7d03a6b3cd09ff16a4447ff495a2393a87a33
[ "MIT" ]
null
null
null
udemy/01_walkthrough/indentation.py
inderpal2406/python
7bd7d03a6b3cd09ff16a4447ff495a2393a87a33
[ "MIT" ]
null
null
null
udemy/01_walkthrough/indentation.py
inderpal2406/python
7bd7d03a6b3cd09ff16a4447ff495a2393a87a33
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 print("This script is to demonstrate usage of indentation in python.") print("Indentation is used to represent different blocks of code.") if 5 < 3: print("This statement is from within if block.") print("This statement is also from within if block.") print("This statement is outside if block.")
30.090909
70
0.731118
52
331
4.653846
0.557692
0.14876
0.223141
0.247934
0.305785
0.305785
0.305785
0.305785
0
0
0
0.010949
0.172205
331
10
71
33.1
0.872263
0.063444
0
0
0
0
0.76699
0
0
0
0
0
0
1
0
true
0
0
0
0
0.833333
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
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
4b6602e4eea75c30903657c4881827c9682cb445
5,023
py
Python
conekt/controllers/ecc.py
legumeinfo/CoNekT
709a4980cfa255cafd456b268e274db2b4b1f5fb
[ "MIT" ]
14
2018-08-20T03:07:21.000Z
2021-11-04T11:15:31.000Z
conekt/controllers/ecc.py
mutwil/CoNekT
f4a4496a87d14b15bcf587975b31a2edc24c6bf7
[ "MIT" ]
9
2018-07-17T15:30:47.000Z
2021-07-05T13:11:54.000Z
conekt/controllers/ecc.py
mutwil/CoNekT
f4a4496a87d14b15bcf587975b31a2edc24c6bf7
[ "MIT" ]
3
2019-08-05T09:16:34.000Z
2019-12-04T23:59:28.000Z
from flask import Blueprint, redirect, url_for, render_template from sqlalchemy import and_ from conekt.models.sequences import Sequence from conekt.models.relationships.sequence_sequence_ecc import SequenceSequenceECCAssociation from conekt.helpers.cytoscape import CytoscapeHelper import json ecc = Blueprint('ecc', __name__) @ecc.route('/') def ecc_overview(): """ For lack of a better alternative redirect users to the main page """ return redirect(url_for('main.screen')) @ecc.route('/graph/<int:sequence>/<int:network>/<int:family>') def ecc_graph(sequence, network, family): """ Returns a page rendering the ECC graph for a specific sequence :param sequence: Internal ID of a sequence :param network: Internal ID of the network method :param family: Internal ID of the family method :return: Response with html page that shows the ECC network """ sequence = Sequence.query.get_or_404(sequence) return render_template("expression_graph.html", sequence=sequence, network_method_id=network, family_method_id=family) @ecc.route('/graph_multi/') def ecc_graph_multi(): """ Returns a page rendering the ECC graph for a specific pair of sequences :param ecc_id: internal ID of the sequence to sequence ECC relationship :return: Response with html page that shows the pairwise ECC network """ return render_template("expression_graph.html", ecc_multi=True) @ecc.route('/graph_pair/<int:ecc_id>') def ecc_graph_pair(ecc_id): """ Returns a page rendering the ECC graph for a specific pair of sequences :param ecc_id: internal ID of the sequence to sequence ECC relationship :return: Response with html page that shows the pairwise ECC network """ ecc_pair = SequenceSequenceECCAssociation.query.get_or_404(ecc_id) return render_template("expression_graph.html", ecc_pair=ecc_pair) @ecc.route('/json/<int:sequence>/<int:network>/<int:family>') def ecc_graph_json(sequence, network, family): """ Returns a JSON object compatible with cytoscape.js that contains the ECC graph for a specific sequence :param sequence: Internal ID of a sequence :param network: Internal ID of the network method :param family: Internal ID of the family method :return: JSON object compatible with cytoscape.js """ network = SequenceSequenceECCAssociation.get_ecc_network(sequence, network, family) network_cytoscape = CytoscapeHelper.parse_network(network) network_cytoscape = CytoscapeHelper.add_descriptions_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.add_family_data_nodes(network_cytoscape, family) network_cytoscape = CytoscapeHelper.add_lc_data_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.add_species_data_nodes(network_cytoscape) return json.dumps(network_cytoscape) @ecc.route('/pair_json/<int:ecc_id>') def ecc_graph_pair_json(ecc_id): """ Returns a JSON object compatible with cytoscape.js that contains the ECC graph for a specific pair of sequences :param ecc_id: internal ID of the sequence to sequence ECC relationship :return: JSON object compatible with cytoscape.js """ network, family = SequenceSequenceECCAssociation.get_ecc_pair_network(ecc_id) network_cytoscape = CytoscapeHelper.parse_network(network) network_cytoscape = CytoscapeHelper.add_descriptions_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.add_family_data_nodes(network_cytoscape, family) network_cytoscape = CytoscapeHelper.add_lc_data_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.add_species_data_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.connect_homologs(network_cytoscape) network_cytoscape = CytoscapeHelper.tag_ecc_singles(network_cytoscape) return json.dumps(network_cytoscape) @ecc.route('/multi_json/') def ecc_graph_multi_json(): """ Returns a JSON object compatible with cytoscape.js that contains the ECC graph for a specific pair of sequences :param ecc_id: internal ID of the sequence to sequence ECC relationship :return: JSON object compatible with cytoscape.js """ network, family = SequenceSequenceECCAssociation.get_ecc_multi_network(1, [162930, 56261, 203621, 94050]) network_cytoscape = CytoscapeHelper.parse_network(network) network_cytoscape = CytoscapeHelper.add_descriptions_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.add_family_data_nodes(network_cytoscape, family) network_cytoscape = CytoscapeHelper.add_lc_data_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.add_species_data_nodes(network_cytoscape) network_cytoscape = CytoscapeHelper.connect_homologs(network_cytoscape) network_cytoscape = CytoscapeHelper.tag_ecc_singles(network_cytoscape) return json.dumps(network_cytoscape)
39.242188
115
0.759705
628
5,023
5.847134
0.13535
0.165577
0.160403
0.111111
0.780773
0.769336
0.758715
0.723312
0.703159
0.668028
0
0.006951
0.169421
5,023
127
116
39.551181
0.873202
0.303006
0
0.438596
0
0
0.073551
0.061543
0
0
0
0
0
1
0.122807
false
0
0.105263
0
0.350877
0.035088
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
4b7e693da8ac17495c33dbb0f19a9d5c29261eca
75,504
py
Python
geosoft/gxapi/GXEDB.py
fearaschiarrai/gxpy
4c5e7594b24e530a8cd94df1eef562c5c6ce3e92
[ "BSD-2-Clause" ]
25
2017-07-14T06:39:37.000Z
2022-03-09T21:39:51.000Z
geosoft/gxapi/GXEDB.py
fearaschiarrai/gxpy
4c5e7594b24e530a8cd94df1eef562c5c6ce3e92
[ "BSD-2-Clause" ]
100
2016-12-13T17:30:41.000Z
2021-08-01T20:21:13.000Z
geosoft/gxapi/GXEDB.py
fearaschiarrai/gxpy
4c5e7594b24e530a8cd94df1eef562c5c6ce3e92
[ "BSD-2-Clause" ]
28
2016-12-12T17:34:40.000Z
2022-03-16T15:39:39.000Z
### extends 'class_empty.py' ### block ClassImports # NOTICE: Do not edit anything here, it is generated code from . import gxapi_cy from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref from .GXDB import GXDB ### endblock ClassImports ### block Header # NOTICE: The code generator will not replace the code in this block ### endblock Header ### block ClassImplementation # NOTICE: Do not edit anything here, it is generated code class GXEDB(gxapi_cy.WrapEDB): """ GXEDB class. The `GXEDB <geosoft.gxapi.GXEDB>` class provides access to a database as displayed within Oasis montaj, but does not change data within the database itself. It performs functions such as setting the current line. **Note:** To obtain access to the database itself, it is recommended practice to begin with an `GXEDB <geosoft.gxapi.GXEDB>` object, and use the `lock <geosoft.gxapi.GXEDB.lock>` function to lock the underlying map to prevent external changes. The returned `GXDB <geosoft.gxapi.GXDB>` object (see `GXDB <geosoft.gxapi.GXDB>`) may then be safely used to make changes to the map itself. """ def __init__(self, handle=0): super(GXEDB, self).__init__(GXContext._get_tls_geo(), handle) @classmethod def null(cls): """ A null (undefined) instance of `GXEDB <geosoft.gxapi.GXEDB>` :returns: A null `GXEDB <geosoft.gxapi.GXEDB>` :rtype: GXEDB """ return GXEDB() def is_null(self): """ Check if this is a null (undefined) instance :returns: True if this is a null (undefined) instance, False otherwise. :rtype: bool """ return self._internal_handle() == 0 # Miscellaneous def apply_formula_internal(self, formula): """ Apply a formula to selected cells of the current line. (Do not use this wrapper if you want to apply a formula across multiple lines) Notes: The current selection must be on cell(s) of a channel or on the a channel header. If the selection is on cell(s) of a channel, the formula is applied to only these cells. If the selection is on a channel header, the formula is applied to every cell in the channel. The given formula string must be of the form: "<NameOfCurrentChannel>=<SomeExpression>;" e.g. "x=y+1;" :param formula: Formula ("<NameOfCurrentChannel>=<SomeExpression>;") :type formula: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._apply_formula_internal(formula.encode()) @classmethod def current(cls): """ This method returns the Current Edited Database. :returns: `GXEDB <geosoft.gxapi.GXEDB>` Object :rtype: GXEDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = gxapi_cy.WrapEDB._current(GXContext._get_tls_geo()) return GXEDB(ret_val) @classmethod def current_no_activate(cls): """ This method returns the Current Edited Database. :returns: `GXEDB <geosoft.gxapi.GXEDB>` Object :rtype: GXEDB .. versionadded:: 9.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** This function acts just like `current <geosoft.gxapi.GXEDB.current>` except that the document is not activated (brought to foreground) and no guarantee is given about which document is currently active. """ ret_val = gxapi_cy.WrapEDB._current_no_activate(GXContext._get_tls_geo()) return GXEDB(ret_val) @classmethod def current_if_exists(cls): """ This method returns the Current Edited Database. :returns: `GXEDB <geosoft.gxapi.GXEDB>` Object to current edited database. If there is no current database, the user is not prompted for a database, and 0 is returned. :rtype: GXEDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = gxapi_cy.WrapEDB._current_if_exists(GXContext._get_tls_geo()) return GXEDB(ret_val) def del_line0(self): """ Delete Line 0. .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Deletes an empty line 0 from the database. """ self._del_line0() def destroy_view(self, unload_flag): """ Removes the view from the workspace. :param unload_flag: :ref:`EDB_REMOVE` :type unload_flag: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Can only be run in interactive mode. After this call the `GXEDB <geosoft.gxapi.GXEDB>` object will become invalid. If this is the last view on the document and the document has been modified the map will be unloaded and optionally saved depending on the :ref:`EDB_REMOVE` parameter. """ self._destroy_view(unload_flag) def get_cur_chan_symb(self): """ Returns the currently marked channel symbol. :returns: Currently channel symbol. `NULLSYMB <geosoft.gxapi.NULLSYMB>` if the mark is not in a channel. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_cur_chan_symb() return ret_val def get_cur_line_symb(self): """ Get current line symbol. :returns: Currently displayed line symbol. `NULLSYMB <geosoft.gxapi.NULLSYMB>` if no line displayed. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_cur_line_symb() return ret_val def get_displ_fid_range(self, start, num): """ Return the displayed fiducial start index & number of cells :param start: Fiducial start :param num: Number of fiducials :type start: int_ref :type num: int_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ start.value, num.value = self._get_displ_fid_range(start.value, num.value) def get_cur_point(self, x, y, z): """ Returns the coordinates of the currently selected point in the database (first value if range selected) :param x: X coordinate (dummy if no selection or if no X channel defined) :param y: Y coordinate (dummy if no selection or if no Y channel defined) :param z: Z coordinate (dummy if no selection or if no Z channel defined) :type x: float_ref :type y: float_ref :type z: float_ref .. versionadded:: 9.2 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ x.value, y.value, z.value = self._get_cur_point(x.value, y.value, z.value) def get_fid_range(self, start, incr, num): """ Returns currently displayed fid range :param start: Fiducial start :param incr: Fiducial increment :param num: Number of fiducials :type start: float_ref :type incr: float_ref :type num: int_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ start.value, incr.value, num.value = self._get_fid_range(start.value, incr.value, num.value) def get_next_line_symb(self): """ Returns the next line symbol. :returns: The next line symbol of currently displayed line. `NULLSYMB <geosoft.gxapi.NULLSYMB>` if no line displayed. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_next_line_symb() return ret_val def get_prev_line_symb(self): """ Returns the previous line symbol. :returns: The previous line symbol of currently displayed line. `NULLSYMB <geosoft.gxapi.NULLSYMB>` if no line displayed. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_prev_line_symb() return ret_val def get_profile_x_axis_options(self, rescale_x, lines, interval): """ Get profile X-axis options :param rescale_x: Auto rescale X-axis :param lines: render vertical grid lines :param interval: vertical lines interval :type rescale_x: bool_ref :type lines: bool_ref :type interval: float_ref .. versionadded:: 9.5.1 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ rescale_x.value, lines.value, interval.value = self._get_profile_x_axis_options(rescale_x.value, lines.value, interval.value) def set_profile_x_axis_options(self, rescale_x, lines, interval): """ Set profile X-axis options :param rescale_x: Auto rescale X-axis :param lines: render vertical grid lines :param interval: vertical lines interval :type rescale_x: bool :type lines: bool :type interval: float .. versionadded:: 9.5.1 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_profile_x_axis_options(rescale_x, lines, interval) def get_profile_range_x(self, min_x, max_x, ph_chan_x): """ Get profile X range and X channel :param min_x: Minimum x :param max_x: Maximum x :param ph_chan_x: X axis channel, `NULLSYMB <geosoft.gxapi.NULLSYMB>` if none :type min_x: float_ref :type max_x: float_ref :type ph_chan_x: int_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ min_x.value, max_x.value, ph_chan_x.value = self._get_profile_range_x(min_x.value, max_x.value, ph_chan_x.value) def get_profile_range_y(self, window, prof, min_y, max_y, scl): """ Get profile Y range and display option :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param prof: Profile number in window (see `window_profiles <geosoft.gxapi.GXEDB.window_profiles>` which returns number of profiles in a window) :param min_y: Minimum y :param max_y: Maximum y :param scl: :ref:`EDB_PROFILE_SCALE` :type window: int :type prof: int :type min_y: float_ref :type max_y: float_ref :type scl: int_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ min_y.value, max_y.value, scl.value = self._get_profile_range_y(window, prof, min_y.value, max_y.value, scl.value) def get_profile_split(self, d1, d2): """ Get profile split for 3 windows. :param d1: Split d1 (profile window 0 height / entire profile window height) :param d2: Split d2 (profile window 1 height / entire profile window height) :type d1: float_ref :type d2: float_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ d1.value, d2.value = self._get_profile_split(d1.value, d2.value) def get_profile_split5(self, d1, d2, d3, d4): """ Get profile split for 5 windows. :param d1: Split d1 (profile window 0 height / entire profile window height) :param d2: Split d2 (profile window 1 height / entire profile window height) :param d3: Split d3 (profile window 2 height / entire profile window height) :param d4: Split d4 (profile window 3 height / entire profile window height) :type d1: float_ref :type d2: float_ref :type d3: float_ref :type d4: float_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ d1.value, d2.value, d3.value, d4.value = self._get_profile_split5(d1.value, d2.value, d3.value, d4.value) def get_profile_split_vv(self, vv): """ Get profile window splits. :param vv: Split `GXVV <geosoft.gxapi.GXVV>` (REAL) (profile window heights / entire profile window height) :type vv: GXVV .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The returned `GXVV <geosoft.gxapi.GXVV>` is sized to the maximum number of profiles that can be displayed. If a profile is not currently displayed, its height fraction is 0. The sum of all the fractions returned is equal to 1. The profile splits refers to the relative sizes of the individual profile windows. To get/set the fraction of the total database window devoted to the profiles, use the `set_split <geosoft.gxapi.GXEDB.set_split>` and `get_split <geosoft.gxapi.GXEDB.get_split>` functions. """ self._get_profile_split_vv(vv) def get_profile_vertical_grid_lines(self, grid, interval): """ Get profile grid vertical line info. :param grid: Vertical grid lines? :param interval: Vertical grid interval :type grid: int_ref :type interval: float_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ grid.value, interval.value = self._get_profile_vertical_grid_lines(grid.value, interval.value) def get_profile_window(self, window, x, y): """ Get profile window size :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param x: Window x size in pixels :param y: Window y size in pixels :type window: int :type x: int_ref :type y: int_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ x.value, y.value = self._get_profile_window(window, x.value, y.value) def goto_column(self, col): """ Move the channel marker to a specific column. :param col: Channel column number, 0 is first -1 for first column without data :type col: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._goto_column(col) def goto_elem(self, elem): """ Goto an element in the current line. :param elem: Element number :type elem: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._goto_elem(elem) def goto_line(self, line_symb): """ Goto to a line symbol in the editor. :param line_symb: Line symbol to goto to :type line_symb: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._goto_line(line_symb) def histogram(self, st, min, incr, count): """ Create histogram stats. :param st: `GXST <geosoft.gxapi.GXST>` handle to update :param min: Histogram minimum :param incr: Histogram increment :param count: Number of increments :type st: GXST :type min: float :type incr: float :type count: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._histogram(st, min, incr, count) def all_chan_list(self, vv): """ Get a list of the all channels but in the way they are displayed. :param vv: `GXVV <geosoft.gxapi.GXVV>` (INT) in which to place the list. :type vv: GXVV :returns: Number of symbols in the list. Terminates GX if there was an error. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The `GXVV <geosoft.gxapi.GXVV>` elements must be INT. Displayed channel lists are filled in the order the channels appear on the display, left to right. .. seealso:: `disp_chan_list <geosoft.gxapi.GXEDB.disp_chan_list>` """ ret_val = self._all_chan_list(vv) return ret_val def channels(self): """ Returns number of displayed channels :returns: x - number of displayed channels :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._channels() return ret_val def disp_chan_list(self, vv): """ Get a list of the displayed channel symbols. :param vv: `GXVV <geosoft.gxapi.GXVV>` (INT) in which to place the list. :type vv: GXVV :returns: Number of symbols in the list. Terminates GX if there was an error. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The `GXVV <geosoft.gxapi.GXVV>` elements must be INT. Displayed channel lists are filled in the order the channels appear on the display, left to right. .. seealso:: `disp_chan_lst <geosoft.gxapi.GXEDB.disp_chan_lst>` """ ret_val = self._disp_chan_list(vv) return ret_val def disp_chan_lst(self, lst): """ Get a list of the displayed channel names. :param lst: `GXLST <geosoft.gxapi.GXLST>` object :type lst: GXLST :returns: Number of channels in the list. Terminates GX if there was an error. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Displayed channel lists are filled in the order the channels appear on the display, left to right. The channel names will be placed in the "Name" part of the list and the values are set to the symbol handle. .. seealso:: `disp_chan_list <geosoft.gxapi.GXEDB.disp_chan_list>` """ ret_val = self._disp_chan_lst(lst) return ret_val def disp_class_chan_lst(self, lst, class_name): """ Get a list of the displayed channels in a given channel class. :param lst: `GXLST <geosoft.gxapi.GXLST>` object :param class_name: Class name ("" for all) :type lst: GXLST :type class_name: str :returns: Number of channels in the list. Terminates GX if there was an error. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Displayed channel lists are filled in the order the channels appear on the display, left to right. The channel names will be placed in the "Name" part of the list and the values are set to the symbol handle. Examples of channel classes in current use are "MASK" and "ASSAY". (Searches are case tolerant). .. seealso:: `disp_chan_list <geosoft.gxapi.GXEDB.disp_chan_list>` """ ret_val = self._disp_class_chan_lst(lst, class_name.encode()) return ret_val def find_channel_column(self, chan): """ Find the column that contains a channel :param chan: Channel :type chan: str :returns: Column number that contains a specific channel `iDUMMY <geosoft.gxapi.iDUMMY>` of channel not loaded :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._find_channel_column(chan.encode()) return ret_val def find_nearest(self, x, y, z, ipj): """ Find the nearest point on the current line based on X,Y and Z and their projection. :param x: X - Modified with true point :param y: Y - Modified with true point :param z: Z - Modified with true point :param ipj: Projection of X,Y,Z :type x: float_ref :type y: float_ref :type z: float_ref :type ipj: GXIPJ :returns: x - Nearest point -1 - Not available :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val, x.value, y.value, z.value = self._find_nearest(x.value, y.value, z.value, ipj) return ret_val def get_cur_chan(self, str_val): """ Get current channel name. :param str_val: Where to put the name :type str_val: str_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Returns "" if mark not currently in a channel. """ str_val.value = self._get_cur_chan(str_val.value.encode()) def get_cur_fid_string(self, val): """ This method returns the currently selected value at the current fid (if available). :param val: String returned here :type val: str_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ val.value = self._get_cur_fid_string(val.value.encode()) def get_cur_line(self, str_val): """ Get current line name. :param str_val: Where to put the name :type str_val: str_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ str_val.value = self._get_cur_line(str_val.value.encode()) def get_cur_mark(self, start, end, inc): """ Returns the current data mark info. :param start: Start fiducial :param end: End fiducial :param inc: Fiducial increment :type start: float_ref :type end: float_ref :type inc: float_ref :returns: 0 - if data is marked. 1 - if data is not currently marked. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val, start.value, end.value, inc.value = self._get_cur_mark(start.value, end.value, inc.value) return ret_val def get_current_selection(self, db, chan, line, fid): """ Get current selection information. :param db: Database name :param chan: Name of Selected channel :param line: Selected lines buffer :param fid: Fiducial range :type db: str_ref :type chan: str_ref :type line: str_ref :type fid: str_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Channel Name Empty if no channel Line Name "[All]" if all lines are selected Fid Range "[All]" if all values in all lines are selected "[None]" if no values are selected "10 to 20" giving the range of values. """ db.value, chan.value, line.value, fid.value = self._get_current_selection(db.value.encode(), chan.value.encode(), line.value.encode(), fid.value.encode()) @classmethod def get_databases_lst(cls, lst, path): """ Load the file names of open databases into a `GXLST <geosoft.gxapi.GXLST>`. :param lst: `GXLST <geosoft.gxapi.GXLST>` to load :param path: :ref:`EDB_PATH` :type lst: GXLST :type path: int :returns: The number of documents loaded into the `GXLST <geosoft.gxapi.GXLST>`. The `GXLST <geosoft.gxapi.GXLST>` is cleared first. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = gxapi_cy.WrapEDB._get_databases_lst(GXContext._get_tls_geo(), lst, path) return ret_val def get_mark_chan_vv(self, vv, chan): """ Get channel data for the current mark. :param vv: `GXVV <geosoft.gxapi.GXVV>` in which to place the data. :param chan: Channel symbol to retrieve. :type vv: GXVV :type chan: int :returns: 0 if successful. 1 if failed, or if entire database is marked. :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The current "mark" in this case is the start and end fiducials and not the selected channel. You can use this method to retrieve the selected range from any channel, loaded or not. The `GXVV <geosoft.gxapi.GXVV>` will be resized to the length of the data """ ret_val = self._get_mark_chan_vv(vv, chan) return ret_val def get_mark_chan_va(self, vv, chan): """ Get channel data for the current mark. :param vv: `GXVA <geosoft.gxapi.GXVA>` in which to place the data. :param chan: Channel symbol to retrieve. :type vv: GXVA :type chan: int :returns: 0 if successful. 1 if failed, or if entire database is marked. :rtype: int .. versionadded:: 8.2 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The current "mark" in this case is the start and end fiducials and not the selected channel. You can use this method to retrieve the selected range from any channel, loaded or not. The `GXVA <geosoft.gxapi.GXVA>` will be resized to the length of the data """ ret_val = self._get_mark_chan_va(vv, chan) return ret_val def get_name(self, name): """ Get the name of the database object of this `GXEDB <geosoft.gxapi.GXEDB>`. :param name: Name returned :type name: str_ref .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ name.value = self._get_name(name.value.encode()) def get_profile_parm_int(self, window, prof, parm): """ Get integer profile parameter :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param prof: Profile number in window (see `get_profile_range_y <geosoft.gxapi.GXEDB.get_profile_range_y>`) :param parm: :ref:`EDB_PROF` :type window: int :type prof: int :type parm: int :returns: Data Value (See notes) :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_profile_parm_int(window, prof, parm) return ret_val def get_window_state(self): """ Retrieve the current state of the database window :returns: :ref:`EDB_WINDOW_STATE` :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_window_state() return ret_val @classmethod def have_current(cls): """ Checks if any database is currently loaded :rtype: bool .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = gxapi_cy.WrapEDB._have_current(GXContext._get_tls_geo()) return ret_val def is_locked(self): """ Checks if the database locked :rtype: bool .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._is_locked() return ret_val @classmethod def loaded(cls, name): """ Checks if a specific database is loaded. :param name: Database name :type name: str :rtype: bool .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = gxapi_cy.WrapEDB._loaded(GXContext._get_tls_geo(), name.encode()) return ret_val def profile_open(self, window): """ Return TRUE or FALSE if profile window is open :param window: Profile window number: 0 is the top window 1 is the middle window 2 is the bottom window :type window: int :returns: TRUE if window is open FALSE if window is closed :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** This functions will return FALSE if requested window is not supported in current version of Oasis montaj. """ ret_val = self._profile_open(window) return ret_val def read_only(self): """ Checks if a database is currently opened in a read-only mode. :rtype: bool .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._read_only() return ret_val def get_window_position(self, left, top, right, bottom, state, is_floating): """ Get the map window's position and dock state :param left: Window left position :param top: Window top position :param right: Window right position :param bottom: Window bottom position :param state: Window state :ref:`EDB_WINDOW_STATE` :param is_floating: Docked or floating :ref:`EDB_WINDOW_POSITION` :type left: int_ref :type top: int_ref :type right: int_ref :type bottom: int_ref :type state: int_ref :type is_floating: int_ref .. versionadded:: 9.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ left.value, top.value, right.value, bottom.value, state.value, is_floating.value = self._get_window_position(left.value, top.value, right.value, bottom.value, state.value, is_floating.value) def set_window_position(self, left, top, right, bottom, state, is_floating): """ Get the map window's position and dock state :param left: Window left position :param top: Window top position :param right: Window right position :param bottom: Window bottom position :param state: Window state :ref:`EDB_WINDOW_STATE` :param is_floating: Docked or floating :ref:`EDB_WINDOW_POSITION` :type left: int :type top: int :type right: int :type bottom: int :type state: int :type is_floating: int .. versionadded:: 9.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_window_position(left, top, right, bottom, state, is_floating) def show_profile_name(self, state, chan): """ Show a profile in the profile window :param state: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param chan: Name of the channel :type state: int :type chan: str :returns: Profile number in window (see `get_profile_range_y <geosoft.gxapi.GXEDB.get_profile_range_y>`), -1 for error :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If the symbol is not loaded, it will be loaded. """ ret_val = self._show_profile_name(state, chan.encode()) return ret_val def profile_shown(self, chan): """ Return index of first profile window in which a profile is shown :param chan: Name of the channel :type chan: str :returns: Index of first profile window in which it is loaded, -1 if not loaded in any profile window :rtype: int .. versionadded:: 9.7 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Returns -1 if channel profile is not loaded. """ ret_val = self._profile_shown(chan.encode()) return ret_val def get_window_y_axis_direction(self, window): """ Get the y-axis direction for a window :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :type window: int :returns: :ref:`EDB_YAXIS_DIRECTION` :rtype: int .. versionadded:: 8.3 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_window_y_axis_direction(window) return ret_val def window_profiles(self, window): """ Get number of profiles in a window :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :type window: int :returns: Number of profiles in a window :rtype: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._window_profiles(window) return ret_val def launch_histogram(self, chan): """ Launch histogram tool on a database. :param chan: First chan name :type chan: str .. versionadded:: 5.0.6 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ .. seealso:: `GXCHIMERA.launch_histogram <geosoft.gxapi.GXCHIMERA.launch_histogram>` in chimera.gxh """ self._launch_histogram(chan.encode()) def launch_scatter(self): """ Launch scatter tool on a database. .. versionadded:: 5.0.6 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Note:** The scatter tool uses the following INI parameters SCATTER.STM name of the scatter template,"none" for none SCATTER.STM_NAME name of last template section, "" for none. SCATTER.X name of channel to display in X SCATTER.Y name of channel to display in Y SCATTER.MASK name of channel to use for mask .. seealso:: `GXCHIMERA.launch_scatter <geosoft.gxapi.GXCHIMERA.launch_scatter>` in chimera.gxh """ self._launch_scatter() @classmethod def load(cls, name): """ Loads a list of databases into the workspace :param name: List of databases (';' or '|' delimited) to load. :type name: str :returns: Handle to current edited database, which will be the last database in the list. :rtype: GXEDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The last listed database will become the current database. Databases may already be loaded. Only the first file in the list may have a directory path. All other files in the list are assumed to be in the same directory as the first file. """ ret_val = gxapi_cy.WrapEDB._load(GXContext._get_tls_geo(), name.encode()) return GXEDB(ret_val) @classmethod def load_no_activate(cls, name): """ Loads documents into the workspace :param name: List of documents (';' or '|' delimited) to load. :type name: str :returns: Handle to current edited document, which will be the last database in the list if multiple files were provided. :rtype: GXEDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** This function acts just like `load <geosoft.gxapi.GXEDB.load>` except that the document(s) is not activated (brought to foreground) and no guarantee is given about which document is currently active. """ ret_val = gxapi_cy.WrapEDB._load_no_activate(GXContext._get_tls_geo(), name.encode()) return GXEDB(ret_val) def load_all_chans(self): """ Load all channels into current database .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._load_all_chans() def load_chan(self, chan): """ Load a channel into current database :param chan: Channel name :type chan: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If the channel does not exist, or if channel is already loaded nothing happens. """ self._load_chan(chan.encode()) @classmethod def load_new(cls, name): """ Loads a database into the workspace, flags as new. :param name: Database to load. :type name: str :returns: Handle to the current edited database. :rtype: GXEDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** See `load <geosoft.gxapi.GXEDB.load>`. This is used for brand new databases, to set an internal flag such that if on closing the user chooses not to save changes, the database is deleted. """ ret_val = gxapi_cy.WrapEDB._load_new(GXContext._get_tls_geo(), name.encode()) return GXEDB(ret_val) @classmethod def load_pass(cls, name, login, password): """ Loads a database into the editor with login and password. :param name: Name of database to load :param login: Login Name :param password: Password :type name: str :type login: str :type password: str :returns: Handle to current edited database. :rtype: GXEDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The loaded database will become the current database. If the database is already loaded, it simply becomes the current database. """ ret_val = gxapi_cy.WrapEDB._load_pass(GXContext._get_tls_geo(), name.encode(), login.encode(), password.encode()) return GXEDB(ret_val) @classmethod def load_with_view(cls, name, p2): """ Load an `GXEDB <geosoft.gxapi.GXEDB>` with the view from a current `GXEDB <geosoft.gxapi.GXEDB>`. :param name: Source `GXDB <geosoft.gxapi.GXDB>` name :param p2: `GXEDB <geosoft.gxapi.GXEDB>` to use as the source view :type name: str :type p2: GXEDB :returns: New `GXEDB <geosoft.gxapi.GXEDB>` handle. :rtype: GXEDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Can only be run in interactive mode. Is used by dbsubset to create a new database with the same view as previously. """ ret_val = gxapi_cy.WrapEDB._load_with_view(GXContext._get_tls_geo(), name.encode(), p2) return GXEDB(ret_val) def lock(self): """ This method locks the Edited Database. :returns: Handle to database associated with edited database. :rtype: GXDB .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._lock() return GXDB(ret_val) def make_current(self): """ Makes this `GXEDB <geosoft.gxapi.GXEDB>` object the current active object to the user. .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._make_current() def remove_profile(self, window, prof): """ Remove a profile from the profile window :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param prof: Profile number in window (see `get_profile_range_y <geosoft.gxapi.GXEDB.get_profile_range_y>`) :type window: int :type prof: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._remove_profile(window, prof) def get_cur_fid(self): """ This method returns the currently selected fiducial if the user is selecting a fiducial. If not, it returns a dummy. :returns: x - Fiducial DUMMY - No Selected Fiducial :rtype: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_cur_fid() return ret_val def get_profile_parm_double(self, window, prof, parm): """ Get real profile parameter :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param prof: Profile number in window (see `get_profile_range_y <geosoft.gxapi.GXEDB.get_profile_range_y>`) :param parm: :ref:`EDB_PROF` :type window: int :type prof: int :type parm: int :returns: Real profile parameter :rtype: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_profile_parm_double(window, prof, parm) return ret_val def get_split(self): """ Get split ratio between spreadsheet and profile sections. :returns: d = (spreadsheet window height/ (spreadsheet window height + entire profile window height)) :rtype: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ ret_val = self._get_split() return ret_val def run_channel_maker(self, chan): """ Run the maker for a single channel. :param chan: Channel name :type chan: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Skips channels without makers; will not return an error if the channel does not exist. """ self._run_channel_maker(chan.encode()) def run_channel_makers(self): """ Recreate channels with makers. .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Skips channels without makers. """ self._run_channel_makers() def set_cur_line(self, line): """ Set the current line name. :param line: Line name :type line: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_cur_line(line.encode()) def set_cur_line_no_message(self, str_val): """ Set Line but do not send a message. :param str_val: Line name :type str_val: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_cur_line_no_message(str_val.encode()) def set_cur_mark(self, start, end): """ Set the current mark. :param start: Start fiducial :param end: End fiducial :type start: float :type end: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_cur_mark(start, end) def set_profile_parm_i(self, window, prof, parm, value): """ Set integer profile parameter :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param prof: Profile number in window (see `get_profile_range_y <geosoft.gxapi.GXEDB.get_profile_range_y>`) :param parm: :ref:`EDB_PROF` :param value: Setting :type window: int :type prof: int :type parm: int :type value: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_profile_parm_i(window, prof, parm, value) def set_profile_parm_r(self, window, prof, parm, value): """ Set real profile parameter :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param prof: Profile number in window (see `get_profile_range_y <geosoft.gxapi.GXEDB.get_profile_range_y>`) :param parm: :ref:`EDB_PROF` :param value: Setting :type window: int :type prof: int :type parm: int :type value: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_profile_parm_r(window, prof, parm, value) def set_profile_range_x(self, min_x, max_x, x_ch): """ Set profile X range and X channel :param min_x: Minimum x, `rDUMMY <geosoft.gxapi.rDUMMY>` for data minimum :param max_x: Maximum x, `rDUMMY <geosoft.gxapi.rDUMMY>` for data maximum :param x_ch: X axis channel, `NULLSYMB <geosoft.gxapi.NULLSYMB>` to use fids :type min_x: float :type max_x: float :type x_ch: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_profile_range_x(min_x, max_x, x_ch) def set_profile_range_y(self, window, prof, min_y, max_y, scl): """ Set profile Y range and display option :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param prof: Profile number in window (see `get_profile_range_y <geosoft.gxapi.GXEDB.get_profile_range_y>`) :param min_y: Minimum y :param max_y: Maximum y :param scl: :ref:`EDB_PROFILE_SCALE` :type window: int :type prof: int :type min_y: float :type max_y: float :type scl: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If channel is not loaded or displayed, it will loaded and/or displayed. """ self._set_profile_range_y(window, prof, min_y, max_y, scl) def profile_rescale_all(self, window): """ Rescale all profiles in a selected window in both X and Y, based on current scaling selections :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, see `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :type window: int .. versionadded:: 9.6 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._profile_rescale_all(window) def set_profile_split(self, d1, d2): """ Set profile split for 3 windows. :param d1: Split d1 (profile window 0 height / entire profile window height) :param d2: Split d2 (profile window 1 height / entire profile window height) :type d1: float :type d2: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_profile_split(d1, d2) def set_profile_split5(self, d1, d2, d3, d4): """ Set profile split for 5 windows. :param d1: Split d1 (profile window 0 height / entire profile window height) :param d2: Split d2 (profile window 1 height / entire profile window height) :param d3: Split d3 (profile window 2 height / entire profile window height) :param d4: Split d4 (profile window 3 height / entire profile window height) :type d1: float :type d2: float :type d3: float :type d4: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_profile_split5(d1, d2, d3, d4) def set_profile_split_vv(self, vv): """ Set profile splits :param vv: Split `GXVV <geosoft.gxapi.GXVV>` (REAL) (relative sizes of each profile window) :type vv: GXVV .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** The input `GXVV <geosoft.gxapi.GXVV>` values are the fractional heights for each profile window. Values are summed, and normalized (so you can enter "1,1,1", with a `GXVV <geosoft.gxapi.GXVV>` of length 3, if you want 3 equal profile windows). `GXVV <geosoft.gxapi.GXVV>` values beyond the maximum number of displayable profiles (`MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`) are ignored. """ self._set_profile_split_vv(vv) def set_split(self, d): """ Set split ratio between spreadsheet and profile sections. :param d: Split d (0.0 <= d <= 1.0). :type d: float .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** d = (spreadsheet window height/ (spreadsheet window height + entire profile window height)) """ self._set_split(d) def set_window_state(self, state): """ Changes the state of the database window :param state: :ref:`EDB_WINDOW_STATE` :type state: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._set_window_state(state) def show_profile(self, window, symb): """ Show a profile in the profile window :param window: Profile window number (0 to `MAX_PROF_WND <geosoft.gxapi.MAX_PROF_WND>`-1, -1 to plot to the currently selected profile window. See `profile_open <geosoft.gxapi.GXEDB.profile_open>`) :param symb: Channel symbol :type window: int :type symb: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If the symbol is not loaded, it will be loaded. """ self._show_profile(window, symb) def statistics(self, st): """ Add all currently selected data to the `GXST <geosoft.gxapi.GXST>`. :param st: `GXST <geosoft.gxapi.GXST>` handle to update :type st: GXST .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** Use `histogram <geosoft.gxapi.GXEDB.histogram>` to get median or histogram. """ self._statistics(st) @classmethod def un_load(cls, name): """ Unloads an edited database. :param name: Name of database to unload :type name: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If the database is not loaded, nothing happens. Same as `un_load_verify <geosoft.gxapi.GXEDB.un_load_verify>` with FALSE to prompt save. """ gxapi_cy.WrapEDB._un_load(GXContext._get_tls_geo(), name.encode()) @classmethod def un_load_all(cls): """ Unloads all opened databases .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ gxapi_cy.WrapEDB._un_load_all(GXContext._get_tls_geo()) def un_load_all_chans(self): """ Unload all channels into current database .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._un_load_all_chans() def un_load_chan(self, chan): """ Unload a channel into current database :param chan: Channel name :type chan: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If the channel does not exist, or if channel is already loaded nothing happens. """ self._un_load_chan(chan.encode()) @classmethod def un_load_discard(cls, name): """ Unloads a database in the workspace, discards changes. :param name: Name of database to unload :type name: str .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If the database is not loaded, nothing happens. """ gxapi_cy.WrapEDB._un_load_discard(GXContext._get_tls_geo(), name.encode()) @classmethod def un_load_verify(cls, name, prompt): """ Unloads an edited database, optional prompt to save. :param name: Name of database to unload :param prompt: :ref:`EDB_UNLOAD` :type name: str :type prompt: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. **Note:** If the database is not loaded, nothing happens. The user can be prompted to save before unloading. If `EDB_UNLOAD_NO_PROMPT <geosoft.gxapi.EDB_UNLOAD_NO_PROMPT>`, data is always saved. EDB_UNLOAD_MULTIPROMPT is now obsolete and is equivalent to `EDB_UNLOAD_SINGLE_PROMPT <geosoft.gxapi.EDB_UNLOAD_SINGLE_PROMPT>`. """ gxapi_cy.WrapEDB._un_load_verify(GXContext._get_tls_geo(), name.encode(), prompt) def un_lock(self): """ This method unlocks the Edited Database. .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ self._un_lock() # External Window @classmethod def load_control(cls, db_file, window): """ Version of `load <geosoft.gxapi.GXEDB.load>` that can be used to load a database via subclassing into a Windows control. :param db_file: Database filename :param window: Window handle to receive document :type db_file: str :type window: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ gxapi_cy.WrapEDB._load_control(GXContext._get_tls_geo(), db_file.encode(), window) @classmethod def load_new_control(cls, db_file, window): """ Version of `load_new <geosoft.gxapi.GXEDB.load_new>` that can be used to load a database via subclassing into a Windows control. :param db_file: Database filename :param window: Window handle to receive document :type db_file: str :type window: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ gxapi_cy.WrapEDB._load_new_control(GXContext._get_tls_geo(), db_file.encode(), window) @classmethod def load_pass_control(cls, db_file, user, password, window): """ Version of `load_pass <geosoft.gxapi.GXEDB.load_pass>` that can be used to load a database via subclassing into a Windows control. :param db_file: Database filename :param user: Login name :param password: Password :param window: Window handle to receive document :type db_file: str :type user: str :type password: str :type window: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ gxapi_cy.WrapEDB._load_pass_control(GXContext._get_tls_geo(), db_file.encode(), user.encode(), password.encode(), window) @classmethod def load_with_view_control(cls, db_file, edb, window): """ Version of `load_with_view <geosoft.gxapi.GXEDB.load_with_view>` that can be used to load a database via subclassing into a Windows control. :param db_file: Database filename :param edb: `GXEDB <geosoft.gxapi.GXEDB>` handle to use as the source view :param window: Window handle to receive document :type db_file: str :type edb: GXEDB :type window: int .. versionadded:: 5.0 **License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_ **Limitations:** May not be available while executing a command line program. """ gxapi_cy.WrapEDB._load_with_view_control(GXContext._get_tls_geo(), db_file.encode(), edb, window) ### endblock ClassImplementation ### block ClassExtend # NOTICE: The code generator will not replace the code in this block ### endblock ClassExtend ### block Footer # NOTICE: The code generator will not replace the code in this block ### endblock Footer
31.885135
206
0.616868
9,415
75,504
4.829952
0.055762
0.027972
0.038791
0.053877
0.753815
0.71144
0.67753
0.646501
0.63058
0.621234
0
0.019253
0.283892
75,504
2,368
207
31.885135
0.821783
0.687646
0
0.215909
1
0
0
0
0
0
0
0
0
1
0.382576
false
0.015152
0.011364
0
0.549242
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
4b98367af52f54cbefa4119ba4173f53d452fbb7
917
py
Python
tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/__init__.py
hito0512/Vitis-AI
996459fb96cb077ed2f7e789d515893b1cccbc95
[ "Apache-2.0" ]
848
2019-12-03T00:16:17.000Z
2022-03-31T22:53:17.000Z
tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/__init__.py
wangyifan778/Vitis-AI
f61061eef7550d98bf02a171604c9a9f283a7c47
[ "Apache-2.0" ]
656
2019-12-03T00:48:46.000Z
2022-03-31T18:41:54.000Z
tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/qat/modules/__init__.py
wangyifan778/Vitis-AI
f61061eef7550d98bf02a171604c9a9f283a7c47
[ "Apache-2.0" ]
506
2019-12-03T00:46:26.000Z
2022-03-30T10:34:56.000Z
from pytorch_nndct.nn.qat.modules.activation import DPULeakyReLU from pytorch_nndct.nn.qat.modules.conv import QuantizedConv2d from pytorch_nndct.nn.qat.modules.conv import QuantizedConv3d from pytorch_nndct.nn.qat.modules.conv import QuantizedConvTranspose2d from pytorch_nndct.nn.qat.modules.conv import QuantizedConvTranspose3d from pytorch_nndct.nn.qat.modules.conv_fused import QuantizedConvBatchNorm2d from pytorch_nndct.nn.qat.modules.conv_fused import QuantizedConvBatchNorm3d from pytorch_nndct.nn.qat.modules.conv_fused import QuantizedConvTransposeBatchNorm2d from pytorch_nndct.nn.qat.modules.conv_fused import QuantizedConvTransposeBatchNorm3d from pytorch_nndct.nn.qat.modules.linear import QuantizedLinear from pytorch_nndct.nn.qat.modules.pooling import DPUAdaptiveAvgPool2d from pytorch_nndct.nn.qat.modules.pooling import DPUAvgPool2d from pytorch_nndct.nn.qat.modules.quantizer import TQTQuantizer
65.5
85
0.886587
121
917
6.578512
0.214876
0.179648
0.261307
0.29397
0.615578
0.615578
0.51005
0.51005
0.21608
0
0
0.011561
0.056707
917
13
86
70.538462
0.908671
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
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
4ba1b60ef62ac613a246abaa0ffce3e42746bf8a
209
py
Python
flask/app/front/routes.py
jonathanvanschenck/DanknD
75a5561ed7bf7a2dffa70d0b78297d7664bd9ad3
[ "MIT" ]
null
null
null
flask/app/front/routes.py
jonathanvanschenck/DanknD
75a5561ed7bf7a2dffa70d0b78297d7664bd9ad3
[ "MIT" ]
null
null
null
flask/app/front/routes.py
jonathanvanschenck/DanknD
75a5561ed7bf7a2dffa70d0b78297d7664bd9ad3
[ "MIT" ]
null
null
null
from flask import url_for, render_template, flash from flask_login import current_user from app.front import bp @bp.route('/') @bp.route('/index') def index(): return render_template("front/index.html")
20.9
49
0.751196
32
209
4.75
0.59375
0.118421
0
0
0
0
0
0
0
0
0
0
0.124402
209
9
50
23.222222
0.830601
0
0
0
0
0
0.110048
0
0
0
0
0
0
1
0.142857
true
0
0.428571
0.142857
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
1
1
0
0
5
4bb97bc779b04f93c50f914a8c4cce39157aa71c
177
py
Python
pysharpen/methods/__init__.py
Vladimir-Kozub/pansharpen
2d6210e09fd1630e66980e6cd539879be17068bf
[ "MIT" ]
1
2021-06-01T21:07:31.000Z
2021-06-01T21:07:31.000Z
pysharpen/methods/__init__.py
Vladimir-Kozub/pansharpen
2d6210e09fd1630e66980e6cd539879be17068bf
[ "MIT" ]
6
2019-12-30T10:40:44.000Z
2021-07-30T19:53:58.000Z
pysharpen/methods/__init__.py
Vladimir-Kozub/pansharpen
2d6210e09fd1630e66980e6cd539879be17068bf
[ "MIT" ]
3
2019-10-28T14:54:11.000Z
2021-03-02T13:33:22.000Z
from pysharpen.methods.sharpening import BroveyPansharpening, IHSPansharpening, GIHSPansharpening from .preprocessing import LinearBrightnessScale from .img_proc import ImgProc
44.25
97
0.887006
17
177
9.176471
0.764706
0
0
0
0
0
0
0
0
0
0
0
0.079096
177
3
98
59
0.957055
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
29af00498e48855768ae75d1699f3042838bc92a
138
py
Python
src/sentry/plugins/sentry_webhooks/__init__.py
AlexWayfer/sentry
ef935cda2b2e960bd602fda590540882d1b0712d
[ "BSD-3-Clause" ]
20
2016-10-01T04:29:24.000Z
2020-10-09T07:23:34.000Z
src/sentry/plugins/sentry_webhooks/__init__.py
AlexWayfer/sentry
ef935cda2b2e960bd602fda590540882d1b0712d
[ "BSD-3-Clause" ]
196
2019-06-10T08:34:10.000Z
2022-02-22T01:26:13.000Z
src/sentry/plugins/sentry_webhooks/__init__.py
AlexWayfer/sentry
ef935cda2b2e960bd602fda590540882d1b0712d
[ "BSD-3-Clause" ]
7
2016-10-27T05:12:45.000Z
2021-05-01T14:29:53.000Z
from __future__ import absolute_import from sentry.plugins import register from .plugin import WebHooksPlugin register(WebHooksPlugin)
17.25
38
0.855072
16
138
7.0625
0.5625
0
0
0
0
0
0
0
0
0
0
0
0.115942
138
7
39
19.714286
0.92623
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
29b0265e726c980ec829e2ba5d55771453c4dc6d
124
py
Python
Courses/YandexAlgo/1/building_school.py
searayeah/sublime-snippets
deff53a06948691cd5e5d7dcfa85515ddd8fab0b
[ "MIT" ]
null
null
null
Courses/YandexAlgo/1/building_school.py
searayeah/sublime-snippets
deff53a06948691cd5e5d7dcfa85515ddd8fab0b
[ "MIT" ]
null
null
null
Courses/YandexAlgo/1/building_school.py
searayeah/sublime-snippets
deff53a06948691cd5e5d7dcfa85515ddd8fab0b
[ "MIT" ]
null
null
null
n = int(input()) a = list(map(int, input().split())) def solve(n, a): return a[int((n - 1) / 2)] print(solve(n, a))
12.4
35
0.524194
23
124
2.826087
0.565217
0.246154
0.215385
0
0
0
0
0
0
0
0
0.020408
0.209677
124
9
36
13.777778
0.642857
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0.2
0.4
0.2
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
5
29b99fe4b0d4dc07bfb89c1300a1dfbae07b11f2
199
py
Python
22/00/0.py
pylangstudy/201707
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
[ "CC0-1.0" ]
null
null
null
22/00/0.py
pylangstudy/201707
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
[ "CC0-1.0" ]
46
2017-06-30T22:19:07.000Z
2017-07-31T22:51:31.000Z
22/00/0.py
pylangstudy/201707
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
[ "CC0-1.0" ]
null
null
null
class NumArray: def __init__(self): self.__values = [] def __len__(self): print('__len__', len(self.__values)) return len(self.__values) n = NumArray() print(len(n))
19.9
44
0.603015
24
199
4.25
0.416667
0.294118
0.254902
0
0
0
0
0
0
0
0
0
0.251256
199
9
45
22.111111
0.684564
0
0
0
0
0
0.035176
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0.25
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
1
0
0
0
0
0
0
0
5
4b0bfbf950c7aa4b34937fa0f566ef11b300deb7
37
py
Python
code_file/login.py
wangqi9207/flask_02
f356046aa1c7cb03a7b5563617968390316b3695
[ "MIT" ]
null
null
null
code_file/login.py
wangqi9207/flask_02
f356046aa1c7cb03a7b5563617968390316b3695
[ "MIT" ]
null
null
null
code_file/login.py
wangqi9207/flask_02
f356046aa1c7cb03a7b5563617968390316b3695
[ "MIT" ]
null
null
null
num==0 num==1 num==2 nums = 100 a -
5.285714
10
0.540541
9
37
2.222222
0.777778
0
0
0
0
0
0
0
0
0
0
0.214286
0.243243
37
6
11
6.166667
0.5
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
d99f9eb00a823f015437b760dd966b416cac87d3
19
py
Python
{{cookiecutter.project_name}}/code/modeling/model.py
pmason314/cookiecutter-tdsp
c5495259f17b4cf27286d7fa39baef4b39810b1d
[ "Apache-2.0" ]
null
null
null
{{cookiecutter.project_name}}/code/modeling/model.py
pmason314/cookiecutter-tdsp
c5495259f17b4cf27286d7fa39baef4b39810b1d
[ "Apache-2.0" ]
null
null
null
{{cookiecutter.project_name}}/code/modeling/model.py
pmason314/cookiecutter-tdsp
c5495259f17b4cf27286d7fa39baef4b39810b1d
[ "Apache-2.0" ]
null
null
null
# Python model code
19
19
0.789474
3
19
5
1
0
0
0
0
0
0
0
0
0
0
0
0.157895
19
1
19
19
0.9375
0.894737
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
8a046777b37258195f82f15d8108c828faec6159
72
py
Python
modules/dbnd/src/databand/__main__.py
ipattarapong/dbnd
7bd65621c46c73e078eb628f994127ad4c7dbd1a
[ "Apache-2.0" ]
224
2020-01-02T10:46:37.000Z
2022-03-02T13:54:08.000Z
modules/dbnd/src/databand/__main__.py
ipattarapong/dbnd
7bd65621c46c73e078eb628f994127ad4c7dbd1a
[ "Apache-2.0" ]
16
2020-03-11T09:37:58.000Z
2022-01-26T10:22:08.000Z
modules/dbnd/src/databand/__main__.py
ipattarapong/dbnd
7bd65621c46c73e078eb628f994127ad4c7dbd1a
[ "Apache-2.0" ]
24
2020-03-24T13:53:50.000Z
2022-03-22T11:55:18.000Z
from dbnd import dbnd_main if __name__ == "__main__": dbnd_main()
12
26
0.694444
10
72
4
0.6
0.4
0
0
0
0
0
0
0
0
0
0
0.208333
72
5
27
14.4
0.701754
0
0
0
0
0
0.111111
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8a0f7e95374ad4efded275296405ece73668e979
36
py
Python
bacpy/__main__.py
tomol111/bacpy
9b01428ade5ece7c58d8b689c0feaab60171cd0f
[ "MIT" ]
null
null
null
bacpy/__main__.py
tomol111/bacpy
9b01428ade5ece7c58d8b689c0feaab60171cd0f
[ "MIT" ]
null
null
null
bacpy/__main__.py
tomol111/bacpy
9b01428ade5ece7c58d8b689c0feaab60171cd0f
[ "MIT" ]
null
null
null
from bacpy.main import main main()
9
27
0.75
6
36
4.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.166667
36
3
28
12
0.9
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
8a19f64c2e2c6baa98515fb9bfe6a7197d752c9b
150
py
Python
src/action/Quit.py
jniestroy/quoridor_bot
afe5acba84a60b3ed03c447b2426794cf1000531
[ "MIT" ]
null
null
null
src/action/Quit.py
jniestroy/quoridor_bot
afe5acba84a60b3ed03c447b2426794cf1000531
[ "MIT" ]
null
null
null
src/action/Quit.py
jniestroy/quoridor_bot
afe5acba84a60b3ed03c447b2426794cf1000531
[ "MIT" ]
null
null
null
# # Quit.py # # @author Alain Rinder # @date 2017.06.02 # @version 0.1 # from src.action.IAction import * class Quit(IAction): pass
10.714286
32
0.6
21
150
4.285714
0.904762
0
0
0
0
0
0
0
0
0
0
0.090909
0.266667
150
14
33
10.714286
0.727273
0.46
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
8a1fa75f153e050949b11fadd27242ffafc8fb19
52
py
Python
mayday/utils/__init__.py
codacy-badger/mayday-ticketing-bot
7cbb1d201ececd2eb879c047e2cf7588862eb89f
[ "MIT" ]
null
null
null
mayday/utils/__init__.py
codacy-badger/mayday-ticketing-bot
7cbb1d201ececd2eb879c047e2cf7588862eb89f
[ "MIT" ]
null
null
null
mayday/utils/__init__.py
codacy-badger/mayday-ticketing-bot
7cbb1d201ececd2eb879c047e2cf7588862eb89f
[ "MIT" ]
null
null
null
def set_tostr(values): return ', '.join(values)
17.333333
28
0.653846
7
52
4.714286
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.173077
52
2
29
26
0.767442
0
0
0
0
0
0.038462
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
8a3a731f953f7c6ad5c2adfebf1ac188df02a709
24,330
py
Python
tests/components/template/test_sensor.py
squirrel289/core
6c5bcbfc3ee40927458e9188d6b79bf63933d3f9
[ "Apache-2.0" ]
5
2020-09-17T21:47:23.000Z
2021-06-04T04:37:29.000Z
tests/components/template/test_sensor.py
squirrel289/core
6c5bcbfc3ee40927458e9188d6b79bf63933d3f9
[ "Apache-2.0" ]
47
2020-07-23T07:13:11.000Z
2022-03-31T06:01:46.000Z
tests/components/template/test_sensor.py
CrossEyeORG/homeassistant
6c5bcbfc3ee40927458e9188d6b79bf63933d3f9
[ "Apache-2.0" ]
1
2021-11-19T19:01:57.000Z
2021-11-19T19:01:57.000Z
"""The test for the Template sensor platform.""" from homeassistant.const import ( EVENT_HOMEASSISTANT_START, STATE_OFF, STATE_ON, STATE_UNAVAILABLE, ) from homeassistant.setup import async_setup_component, setup_component from tests.common import assert_setup_component, get_test_home_assistant class TestTemplateSensor: """Test the Template sensor.""" hass = None # pylint: disable=invalid-name def setup_method(self, method): """Set up things to be run when tests are started.""" self.hass = get_test_home_assistant() def teardown_method(self, method): """Stop everything that was started.""" self.hass.stop() def test_template(self): """Test template.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "It {{ states.sensor.test_state.state }}." } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.state == "It ." self.hass.states.set("sensor.test_state", "Works") self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.state == "It Works." def test_icon_template(self): """Test icon template.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{{ states.sensor.test_state.state }}", "icon_template": "{% if states.sensor.test_state.state == " "'Works' %}" "mdi:check" "{% endif %}", } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes.get("icon") == "" self.hass.states.set("sensor.test_state", "Works") self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes["icon"] == "mdi:check" def test_entity_picture_template(self): """Test entity_picture template.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{{ states.sensor.test_state.state }}", "entity_picture_template": "{% if states.sensor.test_state.state == " "'Works' %}" "/local/sensor.png" "{% endif %}", } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes.get("entity_picture") == "" self.hass.states.set("sensor.test_state", "Works") self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes["entity_picture"] == "/local/sensor.png" def test_friendly_name_template(self): """Test friendly_name template.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{{ states.sensor.test_state.state }}", "friendly_name_template": "It {{ states.sensor.test_state.state }}.", } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes.get("friendly_name") == "It ." self.hass.states.set("sensor.test_state", "Works") self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes["friendly_name"] == "It Works." def test_friendly_name_template_with_unknown_state(self): """Test friendly_name template with an unknown value_template.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{{ states.fourohfour.state }}", "friendly_name_template": "It {{ states.sensor.test_state.state }}.", } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes["friendly_name"] == "It ." self.hass.states.set("sensor.test_state", "Works") self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes["friendly_name"] == "It Works." def test_attribute_templates(self): """Test attribute_templates template.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{{ states.sensor.test_state.state }}", "attribute_templates": { "test_attribute": "It {{ states.sensor.test_state.state }}." }, } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes.get("test_attribute") == "It ." self.hass.states.set("sensor.test_state", "Works") self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.attributes["test_attribute"] == "It Works." def test_template_syntax_error(self): """Test templating syntax error.""" with assert_setup_component(0): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{% if rubbish %}" } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() assert self.hass.states.all() == [] def test_template_attribute_missing(self): """Test missing attribute template.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "It {{ states.sensor.test_state" ".attributes.missing }}." } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() state = self.hass.states.get("sensor.test_template_sensor") assert state.state == STATE_UNAVAILABLE def test_invalid_name_does_not_create(self): """Test invalid name.""" with assert_setup_component(0): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test INVALID sensor": { "value_template": "{{ states.sensor.test_state.state }}" } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() assert self.hass.states.all() == [] def test_invalid_sensor_does_not_create(self): """Test invalid sensor.""" with assert_setup_component(0): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": {"test_template_sensor": "invalid"}, } }, ) self.hass.block_till_done() self.hass.start() assert self.hass.states.all() == [] def test_no_sensors_does_not_create(self): """Test no sensors.""" with assert_setup_component(0): assert setup_component( self.hass, "sensor", {"sensor": {"platform": "template"}} ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() assert self.hass.states.all() == [] def test_missing_template_does_not_create(self): """Test missing template.""" with assert_setup_component(0): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "not_value_template": "{{ states.sensor.test_state.state }}" } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() assert self.hass.states.all() == [] def test_setup_invalid_device_class(self): """Test setup with invalid device_class.""" with assert_setup_component(0): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test": { "value_template": "{{ states.sensor.test_sensor.state }}", "device_class": "foobarnotreal", } }, } }, ) def test_setup_valid_device_class(self): """Test setup with valid device_class.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test1": { "value_template": "{{ states.sensor.test_sensor.state }}", "device_class": "temperature", }, "test2": { "value_template": "{{ states.sensor.test_sensor.state }}" }, }, } }, ) self.hass.block_till_done() state = self.hass.states.get("sensor.test1") assert state.attributes["device_class"] == "temperature" state = self.hass.states.get("sensor.test2") assert "device_class" not in state.attributes def test_available_template_with_entities(self): """Test availability tempalates with values from other entities.""" with assert_setup_component(1): assert setup_component( self.hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{{ states.sensor.test_state.state }}", "availability_template": "{{ is_state('availability_boolean.state', 'on') }}", } }, } }, ) self.hass.block_till_done() self.hass.start() self.hass.block_till_done() # When template returns true.. self.hass.states.set("availability_boolean.state", STATE_ON) self.hass.block_till_done() # Device State should not be unavailable assert ( self.hass.states.get("sensor.test_template_sensor").state != STATE_UNAVAILABLE ) # When Availability template returns false self.hass.states.set("availability_boolean.state", STATE_OFF) self.hass.block_till_done() # device state should be unavailable assert ( self.hass.states.get("sensor.test_template_sensor").state == STATE_UNAVAILABLE ) async def test_available_template_with_entities(hass): """Test availability tempalates with values from other entities.""" hass.states.async_set("sensor.availability_sensor", STATE_OFF) with assert_setup_component(1, "sensor"): assert await async_setup_component( hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor": { "value_template": "{{ states.sensor.test_sensor.state }}", "availability_template": "{{ is_state('sensor.availability_sensor', 'on') }}", } }, } }, ) await hass.async_block_till_done() await hass.async_start() await hass.async_block_till_done() # When template returns true.. hass.states.async_set("sensor.availability_sensor", STATE_ON) await hass.async_block_till_done() # Device State should not be unavailable assert hass.states.get("sensor.test_template_sensor").state != STATE_UNAVAILABLE # When Availability template returns false hass.states.async_set("sensor.availability_sensor", STATE_OFF) await hass.async_block_till_done() # device state should be unavailable assert hass.states.get("sensor.test_template_sensor").state == STATE_UNAVAILABLE async def test_invalid_attribute_template(hass, caplog): """Test that errors are logged if rendering template fails.""" hass.states.async_set("sensor.test_sensor", "startup") await async_setup_component( hass, "sensor", { "sensor": { "platform": "template", "sensors": { "invalid_template": { "value_template": "{{ states.sensor.test_sensor.state }}", "attribute_templates": { "test_attribute": "{{ states.sensor.unknown.attributes.picture }}" }, } }, } }, ) await hass.async_block_till_done() assert len(hass.states.async_all()) == 2 await hass.helpers.entity_component.async_update_entity("sensor.invalid_template") assert ("Error rendering attribute test_attribute") in caplog.text async def test_invalid_availability_template_keeps_component_available(hass, caplog): """Test that an invalid availability keeps the device available.""" await async_setup_component( hass, "sensor", { "sensor": { "platform": "template", "sensors": { "my_sensor": { "value_template": "{{ states.sensor.test_state.state }}", "availability_template": "{{ x - 12 }}", } }, } }, ) await hass.async_block_till_done() await hass.async_start() await hass.async_block_till_done() assert hass.states.get("sensor.my_sensor").state != STATE_UNAVAILABLE assert ("UndefinedError: 'x' is undefined") in caplog.text async def test_no_template_match_all(hass, caplog): """Test that we do not allow sensors that match on all.""" hass.states.async_set("sensor.test_sensor", "startup") await async_setup_component( hass, "sensor", { "sensor": { "platform": "template", "sensors": { "invalid_state": {"value_template": "{{ 1 + 1 }}"}, "invalid_icon": { "value_template": "{{ states.sensor.test_sensor.state }}", "icon_template": "{{ 1 + 1 }}", }, "invalid_entity_picture": { "value_template": "{{ states.sensor.test_sensor.state }}", "entity_picture_template": "{{ 1 + 1 }}", }, "invalid_friendly_name": { "value_template": "{{ states.sensor.test_sensor.state }}", "friendly_name_template": "{{ 1 + 1 }}", }, "invalid_attribute": { "value_template": "{{ states.sensor.test_sensor.state }}", "attribute_templates": {"test_attribute": "{{ 1 + 1 }}"}, }, }, } }, ) await hass.async_block_till_done() assert hass.states.get("sensor.invalid_state").state == "unknown" assert hass.states.get("sensor.invalid_icon").state == "unknown" assert hass.states.get("sensor.invalid_entity_picture").state == "unknown" assert hass.states.get("sensor.invalid_friendly_name").state == "unknown" await hass.async_block_till_done() assert len(hass.states.async_all()) == 6 assert ( "Template sensor 'invalid_state' has no entity ids " "configured to track nor were we able to extract the entities to " "track from the value template" ) in caplog.text assert ( "Template sensor 'invalid_icon' has no entity ids " "configured to track nor were we able to extract the entities to " "track from the icon template" ) in caplog.text assert ( "Template sensor 'invalid_entity_picture' has no entity ids " "configured to track nor were we able to extract the entities to " "track from the entity_picture template" ) in caplog.text assert ( "Template sensor 'invalid_friendly_name' has no entity ids " "configured to track nor were we able to extract the entities to " "track from the friendly_name template" ) in caplog.text assert ( "Template sensor 'invalid_attribute' has no entity ids " "configured to track nor were we able to extract the entities to " "track from the test_attribute template" ) in caplog.text assert hass.states.get("sensor.invalid_state").state == "unknown" assert hass.states.get("sensor.invalid_icon").state == "unknown" assert hass.states.get("sensor.invalid_entity_picture").state == "unknown" assert hass.states.get("sensor.invalid_friendly_name").state == "unknown" assert hass.states.get("sensor.invalid_attribute").state == "unknown" hass.bus.async_fire(EVENT_HOMEASSISTANT_START) await hass.async_block_till_done() assert hass.states.get("sensor.invalid_state").state == "2" assert hass.states.get("sensor.invalid_icon").state == "startup" assert hass.states.get("sensor.invalid_entity_picture").state == "startup" assert hass.states.get("sensor.invalid_friendly_name").state == "startup" assert hass.states.get("sensor.invalid_attribute").state == "startup" hass.states.async_set("sensor.test_sensor", "hello") await hass.async_block_till_done() assert hass.states.get("sensor.invalid_state").state == "2" # Will now process because we have at least one valid template assert hass.states.get("sensor.invalid_icon").state == "hello" assert hass.states.get("sensor.invalid_entity_picture").state == "hello" assert hass.states.get("sensor.invalid_friendly_name").state == "hello" assert hass.states.get("sensor.invalid_attribute").state == "hello" await hass.helpers.entity_component.async_update_entity("sensor.invalid_state") await hass.helpers.entity_component.async_update_entity("sensor.invalid_icon") await hass.helpers.entity_component.async_update_entity( "sensor.invalid_entity_picture" ) await hass.helpers.entity_component.async_update_entity( "sensor.invalid_friendly_name" ) await hass.helpers.entity_component.async_update_entity("sensor.invalid_attribute") assert hass.states.get("sensor.invalid_state").state == "2" assert hass.states.get("sensor.invalid_icon").state == "hello" assert hass.states.get("sensor.invalid_entity_picture").state == "hello" assert hass.states.get("sensor.invalid_friendly_name").state == "hello" assert hass.states.get("sensor.invalid_attribute").state == "hello" async def test_unique_id(hass): """Test unique_id option only creates one sensor per id.""" await async_setup_component( hass, "sensor", { "sensor": { "platform": "template", "sensors": { "test_template_sensor_01": { "unique_id": "not-so-unique-anymore", "value_template": "{{ true }}", }, "test_template_sensor_02": { "unique_id": "not-so-unique-anymore", "value_template": "{{ false }}", }, }, } }, ) await hass.async_block_till_done() await hass.async_start() await hass.async_block_till_done() assert len(hass.states.async_all()) == 1
36.259314
110
0.507398
2,227
24,330
5.3022
0.070947
0.063686
0.051745
0.070799
0.814194
0.796325
0.768631
0.743733
0.679201
0.646257
0
0.00279
0.381217
24,330
670
111
36.313433
0.781534
0.040978
0
0.541133
0
0
0.257124
0.099891
0
0
0
0
0.16819
1
0.031079
false
0
0.005484
0
0.040219
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
8aaa418357a508172335402531790dd18e3ca344
46
py
Python
__init__.py
EpicSoftworks/pelican-prismjs
5030aefda5444ae004f20a9dc7ba1738c4db3942
[ "MIT" ]
null
null
null
__init__.py
EpicSoftworks/pelican-prismjs
5030aefda5444ae004f20a9dc7ba1738c4db3942
[ "MIT" ]
null
null
null
__init__.py
EpicSoftworks/pelican-prismjs
5030aefda5444ae004f20a9dc7ba1738c4db3942
[ "MIT" ]
null
null
null
# -- coding: utf-8 -- from .prismjs import *
11.5
22
0.586957
6
46
4.5
1
0
0
0
0
0
0
0
0
0
0
0.027778
0.217391
46
3
23
15.333333
0.722222
0.413043
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
8aadd2700922b6f4f678d250d680168d3aec3376
75
py
Python
src/pages/gallery/bootstrap_dashboard/__init__.py
mycarta/awesome-panel
dae17d11f686daaedd48b8e74ac4307c89e2b031
[ "Apache-2.0" ]
1
2020-05-08T21:44:37.000Z
2020-05-08T21:44:37.000Z
src/pages/gallery/bootstrap_dashboard/__init__.py
mycarta/awesome-panel
dae17d11f686daaedd48b8e74ac4307c89e2b031
[ "Apache-2.0" ]
null
null
null
src/pages/gallery/bootstrap_dashboard/__init__.py
mycarta/awesome-panel
dae17d11f686daaedd48b8e74ac4307c89e2b031
[ "Apache-2.0" ]
null
null
null
"""Here we export the bootstrap_dashboard view""" from .main import view
25
50
0.746667
11
75
5
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.16
75
2
51
37.5
0.873016
0.573333
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
8aafa5a24125ac9f57f049ff49f1eed9e3bff0da
55
py
Python
python/testData/inspections/PyUnresolvedReferencesInspection/formatStringPackedFunctionCall.py
teddywest32/intellij-community
e0268d7a1da1d318b441001448cdd3e8929b2f29
[ "Apache-2.0" ]
null
null
null
python/testData/inspections/PyUnresolvedReferencesInspection/formatStringPackedFunctionCall.py
teddywest32/intellij-community
e0268d7a1da1d318b441001448cdd3e8929b2f29
[ "Apache-2.0" ]
null
null
null
python/testData/inspections/PyUnresolvedReferencesInspection/formatStringPackedFunctionCall.py
teddywest32/intellij-community
e0268d7a1da1d318b441001448cdd3e8929b2f29
[ "Apache-2.0" ]
1
2020-11-27T10:36:50.000Z
2020-11-27T10:36:50.000Z
def f(): return dict(foo=0) '{foo}'.format(**f())
11
22
0.509091
9
55
3.111111
0.777778
0
0
0
0
0
0
0
0
0
0
0.022222
0.181818
55
5
23
11
0.6
0
0
0
0
0
0.089286
0
0
0
0
0
0
1
0.333333
true
0
0
0.333333
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
0
0
0
5
8ab2f41edadf2ecdfdcfe12ad2d38b0ea202f79d
93
py
Python
main.py
pecjas/Sidescroller-PyGame
dfcaf4ff95a1733714eaaeb00dc00cd876ab1468
[ "MIT" ]
null
null
null
main.py
pecjas/Sidescroller-PyGame
dfcaf4ff95a1733714eaaeb00dc00cd876ab1468
[ "MIT" ]
null
null
null
main.py
pecjas/Sidescroller-PyGame
dfcaf4ff95a1733714eaaeb00dc00cd876ab1468
[ "MIT" ]
null
null
null
import side_scroller.side_scroller as game if __name__ == "__main__": game.start_game()
18.6
42
0.752688
13
93
4.538462
0.692308
0.40678
0
0
0
0
0
0
0
0
0
0
0.150538
93
4
43
23.25
0.746835
0
0
0
0
0
0.086022
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
76f55721b5aea790104bf9c9a6b7a559a3f68eba
62
py
Python
test_yumi/yumi2.py
kyumiouchi/python-basic-to-advanced
a774085a5d0e0bfed90098e0f27c8fb7b760d9a7
[ "Apache-2.0" ]
null
null
null
test_yumi/yumi2.py
kyumiouchi/python-basic-to-advanced
a774085a5d0e0bfed90098e0f27c8fb7b760d9a7
[ "Apache-2.0" ]
null
null
null
test_yumi/yumi2.py
kyumiouchi/python-basic-to-advanced
a774085a5d0e0bfed90098e0f27c8fb7b760d9a7
[ "Apache-2.0" ]
null
null
null
course = 'Python program' def function2(): return course
12.4
25
0.693548
7
62
6.142857
0.857143
0
0
0
0
0
0
0
0
0
0
0.020408
0.209677
62
4
26
15.5
0.857143
0
0
0
0
0
0.225806
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
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
0a0e1b044e4274544af82f1862130e172d00b271
96
py
Python
venv/lib/python3.8/site-packages/cryptography/__about__.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
1
2021-11-07T22:40:27.000Z
2021-11-07T22:40:27.000Z
venv/lib/python3.8/site-packages/cryptography/__about__.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/cryptography/__about__.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/e7/cf/34/fc5891c71005ad8387807c3992af9c9120a19e0ce2cbc29bc1db51eae5
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.395833
0
96
1
96
96
0.5
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
0a4655448037fbb0649f7f5b3d6e3fe5f5429063
365
py
Python
api/error_handler.py
hbaltz/technical-test-kpi-intelligence-back
9e9241fabd465ef49b408c09ea8ee6ae35793dbf
[ "MIT" ]
null
null
null
api/error_handler.py
hbaltz/technical-test-kpi-intelligence-back
9e9241fabd465ef49b408c09ea8ee6ae35793dbf
[ "MIT" ]
null
null
null
api/error_handler.py
hbaltz/technical-test-kpi-intelligence-back
9e9241fabd465ef49b408c09ea8ee6ae35793dbf
[ "MIT" ]
null
null
null
''' Overrides standard error management to return json instead of html''' from flask import make_response, jsonify from . import app @app.errorhandler(404) def not_found(error): return make_response(jsonify({'error': 'Not found'}), 404) @app.errorhandler(500) def internl_eror(error): return make_response(jsonify({'error': 'Server internal error'}), 500)
33.181818
74
0.747945
50
365
5.36
0.54
0.134328
0.212687
0.171642
0.261194
0.261194
0
0
0
0
0
0.037618
0.126027
365
11
74
33.181818
0.802508
0.180822
0
0
0
0
0.136519
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
0.75
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
6a65ceb17c2bfe51b5d101c815b058273084422f
178
py
Python
app.py
aws-samples/aws-cdk-codecommit-pull-request-hook
07dbc449b7b975a4c1a47845ca04b39450f94a05
[ "MIT-0" ]
4
2021-07-07T13:12:04.000Z
2021-11-16T09:49:02.000Z
app.py
QPC-database/aws-cdk-codecommit-pull-request-hook
015994b2226b8982e077a1e768a1d377c5a1296b
[ "MIT-0" ]
null
null
null
app.py
QPC-database/aws-cdk-codecommit-pull-request-hook
015994b2226b8982e077a1e768a1d377c5a1296b
[ "MIT-0" ]
2
2021-07-11T01:50:16.000Z
2021-10-25T00:29:48.000Z
#!/usr/bin/env python3 from aws_cdk import core from cicd_pr_stack import CICDPullRequestStack app = core.App() CICDPullRequestStack(app, "CICDPullRequestStack") app.synth()
17.8
49
0.792135
23
178
6
0.652174
0.5
0.376812
0
0
0
0
0
0
0
0
0.006329
0.11236
178
9
50
19.777778
0.867089
0.117978
0
0
0
0
0.128205
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
6a9e8ea122da4e84ced0568d4532d97cf114ab20
57
py
Python
ECP5/clk_constraint.py
Jadavis123/fpga-pulses-ice
30c63e583c23c5321942bb18d394b70fde0066c9
[ "BSD-3-Clause" ]
null
null
null
ECP5/clk_constraint.py
Jadavis123/fpga-pulses-ice
30c63e583c23c5321942bb18d394b70fde0066c9
[ "BSD-3-Clause" ]
null
null
null
ECP5/clk_constraint.py
Jadavis123/fpga-pulses-ice
30c63e583c23c5321942bb18d394b70fde0066c9
[ "BSD-3-Clause" ]
null
null
null
ctx.addClock("clk", 50.0) ctx.addClock("clk_pll", 100.0)
19
30
0.684211
11
57
3.454545
0.636364
0.578947
0.736842
0
0
0
0
0
0
0
0
0.132075
0.070175
57
2
31
28.5
0.584906
0
0
0
0
0
0.175439
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
6ad4fc7258e9182d03d9f9962e15c690a36e9ce7
645
py
Python
slack/web/classes/blocks.py
timgates42/python-slack-sdk
6339fbe81031c9aec3f95927ac03706fd31f3544
[ "MIT" ]
2,486
2016-11-03T14:31:43.000Z
2020-10-26T23:07:44.000Z
slack/web/classes/blocks.py
timgates42/python-slack-sdk
6339fbe81031c9aec3f95927ac03706fd31f3544
[ "MIT" ]
721
2016-11-03T21:26:56.000Z
2020-10-26T12:41:29.000Z
slack/web/classes/blocks.py
timgates42/python-slack-sdk
6339fbe81031c9aec3f95927ac03706fd31f3544
[ "MIT" ]
627
2016-11-02T19:04:19.000Z
2020-10-25T19:21:13.000Z
from slack import deprecation from slack_sdk.models.blocks import ActionsBlock # noqa from slack_sdk.models.blocks import Block # noqa from slack_sdk.models.blocks import CallBlock # noqa from slack_sdk.models.blocks import ContextBlock # noqa from slack_sdk.models.blocks import DividerBlock # noqa from slack_sdk.models.blocks import FileBlock # noqa from slack_sdk.models.blocks import HeaderBlock # noqa from slack_sdk.models.blocks import ImageBlock # noqa from slack_sdk.models.blocks import InputBlock # noqa from slack_sdk.models.blocks import SectionBlock # noqa deprecation.show_message(__name__, "slack_sdk.models.blocks")
46.071429
61
0.821705
92
645
5.586957
0.228261
0.192607
0.299611
0.428016
0.653697
0.653697
0.595331
0
0
0
0
0
0.11938
645
13
62
49.615385
0.90493
0.075969
0
0
0
0
0.039316
0.039316
0
0
0
0
0
1
0
true
0
0.916667
0
0.916667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0a76307ce9057b85cbe291af993139a606335d62
3,579
py
Python
tests/test_simpleitem.py
dinceraslancom/simpleitem
6488bbb61b82d90b364eec412a42f9d35fe646ef
[ "MIT" ]
7
2021-09-05T13:28:23.000Z
2022-01-08T13:15:13.000Z
tests/test_simpleitem.py
dinceraslancom/simpleitem
6488bbb61b82d90b364eec412a42f9d35fe646ef
[ "MIT" ]
null
null
null
tests/test_simpleitem.py
dinceraslancom/simpleitem
6488bbb61b82d90b364eec412a42f9d35fe646ef
[ "MIT" ]
null
null
null
import unittest from simpleitem import SimpleItem class SimpleItemTestCase(unittest.TestCase): def setUp(self) -> None: self.item1 = SimpleItem() self.item1.node1 = 1 self.item1.node2.node3 = 3 self.item2 = SimpleItem() self.item2['node1'] = 1 self.item2['node2']['node3'] = 3 self.item3 = SimpleItem(node1=1, node2={'node3': 3}) self.item4 = SimpleItem(**{'node1': 1, 'node2': {'node3': 3}}) self.item5 = SimpleItem() self.item5(node1=1, node2={'node3': 3}) self.item6 = SimpleItem() self.item6(**{'node1': 1, 'node2': {'node3': 3}}) self.item7 = SimpleItem() self.item7.from_yaml('test_files/test.yaml') def test_getitem(self): self.assertEqual(self.item1['node1'], 1) self.assertEqual(self.item1['node2']['node3'], 3) self.assertIsInstance(self.item1['node2'], SimpleItem) self.assertEqual(self.item2['node1'], 1) self.assertEqual(self.item2['node2']['node3'], 3) self.assertIsInstance(self.item2['node2'], SimpleItem) self.assertEqual(self.item3['node1'], 1) self.assertEqual(self.item3['node2']['node3'], 3) self.assertIsInstance(self.item3['node2'], SimpleItem) self.assertEqual(self.item4['node1'], 1) self.assertEqual(self.item4['node2']['node3'], 3) self.assertIsInstance(self.item4['node2'], SimpleItem) self.assertEqual(self.item5['node1'], 1) self.assertEqual(self.item5['node2']['node3'], 3) self.assertIsInstance(self.item5['node2'], SimpleItem) self.assertEqual(self.item6['node1'], 1) self.assertEqual(self.item6['node2']['node3'], 3) self.assertIsInstance(self.item6['node2'], SimpleItem) def test_getattr(self): self.assertEqual(self.item1.node1, 1) self.assertEqual(self.item1.node2.node3, 3) self.assertIsInstance(self.item1.node2, SimpleItem) self.assertEqual(self.item2.node1, 1) self.assertEqual(self.item2.node2.node3, 3) self.assertIsInstance(self.item2.node2, SimpleItem) self.assertEqual(self.item3.node1, 1) self.assertEqual(self.item3.node2.node3, 3) self.assertIsInstance(self.item3.node2, SimpleItem) self.assertEqual(self.item4.node1, 1) self.assertEqual(self.item4.node2.node3, 3) self.assertIsInstance(self.item4.node2, SimpleItem) self.assertEqual(self.item5.node1, 1) self.assertEqual(self.item5.node2.node3, 3) self.assertIsInstance(self.item5.node2, SimpleItem) self.assertEqual(self.item6.node1, 1) self.assertEqual(self.item6.node2.node3, 3) self.assertIsInstance(self.item6.node2, SimpleItem) def test_setattr(self): self.assertIsInstance(self.item1.test_setattr_node1, SimpleItem) def test_setitem(self): self.assertIsInstance(self.item1['test_setitem1_node1'], SimpleItem) def test_keys(self): self.assertEqual(self.item1.keys, ('node1', 'node2')) self.assertEqual(self.item2.keys, ('node1', 'node2')) self.assertEqual(self.item3.keys, ('node1', 'node2')) self.assertEqual(self.item4.keys, ('node1', 'node2')) self.assertEqual(self.item5.keys, ('node1', 'node2')) self.assertEqual(self.item6.keys, ('node1', 'node2')) def test_from_yalm(self): self.assertEqual(self.item7.settings.username, 'admin') self.assertEqual(self.item7.settings.host, '0.0.0.0') if __name__ == '__main__': unittest.main()
35.79
76
0.643476
418
3,579
5.45933
0.102871
0.210342
0.266433
0.118317
0.807625
0.754163
0.609991
0.582822
0.582822
0.582822
0
0.063176
0.199497
3,579
99
77
36.151515
0.733333
0
0
0
0
0
0.082146
0
0
0
0
0
0.638889
1
0.097222
false
0
0.027778
0
0.138889
0
0
0
0
null
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5