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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c445f7b208836c3fbce86b07e69b41707ccdba71
| 188
|
py
|
Python
|
codewars/7kyu/doha22/sort_numbers/test.py
|
doha22/Training_one
|
0cd7cf86c7da0f6175834146296b763d1841766b
|
[
"MIT"
] | null | null | null |
codewars/7kyu/doha22/sort_numbers/test.py
|
doha22/Training_one
|
0cd7cf86c7da0f6175834146296b763d1841766b
|
[
"MIT"
] | 2
|
2019-01-22T10:53:42.000Z
|
2019-01-31T08:02:48.000Z
|
codewars/7kyu/doha22/sort_numbers/test.py
|
doha22/Training_one
|
0cd7cf86c7da0f6175834146296b763d1841766b
|
[
"MIT"
] | 13
|
2019-01-22T10:37:42.000Z
|
2019-01-25T13:30:43.000Z
|
import unittest
from sort_numbers import solution
def test_solution(benchmark):
assert benchmark(solution,[1,2,10,5]) == [1,2,5,10]
assert benchmark(solution,[3,1,4]) == [1,3,4]
| 23.5
| 55
| 0.696809
| 31
| 188
| 4.16129
| 0.516129
| 0.232558
| 0.356589
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098765
| 0.138298
| 188
| 7
| 56
| 26.857143
| 0.697531
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c4622302bdc70f93ab1dc61522b6a6f34fd62ebf
| 3,395
|
py
|
Python
|
apps/worker/src/main/routes/groups/routes.py
|
aisportsbets/pygrid
|
eeee1e7ef6ba50a03f6f486992a45f7171976e5a
|
[
"Apache-2.0"
] | null | null | null |
apps/worker/src/main/routes/groups/routes.py
|
aisportsbets/pygrid
|
eeee1e7ef6ba50a03f6f486992a45f7171976e5a
|
[
"Apache-2.0"
] | null | null | null |
apps/worker/src/main/routes/groups/routes.py
|
aisportsbets/pygrid
|
eeee1e7ef6ba50a03f6f486992a45f7171976e5a
|
[
"Apache-2.0"
] | null | null | null |
from .blueprint import groups_blueprint as group_route
from flask import request, Response
import json
from syft.grid.messages.group_messages import (
CreateGroupMessage,
DeleteGroupMessage,
GetGroupMessage,
GetGroupsMessage,
UpdateGroupMessage,
)
from ..auth import error_handler, token_required
from ...core.task_handler import route_logic
from ...core.node import node
@group_route.route("", methods=["POST"])
@token_required
def create_group_route(current_user):
# Get request body
content = request.get_json()
if not content:
content = {}
content["current_user"] = current_user
status_code, response_msg = error_handler(
route_logic, CreateGroupMessage, current_user, content
)
response = response_msg if isinstance(response_msg, dict) else response_msg.content
return Response(
json.dumps(response),
status=status_code,
mimetype="application/json",
)
@group_route.route("", methods=["GET"])
@token_required
def get_all_groups_routes(current_user):
# Get request body
content = request.get_json()
if not content:
content = {}
content["current_user"] = current_user
status_code, response_msg = error_handler(
route_logic, GetGroupsMessage, current_user, content
)
response = response_msg if isinstance(response_msg, dict) else response_msg.content
return Response(
json.dumps(response),
status=status_code,
mimetype="application/json",
)
@group_route.route("/<group_id>", methods=["GET"])
@token_required
def get_specific_group_route(current_user, group_id):
# Get request body
content = request.get_json()
if not content:
content = {}
content["current_user"] = current_user
content["group_id"] = group_id
status_code, response_msg = error_handler(
route_logic, GetGroupMessage, current_user, content
)
response = response_msg if isinstance(response_msg, dict) else response_msg.content
return Response(
json.dumps(response),
status=status_code,
mimetype="application/json",
)
@group_route.route("/<group_id>", methods=["PUT"])
@token_required
def update_group_route(current_user, group_id):
# Get request body
content = request.get_json()
if not content:
content = {}
content["current_user"] = current_user
content["group_id"] = group_id
status_code, response_msg = error_handler(
route_logic, UpdateGroupMessage, current_user, content
)
response = response_msg if isinstance(response_msg, dict) else response_msg.content
return Response(
json.dumps(response),
status=status_code,
mimetype="application/json",
)
@group_route.route("/<group_id>", methods=["DELETE"])
@token_required
def delete_group_route(current_user, group_id):
# Get request body
content = request.get_json()
if not content:
content = {}
content["current_user"] = current_user
content["group_id"] = group_id
status_code, response_msg = error_handler(
route_logic, DeleteGroupMessage, current_user, content
)
response = response_msg if isinstance(response_msg, dict) else response_msg.content
return Response(
json.dumps(response),
status=status_code,
mimetype="application/json",
)
| 26.317829
| 87
| 0.696024
| 395
| 3,395
| 5.713924
| 0.141772
| 0.097475
| 0.063802
| 0.046522
| 0.76739
| 0.76739
| 0.744794
| 0.744794
| 0.744794
| 0.744794
| 0
| 0
| 0.208247
| 3,395
| 128
| 88
| 26.523438
| 0.839658
| 0.024742
| 0
| 0.604167
| 0
| 0
| 0.065356
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.052083
| false
| 0
| 0.072917
| 0
| 0.177083
| 0.010417
| 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
|
675f9e34839bafe50b9710a36a0fac5e753048bc
| 1,472
|
py
|
Python
|
src/genie/libs/parser/iosxe/tests/ShowIpSlaSummary/cli/equal/golden_output_2_expected.py
|
balmasea/genieparser
|
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
|
[
"Apache-2.0"
] | 204
|
2018-06-27T00:55:27.000Z
|
2022-03-06T21:12:18.000Z
|
src/genie/libs/parser/iosxe/tests/ShowIpSlaSummary/cli/equal/golden_output_2_expected.py
|
balmasea/genieparser
|
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
|
[
"Apache-2.0"
] | 468
|
2018-06-19T00:33:18.000Z
|
2022-03-31T23:23:35.000Z
|
src/genie/libs/parser/iosxe/tests/ShowIpSlaSummary/cli/equal/golden_output_2_expected.py
|
balmasea/genieparser
|
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
|
[
"Apache-2.0"
] | 309
|
2019-01-16T20:21:07.000Z
|
2022-03-30T12:56:41.000Z
|
expected_output = {
'ids': {
'100': {
'state': 'active',
'type': 'icmp-jitter',
'destination': '192.0.2.2',
'rtt_stats': '100',
'rtt_stats_msecs': 100,
'return_code': 'OK',
'last_run': '22:49:53 PST Tue May 3 2011'
},
'101': {
'state': 'active',
'type': 'udp-jitter',
'destination': '192.0.2.2',
'rtt_stats': '100',
'rtt_stats_msecs': 100,
'return_code': 'OK',
'last_run': '22:49:53 PST Tue May 3 2011'
},
'102': {
'state': 'active',
'type': 'tcp-connect',
'destination': '192.0.2.2',
'rtt_stats': '-',
'return_code': 'NoConnection',
'last_run': '22:49:53 PST Tue May 3 2011'
},
'103': {
'state': 'active',
'type': 'video',
'destination': '2001:db8:130f:d1c8::222',
'rtt_stats': '100',
'rtt_stats_msecs': 100,
'return_code': 'OK',
'last_run': '22:49:53 PST Tue May 3 2011'
},
'104': {
'state': 'active',
'type': 'video',
'destination': '2001:db8:130f:d1c8::222',
'rtt_stats': '100',
'rtt_stats_msecs': 100,
'return_code': 'OK',
'last_run': '22:49:53 PST Tue May 3 2011'
}
}
}
| 30.040816
| 53
| 0.407609
| 153
| 1,472
| 3.764706
| 0.281046
| 0.125
| 0.130208
| 0.095486
| 0.798611
| 0.798611
| 0.798611
| 0.755208
| 0.755208
| 0.755208
| 0
| 0.160279
| 0.415082
| 1,472
| 48
| 54
| 30.666667
| 0.508711
| 0
| 0
| 0.604167
| 0
| 0
| 0.428668
| 0.03125
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 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
|
679541951dcef8c2672f484489eea87b2d68b4e2
| 659
|
py
|
Python
|
Mundo #02/ex68-a15-par-ou-impar-while.py
|
freitasSystemOutPrint/Python3
|
e5e88fbe8e7e0c5472573d2c901844270385194b
|
[
"MIT"
] | 1
|
2020-06-02T07:31:16.000Z
|
2020-06-02T07:31:16.000Z
|
Mundo #02/ex68-a15-par-ou-impar-while.py
|
freitasSystemOutPrint/Python3
|
e5e88fbe8e7e0c5472573d2c901844270385194b
|
[
"MIT"
] | null | null | null |
Mundo #02/ex68-a15-par-ou-impar-while.py
|
freitasSystemOutPrint/Python3
|
e5e88fbe8e7e0c5472573d2c901844270385194b
|
[
"MIT"
] | null | null | null |
rom random import randint jogador = contador = 0 while True: opcao = 'nula' computador = randint(1, 10) jogador = int(input('Escolha um número: ')) soma = computador + jogador while not opcao in 'PpIi': opcao = input('Par ou impar [p/i]: ') print(f'VOCÊ JOGOU {jogador} E O COMPUTADOR JOGOU {computador}! A soma deu {soma}.') if soma % 2 == 0 and opcao in 'pP': print('Deu PAR!\n') elif soma % 2 != 0 and opcao in 'Ii': print('Deu IMPAR!\n') else: break print('PARABÉNS, VOCÊ VENCEU. Vamos jogar novamente:') contador += 1 print(f'\nGAME OVER! VOCÊ PERDEU APÓS {contador} VITÓRIAS!'
| 329.5
| 658
| 0.610015
| 94
| 659
| 4.276596
| 0.585106
| 0.052239
| 0.029851
| 0.044776
| 0.079602
| 0.079602
| 0
| 0
| 0
| 0
| 0
| 0.018443
| 0.259484
| 659
| 1
| 659
| 659
| 0.805328
| 0
| 0
| 0
| 0
| 0
| 0.367223
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 1
| null | null | 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
679ce48003106e7dee3fc070609e13a8520d5d39
| 238
|
py
|
Python
|
virtualis/methods/card_aware.py
|
valeriangalliat/virtualis-client
|
5972c3dd4abfe00f967a30bf84e5db47771e7034
|
[
"Unlicense"
] | null | null | null |
virtualis/methods/card_aware.py
|
valeriangalliat/virtualis-client
|
5972c3dd4abfe00f967a30bf84e5db47771e7034
|
[
"Unlicense"
] | null | null | null |
virtualis/methods/card_aware.py
|
valeriangalliat/virtualis-client
|
5972c3dd4abfe00f967a30bf84e5db47771e7034
|
[
"Unlicense"
] | null | null | null |
from . import Request
class CardAwareRequest(Request):
def __init__(self, card):
self.card = card
def query(self):
return {
'CardType': self.card.type,
'VCardId': self.card.id,
}
| 18.307692
| 39
| 0.55042
| 25
| 238
| 5.08
| 0.6
| 0.251969
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.336134
| 238
| 12
| 40
| 19.833333
| 0.803797
| 0
| 0
| 0
| 0
| 0
| 0.063025
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.111111
| 0.111111
| 0.555556
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
e1dfa3b5ec1ef5b7a1c3dc7b8be7d9605ce94362
| 5,093
|
py
|
Python
|
test/cnnl/op_test/test_round.py
|
Cambricon/catch
|
2625da389f25a67066d20fb6b0c38250ef98f8ab
|
[
"BSD-2-Clause"
] | 20
|
2022-03-01T11:40:51.000Z
|
2022-03-30T08:17:47.000Z
|
test/cnnl/op_test/test_round.py
|
Cambricon/catch
|
2625da389f25a67066d20fb6b0c38250ef98f8ab
|
[
"BSD-2-Clause"
] | null | null | null |
test/cnnl/op_test/test_round.py
|
Cambricon/catch
|
2625da389f25a67066d20fb6b0c38250ef98f8ab
|
[
"BSD-2-Clause"
] | null | null | null |
from __future__ import print_function
import sys
import os
import unittest
import logging
import torch
import torch_mlu.core.mlu_model as ct # pylint: disable=W0611
cur_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(cur_dir + "/../../")
from common_utils import testinfo, TestCase # pylint: disable=C0413,C0411
logging.basicConfig(level=logging.DEBUG)
class TestOps(TestCase):
#@unittest.skip("not test")
@testinfo()
def test_round(self):
shape_list = [(2,3,4,3,4,2,1),(2,3,4),(1,32,5,12,8),
(2,128,10,6),(2,512,8),(1,100),(24,)]
for i, _ in enumerate(shape_list):
x = torch.randn(shape_list[i], dtype=torch.float)
out_cpu = torch.round(x)
out_mlu = torch.round(self.to_mlu(x))
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0)
#@unittest.skip("not test")
@testinfo()
def test_round_channel_last(self):
shape = (2,128,10,6)
x = torch.randn(shape, dtype=torch.float).to(memory_format=torch.channels_last)
out_cpu = torch.round(x)
out_mlu = torch.round(self.to_mlu(x))
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0)
#@unittest.skip("not test")
@testinfo()
def test_round_not_dense(self):
shape_list = [(2,3,4),(1,32,5,12,8),
(2,128,10,6)]
for i, _ in enumerate(shape_list):
x = torch.randn(shape_list[i], dtype=torch.float)
out_cpu = torch.round(x[:, ... , :2])
out_mlu = torch.round(self.to_mlu(x)[:, ... , :2])
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0)
#@unittest.skip("not test")
@testinfo()
def test_round_inplace(self):
shape_list = [(2,3,4,3,4,2,1),(2,3,4),(1,32,5,12,8),
(2,128,10,6),(2,512,8),(1,100),(24,)]
for i, _ in enumerate(shape_list):
x_cpu = torch.randn(shape_list[i], dtype=torch.float)
x_mlu = x_cpu.to('mlu')
out_cpu = torch.round_(x_cpu)
out_mlu = torch.round_(x_mlu)
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0)
self.assertTensorsEqual(x_cpu, x_mlu.cpu(), 0)
x_cpu = torch.randn(shape_list[i], dtype=torch.float)
x_mlu = x_cpu.to('mlu')
x_cpu.round_()
x_mlu.round_()
self.assertTensorsEqual(x_cpu, x_mlu.cpu(), 0)
#@unittest.skip("not test")
@testinfo()
def test_round_inplace_channel_last(self):
shape_list = [(32,5,12,8),
(2,128,10,6)]
for i, _ in enumerate(shape_list):
x_cpu = torch.randn(shape_list[i]).to(memory_format=torch.channels_last)
x_mlu = x_cpu.to('mlu')
out_cpu = torch.round_(x_cpu)
out_mlu = torch.round_(x_mlu)
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0)
self.assertTensorsEqual(x_cpu, x_mlu.cpu(), 0)
x_cpu = torch.randn(shape_list[i]).to(memory_format=torch.channels_last)
x_mlu = x_cpu.to('mlu')
x_cpu.round_()
x_mlu.round_()
self.assertTensorsEqual(x_cpu, x_mlu.cpu(), 0)
#@unittest.skip("not test")
@testinfo()
def test_round_inplace_not_dense(self):
shape_list = [(2,3,4),(1,32,5,12,8),
(2,128,10,6)]
for i, _ in enumerate(shape_list):
x_cpu = torch.randn(shape_list[i], dtype=torch.float)
x_mlu = x_cpu.to('mlu')
out_cpu = torch.round_(x_cpu[:, ... , :2])
out_mlu = torch.round_(x_mlu[:, ... , :2])
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0)
self.assertTensorsEqual(x_cpu, x_mlu.cpu(), 0)
x_cpu = torch.randn(shape_list[i], dtype=torch.float)
x_mlu = x_cpu.to('mlu')
x_cpu[:, ... , :2].round_()
x_mlu[:, ... , :2].round_()
self.assertTensorsEqual(x_cpu, x_mlu.cpu(), 0)
#@unittest.skip("not test")
@testinfo()
def test_round_out(self):
shape_list = [(2,3,4,3,4,2,1),(2,3,4),(1,32,5,12,8),
(2,128,10,6),(2,512,8),(1,100),(24,)]
for i, _ in enumerate(shape_list):
x_cpu = torch.randn(shape_list[i], dtype=torch.float)
x_mlu = x_cpu.to('mlu')
out_tmpcpu = torch.zeros(shape_list[i])
out_tmpmlu = torch.zeros(shape_list[i]).to('mlu')
out_tmpcpu_2 = torch.zeros((1))
out_tmpmlu_2 = torch.zeros((1)).to('mlu')
out_cpu = torch.round(x_cpu, out=out_tmpcpu)
out_mlu = torch.round(x_mlu, out=out_tmpmlu)
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0)
self.assertTensorsEqual(out_tmpcpu, out_tmpmlu.cpu(), 0)
out_cpu_2 = torch.round(x_cpu, out=out_tmpcpu_2)
out_mlu_2 = torch.round(x_mlu, out=out_tmpmlu_2)
self.assertTensorsEqual(out_cpu_2, out_mlu_2.cpu(), 0)
self.assertTensorsEqual(out_tmpcpu_2, out_tmpmlu_2.cpu(), 0)
if __name__ == "__main__":
unittest.main()
| 39.176923
| 87
| 0.574121
| 748
| 5,093
| 3.649733
| 0.112299
| 0.041026
| 0.052381
| 0.062637
| 0.804762
| 0.778755
| 0.741758
| 0.70989
| 0.686081
| 0.675092
| 0
| 0.054989
| 0.268015
| 5,093
| 129
| 88
| 39.48062
| 0.677307
| 0.045356
| 0
| 0.613208
| 0
| 0
| 0.008656
| 0
| 0
| 0
| 0
| 0
| 0.150943
| 1
| 0.066038
| false
| 0
| 0.075472
| 0
| 0.150943
| 0.009434
| 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
|
223f7ea87976ca61e366ffb2400729d423e625bd
| 26
|
py
|
Python
|
base/test-show-scope/func-5.py
|
jpolitz/lambda-py-paper
|
746ef63fc1123714b4adaf78119028afbea7bd76
|
[
"Apache-2.0"
] | 25
|
2015-04-16T04:31:49.000Z
|
2022-03-10T15:53:28.000Z
|
base/test-show-scope/func-5.py
|
jpolitz/lambda-py-paper
|
746ef63fc1123714b4adaf78119028afbea7bd76
|
[
"Apache-2.0"
] | 1
|
2018-11-21T22:40:02.000Z
|
2018-11-26T17:53:11.000Z
|
base/test-show-scope/func-5.py
|
jpolitz/lambda-py-paper
|
746ef63fc1123714b4adaf78119028afbea7bd76
|
[
"Apache-2.0"
] | 1
|
2021-03-26T03:36:19.000Z
|
2021-03-26T03:36:19.000Z
|
def f():
x = 5
return x
| 6.5
| 9
| 0.5
| 6
| 26
| 2.166667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.346154
| 26
| 3
| 10
| 8.666667
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
226d776dfbc372079f5b240419bd12599b1519c5
| 33
|
py
|
Python
|
Animation/__init__.py
|
olesmith/SmtC
|
dfae5097f02192b60aae05b9d02404fcfe893be3
|
[
"CC0-1.0"
] | null | null | null |
Animation/__init__.py
|
olesmith/SmtC
|
dfae5097f02192b60aae05b9d02404fcfe893be3
|
[
"CC0-1.0"
] | null | null | null |
Animation/__init__.py
|
olesmith/SmtC
|
dfae5097f02192b60aae05b9d02404fcfe893be3
|
[
"CC0-1.0"
] | null | null | null |
from Main import Animation
| 11
| 31
| 0.69697
| 4
| 33
| 5.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.30303
| 33
| 2
| 32
| 16.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
97fe769bbfc4a57abcb4e958b79cda544086d53e
| 89
|
py
|
Python
|
address/admin.py
|
Armestrong/Tourist_Attractions
|
8bcc60cd135cc92f32d3e82485cb45e1ecd4714a
|
[
"MIT"
] | null | null | null |
address/admin.py
|
Armestrong/Tourist_Attractions
|
8bcc60cd135cc92f32d3e82485cb45e1ecd4714a
|
[
"MIT"
] | null | null | null |
address/admin.py
|
Armestrong/Tourist_Attractions
|
8bcc60cd135cc92f32d3e82485cb45e1ecd4714a
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Addres
admin.site.register(Addres)
| 17.8
| 32
| 0.820225
| 13
| 89
| 5.615385
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11236
| 89
| 4
| 33
| 22.25
| 0.924051
| 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
|
3f0204cbedef38b7212139677031197af7161a4a
| 478
|
py
|
Python
|
spec/python/test_imports_circular_a.py
|
cherue/kaitai_struct_tests
|
86ff5169a24c8f5400453320721d86c675c53086
|
[
"MIT"
] | null | null | null |
spec/python/test_imports_circular_a.py
|
cherue/kaitai_struct_tests
|
86ff5169a24c8f5400453320721d86c675c53086
|
[
"MIT"
] | null | null | null |
spec/python/test_imports_circular_a.py
|
cherue/kaitai_struct_tests
|
86ff5169a24c8f5400453320721d86c675c53086
|
[
"MIT"
] | null | null | null |
import unittest
from imports_circular_a import ImportsCircularA
class TestImportsCircularA(unittest.TestCase):
def test_imports_circular_a(self):
r = ImportsCircularA.from_file("src/fixed_struct.bin")
self.assertEqual(r.code, 0x50)
self.assertEqual(r.two.initial, 0x41)
self.assertEqual(r.two.back_ref.code, 0x43)
self.assertEqual(r.two.back_ref.two.initial, 0x4b)
self.assertFalse(hasattr(r.two.back_ref.two, 'back_ref'))
| 34.142857
| 65
| 0.728033
| 64
| 478
| 5.265625
| 0.484375
| 0.178042
| 0.189911
| 0.169139
| 0.204748
| 0.154303
| 0
| 0
| 0
| 0
| 0
| 0.0275
| 0.16318
| 478
| 13
| 66
| 36.769231
| 0.815
| 0
| 0
| 0
| 0
| 0
| 0.058577
| 0
| 0
| 0
| 0.033473
| 0
| 0.5
| 1
| 0.1
| false
| 0
| 0.5
| 0
| 0.7
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
3f0ebd6f9da90c31105befc8ab154a3d361d7fbb
| 18,456
|
py
|
Python
|
rh_DOGE_bot_2021_v1.py
|
0x00C0DE/robinhood_crypto_bot
|
831b1ae663a1819497fdf8e8034b87558fa97bb5
|
[
"MIT"
] | null | null | null |
rh_DOGE_bot_2021_v1.py
|
0x00C0DE/robinhood_crypto_bot
|
831b1ae663a1819497fdf8e8034b87558fa97bb5
|
[
"MIT"
] | null | null | null |
rh_DOGE_bot_2021_v1.py
|
0x00C0DE/robinhood_crypto_bot
|
831b1ae663a1819497fdf8e8034b87558fa97bb5
|
[
"MIT"
] | null | null | null |
import robin_stocks
import math
import pyotp
import sched
import time
import sys
# Program description:
# A Robinhood bot created to automatically monitor and trade crypto currency currently supported by Robinhood.
# Works specifically for DOGE.
#
# This bot runs a scheduler every 5 minutes in order to update the prices on a 5 minute interval for a
# list that will hold the previous prices for 30 minutes.
#
# This bot [REQUIRES] a individual to already have SET amount of shares of the current crypto they want to trade.
#
# Instructions after entering in login information (no particular order):
#
# 1. Fill in ticker (since this bot is specifically for DOGE, should be left alone)
# 2. Fill in average_cost
# 3. Fill in Shares2Buy amount (in dollars $)
# 4. Fill in Shares2Sell amount (in dollars $)
# 5. Fill in num_shares
#
# Some buying and selling errors will occur if a individual does not have enough shares to sell or enough money to buy.
# If errors occur, simply re-update through redoing instructions above and restart the program.
# Robinhood.login(username="example72", password="AnotherExample8")
totp = pyotp.TOTP("Sauce").now()
login = robin_stocks.login("", "")
# Scheduler created to run every 5 mins
s = sched.scheduler(time.time, time.sleep)
# 5 min interval price history list, for every 30 minutes
SE3P = []
Mazda = []
counter1 = 1.0
counter2 = 1.0
Shares2Sell = 0.00
Shares2Buy = 0.00
# step (5)
# number of shares based on (total cost / Shares2Buy)
# EX: ($2940 / 20) = 147
num_shares = 147
# step (2)
# average cost
average_cost = 0.363
def run(sc):
# crypto currency ticker available on robinhood
ticker = "DOGE"
global SE3P
global Mazda
global Shares2Sell
global Shares2Buy
global counter1
global counter2
global average_cost
global num_shares
r = robin_stocks.crypto.get_crypto_quote(ticker, info="mark_price")
#r = robin_stocks.robinhood.get_latest_price(ticker)
print(ticker + ": $" + str(r))
SE3P.append(r)
if len(SE3P) > 6:
# if there are 5 or more elements in the list, rearrange positions
Mazda = SE3P[1:6]
SE3P = SE3P[-1:]
SE3P = Mazda + SE3P
print("Cleared and repositioned")
if len(SE3P) == 1:
#0min
print("appended SE3P[0]")
print(SE3P)
elif len(SE3P) == 2:
#SE3P.append(r) #5min
print("appended SE3P[1]")
print(SE3P)
elif len(SE3P) == 3:
#SE3P.append(r) #10min
print("appended SE3P[2]")
print(SE3P)
elif len(SE3P) == 4:
#SE3P.append(r) #15min
print("appended SE3P[3]")
print(SE3P)
elif len(SE3P) == 5:
#SE3P.append(r) #20min
print("appended SE3P[4]")
print(SE3P)
elif len(SE3P) == 6:
#SE3P.append(r) #25min
print("appended SE3P[5]")
print(SE3P)
# BUY
# if it's been less than 30 minutes since the start of the program
if counter1 < 6:
# For each 5 minutes, compare the inital price at the start of the program to the current price.
# Each 5 minutes passed, checks if difference is larger than a manually set percentage, progressively increasing the difference boundary.
# If the initial starting price when the program started multiplied by a set percentage, is greater than the current price AND
# the current price is lower than the average cost minus a set percentage, then buy Shares2Buy amount in dollars.
# If Bought, updates the average_cost and num_shares.
if counter1 == 6:
if float(SE3P[0])*1.005 > float(r) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif counter1 == 5:
if float(SE3P[0])*1.0045 > float(r) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif counter1 == 4:
if float(SE3P[0])*1.004 > float(r) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif counter1 == 3:
if float(SE3P[0])*1.0035 > float(r) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif counter1 == 2:
if float(SE3P[0])*1.003 > float(r) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
#BUY
# if first price is < than 2nd
# if it has been 30 minutes or more since the start of the program
if counter1 >= 6:
# For each 5 minutes, compare the current price to each index of the list in order starting with [1]-[5] since the current price would be [0].
# Each 5 minutes passed, checks if difference is larger than a manually set percentage, progressively increasing the difference boundary.
# If the current price multiplied by a set percentage, is less than one of the indices AND
# the current price is lower than the average cost minus a set percentage, then buy Shares2Buy amount in dollars.
# If Bought, updates the average_cost and num_shares.
if float(r)*1.004 < float(SE3P[0]) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif float(r)*1.005 < float(SE3P[1]) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif float(r)*1.006 < float(SE3P[2]) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif float(r)*1.007 < float(SE3P[3]) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif float(r)*1.008 < float(SE3P[4]) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
elif float(r)*1.01 < float(SE3P[5]) and float(r) < float(average_cost-float(average_cost*float(0.015))):
# instruction step (3) fill in amount in dollars in place of float(20)
Shares2Buy = math.floor(float(20) / float(r)-1)
crypto_BUY(ticker, Shares2Buy)
print("bought:", r)
tempval = average_cost*num_shares
average_cost = tempval
average_cost += float(r)
num_shares += 1
average_cost /= float(num_shares)
print("avg cost:" + str(average_cost))
#SELL
# if it's been less than 30 minutes since the start of the program
if counter2 < 6:
# For each 5 minutes, compare the inital price at the start of the program to the current price.
# Each 5 minutes passed, checks if difference is larger than a manually set percentage, progressively increasing the difference boundary.
# If the initial starting price when the program started multiplied by a set percentage, is less than the current price AND
# the current price is greater than the average cost plus a set percentage, then sell Shares2Sell amount in dollars.
# If Sold, updates the average_cost and num_shares.
if counter2 == 6:
if float(SE3P[0])*1.0115 < float(r) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif counter2 == 5:
if float(SE3P[0])*1.0105 < float(r) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif counter2 == 4:
if float(SE3P[0])*1.0095 < float(r) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif counter2 == 3:
if float(SE3P[0])*1.0085 < float(r) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif counter2 == 2:
if float(SE3P[0])*1.0075 < float(r) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
#SELL
# if it has been 30 minutes or more since the start of the program
if counter2 >= 6:
# For each 5 minutes, compare the current price to each index of the list in order starting with [1]-[5] since the current price would be [0].
# Each 5 minutes passed, checks if difference is larger than a manually set percentage, progressively increasing the difference boundary.
# If the current price multiplied by a set percentage, is greater than one of the indices AND
# the current price is greater than the average cost plus a set percentage, then sell Shares2Sell amount in dollars.
# If Sold, updates the average_cost and num_shares.
if float(r)*0.996 > float(SE3P[0]) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif float(r)*0.995 > float(SE3P[1]) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif float(r)*0.993 > float(SE3P[2]) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif float(r)*0.991 > float(SE3P[3]) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif float(r)*0.989 > float(SE3P[4]) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
elif float(r)*0.987 > float(SE3P[5]) and float(r) > float(average_cost+float(average_cost*float(0.04))):
# instruction step (4) fill in amount in dollars in place of float(100)
Shares2Sell = math.floor(float(40) / float(r)+1)
crypto_SELL(ticker, Shares2Sell)
print("sold:", r)
print("avg cost:", average_cost)
num_shares -= 2.0
# Keeps track of counter
print("c1:" + str(counter1))
print("c2:" + str(counter2))
counter1 += 1
counter2 += 1
if num_shares <= 0:
sys.exit()
# calls scheduler every 5 minutes
s.enter(300, 1, run, (sc,))
# Functions to buy and sell crypto currency
def crypto_BUY(ticker, amountD):
r = robin_stocks.orders.order_buy_crypto_by_quantity(ticker, amountD)
print(r)
def crypto_SELL(ticker, amountD):
r = robin_stocks.orders.order_sell_crypto_by_quantity(ticker, amountD)
print(r)
s.enter(1, 1, run, (s,))
s.run()
| 42.722222
| 151
| 0.575856
| 2,400
| 18,456
| 4.34
| 0.102083
| 0.12884
| 0.101382
| 0.08871
| 0.794547
| 0.784946
| 0.771505
| 0.757873
| 0.75576
| 0.752112
| 0
| 0.049795
| 0.325368
| 18,456
| 431
| 152
| 42.821346
| 0.786764
| 0.299469
| 0
| 0.627907
| 0
| 0
| 0.038552
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.011628
| false
| 0
| 0.023256
| 0
| 0.034884
| 0.24031
| 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
|
3f1d0e1314da6292b201ab2f8278f0e1f894f6eb
| 109
|
py
|
Python
|
Programas do Curso/Desafio 5.py
|
carvalhopedro22/Programas-em-python-cursos-e-geral-
|
970e1ebe6cdd1e31f52dfd60328c2203d4de3ef1
|
[
"MIT"
] | null | null | null |
Programas do Curso/Desafio 5.py
|
carvalhopedro22/Programas-em-python-cursos-e-geral-
|
970e1ebe6cdd1e31f52dfd60328c2203d4de3ef1
|
[
"MIT"
] | null | null | null |
Programas do Curso/Desafio 5.py
|
carvalhopedro22/Programas-em-python-cursos-e-geral-
|
970e1ebe6cdd1e31f52dfd60328c2203d4de3ef1
|
[
"MIT"
] | null | null | null |
n1 = int(input('Digite um numero: '))
print('Sucessor: {}'.format(n1+1))
print('Antecessor: {}'.format(n1-1))
| 36.333333
| 37
| 0.642202
| 16
| 109
| 4.375
| 0.6875
| 0.228571
| 0.257143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05
| 0.082569
| 109
| 3
| 38
| 36.333333
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.666667
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
3f326a279f58306fa1c29be967df603190d5f9db
| 119
|
py
|
Python
|
cars/admin.py
|
Slawomir-Kwiatkowski/auto-maniac
|
0aad8bfbe0d4bc2f6a890dd5398cd8194248949d
|
[
"MIT"
] | 3
|
2020-11-11T21:06:35.000Z
|
2022-03-02T16:11:29.000Z
|
cars/admin.py
|
Slawomir-Kwiatkowski/auto-maniac
|
0aad8bfbe0d4bc2f6a890dd5398cd8194248949d
|
[
"MIT"
] | 1
|
2020-11-21T19:42:55.000Z
|
2020-12-01T18:50:49.000Z
|
cars/admin.py
|
Slawomir-Kwiatkowski/auto-maniac
|
0aad8bfbe0d4bc2f6a890dd5398cd8194248949d
|
[
"MIT"
] | 2
|
2020-11-11T21:09:41.000Z
|
2020-12-13T16:29:30.000Z
|
from django.contrib import admin
from .models import Car, Repair
admin.site.register(Car)
admin.site.register(Repair)
| 19.833333
| 32
| 0.806723
| 18
| 119
| 5.333333
| 0.555556
| 0.1875
| 0.354167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.10084
| 119
| 5
| 33
| 23.8
| 0.897196
| 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
|
3f40396b0e504c043fd0c4aab4a71f0bba4a7892
| 90
|
py
|
Python
|
pub_data_visualization/load/tools/__init__.py
|
cre-os/pub-data-visualization
|
e5ec45e6397258646290836fc1a3b39ad69bf266
|
[
"MIT"
] | 10
|
2020-10-08T11:35:49.000Z
|
2021-01-22T16:47:59.000Z
|
pub_data_visualization/load/tools/__init__.py
|
l-leo/pub-data-visualization
|
68eea00491424581b057495a7f0f69cf74e16e7d
|
[
"MIT"
] | 3
|
2021-03-15T14:26:43.000Z
|
2021-12-02T15:27:49.000Z
|
pub_data_visualization/load/tools/__init__.py
|
cre-dev/pub-data-visualization
|
229bb7a543684be2cb06935299345ce3263da946
|
[
"MIT"
] | 1
|
2021-01-22T16:47:10.000Z
|
2021-01-22T16:47:10.000Z
|
"""
Module to transform the load data.
"""
from .mean_load_delivery_period import *
| 12.857143
| 40
| 0.7
| 12
| 90
| 5
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 90
| 7
| 40
| 12.857143
| 0.833333
| 0.377778
| 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
|
3f4603c4ecbbe2ef3bb1f2d8cde148f9daf7e067
| 76
|
py
|
Python
|
plugins/general/__init__.py
|
SumWum/HumanSona
|
37319bf7ba4f2b9a2d82038bbae3049c5137757a
|
[
"MIT"
] | null | null | null |
plugins/general/__init__.py
|
SumWum/HumanSona
|
37319bf7ba4f2b9a2d82038bbae3049c5137757a
|
[
"MIT"
] | 1
|
2020-06-07T14:43:49.000Z
|
2020-06-07T14:43:49.000Z
|
plugins/general/__init__.py
|
SumWum/HumanSona
|
37319bf7ba4f2b9a2d82038bbae3049c5137757a
|
[
"MIT"
] | null | null | null |
from .general import General
def setup(bot):
bot.add_cog(General(bot))
| 15.2
| 29
| 0.723684
| 12
| 76
| 4.5
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 76
| 4
| 30
| 19
| 0.84375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
58da351789bdee1cc05d36ed62b668c118e06a25
| 1,652
|
py
|
Python
|
examples_tests.py
|
bryanrios/Barcode_RFID_USB
|
4df6b7a17dfa1a16c35e37a8f03d093f71f19623
|
[
"MIT"
] | null | null | null |
examples_tests.py
|
bryanrios/Barcode_RFID_USB
|
4df6b7a17dfa1a16c35e37a8f03d093f71f19623
|
[
"MIT"
] | null | null | null |
examples_tests.py
|
bryanrios/Barcode_RFID_USB
|
4df6b7a17dfa1a16c35e37a8f03d093f71f19623
|
[
"MIT"
] | null | null | null |
import unittest
from black_rfid_reader import RFIDReader
from lindy_bar_code_scanner import BarCodeReader
class TestRFIDReader(unittest.TestCase):
def test_if_raw_message_is_decoded(self):
reader = RFIDReader(0x08ff, 0x0009, 84, 16, should_reset=False)
raw_data = [0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
result = reader.decode_raw_data(raw_data)
expected = '0027314141\n'
self.assertEqual(expected, result)
class TestBarCodeReader(unittest.TestCase):
def test_if_raw_message_is_decoded(self):
reader = BarCodeReader(0x03eb, 0x6201, 84, 6, should_reset=True)
# Luke, Obi-Wan never told you what's in this raw_data...
raw_data = [0, 0, 34, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 40, 0, 0, 0]
result = reader.decode_raw_data(raw_data)
expected = '5903570132223\n'
self.assertEqual(expected, result)
if __name__ == '__main__':
unittest.main()
| 55.066667
| 558
| 0.534504
| 366
| 1,652
| 2.319672
| 0.177596
| 0.489988
| 0.639576
| 0.734982
| 0.625442
| 0.55477
| 0.55477
| 0.55477
| 0.541814
| 0.537102
| 0
| 0.272204
| 0.263923
| 1,652
| 29
| 559
| 56.965517
| 0.425987
| 0.033293
| 0
| 0.315789
| 0
| 0
| 0.021944
| 0
| 0
| 0
| 0.015047
| 0
| 0.105263
| 1
| 0.105263
| false
| 0
| 0.157895
| 0
| 0.368421
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
58f10a86e709248329bec71a72282b71f53526eb
| 28
|
py
|
Python
|
masterfile.py
|
ndc9jh/cs3240-labdemo
|
6ab150fa655327ae91d66881a31849e9a63fef22
|
[
"MIT"
] | null | null | null |
masterfile.py
|
ndc9jh/cs3240-labdemo
|
6ab150fa655327ae91d66881a31849e9a63fef22
|
[
"MIT"
] | null | null | null |
masterfile.py
|
ndc9jh/cs3240-labdemo
|
6ab150fa655327ae91d66881a31849e9a63fef22
|
[
"MIT"
] | null | null | null |
#This file also does nothing
| 28
| 28
| 0.821429
| 5
| 28
| 4.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 28
| 1
| 28
| 28
| 0.958333
| 0.964286
| 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
|
451f1764c54080c9a50d3790e2d59afcede40e0b
| 194
|
py
|
Python
|
data/__init__.py
|
isLouisHsu/Pytorch_Retinaface
|
2db5e9aaec42d9605494032a5fa70fb7b82831de
|
[
"MIT"
] | null | null | null |
data/__init__.py
|
isLouisHsu/Pytorch_Retinaface
|
2db5e9aaec42d9605494032a5fa70fb7b82831de
|
[
"MIT"
] | null | null | null |
data/__init__.py
|
isLouisHsu/Pytorch_Retinaface
|
2db5e9aaec42d9605494032a5fa70fb7b82831de
|
[
"MIT"
] | null | null | null |
from .wider_face import WiderFaceDetection, detection_collate
from .ecust_hsfd import EcustHsfdDetection, detection_collate_hsfd, load_datacube
from .data_augment import *
from .config import *
| 38.8
| 81
| 0.85567
| 24
| 194
| 6.625
| 0.625
| 0.201258
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097938
| 194
| 4
| 82
| 48.5
| 0.908571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
18c1a7deb28817e4e9f716090232c24f3c4a5b71
| 175
|
py
|
Python
|
bugtests/test310c.py
|
doom38/jython_v2.2.1
|
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
|
[
"CNRI-Jython"
] | null | null | null |
bugtests/test310c.py
|
doom38/jython_v2.2.1
|
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
|
[
"CNRI-Jython"
] | null | null | null |
bugtests/test310c.py
|
doom38/jython_v2.2.1
|
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
|
[
"CNRI-Jython"
] | null | null | null |
"""
[ #444292 ] local var binding overrides local import
"""
import support
def foo(pickle):
assert pickle == 1
import pickle
assert pickle != 1
foo(1)
| 12.5
| 52
| 0.617143
| 22
| 175
| 4.909091
| 0.545455
| 0.222222
| 0.333333
| 0.351852
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 0.28
| 175
| 13
| 53
| 13.461538
| 0.785714
| 0.297143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
18e744a2cfa978c6b7fe1cd5e8c2c8a4035d7311
| 164
|
py
|
Python
|
essentials/hackerank-1.py
|
priyeshkaratha/PythonProjects
|
b8f1aaa286eac4db8c8811c386e4bc120db1ad1a
|
[
"MIT"
] | null | null | null |
essentials/hackerank-1.py
|
priyeshkaratha/PythonProjects
|
b8f1aaa286eac4db8c8811c386e4bc120db1ad1a
|
[
"MIT"
] | null | null | null |
essentials/hackerank-1.py
|
priyeshkaratha/PythonProjects
|
b8f1aaa286eac4db8c8811c386e4bc120db1ad1a
|
[
"MIT"
] | null | null | null |
def print_sequence(n):
for i in range(1, n+1):
print(i, end="")
if __name__ == '__main__':
n = int(input("Enter number :"))
print_sequence(n)
| 18.222222
| 36
| 0.573171
| 25
| 164
| 3.36
| 0.68
| 0.309524
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01626
| 0.25
| 164
| 8
| 37
| 20.5
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0.134146
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.166667
| 0.5
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
7a0f5745022b9b4ae198282053af1c60380bb1d6
| 25,525
|
py
|
Python
|
smart/forward_model/InterpolateModel.py
|
Lingfeng-Wei/smart
|
2316e50bfb6f050d5dcdd0ee1e5eab6831e8a669
|
[
"MIT"
] | null | null | null |
smart/forward_model/InterpolateModel.py
|
Lingfeng-Wei/smart
|
2316e50bfb6f050d5dcdd0ee1e5eab6831e8a669
|
[
"MIT"
] | null | null | null |
smart/forward_model/InterpolateModel.py
|
Lingfeng-Wei/smart
|
2316e50bfb6f050d5dcdd0ee1e5eab6831e8a669
|
[
"MIT"
] | null | null | null |
import smart
import numpy as np
import sys, os, os.path, time
from astropy.table import Table
from astropy.io import fits
from numpy.linalg import inv, det
from ..utils.interpolations import trilinear_interpolation
##############################################################################################################
def InterpModel(teff, logg=4, metal=0, alpha=0, modelset='phoenix-aces-agss-cond-2011', instrument='nirspec', order='O33'):
#print('Parameters', teff, logg, modelset, instrument, order)
FULL_PATH = os.path.realpath(__file__)
BASE, NAME = os.path.split(FULL_PATH)
# Check the model set and instrument
if instrument.lower() == 'nirspec':
path = BASE + '/../libraries/%s/%s-O%s/'%(smart.ModelSets[modelset.lower()], instrument.upper(), order.upper())
else:
path = BASE + '/../libraries/%s/%s-%s/'%(smart.ModelSets[modelset.lower()], instrument.upper(), order.upper())
Gridfile = BASE + '/../libraries/%s/%s_gridparams.csv'%(smart.ModelSets[modelset.lower()], smart.ModelSets[modelset.lower()])
if modelset.lower() == 'btsettl08':
path = BASE + '/../libraries/btsettl08/NIRSPEC-O%s-RAW/'%order
Gridfile = BASE + '/../libraries/btsettl08/btsettl08_gridparams.csv'
# Read the grid file
T1 = Table.read(Gridfile)
###################################################################################
def GetModel(temp, wave=False, **kwargs):
logg = kwargs.get('logg', 4.5)
metal = kwargs.get('metal', 0)
alpha = kwargs.get('alpha', 0)
gridfile = kwargs.get('gridfile', None)
instrument = kwargs.get('instrument', 'nirspec')
order = kwargs.get('order', None)
#print(temp, logg, metal, alpha)
if gridfile is None:
raise ValueError('Model gridfile must be provided.')
if modelset.lower() == 'btsettl08':
filename = 'btsettl08_t'+ str(int(temp.data[0])) + '_g' + '{0:.2f}'.format(float(logg)) + '_z-' + '{0:.2f}'.format(float(metal)) + '_en' + '{0:.2f}'.format(float(alpha)) + '_NIRSPEC-O' + str(order) + '-RAW.txt'
elif modelset.lower() == 'sonora':
if instrument.lower() == 'nirspec':
filename = '%s'%smart.ModelSets[modelset.lower()] + '_t{0:03d}'.format(int(temp.data[0])) + '_g{0:.2f}'.format(float(logg)) + '_FeH0.00_Y0.28_CO1.00' + '_%s-O%s.fits'%(instrument.upper(), order.upper())
else:
filename = '%s'%smart.ModelSets[modelset.lower()] + '_t{0:03d}'.format(int(temp.data[0])) + '_g{0:.2f}'.format(float(logg)) + '_FeH0.00_Y0.28_CO1.00' + '_%s-%s.fits'%(instrument.upper(), order.upper())
elif modelset.lower() == 'marcs-apogee-dr15':
cm = kwargs.get('cm', 0)
nm = kwargs.get('nm', 0)
filename = '%s'%smart.ModelSets[modelset.lower()] + '_t{0:03d}'.format(int(temp.data[0])) + '_g{0:.2f}'.format(float(logg)) + '_z{0:.2f}'.format(float(metal)) + '_en{0:.2f}'.format(float(alpha)) + '_cm{0:.2f}'.format(float(cm)) + '_nm{0:.2f}'.format(float(nm)) + '_%s-%s.fits'%(instrument.upper(), order.upper())
else:
filename = '%s'%smart.ModelSets[modelset.lower()] + '_t{0:03d}'.format(int(temp.data[0])) + '_g{0:.2f}'.format(float(logg)) + '_z{0:.2f}'.format(float(metal)) + '_en{0:.2f}'.format(float(alpha)) + '_%s-%s.fits'%(instrument.upper(), order.upper())
# Read in the model FITS file
if modelset.lower() == 'btsettl08':
Tab = Table.read(path+filename, format='ascii.tab', names=['wave', 'flux'])
else:
Tab = Table.read(path+filename)
# Return the model (wave of flux)
if wave:
return Tab['wave']
else:
return Tab['flux']
###################################################################################
# Check if the model already exists (grid point)
if modelset.lower() == 'sonora':
if (teff, logg) in zip(T1['teff'], T1['logg']):
metal, ys = 0, 0.28
index0 = np.where( (T1['teff'] == teff) & (T1['logg'] == logg) & (T1['FeH'] == metal) & (T1['Y'] == ys) )
#flux2 = GetModel(T1['teff'][index0], T1['logg'][index0], T1['M_H'][index0], modelset=modelset )
#waves2 = GetModel(T1['teff'][index0], T1['logg'][index0], T1['M_H'][index0], modelset=modelset, wave=True)
flux2 = GetModel(T1['teff'][index0], logg=T1['logg'][index0], metal=T1['FeH'][index0], alpha=T1['Y'][index0], instrument=instrument, order=order, gridfile=T1)
waves2 = GetModel(T1['teff'][index0], logg=T1['logg'][index0], metal=T1['FeH'][index0], alpha=T1['Y'][index0], instrument=instrument, order=order, gridfile=T1, wave=True)
return waves2, flux2
else:
if (teff, logg, metal, alpha) in zip(T1['teff'], T1['logg'], T1['M_H'], T1['en']):
index0 = np.where( (T1['teff'] == teff) & (T1['logg'] == logg) & (T1['M_H'] == metal) & (T1['en'] == alpha) )
#flux2 = GetModel(T1['teff'][index0], T1['logg'][index0], T1['M_H'][index0], modelset=modelset )
#waves2 = GetModel(T1['teff'][index0], T1['logg'][index0], T1['M_H'][index0], modelset=modelset, wave=True)
flux2 = GetModel(T1['teff'][index0], logg=T1['logg'][index0], metal=T1['M_H'][index0], alpha=T1['en'][index0], instrument=instrument, order=order, gridfile=T1)
waves2 = GetModel(T1['teff'][index0], logg=T1['logg'][index0], metal=T1['M_H'][index0], alpha=T1['en'][index0], instrument=instrument, order=order, gridfile=T1, wave=True)
return waves2, flux2
try:
if modelset.lower() == 'sonora':
metal, alpha = 0, 0.28
# Get the nearest models to the gridpoint (teff)
x0 = np.max(T1['teff'][np.where(T1['teff'] <= teff)])
x1 = np.min(T1['teff'][np.where(T1['teff'] >= teff)])
#print(x0, x1)
# Get the nearest grid point to logg
y0 = np.max(list(set(T1['logg'][np.where( (T1['teff'] == x0) & (T1['logg'] <= logg) )]) &
set(T1['logg'][np.where( (T1['teff'] == x1) & (T1['logg'] <= logg) )])))
y1 = np.min(list(set(T1['logg'][np.where( (T1['teff'] == x0) & (T1['logg'] >= logg) )]) &
set(T1['logg'][np.where( (T1['teff'] == x1) & (T1['logg'] >= logg) )])))
#print(y0, y1)
# Get the nearest grid point to [M/H]
z0 = np.max(list(set(T1['FeH'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] <= metal) )]) &
set(T1['FeH'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] <= metal) )])))
z1 = np.min(list(set(T1['FeH'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] >= metal) )]) &
set(T1['FeH'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] >= metal) )])))
#print(z0, z1)
# Get the nearest grid point to Alpha
t0 = np.max(list(set(T1['Y'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] == z0) & (T1['Y'] <= alpha) )]) &
set(T1['Y'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] == z1) & (T1['Y'] <= alpha) )])))
t1 = np.min(list(set(T1['Y'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] == z0) & (T1['Y'] >= alpha) )]) &
set(T1['Y'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] == z1) & (T1['Y'] >= alpha) )])))
#print(t0, t1)
else:
# Get the nearest models to the gridpoint (teff)
x0 = np.max(T1['teff'][np.where(T1['teff'] <= teff)])
x1 = np.min(T1['teff'][np.where(T1['teff'] >= teff)])
#print('teff:', x0, teff, x1)
# Get the nearest grid point to logg
y0 = np.max(list(set(T1['logg'][np.where( (T1['teff'] == x0) & (T1['logg'] <= logg) )]) &
set(T1['logg'][np.where( (T1['teff'] == x1) & (T1['logg'] <= logg) )])))
y1 = np.min(list(set(T1['logg'][np.where( (T1['teff'] == x0) & (T1['logg'] >= logg) )]) &
set(T1['logg'][np.where( (T1['teff'] == x1) & (T1['logg'] >= logg) )])))
#print('logg:', y0, logg, y1)
# Get the nearest grid point to [M/H]
#print(metal)
#print(list(set(T1['M_H'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) )])))
#print(list(set(T1['M_H'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) )])))
#print(list(set(T1['M_H'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] <= metal))])))
#print(list(set(T1['M_H'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] <= metal))])))
#print(list(set(T1['M_H'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] >= metal))])))
#print(list(set(T1['M_H'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] >= metal))])))
z0 = np.max(list(set(T1['M_H'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] <= metal) )]) &
set(T1['M_H'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] <= metal) )])))
z1 = np.min(list(set(T1['M_H'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] >= metal) )]) &
set(T1['M_H'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] >= metal) )])))
#print('metal:', z0, metal, z1)
# Get the nearest grid point to Alpha
#print(list(set(T1['en'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z0) )])))
#print(list(set(T1['en'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z1) )])))
#print(list(set(T1['en'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] <= alpha) )])))
#print(list(set(T1['en'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] <= alpha) )])))
#print(list(set(T1['en'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] >= alpha) )])))
#print(list(set(T1['en'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] >= alpha) )])))
t0 = np.max(list(set(T1['en'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] <= alpha) )]) &
set(T1['en'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] <= alpha) )])))
t1 = np.min(list(set(T1['en'][np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] >= alpha) )]) &
set(T1['en'][np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] >= alpha) )])))
#print('alpha:', z0, alpha, z1)
except:
raise ValueError('Model Parameters Teff: %0.3f, logg: %0.3f, [M/H]: %0.3f, Alpha: %0.3f are outside the model grid.'%(teff, logg, metal, alpha))
if modelset.lower() == 'sonora':
# Get the 16 points
ind0000 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] == z0) & (T1['Y'] == t0) ) # 0000
ind1000 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['FeH'] == z0) & (T1['Y'] == t0) ) # 1000
ind0100 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['FeH'] == z0) & (T1['Y'] == t0) ) # 0100
ind0010 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] == z1) & (T1['Y'] == t0) ) # 0010
ind0001 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] == z0) & (T1['Y'] == t1) ) # 0001
ind1001 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['FeH'] == z0) & (T1['Y'] == t1) ) # 1001
ind0101 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['FeH'] == z0) & (T1['Y'] == t1) ) # 0101
ind0011 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['FeH'] == z1) & (T1['Y'] == t1) ) # 0011
ind1011 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['FeH'] == z1) & (T1['Y'] == t1) ) # 1011
ind0111 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['FeH'] == z1) & (T1['Y'] == t1) ) # 0111
ind1111 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] == z1) & (T1['Y'] == t1) ) # 1111
ind0110 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['FeH'] == z1) & (T1['Y'] == t0) ) # 0110
ind1010 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['FeH'] == z1) & (T1['Y'] == t0) ) # 1010
ind1100 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] == z0) & (T1['Y'] == t0) ) # 1100
ind1101 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] == z0) & (T1['Y'] == t1) ) # 1101
ind1110 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['FeH'] == z1) & (T1['Y'] == t0) ) # 1110
Points = [ [np.log10(T1['teff'][ind0000]), T1['logg'][ind0000], T1['FeH'][ind0000], T1['Y'][ind0000],
np.log10(GetModel(T1['teff'][ind0000], logg=T1['logg'][ind0000], metal=T1['FeH'][ind0000], alpha=T1['Y'][ind0000], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1000]), T1['logg'][ind1000], T1['FeH'][ind1000], T1['Y'][ind1000],
np.log10(GetModel(T1['teff'][ind1000], logg=T1['logg'][ind1000], metal=T1['FeH'][ind1000], alpha=T1['Y'][ind1000], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0100]), T1['logg'][ind0100], T1['FeH'][ind0100], T1['Y'][ind0100],
np.log10(GetModel(T1['teff'][ind0100], logg=T1['logg'][ind0100], metal=T1['FeH'][ind0100], alpha=T1['Y'][ind0100], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0010]), T1['logg'][ind0010], T1['FeH'][ind0010], T1['Y'][ind0010],
np.log10(GetModel(T1['teff'][ind0010], logg=T1['logg'][ind0010], metal=T1['FeH'][ind0010], alpha=T1['Y'][ind0010], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0001]), T1['logg'][ind0001], T1['FeH'][ind0001], T1['Y'][ind0001],
np.log10(GetModel(T1['teff'][ind0001], logg=T1['logg'][ind0001], metal=T1['FeH'][ind0001], alpha=T1['Y'][ind0001], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1001]), T1['logg'][ind1001], T1['FeH'][ind1001], T1['Y'][ind1001],
np.log10(GetModel(T1['teff'][ind1001], logg=T1['logg'][ind1001], metal=T1['FeH'][ind1001], alpha=T1['Y'][ind1001], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0101]), T1['logg'][ind0101], T1['FeH'][ind0101], T1['Y'][ind0101],
np.log10(GetModel(T1['teff'][ind0101], logg=T1['logg'][ind0101], metal=T1['FeH'][ind0101], alpha=T1['Y'][ind0101], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0011]), T1['logg'][ind0011], T1['FeH'][ind0011], T1['Y'][ind0011],
np.log10(GetModel(T1['teff'][ind0011], logg=T1['logg'][ind0011], metal=T1['FeH'][ind0011], alpha=T1['Y'][ind0011], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1011]), T1['logg'][ind1011], T1['FeH'][ind1011], T1['Y'][ind1011],
np.log10(GetModel(T1['teff'][ind1011], logg=T1['logg'][ind1011], metal=T1['FeH'][ind1011], alpha=T1['Y'][ind1011], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0111]), T1['logg'][ind0111], T1['FeH'][ind0111], T1['Y'][ind0111],
np.log10(GetModel(T1['teff'][ind0111], logg=T1['logg'][ind0111], metal=T1['FeH'][ind0111], alpha=T1['Y'][ind0111], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1111]), T1['logg'][ind1111], T1['FeH'][ind1111], T1['Y'][ind1111],
np.log10(GetModel(T1['teff'][ind1111], logg=T1['logg'][ind1111], metal=T1['FeH'][ind1111], alpha=T1['Y'][ind1111], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0110]), T1['logg'][ind0110], T1['FeH'][ind0110], T1['Y'][ind0110],
np.log10(GetModel(T1['teff'][ind0110], logg=T1['logg'][ind0110], metal=T1['FeH'][ind0110], alpha=T1['Y'][ind0110], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1010]), T1['logg'][ind1010], T1['FeH'][ind1010], T1['Y'][ind1010],
np.log10(GetModel(T1['teff'][ind1010], logg=T1['logg'][ind1010], metal=T1['FeH'][ind1010], alpha=T1['Y'][ind1010], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1100]), T1['logg'][ind1100], T1['FeH'][ind1100], T1['Y'][ind1100],
np.log10(GetModel(T1['teff'][ind1100], logg=T1['logg'][ind1100], metal=T1['FeH'][ind1100], alpha=T1['Y'][ind1100], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1101]), T1['logg'][ind1101], T1['FeH'][ind1101], T1['Y'][ind1101],
np.log10(GetModel(T1['teff'][ind1101], logg=T1['logg'][ind1101], metal=T1['FeH'][ind1101], alpha=T1['Y'][ind1101], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1110]), T1['logg'][ind1110], T1['FeH'][ind1110], T1['Y'][ind1110],
np.log10(GetModel(T1['teff'][ind1110], logg=T1['logg'][ind1110], metal=T1['FeH'][ind1110], alpha=T1['Y'][ind1110], instrument=instrument, order=order, gridfile=T1))],
]
#print(Points)
waves2 = GetModel(T1['teff'][ind1111], logg=T1['logg'][ind1111], metal=T1['FeH'][ind1111], alpha=T1['Y'][ind1111], instrument=instrument, order=order, gridfile=T1, wave=True)
else:
# Get the 16 points
ind0000 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] == t0) ) # 0000
ind1000 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] == t0) ) # 1000
ind0100 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['M_H'] == z0) & (T1['en'] == t0) ) # 0100
ind0010 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z1) & (T1['en'] == t0) ) # 0010
ind0001 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] == t1) ) # 0001
ind1001 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['M_H'] == z0) & (T1['en'] == t1) ) # 1001
ind0101 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['M_H'] == z0) & (T1['en'] == t1) ) # 0101
ind0011 = np.where( (T1['teff'] == x0) & (T1['logg'] == y0) & (T1['M_H'] == z1) & (T1['en'] == t1) ) # 0011
ind1011 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['M_H'] == z1) & (T1['en'] == t1) ) # 1011
ind0111 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] == t1) ) # 0111
ind1111 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] == t1) ) # 1111
ind0110 = np.where( (T1['teff'] == x0) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] == t0) ) # 0110
ind1010 = np.where( (T1['teff'] == x1) & (T1['logg'] == y0) & (T1['M_H'] == z1) & (T1['en'] == t0) ) # 1010
ind1100 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z0) & (T1['en'] == t0) ) # 1100
ind1101 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z0) & (T1['en'] == t1) ) # 1101
ind1110 = np.where( (T1['teff'] == x1) & (T1['logg'] == y1) & (T1['M_H'] == z1) & (T1['en'] == t0) ) # 1110
Points = [ [np.log10(T1['teff'][ind0000]), T1['logg'][ind0000], T1['M_H'][ind0000], T1['en'][ind0000],
np.log10(GetModel(T1['teff'][ind0000], logg=T1['logg'][ind0000], metal=T1['M_H'][ind0000], alpha=T1['en'][ind0000], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1000]), T1['logg'][ind1000], T1['M_H'][ind1000], T1['en'][ind1000],
np.log10(GetModel(T1['teff'][ind1000], logg=T1['logg'][ind1000], metal=T1['M_H'][ind1000], alpha=T1['en'][ind1000], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0100]), T1['logg'][ind0100], T1['M_H'][ind0100], T1['en'][ind0100],
np.log10(GetModel(T1['teff'][ind0100], logg=T1['logg'][ind0100], metal=T1['M_H'][ind0100], alpha=T1['en'][ind0100], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0010]), T1['logg'][ind0010], T1['M_H'][ind0010], T1['en'][ind0010],
np.log10(GetModel(T1['teff'][ind0010], logg=T1['logg'][ind0010], metal=T1['M_H'][ind0010], alpha=T1['en'][ind0010], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0001]), T1['logg'][ind0001], T1['M_H'][ind0001], T1['en'][ind0001],
np.log10(GetModel(T1['teff'][ind0001], logg=T1['logg'][ind0001], metal=T1['M_H'][ind0001], alpha=T1['en'][ind0001], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1001]), T1['logg'][ind1001], T1['M_H'][ind1001], T1['en'][ind1001],
np.log10(GetModel(T1['teff'][ind1001], logg=T1['logg'][ind1001], metal=T1['M_H'][ind1001], alpha=T1['en'][ind1001], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0101]), T1['logg'][ind0101], T1['M_H'][ind0101], T1['en'][ind0101],
np.log10(GetModel(T1['teff'][ind0101], logg=T1['logg'][ind0101], metal=T1['M_H'][ind0101], alpha=T1['en'][ind0101], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0011]), T1['logg'][ind0011], T1['M_H'][ind0011], T1['en'][ind0011],
np.log10(GetModel(T1['teff'][ind0011], logg=T1['logg'][ind0011], metal=T1['M_H'][ind0011], alpha=T1['en'][ind0011], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1011]), T1['logg'][ind1011], T1['M_H'][ind1011], T1['en'][ind1011],
np.log10(GetModel(T1['teff'][ind1011], logg=T1['logg'][ind1011], metal=T1['M_H'][ind1011], alpha=T1['en'][ind1011], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0111]), T1['logg'][ind0111], T1['M_H'][ind0111], T1['en'][ind0111],
np.log10(GetModel(T1['teff'][ind0111], logg=T1['logg'][ind0111], metal=T1['M_H'][ind0111], alpha=T1['en'][ind0111], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1111]), T1['logg'][ind1111], T1['M_H'][ind1111], T1['en'][ind1111],
np.log10(GetModel(T1['teff'][ind1111], logg=T1['logg'][ind1111], metal=T1['M_H'][ind1111], alpha=T1['en'][ind1111], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind0110]), T1['logg'][ind0110], T1['M_H'][ind0110], T1['en'][ind0110],
np.log10(GetModel(T1['teff'][ind0110], logg=T1['logg'][ind0110], metal=T1['M_H'][ind0110], alpha=T1['en'][ind0110], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1010]), T1['logg'][ind1010], T1['M_H'][ind1010], T1['en'][ind1010],
np.log10(GetModel(T1['teff'][ind1010], logg=T1['logg'][ind1010], metal=T1['M_H'][ind1010], alpha=T1['en'][ind1010], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1100]), T1['logg'][ind1100], T1['M_H'][ind1100], T1['en'][ind1100],
np.log10(GetModel(T1['teff'][ind1100], logg=T1['logg'][ind1100], metal=T1['M_H'][ind1100], alpha=T1['en'][ind1100], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1101]), T1['logg'][ind1101], T1['M_H'][ind1101], T1['en'][ind1101],
np.log10(GetModel(T1['teff'][ind1101], logg=T1['logg'][ind1101], metal=T1['M_H'][ind1101], alpha=T1['en'][ind1101], instrument=instrument, order=order, gridfile=T1))],
[np.log10(T1['teff'][ind1110]), T1['logg'][ind1110], T1['M_H'][ind1110], T1['en'][ind1110],
np.log10(GetModel(T1['teff'][ind1110], logg=T1['logg'][ind1110], metal=T1['M_H'][ind1110], alpha=T1['en'][ind1110], instrument=instrument, order=order, gridfile=T1))],
]
#print(Points)
waves2 = GetModel(T1['teff'][ind1111], logg=T1['logg'][ind1111], metal=T1['M_H'][ind1111], alpha=T1['en'][ind1111], instrument=instrument, order=order, gridfile=T1, wave=True)
return waves2, smart.utils.interpolations.quadlinear_interpolation(np.log10(teff), logg, metal, alpha, Points)
################################################################################################################################################################################################
| 93.841912
| 324
| 0.505622
| 3,350
| 25,525
| 3.815522
| 0.054328
| 0.072289
| 0.0266
| 0.075262
| 0.790095
| 0.783054
| 0.779299
| 0.771163
| 0.766703
| 0.753403
| 0
| 0.123231
| 0.21665
| 25,525
| 271
| 325
| 94.188192
| 0.516029
| 0.102488
| 0
| 0.150754
| 0
| 0.005025
| 0.109367
| 0.010642
| 0.015075
| 0
| 0
| 0
| 0
| 1
| 0.01005
| false
| 0
| 0.035176
| 0
| 0.070352
| 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
|
e149bcbe323162009740cdc117395402d5e41f29
| 6,428
|
py
|
Python
|
run_stepwise_experiment.py
|
enricomeloni/covid-tools
|
6920b8cfa0eb89bdb7e0ba96ecc74831185c44a7
|
[
"MIT"
] | 1
|
2020-10-06T16:03:01.000Z
|
2020-10-06T16:03:01.000Z
|
run_stepwise_experiment.py
|
enricomeloni/covid-tools
|
6920b8cfa0eb89bdb7e0ba96ecc74831185c44a7
|
[
"MIT"
] | 3
|
2022-02-13T20:21:56.000Z
|
2022-02-27T10:19:23.000Z
|
run_stepwise_experiment.py
|
sailab-code/learning-sidarthe
|
6920b8cfa0eb89bdb7e0ba96ecc74831185c44a7
|
[
"MIT"
] | null | null | null |
import os
from collections import namedtuple
from learning_models.stepwise_tied_sidarthe_extended import StepwiseTiedSidartheExtended, Param
from experiments.sidarthe_extended_experiment import ExtendedSidartheExperiment
if __name__ == "__main__":
region = "Italy"
n_epochs = 10000
t_step = 1.0
train_size = 190
# initial_params = {
# "alpha": [Param(0.570, 4), Param(0.422, 18), Param(0.360, 6), Param(0.210, 73), Param(0.210, train_size-101)],
# "beta": [Param(0.011, 4), Param(0.0057, 18), Param(0.005, train_size-38)],
# "gamma": [Param(0.456, 4), Param(0.285, 18), Param(0.2, 6), Param(0.11, 10), Param(0.11, train_size-38)],
# "delta": [Param(0.011, 4), Param(0.0057, 18), Param(0.005, train_size-38)],
# "epsilon": [Param(0.171, 12), Param(0.143, 26), Param(0.2, train_size - 38)],
# "theta": [Param(0.371, 38), Param(0.371, 63), Param(0.371, train_size - 101)],
# "zeta": [Param(0.125, 22), Param(0.034, 16), Param(0.025, train_size - 38)],
# "eta": [Param(0.125, 22), Param(0.034, 16), Param(0.025, train_size - 38)],
# "mu": [Param(0.017, 22), Param(0.008, train_size - 22)],
# "nu": [Param(0.027, 22), Param(0.015, train_size - 22)],
# "tau": [Param(0.01, 4), Param(0.02, 18), Param(0.04, 6), Param(0.06, 10), Param(0.1, 30), Param(0.02, train_size - 68)],
# "lambda": [Param(0.034, 22), Param(0.08, train_size - 22)],
# # "lambda": [0.034],
# "kappa": [Param(0.017, 22), Param(0.017, 16), Param(0.02, train_size - 38)],
# # "kappa": [0.017],
# "xi": [Param(0.017, 22), Param(0.017, 16), Param(0.02, train_size - 38)],
# "rho": [Param(0.034, 22), Param(0.017, 16), Param(0.02, train_size - 38)],
# # "rho": [0.034],
# "sigma": [Param(0.017, 22), Param(0.017, 16), Param(0.01, train_size - 38)],
# "phi": [Param(0.02, 4), Param(0.02, 18), Param(0.02, 16), Param(0.02, train_size - 38)],
# "chi": [Param(0.02, 4), Param(0.02, 18), Param(0.02, 16), Param(0.02, train_size - 38)]
# }
# weekly
wise_step = 7
initial_params = {
"alpha": [Param(0.570, 4), Param(0.422, 18), Param(0.360, 6), Param(0.210, 73)] + [Param(0.21, wise_step) for i in range((train_size-101)//wise_step)],
"beta": [Param(0.011, 4), Param(0.0057, 18), Param(0.005, 16)] + [Param(0.005, wise_step) for i in range((train_size-38)//wise_step)],
"gamma": [Param(0.456, 4), Param(0.285, 18), Param(0.2, 6), Param(0.11, 10)] + [Param(0.11, wise_step) for i in range((train_size-38)//wise_step)],
"delta": [Param(0.011, 4), Param(0.0057, 18), Param(0.005, 16)] + [Param(0.005, wise_step) for i in range((train_size-38)//wise_step)],
"epsilon": [Param(0.171, 12), Param(0.143, 26)] + [Param(0.2, wise_step) for i in range((train_size-38)//wise_step)],
"theta": [Param(0.371, wise_step) for i in range((train_size)//wise_step)],
# "zeta": [Param(0.125, 22), Param(0.034, 16)] + [Param(0.025, wise_step) for i in range((train_size-38)//wise_step)],
# "eta": [Param(0.125, 22), Param(0.034, 16)] + [Param(0.025, wise_step) for i in range((train_size-38)//wise_step)],
# "mu": [Param(0.017, 22), Param(0.008, 16)] + [Param(0.008, wise_step) for i in range((train_size-38)//wise_step)],
# "nu": [Param(0.027, 22), Param(0.015, 16)] + [Param(0.015, wise_step) for i in range((train_size-38)//wise_step)],
# "tau": [Param(0.01, 4), Param(0.02, 18), Param(0.04, 6), Param(0.06, 10), Param(0.1, 30)] + [Param(0.025, wise_step) for i in range((train_size - 68)//wise_step)],
# "lambda": [Param(0.034, 22), Param(0.08, 16)] + [Param(0.08, wise_step) for i in range((train_size-38)//wise_step)],
#
"zeta": [Param(0.125, wise_step) for _ in range(3)] + [Param(0.034, wise_step) for _ in range(3)] + [Param(0.025, wise_step) for i in range((train_size - 42) // wise_step)],
"eta": [Param(0.125, wise_step) for _ in range(3)] + [Param(0.034, wise_step) for _ in range(3)] + [Param(0.025, wise_step) for i in range((train_size - 42) // wise_step)],
"mu": [Param(0.017, wise_step) for _ in range(3)] + [Param(0.008, wise_step) for i in range((train_size - 21) // wise_step)],
"nu": [Param(0.027, wise_step) for _ in range(3)] + [Param(0.015, wise_step) for i in range((train_size - 21) // wise_step)],
"tau": [Param(0.01, 4), Param(0.02, 18), Param(0.04, 6), Param(0.06, 10), Param(0.1, 30)] + [Param(0.025, wise_step) for i in range((train_size - 68) // wise_step)],
"lambda": [Param(0.034, wise_step) for _ in range(3)] + [Param(0.08, wise_step) for i in range((train_size - 21) // wise_step)],
# "kappa": [Param(0.017, 22), Param(0.017, 16)] + [Param(0.02, wise_step) for i in range((train_size-38)//wise_step)],
"kappa": [Param(0.02, wise_step) for i in range((train_size)//wise_step)],
# "xi": [Param(0.017, 22), Param(0.017, 16)] + [Param(0.02, wise_step) for i in range((train_size-38)//wise_step)],
"xi": [Param(0.02, wise_step) for i in range((train_size)//wise_step)],
"rho": [Param(0.034, wise_step) for _ in range(3)] + [Param(0.08, wise_step) for i in range((train_size - 21) // wise_step)],
"sigma": [Param(0.017, wise_step) for _ in range(6) for _ in range(3)] + [Param(0.01, wise_step) for i in range((train_size-42)//wise_step)],
"phi": [Param(0.001, wise_step) for i in range((train_size)//wise_step)],
"chi": [Param(0.001, wise_step) for i in range((train_size)//wise_step)]
}
loss_weights = {
"d_weight": 3.5,
"r_weight": 1.,
"t_weight": 1.,
"h_weight": 1.,
"e_weight": 1.
}
for k,v in loss_weights.items():
loss_weights[k] = 0.001 * v
experiment_cls = ExtendedSidartheExperiment # switch class to change experiment: e.g. SidartheExperiment
experiment = experiment_cls(region, n_epochs=n_epochs, time_step=t_step, runs_directory="stepwise_exps")
experiment.run_exp(
initial_params=initial_params,
dataset_params={"train_size": train_size, "val_len": 22},
train_params={"momentum": True, "a": 0.0},
model_params={"model_cls": StepwiseTiedSidartheExtended, "der_1st_reg": 0, "bound_reg": 0, "bound_loss_type": "step"},
loss_weights=loss_weights
) # params can be set, no params => default configuration
| 69.869565
| 181
| 0.597386
| 1,088
| 6,428
| 3.375
| 0.132353
| 0.220588
| 0.104847
| 0.084967
| 0.728758
| 0.723856
| 0.711329
| 0.711329
| 0.650054
| 0.650054
| 0
| 0.147683
| 0.194151
| 6,428
| 91
| 182
| 70.637363
| 0.561197
| 0.421593
| 0
| 0
| 0
| 0
| 0.05764
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.083333
| 0
| 0.083333
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e16f91ae0147b0c77efb08e6b8b50a84759d74b1
| 491
|
py
|
Python
|
fishingapp_backend/api/serializers/__init__.py
|
Jimmyjtc001/fishingapp-backend
|
653ab1b1d61f43a84a67fbb5e581b8bd45f5b2b7
|
[
"BSD-3-Clause"
] | null | null | null |
fishingapp_backend/api/serializers/__init__.py
|
Jimmyjtc001/fishingapp-backend
|
653ab1b1d61f43a84a67fbb5e581b8bd45f5b2b7
|
[
"BSD-3-Clause"
] | null | null | null |
fishingapp_backend/api/serializers/__init__.py
|
Jimmyjtc001/fishingapp-backend
|
653ab1b1d61f43a84a67fbb5e581b8bd45f5b2b7
|
[
"BSD-3-Clause"
] | null | null | null |
# from api.serializers.DashboardSerializer import
from api.serializers.gateway.login_serializer import LoginSerializer
from api.serializers.gateway.register_serializer import RegisterSerializer
from api.serializers.pm.fishingspot_serializer import FishingSpotSerializer
from api.serializers.pm.pm_serializer import SearchElementSerializer
from api.serializers.homepage.homepage_serializer import UserLocationSerializer
from api.serializers.pm.favorites_serializer import FavoritesSerializer
| 61.375
| 79
| 0.900204
| 53
| 491
| 8.226415
| 0.358491
| 0.112385
| 0.288991
| 0.137615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057026
| 491
| 7
| 80
| 70.142857
| 0.941685
| 0.095723
| 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
| 0
| 0
| 0
| 0
| 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
|
e18378ec6772345b0c8fa4c3870b658c3cff39cc
| 392
|
py
|
Python
|
hooks/rthook-Crypto.py
|
bitProfessor/DEXBot
|
5d692fbf1acffeec46a82a12474b8a123e4c6370
|
[
"MIT"
] | 1
|
2019-11-10T06:53:35.000Z
|
2019-11-10T06:53:35.000Z
|
hooks/rthook-Crypto.py
|
g3d/DEXBot
|
a2b1462d78d7154cb10871a7cec9a44c8d6664de
|
[
"MIT"
] | null | null | null |
hooks/rthook-Crypto.py
|
g3d/DEXBot
|
a2b1462d78d7154cb10871a7cec9a44c8d6664de
|
[
"MIT"
] | 2
|
2021-02-13T10:58:33.000Z
|
2022-03-04T14:01:58.000Z
|
# Runtime hook for pycryptodome extensions
import Crypto.Util._raw_api
import importlib.machinery
import os.path
import sys
def load_raw_lib(name, cdecl):
for ext in importlib.machinery.EXTENSION_SUFFIXES:
try:
return Crypto.Util._raw_api.load_lib(os.path.join(sys._MEIPASS, name + ext), cdecl)
except OSError:
pass
Crypto.Util._raw_api.load_pycryptodome_raw_lib = load_raw_lib
| 24.5
| 86
| 0.798469
| 61
| 392
| 4.868852
| 0.508197
| 0.10101
| 0.131313
| 0.161616
| 0.13468
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122449
| 392
| 15
| 87
| 26.133333
| 0.863372
| 0.102041
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 0
| 1
| 0.090909
| false
| 0.181818
| 0.454545
| 0
| 0.636364
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
e19e86dddb623ae8d49f96263e55228824dd9f3d
| 2,355
|
py
|
Python
|
caesar.py
|
SpicyMchaggis74/353
|
ed549674e15102c4b42ed3f11a9cee85704f21ee
|
[
"Unlicense"
] | null | null | null |
caesar.py
|
SpicyMchaggis74/353
|
ed549674e15102c4b42ed3f11a9cee85704f21ee
|
[
"Unlicense"
] | null | null | null |
caesar.py
|
SpicyMchaggis74/353
|
ed549674e15102c4b42ed3f11a9cee85704f21ee
|
[
"Unlicense"
] | null | null | null |
# Sean Holmes
import sys
def encrypt(givenText, givenRotation):
cipherText = "" # encrypted text //string
givenText = givenText.lower() # get given text to lowercase
# initialize loop
index = 0 # index in given string
while index < (len(givenText)): # begin encrypting
value = (ord(givenText[index])) + givenRotation # use unicode value and rotate to given rotation
if (value <= 122 and value >= 97): # if the value is in range a to z
cipherText = cipherText + chr(value) # add char to cipher text
elif (value >= 123): # if the value is above a-z
cipherText = cipherText + chr(value - 26) # bring it back down to range and add to text
else: # any other value not in a-z will be treated as ' '
cipherText = cipherText + " "
index = index + 1 # increment to next char
print(cipherText) # output encrypted text
def decrypt(givenText, givenRotation):
cipherText = "" # encrypted text //string
givenText = givenText.lower() # get given text to lowercase
# initialize loop
index = 0 # index in given string
while index < (len(givenText)): # begin encrypting
value = (ord(givenText[index])) - givenRotation # rotate to given rotation
if (value <= 122 and value >= 97): # if the value is in range a to z
cipherText = cipherText + chr(value) # decrypt and add to text
elif (value <= 97 and value >= 56): # if the value is below a-z
cipherText = cipherText + chr(value + 26) # bring it back down to range and add to text
else: # any other value not in a-z will be treated as ' '
cipherText = cipherText + " "
index = index + 1 # increment to next char
print(cipherText) # output decrypted text
def decryptBrute(givenText):
index = 25 # 26 total loops
while (index != 0):
decrypt(givenText, index)
index = index - 1
argList = sys.argv
# Mode: -e , -u , -d
if (argList[1] == '-e'): # Encrypt with rotation
encrypt(' '.join(argList[3:]), int(argList[2]))
elif (argList[1] == '-u'): # Decrypt with rotation
decrypt(' '.join(argList[3:]), int(argList[2]))
elif (argList[1] == '-d'): # Brute force decrypt
decryptBrute(' '.join(argList[2:]))
else:
print("Please enter -e -u or -d")
| 39.25
| 105
| 0.614013
| 310
| 2,355
| 4.664516
| 0.290323
| 0.082988
| 0.027663
| 0.033195
| 0.705394
| 0.705394
| 0.705394
| 0.705394
| 0.705394
| 0.656985
| 0
| 0.022887
| 0.276433
| 2,355
| 59
| 106
| 39.915254
| 0.825704
| 0.358811
| 0
| 0.488372
| 0
| 0
| 0.024374
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.069767
| false
| 0
| 0.023256
| 0
| 0.093023
| 0.069767
| 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
|
bef9c7f74f7357d374613349eba84e3c2b338220
| 64
|
py
|
Python
|
transmogrify/tests/__init__.py
|
natgeosociety/Transmogrify
|
81d68c0c1693506ff9a2f59a8b610e0d00948636
|
[
"Apache-2.0"
] | null | null | null |
transmogrify/tests/__init__.py
|
natgeosociety/Transmogrify
|
81d68c0c1693506ff9a2f59a8b610e0d00948636
|
[
"Apache-2.0"
] | null | null | null |
transmogrify/tests/__init__.py
|
natgeosociety/Transmogrify
|
81d68c0c1693506ff9a2f59a8b610e0d00948636
|
[
"Apache-2.0"
] | null | null | null |
# from base import * # NOQA
# from autodetect import * # NOQA
| 21.333333
| 34
| 0.65625
| 8
| 64
| 5.25
| 0.625
| 0.47619
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 64
| 2
| 35
| 32
| 0.875
| 0.890625
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 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
|
55cd4f89c5a1ac8501ac5268f76c0c6439f505ee
| 8,886
|
py
|
Python
|
03_abstaining_classifier/plot.py
|
xiaozhanguva/Intrinsic_robustness_label_uncertainty
|
d9e32a3965ad6c696efd15b784876aed77a5e8a7
|
[
"MIT"
] | 3
|
2021-09-11T03:21:07.000Z
|
2022-01-10T11:22:10.000Z
|
03_abstaining_classifier/plot.py
|
xiaozhanguva/Intrinsic_robustness_label_uncertainty
|
d9e32a3965ad6c696efd15b784876aed77a5e8a7
|
[
"MIT"
] | null | null | null |
03_abstaining_classifier/plot.py
|
xiaozhanguva/Intrinsic_robustness_label_uncertainty
|
d9e32a3965ad6c696efd15b784876aed77a5e8a7
|
[
"MIT"
] | null | null | null |
import torch
import argparse
import numpy as np
import copy
import os
from robustbench.data import load_cifar10
import matplotlib.pyplot as plt
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--model_name', type=str, default='Carmon2019Unlabeled')
parser.add_argument('--norm', type=str, default='Linf')
parser.add_argument('--eps', type=float, default=8/255)
parser.add_argument('--n_ex', type=int, default=1000, help='number of examples to evaluate on')
parser.add_argument('--batch_size', type=int, default=500, help='batch size for evaluation')
parser.add_argument('--data_dir', type=str, default='../00_data', help='where to store downloaded datasets')
parser.add_argument('--model_dir', type=str, default='./models', help='where to store downloaded models')
parser.add_argument('--device', type=str, default='cuda', help='device to use for computations')
args = parser.parse_args()
return args
if __name__ == '__main__':
args = parse_args()
device = torch.device(args.device)
if not os.path.exists('./figs'):
os.makedirs('./figs')
x_test, y_test = load_cifar10(args.n_ex, args.data_dir)
x_test, y_test = x_test.to(device), y_test.to(device)
y_soft_labels = np.load(args.data_dir+'/cifar10h-probs.npy')[:args.n_ex]
probs_fstar = np.array([ y_soft_labels[i, y_test[i]] for i in range(len(y_test)) ])
y_soft_labels_copy = copy.deepcopy(y_soft_labels)
for i in range(len(y_test)):
y_soft_labels_copy[i, y_test[i]] = 0
probs_remain_top1 = np.max(y_soft_labels_copy, axis=1)
lu_test = 1 - (probs_fstar - probs_remain_top1)
normal_flags = np.load('./attack_log/std_'+args.norm+'_'+args.model_name+'.npy')
robust_flags = np.load('./attack_log/rob_'+args.norm+'_'+args.model_name+'.npy')
print(normal_flags)
print(robust_flags)
#### sort the examples by label uncertainty
sorted_inds = np.argsort(lu_test) ## lu from smallest to largest (0->2)
print(sorted_inds)
ratio_arr = np.arange(0.01, 1.00, 0.01)
acc_arr = []
rob_acc_arr = []
for ratio in ratio_arr:
print('===== ratio: {:.2%}'.format(ratio))
n_selected = int(np.floor(ratio*len(lu_test)))
inds_certain = sorted_inds[:n_selected]
acc_certain = np.sum(normal_flags[inds_certain])/ len(inds_certain)
rob_acc_certain = np.sum(robust_flags[inds_certain]) / len(inds_certain)
print('Clean acc: {:.2%}, Robust acc: {:.2%}'.format(acc_certain, rob_acc_certain))
acc_arr.append(acc_certain)
rob_acc_arr.append(rob_acc_certain)
print('')
plt.figure(figsize=(9, 6))
plt.plot(ratio_arr, acc_arr, linewidth=3.0, color='mediumblue')
plt.plot(ratio_arr, rob_acc_arr, linewidth=3.0, color='orangered')
plt.legend(['clean acc', 'robust acc'], fontsize=16, loc=3)
plt.xticks(np.arange(0.00, 1.01, step=0.10), fontsize=14)
plt.yticks(np.arange(0.55, 1.01, step=0.05), fontsize=14)
# plt.xlim([0.0, 1.0])
plt.ylim([0.55, 1.0])
plt.xlabel("Percentage of Included Examples", fontsize=16)
plt.ylabel("Accuracy", fontsize=16)
plt.annotate('lu'+r'$\leq$'+'{:.2f}'.format(np.quantile(lu_test, 0.98)), (0.98, 0.55),
color='black', fontsize=12, xycoords='data', xytext=(0.98, 0.59),
arrowprops=dict(facecolor='black', arrowstyle='->'),
horizontalalignment='center', verticalalignment='top',)
plt.annotate('lu'+r'$\leq$'+'{:.2f}'.format(np.quantile(lu_test, 0.90)), (0.90, 0.55),
color='black', fontsize=12, xycoords='data', xytext=(0.84, 0.59),
arrowprops=dict(facecolor='black', arrowstyle='->'),
horizontalalignment='center', verticalalignment='top',)
plt.annotate('lu'+r'$\leq$'+'{:.2f}'.format(np.quantile(lu_test, 0.80)), (0.80, 0.55),
color='black', fontsize=12, xycoords='data', xytext=(0.70, 0.59),
arrowprops=dict(facecolor='black', arrowstyle='->'),
horizontalalignment='center', verticalalignment='top',)
plt.savefig('./figs/certain_'+args.norm+'_'+args.model_name+'.png')
#### plot the clean acc and robust acc w.r.t. label uncertain examples
sorted_inds = np.argsort(-lu_test) ## lu from largest to smallest (0->2)
print(sorted_inds)
ratio_arr = np.arange(0.01, 1.00, 0.01)
acc_arr = []
rob_acc_arr = []
for ratio in ratio_arr:
print('===== ratio: {:.2%}'.format(ratio))
n_selected = int(np.floor(ratio*len(lu_test)))
inds_uncertain = sorted_inds[:n_selected]
acc_uncertain = np.sum(normal_flags[inds_uncertain])/ len(inds_uncertain)
rob_acc_uncertain = np.sum(robust_flags[inds_uncertain]) / len(inds_uncertain)
print('Clean acc: {:.2%}, Robust acc: {:.2%}'.format(acc_uncertain, rob_acc_uncertain))
acc_arr.append(acc_uncertain)
rob_acc_arr.append(rob_acc_uncertain)
plt.figure(figsize=(9, 6))
plt.plot(ratio_arr, acc_arr, linewidth=3.0, color='mediumblue')
plt.plot(ratio_arr, rob_acc_arr, linewidth=3.0, color='orangered')
plt.legend(['clean acc', 'robust acc'], fontsize=16, loc=4)
plt.xticks(np.arange(0.00, 1.01, step=0.10), fontsize=14)
plt.yticks(np.arange(0.0, 1.01, step=0.1), fontsize=14)
# plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.0])
plt.xlabel("Percentage of Included Examples", fontsize=16)
plt.ylabel("Accuracy", fontsize=16)
plt.annotate('lu'+r'$\geq$'+'{:.2f}'.format(np.quantile(lu_test, 0.98)), (0.02, 0.0),
color='black', fontsize=12, xycoords='data', xytext=(0.02, 0.1),
arrowprops=dict(facecolor='black', arrowstyle='->'),
horizontalalignment='center', verticalalignment='top',)
plt.annotate('lu'+r'$\geq$'+'{:.2f}'.format(np.quantile(lu_test, 0.90)), (0.1, 0.0),
color='black', fontsize=12, xycoords='data', xytext=(0.16, 0.1),
arrowprops=dict(facecolor='black', arrowstyle='->'),
horizontalalignment='center', verticalalignment='top',)
plt.annotate('lu'+r'$\geq$'+'{:.2f}'.format(np.quantile(lu_test, 0.80)), (0.2, 0.0),
color='black', fontsize=12, xycoords='data', xytext=(0.30, 0.1),
arrowprops=dict(facecolor='black', arrowstyle='->'),
horizontalalignment='center', verticalalignment='top',)
plt.savefig('./figs/uncertain_'+args.norm+'_'+args.model_name+'.png')
#### plot the clean acc and robust acc w.r.t. label certain examples
q_lu_arr = np.arange(0.00, 1.00, 0.001)
acc_arr = []
rob_acc_arr = []
for q_lu in q_lu_arr:
lu_thres = np.quantile(lu_test, q_lu)
print('===== q_lu: {:.2%}, lu threshold: {:.4f}'.format(q_lu, lu_thres))
inds_certain = np.argwhere(lu_test <= lu_thres).ravel()
acc_certain = np.sum(normal_flags[inds_certain])/ len(inds_certain)
rob_acc_certain = np.sum(robust_flags[inds_certain]) / len(inds_certain)
print('Clean acc: {:.2%}, Robust acc: {:.2%}'.format(acc_certain, rob_acc_certain))
acc_arr.append(acc_certain)
rob_acc_arr.append(rob_acc_certain)
plt.figure(figsize=(9, 6))
plt.plot(q_lu_arr, acc_arr, linewidth=3.0)
plt.plot(q_lu_arr, rob_acc_arr, linewidth=3.0)
plt.legend(['clean acc', 'robust acc'], fontsize=16, loc=3)
plt.xticks(np.arange(0.00, 1.01, step=0.10), fontsize=16)
plt.yticks(np.arange(0.55, 1.01, step=0.05), fontsize=16)
plt.xlabel("Ratio Threshold (certain)", fontsize=20)
plt.ylabel("Accuracy", fontsize=20)
plt.savefig('./figs/certain_'+args.norm+'_'+args.model_name+'.png')
#### plot the clean acc and robust acc w.r.t. label uncertain examples
q_lu_arr = np.arange(0.00, 1.00, 0.002)
acc_arr = []
rob_acc_arr = []
for q_lu in q_lu_arr:
lu_thres = np.quantile(lu_test, q_lu)
print('===== q_lu: {:.2%}, lu threshold: {:.4f}'.format(q_lu, lu_thres))
inds_uncertain = np.argwhere(lu_test >= lu_thres).ravel()
acc_uncertain = np.sum(normal_flags[inds_uncertain])/ len(inds_uncertain)
rob_acc_uncertain = np.sum(robust_flags[inds_uncertain]) / len(inds_uncertain)
print('Clean acc: {:.2%}, Robust acc: {:.2%}'.format(acc_uncertain, rob_acc_uncertain))
acc_arr.append(acc_uncertain)
rob_acc_arr.append(rob_acc_uncertain)
plt.figure(figsize=(9, 6))
plt.plot(1 - q_lu_arr, acc_arr, linewidth=3.0)
plt.plot(1 - q_lu_arr, rob_acc_arr, linewidth=3.0)
plt.legend(['clean acc', 'robust acc'], fontsize=16, loc=4)
plt.xticks(np.arange(0.00, 1.01, step=0.10), fontsize=16)
plt.yticks(np.arange(0.0, 1.01, step=0.1), fontsize=16)
plt.xlabel("Ratio Threshold (uncertain)", fontsize=20)
plt.ylabel("Accuracy", fontsize=20)
plt.savefig('./figs/uncertain_'+args.norm+'_'+args.model_name+'.png')
| 43.346341
| 112
| 0.644609
| 1,332
| 8,886
| 4.113363
| 0.144895
| 0.026282
| 0.019712
| 0.017521
| 0.781529
| 0.75762
| 0.739369
| 0.734806
| 0.713269
| 0.709984
| 0
| 0.046349
| 0.176907
| 8,886
| 205
| 113
| 43.346341
| 0.702762
| 0.038938
| 0
| 0.539474
| 0
| 0
| 0.140409
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.006579
| false
| 0
| 0.046053
| 0
| 0.059211
| 0.085526
| 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
|
55fc205ca22d2339c5c28b90da7b59d0db871d34
| 89
|
py
|
Python
|
SolrClient/transport/__init__.py
|
cmilheim/SolrClient
|
32420fc2b8d17fd4457d957771b3ed05b6ac48cc
|
[
"Apache-2.0"
] | 69
|
2015-10-16T20:49:53.000Z
|
2021-11-23T06:55:39.000Z
|
SolrClient/transport/__init__.py
|
cmilheim/SolrClient
|
32420fc2b8d17fd4457d957771b3ed05b6ac48cc
|
[
"Apache-2.0"
] | 50
|
2015-11-21T16:20:15.000Z
|
2020-11-03T09:38:17.000Z
|
SolrClient/transport/__init__.py
|
cmilheim/SolrClient
|
32420fc2b8d17fd4457d957771b3ed05b6ac48cc
|
[
"Apache-2.0"
] | 33
|
2015-11-23T01:37:44.000Z
|
2021-07-17T12:48:48.000Z
|
from .transportbase import TransportBase
from .transportrequests import TransportRequests
| 44.5
| 48
| 0.898876
| 8
| 89
| 10
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078652
| 89
| 2
| 48
| 44.5
| 0.97561
| 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
|
361ccb2491624d062cb73a1fbed74781df118442
| 103
|
py
|
Python
|
api/code/send_ping/lambda_function.py
|
mh35/tb08_chatapp
|
b148ea7e3db22471d4995c34a0378e1f7f8e0e8a
|
[
"MIT"
] | null | null | null |
api/code/send_ping/lambda_function.py
|
mh35/tb08_chatapp
|
b148ea7e3db22471d4995c34a0378e1f7f8e0e8a
|
[
"MIT"
] | null | null | null |
api/code/send_ping/lambda_function.py
|
mh35/tb08_chatapp
|
b148ea7e3db22471d4995c34a0378e1f7f8e0e8a
|
[
"MIT"
] | null | null | null |
"""定期PING送信のLambdaプログラムです
"""
def lambda_handler(event, context):
"""Lambdaハンドラのメインプログラムです
"""
| 17.166667
| 35
| 0.699029
| 7
| 103
| 10.142857
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145631
| 103
| 6
| 36
| 17.166667
| 0.806818
| 0.475728
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| false
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
361fb689bbea5290334dc14f4244e4d9d3531327
| 57
|
py
|
Python
|
pybin/__main__.py
|
cefn/pybin
|
e8e221e321d2834d719e6f9867211313a53e4e37
|
[
"Apache-2.0",
"MIT"
] | 25
|
2017-09-01T07:37:05.000Z
|
2022-02-05T07:43:24.000Z
|
pybin/__main__.py
|
cefn/pybin
|
e8e221e321d2834d719e6f9867211313a53e4e37
|
[
"Apache-2.0",
"MIT"
] | 3
|
2018-05-21T13:17:08.000Z
|
2019-04-14T16:05:06.000Z
|
pybin/__main__.py
|
cefn/pybin
|
e8e221e321d2834d719e6f9867211313a53e4e37
|
[
"Apache-2.0",
"MIT"
] | 2
|
2017-12-10T05:37:56.000Z
|
2019-04-14T16:07:54.000Z
|
import sys
from pybin.cli import pybin
sys.exit(pybin())
| 14.25
| 27
| 0.77193
| 10
| 57
| 4.4
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122807
| 57
| 3
| 28
| 19
| 0.88
| 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
|
3677b5966781a78b2f7fc86451299574fe519a5f
| 4,806
|
py
|
Python
|
tests/unit/test_curriculum_learning.py
|
ganik/DeepSpeed
|
788e1c40e83beacfc4901e7daa1e097d2efb82bb
|
[
"MIT"
] | 1
|
2022-02-12T06:27:26.000Z
|
2022-02-12T06:27:26.000Z
|
tests/unit/test_curriculum_learning.py
|
ganik/DeepSpeed
|
788e1c40e83beacfc4901e7daa1e097d2efb82bb
|
[
"MIT"
] | null | null | null |
tests/unit/test_curriculum_learning.py
|
ganik/DeepSpeed
|
788e1c40e83beacfc4901e7daa1e097d2efb82bb
|
[
"MIT"
] | null | null | null |
import torch
import torch.distributed as dist
import deepspeed
import argparse
import pytest
import json
import os
import numpy as np
import time
from .common import distributed_test
from .simple_model import Curriculum_SimpleModel, random_dataloader, args_from_dict
def test_curriculum_scheduler_fixed_discrete(tmpdir):
config_dict = {
"train_batch_size": 2,
"steps_per_print": 1,
"optimizer": {
"type": "Adam",
"params": {
"lr": 0.00015,
"weight_decay": 0.01
}
},
"gradient_clipping": 1.0,
"fp16": {
"enabled": True,
"loss_scale": 0,
"initial_scale_power": 16
},
"curriculum_learning": {
"enabled": True,
"curriculum_type": "seqlen",
"min_difficulty": 1,
"max_difficulty": 5,
"schedule_type": "fixed_discrete",
"schedule_config": {
"difficulty": [1,
2,
3,
4,
5],
"max_step": [2,
4,
6,
8]
}
}
}
args = args_from_dict(tmpdir, config_dict)
hidden_dim = 10
ground_truths = {1: 1, 2: 1, 3: 2, 4: 2, 5: 3, 6: 3, 7: 4, 8: 4}
model = Curriculum_SimpleModel(hidden_dim)
@distributed_test(world_size=[1, 2])
def _test_curriculum_scheduler_fixed_discrete(args, model, hidden_dim):
model, _, _, _ = deepspeed.initialize(args=args,
model=model,
model_parameters=model.parameters())
data_loader = random_dataloader(model=model,
total_samples=20,
hidden_dim=hidden_dim,
device=model.device)
for n, batch in enumerate(data_loader):
loss, seqlen = model(batch[0], batch[1])
model.backward(loss)
model.step()
true_seqlen = 5
if n + 1 in ground_truths:
true_seqlen = ground_truths[n + 1]
print('at step {} the seqlen is {}'.format(n + 1, seqlen))
assert seqlen == true_seqlen, f"Incorrect curriculum schedule"
_test_curriculum_scheduler_fixed_discrete(args=args,
model=model,
hidden_dim=hidden_dim)
def test_curriculum_scheduler_fixed_linear(tmpdir):
config_dict = {
"train_batch_size": 2,
"steps_per_print": 1,
"optimizer": {
"type": "Adam",
"params": {
"lr": 0.00015,
"weight_decay": 0.01
}
},
"gradient_clipping": 1.0,
"fp16": {
"enabled": True,
"loss_scale": 0,
"initial_scale_power": 16
},
"curriculum_learning": {
"enabled": True,
"curriculum_type": "seqlen",
"min_difficulty": 2,
"max_difficulty": 10,
"schedule_type": "fixed_linear",
"schedule_config": {
"total_curriculum_step": 8,
"difficulty_step": 2
}
}
}
args = args_from_dict(tmpdir, config_dict)
hidden_dim = 10
ground_truths = {1: 2, 2: 4, 3: 4, 4: 6, 5: 6, 6: 8, 7: 8, 8: 10, 9: 10, 10: 10}
model = Curriculum_SimpleModel(hidden_dim)
@distributed_test(world_size=[1, 2])
def _test_curriculum_scheduler_fixed_linear(args, model, hidden_dim):
model, _, _, _ = deepspeed.initialize(args=args,
model=model,
model_parameters=model.parameters())
data_loader = random_dataloader(model=model,
total_samples=20,
hidden_dim=hidden_dim,
device=model.device)
for n, batch in enumerate(data_loader):
loss, seqlen = model(batch[0], batch[1])
model.backward(loss)
model.step()
if n + 1 in ground_truths:
true_seqlen = ground_truths[n + 1]
print('at step {} the seqlen is {}'.format(n + 1, seqlen))
assert seqlen == true_seqlen, f"Incorrect curriculum schedule"
_test_curriculum_scheduler_fixed_linear(args=args,
model=model,
hidden_dim=hidden_dim)
| 35.865672
| 84
| 0.47732
| 463
| 4,806
| 4.684665
| 0.215983
| 0.058091
| 0.063624
| 0.077455
| 0.796681
| 0.796681
| 0.748732
| 0.748732
| 0.715537
| 0.715537
| 0
| 0.041833
| 0.428007
| 4,806
| 133
| 85
| 36.135338
| 0.747181
| 0
| 0
| 0.624
| 0
| 0
| 0.134831
| 0.00437
| 0
| 0
| 0
| 0
| 0.016
| 1
| 0.032
| false
| 0
| 0.088
| 0
| 0.12
| 0.032
| 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
|
7fc4a02fec6beef695b6b3021ba785d0fdd162fe
| 87
|
py
|
Python
|
blobcity/aicloud/__init__.py
|
lahdjirayhan/autoai
|
de4c0abfa07f5385ad566d6391fca38d17a22dc1
|
[
"Apache-2.0"
] | 115
|
2021-09-01T03:55:40.000Z
|
2022-03-29T07:09:03.000Z
|
blobcity/aicloud/__init__.py
|
maxpark/autoai
|
c9f6d8d6cc2027b7918bae88862ea476cc49397f
|
[
"Apache-2.0"
] | 87
|
2021-09-10T08:56:32.000Z
|
2022-02-01T07:18:05.000Z
|
blobcity/aicloud/__init__.py
|
maxpark/autoai
|
c9f6d8d6cc2027b7918bae88862ea476cc49397f
|
[
"Apache-2.0"
] | 35
|
2021-09-01T04:16:18.000Z
|
2022-02-05T20:32:26.000Z
|
from .access_validation import set_token
from .auto_save_yaml import send_yaml_to_cloud
| 43.5
| 46
| 0.896552
| 15
| 87
| 4.733333
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08046
| 87
| 2
| 46
| 43.5
| 0.8875
| 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
|
7fec2354d9006d701a877403b234085d310dbe6d
| 117
|
py
|
Python
|
Spotify/config_censored.py
|
gur111/MtmPythonEnrichment
|
4919ec1a6a6ed975b9e522834aebbdb3510c1d52
|
[
"MIT"
] | null | null | null |
Spotify/config_censored.py
|
gur111/MtmPythonEnrichment
|
4919ec1a6a6ed975b9e522834aebbdb3510c1d52
|
[
"MIT"
] | null | null | null |
Spotify/config_censored.py
|
gur111/MtmPythonEnrichment
|
4919ec1a6a6ed975b9e522834aebbdb3510c1d52
|
[
"MIT"
] | null | null | null |
SPOTIPY_CLIENT_ID = 'fa325***********************2365'
SPOTIPY_CLIENT_SECRET = 'be4c0***********************8c4c'
| 58.5
| 58
| 0.478632
| 10
| 117
| 5.2
| 0.8
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101852
| 0.076923
| 117
| 2
| 59
| 58.5
| 0.37963
| 0
| 0
| 0
| 0
| 0
| 0.542373
| 0.542373
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
7ff3b56629d676b2640a4f07b308b8fbef4d060f
| 371
|
py
|
Python
|
src/ssm_document_generator/definition/parameters/assign_parameters_mixin.py
|
awslabs/aws-systems-manager-document-generator
|
2c041fd52342d95da4535fe3236e43933cc6e08d
|
[
"Apache-2.0"
] | 54
|
2018-03-07T18:46:50.000Z
|
2022-01-26T04:35:56.000Z
|
src/ssm_document_generator/definition/parameters/assign_parameters_mixin.py
|
eshack94/aws-systems-manager-document-generator
|
2c041fd52342d95da4535fe3236e43933cc6e08d
|
[
"Apache-2.0"
] | 2
|
2018-09-30T23:39:08.000Z
|
2020-04-03T17:15:21.000Z
|
src/ssm_document_generator/definition/parameters/assign_parameters_mixin.py
|
eshack94/aws-systems-manager-document-generator
|
2c041fd52342d95da4535fe3236e43933cc6e08d
|
[
"Apache-2.0"
] | 12
|
2018-07-27T21:04:12.000Z
|
2021-10-20T18:02:57.000Z
|
class AssignParametersMixin:
"""
Adds the functionality to generate the code for passing the parameters in the following form:
parameterName={{parameterName}}
"""
def generate_parameters_code(self):
return super().generate_parameters_code() + \
[parameter.name + "={{" + parameter.name + "}}" for parameter in self.parameters]
| 37.1
| 97
| 0.673854
| 38
| 371
| 6.473684
| 0.552632
| 0.146341
| 0.178862
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.218329
| 371
| 9
| 98
| 41.222222
| 0.848276
| 0.336927
| 0
| 0
| 1
| 0
| 0.022124
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.25
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
3d216f2c2df923b6247b260be874ec1a3e4db684
| 221
|
py
|
Python
|
src/ufdl/annotations_plugin/common/component/util/__init__.py
|
waikato-ufdl/ufdl-annotations-plugin
|
9eb3d807e35215ad9cfbd4aa651d7f7142e83efe
|
[
"Apache-2.0"
] | null | null | null |
src/ufdl/annotations_plugin/common/component/util/__init__.py
|
waikato-ufdl/ufdl-annotations-plugin
|
9eb3d807e35215ad9cfbd4aa651d7f7142e83efe
|
[
"Apache-2.0"
] | 4
|
2020-07-29T04:09:13.000Z
|
2020-11-22T20:52:18.000Z
|
src/ufdl/annotations_plugin/common/component/util/__init__.py
|
waikato-ufdl/ufdl-annotations-plugin
|
9eb3d807e35215ad9cfbd4aa651d7f7142e83efe
|
[
"Apache-2.0"
] | null | null | null |
"""
Utilities for creating the common UFDL components.
"""
from ._typing import DatasetMethods
from ._UFDLContextOptionsMixin import UFDLContextOptionsMixin
from ._UFDLProjectSpecificMixin import UFDLProjectSpecificMixin
| 31.571429
| 63
| 0.859729
| 19
| 221
| 9.842105
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095023
| 221
| 6
| 64
| 36.833333
| 0.935
| 0.226244
| 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
|
3d2c0774befc9bc891a7c0d982d986faa8fe20e9
| 107
|
py
|
Python
|
vnpy/chart/__init__.py
|
fakecoinbase/jojoquantslashjonpy
|
d92ba43b0de29eeef46c4eb0545a4eac465a280d
|
[
"MIT"
] | 2
|
2020-08-17T18:56:07.000Z
|
2021-11-22T00:47:58.000Z
|
vnpy/chart/__init__.py
|
fakecoinbase/jojoquantslashjonpy
|
d92ba43b0de29eeef46c4eb0545a4eac465a280d
|
[
"MIT"
] | null | null | null |
vnpy/chart/__init__.py
|
fakecoinbase/jojoquantslashjonpy
|
d92ba43b0de29eeef46c4eb0545a4eac465a280d
|
[
"MIT"
] | null | null | null |
from .widget import ChartWidget
from .item import CandleItem, VolumeItem
# from .item import TechIndexItem
| 26.75
| 40
| 0.82243
| 13
| 107
| 6.769231
| 0.615385
| 0.181818
| 0.318182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130841
| 107
| 3
| 41
| 35.666667
| 0.946237
| 0.28972
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3d5a4e0ae66bf8bcfe34873a6daa91e037800a37
| 108
|
py
|
Python
|
pylatex/command.py
|
sebastianhaas/PyLaTeX
|
e33ec1cd29a429dc5c984fb698af22ad3c153b61
|
[
"MIT"
] | null | null | null |
pylatex/command.py
|
sebastianhaas/PyLaTeX
|
e33ec1cd29a429dc5c984fb698af22ad3c153b61
|
[
"MIT"
] | null | null | null |
pylatex/command.py
|
sebastianhaas/PyLaTeX
|
e33ec1cd29a429dc5c984fb698af22ad3c153b61
|
[
"MIT"
] | null | null | null |
# flake8: noqa
"""
Stub command module for backwards compatibility.
"""
from .base_classes import Command
| 13.5
| 48
| 0.75
| 13
| 108
| 6.153846
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010989
| 0.157407
| 108
| 7
| 49
| 15.428571
| 0.868132
| 0.574074
| 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
|
e9ff3365d059f4aa1258c1ffc0716182f71bd512
| 54
|
py
|
Python
|
factor_vae/__init__.py
|
kiwi0fruit/jats-semi-supervised-pytorch
|
67e9bb85f09f8ef02e17e495784d1d9a71c3adec
|
[
"MIT"
] | null | null | null |
factor_vae/__init__.py
|
kiwi0fruit/jats-semi-supervised-pytorch
|
67e9bb85f09f8ef02e17e495784d1d9a71c3adec
|
[
"MIT"
] | null | null | null |
factor_vae/__init__.py
|
kiwi0fruit/jats-semi-supervised-pytorch
|
67e9bb85f09f8ef02e17e495784d1d9a71c3adec
|
[
"MIT"
] | null | null | null |
from .module import Discriminator, FactorVAEContainer
| 27
| 53
| 0.87037
| 5
| 54
| 9.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.092593
| 54
| 1
| 54
| 54
| 0.959184
| 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
|
1810f0f670445dfa7e529078f9272abb312fdd76
| 295
|
py
|
Python
|
run.py
|
oNguyenHaPhan/Flask_framgiatw_docker
|
e5ae30aea7e7ff9fff0ed27c1502b03786c640d1
|
[
"MIT"
] | null | null | null |
run.py
|
oNguyenHaPhan/Flask_framgiatw_docker
|
e5ae30aea7e7ff9fff0ed27c1502b03786c640d1
|
[
"MIT"
] | null | null | null |
run.py
|
oNguyenHaPhan/Flask_framgiatw_docker
|
e5ae30aea7e7ff9fff0ed27c1502b03786c640d1
|
[
"MIT"
] | null | null | null |
#!venv/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
from app import app
from app import app as application
if __name__ == '__main__':
import logging
logging.basicConfig(filename='error.log',level=logging.DEBUG)
app.run(host='0.0.0.0', debug = True)
| 21.071429
| 65
| 0.738983
| 44
| 295
| 4.772727
| 0.568182
| 0.028571
| 0.190476
| 0.295238
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01581
| 0.142373
| 295
| 13
| 66
| 22.692308
| 0.814229
| 0.054237
| 0
| 0.222222
| 0
| 0
| 0.086331
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.555556
| 0
| 0.555556
| 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
|
1810f55dec97a447cefa5f641661d31f8435450d
| 93
|
py
|
Python
|
sensibo_api/admin.py
|
eavior/django-server
|
80a702ba05ce73da3f4baff024635100cb1c1bed
|
[
"MIT"
] | null | null | null |
sensibo_api/admin.py
|
eavior/django-server
|
80a702ba05ce73da3f4baff024635100cb1c1bed
|
[
"MIT"
] | null | null | null |
sensibo_api/admin.py
|
eavior/django-server
|
80a702ba05ce73da3f4baff024635100cb1c1bed
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from sensibo_api import models
# Register your models here.
| 23.25
| 32
| 0.827957
| 14
| 93
| 5.428571
| 0.785714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139785
| 93
| 3
| 33
| 31
| 0.95
| 0.27957
| 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
|
18188dbcfd6d9e7a27f2a1de418277314ed08fab
| 203
|
py
|
Python
|
3-1.py
|
DavidSenpai/aoc
|
479743a87f586e56f647299de78fb34c6260bb03
|
[
"MIT"
] | 1
|
2022-02-17T07:45:50.000Z
|
2022-02-17T07:45:50.000Z
|
3-1.py
|
DavidSenpai/aoc
|
479743a87f586e56f647299de78fb34c6260bb03
|
[
"MIT"
] | null | null | null |
3-1.py
|
DavidSenpai/aoc
|
479743a87f586e56f647299de78fb34c6260bb03
|
[
"MIT"
] | 2
|
2021-12-02T22:13:42.000Z
|
2021-12-13T08:14:31.000Z
|
print((lambda bits: int("".join(max(set(bit), key=bit.count) for bit in bits), base=2) * int("".join(min(set(bit), key=bit.count) for bit in bits), base=2))(tuple(zip(*open("input3.txt").readlines()))))
| 101.5
| 202
| 0.655172
| 37
| 203
| 3.594595
| 0.567568
| 0.105263
| 0.135338
| 0.180451
| 0.511278
| 0.511278
| 0.511278
| 0.511278
| 0.511278
| 0.511278
| 0
| 0.016129
| 0.083744
| 203
| 1
| 203
| 203
| 0.698925
| 0
| 0
| 0
| 0
| 0
| 0.049261
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
1829bcd2579f93631f84eeca52f456ce775e55c2
| 84
|
py
|
Python
|
shopipy/exceptions.py
|
lowercase00/pyshopify
|
98fdd0ac30569725fc0ec32345a92cd84c510a6a
|
[
"MIT"
] | 1
|
2021-10-17T02:09:22.000Z
|
2021-10-17T02:09:22.000Z
|
shopipy/exceptions.py
|
lowercase00/shopipy
|
98fdd0ac30569725fc0ec32345a92cd84c510a6a
|
[
"MIT"
] | null | null | null |
shopipy/exceptions.py
|
lowercase00/shopipy
|
98fdd0ac30569725fc0ec32345a92cd84c510a6a
|
[
"MIT"
] | null | null | null |
class CredentialsError(Exception):
pass
class InvalidSetup(Exception):
pass
| 16.8
| 34
| 0.761905
| 8
| 84
| 8
| 0.625
| 0.40625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 84
| 5
| 35
| 16.8
| 0.914286
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
1843fde2f9fc705427bbe7b70bc6914b1e8a8a4d
| 95
|
py
|
Python
|
passByReference.py
|
bourneagain/pythonBytes
|
be115162147e52718aacbfb9cd2763aa02754f28
|
[
"MIT"
] | 1
|
2017-05-29T02:02:27.000Z
|
2017-05-29T02:02:27.000Z
|
passByReference.py
|
bourneagain/pythonBytes
|
be115162147e52718aacbfb9cd2763aa02754f28
|
[
"MIT"
] | null | null | null |
passByReference.py
|
bourneagain/pythonBytes
|
be115162147e52718aacbfb9cd2763aa02754f28
|
[
"MIT"
] | null | null | null |
def passList(A):
#A.append("this is end");
A=[123,3]
A=[1,2,3]
print A
passList(A)
print A
| 9.5
| 26
| 0.610526
| 21
| 95
| 2.761905
| 0.571429
| 0.310345
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088608
| 0.168421
| 95
| 9
| 27
| 10.555556
| 0.64557
| 0.252632
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.333333
| 0
| null | null | 0.333333
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
185d14a17996730085443ef94d80b05de769561e
| 37
|
py
|
Python
|
Lesson9/random.py
|
shinkai-tester/python_beginner
|
a934328c9a50241cc3f02a423060e16aab53b425
|
[
"Apache-2.0"
] | 2
|
2021-06-01T13:24:04.000Z
|
2021-06-01T13:27:47.000Z
|
Lesson9/random.py
|
shinkai-tester/python_beginner
|
a934328c9a50241cc3f02a423060e16aab53b425
|
[
"Apache-2.0"
] | null | null | null |
Lesson9/random.py
|
shinkai-tester/python_beginner
|
a934328c9a50241cc3f02a423060e16aab53b425
|
[
"Apache-2.0"
] | null | null | null |
#print(list(set(input().split()))[0])
| 37
| 37
| 0.621622
| 6
| 37
| 3.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027027
| 0
| 37
| 1
| 37
| 37
| 0.594595
| 0.972973
| 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
|
18821b0ca5a144b9f7a54abca0ce92da9d37b5f2
| 51
|
py
|
Python
|
spym/io/omicronscala/__init__.py
|
ns-rse/spym
|
5356d97d6baf774a3bdd8c03b436052b8d74dbd0
|
[
"MIT"
] | 4
|
2021-02-08T08:47:52.000Z
|
2021-12-17T19:51:17.000Z
|
spym/io/omicronscala/__init__.py
|
ns-rse/spym
|
5356d97d6baf774a3bdd8c03b436052b8d74dbd0
|
[
"MIT"
] | 4
|
2020-09-29T08:47:37.000Z
|
2021-07-15T13:56:43.000Z
|
spym/io/omicronscala/__init__.py
|
ns-rse/spym
|
5356d97d6baf774a3bdd8c03b436052b8d74dbd0
|
[
"MIT"
] | 3
|
2021-07-10T18:42:06.000Z
|
2022-03-31T08:15:42.000Z
|
from ._methods import load, to_dataset, to_nexus
| 17
| 48
| 0.784314
| 8
| 51
| 4.625
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156863
| 51
| 2
| 49
| 25.5
| 0.860465
| 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
|
43fec5706b6dfc0416030c763b8b11a232a99d5b
| 39
|
py
|
Python
|
PyPLS/__init__.py
|
showhei/show-time
|
5da4c4fd5270d7ba61425649129d2538dd50cb38
|
[
"MIT"
] | 15
|
2019-05-01T03:20:50.000Z
|
2021-10-17T09:09:37.000Z
|
PyPLS/__init__.py
|
showhei/show-time
|
5da4c4fd5270d7ba61425649129d2538dd50cb38
|
[
"MIT"
] | 1
|
2021-11-25T14:37:08.000Z
|
2021-11-25T14:37:08.000Z
|
PyPLS/__init__.py
|
showhei/show-time
|
5da4c4fd5270d7ba61425649129d2538dd50cb38
|
[
"MIT"
] | 5
|
2020-01-24T19:29:42.000Z
|
2021-04-27T08:58:22.000Z
|
## Written by xynx59 and Xinyue-Miranda
| 39
| 39
| 0.794872
| 6
| 39
| 5.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.128205
| 39
| 1
| 39
| 39
| 0.852941
| 0.923077
| 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
|
a10a5adbf154f5f2dccac9416f0907448fafd98c
| 82
|
py
|
Python
|
notebook_autorun/util.py
|
oscar6echo/notebook-autorun
|
e229bc99f21cecc26fceb9748cffc82ea2d0a7f9
|
[
"MIT"
] | null | null | null |
notebook_autorun/util.py
|
oscar6echo/notebook-autorun
|
e229bc99f21cecc26fceb9748cffc82ea2d0a7f9
|
[
"MIT"
] | 1
|
2017-12-12T16:59:17.000Z
|
2017-12-19T08:46:30.000Z
|
notebook_autorun/util.py
|
oscar6echo/notebook-autorun
|
e229bc99f21cecc26fceb9748cffc82ea2d0a7f9
|
[
"MIT"
] | null | null | null |
import os
def is_digit(s):
"""
"""
return s.lstrip('+-').isdigit()
| 9.111111
| 35
| 0.487805
| 10
| 82
| 3.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.280488
| 82
| 8
| 36
| 10.25
| 0.661017
| 0
| 0
| 0
| 0
| 0
| 0.028571
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a10dd1fc2ca4d01a124ab4ccb09d380ad9d39cfd
| 14,516
|
py
|
Python
|
model/VLAE.py
|
Jueast/VLAE_Pytorch
|
8373390008d611909997e4a3de8396f617d53a49
|
[
"MIT"
] | null | null | null |
model/VLAE.py
|
Jueast/VLAE_Pytorch
|
8373390008d611909997e4a3de8396f617d53a49
|
[
"MIT"
] | null | null | null |
model/VLAE.py
|
Jueast/VLAE_Pytorch
|
8373390008d611909997e4a3de8396f617d53a49
|
[
"MIT"
] | null | null | null |
from model.abstract_VAE import VAE
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from scipy.stats import norm
class StableBCELoss(nn.modules.Module):
def __init__(self):
super(StableBCELoss, self).__init__()
def forward(self, input, target):
neg_abs = - input.abs()
loss = input.clamp(min=0) - input * target + (1 + neg_abs.exp()).log()
return loss.sum()
class CNNEncodeLayer(nn.Module):
def __init__(self, input, output, zdim, batchnorm, activacation, out_img_dims):
super(CNNEncodeLayer, self).__init__()
if activacation == "lrelu":
self.act = nn.LeakyReLU()
else:
self.act = nn.ReLU()
if batchnorm:
main = nn.Sequential(
nn.Conv2d(input, output, 4, stride=2, padding=1),
nn.BatchNorm2d(output),
self.act,
)
main2 = nn.Sequential(
nn.Conv2d(input, output, 4, stride=2, padding=1),
nn.BatchNorm2d(output),
self.act,
)
else:
main = nn.Sequential(
nn.Conv2d(input, output, 4, stride=2, padding=1),
self.act,
)
main2 = nn.Sequential(
nn.Conv2d(input, output, 4, stride=2, padding=1),
self.act,
)
self.main = main
self.main2 = main2
self.fc1 = nn.Linear(output * out_img_dims[0] * out_img_dims[1], zdim)
self.fc2 = nn.Linear(output * out_img_dims[0] * out_img_dims[1], zdim)
self.out_img_dims = out_img_dims
# print ("Not implemented now...")
return
def forward(self, x):
h = self.main(x)
h2 = self.main2(x)
return h, self.fc1(h2.view(h2.size(0), -1)), self.fc2(h2.view(h2.size(0), -1))
class CNNDecodeLayer(nn.Module):
def __init__(self, input, output, zdim, batchnorm, activacation, input_img_dims):
super(CNNDecodeLayer, self).__init__()
if activacation == "lrelu":
self.act = nn.LeakyReLU()
else:
self.act = nn.ReLU()
if input == 0:
input = output
self.fc = nn.Linear(zdim, input * input_img_dims[0] * input_img_dims[0])
else:
self.fc = nn.Linear(zdim, input * input_img_dims[0] * input_img_dims[0])
input *= 2
if batchnorm:
main = nn.Sequential(
nn.ConvTranspose2d(input, output, 4, stride=2, padding=1),
nn.BatchNorm2d(output),
self.act,
)
else:
main = nn.Sequential(
nn.ConvTranspose2d(input, output, 4, stride=2, padding=1),
self.act,
)
self.main = main
self.input_img_dims = input_img_dims
def forward(self, input, z):
if input is None:
input = self.act(self.fc(z).view(z.size(0), -1, self.input_img_dims[0], self.input_img_dims[1]))
else:
input = torch.cat([input, self.fc(z).view(z.size(0), -1, self.input_img_dims[0], self.input_img_dims[1])], 1)
return self.main(input)
class EncodeLayer(nn.Module):
def __init__(self, input, output, zdim, batchnorm, activacation):
super(EncodeLayer, self).__init__()
if activacation == "lrelu":
self.act = nn.LeakyReLU()
else:
self.act = nn.ReLU()
if batchnorm:
main = nn.Sequential(
nn.Linear(input, output),
nn.BatchNorm1d(output),
self.act,
)
else:
main = nn.Sequential(
nn.Linear(input, output),
self.act,
)
self.main = main
self.fc1 = nn.Linear(output, zdim)
self.fc2 = nn.Linear(output, zdim)
def forward(self, x):
h = self.main(x)
return self.main(x),self.fc1(h), self.fc2(h)
class DecodeLayer(nn.Module):
def __init__(self, input, output, zdim, batchnorm, activacation):
super(DecodeLayer, self).__init__()
if activacation == "lrelu":
self.act = nn.LeakyReLU()
else:
self.act = nn.ReLU()
if input == 0:
input = output
self.fc = nn.Linear(zdim, input)
else:
self.fc = nn.Linear(zdim, input)
input *= 2
if batchnorm:
main = nn.Sequential(
nn.Linear(input, output),
nn.BatchNorm1d(output),
self.act,
)
else:
main = nn.Sequential(
nn.Linear(input, output),
self.act,
)
self.main = main
def forward(self, input, z):
if input is None:
input = self.act(self.fc(z))
else:
input = torch.cat([input, self.act(self.fc(z))], 1)
return self.main(input)
class VLAE(VAE):
def __init__(self, input_dims, code_dims, beta=1.0,
hidden=400, activacation="lrelu",
decoder="Bernoulli", batchnorm=False):
super(VLAE, self).__init__(input_dims, code_dims)
self.name = "VLAE"
self.nx = int(np.prod(input_dims))
self.nz = int(np.prod(code_dims))
self.beta = beta
if activacation == "lrelu":
self.act = nn.LeakyReLU()
else:
self.act = nn.ReLU()
if decoder == "Bernoulli":
self.reconstruct_loss = StableBCELoss()
else:
self.reconstruct_loss = nn.MSELoss()
self.encode_layers = nn.ModuleList([EncodeLayer(self.nx, hidden, code_dims[1], batchnorm, activacation)])
self.decode_layers = nn.ModuleList([])
for i in range(code_dims[0]-1):
el = EncodeLayer(hidden, hidden, code_dims[1], batchnorm, activacation)
dl = DecodeLayer(hidden, hidden, code_dims[1], batchnorm, activacation)
self.encode_layers.append(el)
self.decode_layers.append(dl)
self.fc1 = nn.Linear(code_dims[1], hidden)
self.fc2 = nn.Linear(hidden, self.nx)
def encode(self, x):
h = x.view(x.size(0), -1)
mu_list = []
logvar_list = []
for fc in self.encode_layers:
h, mu, logvar = fc(h)
mu_list.append(mu)
logvar_list.append(logvar)
return torch.cat(mu_list, dim=1), torch.cat(logvar_list, dim=1)
def reparametrize(self, mu, logvar):
std = logvar.mul(0.5).exp_()
if isinstance(mu, torch.cuda.FloatTensor):
eps = torch.cuda.FloatTensor(std.size()).normal_()
else:
eps = torch.FloatTensor(std.size()).normal_()
# eps[:,-2:-1] = (eps[:,-2:-1] - mu.data[:,-2:-1]) / std.data[:,-2:-1]
eps = Variable(eps)
return eps.mul(std).add_(mu)
def decode(self, z):
zcode = list(torch.chunk(z, self.code_dims[0], dim=1))[::-1]
h = self.act(self.fc1(zcode[0]))
for z, fc in zip(zcode[1:], self.decode_layers):
h = fc(h, z)
return self.fc2(h)
def forward(self, x):
mu, logvar = self.encode(x.view(x.size(0), -1))
z = self.reparametrize(mu, logvar)
return self.decode(z), mu, logvar, z
def loss(self, recon_x, x, mu, logvar, z):
x = x.view(x.size(0), -1)
BCE = self.reconstruct_loss(recon_x, x) / x.size(0)
# see Appendix B from VAE paper:
# Kingma and Welling. Auto-Encoding Variational Bayes. ICLR, 2014
# https://arxiv.org/abs/1312.6114
# 0.5 * sum(1 + log(sigma^2) - mu^2 - sigma^2)
KLD_element = mu.pow(2).add_(logvar.exp()).mul_(-1).add_(1).add_(logvar)
KLD = torch.sum(KLD_element).mul_(-0.5) / x.size(0)
return BCE + self.beta * KLD, BCE, KLD
def mutual_info_q(self, x):
mu, logvar = self.encode(x.view(x.size(0), -1))
z = self.reparametrize(mu, logvar)
l = z.size(0)
z = z.repeat(l, 1, 1)
mu = mu.unsqueeze(2).repeat(1,1,l).transpose(1,2)
logvar = logvar.unsqueeze(2).repeat(1,1,l).transpose(1,2)
p_matrix = ( - torch.sum((z - mu) ** 2 / logvar.exp(), dim=2) / 2.0 - 0.5 * torch.sum(logvar, dim=2)).exp_()
p_split_matrix = (- (z - mu) ** 2 / logvar.exp() / 2.0 - 0.5 * logvar ).exp_()
p_split_vector = torch.sum(p_split_matrix, dim=1)
p_vector = torch.sum(p_matrix, dim=1)
I = torch.FloatTensor([np.log(l)])
I_split = torch.FloatTensor([np.log(l)] * int(z.size(2)))
for i in range(l):
I += (p_matrix[i][i].log() - p_vector[i].log()).data / l
I_split += (p_split_matrix[i][i].log() - p_split_vector[i].log()).data / l
# q(z_i) is not independent..
# assert np.allclose(I.numpy(), np.sum(I_split.numpy()))
return I, I_split
class MMDVLAE(VLAE):
def compute_kernel(self, x, y):
x_size = x.size(0)
y_size = y.size(0)
dim = x.size(1)
tiled_x = x.unsqueeze(1).repeat(1, y_size, 1)
tiled_y = y.unsqueeze(0).repeat(x_size, 1, 1)
return ((-(tiled_x - tiled_y) ** 2).mean(dim=2) / float(dim)).exp_()
def compute_mmd(self, x, y, sigma_sqr=1.0):
x_kernel = self.compute_kernel(x, x)
y_kernel = self.compute_kernel(y, y)
xy_kernel = self.compute_kernel(x, y)
return torch.mean(x_kernel) + torch.mean(y_kernel) - 2 * torch.mean(xy_kernel)
def loss(self, recon_x, x, mu, logvar, z):
x = x.view(x.size(0), -1)
BCE = self.reconstruct_loss(recon_x, x) / (x.size(0) * x.size(1))
true_samples = Variable(torch.FloatTensor(x.size(0), self.nz).normal_())
MMD = self.compute_mmd(true_samples, z)
return BCE + self.beta * MMD , BCE, MMD
class CNNVLAE(VAE):
def __init__(self, input_dims, code_dims, beta=1.0,
hidden=400, activacation="lrelu",
decoder="Bernoulli", batchnorm=True):
super(CNNVLAE, self).__init__(input_dims, code_dims)
self.name = "CNNVLAE"
self.nx = input_dims[0]
self.nz = int(np.prod(code_dims))
self.beta = beta
if activacation == "lrelu":
self.act = nn.LeakyReLU()
else:
self.act = nn.ReLU()
if decoder == "Bernoulli":
self.reconstruct_loss = StableBCELoss()
else:
self.reconstruct_loss = nn.MSELoss()
assert(input_dims[1] == input_dims[2])
l = input_dims[1]
l = int(l/2)
self.encode_layers = [CNNEncodeLayer(self.nx, hidden, code_dims[1], batchnorm, activacation, (l, l))]
self.decode_layers = [CNNDecodeLayer(hidden*2, hidden, code_dims[1], batchnorm, activacation, (l, l))]
self.conv2 = nn.ConvTranspose2d(hidden, 1, 1, 1)
for i in range(code_dims[0]-2):
l = int(l/2)
el = CNNEncodeLayer(hidden, hidden * 2, code_dims[1], batchnorm, activacation, (l, l))
hidden *= 2
dl = CNNDecodeLayer(hidden * 2, hidden, code_dims[1], batchnorm, activacation, (l, l))
self.encode_layers.append(el)
self.decode_layers.insert(0, dl)
self.encode_layers = nn.ModuleList(self.encode_layers)
self.decode_layers = nn.ModuleList(self.decode_layers)
l = int(l/2)
self.encode_layers.append(CNNEncodeLayer(hidden, hidden*2, code_dims[1], batchnorm, activacation, (l, l)))
hidden *= 2
self.conv1 = CNNDecodeLayer(0, hidden, code_dims[1], batchnorm, activacation, (l, l))
def encode(self, x):
h = x
mu_list = []
logvar_list = []
for conv in self.encode_layers:
h, mu, logvar = conv(h)
mu_list.append(mu)
logvar_list.append(logvar)
return torch.cat(mu_list, dim=1), torch.cat(logvar_list, dim=1)
def reparametrize(self, mu, logvar):
std = logvar.mul(0.5).exp_()
if isinstance(mu, torch.cuda.FloatTensor):
eps = torch.cuda.FloatTensor(std.size()).normal_()
else:
eps = torch.FloatTensor(std.size()).normal_()
# eps[:,-2:-1] = (eps[:,-2:-1] - mu.data[:,-2:-1]) / std.data[:,-2:-1]
eps = Variable(eps)
return eps.mul(std).add_(mu)
def decode(self, z):
zcode = list(torch.chunk(z, self.code_dims[0], dim=1))[::-1]
h = self.act(self.conv1(None, zcode[0]))
for z, conv in zip(zcode[1:], self.decode_layers):
h = conv(h, z)
return self.conv2(h)
def forward(self, x):
mu, logvar = self.encode(x)
z = self.reparametrize(mu, logvar)
return self.decode(z), mu, logvar, z
def loss(self, recon_x, x, mu, logvar, z):
x = x.view(x.size(0), -1)
recon_x = recon_x.view(recon_x.size(0), -1)
BCE = self.reconstruct_loss(recon_x, x) / x.size(0)
# see Appendix B from VAE paper:
# Kingma and Welling. Auto-Encoding Variational Bayes. ICLR, 2014
# https://arxiv.org/abs/1312.6114
# 0.5 * sum(1 + log(sigma^2) - mu^2 - sigma^2)
KLD_element = mu.pow(2).add_(logvar.exp()).mul_(-1).add_(1).add_(logvar)
KLD = torch.sum(KLD_element).mul_(-0.5) / x.size(0)
return BCE + self.beta * KLD, BCE, KLD
def mutual_info_q(self, x):
mu, logvar = self.encode(x)
z = self.reparametrize(mu, logvar)
z = z.view(z.size(0), -1)
mu = mu.view(mu.size(0), -1)
logvar = logvar.view(logvar.size(0), -1)
l = z.size(0)
z = z.repeat(l, 1, 1)
mu = mu.unsqueeze(2).repeat(1,1,l).transpose(1,2)
logvar = logvar.unsqueeze(2).repeat(1,1,l).transpose(1,2)
p_matrix = ( - torch.sum((z - mu) ** 2 / logvar.exp(), dim=2) / 2.0 - 0.5 * torch.sum(logvar, dim=2)).exp_()
p_split_matrix = (- (z - mu) ** 2 / logvar.exp() / 2.0 - 0.5 * logvar ).exp_()
p_split_vector = torch.sum(p_split_matrix, dim=1)
p_vector = torch.sum(p_matrix, dim=1)
I = torch.FloatTensor([np.log(l)])
I_split = torch.FloatTensor([np.log(l)] * int(z.size(2)))
for i in range(l):
I += (p_matrix[i][i].log() - p_vector[i].log()).data / l
I_split += (p_split_matrix[i][i].log() - p_split_vector[i].log()).data / l
# q(z_i) is not independent..
# assert np.allclose(I.numpy(), np.sum(I_split.numpy()))
return I, I_split
| 38.91689
| 121
| 0.549325
| 1,996
| 14,516
| 3.862725
| 0.090681
| 0.024514
| 0.010895
| 0.021012
| 0.803502
| 0.775227
| 0.746304
| 0.716991
| 0.666667
| 0.661219
| 0
| 0.029905
| 0.302012
| 14,516
| 372
| 122
| 39.021505
| 0.73105
| 0.047809
| 0
| 0.645963
| 0
| 0
| 0.006302
| 0
| 0
| 0
| 0
| 0
| 0.003106
| 1
| 0.083851
| false
| 0
| 0.018634
| 0
| 0.192547
| 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
|
a111b0e7cb321d1e71b0347115b8faab60668130
| 185
|
py
|
Python
|
bin/twigs/polytwigs-12345-butterfly-8x2-3.py
|
tiwo/puzzler
|
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
|
[
"Intel"
] | null | null | null |
bin/twigs/polytwigs-12345-butterfly-8x2-3.py
|
tiwo/puzzler
|
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
|
[
"Intel"
] | null | null | null |
bin/twigs/polytwigs-12345-butterfly-8x2-3.py
|
tiwo/puzzler
|
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
|
[
"Intel"
] | 1
|
2022-01-02T16:54:14.000Z
|
2022-01-02T16:54:14.000Z
|
#!/usr/bin/env python
# $Id$
"""
many solutions.
"""
import puzzler
from puzzler.puzzles.polytwigs12345 import Polytwigs12345Butterfly8x2_3
puzzler.run(Polytwigs12345Butterfly8x2_3)
| 15.416667
| 71
| 0.794595
| 20
| 185
| 7.25
| 0.75
| 0.372414
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125749
| 0.097297
| 185
| 11
| 72
| 16.818182
| 0.742515
| 0.221622
| 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
| 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
|
a13061975cf47ec32848dfc9dc3b2ad41ad022d0
| 2,770
|
py
|
Python
|
example/compat.py
|
sephiartlist/dynaconf
|
9c5f60b289c1f0fa3f899f1962a8fe5712c74eab
|
[
"MIT"
] | 1
|
2020-10-27T21:30:31.000Z
|
2020-10-27T21:30:31.000Z
|
example/compat.py
|
sephiartlist/dynaconf
|
9c5f60b289c1f0fa3f899f1962a8fe5712c74eab
|
[
"MIT"
] | 50
|
2021-07-26T08:20:07.000Z
|
2022-03-31T08:22:42.000Z
|
example/compat.py
|
sephiartlist/dynaconf
|
9c5f60b289c1f0fa3f899f1962a8fe5712c74eab
|
[
"MIT"
] | null | null | null |
from dynaconf import LazySettings
from dynaconf.utils import RENAMED_VARS
# 0 given a bare settings
settings = LazySettings(environments=True)
# 1 Ensure all renamed vars exists in object
for old, new in RENAMED_VARS.items():
assert old in settings
assert new in settings
# 2 Ensure pairs has the same value
for old, new in RENAMED_VARS.items():
assert settings.get(old) == settings.get(new)
assert getattr(settings, new) == getattr(settings, old)
# 0 given a full old-style configured setting
settings = LazySettings(
environments=True,
DYNACONF_NAMESPACE="FOO",
DYNACONF_SETTINGS_MODULE="/tmp/foo.toml",
PROJECT_ROOT="/tmp/",
DYNACONF_SILENT_ERRORS=False,
DYNACONF_ALWAYS_FRESH_VARS=["baz", "zaz", "caz"],
BASE_NAMESPACE_FOR_DYNACONF="original",
GLOBAL_ENV_FOR_DYNACONF="RAZAMANAZ",
)
# 1 Ensure all renamed vars exists in object
for old, new in RENAMED_VARS.items():
assert old in settings, old
assert new in settings, new
# 2 Ensure pairs has the same value
for old, new in RENAMED_VARS.items():
assert settings.get(old) == settings.get(new), (
old,
settings.get(old),
new,
settings.get(new),
)
assert getattr(settings, new) == getattr(settings, old), (
new,
getattr(settings, new),
old,
getattr(settings, old),
)
settings = LazySettings(
environments=True,
DYNACONF_NAMESPACE="FOO",
DYNACONF_SETTINGS_MODULE="foo.py",
PROJECT_ROOT="/tmp",
DYNACONF_SILENT_ERRORS=True,
DYNACONF_ALWAYS_FRESH_VARS=["BAR"],
GLOBAL_ENV_FOR_DYNACONF="BLARG",
)
assert settings.ENV_FOR_DYNACONF == "FOO"
assert settings.SETTINGS_FILE_FOR_DYNACONF == "foo.py"
assert settings.ROOT_PATH_FOR_DYNACONF == "/tmp"
assert settings.SILENT_ERRORS_FOR_DYNACONF is True
assert settings.FRESH_VARS_FOR_DYNACONF == ["BAR"]
assert settings.ENVVAR_PREFIX_FOR_DYNACONF == "BLARG"
print(settings.ENV_FOR_DYNACONF)
print(settings.SETTINGS_FILE_FOR_DYNACONF)
print(settings.ROOT_PATH_FOR_DYNACONF)
print(settings.SILENT_ERRORS_FOR_DYNACONF)
print(settings.FRESH_VARS_FOR_DYNACONF)
settings = LazySettings(
environments=True,
NAMESPACE="FOO",
SETTINGS_MODULE="foo.py",
PROJECT_ROOT="/tmp",
DYNACONF_SILENT_ERRORS=True,
DYNACONF_ALWAYS_FRESH_VARS=["BAR"],
)
assert settings.ENV_FOR_DYNACONF == "FOO"
assert settings.SETTINGS_FILE_FOR_DYNACONF == "foo.py"
assert settings.ROOT_PATH_FOR_DYNACONF == "/tmp"
assert settings.SILENT_ERRORS_FOR_DYNACONF is True
assert settings.FRESH_VARS_FOR_DYNACONF == ["BAR"]
print(settings.ENV_FOR_DYNACONF)
print(settings.SETTINGS_FILE_FOR_DYNACONF)
print(settings.ROOT_PATH_FOR_DYNACONF)
print(settings.SILENT_ERRORS_FOR_DYNACONF)
print(settings.FRESH_VARS_FOR_DYNACONF)
| 28.556701
| 62
| 0.745848
| 372
| 2,770
| 5.290323
| 0.177419
| 0.134146
| 0.065041
| 0.097561
| 0.754065
| 0.754065
| 0.736789
| 0.736789
| 0.736789
| 0.736789
| 0
| 0.002559
| 0.15343
| 2,770
| 96
| 63
| 28.854167
| 0.836674
| 0.079783
| 0
| 0.575342
| 0
| 0
| 0.0476
| 0
| 0
| 0
| 0
| 0
| 0.260274
| 1
| 0
| false
| 0
| 0.027397
| 0
| 0.027397
| 0.136986
| 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
|
a16b78d7e0085a0c47da2df931c404c602e12e4d
| 181
|
py
|
Python
|
securityheaders/checkers/cors/maxage/__init__.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 151
|
2018-07-29T22:34:43.000Z
|
2022-03-22T05:08:27.000Z
|
securityheaders/checkers/cors/maxage/__init__.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 5
|
2019-04-24T07:31:36.000Z
|
2021-04-15T14:31:23.000Z
|
securityheaders/checkers/cors/maxage/__init__.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 42
|
2018-07-31T08:18:59.000Z
|
2022-03-28T08:18:32.000Z
|
from .checker import AccessControlMaxAgeChecker
from .toolong import AccessControlMaxAgeTooLongChecker
__all__ = ['AccessControlMaxAgeChecker','AccessControlMaxAgeTooLongChecker']
| 36.2
| 76
| 0.878453
| 11
| 181
| 14.090909
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066298
| 181
| 4
| 77
| 45.25
| 0.91716
| 0
| 0
| 0
| 0
| 0
| 0.325967
| 0.325967
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a1789edd8716845b448e4257f042808ca4432f4b
| 55
|
py
|
Python
|
py2app_tests/app_with_scripts/helper1.py
|
flupke/py2app
|
8eb6c618f9c63d6ac970fb145a7f7782b71bcb4d
|
[
"MIT"
] | 193
|
2020-01-15T09:34:20.000Z
|
2022-03-18T19:14:16.000Z
|
py2app_tests/app_with_scripts/helper1.py
|
flupke/py2app
|
8eb6c618f9c63d6ac970fb145a7f7782b71bcb4d
|
[
"MIT"
] | 185
|
2020-01-15T08:38:27.000Z
|
2022-03-27T17:29:29.000Z
|
py2app_tests/app_with_scripts/helper1.py
|
flupke/py2app
|
8eb6c618f9c63d6ac970fb145a7f7782b71bcb4d
|
[
"MIT"
] | 23
|
2020-01-24T14:47:18.000Z
|
2022-02-22T17:19:47.000Z
|
import curses
print("Helper 1: %s"%(curses.__name__,))
| 18.333333
| 40
| 0.709091
| 8
| 55
| 4.375
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.090909
| 55
| 2
| 41
| 27.5
| 0.68
| 0
| 0
| 0
| 0
| 0
| 0.218182
| 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
|
a181f2c79e0680a8daab8d31b2083f94152674a4
| 106
|
py
|
Python
|
build/lib/Factor_analysis_pkg/__init__.py
|
kdk411/Factor_analysis
|
09f85bb77c83bced0dd344c990d85135c9780e8a
|
[
"MIT"
] | null | null | null |
build/lib/Factor_analysis_pkg/__init__.py
|
kdk411/Factor_analysis
|
09f85bb77c83bced0dd344c990d85135c9780e8a
|
[
"MIT"
] | null | null | null |
build/lib/Factor_analysis_pkg/__init__.py
|
kdk411/Factor_analysis
|
09f85bb77c83bced0dd344c990d85135c9780e8a
|
[
"MIT"
] | null | null | null |
name = "Factor_analysis_pkg"
from .EM_Factor_analysis import factor_analysis
from .example import run_demo
| 35.333333
| 47
| 0.858491
| 16
| 106
| 5.3125
| 0.625
| 0.494118
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09434
| 106
| 3
| 48
| 35.333333
| 0.885417
| 0
| 0
| 0
| 0
| 0
| 0.17757
| 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
|
a18a224069313bf27582f6ad30c1d63f8ad1d5b9
| 187
|
py
|
Python
|
dynamically_import.py
|
iandmyhand/python-tester
|
b4fa2bd2706f3fb516388c9866e86fb7a1a9dfa4
|
[
"MIT"
] | 1
|
2015-03-30T08:35:57.000Z
|
2015-03-30T08:35:57.000Z
|
dynamically_import.py
|
iandmyhand/python-tester
|
b4fa2bd2706f3fb516388c9866e86fb7a1a9dfa4
|
[
"MIT"
] | null | null | null |
dynamically_import.py
|
iandmyhand/python-tester
|
b4fa2bd2706f3fb516388c9866e86fb7a1a9dfa4
|
[
"MIT"
] | null | null | null |
def dynamically_import():
mod = __import__('my_package.my_module', fromlist=['my_class'])
klass = getattr(mod, 'my_class')
if '__main__' == __name__:
dynamically_import()
| 18.7
| 67
| 0.684492
| 22
| 187
| 5
| 0.636364
| 0.309091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.165775
| 187
| 9
| 68
| 20.777778
| 0.705128
| 0
| 0
| 0
| 0
| 0
| 0.237838
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.6
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a1b2ca8b0ee8536443694373b5e597f201db7c93
| 184
|
py
|
Python
|
py3plex/algorithms/hedwig/stats/__init__.py
|
SkBlaz/supertest
|
5d99034af820cc10c8f70271b55cc90c42328709
|
[
"BSD-3-Clause"
] | 79
|
2018-10-22T14:54:04.000Z
|
2020-03-05T05:34:35.000Z
|
py3plex/algorithms/hedwig/stats/__init__.py
|
SkBlaz/supertest
|
5d99034af820cc10c8f70271b55cc90c42328709
|
[
"BSD-3-Clause"
] | 6
|
2019-02-19T16:33:14.000Z
|
2019-12-16T10:23:25.000Z
|
py3plex/algorithms/hedwig/stats/__init__.py
|
SkBlaz/Py3Plex
|
5d99034af820cc10c8f70271b55cc90c42328709
|
[
"BSD-3-Clause"
] | 16
|
2019-02-19T16:30:29.000Z
|
2020-02-13T05:57:16.000Z
|
from . import scorefunctions
from . import adjustment
from . import significance
from .validate import Validate
__all__ = ["scorefunctions", "adjustment", "significance", "Validate"]
| 26.285714
| 70
| 0.777174
| 18
| 184
| 7.722222
| 0.388889
| 0.215827
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 184
| 6
| 71
| 30.666667
| 0.863354
| 0
| 0
| 0
| 0
| 0
| 0.23913
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.8
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a1b371cbc484fc1b84f45a9bb95f96a177047d7c
| 190
|
py
|
Python
|
transcriptions/admin.py
|
productivity-in-tech/pit_transcriptor_django
|
8e6962c557a258d9e54e21569d7dfe9f79e6bfd6
|
[
"MIT"
] | 3
|
2019-12-28T15:17:31.000Z
|
2020-03-27T01:30:32.000Z
|
transcriptions/admin.py
|
productivity-in-tech/pit_transcriptor_django
|
8e6962c557a258d9e54e21569d7dfe9f79e6bfd6
|
[
"MIT"
] | 11
|
2020-03-24T18:11:10.000Z
|
2021-09-22T18:21:07.000Z
|
transcriptions/admin.py
|
productivity-in-tech/pit_transcriptor_django
|
8e6962c557a258d9e54e21569d7dfe9f79e6bfd6
|
[
"MIT"
] | 1
|
2019-12-28T15:20:23.000Z
|
2019-12-28T15:20:23.000Z
|
from django.contrib import admin
from .models import Transcription, TranscriptionEdit
# Register your models here.
admin.site.register(Transcription)
admin.site.register(TranscriptionEdit)
| 27.142857
| 52
| 0.842105
| 22
| 190
| 7.272727
| 0.545455
| 0.1125
| 0.2125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089474
| 190
| 6
| 53
| 31.666667
| 0.924855
| 0.136842
| 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
|
a1febb45905db7ff659d35b9f24078a4b3f87def
| 17
|
py
|
Python
|
pygcam/version.py
|
JGCRI/pygcam
|
e33042e7c9f33dfe471dc48e02965ecfb523bd83
|
[
"MIT"
] | 18
|
2017-06-15T01:28:46.000Z
|
2022-03-30T03:13:35.000Z
|
pygcam/version.py
|
JGCRI/pygcam
|
e33042e7c9f33dfe471dc48e02965ecfb523bd83
|
[
"MIT"
] | 8
|
2020-04-03T19:38:14.000Z
|
2022-03-03T17:12:17.000Z
|
pygcam/version.py
|
JGCRI/pygcam
|
e33042e7c9f33dfe471dc48e02965ecfb523bd83
|
[
"MIT"
] | 10
|
2017-08-13T17:24:03.000Z
|
2022-03-06T13:39:25.000Z
|
VERSION="1.10.2"
| 8.5
| 16
| 0.647059
| 4
| 17
| 2.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 0.058824
| 17
| 1
| 17
| 17
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0.352941
| 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
|
b81a856329f5cc33ef14fc6b75260c4e1da95973
| 183
|
py
|
Python
|
nagl/utilities/__init__.py
|
SimonBoothroyd/nagl
|
3aacb69547baae822538a1728e1102513c79561f
|
[
"MIT"
] | 4
|
2020-12-03T13:27:31.000Z
|
2022-03-07T14:17:06.000Z
|
nagl/utilities/__init__.py
|
SimonBoothroyd/nagl
|
3aacb69547baae822538a1728e1102513c79561f
|
[
"MIT"
] | 37
|
2020-12-29T15:27:47.000Z
|
2022-03-30T13:52:09.000Z
|
nagl/utilities/__init__.py
|
SimonBoothroyd/nagl
|
3aacb69547baae822538a1728e1102513c79561f
|
[
"MIT"
] | 1
|
2020-12-05T11:35:48.000Z
|
2020-12-05T11:35:48.000Z
|
from nagl.utilities.utilities import (
MissingOptionalDependency,
requires_package,
temporary_cd,
)
__all__ = [MissingOptionalDependency, requires_package, temporary_cd]
| 22.875
| 69
| 0.79235
| 16
| 183
| 8.5625
| 0.625
| 0.481752
| 0.583942
| 0.715328
| 0.744526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142077
| 183
| 7
| 70
| 26.142857
| 0.872611
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
62bf2d3e9e17825177b21ee63f06094a36439f67
| 119
|
py
|
Python
|
moleculex.py
|
sunhwan/MoleculeX
|
d718870a6f64fd7d6b110e3d6792e9d92c224da8
|
[
"MIT"
] | null | null | null |
moleculex.py
|
sunhwan/MoleculeX
|
d718870a6f64fd7d6b110e3d6792e9d92c224da8
|
[
"MIT"
] | null | null | null |
moleculex.py
|
sunhwan/MoleculeX
|
d718870a6f64fd7d6b110e3d6792e9d92c224da8
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
import sys
import moleculex.cli
if __name__ == '__main__':
moleculex.cli.run(sys.argv[1:])
| 14.875
| 35
| 0.697479
| 18
| 119
| 4.166667
| 0.777778
| 0.32
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009804
| 0.142857
| 119
| 7
| 36
| 17
| 0.72549
| 0.168067
| 0
| 0
| 0
| 0
| 0.081633
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
|
62c1cde6a1154bcc0908e21442b7ee6735123736
| 115
|
py
|
Python
|
html/canvas/tools/gentest_union.py
|
qanat/wpt
|
7c61a4594a95682531367b6956d1c37f8b8fd486
|
[
"BSD-3-Clause"
] | 14,668
|
2015-01-01T01:57:10.000Z
|
2022-03-31T23:33:32.000Z
|
html/canvas/tools/gentest_union.py
|
qanat/wpt
|
7c61a4594a95682531367b6956d1c37f8b8fd486
|
[
"BSD-3-Clause"
] | 7,642
|
2018-05-28T09:38:03.000Z
|
2022-03-31T20:55:48.000Z
|
html/canvas/tools/gentest_union.py
|
qanat/wpt
|
7c61a4594a95682531367b6956d1c37f8b8fd486
|
[
"BSD-3-Clause"
] | 5,941
|
2015-01-02T11:32:21.000Z
|
2022-03-31T16:35:46.000Z
|
from gentestutilsunion import genTestUtils_union
genTestUtils_union('templates-new.yaml', 'name2dir-canvas.yaml')
| 28.75
| 64
| 0.843478
| 13
| 115
| 7.307692
| 0.769231
| 0.357895
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009259
| 0.06087
| 115
| 3
| 65
| 38.333333
| 0.87037
| 0
| 0
| 0
| 0
| 0
| 0.330435
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
|
62c42ceb04c703f2ba1db0dd078669c603e171bd
| 10,872
|
py
|
Python
|
codebase/controller/ofa.py
|
qdmy/Adelaidet-Quantization
|
e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b
|
[
"Apache-2.0"
] | null | null | null |
codebase/controller/ofa.py
|
qdmy/Adelaidet-Quantization
|
e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b
|
[
"Apache-2.0"
] | null | null | null |
codebase/controller/ofa.py
|
qdmy/Adelaidet-Quantization
|
e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b
|
[
"Apache-2.0"
] | null | null | null |
import math
import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
from .base import BaseController
from .gnn import EdgeGraphSAGE, NoEdgeGraph
from codebase.core.arch_representation.ofa import N_LAYERS_PER_UNIT, N_AVAILABLE_RESOLUTIONS
from codebase.core.dynamic_graph import DynamicGraph
from codebase.torchutils.common import auto_device
from codebase.torchutils import logger
class OFAModificationController(BaseController):
def __init__(self, K=10, n_steps=2, gnn_layers=2, in_features=201, has_resolution=False,
n_layers=20, n_operations=10, hidden_size=64,
temperature=None, tanh_constant=1.5, op_tanh_reduce=2.5,
batch_size=1, device=auto_device, no_edge=False):
super(OFAModificationController, self).__init__(hidden_size, device)
self.K = K
self.n_steps = n_steps
self.has_resolution = has_resolution
self.n_layers = n_layers
self.n_operations = n_operations
self.hidden_size = hidden_size
self.temperature = temperature
self.tanh_constant = tanh_constant
self.op_tanh_reduce = op_tanh_reduce
self.no_edge = no_edge
self.batch_size = batch_size
self.device = device
self.gnn = EdgeGraphSAGE(gnn_layers, in_features, hidden_size, hidden_size)
self.node_decision = nn.Linear(self.hidden_size, K)
self.layer_decision = nn.Linear(self.hidden_size, n_layers)
self.op_decision = nn.Linear(self.hidden_size, n_operations)
self.emb_attn = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
self.hid_attn = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
self.v_attn = nn.Linear(self.hidden_size, 1, bias=False)
self.node_embedding = nn.Embedding(K, self.hidden_size)
self.layer_embedding = nn.Embedding(n_layers, self.hidden_size)
self.op_embedding = nn.Embedding(n_operations, self.hidden_size)
if self.has_resolution:
self.resolution_decision = nn.Linear(self.hidden_size, N_AVAILABLE_RESOLUTIONS)
self.resolution_embedding = nn.Embedding(n_operations, self.hidden_size)
self.lstm = nn.LSTMCell(self.hidden_size, self.hidden_size)
self.reset_parameters()
def forward(self, graph: DynamicGraph, force_uniform=False):
node_features = graph.node_features.to(device=self.device)
edge_features = graph.edge_features.to(device=self.device)
if self.no_edge:
# print("no_edge")
with torch.no_grad():
edge_features=edge_features.detach()
edge_features.requires_grad=False
edge_features.zero_()
graph_features, _ = self.gnn(node_features, edge_features, graph.edge_index)
hidden = self._zeros(self.batch_size), self._zeros(self.batch_size)
edit_seq = []
logp_buf = []
entropy_buf = []
max_entropy = 0
# decide which node is most potential
embed = graph_features.mean(dim=0, keepdim=True)
if force_uniform:
logits = torch.zeros(self.K, device=self.device)
else:
hx, cx = self.lstm(embed, hidden)
hidden = (hx, cx)
query = torch.tanh(self.emb_attn(graph_features) + self.hid_attn(hx))
logits = self.v_attn(query).view(-1) # (n_nodes,)
logits = self._scale_attention(logits, self.temperature, self.tanh_constant)
probs = F.softmax(logits, dim=-1)
# logger.debug(f"Most Potential Node: {probs.tolist()}")
action, select_log_p, entropy = self._impl(probs)
max_entropy += math.log(probs.shape[0])
edit_seq.append(action.item())
logp_buf.append(select_log_p)
entropy_buf.append(entropy)
embed = self.node_embedding(action)
for step in range(self.n_steps):
# which layer
if force_uniform:
logits = torch.zeros(self.n_layers, device=self.device)
else:
hx, cx = self.lstm(embed, hidden)
hidden = (hx, cx)
logits = self.layer_decision(hx).view(-1)
logits = self._scale_attention(logits, self.temperature, self.tanh_constant, self.op_tanh_reduce)
probs = F.softmax(logits, dim=-1)
# logger.debug(f"Wchih Layer: {probs.tolist()}")
action, select_log_p, entropy = self._impl(probs)
max_entropy += math.log(probs.shape[0])
layer_index = action.item()
logp_buf.append(select_log_p)
entropy_buf.append(entropy)
embed = self.layer_embedding(action)
if self.has_resolution and layer_index == 0:
if force_uniform:
logits = torch.zeros(N_AVAILABLE_RESOLUTIONS, device=self.device)
else:
hx, cx = self.lstm(embed, hidden)
hidden = (hx, cx)
logits = self.resolution_decision(hx).view(-1)
logits = self._scale_attention(logits, self.temperature, self.tanh_constant, self.op_tanh_reduce)
probs = F.softmax(logits, dim=-1)
action, select_log_p, entropy = self._impl(probs)
max_entropy += math.log(probs.shape[0])
op_index = action.item()
logp_buf.append(select_log_p)
entropy_buf.append(entropy)
embed = self.resolution_embedding(action)
else:
if force_uniform:
logits = torch.zeros(self.n_operations, device=self.device)
else:
hx, cx = self.lstm(embed, hidden)
hidden = (hx, cx)
logits = self.op_decision(hx).view(-1)
logits = self._scale_attention(logits, self.temperature, self.tanh_constant, self.op_tanh_reduce)
is_front_split_line = 3 if self.has_resolution else 2
if layer_index % N_LAYERS_PER_UNIT < is_front_split_line:
# here, the layer cannot be deleted, so we ignore the first decision (0,0)
logits = logits[1:]
probs = F.softmax(logits, dim=-1)
# logger.debug(f"Wchih Operation: {probs.tolist()}")
action, select_log_p, entropy = self._impl(probs)
max_entropy += math.log(probs.shape[0])
if layer_index % N_LAYERS_PER_UNIT < is_front_split_line:
op_index = action.item() + 1
else:
op_index = action.item()
logp_buf.append(select_log_p)
entropy_buf.append(entropy)
embed = self.op_embedding(action)
edit_seq.append((layer_index, op_index))
return edit_seq, sum(logp_buf), sum(entropy_buf), max_entropy
class OFAController(BaseController):
def __init__(self, n_layers=20, n_operations=10, has_resolution=False, hidden_size=64,
temperature=None, tanh_constant=1.5, op_tanh_reduce=2.5,
batch_size=1, device=auto_device):
super(OFAController, self).__init__(hidden_size, device)
self.n_layers = n_layers
self.n_operations = n_operations
self.has_resolution = has_resolution
self.hidden_size = hidden_size
self.temperature = temperature
self.tanh_constant = tanh_constant
self.op_tanh_reduce = op_tanh_reduce
self.batch_size = batch_size
self.device = device
# self.gnn = EdgeGraphSAGE(gnn_layers, in_features, hidden_size, hidden_size)
# self.node_decision = nn.Linear(self.hidden_size, K)
# self.layer_decision = nn.Linear(self.hidden_size, n_layers)
if self.has_resolution:
self.resolution_decision = nn.Linear(self.hidden_size, N_AVAILABLE_RESOLUTIONS)
self.op_decision = nn.Linear(self.hidden_size, n_operations)
# self.emb_attn = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
# self.hid_attn = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
# self.v_attn = nn.Linear(self.hidden_size, 1, bias=False)
# self.node_embedding = nn.Embedding(K, self.hidden_size)
# self.layer_embedding = nn.Embedding(n_layers, self.hidden_size)
if self.has_resolution:
self.resolution_embedding = nn.Embedding(N_AVAILABLE_RESOLUTIONS, self.hidden_size)
self.op_embedding = nn.Embedding(n_operations, self.hidden_size)
self.lstm = nn.LSTMCell(self.hidden_size, self.hidden_size)
self.reset_parameters()
def forward(self, force_uniform=False):
embed = self._zeros(self.batch_size)
hidden = self._zeros(self.batch_size), self._zeros(self.batch_size)
arch_seq = []
logp_buf = []
entropy_buf = []
max_entropy = 0
if self.has_resolution:
if force_uniform:
logits = torch.zeros(N_AVAILABLE_RESOLUTIONS, device=self.device)
else:
hx, cx = self.lstm(embed, hidden)
hidden = (hx, cx)
logits = self.resolution_decision(hx).view(-1)
logits = self._scale_attention(logits, self.temperature, self.tanh_constant, self.op_tanh_reduce)
probs = F.softmax(logits, dim=-1)
action, select_log_p, entropy = self._impl(probs)
max_entropy += math.log(probs.shape[0])
r = action.item()
logp_buf.append(select_log_p)
entropy_buf.append(entropy)
embed = self.resolution_embedding(action)
arch_seq.append(r)
for layer_index in range(self.n_layers):
if force_uniform:
logits = torch.zeros(self.n_operations, device=self.device)
else:
hx, cx = self.lstm(embed, hidden)
hidden = (hx, cx)
logits = self.op_decision(hx).view(-1)
logits = self._scale_attention(logits, self.temperature, self.tanh_constant, self.op_tanh_reduce)
if layer_index % N_LAYERS_PER_UNIT < 2:
# here, the layer cannot be deleted, so we ignore the first decision (0,0)
logits = logits[1:]
probs = F.softmax(logits, dim=-1)
action, select_log_p, entropy = self._impl(probs)
max_entropy += math.log(probs.shape[0])
op = action.item()
if layer_index % N_LAYERS_PER_UNIT < 2:
op += 1
logp_buf.append(select_log_p)
entropy_buf.append(entropy)
embed = self.op_embedding(action)
arch_seq.append(op)
return arch_seq, sum(logp_buf), sum(entropy_buf), max_entropy
| 42.635294
| 117
| 0.621045
| 1,362
| 10,872
| 4.694567
| 0.112335
| 0.065687
| 0.070066
| 0.039412
| 0.781201
| 0.765561
| 0.736941
| 0.731623
| 0.708008
| 0.686112
| 0
| 0.008352
| 0.284124
| 10,872
| 254
| 118
| 42.80315
| 0.813183
| 0.081586
| 0
| 0.637306
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.020725
| false
| 0
| 0.056995
| 0
| 0.098446
| 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
|
1a194808796fa76974ff6fcc3460321ed1f98646
| 51
|
py
|
Python
|
mabel/adapters/mqtt/__init__.py
|
mabel-dev/mabel
|
ee1fdfcfe5fb87d2c5ce4f24b4b7113478ba1b8a
|
[
"Apache-2.0"
] | null | null | null |
mabel/adapters/mqtt/__init__.py
|
mabel-dev/mabel
|
ee1fdfcfe5fb87d2c5ce4f24b4b7113478ba1b8a
|
[
"Apache-2.0"
] | 287
|
2021-05-14T21:25:26.000Z
|
2022-03-30T12:02:51.000Z
|
mabel/adapters/mqtt/__init__.py
|
gva-jjoyce/mabel
|
eb99e02d0287b851e65ad9a75b5f4188805d4ec9
|
[
"Apache-2.0"
] | 1
|
2021-04-29T18:18:20.000Z
|
2021-04-29T18:18:20.000Z
|
from .mqtt_reader import MqttReader # type:ignore
| 25.5
| 50
| 0.803922
| 7
| 51
| 5.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137255
| 51
| 1
| 51
| 51
| 0.909091
| 0.215686
| 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
|
c51f39019ceb0ed730cbf59495c5e633ccb0420f
| 54,402
|
py
|
Python
|
openmoc/bgq/single/openmoc_bgq_single.py
|
samuelshaner/OpenMOC-shaner
|
52a9003eef0de0629aae4aa4030b5e8d2c3f9988
|
[
"MIT"
] | null | null | null |
openmoc/bgq/single/openmoc_bgq_single.py
|
samuelshaner/OpenMOC-shaner
|
52a9003eef0de0629aae4aa4030b5e8d2c3f9988
|
[
"MIT"
] | null | null | null |
openmoc/bgq/single/openmoc_bgq_single.py
|
samuelshaner/OpenMOC-shaner
|
52a9003eef0de0629aae4aa4030b5e8d2c3f9988
|
[
"MIT"
] | null | null | null |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_openmoc_bgq_single', [dirname(__file__)])
except ImportError:
import _openmoc_bgq_single
return _openmoc_bgq_single
if fp is not None:
try:
_mod = imp.load_module('_openmoc_bgq_single', fp, pathname, description)
finally:
fp.close()
return _mod
_openmoc_bgq_single = swig_import_helper()
del swig_import_helper
else:
import _openmoc_bgq_single
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
def castCellToCellFill(*args, **kwargs):
return _openmoc_bgq_single.castCellToCellFill(*args, **kwargs)
castCellToCellFill = _openmoc_bgq_single.castCellToCellFill
def castCellToCellBasic(*args, **kwargs):
return _openmoc_bgq_single.castCellToCellBasic(*args, **kwargs)
castCellToCellBasic = _openmoc_bgq_single.castCellToCellBasic
def castUniverseToLattice(*args, **kwargs):
return _openmoc_bgq_single.castUniverseToLattice(*args, **kwargs)
castUniverseToLattice = _openmoc_bgq_single.castUniverseToLattice
def castLatticeToUniverse(*args, **kwargs):
return _openmoc_bgq_single.castLatticeToUniverse(*args, **kwargs)
castLatticeToUniverse = _openmoc_bgq_single.castLatticeToUniverse
def cell_id():
return _openmoc_bgq_single.cell_id()
cell_id = _openmoc_bgq_single.cell_id
MATERIAL = _openmoc_bgq_single.MATERIAL
FILL = _openmoc_bgq_single.FILL
class Cell(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Cell, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Cell, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _openmoc_bgq_single.delete_Cell
__del__ = lambda self : None;
def getUid(self): return _openmoc_bgq_single.Cell_getUid(self)
def getId(self): return _openmoc_bgq_single.Cell_getId(self)
def getType(self): return _openmoc_bgq_single.Cell_getType(self)
def getUniverse(self): return _openmoc_bgq_single.Cell_getUniverse(self)
def getNumSurfaces(self): return _openmoc_bgq_single.Cell_getNumSurfaces(self)
def getSurfaces(self): return _openmoc_bgq_single.Cell_getSurfaces(self)
def getNumFSRs(self): return _openmoc_bgq_single.Cell_getNumFSRs(self)
def setUniverse(self, *args, **kwargs): return _openmoc_bgq_single.Cell_setUniverse(self, *args, **kwargs)
def addSurface(self, *args, **kwargs): return _openmoc_bgq_single.Cell_addSurface(self, *args, **kwargs)
def setSurfacePointer(self, *args, **kwargs): return _openmoc_bgq_single.Cell_setSurfacePointer(self, *args, **kwargs)
def cellContainsPoint(self, *args, **kwargs): return _openmoc_bgq_single.Cell_cellContainsPoint(self, *args, **kwargs)
def cellContainsCoords(self, *args, **kwargs): return _openmoc_bgq_single.Cell_cellContainsCoords(self, *args, **kwargs)
def minSurfaceDist(self, *args, **kwargs): return _openmoc_bgq_single.Cell_minSurfaceDist(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.Cell_toString(self)
def printString(self): return _openmoc_bgq_single.Cell_printString(self)
Cell_swigregister = _openmoc_bgq_single.Cell_swigregister
Cell_swigregister(Cell)
class CellBasic(Cell):
__swig_setmethods__ = {}
for _s in [Cell]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, CellBasic, name, value)
__swig_getmethods__ = {}
for _s in [Cell]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, CellBasic, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_CellBasic(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
def getMaterial(self): return _openmoc_bgq_single.CellBasic_getMaterial(self)
def getNumRings(self): return _openmoc_bgq_single.CellBasic_getNumRings(self)
def getNumSectors(self): return _openmoc_bgq_single.CellBasic_getNumSectors(self)
def getNumFSRs(self): return _openmoc_bgq_single.CellBasic_getNumFSRs(self)
def setNumRings(self, *args, **kwargs): return _openmoc_bgq_single.CellBasic_setNumRings(self, *args, **kwargs)
def setNumSectors(self, *args, **kwargs): return _openmoc_bgq_single.CellBasic_setNumSectors(self, *args, **kwargs)
def clone(self): return _openmoc_bgq_single.CellBasic_clone(self)
def subdivideCell(self): return _openmoc_bgq_single.CellBasic_subdivideCell(self)
def toString(self): return _openmoc_bgq_single.CellBasic_toString(self)
def printString(self): return _openmoc_bgq_single.CellBasic_printString(self)
__swig_destroy__ = _openmoc_bgq_single.delete_CellBasic
__del__ = lambda self : None;
CellBasic_swigregister = _openmoc_bgq_single.CellBasic_swigregister
CellBasic_swigregister(CellBasic)
class CellFill(Cell):
__swig_setmethods__ = {}
for _s in [Cell]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, CellFill, name, value)
__swig_getmethods__ = {}
for _s in [Cell]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, CellFill, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_CellFill(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
def getUniverseFillId(self): return _openmoc_bgq_single.CellFill_getUniverseFillId(self)
def getUniverseFill(self): return _openmoc_bgq_single.CellFill_getUniverseFill(self)
def getNumFSRs(self): return _openmoc_bgq_single.CellFill_getNumFSRs(self)
def setUniverseFill(self, *args, **kwargs): return _openmoc_bgq_single.CellFill_setUniverseFill(self, *args, **kwargs)
def setUniverseFillPointer(self, *args, **kwargs): return _openmoc_bgq_single.CellFill_setUniverseFillPointer(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.CellFill_toString(self)
def printString(self): return _openmoc_bgq_single.CellFill_printString(self)
__swig_destroy__ = _openmoc_bgq_single.delete_CellFill
__del__ = lambda self : None;
CellFill_swigregister = _openmoc_bgq_single.CellFill_swigregister
CellFill_swigregister(CellFill)
class Geometry(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Geometry, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Geometry, name)
__repr__ = _swig_repr
def __init__(self):
this = _openmoc_bgq_single.new_Geometry()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Geometry
__del__ = lambda self : None;
def getWidth(self): return _openmoc_bgq_single.Geometry_getWidth(self)
def getHeight(self): return _openmoc_bgq_single.Geometry_getHeight(self)
def getXMin(self): return _openmoc_bgq_single.Geometry_getXMin(self)
def getXMax(self): return _openmoc_bgq_single.Geometry_getXMax(self)
def getYMin(self): return _openmoc_bgq_single.Geometry_getYMin(self)
def getYMax(self): return _openmoc_bgq_single.Geometry_getYMax(self)
def getBCTop(self): return _openmoc_bgq_single.Geometry_getBCTop(self)
def getBCBottom(self): return _openmoc_bgq_single.Geometry_getBCBottom(self)
def getBCLeft(self): return _openmoc_bgq_single.Geometry_getBCLeft(self)
def getBCRight(self): return _openmoc_bgq_single.Geometry_getBCRight(self)
def getNumFSRs(self): return _openmoc_bgq_single.Geometry_getNumFSRs(self)
def getNumEnergyGroups(self): return _openmoc_bgq_single.Geometry_getNumEnergyGroups(self)
def getNumMaterials(self): return _openmoc_bgq_single.Geometry_getNumMaterials(self)
def getFSRtoCellMap(self): return _openmoc_bgq_single.Geometry_getFSRtoCellMap(self)
def getFSRtoMaterialMap(self): return _openmoc_bgq_single.Geometry_getFSRtoMaterialMap(self)
def getMaxSegmentLength(self): return _openmoc_bgq_single.Geometry_getMaxSegmentLength(self)
def getMinSegmentLength(self): return _openmoc_bgq_single.Geometry_getMinSegmentLength(self)
def getMaterials(self): return _openmoc_bgq_single.Geometry_getMaterials(self)
def getMaterial(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_getMaterial(self, *args, **kwargs)
def getSurface(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_getSurface(self, *args, **kwargs)
def getCell(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_getCell(self, *args, **kwargs)
def getUniverse(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_getUniverse(self, *args, **kwargs)
def getLattice(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_getLattice(self, *args, **kwargs)
def addMaterial(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_addMaterial(self, *args, **kwargs)
def addSurface(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_addSurface(self, *args, **kwargs)
def addCell(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_addCell(self, *args, **kwargs)
def addUniverse(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_addUniverse(self, *args, **kwargs)
def addLattice(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_addLattice(self, *args, **kwargs)
def findCellContainingCoords(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_findCellContainingCoords(self, *args, **kwargs)
def findCellContainingFSR(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_findCellContainingFSR(self, *args, **kwargs)
def findCell(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_findCell(self, *args, **kwargs)
def findFSRId(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_findFSRId(self, *args, **kwargs)
def subdivideCells(self): return _openmoc_bgq_single.Geometry_subdivideCells(self)
def initializeFlatSourceRegions(self): return _openmoc_bgq_single.Geometry_initializeFlatSourceRegions(self)
def segmentize(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_segmentize(self, *args, **kwargs)
def computeFissionability(self, univ=None): return _openmoc_bgq_single.Geometry_computeFissionability(self, univ)
def computePinPowers(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_computePinPowers(self, *args, **kwargs)
def computePinPowersInUniverse(self, *args, **kwargs): return _openmoc_bgq_single.Geometry_computePinPowersInUniverse(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.Geometry_toString(self)
def printString(self): return _openmoc_bgq_single.Geometry_printString(self)
Geometry_swigregister = _openmoc_bgq_single.Geometry_swigregister
Geometry_swigregister(Geometry)
UNIV = _openmoc_bgq_single.UNIV
LAT = _openmoc_bgq_single.LAT
class LocalCoords(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, LocalCoords, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, LocalCoords, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_LocalCoords(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_LocalCoords
__del__ = lambda self : None;
def getType(self): return _openmoc_bgq_single.LocalCoords_getType(self)
def getUniverse(self): return _openmoc_bgq_single.LocalCoords_getUniverse(self)
def getCell(self): return _openmoc_bgq_single.LocalCoords_getCell(self)
def getLattice(self): return _openmoc_bgq_single.LocalCoords_getLattice(self)
def getLatticeX(self): return _openmoc_bgq_single.LocalCoords_getLatticeX(self)
def getLatticeY(self): return _openmoc_bgq_single.LocalCoords_getLatticeY(self)
def getX(self): return _openmoc_bgq_single.LocalCoords_getX(self)
def getY(self): return _openmoc_bgq_single.LocalCoords_getY(self)
def getPoint(self): return _openmoc_bgq_single.LocalCoords_getPoint(self)
def getNext(self): return _openmoc_bgq_single.LocalCoords_getNext(self)
def getPrev(self): return _openmoc_bgq_single.LocalCoords_getPrev(self)
def setType(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setType(self, *args, **kwargs)
def setUniverse(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setUniverse(self, *args, **kwargs)
def setCell(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setCell(self, *args, **kwargs)
def setLattice(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setLattice(self, *args, **kwargs)
def setLatticeX(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setLatticeX(self, *args, **kwargs)
def setLatticeY(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setLatticeY(self, *args, **kwargs)
def setX(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setX(self, *args, **kwargs)
def setY(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setY(self, *args, **kwargs)
def setNext(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setNext(self, *args, **kwargs)
def setPrev(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_setPrev(self, *args, **kwargs)
def getLowestLevel(self): return _openmoc_bgq_single.LocalCoords_getLowestLevel(self)
def adjustCoords(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_adjustCoords(self, *args, **kwargs)
def updateMostLocal(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_updateMostLocal(self, *args, **kwargs)
def prune(self): return _openmoc_bgq_single.LocalCoords_prune(self)
def copyCoords(self, *args, **kwargs): return _openmoc_bgq_single.LocalCoords_copyCoords(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.LocalCoords_toString(self)
LocalCoords_swigregister = _openmoc_bgq_single.LocalCoords_swigregister
LocalCoords_swigregister(LocalCoords)
DEBUG = _openmoc_bgq_single.DEBUG
INFO = _openmoc_bgq_single.INFO
NORMAL = _openmoc_bgq_single.NORMAL
SEPARATOR = _openmoc_bgq_single.SEPARATOR
HEADER = _openmoc_bgq_single.HEADER
TITLE = _openmoc_bgq_single.TITLE
WARNING = _openmoc_bgq_single.WARNING
CRITICAL = _openmoc_bgq_single.CRITICAL
RESULT = _openmoc_bgq_single.RESULT
UNITTEST = _openmoc_bgq_single.UNITTEST
ERROR = _openmoc_bgq_single.ERROR
def set_err(*args, **kwargs):
return _openmoc_bgq_single.set_err(*args, **kwargs)
set_err = _openmoc_bgq_single.set_err
def setOutputDirectory(*args, **kwargs):
return _openmoc_bgq_single.setOutputDirectory(*args, **kwargs)
setOutputDirectory = _openmoc_bgq_single.setOutputDirectory
def getOutputDirectory():
return _openmoc_bgq_single.getOutputDirectory()
getOutputDirectory = _openmoc_bgq_single.getOutputDirectory
def setLogfileName(*args, **kwargs):
return _openmoc_bgq_single.setLogfileName(*args, **kwargs)
setLogfileName = _openmoc_bgq_single.setLogfileName
def getLogfileName():
return _openmoc_bgq_single.getLogfileName()
getLogfileName = _openmoc_bgq_single.getLogfileName
def setSeparatorCharacter(*args, **kwargs):
return _openmoc_bgq_single.setSeparatorCharacter(*args, **kwargs)
setSeparatorCharacter = _openmoc_bgq_single.setSeparatorCharacter
def getSeparatorCharacter():
return _openmoc_bgq_single.getSeparatorCharacter()
getSeparatorCharacter = _openmoc_bgq_single.getSeparatorCharacter
def setHeaderCharacter(*args, **kwargs):
return _openmoc_bgq_single.setHeaderCharacter(*args, **kwargs)
setHeaderCharacter = _openmoc_bgq_single.setHeaderCharacter
def getHeaderCharacter():
return _openmoc_bgq_single.getHeaderCharacter()
getHeaderCharacter = _openmoc_bgq_single.getHeaderCharacter
def setTitleCharacter(*args, **kwargs):
return _openmoc_bgq_single.setTitleCharacter(*args, **kwargs)
setTitleCharacter = _openmoc_bgq_single.setTitleCharacter
def getTitleCharacter():
return _openmoc_bgq_single.getTitleCharacter()
getTitleCharacter = _openmoc_bgq_single.getTitleCharacter
def setLineLength(*args, **kwargs):
return _openmoc_bgq_single.setLineLength(*args, **kwargs)
setLineLength = _openmoc_bgq_single.setLineLength
def setLogLevel(*args, **kwargs):
return _openmoc_bgq_single.setLogLevel(*args, **kwargs)
setLogLevel = _openmoc_bgq_single.setLogLevel
def getLogLevel():
return _openmoc_bgq_single.getLogLevel()
getLogLevel = _openmoc_bgq_single.getLogLevel
def log_printf(*args, **kwargs):
return _openmoc_bgq_single.log_printf(*args, **kwargs)
log_printf = _openmoc_bgq_single.log_printf
def createMultilineMsg(*args, **kwargs):
return _openmoc_bgq_single.createMultilineMsg(*args, **kwargs)
createMultilineMsg = _openmoc_bgq_single.createMultilineMsg
SIGMA_T_THRESH = _openmoc_bgq_single.SIGMA_T_THRESH
def material_id():
return _openmoc_bgq_single.material_id()
material_id = _openmoc_bgq_single.material_id
class Material(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Material, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Material, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_Material(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Material
__del__ = lambda self : None;
def getUid(self): return _openmoc_bgq_single.Material_getUid(self)
def getId(self): return _openmoc_bgq_single.Material_getId(self)
def getNumEnergyGroups(self): return _openmoc_bgq_single.Material_getNumEnergyGroups(self)
def getSigmaT(self): return _openmoc_bgq_single.Material_getSigmaT(self)
def getSigmaA(self): return _openmoc_bgq_single.Material_getSigmaA(self)
def getSigmaS(self): return _openmoc_bgq_single.Material_getSigmaS(self)
def getSigmaF(self): return _openmoc_bgq_single.Material_getSigmaF(self)
def getNuSigmaF(self): return _openmoc_bgq_single.Material_getNuSigmaF(self)
def getChi(self): return _openmoc_bgq_single.Material_getChi(self)
def isFissionable(self): return _openmoc_bgq_single.Material_isFissionable(self)
def isDataAligned(self): return _openmoc_bgq_single.Material_isDataAligned(self)
def getNumVectorGroups(self): return _openmoc_bgq_single.Material_getNumVectorGroups(self)
def setNumEnergyGroups(self, *args, **kwargs): return _openmoc_bgq_single.Material_setNumEnergyGroups(self, *args, **kwargs)
def setSigmaT(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaT(self, *args, **kwargs)
def setSigmaA(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaA(self, *args, **kwargs)
def setSigmaS(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaS(self, *args, **kwargs)
def setSigmaF(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaF(self, *args, **kwargs)
def setNuSigmaF(self, *args, **kwargs): return _openmoc_bgq_single.Material_setNuSigmaF(self, *args, **kwargs)
def setChi(self, *args, **kwargs): return _openmoc_bgq_single.Material_setChi(self, *args, **kwargs)
def setSigmaTByGroup(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaTByGroup(self, *args, **kwargs)
def setSigmaAByGroup(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaAByGroup(self, *args, **kwargs)
def setSigmaFByGroup(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaFByGroup(self, *args, **kwargs)
def setNuSigmaFByGroup(self, *args, **kwargs): return _openmoc_bgq_single.Material_setNuSigmaFByGroup(self, *args, **kwargs)
def setSigmaSByGroup(self, *args, **kwargs): return _openmoc_bgq_single.Material_setSigmaSByGroup(self, *args, **kwargs)
def setChiByGroup(self, *args, **kwargs): return _openmoc_bgq_single.Material_setChiByGroup(self, *args, **kwargs)
def checkSigmaT(self): return _openmoc_bgq_single.Material_checkSigmaT(self)
def toString(self): return _openmoc_bgq_single.Material_toString(self)
def printString(self): return _openmoc_bgq_single.Material_printString(self)
def alignData(self): return _openmoc_bgq_single.Material_alignData(self)
Material_swigregister = _openmoc_bgq_single.Material_swigregister
Material_swigregister(Material)
class Point(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Point, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Point, name)
__repr__ = _swig_repr
def __init__(self):
this = _openmoc_bgq_single.new_Point()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Point
__del__ = lambda self : None;
def setCoords(self, *args, **kwargs): return _openmoc_bgq_single.Point_setCoords(self, *args, **kwargs)
def getX(self): return _openmoc_bgq_single.Point_getX(self)
def getY(self): return _openmoc_bgq_single.Point_getY(self)
def setX(self, *args, **kwargs): return _openmoc_bgq_single.Point_setX(self, *args, **kwargs)
def setY(self, *args, **kwargs): return _openmoc_bgq_single.Point_setY(self, *args, **kwargs)
def distance(self, *args, **kwargs): return _openmoc_bgq_single.Point_distance(self, *args, **kwargs)
def distanceToPoint(self, *args, **kwargs): return _openmoc_bgq_single.Point_distanceToPoint(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.Point_toString(self)
Point_swigregister = _openmoc_bgq_single.Point_swigregister
Point_swigregister(Point)
LEONARD = _openmoc_bgq_single.LEONARD
TABUCHI = _openmoc_bgq_single.TABUCHI
class Quadrature(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Quadrature, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Quadrature, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_Quadrature(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Quadrature
__del__ = lambda self : None;
def getNumPolarAngles(self): return _openmoc_bgq_single.Quadrature_getNumPolarAngles(self)
def getType(self): return _openmoc_bgq_single.Quadrature_getType(self)
def getSinTheta(self, *args, **kwargs): return _openmoc_bgq_single.Quadrature_getSinTheta(self, *args, **kwargs)
def getWeight(self, *args, **kwargs): return _openmoc_bgq_single.Quadrature_getWeight(self, *args, **kwargs)
def getMultiple(self, *args, **kwargs): return _openmoc_bgq_single.Quadrature_getMultiple(self, *args, **kwargs)
def getSinThetas(self): return _openmoc_bgq_single.Quadrature_getSinThetas(self)
def getWeights(self): return _openmoc_bgq_single.Quadrature_getWeights(self)
def getMultiples(self): return _openmoc_bgq_single.Quadrature_getMultiples(self)
def toString(self): return _openmoc_bgq_single.Quadrature_toString(self)
Quadrature_swigregister = _openmoc_bgq_single.Quadrature_swigregister
Quadrature_swigregister(Quadrature)
FOUR_PI = _openmoc_bgq_single.FOUR_PI
ONE_OVER_FOUR_PI = _openmoc_bgq_single.ONE_OVER_FOUR_PI
class Solver(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Solver, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Solver, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _openmoc_bgq_single.delete_Solver
__del__ = lambda self : None;
def getGeometry(self): return _openmoc_bgq_single.Solver_getGeometry(self)
def getTrackGenerator(self): return _openmoc_bgq_single.Solver_getTrackGenerator(self)
def getNumPolarAngles(self): return _openmoc_bgq_single.Solver_getNumPolarAngles(self)
def getPolarQuadratureType(self): return _openmoc_bgq_single.Solver_getPolarQuadratureType(self)
def getNumIterations(self): return _openmoc_bgq_single.Solver_getNumIterations(self)
def getSourceConvergenceThreshold(self): return _openmoc_bgq_single.Solver_getSourceConvergenceThreshold(self)
def getFSRScalarFlux(self, *args, **kwargs): return _openmoc_bgq_single.Solver_getFSRScalarFlux(self, *args, **kwargs)
def getFSRScalarFluxes(self): return _openmoc_bgq_single.Solver_getFSRScalarFluxes(self)
def setGeometry(self, *args, **kwargs): return _openmoc_bgq_single.Solver_setGeometry(self, *args, **kwargs)
def setTrackGenerator(self, *args, **kwargs): return _openmoc_bgq_single.Solver_setTrackGenerator(self, *args, **kwargs)
def setPolarQuadratureType(self, *args, **kwargs): return _openmoc_bgq_single.Solver_setPolarQuadratureType(self, *args, **kwargs)
def setNumPolarAngles(self, *args, **kwargs): return _openmoc_bgq_single.Solver_setNumPolarAngles(self, *args, **kwargs)
def setSourceConvergenceThreshold(self, *args, **kwargs): return _openmoc_bgq_single.Solver_setSourceConvergenceThreshold(self, *args, **kwargs)
def useExponentialInterpolation(self): return _openmoc_bgq_single.Solver_useExponentialInterpolation(self)
def useExponentialIntrinsic(self): return _openmoc_bgq_single.Solver_useExponentialIntrinsic(self)
def convergeSource(self, *args, **kwargs): return _openmoc_bgq_single.Solver_convergeSource(self, *args, **kwargs)
def computeFSRFissionRates(self, *args, **kwargs): return _openmoc_bgq_single.Solver_computeFSRFissionRates(self, *args, **kwargs)
def printTimerReport(self): return _openmoc_bgq_single.Solver_printTimerReport(self)
Solver_swigregister = _openmoc_bgq_single.Solver_swigregister
Solver_swigregister(Solver)
class CPUSolver(Solver):
__swig_setmethods__ = {}
for _s in [Solver]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, CPUSolver, name, value)
__swig_getmethods__ = {}
for _s in [Solver]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, CPUSolver, name)
__repr__ = _swig_repr
def __init__(self, geometry=None, track_generator=None):
this = _openmoc_bgq_single.new_CPUSolver(geometry, track_generator)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_CPUSolver
__del__ = lambda self : None;
def getNumThreads(self): return _openmoc_bgq_single.CPUSolver_getNumThreads(self)
def getFSRScalarFlux(self, *args, **kwargs): return _openmoc_bgq_single.CPUSolver_getFSRScalarFlux(self, *args, **kwargs)
def getFSRScalarFluxes(self): return _openmoc_bgq_single.CPUSolver_getFSRScalarFluxes(self)
def setNumThreads(self, *args, **kwargs): return _openmoc_bgq_single.CPUSolver_setNumThreads(self, *args, **kwargs)
def computeFSRFissionRates(self, *args, **kwargs): return _openmoc_bgq_single.CPUSolver_computeFSRFissionRates(self, *args, **kwargs)
CPUSolver_swigregister = _openmoc_bgq_single.CPUSolver_swigregister
CPUSolver_swigregister(CPUSolver)
class ThreadPrivateSolver(CPUSolver):
__swig_setmethods__ = {}
for _s in [CPUSolver]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ThreadPrivateSolver, name, value)
__swig_getmethods__ = {}
for _s in [CPUSolver]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, ThreadPrivateSolver, name)
__repr__ = _swig_repr
def __init__(self, geometry=None, track_generator=None):
this = _openmoc_bgq_single.new_ThreadPrivateSolver(geometry, track_generator)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_ThreadPrivateSolver
__del__ = lambda self : None;
ThreadPrivateSolver_swigregister = _openmoc_bgq_single.ThreadPrivateSolver_swigregister
ThreadPrivateSolver_swigregister(ThreadPrivateSolver)
ON_SURFACE_THRESH = _openmoc_bgq_single.ON_SURFACE_THRESH
def surf_id():
return _openmoc_bgq_single.surf_id()
surf_id = _openmoc_bgq_single.surf_id
PLANE = _openmoc_bgq_single.PLANE
CIRCLE = _openmoc_bgq_single.CIRCLE
XPLANE = _openmoc_bgq_single.XPLANE
YPLANE = _openmoc_bgq_single.YPLANE
ZPLANE = _openmoc_bgq_single.ZPLANE
QUADRATIC = _openmoc_bgq_single.QUADRATIC
VACUUM = _openmoc_bgq_single.VACUUM
REFLECTIVE = _openmoc_bgq_single.REFLECTIVE
BOUNDARY_NONE = _openmoc_bgq_single.BOUNDARY_NONE
class Surface(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Surface, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Surface, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _openmoc_bgq_single.delete_Surface
__del__ = lambda self : None;
def getUid(self): return _openmoc_bgq_single.Surface_getUid(self)
def getId(self): return _openmoc_bgq_single.Surface_getId(self)
def getSurfaceType(self): return _openmoc_bgq_single.Surface_getSurfaceType(self)
def getBoundaryType(self): return _openmoc_bgq_single.Surface_getBoundaryType(self)
def getXMin(self): return _openmoc_bgq_single.Surface_getXMin(self)
def getXMax(self): return _openmoc_bgq_single.Surface_getXMax(self)
def getYMin(self): return _openmoc_bgq_single.Surface_getYMin(self)
def getYMax(self): return _openmoc_bgq_single.Surface_getYMax(self)
def setBoundaryType(self, *args, **kwargs): return _openmoc_bgq_single.Surface_setBoundaryType(self, *args, **kwargs)
def evaluate(self, *args, **kwargs): return _openmoc_bgq_single.Surface_evaluate(self, *args, **kwargs)
def intersection(self, *args, **kwargs): return _openmoc_bgq_single.Surface_intersection(self, *args, **kwargs)
def isPointOnSurface(self, *args, **kwargs): return _openmoc_bgq_single.Surface_isPointOnSurface(self, *args, **kwargs)
def isCoordOnSurface(self, *args, **kwargs): return _openmoc_bgq_single.Surface_isCoordOnSurface(self, *args, **kwargs)
def getMinDistance(self, *args, **kwargs): return _openmoc_bgq_single.Surface_getMinDistance(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.Surface_toString(self)
def printString(self): return _openmoc_bgq_single.Surface_printString(self)
Surface_swigregister = _openmoc_bgq_single.Surface_swigregister
Surface_swigregister(Surface)
class Plane(Surface):
__swig_setmethods__ = {}
for _s in [Surface]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Plane, name, value)
__swig_getmethods__ = {}
for _s in [Surface]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, Plane, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_Plane(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
def getXMin(self): return _openmoc_bgq_single.Plane_getXMin(self)
def getXMax(self): return _openmoc_bgq_single.Plane_getXMax(self)
def getYMin(self): return _openmoc_bgq_single.Plane_getYMin(self)
def getYMax(self): return _openmoc_bgq_single.Plane_getYMax(self)
def evaluate(self, *args, **kwargs): return _openmoc_bgq_single.Plane_evaluate(self, *args, **kwargs)
def intersection(self, *args, **kwargs): return _openmoc_bgq_single.Plane_intersection(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.Plane_toString(self)
def printString(self): return _openmoc_bgq_single.Plane_printString(self)
__swig_destroy__ = _openmoc_bgq_single.delete_Plane
__del__ = lambda self : None;
Plane_swigregister = _openmoc_bgq_single.Plane_swigregister
Plane_swigregister(Plane)
class XPlane(Plane):
__swig_setmethods__ = {}
for _s in [Plane]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, XPlane, name, value)
__swig_getmethods__ = {}
for _s in [Plane]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, XPlane, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_XPlane(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
def setX(self, *args, **kwargs): return _openmoc_bgq_single.XPlane_setX(self, *args, **kwargs)
def getX(self): return _openmoc_bgq_single.XPlane_getX(self)
def getXMin(self): return _openmoc_bgq_single.XPlane_getXMin(self)
def getXMax(self): return _openmoc_bgq_single.XPlane_getXMax(self)
def getYMin(self): return _openmoc_bgq_single.XPlane_getYMin(self)
def getYMax(self): return _openmoc_bgq_single.XPlane_getYMax(self)
def toString(self): return _openmoc_bgq_single.XPlane_toString(self)
__swig_destroy__ = _openmoc_bgq_single.delete_XPlane
__del__ = lambda self : None;
XPlane_swigregister = _openmoc_bgq_single.XPlane_swigregister
XPlane_swigregister(XPlane)
class YPlane(Plane):
__swig_setmethods__ = {}
for _s in [Plane]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, YPlane, name, value)
__swig_getmethods__ = {}
for _s in [Plane]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, YPlane, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_YPlane(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
def setY(self, *args, **kwargs): return _openmoc_bgq_single.YPlane_setY(self, *args, **kwargs)
def getY(self): return _openmoc_bgq_single.YPlane_getY(self)
def getXMin(self): return _openmoc_bgq_single.YPlane_getXMin(self)
def getXMax(self): return _openmoc_bgq_single.YPlane_getXMax(self)
def getYMin(self): return _openmoc_bgq_single.YPlane_getYMin(self)
def getYMax(self): return _openmoc_bgq_single.YPlane_getYMax(self)
def toString(self): return _openmoc_bgq_single.YPlane_toString(self)
def printString(self): return _openmoc_bgq_single.YPlane_printString(self)
__swig_destroy__ = _openmoc_bgq_single.delete_YPlane
__del__ = lambda self : None;
YPlane_swigregister = _openmoc_bgq_single.YPlane_swigregister
YPlane_swigregister(YPlane)
class ZPlane(Plane):
__swig_setmethods__ = {}
for _s in [Plane]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ZPlane, name, value)
__swig_getmethods__ = {}
for _s in [Plane]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, ZPlane, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_ZPlane(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
def setZ(self, *args, **kwargs): return _openmoc_bgq_single.ZPlane_setZ(self, *args, **kwargs)
def getZ(self): return _openmoc_bgq_single.ZPlane_getZ(self)
def getXMin(self): return _openmoc_bgq_single.ZPlane_getXMin(self)
def getXMax(self): return _openmoc_bgq_single.ZPlane_getXMax(self)
def getYMin(self): return _openmoc_bgq_single.ZPlane_getYMin(self)
def getYMax(self): return _openmoc_bgq_single.ZPlane_getYMax(self)
def toString(self): return _openmoc_bgq_single.ZPlane_toString(self)
def printString(self): return _openmoc_bgq_single.ZPlane_printString(self)
__swig_destroy__ = _openmoc_bgq_single.delete_ZPlane
__del__ = lambda self : None;
ZPlane_swigregister = _openmoc_bgq_single.ZPlane_swigregister
ZPlane_swigregister(ZPlane)
class Circle(Surface):
__swig_setmethods__ = {}
for _s in [Surface]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Circle, name, value)
__swig_getmethods__ = {}
for _s in [Surface]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, Circle, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_Circle(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
def getX0(self): return _openmoc_bgq_single.Circle_getX0(self)
def getY0(self): return _openmoc_bgq_single.Circle_getY0(self)
def getRadius(self): return _openmoc_bgq_single.Circle_getRadius(self)
def getXMin(self): return _openmoc_bgq_single.Circle_getXMin(self)
def getXMax(self): return _openmoc_bgq_single.Circle_getXMax(self)
def getYMin(self): return _openmoc_bgq_single.Circle_getYMin(self)
def getYMax(self): return _openmoc_bgq_single.Circle_getYMax(self)
def evaluate(self, *args, **kwargs): return _openmoc_bgq_single.Circle_evaluate(self, *args, **kwargs)
def intersection(self, *args, **kwargs): return _openmoc_bgq_single.Circle_intersection(self, *args, **kwargs)
def toString(self): return _openmoc_bgq_single.Circle_toString(self)
def printString(self): return _openmoc_bgq_single.Circle_printString(self)
__swig_destroy__ = _openmoc_bgq_single.delete_Circle
__del__ = lambda self : None;
Circle_swigregister = _openmoc_bgq_single.Circle_swigregister
Circle_swigregister(Circle)
class Timer(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Timer, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Timer, name)
__repr__ = _swig_repr
def __init__(self):
this = _openmoc_bgq_single.new_Timer()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Timer
__del__ = lambda self : None;
__swig_getmethods__["Get"] = lambda x: _openmoc_bgq_single.Timer_Get
if _newclass:Get = staticmethod(_openmoc_bgq_single.Timer_Get)
def startTimer(self): return _openmoc_bgq_single.Timer_startTimer(self)
def stopTimer(self): return _openmoc_bgq_single.Timer_stopTimer(self)
def recordSplit(self, *args, **kwargs): return _openmoc_bgq_single.Timer_recordSplit(self, *args, **kwargs)
def getTime(self): return _openmoc_bgq_single.Timer_getTime(self)
def getSplit(self, *args, **kwargs): return _openmoc_bgq_single.Timer_getSplit(self, *args, **kwargs)
def printSplits(self): return _openmoc_bgq_single.Timer_printSplits(self)
def clearSplit(self, *args, **kwargs): return _openmoc_bgq_single.Timer_clearSplit(self, *args, **kwargs)
def clearSplits(self): return _openmoc_bgq_single.Timer_clearSplits(self)
Timer_swigregister = _openmoc_bgq_single.Timer_swigregister
Timer_swigregister(Timer)
def Timer_Get():
return _openmoc_bgq_single.Timer_Get()
Timer_Get = _openmoc_bgq_single.Timer_Get
class segment(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, segment, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, segment, name)
__repr__ = _swig_repr
__swig_setmethods__["_length"] = _openmoc_bgq_single.segment__length_set
__swig_getmethods__["_length"] = _openmoc_bgq_single.segment__length_get
if _newclass:_length = _swig_property(_openmoc_bgq_single.segment__length_get, _openmoc_bgq_single.segment__length_set)
__swig_setmethods__["_material"] = _openmoc_bgq_single.segment__material_set
__swig_getmethods__["_material"] = _openmoc_bgq_single.segment__material_get
if _newclass:_material = _swig_property(_openmoc_bgq_single.segment__material_get, _openmoc_bgq_single.segment__material_set)
__swig_setmethods__["_region_id"] = _openmoc_bgq_single.segment__region_id_set
__swig_getmethods__["_region_id"] = _openmoc_bgq_single.segment__region_id_get
if _newclass:_region_id = _swig_property(_openmoc_bgq_single.segment__region_id_get, _openmoc_bgq_single.segment__region_id_set)
def __init__(self):
this = _openmoc_bgq_single.new_segment()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_segment
__del__ = lambda self : None;
segment_swigregister = _openmoc_bgq_single.segment_swigregister
segment_swigregister(segment)
class Track(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Track, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Track, name)
__repr__ = _swig_repr
def __init__(self):
this = _openmoc_bgq_single.new_Track()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Track
__del__ = lambda self : None;
def setValues(self, *args, **kwargs): return _openmoc_bgq_single.Track_setValues(self, *args, **kwargs)
def setUid(self, *args, **kwargs): return _openmoc_bgq_single.Track_setUid(self, *args, **kwargs)
def setPhi(self, *args, **kwargs): return _openmoc_bgq_single.Track_setPhi(self, *args, **kwargs)
def setAzimAngleIndex(self, *args, **kwargs): return _openmoc_bgq_single.Track_setAzimAngleIndex(self, *args, **kwargs)
def setReflIn(self, *args, **kwargs): return _openmoc_bgq_single.Track_setReflIn(self, *args, **kwargs)
def setReflOut(self, *args, **kwargs): return _openmoc_bgq_single.Track_setReflOut(self, *args, **kwargs)
def setBCIn(self, *args, **kwargs): return _openmoc_bgq_single.Track_setBCIn(self, *args, **kwargs)
def setBCOut(self, *args, **kwargs): return _openmoc_bgq_single.Track_setBCOut(self, *args, **kwargs)
def setTrackIn(self, *args, **kwargs): return _openmoc_bgq_single.Track_setTrackIn(self, *args, **kwargs)
def setTrackOut(self, *args, **kwargs): return _openmoc_bgq_single.Track_setTrackOut(self, *args, **kwargs)
def setTrackInI(self, *args, **kwargs): return _openmoc_bgq_single.Track_setTrackInI(self, *args, **kwargs)
def setTrackInJ(self, *args, **kwargs): return _openmoc_bgq_single.Track_setTrackInJ(self, *args, **kwargs)
def setTrackOutI(self, *args, **kwargs): return _openmoc_bgq_single.Track_setTrackOutI(self, *args, **kwargs)
def setTrackOutJ(self, *args, **kwargs): return _openmoc_bgq_single.Track_setTrackOutJ(self, *args, **kwargs)
def getUid(self): return _openmoc_bgq_single.Track_getUid(self)
def getEnd(self): return _openmoc_bgq_single.Track_getEnd(self)
def getStart(self): return _openmoc_bgq_single.Track_getStart(self)
def getPhi(self): return _openmoc_bgq_single.Track_getPhi(self)
def getAzimAngleIndex(self): return _openmoc_bgq_single.Track_getAzimAngleIndex(self)
def getSegment(self, *args, **kwargs): return _openmoc_bgq_single.Track_getSegment(self, *args, **kwargs)
def getSegments(self): return _openmoc_bgq_single.Track_getSegments(self)
def getNumSegments(self): return _openmoc_bgq_single.Track_getNumSegments(self)
def getTrackIn(self): return _openmoc_bgq_single.Track_getTrackIn(self)
def getTrackOut(self): return _openmoc_bgq_single.Track_getTrackOut(self)
def getTrackInI(self): return _openmoc_bgq_single.Track_getTrackInI(self)
def getTrackInJ(self): return _openmoc_bgq_single.Track_getTrackInJ(self)
def getTrackOutI(self): return _openmoc_bgq_single.Track_getTrackOutI(self)
def getTrackOutJ(self): return _openmoc_bgq_single.Track_getTrackOutJ(self)
def isReflIn(self): return _openmoc_bgq_single.Track_isReflIn(self)
def isReflOut(self): return _openmoc_bgq_single.Track_isReflOut(self)
def getBCIn(self): return _openmoc_bgq_single.Track_getBCIn(self)
def getBCOut(self): return _openmoc_bgq_single.Track_getBCOut(self)
def contains(self, *args, **kwargs): return _openmoc_bgq_single.Track_contains(self, *args, **kwargs)
def addSegment(self, *args, **kwargs): return _openmoc_bgq_single.Track_addSegment(self, *args, **kwargs)
def clearSegments(self): return _openmoc_bgq_single.Track_clearSegments(self)
def toString(self): return _openmoc_bgq_single.Track_toString(self)
Track_swigregister = _openmoc_bgq_single.Track_swigregister
Track_swigregister(Track)
class TrackGenerator(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, TrackGenerator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, TrackGenerator, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_TrackGenerator(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_TrackGenerator
__del__ = lambda self : None;
def getNumAzim(self): return _openmoc_bgq_single.TrackGenerator_getNumAzim(self)
def getTrackSpacing(self): return _openmoc_bgq_single.TrackGenerator_getTrackSpacing(self)
def getGeometry(self): return _openmoc_bgq_single.TrackGenerator_getGeometry(self)
def getNumTracks(self): return _openmoc_bgq_single.TrackGenerator_getNumTracks(self)
def getNumTracksArray(self): return _openmoc_bgq_single.TrackGenerator_getNumTracksArray(self)
def getNumSegments(self): return _openmoc_bgq_single.TrackGenerator_getNumSegments(self)
def getNumSegmentsArray(self): return _openmoc_bgq_single.TrackGenerator_getNumSegmentsArray(self)
def getTracks(self): return _openmoc_bgq_single.TrackGenerator_getTracks(self)
def getAzimWeights(self): return _openmoc_bgq_single.TrackGenerator_getAzimWeights(self)
def containsTracks(self): return _openmoc_bgq_single.TrackGenerator_containsTracks(self)
def retrieveTrackCoords(self, *args, **kwargs): return _openmoc_bgq_single.TrackGenerator_retrieveTrackCoords(self, *args, **kwargs)
def retrieveSegmentCoords(self, *args, **kwargs): return _openmoc_bgq_single.TrackGenerator_retrieveSegmentCoords(self, *args, **kwargs)
def setNumAzim(self, *args, **kwargs): return _openmoc_bgq_single.TrackGenerator_setNumAzim(self, *args, **kwargs)
def setTrackSpacing(self, *args, **kwargs): return _openmoc_bgq_single.TrackGenerator_setTrackSpacing(self, *args, **kwargs)
def setGeometry(self, *args, **kwargs): return _openmoc_bgq_single.TrackGenerator_setGeometry(self, *args, **kwargs)
def generateTracks(self): return _openmoc_bgq_single.TrackGenerator_generateTracks(self)
TrackGenerator_swigregister = _openmoc_bgq_single.TrackGenerator_swigregister
TrackGenerator_swigregister(TrackGenerator)
ON_LATTICE_CELL_THRESH = _openmoc_bgq_single.ON_LATTICE_CELL_THRESH
TINY_MOVE = _openmoc_bgq_single.TINY_MOVE
SIMPLE = _openmoc_bgq_single.SIMPLE
LATTICE = _openmoc_bgq_single.LATTICE
class Universe(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Universe, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Universe, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_Universe(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Universe
__del__ = lambda self : None;
def addCell(self, *args, **kwargs): return _openmoc_bgq_single.Universe_addCell(self, *args, **kwargs)
def getCell(self, *args, **kwargs): return _openmoc_bgq_single.Universe_getCell(self, *args, **kwargs)
def getCells(self): return _openmoc_bgq_single.Universe_getCells(self)
def getUid(self): return _openmoc_bgq_single.Universe_getUid(self)
def getId(self): return _openmoc_bgq_single.Universe_getId(self)
def getType(self): return _openmoc_bgq_single.Universe_getType(self)
def getNumCells(self): return _openmoc_bgq_single.Universe_getNumCells(self)
def getFSR(self, *args, **kwargs): return _openmoc_bgq_single.Universe_getFSR(self, *args, **kwargs)
def getOrigin(self): return _openmoc_bgq_single.Universe_getOrigin(self)
def getMaterialIds(self): return _openmoc_bgq_single.Universe_getMaterialIds(self)
def getNestedUniverseIds(self): return _openmoc_bgq_single.Universe_getNestedUniverseIds(self)
def getCellIds(self, *args, **kwargs): return _openmoc_bgq_single.Universe_getCellIds(self, *args, **kwargs)
def isFissionable(self): return _openmoc_bgq_single.Universe_isFissionable(self)
def setType(self, *args, **kwargs): return _openmoc_bgq_single.Universe_setType(self, *args, **kwargs)
def setOrigin(self, *args, **kwargs): return _openmoc_bgq_single.Universe_setOrigin(self, *args, **kwargs)
def setFissionability(self, *args, **kwargs): return _openmoc_bgq_single.Universe_setFissionability(self, *args, **kwargs)
def findCell(self, *args, **kwargs): return _openmoc_bgq_single.Universe_findCell(self, *args, **kwargs)
def computeFSRMaps(self): return _openmoc_bgq_single.Universe_computeFSRMaps(self)
def subdivideCells(self): return _openmoc_bgq_single.Universe_subdivideCells(self)
def toString(self): return _openmoc_bgq_single.Universe_toString(self)
def printString(self): return _openmoc_bgq_single.Universe_printString(self)
Universe_swigregister = _openmoc_bgq_single.Universe_swigregister
Universe_swigregister(Universe)
class Lattice(Universe):
__swig_setmethods__ = {}
for _s in [Universe]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Lattice, name, value)
__swig_getmethods__ = {}
for _s in [Universe]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, Lattice, name)
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
this = _openmoc_bgq_single.new_Lattice(*args, **kwargs)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _openmoc_bgq_single.delete_Lattice
__del__ = lambda self : None;
def getNumX(self): return _openmoc_bgq_single.Lattice_getNumX(self)
def getNumY(self): return _openmoc_bgq_single.Lattice_getNumY(self)
def getOrigin(self): return _openmoc_bgq_single.Lattice_getOrigin(self)
def getUniverses(self): return _openmoc_bgq_single.Lattice_getUniverses(self)
def getUniverse(self, *args, **kwargs): return _openmoc_bgq_single.Lattice_getUniverse(self, *args, **kwargs)
def getWidthX(self): return _openmoc_bgq_single.Lattice_getWidthX(self)
def getWidthY(self): return _openmoc_bgq_single.Lattice_getWidthY(self)
def getFSR(self, *args, **kwargs): return _openmoc_bgq_single.Lattice_getFSR(self, *args, **kwargs)
def getNestedUniverseIds(self): return _openmoc_bgq_single.Lattice_getNestedUniverseIds(self)
def setLatticeCells(self, *args, **kwargs): return _openmoc_bgq_single.Lattice_setLatticeCells(self, *args, **kwargs)
def setUniversePointer(self, *args, **kwargs): return _openmoc_bgq_single.Lattice_setUniversePointer(self, *args, **kwargs)
def withinBounds(self, *args, **kwargs): return _openmoc_bgq_single.Lattice_withinBounds(self, *args, **kwargs)
def findCell(self, *args, **kwargs): return _openmoc_bgq_single.Lattice_findCell(self, *args, **kwargs)
def findNextLatticeCell(self, *args, **kwargs): return _openmoc_bgq_single.Lattice_findNextLatticeCell(self, *args, **kwargs)
def computeFSRMaps(self): return _openmoc_bgq_single.Lattice_computeFSRMaps(self)
def toString(self): return _openmoc_bgq_single.Lattice_toString(self)
def printString(self): return _openmoc_bgq_single.Lattice_printString(self)
Lattice_swigregister = _openmoc_bgq_single.Lattice_swigregister
Lattice_swigregister(Lattice)
# This file is compatible with both classic and new-style classes.
| 60.852349
| 148
| 0.775927
| 6,590
| 54,402
| 5.898027
| 0.064188
| 0.126582
| 0.202532
| 0.19754
| 0.625347
| 0.591952
| 0.473063
| 0.443141
| 0.299784
| 0.227488
| 0
| 0.000336
| 0.124665
| 54,402
| 893
| 149
| 60.920493
| 0.815876
| 0.005404
| 0
| 0.215923
| 1
| 0
| 0.012588
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.453559
| false
| 0.002413
| 0.010856
| 0.420989
| 0.722557
| 0.020507
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
c536b14f1525244574fca106ad6ff3a05154a32c
| 129
|
py
|
Python
|
authx/cache/__init__.py
|
theoohoho/authx
|
5c79983cedd4f33fe4c6c3d744c6857f830653fc
|
[
"MIT"
] | 141
|
2021-11-08T18:59:57.000Z
|
2022-03-31T18:49:23.000Z
|
authx/cache/__init__.py
|
theoohoho/authx
|
5c79983cedd4f33fe4c6c3d744c6857f830653fc
|
[
"MIT"
] | 85
|
2021-11-08T17:30:08.000Z
|
2022-03-24T18:23:51.000Z
|
authx/cache/__init__.py
|
theoohoho/authx
|
5c79983cedd4f33fe4c6c3d744c6857f830653fc
|
[
"MIT"
] | 15
|
2021-11-09T00:01:13.000Z
|
2022-03-26T20:25:18.000Z
|
from authx.cache.config import basicConfig
from authx.cache.redis import RedisBackend
__all__ = ["RedisBackend", "basicConfig"]
| 25.8
| 42
| 0.806202
| 15
| 129
| 6.666667
| 0.6
| 0.18
| 0.28
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.100775
| 129
| 4
| 43
| 32.25
| 0.862069
| 0
| 0
| 0
| 0
| 0
| 0.178295
| 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
|
c54eba3f959dbfeab8babc52b8f50257695c23ae
| 86
|
py
|
Python
|
BluenetTestSuite/runtests.py
|
crownstone/bluenet-test-suite
|
2e1edcee18c0ee33231ea7a497c3165d69f016c8
|
[
"MIT"
] | null | null | null |
BluenetTestSuite/runtests.py
|
crownstone/bluenet-test-suite
|
2e1edcee18c0ee33231ea7a497c3165d69f016c8
|
[
"MIT"
] | 1
|
2021-02-15T10:55:27.000Z
|
2021-02-15T10:55:27.000Z
|
BluenetTestSuite/runtests.py
|
crownstone/bluenet-test-suite
|
2e1edcee18c0ee33231ea7a497c3165d69f016c8
|
[
"MIT"
] | null | null | null |
"""
Runs all files in ./tests/ and collects stats on their successes.
"""
import sys
| 14.333333
| 65
| 0.697674
| 13
| 86
| 4.615385
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186047
| 86
| 5
| 66
| 17.2
| 0.857143
| 0.755814
| 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
|
c572b830a3f8b199f26eec2204c31528ba93dade
| 174
|
py
|
Python
|
tests/web_platform/CSS2/normal_flow/test_block_in_inline_insert_002_ref.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 71
|
2015-04-13T09:44:14.000Z
|
2019-03-24T01:03:02.000Z
|
tests/web_platform/CSS2/normal_flow/test_block_in_inline_insert_002_ref.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 35
|
2019-05-06T15:26:09.000Z
|
2022-03-28T06:30:33.000Z
|
tests/web_platform/CSS2/normal_flow/test_block_in_inline_insert_002_ref.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 139
|
2015-05-30T18:37:43.000Z
|
2019-03-27T17:14:05.000Z
|
from tests.utils import W3CTestCase
class TestBlockInInlineInsert002Ref(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'block-in-inline-insert-002-ref'))
| 29
| 85
| 0.804598
| 20
| 174
| 6.75
| 0.85
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05625
| 0.08046
| 174
| 5
| 86
| 34.8
| 0.7875
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 0.172414
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c575eaa9155f837e1da6ef1b6a87650e317cc6c7
| 43
|
py
|
Python
|
central_server/api/__init__.py
|
BUPT-MAGA/central_server
|
1ecf0f2fe40651107fa010aac0e629b5b39b9fd0
|
[
"Apache-2.0"
] | null | null | null |
central_server/api/__init__.py
|
BUPT-MAGA/central_server
|
1ecf0f2fe40651107fa010aac0e629b5b39b9fd0
|
[
"Apache-2.0"
] | null | null | null |
central_server/api/__init__.py
|
BUPT-MAGA/central_server
|
1ecf0f2fe40651107fa010aac0e629b5b39b9fd0
|
[
"Apache-2.0"
] | null | null | null |
from .slave import *
from .center import *
| 14.333333
| 21
| 0.72093
| 6
| 43
| 5.166667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186047
| 43
| 2
| 22
| 21.5
| 0.885714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3d6635c1b708d3ff65f86496d48f99a81be56387
| 26
|
py
|
Python
|
pgdiff/__init__.py
|
Onapsis/pgdiff
|
ee9f618bc339cbfaf7967103e95f9650273550f8
|
[
"MIT"
] | 2
|
2020-05-11T16:42:48.000Z
|
2020-08-27T04:11:49.000Z
|
pgdiff/__init__.py
|
Onapsis/pgdiff
|
ee9f618bc339cbfaf7967103e95f9650273550f8
|
[
"MIT"
] | null | null | null |
pgdiff/__init__.py
|
Onapsis/pgdiff
|
ee9f618bc339cbfaf7967103e95f9650273550f8
|
[
"MIT"
] | null | null | null |
from .PgDiff import PgDiff
| 26
| 26
| 0.846154
| 4
| 26
| 5.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 26
| 1
| 26
| 26
| 0.956522
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3d79c8931a6751d9c17bc142d541b260dfec66ab
| 36
|
py
|
Python
|
lib/Importer.py
|
assemblical/qtcreator_settings_sync
|
db2232a771fcfa597da6304566b500a203cd03c7
|
[
"MIT"
] | 1
|
2016-06-15T14:43:35.000Z
|
2016-06-15T14:43:35.000Z
|
lib/Importer.py
|
assemblical/qtcreator_settings_sync
|
db2232a771fcfa597da6304566b500a203cd03c7
|
[
"MIT"
] | null | null | null |
lib/Importer.py
|
assemblical/qtcreator_settings_sync
|
db2232a771fcfa597da6304566b500a203cd03c7
|
[
"MIT"
] | null | null | null |
# imports settings from exported dir
| 36
| 36
| 0.833333
| 5
| 36
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.138889
| 36
| 1
| 36
| 36
| 0.967742
| 0.944444
| 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
|
3d8cad379a2adca59dc59c3998c836db427c501d
| 3,356
|
py
|
Python
|
XYZHubConnector/modules/loader/space_loader.py
|
hererucis/xyz-qgis-plugin
|
5e1bd3a7a64b0bec8e36264b109155f6d90e87ea
|
[
"MIT"
] | 1
|
2019-09-16T08:01:10.000Z
|
2019-09-16T08:01:10.000Z
|
XYZHubConnector/xyz_qgis/loader/space_loader.py
|
deeplook/xyz-qgis-plugin
|
37b7d84992155fe35d9578b58c9d74a198eccb40
|
[
"MIT"
] | null | null | null |
XYZHubConnector/xyz_qgis/loader/space_loader.py
|
deeplook/xyz-qgis-plugin
|
37b7d84992155fe35d9578b58c9d74a198eccb40
|
[
"MIT"
] | 1
|
2019-09-13T15:05:17.000Z
|
2019-09-13T15:05:17.000Z
|
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (c) 2019 HERE Europe B.V.
#
# SPDX-License-Identifier: MIT
# License-Filename: LICENSE
#
###############################################################################
from qgis.PyQt.QtCore import QThreadPool
from ..controller import ChainController, NetworkFun, WorkerFun
from ..network import net_handler
class LoadSpaceController(ChainController):
""" load space metadata (list space)
Args:
conn_info: token
"""
# Feature
def __init__(self, network):
super().__init__()
self.pool = QThreadPool() # .globalInstance() will crash afterward
self._config(network)
def start(self, conn_info):
super().start(conn_info)
def _config(self, network):
self.config_fun([
NetworkFun( network.list_spaces),
WorkerFun( net_handler.on_received, self.pool),
])
class StatSpaceController(ChainController):
""" get statistics of given space (count, byteSize, bbox)
Args:
conn_info: token
"""
# Feature
def __init__(self, network):
super().__init__()
self.pool = QThreadPool() # .globalInstance() will crash afterward
self._config(network)
def start(self, conn_info):
super().start(conn_info)
def _config(self, network):
self.config_fun([
NetworkFun( network.get_statistics),
# NetworkFun( network.get_count),
WorkerFun( net_handler.on_received, self.pool),
])
class DeleteSpaceController(ChainController):
""" Delete space
Args:
conn_info: token + space_id
"""
# Feature
def __init__(self, network):
super().__init__()
self.pool = QThreadPool() # .globalInstance() will crash afterward
self._config(network)
def start(self, conn_info):
super().start(conn_info)
def _config(self, network):
self.config_fun([
NetworkFun( network.del_space),
WorkerFun( net_handler.on_received, self.pool),
])
class EditSpaceController(ChainController):
""" Edit space metadata
Args:
conn_info: token + space_id
meta: new metadata/space_info (title, description)
"""
# Feature
def __init__(self, network):
super().__init__()
self.pool = QThreadPool() # .globalInstance() will crash afterward
self._config(network)
def start(self, conn_info, meta):
super().start(conn_info, meta)
def _config(self, network):
self.config_fun([
NetworkFun( network.edit_space),
WorkerFun( net_handler.on_received, self.pool),
])
class CreateSpaceController(ChainController):
""" Create new space
Args:
conn_info: token + space_id
meta: new metadata/space_info (title, description)
"""
def __init__(self, network):
super().__init__()
self.pool = QThreadPool() # .globalInstance() will crash afterward
self._config(network)
def start(self, conn_info, meta):
super().start(conn_info, meta)
def _config(self, network):
self.config_fun([
NetworkFun( network.add_space),
WorkerFun( net_handler.on_received, self.pool),
])
| 31.074074
| 79
| 0.596544
| 337
| 3,356
| 5.667656
| 0.222552
| 0.062827
| 0.031414
| 0.044503
| 0.722513
| 0.719895
| 0.719895
| 0.702094
| 0.636126
| 0.586911
| 0
| 0.001985
| 0.249404
| 3,356
| 107
| 80
| 31.364486
| 0.756252
| 0.234803
| 0
| 0.793651
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.238095
| false
| 0
| 0.047619
| 0
| 0.365079
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3db92b912a585cb9f17302bc6c10d4b58c5ce247
| 189
|
py
|
Python
|
src/__init__.py
|
vaklyuenkov/classification
|
e2c008d47b608aaea428f4944a130161bcde0d1b
|
[
"Apache-2.0"
] | null | null | null |
src/__init__.py
|
vaklyuenkov/classification
|
e2c008d47b608aaea428f4944a130161bcde0d1b
|
[
"Apache-2.0"
] | null | null | null |
src/__init__.py
|
vaklyuenkov/classification
|
e2c008d47b608aaea428f4944a130161bcde0d1b
|
[
"Apache-2.0"
] | null | null | null |
# flake8: noqa
from catalyst.dl import registry
from .experiment import Experiment
from .runner import ModelRunner as Runner
from .model import MultiHeadNet
registry.Model(MultiHeadNet)
| 18.9
| 41
| 0.820106
| 24
| 189
| 6.458333
| 0.541667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006098
| 0.132275
| 189
| 9
| 42
| 21
| 0.939024
| 0.063492
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.8
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
3dc12b281ce62b5f5649bf51e2c4c3d461be6879
| 104
|
py
|
Python
|
python/basic/importer.py
|
swenker/studio
|
298336a6327dbd3d496de6a9290d29ac8fe00514
|
[
"Apache-2.0"
] | 1
|
2015-02-05T09:05:01.000Z
|
2015-02-05T09:05:01.000Z
|
python/basic/importer.py
|
swenker/studio
|
298336a6327dbd3d496de6a9290d29ac8fe00514
|
[
"Apache-2.0"
] | null | null | null |
python/basic/importer.py
|
swenker/studio
|
298336a6327dbd3d496de6a9290d29ac8fe00514
|
[
"Apache-2.0"
] | null | null | null |
__author__ = 'samsung'
import importee
importee.init()
print importee.a
print importee._hide
| 11.555556
| 23
| 0.721154
| 12
| 104
| 5.833333
| 0.666667
| 0.371429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.201923
| 104
| 9
| 24
| 11.555556
| 0.843373
| 0
| 0
| 0
| 0
| 0
| 0.072165
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.8
| null | null | 0.4
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3de8c2d588150168ee192459aac90ac03ecee1ef
| 160
|
py
|
Python
|
source/device_manager/tests/discovery_test.py
|
ElsevierSoftwareX/SOFTX-D-21-00051
|
7ae5ad60971129286e2ee452a797c26810a9cb0f
|
[
"MIT"
] | null | null | null |
source/device_manager/tests/discovery_test.py
|
ElsevierSoftwareX/SOFTX-D-21-00051
|
7ae5ad60971129286e2ee452a797c26810a9cb0f
|
[
"MIT"
] | null | null | null |
source/device_manager/tests/discovery_test.py
|
ElsevierSoftwareX/SOFTX-D-21-00051
|
7ae5ad60971129286e2ee452a797c26810a9cb0f
|
[
"MIT"
] | null | null | null |
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
from source.device_manager.sila_auto_discovery.sila_auto_discovery import find
servers = find()
| 20
| 78
| 0.79375
| 25
| 160
| 4.88
| 0.64
| 0.131148
| 0.278689
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006897
| 0.09375
| 160
| 7
| 79
| 22.857143
| 0.834483
| 0
| 0
| 0
| 0
| 0
| 0.00625
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 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
|
9a8a1cd8b1db5a8cced377c0b4181ddbba1d6f56
| 80
|
py
|
Python
|
main.py
|
Halebane/Test_project
|
59d1c2a024cf9aae2b8e7d7517bc95ea19c952a1
|
[
"MIT"
] | null | null | null |
main.py
|
Halebane/Test_project
|
59d1c2a024cf9aae2b8e7d7517bc95ea19c952a1
|
[
"MIT"
] | 3
|
2022-02-21T11:15:15.000Z
|
2022-02-21T11:58:21.000Z
|
main.py
|
Halebane/Test_project
|
59d1c2a024cf9aae2b8e7d7517bc95ea19c952a1
|
[
"MIT"
] | null | null | null |
print('hi all')
print ('hello world')
print('hi')
print('hii')
print('hello2')
| 11.428571
| 21
| 0.6375
| 12
| 80
| 4.25
| 0.583333
| 0.27451
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014085
| 0.1125
| 80
| 7
| 22
| 11.428571
| 0.704225
| 0
| 0
| 0
| 0
| 0
| 0.345679
| 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
|
9a8e897e6d7b3113e34dcc478e5b70fc503a51f0
| 178
|
py
|
Python
|
tardis/rest/hash_credentials/__main__.py
|
maxfischer2781/tardis
|
a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5
|
[
"MIT"
] | 4
|
2018-05-22T13:22:06.000Z
|
2019-03-26T15:32:57.000Z
|
tardis/rest/hash_credentials/__main__.py
|
maxfischer2781/tardis
|
a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5
|
[
"MIT"
] | 50
|
2018-05-18T11:46:39.000Z
|
2019-04-26T07:29:45.000Z
|
tardis/rest/hash_credentials/__main__.py
|
maxfischer2781/tardis
|
a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5
|
[
"MIT"
] | 2
|
2018-12-12T13:15:59.000Z
|
2018-12-17T08:18:15.000Z
|
from .hash_credentials import hash_credentials
import typer
def hash_credentials_cli():
typer.run(hash_credentials)
if __name__ == "__main__":
hash_credentials_cli()
| 16.181818
| 46
| 0.775281
| 22
| 178
| 5.590909
| 0.5
| 0.609756
| 0.341463
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146067
| 178
| 10
| 47
| 17.8
| 0.809211
| 0
| 0
| 0
| 0
| 0
| 0.044944
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0.333333
| 0
| 0.5
| 0
| 1
| 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
| 0
| 0
|
0
| 5
|
9a95386feeb6320db7799b5536c7b621fb56e7bf
| 8,271
|
py
|
Python
|
database/migrations/0003_auto_20180320_2058.py
|
DMS-medical-informatics/beiwe-backend
|
55afe3a16e1c9b34501f3655288b5c19c663a083
|
[
"BSD-3-Clause"
] | 1
|
2019-09-26T04:00:55.000Z
|
2019-09-26T04:00:55.000Z
|
database/migrations/0003_auto_20180320_2058.py
|
DMS-medical-informatics/beiwe-backend
|
55afe3a16e1c9b34501f3655288b5c19c663a083
|
[
"BSD-3-Clause"
] | 2
|
2020-06-05T21:58:55.000Z
|
2021-06-10T21:45:08.000Z
|
database/migrations/0003_auto_20180320_2058.py
|
DMS-medical-informatics/beiwe-backend
|
55afe3a16e1c9b34501f3655288b5c19c663a083
|
[
"BSD-3-Clause"
] | 1
|
2019-09-26T03:55:06.000Z
|
2019-09-26T03:55:06.000Z
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-03-20 20:58
from __future__ import unicode_literals
import database.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('database', '0002_auto_20170923_1949'),
]
operations = [
migrations.CreateModel(
name='PipelineUpload',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted', models.BooleanField(default=False)),
('created_on', models.DateTimeField(auto_now_add=True)),
('last_updated', models.DateTimeField(auto_now=True)),
('object_id', models.CharField(max_length=24, unique=True, validators=[database.validators.LengthValidator(24)])),
('file_name', models.TextField()),
('s3_path', models.TextField()),
('file_hash', models.CharField(max_length=128)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='PipelineUploadTags',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted', models.BooleanField(default=False)),
('created_on', models.DateTimeField(auto_now_add=True)),
('last_updated', models.DateTimeField(auto_now=True)),
('tag', models.CharField(max_length=1024, validators=[database.validators.LengthValidator(1024)])),
('pipeline_upload', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tags', to='database.PipelineUpload')),
],
options={
'abstract': False,
},
),
migrations.AddField(
model_name='chunkregistry',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='chunkregistry',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='decryptionkeyerror',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='decryptionkeyerror',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='devicesettings',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='devicesettings',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='encryptionerrormetadata',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='encryptionerrormetadata',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='fileprocesslock',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='fileprocesslock',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='filetoprocess',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='filetoprocess',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='lineencryptionerror',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='lineencryptionerror',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='participant',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='participant',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='researcher',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='researcher',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='study',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='study',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='survey',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='survey',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='surveyarchive',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='surveyarchive',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='uploadtracking',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='uploadtracking',
name='last_updated',
field=models.DateTimeField(auto_now=True),
),
migrations.AlterField(
model_name='chunkregistry',
name='data_type',
field=models.CharField(choices=[(b'accelerometer', b'accelerometer'), (b'bluetooth', b'bluetooth'), (b'calls', b'calls'), (b'gps', b'gps'), (b'identifiers', b'identifiers'), (b'app_log', b'app_log'), (b'power_state', b'power_state'), (b'survey_answers', b'survey_answers'), (b'survey_timings', b'survey_timings'), (b'texts', b'texts'), (b'audio_recordings', b'audio_recordings'), (b'wifi', b'wifi'), (b'proximity', b'proximity'), (b'gyro', b'gyro'), (b'magnetometer', b'magnetometer'), (b'devicemotion', b'devicemotion'), (b'reachability', b'reachability'), (b'ios_log', b'ios_log')], max_length=32),
),
migrations.AddField(
model_name='pipelineupload',
name='study',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pipeline_uploads', to='database.Study'),
),
]
| 40.945545
| 612
| 0.592431
| 794
| 8,271
| 5.973552
| 0.15995
| 0.120177
| 0.145478
| 0.164453
| 0.753953
| 0.746574
| 0.678684
| 0.666456
| 0.666456
| 0.666456
| 0
| 0.008613
| 0.284125
| 8,271
| 201
| 613
| 41.149254
| 0.792434
| 0.008222
| 0
| 0.860825
| 1
| 0
| 0.154268
| 0.01122
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.025773
| 0
| 0.041237
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9ab669bff52da3b542216fac3731e365198d8ddc
| 51
|
py
|
Python
|
gym_cityflow/envs/__init__.py
|
MaxVanDijck/gym-cityflow
|
628ea37e48a3f639970801d22fe1d844a21ebc99
|
[
"MIT"
] | 1
|
2021-08-04T21:40:53.000Z
|
2021-08-04T21:40:53.000Z
|
gym_cityflow/envs/__init__.py
|
MaxVanDijck/gym-cityflow
|
628ea37e48a3f639970801d22fe1d844a21ebc99
|
[
"MIT"
] | null | null | null |
gym_cityflow/envs/__init__.py
|
MaxVanDijck/gym-cityflow
|
628ea37e48a3f639970801d22fe1d844a21ebc99
|
[
"MIT"
] | null | null | null |
from gym_cityflow.envs.cityflow_env import Cityflow
| 51
| 51
| 0.901961
| 8
| 51
| 5.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 51
| 1
| 51
| 51
| 0.916667
| 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
|
9af2b0d5427f96e4f65518472ab8bed7816bc20b
| 76
|
py
|
Python
|
app/handlers/__init__.py
|
akrisanov/dataset-catalog
|
fa55ae2097dfd10f89021971ae9b14c830990c47
|
[
"MIT"
] | null | null | null |
app/handlers/__init__.py
|
akrisanov/dataset-catalog
|
fa55ae2097dfd10f89021971ae9b14c830990c47
|
[
"MIT"
] | null | null | null |
app/handlers/__init__.py
|
akrisanov/dataset-catalog
|
fa55ae2097dfd10f89021971ae9b14c830990c47
|
[
"MIT"
] | null | null | null |
from .datasets import datasets_router
from .services import services_router
| 25.333333
| 37
| 0.868421
| 10
| 76
| 6.4
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 76
| 2
| 38
| 38
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b106993c0fc1404973a1c88f9f6016da9a468c68
| 404
|
py
|
Python
|
src/affe/utils.py
|
eliavw/affe
|
0e57d7f40cb67f9a300292e03e3f83b4b591d1e3
|
[
"MIT"
] | 1
|
2020-12-02T06:16:00.000Z
|
2020-12-02T06:16:00.000Z
|
src/affe/utils.py
|
eliavw/affe
|
0e57d7f40cb67f9a300292e03e3f83b4b591d1e3
|
[
"MIT"
] | null | null | null |
src/affe/utils.py
|
eliavw/affe
|
0e57d7f40cb67f9a300292e03e3f83b4b591d1e3
|
[
"MIT"
] | null | null | null |
import pandas as pd
from .io.CTE import KEYCHAIN_SEPARATOR
VERBOSITY = 1
def flatten_dict(d, separator=KEYCHAIN_SEPARATOR):
return pd.json_normalize(d, sep=separator).to_dict(orient="records").pop()
def keychain(*args, separator=KEYCHAIN_SEPARATOR):
return separator.join(args)
def debug_print(msg, level=1, V=VERBOSITY, **kwargs):
if V >= level:
print(msg + "\n")
return
| 20.2
| 78
| 0.710396
| 57
| 404
| 4.912281
| 0.578947
| 0.182143
| 0.185714
| 0.228571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005935
| 0.165842
| 404
| 19
| 79
| 21.263158
| 0.824926
| 0
| 0
| 0
| 0
| 0
| 0.022277
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0
| 0.181818
| 0.181818
| 0.727273
| 0.181818
| 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
|
b1240c319b7a8d48c0e54b56aff10d9f2a38bb86
| 2,489
|
py
|
Python
|
pyosim/static_optimization.py
|
sbourdon/pyosim
|
ce941432d47352c59eddf13f4ee949cca5cec60f
|
[
"Apache-2.0"
] | 15
|
2018-05-26T00:07:57.000Z
|
2021-12-16T01:06:29.000Z
|
pyosim/static_optimization.py
|
sbourdon/pyosim
|
ce941432d47352c59eddf13f4ee949cca5cec60f
|
[
"Apache-2.0"
] | 18
|
2018-04-05T13:59:55.000Z
|
2020-12-24T16:42:38.000Z
|
pyosim/static_optimization.py
|
pyomeca/pyosim
|
84b418ba276a9e5c499c44acd3fc4531103ad6c0
|
[
"Apache-2.0"
] | 9
|
2018-10-10T11:30:49.000Z
|
2021-08-17T20:03:40.000Z
|
"""
Static optimization class in pyosim
"""
from pyosim import AnalyzeTool
class StaticOptimization(AnalyzeTool):
"""
Static Optimization in pyosim
Parameters
----------
model_input : str
Path to the osim model
xml_input : str
Path to the generic so xml
xml_output : str
Output path of the so xml
xml_forces : str, optional
Path to the generic forces sensor xml (Optional)
ext_forces_dir : str, optional
Path of the directory containing the external forces files (`.sto`) (Optional)
muscle_forces_dir : str, optional
Path of the directory containing the muscle forces files (`.sto`) (Optional)
mot_files : str, Path, list
Path or list of path to the directory containing the motion files (`.mot`)
sto_output : Path, str
Output directory
xml_actuators: Path, str
Actuators (Optional)
prefix : str, optional
Optional prefix to put in front of the output filename (typically model name) (Optional)
low_pass : int, optional
Cutoff frequency for an optional low pass filter on coordinates (Optional)
remove_empty_files : bool, optional
remove empty files i in `sto_output` if True (Optional)
Examples
--------
>>> from pathlib import Path
>>>
>>> from pyosim import StaticOptimization
>>>
>>> PROJECT_PATH = Path('../Misc/project_sample')
>>> TEMPLATES_PATH = PROJECT_PATH / '_templates'
>>>
>>> participant = 'dapo'
>>> model = 'wu'
>>> trials = [ifile for ifile in (PROJECT_PATH / participant / '1_inverse_kinematic').glob('*.mot')]
>>>
>>> path_kwargs = {
>>> 'model_input': f"{(PROJECT_PATH / participant / '_models' / model).resolve()}_scaled_markers.osim",
>>> 'xml_input': f"{(TEMPLATES_PATH / model).resolve()}_so.xml",
>>> 'xml_output': f"{(PROJECT_PATH / participant / '_xml' / model).resolve()}_so.xml",
>>> 'xml_forces': f"{(TEMPLATES_PATH / 'forces_sensor.xml').resolve()}",
>>> 'xml_actuators': f"{(TEMPLATES_PATH / f'{model}_actuators.xml').resolve()}",
>>> 'ext_forces_dir': f"{(PROJECT_PATH / participant / '0_forces').resolve()}",
>>> 'sto_output': f"{(PROJECT_PATH / participant / '3_static_optimization').resolve()}",
>>> }
>>>
>>> StaticOptimization(
>>> **path_kwargs,
>>> mot_files=trials,
>>> prefix=model,
>>> low_pass=5
>>> )
"""
pass
| 35.557143
| 111
| 0.618321
| 286
| 2,489
| 5.195804
| 0.293706
| 0.051817
| 0.074024
| 0.061911
| 0.15747
| 0.068641
| 0.068641
| 0.068641
| 0.068641
| 0.068641
| 0
| 0.002129
| 0.245078
| 2,489
| 69
| 112
| 36.072464
| 0.788717
| 0.867015
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
b132a76689c95943a16253a38adba50636d09361
| 40
|
py
|
Python
|
test.py
|
ekutlu/raspberry-test
|
fc7a1f74764dc420f263de83b2eeb83110aff230
|
[
"MIT"
] | null | null | null |
test.py
|
ekutlu/raspberry-test
|
fc7a1f74764dc420f263de83b2eeb83110aff230
|
[
"MIT"
] | null | null | null |
test.py
|
ekutlu/raspberry-test
|
fc7a1f74764dc420f263de83b2eeb83110aff230
|
[
"MIT"
] | null | null | null |
__author__ = 'emre'
print "hello world"
| 13.333333
| 19
| 0.725
| 5
| 40
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 40
| 3
| 20
| 13.333333
| 0.735294
| 0
| 0
| 0
| 0
| 0
| 0.365854
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
b15686a64ddc5595d5b6bb95bf98a952650e456b
| 156
|
py
|
Python
|
cogs/utils/apis.py
|
bsquidwrd/Live-Bot
|
f28f028ddc371b86e19df6f603aa3b14bab93533
|
[
"MIT"
] | 1
|
2019-02-27T10:38:46.000Z
|
2019-02-27T10:38:46.000Z
|
cogs/utils/apis.py
|
bsquidwrd/Live-Bot
|
f28f028ddc371b86e19df6f603aa3b14bab93533
|
[
"MIT"
] | 21
|
2017-08-03T01:01:31.000Z
|
2020-06-05T18:02:20.000Z
|
cogs/utils/apis.py
|
bsquidwrd/Live-Bot
|
f28f028ddc371b86e19df6f603aa3b14bab93533
|
[
"MIT"
] | null | null | null |
class StreamAPI(object):
'https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=[ChannelID]&type=video&eventType=live&key=[API_KEY]'
| 39
| 125
| 0.75
| 21
| 156
| 5.52381
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006944
| 0.076923
| 156
| 3
| 126
| 52
| 0.798611
| 0.762821
| 0
| 0
| 0
| 0.5
| 0.762821
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b167579d44e76ef6cc1304432155211f1599a334
| 30
|
py
|
Python
|
build/v0.2.1/index.py
|
ryantwt07/Python-Math-Library
|
8320a73baf139e7ac0ba87ddcfa410af0dac8631
|
[
"MIT"
] | null | null | null |
build/v0.2.1/index.py
|
ryantwt07/Python-Math-Library
|
8320a73baf139e7ac0ba87ddcfa410af0dac8631
|
[
"MIT"
] | null | null | null |
build/v0.2.1/index.py
|
ryantwt07/Python-Math-Library
|
8320a73baf139e7ac0ba87ddcfa410af0dac8631
|
[
"MIT"
] | null | null | null |
from lib import user
user()
| 6
| 20
| 0.7
| 5
| 30
| 4.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.233333
| 30
| 4
| 21
| 7.5
| 0.913043
| 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
|
b16da500a0f59e2f32cf245b40e907dc9eed5fd3
| 8,980
|
py
|
Python
|
tests/functional/test_queryset.py
|
timgates42/pyeqs
|
2e385c0a5d113af0e20be4d9393add2aabdd9565
|
[
"MIT"
] | null | null | null |
tests/functional/test_queryset.py
|
timgates42/pyeqs
|
2e385c0a5d113af0e20be4d9393add2aabdd9565
|
[
"MIT"
] | null | null | null |
tests/functional/test_queryset.py
|
timgates42/pyeqs
|
2e385c0a5d113af0e20be4d9393add2aabdd9565
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sure import scenario
from pyeqs import QuerySet
from pyeqs.dsl import Term, ScriptScore, Sort
from tests.helpers import prepare_data, cleanup_data, add_document
@scenario(prepare_data, cleanup_data)
def test_simple_search(context):
"""
Search with match_all query
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": "baz"})
# And I do a search
results = t[0:1]
# Then I get a the expected results
len(results).should.equal(1)
results[0]['_source'].should.equal({"bar": "baz"})
@scenario(prepare_data, cleanup_data)
def test_string_search(context):
"""
Search with string query
"""
# When create a queryset
t = QuerySet("localhost", query="cheese", index="foo")
# And there are records
add_document("foo", {"bar": "banana"})
add_document("foo", {"bar": "cheese"})
# And I do a search
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(1)
results[0]['_source'].should.equal({"bar": "cheese"})
@scenario(prepare_data, cleanup_data)
def test_search_with_filter(context):
"""
Search with match_all query and filter
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": "baz"})
add_document("foo", {"bar": "bazbaz"})
# And I do a search
t.filter(Term("bar", "baz"))
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(1)
results[0]['_source'].should.equal({"bar": "baz"})
@scenario(prepare_data, cleanup_data)
def test_search_with_filter_and_scoring(context):
"""
Search with match_all query, filter and scoring
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": "baz", "scoring_field": 1})
add_document("foo", {"bar": "baz", "scoring_field": 2})
add_document("foo", {"bar": "bazbaz", "scoring_field": 3})
# And I do a search
t.filter(Term("bar", "baz"))
score = ScriptScore("final_score = 0 + doc['scoring_field'].value;")
t.score(score)
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(2)
results[0]['_source'].should.equal({"bar": "baz", "scoring_field": 2})
results[1]['_source'].should.equal({"bar": "baz", "scoring_field": 1})
@scenario(prepare_data, cleanup_data)
def test_search_with_scoring_min_score_and_track_scores(context):
"""
Search with match_all query and scoring with min_score and track_scores
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": "baz", "scoring_field": 1})
add_document("foo", {"bar": "baz", "scoring_field": 2})
add_document("foo", {"bar": "baz", "scoring_field": 3})
# And I do a search
score = ScriptScore("final_score = 0 + doc['scoring_field'].value;")
t.score(score, min_score=2, track_scores=True)
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(2)
results[0]['_source'].should.equal({"bar": "baz", "scoring_field": 3})
results[1]['_source'].should.equal({"bar": "baz", "scoring_field": 2})
@scenario(prepare_data, cleanup_data)
def test_search_with_filter_and_scoring_and_sorting(context):
"""
Search with match_all query, filter, scoring, and sorting
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": "baz", "scoring_field": 0, "sorting_field": 30})
add_document("foo", {"bar": "baz", "scoring_field": 1, "sorting_field": 20})
add_document("foo", {"bar": "baz", "scoring_field": 2, "sorting_field": 10})
add_document("foo", {"bar": "bazbaz", "scoring_field": 3, "sorting_field": 0})
# And I do a search
t.filter(Term("bar", "baz"))
score = ScriptScore("final_score = 0 + doc['scoring_field'].value;")
t.score(score)
sorting = Sort("sorting_field", order="desc")
t.order_by(sorting)
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(3)
results[0]['_source'].should.equal({"bar": "baz", "scoring_field": 0, "sorting_field": 30})
results[1]['_source'].should.equal({"bar": "baz", "scoring_field": 1, "sorting_field": 20})
results[2]['_source'].should.equal({"bar": "baz", "scoring_field": 2, "sorting_field": 10})
@scenario(prepare_data, cleanup_data)
def test_search_with_filter_and_scoring_and_sorting_and_fields(context):
"""
Search with match_all query, filter, scoring, sorting, and fields
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": "baz", "scoring_field": 0, "sorting_field": 30})
add_document("foo", {"bar": "baz", "scoring_field": 1, "sorting_field": 20})
add_document("foo", {"bar": "baz", "scoring_field": 2, "sorting_field": 10})
add_document("foo", {"bar": "bazbaz", "scoring_field": 3, "sorting_field": 0})
# And I do a search
t.filter(Term("bar", "baz"))
score = ScriptScore("final_score = 0 + doc['scoring_field'].value;")
t.score(score)
sorting = Sort("sorting_field", order="desc")
t.order_by(sorting)
t.only(["bar"])
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(3)
results[0]['fields'].should.equal({"bar": ["baz"]})
results[1]['fields'].should.equal({"bar": ["baz"]})
results[2]['fields'].should.equal({"bar": ["baz"]})
@scenario(prepare_data, cleanup_data)
def test_wrappers(context):
"""
Search with wrapped match_all query
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": 1})
add_document("foo", {"bar": 2})
add_document("foo", {"bar": 3})
# And I do a search
def wrapper_function(search_results):
return list(map(lambda x: x['_source']['bar'] + 1, search_results))
t.wrappers(wrapper_function)
t.order_by(Sort("bar", order="asc"))
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(3)
results[0].should.equal(2)
results[1].should.equal(3)
results[2].should.equal(4)
@scenario(prepare_data, cleanup_data)
def test_search_as_queryset_with_filter(context):
"""
Search with match_all query and filter on a cloned queryset
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": "baz"})
add_document("foo", {"bar": "bazbaz"})
# And I do a filter on my new object
my_search = t.objects.filter(Term("bar", "baz"))
# And a different filter on my old object
t.filter(Term("bar", "bazbaz"))
# And I do a search
results = my_search[0:10]
# Then I get a the expected results
len(results).should.equal(1)
results[0]['_source'].should.equal({"bar": "baz"})
@scenario(prepare_data, cleanup_data)
def test_search_with_iterator(context):
"""
Search using an iterator
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And set iterator fetching to a small size
t._per_request = 2
# And there are records
add_document("foo", {"bar": 0})
add_document("foo", {"bar": 1})
add_document("foo", {"bar": 2})
add_document("foo", {"bar": 3})
add_document("foo", {"bar": 4})
# And I do a filter on my new object
# And a different filter on my old object
t.order_by(Sort("bar", order="asc"))
# Then I get the expected results
for (counter, result) in enumerate(t):
result['_source'].should.equal({"bar": counter})
len(t).should.equal(5)
t.count().should.equal(5)
t.max_score().should_not.be(None)
@scenario(prepare_data, cleanup_data)
def test_post_query_actions(context):
"""
Search with match_all query with post query actions
"""
# When create a queryset
t = QuerySet("localhost", index="foo")
# And there are records
add_document("foo", {"bar": 1})
add_document("foo", {"bar": 2})
add_document("foo", {"bar": 3})
# And I have a post query action
global my_global_var
my_global_var = 1
def action(self, results, start, stop):
global my_global_var
my_global_var += 1
t.post_query_actions(action)
# And I do a search
t.order_by(Sort("bar", order="asc"))
results = t[0:10]
# Then I get a the expected results
len(results).should.equal(3)
results[0]["_source"]["bar"].should.equal(1)
results[1]["_source"]["bar"].should.equal(2)
results[2]["_source"]["bar"].should.equal(3)
my_global_var.should.equal(2)
| 30.23569
| 95
| 0.638864
| 1,273
| 8,980
| 4.343284
| 0.105263
| 0.067643
| 0.081027
| 0.09839
| 0.803943
| 0.794719
| 0.770121
| 0.735757
| 0.658889
| 0.617291
| 0
| 0.018003
| 0.19588
| 8,980
| 296
| 96
| 30.337838
| 0.74768
| 0.200557
| 0
| 0.594595
| 0
| 0
| 0.191844
| 0.015508
| 0
| 0
| 0
| 0
| 0
| 1
| 0.087838
| false
| 0
| 0.033784
| 0.006757
| 0.128378
| 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
|
b176a4acfa779ba34ebaa05209449e9361e85220
| 68
|
py
|
Python
|
src/vocles/__init__.py
|
NickleDave/vocles
|
897cff032af845b0a49af4a0bfdd1a3195b677a9
|
[
"BSD-3-Clause"
] | 2
|
2022-01-17T14:43:38.000Z
|
2022-01-17T14:52:14.000Z
|
src/vocles/__init__.py
|
NickleDave/vocles
|
897cff032af845b0a49af4a0bfdd1a3195b677a9
|
[
"BSD-3-Clause"
] | 2
|
2022-01-18T13:54:17.000Z
|
2022-01-21T13:41:02.000Z
|
src/vocles/__init__.py
|
NickleDave/vocles
|
897cff032af845b0a49af4a0bfdd1a3195b677a9
|
[
"BSD-3-Clause"
] | 2
|
2022-02-12T13:48:51.000Z
|
2022-03-27T20:55:01.000Z
|
from .dataset import Dataset
from .vocalization import Vocalization
| 22.666667
| 38
| 0.852941
| 8
| 68
| 7.25
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 68
| 2
| 39
| 34
| 0.966667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 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
|
b1ab9fa9f5853d9e340df459d69cc78822aec02b
| 156
|
py
|
Python
|
boa3/model/builtin/interop/nativecontract/__init__.py
|
DanPopa46/neo3-boa
|
e4ef340744b5bd25ade26f847eac50789b97f3e9
|
[
"Apache-2.0"
] | null | null | null |
boa3/model/builtin/interop/nativecontract/__init__.py
|
DanPopa46/neo3-boa
|
e4ef340744b5bd25ade26f847eac50789b97f3e9
|
[
"Apache-2.0"
] | null | null | null |
boa3/model/builtin/interop/nativecontract/__init__.py
|
DanPopa46/neo3-boa
|
e4ef340744b5bd25ade26f847eac50789b97f3e9
|
[
"Apache-2.0"
] | null | null | null |
from .CryptoLib import CryptoLibContract, CryptoLibMethod
from .Oracle import OracleContract, OracleMethod
from .StdLib import StdLibContract, StdLibMethod
| 39
| 57
| 0.865385
| 15
| 156
| 9
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096154
| 156
| 3
| 58
| 52
| 0.957447
| 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
|
491dbf0d7ef595d9a7c58d13db06954d39c0efcd
| 352
|
py
|
Python
|
tests/entities/test_utils.py
|
Ahmed-Khaled-dev/modern-meerkats
|
e54304303c77928a2566f4e4c3eefb98135acfc7
|
[
"MIT"
] | 1
|
2022-01-07T02:38:08.000Z
|
2022-01-07T02:38:08.000Z
|
tests/entities/test_utils.py
|
Ahmed-Khaled-dev/modern-meerkats
|
e54304303c77928a2566f4e4c3eefb98135acfc7
|
[
"MIT"
] | null | null | null |
tests/entities/test_utils.py
|
Ahmed-Khaled-dev/modern-meerkats
|
e54304303c77928a2566f4e4c3eefb98135acfc7
|
[
"MIT"
] | null | null | null |
from app.entities.utils import get_loop_time
def test_get_loop_time_returns_correct_time_value():
assert get_loop_time(2, 0) == 0
assert get_loop_time(2, 1) == 1
assert get_loop_time(2, 2) == 2
assert get_loop_time(2, 3) == 1
assert get_loop_time(2, 4) == 0
assert get_loop_time(2, 5) == 1
assert get_loop_time(2, 6) == 2
| 29.333333
| 52
| 0.684659
| 66
| 352
| 3.30303
| 0.318182
| 0.288991
| 0.454128
| 0.545872
| 0.600917
| 0.43578
| 0
| 0
| 0
| 0
| 0
| 0.074733
| 0.201705
| 352
| 11
| 53
| 32
| 0.701068
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.777778
| 1
| 0.111111
| true
| 0
| 0.111111
| 0
| 0.222222
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
49823128dee59beea8d63777374e377511f9e211
| 95
|
py
|
Python
|
django_cradmin/apps/django_cradmin_js/__init__.py
|
appressoas/django_cradmin
|
0f8715afdfe1ad32e46033f442e622aecf6a4dec
|
[
"BSD-3-Clause"
] | 11
|
2015-07-05T16:57:58.000Z
|
2020-11-24T16:58:19.000Z
|
django_cradmin/apps/django_cradmin_js/__init__.py
|
appressoas/django_cradmin
|
0f8715afdfe1ad32e46033f442e622aecf6a4dec
|
[
"BSD-3-Clause"
] | 91
|
2015-01-08T22:38:13.000Z
|
2022-02-10T10:25:27.000Z
|
django_cradmin/apps/django_cradmin_js/__init__.py
|
appressoas/django_cradmin
|
0f8715afdfe1ad32e46033f442e622aecf6a4dec
|
[
"BSD-3-Clause"
] | 3
|
2016-12-07T12:19:24.000Z
|
2018-10-03T14:04:18.000Z
|
# default_app_config = 'django_cradmin.apps.django_cradmin_js.apps.CradminJavascriptAppConfig'
| 47.5
| 94
| 0.873684
| 11
| 95
| 7.090909
| 0.727273
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042105
| 95
| 1
| 95
| 95
| 0.857143
| 0.968421
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 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
|
498b4db11b552f569d933b36e07f6aa906a8d8e7
| 101
|
py
|
Python
|
bots/__init__.py
|
mscroggs/MENACEpy
|
62adeb369b849bf0a067f7a0754995737b5cea86
|
[
"MIT"
] | 2
|
2018-03-28T16:22:59.000Z
|
2020-01-08T16:02:29.000Z
|
bots/__init__.py
|
mscroggs/MENACEpy
|
62adeb369b849bf0a067f7a0754995737b5cea86
|
[
"MIT"
] | null | null | null |
bots/__init__.py
|
mscroggs/MENACEpy
|
62adeb369b849bf0a067f7a0754995737b5cea86
|
[
"MIT"
] | 1
|
2020-07-17T02:43:54.000Z
|
2020-07-17T02:43:54.000Z
|
from .rando import Rando
from .humans import QuiteGood, Good
from .menace_killer import MenaceKiller
| 25.25
| 39
| 0.831683
| 14
| 101
| 5.928571
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128713
| 101
| 3
| 40
| 33.666667
| 0.943182
| 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
|
499bd2618b50afffd169f9549fcdd2132d8e2372
| 363
|
py
|
Python
|
examples/pipelayer_microservice/src/service/config/app_settings_factory.py
|
greater-than/PipeLayer
|
569f43b65992f8a32079835585b864d5fe0bb251
|
[
"BSD-2-Clause"
] | 61
|
2021-02-03T02:54:18.000Z
|
2021-12-26T11:38:51.000Z
|
examples/pipelayer_microservice/src/service/config/app_settings_factory.py
|
greater-than/PipeLayer
|
569f43b65992f8a32079835585b864d5fe0bb251
|
[
"BSD-2-Clause"
] | 1
|
2021-02-16T13:58:33.000Z
|
2021-02-18T12:56:32.000Z
|
examples/pipelayer_microservice/src/service/config/app_settings_factory.py
|
greater-than/PipeLayer
|
569f43b65992f8a32079835585b864d5fe0bb251
|
[
"BSD-2-Clause"
] | null | null | null |
from typing import Any, Optional
from pipelayer._patch.typing import Protocol
from service.config.app_settings import AppSettings
class ISettingsProvider(Protocol):
def get(*args) -> Any:
pass
def create(provider: Optional[ISettingsProvider] = None) -> AppSettings:
return AppSettings.parse_obj(provider.get()) if provider else AppSettings()
| 25.928571
| 79
| 0.76584
| 43
| 363
| 6.395349
| 0.627907
| 0.087273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14876
| 363
| 13
| 80
| 27.923077
| 0.889968
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.125
| 0.375
| 0.125
| 0.875
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 1
| 1
| 0
|
0
| 5
|
b8c6e276c0543cc99e6dbaa57daeca5daee94dd3
| 394
|
py
|
Python
|
scrapyproject/models/__init__.py
|
gas1121/JapanCinemaStatusSpider
|
67c7b963914565589f64dd1bcf18839a4160ea34
|
[
"MIT"
] | 2
|
2018-06-07T13:28:03.000Z
|
2018-12-10T14:04:53.000Z
|
scrapyproject/models/__init__.py
|
gas1121/JapanCinemaStatusSpider
|
67c7b963914565589f64dd1bcf18839a4160ea34
|
[
"MIT"
] | null | null | null |
scrapyproject/models/__init__.py
|
gas1121/JapanCinemaStatusSpider
|
67c7b963914565589f64dd1bcf18839a4160ea34
|
[
"MIT"
] | null | null | null |
"""
Persist level for JapanCinemaStatusSpider
"""
from scrapyproject.models.models import (create_table, drop_table_if_exist,
db_connect, Session)
from scrapyproject.models.cinema import Cinema
from scrapyproject.models.showing import Showing
from scrapyproject.models.showing_booking import ShowingBooking
from scrapyproject.models.movie import Movie
| 35.818182
| 75
| 0.766497
| 43
| 394
| 6.883721
| 0.488372
| 0.287162
| 0.388514
| 0.202703
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180203
| 394
| 10
| 76
| 39.4
| 0.916409
| 0.104061
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.833333
| 0
| 0.833333
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
b8f75b0025952cb1437d9c6ff962b821d5cc0ac8
| 51
|
py
|
Python
|
motionsaver/__init__.py
|
takeontom/motion-saver
|
743186dfb5c766a064d7892b54e82b08bfbbc657
|
[
"MIT"
] | null | null | null |
motionsaver/__init__.py
|
takeontom/motion-saver
|
743186dfb5c766a064d7892b54e82b08bfbbc657
|
[
"MIT"
] | 5
|
2021-03-18T20:44:06.000Z
|
2022-03-11T23:26:32.000Z
|
motionsaver/__init__.py
|
takeontom/motion-saver
|
743186dfb5c766a064d7892b54e82b08bfbbc657
|
[
"MIT"
] | null | null | null |
from .motionsaver import MotionSaver # noqa: F401
| 25.5
| 50
| 0.784314
| 6
| 51
| 6.666667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.069767
| 0.156863
| 51
| 1
| 51
| 51
| 0.860465
| 0.196078
| 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
|
7726f0ebd39f8eb5ff833acab30ad9291922372b
| 227
|
py
|
Python
|
syft/federated/__init__.py
|
abdulrahmanmazhar/PySyft
|
dc0ba29df83de3bd0cf59956b433b418a9731baa
|
[
"Apache-2.0"
] | null | null | null |
syft/federated/__init__.py
|
abdulrahmanmazhar/PySyft
|
dc0ba29df83de3bd0cf59956b433b418a9731baa
|
[
"Apache-2.0"
] | 1
|
2019-06-05T14:19:07.000Z
|
2019-06-05T14:19:07.000Z
|
syft/federated/__init__.py
|
abmazhr/PySyft
|
dc0ba29df83de3bd0cf59956b433b418a9731baa
|
[
"Apache-2.0"
] | null | null | null |
from syft.federated.plan import Plan
from syft.federated.plan import func2plan
from syft.federated.plan import method2plan
from syft.federated.plan import make_plan
__all__ = ["Plan", "func2plan", "method2plan", "make_plan"]
| 28.375
| 59
| 0.797357
| 31
| 227
| 5.645161
| 0.290323
| 0.182857
| 0.388571
| 0.48
| 0.617143
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019704
| 0.105727
| 227
| 7
| 60
| 32.428571
| 0.842365
| 0
| 0
| 0
| 0
| 0
| 0.145374
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.8
| 0
| 0.8
| 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
|
772a75ab91757daebdd45b62ba757b5e7b491643
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/setuptools/_deprecation_warning.py
|
Retraces/UkraineBot
|
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/setuptools/_deprecation_warning.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/setuptools/_deprecation_warning.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/8d/4f/7e/76d7efe9c2a6b5024e5cdf273f59a6ee038dc3990a12d88fb5bc276722
| 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
|
77555cff7b1671ec1f5d37ac5180262645dc8ba3
| 1,880
|
py
|
Python
|
test-http/src/test/cve_tests/cve_as_org_admin.py
|
cristina479/cve-services
|
16794c7e04d7385ab0493bc9f838526c1401424d
|
[
"CC0-1.0"
] | null | null | null |
test-http/src/test/cve_tests/cve_as_org_admin.py
|
cristina479/cve-services
|
16794c7e04d7385ab0493bc9f838526c1401424d
|
[
"CC0-1.0"
] | 16
|
2021-05-14T23:52:16.000Z
|
2022-03-29T22:14:29.000Z
|
test-http/src/test/cve_tests/cve_as_org_admin.py
|
cristina479/cve-services
|
16794c7e04d7385ab0493bc9f838526c1401424d
|
[
"CC0-1.0"
] | null | null | null |
import json
import requests
from src import env
from src.utils import response_contains_json
CVE_URL = '/api/cve'
cve_id = 'CVE-1999-0001'
update_cve_id = create_cve_id = 'CVE-2000-0008'
#### GET /cve ####
def test_get_all_cves(org_admin_headers):
""" services api rejects requests for admin orgs """
res = requests.get(
f'{env.AWG_BASE_URL}{CVE_URL}/',
headers=org_admin_headers
)
assert res.status_code == 403
response_contains_json(res, 'error', 'SECRETARIAT_ONLY')
#### GET /cve/:id ####
def test_get_cve(org_admin_headers):
""" services api rejects requests for admin orgs """
res = requests.get(
f'{env.AWG_BASE_URL}{CVE_URL}/{cve_id}',
headers=org_admin_headers
)
assert res.status_code == 403
response_contains_json(res, 'error', 'SECRETARIAT_ONLY')
#### POST /cve/:id ####
def test_create_cve(org_admin_headers):
""" services api rejects requests for admin orgs """
with open('./src/test/cve_tests/cve_record_fixtures/CVE-2000-0008_public.json') as json_file:
data = json.load(json_file)
res = requests.post(
f'{env.AWG_BASE_URL}{CVE_URL}/{create_cve_id}',
headers=org_admin_headers,
json=data
)
assert res.status_code == 403
response_contains_json(res, 'error', 'SECRETARIAT_ONLY')
#### PUT /cve/:id ####
def test_update_cve_record(org_admin_headers):
""" services api rejects requests for admin orgs """
with open('./src/test/cve_tests/cve_record_fixtures/CVE-2000-0008_public.json') as json_file:
data = json.load(json_file)
res = requests.put(
f'{env.AWG_BASE_URL}{CVE_URL}/{update_cve_id}',
headers=org_admin_headers,
json=data
)
assert res.status_code == 403
response_contains_json(res, 'error', 'SECRETARIAT_ONLY')
| 31.864407
| 97
| 0.659043
| 262
| 1,880
| 4.427481
| 0.206107
| 0.038793
| 0.103448
| 0.07931
| 0.783621
| 0.783621
| 0.77931
| 0.744828
| 0.744828
| 0.744828
| 0
| 0.02973
| 0.212766
| 1,880
| 58
| 98
| 32.413793
| 0.754054
| 0.125532
| 0
| 0.487805
| 0
| 0
| 0.252048
| 0.177694
| 0
| 0
| 0
| 0
| 0.097561
| 1
| 0.097561
| false
| 0
| 0.097561
| 0
| 0.195122
| 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
|
620b3979b51a5f0c6be27adac0783dcff77e73dc
| 715
|
py
|
Python
|
COMP0016_2020_21_Team12-datasetsExperimentsAna/pwa/FADapp/pythonScripts/venv/Lib/site-packages/numpy/typing/tests/data/reveal/modules.py
|
anzhao920/MicrosoftProject15_Invictus
|
15f44eebb09561acbbe7b6730dfadf141e4c166d
|
[
"MIT"
] | null | null | null |
COMP0016_2020_21_Team12-datasetsExperimentsAna/pwa/FADapp/pythonScripts/venv/Lib/site-packages/numpy/typing/tests/data/reveal/modules.py
|
anzhao920/MicrosoftProject15_Invictus
|
15f44eebb09561acbbe7b6730dfadf141e4c166d
|
[
"MIT"
] | null | null | null |
COMP0016_2020_21_Team12-datasetsExperimentsAna/pwa/FADapp/pythonScripts/venv/Lib/site-packages/numpy/typing/tests/data/reveal/modules.py
|
anzhao920/MicrosoftProject15_Invictus
|
15f44eebb09561acbbe7b6730dfadf141e4c166d
|
[
"MIT"
] | 1
|
2021-04-26T22:41:56.000Z
|
2021-04-26T22:41:56.000Z
|
import numpy as np
reveal_type(np) # E: ModuleType
reveal_type(np.char) # E: ModuleType
reveal_type(np.ctypeslib) # E: ModuleType
reveal_type(np.emath) # E: ModuleType
reveal_type(np.fft) # E: ModuleType
reveal_type(np.lib) # E: ModuleType
reveal_type(np.linalg) # E: ModuleType
reveal_type(np.ma) # E: ModuleType
reveal_type(np.matrixlib) # E: ModuleType
reveal_type(np.polynomial) # E: ModuleType
reveal_type(np.random) # E: ModuleType
reveal_type(np.rec) # E: ModuleType
reveal_type(np.testing) # E: ModuleType
reveal_type(np.version) # E: ModuleType
# TODO: Remove when annotations have been added to `np.testing.assert_equal`
reveal_type(np.testing.assert_equal) # E: Any
| 34.047619
| 77
| 0.73007
| 107
| 715
| 4.719626
| 0.299065
| 0.29703
| 0.356436
| 0.540594
| 0.592079
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156643
| 715
| 20
| 78
| 35.75
| 0.837479
| 0.387413
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05
| 0.0625
| 1
| 0
| true
| 0
| 0.0625
| 0
| 0.0625
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
622f836838574698c936717caf8d43fcf788b010
| 103
|
py
|
Python
|
edmondsonline/covid/__init__.py
|
khammrich/Prod-EdmondsOnline
|
5bc2771fee4086cae72fb250d658c4d622455428
|
[
"MIT"
] | null | null | null |
edmondsonline/covid/__init__.py
|
khammrich/Prod-EdmondsOnline
|
5bc2771fee4086cae72fb250d658c4d622455428
|
[
"MIT"
] | 1
|
2021-06-02T01:22:10.000Z
|
2021-06-02T01:22:10.000Z
|
edmondsonline/covid/__init__.py
|
khammrich/Prod-EdmondsOnline
|
5bc2771fee4086cae72fb250d658c4d622455428
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
bp = Blueprint('covid', __name__)
from edmondsonline.covid import routes
| 17.166667
| 38
| 0.796117
| 13
| 103
| 6
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135922
| 103
| 5
| 39
| 20.6
| 0.876404
| 0
| 0
| 0
| 0
| 0
| 0.048544
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 5
|
625380fda66bfd773001b17c8ee52fc48c200bec
| 209
|
py
|
Python
|
terzani/utils/types.py
|
JanMaxime/terzani_colorization
|
6538e0053c9119b1bf67da930f309b22cbdece30
|
[
"MIT"
] | null | null | null |
terzani/utils/types.py
|
JanMaxime/terzani_colorization
|
6538e0053c9119b1bf67da930f309b22cbdece30
|
[
"MIT"
] | 1
|
2020-12-16T14:16:16.000Z
|
2020-12-24T10:35:27.000Z
|
terzani/utils/types.py
|
JanMaxime/terzani_colorization
|
6538e0053c9119b1bf67da930f309b22cbdece30
|
[
"MIT"
] | null | null | null |
class IIIF_Photo(object):
def __init__(self, iiif, country):
self.iiif = iiif
self.country = country
def get_photo_link(self):
return self.iiif["images"][0]["resource"]["@id"]
| 26.125
| 56
| 0.617225
| 27
| 209
| 4.518519
| 0.555556
| 0.196721
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00625
| 0.23445
| 209
| 7
| 57
| 29.857143
| 0.75625
| 0
| 0
| 0
| 0
| 0
| 0.08134
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.166667
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
626458315526f01ec2c87c0b7d076c3552b41667
| 36
|
py
|
Python
|
cheope/dace/__init__.py
|
tiziano1590/cheops_analysis-package
|
d9e84ad43bfafd1f12a340dcaed89d4dad6b876b
|
[
"BSD-3-Clause"
] | 1
|
2021-12-20T15:14:06.000Z
|
2021-12-20T15:14:06.000Z
|
cheope/dace/__init__.py
|
tiziano1590/cheops_analysis-package
|
d9e84ad43bfafd1f12a340dcaed89d4dad6b876b
|
[
"BSD-3-Clause"
] | null | null | null |
cheope/dace/__init__.py
|
tiziano1590/cheops_analysis-package
|
d9e84ad43bfafd1f12a340dcaed89d4dad6b876b
|
[
"BSD-3-Clause"
] | null | null | null |
from .dace_search import DACESearch
| 18
| 35
| 0.861111
| 5
| 36
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 36
| 1
| 36
| 36
| 0.9375
| 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
|
62831dd496dad011ad0638fed7bad87dd5431cc0
| 181
|
py
|
Python
|
Training Modules/01 Introduction/1.09 Logical Operators/solution.py
|
cocobaco/Python3-by-practice
|
9255573ee7e68d20cde7a75e36b6bf5a8eb5b1f2
|
[
"Apache-2.0"
] | 54
|
2020-07-20T13:52:50.000Z
|
2021-11-07T20:38:47.000Z
|
Training Modules/01 Introduction/1.09 Logical Operators/solution.py
|
cocobaco/Python3-by-practice
|
9255573ee7e68d20cde7a75e36b6bf5a8eb5b1f2
|
[
"Apache-2.0"
] | 83
|
2020-09-25T15:21:55.000Z
|
2021-10-02T04:58:54.000Z
|
Training Modules/01 Introduction/1.09 Logical Operators/solution.py
|
cocobaco/Python3-by-practice
|
9255573ee7e68d20cde7a75e36b6bf5a8eb5b1f2
|
[
"Apache-2.0"
] | 74
|
2020-09-25T19:16:29.000Z
|
2021-10-02T04:58:19.000Z
|
print (True and True)
print (True and False)
print (False and True)
print (False and False)
print (True or True)
print (True or False)
print (False or True)
print (False or False)
| 18.1
| 23
| 0.729282
| 32
| 181
| 4.125
| 0.15625
| 0.272727
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.18232
| 181
| 9
| 24
| 20.111111
| 0.891892
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.