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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2b4b5ab3945168fc3e2cef39dd3c30ec01ea875a | 116 | py | Python | src/Neighbor/TreeNeighborInst.cc.py | markguozhiming/spheral | bbb982102e61edb8a1d00cf780bfa571835e1b61 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 1 | 2020-10-21T01:56:55.000Z | 2020-10-21T01:56:55.000Z | src/Neighbor/TreeNeighborInst.cc.py | markguozhiming/spheral | bbb982102e61edb8a1d00cf780bfa571835e1b61 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | null | null | null | src/Neighbor/TreeNeighborInst.cc.py | markguozhiming/spheral | bbb982102e61edb8a1d00cf780bfa571835e1b61 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | null | null | null | text = """
#include "TreeNeighbor.cc"
namespace Spheral {
template class TreeNeighbor< Dim< %(ndim)s > >;
}
"""
| 12.888889 | 49 | 0.637931 | 12 | 116 | 6.166667 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181034 | 116 | 8 | 50 | 14.5 | 0.778947 | 0 | 0 | 0 | 0 | 0 | 0.87931 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2b581a0af9feed5e1273d75efc1dc50c412e4639 | 42 | py | Python | sfm/ui/__init__.py | Tanych/gh-sfm-ui | bba2319018fb55bb1b4031377879e5611d7a9036 | [
"MIT"
] | 129 | 2015-10-08T18:49:38.000Z | 2022-02-19T23:16:24.000Z | sfm/ui/__init__.py | Tanych/gh-sfm-ui | bba2319018fb55bb1b4031377879e5611d7a9036 | [
"MIT"
] | 941 | 2015-08-31T17:57:54.000Z | 2022-03-16T22:02:34.000Z | sfm/ui/__init__.py | Tanych/gh-sfm-ui | bba2319018fb55bb1b4031377879e5611d7a9036 | [
"MIT"
] | 31 | 2016-03-06T09:25:02.000Z | 2021-02-03T11:53:29.000Z | default_app_config = 'ui.config.UIConfig'
| 21 | 41 | 0.809524 | 6 | 42 | 5.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 42 | 1 | 42 | 42 | 0.820513 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2b5ab16f7eac57edcf489858361268d92f9398a8 | 538 | py | Python | devito/devito/foreign/__init__.py | LukasMosser/stochastic_seismic_waveform_inversion | 4976c3b9a39b8d246d3d220056f235df6fc7dbb3 | [
"MIT"
] | 20 | 2019-08-01T19:08:10.000Z | 2022-03-20T05:04:06.000Z | devito/devito/foreign/__init__.py | esgomi/gan_seismic_waveform_inversion | 4976c3b9a39b8d246d3d220056f235df6fc7dbb3 | [
"MIT"
] | 1 | 2019-12-05T13:00:14.000Z | 2019-12-05T13:00:14.000Z | devito/devito/foreign/__init__.py | esgomi/gan_seismic_waveform_inversion | 4976c3b9a39b8d246d3d220056f235df6fc7dbb3 | [
"MIT"
] | 12 | 2019-10-03T14:47:48.000Z | 2021-09-22T14:06:47.000Z | """
The ``foreign`` Devito backend is meant to be used by codes that don't
run Python natively. This backend is only capable of generating and compiling
kernels; however, kernels must be executed explicitly from outside Devito.
Further, with the ``foreign`` backed, Devito doesn't allocate any data.
"""
# The following used by backends.backendSelector
from devito.function import Constant, Function, TimeFunction, SparseFunction # noqa
from devito.foreign.operator import Operator # noqa
from devito.types import CacheManager # noqa
| 44.833333 | 84 | 0.789963 | 75 | 538 | 5.666667 | 0.666667 | 0.070588 | 0.065882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144981 | 538 | 11 | 85 | 48.909091 | 0.923913 | 0.665428 | 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 | 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 | 3 |
2b5f8027129b5d5b1861d24a6459864da8da66d7 | 293 | py | Python | src/app/callbacks/init.py | PhilippVerpoort/blue-green-H2 | a9b9bd27d2459df0f14e719a466af5ed6318d7e0 | [
"MIT"
] | null | null | null | src/app/callbacks/init.py | PhilippVerpoort/blue-green-H2 | a9b9bd27d2459df0f14e719a466af5ed6318d7e0 | [
"MIT"
] | null | null | null | src/app/callbacks/init.py | PhilippVerpoort/blue-green-H2 | a9b9bd27d2459df0f14e719a466af5ed6318d7e0 | [
"MIT"
] | 1 | 2022-03-19T16:11:53.000Z | 2022-03-19T16:11:53.000Z | from src.config_load import input_data, steel_data, plots_cfg
from src.data.data import getFullData
from src.plotting.plot_all import plotAllFigs
outputData = getFullData(input_data.copy(), steel_data)
figsDefault = plotAllFigs(outputData, input_data.copy(), plots_cfg, global_cfg='webapp')
| 36.625 | 88 | 0.822526 | 42 | 293 | 5.5 | 0.47619 | 0.090909 | 0.112554 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088737 | 293 | 7 | 89 | 41.857143 | 0.865169 | 0 | 0 | 0 | 0 | 0 | 0.020478 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
2b710f90f0702741396a2856184f7a5db291acfa | 303 | py | Python | instagram_api/response/model/trace_control.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | 13 | 2019-08-07T21:24:34.000Z | 2020-12-12T12:23:50.000Z | instagram_api/response/model/trace_control.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | instagram_api/response/model/trace_control.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | from ..mapper import PropertyMapper, ApiInterfaceBase
from ..mapper.types import Timestamp, AnyType
__all__ = ['TraceControl', 'TraceControlInterface']
class TraceControlInterface(ApiInterfaceBase):
max_trace_timeout_ms: int
class TraceControl(PropertyMapper, TraceControlInterface):
pass
| 21.642857 | 58 | 0.805281 | 27 | 303 | 8.777778 | 0.666667 | 0.084388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.118812 | 303 | 13 | 59 | 23.307692 | 0.88764 | 0 | 0 | 0 | 0 | 0 | 0.109272 | 0.069536 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0.285714 | 0 | 0.714286 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
99246f4bb7500baea9d62654feeafcb83b335876 | 1,269 | py | Python | year_2020/day15/test_day15.py | mjalkio/advent-of-code | 54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42 | [
"MIT"
] | null | null | null | year_2020/day15/test_day15.py | mjalkio/advent-of-code | 54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42 | [
"MIT"
] | null | null | null | year_2020/day15/test_day15.py | mjalkio/advent-of-code | 54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42 | [
"MIT"
] | null | null | null | import pytest
from year_2020.day15.rambunctious_recitation import get_number_spoken
@pytest.mark.parametrize(
"starting_numbers,num_turns,expected",
[
("0,3,6", 1, 0),
("0,3,6", 2, 3),
("0,3,6", 3, 6),
("0,3,6", 4, 0),
("0,3,6", 5, 3),
("0,3,6", 6, 3),
("0,3,6", 7, 1),
("0,3,6", 8, 0),
("0,3,6", 9, 4),
("0,3,6", 10, 0),
("0,3,6", 2020, 436),
("1,3,2", 2020, 1),
("2,1,3", 2020, 10),
("1,2,3", 2020, 27),
("2,3,1", 2020, 78),
("3,2,1", 2020, 438),
("3,1,2", 2020, 1836),
pytest.param("0,3,6", 30000000, 175594, marks=pytest.mark.slow),
pytest.param("1,3,2", 30000000, 2578, marks=pytest.mark.slow),
pytest.param("2,1,3", 30000000, 3544142, marks=pytest.mark.slow),
pytest.param("1,2,3", 30000000, 261214, marks=pytest.mark.slow),
pytest.param("2,3,1", 30000000, 6895259, marks=pytest.mark.slow),
pytest.param("3,2,1", 30000000, 18, marks=pytest.mark.slow),
pytest.param("3,1,2", 30000000, 362, marks=pytest.mark.slow),
],
)
def test_get_number_spoken(starting_numbers, num_turns, expected):
assert get_number_spoken(starting_numbers, num_turns) == expected
| 34.297297 | 73 | 0.538219 | 201 | 1,269 | 3.323383 | 0.238806 | 0.038922 | 0.053892 | 0.199102 | 0.462575 | 0.416168 | 0.416168 | 0.137725 | 0 | 0 | 0 | 0.245047 | 0.244287 | 1,269 | 36 | 74 | 35.25 | 0.451512 | 0 | 0 | 0 | 0 | 0 | 0.122143 | 0.027581 | 0 | 0 | 0 | 0 | 0.030303 | 1 | 0.030303 | false | 0 | 0.060606 | 0 | 0.090909 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
994c72ee587b0016dc85da74d0c7617e61b815aa | 329 | py | Python | examples.py | loynoir/defer.py | 46f37a046028b1854586301a45870c2b3a628f65 | [
"MIT"
] | null | null | null | examples.py | loynoir/defer.py | 46f37a046028b1854586301a45870c2b3a628f65 | [
"MIT"
] | null | null | null | examples.py | loynoir/defer.py | 46f37a046028b1854586301a45870c2b3a628f65 | [
"MIT"
] | null | null | null | from Defer import Defer
with Defer() as defer:
print("enter the room")
defer(lambda: print("leave the room"))
print("prepare printer")
defer(lambda: print("close printer"))
print("start printing")
defer(lambda: print("end printing"))
print(3)
print(4)
print(5)
print("LONG LONG TASKS")
| 20.5625 | 42 | 0.635258 | 44 | 329 | 4.75 | 0.5 | 0.157895 | 0.229665 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011765 | 0.224924 | 329 | 15 | 43 | 21.933333 | 0.807843 | 0 | 0 | 0 | 0 | 0 | 0.294833 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.083333 | 0 | 0.083333 | 0.833333 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
995050aaf43abe070dfab1f85dd869f0e7f9f405 | 1,642 | py | Python | warmup_2/string_splosion.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | 1 | 2020-09-19T18:02:13.000Z | 2020-09-19T18:02:13.000Z | warmup_2/string_splosion.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | null | null | null | warmup_2/string_splosion.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | null | null | null | # =======================================================================================================================================
# VNU-HCM, University of Science
# Department Computer Science, Faculty of Information Technology
# Authors: Nhut-Nam Le (Tich Phan Suy Rong)
# © 2020
import unittest
"""
Given a non-empty string like "Code" return a string like "CCoCodCode".
string_splosion('Code') → 'CCoCodCode'
string_splosion('abc') → 'aababc'
string_splosion('ab') → 'aab'
"""
def string_splosion(str):
result = ''
i = 0
while i < len(str):
result += str[:i+1]
i += 1
return result
class TestStringSplosion(unittest.TestCase):
def test_case_00(self):
self.assertEqual(string_splosion('Code'), 'CCoCodCode')
def test_case_01(self):
self.assertEqual(string_splosion('abc'), 'aababc')
def test_case_02(self):
self.assertEqual(string_splosion('ab'), 'aab')
def test_case_03(self):
self.assertEqual(string_splosion('x'), 'x')
def test_case_04(self):
self.assertEqual(string_splosion('fade'), 'ffafadfade')
def test_case_05(self):
self.assertEqual(string_splosion('There'), 'TThTheTherThere')
def test_case_06(self):
self.assertEqual(string_splosion('Kitten'), 'KKiKitKittKitteKitten')
def test_case_07(self):
self.assertEqual(string_splosion('Bye'), 'BByBye')
def test_case_08(self):
self.assertEqual(string_splosion('Good'), 'GGoGooGood')
def test_case_09(self):
self.assertEqual(string_splosion('Bad'), 'BBaBad')
if __name__ == "__main__":
unittest.main()
| 25.261538 | 137 | 0.612058 | 189 | 1,642 | 5.116402 | 0.412698 | 0.202689 | 0.113754 | 0.258532 | 0.341262 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020045 | 0.179659 | 1,642 | 64 | 138 | 25.65625 | 0.694878 | 0.169306 | 0 | 0 | 0 | 0 | 0.111679 | 0.017903 | 0 | 0 | 0 | 0 | 0.322581 | 1 | 0.354839 | false | 0 | 0.032258 | 0 | 0.451613 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
995106f61a1486869dcff6b8ab27a4c99952dfef | 334 | py | Python | ea_sim/params_conf.py | lis-epfl/Tensoft-G21 | 7a83c5dabc12906c0a6bd1da0a28a131e9d5e144 | [
"Apache-2.0"
] | 1 | 2021-08-03T10:52:20.000Z | 2021-08-03T10:52:20.000Z | ea_sim/params_conf.py | lis-epfl/Tensoft-G21 | 7a83c5dabc12906c0a6bd1da0a28a131e9d5e144 | [
"Apache-2.0"
] | null | null | null | ea_sim/params_conf.py | lis-epfl/Tensoft-G21 | 7a83c5dabc12906c0a6bd1da0a28a131e9d5e144 | [
"Apache-2.0"
] | 1 | 2021-09-18T07:23:35.000Z | 2021-09-18T07:23:35.000Z | # centralized file where robot parameters can be customized
MIN_NUM_MODULES = 2
MAX_NUM_MODULES = 10
N_MODULES = list(range(MIN_NUM_MODULES, MAX_NUM_MODULES+1))
STIFF_TABLE = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
#STIFF_TABLE = [0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 4]
| 41.75 | 108 | 0.637725 | 84 | 334 | 2.404762 | 0.404762 | 0.19802 | 0.128713 | 0.118812 | 0.188119 | 0.188119 | 0.188119 | 0.188119 | 0.188119 | 0.188119 | 0 | 0.224199 | 0.158683 | 334 | 7 | 109 | 47.714286 | 0.494662 | 0.491018 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 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 | 3 |
9958f6192f0c624286a05b17462ac8310129e2ae | 2,742 | py | Python | simpleeval__examples__calc/basic/compound_types.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | simpleeval__examples__calc/basic/compound_types.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | simpleeval__examples__calc/basic/compound_types.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://github.com/danthedeckie/simpleeval/blob/master/README.rst#compound-types
# """
# Compound types (dict, tuple, list, set) in general just work if you pass them in as named objects.
# If you want to allow creation of these, the EvalWithCompoundTypes class works. Just replace any use of
# SimpleEval with that.
# """
# pip install simpleeval
from simpleeval import simple_eval, SimpleEval, EvalWithCompoundTypes
# SimpleEval and simple_eval NOT WORK with compound types
try:
print(simple_eval('[1, 2, 3, 4]'))
except Exception as e:
print(e) # Sorry, List is not available in this evaluator
try:
my_eval = SimpleEval()
print(my_eval.eval('[1, 2, 3, 4]'))
except Exception as e:
print(e) # Sorry, List is not available in this evaluator
print()
# Compound Types
my_compound_types_eval = EvalWithCompoundTypes()
my_compound_types_eval.functions['len'] = len
# list
print(my_compound_types_eval.eval('[1, 2, 3, 4]')) # [1, 2, 3, 4]
print(my_compound_types_eval.eval('[1, 2] + [3, 4]')) # [1, 2, 3, 4]
print(my_compound_types_eval.eval('len([1, 2, 3, 4])')) # 4
print(my_compound_types_eval.eval('[1, 2, 1, 3, 4].count(1)')) # 2
print(my_compound_types_eval.eval('list("1234")')) # ['1', '2', '3', '4']
print()
# dict
print(my_compound_types_eval.eval('{"a": 1, "b": 999}')) # {'a': 1, 'b': 999}
print(my_compound_types_eval.eval('{"a": 1, "b": 999}["b"]')) # 999
print(my_compound_types_eval.eval('{"a": 1, "b": 999}.items()')) # dict_items([('a', 1), ('b', 999)])
print(my_compound_types_eval.eval('len({"a": 1, "b": 999})')) # 2
print(my_compound_types_eval.eval('dict([("a", 1), ("b", 999)])')) # {'a': 1, 'b': 999}
print()
# tuple
print(my_compound_types_eval.eval('(1, 2, 3, 4)')) # (1, 2, 3, 4)
print(my_compound_types_eval.eval('(1, 2) + (3, 4)')) # (1, 2, 3, 4)
print(my_compound_types_eval.eval('1, 2, 3, 4')) # (1, 2, 3, 4)
print(my_compound_types_eval.eval('len((1, 2, 3, 4))')) # 4
print(my_compound_types_eval.eval('(1, 2, 1, 3, 4).count(1)')) # 2
print()
# set
print(my_compound_types_eval.eval('{1, 2, 3, 4}')) # {1, 2, 3, 4}
print(my_compound_types_eval.eval('{1, 2, 1, 3, 1, 4, 3}')) # {1, 2, 3, 4}
print(my_compound_types_eval.eval('[1, 2, 1, 3, 1, 4, 3]')) # [1, 2, 1, 3, 1, 4, 3]
print(my_compound_types_eval.eval('set([1, 2, 1, 3, 1, 4, 3])')) # {1, 2, 3, 4}
print(my_compound_types_eval.eval('{1, 1, 2}.union({3, 2, 4})')) # {1, 2, 3, 4}
print(my_compound_types_eval.eval('{1, 1, 2}.intersection({3, 2, 4})')) # {2}
| 40.323529 | 104 | 0.598104 | 452 | 2,742 | 3.45354 | 0.185841 | 0.038437 | 0.221012 | 0.279949 | 0.599616 | 0.59385 | 0.57335 | 0.534914 | 0.534914 | 0.524023 | 0 | 0.081364 | 0.197666 | 2,742 | 67 | 105 | 40.925373 | 0.628182 | 0.299781 | 0 | 0.263158 | 0 | 0 | 0.239234 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.026316 | 0 | 0.026316 | 0.763158 | 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 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
996b4a5c2c888f7934622bcd04f25b88299bc8b1 | 1,784 | py | Python | server/cosmic_pairing_api/mocks/signs.py | lingtran/cosmic_pairing | df25b3873cc4fb871526eb5187070596b8b11ea2 | [
"MIT"
] | null | null | null | server/cosmic_pairing_api/mocks/signs.py | lingtran/cosmic_pairing | df25b3873cc4fb871526eb5187070596b8b11ea2 | [
"MIT"
] | 19 | 2020-07-31T03:06:14.000Z | 2022-03-10T05:03:04.000Z | server/cosmic_pairing_api/mocks/signs.py | lingtran/cosmic_pairing | df25b3873cc4fb871526eb5187070596b8b11ea2 | [
"MIT"
] | null | null | null | from cosmic_pairing_api.utils.enums.element import Element
from cosmic_pairing_api.utils.enums.modality import Modality
SIGNS = [
{
"id": 1,
"name": "aries",
"modality": Modality.CARDINAL.name,
"element": Element.FIRE.name,
},
{
"id": 2,
"name": "taurus",
"modality": Modality.FIXED.name,
"element": Element.EARTH.name,
},
{
"id": 3,
"name": "gemini",
"modality": Modality.MUTABLE.name,
"element": Element.AIR.name,
},
{
"id": 4,
"name": "cancer",
"modality": Modality.CARDINAL.name,
"element": Element.WATER.name,
},
{
"id": 5,
"name": "leo",
"modality": Modality.FIXED.name,
"element": Element.FIRE.name,
},
{
"id": 6,
"name": "virgo",
"modality": Modality.MUTABLE.name,
"element": Element.EARTH.name,
},
{
"id": 7,
"name": "libra",
"modality": Modality.CARDINAL.name,
"element": Element.AIR.name,
},
{
"id": 8,
"name": "scorpio",
"modality": Modality.FIXED.name,
"element": Element.WATER.name,
},
{
"id": 9,
"name": "sagittarius",
"modality": Modality.MUTABLE.name,
"element": Element.FIRE.name,
},
{
"id": 10,
"name": "capricorn",
"modality": Modality.CARDINAL.name,
"element": Element.EARTH.name,
},
{
"id": 11,
"name": "aquarius",
"modality": Modality.FIXED.name,
"element": Element.AIR.name,
},
{
"id": 12,
"name": "pisces",
"modality": Modality.MUTABLE.name,
"element": Element.WATER.name,
},
]
| 22.871795 | 60 | 0.483184 | 163 | 1,784 | 5.263804 | 0.263804 | 0.223776 | 0.251748 | 0.130536 | 0.77972 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0.01281 | 0.34361 | 1,784 | 77 | 61 | 23.168831 | 0.719898 | 0 | 0 | 0.315789 | 0 | 0 | 0.184417 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.026316 | 0 | 0.026316 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
999b7e222c07ec4e4045ccf0fbb8d6e8afb0520b | 575 | py | Python | pandapipes/component_models/abstract_models/__init__.py | ggrrll/pandapipes | 636c45bfeb05feb9f4700864070086adfd74b8cf | [
"BSD-3-Clause"
] | 48 | 2020-02-14T13:16:31.000Z | 2022-03-30T07:15:55.000Z | pandapipes/component_models/abstract_models/__init__.py | ggrrll/pandapipes | 636c45bfeb05feb9f4700864070086adfd74b8cf | [
"BSD-3-Clause"
] | 279 | 2020-02-20T13:06:56.000Z | 2022-03-14T12:29:59.000Z | pandapipes/component_models/abstract_models/__init__.py | ggrrll/pandapipes | 636c45bfeb05feb9f4700864070086adfd74b8cf | [
"BSD-3-Clause"
] | 30 | 2020-02-14T15:38:24.000Z | 2022-02-21T13:37:12.000Z | # Copyright (c) 2020-2021 by Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
from .base_component import *
from .branch_models import *
from .branch_w_internals_models import *
from .branch_wo_internals_models import *
from .branch_wzerolength_models import *
from .node_element_models import *
from .node_models import *
from .const_flow_models import *
from .circulation_pump import *
| 41.071429 | 99 | 0.803478 | 86 | 575 | 5.186047 | 0.616279 | 0.179372 | 0.251121 | 0.147982 | 0.139013 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016194 | 0.14087 | 575 | 13 | 100 | 44.230769 | 0.88664 | 0.446957 | 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 | 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 | 3 |
99ab42eab96ab3c16d101146330c97b44958c97a | 66 | py | Python | configs/garbage/test_lr0.1_1x.py | zhanggefan/mmdet-yolov4 | fe544b1a94c24e8abdb13bc2e4ca664854aa86a7 | [
"Apache-2.0"
] | 16 | 2021-01-21T06:52:28.000Z | 2022-03-30T09:17:16.000Z | configs/garbage/test_lr0.1_1x.py | zhanggefan/mmdet-yolov4 | fe544b1a94c24e8abdb13bc2e4ca664854aa86a7 | [
"Apache-2.0"
] | 2 | 2021-06-18T14:32:34.000Z | 2021-09-13T15:52:16.000Z | configs/garbage/test_lr0.1_1x.py | zhanggefan/mmdet-yolov4 | fe544b1a94c24e8abdb13bc2e4ca664854aa86a7 | [
"Apache-2.0"
] | 8 | 2020-12-22T21:54:10.000Z | 2022-03-30T09:17:15.000Z | _base_ = './config_base/garbage_ddp.py'
optimizer = dict(lr=0.1)
| 16.5 | 39 | 0.712121 | 11 | 66 | 3.909091 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033898 | 0.106061 | 66 | 3 | 40 | 22 | 0.694915 | 0 | 0 | 0 | 0 | 0 | 0.424242 | 0.424242 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
41d5649317c085f8985b97148521c85447459436 | 38 | py | Python | yeelight/version.py | kmohrf/python-yeelight | 483019c074556b4c3d2f665398f0fc308afd6274 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | yeelight/version.py | kmohrf/python-yeelight | 483019c074556b4c3d2f665398f0fc308afd6274 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | yeelight/version.py | kmohrf/python-yeelight | 483019c074556b4c3d2f665398f0fc308afd6274 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # flake8: noqa
__version__ = "0.5.0"
| 9.5 | 21 | 0.631579 | 6 | 38 | 3.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129032 | 0.184211 | 38 | 3 | 22 | 12.666667 | 0.516129 | 0.315789 | 0 | 0 | 0 | 0 | 0.208333 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
512428cd6c69268176ef05fa7a8650131e018089 | 563 | py | Python | vendor/mo_logs/log_usingNothing.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | vendor/mo_logs/log_usingNothing.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | vendor/mo_logs/log_usingNothing.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, division, unicode_literals
from mo_future import is_text, is_binary
class StructuredLogger(object):
"""
ABSTRACT BASE CLASS FOR JSON LOGGING
"""
def write(self, template, params):
pass
def stop(self):
pass
| 20.107143 | 75 | 0.694494 | 84 | 563 | 4.547619 | 0.761905 | 0.026178 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011338 | 0.216696 | 563 | 27 | 76 | 20.851852 | 0.854875 | 0.51865 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0.285714 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
51277cbf373e68b6520295ae14d8965cded5385d | 158 | py | Python | basic_system/routing.py | JagerCox/basic-project-django2-channels2-gunicorn-dahpne | 5329a06d251706f6f02cf202dff04959982d8214 | [
"MIT"
] | 3 | 2019-04-08T12:51:57.000Z | 2021-07-28T16:54:41.000Z | basic_system/routing.py | JagerCox/basic-project-django2-channels2-gunicorn-dahpne | 5329a06d251706f6f02cf202dff04959982d8214 | [
"MIT"
] | null | null | null | basic_system/routing.py | JagerCox/basic-project-django2-channels2-gunicorn-dahpne | 5329a06d251706f6f02cf202dff04959982d8214 | [
"MIT"
] | 1 | 2019-04-08T12:52:00.000Z | 2019-04-08T12:52:00.000Z | from django.urls import path
from .consumers import ChatConsumer
websocket_urlpatterns = [
path('ws/<str:room_name>/', ChatConsumer, name='consumer'),
]
| 22.571429 | 63 | 0.746835 | 19 | 158 | 6.105263 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.126582 | 158 | 6 | 64 | 26.333333 | 0.84058 | 0 | 0 | 0 | 0 | 0 | 0.170886 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
5128aaf3cd26118d6b07e1e07b47d69c770a4e85 | 79 | py | Python | pathfinder/__init__.py | dsp/aa-pathfinder | 1fdb43948921922d60b8b489b53b33b8ea929d31 | [
"MIT"
] | null | null | null | pathfinder/__init__.py | dsp/aa-pathfinder | 1fdb43948921922d60b8b489b53b33b8ea929d31 | [
"MIT"
] | null | null | null | pathfinder/__init__.py | dsp/aa-pathfinder | 1fdb43948921922d60b8b489b53b33b8ea929d31 | [
"MIT"
] | null | null | null | default_app_config = "pathfinder.apps.PathfinderConfig"
__version__ = "0.1.0"
| 19.75 | 55 | 0.78481 | 10 | 79 | 5.6 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.088608 | 79 | 3 | 56 | 26.333333 | 0.736111 | 0 | 0 | 0 | 0 | 0 | 0.468354 | 0.405063 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
512e099f596e3955243cf492631352af559a94af | 246 | wsgi | Python | pastr.wsgi | hossainalhaidari/pastr | 49417cbe6ef64c763cda41ada6d42ef8d643d081 | [
"MIT"
] | 3 | 2019-01-16T14:01:20.000Z | 2019-09-29T14:16:26.000Z | pastr.wsgi | hossainalhaidari/pastr | 49417cbe6ef64c763cda41ada6d42ef8d643d081 | [
"MIT"
] | null | null | null | pastr.wsgi | hossainalhaidari/pastr | 49417cbe6ef64c763cda41ada6d42ef8d643d081 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
from dotenv import load_dotenv
load_dotenv()
sys.path.insert(0, os.getenv('PASTR_PATH', 'App Path'))
from pastr import app as application
application.secret_key = os.getenv('SECRET_KEY', 'Secret Key') | 24.6 | 62 | 0.768293 | 40 | 246 | 4.6 | 0.5 | 0.146739 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009132 | 0.109756 | 246 | 10 | 62 | 24.6 | 0.83105 | 0.085366 | 0 | 0 | 0 | 0 | 0.168889 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.571429 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
51523224ed1784558c61cf16ca3f354c9e20fd86 | 1,741 | py | Python | brainTeasers/numberOfLines/unitTests.py | christopher-henderson/Experiments | d970249a4895424cb5ff5b557948f3a4bda4879c | [
"MIT"
] | null | null | null | brainTeasers/numberOfLines/unitTests.py | christopher-henderson/Experiments | d970249a4895424cb5ff5b557948f3a4bda4879c | [
"MIT"
] | null | null | null | brainTeasers/numberOfLines/unitTests.py | christopher-henderson/Experiments | d970249a4895424cb5ff5b557948f3a4bda4879c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from functools import wraps
from lines import getNumLines
assertion = 0
exception = 0
passed = 0
def Test(function):
@wraps(function)
def wrapper(*args, **kwargs):
global assertion
global exception
global passed
try:
function(*args, **kwargs)
except Exception as e:
if isinstance(e, AssertionError):
assertion += 1
print ("ASSERTION: {FUNC}: {ERROR}".format(FUNC=function.__name__, ERROR=e))
else:
exception += 1
print ("EXCEPTION: {FUNC}: {ERROR}".format(FUNC=function.__name__, ERROR=e))
else:
print ("PASSED: {FUNC}".format(FUNC=function.__name__))
return wrapper
@Test
def empty():
assert getNumLines(()) is 0
@Test
def one():
assert getNumLines(((1,1),)) is 1
@Test
def axis():
assert getNumLines(((0,1),)) is 1
assert getNumLines(((0,1), (0,-1))) is 1
assert getNumLines(((1,0),)) is 1
assert getNumLines(((1,0), (-1,0))) is 1
@Test
def origin():
assert getNumLines(((0,0),)) is 1
assert getNumLines(((0,0), (0,0), (0,0), (0,0))) is 1
assert getNumLines(((0,0), (1,1))) is 1
assert getNumLines(((0,0), (1,1), (1,2))) is 2
@Test
def counterQuadrants():
assert getNumLines(((1,1), (-1,-1), (2,2), (-2,-2))) is 1
assert getNumLines(((-1,1), (1,-1))) is 1
assert getNumLines(((2,2), (-2,-1))) is 2
assert getNumLines(((-2,2), (2,-1))) is 2
@Test
def scientificInts():
assert getNumLines(((1+10**10000, 10**10000), (1, 1))) is 2
def main():
empty()
one()
axis()
origin()
counterQuadrants()
scientificInts()
main()
| 24.521127 | 92 | 0.570936 | 233 | 1,741 | 4.193133 | 0.2103 | 0.261003 | 0.073695 | 0.163767 | 0.332651 | 0.32958 | 0.212897 | 0.208802 | 0.08393 | 0 | 0 | 0.069839 | 0.25158 | 1,741 | 70 | 93 | 24.871429 | 0.679969 | 0.011488 | 0 | 0.135593 | 0 | 0 | 0.038372 | 0 | 0 | 0 | 0 | 0 | 0.338983 | 1 | 0.152542 | false | 0.050847 | 0.050847 | 0 | 0.220339 | 0.067797 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
5166a904988e89265b852c411614fc81169a4bf3 | 68 | py | Python | GCC-paddle/gcc/models/__init__.py | S-HuaBomb/Contrib | 10596814bb98c9e2499e4240e56207dc3b547959 | [
"Apache-2.0"
] | 243 | 2020-06-16T08:06:57.000Z | 2022-03-31T10:09:37.000Z | GCC-paddle/gcc/models/__init__.py | S-HuaBomb/Contrib | 10596814bb98c9e2499e4240e56207dc3b547959 | [
"Apache-2.0"
] | 34 | 2020-02-20T11:04:58.000Z | 2022-03-12T00:54:26.000Z | GCC-paddle/gcc/models/__init__.py | S-HuaBomb/Contrib | 10596814bb98c9e2499e4240e56207dc3b547959 | [
"Apache-2.0"
] | 49 | 2020-06-28T02:37:17.000Z | 2022-03-29T08:07:35.000Z | from .graph_encoder import GraphEncoder
__all__ = ["GraphEncoder"]
| 17 | 39 | 0.794118 | 7 | 68 | 7 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 68 | 3 | 40 | 22.666667 | 0.816667 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
5a91d9da8ada11831ecc164dcca33401ae0379e5 | 6,347 | py | Python | test/database/test_raw_scraping_data.py | AMHesch/aws-allowlister | b15309cc581b3cfba97733806df4ba2afa73fbee | [
"MIT"
] | 180 | 2021-02-02T21:31:56.000Z | 2022-03-19T19:52:08.000Z | test/database/test_raw_scraping_data.py | AMHesch/aws-allowlister | b15309cc581b3cfba97733806df4ba2afa73fbee | [
"MIT"
] | 36 | 2021-02-05T19:19:26.000Z | 2022-01-27T05:01:08.000Z | test/database/test_raw_scraping_data.py | AMHesch/aws-allowlister | b15309cc581b3cfba97733806df4ba2afa73fbee | [
"MIT"
] | 28 | 2021-02-04T19:19:43.000Z | 2022-03-18T21:27:41.000Z | import unittest
import json
from aws_allowlister.database.database import connect_db
from aws_allowlister.database.raw_scraping_data import RawScrapingData
db_session = connect_db()
raw_scraping_data = RawScrapingData()
class RawScrapingDataTestCase(unittest.TestCase):
def test_standards(self):
"""database.scrapers.raw_scraping_data.standards"""
results = raw_scraping_data.standards(db_session=db_session)
print(results)
print(len(results))
# This will grow over time, so let's just make sure it meets minimum size
self.assertTrue(len(results) >= 7)
expected_results = ['SOC', 'PCI', 'IRAP', 'OSPAR', 'FINMA', 'ISO', 'HIPAA']
def test_get_rows(self):
"""database.scrapers.raw_scraping_data.get_rows"""
results = raw_scraping_data.get_rows(db_session=db_session, sdk_name="ecs")
print(len(results))
# print(results)
results = raw_scraping_data.get_rows(db_session=db_session)
# This will change over time, so let's just check that the size of this is massive
print(len(results))
self.assertTrue(len(results) > 850) # 857
def test_get_sdk_names_matching_compliance_standard(self):
"""database.scrapers.raw_scraping_data.get_sdk_names_matching_compliance_standard"""
results = raw_scraping_data.get_sdk_names_matching_compliance_standard(db_session=db_session, standard_name="SOC")
# print(results)
print(len(results)) # 120
def test_get_service_names_matching_compliance_standard(self):
"""database.scrapers.raw_scraping_data.get_service_names_matching_compliance_standard"""
results = raw_scraping_data.get_service_names_matching_compliance_standard(db_session=db_session, standard_name="SOC")
# print(results)
print(len(results)) # 119
expected_results = {'Amazon API Gateway': 'apigateway', 'Amazon AppStream 2.0': 'appstream', 'Amazon Athena': 'athena', 'Amazon Chime': 'chime', 'Amazon Cloud Directory': 'clouddirectory', 'Amazon CloudFront': 'cloudfront', 'Amazon CloudWatch': 'cloudwatch', 'Amazon CloudWatch Events [includes Amazon EventBridge]': 'events', 'Amazon CloudWatch Logs': 'logs', 'Amazon CloudWatch SDK Metrics for Enterprise Support': 'sdkmetrics', 'Amazon Cognito': 'cognito-sync', 'Amazon Comprehend': 'comprehend', 'Amazon Comprehend Medical': 'comprehendmedical', 'Amazon Connect': 'connect', 'Amazon DynamoDB': 'dynamodb', 'Amazon EC2 Auto Scaling': 'autoscaling', 'Amazon Elastic Block Store (EBS)': 'ec2', 'Amazon Elastic Compute Cloud (EC2)': 'ec2', 'Amazon Elastic Container Registry (ECR)': 'ecr', 'Amazon Elastic Container Service': 'ecs', 'Amazon Elastic File System (EFS)': 'elasticfilesystem', 'Amazon Elastic Kubernetes Service (EKS)': 'eks', 'Amazon Elastic MapReduce (EMR)': 'elasticmapreduce', 'Amazon ElastiCache for Redis': 'elasticache', 'Amazon Elasticsearch Service': 'es', 'Amazon Forecast': 'amazonforecast', 'Amazon FreeRTOS': 'freertos', 'Amazon FSx': 'fsx', 'Amazon GuardDuty': 'guardduty', 'Amazon Inspector': 'inspector', 'Amazon Kinesis Data Analytics': 'kinesisanalytics', 'Amazon Kinesis Data Firehose': 'firehose', 'Amazon Kinesis Data Streams': 'kinesis', 'Amazon Kinesis Video Streams': 'kinesisvideo', 'Amazon Lex': 'models.lex', 'Amazon Macie': 'macie', 'Amazon Managed Streaming for Apache Kafka': 'kafka', 'Amazon MQ': 'mq', 'Amazon Neptune': 'neptune-db', 'Amazon Personalize': 'personalize', 'Amazon Pinpoint': 'mobiletargeting', 'Amazon Polly': 'polly', 'Amazon Quantum Ledger Database (QLDB)': 'qldb', 'Amazon QuickSight': 'quicksight', 'Amazon Redshift': 'redshift', 'Amazon Rekognition': 'rekognition', 'Amazon Relational Database Service (RDS)': 'rds', 'Amazon Route 53': 'route53', 'Amazon S3 Glacier': 'glacier', 'Amazon SageMaker': 'sagemaker', 'Amazon SimpleDB': 'sdb', 'Amazon Simple Email Service (SES)': 'ses', 'Amazon Simple Notification Service (SNS)': 'sns', 'Amazon Simple Queue Service (SQS)': 'sqs', 'Amazon Simple Storage Service (S3)': 's3', 'Amazon Simple Workflow Service (SWF)': 'swf', 'Amazon Textract': 'textract', 'Amazon Transcribe': 'transcribe', 'Amazon Translate': 'translate', 'Amazon Virtual Private Cloud (VPC)': 'ec2', 'Amazon WorkDocs': 'workdocs', 'Amazon WorkLink': 'worklink', 'Amazon WorkMail': 'workmail', 'Amazon WorkSpaces': 'workspaces', 'AWS Amplify': 'amplify', 'AWS AppSync': 'appsync', 'AWS Backup': 'backup', 'AWS Batch': 'batch', 'AWS Certificate Manager (ACM)': 'acm', 'AWS CloudFormation': 'cloudformation', 'AWS CloudHSM': 'cloudhsm', 'AWS CloudTrail': 'cloudtrail', 'AWS CodeBuild': 'codebuild', 'AWS CodeCommit': 'codecommit', 'AWS CodeDeploy': 'codedeploy', 'AWS CodePipeline': 'codepipeline', 'AWS Config': 'config', 'AWS Control Tower': 'controltower', 'AWS Data Exchange': 'dataexchange', 'AWS Database Migration Service (DMS)': 'dms', 'AWS DataSync': 'datasync', 'AWS Direct Connect': 'directconnect', 'AWS Directory Service': 'ds', 'AWS Elastic Beanstalk': 'elasticbeanstalk', 'AWS Elemental MediaConnect': 'mediaconnect', 'AWS Elemental MediaConvert': 'mediaconvert', 'AWS Elemental MediaLive': 'medialive', 'AWS Firewall Manager': 'fms', 'AWS Global Accelerator': 'globalaccelerator', 'AWS Glue': 'glue', 'AWS Identity and Access Management (IAM)': 'iam', 'AWS IoT Core': 'iot', 'AWS IoT Device Management': 'iot', 'AWS IoT Events': 'iotevents', 'AWS IoT Greengrass': 'greengrass', 'AWS Key Management Service (KMS)': 'kms', 'AWS Lambda': 'lambda', 'AWS License Manager': 'license-manager', 'AWS OpsWorks Stacks': 'opsworks', 'AWS OpsWorks Stacksfor Chef Automate': 'opsworks-cm', 'AWS Organizations': 'organizations', 'AWS Outposts': 'outposts', 'AWS Personal Health Dashboard': 'health', 'AWS Resource Groups': 'resource-groups', 'AWS RoboMaker': 'robomaker', 'AWS Secrets Manager': 'secretsmanager', 'AWS Security Hub': 'securityhub', 'AWS Server Migration Service (SMS)': 'sms', 'AWS Serverless Application Repository': 'serverlessrepo', 'AWS Service Catalog': 'servicecatalog', 'AWS Shield': 'DDoSProtection', 'AWS Snowball': 'snowball', 'AWS Step Functions': 'states', 'AWS Storage Gateway': 'storagegateway', 'AWS Systems Manager': 'ssm', 'AWS Transfer Family': 'transfer', 'AWS Web Application Firewall (WAF)': 'waf', 'AWS X-Ray': 'xray', 'Elastic Load Balancing (ELB)': 'elasticloadbalancing'}
| 144.25 | 4,496 | 0.722073 | 733 | 6,347 | 6.143247 | 0.390177 | 0.026871 | 0.036642 | 0.027981 | 0.155896 | 0.149012 | 0.129691 | 0.121253 | 0.121253 | 0.091939 | 0 | 0.004886 | 0.129352 | 6,347 | 43 | 4,497 | 147.604651 | 0.809989 | 0.072948 | 0 | 0.192308 | 0 | 0 | 0.607003 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 1 | 0.153846 | false | 0 | 0.153846 | 0 | 0.346154 | 0.230769 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5aa27bded824f5d2ed1668d9730e5fcc75bdeb84 | 550 | py | Python | cc_server/commons/database.py | curious-containers/cc-server | 3d4f0e39d2a974ee239a455b238ac8a3bfcddb73 | [
"Apache-2.0"
] | 4 | 2016-09-05T15:01:01.000Z | 2016-11-17T12:36:41.000Z | cc_server/commons/database.py | curious-containers/cc-server | 3d4f0e39d2a974ee239a455b238ac8a3bfcddb73 | [
"Apache-2.0"
] | null | null | null | cc_server/commons/database.py | curious-containers/cc-server | 3d4f0e39d2a974ee239a455b238ac8a3bfcddb73 | [
"Apache-2.0"
] | null | null | null | import pymongo
class Mongo:
def __init__(self, config):
self._config = config
self.client = pymongo.MongoClient('mongodb://{}:{}@{}:{}/{}'.format(
self._config.mongo['username'],
self._config.mongo['password'],
self._config.mongo['host'],
self._config.mongo['port'],
self._config.mongo['db']
))
self.db = self.client[self._config.mongo['db']]
def drop_db_collections(self, collections):
for c in collections:
self.db[c].drop()
| 28.947368 | 76 | 0.558182 | 59 | 550 | 4.983051 | 0.372881 | 0.272109 | 0.306122 | 0.115646 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.278182 | 550 | 18 | 77 | 30.555556 | 0.740554 | 0 | 0 | 0 | 0 | 0 | 0.094545 | 0.043636 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0.066667 | 0.066667 | 0 | 0.266667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
5ab39146e42528e662c0c49db178a51f75c5037e | 1,901 | py | Python | app/stac_api/migrations/0006_auto_20210419_1409.py | Niclnx/service-stac | ad9129a7130d09b2bed387d8e82575eb86fdfa7b | [
"BSD-3-Clause"
] | 9 | 2020-08-17T11:01:48.000Z | 2022-01-17T22:24:13.000Z | app/stac_api/migrations/0006_auto_20210419_1409.py | Niclnx/service-stac | ad9129a7130d09b2bed387d8e82575eb86fdfa7b | [
"BSD-3-Clause"
] | 100 | 2020-08-14T05:56:40.000Z | 2022-03-01T22:39:58.000Z | app/stac_api/migrations/0006_auto_20210419_1409.py | Niclnx/service-stac | ad9129a7130d09b2bed387d8e82575eb86fdfa7b | [
"BSD-3-Clause"
] | 3 | 2020-09-02T14:01:07.000Z | 2021-07-27T06:30:26.000Z | # Generated by Django 3.1.7 on 2021-04-19 14:09
import django.db.models.deletion
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('stac_api', '0005_auto_20210408_0821'),
]
operations = [
migrations.AlterField(
model_name='item',
name='collection',
field=models.ForeignKey(
help_text=
'\n <div class=SearchUsage>\n Search Usage:\n <ul>\n <li>\n <i>arg</i> will make a non exact search checking if <i>arg</i> is part of\n the collection ID\n </li>\n <li>\n Multiple <i>arg</i> can be used, separated by spaces. This will search for all\n collections ID containing all arguments.\n </li>\n <li>\n <i>"collectionID"</i> will make an exact search for the specified collection.\n </li>\n </ul>\n Examples :\n <ul>\n <li>\n Searching for <i>pixelkarte</i> will return all collections which have\n pixelkarte as a part of their collection ID\n </li>\n <li>\n Searching for <i>pixelkarte 2016 4</i> will return all collection\n which have pixelkarte, 2016 AND 4 as part of their collection ID\n </li>\n <li>\n Searching for <i>ch.swisstopo.pixelkarte.example</i> will yield only this\n collection, if this collection exists. Please note that it would not return\n a collection named ch.swisstopo.pixelkarte.example.2.\n </li>\n </ul>\n </div>',
on_delete=django.db.models.deletion.PROTECT,
to='stac_api.collection'
),
),
]
| 73.115385 | 1,327 | 0.538664 | 243 | 1,901 | 4.18107 | 0.415638 | 0.035433 | 0.047244 | 0.023622 | 0.170276 | 0.139764 | 0.139764 | 0.084646 | 0.084646 | 0.084646 | 0 | 0.034539 | 0.360337 | 1,901 | 25 | 1,328 | 76.04 | 0.800987 | 0.023672 | 0 | 0.105263 | 1 | 0.052632 | 0.740022 | 0.063646 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.157895 | 0 | 0.315789 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5ab5bd66bce6d4c9eceac8e62755a4fcbe075a48 | 108 | py | Python | Python/type_casting.py | thebiebs/python-practise-exercises | 28db498f35ec6f9bdd437f54c91990027f4b9436 | [
"MIT"
] | null | null | null | Python/type_casting.py | thebiebs/python-practise-exercises | 28db498f35ec6f9bdd437f54c91990027f4b9436 | [
"MIT"
] | null | null | null | Python/type_casting.py | thebiebs/python-practise-exercises | 28db498f35ec6f9bdd437f54c91990027f4b9436 | [
"MIT"
] | null | null | null | a = "3434"
a = int(a)
print(type(a))
b = 32
b = str(b)
print(type(b))
| 4.695652 | 15 | 0.351852 | 16 | 108 | 2.375 | 0.5 | 0.473684 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107143 | 0.481481 | 108 | 22 | 16 | 4.909091 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5ae084aea517a9f9539f0a2bcb3c98aac39ffea6 | 2,801 | py | Python | utils/ICMPMaker.py | lanfis/Spider | c66f1d134733318a8714c544050ca42e08b9fe0e | [
"MIT"
] | null | null | null | utils/ICMPMaker.py | lanfis/Spider | c66f1d134733318a8714c544050ca42e08b9fe0e | [
"MIT"
] | null | null | null | utils/ICMPMaker.py | lanfis/Spider | c66f1d134733318a8714c544050ca42e08b9fe0e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# license removed for brevity
from scapy.all import *
import sys
class ICMPMaker:
TYPE = 8
CODE = 0
CHKSUM = None
ID = 0
SEQ = 0
TIMESTAMP_ORI = 60025165
TIMESTAMP_RX = 60025165
TIMESTAMP_TX = 60025165
GATEWAY = '0.0.0.0'
PTR = 0
RESERVED = 0
LEN = 0
MASK = '0.0.0.0'
NEXTHOPMTU = 0
def __init__(self,
TYPE=8,
CODE=0,
CHKSUM=None,
ID=0,
SEQ=0,
TIMESTAMP_ORI=60025165,
TIMESTAMP_RX=60025165,
TIMESTAMP_TX=60025165,
GATEWAY='0.0.0.0',
PTR=0,
RESERVED=0,
LEN=0,
MASK='0.0.0.0',
NEXTHOPMTU=0
):
self.TYPE = TYPE
self.CODE = CODE
self.CHKSUM = CHKSUM
self.ID = ID
self.SEQ = SEQ
self.TIMESTAMP_ORI = TIMESTAMP_ORI
self.TIMESTAMP_RX = TIMESTAMP_RX
self.TIMESTAMP_TX = TIMESTAMP_TX
self.GATEWAY = GATEWAY
self.PTR = PTR
self.RESERVED = RESERVED
self.LEN = LEN
self.MASK = MASK
self.NEXTHOPMTU = NEXTHOPMTU
def make_packet(self):
return ICMP(
type=self.TYPE,
code=self.CODE,
chksum=self.CHKSUM,
id=self.ID,
seq=self.SEQ,
ts_ori=self.TIMESTAMP_ORI,
ts_rx=self.TIMESTAMP_RX,
ts_tx=self.TIMESTAMP_TX,
gw=self.GATEWAY,
ptr=self.PTR,
reserved=self.RESERVED,
length=self.LEN,
addr_mask=self.MASK,
nexthopmtu=self.NEXTHOPMTU
)
def parse_type(self, icmp):
return icmp.type
def parse_code(self, icmp):
return icmp.code
def parse_chksum(self, icmp):
return icmp.chksum
def parse_id(self, icmp):
return icmp.id
def parse_seq(self, icmp):
return icmp.seq
def parse_ts_ori(self, icmp):
return icmp.ts_ori
def parse_ts_rx(self, icmp):
return icmp.ts_rx
def parse_ts_tx(self, icmp):
return icmp.ts_tx
def parse_gw(self, icmp):
return icmp.gw
def parse_ptr(self, icmp):
return icmp.ptr
def parse_reserved(self, icmp):
return icmp.reserved
def parse_len(self, icmp):
return icmp.length
def parse_mask(self, icmp):
return icmp.addr_mask
def parse_nexthopmtu(self, icmp):
return icmp.nexthopmtu
def show(self, icmp):
return icmp.show2()
| 27.732673 | 43 | 0.49875 | 322 | 2,801 | 4.198758 | 0.149068 | 0.118343 | 0.155325 | 0.199704 | 0.239645 | 0.195266 | 0.195266 | 0.195266 | 0.195266 | 0.195266 | 0 | 0.049938 | 0.420921 | 2,801 | 100 | 44 | 28.01 | 0.7836 | 0.017137 | 0 | 0.021277 | 0 | 0 | 0.010562 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.180851 | false | 0 | 0.021277 | 0.170213 | 0.531915 | 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 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5aecff436e5a3929428f67cdb7fbb6a29d787f25 | 208 | py | Python | wthpython/return_none/nothing.py | Nobodylesszb/python_study | 56c419df4c5deffa3d14c2ffb03c6a39a7d945be | [
"MIT"
] | null | null | null | wthpython/return_none/nothing.py | Nobodylesszb/python_study | 56c419df4c5deffa3d14c2ffb03c6a39a7d945be | [
"MIT"
] | null | null | null | wthpython/return_none/nothing.py | Nobodylesszb/python_study | 56c419df4c5deffa3d14c2ffb03c6a39a7d945be | [
"MIT"
] | null | null | null | some_list = [1, 2, 3]
some_dict = {
"key_1": 1,
"key_2": 2,
"key_3": 3
}
some_list = some_list.append(4)
some_dict = some_dict.update({"key_4": 4})
print(some_list,some_list)
"""
output:
None None
""" | 13.866667 | 42 | 0.629808 | 38 | 208 | 3.131579 | 0.342105 | 0.336134 | 0.201681 | 0.268908 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069364 | 0.168269 | 208 | 15 | 43 | 13.866667 | 0.618497 | 0 | 0 | 0 | 0 | 0 | 0.108696 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.111111 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5af8db425d863a789a0d294d5dea7672f67dc1bf | 2,085 | py | Python | imdbCrawler/items.py | irfanandriansyah1997/imdbCrawler | 04206b779735777c9025160f8bd8dad34517edfe | [
"MIT"
] | null | null | null | imdbCrawler/items.py | irfanandriansyah1997/imdbCrawler | 04206b779735777c9025160f8bd8dad34517edfe | [
"MIT"
] | null | null | null | imdbCrawler/items.py | irfanandriansyah1997/imdbCrawler | 04206b779735777c9025160f8bd8dad34517edfe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class ActressList(scrapy.Item):
actress_id = scrapy.Field()
actress_link = scrapy.Field()
actress_name = scrapy.Field()
actress_photo = scrapy.Field()
class ActressDetail(scrapy.Item):
actress_id = scrapy.Field()
actress_name = scrapy.Field()
actress_photo = scrapy.Field()
actress_height = scrapy.Field()
actress_category = scrapy.Field()
actress_filmography = scrapy.Field()
class ActressBio(scrapy.Item):
actress_id = scrapy.Field()
actress_bio = scrapy.Field()
actress_birth = scrapy.Field()
actress_height = scrapy.Field()
actress_personal_detail = scrapy.Field()
class ActressPhoto(scrapy.Item):
actress_id = scrapy.Field()
actress_media = scrapy.Field()
class FilmList(scrapy.Item):
film_id = scrapy.Field()
film_year = scrapy.Field()
film_title = scrapy.Field()
film_photo = scrapy.Field()
film_length = scrapy.Field()
film_rating = scrapy.Field()
film_genre = scrapy.Field()
film_description_short = scrapy.Field()
class FilmDetail(scrapy.Item):
film_id = scrapy.Field()
film_title = scrapy.Field()
film_description_short = scrapy.Field()
film_director = scrapy.Field()
film_writer = scrapy.Field()
film_stars = scrapy.Field()
film_photo = scrapy.Field()
film_creator = scrapy.Field()
film_year = scrapy.Field()
film_type = scrapy.Field()
film_length = scrapy.Field()
film_rating = scrapy.Field()
film_genre = scrapy.Field()
film_date_release = scrapy.Field()
film_content_rating = scrapy.Field()
film_storyline = scrapy.Field()
class FilmSynopsis(scrapy.Item):
film_id = scrapy.Field()
film_synopsis = scrapy.Field()
class FilmPhoto(scrapy.Item):
film_id = scrapy.Field()
film_media = scrapy.Field()
class FilmCrew(scrapy.Item):
film_id = scrapy.Field()
film_crew = scrapy.Field()
film_cast = scrapy.Field() | 27.8 | 51 | 0.693046 | 258 | 2,085 | 5.395349 | 0.263566 | 0.37931 | 0.280172 | 0.057471 | 0.582615 | 0.582615 | 0.582615 | 0.191092 | 0.191092 | 0.191092 | 0 | 0.000589 | 0.186091 | 2,085 | 75 | 52 | 27.8 | 0.819682 | 0.066667 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.017241 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8508ac206895abe5c9050cca651b7662bc4d25d1 | 2,309 | py | Python | bpn_init.py | praneethnamburi/blender-ScriptViz | 95554873ecebc0aa6b151d90d2ecf952be4b8880 | [
"MIT"
] | 10 | 2020-06-12T06:39:11.000Z | 2022-02-03T00:24:28.000Z | bpn_init.py | praneethnamburi/blender-ScriptViz | 95554873ecebc0aa6b151d90d2ecf952be4b8880 | [
"MIT"
] | null | null | null | bpn_init.py | praneethnamburi/blender-ScriptViz | 95554873ecebc0aa6b151d90d2ecf952be4b8880 | [
"MIT"
] | 1 | 2021-04-13T01:55:16.000Z | 2021-04-13T01:55:16.000Z | """
Initialization code for apps using Praneeth's blender python module.
Also useful for initalizing blender's workspace.
Usage:
from bpn_init import *
pn.reload() # useful when developing the module alongside the app
env.reset() # if you want to delete objects, this is useful!
"""
#pylint:disable=unused-import
# Imports from the standard library
import os
import sys
import inspect
from importlib import reload
from timeit import default_timer as timer
# Installed using _requirements
import numpy as np
import pandas as pd
# Blender's library
import bpy #pylint: disable=import-error
import bmesh #pylint: disable=import-error
import mathutils #pylint: disable=import-error
# Peronal library
import pntools as pn
from pntools import sampled
import bpn
# modules
from bpn import new, env, demo, utils, turtle, vef, trf, io, mantle, core
# classes
from bpn.mantle import Pencil, Screen
# functions
from bpn.utils import get
from pntools import run
# # Convenience
# Matrix = mathutils.Matrix
# Vector = mathutils.Vector
# for using matplotlib from within blender
if os.name == 'nt':
import multiprocess
multiprocess.set_executable(pn.locate_command('python', 'conda', verbose=False).split('\r\n')[0])
from plots import plot
def reset():
env.reset()
core.ThingDB = core._ThingDB()
# bridge to julia
# pylint: disable=no-name-in-module, wrong-import-order
# from julia import Pkg
# Pkg.activate(os.path.join(os.path.dirname(__file__), "SimPN"))
# from julia import SimPN as spn
# Pkg.activate() # switch back to the default environment in julia
# pylint: enable=no-name-in-module, wrong-import-order
# # bridge to MATLAB
# try:
# import matlab.engine
# ml_eng_installed = True
# except ImportError:
# print("Unable to detect MATLAB engine.")
# ml_eng_installed = False
# if ml_eng_installed:
# all_ml = matlab.engine.find_matlab()
# if len(all_ml) == 0:
# print("No shared MATLAB engine sessions found. Type matlab.engine.shareEngine at the MATLAB command prompt")
# elif len(all_ml) == 1:
# future = matlab.engine.connect_matlab(all_ml[0], background=True)
# eng = future.result()
# mw = eng.workspace
# elif len(all_ml) > 1:
# print("Multiple MATLAB sessions found. Please connect manually.")
| 29.227848 | 118 | 0.725422 | 328 | 2,309 | 5.036585 | 0.460366 | 0.043584 | 0.034504 | 0.043584 | 0.119855 | 0.03632 | 0.03632 | 0 | 0 | 0 | 0 | 0.002634 | 0.177999 | 2,309 | 78 | 119 | 29.602564 | 0.867756 | 0.677783 | 0 | 0 | 0 | 0 | 0.02446 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | true | 0 | 0.791667 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
850acd6db723d84ce7aaa424a7eb7c331b08e2c7 | 81 | py | Python | main.py | iuliansimion/Chevalley | 9122b1002db99c352533c99f7e143f5be8f8c34b | [
"MIT"
] | null | null | null | main.py | iuliansimion/Chevalley | 9122b1002db99c352533c99f7e143f5be8f8c34b | [
"MIT"
] | null | null | null | main.py | iuliansimion/Chevalley | 9122b1002db99c352533c99f7e143f5be8f8c34b | [
"MIT"
] | null | null | null | import chevalley as chv
tmp = chv.LieType("a", 2)
tmp.curtis.report_latex_all()
| 16.2 | 29 | 0.740741 | 14 | 81 | 4.142857 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014085 | 0.123457 | 81 | 4 | 30 | 20.25 | 0.802817 | 0 | 0 | 0 | 0 | 0 | 0.012346 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
85105c4f6fcd9260004a2cb0b270501f073f2833 | 77 | py | Python | curfuel/__init__.py | tamentis/curfuel | 0cf2d06efc452f05d5eedbe53fb48c86c5ec4023 | [
"ISC",
"MIT"
] | 1 | 2020-11-30T10:38:07.000Z | 2020-11-30T10:38:07.000Z | curfuel/__init__.py | tamentis/curfuel | 0cf2d06efc452f05d5eedbe53fb48c86c5ec4023 | [
"ISC",
"MIT"
] | null | null | null | curfuel/__init__.py | tamentis/curfuel | 0cf2d06efc452f05d5eedbe53fb48c86c5ec4023 | [
"ISC",
"MIT"
] | null | null | null | from daemonapp import DaemonApp
from tank import Tank
__version__ = "0.1.1"
| 15.4 | 31 | 0.779221 | 12 | 77 | 4.666667 | 0.583333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.046154 | 0.155844 | 77 | 4 | 32 | 19.25 | 0.815385 | 0 | 0 | 0 | 0 | 0 | 0.064935 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
516f59ae351411499e663fe5fdd1c79c63235791 | 181 | py | Python | tasks/read_txt_file.py | Adamage/python-training | dd58868420656dc575c4a32304028bdd0215f415 | [
"Apache-2.0"
] | 2 | 2018-09-06T15:29:25.000Z | 2019-09-18T08:59:24.000Z | tasks/read_txt_file.py | Adamage/python-training | dd58868420656dc575c4a32304028bdd0215f415 | [
"Apache-2.0"
] | 1 | 2017-09-13T17:31:43.000Z | 2021-03-15T14:59:50.000Z | tasks/read_txt_file.py | Adamage/python-training | dd58868420656dc575c4a32304028bdd0215f415 | [
"Apache-2.0"
] | null | null | null | with open('example.txt') as file:
all_lines = file.readlines()
print(all_lines)
for line in all_lines:
if line == "\n":
continue
print(line)
| 22.625 | 33 | 0.563536 | 24 | 181 | 4.125 | 0.666667 | 0.242424 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.320442 | 181 | 7 | 34 | 25.857143 | 0.804878 | 0 | 0 | 0 | 0 | 0 | 0.071823 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.285714 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
51700dec9f70b821831074e4298daf70b42e93d4 | 698 | py | Python | tests/common.py | VFXetc/sgsession | 6ae016e376fda26ac8c2fbb48d96b878bd446da2 | [
"BSD-3-Clause"
] | 9 | 2017-04-05T12:38:53.000Z | 2021-06-25T15:41:07.000Z | tests/common.py | vfxetc/sgsession | 6ae016e376fda26ac8c2fbb48d96b878bd446da2 | [
"BSD-3-Clause"
] | null | null | null | tests/common.py | vfxetc/sgsession | 6ae016e376fda26ac8c2fbb48d96b878bd446da2 | [
"BSD-3-Clause"
] | 3 | 2017-07-04T22:59:15.000Z | 2018-05-19T22:47:26.000Z | from pprint import pprint, pformat
import datetime
import os
from sgmock import Fixture
from sgmock import TestCase
_shotgun_server = os.environ.get('SHOTGUN', 'mock')
if _shotgun_server == 'mock':
from sgmock import Shotgun, ShotgunError, Fault
else:
from shotgun_api3 import ShotgunError, Fault
import shotgun_api3_registry
def Shotgun():
return shotgun_api3_registry.connect('sgsession.tests', server=_shotgun_server)
from sgsession import Session, Entity
def mini_uuid():
return os.urandom(4).encode('hex')
def timestamp():
return datetime.datetime.now().strftime('%Y%m%d%H%M%S')
def minimal(entity):
return dict(type=entity['type'], id=entity['id'])
| 24.928571 | 87 | 0.739255 | 95 | 698 | 5.305263 | 0.473684 | 0.059524 | 0.095238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006745 | 0.15043 | 698 | 27 | 88 | 25.851852 | 0.84317 | 0 | 0 | 0 | 0 | 0 | 0.073066 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.45 | 0.2 | 0.85 | 0.05 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
51799bf4b379e2c4be804aba7006121b1c6cccf6 | 2,137 | py | Python | smartmin/csv_imports/models.py | nickhargreaves/smartmin | 660a67ec2619af2a766970b3fe3b4369fffb5741 | [
"BSD-3-Clause"
] | 166 | 2015-01-13T13:40:17.000Z | 2022-03-23T09:40:52.000Z | smartmin/csv_imports/models.py | nickhargreaves/smartmin | 660a67ec2619af2a766970b3fe3b4369fffb5741 | [
"BSD-3-Clause"
] | 71 | 2015-01-08T17:02:31.000Z | 2022-02-10T12:43:27.000Z | smartmin/csv_imports/models.py | nickhargreaves/smartmin | 660a67ec2619af2a766970b3fe3b4369fffb5741 | [
"BSD-3-Clause"
] | 34 | 2015-01-14T07:19:27.000Z | 2021-02-19T20:41:02.000Z | import os
from django.db import models
from django.utils import timezone
from django.utils.module_loading import import_string
from smartmin.models import SmartModel
def generate_file_path(instance, filename):
file_path_prefix = 'csv_imports/'
name, extension = os.path.splitext(filename)
if len(name) + len(extension) >= 100:
name = name[:100-len(extension)-len(file_path_prefix)]
return "%s%s%s" % (file_path_prefix, name, extension)
class ImportTask(SmartModel):
PENDING = 'PENDING'
STARTED = 'STARTED'
RUNNING = 'RUNNING'
SUCCESS = 'SUCCESS'
FAILURE = 'FAILURE'
READY_STATES = [SUCCESS, FAILURE]
csv_file = models.FileField(upload_to=generate_file_path, verbose_name="Import file",
help_text="A comma delimited file of records to import")
model_class = models.CharField(max_length=255, help_text="The model we are importing for")
import_params = models.TextField(blank=True, null=True, help_text="JSON blob of form parameters on task creation")
import_log = models.TextField()
import_results = models.TextField(blank=True, null=True, help_text="JSON blob of result values on task completion")
task_id = models.CharField(null=True, max_length=64)
task_status = models.CharField(max_length=32, default=PENDING)
def start(self):
from .tasks import csv_import
self.log("Queued import at %s" % timezone.now())
self.task_status = self.STARTED
self.save(update_fields=['import_log', 'task_status'])
result = csv_import.delay(self.pk)
self.task_id = result.task_id
self.save(update_fields=['task_id'])
def done(self):
if self.task_id:
return self.task_status in self.READY_STATES
def status(self):
return self.task_status
def log(self, message):
self.import_log += "%s\n" % message
self.modified_on = timezone.now()
self.save(update_fields=['import_log', 'modified_on'])
def __unicode__(self):
return "%s Import" % import_string(self.model_class)._meta.verbose_name.title()
| 30.971014 | 119 | 0.685073 | 286 | 2,137 | 4.91958 | 0.353147 | 0.028429 | 0.029851 | 0.042644 | 0.112296 | 0.112296 | 0.071073 | 0.071073 | 0.071073 | 0.071073 | 0 | 0.007679 | 0.207768 | 2,137 | 68 | 120 | 31.426471 | 0.82339 | 0 | 0 | 0 | 1 | 0 | 0.144127 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0 | 0.444444 | 0.044444 | 0.977778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
5199e96e2dc3b8315e0ada1e424873f01260bd26 | 174 | py | Python | visualdl/server/log.py | gmhou/VisualDL | fa7b30e09b91c336b1eb900ad799f71cf0db9f94 | [
"Apache-2.0"
] | 1 | 2018-01-19T10:54:38.000Z | 2018-01-19T10:54:38.000Z | visualdl/server/log.py | gmhou/VisualDL | fa7b30e09b91c336b1eb900ad799f71cf0db9f94 | [
"Apache-2.0"
] | null | null | null | visualdl/server/log.py | gmhou/VisualDL | fa7b30e09b91c336b1eb900ad799f71cf0db9f94 | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging
logger.basicConfig(
format='[%(levelname)s %(asctime)s %(filename)s:%(lineno)s] %(message)s')
logger.getLogger().setLevel(logging.INFO)
| 21.75 | 77 | 0.718391 | 22 | 174 | 5.681818 | 0.636364 | 0.208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097701 | 174 | 7 | 78 | 24.857143 | 0.796178 | 0 | 0 | 0 | 0 | 0.2 | 0.362069 | 0.137931 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
51a6290e44551eff196c9b9eb2b8f69ed8a8403e | 346 | py | Python | third_party/WebKit/LayoutTests/http/tests/websocket/delayed-handshake_wsh.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | third_party/WebKit/LayoutTests/http/tests/websocket/delayed-handshake_wsh.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | third_party/WebKit/LayoutTests/http/tests/websocket/delayed-handshake_wsh.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
def web_socket_do_extra_handshake(request):
time.sleep(1) # Wait for 1 second and then always accept.
def web_socket_transfer_data(request):
pass # do nothing
| 24.714286 | 72 | 0.763006 | 57 | 346 | 4.508772 | 0.842105 | 0.046693 | 0.093385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021201 | 0.182081 | 346 | 13 | 73 | 26.615385 | 0.886926 | 0.601156 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0.2 | 0.2 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
51d27d6990f67193e13df04e2f51e6f106d038fe | 2,192 | py | Python | checkmate/contrib/plugins/php/progpilot/issues_data.py | marcinguy/checkmate-ce | fc33c7c27bc640ab4db5dbda274a0edd3b3db218 | [
"MIT"
] | null | null | null | checkmate/contrib/plugins/php/progpilot/issues_data.py | marcinguy/checkmate-ce | fc33c7c27bc640ab4db5dbda274a0edd3b3db218 | [
"MIT"
] | null | null | null | checkmate/contrib/plugins/php/progpilot/issues_data.py | marcinguy/checkmate-ce | fc33c7c27bc640ab4db5dbda274a0edd3b3db218 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
issues_data = {
"xss": {
"severity": "1",
"description": "Cross-Site Scripting detected",
"categories": ["security"],
"title": "XSS"
},
"session_fixation": {
"severity": "2",
"description": "Session fixation detected",
"categories": ["security"],
"title": "Session fixation"
},
"file_inclusion": {
"severity": "2",
"description": "File inclusion detected",
"categories": ["security"],
"title": "File Inclusion"
},
"file_disclosure": {
"severity": "1",
"description": "File disclosure detected",
"categories": ["security"],
"title": "File disclosure"
},
"ldap_injection": {
"severity": "1",
"description": "LDAP Injection detected",
"categories": ["security"],
"title": "LDAP Injection"
},
"xml_injection": {
"severity": "1",
"description": "XML Injection detected",
"categories": ["security"],
"title": "XML Injection"
},
"sql_injection": {
"severity": "1",
"description": "SQL Injection detected",
"categories": ["security"],
"title": "SQL Injection"
},
"code_injection": {
"severity": "1",
"description": "Code Injection detected",
"categories": ["security"],
"title": "Code Injection"
},
"header_injection": {
"severity": "1",
"description": "Header Injection detected",
"categories": ["security"],
"title": "Header Injection"
},
"idor": {
"severity": "1",
"description": "Insecure Direct Object Reference detected",
"categories": ["security"],
"title": "Insecure Direct Object Reference"
},
"command_injection": {
"severity": "1",
"description": "Command Injection detected",
"categories": ["security"],
"title": "Command Injection"
},
"mail command_injection": {
"severity": "1",
"description": "Mail Command Injection detected",
"categories": ["security"],
"title": "Mail Command Injection"
},
"w32api command_injection": {
"severity": "1",
"description": "w32api Command Injection detected",
"categories": ["security"],
"title": "w32api Command Injection"
}
}
| 25.788235 | 63 | 0.59854 | 187 | 2,192 | 6.925134 | 0.219251 | 0.180695 | 0.261004 | 0.311197 | 0.400772 | 0.10888 | 0 | 0 | 0 | 0 | 0 | 0.011581 | 0.212135 | 2,192 | 84 | 64 | 26.095238 | 0.738274 | 0.00958 | 0 | 0.320988 | 0 | 0 | 0.601199 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.012346 | 0 | 0.012346 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
51febf22b0facd552d35748a11b39de2fc7adf8c | 265 | py | Python | poezio/ui/consts.py | hrnciar/poezio | 12b8af11df35dda535412b0c02ba792890095a7d | [
"Zlib"
] | 50 | 2015-02-11T12:00:25.000Z | 2022-01-18T05:26:40.000Z | poezio/ui/consts.py | hrnciar/poezio | 12b8af11df35dda535412b0c02ba792890095a7d | [
"Zlib"
] | 3 | 2017-11-27T20:55:42.000Z | 2020-03-20T18:05:53.000Z | poezio/ui/consts.py | hrnciar/poezio | 12b8af11df35dda535412b0c02ba792890095a7d | [
"Zlib"
] | 15 | 2015-04-22T14:33:36.000Z | 2021-09-29T21:33:50.000Z | from datetime import datetime
FORMAT_CHAR = '\x19'
# These are non-printable chars, so they should never appear in the input,
# I guess. But maybe we can find better chars that are even less risky.
FORMAT_CHARS = '\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x1A'
| 37.857143 | 74 | 0.754717 | 48 | 265 | 4.125 | 0.895833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.10177 | 0.14717 | 265 | 6 | 75 | 44.166667 | 0.774336 | 0.535849 | 0 | 0 | 0 | 0.333333 | 0.433333 | 0.4 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
51ffc4f6b6d23170b73a6eacebc5e2ad88e94b17 | 403 | py | Python | utilities/py/factories/factory.py | ItsSeaJay/phphp | c430c1d03fb88a6a94e07b84eba3905d8090cc8e | [
"MIT"
] | null | null | null | utilities/py/factories/factory.py | ItsSeaJay/phphp | c430c1d03fb88a6a94e07b84eba3905d8090cc8e | [
"MIT"
] | null | null | null | utilities/py/factories/factory.py | ItsSeaJay/phphp | c430c1d03fb88a6a94e07b84eba3905d8090cc8e | [
"MIT"
] | null | null | null | import json
class Factory:
def __init__(self):
pass
@staticmethod
def create(self):
pass
@staticmethod
def get_template(self):
pass
def get_config(self):
with open('json/config.json', 'r') as file:
# Convert the contents of the file to a Python dictionary
config = json.loads(file.read())
return config | 20.15 | 69 | 0.575682 | 48 | 403 | 4.708333 | 0.604167 | 0.106195 | 0.176991 | 0.20354 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.342432 | 403 | 20 | 70 | 20.15 | 0.85283 | 0.136476 | 0 | 0.357143 | 0 | 0 | 0.048991 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.214286 | 0.071429 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
a405cb29a4a6d5faed09ea2ed20051e186fb8ddd | 100 | py | Python | src/apps/songs_artists/apps.py | forever-Agriculture/lyrics_site | 9acac576974578ac52b9e32a760089c8c95d3e6d | [
"BSD-3-Clause"
] | 1 | 2017-05-05T12:07:31.000Z | 2017-05-05T12:07:31.000Z | src/apps/songs_artists/apps.py | forever-Agriculture/lyrics_site | 9acac576974578ac52b9e32a760089c8c95d3e6d | [
"BSD-3-Clause"
] | 7 | 2020-02-11T23:57:39.000Z | 2022-01-13T00:42:36.000Z | src/apps/songs_artists/apps.py | forever-Agriculture/lyrics_site | 9acac576974578ac52b9e32a760089c8c95d3e6d | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class SongsArtistsConfig(AppConfig):
name = 'songs_artists'
| 16.666667 | 36 | 0.78 | 11 | 100 | 7 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 100 | 5 | 37 | 20 | 0.905882 | 0 | 0 | 0 | 0 | 0 | 0.13 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
cf95eb4bdfd3378b91c202518528f3335389e6e3 | 370 | py | Python | texts/objects/cache/base.py | nicolay-r/frame-based-attitude-extraction-workflow | f20e6d17a9eb6613028545b889c74626a8260ccd | [
"MIT"
] | null | null | null | texts/objects/cache/base.py | nicolay-r/frame-based-attitude-extraction-workflow | f20e6d17a9eb6613028545b889c74626a8260ccd | [
"MIT"
] | 6 | 2020-10-03T13:45:38.000Z | 2021-07-13T18:31:57.000Z | texts/objects/cache/base.py | nicolay-r/frame-based-attitude-extraction-workflow | f20e6d17a9eb6613028545b889c74626a8260ccd | [
"MIT"
] | null | null | null | from texts.text_info import NewsSentenceInfo
class BaseObjectCache:
"""
Base Cache for NER data (API).
"""
TITLE_SENT_IND = NewsSentenceInfo.TITLE_SENT_IND
def __init__(self):
pass
def is_news_registered(self, news_id):
raise NotImplementedError()
def try_get(self, filename, s_ind):
raise NotImplementedError()
| 19.473684 | 52 | 0.681081 | 43 | 370 | 5.534884 | 0.72093 | 0.07563 | 0.10084 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.240541 | 370 | 18 | 53 | 20.555556 | 0.846975 | 0.081081 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.111111 | 0.111111 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
cfa10d23c5f1725d917e3366e959b9010799603e | 267 | py | Python | annotator/admin.py | fossabot/django-annotator | 1151c7628dade8b600719e3653a79e1c53b16340 | [
"Apache-2.0"
] | 11 | 2017-02-21T11:31:10.000Z | 2019-06-19T08:44:15.000Z | annotator/admin.py | fossabot/django-annotator | 1151c7628dade8b600719e3653a79e1c53b16340 | [
"Apache-2.0"
] | 5 | 2017-02-21T18:31:44.000Z | 2020-03-06T09:10:40.000Z | annotator/admin.py | fossabot/django-annotator | 1151c7628dade8b600719e3653a79e1c53b16340 | [
"Apache-2.0"
] | 5 | 2017-03-27T18:45:41.000Z | 2020-03-06T09:11:18.000Z | from django.apps import apps
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered
for model in apps.get_app_config("annotator").get_models():
try:
admin.site.register(model)
except AlreadyRegistered:
pass
| 26.7 | 59 | 0.752809 | 35 | 267 | 5.657143 | 0.6 | 0.151515 | 0.171717 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172285 | 267 | 9 | 60 | 29.666667 | 0.895928 | 0 | 0 | 0 | 0 | 0 | 0.033708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.125 | 0.375 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
cfbeba738a545b8fa816e6c53371f15e1212b0d3 | 2,590 | py | Python | sds.py | Nico0302/SMG-UntisOfficeConverters | b43fd6b2baa58d42f9343c3a40963b7eec689ed5 | [
"MIT"
] | null | null | null | sds.py | Nico0302/SMG-UntisOfficeConverters | b43fd6b2baa58d42f9343c3a40963b7eec689ed5 | [
"MIT"
] | null | null | null | sds.py | Nico0302/SMG-UntisOfficeConverters | b43fd6b2baa58d42f9343c3a40963b7eec689ed5 | [
"MIT"
] | null | null | null | import csv
from utils import to_sds_date
SCHOOL_ID = '1'
SCHOOL_FILENAME = 'School.csv'
SECTION_FILENAME = 'Section.csv'
STUDENT_FILENAME = 'Student.csv'
TEACHER_FILENAME = 'Teacher.csv'
STUDENT_ENROLLMENT_FILENAME = 'StudentEnrollment.csv'
TEACHER_ROSTER_FILENAME = 'TeacherRoster.csv'
class Writer:
HEADERS = []
def __init__(self, csvfile, datascource):
self.csvwriter = csv.writer(csvfile, delimiter=',', quoting=csv.QUOTE_NONE)
self.datasource = datascource
def row_iterator(self, sourcerow):
return sourcerow
def generate(self, *args, **kwargs):
self.csvwriter.writerow(self.HEADERS)
for sourcerow in self.datasource:
self.csvwriter.writerow(self.row_iterator(sourcerow, *args, **kwargs))
class School(Writer):
HEADERS = ['SIS ID', 'Name']
def __init__(self, csvfile, schoolname):
super(School, self).__init__(csvfile, [[SCHOOL_ID, schoolname]])
class Section(Writer):
HEADERS = ['SIS ID', 'School SIS ID', 'Section Name']
def __init__(self, csvfile, datascource):
super(Section, self).__init__(csvfile, datascource)
def row_iterator(self, sourcerow, schoolyear=2020):
return [
sourcerow.get_id(schoolyear),
SCHOOL_ID,
sourcerow.course + ' ' + str(sourcerow.grade)
]
class Student(Writer):
HEADERS = ['SIS ID', 'School SIS ID', 'Username', 'Grade']
def __init__(self, csvfile, datascource):
super(Student, self).__init__(csvfile, datascource)
def row_iterator(self, sourcerow):
return [sourcerow.shortname, SCHOOL_ID, sourcerow.get_username(), sourcerow.grade]
class Teacher(Writer):
HEADERS = ['SIS ID', 'School SIS ID', 'Username']
def __init__(self, csvfile, datascource):
super(Teacher, self).__init__(csvfile, datascource)
def row_iterator(self, sourcerow):
return [sourcerow.shortname, SCHOOL_ID, sourcerow.get_username()]
class StudentEnrollment(Writer):
HEADERS = ['Section SIS ID', 'SIS ID']
def __init__(self, csvfile, datascource):
super(StudentEnrollment, self).__init__(csvfile, datascource)
def row_iterator(self, sourcerow, schoolyear=2020):
return [sourcerow.get_id(schoolyear), sourcerow.student]
class TeacherRoaster(Writer):
HEADERS = ['Section SIS ID', 'SIS ID']
def __init__(self, csvfile, datascource):
super(TeacherRoaster, self).__init__(csvfile, datascource)
def row_iterator(self, sourcerow, schoolyear=2020):
return [sourcerow.get_id(schoolyear), sourcerow.teacher]
| 31.204819 | 90 | 0.688417 | 289 | 2,590 | 5.892734 | 0.190311 | 0.116265 | 0.045214 | 0.073987 | 0.563711 | 0.531415 | 0.471521 | 0.454492 | 0.379918 | 0.379918 | 0 | 0.006211 | 0.191892 | 2,590 | 82 | 91 | 31.585366 | 0.807453 | 0 | 0 | 0.241379 | 0 | 0 | 0.086486 | 0.008108 | 0 | 0 | 0 | 0 | 0 | 1 | 0.241379 | false | 0 | 0.034483 | 0.103448 | 0.62069 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
cfc8236b7f2f5731cc673472309e507f47fa4c37 | 301 | py | Python | Unit 2 Review of Rock and Fluid Properties/functions/waterfvf.py | datasolver/reservoir-engineering | 82393cff19e700fe3c7ac5c1a32ba877a4e40750 | [
"MIT"
] | null | null | null | Unit 2 Review of Rock and Fluid Properties/functions/waterfvf.py | datasolver/reservoir-engineering | 82393cff19e700fe3c7ac5c1a32ba877a4e40750 | [
"MIT"
] | null | null | null | Unit 2 Review of Rock and Fluid Properties/functions/waterfvf.py | datasolver/reservoir-engineering | 82393cff19e700fe3c7ac5c1a32ba877a4e40750 | [
"MIT"
] | 1 | 2020-06-24T15:50:00.000Z | 2020-06-24T15:50:00.000Z | def waterfvf(temp, p):
"Water FVF (Bw)"
# temp in Fahrenheit
# p pressure in psia
Vwp = (-1.95301E-9 * p * temp) - (1.72834E-13 * (p**2) * temp) - (3.588922E-7 * p) - (2.25341E-10 * p**2)
Vwt = (-1E-2) + (1.33391E-2 * temp) + (5.50654E-7 * temp**2)
Bw = (1 + Vwt) * (1 + Vwp)
return(Bw)
| 33.444444 | 107 | 0.524917 | 54 | 301 | 2.925926 | 0.537037 | 0.037975 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.226087 | 0.23588 | 301 | 8 | 108 | 37.625 | 0.46087 | 0.17608 | 0 | 0 | 0 | 0 | 0.05364 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
32051e69655135f9cec16bd36a2816331e97b889 | 279 | py | Python | tatk/dst/trade/multiwoz/trade.py | libing125/tatk | 1473a162cf45a4a40a60473169bc034234412b2e | [
"Apache-2.0"
] | 81 | 2019-03-12T13:40:29.000Z | 2022-01-17T10:59:21.000Z | tatk/dst/trade/multiwoz/trade.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 35 | 2019-03-13T14:05:05.000Z | 2021-08-25T15:38:14.000Z | tatk/dst/trade/multiwoz/trade.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 41 | 2019-03-13T09:40:24.000Z | 2022-03-07T17:59:07.000Z | class TRADE:
def __init__(self):
pass
def update(self, user_act, history):
"""
Args:
user_act: dict
history: [[system, user], [s, u], ...]
Returns:
The current dialogue state.
"""
pass
| 18.6 | 50 | 0.451613 | 27 | 279 | 4.444444 | 0.740741 | 0.116667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.430108 | 279 | 14 | 51 | 19.928571 | 0.754717 | 0.387097 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0.4 | 0 | 0 | 0.6 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
320f405199d5ce9241ae050a831d48536cdecf70 | 150 | py | Python | ncmw/setup_models/__init__.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 5 | 2022-01-19T12:55:35.000Z | 2022-03-10T13:17:22.000Z | ncmw/setup_models/__init__.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 5 | 2022-02-18T08:17:04.000Z | 2022-02-23T13:50:15.000Z | ncmw/setup_models/__init__.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 1 | 2021-12-02T12:23:59.000Z | 2021-12-02T12:23:59.000Z | from .setup import (
create_consistent_model,
set_default_configs_and_snm3_medium,
gapfill_model,
gapfill_medium,
score_memote,
)
| 18.75 | 40 | 0.746667 | 18 | 150 | 5.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008333 | 0.2 | 150 | 7 | 41 | 21.428571 | 0.841667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.142857 | 0 | 0.142857 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5c61d523b5aab9332a583c4fbce5282a1d349b34 | 198 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C03StacksQueues/questions/3.2-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C03StacksQueues/questions/3.2-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C03StacksQueues/questions/3.2-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 3.2 Stack Min
# How would you design a stack which, in addition to push and pop, has a function min which
# returns the minimum element? Push, pop, and min should all operate in O(1) time.
| 39.6 | 92 | 0.712121 | 37 | 198 | 3.810811 | 0.756757 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019608 | 0.227273 | 198 | 4 | 93 | 49.5 | 0.901961 | 0.939394 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
5c705653960bf8c4fea49d4f71bff6d854d0afcb | 7,638 | py | Python | scancodes.py | mallardtheduck/ericvnc | 2b064f00de097d336804d06ca444cd2d17ab9303 | [
"MIT"
] | null | null | null | scancodes.py | mallardtheduck/ericvnc | 2b064f00de097d336804d06ca444cd2d17ab9303 | [
"MIT"
] | null | null | null | scancodes.py | mallardtheduck/ericvnc | 2b064f00de097d336804d06ca444cd2d17ab9303 | [
"MIT"
] | null | null | null | KEY_BackSpace = 0xff08
KEY_Tab = 0xff09
KEY_Return = 0xff0d
KEY_Escape = 0xff1b
KEY_Insert = 0xff63
KEY_Delete = 0xffff
KEY_Home = 0xff50
KEY_End = 0xff57
KEY_PageUp = 0xff55
KEY_PageDown = 0xff56
KEY_Left = 0xff51
KEY_Up = 0xff52
KEY_Right = 0xff53
KEY_Down = 0xff54
KEY_F1 = 0xffbe
KEY_F2 = 0xffbf
KEY_F3 = 0xffc0
KEY_F4 = 0xffc1
KEY_F5 = 0xffc2
KEY_F6 = 0xffc3
KEY_F7 = 0xffc4
KEY_F8 = 0xffc5
KEY_F9 = 0xffc6
KEY_F10 = 0xffc7
KEY_F11 = 0xffc8
KEY_F12 = 0xffc9
KEY_F13 = 0xFFCA
KEY_F14 = 0xFFCB
KEY_F15 = 0xFFCC
KEY_F16 = 0xFFCD
KEY_F17 = 0xFFCE
KEY_F18 = 0xFFCF
KEY_F19 = 0xFFD0
KEY_F20 = 0xFFD1
KEY_ShiftLeft = 0xffe1
KEY_ShiftRight = 0xffe2
KEY_ControlLeft = 0xffe3
KEY_ControlRight = 0xffe4
KEY_MetaLeft = 0xffe7
KEY_MetaRight = 0xffe8
KEY_AltLeft = 0xffe9
KEY_AltRight = 0xffea
KEY_Scroll_Lock = 0xFF14
KEY_Sys_Req = 0xFF15
KEY_Num_Lock = 0xFF7F
KEY_Caps_Lock = 0xFFE5
KEY_Pause = 0xFF13
KEY_Super_L = 0xFFEB
KEY_Super_R = 0xFFEC
KEY_Hyper_L = 0xFFED
KEY_Hyper_R = 0xFFEE
KEY_KP_0 = 0xFFB0
KEY_KP_1 = 0xFFB1
KEY_KP_2 = 0xFFB2
KEY_KP_3 = 0xFFB3
KEY_KP_4 = 0xFFB4
KEY_KP_5 = 0xFFB5
KEY_KP_6 = 0xFFB6
KEY_KP_7 = 0xFFB7
KEY_KP_8 = 0xFFB8
KEY_KP_9 = 0xFFB9
KEY_KP_Enter = 0xFF8D
# Define a scancode lookup dictionary
SCANCODES = {
KEY_Escape: [[0x01], [0x81]],
'1': [[0x02], [0x82]], '!': [[0x2A, 0x02], [0x82, 0xAA]],
'2': [[0x03], [0x83]], '@': [[0x2A, 0x03], [0x83, 0xAA]],
'3': [[0x04], [0x84]], '#': [[0x2A, 0x04], [0x84, 0xAA]],
'4': [[0x05], [0x85]], '$': [[0x2A, 0x05], [0x85, 0xAA]],
'5': [[0x06], [0x86]], '%': [[0x2A, 0x06], [0x86, 0xAA]],
'6': [[0x07], [0x87]], '^': [[0x2A, 0x07], [0x87, 0xAA]],
'7': [[0x08], [0x88]], '&': [[0x2A, 0x08], [0x88, 0xAA]],
'8': [[0x09], [0x89]], '*': [[0x2A, 0x09], [0x89, 0xAA]],
'9': [[0x0A], [0x8A]], '(': [[0x2A, 0x0A], [0x8A, 0xAA]],
'0': [[0x0B], [0x8B]], ')': [[0x2A, 0x0B], [0x8B, 0xAA]],
'-': [[0x0C], [0x8C]], '_': [[0x2A, 0x0C], [0x8C, 0xAA]],
'=': [[0x0D], [0x8D]], '+': [[0x2A, 0x0D], [0x8D, 0xAA]],
KEY_BackSpace: [[0x0E], [0x8E]],
'\b': [[0x0E], [0x8E]],
KEY_Tab: [[0x0F], [0x8F]],
'\t': [[0x0F], [0x8F]],
'q': [[0x10], [0x90]], 'Q': [[0x2A, 0x10], [0x90, 0xAA]],
'w': [[0x11], [0x91]], 'W': [[0x2A, 0x11], [0x91, 0xAA]],
'e': [[0x12], [0x92]], 'E': [[0x2A, 0x12], [0x92, 0xAA]],
'r': [[0x13], [0x93]], 'R': [[0x2A, 0x13], [0x93, 0xAA]],
't': [[0x14], [0x94]], 'T': [[0x2A, 0x14], [0x94, 0xAA]],
'y': [[0x15], [0x95]], 'Y': [[0x2A, 0x15], [0x95, 0xAA]],
'u': [[0x16], [0x96]], 'U': [[0x2A, 0x16], [0x96, 0xAA]],
'i': [[0x17], [0x97]], 'I': [[0x2A, 0x17], [0x97, 0xAA]],
'o': [[0x18], [0x98]], 'O': [[0x2A, 0x18], [0x98, 0xAA]],
'p': [[0x19], [0x99]], 'P': [[0x2A, 0x19], [0x99, 0xAA]],
'[': [[0x1A], [0x9A]], '{': [[0x2A, 0x1A], [0x9A, 0xAA]],
']': [[0x1B], [0x9B]], '}': [[0x2A, 0x1B], [0x9B, 0xAA]],
KEY_Return: [[0x1C], [0x9C]],
'\r': [[0x1C], [0x9C]],
'\n': [[0x1C], [0x9C]],
KEY_ControlLeft: [[0x1D], [0x9D]],
'a': [[0x1E], [0x9E]], 'A': [[0x2A, 0x1E], [0x9E, 0xAA]],
's': [[0x1F], [0x9F]], 'S': [[0x2A, 0x1F], [0x9F, 0xAA]],
'd': [[0x20], [0xA0]], 'D': [[0x2A, 0x20], [0xA0, 0xAA]],
'f': [[0x21], [0xA1]], 'F': [[0x2A, 0x21], [0xA1, 0xAA]],
'g': [[0x22], [0xA2]], 'G': [[0x2A, 0x22], [0xA2, 0xAA]],
'h': [[0x23], [0xA3]], 'H': [[0x2A, 0x23], [0xA3, 0xAA]],
'j': [[0x24], [0xA4]], 'J': [[0x2A, 0x24], [0xA4, 0xAA]],
'k': [[0x25], [0xA5]], 'K': [[0x2A, 0x25], [0xA5, 0xAA]],
'l': [[0x26], [0xA6]], 'L': [[0x2A, 0x26], [0xA6, 0xAA]],
';': [[0x27], [0xA7]], ':': [[0x2A, 0x27], [0xA7, 0xAA]],
'\'': [[0x28], [0xA8]], '\"': [[0x2A, 0x28], [0xA8, 0xAA]],
'`': [[0x29], [0xA9]], '~': [[0x2A, 0x29], [0xA9, 0xAA]],
KEY_ShiftLeft: [[0x2A], [0xAA]],
'\\': [[0x2B], [0xAB]], '|': [[0x2A, 0x2B], [0xAB, 0xAA]],
'z': [[0x2C], [0xAC]], 'Z': [[0x2A, 0x2C], [0xAC, 0xAA]],
'x': [[0x2D], [0xAD]], 'X': [[0x2A, 0x2D], [0xAD, 0xAA]],
'c': [[0x2E], [0xAE]], 'C': [[0x2A, 0x2E], [0xAE, 0xAA]],
'v': [[0x2F], [0xAF]], 'V': [[0x2A, 0x2F], [0xAF, 0xAA]],
'b': [[0x30], [0xB0]], 'B': [[0x2A, 0x30], [0xB0, 0xAA]],
'n': [[0x31], [0xB1]], 'N': [[0x2A, 0x31], [0xB1, 0xAA]],
'm': [[0x32], [0xB2]], 'M': [[0x2A, 0x32], [0xB2, 0xAA]],
',': [[0x33], [0xB3]], '<': [[0x2A, 0x33], [0xB3, 0xAA]],
'.': [[0x34], [0xB4]], '>': [[0x2A, 0x34], [0xB4, 0xAA]],
'/': [[0x35], [0xB5]], '?': [[0x2A, 0x35], [0xB5, 0xAA]],
KEY_ShiftRight: [[0x36], [0xB6]],
KEY_Sys_Req: [[0x37], [0xB7]],
KEY_AltLeft: [[0x38], [0xB8]],
#'SPACE': [[0x39], [0xB9]],
' ': [[0x39], [0xB9]],
KEY_Caps_Lock: [[0x3A], [0xBA]],
KEY_F1: [[0x3B], [0xBB]],
KEY_F2: [[0x3C], [0xBC]],
KEY_F3: [[0x3D], [0xBD]],
KEY_F4: [[0x3E], [0xBE]],
KEY_F5: [[0x3F], [0xBF]],
KEY_F6: [[0x40], [0xC0]],
KEY_F7: [[0x41], [0xC1]],
KEY_F8: [[0x42], [0xC2]],
KEY_F9: [[0x43], [0xC3]],
KEY_F10: [[0x44], [0xC4]],
KEY_F11: [[0x57], [0xD7]],
KEY_F12: [[0x58], [0xD8]],
KEY_Num_Lock: [[0x45], [0xC5]],
KEY_Scroll_Lock: [[0x46], [0xC6]],
KEY_Home: [[0x47], [0xC7]],
KEY_Up: [[0x48], [0xC8]],
KEY_PageUp: [[0x49], [0xC9]],
#'MINUS': [[0x4A], [0xCA]],
KEY_Left: [[0x4B], [0xCB]],
#'CENTER': [[0x4C], [0xCC]],
KEY_Right: [[0x4D], [0xCD]],
#'PLUS': [[0x4E], [0xCE]],
KEY_End: [[0x4F], [0xCF]],
KEY_Down: [[0x50], [0xD0]],
KEY_PageDown: [[0x51], [0xD1]],
KEY_Insert: [[0x52], [0xD2]],
KEY_Delete: [[0x53], [0xD3]],
#'E_DIV': [[0xE0, 0x54], [0xE0, 0xD4]],
#'E_ENTER': [[0xE0, 0x1C], [0xE0, 0x9C]],
#'E_INS': [[0xE0, 0x52], [0xE0, 0xD2]],
#'E_DEL': [[0xE0, 0x53], [0xE0, 0xD3]],
#'E_HOME': [[0xE0, 0x47], [0xE0, 0xC7]],
#'E_END': [[0xE0, 0x4F], [0xE0, 0xCF]],
#'E_PGUP': [[0xE0, 0x49], [0xE0, 0xC9]],
#'E_PGDN': [[0xE0, 0x51], [0xE0, 0xD1]],
#'E_LEFT': [[0xE0, 0x4B], [0xE0, 0xCB]],
#'E_RIGHT': [[0xE0, 0x4D], [0xE0, 0xCD]],
#'E_UP': [[0xE0, 0x48], [0xE0, 0xC8]],
#'E_DOWN': [[0xE0, 0x50], [0xE0, 0xD0]],
KEY_AltRight: [[0x0C, 0x38], [0xC0, 0xB8]],
KEY_ControlRight: [[0x0C, 0x1D], [0xC0, 0x9D]],
KEY_Super_L: [[0xE0, 0x5B], [0xE0, 0xDB]],
KEY_Super_R: [[0xE0, 0x5C], [0xE0, 0xDC]],
# No scan code for pause key released
KEY_Pause: [[0xE1, 0x1D, 0x45, 0xE1, 0x9D, 0xC5], []],
}
def rfbToScancodes_real(key, up):
if key <= 255:
key = chr(key)
key = key.lower()
if key in SCANCODES: codes = SCANCODES[key]
else: return None
if up: return codes[0]
else: return codes[1]
def rfbToScancodes(key, up):
ret = rfbToScancodes_real(key, up)
print "rfbToScancodes(%i, %s) = %s" % (key, str(up), str(ret))
if ret is not None:
realret = []
for r in ret: realret.append(r - 1)
ret = realret
return ret
| 38.771574 | 68 | 0.465829 | 904 | 7,638 | 3.779867 | 0.405973 | 0.016096 | 0.007609 | 0.013462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.20667 | 0.281618 | 7,638 | 196 | 69 | 38.969388 | 0.416074 | 0.086803 | 0 | 0 | 0 | 0.040936 | 0.022286 | 0 | 0 | 0 | 0.273185 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.005848 | 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 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5c8d31e642b15145aa91d1757e96e178ea0de22f | 730 | py | Python | excursion/testcases/fast3d.py | tutrie/excursion | a2845739fadfa038c3266b5850523fca808b49af | [
"Apache-2.0"
] | null | null | null | excursion/testcases/fast3d.py | tutrie/excursion | a2845739fadfa038c3266b5850523fca808b49af | [
"Apache-2.0"
] | 1 | 2021-08-16T19:18:11.000Z | 2021-08-16T19:18:11.000Z | excursion/testcases/fast3d.py | tutrie/excursion | a2845739fadfa038c3266b5850523fca808b49af | [
"Apache-2.0"
] | null | null | null | import numpy as np
from .. import utils
from .. import ExcursionProblem
def truth(x):
xv, yv, zv = x[:,0],x[:,1], x[:,2]
'''more wiggles in physics case'''
def xsec(xv,yv,zv):
return (12*np.exp(-xv/2)+((0.1*np.cos(10*yv)))+((0.2*np.cos(15*xv))))*np.exp(-0.3*zv)
def eff(xv,yv,zv):
return np.tanh((1.3*xv-yv)+1)*1
def stats(nevents):
return (1-np.tanh((nevents-5)))/2.
def analysis(xv,yv,zv):
return stats(xsec(xv,yv,zv) * eff(xv,yv,zv))
return 3*(np.log(analysis(xv,yv,zv)) - np.log(0.05))
bounding_box = [[0,1.5],[0,1.5],[0,1.5]]
npoints = [60,60,60]
single_function = ExcursionProblem([truth],[0.0],ndim = 3, bounding_box = bounding_box, plot_npoints=npoints)
| 27.037037 | 109 | 0.590411 | 136 | 730 | 3.132353 | 0.330882 | 0.075117 | 0.098592 | 0.112676 | 0.091549 | 0.021127 | 0 | 0 | 0 | 0 | 0 | 0.075 | 0.178082 | 730 | 26 | 110 | 28.076923 | 0.635 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.176471 | 0.235294 | 0.764706 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5cc2c89702cb6bfef8fed47f8984c04ad8a693d6 | 250 | py | Python | ExPy/ExPy/module30.py | brad-h/expy | d3f3dfbbdae31ab8c7e134a5ce9d5f6adf94b516 | [
"MIT"
] | null | null | null | ExPy/ExPy/module30.py | brad-h/expy | d3f3dfbbdae31ab8c7e134a5ce9d5f6adf94b516 | [
"MIT"
] | null | null | null | ExPy/ExPy/module30.py | brad-h/expy | d3f3dfbbdae31ab8c7e134a5ce9d5f6adf94b516 | [
"MIT"
] | null | null | null | """ Multiplication Table """
def ex30():
"""Generate a multiplication table"""
for left in range(13):
for right in range(13):
print('{} X {} = {}'.format(left, right, left * right))
if __name__ == '__main__':
ex30()
| 22.727273 | 67 | 0.556 | 29 | 250 | 4.517241 | 0.62069 | 0.290076 | 0.137405 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043478 | 0.264 | 250 | 10 | 68 | 25 | 0.668478 | 0.208 | 0 | 0 | 1 | 0 | 0.108108 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.166667 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7a307f2f55d5637cf1662f83fbfb6b7206eaf55e | 4,012 | py | Python | Tests/test_doc.py | seadavis/StoryNode | e863e68e4b95b92a074554c2399492dbfb54cbab | [
"Apache-2.0"
] | null | null | null | Tests/test_doc.py | seadavis/StoryNode | e863e68e4b95b92a074554c2399492dbfb54cbab | [
"Apache-2.0"
] | null | null | null | Tests/test_doc.py | seadavis/StoryNode | e863e68e4b95b92a074554c2399492dbfb54cbab | [
"Apache-2.0"
] | null | null | null | import spacy
import sys
from spacy.matcher import Matcher
from src.core.document import Document
from src.core.relation_extraction import *
def test_one_to_one_replacement():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
doc2 = Document("word word word word word word hello")
span = doc.span(2, 3)
span_swap = doc2.span(6, 7)
doc.swap(span, span_swap)
new_text = doc.print()
assert new_text == "Python code hello the cleanest code around unlike C++ which is garbage nonsense"
def test_multiple_replacements():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
span = doc.span(5, 6)
span2 = doc.span(12, 13)
span3 = doc.span(8, 10)
doc2 = Document("the joker fights guys batman is evil")
doc3 = Document("highlighting textbooks for fun")
span_swap = doc2.span(4, 5)
span_swap2 = doc3.span(0, 1)
span_swap3 = doc3.span(1, 3)
doc.swap(span, span_swap)
doc.swap(span2, span_swap2)
doc.swap(span3, span_swap3)
new_text = doc.print()
assert new_text == "Python code is the cleanest batman around unlike textbooks for is garbage highlighting"
def test_one_to_one_replacement_same_start_end():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
span = doc.span(5, 6)
doc2 = Document("the joker fights guys batman is evil")
span_swap = doc2.span(4, 5)
doc.swap(span, span_swap)
new_text = doc.print()
assert new_text == "Python code is the cleanest batman around unlike C++ which is garbage nonsense"
def test_n_to_n_replacement():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
span = doc.span(0, 7)
doc2 = Document("my adult nephew enjoys crafts and cutting paper like a two year old")
span_swap = doc2.span(6, 14)
doc.swap(span, span_swap)
new_text = doc.print()
assert new_text == "cutting paper like a two year old unlike C++ which is garbage nonsense"
def test_n_to_n_replacement_same_start_end():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
span = doc.span(6, 9)
doc2 = Document("my mom told me to button up jacket young man its cold outside")
span_swap = doc2.span(5, 9)
doc.swap(span, span_swap)
new_text = doc.print()
assert new_text == "Python code is the cleanest code button up jacket young which is garbage nonsense"
def test_shorter_replacement():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
span = doc.span(4, 9)
doc2 = Document("down dog, get off of the couch")
span_swap = doc2.span(0, 2)
doc.swap(span, span_swap)
new_text = doc.print()
assert new_text == "Python code is the down dog which is garbage nonsense"
def test_longer_replacement():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
span = doc.span(8, 10)
doc2 = Document("my mom told me to button up jacket young man its cold outside")
span_swap = doc2.span(5,12)
doc.swap(span, span_swap)
new_text = doc.print()
assert new_text == "Python code is the cleanest code around unlike button up jacket young man its cold is garbage nonsense"
def test_original_still_prints_after_replacement():
sample_text = "Python code is the cleanest code around unlike C++ which is garbage nonsense"
doc = Document(sample_text)
span = doc.span(8, 10)
doc2 = Document("my mom told me to button up jacket young man its cold outside")
span_swap = doc2.span(5,12)
doc.swap(span, span_swap)
old_text = doc.print(True)
assert old_text == sample_text
| 39.722772 | 127 | 0.709123 | 637 | 4,012 | 4.32967 | 0.169545 | 0.061639 | 0.071066 | 0.075417 | 0.799492 | 0.762872 | 0.714286 | 0.684191 | 0.684191 | 0.646846 | 0 | 0.023489 | 0.204138 | 4,012 | 100 | 128 | 40.12 | 0.840276 | 0 | 0 | 0.52381 | 0 | 0 | 0.392323 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 1 | 0.095238 | false | 0 | 0.059524 | 0 | 0.154762 | 0.107143 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7a4dcae230249ada20dad7e710e2b47b9491c925 | 710 | py | Python | rootUtilLib.py | fermi-lat/rootUtil | 3d326b1c35284080b3049cdcee8107205851048b | [
"BSD-3-Clause"
] | null | null | null | rootUtilLib.py | fermi-lat/rootUtil | 3d326b1c35284080b3049cdcee8107205851048b | [
"BSD-3-Clause"
] | null | null | null | rootUtilLib.py | fermi-lat/rootUtil | 3d326b1c35284080b3049cdcee8107205851048b | [
"BSD-3-Clause"
] | null | null | null | # $Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/rootUtil/rootUtilLib.py,v 1.3 2008/10/27 17:49:11 ecephas Exp $
def generate(env, **kw):
if not kw.get('depsOnly', 0):
env.Tool('addLibrary', library = ['rootUtil'])
if env['PLATFORM']=='win32' and env.get('CONTAINERNAME','')=='GlastRelease':
env.Tool('findPkgPath', package = 'rootUtil')
env.Tool('addLibrary', library = env['rootLibs'])
env.Tool('addLibrary', library = env['minuitLibs'])
env.Tool('addLibrary', library = env['rootGuiLibs'])
if env['PLATFORM']=='win32' and env.get('CONTAINERNAME','')=='GlastRelease':
env.Tool('findPkgPath', package = 'facilities')
def exists(env):
return 1;
| 50.714286 | 122 | 0.649296 | 89 | 710 | 5.179775 | 0.52809 | 0.091106 | 0.147505 | 0.208243 | 0.509761 | 0.334056 | 0.334056 | 0.334056 | 0.334056 | 0.334056 | 0 | 0.036484 | 0.150704 | 710 | 13 | 123 | 54.615385 | 0.728027 | 0.169014 | 0 | 0.166667 | 1 | 0 | 0.341837 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7a4f2b510df94c47aa5b903e4031611038525ce6 | 425 | py | Python | website/models/user.py | olaruandreea/flaskbootstrapblog | 462f2f700c3b73a794842f1fad4b318c6406c678 | [
"MIT"
] | null | null | null | website/models/user.py | olaruandreea/flaskbootstrapblog | 462f2f700c3b73a794842f1fad4b318c6406c678 | [
"MIT"
] | 4 | 2020-05-03T11:45:01.000Z | 2020-06-13T19:43:26.000Z | website/models/user.py | olaruandreea/flaskbootstrapblog | 462f2f700c3b73a794842f1fad4b318c6406c678 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask_login import UserMixin
from flask import Flask, current_app
from website.routes import get_db
db = get_db()
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(20), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
password = db.Column(db.String(60), nullable=False)
| 32.692308 | 68 | 0.748235 | 65 | 425 | 4.815385 | 0.476923 | 0.102236 | 0.127796 | 0.153355 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019126 | 0.138824 | 425 | 12 | 69 | 35.416667 | 0.836066 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.1 | 0.4 | 0 | 0.9 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
7a6651f10741e2f55d41c5d49f4a11f863eca070 | 8,311 | py | Python | venv/lib/python3.7/site-packages/twilio/rest/preview/trusted_comms/brands_information.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | venv/lib/python3.7/site-packages/twilio/rest/preview/trusted_comms/brands_information.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | venv/lib/python3.7/site-packages/twilio/rest/preview/trusted_comms/brands_information.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class BrandsInformationList(ListResource):
""" PLEASE NOTE that this class contains preview products that are subject
to change. Use them with caution. If you currently do not have developer
preview access, please contact help@twilio.com. """
def __init__(self, version):
"""
Initialize the BrandsInformationList
:param Version version: Version that contains the resource
:returns: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationList
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationList
"""
super(BrandsInformationList, self).__init__(version)
# Path Solution
self._solution = {}
def get(self):
"""
Constructs a BrandsInformationContext
:returns: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationContext
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationContext
"""
return BrandsInformationContext(self._version, )
def __call__(self):
"""
Constructs a BrandsInformationContext
:returns: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationContext
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationContext
"""
return BrandsInformationContext(self._version, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.Preview.TrustedComms.BrandsInformationList>'
class BrandsInformationPage(Page):
""" PLEASE NOTE that this class contains preview products that are subject
to change. Use them with caution. If you currently do not have developer
preview access, please contact help@twilio.com. """
def __init__(self, version, response, solution):
"""
Initialize the BrandsInformationPage
:param Version version: Version that contains the resource
:param Response response: Response from the API
:returns: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationPage
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationPage
"""
super(BrandsInformationPage, self).__init__(version, response)
# Path Solution
self._solution = solution
def get_instance(self, payload):
"""
Build an instance of BrandsInformationInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationInstance
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationInstance
"""
return BrandsInformationInstance(self._version, payload, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.Preview.TrustedComms.BrandsInformationPage>'
class BrandsInformationContext(InstanceContext):
""" PLEASE NOTE that this class contains preview products that are subject
to change. Use them with caution. If you currently do not have developer
preview access, please contact help@twilio.com. """
def __init__(self, version):
"""
Initialize the BrandsInformationContext
:param Version version: Version that contains the resource
:returns: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationContext
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationContext
"""
super(BrandsInformationContext, self).__init__(version)
# Path Solution
self._solution = {}
self._uri = '/BrandsInformation'.format(**self._solution)
def fetch(self, if_none_match=values.unset):
"""
Fetch the BrandsInformationInstance
:param unicode if_none_match: Standard `If-None-Match` HTTP header
:returns: The fetched BrandsInformationInstance
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationInstance
"""
headers = values.of({'If-None-Match': if_none_match, })
payload = self._version.fetch(method='GET', uri=self._uri, headers=headers, )
return BrandsInformationInstance(self._version, payload, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
return '<Twilio.Preview.TrustedComms.BrandsInformationContext {}>'.format(context)
class BrandsInformationInstance(InstanceResource):
""" PLEASE NOTE that this class contains preview products that are subject
to change. Use them with caution. If you currently do not have developer
preview access, please contact help@twilio.com. """
def __init__(self, version, payload):
"""
Initialize the BrandsInformationInstance
:returns: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationInstance
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationInstance
"""
super(BrandsInformationInstance, self).__init__(version)
# Marshaled Properties
self._properties = {
'update_time': deserialize.iso8601_datetime(payload.get('update_time')),
'file_link': payload.get('file_link'),
'file_link_ttl_in_seconds': payload.get('file_link_ttl_in_seconds'),
'url': payload.get('url'),
}
# Context
self._context = None
self._solution = {}
@property
def _proxy(self):
"""
Generate an instance context for the instance, the context is capable of
performing various actions. All instance actions are proxied to the context
:returns: BrandsInformationContext for this BrandsInformationInstance
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationContext
"""
if self._context is None:
self._context = BrandsInformationContext(self._version, )
return self._context
@property
def update_time(self):
"""
:returns: Creation time of the information retrieved
:rtype: datetime
"""
return self._properties['update_time']
@property
def file_link(self):
"""
:returns: The URL to the brands information
:rtype: unicode
"""
return self._properties['file_link']
@property
def file_link_ttl_in_seconds(self):
"""
:returns: How long will be the `file_link` valid
:rtype: unicode
"""
return self._properties['file_link_ttl_in_seconds']
@property
def url(self):
"""
:returns: The URL of this resource
:rtype: unicode
"""
return self._properties['url']
def fetch(self, if_none_match=values.unset):
"""
Fetch the BrandsInformationInstance
:param unicode if_none_match: Standard `If-None-Match` HTTP header
:returns: The fetched BrandsInformationInstance
:rtype: twilio.rest.preview.trusted_comms.brands_information.BrandsInformationInstance
"""
return self._proxy.fetch(if_none_match=if_none_match, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
return '<Twilio.Preview.TrustedComms.BrandsInformationInstance {}>'.format(context)
| 34.342975 | 96 | 0.679461 | 837 | 8,311 | 6.549582 | 0.166069 | 0.055819 | 0.052718 | 0.074425 | 0.668004 | 0.649033 | 0.641007 | 0.612185 | 0.569318 | 0.551076 | 0 | 0.001255 | 0.233185 | 8,311 | 241 | 97 | 34.485477 | 0.858936 | 0.495247 | 0 | 0.314286 | 1 | 0 | 0.119104 | 0.082842 | 0 | 0 | 0 | 0 | 0 | 1 | 0.257143 | false | 0 | 0.085714 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
7a69b967fd4fe272f88237f204dac1419991d4fb | 117 | py | Python | server/learning/login/urls.py | kantanand/insmartapps | 4ab54bb41101e43b5edaac9795509584f01c5c92 | [
"MIT"
] | 3 | 2016-05-01T18:39:08.000Z | 2019-02-19T11:55:40.000Z | server/learning/login/urls.py | kantanand/insmartapps | 4ab54bb41101e43b5edaac9795509584f01c5c92 | [
"MIT"
] | 1 | 2016-04-28T16:41:24.000Z | 2016-06-11T19:11:14.000Z | server/learning/login/urls.py | kantanand/insmartapps | 4ab54bb41101e43b5edaac9795509584f01c5c92 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from login import views
urlpatterns = [
url(r'^$', views.index, name='home'),
] | 19.5 | 41 | 0.683761 | 17 | 117 | 4.705882 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162393 | 117 | 6 | 42 | 19.5 | 0.816327 | 0 | 0 | 0 | 0 | 0 | 0.050847 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
7a8dcc97cfb480e0204ea275bf860897bec39fc3 | 34 | py | Python | bzoing/share.py | marado/bzoing | 7d3ac9c36f23d89b692de2e2d8871c108b7d335d | [
"MIT"
] | 7 | 2017-01-12T18:25:39.000Z | 2021-06-30T11:56:07.000Z | bzoing/share.py | marado/bzoing | 7d3ac9c36f23d89b692de2e2d8871c108b7d335d | [
"MIT"
] | 20 | 2017-03-13T19:47:30.000Z | 2021-01-19T04:25:35.000Z | bzoing/share.py | marado/bzoing | 7d3ac9c36f23d89b692de2e2d8871c108b7d335d | [
"MIT"
] | 4 | 2017-07-16T05:39:32.000Z | 2020-09-30T23:22:43.000Z | tasklist = None
my_monitor = None
| 11.333333 | 17 | 0.764706 | 5 | 34 | 5 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 34 | 2 | 18 | 17 | 0.892857 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7a9363b2cf078e6aa15dc4babf04d9305d0349df | 158 | py | Python | pygamebook/SourceCode_PyGame/User Defined Functions/trivialfunction.py | satrapade/sofia | f8903eb48a88eb9575823b4fe9f61435b882cdd4 | [
"MIT"
] | null | null | null | pygamebook/SourceCode_PyGame/User Defined Functions/trivialfunction.py | satrapade/sofia | f8903eb48a88eb9575823b4fe9f61435b882cdd4 | [
"MIT"
] | 9 | 2018-06-18T11:17:44.000Z | 2018-06-19T21:00:48.000Z | pygamebook/SourceCode_PyGame/User Defined Functions/trivialfunction.py | satrapade/sofia | f8903eb48a88eb9575823b4fe9f61435b882cdd4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
def add(num1, num2):
return num1 + num2
print add(10, 5)
print add('sloan ', 'kelly')
print add(3.14, 1.61)
print add((1,2,3), (4,5,6)) | 15.8 | 28 | 0.613924 | 32 | 158 | 3.03125 | 0.625 | 0.329897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0.158228 | 158 | 10 | 29 | 15.8 | 0.586466 | 0.101266 | 0 | 0 | 0 | 0 | 0.077465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.666667 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
7aaca2e7fcf2fade3456711cd8963f5e6c2b9c4d | 234 | py | Python | src/create_flask_app/api/app/some_blueprint/routes.py | isakal/create_flask_app | 6ff35f6d1d670b20a4fa7d3aa2f441125b7aecde | [
"MIT"
] | 17 | 2019-12-18T12:41:35.000Z | 2022-03-17T22:38:12.000Z | src/create_flask_app/api/app/some_blueprint/routes.py | isakal/create_flask_app | 6ff35f6d1d670b20a4fa7d3aa2f441125b7aecde | [
"MIT"
] | 2 | 2020-03-15T11:17:05.000Z | 2021-01-26T23:07:46.000Z | src/create_flask_app/api/app/some_blueprint/routes.py | isakal/create_flask_app | 6ff35f6d1d670b20a4fa7d3aa2f441125b7aecde | [
"MIT"
] | 6 | 2020-06-09T14:36:54.000Z | 2022-03-17T22:13:53.000Z | from flask import Blueprint, jsonify
api = Blueprint('api', __name__)
@api.route("/")
def home():
return {"home": "page"}
@api.route("/<string:variable>")
def greeting(variable):
return {"hello": variable}
| 15.6 | 37 | 0.611111 | 26 | 234 | 5.346154 | 0.615385 | 0.115108 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209402 | 234 | 14 | 38 | 16.714286 | 0.751351 | 0 | 0 | 0 | 0 | 0 | 0.159091 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.25 | 0.625 | 0.25 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
7ab3b78ef740ec202ef067979278dcabfb3ae5f2 | 1,274 | py | Python | ezdisteach/lib/imscc/imsccfilebuilder.py | call-learning/ez-disteach | 7636dfdbfb709769824266800ebba18be764ecc3 | [
"MIT"
] | null | null | null | ezdisteach/lib/imscc/imsccfilebuilder.py | call-learning/ez-disteach | 7636dfdbfb709769824266800ebba18be764ecc3 | [
"MIT"
] | null | null | null | ezdisteach/lib/imscc/imsccfilebuilder.py | call-learning/ez-disteach | 7636dfdbfb709769824266800ebba18be764ecc3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
IMSCC File Builder
Produce an lxml entity ready to convert to text
"""
import io
def course_output_file(model, ioopen=io.open) -> None:
for item in model:
file_output(item, ioopen)
def section_output_file(model, ioopen=io.open) -> None:
for item in model:
file_output(item, ioopen)
def label_output_file(model, ioopen=io.open) -> None:
pass
def assessment_output_file(model, ioopen=io.open) -> None:
pass
def discussion_output_file(model, ioopen=io.open) -> None:
# Output the discussion.xml file
pass
def binaryfile_output_file(model, ioopen=io.open) -> None:
with ioopen(model.name, 'w') as f:
f.write(model.export())
def image_output_file(model, ioopen=io.open) -> None:
with ioopen(model.name, 'w') as f:
f.write(model.export())
def file_output(model, ioopen=io.open):
modelclassname = model.__class__.__name__
builderfunctname = '%s_output_file' % modelclassname.lower()
builderfunct = globals().get(builderfunctname, None)
if builderfunct:
return builderfunct(model, ioopen)
else:
raise NotImplementedError(
'cannot find file output builder function {} for {}'.format(builderfunctname, modelclassname))
| 24.5 | 106 | 0.681319 | 167 | 1,274 | 5.035928 | 0.353293 | 0.117717 | 0.123662 | 0.161712 | 0.464923 | 0.464923 | 0.464923 | 0.428062 | 0.428062 | 0.337693 | 0 | 0.000984 | 0.202512 | 1,274 | 51 | 107 | 24.980392 | 0.826772 | 0.094192 | 0 | 0.392857 | 0 | 0 | 0.058047 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.107143 | 0.035714 | 0 | 0.357143 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
8f909cdae723994e554369978e6cc97f4a98602c | 172 | py | Python | BOJ/13000~13999/13800~13899/13877.py | shinkeonkim/today-ps | f3e5e38c5215f19579bb0422f303a9c18c626afa | [
"Apache-2.0"
] | 2 | 2020-01-29T06:54:41.000Z | 2021-11-07T13:23:27.000Z | BOJ/13000~13999/13800~13899/13877.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | BOJ/13000~13999/13800~13899/13877.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | for case in range(int(input())):
a,b = input().split()
k = False
try:
print(a,int(b,8),int(b),int(b,16))
except:
print(a,0,int(b),int(b,16)) | 24.571429 | 42 | 0.505814 | 32 | 172 | 2.71875 | 0.53125 | 0.229885 | 0.16092 | 0.183908 | 0.229885 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047244 | 0.261628 | 172 | 7 | 43 | 24.571429 | 0.637795 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.285714 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8f9cadd05315c0a6dcf0e9ce19e102b8ba6ec07e | 28 | py | Python | src/catatumbo/core/__init__.py | MBizm/Catatumbo | 1494e8fd53a7096acc49d085a9eb9822df297473 | [
"Apache-2.0"
] | 2 | 2019-10-04T15:27:09.000Z | 2020-04-27T14:20:29.000Z | src/catatumbo/core/__init__.py | MBizm/Catatumbo | 1494e8fd53a7096acc49d085a9eb9822df297473 | [
"Apache-2.0"
] | 13 | 2019-12-28T01:31:12.000Z | 2020-11-16T09:36:05.000Z | src/catatumbo/core/__init__.py | MBizm/Catatumbo | 1494e8fd53a7096acc49d085a9eb9822df297473 | [
"Apache-2.0"
] | 3 | 2020-04-29T17:01:10.000Z | 2020-11-16T07:25:48.000Z | __all__ = ["NeoPixelColors"] | 28 | 28 | 0.75 | 2 | 28 | 8.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 28 | 1 | 28 | 28 | 0.653846 | 0 | 0 | 0 | 0 | 0 | 0.482759 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8fa316264e67e68643ee75008d6b3c26e94699e0 | 253 | py | Python | control_codes.py | SreeHarshaNelaturu/runway-transformers-CTRL | a7f38ed8999eac90f0e17185ec5e7d138f0ddb9f | [
"Apache-2.0"
] | null | null | null | control_codes.py | SreeHarshaNelaturu/runway-transformers-CTRL | a7f38ed8999eac90f0e17185ec5e7d138f0ddb9f | [
"Apache-2.0"
] | null | null | null | control_codes.py | SreeHarshaNelaturu/runway-transformers-CTRL | a7f38ed8999eac90f0e17185ec5e7d138f0ddb9f | [
"Apache-2.0"
] | null | null | null | CONTROL_CODES = {
"Questions": 456,
"Funny": 58917,
"Gaming": 40358,
"Movies": 46273,
"Science": 2090,
"Politics": 16360,
"Technologies": 32516,
"Books": 6665,
"Links": 63674,
"Reviews": 41671,
"News": 4256
}
| 18.071429 | 26 | 0.541502 | 24 | 253 | 5.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.273224 | 0.27668 | 253 | 13 | 27 | 19.461538 | 0.469945 | 0 | 0 | 0 | 0 | 0 | 0.29249 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 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 | 3 |
8fb9bcc594037c317be9de793989951eff153fd5 | 179 | py | Python | civic_scraper/scrapers/__init__.py | DiPierro/civic-scraper | de3b41f6b1609b68be75d2223f4d0c8061267246 | [
"Apache-2.0"
] | null | null | null | civic_scraper/scrapers/__init__.py | DiPierro/civic-scraper | de3b41f6b1609b68be75d2223f4d0c8061267246 | [
"Apache-2.0"
] | null | null | null | civic_scraper/scrapers/__init__.py | DiPierro/civic-scraper | de3b41f6b1609b68be75d2223f4d0c8061267246 | [
"Apache-2.0"
] | null | null | null | from .site import Site
from .civicplus import CivicPlusSite
from .granicus import GranicusSite
SUPPORTED_SITES = {
'granicus': GranicusSite,
'civicplus': CivicPlusSite,
} | 22.375 | 36 | 0.765363 | 18 | 179 | 7.555556 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156425 | 179 | 8 | 37 | 22.375 | 0.900662 | 0 | 0 | 0 | 0 | 0 | 0.094444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
8fc4cecc84d6adcbf94bcf44dcce76669aaebe2d | 478 | py | Python | accounts/models.py | ejolie/movie | 6cfa5d02378c216e9cf031c26d2752f029b6c010 | [
"MIT"
] | 5 | 2019-05-14T04:30:33.000Z | 2019-05-18T07:36:07.000Z | accounts/models.py | ejolie/movie | 6cfa5d02378c216e9cf031c26d2752f029b6c010 | [
"MIT"
] | 2 | 2020-06-05T20:47:28.000Z | 2021-06-10T21:27:10.000Z | accounts/models.py | ejolie/movie | 6cfa5d02378c216e9cf031c26d2752f029b6c010 | [
"MIT"
] | 2 | 2019-09-17T07:45:08.000Z | 2020-08-28T14:59:31.000Z | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
class User(AbstractUser):
from_user = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name="to_user")
def get_score(self):
return round(self.ratings.aggregate(models.Avg('score'))['score__avg'], 2)
def get_recommend(self):
return self.ratings.order_by('-score').first()
def __str__(self):
return self.username
| 28.117647 | 88 | 0.730126 | 64 | 478 | 5.234375 | 0.515625 | 0.089552 | 0.083582 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002488 | 0.158996 | 478 | 16 | 89 | 29.875 | 0.830846 | 0 | 0 | 0 | 0 | 0 | 0.058577 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.272727 | 0.272727 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
8fdc77f56f8c8adbfa20a7252c3438a08642f3a4 | 934 | py | Python | tools/leetcode.143.Reorder List/leetcode.143.Reorder List.submission9.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | 4 | 2015-10-10T00:30:55.000Z | 2020-07-27T19:45:54.000Z | tools/leetcode.143.Reorder List/leetcode.143.Reorder List.submission9.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | tools/leetcode.143.Reorder List/leetcode.143.Reorder List.submission9.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param {ListNode} head
# @return {void} Do not return anything, modify head in-place instead.
def reorderList(self, head):
if not head: return
if not head.next: return
nodes = []
temp = head
while temp:
nodes.append(temp)
temp = temp.next
length = len(nodes)
temp = [None] * length
if length%2:
temp[::2] = nodes[:length//2+1]
temp[1::2] = nodes[length//2+1:][::-1]
else:
temp[::2] = nodes[:length//2]
temp[1::2] = nodes[length//2:][::-1]
nodes = temp
pos = 1
while pos < length:
nodes[pos-1].next = nodes[pos]
pos += 1
nodes[pos-1].next = None
| 934 | 934 | 0.481799 | 113 | 934 | 3.946903 | 0.336283 | 0.078475 | 0.107623 | 0.116592 | 0.163677 | 0.085202 | 0.085202 | 0 | 0 | 0 | 0 | 0.033043 | 0.384368 | 934 | 1 | 934 | 934 | 0.742609 | 0.976445 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.043478 | false | 0 | 0 | 0 | 0.086957 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8ff8cf529d3b25790ac72afa6ba74a58b9621d31 | 720 | py | Python | 0-python-tutorial/09-operators08-bitwise03.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | 0-python-tutorial/09-operators08-bitwise03.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | 0-python-tutorial/09-operators08-bitwise03.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | # Demo Python Operators
'''
Python Bitwise Operators
~ NOT Inverts all the bits
'''
a = 60
b = 13
variable1 = ~a
variable2 = ~b
print("Variable 'a': ", a, "Variable 'a' en binario: ", format(a, 'b'))
print("Procesando '~a': ", variable1, "Resultado en binario: ", format(variable1, 'b'))
print("Variable 'b': ", b, "Variable 'b' en binario: ", format(b, 'b'))
print("Procesando '~b': ", variable2, "Resultado en binario: ", format(variable2, 'b'))
print("Procesando 'a & b': ", a&b, "Resultado en binario: ", format(a&b, 'b'))
print("Procesando 'a | b': ", a|b, "Resultado en binario: ", format(a|b, 'b'))
print("Procesando 'a ^ b': ", a^b, "Resultado en binario: ", format(a^b, 'b'))
| 28.8 | 87 | 0.590278 | 100 | 720 | 4.25 | 0.22 | 0.047059 | 0.247059 | 0.282353 | 0.367059 | 0.327059 | 0.327059 | 0.327059 | 0.327059 | 0.327059 | 0 | 0.017241 | 0.194444 | 720 | 24 | 88 | 30 | 0.715517 | 0.151389 | 0 | 0 | 0 | 0 | 0.476112 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.636364 | 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 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
8fff417bb2a35dd2af5bd1c303692887ce88c5e5 | 66 | py | Python | tests/__init__.py | collectiveacuity/jsonModel | 64aa8127f2a0d26e6bff27f70bbcdde8f6a2835b | [
"MIT"
] | 2 | 2016-02-17T20:50:39.000Z | 2017-06-20T15:34:32.000Z | tests/__init__.py | collectiveacuity/jsonModel | 64aa8127f2a0d26e6bff27f70bbcdde8f6a2835b | [
"MIT"
] | null | null | null | tests/__init__.py | collectiveacuity/jsonModel | 64aa8127f2a0d26e6bff27f70bbcdde8f6a2835b | [
"MIT"
] | null | null | null | __author__ = 'rcj1492'
__created__ = '2016.02'
__license__ = 'MIT' | 22 | 23 | 0.727273 | 7 | 66 | 5.142857 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172414 | 0.121212 | 66 | 3 | 24 | 22 | 0.448276 | 0 | 0 | 0 | 0 | 0 | 0.253731 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
890f2b51c60c3ae89e15389064fecd83f7930ef7 | 181 | py | Python | ecs/scratchpad/forms.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 9 | 2017-02-13T18:17:13.000Z | 2020-11-21T20:15:54.000Z | ecs/scratchpad/forms.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 2 | 2021-05-20T14:26:47.000Z | 2021-05-20T14:26:48.000Z | ecs/scratchpad/forms.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 4 | 2017-04-02T18:48:59.000Z | 2021-11-23T15:40:35.000Z | from django import forms
from ecs.scratchpad.models import ScratchPad
class ScratchPadForm(forms.ModelForm):
class Meta:
model = ScratchPad
fields = ('text',)
| 20.111111 | 44 | 0.701657 | 20 | 181 | 6.35 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.220994 | 181 | 8 | 45 | 22.625 | 0.900709 | 0 | 0 | 0 | 0 | 0 | 0.022099 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
64e5cb2f12494c402629102fa0444b71af4c9e8d | 1,006 | py | Python | bnpy/datasets/zzz_unsupported/StandardNormalK1.py | jun2tong/bnp-anomaly | c7fa106b5bb29ed6688a3d91e3f302a0a130b896 | [
"BSD-3-Clause"
] | 184 | 2016-12-13T21:05:48.000Z | 2022-02-28T11:47:23.000Z | bnpy/datasets/zzz_unsupported/StandardNormalK1.py | jun2tong/bnp-anomaly | c7fa106b5bb29ed6688a3d91e3f302a0a130b896 | [
"BSD-3-Clause"
] | 37 | 2016-12-18T14:07:53.000Z | 2022-03-13T10:58:14.000Z | bnpy/datasets/zzz_unsupported/StandardNormalK1.py | jun2tong/bnp-anomaly | c7fa106b5bb29ed6688a3d91e3f302a0a130b896 | [
"BSD-3-Clause"
] | 50 | 2017-01-25T19:44:34.000Z | 2022-03-15T10:22:01.000Z | '''
StandardNormalK1.py
Simple toy dataset from standard normal distribution.
'''
import numpy as np
from bnpy.data import XData
def get_data(seed=8675309, nObsTotal=25000, **kwargs):
''' Create and return toy dataset from 1D standard normal distribution.
Args
-------
seed : integer seed for random number generator,
used for actually *generating* the data
nObsTotal : total number of observations for the dataset.
Returns
-------
Data : bnpy XData object, with nObsTotal observations
'''
X, TrueZ = generate_data(seed, nObsTotal)
Data = XData(X=X, TrueZ=TrueZ)
Data.name = get_short_name()
Data.summary = get_data_info()
return Data
def get_data_info():
return 'Standard Normal Data. All from one true cluster.'
def get_short_name():
return "StandardNormalK1"
def generate_data(seed, nObsTotal):
PRNG = np.random.RandomState(seed)
X = PRNG.randn(nObsTotal, 1)
TrueZ = np.ones(nObsTotal)
return X, TrueZ
| 22.355556 | 75 | 0.686879 | 131 | 1,006 | 5.19084 | 0.450382 | 0.061765 | 0.041176 | 0.073529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020305 | 0.2167 | 1,006 | 44 | 76 | 22.863636 | 0.84264 | 0.375746 | 0 | 0 | 0 | 0 | 0.110919 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0 | 0.117647 | 0.117647 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
64f4ed4a482b455825429f140a47289347e72d8a | 1,731 | py | Python | common/src/plugins/__init__.py | krisshol/bach-kmno | f40d85b3397bb340e26a671c54d4a753dbbb0d43 | [
"Apache-2.0"
] | 248 | 2015-01-08T09:36:44.000Z | 2022-01-12T10:29:21.000Z | common/src/plugins/__init__.py | krisshol/bach-kmno | f40d85b3397bb340e26a671c54d4a753dbbb0d43 | [
"Apache-2.0"
] | 50 | 2015-01-09T08:31:57.000Z | 2022-03-30T10:41:13.000Z | common/src/plugins/__init__.py | krisshol/bach-kmno | f40d85b3397bb340e26a671c54d4a753dbbb0d43 | [
"Apache-2.0"
] | 74 | 2015-01-05T09:11:21.000Z | 2022-03-29T02:16:54.000Z | from irma.common.plugins.plugin import PluginBase
from irma.common.plugins.plugin import PluginMetaClass
from irma.common.plugins.manager import PluginManager
from irma.common.plugins.exceptions import PluginError
from irma.common.plugins.exceptions import PluginLoadError
from irma.common.plugins.exceptions import PluginFormatError
from irma.common.plugins.exceptions import PluginCrashed
from irma.common.plugins.exceptions import DependencyMissing
from irma.common.plugins.exceptions import ModuleDependencyMissing
from irma.common.plugins.exceptions import BinaryDependencyMissing
from irma.common.plugins.exceptions import FileDependencyMissing
from irma.common.plugins.exceptions import FolderDependencyMissing
from irma.common.plugins.exceptions import PlatformDependencyMissing
from irma.common.plugins.dependencies import Dependency
from irma.common.plugins.dependencies import ModuleDependency
from irma.common.plugins.dependencies import BinaryDependency
from irma.common.plugins.dependencies import FileDependency
from irma.common.plugins.dependencies import FolderDependency
from irma.common.plugins.dependencies import PlatformDependency
__all__ = [
# from plugin.py
'PluginBase',
'PluginMetaClass',
# from manager.py
'PluginManager',
# from exception.py
'PluginError',
'PluginLoadError',
'PluginFormatError',
'PluginCrashed',
'DependencyMissing',
'ModuleDependencyMissing',
'BinaryDependencyMissing',
'FileDependencyMissing',
'FolderDependencyMissing',
'PlatformDependencyMissing',
# from dependency.py
'Dependency',
'ModuleDependency',
'BinaryDependency',
'FileDependency',
'FolderDependency',
'PlatformDependency',
]
| 35.326531 | 68 | 0.808203 | 165 | 1,731 | 8.454545 | 0.187879 | 0.108961 | 0.190681 | 0.286022 | 0.480287 | 0.480287 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119584 | 1,731 | 48 | 69 | 36.0625 | 0.915354 | 0.038706 | 0 | 0 | 0 | 0 | 0.190476 | 0.069319 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.475 | 0 | 0.475 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
64f819eba5fc083ede53de05b85e42707d3caf74 | 1,192 | py | Python | Modulo_construcao_regras/Frase_pt.py | mattgoncalves/PE2LGP | dc74d496637217170b5287ca877d86e2e18068ab | [
"MIT"
] | 1 | 2021-12-16T13:13:19.000Z | 2021-12-16T13:13:19.000Z | PE2LGP/Modulo_construcao_regras/Frase_pt.py | ineslacerda/PE2LGP-Translator | 6ff22da887444d8be6cd50b3c3cdc3ce5bd2449a | [
"MIT"
] | null | null | null | PE2LGP/Modulo_construcao_regras/Frase_pt.py | ineslacerda/PE2LGP-Translator | 6ff22da887444d8be6cd50b3c3cdc3ce5bd2449a | [
"MIT"
] | 2 | 2021-03-27T10:59:28.000Z | 2021-12-16T11:51:43.000Z | class Frase_pt:
#informações com as dependências da frase em português e das classes gramaticais.
def __init__(self, frase_pt= ""):
self.frase_pt = frase_pt
self.lemmas = {}
self.classes_gramaticais = {}
self.analise_sintatica = {}
def append_classes_gramaticais(self, glosa, classe):
self.classes_gramaticais[glosa] = classe
def append_analise_sintatica(self, glosa, classe):
self.analise_sintatica[glosa] = classe
def append_lemmas(self, glosa, lemma):
self.lemmas[glosa] = lemma
def converter_classes_gramaticais(self):
for k,v in self.classes_gramaticais.items():
if v.startswith( 'V'):
self.classes_gramaticais[k]="V"
if v.startswith( 'N'):
self.classes_gramaticais[k]="N"
if v.startswith( 'AQ') or v.startswith( 'AO'):
self.classes_gramaticais[k]="ADJ"
if v.startswith( 'R'):
self.classes_gramaticais[k]="ADV"
if v.startswith( 'C'):
self.classes_gramaticais[k]="CONJ"
if v.startswith( 'Z'):
self.classes_gramaticais[k]="NUM"
if v.startswith( 'I'):
self.classes_gramaticais[k]="INT"
if v.startswith( 'P'):
self.classes_gramaticais[k]="PRO"
if v.startswith( 'D'):
self.classes_gramaticais[k]="DET" | 30.564103 | 82 | 0.698826 | 165 | 1,192 | 4.872727 | 0.29697 | 0.335821 | 0.328358 | 0.257463 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15604 | 1,192 | 39 | 83 | 30.564103 | 0.799205 | 0.067114 | 0 | 0 | 0 | 0 | 0.032374 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.15625 | false | 0 | 0 | 0 | 0.1875 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8f0b38a7be3883ab570ebdb5fd63d7f0c704c7d9 | 340 | py | Python | array/shuffle_the_array.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/shuffle_the_array.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/shuffle_the_array.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | def shuffle(nums, n):
shuffled_array = []
i = 0
while len(shuffled_array) < len(nums):
shuffled_array.append(nums[i])
shuffled_array.append(nums[i + n])
i += 1
return shuffled_array
print(shuffle([2, 5, 1, 3, 4, 7], 3))
print(shuffle([1, 2, 3, 4, 4, 3, 2, 1], 4))
print(shuffle([1, 1, 2, 2], 2))
| 21.25 | 43 | 0.558824 | 57 | 340 | 3.245614 | 0.333333 | 0.351351 | 0.205405 | 0.248649 | 0.259459 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0.255882 | 340 | 15 | 44 | 22.666667 | 0.640316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0 | 0 | 0.181818 | 0.272727 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8f104b5661836f5be7edc0ffb289f0055a1c9b2f | 2,265 | py | Python | api/models.py | DominikWolek/survey | 358794ea1ed81ba7ba2ffe4a0897d9867455cf31 | [
"MIT"
] | null | null | null | api/models.py | DominikWolek/survey | 358794ea1ed81ba7ba2ffe4a0897d9867455cf31 | [
"MIT"
] | null | null | null | api/models.py | DominikWolek/survey | 358794ea1ed81ba7ba2ffe4a0897d9867455cf31 | [
"MIT"
] | null | null | null | import datetime
from django.db import models
from django.contrib.postgres.fields import ArrayField
from django.utils import timezone
class Survey(models.Model):
name = models.CharField(max_length=200)
def __str__(self):
return self.name
def questions(self):
return self.question_set
class Question(models.Model):
value = models.CharField(max_length=200)
answer_type = models.CharField(max_length=20, default='single_select')
survey = models.ForeignKey(Survey, on_delete=models.CASCADE)
def __str__(self):
return self.value
def answers(self):
return self.answer_set
class Answer(models.Model):
value = models.CharField(max_length=200)
question = models.ForeignKey(Question, on_delete=models.CASCADE)
votes = models.IntegerField(default=0)
def __str__(self):
return self.value
class Day(models.Model):
day = models.DateField('Day', default = timezone.localdate)
def __str__(self):
return str(self.day)
def rooms(self):
return self.place_set
class Place(models.Model):
day = models.ForeignKey(Day, on_delete=models.CASCADE)
room = models.CharField(max_length=100)
def __str__(self):
return str(self.room) + ' ' + str(self.day)
def lectures(self):
return self.lecture_set
class Lecture(models.Model):
name = models.CharField(max_length=200)
start_time = models.TimeField('Start time of lecture', default=timezone.localtime)
end_time = models.TimeField('End time of lecture', default=(timezone.localtime))
room = models.ForeignKey(Place, on_delete=models.CASCADE)
speaker = models.CharField(max_length=200)
rates = ArrayField(base_field=models.SmallIntegerField(blank=False), size=5, default=list([0 for x in range(5)]))
def __str__(self):
return self.name
def attendance(self):
return sum(self.rates)
def average_rate(self):
if self.attendance() == 0:
return 0
sum_of_rates = 0
for i in range(len(self.rates)):
sum_of_rates += (i + 1) * self.rates[i]
return sum_of_rates / self.attendance()
def rate_lecture(self, rate):
self.rates[rate - 1] += 1
| 26.964286 | 117 | 0.671082 | 294 | 2,265 | 4.993197 | 0.268707 | 0.074932 | 0.076294 | 0.114441 | 0.286785 | 0.268392 | 0.152589 | 0.115804 | 0 | 0 | 0 | 0.017007 | 0.221192 | 2,265 | 83 | 118 | 27.289157 | 0.815193 | 0 | 0 | 0.245614 | 0 | 0 | 0.025166 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.22807 | false | 0 | 0.070175 | 0.192982 | 0.912281 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
8f10cb27e5a5f26016387bdf0a6b631a9bfd71b3 | 92 | py | Python | my_PP4E/system/adder3.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | my_PP4E/system/adder3.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | my_PP4E/system/adder3.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | import sys
sum_int = 0
for line_str in sys.stdin: sum_int += int(line_str)
print(sum_int)
| 13.142857 | 51 | 0.73913 | 19 | 92 | 3.315789 | 0.578947 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012987 | 0.163043 | 92 | 6 | 52 | 15.333333 | 0.805195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
8f2505c47e5671579a2268dd78cbe3bc9dc699e6 | 448 | py | Python | mytest.py | qxcross/tdd-practice | 72d58bf99ab02decc570649fd8995f8a9ccb0d4f | [
"MIT"
] | null | null | null | mytest.py | qxcross/tdd-practice | 72d58bf99ab02decc570649fd8995f8a9ccb0d4f | [
"MIT"
] | null | null | null | mytest.py | qxcross/tdd-practice | 72d58bf99ab02decc570649fd8995f8a9ccb0d4f | [
"MIT"
] | null | null | null | import unittest
from practice import *
class myFirstTests(unittest.TestCase):
def test_hello(self):
self.assertEqual(hello_world(),'hello world')
def test_sorted(self):
self.assertEqual(sorted_list(list(range(0,11))),[0,1,2,3,4,5,6,7,8,9,10])
def test_even(self):
self.assertEqual(even_num(4),True)
def test_sorted_type(self):
self.assertEqual(type(sorted_list([0,1,2,3])),list)
unittest.main() | 24.888889 | 81 | 0.676339 | 69 | 448 | 4.26087 | 0.478261 | 0.095238 | 0.258503 | 0.027211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.053619 | 0.167411 | 448 | 18 | 82 | 24.888889 | 0.734584 | 0 | 0 | 0 | 0 | 0 | 0.024499 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.333333 | false | 0 | 0.166667 | 0 | 0.583333 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8f51187c7b29e504944fcdf736e1d835859086bf | 392 | py | Python | usaco/january-2021/bronze/problem-1/problem-1.py | Yash-Singh1/competitive-programming | 3b9d278ed8138ab614e2a3d748627db8f4a2cdbd | [
"MIT"
] | 1 | 2021-04-25T21:58:57.000Z | 2021-04-25T21:58:57.000Z | usaco/january-2021/bronze/problem-1/problem-1.py | Yash-Singh1/competitive-programming | 3b9d278ed8138ab614e2a3d748627db8f4a2cdbd | [
"MIT"
] | null | null | null | usaco/january-2021/bronze/problem-1/problem-1.py | Yash-Singh1/competitive-programming | 3b9d278ed8138ab614e2a3d748627db8f4a2cdbd | [
"MIT"
] | null | null | null | cowphabet = raw_input()
duplicated_cowphabet = cowphabet
heard = raw_input()
amount = 1
for char in heard:
if char in duplicated_cowphabet:
duplicated_cowphabet = duplicated_cowphabet[duplicated_cowphabet.find(char) + 1:]
else:
duplicated_cowphabet += cowphabet
amount += 1
duplicated_cowphabet = duplicated_cowphabet[duplicated_cowphabet.find(char) + 1:]
print(amount)
| 26.133333 | 85 | 0.762755 | 46 | 392 | 6.26087 | 0.304348 | 0.59375 | 0.503472 | 0.659722 | 0.524306 | 0.524306 | 0.458333 | 0.458333 | 0.458333 | 0 | 0 | 0.012048 | 0.153061 | 392 | 14 | 86 | 28 | 0.855422 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.083333 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8f68e760e629e6c9289a968b529c8bbdbfa66448 | 1,281 | py | Python | configs/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_02_benchvise.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 33 | 2021-12-15T07:11:47.000Z | 2022-03-29T08:58:32.000Z | configs/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_02_benchvise.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 3 | 2021-12-15T11:39:54.000Z | 2022-03-29T07:24:23.000Z | configs/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_02_benchvise.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | null | null | null | _base_ = ["./FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_01_ape.py"]
OUTPUT_DIR = "output/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/benchvise"
DATASETS = dict(TRAIN=("lm_pbr_benchvise_train",), TEST=("lm_real_benchvise_test",))
# bbnc7
# objects benchvise Avg(1)
# ad_2 9.12 9.12
# ad_5 44.52 44.52
# ad_10 90.69 90.69
# rete_2 45.97 45.97
# rete_5 99.71 99.71
# rete_10 100.00 100.00
# re_2 63.43 63.43
# re_5 99.71 99.71
# re_10 100.00 100.00
# te_2 77.40 77.40
# te_5 100.00 100.00
# te_10 100.00 100.00
# proj_2 75.75 75.75
# proj_5 99.22 99.22
# proj_10 100.00 100.00
# re 1.80 1.80
# te 0.01 0.01
# init by mlBCE
# objects benchvise Avg(1)
# ad_2 9.21 9.21
# ad_5 44.52 44.52
# ad_10 90.79 90.79
# rete_2 46.46 46.46
# rete_5 99.52 99.52
# rete_10 100.00 100.00
# re_2 64.31 64.31
# re_5 99.52 99.52
# re_10 100.00 100.00
# te_2 77.50 77.50
# te_5 100.00 100.00
# te_10 100.00 100.00
# proj_2 75.85 75.85
# proj_5 99.22 99.22
# proj_10 100.00 100.00
# re 1.80 1.80
# te 0.01 0.01
| 27.255319 | 89 | 0.540984 | 245 | 1,281 | 2.632653 | 0.257143 | 0.155039 | 0.124031 | 0.155039 | 0.545736 | 0.489922 | 0.489922 | 0.415504 | 0.356589 | 0.244961 | 0 | 0.400718 | 0.347385 | 1,281 | 46 | 90 | 27.847826 | 0.370813 | 0.750195 | 0 | 0 | 0 | 0 | 0.594306 | 0.594306 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8f783f3db1a5b9213fb73a1f97a44919aad8d34c | 175 | py | Python | RecommenderSystem/Book.py | RowanOmar/Recommender-System | 60c8299610f4bc5ccc7254b1e05ed6228947118c | [
"MIT"
] | null | null | null | RecommenderSystem/Book.py | RowanOmar/Recommender-System | 60c8299610f4bc5ccc7254b1e05ed6228947118c | [
"MIT"
] | null | null | null | RecommenderSystem/Book.py | RowanOmar/Recommender-System | 60c8299610f4bc5ccc7254b1e05ed6228947118c | [
"MIT"
] | null | null | null | class Book:
Title = ""
Rate = 0
def __init__(self, title, rate):
self.Title = title
self.Rate = rate
# print ("I am new ", self.Title)
| 14.583333 | 41 | 0.508571 | 22 | 175 | 3.863636 | 0.545455 | 0.317647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009091 | 0.371429 | 175 | 11 | 42 | 15.909091 | 0.763636 | 0.177143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8f787cfd457d65b0d4fa5d03424c02511129986f | 109 | py | Python | fluxio_parser/__init__.py | NarrativeScience/fluxio-parser | bddd6b86a550ec87a58a2d854978d559e29cf3f4 | [
"BSD-3-Clause"
] | 1 | 2021-06-09T20:22:38.000Z | 2021-06-09T20:22:38.000Z | fluxio_parser/__init__.py | NarrativeScience/fluxio-parser | bddd6b86a550ec87a58a2d854978d559e29cf3f4 | [
"BSD-3-Clause"
] | null | null | null | fluxio_parser/__init__.py | NarrativeScience/fluxio-parser | bddd6b86a550ec87a58a2d854978d559e29cf3f4 | [
"BSD-3-Clause"
] | 1 | 2021-06-09T20:22:39.000Z | 2021-06-09T20:22:39.000Z | """Main exports"""
from fluxio_parser.parser import parse_project_tree # noqa: F401
__version__ = "0.3.1"
| 18.166667 | 65 | 0.733945 | 16 | 109 | 4.5625 | 0.9375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06383 | 0.137615 | 109 | 5 | 66 | 21.8 | 0.712766 | 0.220183 | 0 | 0 | 0 | 0 | 0.063291 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
56bfc33a7af917c5815e0bac91e9b07e0bede4f2 | 247 | py | Python | ex016-Descubra a Hipotenusa.py | Mathelzu/PythonExercicios | 9bb3f4ce97818fd4f0cb296c262818d7b1c76adb | [
"Apache-2.0"
] | null | null | null | ex016-Descubra a Hipotenusa.py | Mathelzu/PythonExercicios | 9bb3f4ce97818fd4f0cb296c262818d7b1c76adb | [
"Apache-2.0"
] | null | null | null | ex016-Descubra a Hipotenusa.py | Mathelzu/PythonExercicios | 9bb3f4ce97818fd4f0cb296c262818d7b1c76adb | [
"Apache-2.0"
] | null | null | null | import math
catOp = float(input('Valor Cateto Oposto: '))
catAd = float (input('Valor Cateto adjacente: '))
hip = (catOp**2) + (catAd**2)
# ou hip = math.hypot (catOp , catAd)
hip2 = math.sqrt(hip)
print (f'O valor da hipotenusa é de {hip2:.2f}')
| 30.875 | 49 | 0.663968 | 39 | 247 | 4.205128 | 0.615385 | 0.121951 | 0.182927 | 0.256098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024038 | 0.157895 | 247 | 7 | 50 | 35.285714 | 0.764423 | 0.1417 | 0 | 0 | 0 | 0 | 0.390476 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.166667 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
56cf21dd91586a112ff72573b3ee25e290d3bbe0 | 5,141 | py | Python | kra/analytics/container.py | smpio/kube-resource-analyzer | d214b7c32bc5e404ac951f66cf0914fcae1f580f | [
"MIT"
] | null | null | null | kra/analytics/container.py | smpio/kube-resource-analyzer | d214b7c32bc5e404ac951f66cf0914fcae1f580f | [
"MIT"
] | 50 | 2021-05-26T14:15:09.000Z | 2021-07-24T12:08:14.000Z | kra/analytics/container.py | smpio/kube-resource-analyzer | d214b7c32bc5e404ac951f66cf0914fcae1f580f | [
"MIT"
] | null | null | null | from kra import models
def get_containers_summary(container_ids=None):
if container_ids is not None:
container_ids_str = ','.join(str(cid) for cid in container_ids)
container_filter = f'AND id IN ({container_ids_str})'
else:
container_filter = ''
return models.Container.objects.raw(r"""
SELECT
*
FROM %(container_tblname)s AS c
LEFT JOIN LATERAL (
SELECT * FROM (
SELECT
since,
till,
total_seconds,
total_cpu_m_seconds,
max_memory_mi,
max_cpu_m,
total_memory_mi_seconds,
(total_memory_mi_seconds / total_seconds) AS avg_memory_mi,
(total_cpu_m_seconds / total_seconds) AS avg_cpu_m
FROM (
SELECT
*,
extract(epoch FROM (till - since)) AS total_seconds
FROM (
SELECT
c.started_at AS since,
max(measured_at) AS till,
max(cpu_m) AS max_cpu_m,
max(cpu_m_seconds) AS total_cpu_m_seconds,
max(memory_mi) AS max_memory_mi,
sum(delta_memory_mi_seconds) AS total_memory_mi_seconds
FROM (
SELECT
*,
memory_mi * delta_seconds AS delta_memory_mi_seconds,
delta_cpu_m_seconds / delta_seconds AS cpu_m
FROM (
SELECT
measured_at,
cpu_m_seconds,
memory_mi,
(
CASE
WHEN lag(measured_at) OVER w IS NOT NULL
THEN extract(epoch FROM (measured_at - lag(measured_at) OVER w))
ELSE extract(epoch FROM (measured_at - c.started_at))
END
) AS delta_seconds,
(
CASE
WHEN lag(cpu_m_seconds) OVER w IS NOT NULL
THEN cpu_m_seconds - lag(cpu_m_seconds) OVER w
ELSE cpu_m_seconds
END
) AS delta_cpu_m_seconds
FROM %(ru_tblname)s
WHERE container_id = c.id
WINDOW w AS (ORDER BY measured_at)
) AS pass1q0
) AS pass1q1
) AS pass1q2
) AS pass1q3
) AS pass1
LEFT JOIN LATERAL (
SELECT
sqrt(total_stddev_memory_mi2_seconds / total_seconds) AS stddev_memory_mi,
sqrt(total_stddev_cpu_m2_seconds / total_seconds) AS stddev_cpu_m
FROM (
SELECT
sum(stddev_memory_mi2_seconds) AS total_stddev_memory_mi2_seconds,
sum(stddev_cpu_m2_seconds) AS total_stddev_cpu_m2_seconds
FROM (
SELECT
((memory_mi - avg_memory_mi)^2 * delta_seconds) AS stddev_memory_mi2_seconds,
((delta_cpu_m_seconds / delta_seconds - avg_cpu_m)^2 * delta_seconds) AS stddev_cpu_m2_seconds
FROM (
SELECT
cpu_m_seconds,
memory_mi,
(
CASE
WHEN lag(measured_at) OVER w IS NOT NULL
THEN extract(epoch FROM (measured_at - lag(measured_at) OVER w))
ELSE extract(epoch FROM (measured_at - c.started_at))
END
) AS delta_seconds,
(
CASE
WHEN lag(cpu_m_seconds) OVER w IS NOT NULL
THEN cpu_m_seconds - lag(cpu_m_seconds) OVER w
ELSE cpu_m_seconds
END
) AS delta_cpu_m_seconds
FROM %(ru_tblname)s
WHERE container_id = c.id
WINDOW w AS (ORDER BY measured_at)
) AS pass2q0
) AS pass2q1
) AS pass2q2
) AS pass2 ON TRUE
) AS summary ON TRUE
WHERE total_seconds IS NOT NULL %(container_filter)s
""" % {
'container_tblname': models.Container._meta.db_table,
'ru_tblname': models.ResourceUsage._meta.db_table,
'container_filter': container_filter,
})
| 44.704348 | 118 | 0.428321 | 485 | 5,141 | 4.195876 | 0.175258 | 0.04914 | 0.097297 | 0.041278 | 0.542506 | 0.408845 | 0.381327 | 0.320393 | 0.320393 | 0.320393 | 0 | 0.010717 | 0.528107 | 5,141 | 114 | 119 | 45.096491 | 0.828112 | 0 | 0 | 0.495496 | 0 | 0 | 0.915775 | 0.080918 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009009 | false | 0.081081 | 0.009009 | 0 | 0.027027 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
56ee82e7574951e2d9ede6d10b02540ba09cf793 | 68 | py | Python | src/traits/__init__.py | 5monkeys/django-traits | 206c91f2738974fe5df0a12a7e94f1ba1dd28f39 | [
"BSD-3-Clause"
] | null | null | null | src/traits/__init__.py | 5monkeys/django-traits | 206c91f2738974fe5df0a12a7e94f1ba1dd28f39 | [
"BSD-3-Clause"
] | 2 | 2021-10-07T18:14:13.000Z | 2021-10-07T20:30:49.000Z | src/traits/__init__.py | 5monkeys/django-traits | 206c91f2738974fe5df0a12a7e94f1ba1dd28f39 | [
"BSD-3-Clause"
] | null | null | null | from .base import Trait
__version__ = "0.0.1"
__all__ = ("Trait",)
| 13.6 | 23 | 0.661765 | 10 | 68 | 3.7 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 0.161765 | 68 | 4 | 24 | 17 | 0.596491 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
56fb6798738db165da7424a3d5f66f0c90904f19 | 98 | py | Python | pygame_rl/scenario/soccer/teams.py | sc420/pygame-rl | f81da559385876616d99c74b43e4345f53d086d2 | [
"MIT"
] | 6 | 2019-02-18T09:34:34.000Z | 2021-11-09T06:58:02.000Z | pygame_rl/scenario/soccer/teams.py | ebola777/pygame-soccer | f81da559385876616d99c74b43e4345f53d086d2 | [
"MIT"
] | 3 | 2019-03-14T03:10:48.000Z | 2019-07-15T08:11:25.000Z | pygame_rl/scenario/soccer/teams.py | ebola777/pygame-soccer | f81da559385876616d99c74b43e4345f53d086d2 | [
"MIT"
] | 4 | 2019-02-13T13:41:17.000Z | 2019-07-22T13:33:15.000Z | # Native modules
from enum import IntEnum
class Teams(IntEnum):
PLAYER = 0
COMPUTER = 1
| 12.25 | 24 | 0.683673 | 13 | 98 | 5.153846 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027397 | 0.255102 | 98 | 7 | 25 | 14 | 0.890411 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
711ba79d48c5acb9d3accd7a478bb0384f339f42 | 156 | py | Python | anvil/interfaces/__init__.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 3 | 2019-11-22T04:38:06.000Z | 2022-01-19T08:27:18.000Z | anvil/interfaces/__init__.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 28 | 2018-02-01T20:39:42.000Z | 2018-04-26T17:25:23.000Z | anvil/interfaces/__init__.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 1 | 2018-03-11T06:47:26.000Z | 2018-03-11T06:47:26.000Z | """The set of functions that enable Anvil to work in the given DCC."""
import api_proxy
import dcc_plugin
__all__ = ['api_proxy',
'dcc_plugin']
| 22.285714 | 70 | 0.692308 | 24 | 156 | 4.166667 | 0.708333 | 0.16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211538 | 156 | 6 | 71 | 26 | 0.813008 | 0.410256 | 0 | 0 | 0 | 0 | 0.22093 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
71203d69e972ebd9a73901db8b42d1c645ea09f0 | 1,346 | py | Python | src/face_check/social/backends/goodgame.py | tarvitz/face-check | e468025c7a5615f4ec8ee24c06252ceeb8a2e129 | [
"BSD-4-Clause"
] | null | null | null | src/face_check/social/backends/goodgame.py | tarvitz/face-check | e468025c7a5615f4ec8ee24c06252ceeb8a2e129 | [
"BSD-4-Clause"
] | 7 | 2019-01-01T17:13:06.000Z | 2021-06-10T17:42:54.000Z | src/face_check/social/backends/goodgame.py | tarvitz/face-check | e468025c7a5615f4ec8ee24c06252ceeb8a2e129 | [
"BSD-4-Clause"
] | null | null | null | """
Twitch OAuth2 backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/goodgame.html
"""
from social_core.backends import oauth
class GoodGameOAuth2(oauth.BaseOAuth2):
"""GoodGame OAuth authentication backend"""
name = 'goodgame'
ID_KEY = 'user_id'
AUTHORIZATION_URL = 'https://api2.goodgame.ru/oauth/authorize'
ACCESS_TOKEN_URL = 'https://api2.goodgame.ru/oauth'
ACCESS_TOKEN_METHOD = 'POST'
#: TODO await when GG provide email user retrieve through scope
#: https://goodgame.ru/topic/67865#comment427
DEFAULT_SCOPE = ['channel.subscribers']
REDIRECT_STATE = False
def get_user_id(self, details, response):
return response["user"].get(self.ID_KEY)
def get_user_details(self, response):
return {
'username': response['user'].get('username'),
#: currently there's no email
'email': response['user'].get('email'),
'first_name': '',
'last_name': ''
}
def user_data(self, access_token, *args, **kwargs):
#: treat this as hacky as far as simple info does not return
#: email address, but we can retrieve it from another endpoint
return self.get_json(
'https://api2.goodgame.ru/info',
params={'access_token': access_token}
)
| 34.512821 | 78 | 0.642645 | 163 | 1,346 | 5.171779 | 0.546012 | 0.065243 | 0.060498 | 0.067616 | 0.064057 | 0.064057 | 0 | 0 | 0 | 0 | 0 | 0.013553 | 0.232541 | 1,346 | 38 | 79 | 35.421053 | 0.802517 | 0.298663 | 0 | 0 | 0 | 0 | 0.222462 | 0 | 0 | 0 | 0 | 0.026316 | 0 | 1 | 0.130435 | false | 0 | 0.043478 | 0.130435 | 0.652174 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
712febd61548dc3d1908db056b52dfe5ee29e08f | 705 | py | Python | lang/Python/playing-cards-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | 5 | 2021-01-29T20:08:05.000Z | 2022-03-22T06:16:05.000Z | lang/Python/playing-cards-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/playing-cards-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | 1 | 2021-04-13T04:19:31.000Z | 2021-04-13T04:19:31.000Z | import random
class Card(object):
suits = ("Clubs","Hearts","Spades","Diamonds")
pips = ("2","3","4","5","6","7","8","9","10","Jack","Queen","King","Ace")
def __init__(self, pip,suit):
self.pip=pip
self.suit=suit
def __str__(self):
return "%s %s"%(self.pip,self.suit)
class Deck(object):
def __init__(self):
self.deck = [Card(pip,suit) for suit in Card.suits for pip in Card.pips]
def __str__(self):
return "[%s]"%", ".join( (str(card) for card in self.deck))
def shuffle(self):
random.shuffle(self.deck)
def deal(self):
self.shuffle() # Can't tell what is next from self.deck
return self.deck.pop(0)
| 26.111111 | 80 | 0.574468 | 105 | 705 | 3.704762 | 0.447619 | 0.102828 | 0.056555 | 0.082262 | 0.087404 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02037 | 0.234043 | 705 | 26 | 81 | 27.115385 | 0.7 | 0.053901 | 0 | 0.105263 | 0 | 0 | 0.093233 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.315789 | false | 0 | 0.052632 | 0.105263 | 0.736842 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
7131fdbb28ce493b1ce2fdb0b6b3ceece6c2c5e7 | 234 | py | Python | lulu/length-of-last-word.py | joshua-jin/algorithm-campus | 8f60cd63542f4f5778a992179c3e767fbc023338 | [
"MIT"
] | 8 | 2016-05-10T12:59:36.000Z | 2020-09-16T19:47:44.000Z | lulu/length-of-last-word.py | joshua-jin/algorithm-campus | 8f60cd63542f4f5778a992179c3e767fbc023338 | [
"MIT"
] | null | null | null | lulu/length-of-last-word.py | joshua-jin/algorithm-campus | 8f60cd63542f4f5778a992179c3e767fbc023338 | [
"MIT"
] | 2 | 2016-12-22T09:28:54.000Z | 2020-01-22T17:56:02.000Z | class Solution:
# @param {string} s A string
# @return {int} the length of last word
def lengthOfLastWord(self, s):
# Write your code here
if s == '':
return 0
return len(s.split()[-1])
| 26 | 43 | 0.542735 | 31 | 234 | 4.096774 | 0.806452 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012987 | 0.34188 | 234 | 8 | 44 | 29.25 | 0.811688 | 0.363248 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
85675537e715f74331909f1bfc3cbced5496b2e4 | 158 | py | Python | src/debugbar/messages/Message.py | MasoniteFramework/debugbar | 62c8ba202f4b7530248c88ca2ce7aaaddcf598d9 | [
"MIT"
] | 5 | 2021-01-17T17:25:04.000Z | 2022-01-24T16:52:19.000Z | src/debugbar/messages/Message.py | MasoniteFramework/debugbar | 62c8ba202f4b7530248c88ca2ce7aaaddcf598d9 | [
"MIT"
] | 32 | 2021-01-17T15:16:52.000Z | 2022-03-07T01:30:19.000Z | src/debugbar/messages/Message.py | MasoniteFramework/debugbar | 62c8ba202f4b7530248c88ca2ce7aaaddcf598d9 | [
"MIT"
] | 1 | 2022-01-05T14:08:53.000Z | 2022-01-05T14:08:53.000Z | class Message:
def __init__(self, subject, value, options=None):
self.subject = subject
self.value = value
self.options = options | 26.333333 | 53 | 0.632911 | 18 | 158 | 5.333333 | 0.5 | 0.229167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.278481 | 158 | 6 | 54 | 26.333333 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
857c933c8a1faa44d29c848ca1b539e394d2ba3b | 1,667 | py | Python | hovor/session/session_base.py | IBM/contingent-plan-executor | 177c5ec84070a4d0d83beb6622d99ec0fd772c12 | [
"Apache-2.0"
] | 3 | 2020-07-01T03:09:27.000Z | 2021-03-20T03:27:24.000Z | hovor/session/session_base.py | IBM/contingent-plan-executor | 177c5ec84070a4d0d83beb6622d99ec0fd772c12 | [
"Apache-2.0"
] | 1 | 2020-07-09T00:56:14.000Z | 2020-07-09T00:56:14.000Z | hovor/session/session_base.py | IBM/contingent-plan-executor | 177c5ec84070a4d0d83beb6622d99ec0fd772c12 | [
"Apache-2.0"
] | 1 | 2020-12-19T22:06:00.000Z | 2020-12-19T22:06:00.000Z | class SessionBase(object):
"""
Base class for accessing plan, state, and context data.
Is responsible for defining initial state, context, and action in __init__.
ALL METHODS MUST BE OVERRIDDEN.
"""
@property
def plan(self):
"""The active plan for the session"""
raise NotImplementedError("must be overriden")
@property
def configuration(self):
"""The active configuration provider for the session"""
raise NotImplementedError("must be overriden")
@property
def current_node(self):
"""
Gets the current node in the plan that the agent is at
:return: The current node in the plan
"""
raise NotImplementedError("must be overriden")
@property
def current_state(self):
"""
Gets currently processed state
:return: The processed state
"""
raise NotImplementedError("must be overriden")
@property
def current_action(self):
"""
Gets next action to be executed
:return: The action
"""
raise NotImplementedError("must be overriden")
def update_by(self, progress):
"""
Updates session to state and context described by the give progress.
Action for given state is created. (Available through current_action property)
:param progress: State to be set
"""
raise NotImplementedError("must be overriden")
def get_context_copy(self):
"""
Gets copy of currently processed context.
:return: The processed context copy
"""
raise NotImplementedError("must be overriden")
| 29.245614 | 86 | 0.629274 | 184 | 1,667 | 5.641304 | 0.331522 | 0.046243 | 0.188825 | 0.202312 | 0.400771 | 0.363198 | 0.237958 | 0.237958 | 0.121387 | 0.121387 | 0 | 0 | 0.293941 | 1,667 | 56 | 87 | 29.767857 | 0.881903 | 0.425915 | 0 | 0.6 | 0 | 0 | 0.156579 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.35 | false | 0 | 0 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8591a7090c96616149a2e2720da637473a0729d4 | 177 | py | Python | ProcessScreen.py | collvey/AutoHotKey | 378af50954e0d93af00d73b62b49a053b1e80e83 | [
"MIT"
] | null | null | null | ProcessScreen.py | collvey/AutoHotKey | 378af50954e0d93af00d73b62b49a053b1e80e83 | [
"MIT"
] | null | null | null | ProcessScreen.py | collvey/AutoHotKey | 378af50954e0d93af00d73b62b49a053b1e80e83 | [
"MIT"
] | 1 | 2022-02-21T05:35:43.000Z | 2022-02-21T05:35:43.000Z | import os
if __name__ == "__main__":
screen_dir = r"C:\Users\collv\Pictures\Screenshots"
for f in os.listdir(screen_dir):
os.remove(os.path.join(screen_dir, f)) | 29.5 | 55 | 0.683616 | 28 | 177 | 3.928571 | 0.714286 | 0.245455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175141 | 177 | 6 | 56 | 29.5 | 0.753425 | 0 | 0 | 0 | 0 | 0 | 0.241573 | 0.196629 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
8595e9d998cbd9c7f01883a7d7536070b59a1bb6 | 36,756 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripItem.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripItem.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripItem.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class ToolStripItem(Component,IComponent,IDisposable,IDropTarget,ISupportOleDropSource,IArrangedElement):
""" Represents the abstract base class that manages events and layout for all the elements that a System.Windows.Forms.ToolStrip or System.Windows.Forms.ToolStripDropDown can contain. """
def CreateAccessibilityInstance(self,*args):
"""
CreateAccessibilityInstance(self: ToolStripItem) -> AccessibleObject
Creates a new accessibility object for the System.Windows.Forms.ToolStripItem.
Returns: A new System.Windows.Forms.AccessibleObject for the System.Windows.Forms.ToolStripItem.
"""
pass
def Dispose(self):
"""
Dispose(self: ToolStripItem,disposing: bool)
Releases the unmanaged resources used by the System.Windows.Forms.ToolStripItem and optionally
releases the managed resources.
disposing: true to release both managed and unmanaged resources; false to release only unmanaged resources.
"""
pass
def DoDragDrop(self,data,allowedEffects):
"""
DoDragDrop(self: ToolStripItem,data: object,allowedEffects: DragDropEffects) -> DragDropEffects
Begins a drag-and-drop operation.
data: The object to be dragged.
allowedEffects: The drag operations that can occur.
Returns: One of the System.Windows.Forms.DragDropEffects values.
"""
pass
def GetCurrentParent(self):
"""
GetCurrentParent(self: ToolStripItem) -> ToolStrip
Retrieves the System.Windows.Forms.ToolStrip that is the container of the current
System.Windows.Forms.ToolStripItem.
Returns: A System.Windows.Forms.ToolStrip that is the container of the current
System.Windows.Forms.ToolStripItem.
"""
pass
def GetPreferredSize(self,constrainingSize):
"""
GetPreferredSize(self: ToolStripItem,constrainingSize: Size) -> Size
Retrieves the size of a rectangular area into which a control can be fit.
constrainingSize: The custom-sized area for a control.
Returns: A System.Drawing.Size ordered pair,representing the width and height of a rectangle.
"""
pass
def GetService(self,*args):
"""
GetService(self: Component,service: Type) -> object
Returns an object that represents a service provided by the System.ComponentModel.Component or
by its System.ComponentModel.Container.
service: A service provided by the System.ComponentModel.Component.
Returns: An System.Object that represents a service provided by the System.ComponentModel.Component,or
null if the System.ComponentModel.Component does not provide the specified service.
"""
pass
def Invalidate(self,r=None):
"""
Invalidate(self: ToolStripItem,r: Rectangle)
Invalidates the specified region of the System.Windows.Forms.ToolStripItem by adding it to the
update region of the System.Windows.Forms.ToolStripItem,which is the area that will be
repainted at the next paint operation,and causes a paint message to be sent to the
System.Windows.Forms.ToolStripItem.
r: A System.Drawing.Rectangle that represents the region to invalidate.
Invalidate(self: ToolStripItem)
Invalidates the entire surface of the System.Windows.Forms.ToolStripItem and causes it to be
redrawn.
"""
pass
def IsInputChar(self,*args):
"""
IsInputChar(self: ToolStripItem,charCode: Char) -> bool
Determines whether a character is an input character that the item recognizes.
charCode: The character to test.
Returns: true if the character should be sent directly to the item and not preprocessed; otherwise,false.
"""
pass
def IsInputKey(self,*args):
"""
IsInputKey(self: ToolStripItem,keyData: Keys) -> bool
Determines whether the specified key is a regular input key or a special key that requires
preprocessing.
keyData: One of the System.Windows.Forms.Keys values.
Returns: true if the specified key is a regular input key; otherwise,false.
"""
pass
def MemberwiseClone(self,*args):
"""
MemberwiseClone(self: MarshalByRefObject,cloneIdentity: bool) -> MarshalByRefObject
Creates a shallow copy of the current System.MarshalByRefObject object.
cloneIdentity: false to delete the current System.MarshalByRefObject object's identity,which will cause the
object to be assigned a new identity when it is marshaled across a remoting boundary. A value of
false is usually appropriate. true to copy the current System.MarshalByRefObject object's
identity to its clone,which will cause remoting client calls to be routed to the remote server
object.
Returns: A shallow copy of the current System.MarshalByRefObject object.
MemberwiseClone(self: object) -> object
Creates a shallow copy of the current System.Object.
Returns: A shallow copy of the current System.Object.
"""
pass
def OnAvailableChanged(self,*args):
"""
OnAvailableChanged(self: ToolStripItem,e: EventArgs)
Raises the AvailableChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBackColorChanged(self,*args):
"""
OnBackColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.BackColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBoundsChanged(self,*args):
"""
OnBoundsChanged(self: ToolStripItem)
Occurs when the System.Windows.Forms.ToolStripItem.Bounds property changes.
"""
pass
def OnClick(self,*args):
"""
OnClick(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.Click event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDisplayStyleChanged(self,*args):
"""
OnDisplayStyleChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.DisplayStyleChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDoubleClick(self,*args):
"""
OnDoubleClick(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.DoubleClick event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDragDrop(self,*args):
"""
OnDragDrop(self: ToolStripItem,dragEvent: DragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragDrop event.
dragEvent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnDragEnter(self,*args):
"""
OnDragEnter(self: ToolStripItem,dragEvent: DragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragEnter event.
dragEvent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnDragLeave(self,*args):
"""
OnDragLeave(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragLeave event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDragOver(self,*args):
"""
OnDragOver(self: ToolStripItem,dragEvent: DragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragOver event.
dragEvent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnEnabledChanged(self,*args):
"""
OnEnabledChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.EnabledChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnFontChanged(self,*args):
"""
OnFontChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.Control.FontChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnForeColorChanged(self,*args):
"""
OnForeColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.ForeColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnGiveFeedback(self,*args):
"""
OnGiveFeedback(self: ToolStripItem,giveFeedbackEvent: GiveFeedbackEventArgs)
Raises the System.Windows.Forms.ToolStripItem.GiveFeedback event.
giveFeedbackEvent: A System.Windows.Forms.GiveFeedbackEventArgs that contains the event data.
"""
pass
def OnLayout(self,*args):
"""
OnLayout(self: ToolStripItem,e: LayoutEventArgs)
Raises the System.Windows.Forms.Control.Layout event.
e: A System.Windows.Forms.LayoutEventArgs that contains the event data.
"""
pass
def OnLocationChanged(self,*args):
"""
OnLocationChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.LocationChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseDown(self,*args):
"""
OnMouseDown(self: ToolStripItem,e: MouseEventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseDown event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseEnter(self,*args):
"""
OnMouseEnter(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseEnter event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseHover(self,*args):
"""
OnMouseHover(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseHover event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseLeave(self,*args):
"""
OnMouseLeave(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseLeave event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseMove(self,*args):
"""
OnMouseMove(self: ToolStripItem,mea: MouseEventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseMove event.
mea: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseUp(self,*args):
"""
OnMouseUp(self: ToolStripItem,e: MouseEventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseUp event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnOwnerChanged(self,*args):
"""
OnOwnerChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.OwnerChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnOwnerFontChanged(self,*args):
"""
OnOwnerFontChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.Control.FontChanged event when the
System.Windows.Forms.ToolStripItem.Font property has changed on the parent of the
System.Windows.Forms.ToolStripItem.
e: A System.EventArgs that contains the event data.
"""
pass
def OnPaint(self,*args):
"""
OnPaint(self: ToolStripItem,e: PaintEventArgs)
Raises the System.Windows.Forms.ToolStripItem.Paint event.
e: A System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def OnParentBackColorChanged(self,*args):
"""
OnParentBackColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.BackColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentChanged(self,*args):
"""
OnParentChanged(self: ToolStripItem,oldParent: ToolStrip,newParent: ToolStrip)
Raises the System.Windows.Forms.Control.ParentChanged event.
oldParent: The original parent of the item.
newParent: The new parent of the item.
"""
pass
def OnParentEnabledChanged(self,*args):
"""
OnParentEnabledChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.EnabledChanged event when the
System.Windows.Forms.ToolStripItem.Enabled property value of the item's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentForeColorChanged(self,*args):
"""
OnParentForeColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.ForeColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentRightToLeftChanged(self,*args):
"""
OnParentRightToLeftChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.RightToLeftChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnQueryContinueDrag(self,*args):
"""
OnQueryContinueDrag(self: ToolStripItem,queryContinueDragEvent: QueryContinueDragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.QueryContinueDrag event.
queryContinueDragEvent: A System.Windows.Forms.QueryContinueDragEventArgs that contains the event data.
"""
pass
def OnRightToLeftChanged(self,*args):
"""
OnRightToLeftChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.RightToLeftChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnTextChanged(self,*args):
"""
OnTextChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.TextChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnVisibleChanged(self,*args):
"""
OnVisibleChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.VisibleChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def PerformClick(self):
"""
PerformClick(self: ToolStripItem)
Activates the System.Windows.Forms.ToolStripItem when it is clicked with the mouse.
"""
pass
def ProcessCmdKey(self,*args):
"""
ProcessCmdKey(self: ToolStripItem,m: Message,keyData: Keys) -> (bool,Message)
Processes a command key.
m: A System.Windows.Forms.Message,passed by reference,that represents the window message to
process.
keyData: One of the System.Windows.Forms.Keys values that represents the key to process.
Returns: false in all cases.
"""
pass
def ProcessDialogKey(self,*args):
"""
ProcessDialogKey(self: ToolStripItem,keyData: Keys) -> bool
Processes a dialog key.
keyData: One of the System.Windows.Forms.Keys values that represents the key to process.
Returns: true if the key was processed by the item; otherwise,false.
"""
pass
def ProcessMnemonic(self,*args):
"""
ProcessMnemonic(self: ToolStripItem,charCode: Char) -> bool
Processes a mnemonic character.
charCode: The character to process.
Returns: true in all cases.
"""
pass
def ResetBackColor(self):
"""
ResetBackColor(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetDisplayStyle(self):
"""
ResetDisplayStyle(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetFont(self):
"""
ResetFont(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetForeColor(self):
"""
ResetForeColor(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetImage(self):
"""
ResetImage(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetMargin(self):
"""
ResetMargin(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetPadding(self):
"""
ResetPadding(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetRightToLeft(self):
"""
ResetRightToLeft(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetTextDirection(self):
"""
ResetTextDirection(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def Select(self):
"""
Select(self: ToolStripItem)
Selects the item.
"""
pass
def SetBounds(self,*args):
"""
SetBounds(self: ToolStripItem,bounds: Rectangle)
Sets the size and location of the item.
bounds: A System.Drawing.Rectangle that represents the size and location of the
System.Windows.Forms.ToolStripItem
"""
pass
def SetVisibleCore(self,*args):
"""
SetVisibleCore(self: ToolStripItem,visible: bool)
Sets the System.Windows.Forms.ToolStripItem to the specified visible state.
visible: true to make the System.Windows.Forms.ToolStripItem visible; otherwise,false.
"""
pass
def ToString(self):
"""
ToString(self: ToolStripItem) -> str
Returns: A System.String containing the name of the System.ComponentModel.Component,if any,or null if
the System.ComponentModel.Component is unnamed.
"""
pass
def __enter__(self,*args):
"""
__enter__(self: IDisposable) -> object
Provides the implementation of __enter__ for objects which implement IDisposable.
"""
pass
def __exit__(self,*args):
"""
__exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object)
Provides the implementation of __exit__ for objects which implement IDisposable.
"""
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod
def __new__(self,*args): #cannot find CLR constructor
"""
__new__(cls: type)
__new__(cls: type,text: str,image: Image,onClick: EventHandler)
__new__(cls: type,text: str,image: Image,onClick: EventHandler,name: str)
"""
pass
def __str__(self,*args):
pass
AccessibilityObject=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the System.Windows.Forms.AccessibleObject assigned to the control.
Get: AccessibilityObject(self: ToolStripItem) -> AccessibleObject
"""
AccessibleDefaultActionDescription=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the default action description of the control for use by accessibility client applications.
Get: AccessibleDefaultActionDescription(self: ToolStripItem) -> str
Set: AccessibleDefaultActionDescription(self: ToolStripItem)=value
"""
AccessibleDescription=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the description that will be reported to accessibility client applications.
Get: AccessibleDescription(self: ToolStripItem) -> str
Set: AccessibleDescription(self: ToolStripItem)=value
"""
AccessibleName=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the name of the control for use by accessibility client applications.
Get: AccessibleName(self: ToolStripItem) -> str
Set: AccessibleName(self: ToolStripItem)=value
"""
AccessibleRole=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the accessible role of the control,which specifies the type of user interface element of the control.
Get: AccessibleRole(self: ToolStripItem) -> AccessibleRole
Set: AccessibleRole(self: ToolStripItem)=value
"""
Alignment=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the item aligns towards the beginning or end of the System.Windows.Forms.ToolStrip.
Get: Alignment(self: ToolStripItem) -> ToolStripItemAlignment
Set: Alignment(self: ToolStripItem)=value
"""
AllowDrop=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether drag-and-drop and item reordering are handled through events that you implement.
Get: AllowDrop(self: ToolStripItem) -> bool
Set: AllowDrop(self: ToolStripItem)=value
"""
Anchor=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the edges of the container to which a System.Windows.Forms.ToolStripItem is bound and determines how a System.Windows.Forms.ToolStripItem is resized with its parent.
Get: Anchor(self: ToolStripItem) -> AnchorStyles
Set: Anchor(self: ToolStripItem)=value
"""
AutoSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the item is automatically sized.
Get: AutoSize(self: ToolStripItem) -> bool
Set: AutoSize(self: ToolStripItem)=value
"""
AutoToolTip=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether to use the System.Windows.Forms.ToolStripItem.Text property or the System.Windows.Forms.ToolStripItem.ToolTipText property for the System.Windows.Forms.ToolStripItem ToolTip.
Get: AutoToolTip(self: ToolStripItem) -> bool
Set: AutoToolTip(self: ToolStripItem)=value
"""
Available=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the System.Windows.Forms.ToolStripItem should be placed on a System.Windows.Forms.ToolStrip.
Get: Available(self: ToolStripItem) -> bool
Set: Available(self: ToolStripItem)=value
"""
BackColor=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the background color for the item.
Get: BackColor(self: ToolStripItem) -> Color
Set: BackColor(self: ToolStripItem)=value
"""
BackgroundImage=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the background image displayed in the item.
Get: BackgroundImage(self: ToolStripItem) -> Image
Set: BackgroundImage(self: ToolStripItem)=value
"""
BackgroundImageLayout=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the background image layout used for the System.Windows.Forms.ToolStripItem.
Get: BackgroundImageLayout(self: ToolStripItem) -> ImageLayout
Set: BackgroundImageLayout(self: ToolStripItem)=value
"""
Bounds=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the size and location of the item.
Get: Bounds(self: ToolStripItem) -> Rectangle
"""
CanRaiseEvents=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the component can raise an event.
"""
CanSelect=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the item can be selected.
Get: CanSelect(self: ToolStripItem) -> bool
"""
ContentRectangle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the area where content,such as text and icons,can be placed within a System.Windows.Forms.ToolStripItem without overwriting background borders.
Get: ContentRectangle(self: ToolStripItem) -> Rectangle
"""
DefaultAutoToolTip=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether to display the System.Windows.Forms.ToolTip that is defined as the default.
"""
DefaultDisplayStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating what is displayed on the System.Windows.Forms.ToolStripItem.
"""
DefaultMargin=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the default margin of an item.
"""
DefaultPadding=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the internal spacing characteristics of the item.
"""
DefaultSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the default size of the item.
"""
DesignMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode.
"""
DismissWhenClicked=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether items on a System.Windows.Forms.ToolStripDropDown are hidden after they are clicked.
"""
DisplayStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets whether text and images are displayed on a System.Windows.Forms.ToolStripItem.
Get: DisplayStyle(self: ToolStripItem) -> ToolStripItemDisplayStyle
Set: DisplayStyle(self: ToolStripItem)=value
"""
Dock=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets which System.Windows.Forms.ToolStripItem borders are docked to its parent control and determines how a System.Windows.Forms.ToolStripItem is resized with its parent.
Get: Dock(self: ToolStripItem) -> DockStyle
Set: Dock(self: ToolStripItem)=value
"""
DoubleClickEnabled=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the System.Windows.Forms.ToolStripItem can be activated by double-clicking the mouse.
Get: DoubleClickEnabled(self: ToolStripItem) -> bool
Set: DoubleClickEnabled(self: ToolStripItem)=value
"""
Enabled=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the parent control of the System.Windows.Forms.ToolStripItem is enabled.
Get: Enabled(self: ToolStripItem) -> bool
Set: Enabled(self: ToolStripItem)=value
"""
Events=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the list of event handlers that are attached to this System.ComponentModel.Component.
"""
Font=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the font of the text displayed by the item.
Get: Font(self: ToolStripItem) -> Font
Set: Font(self: ToolStripItem)=value
"""
ForeColor=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the foreground color of the item.
Get: ForeColor(self: ToolStripItem) -> Color
Set: ForeColor(self: ToolStripItem)=value
"""
Height=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the height,in pixels,of a System.Windows.Forms.ToolStripItem.
Get: Height(self: ToolStripItem) -> int
Set: Height(self: ToolStripItem)=value
"""
Image=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the image that is displayed on a System.Windows.Forms.ToolStripItem.
Get: Image(self: ToolStripItem) -> Image
Set: Image(self: ToolStripItem)=value
"""
ImageAlign=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the alignment of the image on a System.Windows.Forms.ToolStripItem.
Get: ImageAlign(self: ToolStripItem) -> ContentAlignment
Set: ImageAlign(self: ToolStripItem)=value
"""
ImageIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the index value of the image that is displayed on the item.
Get: ImageIndex(self: ToolStripItem) -> int
Set: ImageIndex(self: ToolStripItem)=value
"""
ImageKey=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the key accessor for the image in the System.Windows.Forms.ToolStrip.ImageList that is displayed on a System.Windows.Forms.ToolStripItem.
Get: ImageKey(self: ToolStripItem) -> str
Set: ImageKey(self: ToolStripItem)=value
"""
ImageScaling=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether an image on a System.Windows.Forms.ToolStripItem is automatically resized to fit in a container.
Get: ImageScaling(self: ToolStripItem) -> ToolStripItemImageScaling
Set: ImageScaling(self: ToolStripItem)=value
"""
ImageTransparentColor=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the color to treat as transparent in a System.Windows.Forms.ToolStripItem image.
Get: ImageTransparentColor(self: ToolStripItem) -> Color
Set: ImageTransparentColor(self: ToolStripItem)=value
"""
IsDisposed=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the object has been disposed of.
Get: IsDisposed(self: ToolStripItem) -> bool
"""
IsOnDropDown=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the container of the current System.Windows.Forms.Control is a System.Windows.Forms.ToolStripDropDown.
Get: IsOnDropDown(self: ToolStripItem) -> bool
"""
IsOnOverflow=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the System.Windows.Forms.ToolStripItem.Placement property is set to System.Windows.Forms.ToolStripItemPlacement.Overflow.
Get: IsOnOverflow(self: ToolStripItem) -> bool
"""
Margin=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the space between the item and adjacent items.
Get: Margin(self: ToolStripItem) -> Padding
Set: Margin(self: ToolStripItem)=value
"""
MergeAction=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets how child menus are merged with parent menus.
Get: MergeAction(self: ToolStripItem) -> MergeAction
Set: MergeAction(self: ToolStripItem)=value
"""
MergeIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the position of a merged item within the current System.Windows.Forms.ToolStrip.
Get: MergeIndex(self: ToolStripItem) -> int
Set: MergeIndex(self: ToolStripItem)=value
"""
Name=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the name of the item.
Get: Name(self: ToolStripItem) -> str
Set: Name(self: ToolStripItem)=value
"""
Overflow=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets whether the item is attached to the System.Windows.Forms.ToolStrip or System.Windows.Forms.ToolStripOverflowButton or can float between the two.
Get: Overflow(self: ToolStripItem) -> ToolStripItemOverflow
Set: Overflow(self: ToolStripItem)=value
"""
Owner=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the owner of this item.
Get: Owner(self: ToolStripItem) -> ToolStrip
Set: Owner(self: ToolStripItem)=value
"""
OwnerItem=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the parent System.Windows.Forms.ToolStripItem of this System.Windows.Forms.ToolStripItem.
Get: OwnerItem(self: ToolStripItem) -> ToolStripItem
"""
Padding=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the internal spacing,in pixels,between the item's contents and its edges.
Get: Padding(self: ToolStripItem) -> Padding
Set: Padding(self: ToolStripItem)=value
"""
Parent=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the parent container of the System.Windows.Forms.ToolStripItem.
"""
Placement=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the current layout of the item.
Get: Placement(self: ToolStripItem) -> ToolStripItemPlacement
"""
Pressed=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the state of the item is pressed.
Get: Pressed(self: ToolStripItem) -> bool
"""
RightToLeft=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether items are to be placed from right to left and text is to be written from right to left.
Get: RightToLeft(self: ToolStripItem) -> RightToLeft
Set: RightToLeft(self: ToolStripItem)=value
"""
RightToLeftAutoMirrorImage=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Mirrors automatically the System.Windows.Forms.ToolStripItem image when the System.Windows.Forms.ToolStripItem.RightToLeft property is set to System.Windows.Forms.RightToLeft.Yes.
Get: RightToLeftAutoMirrorImage(self: ToolStripItem) -> bool
Set: RightToLeftAutoMirrorImage(self: ToolStripItem)=value
"""
Selected=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the item is selected.
Get: Selected(self: ToolStripItem) -> bool
"""
ShowKeyboardCues=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether to show or hide shortcut keys.
"""
Size=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the size of the item.
Get: Size(self: ToolStripItem) -> Size
Set: Size(self: ToolStripItem)=value
"""
Tag=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the object that contains data about the item.
Get: Tag(self: ToolStripItem) -> object
Set: Tag(self: ToolStripItem)=value
"""
Text=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the text that is to be displayed on the item.
Get: Text(self: ToolStripItem) -> str
Set: Text(self: ToolStripItem)=value
"""
TextAlign=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the alignment of the text on a System.Windows.Forms.ToolStripLabel.
Get: TextAlign(self: ToolStripItem) -> ContentAlignment
Set: TextAlign(self: ToolStripItem)=value
"""
TextDirection=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the orientation of text used on a System.Windows.Forms.ToolStripItem.
Get: TextDirection(self: ToolStripItem) -> ToolStripTextDirection
Set: TextDirection(self: ToolStripItem)=value
"""
TextImageRelation=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the position of System.Windows.Forms.ToolStripItem text and image relative to each other.
Get: TextImageRelation(self: ToolStripItem) -> TextImageRelation
Set: TextImageRelation(self: ToolStripItem)=value
"""
ToolTipText=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the text that appears as a System.Windows.Forms.ToolTip for a control.
Get: ToolTipText(self: ToolStripItem) -> str
Set: ToolTipText(self: ToolStripItem)=value
"""
Visible=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the item is displayed.
Get: Visible(self: ToolStripItem) -> bool
Set: Visible(self: ToolStripItem)=value
"""
Width=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the width in pixels of a System.Windows.Forms.ToolStripItem.
Get: Width(self: ToolStripItem) -> int
Set: Width(self: ToolStripItem)=value
"""
AvailableChanged=None
BackColorChanged=None
Click=None
DisplayStyleChanged=None
DoubleClick=None
DragDrop=None
DragEnter=None
DragLeave=None
DragOver=None
EnabledChanged=None
ForeColorChanged=None
GiveFeedback=None
LocationChanged=None
MouseDown=None
MouseEnter=None
MouseHover=None
MouseLeave=None
MouseMove=None
MouseUp=None
OwnerChanged=None
Paint=None
QueryAccessibilityHelp=None
QueryContinueDrag=None
RightToLeftChanged=None
TextChanged=None
ToolStripItemAccessibleObject=None
VisibleChanged=None
| 23.501279 | 219 | 0.710279 | 4,409 | 36,756 | 5.901565 | 0.114538 | 0.076095 | 0.078171 | 0.088163 | 0.516641 | 0.479093 | 0.450423 | 0.410108 | 0.396849 | 0.378939 | 0 | 0 | 0.194145 | 36,756 | 1,563 | 220 | 23.516315 | 0.878461 | 0.368076 | 0 | 0.290749 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.290749 | false | 0.290749 | 0 | 0 | 0.704846 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
85ab4c1f01496489252f35724adcec43beaaa302 | 67 | py | Python | python/testData/quickFixes/PyAddImportQuickFixTest/globalDefinitionDoesNotShadowCommonPackageAliasVariant/main.py | 06needhamt/intellij-community | 63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b | [
"Apache-2.0"
] | null | null | null | python/testData/quickFixes/PyAddImportQuickFixTest/globalDefinitionDoesNotShadowCommonPackageAliasVariant/main.py | 06needhamt/intellij-community | 63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b | [
"Apache-2.0"
] | null | null | null | python/testData/quickFixes/PyAddImportQuickFixTest/globalDefinitionDoesNotShadowCommonPackageAliasVariant/main.py | 06needhamt/intellij-community | 63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b | [
"Apache-2.0"
] | null | null | null | <error descr="Unresolved reference 'np'">n<caret>p</error>.ndarray
| 33.5 | 66 | 0.746269 | 10 | 67 | 5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.059701 | 67 | 1 | 67 | 67 | 0.793651 | 0 | 0 | 0 | 0 | 0 | 0.373134 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a413259a60fc0a267d12007e28ed945f8488cc02 | 1,359 | py | Python | todolistapi/authentication/tests/test_models.py | yaswanthsaivendra/django_projects | 9c4b3511d32eb3bfd0825480a5dd021bd865b16b | [
"MIT"
] | 3 | 2021-11-08T18:26:26.000Z | 2021-12-11T18:30:50.000Z | todolistapi/authentication/tests/test_models.py | yaswanthsaivendra/django_projects | 9c4b3511d32eb3bfd0825480a5dd021bd865b16b | [
"MIT"
] | null | null | null | todolistapi/authentication/tests/test_models.py | yaswanthsaivendra/django_projects | 9c4b3511d32eb3bfd0825480a5dd021bd865b16b | [
"MIT"
] | null | null | null | from rest_framework.test import APITestCase
from authentication.models import User
class TestModel(APITestCase):
def test_creates_user(self):
user=User.objects.create_user('username', 'user@gmail.com','password1!')
self.assertIsInstance(user,User)
def test_creates_superuser(self):
user=User.objects.create_superuser('username', 'user@gmail.com','password1!')
self.assertIsInstance(user,User)
def test_raises_error_when_no_username_is_supplied(self):
self.assertRaises(ValueError, User.objects.create_user, username='',email='user@gmail.com',password='password1!')
def test_raises_error_when_no_email_is_supplied(self):
self.assertRaises(ValueError, User.objects.create_user, username='username',email='',password='password1!')
def test_creates_superuser_with_is_staff_status(self):
with self.assertRaisesMessage(ValueError, 'Superuser must have is_staff=True.'):
User.objects.create_superuser(username='username', email='user@gmail.com', password='password1!', is_staff=False)
def test_creates_superuser_with_is_superuser_status(self):
with self.assertRaisesMessage(ValueError, 'Superuser must have is_superuser=True.'):
User.objects.create_superuser(username='username', email='user@gmail.com', password='password1!', is_superuser=False) | 50.333333 | 129 | 0.754231 | 166 | 1,359 | 5.927711 | 0.240964 | 0.042683 | 0.103659 | 0.064024 | 0.770325 | 0.706301 | 0.605691 | 0.571138 | 0.571138 | 0.571138 | 0 | 0.005059 | 0.127299 | 1,359 | 27 | 129 | 50.333333 | 0.824621 | 0 | 0 | 0.105263 | 0 | 0 | 0.177941 | 0 | 0 | 0 | 0 | 0 | 0.315789 | 1 | 0.315789 | false | 0.315789 | 0.105263 | 0 | 0.473684 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
a42d8d5b67740ae561836c7a45d64c9f78eb7129 | 2,880 | py | Python | Day 14 - Coffee Machine Project/todos.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-01-28T13:55:39.000Z | 2022-01-28T13:55:39.000Z | Day 14 - Coffee Machine Project/todos.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 1 | 2022-02-02T00:13:18.000Z | 2022-02-03T11:32:53.000Z | Day 14 - Coffee Machine Project/todos.py | secureterminal/100-Days-of-Code | 04383ae541938d8a551b5aac9a0dad3348a6ef23 | [
"MIT"
] | 2 | 2022-02-07T20:49:36.000Z | 2022-02-19T21:22:15.000Z | # TODO 1. Prompt user by asking “What would you like? (espresso/latte/cappuccino):” \ a. Check the user’s input to
# decide what to do next.\ b. The prompt should show every time action has completed, e.g. once the drink is
# dispensed. The prompt should show again to serve the next customer.
# TODO 2. Turn off the Coffee Machine by entering “off” to the prompt.
# a. For maintainers of the coffee machine, they can use “off” as the secret word to turn off
# the machine. Your code should end execution when this happens.
# TODO 3. Print report.
# a. When the user enters “report” to the prompt, a report should be generated that shows
# the current resource values. e.g.
# Water: 100ml
# Milk: 50ml
# Coffee: 76g
# Money: $2.5
# TODO 4. Check resources sufficient?
# a. When the user chooses a drink, the program should check if there are enough
# resources to make that drink.
# b. E.g. if Latte requires 200ml water but there is only 100ml left in the machine. It should
# not continue to make the drink but print: “Sorry there is not enough water.”
# c. The same should happen if another resource is depleted, e.g. milk or coffee.
# TODO 5. Process coins.
# a. If there are sufficient resources to make the drink selected, then the program should
# prompt the user to insert coins.
# b. Remember that quarters = $0.25, dimes = $0.10, nickles = $0.05, pennies = $0.01
# c. Calculate the monetary value of the coins inserted. E.g. 1 quarter, 2 dimes, 1 nickel, 2
# pennies = 0.25 + 0.1 x 2 + 0.05 + 0.01 x 2 = $0.52
# TODO 6. Check transaction successful?
# a. Check that the user has inserted enough money to purchase the drink they selected.
# E.g Latte cost $2.50, but they only inserted $0.52 then after counting the coins the
# program should say “Sorry that's not enough money. Money refunded.”.
# b. But if the user has inserted enough money, then the cost of the drink gets added to the
# machine as the profit and this will be reflected the next time “report” is triggered. E.g.
# Water: 100ml
# Milk: 50ml
# Coffee: 76g
# Money: $2.5
# c. If the user has inserted too much money, the machine should offer change.
# E.g. “Here is $2.45 dollars in change.” The change should be rounded to 2 decimal
# places.
# TODO 7. Make Coffee.
# a. If the transaction is successful and there are enough resources to make the drink the
# user selected, then the ingredients to make the drink should be deducted from the
# coffee machine resources.
# E.g. report before purchasing latte:
# Water: 300ml
# Milk: 200ml
# Coffee: 100g
# Money: $0
# Report after purchasing latte:
# Water: 100ml
# Milk: 50ml
# Coffee: 76g
# Money: $2.5
# b. Once all resources have been deducted, tell the user “Here is your latte. Enjoy!”. If
# latte was their choice of drink.
| 43.636364 | 115 | 0.698264 | 486 | 2,880 | 4.13786 | 0.351852 | 0.031328 | 0.017902 | 0.027847 | 0.136748 | 0.110393 | 0.05271 | 0.05271 | 0.05271 | 0.035803 | 0 | 0.041163 | 0.223958 | 2,880 | 65 | 116 | 44.307692 | 0.858613 | 0.935764 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.015385 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a43dc50a6574d44ec26b352643549584b01d8720 | 209 | py | Python | character_sheet/src/player/classes/cleric.py | quintenpalmer/dnd | 0efa2b0ecfe886fde06a07ee5dc9475cd77f63a3 | [
"MIT"
] | 7 | 2016-11-13T18:50:39.000Z | 2021-02-11T01:38:36.000Z | character_sheet/src/player/classes/cleric.py | quintenpalmer/dnd | 0efa2b0ecfe886fde06a07ee5dc9475cd77f63a3 | [
"MIT"
] | null | null | null | character_sheet/src/player/classes/cleric.py | quintenpalmer/dnd | 0efa2b0ecfe886fde06a07ee5dc9475cd77f63a3 | [
"MIT"
] | 2 | 2016-11-04T13:07:58.000Z | 2017-09-22T07:36:20.000Z | from . import class_
class Cleric(class_.Class):
def __init__(self, channel_divinity):
class_.Class.__init__(self)
self.defs['will'] = 2
self.spec = 'cleric_%s' % channel_divinity | 26.125 | 50 | 0.655502 | 26 | 209 | 4.730769 | 0.538462 | 0.243902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006173 | 0.22488 | 209 | 8 | 50 | 26.125 | 0.753086 | 0 | 0 | 0 | 0 | 0 | 0.061905 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a44ee44527b1ddc9697f3b8d65d9da9c79901aae | 220 | py | Python | python/pangram/pangram.py | AnthonyRChao/Exercism | d477af77cf1bbd37ce5cc705f6d201daeda82df7 | [
"MIT"
] | null | null | null | python/pangram/pangram.py | AnthonyRChao/Exercism | d477af77cf1bbd37ce5cc705f6d201daeda82df7 | [
"MIT"
] | null | null | null | python/pangram/pangram.py | AnthonyRChao/Exercism | d477af77cf1bbd37ce5cc705f6d201daeda82df7 | [
"MIT"
] | null | null | null | from string import ascii_lowercase
ALPHABET = set(ascii_lowercase)
def is_pangram(sentence):
"""Checks if sentence uses every letter in the alphabet at least once"""
return ALPHABET.issubset(sentence.lower())
| 24.444444 | 76 | 0.763636 | 30 | 220 | 5.5 | 0.8 | 0.169697 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154545 | 220 | 8 | 77 | 27.5 | 0.887097 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a49a7796657fa08d5519667b5c665162e1e0b2bd | 522 | py | Python | Aula 10 Estrutura Condicional IF/Aula 10.py | JadilsonJR/Python | 99eab305249ccd02c31f1913d569a9b601eff06a | [
"MIT"
] | null | null | null | Aula 10 Estrutura Condicional IF/Aula 10.py | JadilsonJR/Python | 99eab305249ccd02c31f1913d569a9b601eff06a | [
"MIT"
] | null | null | null | Aula 10 Estrutura Condicional IF/Aula 10.py | JadilsonJR/Python | 99eab305249ccd02c31f1913d569a9b601eff06a | [
"MIT"
] | null | null | null |
a= 10
b= 5
op = "/"
if op == "+":
res=a+b
print("Operação Soma, o Resultado foi de:", a ,"+", b ,"=" , res )
if op == "-":
res=a-b
print("Operação Subtração, o Resultado foi de:", a ,"-", b ,"=" , res )
if op == "/":
res=a/b
print("Operação Subtração, o Resultado de:", a ,"/", b ,"=" , res )
if op == "*":
res=a*b
print("Operação Subtração, o Resultado de:" , a ,"*", b ,"=" , res )
# a = False
# if a:
# print("é Verdade e não mintu")
# else :
# print ("Né não")
| 15.818182 | 75 | 0.469349 | 77 | 522 | 3.181818 | 0.298701 | 0.065306 | 0.114286 | 0.130612 | 0.771429 | 0.771429 | 0.771429 | 0.681633 | 0.681633 | 0.681633 | 0 | 0.008174 | 0.296935 | 522 | 32 | 76 | 16.3125 | 0.659401 | 0.149425 | 0 | 0 | 0 | 0 | 0.361111 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.266667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a49eab646b818bca17a2eac3acba44ec620d5a5e | 3,496 | py | Python | qrl/core/StakeValidator.py | djuhn/QRL-1 | 47c4b8beb8e1be8c5a0fdf16b33532f32899ce13 | [
"MIT"
] | null | null | null | qrl/core/StakeValidator.py | djuhn/QRL-1 | 47c4b8beb8e1be8c5a0fdf16b33532f32899ce13 | [
"MIT"
] | null | null | null | qrl/core/StakeValidator.py | djuhn/QRL-1 | 47c4b8beb8e1be8c5a0fdf16b33532f32899ce13 | [
"MIT"
] | 1 | 2021-11-03T06:56:27.000Z | 2021-11-03T06:56:27.000Z | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from google.protobuf.json_format import MessageToJson, Parse
from qrl.core import config
from qrl.core.Transaction import StakeTransaction
from qrl.generated import qrl_pb2
from qrl.crypto.misc import sha256_n
class StakeValidator:
"""
Stake Validator class to represent each unique Stake Validator
Maintains the cache of successfully validated hashes, saves validation
time by avoiding recalculation of the hash till the hash terminators.
"""
def __init__(self, stakevalidator_protobuf=None):
self._data = stakevalidator_protobuf
if not self._data:
self._data = qrl_pb2.StakeValidator()
@property
def pbdata(self):
return self._data
@property
def address(self) -> bytes:
return self._data.address
@property
def slave_public_key(self) -> bytes:
return self._data.slave_public_key
@property
def terminator_hash(self) -> bytes:
return self._data.terminator_hash
@property
def balance(self) -> int:
return self._data.balance
@property
def is_banned(self) -> bool:
return self._data.is_banned
@property
def is_active(self) -> bool:
return self._data.is_active
@property
def nonce(self) -> int:
return self._data.nonce
@property
def activation_blocknumber(self) -> int:
return self._data.activation_blocknumber
def increase_nonce(self):
self._data.nonce += 1
@staticmethod
def _hash_to_terminator(reveal_hash: bytes, times: int) -> bytes:
return sha256_n(reveal_hash, times)
@staticmethod
def create(balance: int,
stake_txn: StakeTransaction):
stakevalidator = StakeValidator()
stakevalidator._data.address = stake_txn.txfrom
stakevalidator._data.slave_public_key = stake_txn.slave_public_key
stakevalidator._data.terminator_hash = stake_txn.hash
if not stakevalidator._data.terminator_hash:
raise ValueError("terminator hash cannot be empty")
stakevalidator._data.balance = balance
if balance < config.dev.minimum_staking_balance_required:
raise ValueError("balance should be at least {}".format(config.dev.minimum_staking_balance_required))
stakevalidator._data.activation_blocknumber = stake_txn.activation_blocknumber
stakevalidator._data.nonce = 0
stakevalidator._data.is_banned = False
stakevalidator._data.is_active = True # Flag that represents if the stakevalidator has been deactivated by destake txn
return stakevalidator
def validate_hash(self, reveal_hash: bytes, block_idx: int) -> bool:
# FIXME: Measure with a profiler if we really need a cache here
times = block_idx - self.activation_blocknumber + 1
terminator_found = self._hash_to_terminator(reveal_hash, times)
terminator_expected = self.terminator_hash
return terminator_found == terminator_expected
@staticmethod
def from_json(json_data):
pbdata = qrl_pb2.StakeValidator()
Parse(json_data, pbdata)
return StakeValidator(pbdata)
def to_json(self):
return MessageToJson(self._data)
| 31.495495 | 128 | 0.680492 | 403 | 3,496 | 5.674938 | 0.322581 | 0.048972 | 0.055094 | 0.024923 | 0.134674 | 0.05422 | 0 | 0 | 0 | 0 | 0 | 0.004964 | 0.250858 | 3,496 | 110 | 129 | 31.781818 | 0.86827 | 0.140732 | 0 | 0.169014 | 0 | 0 | 0.020935 | 0 | 0 | 0 | 0 | 0.009091 | 0 | 1 | 0.225352 | false | 0 | 0.070423 | 0.15493 | 0.507042 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
a4a6b6bc1a07e212eb0593d122c2db090785358b | 690 | py | Python | circuitpython_typing/device_drivers.py | tekktrik/Adafruit_CircuitPython_Typing | f6e60bddbf853acd367e2abd77d3253a38af0189 | [
"MIT"
] | null | null | null | circuitpython_typing/device_drivers.py | tekktrik/Adafruit_CircuitPython_Typing | f6e60bddbf853acd367e2abd77d3253a38af0189 | [
"MIT"
] | 10 | 2022-02-14T02:43:06.000Z | 2022-03-28T18:34:41.000Z | circuitpython_typing/device_drivers.py | tekktrik/Adafruit_CircuitPython_Typing | f6e60bddbf853acd367e2abd77d3253a38af0189 | [
"MIT"
] | 3 | 2022-02-21T20:28:20.000Z | 2022-03-07T17:03:22.000Z | # SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney
# SPDX-License-Identifier: MIT
"""
`circuitpython_typing.device_drivers`
================================================================================
Type annotation definitions for device drivers. Used for `adafruit_register`.
* Author(s): Alec Delaney
"""
from adafruit_bus_device.i2c_device import I2CDevice
# # Protocol was introduced in Python 3.8.
try:
from typing import Protocol
except ImportError:
from typing_extensions import Protocol
# pylint: disable=too-few-public-methods
class I2CDeviceDriver(Protocol):
"""Describes classes that are drivers utilizing `I2CDevice`"""
i2c_device: I2CDevice
| 26.538462 | 80 | 0.684058 | 75 | 690 | 6.186667 | 0.693333 | 0.047414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019901 | 0.126087 | 690 | 25 | 81 | 27.6 | 0.749585 | 0.646377 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.571429 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
8efd24e6ffdf51325fc1702ee241c99388f98dff | 3,937 | py | Python | tests/unit/runners/test_asam.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | tests/unit/runners/test_asam.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | tests/unit/runners/test_asam.py | HudsonWu/mysalt | 8ce2f66e0d0338157923f0ea0dab912a0f43e52e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
tests.unit.runners.test_asam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the asam runner
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.runners.asam as asam
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
log = logging.getLogger(__name__)
class AsamRunnerVerifySslTest(TestCase, LoaderModuleMockMixin):
def setup_loader_modules(self):
opts = {
"asam": {
"prov1.domain.com": {
"username": "TheUsername",
"password": "ThePassword",
}
}
}
return {asam: {"__opts__": opts}}
def test_add_platform(self):
parse_html_content = MagicMock()
get_platform_set_name = MagicMock(return_value="plat-foo")
requests_mock = MagicMock()
# remove_platform
with patch("salt.runners.asam._parse_html_content", parse_html_content), patch(
"salt.runners.asam._get_platformset_name", get_platform_set_name
), patch("salt.runners.asam.requests.post", requests_mock):
asam.add_platform("plat-foo-2", "plat-foo", "prov1.domain.com")
requests_mock.assert_called_with(
'https://prov1.domain.com:3451/config/PlatformSetConfig.html',
auth=('TheUsername', 'ThePassword'),
data={'manual': 'false'},
verify=True
)
def test_remove_platform(self):
parse_html_content = MagicMock()
get_platform_set_name = MagicMock(return_value="plat-foo")
requests_mock = MagicMock()
# remove_platform
with patch("salt.runners.asam._parse_html_content", parse_html_content), patch(
"salt.runners.asam._get_platformset_name", get_platform_set_name
), patch("salt.runners.asam.requests.post", requests_mock):
asam.remove_platform("plat-foo", "prov1.domain.com")
requests_mock.assert_called_with(
"https://prov1.domain.com:3451/config/PlatformConfig.html",
auth=("TheUsername", "ThePassword"),
data={
"manual": "false",
"platformName": "plat-foo",
"platformSetName": "plat-foo",
"postType": "platformRemove",
"Submit": "Yes",
},
verify=True,
)
def test_list_platforms(self):
parse_html_content = MagicMock()
get_platforms = MagicMock(return_value=["plat-foo", "plat-bar"])
requests_mock = MagicMock()
# remove_platform
with patch("salt.runners.asam._parse_html_content", parse_html_content), patch(
"salt.runners.asam._get_platforms", get_platforms
), patch("salt.runners.asam.requests.post", requests_mock):
asam.list_platforms("prov1.domain.com")
requests_mock.assert_called_with(
"https://prov1.domain.com:3451/config/PlatformConfig.html",
auth=("TheUsername", "ThePassword"),
data={"manual": "false"},
verify=True,
)
def test_list_platform_sets(self):
parse_html_content = MagicMock()
get_platform_sets = MagicMock(return_value=["plat-foo", "plat-bar"])
requests_mock = MagicMock()
# remove_platform
with patch("salt.runners.asam._parse_html_content", parse_html_content), patch(
"salt.runners.asam._get_platforms", get_platform_sets
), patch("salt.runners.asam.requests.post", requests_mock):
asam.list_platform_sets("prov1.domain.com")
requests_mock.assert_called_with(
"https://prov1.domain.com:3451/config/PlatformSetConfig.html",
auth=("TheUsername", "ThePassword"),
data={"manual": "false"},
verify=True,
)
| 35.790909 | 87 | 0.618491 | 411 | 3,937 | 5.642336 | 0.211679 | 0.061665 | 0.084088 | 0.103493 | 0.715395 | 0.704614 | 0.690815 | 0.673566 | 0.673566 | 0.673566 | 0 | 0.009193 | 0.254001 | 3,937 | 109 | 88 | 36.119266 | 0.780388 | 0.044704 | 0 | 0.425 | 0 | 0 | 0.281142 | 0.110429 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0.0625 | false | 0.0625 | 0.075 | 0 | 0.1625 | 0.0125 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
f11ca3fdd4ba7c8d116c74428211e0b05be66c95 | 17,854 | py | Python | sdk/python/pulumi_azure_native/costmanagement/v20210101/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/costmanagement/v20210101/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/costmanagement/v20210101/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ._enums import *
__all__ = [
'ExportDatasetConfigurationArgs',
'ExportDatasetArgs',
'ExportDefinitionArgs',
'ExportDeliveryDestinationArgs',
'ExportDeliveryInfoArgs',
'ExportRecurrencePeriodArgs',
'ExportScheduleArgs',
'ExportTimePeriodArgs',
]
@pulumi.input_type
class ExportDatasetConfigurationArgs:
def __init__(__self__, *,
columns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.
:param pulumi.Input[Sequence[pulumi.Input[str]]] columns: Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).
"""
if columns is not None:
pulumi.set(__self__, "columns", columns)
@property
@pulumi.getter
def columns(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).
"""
return pulumi.get(self, "columns")
@columns.setter
def columns(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "columns", value)
@pulumi.input_type
class ExportDatasetArgs:
def __init__(__self__, *,
configuration: Optional[pulumi.Input['ExportDatasetConfigurationArgs']] = None,
granularity: Optional[pulumi.Input[Union[str, 'GranularityType']]] = None):
"""
The definition for data in the export.
:param pulumi.Input['ExportDatasetConfigurationArgs'] configuration: The export dataset configuration.
:param pulumi.Input[Union[str, 'GranularityType']] granularity: The granularity of rows in the export. Currently only 'Daily' is supported.
"""
if configuration is not None:
pulumi.set(__self__, "configuration", configuration)
if granularity is not None:
pulumi.set(__self__, "granularity", granularity)
@property
@pulumi.getter
def configuration(self) -> Optional[pulumi.Input['ExportDatasetConfigurationArgs']]:
"""
The export dataset configuration.
"""
return pulumi.get(self, "configuration")
@configuration.setter
def configuration(self, value: Optional[pulumi.Input['ExportDatasetConfigurationArgs']]):
pulumi.set(self, "configuration", value)
@property
@pulumi.getter
def granularity(self) -> Optional[pulumi.Input[Union[str, 'GranularityType']]]:
"""
The granularity of rows in the export. Currently only 'Daily' is supported.
"""
return pulumi.get(self, "granularity")
@granularity.setter
def granularity(self, value: Optional[pulumi.Input[Union[str, 'GranularityType']]]):
pulumi.set(self, "granularity", value)
@pulumi.input_type
class ExportDefinitionArgs:
def __init__(__self__, *,
timeframe: pulumi.Input[Union[str, 'TimeframeType']],
type: pulumi.Input[Union[str, 'ExportType']],
data_set: Optional[pulumi.Input['ExportDatasetArgs']] = None,
time_period: Optional[pulumi.Input['ExportTimePeriodArgs']] = None):
"""
The definition of an export.
:param pulumi.Input[Union[str, 'TimeframeType']] timeframe: The time frame for pulling data for the export. If custom, then a specific time period must be provided.
:param pulumi.Input[Union[str, 'ExportType']] type: The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.
:param pulumi.Input['ExportDatasetArgs'] data_set: The definition for data in the export.
:param pulumi.Input['ExportTimePeriodArgs'] time_period: Has time period for pulling data for the export.
"""
pulumi.set(__self__, "timeframe", timeframe)
pulumi.set(__self__, "type", type)
if data_set is not None:
pulumi.set(__self__, "data_set", data_set)
if time_period is not None:
pulumi.set(__self__, "time_period", time_period)
@property
@pulumi.getter
def timeframe(self) -> pulumi.Input[Union[str, 'TimeframeType']]:
"""
The time frame for pulling data for the export. If custom, then a specific time period must be provided.
"""
return pulumi.get(self, "timeframe")
@timeframe.setter
def timeframe(self, value: pulumi.Input[Union[str, 'TimeframeType']]):
pulumi.set(self, "timeframe", value)
@property
@pulumi.getter
def type(self) -> pulumi.Input[Union[str, 'ExportType']]:
"""
The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: pulumi.Input[Union[str, 'ExportType']]):
pulumi.set(self, "type", value)
@property
@pulumi.getter(name="dataSet")
def data_set(self) -> Optional[pulumi.Input['ExportDatasetArgs']]:
"""
The definition for data in the export.
"""
return pulumi.get(self, "data_set")
@data_set.setter
def data_set(self, value: Optional[pulumi.Input['ExportDatasetArgs']]):
pulumi.set(self, "data_set", value)
@property
@pulumi.getter(name="timePeriod")
def time_period(self) -> Optional[pulumi.Input['ExportTimePeriodArgs']]:
"""
Has time period for pulling data for the export.
"""
return pulumi.get(self, "time_period")
@time_period.setter
def time_period(self, value: Optional[pulumi.Input['ExportTimePeriodArgs']]):
pulumi.set(self, "time_period", value)
@pulumi.input_type
class ExportDeliveryDestinationArgs:
def __init__(__self__, *,
container: pulumi.Input[str],
resource_id: Optional[pulumi.Input[str]] = None,
root_folder_path: Optional[pulumi.Input[str]] = None,
sas_token: Optional[pulumi.Input[str]] = None,
storage_account: Optional[pulumi.Input[str]] = None):
"""
This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Azure Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ).
:param pulumi.Input[str] container: The name of the container where exports will be uploaded. If the container does not exist it will be created.
:param pulumi.Input[str] resource_id: The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.
:param pulumi.Input[str] root_folder_path: The name of the directory where exports will be uploaded.
:param pulumi.Input[str] sas_token: A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.
:param pulumi.Input[str] storage_account: The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.
"""
pulumi.set(__self__, "container", container)
if resource_id is not None:
pulumi.set(__self__, "resource_id", resource_id)
if root_folder_path is not None:
pulumi.set(__self__, "root_folder_path", root_folder_path)
if sas_token is not None:
pulumi.set(__self__, "sas_token", sas_token)
if storage_account is not None:
pulumi.set(__self__, "storage_account", storage_account)
@property
@pulumi.getter
def container(self) -> pulumi.Input[str]:
"""
The name of the container where exports will be uploaded. If the container does not exist it will be created.
"""
return pulumi.get(self, "container")
@container.setter
def container(self, value: pulumi.Input[str]):
pulumi.set(self, "container", value)
@property
@pulumi.getter(name="resourceId")
def resource_id(self) -> Optional[pulumi.Input[str]]:
"""
The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.
"""
return pulumi.get(self, "resource_id")
@resource_id.setter
def resource_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "resource_id", value)
@property
@pulumi.getter(name="rootFolderPath")
def root_folder_path(self) -> Optional[pulumi.Input[str]]:
"""
The name of the directory where exports will be uploaded.
"""
return pulumi.get(self, "root_folder_path")
@root_folder_path.setter
def root_folder_path(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "root_folder_path", value)
@property
@pulumi.getter(name="sasToken")
def sas_token(self) -> Optional[pulumi.Input[str]]:
"""
A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.
"""
return pulumi.get(self, "sas_token")
@sas_token.setter
def sas_token(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sas_token", value)
@property
@pulumi.getter(name="storageAccount")
def storage_account(self) -> Optional[pulumi.Input[str]]:
"""
The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.
"""
return pulumi.get(self, "storage_account")
@storage_account.setter
def storage_account(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "storage_account", value)
@pulumi.input_type
class ExportDeliveryInfoArgs:
def __init__(__self__, *,
destination: pulumi.Input['ExportDeliveryDestinationArgs']):
"""
The delivery information associated with a export.
:param pulumi.Input['ExportDeliveryDestinationArgs'] destination: Has destination for the export being delivered.
"""
pulumi.set(__self__, "destination", destination)
@property
@pulumi.getter
def destination(self) -> pulumi.Input['ExportDeliveryDestinationArgs']:
"""
Has destination for the export being delivered.
"""
return pulumi.get(self, "destination")
@destination.setter
def destination(self, value: pulumi.Input['ExportDeliveryDestinationArgs']):
pulumi.set(self, "destination", value)
@pulumi.input_type
class ExportRecurrencePeriodArgs:
def __init__(__self__, *,
from_: pulumi.Input[str],
to: Optional[pulumi.Input[str]] = None):
"""
The start and end date for recurrence schedule.
:param pulumi.Input[str] from_: The start date of recurrence.
:param pulumi.Input[str] to: The end date of recurrence.
"""
pulumi.set(__self__, "from_", from_)
if to is not None:
pulumi.set(__self__, "to", to)
@property
@pulumi.getter(name="from")
def from_(self) -> pulumi.Input[str]:
"""
The start date of recurrence.
"""
return pulumi.get(self, "from_")
@from_.setter
def from_(self, value: pulumi.Input[str]):
pulumi.set(self, "from_", value)
@property
@pulumi.getter
def to(self) -> Optional[pulumi.Input[str]]:
"""
The end date of recurrence.
"""
return pulumi.get(self, "to")
@to.setter
def to(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "to", value)
@pulumi.input_type
class ExportScheduleArgs:
def __init__(__self__, *,
recurrence: Optional[pulumi.Input[Union[str, 'RecurrenceType']]] = None,
recurrence_period: Optional[pulumi.Input['ExportRecurrencePeriodArgs']] = None,
status: Optional[pulumi.Input[Union[str, 'StatusType']]] = None):
"""
The schedule associated with the export.
:param pulumi.Input[Union[str, 'RecurrenceType']] recurrence: The schedule recurrence.
:param pulumi.Input['ExportRecurrencePeriodArgs'] recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.
:param pulumi.Input[Union[str, 'StatusType']] status: The status of the export's schedule. If 'Inactive', the export's schedule is paused.
"""
if recurrence is not None:
pulumi.set(__self__, "recurrence", recurrence)
if recurrence_period is not None:
pulumi.set(__self__, "recurrence_period", recurrence_period)
if status is not None:
pulumi.set(__self__, "status", status)
@property
@pulumi.getter
def recurrence(self) -> Optional[pulumi.Input[Union[str, 'RecurrenceType']]]:
"""
The schedule recurrence.
"""
return pulumi.get(self, "recurrence")
@recurrence.setter
def recurrence(self, value: Optional[pulumi.Input[Union[str, 'RecurrenceType']]]):
pulumi.set(self, "recurrence", value)
@property
@pulumi.getter(name="recurrencePeriod")
def recurrence_period(self) -> Optional[pulumi.Input['ExportRecurrencePeriodArgs']]:
"""
Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.
"""
return pulumi.get(self, "recurrence_period")
@recurrence_period.setter
def recurrence_period(self, value: Optional[pulumi.Input['ExportRecurrencePeriodArgs']]):
pulumi.set(self, "recurrence_period", value)
@property
@pulumi.getter
def status(self) -> Optional[pulumi.Input[Union[str, 'StatusType']]]:
"""
The status of the export's schedule. If 'Inactive', the export's schedule is paused.
"""
return pulumi.get(self, "status")
@status.setter
def status(self, value: Optional[pulumi.Input[Union[str, 'StatusType']]]):
pulumi.set(self, "status", value)
@pulumi.input_type
class ExportTimePeriodArgs:
def __init__(__self__, *,
from_: pulumi.Input[str],
to: pulumi.Input[str]):
"""
The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.
:param pulumi.Input[str] from_: The start date for export data.
:param pulumi.Input[str] to: The end date for export data.
"""
pulumi.set(__self__, "from_", from_)
pulumi.set(__self__, "to", to)
@property
@pulumi.getter(name="from")
def from_(self) -> pulumi.Input[str]:
"""
The start date for export data.
"""
return pulumi.get(self, "from_")
@from_.setter
def from_(self, value: pulumi.Input[str]):
pulumi.set(self, "from_", value)
@property
@pulumi.getter
def to(self) -> pulumi.Input[str]:
"""
The end date for export data.
"""
return pulumi.get(self, "to")
@to.setter
def to(self, value: pulumi.Input[str]):
pulumi.set(self, "to", value)
| 44.635 | 1,390 | 0.674359 | 2,179 | 17,854 | 5.407985 | 0.121156 | 0.085879 | 0.047522 | 0.032247 | 0.6037 | 0.458333 | 0.380771 | 0.333248 | 0.307705 | 0.283181 | 0 | 0.000145 | 0.22516 | 17,854 | 399 | 1,391 | 44.746867 | 0.85167 | 0.384956 | 0 | 0.304721 | 1 | 0 | 0.134094 | 0.035588 | 0 | 0 | 0 | 0 | 0 | 1 | 0.206009 | false | 0 | 0.025751 | 0 | 0.351931 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.