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
e4e744cea09aa5c17b5498d8639be53e51afe5ae
246
py
Python
algorithms/__init__.py
farfanoide/simuladorHDD
27418ae2d0ed6f8d8642f670682a66451c5cbc43
[ "MIT" ]
1
2019-02-06T05:14:25.000Z
2019-02-06T05:14:25.000Z
algorithms/__init__.py
farfanoide/simuladorHDD
27418ae2d0ed6f8d8642f670682a66451c5cbc43
[ "MIT" ]
null
null
null
algorithms/__init__.py
farfanoide/simuladorHDD
27418ae2d0ed6f8d8642f670682a66451c5cbc43
[ "MIT" ]
null
null
null
from algorithms.scheduling import Scheduling from algorithms.clook import CLOOK from algorithms.cscan import CSCAN from algorithms.fcfs import FCFS from algorithms.look import LOOK from algorithms.scan import SCAN from algorithms.sstf import SSTF
35.142857
44
0.861789
35
246
6.057143
0.285714
0.462264
0
0
0
0
0
0
0
0
0
0
0.109756
246
7
45
35.142857
0.968037
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
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
e4f50dbec0ca1e407b428adeab5fc918e5d6199f
659
py
Python
tests/test_utils.py
benchuang11046/afs2-model
c821f078a2c1379b16273dc34d5d488a3d032f06
[ "Apache-2.0" ]
2
2019-05-27T06:19:33.000Z
2021-01-24T14:39:25.000Z
tests/test_utils.py
benchuang11046/afs2-model
c821f078a2c1379b16273dc34d5d488a3d032f06
[ "Apache-2.0" ]
24
2019-04-26T02:02:02.000Z
2020-05-14T10:18:55.000Z
tests/test_utils.py
benchuang11046/afs2-model
c821f078a2c1379b16273dc34d5d488a3d032f06
[ "Apache-2.0" ]
null
null
null
import pytest from afs import utils def test_urljoin(): url = utils.urljoin( "http://afs.org.tw", "instance_id", "1234-4567-7890", "model_respositories", "123", extra_paths={}, ) assert url == "http://afs.org.tw/instance_id/1234-4567-7890/model_respositories/123" def test_urljoin_extra_paths(): url = utils.urljoin( "http://afs.org.tw", "instance_id", "1234-4567-7890", "model_respositories", extra_paths=["123", "upload"], ) assert ( url == "http://afs.org.tw/instance_id/1234-4567-7890/model_respositories/123/upload" )
22.724138
88
0.579666
78
659
4.717949
0.307692
0.076087
0.108696
0.130435
0.720109
0.720109
0.720109
0.720109
0.720109
0.720109
0
0.124224
0.267071
659
28
89
23.535714
0.637681
0
0
0.416667
0
0.041667
0.420334
0
0
0
0
0
0.083333
1
0.083333
false
0
0.083333
0
0.166667
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
902cd08c4f4388ffd915a79c7766a95543e4b2df
148
py
Python
vsp-banckend/virtualStoreApp/models/__init__.py
DannielF/virtual-store-project
a8600b6acdabf33cdc4d7ae5c744edd064fe0a1b
[ "MIT" ]
null
null
null
vsp-banckend/virtualStoreApp/models/__init__.py
DannielF/virtual-store-project
a8600b6acdabf33cdc4d7ae5c744edd064fe0a1b
[ "MIT" ]
null
null
null
vsp-banckend/virtualStoreApp/models/__init__.py
DannielF/virtual-store-project
a8600b6acdabf33cdc4d7ae5c744edd064fe0a1b
[ "MIT" ]
null
null
null
from .user import User from .order import Order from .product import Product from .provider import Provider from .order_product import OrderProduct
24.666667
39
0.831081
21
148
5.809524
0.333333
0.147541
0
0
0
0
0
0
0
0
0
0
0.135135
148
5
40
29.6
0.953125
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
902f715205288441efc880c579b2f4b1071092e5
163
py
Python
src/managers/__init__.py
deepak2431/pygame-Coin-Fall-
2238fb8badc7db138e1bfa5e1d4e2672d652e935
[ "MIT" ]
null
null
null
src/managers/__init__.py
deepak2431/pygame-Coin-Fall-
2238fb8badc7db138e1bfa5e1d4e2672d652e935
[ "MIT" ]
null
null
null
src/managers/__init__.py
deepak2431/pygame-Coin-Fall-
2238fb8badc7db138e1bfa5e1d4e2672d652e935
[ "MIT" ]
null
null
null
from .resources import Resources from .game_manager import Game_manager from .sound_manager import Play_sound from .gameplay_parameters import Gameplay_Parameters
32.6
52
0.877301
22
163
6.227273
0.409091
0.160584
0
0
0
0
0
0
0
0
0
0
0.09816
163
4
53
40.75
0.931973
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
90339faf283a28114b167e35435605ba4f6be749
5,398
py
Python
tests/utilities/test_async_tools.py
apollo13/lightbus
ad9bb5e376e7aabb400d01307345e00fd07e4677
[ "Apache-2.0" ]
null
null
null
tests/utilities/test_async_tools.py
apollo13/lightbus
ad9bb5e376e7aabb400d01307345e00fd07e4677
[ "Apache-2.0" ]
null
null
null
tests/utilities/test_async_tools.py
apollo13/lightbus
ad9bb5e376e7aabb400d01307345e00fd07e4677
[ "Apache-2.0" ]
null
null
null
import asyncio from datetime import timedelta import pytest import schedule from lightbus.exceptions import CannotBlockHere from lightbus.utilities.async_tools import ( call_every, cancel, call_on_schedule, run_user_provided_callable, block, ) pytestmark = pytest.mark.unit @pytest.fixture() def call_counter(): class CallCounter: def __init__(self): self.call_count = 0 def __call__(self, *args, **kwargs): self.call_count += 1 return CallCounter() @pytest.mark.asyncio async def test_block_within_event_loop(): # Should give an error async def co(): pass with pytest.raises(CannotBlockHere): block(co()) def test_block_outside_event_loop(): # Should not raise an error async def co(): return 1 resuult = block(co()) assert resuult == 1 @pytest.fixture() async def run_for(): async def run_for_inner(coroutine, seconds): task = asyncio.ensure_future(coroutine) await asyncio.sleep(seconds) await cancel(task) return run_for_inner # call_every() @pytest.mark.asyncio async def test_call_every(run_for, call_counter, dummy_bus): await run_for( coroutine=call_every( callback=call_counter, timedelta=timedelta(seconds=0.1), also_run_immediately=False, bus_client=dummy_bus.bus, ), seconds=0.25, ) assert call_counter.call_count == 2 @pytest.mark.asyncio async def test_call_every_run_immediate(run_for, call_counter, dummy_bus): await run_for( coroutine=call_every( callback=call_counter, timedelta=timedelta(seconds=0.1), also_run_immediately=True, bus_client=dummy_bus.busdummy_bus, ), seconds=0.25, ) assert call_counter.call_count == 3 @pytest.mark.asyncio async def test_call_every_async(run_for, dummy_bus): await_count = 0 async def cb(): nonlocal await_count await_count += 1 await run_for( coroutine=call_every( callback=cb, timedelta=timedelta(seconds=0.1), also_run_immediately=False, bus_client=dummy_bus.busdummy_bus, ), seconds=0.25, ) assert await_count == 2 @pytest.mark.asyncio async def test_call_every_with_long_execution_time(run_for, dummy_bus): """Execution time should get taken into account""" await_count = 0 async def cb(): nonlocal await_count await_count += 1 await asyncio.sleep(0.09) await run_for( coroutine=call_every( callback=cb, timedelta=timedelta(seconds=0.1), also_run_immediately=False, bus_client=dummy_bus.busdummy_bus, ), seconds=0.25, ) assert await_count == 2 # call_on_schedule() @pytest.mark.asyncio async def test_call_on_schedule(run_for, call_counter, dummy_bus): await run_for( coroutine=call_on_schedule( callback=call_counter, schedule=schedule.every(0.1).seconds, also_run_immediately=False, bus_client=dummy_bus.client, ), seconds=0.25, ) assert call_counter.call_count == 2 @pytest.mark.asyncio async def test_call_on_schedule_run_immediate(run_for, call_counter, dummy_bus): await run_for( coroutine=call_on_schedule( callback=call_counter, schedule=schedule.every(0.1).seconds, also_run_immediately=True, bus_client=dummy_bus.client, ), seconds=0.25, ) assert call_counter.call_count == 3 @pytest.mark.asyncio async def test_call_on_schedule_async(run_for, dummy_bus): import schedule await_count = 0 async def cb(): nonlocal await_count await_count += 1 await run_for( coroutine=call_on_schedule( callback=cb, schedule=schedule.every(0.1).seconds, also_run_immediately=False, bus_client=dummy_bus.client, ), seconds=0.25, ) assert await_count == 2 @pytest.mark.asyncio async def test_call_on_schedule_with_long_execution_time(run_for, dummy_bus): """Execution time should get taken into account""" import schedule await_count = 0 async def cb(): nonlocal await_count await_count += 1 await asyncio.sleep(0.09) await run_for( coroutine=call_on_schedule( callback=cb, schedule=schedule.every(0.1).seconds, also_run_immediately=False, bus_client=dummy_bus.client, ), seconds=0.25, ) assert await_count == 2 @pytest.mark.asyncio async def test_run_user_provided_callable_regular_function(dummy_bus): called = False def call_me(a, b): nonlocal called called = True await run_user_provided_callable( call_me, args=[1], kwargs={"b": 2}, bus_client=dummy_bus.client ) assert called @pytest.mark.asyncio async def test_run_user_provided_callable_async_function(dummy_bus): called = False async def call_me(a, b): nonlocal called called = True await run_user_provided_callable( call_me, args=[1], kwargs={"b": 2}, bus_client=dummy_bus.client ) assert called
22.872881
80
0.643016
683
5,398
4.789165
0.136164
0.048915
0.057169
0.073983
0.790278
0.751758
0.742892
0.742892
0.738918
0.723326
0
0.017821
0.272323
5,398
235
81
22.970213
0.814919
0.01445
0
0.68
0
0
0.000384
0
0
0
0
0
0.062857
1
0.028571
false
0.005714
0.045714
0
0.097143
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
5f539a160e413b2e4710706e394d417f8da45590
2,623
py
Python
pygrank/core/backend/specification.py
maniospas/pygrank
a92f6bb6d13553dd960f2e6bda4c041a8027a9d1
[ "Apache-2.0" ]
19
2019-10-07T14:42:40.000Z
2022-03-24T15:02:02.000Z
pygrank/core/backend/specification.py
maniospas/pygrank
a92f6bb6d13553dd960f2e6bda4c041a8027a9d1
[ "Apache-2.0" ]
13
2021-08-25T12:54:37.000Z
2022-03-05T03:31:34.000Z
pygrank/core/backend/specification.py
maniospas/pygrank
a92f6bb6d13553dd960f2e6bda4c041a8027a9d1
[ "Apache-2.0" ]
4
2019-09-25T09:54:51.000Z
2020-12-09T00:11:21.000Z
from pygrank.core.typing import BackendGraph, BackendPrimitive from typing import Iterable, Optional, Tuple def backend_name() -> str: # pragma: no cover return "no backend loaded" def backend_init(): # pragma: no cover pass def graph_dropout(M: BackendGraph, dropout: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def separate_cols(x: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def combine_cols(cols: Iterable[BackendPrimitive]) -> BackendPrimitive: # pragma: no cover pass def abs(x: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def sum(x: BackendPrimitive, axis: Optional[int] = None) -> BackendPrimitive: # pragma: no cover pass def mean(x: BackendPrimitive, axis: Optional[int] = None) -> BackendPrimitive: #pragma: no cover pass def min(x: BackendPrimitive, axis: Optional[int]=None) -> BackendPrimitive: # pragma: no cover pass def max(x: BackendPrimitive, axis: Optional[int]=None) -> BackendPrimitive: # pragma: no cover pass def exp(x: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def log(x: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def ones(dims: Tuple[int, int]) -> BackendPrimitive: # pragma: no cover pass def eye(dims: int) -> BackendPrimitive: # pragma: no cover pass def diag(diagonal: BackendPrimitive, offset: int = 0) -> BackendPrimitive: # pragma: no cover pass def copy(x: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def scipy_sparse_to_backend(M: BackendGraph) -> BackendGraph: # pragma: no cover pass def to_array(obj: object, copy_array: bool = False) -> BackendPrimitive: # pragma: no cover pass def to_primitive(obj: object) -> BackendPrimitive: # pragma: no cover pass def is_array(obj: object) -> bool: # pragma: no cover pass def repeat(value: float, times: int) -> BackendPrimitive: # pragma: no cover pass def self_normalize(obj: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def conv(signal: BackendPrimitive, M: BackendGraph) -> BackendPrimitive: # pragma: no cover pass def length(x: BackendPrimitive) -> int: # pragma: no cover pass def degrees(M: BackendGraph) -> BackendPrimitive: # pragma: no cover pass def dot(x: BackendPrimitive, y: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def filter_out(x: BackendPrimitive, exclude: BackendPrimitive) -> BackendPrimitive: # pragma: no cover pass def epsilon() -> float: # pragma: no cover pass
22.808696
104
0.701106
310
2,623
5.887097
0.232258
0.12274
0.199452
0.251507
0.668493
0.635616
0.563288
0.356712
0.157808
0.157808
0
0.000475
0.197103
2,623
114
105
23.008772
0.866097
0.180709
0
0.465517
0
0
0.008019
0
0
0
0
0
0
1
0.482759
false
0.465517
0.034483
0.017241
0.534483
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
5f8a29602b5f61769a85daac8cf0468be341357a
3,543
py
Python
tests/drum/test_drum_runtime.py
andreakropp/datarobot-user-models
423ab8c703a545491ad6013a0b7efa3119e2c0fc
[ "Apache-2.0" ]
null
null
null
tests/drum/test_drum_runtime.py
andreakropp/datarobot-user-models
423ab8c703a545491ad6013a0b7efa3119e2c0fc
[ "Apache-2.0" ]
9
2021-11-10T20:16:41.000Z
2022-03-12T00:59:05.000Z
tests/drum/test_drum_runtime.py
andreakropp/datarobot-user-models
423ab8c703a545491ad6013a0b7efa3119e2c0fc
[ "Apache-2.0" ]
1
2021-06-17T22:05:33.000Z
2021-06-17T22:05:33.000Z
import collections from unittest import mock import pytest from datarobot_drum.drum.args_parser import CMRunnerArgsRegistry from datarobot_drum.drum.common import RunMode from datarobot_drum.drum.runtime import DrumRuntime class TestDrumRuntime: Options = collections.namedtuple( "Options", "with_error_server {} docker address verbose show_stacktrace".format( CMRunnerArgsRegistry.SUBPARSER_DEST_KEYWORD ), defaults=[RunMode.SERVER, None, "localhost", False, True], ) class StubDrumException(Exception): pass @mock.patch("datarobot_drum.drum.runtime.run_error_server") def test_no_exceptions(self, mock_run_error_server): with DrumRuntime(): pass mock_run_error_server.assert_not_called() @mock.patch("datarobot_drum.drum.runtime.run_error_server") def test_exception_no_options(self, mock_run_error_server): with pytest.raises(TestDrumRuntime.StubDrumException): with DrumRuntime(): raise TestDrumRuntime.StubDrumException() mock_run_error_server.assert_not_called() @mock.patch("datarobot_drum.drum.runtime.run_error_server") def test_exception_initialization_succeeded(self, mock_run_error_server): with pytest.raises(TestDrumRuntime.StubDrumException): with DrumRuntime() as runtime: runtime.options = TestDrumRuntime.Options(False) runtime.initialization_succeeded = True raise TestDrumRuntime.StubDrumException() mock_run_error_server.assert_not_called() @mock.patch("datarobot_drum.drum.runtime.run_error_server") def test_exception_not_server_mode(self, mock_run_error_server): with pytest.raises(TestDrumRuntime.StubDrumException): with DrumRuntime() as runtime: runtime.options = TestDrumRuntime.Options(False, RunMode.SCORE) runtime.initialization_succeeded = False raise TestDrumRuntime.StubDrumException() mock_run_error_server.assert_not_called() @mock.patch("datarobot_drum.drum.runtime.run_error_server") def test_exception_not_server_mode(self, mock_run_error_server): with pytest.raises(TestDrumRuntime.StubDrumException): with DrumRuntime() as runtime: runtime.options = TestDrumRuntime.Options(False, RunMode.SERVER, "path_to_image") runtime.initialization_succeeded = False raise TestDrumRuntime.StubDrumException() mock_run_error_server.assert_not_called() @mock.patch("datarobot_drum.drum.runtime.run_error_server") def test_exception_no_with_error_server(self, mock_run_error_server): with pytest.raises(TestDrumRuntime.StubDrumException): with DrumRuntime() as runtime: runtime.options = TestDrumRuntime.Options(False) runtime.initialization_succeeded = False raise TestDrumRuntime.StubDrumException() mock_run_error_server.assert_not_called() @mock.patch("datarobot_drum.drum.runtime.run_error_server") def test_exception_with_error_server(self, mock_run_error_server): with pytest.raises(TestDrumRuntime.StubDrumException): with DrumRuntime() as runtime: runtime.options = TestDrumRuntime.Options(True) runtime.initialization_succeeded = False raise TestDrumRuntime.StubDrumException() mock_run_error_server.assert_called()
40.724138
97
0.714649
370
3,543
6.527027
0.159459
0.109317
0.121739
0.104348
0.787164
0.787164
0.776398
0.776398
0.776398
0.776398
0
0
0.211967
3,543
86
98
41.197674
0.864971
0
0
0.626866
0
0
0.11177
0.086932
0
0
0
0
0.104478
1
0.104478
false
0.029851
0.089552
0
0.238806
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
5fad1f9314f35b9f953ccb370f0f47315536b8af
45
py
Python
amazon_scraper/__init__.py
picorana/amazon-scraper
28e9c692ffd0af47a7f90355a53e41c47ddebf7f
[ "Unlicense" ]
32
2017-11-02T08:50:07.000Z
2021-11-18T14:45:00.000Z
amazon_scraper/__init__.py
picorana/amazon-scraper
28e9c692ffd0af47a7f90355a53e41c47ddebf7f
[ "Unlicense" ]
11
2017-11-01T16:20:10.000Z
2019-12-26T12:56:59.000Z
amazon_scraper/__init__.py
picorana/amazon-scraper
28e9c692ffd0af47a7f90355a53e41c47ddebf7f
[ "Unlicense" ]
4
2018-02-11T08:52:13.000Z
2021-12-05T19:17:40.000Z
from amazon_scraper.app import AmazonScraper
22.5
44
0.888889
6
45
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.088889
45
1
45
45
0.95122
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
395c51b1257b20db070e8856b928b87dc77f85d3
155
py
Python
src/effective_python/simple_generator.py
mketiku/python-tutorials
57f05ed78d5391b0c551c7e064a1b2f4304a3c82
[ "MIT" ]
1
2022-03-30T00:22:21.000Z
2022-03-30T00:22:21.000Z
src/effective_python/simple_generator.py
mketiku/python-tutorials
57f05ed78d5391b0c551c7e064a1b2f4304a3c82
[ "MIT" ]
null
null
null
src/effective_python/simple_generator.py
mketiku/python-tutorials
57f05ed78d5391b0c551c7e064a1b2f4304a3c82
[ "MIT" ]
null
null
null
#!/usr/bin/env python def simple_generator(): yield 1 yield 2 yield 3 simple_generator() print(simple_generator) print(simple_generator())
11.923077
25
0.709677
21
155
5.047619
0.571429
0.566038
0.377358
0.490566
0.518868
0
0
0
0
0
0
0.02381
0.187097
155
13
25
11.923077
0.81746
0.129032
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
true
0
0
0
0.142857
0.285714
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
39d69a4587895bbd0cdc3f66f88fe9b67673fba2
261
py
Python
link/linalg.py
wx-b/link
c99ff6f3026e1d7401516d0564097685ec032ee7
[ "MIT" ]
3
2021-08-11T02:07:38.000Z
2021-12-27T11:20:27.000Z
link/linalg.py
wx-b/link
c99ff6f3026e1d7401516d0564097685ec032ee7
[ "MIT" ]
1
2021-08-11T01:02:20.000Z
2021-09-25T12:45:37.000Z
link/linalg.py
wx-b/link
c99ff6f3026e1d7401516d0564097685ec032ee7
[ "MIT" ]
1
2021-08-11T02:08:25.000Z
2021-08-11T02:08:25.000Z
import numpy as np def skew(x: np.ndarray) -> np.ndarray: """ Args: x: An array of shape (3,). Returns: The skew symmetric array of shape (3, 3). """ return np.array([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]])
20.076923
75
0.482759
45
261
2.8
0.466667
0.047619
0.190476
0.206349
0
0
0
0
0
0
0
0.064865
0.291188
261
12
76
21.75
0.616216
0.35249
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
8410184025fd93ef2b6817670f6d9cf70884e13b
148
py
Python
music/admin.py
rishidutta92/django
5d2fdb94b1c273577512cbd8a0dbb3a7b310f371
[ "BSD-2-Clause" ]
null
null
null
music/admin.py
rishidutta92/django
5d2fdb94b1c273577512cbd8a0dbb3a7b310f371
[ "BSD-2-Clause" ]
null
null
null
music/admin.py
rishidutta92/django
5d2fdb94b1c273577512cbd8a0dbb3a7b310f371
[ "BSD-2-Clause" ]
null
null
null
from django.contrib import admin from . models import Album,song admin.site.register(Album) # Register your models here. admin.site.register(song)
21.142857
32
0.797297
22
148
5.363636
0.545455
0.152542
0.288136
0
0
0
0
0
0
0
0
0
0.114865
148
6
33
24.666667
0.900763
0.175676
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
84436bd9e54b8292e30ed0a6b3bb756bcee330f0
1,265
py
Python
SQLAlchemy_expression.py
Wingsgo/sqlachemy-exqmple
b97ab8c56df755064fc38c8d0ed8261957331b8c
[ "MIT" ]
null
null
null
SQLAlchemy_expression.py
Wingsgo/sqlachemy-exqmple
b97ab8c56df755064fc38c8d0ed8261957331b8c
[ "MIT" ]
null
null
null
SQLAlchemy_expression.py
Wingsgo/sqlachemy-exqmple
b97ab8c56df755064fc38c8d0ed8261957331b8c
[ "MIT" ]
null
null
null
>>> from sqlalchemy import select >>> product_higher_than_one_hundred = select([Product.id]).where(Product.price > 100.00) >>> >>> session = DBSession() >>> session.query(Product).filter(Product.id.in_(product_higher_than_one_hundred)).all() [( :u'CPU':300.0 ), ( :u'Motherboard':150.0 )] >>> session.close() >>> shopping_carts_with_products_higher_than_one_hundred = select([ShoppingCart.id]).where( ... ShoppingCart.products.any(Product.id.in_(product_higher_than_one_hundred)) ... ) >>> session = DBSession() >>> session.query(ShoppingCart).filter(ShoppingCart.id.in_(shopping_carts_with_products_higher_than_one_hundred)).one() ( :John:[( :u'CPU':300.0 ), ( :u'Motherboard':150.0 )] ) >>> session.close() >>> products_lower_than_one_hundred = select([Product.id]).where(Product.price < 100.00) >>> from sqlalchemy import not_ >>> shopping_carts_with_no_products_lower_than_one_hundred = select([ShoppingCart.id]).where( ... not_(ShoppingCart.products.any(Product.id.in_(products_lower_than_one_hundred))) ... ) >>> session = DBSession() >>> session.query(ShoppingCart).filter(ShoppingCart.id.in_( ... shopping_carts_with_no_products_lower_than_one_hundred) ... ).all() [( :John:[( :u'CPU':300.0 ), ( :u'Motherboard':150.0 )] )] >>> session.close()
46.851852
119
0.726482
166
1,265
5.192771
0.222892
0.073086
0.146172
0.116009
0.881671
0.851508
0.770302
0.712297
0.555684
0.468677
0
0.029235
0.080632
1,265
27
120
46.851852
0.711952
0
0
0.32
0
0
0.033175
0
0
0
0
0
0
0
null
null
0
0.08
null
null
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
8458879066d6609153a6b137d7bd8b8ed6d401cc
194
py
Python
music_collection_manager/__main__.py
nikohonu/music_collection_manager
74c7eb81badef52e981d905ccebc651c04b4bee6
[ "MIT" ]
null
null
null
music_collection_manager/__main__.py
nikohonu/music_collection_manager
74c7eb81badef52e981d905ccebc651c04b4bee6
[ "MIT" ]
null
null
null
music_collection_manager/__main__.py
nikohonu/music_collection_manager
74c7eb81badef52e981d905ccebc651c04b4bee6
[ "MIT" ]
null
null
null
from music_collection_manager.models import MusicCollection from music_collection_manager.utils import Config def main(): MusicCollection(Config()) if __name__ == '__main__': main()
17.636364
59
0.773196
22
194
6.272727
0.590909
0.130435
0.275362
0.376812
0
0
0
0
0
0
0
0
0.14433
194
10
60
19.4
0.831325
0
0
0
0
0
0.041237
0
0
0
0
0
0
1
0.166667
true
0
0.333333
0
0.5
0
1
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
0
0
0
5
ffd03f974abdfe49296b6264d6933a1e086e9315
54
py
Python
lipanampesa.py
gelson1996/daraja_api
f489092ff09eb9691d7d23973312dd351300dee8
[ "MIT" ]
null
null
null
lipanampesa.py
gelson1996/daraja_api
f489092ff09eb9691d7d23973312dd351300dee8
[ "MIT" ]
null
null
null
lipanampesa.py
gelson1996/daraja_api
f489092ff09eb9691d7d23973312dd351300dee8
[ "MIT" ]
null
null
null
print('Hello ready to craete some mpesa applications')
54
54
0.814815
8
54
5.5
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
54
1
54
54
0.916667
0
0
0
0
0
0.818182
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
fff04d3a77c8b67690fe2c4280c7378b68317a13
59
py
Python
discovery-provider/src/queries/get_route_metrics_test.py
ppak10/audius-protocol
4dd9df787cbd39f86c5623ce7899b3855b7b314e
[ "Apache-2.0" ]
429
2019-08-14T01:34:07.000Z
2022-03-30T06:31:38.000Z
discovery-provider/src/queries/get_route_metrics_test.py
ppak10/audius-protocol
4dd9df787cbd39f86c5623ce7899b3855b7b314e
[ "Apache-2.0" ]
998
2019-08-14T01:52:37.000Z
2022-03-31T23:17:22.000Z
discovery-provider/src/queries/get_route_metrics_test.py
ppak10/audius-protocol
4dd9df787cbd39f86c5623ce7899b3855b7b314e
[ "Apache-2.0" ]
73
2019-10-04T04:24:16.000Z
2022-03-24T16:27:30.000Z
def test(): """See /tests/test_get_route_metrics.py"""
19.666667
46
0.661017
9
59
4
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.135593
59
2
47
29.5
0.705882
0.610169
0
0
0
0
0
0
0
0
0
0
0
1
1
true
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
1
0
0
5
08298ea7ede9e38d20c4f30da379c9550f77c44c
43
py
Python
__init__.py
pveiga-abreu/pdf2text
69eb30f42aaa845e7bfd0269da02c3f6e8a60a16
[ "MIT" ]
1
2021-09-16T16:50:07.000Z
2021-09-16T16:50:07.000Z
__init__.py
pveiga-abreu/pdf2text
69eb30f42aaa845e7bfd0269da02c3f6e8a60a16
[ "MIT" ]
null
null
null
__init__.py
pveiga-abreu/pdf2text
69eb30f42aaa845e7bfd0269da02c3f6e8a60a16
[ "MIT" ]
null
null
null
from .pdf2text import ( PDF2Text )
10.75
23
0.604651
4
43
6.5
0.75
0
0
0
0
0
0
0
0
0
0
0.068966
0.325581
43
3
24
14.333333
0.827586
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0856e18fc1dac6c13ec918311a9d7f30d14ba2a7
48
py
Python
datasimple/__init__.py
CraigKelly/datasimple
1458149f789b7aeb0e2d7886bc9ba5fd5600d700
[ "Apache-2.0" ]
1
2018-05-29T18:12:13.000Z
2018-05-29T18:12:13.000Z
datasimple/__init__.py
CraigKelly/datasimple
1458149f789b7aeb0e2d7886bc9ba5fd5600d700
[ "Apache-2.0" ]
null
null
null
datasimple/__init__.py
CraigKelly/datasimple
1458149f789b7aeb0e2d7886bc9ba5fd5600d700
[ "Apache-2.0" ]
null
null
null
"""Library for simple data processing tasks."""
24
47
0.729167
6
48
5.833333
1
0
0
0
0
0
0
0
0
0
0
0
0.125
48
1
48
48
0.833333
0.854167
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
f22fabfbed6ab4f344fd6a2a6ea6ef3a9c5f8760
1,092
py
Python
layers/searcher/Searcher.py
iamsg08/Joing-Parsing-and-Generation-for-Abstractive-Summarization
a432e6e78ac1b3016c2a5f8788a613772b11da40
[ "BSD-3-Clause" ]
29
2019-11-17T08:03:28.000Z
2021-01-06T15:16:05.000Z
layers/searcher/Searcher.py
iamsg08/Joing-Parsing-and-Generation-for-Abstractive-Summarization
a432e6e78ac1b3016c2a5f8788a613772b11da40
[ "BSD-3-Clause" ]
1
2020-04-30T08:09:39.000Z
2020-07-24T11:24:02.000Z
layers/searcher/Searcher.py
iamsg08/Joing-Parsing-and-Generation-for-Abstractive-Summarization
a432e6e78ac1b3016c2a5f8788a613772b11da40
[ "BSD-3-Clause" ]
4
2020-01-04T14:44:46.000Z
2021-12-20T06:30:04.000Z
#==============================# # System Import # #==============================# #==============================# # Platform Import # #==============================# import torch.nn as nn #==============================# # Class/Layer Part Import # #==============================# from .AStar import AStar from .BFS_BEAM import BFS_BEAM from .Debug import Debug from .Prob import Prob from .BasicSearcher import BasicSearcher class Searcher(object): def __init__(self, options): self.searcher = eval(options['test']['method'])(options) def search(self, *argv, **kwargs): return self.searcher.search(*argv, **kwargs) def setType(self,*argv, **kwargs): return self.searcher.setType(*argv, **kwargs) def Emb_Set(self, *argv, **kwargs): return self.searcher.Emb_Set(*argv, **kwargs) def Generator_Set(self, *argv, **kwargs): return self.searcher.Generator_Set(*argv, **kwargs) def LVT_Set(self, *argv, **kwargs): return self.searcher.LVT_Set(*argv, **kwargs)
30.333333
64
0.521062
110
1,092
5.063636
0.309091
0.179533
0.125673
0.179533
0.303411
0.303411
0.18851
0
0
0
0
0
0.198718
1,092
36
65
30.333333
0.636571
0.247253
0
0
0
0
0.012422
0
0
0
0
0
0
1
0.315789
false
0
0.315789
0.263158
0.947368
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
0
0
0
1
0
0
1
1
1
0
0
5
f24cd12135bcc361f0c26becb7b12c7bd8aa5354
5,992
py
Python
matlab_ext/measurement/mc-assistant/projects/py_hw_models/hided/air_liq_curves/sqlTest.py
zaqwes8811/coordinator-tasks
7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a
[ "MIT" ]
null
null
null
matlab_ext/measurement/mc-assistant/projects/py_hw_models/hided/air_liq_curves/sqlTest.py
zaqwes8811/coordinator-tasks
7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a
[ "MIT" ]
15
2015-03-07T12:46:41.000Z
2015-04-11T09:08:36.000Z
matlab_ext/measurement/mc-assistant/projects/py_hw_models/trash/_air_or_liq_curves/sqlTest.py
zaqwes8811/micro-apps
7f63fdf613eff5d441a3c2c7b52d2a3d02d9736a
[ "MIT" ]
null
null
null
#-*- coding: utf-8 -*- # хранилище import sqlite3 # Run if __name__ == '__main__': conn = sqlite3.connect('Curves.db') # создаем курсор c = conn.cursor() # Create table c.execute(''' CREATE TABLE if not exists stocks( NameCurve text primary key, CurveValue text, Type boolean )''' ) # запись в базу данных CurvesSet = {} hex = {} # конкретные кривые name = 'CurveSpeeds' hex[name] = False CurvesSet[name] = """ db 1,12, 2,12, 3,12, 4,12, 5,12, 6,12, 7,12, 8,12, 9,12, 10,12, 11,12, 12,12, 13,12, 14,12, 15,12, 16,12, 17,12, 18,12, 19,12, 20,12 db 21,12, 22,12, 23,12, 24,12, 25,12, 26,12, 27,12, 28,12, 29,12, 30,12, 31,12, 32,12, 33,12, 34,12, 35,12, 36,12, 37,12, 38,12, 39,12, 40,12 db 41,12, 42,12, 43,12, 44,12, 45,12, 46,12, 47,12, 48,12, 49,12, 50,17, 51,22, 52,27, 53,32, 54,37, 55,42, 56,47, 57,52, 58,57, 59,62, 60,67 db 61,72, 62,77, 63,82, 64,87, 65,92, 66,97, 67,102, 68,107, 69,112, 70,117, 71,122, 72,127, 73,132, 74,137, 75,142, 76,147, 77,152, 78,157, 79,164, 80,164 db 81,164, 82,164, 83,164, 84,164, 85,164, 86,164, 87,164, 88,164, 89,164, 90,164, 91,164, 92,164, 93,164, 94,164, 95,164, 96,164, 97,164, 98,164, 99,164, 0x00 """ name = 'CurveSpeeds2' hex[name] = False CurvesSet[name] = """ db 1,37, 2,37, 3,37, 4,37, 5,37, 6,37, 7,37, 8,37, 9,37, 10,37, 11,37, 12,37, 13,37, 14,37, 15,37, 16,37, 17,37, 18,37, 19,37, 20,37 db 21,37, 22,37, 23,37, 24,37, 25,37, 26,41, 27,45, 28,49, 29,52, 30,56, 31,60, 32,64, 33,67, 34,71, 35,75, 36,79, 37,82, 38,86, 39,90, 40,94 db 41,97, 42,101, 43,105, 44,109, 45,113, 46,113, 47,113, 48,113, 49,113, 50,113, 51,113, 52,113, 53,113, 54,113, 55,113, 56,113, 57,113, 58,113, 59,113, 60,113 db 61,113, 62,113, 63,113, 64,113, 65,113, 66,113, 67,113, 68,113, 69,113, 70,113, 71,113, 72,113, 73,113, 74,113, 75,113, 76,113, 77,113, 78,113, 79,113, 80,113 db 81,113, 82,113, 83,113, 84,113, 85,113, 86,113, 87,113, 88,113, 89,113, 90,113, 91,113, 92,113, 93,113, 94,113, 95,113, 96,113, 97,113, 98,113, 99,113, 0x00 """ name = 'CurveSpeeds3' hex[name] = False CurvesSet[name] = """ db 1,88, 2,88, 3,88, 4,88, 5,88, 6,88, 7,88, 8,88, 9,88, 10,88, 11,88, 12,88, 13,88, 14,88, 15,88, 16,88, 17,88, 18,88, 19,88, 20,88 db 21,89, 22,91, 23,92, 24,94, 25,95, 26,97, 27,98, 28,100, 29,101, 30,103, 31,104, 32,106, 33,107, 34,109, 35,110, 36,112, 37,113, 38,115, 39,116, 40,118 db 41,119, 42,121, 43,122, 44,124, 45,125, 46,127, 47,128, 48,130, 49,131, 50,133, 51,134, 52,136, 53,137, 54,139, 55,141, 56,142, 57,144, 58,145, 59,147, 60,148 db 61,150, 62,151, 63,153, 64,154, 65,156, 66,157, 67,159, 68,160, 69,162, 70,164, 71,164, 72,164, 73,164, 74,164, 75,164, 76,164, 77,164, 78,164, 79,164, 80,164 db 81,164, 82,164, 83,164, 84,164, 85,164, 86,164, 87,164, 88,164, 89,164, 90,164, 91,164, 92,164, 93,164, 94,164, 95,164, 96,164, 97,164, 98,164, 99,164, 0x00 """ name = 'CurveSpeeds4' hex[name] = False CurvesSet[name] = """ db 1,88, 2,88, 3,88, 4,88, 5,88, 6,88, 7,88, 8,88, 9,88, 10,88, 11,88, 12,88, 13,88, 14,88, 15,88, 16,88, 17,88, 18,88, 19,88, 20,88 db 21,88, 22,88, 23,88, 24,88, 25,88, 26,89, 27,90, 28,91, 29,93, 30,94, 31,95, 32,96, 33,97, 34,99, 35,100, 36,101, 37,102, 38,103, 39,105, 40,106 db 41,107, 42,108, 43,109, 44,111, 45,113, 46,113, 47,113, 48,113, 49,113, 50,113, 51,113, 52,113, 53,113, 54,113, 55,113, 56,113, 57,113, 58,113, 59,113, 60,113 db 61,113, 62,113, 63,113, 64,113, 65,113, 66,113, 67,113, 68,113, 69,113, 70,113, 71,113, 72,113, 73,113, 74,113, 75,113, 76,113, 77,113, 78,113, 79,113, 80,113 db 81,113, 82,113, 83,113, 84,113, 85,113, 86,113, 87,113, 88,113, 89,113, 90,113, 91,113, 92,113, 93,113, 94,113, 95,113, 96,113, 97,113, 98,113, 99,113, 0x00 """ name = 'VIRTUAL_ONE' hex[name] = True CurvesSet[name] = """ db 0x01, 0x33, 0x02, 0x33, 0x03, 0x33, 0x04, 0x33, 0x05, 0x33, 0x06, 0x33 db 0x07, 0x33, 0x08, 0x33, 0x09, 0x33, 0x0A, 0x33, 0x0B, 0x33, 0x0C, 0x33 db 0x0D, 0x33, 0x0E, 0x33, 0x0F, 0x33, 0x10, 0x33, 0x11, 0x33, 0x12, 0x33 db 0x13, 0x33, 0x14, 0x33, 0x15, 0x39, 0x16, 0x3F, 0x17, 0x46, 0x18, 0x4C db 0x19, 0x52, 0x1A, 0x59, 0x1B, 0x5F, 0x1C, 0x66, 0x1D, 0x6C, 0x1E, 0x72 db 0x1F, 0x7A, 0x20, 0x82, 0x21, 0x89, 0x22, 0x91, 0x23, 0x99, 0x24, 0xA0 db 0x25, 0xA8, 0x26, 0xAF, 0x27, 0xB7, 0x28, 0xBF, 0x29, 0xBF, 0x2A, 0xBF db 0x2B, 0xBF, 0x2C, 0xBF, 0x2D, 0xBF, 0x2E, 0xBF, 0x2F, 0xBF, 0x30, 0xBF db 0x31, 0xBF, 0x32, 0xBF, 0x33, 0xBF, 0x34, 0xBF, 0x35, 0xBF, 0x36, 0xBF db 0x37, 0xBF, 0x38, 0xBF, 0x39, 0xBF, 0x3A, 0xBF, 0x3B, 0xBF, 0x3C, 0xBF db 0x3D, 0xBF, 0x3E, 0xBF, 0x3F, 0xBF, 0x40, 0xBF, 0x41, 0xBF, 0x42, 0xBF db 0x43, 0xBF, 0x44, 0xBF, 0x45, 0xBF, 0x46, 0xBF, 0x47, 0xBF, 0x48, 0xBF db 0x49, 0xBF, 0x4A, 0xBF, 0x4B, 0xBF, 0x4C, 0xBF, 0x4D, 0xBF, 0x4E, 0xBF db 0x4F, 0xBF, 0x50, 0xBF, 0x51, 0xBF, 0x52, 0xBF, 0x53, 0xBF, 0x54, 0xBF db 0x55, 0xBF, 0x56, 0xFE, 0x57, 0xFE, 0x58, 0xFE, 0x59, 0xFE, 0x5A, 0xFE db 0x5B, 0xFE, 0x5C, 0xFE, 0x5D, 0xFE, 0x5E, 0xFE, 0x5F, 0xFE, 0x60, 0xFE db 0x61, 0xFE, 0x62, 0xFE, 0x63, 0xFE, 0x00 """ # Собираем набор имен # Insert a row of data INSET_REQ = 'INSERT INTO stocks VALUES (' fullReq = INSET_REQ+" '"+name+"','"+ CurvesSet[name] +" ',"+str(int(hex[name]))+")" try: c.execute( fullReq ) except sqlite3.IntegrityError: print "Exist" # закрываем базу #c.close() #return None # Save (commit) the changes conn.commit() # Выворачиваем всю базу #for row in c.execute('SELECT NameCurve FROM stocks ORDER BY id'): for row in c.execute("SELECT * FROM stocks"):# WHERE NameCurve = 'VIRTUAL_ONE_0'"): print row # We can also close the cursor if we are done with it c.close() #return None
56
184
0.587951
1,205
5,992
2.912863
0.294606
0.013675
0.021368
0.023932
0.31567
0.31567
0.303134
0.287179
0.287179
0.287179
0
0.47484
0.21729
5,992
107
185
56
0.273561
0.065421
0
0.275
0
0.45
0.877284
0
0
0
0.145468
0
0
0
null
null
0
0.0125
null
null
0.025
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
f290b791885d4d3cf7180f249c81061fd1069873
53
py
Python
lizardanalysis/utils/__init__.py
JojoReikun/ClimbingLizardDLCAnalysis
6cc38090217a3ffd4860ef6d06ba7967d3c10b7c
[ "MIT" ]
1
2021-03-09T19:12:44.000Z
2021-03-09T19:12:44.000Z
lizardanalysis/utils/__init__.py
JojoReikun/ClimbingLizardDLCAnalysis
6cc38090217a3ffd4860ef6d06ba7967d3c10b7c
[ "MIT" ]
null
null
null
lizardanalysis/utils/__init__.py
JojoReikun/ClimbingLizardDLCAnalysis
6cc38090217a3ffd4860ef6d06ba7967d3c10b7c
[ "MIT" ]
null
null
null
from lizardanalysis.utils.auxiliaryfunctions import *
53
53
0.886792
5
53
9.4
1
0
0
0
0
0
0
0
0
0
0
0
0.056604
53
1
53
53
0.94
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
f29157831d19478d2f9698d1b2a7c2a7fad227c3
124
py
Python
osu_map_gen/train/__init__.py
Syps/osu_beatmap_generator
684b5356bbf79ba847b3ab20e2b6b3a73d7721ad
[ "MIT" ]
15
2018-11-28T12:00:53.000Z
2022-02-04T05:56:45.000Z
osu_map_gen/train/__init__.py
Syps/osu_beatmap_generator
684b5356bbf79ba847b3ab20e2b6b3a73d7721ad
[ "MIT" ]
3
2020-07-16T11:40:33.000Z
2021-06-15T15:13:25.000Z
osu_map_gen/train/__init__.py
Syps/osu_beatmap_generator
684b5356bbf79ba847b3ab20e2b6b3a73d7721ad
[ "MIT" ]
4
2020-11-12T09:12:39.000Z
2021-12-26T16:35:11.000Z
import sys from .. import definitions # load submodule files into python path # sys.path.append(definitions.MODULE_PATH)
15.5
42
0.782258
17
124
5.647059
0.705882
0
0
0
0
0
0
0
0
0
0
0
0.145161
124
7
43
17.714286
0.90566
0.629032
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
f2a48c5c27bd3992f95e57ad139de2cd7edfa95d
184
py
Python
replay-topo/init.py
Cyphysecurity/ICS-SDN-1
c04d9e7bb7ad945166e969e071a2f82fb5bd18bf
[ "MIT" ]
4
2019-12-17T08:59:57.000Z
2022-01-09T19:52:27.000Z
replay-topo/init.py
Cyphysecurity/ICS-SDN-1
c04d9e7bb7ad945166e969e071a2f82fb5bd18bf
[ "MIT" ]
3
2020-08-13T16:05:46.000Z
2021-10-17T07:49:33.000Z
replay-topo/init.py
Cyphysecurity/ICS-SDN-1
c04d9e7bb7ad945166e969e071a2f82fb5bd18bf
[ "MIT" ]
4
2017-06-14T23:41:50.000Z
2021-03-01T18:54:03.000Z
from minicps.states import SQLiteState from utils import PATH, SCHEMA, SCHEMA_INIT if __name__ == "__main__": SQLiteState._create(PATH, SCHEMA) SQLiteState._init(PATH, SCHEMA_INIT)
26.285714
43
0.798913
24
184
5.625
0.541667
0.222222
0
0
0
0
0
0
0
0
0
0
0.11413
184
6
44
30.666667
0.828221
0
0
0
0
0
0.043478
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f2acf36dc6007fa2d5132a6acac07a07686fdaa9
67
py
Python
org/bash/frame/handler.py
Kai-Builder/kobash
7f3c6fbcb129fd4ea709b07c50c624db4d82a1ca
[ "BSD-3-Clause" ]
null
null
null
org/bash/frame/handler.py
Kai-Builder/kobash
7f3c6fbcb129fd4ea709b07c50c624db4d82a1ca
[ "BSD-3-Clause" ]
null
null
null
org/bash/frame/handler.py
Kai-Builder/kobash
7f3c6fbcb129fd4ea709b07c50c624db4d82a1ca
[ "BSD-3-Clause" ]
null
null
null
from org.scripts.lib.libraries.linuxsystemX64.scriptEngine import *
67
67
0.865672
8
67
7.25
1
0
0
0
0
0
0
0
0
0
0
0.03125
0.044776
67
1
67
67
0.875
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
4b300799b9b205cef828c468b22c940c68d9437e
681
py
Python
Gathered CTF writeups/ptr-yudai-writeups/2019/Teaser_CONFidence_2019_CTF/oldschool/decode.py
mihaid-b/CyberSakura
f60e6b6bfd6898c69b84424b080090ae98f8076c
[ "MIT" ]
1
2022-03-27T06:00:41.000Z
2022-03-27T06:00:41.000Z
Gathered CTF writeups/ptr-yudai-writeups/2019/Teaser_CONFidence_2019_CTF/oldschool/decode.py
mihaid-b/CyberSakura
f60e6b6bfd6898c69b84424b080090ae98f8076c
[ "MIT" ]
null
null
null
Gathered CTF writeups/ptr-yudai-writeups/2019/Teaser_CONFidence_2019_CTF/oldschool/decode.py
mihaid-b/CyberSakura
f60e6b6bfd6898c69b84424b080090ae98f8076c
[ "MIT" ]
1
2022-03-27T06:01:42.000Z
2022-03-27T06:01:42.000Z
route = [(1, -1), (1, 1), (1, -1), (-1, 1), (-1, 1), (1, -1), (1, -1), (1, 1), (-1, -1), (1, 1), (1, -1), (-1, 1), (1, -1), (-1, 1), (-1, 1), (-1, -1), (1, -1), (1, 1), (-1, -1), (1, -1), (1, -1), (1, 1), (1, -1), (-1, 1), (-1, 1), (-1, 1), (-1, -1), (1, -1), (1, -1), (1, 1), (-1, -1), (1, 1), (1, -1), (1, -1), (-1, -1), (-1, -1)] route.reverse() result = '' bit = '' i = 0 for move in route: if move[0] == 1: bit += '1' elif move[0] == -1: bit += '0' if move[1] == 1: bit += '1' elif move[1] == -1: bit += '0' i += 1 if i == 4: result += bit[::-1] bit = '' i = 0 print(result) print(len(route))
27.24
332
0.309838
123
681
1.715447
0.121951
0.691943
0.995261
1.308057
0.464455
0.341232
0.341232
0.341232
0.341232
0.341232
0
0.19181
0.318649
681
24
333
28.375
0.262931
0
0
0.380952
0
0
0.005874
0
0
0
0
0
0
1
0
false
0
0
0
0
0.095238
0
0
1
null
1
1
1
0
0
0
0
0
0
0
0
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
4b32f224d6c6a2586e2548c03aff5fc282f800a8
202
py
Python
__init__.py
cod3licious/simec
45392475debc37883a79eddb0e90f2669ce0a44e
[ "MIT" ]
28
2016-11-05T16:05:04.000Z
2022-03-05T15:47:45.000Z
__init__.py
cod3licious/simec
45392475debc37883a79eddb0e90f2669ce0a44e
[ "MIT" ]
4
2018-04-28T03:10:50.000Z
2020-06-26T13:59:52.000Z
__init__.py
cod3licious/simec
45392475debc37883a79eddb0e90f2669ce0a44e
[ "MIT" ]
5
2017-02-10T11:54:37.000Z
2022-02-17T13:45:45.000Z
from __future__ import unicode_literals, division, print_function, absolute_import from .simec import SimilarityEncoder, masked_mse, masked_binary_crossentropy, LastLayerReg from .utils import center_K
50.5
90
0.871287
25
202
6.6
0.76
0
0
0
0
0
0
0
0
0
0
0
0.089109
202
3
91
67.333333
0.896739
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4baab62ce0176a048e4a86f509579ccedbf3c77f
4,663
py
Python
evalne/evaluation/edge_embeddings.py
bhevencious/EvalNE
a62bd11901ea891535f6cb2a05e7abb65b1f3e6f
[ "MIT" ]
null
null
null
evalne/evaluation/edge_embeddings.py
bhevencious/EvalNE
a62bd11901ea891535f6cb2a05e7abb65b1f3e6f
[ "MIT" ]
null
null
null
evalne/evaluation/edge_embeddings.py
bhevencious/EvalNE
a62bd11901ea891535f6cb2a05e7abb65b1f3e6f
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Mara Alexandru Cristian # Contact: alexandru.mara@ugent.be # Date: 18/12/2018 # This code provides implementations of several methods for computing edge embeddings from given node feature vectors. from __future__ import division import numpy as np def average(X, ebunch): r""" Compute the edge embeddings all node pairs (u,v) in ebunch as the average of the embeddings of u and v. Parameters ---------- X : dict A dictionary where keys are nodes in the graph and values are the node embeddings. The keys are of type str and the values of type array. ebunch : iterable of node pairs The edges, as pairs (u,v), for which the embedding will be computed. Returns ------- edge_embeds : matrix A Numpy matrix containing the edge embeddings in the same order as ebunch. """ edge_embeds = np.zeros((len(ebunch), len(X[list(X.keys())[0]]))) i = 0 for edge in ebunch: edge_embeds[i] = (X[str(edge[0])] + X[str(edge[1])]) / 2.0 i += 1 return edge_embeds def hadamard(X, ebunch): r""" Compute the edge embeddings all node pairs (u,v) in ebunch as the hadamard distance of the embeddings of u and v. Parameters ---------- X : dict A dictionary where keys are nodes in the graph and values are the node embeddings. The keys are of type str and the values of type array. ebunch : iterable of node pairs The edges, as pairs (u,v), for which the embedding will be computed. Returns ------- edge_embeds : matrix A Numpy matrix containing the edge embeddings in the same order as ebunch. """ edge_embeds = np.zeros((len(ebunch), len(X[list(X.keys())[0]]))) i = 0 for edge in ebunch: edge_embeds[i] = X[str(edge[0])] * X[str(edge[1])] i += 1 return edge_embeds def weighted_l1(X, ebunch): r""" Compute the edge embeddings all node pairs (u,v) in ebunch as the weighted l1 distance of the embeddings of u and v. Parameters ---------- X : dict A dictionary where keys are nodes in the graph and values are the node embeddings. The keys are of type str and the values of type array. ebunch : iterable of node pairs The edges, as pairs (u,v), for which the embedding will be computed. Returns ------- edge_embeds : matrix A Numpy matrix containing the edge embeddings in the same order as ebunch. """ edge_embeds = np.zeros((len(ebunch), len(X[list(X.keys())[0]]))) i = 0 for edge in ebunch: edge_embeds[i] = np.abs(X[str(edge[0])] - X[str(edge[1])]) i += 1 return edge_embeds def weighted_l2(X, ebunch): r""" Compute the edge embeddings all node pairs (u,v) in ebunch as the weighted l2 distance of the embeddings of u and v. Parameters ---------- X : dict A dictionary where keys are nodes in the graph and values are the node embeddings. The keys are of type str and the values of type array. ebunch : iterable of node pairs The edges, as pairs (u,v), for which the embedding will be computed. Returns ------- edge_embeds : matrix A Numpy matrix containing the edge embeddings in the same order as ebunch. """ edge_embeds = np.zeros((len(ebunch), len(X[list(X.keys())[0]]))) i = 0 for edge in ebunch: edge_embeds[i] = np.power(X[str(edge[0])] - X[str(edge[1])], 2) i += 1 return edge_embeds def compute_edge_embeddings(X, ebunch, method='hadamard'): r""" Helper method to call any of the edge embedding methods using a simple string parameter. Parameters ---------- X : dict A dictionary where keys are nodes in the graph and values are the node embeddings. The keys are of type str and the values of type array. ebunch : iterable of node pairs The edges, as pairs (u,v), for which the embedding will be computed. method : string, optional The method to be used for computing the embeddings. Options are: average, hadamard, l1 or l2. Default is hadamard. Returns ------- edge_embeds : matrix A Numpy matrix containing the edge embeddings in the same order as ebunch. """ if method == 'hadamard': return hadamard(X, ebunch) elif method == 'average': return average(X, ebunch) elif method == 'weighted_l1': return weighted_l1(X, ebunch) elif method == 'weighted_l2': return weighted_l2(X, ebunch) else: raise ValueError("Unknown method!")
32.381944
120
0.634999
706
4,663
4.152975
0.161473
0.057981
0.052183
0.027285
0.77899
0.761937
0.747613
0.747613
0.747613
0.740791
0
0.012277
0.266352
4,663
143
121
32.608392
0.844782
0.628565
0
0.434783
0
0
0.042283
0
0
0
0
0
0
1
0.108696
false
0
0.043478
0
0.326087
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
29f6f65b6a9382bcd6bd1fffa765871ec71749d7
141
py
Python
modules/__init__.py
Kandongwe/RunestoneServer
f555868521b3717beec0ec42dbcbcb443c64686c
[ "MIT" ]
344
2015-10-15T20:03:57.000Z
2022-03-25T18:37:42.000Z
modules/__init__.py
Kandongwe/RunestoneServer
f555868521b3717beec0ec42dbcbcb443c64686c
[ "MIT" ]
1,170
2015-10-15T08:17:03.000Z
2022-03-28T14:32:47.000Z
modules/__init__.py
Kandongwe/RunestoneServer
f555868521b3717beec0ec42dbcbcb443c64686c
[ "MIT" ]
278
2015-10-12T23:44:38.000Z
2022-03-19T09:22:47.000Z
# ************************** # |docname| - web2py modules # ************************** # .. toctree:: # :maxdepth: 2 # :glob: # # *.py
15.666667
28
0.297872
8
141
5.25
1
0
0
0
0
0
0
0
0
0
0
0.017391
0.184397
141
8
29
17.625
0.347826
0.879433
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
4b1040252af7799ab2d710177f8047301d1ef7f6
301
py
Python
OLD CODE/Robotics/buzzer.py
ahmetakif/Voice-Controlled-Raspberry-Pi-Robot
00dcc15dfbb7441d6403fb0467b2144e8750cc0c
[ "Apache-2.0" ]
5
2019-08-21T08:08:27.000Z
2021-06-14T06:56:50.000Z
Robotics/robo/buzzer.py
ahmetakif/Voice-Controlled-Raspberry-Pi-Robot
00dcc15dfbb7441d6403fb0467b2144e8750cc0c
[ "Apache-2.0" ]
null
null
null
Robotics/robo/buzzer.py
ahmetakif/Voice-Controlled-Raspberry-Pi-Robot
00dcc15dfbb7441d6403fb0467b2144e8750cc0c
[ "Apache-2.0" ]
2
2019-08-21T08:16:58.000Z
2021-04-07T11:56:11.000Z
import RPi.GPIO as gpio import time gpio.setmode(gpio.BCM) gpio.setup(21,gpio.OUT) gpio.output(21,1) time.sleep(0.1) gpio.output(21,0) time.sleep(0.1) gpio.output(21,1) time.sleep(0.1) gpio.output(21,0) time.sleep(0.1) gpio.output(21,1) time.sleep(0.1) gpio.output(21,0) gpio.cleanup()
9.40625
23
0.694352
62
301
3.370968
0.241935
0.287081
0.344498
0.263158
0.636364
0.636364
0.636364
0.636364
0.636364
0.636364
0
0.112782
0.116279
301
31
24
9.709677
0.672932
0
0
0.6875
0
0
0
0
0
0
0
0
0
1
0
true
0
0.125
0
0.125
0
0
0
0
null
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
8a2062dd086e1a6fdb0d2f3ca923411c91d9d346
393
py
Python
snowplow_tracker/__init__.py
vicrep/snowplow-python-tracker
a2c50de16afa32a6fa4ee46d83c2be2b70dbee44
[ "Apache-2.0" ]
1
2021-09-01T14:23:16.000Z
2021-09-01T14:23:16.000Z
snowplow_tracker/__init__.py
vicrep/snowplow-python-tracker
a2c50de16afa32a6fa4ee46d83c2be2b70dbee44
[ "Apache-2.0" ]
1
2019-01-08T17:09:11.000Z
2019-01-08T17:09:11.000Z
snowplow_tracker/__init__.py
vicrep/snowplow-python-tracker
a2c50de16afa32a6fa4ee46d83c2be2b70dbee44
[ "Apache-2.0" ]
1
2019-05-10T22:37:16.000Z
2019-05-10T22:37:16.000Z
from snowplow_tracker._version import __version__ from snowplow_tracker.subject import Subject from snowplow_tracker.emitters import logger, Emitter, AsyncEmitter, CeleryEmitter, RedisEmitter from snowplow_tracker.self_describing_json import SelfDescribingJson from snowplow_tracker.tracker import Tracker from contracts import disable_all as disable_contracts, enable_all as enable_contracts
56.142857
96
0.890585
49
393
6.816327
0.428571
0.179641
0.284431
0
0
0
0
0
0
0
0
0
0.083969
393
6
97
65.5
0.927778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
0
0
0
0
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
8a2743e9f349800044dadf1fe5647a2088ecae8f
127
py
Python
client/admin.py
alexbali/authentication-lab
83705ec162d7bec8d01cad0725a4fdfc43c6a02c
[ "MIT" ]
null
null
null
client/admin.py
alexbali/authentication-lab
83705ec162d7bec8d01cad0725a4fdfc43c6a02c
[ "MIT" ]
null
null
null
client/admin.py
alexbali/authentication-lab
83705ec162d7bec8d01cad0725a4fdfc43c6a02c
[ "MIT" ]
null
null
null
from django.contrib import admin from rest_framework.authtoken.admin import TokenAdmin TokenAdmin.raw_id_fields = ('user',)
18.142857
53
0.811024
17
127
5.882353
0.764706
0
0
0
0
0
0
0
0
0
0
0
0.110236
127
6
54
21.166667
0.884956
0
0
0
0
0
0.031746
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
8a2e6436e184ccb771a4977106c41d31ab05fd1d
60
py
Python
exdir/plugins/__init__.py
knc-neural-calculus/exdir
5448d41d60c0583892ab7bcf10342d8fb2f2a26b
[ "MIT" ]
67
2017-10-25T11:08:59.000Z
2022-02-25T18:04:36.000Z
exdir/plugins/__init__.py
knc-neural-calculus/exdir
5448d41d60c0583892ab7bcf10342d8fb2f2a26b
[ "MIT" ]
107
2017-02-03T16:50:53.000Z
2022-03-18T04:18:14.000Z
exdir/plugins/__init__.py
knc-neural-calculus/exdir
5448d41d60c0583892ab7bcf10342d8fb2f2a26b
[ "MIT" ]
11
2018-09-11T11:05:44.000Z
2022-02-13T10:37:09.000Z
# from . import quantities # from . import numpy_attributes
20
32
0.766667
7
60
6.428571
0.714286
0.444444
0
0
0
0
0
0
0
0
0
0
0.166667
60
2
33
30
0.9
0.916667
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
8a33b57a0be7ab967dcfe25148d6158c661b0300
43
py
Python
scitorch/_device.py
christophfritz/scitorch
64660a42bf70ad0d5da848a55fa4bc8b0bcc559e
[ "Apache-2.0" ]
null
null
null
scitorch/_device.py
christophfritz/scitorch
64660a42bf70ad0d5da848a55fa4bc8b0bcc559e
[ "Apache-2.0" ]
6
2019-01-15T10:38:22.000Z
2019-03-13T22:09:55.000Z
scitorch/_device.py
christophfritz/scitorch
64660a42bf70ad0d5da848a55fa4bc8b0bcc559e
[ "Apache-2.0" ]
null
null
null
import torch DEVICE = torch.device('cpu')
14.333333
28
0.72093
6
43
5.166667
0.666667
0.709677
0
0
0
0
0
0
0
0
0
0
0.139535
43
3
28
14.333333
0.837838
0
0
0
0
0
0.068182
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
76d219c72a9fbf7a3485f7e0400fb1a3452e431f
9,065
py
Python
tests/test_orders.py
ChukwuEmekaAjah/buycoins_python
86547aa742364a0e308b1dfb5f7c73b4467b1e06
[ "MIT" ]
1
2021-03-25T19:28:48.000Z
2021-03-25T19:28:48.000Z
tests/test_orders.py
ChukwuEmekaAjah/buycoins_python
86547aa742364a0e308b1dfb5f7c73b4467b1e06
[ "MIT" ]
null
null
null
tests/test_orders.py
ChukwuEmekaAjah/buycoins_python
86547aa742364a0e308b1dfb5f7c73b4467b1e06
[ "MIT" ]
null
null
null
from buycoins_client import Auth from buycoins_client import Orders import unittest from unittest.mock import patch class MockResponse: def __init__(self, json_data, status_code): self.json_data = json_data self.status_code = status_code def json(self): return self.json_data class TestOrdersMethods(unittest.TestCase): def test_invalid_status_type(self): """ Should throw an exception for status parameter type that is not a string """ try: Orders.list_my_orders(3) except Exception as e: self.assertEqual(str(e), "status parameter is compulsory and it is a string. Default is 'open'") def test_invalid_status(self): """ Should throw an exception for invalid status parameter """ try: Orders.list_my_orders("closed") except Exception as e: self.assertEqual(str(e), "Personal orders status can only be 'open' or 'completed'.") def test_absent_cryptocurrency_for_post_limit_order(self): """ Should throw an exception for a args without a cryptocurrency key """ args = { "orderSide": "buy", "priceType": "dynamic", "coinAmount": 0.001 } try: Orders.post_limit_order(args) except Exception as e: self.assertEqual(str(e), "cryptocurrency argument must be a valid string identifier.") def test_absent_orderSide_for_post_limit_order(self): """ Should throw an exception for a args without a cryptocurrency key """ args = { "cryptocurrency": "bitcoin", "priceType": "dynamic", "coinAmount": 0.001 } try: Orders.post_limit_order(args) except Exception as e: self.assertEqual(str(e), "orderSide argument must be a valid string that is either 'buy' or 'sell'") def test_absent_priceType_for_post_limit_order(self): """ Should throw an exception for a args without a cryptocurrency key """ args = { "cryptocurrency": "bitcoin", "coinAmount": 0.001, "orderSide":"buy" } try: Orders.post_limit_order(args) except Exception as e: self.assertEqual(str(e), "priceType argument must be a valid string that is either 'dynamic' or 'static'") def test_absent_coinAmount_for_post_limit_order(self): """ Should throw an exception for a args without a cryptocurrency key """ args = { "cryptocurrency": "bitcoin", "priceType": "dynamic", "orderSide":"buy" } try: Orders.post_limit_order(args) except Exception as e: self.assertEqual(str(e), "coinAmount argument must be a valid float and greater than 0.") def test_invalid_staticPrice_for_post_limit_order(self): """ Should throw an exception for a args without a cryptocurrency key """ args = { "cryptocurrency": "bitcoin", "priceType": "dynamic", "orderSide":"buy", "coinAmount": 0.01, "staticPrice":"ajdf" } try: Orders.post_limit_order(args) except Exception as e: self.assertEqual(str(e), "staticPrice argument must be a valid float and greater than 0.") def test_invalid_dynamicPrice_for_post_limit_order(self): """ Should throw an exception for a args without a cryptocurrency key """ args = { "cryptocurrency": "bitcoin", "priceType": "dynamic", "orderSide":"buy", "coinAmount": 0.01, "dynamicPrice":"ajdf" } try: Orders.post_limit_order(args) except Exception as e: self.assertEqual(str(e), "dynamicPrice argument must be a valid float and greater than 0.") def test_invalid_field(self): """ Should throw an exception for a node dict without a field property """ try: Orders.list_my_orders("completed", [{"field":"cryptocrrency"}, {"name":"chuks"}]) except Exception as e: self.assertEqual(str(e), "Fields contains a node dict without a 'field' property.") @patch('buycoins_client.Orders.requests.post') # Mock 'requests' module 'post' method. def test_failed_list_my_orders(self, mock_post): """ Should return a failure status when invalid node is requested. """ mock_post.return_value = MockResponse({"errors":[{"message":"Field 'edgesa' doesn't exist on type 'PostOrderConnection'","locations":[{"line":1,"column":59}],"path":["query","getOrders","orders","edgesa"],"extensions":{"code":"undefinedField","typeName":"PostOrderConnection","fieldName":"edgesa"}}]}, 200) Auth.setup("chuks", "emeka") response = Orders.list_my_orders("completed", []) self.assertEqual(response['status'], "failure") self.assertEqual(response["errors"][0]["reason"], "Field 'edgesa' doesn't exist on type 'PostOrderConnection'") @patch('buycoins_client.Orders.requests.post') # Mock 'requests' module 'post' method. def test_successful_list_my_orders(self, mock_post): """ Should return a success status for successful personal orders retrieval """ mock_post.return_value = MockResponse({"data":{"getOrders":{"dynamicPriceExpiry":1612396362,"orders":{"edges":[]}}}}, 200) Auth.setup("chuks", "emeka") response = Orders.list_my_orders(status="open", fields=[]) self.assertEqual(response['status'], "success") self.assertEqual(response["data"]["getOrders"]["dynamicPriceExpiry"], 1612396362) @patch('buycoins_client.Orders.requests.post') # Mock 'requests' module 'post' method. def test_failed_list_market_orders(self, mock_post): """ Should return a failure status when invalid node is requested. """ mock_post.return_value = MockResponse({"errors":[{"message":"Field 'edgesa' doesn't exist on type 'PostOrderConnection'","locations":[{"line":1,"column":59}],"path":["query","getMarketBook","orders","edgesa"],"extensions":{"code":"undefinedField","typeName":"PostOrderConnection","fieldName":"edgesa"}}]}, 200) Auth.setup("chuks", "emeka") response = Orders.list_market_orders([]) self.assertEqual(response['status'], "failure") self.assertEqual(response["errors"][0]["reason"], "Field 'edgesa' doesn't exist on type 'PostOrderConnection'") @patch('buycoins_client.Orders.requests.post') # Mock 'requests' module 'post' method. def test_successful_list_market_orders(self, mock_post): """ Should return a success status for successful personal orders retrieval """ mock_post.return_value = MockResponse({"data":{"getMarketBook":{"dynamicPriceExpiry":1612396362,"orders":{"edges":[]}}}}, 200) Auth.setup("chuks", "emeka") response = Orders.list_market_orders(fields=[]) self.assertEqual(response['status'], "success") self.assertEqual(response["data"]["getMarketBook"]["dynamicPriceExpiry"], 1612396362) @patch('buycoins_client.Orders.requests.post') # Mock 'requests' module 'post' method. def test_successful_post_limit_order(self, mock_post): """ Should return a success status for successful list order posting """ mock_post.return_value = MockResponse({"data":{"postLimitOrder":{"id":"bDAd8slaAFDajd829slsf"}}}, 200) Auth.setup("chuks", "emeka") args = { "orderSide": "buy", "priceType": "dynamic", "cryptocurrency": "bitcoin", "coinAmount": 0.001 } response = Orders.post_limit_order(args, fields=[]) self.assertEqual(response['status'], "success") self.assertEqual(response["data"]["postLimitOrder"]["id"], "bDAd8slaAFDajd829slsf") @patch('buycoins_client.Orders.requests.post') # Mock 'requests' module 'post' method. def test_successful_post_market_order(self, mock_post): """ Should return a success status for successful market order posting """ mock_post.return_value = MockResponse({"data":{"postMarketOrder":{"id":"adfFDAFDajd829slsf"}}}, 200) Auth.setup("chuks", "emeka") args = { "orderSide": "buy", "cryptocurrency": "bitcoin", "coinAmount": 0.001 } response = Orders.post_market_order(args, fields=[]) self.assertEqual(response['status'], "success") self.assertEqual(response["data"]["postMarketOrder"]["id"], "adfFDAFDajd829slsf") if __name__ == '__main__': unittest.main()
40.288889
318
0.609266
960
9,065
5.605208
0.15
0.058539
0.036424
0.028433
0.811188
0.7874
0.77179
0.75525
0.68333
0.666233
0
0.016534
0.266078
9,065
224
319
40.46875
0.792274
0.134694
0
0.537931
0
0
0.303646
0.046011
0
0
0
0
0.144828
1
0.117241
false
0
0.027586
0.006897
0.165517
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
76dc711d032abc2d783277dc6a30d1e7ef8b6903
19
py
Python
hello_world.py
Sahinovic/profiles-rest-api
054744d87d187ebe21eeae6c252db2fbda1ba5a3
[ "MIT" ]
null
null
null
hello_world.py
Sahinovic/profiles-rest-api
054744d87d187ebe21eeae6c252db2fbda1ba5a3
[ "MIT" ]
null
null
null
hello_world.py
Sahinovic/profiles-rest-api
054744d87d187ebe21eeae6c252db2fbda1ba5a3
[ "MIT" ]
null
null
null
print('heloo word')
19
19
0.736842
3
19
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.052632
19
1
19
19
0.777778
0
0
0
0
0
0.5
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
76e77cd68434c4fc2cb6eb4acaf50eb44dc1d9da
98
py
Python
dating_skeleton.py
beluzoni/Machine-Learning-Fundamentals
5d6e4f8cafe25479f98e6cd50c5ae5dec37691df
[ "MIT" ]
null
null
null
dating_skeleton.py
beluzoni/Machine-Learning-Fundamentals
5d6e4f8cafe25479f98e6cd50c5ae5dec37691df
[ "MIT" ]
1
2019-01-07T22:09:09.000Z
2019-01-07T22:09:09.000Z
dating_skeleton.py
beluzoni/Machine-Learning-Fundamentals
5d6e4f8cafe25479f98e6cd50c5ae5dec37691df
[ "MIT" ]
null
null
null
import pandas as pd import numpy as np from matplotlib import pyplot as plt #Create your df here:
19.6
36
0.795918
18
98
4.333333
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.183673
98
5
37
19.6
0.975
0.204082
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
76ee2f1be9aa87a673ac4165b0968ff6682de36e
81
py
Python
src/android/toga_android/widgets/box.py
d3r3kk/toga
2d8c0eb30371c4ef4f0610251233569e9c618e93
[ "BSD-3-Clause" ]
1
2021-05-05T14:36:08.000Z
2021-05-05T14:36:08.000Z
src/android/toga_android/widgets/box.py
d3r3kk/toga
2d8c0eb30371c4ef4f0610251233569e9c618e93
[ "BSD-3-Clause" ]
null
null
null
src/android/toga_android/widgets/box.py
d3r3kk/toga
2d8c0eb30371c4ef4f0610251233569e9c618e93
[ "BSD-3-Clause" ]
null
null
null
from .base import Widget class Box(Widget): def create(self): pass
11.571429
24
0.62963
11
81
4.636364
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.283951
81
6
25
13.5
0.87931
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
76f75d3f3dce5e0e0a23602299b3da4e787944a8
38
py
Python
virtual/Lib/site-packages/pylint/test/regrtest_data/bad_package/__init__.py
JamesKimari/pitch-one
aac9007716bf2e3b6446588a06508fac068f3d20
[ "MIT" ]
35
2016-09-22T22:53:14.000Z
2020-02-13T15:12:21.000Z
virtual/Lib/site-packages/pylint/test/regrtest_data/bad_package/__init__.py
JamesKimari/pitch-one
aac9007716bf2e3b6446588a06508fac068f3d20
[ "MIT" ]
32
2018-05-01T05:24:43.000Z
2022-03-11T23:20:39.000Z
flask/Lib/site-packages/pylint/test/regrtest_data/bad_package/__init__.py
koyota79/weekly-report
a9f518965d9f51e81c13711a8b0bfda336eae2a0
[ "bzip2-1.0.6" ]
88
2016-11-27T02:16:11.000Z
2020-02-28T05:10:26.000Z
import missing raise missing.Missing..
19
23
0.842105
5
38
6.4
0.6
0
0
0
0
0
0
0
0
0
0
0
0.078947
38
2
23
19
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
5
0a23ac88a9c3c85806794f7489cc4a657db875dc
250
py
Python
virtualenv/Lib/site-packages/tdl/queue/abstractions/response/fatal_error_response.py
DPNT-Sourcecode/CHK-hbjk01
270d6dc5433845352a27ab5caa8bc1d5ecf1236c
[ "Apache-2.0" ]
null
null
null
virtualenv/Lib/site-packages/tdl/queue/abstractions/response/fatal_error_response.py
DPNT-Sourcecode/CHK-hbjk01
270d6dc5433845352a27ab5caa8bc1d5ecf1236c
[ "Apache-2.0" ]
7
2015-12-09T20:56:28.000Z
2020-01-27T12:48:17.000Z
virtualenv/Lib/site-packages/tdl/queue/abstractions/response/fatal_error_response.py
DPNT-Sourcecode/CHK-hbjk01
270d6dc5433845352a27ab5caa8bc1d5ecf1236c
[ "Apache-2.0" ]
1
2015-09-03T18:33:05.000Z
2015-09-03T18:33:05.000Z
class FatalErrorResponse: def __init__(self, message): self._message = message self.result = message self.id = "error" def get_audit_text(self): return 'error = "{0}", (NOT PUBLISHED)'.format(self._message)
22.727273
69
0.62
28
250
5.25
0.607143
0.22449
0
0
0
0
0
0
0
0
0
0.005405
0.26
250
10
70
25
0.789189
0
0
0
0
0
0.140562
0
0
0
0
0
0
1
0.285714
false
0
0
0.142857
0.571429
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
0a62a6dc6491517353481ccd653ab5277df773f4
122
py
Python
messengerext/events/admin.py
groupsome/groupsome
4edcf30d66ff458c4df37d3198ef187219a768d7
[ "MIT" ]
6
2016-10-07T13:43:17.000Z
2017-10-07T22:34:44.000Z
messengerext/events/admin.py
groupsome/groupsome
4edcf30d66ff458c4df37d3198ef187219a768d7
[ "MIT" ]
null
null
null
messengerext/events/admin.py
groupsome/groupsome
4edcf30d66ff458c4df37d3198ef187219a768d7
[ "MIT" ]
1
2020-07-15T04:29:31.000Z
2020-07-15T04:29:31.000Z
from django.contrib import admin from events.models import Event # Register your models here. admin.site.register(Event)
20.333333
32
0.811475
18
122
5.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.122951
122
5
33
24.4
0.925234
0.213115
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
6a61e19bd15516ab5146e6396e46688a06dcace1
29
py
Python
openstack_client/__init__.py
uzum/cran-orchestrator
c2235bf324c8c04e82960ca58ec49f2f700c065d
[ "MIT" ]
null
null
null
openstack_client/__init__.py
uzum/cran-orchestrator
c2235bf324c8c04e82960ca58ec49f2f700c065d
[ "MIT" ]
null
null
null
openstack_client/__init__.py
uzum/cran-orchestrator
c2235bf324c8c04e82960ca58ec49f2f700c065d
[ "MIT" ]
null
null
null
from .server import OCServer
14.5
28
0.827586
4
29
6
1
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.96
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
6a7765bea8cc2fa5f6cc039cb43fc441da9fbbfb
18
py
Python
dbt/adapters/sqlserver/__version__.py
alangsbo/dbt-sqlserver
87871676707e771461bc4a6e7db892d90d53ea7a
[ "MIT" ]
null
null
null
dbt/adapters/sqlserver/__version__.py
alangsbo/dbt-sqlserver
87871676707e771461bc4a6e7db892d90d53ea7a
[ "MIT" ]
null
null
null
dbt/adapters/sqlserver/__version__.py
alangsbo/dbt-sqlserver
87871676707e771461bc4a6e7db892d90d53ea7a
[ "MIT" ]
null
null
null
version = '0.18.1'
18
18
0.611111
4
18
2.75
1
0
0
0
0
0
0
0
0
0
0
0.25
0.111111
18
1
18
18
0.4375
0
0
0
0
0
0.315789
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
6a8fd727fa00fca8f37716747f17a670ba9b42c2
1,630
py
Python
GPU_Computer/catkin_ws/build/darknet_ros/darknet_ros_msgs/cmake/darknet_ros_msgs-genmsg-context.py
HYEON-JIN-KWON/Drone_Project
81d0ea6532f9edb27be7d1d534f3e48f302203d4
[ "MIT" ]
null
null
null
GPU_Computer/catkin_ws/build/darknet_ros/darknet_ros_msgs/cmake/darknet_ros_msgs-genmsg-context.py
HYEON-JIN-KWON/Drone_Project
81d0ea6532f9edb27be7d1d534f3e48f302203d4
[ "MIT" ]
null
null
null
GPU_Computer/catkin_ws/build/darknet_ros/darknet_ros_msgs/cmake/darknet_ros_msgs-genmsg-context.py
HYEON-JIN-KWON/Drone_Project
81d0ea6532f9edb27be7d1d534f3e48f302203d4
[ "MIT" ]
2
2021-05-18T07:04:23.000Z
2021-05-23T13:22:13.000Z
# generated from genmsg/cmake/pkg-genmsg.context.in messages_str = "/home/pnu/catkin_ws/src/darknet_ros/darknet_ros_msgs/msg/BoundingBox.msg;/home/pnu/catkin_ws/src/darknet_ros/darknet_ros_msgs/msg/BoundingBoxes.msg;/home/pnu/catkin_ws/src/darknet_ros/darknet_ros_msgs/msg/ObjectCount.msg;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg/CheckForObjectsAction.msg;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg/CheckForObjectsActionGoal.msg;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg/CheckForObjectsActionResult.msg;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg/CheckForObjectsActionFeedback.msg;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg/CheckForObjectsGoal.msg;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg/CheckForObjectsResult.msg;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg/CheckForObjectsFeedback.msg" services_str = "" pkg_name = "darknet_ros_msgs" dependencies_str = "actionlib_msgs;geometry_msgs;sensor_msgs;std_msgs" langs = "gencpp;geneus;genlisp;gennodejs;genpy" dep_include_paths_str = "darknet_ros_msgs;/home/pnu/catkin_ws/src/darknet_ros/darknet_ros_msgs/msg;darknet_ros_msgs;/home/pnu/catkin_ws/devel/share/darknet_ros_msgs/msg;actionlib_msgs;/opt/ros/melodic/share/actionlib_msgs/cmake/../msg;geometry_msgs;/opt/ros/melodic/share/geometry_msgs/cmake/../msg;sensor_msgs;/opt/ros/melodic/share/sensor_msgs/cmake/../msg;std_msgs;/opt/ros/melodic/share/std_msgs/cmake/../msg" PYTHON_EXECUTABLE = "/usr/bin/python2" package_has_static_sources = '' == 'TRUE' genmsg_check_deps_script = "/opt/ros/melodic/share/genmsg/cmake/../../../lib/genmsg/genmsg_check_deps.py"
135.833333
808
0.838037
253
1,630
5.106719
0.249012
0.147059
0.162539
0.139319
0.510062
0.44195
0.44195
0.420279
0.420279
0.420279
0
0.000627
0.020859
1,630
11
809
148.181818
0.808897
0.030061
0
0
1
0.222222
0.871438
0.848638
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
6a9c74cb85800ca6fa81559da1ab301d49d188bb
3,929
py
Python
cpp/cpp_if.py
btc-ag/revengtools
d58680ef7d6bdc8ef518860d5d13a5acc0d01758
[ "Apache-2.0" ]
2
2019-07-15T14:59:59.000Z
2022-01-18T14:23:54.000Z
cpp/cpp_if.py
btc-ag/revengtools
d58680ef7d6bdc8ef518860d5d13a5acc0d01758
[ "Apache-2.0" ]
10
2018-05-03T13:25:07.000Z
2021-06-25T15:14:55.000Z
cpp/cpp_if.py
btc-ag/revengtools
d58680ef7d6bdc8ef518860d5d13a5acc0d01758
[ "Apache-2.0" ]
1
2018-05-02T13:59:27.000Z
2018-05-02T13:59:27.000Z
#! /usr/bin/env python # -*- coding: UTF-8 -*- ''' Created on 22.09.2010 @author: SIGIESEC ''' from commons.config_if import AutoConfigurable from commons.core_if import EnumerationItem, Enumeration class HeaderListSupply(AutoConfigurable): def get_header_list(self): raise NotImplementedError(self.__class__) class CppLiterals(object): LINE_COMMENT_PREFIX = '//' class CppFileConfiguration(AutoConfigurable): def get_header_file_extensions(self): raise NotImplementedError(self.__class__) def get_implementation_file_extensions(self): raise NotImplementedError(self.__class__) def is_header_file(self, path): raise NotImplementedError(self.__class__) def is_implementation_file(self, path): raise NotImplementedError(self.__class__) class _CppFileType(EnumerationItem): pass class CppFileTypes(Enumeration): _type = _CppFileType ImplementationFile = _CppFileType() HeaderFile = _CppFileType() HeaderImplementationFile = _CppFileType() class CppDataSupply(AutoConfigurable): # TODO Semantik, wann werden Collections, wann nur (einmal verwendbare) Iterables zurück geliefert # -> Üblicherweise Iterables, außer wenn dies explizit anders gesagt ist """ @rtype: Iterable(str) """ def get_header_list(self): # TODO remove from this class, moved to HeaderListSupply raise NotImplementedError(self.__class__) def get_module_rootdirs(self): """ Returns a dictionary module name -> root dir (rel to main root). """ raise NotImplementedError(self.__class__) class FileToModuleMapSupply(AutoConfigurable): def get_module_to_header_file_map(self): raise NotImplementedError(self.__class__) def get_module_to_implementation_file_map(self): raise NotImplementedError(self.__class__) def get_module_to_header_file_map_final(self): raise NotImplementedError(self.__class__) def get_header_file_map_exceptions(self): raise NotImplementedError(self.__class__) def get_implementation_file_map_exceptions(self): raise NotImplementedError(self.__class__) def get_header_file_to_module_map(self, use_exceptions=True): raise NotImplementedError(self.__class__) def get_implementation_file_to_module_map(self, use_exceptions=True): raise NotImplementedError(self.__class__) def generate_file_to_module_map(self, use_exceptions=True): raise NotImplementedError(self.__class__) def generate_module_to_file_map(self, use_exceptions=True): raise NotImplementedError(self.__class__) class CppPaths(AutoConfigurable): """ @todo: move and rename CppPaths. It is not specific to Cpp, but rather to the Microsoft toolchain around VisualStudio, independent of the programming language. Other toolchains may also have module specifications, but their format and semantics will be different. """ def get_module_spec_basedir(self): raise NotImplementedError(self.__class__) def get_solution_file(self): raise NotImplementedError(self.__class__) class _VirtualModuleType(EnumerationItem): def __init__(self, suffix): self.__suffix = suffix def suffix(self): return self.__suffix class VirtualModuleTypes(Enumeration): _type = _VirtualModuleType DeclarationModule = _VirtualModuleType("_decl") HeaderModule = _VirtualModuleType("_inc") CombinedModule = _VirtualModuleType("_INC") ExtensionSubmodule = _VirtualModuleType("_ext") suffixes = None @staticmethod def remove_suffixes(module): if VirtualModuleTypes.suffixes == None: VirtualModuleTypes.suffixes = [value.suffix() for value in VirtualModuleTypes.values()] for suffix in VirtualModuleTypes.suffixes: module = module.replace(suffix, '') return module
32.471074
103
0.73632
412
3,929
6.61165
0.359223
0.15859
0.185022
0.218062
0.411894
0.381057
0.347651
0.270191
0.240455
0.171806
0
0.002823
0.188598
3,929
120
104
32.741667
0.851631
0.170018
0
0.28169
0
0
0.005962
0
0
0
0
0.025
0
1
0.295775
false
0.014085
0.028169
0.014085
0.647887
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
1
0
0
1
0
0
0
0
1
0
0
5
6abbf82251970cd2e5a311f6940fee0230da6099
538
py
Python
tests/y_2015/test_2015_day1.py
Stegallo/adventofcode
74cd3725318150a4fee397a9388326d56ca49333
[ "MIT" ]
4
2020-11-28T15:46:43.000Z
2021-12-02T22:37:27.000Z
tests/y_2015/test_2015_day1.py
Stegallo/adventofcode
74cd3725318150a4fee397a9388326d56ca49333
[ "MIT" ]
80
2020-07-02T19:01:20.000Z
2021-12-06T03:48:46.000Z
tests/y_2015/test_2015_day1.py
Stegallo/adventofcode
74cd3725318150a4fee397a9388326d56ca49333
[ "MIT" ]
2
2021-04-04T06:22:56.000Z
2021-05-03T20:23:51.000Z
from y_2015.day1 import calculate_1, calculate_2 def test_calculate_1(): assert calculate_1("(())") == 0 assert calculate_1("()()") == 0 assert calculate_1("(((") == 3 assert calculate_1("(()(()(") == 3 assert calculate_1("))(((((") == 3 assert calculate_1("())") == -1 assert calculate_1("))(") == -1 assert calculate_1(")))") == -3 assert calculate_1(")())())") == -3 def test_calculate_2(): assert calculate_2(")") == 1 assert calculate_2("()())") == 5 assert calculate_2("(") == -1
26.9
48
0.550186
65
538
4.261538
0.215385
0.649819
0.519856
0.306859
0.552347
0.552347
0.552347
0.364621
0.241877
0.241877
0
0.076923
0.202602
538
19
49
28.315789
0.568765
0
0
0
0
0
0.089219
0
0
0
0
0
0.8
1
0.133333
true
0
0.066667
0
0.2
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
6accff745a134496f560abe15e50b42be70294b6
13,817
py
Python
tests/unit/modules/test_parted.py
dmyerscough/salt
d7b19ab64f0695568f78c12b4ba209e033903804
[ "Apache-2.0" ]
1
2021-08-14T13:48:38.000Z
2021-08-14T13:48:38.000Z
tests/unit/modules/test_parted.py
dmyerscough/salt
d7b19ab64f0695568f78c12b4ba209e033903804
[ "Apache-2.0" ]
3
2015-03-31T14:44:05.000Z
2015-06-18T19:02:24.000Z
tests/unit/modules/test_parted.py
dmyerscough/salt
d7b19ab64f0695568f78c12b4ba209e033903804
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Dave Rawks (dave@pandora.com)` tests.unit.modules.parted_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import skipIf, TestCase from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch # Import Salt libs from salt.exceptions import CommandExecutionError import salt.modules.parted as parted @skipIf(NO_MOCK, NO_MOCK_REASON) class PartedTestCase(TestCase, LoaderModuleMockMixin): def setup_loader_modules(self): self.cmdrun = MagicMock() self.cmdrun_stdout = MagicMock() self.addCleanup(delattr, self, 'cmdrun') self.addCleanup(delattr, self, 'cmdrun_stdout') return { parted: { '__salt__': { 'cmd.run': self.cmdrun, 'cmd.run_stdout': self.cmdrun_stdout } } } # Test __virtual__ function for module registration def test_virtual_bails_on_windows(self): ''' If running windows, __virtual__ shouldn't register module ''' with patch('salt.utils.platform.is_windows', lambda: True): ret = parted.__virtual__() err = (False, 'The parted execution module failed to load Windows systems are not supported.') self.assertEqual(err, ret) def test_virtual_bails_without_parted(self): ''' If parted not in PATH, __virtual__ shouldn't register module ''' with patch('salt.utils.path.which', lambda exe: not exe == "parted"),\ patch('salt.utils.platform.is_windows', return_value=False): ret = parted.__virtual__() err = (False, 'The parted execution module failed to load parted binary is not in the path.') self.assertEqual(err, ret) def test_virtual_bails_without_lsblk(self): ''' If lsblk not in PATH, __virtual__ shouldn't register module ''' with patch('salt.utils.path.which', lambda exe: not exe == "lsblk"),\ patch('salt.utils.platform.is_windows', return_value=False): ret = parted.__virtual__() err = (False, 'The parted execution module failed to load lsblk binary is not in the path.') self.assertEqual(err, ret) def test_virtual_bails_without_partprobe(self): ''' If partprobe not in PATH, __virtual__ shouldn't register module ''' with patch('salt.utils.path.which', lambda exe: not exe == "partprobe"),\ patch('salt.utils.platform.is_windows', return_value=False): ret = parted.__virtual__() err = (False, 'The parted execution module failed to load partprobe binary is not in the path.') self.assertEqual(err, ret) def test_virtual(self): ''' On expected platform with correct utils in PATH, register "partition" module ''' with patch('salt.utils.platform.is_windows', lambda: False), \ patch('salt.utils.path.which', lambda exe: exe in ('parted', 'lsblk', 'partprobe')): ret = parted.__virtual__() expect = 'partition' self.assertEqual(ret, expect) # Test probe function def test_probe_wo_args(self): parted.probe() self.cmdrun.assert_called_once_with('partprobe -- ') def test_probe_w_single_arg(self): with patch('salt.modules.parted._validate_device', MagicMock()): parted.probe('/dev/sda') self.cmdrun.assert_called_once_with('partprobe -- /dev/sda') def test_probe_w_multiple_args(self): with patch('salt.modules.parted._validate_device', MagicMock()): parted.probe('/dev/sda', '/dev/sdb') self.cmdrun.assert_called_once_with('partprobe -- /dev/sda /dev/sdb') # Test _list function @staticmethod def parted_print_output(k): output = { "valid": ( '''BYT;\n''' '''/dev/sda:4000GB:scsi:512:512:gpt:AMCC 9650SE-24M DISK:;\n''' '''1:17.4kB:150MB:150MB:ext3::boot;\n''' '''2:3921GB:4000GB:79.3GB:linux-swap(v1)::;\n''' ), "valid_legacy": ( '''BYT;\n''' '''/dev/sda:4000GB:scsi:512:512:gpt:AMCC 9650SE-24M DISK;\n''' '''1:17.4kB:150MB:150MB:ext3::boot;\n''' '''2:3921GB:4000GB:79.3GB:linux-swap(v1)::;\n''' ), "empty": '', "bad_label_info": ( '''BYT;\n''' '''badbadbadbad\n''' '''1:17.4kB:150MB:150MB:ext3::boot;\n''' '''2:3921GB:4000GB:79.3GB:linux-swap(v1)::;\n''' ), "bad_header": ( '''badbadbadbad\n''' '''/dev/sda:4000GB:scsi:512:512:gpt:AMCC 9650SE-24M DISK:;\n''' '''1:17.4kB:150MB:150MB:ext3::boot;\n''' '''2:3921GB:4000GB:79.3GB:linux-swap(v1)::;\n''' ), "bad_partition": ( '''BYT;\n''' '''/dev/sda:4000GB:scsi:512:512:gpt:AMCC 9650SE-24M DISK:;\n''' '''badbadbadbad\n''' '''2:3921GB:4000GB:79.3GB:linux-swap(v1)::;\n''' ), } return output[k] def test_list__without_device(self): self.assertRaises(TypeError, parted.list_) def test_list__empty_cmd_output(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('empty') output = parted.list_('/dev/sda') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda print') expected = {'info': {}, 'partitions': {}} self.assertEqual(output, expected) def test_list__valid_unit_empty_cmd_output(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('empty') output = parted.list_('/dev/sda', unit='s') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda unit s print') expected = {'info': {}, 'partitions': {}} self.assertEqual(output, expected) def test_list__invalid_unit(self): self.assertRaises(CommandExecutionError, parted.list_, '/dev/sda', unit='badbadbad') self.assertFalse(self.cmdrun.called) def test_list__bad_header(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('bad_header') self.assertRaises(CommandExecutionError, parted.list_, '/dev/sda') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda print') def test_list__bad_label_info(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('bad_label_info') self.assertRaises(CommandExecutionError, parted.list_, '/dev/sda') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda print') def test_list__bad_partition(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('bad_partition') self.assertRaises(CommandExecutionError, parted.list_, '/dev/sda') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda print') def test_list__valid_cmd_output(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('valid') output = parted.list_('/dev/sda') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda print') expected = { 'info': { 'logical sector': '512', 'physical sector': '512', 'interface': 'scsi', 'model': 'AMCC 9650SE-24M DISK', 'disk': '/dev/sda', 'disk flags': '', 'partition table': 'gpt', 'size': '4000GB' }, 'partitions': { '1': { 'end': '150MB', 'number': '1', 'start': '17.4kB', 'file system': '', 'flags': 'boot', 'type': 'ext3', 'size': '150MB'}, '2': { 'end': '4000GB', 'number': '2', 'start': '3921GB', 'file system': '', 'flags': '', 'type': 'linux-swap(v1)', 'size': '79.3GB' } } } self.assertEqual(output, expected) def test_list__valid_unit_valid_cmd_output(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('valid') output = parted.list_('/dev/sda', unit='s') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda unit s print') expected = { 'info': { 'logical sector': '512', 'physical sector': '512', 'interface': 'scsi', 'model': 'AMCC 9650SE-24M DISK', 'disk': '/dev/sda', 'disk flags': '', 'partition table': 'gpt', 'size': '4000GB' }, 'partitions': { '1': { 'end': '150MB', 'number': '1', 'start': '17.4kB', 'file system': '', 'flags': 'boot', 'type': 'ext3', 'size': '150MB'}, '2': { 'end': '4000GB', 'number': '2', 'start': '3921GB', 'file system': '', 'flags': '', 'type': 'linux-swap(v1)', 'size': '79.3GB' } } } self.assertEqual(output, expected) def test_list__valid_legacy_cmd_output(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('valid_legacy') output = parted.list_('/dev/sda') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda print') expected = { 'info': { 'logical sector': '512', 'physical sector': '512', 'interface': 'scsi', 'model': 'AMCC 9650SE-24M DISK', 'disk': '/dev/sda', 'partition table': 'gpt', 'size': '4000GB' }, 'partitions': { '1': { 'end': '150MB', 'number': '1', 'start': '17.4kB', 'file system': '', 'flags': 'boot', 'type': 'ext3', 'size': '150MB'}, '2': { 'end': '4000GB', 'number': '2', 'start': '3921GB', 'file system': '', 'flags': '', 'type': 'linux-swap(v1)', 'size': '79.3GB' } } } self.assertEqual(output, expected) def test_list__valid_unit_valid_legacy_cmd_output(self): with patch('salt.modules.parted._validate_device', MagicMock()): self.cmdrun_stdout.return_value = self.parted_print_output('valid_legacy') output = parted.list_('/dev/sda', unit='s') self.cmdrun_stdout.assert_called_once_with('parted -m -s /dev/sda unit s print') expected = { 'info': { 'logical sector': '512', 'physical sector': '512', 'interface': 'scsi', 'model': 'AMCC 9650SE-24M DISK', 'disk': '/dev/sda', 'partition table': 'gpt', 'size': '4000GB' }, 'partitions': { '1': { 'end': '150MB', 'number': '1', 'start': '17.4kB', 'file system': '', 'flags': 'boot', 'type': 'ext3', 'size': '150MB'}, '2': { 'end': '4000GB', 'number': '2', 'start': '3921GB', 'file system': '', 'flags': '', 'type': 'linux-swap(v1)', 'size': '79.3GB' } } } self.assertEqual(output, expected)
40.878698
108
0.490772
1,339
13,817
4.851382
0.123973
0.028633
0.051724
0.036946
0.789101
0.773399
0.773399
0.75431
0.75431
0.713824
0
0.039519
0.37367
13,817
337
109
41
0.711116
0.044149
0
0.643411
0
0
0.22085
0.05119
0
0
0
0
0.112403
1
0.081395
false
0
0.023256
0
0.116279
0.073643
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
0a773e7735124c957f70c7f288150c1a89d7516d
339
py
Python
pythonProject2/exercicios/exercicio38.py
DeyvidMonteiro/PycharmProjects
c8fb45f05bbbaab41a20ff22f0e60fdde87210af
[ "MIT" ]
null
null
null
pythonProject2/exercicios/exercicio38.py
DeyvidMonteiro/PycharmProjects
c8fb45f05bbbaab41a20ff22f0e60fdde87210af
[ "MIT" ]
null
null
null
pythonProject2/exercicios/exercicio38.py
DeyvidMonteiro/PycharmProjects
c8fb45f05bbbaab41a20ff22f0e60fdde87210af
[ "MIT" ]
null
null
null
from random import randint numeros = randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10),\ randint(1, 10), randint(1, 10), print(f'Os valores sorteados foram : ', end='') for n in numeros: print(f'{n} ', end='') print(f'\nO maior valor sorteado foi {max(numeros)}') print(f'O menor numero sorteado foi {min(numeros)}')
33.9
74
0.657817
56
339
3.982143
0.482143
0.215247
0.269058
0.381166
0.269058
0.269058
0.269058
0.269058
0.269058
0.269058
0
0.062937
0.156342
339
9
75
37.666667
0.716783
0
0
0
0
0
0.349112
0
0
0
0
0
0
1
0
false
0
0.125
0
0.125
0.5
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
0ac190d3dce6a5003795d895b3f95776c2a6b1e1
197
py
Python
aoc2021/tests/test_day18.py
e-jameson/aoc
f26196d5564a9ac8027532c276af00aaf3718c6e
[ "MIT" ]
null
null
null
aoc2021/tests/test_day18.py
e-jameson/aoc
f26196d5564a9ac8027532c276af00aaf3718c6e
[ "MIT" ]
null
null
null
aoc2021/tests/test_day18.py
e-jameson/aoc
f26196d5564a9ac8027532c276af00aaf3718c6e
[ "MIT" ]
null
null
null
from aoc.day18 import part1, part2 # # --- Part One --- # def test_part1(): assert part1.result(None) == None # # --- Part Two --- # def test_part2(): assert part2.result(None) == None
12.3125
37
0.598985
26
197
4.461538
0.538462
0.12069
0.241379
0
0
0
0
0
0
0
0
0.051948
0.218274
197
15
38
13.133333
0.701299
0.167513
0
0
0
0
0
0
0
0
0
0
0.4
1
0.4
true
0
0.2
0
0.6
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
1
0
0
5
0ad95c60c545c21fde9aa34cadda25bb4491b679
107
py
Python
tests/k8s/conftest.py
pawelkopka/kopf
51a3a70e09a17cf3baec2946b64b125a90595cf4
[ "MIT" ]
1,038
2019-03-26T16:32:56.000Z
2022-03-27T09:15:03.000Z
tests/k8s/conftest.py
pawelkopka/kopf
51a3a70e09a17cf3baec2946b64b125a90595cf4
[ "MIT" ]
393
2019-03-26T13:43:42.000Z
2020-09-14T13:18:14.000Z
tests/k8s/conftest.py
pawelkopka/kopf
51a3a70e09a17cf3baec2946b64b125a90595cf4
[ "MIT" ]
116
2019-03-31T23:01:09.000Z
2022-03-18T16:44:58.000Z
import pytest @pytest.fixture(autouse=True) def _autouse_resp_mocker(resp_mocker, version_api): pass
15.285714
51
0.794393
15
107
5.333333
0.733333
0.25
0
0
0
0
0
0
0
0
0
0
0.121495
107
6
52
17.833333
0.851064
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
0.25
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
1
0
1
0
0
0
0
0
5
0adf85c5c2698e32f5625c72580f7959f7948d25
67
py
Python
bees/b/__init__.py
jcarizza/serverfull
4fced3c81997c7105e4f558d5314eee76f525f18
[ "MIT" ]
1
2021-01-14T16:59:39.000Z
2021-01-14T16:59:39.000Z
bees/b/__init__.py
jcarizza/serverfull
4fced3c81997c7105e4f558d5314eee76f525f18
[ "MIT" ]
null
null
null
bees/b/__init__.py
jcarizza/serverfull
4fced3c81997c7105e4f558d5314eee76f525f18
[ "MIT" ]
1
2020-03-19T13:55:14.000Z
2020-03-19T13:55:14.000Z
def handler(request): return f"Hi there!, this is B {request}"
22.333333
44
0.671642
11
67
4.090909
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.19403
67
2
45
33.5
0.833333
0
0
0
0
0
0.447761
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
0af883b0cd98ae89ea3a6ca9b0ef4de94fe56be4
300
py
Python
Chapter 4/restful_python_chapter_04_05/gamesapi/games/admin.py
Mohamed2011-bit/Building-RESTful-Python-Web-Services
503c9b5fec57eeb58397514f3168c3c5248724a3
[ "MIT" ]
116
2016-12-07T00:50:04.000Z
2022-03-31T06:34:02.000Z
Chapter 4/restful_python_chapter_04_05/gamesapi/games/admin.py
Mohamed2011-bit/Building-RESTful-Python-Web-Services
503c9b5fec57eeb58397514f3168c3c5248724a3
[ "MIT" ]
5
2018-09-29T20:48:05.000Z
2021-06-10T18:21:51.000Z
Chapter 4/restful_python_chapter_04_05/gamesapi/games/admin.py
Mohamed2011-bit/Building-RESTful-Python-Web-Services
503c9b5fec57eeb58397514f3168c3c5248724a3
[ "MIT" ]
79
2017-01-02T05:16:01.000Z
2022-02-16T04:23:52.000Z
""" Book: Building RESTful Python Web Services Chapter 4: Throttling, Filtering, Testing and Deploying an API with Django Author: Gaston C. Hillar - Twitter.com/gastonhillar Publisher: Packt Publishing Ltd. - http://www.packtpub.com """ from django.contrib import admin # Register your models here.
30
74
0.776667
41
300
5.682927
0.95122
0
0
0
0
0
0
0
0
0
0
0.003861
0.136667
300
9
75
33.333333
0.895753
0.853333
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e400096bd1f34be745d29be20dba6c39f4b1a6e2
349
py
Python
radonpy/ff/__init__.py
RadonPy/RadonPy
f3bf51a9273cf630d1ba259b454551f3713724d8
[ "BSD-3-Clause" ]
1
2022-03-30T00:09:58.000Z
2022-03-30T00:09:58.000Z
radonpy/ff/__init__.py
RadonPy/RadonPy
f3bf51a9273cf630d1ba259b454551f3713724d8
[ "BSD-3-Clause" ]
null
null
null
radonpy/ff/__init__.py
RadonPy/RadonPy
f3bf51a9273cf630d1ba259b454551f3713724d8
[ "BSD-3-Clause" ]
null
null
null
# ****************************************************************************** # RadonPy ff.__init__ # ****************************************************************************** from .gaff import GAFF from .gaff2 import GAFF2 from .gaff2_mod import GAFF2_mod #from .dreiding import Dreiding #from .pcff import PCFF #from .tip3p import TIP3P
29.083333
80
0.421203
29
349
4.862069
0.37931
0.12766
0
0
0
0
0
0
0
0
0
0.018987
0.094556
349
11
81
31.727273
0.427215
0.724928
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
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
7c4480ca7fcc2a8e377901a38769b2ab5d0a0853
53
py
Python
enthought/util/wx/drag_and_drop.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/util/wx/drag_and_drop.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/util/wx/drag_and_drop.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from pyface.wx.drag_and_drop import *
17.666667
37
0.792453
9
53
4.444444
1
0
0
0
0
0
0
0
0
0
0
0
0.132075
53
2
38
26.5
0.869565
0.226415
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
7ca17b1df719d942c7133ab741e0658009d77a17
211
py
Python
goflow/graphics2/urls_admin.py
mikewolfli/django2-goflow
136afbfd90205ee83b2d50ac1be6a6b207fbcdf8
[ "MIT" ]
10
2018-08-10T15:07:29.000Z
2021-11-05T23:14:47.000Z
goflow/graphics2/urls_admin.py
mikewolfli/django2-goflow
136afbfd90205ee83b2d50ac1be6a6b207fbcdf8
[ "MIT" ]
5
2019-11-20T06:09:00.000Z
2022-03-11T23:26:40.000Z
goflow/graphics2/urls_admin.py
mikewolfli/django2-goflow
136afbfd90205ee83b2d50ac1be6a6b207fbcdf8
[ "MIT" ]
1
2018-08-10T15:07:37.000Z
2018-08-10T15:07:37.000Z
from django.urls import path from goflow.graphics2 import views as goflow_graphics2_views urlpatterns = [ path('processimage/<int:process_id>/pos_activity/', goflow_graphics2_views.pos_activity), ]
26.375
94
0.777251
27
211
5.814815
0.592593
0.286624
0.254777
0
0
0
0
0
0
0
0
0.016484
0.137441
211
7
95
30.142857
0.846154
0
0
0
0
0
0.210784
0.210784
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
7ca50aa5e48c383df1c2efe216531a603b7863b3
727
py
Python
kyu6/tests/test_autocorrect.py
juanshishido/codewars
d50d4ac07ddcc00fa2f7c367ec39cdb5e274d8da
[ "MIT" ]
null
null
null
kyu6/tests/test_autocorrect.py
juanshishido/codewars
d50d4ac07ddcc00fa2f7c367ec39cdb5e274d8da
[ "MIT" ]
null
null
null
kyu6/tests/test_autocorrect.py
juanshishido/codewars
d50d4ac07ddcc00fa2f7c367ec39cdb5e274d8da
[ "MIT" ]
null
null
null
import unittest from kyu6.autocorrect import autocorrect class TestAutocorrect(unittest.TestCase): def test_u(self): self.assertEquals('your sister', autocorrect('u')) def test_you(self): self.assertEquals('your sister', autocorrect('you')) def test_You(self): self.assertEquals('your sister', autocorrect('You')) def test_Youuuuu(self): self.assertEquals('your sister', autocorrect('Youuuuu')) def test_youtube(self): self.assertEquals('youtube', autocorrect('youtube')) def test_bayou(self): self.assertEquals('bayou', autocorrect('bayou')) def test_I_miss(self): self.assertEquals('I miss your sister!', autocorrect('I miss u!'))
25.964286
74
0.674003
84
727
5.738095
0.25
0.10166
0.290456
0.19917
0.408714
0.408714
0.238589
0.238589
0.238589
0.238589
0
0.001701
0.191197
727
27
75
26.925926
0.818027
0
0
0
0
0
0.151307
0
0
0
0
0
0.411765
1
0.411765
false
0
0.117647
0
0.588235
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
1
0
0
0
0
1
0
0
5
7cc88654be9d7939bcad8aca35e3bfc7de647215
45
py
Python
tests/contrib/django/fake2/__init__.py
lyrixderaven/apm-agent-python
e21b306da70995ca1582666378b7059495ff1bee
[ "BSD-3-Clause" ]
2
2019-02-15T20:23:39.000Z
2019-02-15T20:26:06.000Z
tests/contrib/django/fake2/__init__.py
lyrixderaven/apm-agent-python
e21b306da70995ca1582666378b7059495ff1bee
[ "BSD-3-Clause" ]
null
null
null
tests/contrib/django/fake2/__init__.py
lyrixderaven/apm-agent-python
e21b306da70995ca1582666378b7059495ff1bee
[ "BSD-3-Clause" ]
null
null
null
class FakeException(BaseException): pass
15
35
0.777778
4
45
8.75
1
0
0
0
0
0
0
0
0
0
0
0
0.155556
45
2
36
22.5
0.921053
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
8630712c6c6d2bf8e4b7f13ee0c47e390110e61d
71
py
Python
restaurants/tests/test_models.py
mredisax/Gastrofaza24
c3d92c74112c34444bcb983a53ca1987989fbace
[ "MIT" ]
null
null
null
restaurants/tests/test_models.py
mredisax/Gastrofaza24
c3d92c74112c34444bcb983a53ca1987989fbace
[ "MIT" ]
8
2019-10-08T16:02:40.000Z
2021-08-05T17:56:06.000Z
restaurants/tests/test_models.py
mredisax/Gastrofaza24
c3d92c74112c34444bcb983a53ca1987989fbace
[ "MIT" ]
2
2020-02-20T05:40:10.000Z
2021-04-30T16:37:44.000Z
from django.test import TestCase from restaurants.models import Place
17.75
36
0.84507
10
71
6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.126761
71
3
37
23.666667
0.967742
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8663ffa911722f6c6e62198b43d1eaa5548ead40
645
py
Python
gym/envs/leg_learning/__init__.py
abhiksingla/gym
8c897619696a089db773691919d394990edb36eb
[ "Python-2.0", "OLDAP-2.7" ]
null
null
null
gym/envs/leg_learning/__init__.py
abhiksingla/gym
8c897619696a089db773691919d394990edb36eb
[ "Python-2.0", "OLDAP-2.7" ]
null
null
null
gym/envs/leg_learning/__init__.py
abhiksingla/gym
8c897619696a089db773691919d394990edb36eb
[ "Python-2.0", "OLDAP-2.7" ]
null
null
null
# from gym.envs.robotics.fetch_env import FetchEnv # from gym.envs.robotics.fetch.slide import FetchSlideEnv # from gym.envs.robotics.fetch.pick_and_place import FetchPickAndPlaceEnv # from gym.envs.robotics.fetch.push import FetchPushEnv # from gym.envs.robotics.fetch.reach import FetchReachEnv # from gym.envs.robotics.hand.reach import HandReachEnv # from gym.envs.robotics.hand.manipulate import HandBlockEnv # from gym.envs.robotics.hand.manipulate import HandEggEnv # from gym.envs.robotics.hand.manipulate import HandPenEnv from gym.envs.leg_learning.fetch_env import FetchEnv from gym.envs.leg_learning.leg.reach import FetchReachEnv
46.071429
73
0.835659
92
645
5.793478
0.282609
0.144465
0.227017
0.320826
0.643527
0.34334
0.34334
0
0
0
0
0
0.085271
645
13
74
49.615385
0.90339
0.795349
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
86f517d28126d91ba4ef9d5046714bdf071c4c83
19,258
py
Python
examples/unfinished/flp_nonlinear.py
gasse/PySCIPOpt
2dd37997297ab226bed69cc48b7c606131fed1a9
[ "MIT" ]
311
2016-05-19T14:31:41.000Z
2020-11-16T07:54:41.000Z
examples/unfinished/flp_nonlinear.py
gasse/PySCIPOpt
2dd37997297ab226bed69cc48b7c606131fed1a9
[ "MIT" ]
380
2016-05-19T15:52:43.000Z
2020-11-16T20:09:16.000Z
examples/unfinished/flp_nonlinear.py
gasse/PySCIPOpt
2dd37997297ab226bed69cc48b7c606131fed1a9
[ "MIT" ]
165
2016-05-19T16:19:11.000Z
2020-11-10T19:04:35.000Z
# todo """ flp_nonlinear.py: piecewise linear model for the capacitated facility location problem minimize the total (weighted) travel cost from n customers to a given set of facilities, with fixed costs and limited capacities; costs are nonlinear (square root of the total quantity serviced by a facility). Approaches: use - convex combination - multiple selection formulations defined in 'piecewise.py'. Copyright (c) by Joao Pedro PEDROSO and Mikio KUBO, 2012 """ import math import random from pyscipopt import Model, quicksum, multidict from piecewise import * def flp_nonlinear_mselect(I,J,d,M,f,c,K): """flp_nonlinear_mselect -- use multiple selection model Parameters: - I: set of customers - J: set of facilities - d[i]: demand for customer i - M[j]: capacity of facility j - f[j]: fixed cost for using a facility in point j - c[i,j]: unit cost of servicing demand point i from facility j - K: number of linear pieces for approximation of non-linear cost function Returns a model, ready to be solved. """ a,b = {},{} for j in J: U = M[j] L = 0 width = U/float(K) a[j] = [k*width for k in range(K+1)] b[j] = [f[j]*math.sqrt(value) for value in a[j]] model = Model("nonlinear flp -- piecewise linear version with multiple selection") x = {} for j in J: for i in I: x[i,j] = model.addVar(vtype="C", name="x(%s,%s)"%(i,j)) # i's demand satisfied from j # total volume transported from plant j, corresponding (linearized) cost, selection variable: X,F,z = {},{},{} for j in J: # add constraints for linking piecewise linear part: X[j],F[j],z[j] = mult_selection(model,a[j],b[j]) X[j].ub = M[j] # for i in I: # model.addCons( # x[i,j] <= \ # quicksum(min(d[i],a[j][k+1]) * z[j][k] for k in range(K)),\ # "Strong(%s,%s)"%(i,j)) # constraints for customer's demand satisfaction for i in I: model.addCons(quicksum(x[i,j] for j in J) == d[i], "Demand(%s)"%i) for j in J: model.addCons(quicksum(x[i,j] for i in I) == X[j], "Capacity(%s)"%j) model.setObjective(quicksum(F[j] for j in J) +\ quicksum(c[i,j]*x[i,j] for j in J for i in I),\ "minimize") model.data = x,X,F return model def flp_nonlinear_cc_dis_strong(I,J,d,M,f,c,K): """flp_nonlinear_bin -- use convex combination model, with binary variables Parameters: - I: set of customers - J: set of facilities - d[i]: demand for customer i - M[j]: capacity of facility j - f[j]: fixed cost for using a facility in point j - c[i,j]: unit cost of servicing demand point i from facility j - K: number of linear pieces for approximation of non-linear cost function Returns a model, ready to be solved. """ a,b = {},{} for j in J: U = M[j] L = 0 width = U/float(K) a[j] = [k*width for k in range(K+1)] b[j] = [f[j]*math.sqrt(value) for value in a[j]] model = Model("nonlinear flp -- piecewise linear version with convex combination") x = {} for j in J: for i in I: x[i,j] = model.addVar(vtype="C", name="x(%s,%s)"%(i,j)) # i's demand satisfied from j # total volume transported from plant j, corresponding (linearized) cost, selection variable: X,F,z = {},{},{} for j in J: # add constraints for linking piecewise linear part: X[j],F[j],z[j] = convex_comb_dis(model,a[j],b[j]) X[j].ub = M[j] for i in I: model.addCons( x[i,j] <= \ quicksum(min(d[i],a[j][k+1]) * z[j][k] for k in range(K)),\ "Strong(%s,%s)"%(i,j)) # constraints for customer's demand satisfaction for i in I: model.addCons(quicksum(x[i,j] for j in J) == d[i], "Demand(%s)"%i) for j in J: model.addCons(quicksum(x[i,j] for i in I) == X[j], "Capacity(%s)"%j) model.setObjective(quicksum(F[j] for j in J) +\ quicksum(c[i,j]*x[i,j] for j in J for i in I),\ "minimize") model.data = x,X,F return model def flp_nonlinear_cc_dis(I,J,d,M,f,c,K): """flp_nonlinear_bin -- use convex combination model, with binary variables Parameters: - I: set of customers - J: set of facilities - d[i]: demand for customer i - M[j]: capacity of facility j - f[j]: fixed cost for using a facility in point j - c[i,j]: unit cost of servicing demand point i from facility j - K: number of linear pieces for approximation of non-linear cost function Returns a model, ready to be solved. """ a,b = {},{} for j in J: U = M[j] L = 0 width = U/float(K) a[j] = [k*width for k in range(K+1)] b[j] = [f[j]*math.sqrt(value) for value in a[j]] model = Model("nonlinear flp -- piecewise linear version with convex combination") x = {} for j in J: for i in I: x[i,j] = model.addVar(vtype="C", name="x(%s,%s)"%(i,j)) # i's demand satisfied from j # total volume transported from plant j, corresponding (linearized) cost, selection variable: X,F,z = {},{},{} for j in J: # add constraints for linking piecewise linear part: X[j],F[j],z[j] = convex_comb_dis(model,a[j],b[j]) X[j].ub = M[j] # for i in I: # model.addCons( # x[i,j] <= \ # quicksum(min(d[i],a[j][k+1]) * z[j][k] for k in range(K)),\ # "Strong(%s,%s)"%(i,j)) # constraints for customer's demand satisfaction for i in I: model.addCons(quicksum(x[i,j] for j in J) == d[i], "Demand(%s)"%i) for j in J: model.addCons(quicksum(x[i,j] for i in I) == X[j], "Capacity(%s)"%j) model.setObjective(quicksum(F[j] for j in J) +\ quicksum(c[i,j]*x[i,j] for j in J for i in I),\ "minimize") model.data = x,X,F return model def flp_nonlinear_cc_dis_log(I,J,d,M,f,c,K): """flp_nonlinear_cc_dis_log -- convex combination model with logarithmic number of binary variables Parameters: - I: set of customers - J: set of facilities - d[i]: demand for customer i - M[j]: capacity of facility j - f[j]: fixed cost for using a facility in point j - c[i,j]: unit cost of servicing demand point i from facility j - K: number of linear pieces for approximation of non-linear cost function Returns a model, ready to be solved. """ a,b = {},{} for j in J: U = M[j] L = 0 width = U/float(K) a[j] = [k*width for k in range(K+1)] b[j] = [f[j]*math.sqrt(value) for value in a[j]] model = Model("nonlinear flp -- convex combination model with logarithmic number of binary variables") x = {} for j in J: for i in I: x[i,j] = model.addVar(vtype="C", name="x(%s,%s)"%(i,j)) # i's demand satisfied from j # total volume transported from plant j, corresponding (linearized) cost, selection variable: X,F,yL,yR = {},{},{},{} for j in J: # add constraints for linking piecewise linear part: X[j],F[j],yL[j],yR[j] = convex_comb_dis_log(model,a[j],b[j]) X[j].ub = M[j] # for i in I: # model.addCons( # x[i,j] <= \ # quicksum(min(d[i],a[j][k+1]) * (yL[j][k]+yR[j][k]) for k in range(K)),\ # "Strong(%s,%s)"%(i,j)) # constraints for customer's demand satisfaction for i in I: model.addCons(quicksum(x[i,j] for j in J) == d[i], "Demand(%s)"%i) for j in J: model.addCons(quicksum(x[i,j] for i in I) == X[j], "Capacity(%s)"%j) model.setObjective(quicksum(F[j] for j in J) +\ quicksum(c[i,j]*x[i,j] for j in J for i in I),\ "minimize") model.data = x,X,F return model def flp_nonlinear_cc_agg(I,J,d,M,f,c,K): """flp_nonlinear_cc_agg -- aggregated convex combination model Parameters: - I: set of customers - J: set of facilities - d[i]: demand for customer i - M[j]: capacity of facility j - f[j]: fixed cost for using a facility in point j - c[i,j]: unit cost of servicing demand point i from facility j - K: number of linear pieces for approximation of non-linear cost function Returns a model, ready to be solved. """ a,b = {},{} for j in J: U = M[j] L = 0 width = U/float(K) a[j] = [k*width for k in range(K+1)] b[j] = [f[j]*math.sqrt(value) for value in a[j]] model = Model("nonlinear flp -- piecewise linear aggregated convex combination") x = {} for j in J: for i in I: x[i,j] = model.addVar(vtype="C", name="x(%s,%s)"%(i,j)) # i's demand satisfied from j # total volume transported from plant j, corresponding (linearized) cost, selection variable: X,F,z = {},{},{} for j in J: # add constraints for linking piecewise linear part: X[j],F[j],z[j] = convex_comb_agg(model,a[j],b[j]) X[j].ub = M[j] # for i in I: # model.addCons( # x[i,j] <= \ # quicksum(min(d[i],a[j][k+1]) * z[j][k] for k in range(K)),\ # "Strong(%s,%s)"%(i,j)) # constraints for customer's demand satisfaction for i in I: model.addCons(quicksum(x[i,j] for j in J) == d[i], "Demand(%s)"%i) for j in J: model.addCons(quicksum(x[i,j] for i in I) == X[j], "Capacity(%s)"%j) model.setObjective(quicksum(F[j] for j in J) +\ quicksum(c[i,j]*x[i,j] for j in J for i in I),\ "minimize") model.data = x,X,F return model def flp_nonlinear_cc_agg_log(I,J,d,M,f,c,K): """flp_nonlinear_cc_agg_logg -- aggregated convex combination model, with log. binary variables Parameters: - I: set of customers - J: set of facilities - d[i]: demand for customer i - M[j]: capacity of facility j - f[j]: fixed cost for using a facility in point j - c[i,j]: unit cost of servicing demand point i from facility j - K: number of linear pieces for approximation of non-linear cost function Returns a model, ready to be solved. """ a,b = {},{} for j in J: U = M[j] L = 0 width = U/float(K) a[j] = [k*width for k in range(K+1)] b[j] = [f[j]*math.sqrt(value) for value in a[j]] model = Model("nonlinear flp -- piecewise linear version with convex combination") x = {} for j in J: for i in I: x[i,j] = model.addVar(vtype="C", name="x(%s,%s)"%(i,j)) # i's demand satisfied from j # total volume transported from plant j, corresponding (linearized) cost, selection variable: X,F,y = {},{},{} for j in J: # add constraints for linking piecewise linear part: X[j],F[j],y[j] = convex_comb_agg_log(model,a[j],b[j]) X[j].ub = M[j] # for i in I: # model.addCons( # x[i,j] <= \ # quicksum(min(d[i],a[j][k+1]) * (y[j][k]+y[j][k+1]) for k in range(K)),\ # "Strong(%s,%s)"%(i,j)) # constraints for customer's demand satisfaction for i in I: model.addCons(quicksum(x[i,j] for j in J) == d[i], "Demand(%s)"%i) for j in J: model.addCons(quicksum(x[i,j] for i in I) == X[j], "Capacity(%s)"%j) model.setObjective(quicksum(F[j] for j in J) +\ quicksum(c[i,j]*x[i,j] for j in J for i in I),\ "minimize") model.data = x,X,F return model def flp_nonlinear_sos(I,J,d,M,f,c,K): """flp_nonlinear_sos -- use model with SOS constraints Parameters: - I: set of customers - J: set of facilities - d[i]: demand for customer i - M[j]: capacity of facility j - f[j]: fixed cost for using a facility in point j - c[i,j]: unit cost of servicing demand point i from facility j - K: number of linear pieces for approximation of non-linear cost function Returns a model, ready to be solved. """ a,b = {},{} for j in J: U = M[j] L = 0 width = U/float(K) a[j] = [k*width for k in range(K+1)] b[j] = [f[j]*math.sqrt(value) for value in a[j]] model = Model("nonlinear flp -- use model with SOS constraints") x = {} for j in J: for i in I: x[i,j] = model.addVar(vtype="C", name="x(%s,%s)"%(i,j)) # i's demand satisfied from j # total volume transported from plant j, corresponding (linearized) cost, selection variable: X,F,z = {},{},{} for j in J: # add constraints for linking piecewise linear part: X[j],F[j],z[j] = convex_comb_sos(model,a[j],b[j]) X[j].ub = M[j] # for i in I: # model.addCons( # x[i,j] <= \ # quicksum(min(d[i],a[j][k+1]) * (z[j][k] + z[j][k+1])\ # for k in range(len(a[j])-1)), # "Strong(%s,%s)"%(i,j)) # constraints for customer's demand satisfaction for i in I: model.addCons(quicksum(x[i,j] for j in J) == d[i], "Demand(%s)"%i) for j in J: model.addCons(quicksum(x[i,j] for i in I) == X[j], "Capacity(%s)"%j) model.setObjective(quicksum(F[j] for j in J) +\ quicksum(c[i,j]*x[i,j] for j in J for i in I),\ "minimize") model.data = x,X,F return model def distance(x1,y1,x2,y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) def make_data(n,m,same=True): x,y = {},{} if same == True: I = range(1,n+1) J = range(1,m+1) for i in range(1,1+max(m,n)): # positions of the points in the plane x[i] = random.random() y[i] = random.random() else: I = range(1,n+1) J = range(n+1,n+m+1) for i in I: # positions of the points in the plane x[i] = random.random() y[i] = random.random() for j in J: # positions of the points in the plane x[j] = random.random() y[j] = random.random() f,c,d,M = {},{},{},{} total_demand = 0. for i in I: for j in J: c[i,j] = int(100*distance(x[i],y[i],x[j],y[j])) + 1 d[i] = random.randint(1,10) total_demand += d[i] total_cap = 0. r = {} for j in J: r[j] = random.randint(0,m) f[j] = random.randint(100,100+r[j]*m) M[j] = 1 + 100+r[j]*m - f[j] # M[j] = int(total_demand/m) + random.randint(1,m) total_cap += M[j] for j in J: M[j] = int(M[j] * total_demand / total_cap + 1) + random.randint(0,r[j]) # print("%s\t%s\t%s" % (j,f[j],M[j]) # print("demand:",total_demand # print("capacity:",sum([M[j] for j in J]) return I,J,d,M,f,c,x,y def example(): I,d = multidict({1:80, 2:270, 3:250, 4:160, 5:180}) # demand J,M,f = multidict({10:[500,100], 11:[500,100], 12:[500,100]}) # capacity, fixed costs c = {(1,10):4, (1,11):6, (1,12):9, # transportation costs (2,10):5, (2,11):4, (2,12):7, (3,10):6, (3,11):3, (3,12):4, (4,10):8, (4,11):5, (4,12):3, (5,10):10, (5,11):8, (5,12):4, } x_pos = {1:0, 2:0, 3:0, 4:0, 5:0, 10:2, 11:2, 12:2} # positions of the points in the plane y_pos = {1:2, 2:1, 3:0, 4:-1, 5:-2, 10:1, 11:0, 12:-1} return I,J,d,M,f,c,x_pos,y_pos if __name__ == "__main__": # I,J,d,M,f,c,x_pos,y_pos = example() random.seed(1) n = 25 m = 5 I,J,d,M,f,c,x_pos,y_pos = make_data(n,m,same=False) # from flp_make_data import read_orlib,read_cortinhal # I,J,d,M,f,c,x_pos,y_pos = read_orlib("DATA/ORLIB/cap101.txt.gz") # I,J,d,M,f,c,x_pos,y_pos = read_cortinhal("DATA/8_25/A8_25_11.DAT") # I,J,d,M,f,c,x_pos,y_pos = example() K = 4 print("demand:",d) print("cost:",c) print("fixed:",f) print("capacity:",M) # print("x:",x_pos # print("y:",y_pos print("number of intervals:",K) print("\n\n\nflp: multiple selection") model = flp_nonlinear_mselect(I,J,d,M,f,c,K) x,X,F = model.data model.hideOutput() # silent/verbose mode model.optimize() objMS = model.getObjVal() print("Obj.",objMS) print("\n\n\nflp: convex combination with binary variables") model = flp_nonlinear_cc_dis(I,J,d,M,f,c,K) x,X,F = model.data model.hideOutput() # silent/verbose mode model.optimize() objCC = model.getObjVal() print("Obj.",objCC) print("\n\n\nflp: convex combination with logarithmic number of binary variables") model = flp_nonlinear_cc_dis_log(I,J,d,M,f,c,K) x,X,F = model.data model.hideOutput() # silent/verbose mode model.optimize() objLOG = model.getObjVal() print("Obj.",objLOG) print("\n\n\nflp: model with SOS constraints") model = flp_nonlinear_sos(I,J,d,M,f,c,K) x,X,F = model.data model.hideOutput() # silent/verbose mode model.optimize() objSOS = model.getObjVal() print("Obj.",objSOS) print("\n\n\nflp: aggregated CC model") model = flp_nonlinear_cc_agg(I,J,d,M,f,c,K) x,X,F = model.data model.hideOutput() # silent/verbose mode model.optimize() objND = model.getObjVal() print("Obj.",objND) print("\n\n\nflp: aggregated CC model, log number variables") model = flp_nonlinear_cc_agg_log(I,J,d,M,f,c,K) x,X,F = model.data model.hideOutput() # silent/verbose mode model.optimize() objNDlog = model.getObjVal() print("Obj.",objNDlog) EPS = 1.e-4 assert abs(objCC-objMS)<EPS and abs(objLOG-objMS)<EPS and abs(objSOS-objMS)<EPS\ and abs(objSOS-objND)<EPS and abs(objSOS-objNDlog)<EPS edges = [] flow = {} for (i,j) in sorted(x): if model.getVal(x[i,j]) > EPS: edges.append((i,j)) flow[(i,j)] = model.getVal(x[i,j]) print("\n\n\nflp: model with piecewise linear approximation of cost function") print("Obj.",model.getObjVal(),"\nedges",sorted(edges)) print("flows:",flow) if x_pos == None: exit(0) try: # plot the result using networkx and matplotlib import networkx as NX import matplotlib.pyplot as P P.clf() G = NX.Graph() facilities = J client = I G.add_nodes_from(facilities) G.add_nodes_from(client) for (i,j) in edges: G.add_edge(i,j) position = {} for i in I + J: position[i] = (x_pos[i],y_pos[i]) NX.draw(G,position,node_color="g",nodelist=client) NX.draw(G,position,node_color="y",nodelist=facilities) P.show() except ImportError: print("install 'networkx' and 'matplotlib' for plotting")
33.260794
106
0.547045
3,187
19,258
3.265453
0.077502
0.01768
0.031133
0.036322
0.778034
0.759104
0.747093
0.72432
0.719516
0.70712
0
0.017179
0.298733
19,258
578
107
33.318339
0.753425
0.357462
0
0.6
0
0
0.102676
0
0
0
0
0.00173
0.003077
1
0.030769
false
0
0.021538
0.003077
0.083077
0.064615
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
86fbc0c32add31a2666211620dcb4aa45d6f19a4
12,648
py
Python
firecares/firestation/migrations/0016_auto_20151006_1131.py
FireCARES/firecares
aa708d441790263206dd3a0a480eb6ca9031439d
[ "MIT" ]
12
2016-01-30T02:28:35.000Z
2019-05-29T15:49:56.000Z
firecares/firestation/migrations/0016_auto_20151006_1131.py
FireCARES/firecares
aa708d441790263206dd3a0a480eb6ca9031439d
[ "MIT" ]
455
2015-07-27T20:21:56.000Z
2022-03-11T23:26:20.000Z
firecares/firestation/migrations/0016_auto_20151006_1131.py
FireCARES/firecares
aa708d441790263206dd3a0a480eb6ca9031439d
[ "MIT" ]
14
2015-07-29T09:45:53.000Z
2020-10-21T20:03:17.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('firestation', '0015_auto_20150901_1056'), ] stations = [(25852, 73144), (22168, 75975), (50316, 78189), (53370, 93639), (53447, 73324), (53406, 81147), (53608, 81147), (53172, 81147), (53512, 81147), (53515, 81147), (53481, 73522), (53728, 78260), (53669, 73574), (53174, 73574), (53599, 73574), (11075, 73574), (21474, 91690), (39451, 73596), (53457, 81147), (27478, 73759), (53471, 73771), (53240, 73771), (17791, 88514), (53354, 73923), (53603, 87281), (53510, 81338), (11254, 74008), (42029, 74027), (4961, 87689), (25914, 74299), (33515, 74420), (27692, 78105), (21687, 91161), (2713, 87132), (16497, 74619), (26344, 88959), (27741, 93543), (39467, 95613), (11059, 74864), (20237, 85328), (11052, 75043), (50049, 75070), (30946, 75070), (39452, 85189), (39394, 97926), (53238, 75181), (29981, 75184), (11078, 75215), (27817, 84391), (16660, 75289), (24078, 73125), (30895, 75330), (13818, 75317), (33200, 89398), (53556, 75319), (53254, 75454), (32154, 75552), (13657, 75571), (39385, 75576), (11489, 91424), (21446, 75579), (21126, 86108), (26428, 75646), (11512, 75656), (30936, 75765), (33546, 75808), (22046, 75808), (11747, 75808), (29973, 82718), (25447, 98541), (53511, 90236), (42065, 75842), (53631, 75854), (53398, 75900), (46496, 95613), (53442, 76014), (39442, 82606), (35807, 76053), (53283, 76105), (53267, 84377), (53270, 87100), (13905, 81177), (53685, 81147), (53407, 76141), (53453, 76388), (51053, 76390), (53420, 76394), (11711, 76508), (20887, 76589), (13427, 76609), (17197, 76718), (29843, 76720), (53385, 76737), (53394, 76764), (51979, 76823), (53529, 76827), (53368, 76827), (53446, 78715), (11086, 93543), (30901, 97786), (30133, 76848), (53436, 74673), (42408, 93339), (13382, 96668), (53435, 81147), (53287, 81147), (11071, 77099), (21445, 89710), (23341, 96668), (53559, 81147), (53341, 81147), (2698, 77171), (941, 77171), (11708, 77192), (11710, 77201), (11508, 94720), (11099, 96253), (27435, 77214), (53429, 77229), (53503, 78187), (24055, 81627), (50932, 77285), (38420, 77326), (35332, 77326), (18377, 77326), (41388, 77326), (17216, 77326), (50662, 77326), (41360, 77326), (13899, 77326), (924, 77326), (986, 77326), (41465, 77326), (1798, 77326), (47121, 77326), (36142, 77326), (44098, 77326), (53388, 77353), (53364, 77353), (53373, 84011), (53259, 77353), (53415, 77353), (21137, 77399), (29427, 77417), (53438, 77451), (51929, 81666), (11102, 77478), (41228, 77969), (10405, 78030), (53655, 78155), (53380, 81147), (11047, 78176), (39085, 94838), (24759, 78191), (11224, 78235), (53319, 78249), (13396, 88060), (45501, 78235), (50398, 78319), (37582, 78426), (942, 78443), (14205, 78443), (29552, 90762), (44669, 78445), (23349, 78445), (53547, 78591), (2708, 78886), (11213, 75379), (11093, 75379), (11050, 78906), (15253, 78906), (25445, 78906), (11329, 78906), (11761, 78906), (11721, 78958), (45485, 79163), (36815, 94178), (23557, 89691), (51814, 79301), (53737, 74192), (53288, 75924), (53275, 79338), (53414, 79338), (53424, 79338), (53336, 79338), (53403, 79338), (53428, 79338), (53209, 79338), (53417, 89322), (53465, 89332), (53692, 93496), (27786, 78247), (37460, 79515), (38693, 87344), (32976, 79614), (47344, 79767), (42424, 97039), (1818, 79771), (14141, 76195), (44978, 79774), (53589, 79825), (11760, 79942), (45229, 79947), (14022, 79961), (25918, 79978), (53483, 79973), (53490, 97499), (33318, 79987), (42073, 90061), (53533, 85189), (53171, 85189), (53450, 81147), (30647, 80106), (53178, 80141), (53376, 82577), (11236, 80166), (36144, 80447), (35825, 80530), (24736, 80568), (21448, 80684), (33289, 80723), (53484, 80754), (53344, 81084), (53663, 81084), (25841, 78548), (53625, 81117), (53242, 81147), (53402, 81147), (53572, 81147), (53623, 81147), (35620, 81147), (53396, 81147), (53230, 81147), (53621, 81147), (53437, 95572), (53269, 81147), (53395, 81147), (53276, 81147), (53239, 89432), (53328, 96004), (53524, 81280), (53641, 89432), (10388, 81333), (53252, 81333), (53613, 81424), (21123, 81435), (11108, 81574), (33264, 81627), (53352, 75919), (11576, 81700), (40344, 81713), (3787, 81738), (40587, 81738), (16673, 81738), (27329, 81738), (53377, 81741), (48897, 89938), (32157, 81759), (46821, 81759), (32455, 81780), (4389, 81780), (24357, 81780), (32454, 81798), (2709, 81804), (13418, 81823), (24737, 81829), (35323, 88060), (48569, 81945), (50444, 81945), (17157, 84710), (21422, 84933), (23546, 82013), (32159, 82013), (4862, 82013), (53681, 96004), (53678, 96004), (45454, 82116), (48417, 78633), (15209, 82128), (11101, 90549), (27258, 94943), (53422, 82188), (25804, 82198), (53321, 82327), (53335, 82339), (53382, 82531), (39336, 82532), (53600, 82541), (53689, 82544), (53439, 82551), (53400, 84011), (53464, 84011), (53461, 84011), (30643, 82571), (17403, 82680), (45845, 82690), (53726, 82756), (53246, 82763), (53488, 81147), (17209, 83101), (53260, 83227), (53227, 93190), (11217, 83267), (49404, 83291), (39389, 83625), (11762, 88843), (25934, 88060), (41128, 78712), (53393, 83411), (53495, 86580), (31542, 83494), (1854, 83501), (16683, 83501), (35936, 83501), (32384, 83501), (20197, 83501), (2702, 83501), (3793, 83501), (879, 83501), (1845, 83501), (32145, 83501), (27065, 86328), (53285, 83548), (53540, 83708), (53346, 83708), (53375, 83708), (53200, 84556), (11746, 84556), (16495, 83728), (37381, 73143), (32374, 73143), (47960, 73143), (53350, 81074), (22053, 83873), (53605, 81147), (53520, 81147), (53231, 81147), (53310, 81147), (53298, 84011), (21125, 76700), (21662, 84249), (53688, 84260), (10389, 84289), (11058, 95330), (25505, 78866), (53508, 84440), (24293, 84451), (992, 84505), (32367, 84505), (11563, 84634), (25230, 84634), (45228, 84634), (48149, 84634), (11624, 94459), (30947, 94459), (33169, 85883), (53176, 84761), (11575, 84851), (11212, 81626), (45318, 84978), (53389, 85040), (38143, 85043), (53482, 93287), (53462, 73574), (53383, 73574), (23062, 85316), (30653, 85395), (53532, 85529), (53612, 85566), (27774, 80350), (53278, 85714), (26425, 85748), (18010, 85748), (40860, 78712), (45344, 86006), (53527, 97798), (53392, 97798), (36755, 86328), (47790, 86328), (30943, 86414), (53271, 86481), (53204, 78715), (53322, 86531), (53525, 86580), (53727, 86580), (53463, 85644), (21139, 77733), (11328, 86910), (28198, 86153), (53616, 81147), (53358, 81147), (53162, 87285), (53205, 89746), (21953, 87418), (11098, 75460), (53405, 87447), (53474, 87447), (53561, 87447), (53454, 87447), (53445, 87447), (53304, 87447), (53456, 87447), (53568, 87447), (19862, 87448), (53734, 87441), (25886, 99699), (37421, 87536), (33564, 88958), (27430, 88958), (53531, 78383), (53682, 86124), (17210, 87662), (53691, 96236), (53509, 100157), (41460, 87661), (11092, 73234), (11253, 87884), (29282, 87950), (23554, 87950), (2699, 91168), (24514, 87989), (35834, 87989), (11133, 87989), (10387, 93404), (16756, 88060), (53470, 88088), (36966, 88213), (11218, 88222), (53526, 81147), (53165, 81147), (53263, 88307), (25913, 88309), (53425, 88368), (3794, 88379), (17709, 82718), (53448, 98328), (53181, 88624), (53423, 77353), (53303, 77353), (1832, 95742), (46866, 88722), (53323, 88843), (11128, 88831), (25396, 88959), (48970, 88959), (53738, 94615), (30873, 88958), (53265, 80013), (53594, 89046), (47346, 84146), (40820, 99272), (41957, 99272), (15168, 89136), (40805, 78614), (50832, 89342), (11581, 89635), (38418, 90617), (53615, 97391), (53399, 90396), (53736, 97391), (53367, 89679), (53410, 99828), (42067, 85329), (23843, 89870), (47334, 89974), (36060, 89974), (11697, 90127), (35837, 95132), (13653, 90123), (38140, 90123), (14662, 90123), (44374, 90123), (44116, 90123), (26136, 90123), (23849, 90123), (35607, 90123), (17731, 90123), (881, 90123), (47710, 90123), (991, 90132), (53360, 90181), (53412, 90236), (4272, 89704), (53498, 90254), (53570, 90254), (53518, 90254), (53656, 90254), (53233, 90254), (53302, 90254), (53312, 90254), (53348, 90254), (53536, 90254), (53449, 90254), (53311, 90254), (53636, 90254), (53494, 90254), (53173, 90254), (1944, 90251), (39347, 90387), (24793, 90671), (31696, 90671), (51884, 90837), (23979, 91612), (2459, 91043), (42022, 91064), (42367, 91121), (3872, 91388), (30808, 86144), (36090, 91439), (24502, 79360), (35355, 91452), (4476, 91543), (21914, 97561), (53179, 91600), (53607, 91599), (21760, 91668), (39153, 92460), (37434, 91734), (53372, 78669), (53468, 95322), (26715, 91766), (33552, 91766), (3767, 89606), (53245, 91878), (53480, 91878), (53218, 91878), (1006, 92468), (1867, 92468), (27345, 88060), (25671, 90255), (53499, 92558), (53301, 92558), (53530, 92558), (53333, 92558), (53528, 92558), (53602, 92558), (53583, 92558), (53305, 92558), (51366, 92619), (16080, 92633), (11243, 84673), (11053, 87517), (50394, 81458), (11205, 92633), (1866, 92722), (53675, 92724), (11678, 92764), (48191, 89945), (47345, 92801), (53513, 89729), (53496, 91932), (29579, 92848), (21386, 92848), (27199, 92848), (21322, 92848), (14186, 92876), (28763, 81191), (40590, 92901), (30580, 95330), (53211, 92985), (11090, 93079), (49164, 81177), (21368, 93185), (53235, 81147), (24792, 93281), (40754, 93297), (25556, 93289), (11076, 93339), (14908, 93339), (53433, 77353), (53281, 77353), (53680, 77353), (53292, 77353), (53359, 79528), (53183, 84011), (53401, 84011), (53705, 84011), (53374, 84011), (53504, 84011), (53337, 84011), (53704, 84011), (53706, 84011), (53434, 84011), (53707, 84011), (53585, 84011), (53334, 84011), (53584, 84011), (53169, 84011), (53378, 84011), (33097, 91913), (4674, 93271), (17644, 84545), (42074, 93404), (53167, 93432), (53440, 85623), (53620, 93436), (29239, 86995), (53601, 93043), (30563, 93543), (11130, 93543), (11111, 93543), (40403, 93543), (36596, 93543), (52214, 93547), (11081, 93547), (24703, 93547), (30858, 93547), (11148, 93547), (48418, 93547), (45503, 93547), (30926, 93547), (11507, 93547), (11354, 93547), (27963, 93547), (49797, 93547), (53476, 93634), (24270, 93691), (53708, 81711), (53538, 93696), (53472, 99828), (53606, 93860), (39314, 90837), (42358, 93908), (53170, 93947), (53258, 93991), (35614, 86017), (11488, 94129), (15256, 93543), (27712, 81784), (11487, 94158), (39313, 94158), (11049, 94158), (11070, 89710), (48901, 94230), (53219, 84011), (53695, 94600), (26387, 94602), (34983, 94682), (10386, 94714), (1855, 87339), (41943, 87339), (40696, 94945), (48122, 95150), (20880, 93966), (16791, 95274), (53340, 95419), (53473, 97507), (26643, 76029), (33492, 95495), (53535, 95758), (53199, 89153), (11077, 95783), (2705, 95808), (49039, 95808), (53637, 81147), (53624, 81147), (53684, 81147), (53575, 81147), (13422, 77969), (53485, 96004), (53611, 93646), (53300, 92582), (53731, 96004), (53451, 96004), (53557, 96004), (53514, 93646), (53284, 96004), (44675, 96021), (11525, 96046), (25747, 74084), (53324, 96094), (53458, 96094), (36078, 96578), (53597, 96123), (53273, 96138), (53486, 96138), (53567, 96138), (53690, 96138), (53306, 96248), (53309, 81244), (53546, 96325), (11110, 96326), (16422, 79967), (26422, 96352), (1307, 96352), (40885, 96352), (40839, 96352), (47001, 96352), (20244, 84355), (20349, 99338), (1294, 77460), (14344, 96358), (44369, 96513), (53521, 86416), (835, 96660), (49956, 96666), (832, 96668), (2710, 96678), (39160, 76138), (39373, 96709), (11582, 96709), (39752, 97231), (30951, 96880), (11652, 96989), (37859, 85140), (53251, 80013), (40807, 97425), (53421, 97427), (1826, 97821), (26622, 88604), (53397, 90775), (42380, 98050), (53299, 98083), (53366, 81147), (45530, 93543), (11693, 96167), (39374, 96167), (53722, 88663), (53721, 98188), (2701, 98242), (53280, 98287), (3873, 98331), (38419, 89823), (1825, 98497), (52343, 98497), (53666, 93344), (53247, 93344), (33247, 98600), (29559, 97803), (53315, 98716), (36085, 98760), (10404, 98760), (2704, 99130), (39344, 99334), (33242, 99488), (1799, 85140), (3865, 85140), (16672, 85140), (51642, 85140), (943, 99569), (42157, 74440), (11211, 81626), (53519, 93859), (53411, 82186), (53332, 90463), (53694, 88790), (16476, 99725), (44671, 99725), (37520, 99725), (13421, 99725), (53586, 81941), (39092, 99849), (53237, 90844), (53596, 90844), (53426, 90844), (37080, 99973), (47603, 99973), (53384, 99991), (36064, 74198), (53455, 100078), (1924, 99235)] operations = map(lambda match: migrations.RunSQL('update firestation_firestation set department_id={1} where usgsstructuredata_ptr_id={0}'.format(*match), reverse_sql='update firestation_firestation set department_id=null where usgsstructuredata_ptr_id={0}'.format(*match)), stations)
903.428571
12,131
0.628795
1,584
12,648
5.010101
0.809343
0.004284
0.007056
0.007813
0.020665
0.020665
0.009829
0
0
0
0
0.684634
0.125791
12,648
14
12,132
903.428571
0.033101
0.00166
0
0
0
0
0.016553
0.0099
0
0
0
0
0
1
0
false
0
0.25
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
811ce141d89f518abb28f17f6417becf4a4068d9
235
py
Python
labs/ex04/template/__init__.py
kcyu1993/ML_course_kyu
99671281bcf83cbcd75d1c57772bdfdf79d28aff
[ "MIT" ]
null
null
null
labs/ex04/template/__init__.py
kcyu1993/ML_course_kyu
99671281bcf83cbcd75d1c57772bdfdf79d28aff
[ "MIT" ]
null
null
null
labs/ex04/template/__init__.py
kcyu1993/ML_course_kyu
99671281bcf83cbcd75d1c57772bdfdf79d28aff
[ "MIT" ]
null
null
null
from __future__ import absolute_import from . import build_polynomial from . import costs from . import helpers from . import plots from . import least_squares from . import split_data from . import ridge_regression from . import ex04
23.5
38
0.812766
33
235
5.515152
0.484848
0.43956
0
0
0
0
0
0
0
0
0
0.01005
0.153191
235
9
39
26.111111
0.904523
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
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
d4c79849630a42599ef052310cb4c3a0511a6329
26
py
Python
tests/cnert/__init__.py
maartenq/cnert
6467854c9022ab24d4c445275ab3feb7d0289076
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
tests/cnert/__init__.py
maartenq/cnert
6467854c9022ab24d4c445275ab3feb7d0289076
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
2
2022-01-03T18:32:43.000Z
2022-01-31T19:09:50.000Z
tests/cnert/__init__.py
maartenq/cnert
6467854c9022ab24d4c445275ab3feb7d0289076
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
# tests/cnert/__init__.py
13
25
0.769231
4
26
4
1
0
0
0
0
0
0
0
0
0
0
0
0.076923
26
1
26
26
0.666667
0.884615
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
d4ecf53cc47cce7b6a49029cf08f21ccc8f1a8f9
27
py
Python
graphene/graphene_core/relation_extraction/model/extraction.py
kkatsamaktsis/PyGraphene
0e9db929d8471df5048e35e37d86de74a0f733d2
[ "MIT" ]
null
null
null
graphene/graphene_core/relation_extraction/model/extraction.py
kkatsamaktsis/PyGraphene
0e9db929d8471df5048e35e37d86de74a0f733d2
[ "MIT" ]
null
null
null
graphene/graphene_core/relation_extraction/model/extraction.py
kkatsamaktsis/PyGraphene
0e9db929d8471df5048e35e37d86de74a0f733d2
[ "MIT" ]
null
null
null
class Extraction: pass
9
17
0.703704
3
27
6.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.259259
27
2
18
13.5
0.95
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
d4f1e95dec22cbc9b7319c124604efd3574f9f22
215
py
Python
settings.py
akshaykr/oracle_cb
68f10fce5eca8ebe3f57fd5a56a0ef8d82537ab4
[ "MIT" ]
26
2017-08-02T19:58:06.000Z
2021-11-03T06:31:01.000Z
settings.py
akshaykr/oracle_cb
68f10fce5eca8ebe3f57fd5a56a0ef8d82537ab4
[ "MIT" ]
1
2020-03-03T06:06:32.000Z
2020-03-03T06:06:32.000Z
settings.py
akshaykr/oracle_cb
68f10fce5eca8ebe3f57fd5a56a0ef8d82537ab4
[ "MIT" ]
10
2017-06-02T19:34:38.000Z
2022-03-22T10:38:51.000Z
BASE_DIR="" DATA_DIR="/mnt/nfs/work1/akshay/akshay/projects/oracle_cb/data/" REMOTE_PATH_TO_PYTHON="/mnt/nfs/work1/akshay/akshay/anaconda3/python3" REMOTE_BASE_DIR="/mnt/nfs/work1/akshay/akshay/projects/oracle_cb/"
43
70
0.813953
35
215
4.742857
0.457143
0.108434
0.198795
0.307229
0.644578
0.506024
0.506024
0.506024
0.506024
0
0
0.023697
0.018605
215
4
71
53.75
0.763033
0
0
0
0
0
0.683721
0.683721
0
0
0
0
0
1
0
false
0
0
0
0
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
be190c0e680b169c47507399e1988ecfe885a6fe
118
py
Python
xmipy/__init__.py
jdhughes-usgs/modflow6-bmipy
a0c435465d5c6987e5914a2da3523e1f5f7f2c91
[ "CC0-1.0" ]
1
2021-10-08T00:56:48.000Z
2021-10-08T00:56:48.000Z
xmipy/__init__.py
jdhughes-usgs/modflow6-bmipy
a0c435465d5c6987e5914a2da3523e1f5f7f2c91
[ "CC0-1.0" ]
20
2020-06-23T09:01:59.000Z
2020-07-16T14:05:22.000Z
xmipy/__init__.py
jdhughes-usgs/modflow6-bmipy
a0c435465d5c6987e5914a2da3523e1f5f7f2c91
[ "CC0-1.0" ]
null
null
null
# imports from xmipy.xmi import Xmi as Xmi from xmipy.xmiwrapper import XmiWrapper as XmiWrapper __version__ = "1.1"
19.666667
53
0.788136
18
118
4.944444
0.5
0.202247
0
0
0
0
0
0
0
0
0
0.02
0.152542
118
5
54
23.6
0.87
0.059322
0
0
0
0
0.027523
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
078a2b885b93169f3d6bf412854fac73738af56a
159
py
Python
uncharted/exceptions.py
bashu/django-uncharted
b285b4dfc8310cb62e7535fb39326916e2c81159
[ "MIT" ]
9
2015-06-07T06:50:42.000Z
2020-09-04T05:57:20.000Z
uncharted/exceptions.py
bashu/django-uncharted
b285b4dfc8310cb62e7535fb39326916e2c81159
[ "MIT" ]
1
2015-09-24T08:17:25.000Z
2019-03-31T03:51:00.000Z
uncharted/exceptions.py
bashu/django-uncharted
b285b4dfc8310cb62e7535fb39326916e2c81159
[ "MIT" ]
2
2018-11-13T22:56:05.000Z
2020-11-18T07:18:49.000Z
# -*- coding: utf-8 -*- class FieldError(Exception): pass class FieldDoesNotExist(Exception): pass class ReadOnlyError(AttributeError): pass
11.357143
36
0.685535
15
159
7.266667
0.666667
0.238532
0.330275
0
0
0
0
0
0
0
0
0.007874
0.201258
159
13
37
12.230769
0.850394
0.132075
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
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
07ae4ed3d743b4dd71996aa11ea28ec9e558d479
156
py
Python
ultron8/exceptions/ssh.py
bossjones/ultron8
45db73d32542a844570d44bc83defa935e15803f
[ "Apache-2.0", "MIT" ]
null
null
null
ultron8/exceptions/ssh.py
bossjones/ultron8
45db73d32542a844570d44bc83defa935e15803f
[ "Apache-2.0", "MIT" ]
43
2019-06-01T23:08:32.000Z
2022-02-07T22:24:53.000Z
ultron8/exceptions/ssh.py
bossjones/ultron8
45db73d32542a844570d44bc83defa935e15803f
[ "Apache-2.0", "MIT" ]
null
null
null
__all__ = ["InvalidCredentialsException"] class InvalidCredentialsException(Exception): pass class NoHostsConnectedToException(Exception): pass
15.6
45
0.794872
10
156
12
0.6
0.216667
0
0
0
0
0
0
0
0
0
0
0.134615
156
9
46
17.333333
0.888889
0
0
0.4
0
0
0.173077
0.173077
0
0
0
0
0
1
0
false
0.4
0
0
0.4
0
1
0
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
07febe57d3e46c65f0339756cdc89a8fd1b3230e
3,216
py
Python
funcx/serialize/concretes.py
NickolausDS/funcX
94420221453aa2be65d259244968a94a12104a4a
[ "Apache-2.0" ]
null
null
null
funcx/serialize/concretes.py
NickolausDS/funcX
94420221453aa2be65d259244968a94a12104a4a
[ "Apache-2.0" ]
null
null
null
funcx/serialize/concretes.py
NickolausDS/funcX
94420221453aa2be65d259244968a94a12104a4a
[ "Apache-2.0" ]
null
null
null
import codecs import json import dill import pickle import inspect import logging logger = logging.getLogger(__name__) from funcx.serialize.base import fxPicker_enforcer, fxPicker_shared class json_base64(fxPicker_shared): _identifier = '00\n' _for_code = False def __init__(self): super().__init__() def serialize(self, data): x = json.dumps(data) return self.identifier + x def deserialize(self, payload): x = json.loads(self.chomp(payload)) return x class pickle_base64(fxPicker_shared): _identifier = '01\n' _for_code = False def __init__(self): super().__init__() def serialize(self, data): x = codecs.encode(pickle.dumps(data), 'base64').decode() return self.identifier + x def deserialize(self, payload): chomped = self.chomp(payload) data = pickle.loads(codecs.decode(chomped.encode(), 'base64')) return data class code_pickle(fxPicker_shared): _identifier = '02\n' _for_code = True def __init__(self): super().__init__() def serialize(self, data): x = codecs.encode(pickle.dumps(data), 'base64').decode() return self.identifier + x def deserialize(self, payload): chomped = self.chomp(payload) data = pickle.loads(codecs.decode(chomped.encode(), 'base64')) return data class code_text_dill(fxPicker_shared): """ We use dill to get the source code out of the function object and then exec the function body to load it in. The function object is then returned by name. """ _identifier = '03\n' _for_code = True def __init__(self): super().__init__() def serialize(self, data): name = data.__name__ body = dill.source.getsource(data) x = codecs.encode(pickle.dumps((name, body)), 'base64').decode() return self.identifier + x def deserialize(self, payload): chomped = self.chomp(payload) name, body = pickle.loads(codecs.decode(chomped.encode(), 'base64')) exec(body) return locals()[name] class code_text_inspect(fxPicker_shared): """ We use dill to get the source code out of the function object and then exec the function body to load it in. The function object is then returned by name. """ _identifier = '04\n' _for_code = True def __init__(self): super().__init__() def serialize(self, data): name = data.__name__ body = inspect.getsource(data) x = codecs.encode(pickle.dumps((name, body)), 'base64').decode() return self.identifier + x def deserialize(self, payload): chomped = self.chomp(payload) name, body = pickle.loads(codecs.decode(chomped.encode(), 'base64')) exec(body) return locals()[name] def bar(x, y={'a':3}): return x * y['a'] if __name__ == '__main__' : bar(29) #print(json_base64.identifier) #print(pickle_base64.identifier) ct = code_text_inspect() f = ct.serialize(bar) # print("Serialized : ", f) new_bar = ct.deserialize(f) print("After deserialization : ", new_bar) print("FN() : ", new_bar(10))
25.125
76
0.63495
403
3,216
4.828784
0.208437
0.043165
0.020555
0.04111
0.709661
0.709661
0.709661
0.709661
0.686023
0.686023
0
0.016096
0.24658
3,216
127
77
25.322835
0.787041
0.123134
0
0.609756
0
0
0.039223
0
0
0
0
0
0
1
0.195122
false
0
0.085366
0.012195
0.597561
0.02439
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
580517f64b701b2811884caa070d2d05b34578b8
7,281
py
Python
Packs/Yara/Scripts/YaraScan/YaraScan.py
diCagri/content
c532c50b213e6dddb8ae6a378d6d09198e08fc9f
[ "MIT" ]
799
2016-08-02T06:43:14.000Z
2022-03-31T11:10:11.000Z
Packs/Yara/Scripts/YaraScan/YaraScan.py
diCagri/content
c532c50b213e6dddb8ae6a378d6d09198e08fc9f
[ "MIT" ]
9,317
2016-08-07T19:00:51.000Z
2022-03-31T21:56:04.000Z
Packs/Yara/Scripts/YaraScan/YaraScan.py
diCagri/content
c532c50b213e6dddb8ae6a378d6d09198e08fc9f
[ "MIT" ]
1,297
2016-08-04T13:59:00.000Z
2022-03-31T23:43:06.000Z
import demistomock as demisto from CommonServerPython import * # The script uses the Python yara library to scan a file or files ''' IMPORTS ''' import yara ''' GLOBAL VARIABLES ''' yaraLogo = "iVBORw0KGgoAAAANSUhEUgAAAR0AAABgCAYAAAAgoabQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAC9VJREFUeNrsnW1sVFUax59pp7RQtIXKULp0WxYQggZK2GgCvswkmC1BA0TTDzZCMeIXl1C+gJEohcQPNRIwkuAaY6vGjSYYiyEpBhJma8BIUqik7IK0zkjXUiuddgqllEyZvc/t7TLLAp17z7l37sv/l1zHAPft/O/93+e8PceXTCYJAACsws//OVFc7KqbWtHTA2UBsLPpaFQq2x8tOem0aTkP79//l8JgsNKXnZ1j5BjXOzrazjzxxIE7/viasv0dsgLgDNP5q7KtNvNkuaWlNOvllylQVUU5RUVCx0r09VUoP3+7448vwXQAcI7pmEZ2QQGVbd9OxevXk88v55TJ0VGoBwBM5/8pDIVo3p49lFtSIvW4o0NDUA8AB5Jl5sFnbdpEiz77TLrhMDcvX4Z6ACDSuc3s2loqe/110y78Zm8v1AMAkc4YD61da6rhAABgOv+Fe6i4DcdsJs2aBfUAgOkQle3YQdn5+aZfuKxeMACAg01n8rx5NEOpWllBLiIdAGA6M6urLbvwxOAg1APAgUito0yvrJRyHB6DEz95koY7OigRj9OtkRG1ypYzfTplKb+3lL//9/vvQz0AvGw6OYEATZ4zR+gYyUSCfqmvp+4PP6SkYjQAAJjOPcl/5BHhY/xr40bqP3oUqgDgYqS16UxSIh0R+pqbYTgAwHTSh8fniHDl0CGoAQBMxzqG2tuhBgAwnfThRmARbqHhGACYjh4w6xsAkA7Seq9GBE3H/2ABjVCXqTc71+eD4sBsgspWrm2pRLUt7LUC6bxj8QdppnMjEhHaP7d0Ng2da7figQgK7B828aERvbZG7aGeiJq7vBB2gMt1QNnaTDxHnUn789yfDdrvRPi8rom8SKerSx1JbHSyZ57gwEIdL/ZOCULY8drCaZrOBkFzM4vUe29StkPa74BJ55BhOpynu0H7FcFTmkjtvRLpgXpg2TIE5iA1cuCXuV/7tWMUwNHJGQmG4zlNpJrO1dOnDe87dckSvGrgXi93RIsyCm10TQ3QxJgmUk1n8IcfDO+bV1oqPMAQuBoO9Y/bILLwuuEIayLVdOLffy80Xqdg+XLICO5HhfaQ12To/Fyl2AsZxDSRajqj8Thd+/FH46bz5JOQEExEoRZpZMJ49tqoiudYTaRPg+g/ftzwvtNCISKkIQXpwQ950OJzrkWxi2tiK9PhpYZRxQI6+BqRh/M0kW4611pbaaS72/D+01euhGxAT1i/E8XgLE1MmWXef+yY4X15zSxUsYAOasme43igiZWmc+XwYcP7cjIwVLGATragCJyjiSkhBSdV54Tq/oICQ/sHqqoo3tIC2cxhK2W2HSSobEu0X1nXsVa7L7PZBU3SpuZemphTj0kkKHb0KAVeeMHQ7kWrVlGntuoDkE5bhs8fTqn712pfRNEHnUP5CgvurQ6apE3hvTQxLXPggEAvFk8aLZK0nA2wLQPaS7xU0kuH7myHaGKa6cQEGpPVaOfZZ/EIeIOosoVIfDY5Ju85RBPTTEcdnSww65wHCmZZsCY6sM0XVrRNphzF6AxNzEvM7vcLtclk5eVRIaZFeIlGwf0rUITO0ES66XB0MuP552nJkSP04OOPCx0r/9FHIbu3CAvuj9HJDtBESu9Vltbwy+0warVIiVJkILrCBPAcFeTBHMRO08Sw6fhyc1WD4RHEbDiyjCbVcGJKtAQAcBe6TYejmjk7d6pVqGyTGnpv9vZS57ZtdP38eSgEgNdNZ87u3VRcXS39QoYjEXUt8z4luhk8dUodYAgsp5xuj07NRMMsGoM9oIk+0/H7KaBEOLLg9KY8nifW3EzDHR14vDJHDY2NQsVLD03sFelMmTdPqO2Gl6gZaGlR22p4mkQiFsOjlVl4xOhewhgXaGJX05msmI5eOLcOJ/bqO3xYnQiaxJrldiFTKT+BxzXRZTp6FsTj3qd/vvSS0BwsYAo8bsIOqyoAj2qia3DglAUL0v63Pr+fHt6/n+bu2UMPPPYYHit7fU1hONDEGZHOlPnzdR2ccx5zTxdvXM3iKhYn+LrKvVMgE9QRZmNDE0dVr8rLDZ8ot6SESl59Vd1gQBkhSMgnDE2cVr26JakReNyAFn/zDf359Gl17A+WFTYdGA40cZ7pXKqvp1s3bki9gHEDWvLtt1QRDutqrAa6vqhBFAM0cVz16rfPP1erRDwFYuaLL9JUybPA8xcupLIdO+jCK6/gkZTLBsnH46xyYWWLm3Cd5dDE3ZrongbBybl6Pv5Y3bhKNLO6mh5as8ZwEvY7QTXLtK+qrAd7K5k3k/tpD5mOZzURyqfD65bzxMxTixfTxS1b6Gprq/AF2XyUcpkDH+5ySQ9NI43lzg0TgCaZMp1xeJRx75df0lkl4rl+8aLQsXoPHrT7w+LEB1yUKFmzxIuXTMezmkjNHJhXWqpuRuGu9J5PPzXzfkUz3DtxAJeMa/6ExJN0A2gi2XT8fpq/b5/QhNDo7t1mz80SFamQnNfjICOFJ6pU0MR+plO2fbtQTmSedX6lqcns+5XxZdiLLzOAJhk2nWnPPEOzN282vD8vQcwN0hbQJknsBgdpLMNodxKSnkMTu5gOp7tY8MEHQsf4+Y036Obly1bds4xwqobGZgU7oaolw2j54T5DGGAITSQgtBoE50te2NAglCv5d6VK9ftXX1l5z4dIzgS7oLZFNSOLC9azzeqOj0o6TrlmtG1aGZrRpuCVaMrTmviSySSdKC7m/z+sbKv17MyGU7RqleGT3+jqoraVK9UBh5K4xC/vip6eu/7lXJ9vvBAjLnzAQ/d56CLkjUF3oQlevKTo+yLxWj2jSWcyGZZSvfrD5s1ChsNJvn567TWZhqOnPv2ex8L5JgLQxCYYMh2eqsC9VSJ07duXybQW+8hb407ewzsOTRxrOtyOs+Cjj9TMgEbhXMlsOhmEDWedh3SOakYLoInzTIdz34iMOubuca5W2WBdK65nbvSQ1rtIXgMmgCbWmE7BU08JL7TXqVTLLOwen4hGDxnPeHSH6QzQxBmmw2uXz62vFzoZ5+KxYNSxEeNZ6hHhuWs1BOOBJo4wneL162myQFY/rlZF3nzTzsIvJTmDtvCQA2giajoc5YhMc2AuvfuunapVdyOqGc8ujzzk/AUJ432HJrY0Hc4OOCkQMHwSzrFzucEx05XqyBvJqga0r+s6QgMzNLGb6XDVSoRf3n7bDr1VRsLdOVrk42YDatLuk++3EQYETcxmwsE2U5ctUxOmi0Q5sSNHnFo+US3yGaecbg9dD0o+19OU2cl74RRz5SkiFSQvraaVet0Pp1WdXanJhKZTVFkpdEaTMwFmogCjKQ+E7Gpd0Cb3OeDS6K7O4VUvV2gyYfWqMBQSOoGDoxwAgNWmkxMICK9tNdLVhVJOjwIUAfC86YhWrdQTCOTa8RBcX1+LYgCeNx3RqhWDxfPSgvMul6MYgOdNR8aqnSWbNqGU7x/h8ACmGgnHCqM4geNNRwac6GvuO+9QdgGaLFLgrs9aGstxK8NwoihS4BT8VpyEBxcGqqrUZYiHo7ffj/EUGdfPn1eTs1tEHY1l0ncTiHKAO0yHk20VLF8uJ6TKy1PXxbrb2lh8jl8PHEBPl3E+QREAV1SvYs3WjLHhfMmJwUGoYYw2RDrANaYzdK5dXbHBbPqPH89Egna3sBVFAFxjOmPRTrPpF8FVK2DYcBDlAHeZjtlzp661t9PgyZNQQj+cZhXJ1oH7TGe4o4N6Dx407QJ6Ghqggj44suG0B40oCuBK02Eib71FI93dplzAQEsLVEiPKI0ldwoRxuUAt5tOIhajc1VVdLO3V+rJhyMRdJOn4cs0lgeGoxus1Am8YTrj1ayzq1fT1dZWaSePf/cdFEjPbOpQHMBzpsNwVHJ2zRrq3LZNSld6HA3IdzMajmY2ppgNVm0AriJ1RDKPBPx14rpWQu3R+u2LL7JmrFs3q+i55/6Uv2jRzNySkul6Tnz9woXu/mPHuD9+VOL9xNL4N1GyRzfzP1KMpo3+NyshAK7Fl0wm6URxsatuakVPD5QFwKb8R4ABAIVBfi7Jn7kUAAAAAElFTkSuQmCC" # noqa def main(): entries = list() args = demisto.args() entryIDs = argToList(args.get('entryIDs')) fileInfos = list() for item in entryIDs: res = demisto.executeCommand("getFilePath", {"id": item}) if is_error(res): return_error(get_error(res)) if type(res[0]['Contents']) == dict: fileInfo = { "name": res[0]['Contents']['name'], "id": res[0]['Contents']['ID'], "path": res[0]['Contents']['path'], "entryID": item } fileInfos.append(fileInfo) if len(fileInfos) < 1: return_error('No files were found for scanning, please check the entry IDs') yaraRuleRaw = args.get('yaraRule') for fileInfo in fileInfos: with open(fileInfo['path'], 'rb') as fp: thisMatch = { "Filename": fileInfo['name'], "entryID": fileInfo['entryID'], "fileID": fileInfo['id'], "HasMatch": False, "HasError": False, "MatchCount": 0, "Matches": list(), "Errors": list() } try: cRule = yara.compile(source=yaraRuleRaw) except Exception as err: thisMatch['HasError'] = True thisMatch['Errors'].append(str(err)) entries.append(thisMatch) continue try: matches = cRule.match(data=fp.read()) except Exception as err: thisMatch['HasError'] = True thisMatch['Errors'].append(str(err)) entries.append(thisMatch) continue if len(matches) > 0: thisMatch['HasMatch'] = True else: thisMatch['HasMatch'] = False for match in matches: matchData = dict() matchData['RuleName'] = match.rule matchData['Meta'] = match.meta matchData['Strings'] = str(match.strings) matchData['Tags'] = match.tags matchData['Namespace'] = match.namespace thisMatch['Matches'].append(matchData) thisMatch['MatchCount'] += 1 entries.append(thisMatch) md = "![](data:image/png;base64,{})\n\n{}".format( yaraLogo, tableToMarkdown('Yara Scan Results:', entries, ['Filename', 'entryID', 'HasMatch', 'HasError', 'MatchCount', 'Matches'])) demisto.results({ 'Type': entryTypes['note'], 'Contents': entries, 'ContentsFormat': formats['json'], 'HumanReadable': md, 'ReadableContentsFormat': formats['markdown'], 'EntryContext': {'Yara(val.entryID && val.entryID==obj.entryID)': entries} }) if __name__ in ['__main__', 'builtin', 'builtins']: main()
78.290323
4,185
0.778739
385
7,281
14.696104
0.568831
0.002828
0.008484
0.00707
0.034641
0.034641
0.034641
0.034641
0.034641
0.034641
0
0.108282
0.147645
7,281
92
4,186
79.141304
0.803416
0.009339
0
0.168831
0
0.012987
0.661275
0.592107
0
1
0
0
0
1
0.012987
false
0
0.038961
0
0.051948
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
5
ed131e375d7e3ff8bd83cab6c7d88bb8c39f7b38
144
py
Python
recipe_app/admin.py
Ljohns635/recipebox
59b70f02dcf322284bc76cf636315ca8839dc722
[ "MIT" ]
null
null
null
recipe_app/admin.py
Ljohns635/recipebox
59b70f02dcf322284bc76cf636315ca8839dc722
[ "MIT" ]
null
null
null
recipe_app/admin.py
Ljohns635/recipebox
59b70f02dcf322284bc76cf636315ca8839dc722
[ "MIT" ]
null
null
null
from django.contrib import admin from recipe_app.models import Author, RecipeItems admin.site.register(Author) admin.site.register(RecipeItems)
28.8
49
0.847222
20
144
6.05
0.6
0.14876
0.280992
0
0
0
0
0
0
0
0
0
0.076389
144
5
50
28.8
0.909774
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
ed3734895d06351efd8db151c78cab4264d53ff7
146
py
Python
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/locations/admin.py
piyushka17/azure-intelligent-edge-patterns
0d088899afb0022daa2ac434226824dba2c997c1
[ "MIT" ]
1
2020-08-17T16:50:09.000Z
2020-08-17T16:50:09.000Z
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/locations/admin.py
piyushka17/azure-intelligent-edge-patterns
0d088899afb0022daa2ac434226824dba2c997c1
[ "MIT" ]
null
null
null
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/locations/admin.py
piyushka17/azure-intelligent-edge-patterns
0d088899afb0022daa2ac434226824dba2c997c1
[ "MIT" ]
null
null
null
""" Location admin """ from django.contrib import admin from .models import Location # Register your models here. admin.site.register(Location)
14.6
32
0.767123
19
146
5.894737
0.578947
0.160714
0
0
0
0
0
0
0
0
0
0
0.136986
146
9
33
16.222222
0.888889
0.287671
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
ed6b05951e84ee2f2aa080cc8043aa0423da46f1
155
py
Python
rlfd/rlfd/agents/__init__.py
cheneyuwu/RLProject
a2708e3a13e74e3617cb11799ba2a128a63709e9
[ "MIT" ]
1
2021-01-11T16:42:58.000Z
2021-01-11T16:42:58.000Z
rlfd/rlfd/agents/__init__.py
cheneyuwu/RLProject
a2708e3a13e74e3617cb11799ba2a128a63709e9
[ "MIT" ]
4
2020-01-04T22:07:24.000Z
2020-06-26T00:08:32.000Z
rlfd/rlfd/agents/__init__.py
cheneyuwu/RLProject
a2708e3a13e74e3617cb11799ba2a128a63709e9
[ "MIT" ]
null
null
null
# Import modules with agent class defined from . import td3, sac, cql, cql_dp, bc, cql_online, sac_offline from . import gan, nf from .agent import AGENTS
31
64
0.76129
26
155
4.423077
0.653846
0.173913
0
0
0
0
0
0
0
0
0
0.007752
0.167742
155
4
65
38.75
0.883721
0.251613
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
ed736d36cbe3de9fe39a9baf79f2c131427e4135
235
py
Python
app/demo/countries/translation.py
frankhood/django-material-admin
ea384bdf8ebcc59532fcb605519a8e9362e96414
[ "MIT" ]
null
null
null
app/demo/countries/translation.py
frankhood/django-material-admin
ea384bdf8ebcc59532fcb605519a8e9362e96414
[ "MIT" ]
null
null
null
app/demo/countries/translation.py
frankhood/django-material-admin
ea384bdf8ebcc59532fcb605519a8e9362e96414
[ "MIT" ]
null
null
null
from modeltranslation.translator import translator, TranslationOptions from .models import Country class CountryTranslationOptions(TranslationOptions): fields = ('name',) translator.register(Country, CountryTranslationOptions)
23.5
70
0.829787
19
235
10.263158
0.631579
0
0
0
0
0
0
0
0
0
0
0
0.102128
235
9
71
26.111111
0.924171
0
0
0
0
0
0.017021
0
0
0
0
0
0
1
0
false
0
0.4
0
0.8
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
71f54575d5a74f37fd6acd6d3a477b783765eef7
214
py
Python
src/airfly/_vendor/airflow/operators/s3_to_redshift_operator.py
ryanchao2012/airfly
230ddd88885defc67485fa0c51f66c4a67ae98a9
[ "MIT" ]
7
2021-09-27T11:38:48.000Z
2022-02-01T06:06:24.000Z
src/airfly/_vendor/airflow/operators/s3_to_redshift_operator.py
ryanchao2012/airfly
230ddd88885defc67485fa0c51f66c4a67ae98a9
[ "MIT" ]
null
null
null
src/airfly/_vendor/airflow/operators/s3_to_redshift_operator.py
ryanchao2012/airfly
230ddd88885defc67485fa0c51f66c4a67ae98a9
[ "MIT" ]
null
null
null
# Auto generated by 'inv collect-airflow' from airfly._vendor.airflow.providers.amazon.aws.transfers.s3_to_redshift import ( S3ToRedshiftOperator, ) class S3ToRedshiftTransfer(S3ToRedshiftOperator): pass
23.777778
82
0.803738
23
214
7.347826
0.913043
0
0
0
0
0
0
0
0
0
0
0.021164
0.116822
214
8
83
26.75
0.873016
0.182243
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0.2
0.2
0
0.4
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
1
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
9c08901375fa94ba6347f296a119d1c9f1d074b7
79
py
Python
djackal/views/__init__.py
jrog612/djackal
f46733f69f7a2e796ac611700ac5ffe20b7f0927
[ "MIT" ]
null
null
null
djackal/views/__init__.py
jrog612/djackal
f46733f69f7a2e796ac611700ac5ffe20b7f0927
[ "MIT" ]
null
null
null
djackal/views/__init__.py
jrog612/djackal
f46733f69f7a2e796ac611700ac5ffe20b7f0927
[ "MIT" ]
null
null
null
from .base import DjackalAPIView from .generics import * from .mixins import *
19.75
32
0.78481
10
79
6.2
0.6
0
0
0
0
0
0
0
0
0
0
0
0.151899
79
3
33
26.333333
0.925373
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9c32972e9a8d8a36d99ef1dfe241aa3b60fe49c2
122
py
Python
simpleAPI/companys/admin.py
Gleb-Stasuyk/simpleAPI
9b30202915a4f144921b9bd5204f7bfac8b1201f
[ "MIT" ]
null
null
null
simpleAPI/companys/admin.py
Gleb-Stasuyk/simpleAPI
9b30202915a4f144921b9bd5204f7bfac8b1201f
[ "MIT" ]
null
null
null
simpleAPI/companys/admin.py
Gleb-Stasuyk/simpleAPI
9b30202915a4f144921b9bd5204f7bfac8b1201f
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Company, News admin.site.register(Company) admin.site.register(News)
24.4
33
0.819672
18
122
5.555556
0.555556
0.18
0.34
0
0
0
0
0
0
0
0
0
0.090164
122
5
34
24.4
0.900901
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
9c49e7ea9dc0c83f5d74bb36493688e800e07822
91
py
Python
python/flask/simpledu/simpledu/handlers/course.py
smallyear/linuxLearn
342e5020bf24b5fac732c4275a512087b47e578d
[ "Apache-2.0" ]
1
2017-11-21T16:57:27.000Z
2017-11-21T16:57:27.000Z
python/flask/simpledu/simpledu/handlers/course.py
smallyear/linuxLearn
342e5020bf24b5fac732c4275a512087b47e578d
[ "Apache-2.0" ]
null
null
null
python/flask/simpledu/simpledu/handlers/course.py
smallyear/linuxLearn
342e5020bf24b5fac732c4275a512087b47e578d
[ "Apache-2.0" ]
null
null
null
from flask import Blueprint course = Blueprint('course', __name__, url_prefix='/courses')
22.75
61
0.769231
11
91
5.909091
0.818182
0.461538
0
0
0
0
0
0
0
0
0
0
0.10989
91
3
62
30.333333
0.802469
0
0
0
0
0
0.153846
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
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
0
0
1
0
0
1
0
5
9c8192fd57840d66f2ad325f625cc003dcadc59b
100
py
Python
pySGDabao/__init__.py
rizemon/pySGDabao
3c4e24e29fa42fbabd5b7f34c81cd849e56bfe5b
[ "Apache-2.0" ]
1
2021-05-31T21:50:26.000Z
2021-05-31T21:50:26.000Z
pySGDabao/__init__.py
rizemon/pySGDabao
3c4e24e29fa42fbabd5b7f34c81cd849e56bfe5b
[ "Apache-2.0" ]
null
null
null
pySGDabao/__init__.py
rizemon/pySGDabao
3c4e24e29fa42fbabd5b7f34c81cd849e56bfe5b
[ "Apache-2.0" ]
1
2021-05-18T07:29:05.000Z
2021-05-18T07:29:05.000Z
from .foodpanda import Foodpanda from .deliveroo import Deliveroo from .honestbee import Honestbee
33.333333
33
0.84
12
100
7
0.416667
0
0
0
0
0
0
0
0
0
0
0
0.13
100
3
34
33.333333
0.965517
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
9c836e59bdb6aeb9e92956636746187b11661e26
5,984
py
Python
nova/tests/unit/api/openstack/compute/test_urlmap.py
larsbutler/nova
fb190f30a911658d8b0c4deaf43cbb8c9e35b672
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/api/openstack/compute/test_urlmap.py
larsbutler/nova
fb190f30a911658d8b0c4deaf43cbb8c9e35b672
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/api/openstack/compute/test_urlmap.py
larsbutler/nova
fb190f30a911658d8b0c4deaf43cbb8c9e35b672
[ "Apache-2.0" ]
null
null
null
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_serialization import jsonutils import webob from nova import test from nova.tests.unit.api.openstack import fakes import nova.tests.unit.image.fake class UrlmapTest(test.NoDBTestCase): def setUp(self): super(UrlmapTest, self).setUp() nova.tests.unit.image.fake.stub_out_image_service(self) def tearDown(self): super(UrlmapTest, self).tearDown() nova.tests.unit.image.fake.FakeImageService_reset() def test_path_version_v2(self): # Test URL path specifying v2 returns v2 content. req = webob.Request.blank('/v2/') req.accept = "application/json" res = req.get_response(fakes.wsgi_app_v21(init_only=('versions',), v2_compatible=True)) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('v2.0', body['version']['id']) def test_content_type_version_v2(self): # Test Content-Type specifying v2 returns v2 content. req = webob.Request.blank('/') req.content_type = "application/json;version=2" req.accept = "application/json" res = req.get_response(fakes.wsgi_app_v21(init_only=('versions',), v2_compatible=True)) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('v2.0', body['version']['id']) def test_accept_version_v2(self): # Test Accept header specifying v2 returns v2 content. req = webob.Request.blank('/') req.accept = "application/json;version=2" res = req.get_response(fakes.wsgi_app_v21(init_only=('versions',), v2_compatible=True)) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('v2.0', body['version']['id']) def test_path_content_type(self): # Test URL path specifying JSON returns JSON content. url = '/v2/fake/images/cedef40a-ed67-4d10-800e-17455edce175.json' req = webob.Request.blank(url) req.accept = "application/xml" res = req.get_response(fakes.wsgi_app_v21(init_only=('images',))) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('cedef40a-ed67-4d10-800e-17455edce175', body['image']['id']) def test_accept_content_type(self): # Test Accept header specifying JSON returns JSON content. url = '/v2/fake/images/cedef40a-ed67-4d10-800e-17455edce175' req = webob.Request.blank(url) req.accept = "application/xml;q=0.8, application/json" res = req.get_response(fakes.wsgi_app_v21(init_only=('images',))) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('cedef40a-ed67-4d10-800e-17455edce175', body['image']['id']) def test_path_version_v21(self): # Test URL path specifying v2.1 returns v2.1 content. req = webob.Request.blank('/v2.1/') req.accept = "application/json" res = req.get_response(fakes.wsgi_app_v21(init_only=('versions',))) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('v2.1', body['version']['id']) def test_content_type_version_v21(self): # Test Content-Type specifying v2.1 returns v2 content. req = webob.Request.blank('/') req.content_type = "application/json;version=2.1" req.accept = "application/json" res = req.get_response(fakes.wsgi_app_v21(init_only=('versions',))) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('v2.1', body['version']['id']) def test_accept_version_v21(self): # Test Accept header specifying v2.1 returns v2.1 content. req = webob.Request.blank('/') req.accept = "application/json;version=2.1" res = req.get_response(fakes.wsgi_app_v21(init_only=('versions',))) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('v2.1', body['version']['id']) def test_accept_content_type_v21(self): # Test Accept header specifying JSON returns JSON content. req = webob.Request.blank('/') req.content_type = "application/json;version=2.1" req.accept = "application/xml;q=0.8, application/json" res = req.get_response(fakes.wsgi_app_v21(init_only=('versions',))) self.assertEqual(200, res.status_int) self.assertEqual("application/json", res.content_type) body = jsonutils.loads(res.body) self.assertEqual('v2.1', body['version']['id'])
45.333333
78
0.652406
760
5,984
5.011842
0.177632
0.106327
0.070885
0.047257
0.792859
0.771069
0.729588
0.724337
0.714886
0.667104
0
0.040302
0.224599
5,984
131
79
45.679389
0.780603
0.181818
0
0.691489
0
0
0.165435
0.074097
0
0
0
0
0.287234
1
0.117021
false
0
0.053191
0
0.180851
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
92bba209fd8770afe9d70a559e255d710034f02f
18,258
py
Python
src/controller/python/test/test_scripts/network_commissioning.py
mykrupp/connectedhomeip-1
c6ca8bde66f76fa95b0383e2faa6a67c74cef2c3
[ "Apache-2.0" ]
null
null
null
src/controller/python/test/test_scripts/network_commissioning.py
mykrupp/connectedhomeip-1
c6ca8bde66f76fa95b0383e2faa6a67c74cef2c3
[ "Apache-2.0" ]
null
null
null
src/controller/python/test/test_scripts/network_commissioning.py
mykrupp/connectedhomeip-1
c6ca8bde66f76fa95b0383e2faa6a67c74cef2c3
[ "Apache-2.0" ]
null
null
null
# # Copyright (c) 2021 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import chip.clusters as Clusters import logging from chip.clusters.Attribute import AttributePath, AttributeReadResult, AttributeStatus, ValueDecodeFailure from chip.clusters.Types import NullValue import chip.interaction_model import asyncio logger = logging.getLogger('NetworkCommissioning') logger.setLevel(logging.INFO) TEST_THREAD_NETWORK_DATASET_TLVS = [bytes.fromhex("0e080000000000010000" + "000300000c" + "35060004001fffe0" + "0208fedcba9876543210" + "0708fd00000000001234" + "0510ffeeddccbbaa99887766554433221100" + "030e54657374696e674e6574776f726b" + "0102d252" + "041081cb3b2efa781cc778397497ff520fa50c0302a0ff"), # End of first TLV ] # Network id, for the thread network, current a const value, will be changed to XPANID of the thread network. TEST_THREAD_NETWORK_IDS = [ bytes.fromhex("fedcba9876543210"), ] TEST_WIFI_SSID = "TestSSID" TEST_WIFI_PASS = "TestPass" WIFI_NETWORK_FEATURE_MAP = 1 THREAD_NETWORK_FEATURE_MAP = 2 class NetworkCommissioningTests: def __init__(self, devCtrl, nodeid): self._devCtrl = devCtrl self._nodeid = nodeid def log_interface_basic_info(self, values): logger.info(f"The interface supports {values.maxNetworks} networks.") logger.info( f"ScanNetworks should take no more than {values.scanMaxTimeSeconds} seconds.") logger.info( f"ConnectNetwork should take no more than {values.connectMaxTimeSeconds} seconds.") logger.info( f"The feature map of this endpoint is {values.featureMap}.") async def readLastNetworkingStateAttributes(self, endpointId): res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.LastConnectErrorValue), (endpointId, Clusters.NetworkCommissioning.Attributes.LastNetworkID), (endpointId, Clusters.NetworkCommissioning.Attributes.LastNetworkingStatus)], returnClusterObject=True) values = res[endpointId][Clusters.NetworkCommissioning] logger.info(f"Got values: {values}") return values async def test_negative(self, endpointId): logger.info( f"Running negative test cases for NetworkCommissioning cluster on endpoint {endpointId}") try: logger.info( f"1. Send ConnectNetwork command with a illegal network id") req = Clusters.NetworkCommissioning.Commands.ConnectNetwork( networkID=b'0' * 254, breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) raise AssertionError(f"Failure expected but got response {res}") except chip.interaction_model.InteractionModelError as ex: logger.info(f"Received {ex} from server.") logger.info(f"Finished negative test cases.") async def test_wifi(self, endpointId): logger.info(f"Get basic information of the endpoint") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[ (endpointId, Clusters.NetworkCommissioning.Attributes.ConnectMaxTimeSeconds), (endpointId, Clusters.NetworkCommissioning.Attributes.ScanMaxTimeSeconds), (endpointId, Clusters.NetworkCommissioning.Attributes.MaxNetworks), (endpointId, Clusters.NetworkCommissioning.Attributes.FeatureMap)], returnClusterObject=True) self.log_interface_basic_info( res[endpointId][Clusters.NetworkCommissioning]) logger.info(f"Finished getting basic information of the endpoint") # Read Last* attributes logger.info(f"Read Last* attributes") res = await self.readLastNetworkingStateAttributes(endpointId=endpointId) if (res.lastNetworkID != NullValue) or (res.lastNetworkingStatus != NullValue) or (res.lastConnectErrorValue != NullValue): raise AssertionError( f"LastNetworkID, LastNetworkingStatus and LastConnectErrorValue should be Null") # Scan networks logger.info(f"Scan networks") req = Clusters.NetworkCommissioning.Commands.ScanNetworks( ssid=b'', breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Received response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError(f"Unexpected result: {res.networkingStatus}") # Verify Last* attributes logger.info(f"Read Last* attributes") res = await self.readLastNetworkingStateAttributes(endpointId=endpointId) if (res.lastNetworkID != NullValue) or (res.lastNetworkingStatus == NullValue) or (res.lastConnectErrorValue != NullValue): raise AssertionError( f"LastNetworkID and LastConnectErrorValue should be Null and LastNetworkingStatus should not be Null") # Remove existing network logger.info(f"Check network list") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) networkList = res[endpointId][Clusters.NetworkCommissioning].networks logger.info(f"Got network list: {networkList}") if len(networkList) != 0: logger.info(f"Removing existing network") req = Clusters.NetworkCommissioning.Commands.RemoveNetwork( networkID=networkList[0].networkID, breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Received response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError( f"Unexpected result: {res.networkingStatus}") # Add first network logger.info(f"Adding first test network") req = Clusters.NetworkCommissioning.Commands.AddOrUpdateWiFiNetwork( ssid=TEST_WIFI_SSID.encode(), credentials=TEST_WIFI_PASS.encode(), breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Received response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError(f"Unexpected result: {res.networkingStatus}") logger.info(f"Check network list") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) networkList = res[endpointId][Clusters.NetworkCommissioning].networks logger.info(f"Got network list: {networkList}") if len(networkList) != 1: raise AssertionError( f"Unexpected result: expect 1 networks, but {len(networkList)} networks received") if networkList[0].networkID != TEST_WIFI_SSID.encode(): raise AssertionError( f"Unexpected result: first network ID should be 'TestSSID' got {networkList[0].networkID}") logger.info(f"Connect to a network") req = Clusters.NetworkCommissioning.Commands.ConnectNetwork( networkID=TEST_WIFI_SSID.encode(), breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Got response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError(f"Unexpected result: {res.networkingStatus}") logger.info(f"Device connected to a network.") # Note: On Linux, when connecting to a connected network, it will return immediately, however, it will try a reconnect. This will make the below attribute read return false negative values. await asyncio.sleep(5) logger.info(f"Check network is connected") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) networkList = res[endpointId][Clusters.NetworkCommissioning].networks logger.info(f"Got network list: {networkList}") if len(networkList) != 1: raise AssertionError( f"Unexpected result: expect 1 networks, but {len(networkList)} networks received") if networkList[0].networkID != TEST_WIFI_SSID.encode(): raise AssertionError( f"Unexpected result: first network ID should be 'TestSSID' got {networkList[0].networkID}") if not networkList[0].connected: raise AssertionError( f"Unexpected result: network is not marked as connected") # Verify Last* attributes logger.info(f"Read Last* attributes") res = await self.readLastNetworkingStateAttributes(endpointId=endpointId) if (res.lastNetworkID == NullValue) or (res.lastNetworkingStatus == NullValue) or (res.lastConnectErrorValue == NullValue): raise AssertionError( f"LastNetworkID, LastConnectErrorValue and LastNetworkingStatus should not be Null") async def test_thread(self, endpointId): logger.info(f"Get basic information of the endpoint") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[ (endpointId, Clusters.NetworkCommissioning.Attributes.ConnectMaxTimeSeconds), (endpointId, Clusters.NetworkCommissioning.Attributes.ScanMaxTimeSeconds), (endpointId, Clusters.NetworkCommissioning.Attributes.MaxNetworks), (endpointId, Clusters.NetworkCommissioning.Attributes.FeatureMap)], returnClusterObject=True) self.log_interface_basic_info( res[endpointId][Clusters.NetworkCommissioning]) logger.info(f"Finished getting basic information of the endpoint") # Read Last* attributes logger.info(f"Read Last* attributes") res = await self.readLastNetworkingStateAttributes(endpointId=endpointId) if (res.lastNetworkID != NullValue) or (res.lastNetworkingStatus != NullValue) or (res.lastConnectErrorValue != NullValue): raise AssertionError( f"LastNetworkID, LastNetworkingStatus and LastConnectErrorValue should be Null") # Scan networks logger.info(f"Scan networks") req = Clusters.NetworkCommissioning.Commands.ScanNetworks( ssid=b'', breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Received response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError(f"Unexpected result: {res.networkingStatus}") # Verify Last* attributes logger.info(f"Read Last* attributes") res = await self.readLastNetworkingStateAttributes(endpointId=endpointId) if (res.lastNetworkID != NullValue) or (res.lastNetworkingStatus == NullValue) or (res.lastConnectErrorValue != NullValue): raise AssertionError( f"LastNetworkID and LastConnectErrorValue should be Null and LastNetworkingStatus should not be Null") # Remove existing network logger.info(f"Check network list") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) networkList = res[endpointId][Clusters.NetworkCommissioning].networks logger.info(f"Got network list: {networkList}") if len(networkList) != 0: logger.info(f"Removing existing network") req = Clusters.NetworkCommissioning.Commands.RemoveNetwork( networkID=networkList[0].networkID, breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Received response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError( f"Unexpected result: {res.networkingStatus}") # Add first network logger.info(f"Adding first test network") req = Clusters.NetworkCommissioning.Commands.AddOrUpdateThreadNetwork( operationalDataset=TEST_THREAD_NETWORK_DATASET_TLVS[0], breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Received response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError(f"Unexpected result: {res.networkingStatus}") logger.info(f"Check network list") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) networkList = res[endpointId][Clusters.NetworkCommissioning].networks logger.info(f"Got network list: {networkList}") if len(networkList) != 1: raise AssertionError( f"Unexpected result: expect 1 networks, but {len(networkList.Data.value)} networks received") if networkList[0].networkID != TEST_THREAD_NETWORK_IDS[0]: raise AssertionError( f"Unexpected result: first network ID should be {TEST_THREAD_NETWORK_IDS[0]} got {networkList[0].networkID}") logger.info(f"Connect to a network") req = Clusters.NetworkCommissioning.Commands.ConnectNetwork( networkID=TEST_THREAD_NETWORK_IDS[0], breadcrumb=0) res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) logger.info(f"Got response: {res}") if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: raise AssertionError(f"Unexpected result: {res.networkingStatus}") logger.info(f"Device connected to a network.") # Verify Last* attributes logger.info(f"Read Last* attributes") res = await self.readLastNetworkingStateAttributes(endpointId=endpointId) if (res.lastNetworkID == NullValue) or (res.lastNetworkingStatus == NullValue) or (res.lastConnectErrorValue == NullValue): raise AssertionError( f"LastNetworkID, LastConnectErrorValue and LastNetworkingStatus should not be Null") logger.info(f"Check network list") res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) networkList = res[endpointId][Clusters.NetworkCommissioning].networks logger.info(f"Got network list: {networkList}") if len(networkList) != 1: raise AssertionError( f"Unexpected result: expect 1 networks, but {len(networkList.Data.value)} networks received") if networkList[0].networkID != TEST_THREAD_NETWORK_IDS[0]: raise AssertionError( f"Unexpected result: first network ID should be {TEST_THREAD_NETWORK_IDS[0]} got {networkList[0].networkID}") if not networkList[0].connected: raise AssertionError( f"Unexpected result: network is not marked as connected") async def run(self): try: endpoints = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(Clusters.NetworkCommissioning.Attributes.FeatureMap)], returnClusterObject=True) logger.info(endpoints) for endpoint, obj in endpoints.items(): clus = obj[Clusters.NetworkCommissioning] if clus.featureMap == WIFI_NETWORK_FEATURE_MAP: logger.info( f"Endpoint {endpoint} is configured as WiFi network, run WiFi commissioning test.") await self.test_negative(endpoint) await self.test_wifi(endpoint) elif clus.featureMap == THREAD_NETWORK_FEATURE_MAP: logger.info( f"Endpoint {endpoint} is configured as Thread network, run Thread commissioning test.") await self.test_negative(endpoint) await self.test_thread(endpoint) else: logger.info( f"Skip endpoint {endpoint} with featureMap {clus.featureMap}") except Exception as ex: logger.exception(ex) return False return True
57.23511
197
0.672801
1,771
18,258
6.871824
0.142292
0.04355
0.047001
0.028102
0.771076
0.761873
0.745357
0.741085
0.736565
0.736565
0
0.016115
0.242086
18,258
318
198
57.415094
0.863347
0.064465
0
0.699605
0
0.007905
0.215182
0.040537
0
0
0
0
0.098814
1
0.007905
false
0.007905
0.023715
0
0.047431
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
92d32ac56b0f90ff3bfa98fd1fc537b6449c1c3f
41
py
Python
04/00/0.py
pylangstudy/201707
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
[ "CC0-1.0" ]
null
null
null
04/00/0.py
pylangstudy/201707
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
[ "CC0-1.0" ]
46
2017-06-30T22:19:07.000Z
2017-07-31T22:51:31.000Z
04/00/0.py
pylangstudy/201707
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
[ "CC0-1.0" ]
null
null
null
#!/usr/bin/python3 print('Hello 0.py!!')
13.666667
21
0.634146
7
41
3.714286
1
0
0
0
0
0
0
0
0
0
0
0.052632
0.073171
41
2
22
20.5
0.631579
0.414634
0
0
0
0
0.521739
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
92d3b08e4119b987a48cc7f52d765bdc3738b10e
727
py
Python
examples/RemoteCtrl/script/testScript.py
prototypicalpro/spix
3b758e8ec88d9884627670f8d05bd50f7992e9c0
[ "MIT" ]
97
2019-06-26T07:48:49.000Z
2022-03-19T14:10:43.000Z
examples/RemoteCtrl/script/testScript.py
prototypicalpro/spix
3b758e8ec88d9884627670f8d05bd50f7992e9c0
[ "MIT" ]
35
2019-07-15T22:04:44.000Z
2022-03-24T13:57:49.000Z
examples/RemoteCtrl/script/testScript.py
prototypicalpro/spix
3b758e8ec88d9884627670f8d05bd50f7992e9c0
[ "MIT" ]
28
2019-07-10T10:53:37.000Z
2022-02-21T19:33:42.000Z
import xmlrpc.client s = xmlrpc.client.ServerProxy('http://localhost:9000') print("Available Methods:") print(s.system.listMethods()) s.mouseClick("mainWindow/Button_1") s.wait(200) s.mouseClick("mainWindow/Button_2") s.wait(200) s.mouseClick("mainWindow/Button_2") s.wait(200) s.mouseClick("mainWindow/Button_2") s.wait(200) s.mouseClick("mainWindow/Button_1") s.wait(200) s.mouseClick("mainWindow/Button_2") s.wait(200) s.mouseClick("mainWindow/Button_1") s.wait(200) s.mouseClick("mainWindow/Button_1") s.wait(200) s.mouseClick("mainWindow/Button_1") s.wait(200) s.mouseClick("mainWindow/Button_2") s.wait(200) resultText = s.getStringProperty("mainWindow/results", "text") print("Result:\n{}".format(resultText)) s.quit()
25.068966
62
0.763411
110
727
4.954545
0.254545
0.201835
0.385321
0.495413
0.66055
0.66055
0.66055
0.66055
0.66055
0.66055
0
0.063584
0.048143
727
28
63
25.964286
0.723988
0
0
0.740741
0
0
0.360385
0
0
0
0
0
0
1
0
false
0
0.037037
0
0.037037
0.111111
0
0
0
null
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
13235744121c09374187173c10a88e9d6ab03ece
193
py
Python
pytorch-perceiver/pytorch_perceiver.py
rish-16/pytorch-perceiver
547cb337dd1e47800951e0c4d21bf67f5794ba5d
[ "MIT" ]
1
2021-08-05T06:30:43.000Z
2021-08-05T06:30:43.000Z
pytorch-perceiver/pytorch_perceiver.py
rish-16/pytorch-perceiver
547cb337dd1e47800951e0c4d21bf67f5794ba5d
[ "MIT" ]
null
null
null
pytorch-perceiver/pytorch_perceiver.py
rish-16/pytorch-perceiver
547cb337dd1e47800951e0c4d21bf67f5794ba5d
[ "MIT" ]
1
2021-08-05T06:30:49.000Z
2021-08-05T06:30:49.000Z
import torch from torch import nn import torch.nn.functional as F class Perceiver(nn.Module): def __init__(self): super().__init__() def forward(self, x): pass
19.3
31
0.637306
26
193
4.423077
0.653846
0.191304
0
0
0
0
0
0
0
0
0
0
0.26943
193
10
32
19.3
0.815603
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.125
0.375
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
1
0
1
0
0
5
13244e735da5482b85e015adccaee9fc3950940a
2,877
py
Python
tests/unit/bokeh/plotting/test__tools.py
goncaloperes/bokeh
b857d2d17d7c19779bb0a7be2601d8238fb1d5e9
[ "BSD-3-Clause" ]
1
2021-04-09T02:57:29.000Z
2021-04-09T02:57:29.000Z
tests/unit/bokeh/plotting/test__tools.py
goncaloperes/bokeh
b857d2d17d7c19779bb0a7be2601d8238fb1d5e9
[ "BSD-3-Clause" ]
1
2021-04-21T19:44:07.000Z
2021-04-21T19:44:07.000Z
tests/unit/bokeh/plotting/test__tools.py
goncaloperes/bokeh
b857d2d17d7c19779bb0a7be2601d8238fb1d5e9
[ "BSD-3-Clause" ]
null
null
null
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- import pytest ; pytest #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Module under test import bokeh.plotting._tools as _tools # isort:skip #----------------------------------------------------------------------------- # Setup #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- def test__collect_repeated_tools() -> None: def count_repeated(tools: str) -> int: objs, _ = _tools._resolve_tools(tools) return len(list(_tools._collect_repeated_tools(objs))) assert count_repeated("pan,xpan,ypan") == 0 assert count_repeated("xwheel_pan,ywheel_pan") == 0 assert count_repeated("wheel_zoom,xwheel_zoom,ywheel_zoom") == 0 assert count_repeated("zoom_in,xzoom_in,yzoom_in") == 0 assert count_repeated("zoom_out,xzoom_out,yzoom_out") == 0 assert count_repeated("click,tap") == 0 assert count_repeated("crosshair") == 0 assert count_repeated("box_select,xbox_select,ybox_select") == 0 assert count_repeated("poly_select,lasso_select") == 0 assert count_repeated("box_zoom,xbox_zoom,ybox_zoom") == 0 assert count_repeated("hover,save,undo,redo,reset,help") == 0 assert count_repeated("pan,xpan,xpan") == 1 assert count_repeated("pan,xpan,ypan,xpan") == 1 assert count_repeated("pan,xpan,ypan,click,xpan") == 1 assert count_repeated("pan,xpan,ypan,click,xpan,click") == 2 assert count_repeated("pan,xpan,ypan,xpan,ypan") == 2 assert count_repeated("pan,xpan,ypan,click,xpan,ypan") == 2 assert count_repeated("pan,xpan,ypan,click,xpan,ypan,click") == 3 #----------------------------------------------------------------------------- # Code #-----------------------------------------------------------------------------
43.590909
78
0.400417
232
2,877
4.741379
0.357759
0.224545
0.310909
0.2
0.414545
0.250909
0.223636
0.195455
0.163636
0.163636
0
0.009966
0.093153
2,877
65
79
44.261538
0.411652
0.517553
0
0
0
0
0.314937
0.269316
0
0
0
0
0.75
1
0.083333
false
0
0.083333
0
0.208333
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
1352987d65d6bab2cc42ab1a29c5ddc7d4989639
134
py
Python
PythonExercicios/ex005.py
github-felipe/ExerciciosEmPython-cursoemvideo
0045464a287f21b6245554a975588cf06c5b476d
[ "MIT" ]
null
null
null
PythonExercicios/ex005.py
github-felipe/ExerciciosEmPython-cursoemvideo
0045464a287f21b6245554a975588cf06c5b476d
[ "MIT" ]
null
null
null
PythonExercicios/ex005.py
github-felipe/ExerciciosEmPython-cursoemvideo
0045464a287f21b6245554a975588cf06c5b476d
[ "MIT" ]
null
null
null
n = int(input('Digite um número inteiro: ')) print(f'O antecessor de {n} é \033[7;30m{n-1}\033[m e o sucessor é \033[30m{n+1}\033[m')
44.666667
88
0.649254
31
134
2.806452
0.645161
0.091954
0.114943
0.183908
0.206897
0
0
0
0
0
0
0.163793
0.134328
134
2
89
67
0.586207
0
0
0
0
0.5
0.776119
0.156716
0
0
0
0
0
1
0
false
0
0
0
0
0.5
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
13745a2272cacb5bd845a0693956b1aab64ef375
90
py
Python
commands/config.py
pieroproietti/penguins-eggs2
7c029cf1d180bd5d7ace856d547de8540b61c093
[ "MIT" ]
null
null
null
commands/config.py
pieroproietti/penguins-eggs2
7c029cf1d180bd5d7ace856d547de8540b61c093
[ "MIT" ]
null
null
null
commands/config.py
pieroproietti/penguins-eggs2
7c029cf1d180bd5d7ace856d547de8540b61c093
[ "MIT" ]
null
null
null
def config(args): """ This command configure eggs """ print("configure eggs")
15
30
0.611111
10
90
5.5
0.8
0.472727
0
0
0
0
0
0
0
0
0
0
0.244444
90
5
31
18
0.808824
0.3
0
0
0
0
0.285714
0
0
0
0
0
0
1
0.5
false
0
0
0
0.5
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
5
138eb8ba6f42506cccd1eaebffa8b180468ff9ab
43
py
Python
test/login.py
rebecca1202/010101
139d9fc5817be55c3765b9d527d2ff83c86730cf
[ "MIT" ]
null
null
null
test/login.py
rebecca1202/010101
139d9fc5817be55c3765b9d527d2ff83c86730cf
[ "MIT" ]
null
null
null
test/login.py
rebecca1202/010101
139d9fc5817be55c3765b9d527d2ff83c86730cf
[ "MIT" ]
null
null
null
num1=10 num2=20 num3=300 num3=30 num4=40
5.375
8
0.72093
10
43
3.1
0.9
0
0
0
0
0
0
0
0
0
0
0.444444
0.162791
43
7
9
6.142857
0.416667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
13aa23256de6e1903da7ff97977046bcd31f883a
428
py
Python
xastropy/igm/fN/__init__.py
bpholden/xastropy
66aff0995a84c6829da65996d2379ba4c946dabe
[ "BSD-3-Clause" ]
3
2015-08-23T00:32:58.000Z
2020-12-31T02:37:52.000Z
xastropy/igm/fN/__init__.py
Kristall-WangShiwei/xastropy
723fe56cb48d5a5c4cdded839082ee12ef8c6732
[ "BSD-3-Clause" ]
104
2015-07-17T18:31:54.000Z
2018-06-29T17:04:09.000Z
xastropy/igm/fN/__init__.py
Kristall-WangShiwei/xastropy
723fe56cb48d5a5c4cdded839082ee12ef8c6732
[ "BSD-3-Clause" ]
16
2015-07-17T15:50:37.000Z
2019-04-21T03:42:47.000Z
# Non-dependent modules import data # Dependent modules try: import pymc except ImportError: print('-----------------------------------------------------------') print('-----------------------------------------------------------') print('WARNING: Not loading model in xastropy.fN \n Install pymc if you want it') print('-----------------------------------------------------------') else: import model
30.571429
87
0.390187
33
428
5.060606
0.727273
0.191617
0
0
0
0
0
0
0
0
0
0
0.13785
428
13
88
32.923077
0.452575
0.091122
0
0.3
0
0
0.650259
0.458549
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0.4
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
1
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
13bdb6c681a5844598b50783e8027c0a73cf55b6
150
py
Python
Django/Ubi/status_point/admin.py
LuckyMagpie/StatusMap
7518fb7b98a759f6b184c7fc2c0b1c2656a55fe4
[ "Apache-2.0" ]
3
2016-03-04T22:28:26.000Z
2017-02-02T20:27:19.000Z
Django/Ubi/status_point/admin.py
LuckyMagpie/Ubi
7518fb7b98a759f6b184c7fc2c0b1c2656a55fe4
[ "Apache-2.0" ]
null
null
null
Django/Ubi/status_point/admin.py
LuckyMagpie/Ubi
7518fb7b98a759f6b184c7fc2c0b1c2656a55fe4
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import * admin.site.register(StatusPoint) admin.site.register(Indicator) # Register your models here.
18.75
32
0.8
20
150
6
0.6
0.183333
0.283333
0
0
0
0
0
0
0
0
0
0.113333
150
7
33
21.428571
0.902256
0.173333
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
13dba8fbfab8b2412ffc4a60e3e7cec0ace7a1b4
194
py
Python
tests/test_decorators.py
Olegt0rr/aiodine
89f6207e780ec2c08d62e9ec20372658af7ccef9
[ "MIT" ]
61
2019-02-27T21:07:54.000Z
2021-09-23T01:38:26.000Z
tests/test_decorators.py
Olegt0rr/aiodine
89f6207e780ec2c08d62e9ec20372658af7ccef9
[ "MIT" ]
30
2019-02-28T22:27:42.000Z
2021-09-07T04:49:47.000Z
tests/test_decorators.py
Olegt0rr/aiodine
89f6207e780ec2c08d62e9ec20372658af7ccef9
[ "MIT" ]
2
2019-10-14T15:51:59.000Z
2021-09-07T04:28:22.000Z
from aiodine import Store, Provider def test_at_provider_returns_a_provider_object(store: Store): @store.provider def example(): pass assert isinstance(example, Provider)
19.4
61
0.737113
24
194
5.708333
0.625
0.189781
0.233577
0
0
0
0
0
0
0
0
0
0.195876
194
9
62
21.555556
0.878205
0
0
0
0
0
0
0
0
0
0
0
0.166667
1
0.333333
false
0.166667
0.166667
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
1
0
1
0
0
0
0
0
5
b9176488ace89464189f43bc4e306167909572a0
216
py
Python
contrib/zmq/piped/plugins/zmq_plugin.py
alexbrasetvik/Piped
0312c14d6c4c293df378c915cc9787bcc7faed36
[ "MIT" ]
3
2015-02-12T20:34:30.000Z
2016-08-06T06:54:48.000Z
contrib/zmq/piped/plugins/zmq_plugin.py
alexbrasetvik/Piped
0312c14d6c4c293df378c915cc9787bcc7faed36
[ "MIT" ]
null
null
null
contrib/zmq/piped/plugins/zmq_plugin.py
alexbrasetvik/Piped
0312c14d6c4c293df378c915cc9787bcc7faed36
[ "MIT" ]
2
2015-12-16T14:18:14.000Z
2019-04-12T01:43:10.000Z
from piped_zmq import version from piped_zmq.providers import ZMQSocketProvider, ZMQProcessorFeederProvider from piped_zmq.processors import MessageSender from piped_zmq.mongrel2_processors import MongrelReplySender
43.2
77
0.902778
25
216
7.6
0.48
0.189474
0.252632
0
0
0
0
0
0
0
0
0.005025
0.078704
216
5
78
43.2
0.949749
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
b95b2f27cd6e7f7cd494e0ae61bfacf156b8cbcd
365
py
Python
sscanss/core/instrument/__init__.py
samtygier-stfc/SScanSS-2
0df2160c32fdc533f7d391735bd55d524e253f4d
[ "BSD-3-Clause" ]
9
2018-09-09T13:45:38.000Z
2022-01-04T09:02:37.000Z
sscanss/core/instrument/__init__.py
samtygier-stfc/SScanSS-2
0df2160c32fdc533f7d391735bd55d524e253f4d
[ "BSD-3-Clause" ]
21
2020-10-07T14:37:01.000Z
2022-03-18T09:14:35.000Z
sscanss/core/instrument/__init__.py
samtygier-stfc/SScanSS-2
0df2160c32fdc533f7d391735bd55d524e253f4d
[ "BSD-3-Clause" ]
8
2019-11-18T12:00:35.000Z
2022-02-17T13:35:15.000Z
from .calibration import circle_point_analysis, generate_description, robot_world_calibration from .create import (read_instrument_description_file, read_detector_description, read_jaw_description, read_instrument_description) from .instrument import Instrument from .robotics import Sequence, Link, IKSolver from .simulation import Simulation
52.142857
103
0.830137
41
365
7.04878
0.512195
0.096886
0.17301
0
0
0
0
0
0
0
0
0
0.131507
365
6
104
60.833333
0.911672
0
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
0.833333
0
0.833333
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
0
1
0
1
0
1
0
0
5
b9b1107e74771b20384f51ef715265fc733e0153
190
py
Python
python/aws_lambda_powertools/metrics/exceptions.py
doc22940/aws-lambda-powertools
70d927771176a221ca0d8e6e156cedd1187c6bff
[ "MIT-0" ]
1
2020-05-11T05:37:06.000Z
2020-05-11T05:37:06.000Z
python/aws_lambda_powertools/metrics/exceptions.py
doc22940/aws-lambda-powertools
70d927771176a221ca0d8e6e156cedd1187c6bff
[ "MIT-0" ]
null
null
null
python/aws_lambda_powertools/metrics/exceptions.py
doc22940/aws-lambda-powertools
70d927771176a221ca0d8e6e156cedd1187c6bff
[ "MIT-0" ]
null
null
null
class MetricUnitError(Exception): pass class SchemaValidationError(Exception): pass class MetricValueError(Exception): pass class UniqueNamespaceError(Exception): pass
12.666667
39
0.757895
16
190
9
0.4375
0.361111
0.375
0
0
0
0
0
0
0
0
0
0.178947
190
14
40
13.571429
0.923077
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
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
6a1d485a335681eaf0394441ea3928e3cd7423ab
39
py
Python
tests/__init__.py
NikhilJArora/pytorrent
77342e3675603d692fb24ba86ef8d1971932b16a
[ "MIT" ]
null
null
null
tests/__init__.py
NikhilJArora/pytorrent
77342e3675603d692fb24ba86ef8d1971932b16a
[ "MIT" ]
null
null
null
tests/__init__.py
NikhilJArora/pytorrent
77342e3675603d692fb24ba86ef8d1971932b16a
[ "MIT" ]
null
null
null
"""Unit test package for pytorrent."""
19.5
38
0.692308
5
39
5.4
1
0
0
0
0
0
0
0
0
0
0
0
0.128205
39
1
39
39
0.794118
0.820513
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
6a1e60f6318b2121e4265afae2a5723671404ab2
1,303
py
Python
backend/services/iotdevices.py
AmirAbaskohi/Castrol-Smart-Oil-Dispenser-App
adaf9d5ffee74283144eed9d75d2cabc67bf673d
[ "MIT" ]
null
null
null
backend/services/iotdevices.py
AmirAbaskohi/Castrol-Smart-Oil-Dispenser-App
adaf9d5ffee74283144eed9d75d2cabc67bf673d
[ "MIT" ]
null
null
null
backend/services/iotdevices.py
AmirAbaskohi/Castrol-Smart-Oil-Dispenser-App
adaf9d5ffee74283144eed9d75d2cabc67bf673d
[ "MIT" ]
null
null
null
iot_devices = { "cl01": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=cl01;SharedAccessKey=C3lI2jbo0DVgPtUqMjg7BYxXpBRvGsvXCCP/33zRK34=", # Cristian's Device "js01": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=js01;SharedAccessKey=9g4Qmbfoi/WZPNTA3HqePqrCjYd1mtj15CKu8hMow9Y=", # John's Device "rd01": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=rd01;SharedAccessKey=Qeqd/TDF2RflZlRpY2rWbElHKrC3OJ7nMVG3R0LOlF0=", # Roy's Device "sd01": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=sd01;SharedAccessKey=LDpxKA7Tpnqba3Z3ckEITlRKmLVnNy7/hzB4sMmpR28=", # Steve's Device / Actual Smart Dispenser "mm01": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=mm01;SharedAccessKey=f0X0nJcyx4ailP0Q8ZYfaHT2YFk2+BkVPkZdf7+l0Yo=", # Mohsen's Device "device001": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=device_001;SharedAccessKey=s6qT9bdU7vIWdKu1GAaliN5QR4lljBQK4/yIg2cO8QQ=", # Spare #1 "device002": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=device_002;SharedAccessKey=Sn5XrNGsib+NZ9AIxNngQsUGX03rNP41wEKlqdOhcw0=", # Spare #2 "device003": "HostName=znetinnn12ioth01.azure-devices.net;DeviceId=device_003;SharedAccessKey=SeB4TvNDT6nVlDU25H5Nvv6/En1gZfQcmJJLsqsfp84=", # Spare #3 } print(iot_devices["sd01"])
100.230769
176
0.811972
122
1,303
8.631148
0.418033
0.182336
0.220323
0.273504
0.374169
0.374169
0.150997
0
0
0
0
0.114592
0.069071
1,303
12
177
108.583333
0.753504
0.095165
0
0
0
0.090909
0.868038
0.824336
0
0
0
0
0
1
0
false
0
0
0
0
0.090909
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
dbe5053a0600edc09328b5d170f0fec13dbb23f6
115
py
Python
deep_rl/__init__.py
Louis-Bagot/DeepRL
0b152c52bbba90362c8276c223fee3f9a464eb32
[ "MIT" ]
null
null
null
deep_rl/__init__.py
Louis-Bagot/DeepRL
0b152c52bbba90362c8276c223fee3f9a464eb32
[ "MIT" ]
null
null
null
deep_rl/__init__.py
Louis-Bagot/DeepRL
0b152c52bbba90362c8276c223fee3f9a464eb32
[ "MIT" ]
null
null
null
from .agent import * from .component import * from .network import * from .utils import * from .reward_fs import *
19.166667
24
0.73913
16
115
5.25
0.5
0.47619
0
0
0
0
0
0
0
0
0
0
0.173913
115
5
25
23
0.884211
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
e00afd8cf124c27cecda8e2c97e7620875202d16
184
py
Python
calculation/gmhazard_calc/gmhazard_calc/disagg/__init__.py
ucgmsim/gmhazard
d3d90b4c94b3d9605597a3efeccc8523a1e50c0e
[ "MIT" ]
null
null
null
calculation/gmhazard_calc/gmhazard_calc/disagg/__init__.py
ucgmsim/gmhazard
d3d90b4c94b3d9605597a3efeccc8523a1e50c0e
[ "MIT" ]
8
2021-10-13T02:33:23.000Z
2022-03-29T21:01:08.000Z
calculation/gmhazard_calc/gmhazard_calc/disagg/__init__.py
ucgmsim/gmhazard
d3d90b4c94b3d9605597a3efeccc8523a1e50c0e
[ "MIT" ]
null
null
null
from .disagg import run_ensemble_disagg, run_branches_disagg, run_branch_disagg, run_disagg_gridding from .DisaggResult import BranchDisaggResult, EnsembleDisaggResult, DisaggGridData
61.333333
100
0.891304
21
184
7.428571
0.571429
0.173077
0
0
0
0
0
0
0
0
0
0
0.070652
184
2
101
92
0.912281
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
e00d24a87f304741748f78f58e4da607f825a34c
209
py
Python
docs/source/tutorials/installation/install_check.demo.py
HansBug/hbutils
6872311c8a441c5955572e0093b10189a2b90708
[ "Apache-2.0" ]
null
null
null
docs/source/tutorials/installation/install_check.demo.py
HansBug/hbutils
6872311c8a441c5955572e0093b10189a2b90708
[ "Apache-2.0" ]
25
2021-10-03T06:19:05.000Z
2022-03-27T12:48:57.000Z
docs/source/tutorials/installation/install_check.demo.py
HansBug/hbutils
6872311c8a441c5955572e0093b10189a2b90708
[ "Apache-2.0" ]
null
null
null
from hbutils.config.meta import __TITLE__, __VERSION__, __AUTHOR__, __DESCRIPTION__ if __name__ == '__main__': print(__TITLE__, __VERSION__) print(__DESCRIPTION__) print('Powered by', __AUTHOR__)
29.857143
83
0.760766
21
209
5.666667
0.714286
0.201681
0
0
0
0
0
0
0
0
0
0
0.143541
209
6
84
34.833333
0.664804
0
0
0
0
0
0.086124
0
0
0
0
0
0
1
0
true
0
0.2
0
0.2
0.6
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
e02c617141c58e19ba5f22f1729dd354634a3dc7
122
py
Python
depiction/models/uri/rest_api/__init__.py
IBM/dl-interpretability-compbio
3b13394f2dd9614736b4183b407a938a2c5924ac
[ "Apache-2.0" ]
23
2019-07-10T08:35:11.000Z
2019-11-20T13:53:01.000Z
depiction/models/uri/rest_api/__init__.py
IBM/dl-interpretability-compbio
3b13394f2dd9614736b4183b407a938a2c5924ac
[ "Apache-2.0" ]
31
2019-07-03T17:08:31.000Z
2019-11-21T12:45:56.000Z
depiction/models/uri/rest_api/__init__.py
IBM/dl-interpretability-compbio
3b13394f2dd9614736b4183b407a938a2c5924ac
[ "Apache-2.0" ]
13
2019-07-12T18:45:19.000Z
2019-11-20T16:25:20.000Z
"""Initialize rest_api module.""" from .rest_api_model import RESTAPIModel # noqa from .max_model import MAXModel # noqa
40.666667
48
0.778689
17
122
5.352941
0.647059
0.153846
0
0
0
0
0
0
0
0
0
0
0.131148
122
3
49
40.666667
0.858491
0.311475
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
e033302b9354d5acb6404fa797a22ae5b860c834
59
py
Python
src/d365fo_tools/core/__init__.py
OnoArnaldo/d365fo-tools
c7e6ced108c53b01522daf963d1949ad7071ba0a
[ "MIT" ]
null
null
null
src/d365fo_tools/core/__init__.py
OnoArnaldo/d365fo-tools
c7e6ced108c53b01522daf963d1949ad7071ba0a
[ "MIT" ]
null
null
null
src/d365fo_tools/core/__init__.py
OnoArnaldo/d365fo-tools
c7e6ced108c53b01522daf963d1949ad7071ba0a
[ "MIT" ]
null
null
null
from .core import Log, Folder from .helpers import Package
19.666667
29
0.79661
9
59
5.222222
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.152542
59
2
30
29.5
0.94
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
0eb9ed814632a8d8a1317fe5ac24ba830a80dc75
1,420
py
Python
app/gws/tools/vendor/chartreux/renderer.py
ewie/gbd-websuite
6f2814c7bb64d11cb5a0deec712df751718fb3e1
[ "Apache-2.0" ]
3
2020-07-24T10:10:18.000Z
2022-03-16T10:22:04.000Z
chartreux/renderer.py
gebrkn/chartreux
95402b6850e6f823440e7586a9c239b8eea68299
[ "MIT" ]
28
2020-03-03T17:35:58.000Z
2021-07-12T12:05:47.000Z
chartreux/renderer.py
gebrkn/chartreux
95402b6850e6f823440e7586a9c239b8eea68299
[ "MIT" ]
1
2021-02-22T14:32:10.000Z
2021-02-22T14:32:10.000Z
from . import compiler, runtime as rt _DefaultRuntime = rt.Runtime() def call( template, context=None, runtime=None, error=None, ): return template(runtime or _DefaultRuntime, context, error) def render( text, context=None, error=None, runtime=None, commands=None, filter=None, finder=None, globals=None, name=None, path=None, strip=None, syntax=None, ): template = compiler.compile( text, commands=commands, filter=filter, finder=finder, globals=globals, name=name, path=path, strip=strip, syntax=syntax, ) return call( template, context=context, runtime=runtime, error=error, ) def render_path( path, context=None, error=None, runtime=None, commands=None, filter=None, finder=None, globals=None, name=None, strip=None, syntax=None, ): template = compiler.compile_path( path, commands=commands, filter=filter, finder=finder, globals=globals, name=name, strip=strip, syntax=syntax, ) return call( template, context=context, runtime=runtime, error=error, )
17.317073
63
0.519014
131
1,420
5.59542
0.198473
0.049113
0.077763
0.05457
0.725784
0.725784
0.725784
0.725784
0.60573
0.60573
0
0
0.390845
1,420
81
64
17.530864
0.847399
0
0
0.797101
0
0
0
0
0
0
0
0
0
1
0.043478
false
0
0.014493
0.014493
0.101449
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5