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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b6ee82cdbace99f18624c016c8604895ea1b9e9d | 64 | py | Python | tests/integration/stemlab-125-14/conftest.py | lneuhaus/pypga | 836932e4a5abbc9d52eb824b446f176af65485c0 | [
"MIT"
] | 1 | 2021-04-25T08:06:09.000Z | 2021-04-25T08:06:09.000Z | tests/integration/stemlab-125-14/conftest.py | lneuhaus/pypga | 836932e4a5abbc9d52eb824b446f176af65485c0 | [
"MIT"
] | null | null | null | tests/integration/stemlab-125-14/conftest.py | lneuhaus/pypga | 836932e4a5abbc9d52eb824b446f176af65485c0 | [
"MIT"
] | null | null | null | import pytest
@pytest.fixture
def client():
client = ...
| 9.142857 | 17 | 0.625 | 7 | 64 | 5.714286 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.234375 | 64 | 6 | 18 | 10.666667 | 0.816327 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f3d42decb96ac204eb42fa119d7db65eac837e8c | 692 | py | Python | src/parser/rules/name/i_rule_name.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/parser/rules/name/i_rule_name.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/parser/rules/name/i_rule_name.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from typing import TYPE_CHECKING
from abc import ABC, abstractmethod
if TYPE_CHECKING:
from ...dataclass.name_info import NameInfo
from .i_rules_name import IRulesName
class IRuleName(ABC):
@abstractmethod
def __init__(self, rules: 'IRulesName') -> None:
"""Constructor"""
@abstractmethod
def get_is_match(self, ni: 'NameInfo') -> bool:
"""
Gets if rule is a match
Args:
ni (NameInfo): name info
"""
@abstractmethod
def process_name(self, ni: 'NameInfo') -> None:
"""
Changes name info based upon rules match
Args:
ni (NameInfo): name info
""" | 23.862069 | 52 | 0.604046 | 79 | 692 | 5.139241 | 0.481013 | 0.078818 | 0.078818 | 0.093596 | 0.133005 | 0.133005 | 0 | 0 | 0 | 0 | 0 | 0.002053 | 0.296243 | 692 | 29 | 53 | 23.862069 | 0.831622 | 0.235549 | 0 | 0.25 | 0 | 0 | 0.058296 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
6d01928250cca29344c8bb93e556fed1b7dfa7ed | 197 | py | Python | scripts/create_video.py | olds/moab_tools | e108919ee2c67d478e05ffeed174511378914160 | [
"MIT"
] | null | null | null | scripts/create_video.py | olds/moab_tools | e108919ee2c67d478e05ffeed174511378914160 | [
"MIT"
] | 9 | 2020-03-24T16:24:06.000Z | 2022-03-11T23:34:16.000Z | scripts/create_video.py | olds/moab_tools | e108919ee2c67d478e05ffeed174511378914160 | [
"MIT"
] | null | null | null | from config import IMAGE_LOCATIONS
import datetime
yesterday = datetime.date.today() - datetime.timedelta(days = 1)
for location in IMAGE_LOCATIONS:
location.create_video(date=str(yesterday)) | 28.142857 | 64 | 0.796954 | 26 | 197 | 5.923077 | 0.692308 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005747 | 0.116751 | 197 | 7 | 65 | 28.142857 | 0.87931 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
6d2285175f165acdeb4c072ccd50b2cf222d0fed | 54 | py | Python | src/schedules/__init__.py | Talengi/phase | 60ff6f37778971ae356c5b2b20e0d174a8288bfe | [
"MIT"
] | 8 | 2016-01-29T11:53:40.000Z | 2020-03-02T22:42:02.000Z | src/schedules/__init__.py | Talengi/phase | 60ff6f37778971ae356c5b2b20e0d174a8288bfe | [
"MIT"
] | 289 | 2015-03-23T07:42:52.000Z | 2022-03-11T23:26:10.000Z | src/schedules/__init__.py | Talengi/phase | 60ff6f37778971ae356c5b2b20e0d174a8288bfe | [
"MIT"
] | 7 | 2015-12-08T09:03:20.000Z | 2020-05-11T15:36:51.000Z | default_app_config = 'schedules.apps.SchedulesConfig'
| 27 | 53 | 0.851852 | 6 | 54 | 7.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 54 | 1 | 54 | 54 | 0.862745 | 0 | 0 | 0 | 0 | 0 | 0.555556 | 0.555556 | 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 |
6d3bb469effdea2324d274a68721a94924c666c3 | 715 | py | Python | fruitpal/models.py | jubins/Fruitpal | ce83e846ac8f383d06d6cb4d4dad6ba66e35f0d4 | [
"MIT"
] | null | null | null | fruitpal/models.py | jubins/Fruitpal | ce83e846ac8f383d06d6cb4d4dad6ba66e35f0d4 | [
"MIT"
] | null | null | null | fruitpal/models.py | jubins/Fruitpal | ce83e846ac8f383d06d6cb4d4dad6ba66e35f0d4 | [
"MIT"
] | null | null | null | from flask_restful import fields
class ResourceFields(object):
def __init__(self):
pass
@staticmethod
def put_schema():
return {
'id': fields.Integer,
'country': fields.String,
'commodity': fields.String,
'fixed_overhead': fields.Float,
'variable_overhead': fields.Float,
}
class PricingModel(object):
def __init__(self):
pass
@staticmethod
def compute_fixed_overhead(price, volume, overhead):
return (price+overhead)*volume, f"({overhead:.2f} + {price}) * {volume}"
@staticmethod
def compute_variable_overhead(price, volume, overhead):
return (price+overhead)*volume
| 23.833333 | 80 | 0.616783 | 70 | 715 | 6.071429 | 0.442857 | 0.105882 | 0.061176 | 0.08 | 0.414118 | 0.414118 | 0.414118 | 0.244706 | 0 | 0 | 0 | 0.001927 | 0.274126 | 715 | 29 | 81 | 24.655172 | 0.816956 | 0 | 0 | 0.318182 | 0 | 0 | 0.12028 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.227273 | false | 0.090909 | 0.045455 | 0.136364 | 0.5 | 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 | 1 | 0 | 0 | 0 | 3 |
6d466e08b74e39ccf67ecb08fc551cb5db3bc2a7 | 201 | py | Python | colloquial/transcripts/urls.py | TeHikuMedia/django-colloquial | ca41e61b62b8915d44d903c65d07e45884a0f9c4 | [
"BSD-3-Clause"
] | 1 | 2018-10-29T19:28:31.000Z | 2018-10-29T19:28:31.000Z | colloquial/transcripts/urls.py | TeHikuMedia/django-colloquial | ca41e61b62b8915d44d903c65d07e45884a0f9c4 | [
"BSD-3-Clause"
] | 2 | 2017-09-17T21:34:32.000Z | 2018-08-30T03:32:32.000Z | colloquial/transcripts/urls.py | TeHikuMedia/django-colloquial | ca41e61b62b8915d44d903c65d07e45884a0f9c4 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from .models import Transcript
from ..colloquialisms.views import tags
urlpatterns = [
url(r'^tags/(?P<item_pk>\d+)', tags, {'item_cls': Transcript}, 'tags'),
]
| 20.1 | 75 | 0.696517 | 28 | 201 | 4.928571 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139303 | 201 | 9 | 76 | 22.333333 | 0.797688 | 0 | 0 | 0 | 0 | 0 | 0.169154 | 0.109453 | 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 |
6d61aeab5b388700621d2235b2ef3c2c4268cc21 | 261 | py | Python | Examples/put_worksheet_chart_legend.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | 3 | 2018-05-23T03:16:26.000Z | 2020-11-07T11:42:41.000Z | Examples/put_worksheet_chart_legend.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | null | null | null | Examples/put_worksheet_chart_legend.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | 4 | 2018-08-29T18:45:05.000Z | 2021-03-25T07:59:56.000Z | """
Test case for cells_charts_put_worksheet_chart_legend
Show legend in chart
"""
name ='myDocument.xlsx'
sheet_name ='Sheet3'
chartIndex = 0
folder = "Temp"
AuthUtil.Ready(name, folder) | 29 | 61 | 0.555556 | 27 | 261 | 5.148148 | 0.814815 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012048 | 0.363985 | 261 | 9 | 62 | 29 | 0.825301 | 0 | 0 | 0 | 0 | 0 | 0.160256 | 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 |
6d655e768dd863514408c7ba8b32a3e3726febdf | 218 | py | Python | gpio/init.py | hpiso/baby_smart | 5785e943b3842c5c34edc2442a75a9d13ec26a35 | [
"MIT"
] | null | null | null | gpio/init.py | hpiso/baby_smart | 5785e943b3842c5c34edc2442a75a9d13ec26a35 | [
"MIT"
] | null | null | null | gpio/init.py | hpiso/baby_smart | 5785e943b3842c5c34edc2442a75a9d13ec26a35 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(2,GPIO.OUT)
GPIO.setup(3,GPIO.OUT)
GPIO.setup(4,GPIO.OUT)
GPIO.output(2, GPIO.LOW)
GPIO.output(3, GPIO.LOW)
GPIO.output(4, GPIO.LOW)
| 16.769231 | 24 | 0.743119 | 42 | 218 | 3.857143 | 0.357143 | 0.166667 | 0.203704 | 0.197531 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03 | 0.082569 | 218 | 12 | 25 | 18.166667 | 0.78 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.111111 | 0 | 0.111111 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ed9685dbc726420dcbcc1dfbe9c8c09d0fd8f387 | 593 | py | Python | data_structures/arrays/arrays.py | yznnck/algodat_practice | f8b6240f51c56b9e63e140f791327fa5055fd23d | [
"MIT"
] | 3 | 2021-12-27T00:52:50.000Z | 2022-01-22T23:05:10.000Z | data_structures/arrays/arrays.py | ybrenning/algodat_practice | f8b6240f51c56b9e63e140f791327fa5055fd23d | [
"MIT"
] | null | null | null | data_structures/arrays/arrays.py | ybrenning/algodat_practice | f8b6240f51c56b9e63e140f791327fa5055fd23d | [
"MIT"
] | null | null | null | # Lists in Python are mutable objects that may contain
# any number of items of different types
my_list = [1, "Hello", True, 3.4]
# Python allows negative indexing
my_list = [1, 2, 3, 4, 5, 6]
print(my_list[-1])
# We can access a range of items within the list using slicing
# my_list[start:stop:step]
my_list = ['H', 'e', 'l', 'l', 'o', 'W', 'o', 'r', 'l', 'd']
print(my_list[2:5])
print(my_list[5:])
print(my_list[:-2])
print(my_list[::-1])
my_list = [1, 2, 3, 4, 5]
my_list.append(6)
my_list.insert(2, 7)
print(my_list)
print(my_list.pop())
print(my_list.pop(0))
print(my_list.count(3))
| 24.708333 | 62 | 0.657673 | 118 | 593 | 3.169492 | 0.457627 | 0.256684 | 0.264706 | 0.042781 | 0.058824 | 0.058824 | 0.058824 | 0 | 0 | 0 | 0 | 0.04931 | 0.145025 | 593 | 23 | 63 | 25.782609 | 0.688363 | 0.352445 | 0 | 0 | 0 | 0 | 0.039683 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.6 | 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 | 0 | 1 | 0 | 3 |
edb076c5620efbb35a5372533df183e77d486274 | 962 | py | Python | checkout/migrations/0006_auto_20210426_1327.py | Gregory4321/cooks_finest | a7980ede050882ded5471d1cdb0dab216256a12a | [
"PostgreSQL"
] | null | null | null | checkout/migrations/0006_auto_20210426_1327.py | Gregory4321/cooks_finest | a7980ede050882ded5471d1cdb0dab216256a12a | [
"PostgreSQL"
] | null | null | null | checkout/migrations/0006_auto_20210426_1327.py | Gregory4321/cooks_finest | a7980ede050882ded5471d1cdb0dab216256a12a | [
"PostgreSQL"
] | 1 | 2021-04-30T10:53:30.000Z | 2021-04-30T10:53:30.000Z | # Generated by Django 3.1.7 on 2021-04-26 13:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('checkout', '0005_order_user_profile'),
]
operations = [
migrations.AlterField(
model_name='order',
name='county',
field=models.CharField(blank=True, default='', max_length=80),
),
migrations.AlterField(
model_name='order',
name='postcode',
field=models.CharField(blank=True, default='', max_length=20),
),
migrations.AlterField(
model_name='order',
name='street_address2',
field=models.CharField(blank=True, default='', max_length=80),
),
migrations.AlterField(
model_name='orderlineitem',
name='product_size',
field=models.CharField(blank=True, default='', max_length=2),
),
]
| 28.294118 | 74 | 0.571726 | 95 | 962 | 5.652632 | 0.484211 | 0.148976 | 0.18622 | 0.216015 | 0.608939 | 0.608939 | 0.450652 | 0.450652 | 0.283054 | 0.283054 | 0 | 0.040179 | 0.301455 | 962 | 33 | 75 | 29.151515 | 0.758929 | 0.046778 | 0 | 0.481481 | 1 | 0 | 0.10929 | 0.025137 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.037037 | 0 | 0.148148 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
edb15834fb92839e11be8dbf1983ea349ae760b6 | 224 | py | Python | output/models/ibm_data/mixed/assertions/list_union/listunion3_xsd/listunion3.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ibm_data/mixed/assertions/list_union/listunion4_xsd/listunion4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ibm_data/mixed/assertions/list_union/listunion4_xsd/listunion4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional, Union
from xsdata.models.datatype import XmlDate
@dataclass
class Example:
value: Optional[Union[int, XmlDate]] = field(
default=None
)
| 20.363636 | 49 | 0.741071 | 27 | 224 | 6.148148 | 0.666667 | 0.156627 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 224 | 10 | 50 | 22.4 | 0.912088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.375 | 0 | 0.625 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
edbc1050504299aa35ee5c21af45982c24c52d89 | 59 | py | Python | timecardsite/__init__.py | holden-nelson/ShiftAlert | ce8d1d9040deb60f71e456604ac178dd9eb6b842 | [
"Unlicense"
] | null | null | null | timecardsite/__init__.py | holden-nelson/ShiftAlert | ce8d1d9040deb60f71e456604ac178dd9eb6b842 | [
"Unlicense"
] | null | null | null | timecardsite/__init__.py | holden-nelson/ShiftAlert | ce8d1d9040deb60f71e456604ac178dd9eb6b842 | [
"Unlicense"
] | 1 | 2022-02-04T00:16:04.000Z | 2022-02-04T00:16:04.000Z | default_app_config = 'timecardsite.apps.TimecardsiteConfig' | 59 | 59 | 0.881356 | 6 | 59 | 8.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033898 | 59 | 1 | 59 | 59 | 0.877193 | 0 | 0 | 0 | 0 | 0 | 0.6 | 0.6 | 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 |
edd2d89ac0ea090d0a2383abd9e87e88db687f2c | 336 | py | Python | tests/test_pump.py | prcutler/pi-pump | 3930edf3d1ef0c0ab39ee9dc33ad0997c47fc7dc | [
"MIT"
] | 1 | 2020-01-21T22:47:05.000Z | 2020-01-21T22:47:05.000Z | tests/test_pump.py | prcutler/pi-pump | 3930edf3d1ef0c0ab39ee9dc33ad0997c47fc7dc | [
"MIT"
] | 262 | 2019-07-04T11:29:12.000Z | 2022-03-21T10:39:52.000Z | tests/test_pump.py | prcutler/pi-pump | 3930edf3d1ef0c0ab39ee9dc33ad0997c47fc7dc | [
"MIT"
] | null | null | null | from gpiozero import *
def test_pump_on(mock_factory):
pump1 = mock_factory.pin(4)
with OutputDevice(4) as device:
device.on()
assert pump1.state
device.off()
assert not pump1.state
def test_pump_time():
pass
def test_pump_stop(mock_factory):
pass
def test_pump_series():
pass
| 12.923077 | 35 | 0.654762 | 47 | 336 | 4.446809 | 0.510638 | 0.133971 | 0.210526 | 0.143541 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020161 | 0.261905 | 336 | 25 | 36 | 13.44 | 0.822581 | 0 | 0 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.285714 | false | 0.214286 | 0.071429 | 0 | 0.357143 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
edd521a939ea9a3b6e94c9380b456957f9c00f0d | 164 | py | Python | tests/paths.py | hasadna/OpenCaptcha | 4cf4bf11b03f6b0aef861bc547be93077ddb6742 | [
"MIT"
] | 3 | 2020-12-10T23:15:33.000Z | 2022-01-26T06:47:44.000Z | tests/paths.py | hasadna/OpenCaptcha | 4cf4bf11b03f6b0aef861bc547be93077ddb6742 | [
"MIT"
] | 15 | 2020-04-12T12:37:20.000Z | 2020-04-24T16:06:43.000Z | tests/paths.py | hasadna/OpenCaptcha | 4cf4bf11b03f6b0aef861bc547be93077ddb6742 | [
"MIT"
] | null | null | null | import os
def data_file(path):
this_dir = os.path.dirname(__file__)
data_dir = os.path.join(this_dir, 'testdata')
return os.path.join(data_dir, path)
| 20.5 | 49 | 0.70122 | 27 | 164 | 3.925926 | 0.444444 | 0.169811 | 0.169811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170732 | 164 | 7 | 50 | 23.428571 | 0.779412 | 0 | 0 | 0 | 0 | 0 | 0.04878 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 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 |
61180214baf22860462546bb1eeb3e9b3a069573 | 84 | py | Python | very_scratch/server/example6/settings.py | ibrahemesam/Fos | f2f284a2c7bdc24dafafebb8aa3141ebf225e451 | [
"BSD-3-Clause"
] | 2 | 2016-08-03T10:33:08.000Z | 2021-06-23T18:50:14.000Z | scratch/very_scratch/server/example6/settings.py | fos/fos-legacy | db6047668781a0615abcebc7d55a7164f3105047 | [
"BSD-3-Clause"
] | null | null | null | scratch/very_scratch/server/example6/settings.py | fos/fos-legacy | db6047668781a0615abcebc7d55a7164f3105047 | [
"BSD-3-Clause"
] | 1 | 2021-07-11T00:16:46.000Z | 2021-07-11T00:16:46.000Z | cycles_per_tick = 5000
port = 5555
hostname = '192.168.1.2'
websocket_location = "/" | 21 | 24 | 0.72619 | 13 | 84 | 4.461538 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.219178 | 0.130952 | 84 | 4 | 25 | 21 | 0.575342 | 0 | 0 | 0 | 0 | 0 | 0.141176 | 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 | 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 |
6126aa60e38ce29bbc5a8ad60779a18c2dcb9709 | 302 | py | Python | packages/PIPS/validation/Transformations/Flatten_code.sub/unnormalize_expression.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/PIPS/validation/Transformations/Flatten_code.sub/unnormalize_expression.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/PIPS/validation/Transformations/Flatten_code.sub/unnormalize_expression.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z | from __future__ import with_statement # this is to work with python2.5
from validation import vworkspace
with vworkspace() as w:
w.props.flatten_code_unroll = False
w.all_functions.validate_phases("coarse_grain_parallelization","flatten_code","coarse_grain_parallelization","loop_fusion")
| 27.454545 | 127 | 0.804636 | 41 | 302 | 5.560976 | 0.707317 | 0.096491 | 0.22807 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007519 | 0.119205 | 302 | 10 | 128 | 30.2 | 0.849624 | 0.099338 | 0 | 0 | 0 | 0 | 0.294776 | 0.208955 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 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 |
6129d1eef214cf77f705ce7e532056d3e4a25ca2 | 175 | py | Python | setup.py | sibyjackgrove/gym-SolarPVDER-environment | 0f24cc2eac711001d6631c130ddc2a63c0765702 | [
"MIT"
] | 7 | 2019-04-18T22:05:34.000Z | 2022-03-14T07:36:33.000Z | setup.py | sibyjackgrove/gym-SolarPVDER-environment | 0f24cc2eac711001d6631c130ddc2a63c0765702 | [
"MIT"
] | 2 | 2019-11-19T16:52:24.000Z | 2020-10-19T14:41:32.000Z | setup.py | sibyjackgrove/gym-SolarPVDER-environment | 0f24cc2eac711001d6631c130ddc2a63c0765702 | [
"MIT"
] | 1 | 2019-12-05T01:07:32.000Z | 2019-12-05T01:07:32.000Z | from setuptools import setup
setup(name='gym_PVDER',
version='0.0.1',
install_requires=['gym','scipy','numpy','matplotlib']#And any other dependencies required
)
| 25 | 95 | 0.702857 | 23 | 175 | 5.26087 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02 | 0.142857 | 175 | 6 | 96 | 29.166667 | 0.786667 | 0.2 | 0 | 0 | 0 | 0 | 0.266187 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 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 |
b61756e0f31fb0acc34d8cb551636dd8cbf2dbab | 9,049 | py | Python | populate.py | lordbeerus0505/HandGesture | 41b523c09d8af25b6aace9fa65eadf31d9794097 | [
"MIT"
] | 1 | 2021-11-13T04:18:19.000Z | 2021-11-13T04:18:19.000Z | populate.py | TanmayH/HandGesture | 41b523c09d8af25b6aace9fa65eadf31d9794097 | [
"MIT"
] | null | null | null | populate.py | TanmayH/HandGesture | 41b523c09d8af25b6aace9fa65eadf31d9794097 | [
"MIT"
] | 2 | 2020-07-06T14:07:59.000Z | 2021-11-13T04:14:50.000Z | # def form_list():
# with open("words.txt",'r') as f:
# import pdb; pdb.set_trace()
# data=f.readlines()
# form_list()
data=['TEMPERATURE', 'PARTICULAR', 'INSTRUMENT', 'EXPERIMENT', 'EXPERIENCE', 'ESPECIALLY', 'DICTIONARY', 'SUBSTANCE', 'REPRESENT', 'PARAGRAPH', 'NECESSARY', 'DIFFICULT', 'DETERMINE', 'CONTINENT', 'CONSONANT', 'CONDITION', 'CHARACTER', 'TRIANGLE', 'TOGETHER', 'THOUSAND', 'SYLLABLE', 'SURPRISE', 'SUBTRACT', 'STRAIGHT', 'SOLUTION', 'SHOULDER', 'SEPARATE', 'SENTENCE', 'REMEMBER', 'QUOTIENT', 'QUESTION', 'PROPERTY', 'PROBABLE', 'PRACTICE', 'POSSIBLE', 'POSITION', 'POPULATE', 'ORIGINAL', 'OPPOSITE', 'NEIGHBOR', 'MULTIPLY', 'MOUNTAIN', 'MOLECULE', 'MATERIAL', 'LANGUAGE', 'INTEREST', 'INDUSTRY', 'INDICATE', 'FRACTION', 'EXERCISE', 'ELECTRIC', 'DIVISION', 'DESCRIBE', 'CONTINUE', 'CONSIDER', 'COMPLETE', 'CHILDREN', 'WRITTEN', 'WHETHER', 'WEATHER', 'VILLAGE', 'TROUBLE', 'THROUGH', 'THOUGHT', 'SURFACE', 'SUPPORT', 'SUGGEST', 'SUCCESS', 'SUBJECT', 'STUDENT', 'STRETCH', 'STRANGE', 'STATION', 'SPECIAL', 'SOLDIER', 'SIMILAR', 'SEVERAL', 'SEGMENT', 'SECTION', 'SCIENCE', 'REQUIRE', 'RECEIVE', 'PROVIDE', 'PROTECT', 'PRODUCT', 'PRODUCE', 'PROCESS', 'PROBLEM', 'PRESENT', 'PREPARE', 'PICTURE', 'PERHAPS', 'PATTERN', 'OPERATE', 'OBSERVE', 'NUMERAL', 'NOTHING', 'NATURAL', 'MORNING', 'MILLION', 'MEASURE', 'MACHINE', 'INSTANT', 'INCLUDE', 'IMAGINE', 'HUNDRED', 'HISTORY', 'GENERAL', 'FORWARD', 'EXAMPLE', 'EVENING', 'ELEMENT', 'DISTANT', 'DISCUSS', 'DEVELOP', 'DECIMAL', 'CURRENT', 'COUNTRY', 'CORRECT', 'CONTROL', 'CONTAIN', 'CONNECT', 'COMPARE', 'COMPANY', 'COLLECT', 'CERTAIN', 'CENTURY', 'CAPTAIN', 'CAPITAL', 'BROUGHT', 'BROTHER', 'BETWEEN', 'BELIEVE', 'ARRANGE', 'AGAINST', 'YELLOW', 'WONDER', 'WINTER', 'WINDOW', 'WEIGHT', 'VALLEY', 'TWENTY', 'TRAVEL', 'TOWARD', 'THOUGH', 'SYSTEM', 'SYMBOL', 'SUPPLY', 'SUMMER', 'SUFFIX', 'SUDDEN', 'STRONG', 'STRING', 'STREET', 'STREAM', 'SQUARE', 'SPRING', 'SPREAD', 'SPEECH', 'SISTER', 'SINGLE', 'SIMPLE', 'SILVER', 'SILENT', 'SHOULD', 'SETTLE', 'SELECT', 'SECOND', 'SEASON', 'SEARCH', 'SCHOOL', 'RESULT', 'REPEAT', 'REGION', 'RECORD', 'REASON', 'RATHER', 'PROPER', 'PRETTY', 'PLURAL', 'PLEASE', 'PLANET', 'PHRASE', 'PERSON', 'PERIOD', 'PEOPLE', 'PARENT', 'OXYGEN', 'OFFICE', 'OBJECT', 'NUMBER', 'NOTICE', 'NATURE', 'NATION', 'MOTION', 'MOTHER', 'MOMENT', 'MODERN', 'MINUTE', 'MIDDLE', 'METHOD', 'MELODY', 'MATTER', 'MASTER', 'MARKET', 'MAGNET', 'LOCATE', 'LITTLE', 'LISTEN', 'LIQUID', 'LETTER', 'LENGTH', 'ISLAND', 'INVENT', 'INSECT', 'HAPPEN', 'GROUND', 'GOVERN', 'GENTLE', 'GATHER', 'GARDEN', 'FRIEND', 'FOREST', 'FOLLOW', 'FLOWER', 'FINISH', 'FINGER', 'FIGURE', 'FATHER', 'FAMOUS', 'FAMILY', 'EXPECT', 'EXCITE', 'EXCEPT', 'EQUATE', 'ENOUGH', 'ENGINE', 'ENERGY', 'EITHER', 'EFFECT', 'DURING', 'DOUBLE', 'DOLLAR', 'DOCTOR', 'DIVIDE', 'DIRECT', 'DIFFER', 'DESIGN', 'DESERT', 'DEPEND', 'DEGREE', 'DECIDE', 'DANGER', 'CREATE', 'CREASE', 'COURSE', 'COTTON', 'CORNER', 'COMMON', 'COLUMN', 'COLONY', 'CLOTHE', 'CIRCLE', 'CHOOSE', 'CHARGE', 'CHANGE', 'CHANCE', 'CENTER', 'CAUGHT', 'BRIGHT', 'BRANCH', 'BOUGHT', 'BOTTOM', 'BETTER', 'BEHIND', 'BEFORE', 'BEAUTY', 'ARRIVE', 'APPEAR', 'ANSWER', 'ANIMAL', 'ALWAYS', 'AFRAID', 'YOUNG', 'WROTE', 'WRONG', 'WRITE', 'WOULD', 'WORLD', "WON'T", 'WOMEN', 'WOMAN', 'WHOSE', 'WHOLE', 'WHITE', 'WHILE', 'WHICH', 'WHERE', 'WHEEL', 'WATER', 'WATCH', 'VOWEL', 'VOICE', 'VISIT', 'VALUE', 'USUAL', 'UNTIL', 'UNDER', 'TRUCK', 'TRAIN', 'TRADE', 'TRACK', 'TOUCH', 'TOTAL', 'THROW', 'THREE', 'THOSE', 'THIRD', 'THINK', 'THING', 'THICK', 'THESE', 'THERE', 'THEIR', 'THANK', 'TEETH', 'TEACH', 'TABLE', 'SUGAR', 'STUDY', 'STORY', 'STORE', 'STOOD', 'STONE', 'STILL', 'STICK', 'STEEL', 'STEAM', 'STEAD', 'STATE', 'START', 'STAND', 'SPOKE', 'SPEND', 'SPELL', 'SPEED', 'SPEAK', 'SPACE', 'SOUTH', 'SOUND', 'SOLVE', 'SMILE', 'SMELL', 'SMALL', 'SLEEP', 'SLAVE', 'SKILL', 'SINCE', 'SIGHT', 'SHOUT', 'SHORT', 'SHORE', 'SHINE', 'SHELL', 'SHEET', 'SHARP', 'SHARE', 'SHAPE', 'SHALL', 'SEVEN', 'SERVE', 'SENSE', 'SCORE', 'SCALE', 'ROUND', 'RIVER', 'RIGHT', 'REPLY', 'READY', 'REACH', 'RANGE', 'RAISE', 'RADIO', 'QUITE', 'QUIET', 'QUICK', 'QUART', 'PROVE', 'PRINT', 'PRESS', 'POWER', 'POUND', 'POINT', 'PLANT', 'PLANE', 'PLAIN', 'PLACE', 'PITCH', 'PIECE', 'PARTY', 'PAPER', 'PAINT', 'OTHER', 'ORGAN', 'ORDER', 'OFTEN', 'OFFER', 'OCEAN', 'OCCUR', 'NORTH', 'NOISE', 'NIGHT', 'NEVER', 'MUSIC', 'MOUTH', 'MOUNT', 'MONTH', 'MONEY', 'MIGHT', 'METAL', 'MEANT', 'MATCH', 'MAJOR', 'LIGHT', 'LEVEL', 'LEAVE', 'LEAST', 'LEARN', 'LAUGH', 'LARGE', 'HURRY', 'HUMAN', 'HOUSE', 'HORSE', 'HEAVY', 'HEART', 'HEARD', 'HAPPY', 'GUIDE', 'GUESS', 'GROUP', 'GREEN', 'GREAT', 'GRASS', 'GRAND', 'GLASS', 'FRUIT', 'FRONT', 'FRESH', 'FOUND', 'FORCE', 'FLOOR', 'FIRST', 'FINAL', 'FIGHT', 'FIELD', 'FAVOR', 'EXACT', 'EVERY', 'EVENT', 'EQUAL', 'ENTER', 'ENEMY', 'EIGHT', 'EARTH', 'EARLY', 'DRIVE', 'DRINK', 'DRESS', 'DREAM', "DON'T", 'DEATH', 'DANCE', 'CROWD', 'CROSS', 'COVER', 'COUNT', 'COULD', 'COLOR', 'COAST', 'CLOUD', 'CLOSE', 'CLOCK', 'CLIMB', 'CLEAR', 'CLEAN', 'CLASS', 'CLAIM', 'CHORD', 'CHILD', 'CHIEF', 'CHICK', 'CHECK', 'CHART', 'CHAIR', 'CAUSE', 'CATCH', 'CARRY', 'BUILD', 'BROWN', 'BROKE', 'BROAD', 'BRING', 'BREAK', 'BREAD', 'BOARD', 'BLOOD', 'BLOCK', 'BLACK', 'BEGIN', 'BEGAN', 'BASIC', 'APPLE', 'ANGER', 'AMONG', 'ALLOW', 'AGREE', 'AGAIN', 'AFTER', 'ABOVE', 'ABOUT', 'YOUR', 'YEAR', 'YARD', 'WORK', 'WORD', 'WOOD', 'WITH', 'WISH', 'WIRE', 'WING', 'WIND', 'WILL', 'WILD', 'WIFE', 'WIDE', 'WHEN', 'WHAT', 'WEST', 'WERE', 'WENT', 'WELL', 'WEEK', 'WEAR', 'WAVE', 'WASH', 'WARM', 'WANT', 'WALL', 'WALK', 'WAIT', 'VIEW', 'VERY', 'VERB', 'VARY', 'UNIT', 'TYPE', 'TURN', 'TUBE', 'TRUE', 'TRIP', 'TREE', 'TOWN', 'TOOL', 'TOOK', 'TONE', 'TOLD', 'TIRE', 'TINY', 'TIME', 'THUS', 'THIS', 'THIN', 'THEY', 'THEN', 'THEM', 'THAT', 'THAN', 'TEST', 'TERM', 'TELL', 'TEAM', 'TALL', 'TALK', 'TAKE', 'TAIL', 'SWIM', 'SURE', 'SUIT', 'SUCH', 'STOP', 'STEP', 'STAY', 'STAR', 'SPOT', 'SOON', 'SONG', 'SOME', 'SOIL', 'SOFT', 'SNOW', 'SLOW', 'SLIP', 'SKIN', 'SIZE', 'SING', 'SIGN', 'SIDE', 'SHOW', 'SHOP', 'SHOE', 'SHIP', 'SENT', 'SEND', 'SELL', 'SELF', 'SEEM', 'SEED', 'SEAT', 'SAVE', 'SAND', 'SAME', 'SALT', 'SAIL', 'SAID', 'SAFE', 'RULE', 'ROSE', 'ROPE', 'ROOT', 'ROOM', 'ROLL', 'ROCK', 'ROAD', 'RISE', 'RING', 'RIDE', 'RICH', 'REST', 'REAL', 'READ', 'RAIN', 'RAIL', 'RACE', 'PUSH', 'PULL', 'POST', 'POSE', 'PORT', 'POOR', 'POEM', 'PLAY', 'PLAN', 'PICK', 'PATH', 'PAST', 'PASS', 'PART', 'PAIR', 'PAGE', 'OVER', 'OPEN', 'ONLY', 'ONCE', 'NOUN', 'NOTE', 'NOSE', 'NOON', 'NINE', 'NEXT', 'NEED', 'NEAR', 'NAME', 'MUST', 'MUCH', 'MOVE', 'MOST', 'MORE', 'MOON', 'MISS', 'MINE', 'MIND', 'MILK', 'MILE', 'MEET', 'MEAT', 'MEAN', 'MASS', 'MARK', 'MANY', 'MAKE', 'MAIN', 'MADE', 'LOVE', 'LOUD', 'LOST', 'LOOK', 'LONG', 'LONE', 'LIVE', 'LIST', 'LINE', 'LIKE', 'LIFT', 'LIFE', 'LESS', 'LEFT', 'LEAD', 'LATE', 'LAST', 'LAND', 'LAKE', 'LADY', 'KNOW', 'KNEW', 'KING', 'KIND', 'KILL', 'KEPT', 'KEEP', 'JUST', 'JUMP', 'JOIN', 'IRON', 'INCH', 'IDEA', 'HUNT', 'HUGE', 'HOUR', 'HOPE', 'HOME', 'HOLE', 'HOLD', 'HILL', 'HIGH', 'HERE', 'HELP', 'HELD', 'HEAT', 'HEAR', 'HEAD', 'HAVE', 'HARD', 'HAND', 'HALF', 'HAIR', 'GROW', 'GREW', 'GRAY', 'GOOD', 'GONE', 'GOLD', 'GLAD', 'GIVE', 'GIRL', 'GAVE', 'GAME', 'FULL', 'FROM', 'FREE', 'FOUR', 'FORM', 'FOOT', 'FOOD', 'FLOW', 'FLAT', 'FIVE', 'FISH', 'FIRE', 'FINE', 'FIND', 'FILL', 'FELT', 'FELL', 'FEET', 'FEEL', 'FEED', 'FEAR', 'FAST', 'FARM', 'FALL', 'FAIR', 'FACT', 'FACE', 'EVER', 'EVEN', 'ELSE', 'EDGE', 'EAST', 'EASE', 'EACH', 'DUCK', 'DROP', 'DRAW', 'DOWN', 'DOOR', 'DONE', 'DOES', 'DEEP', 'DEAR', 'DEAL', 'DEAD', 'DARK', 'CROP', 'COST', 'CORN', 'COPY', 'COOL', 'COOK', 'COME', 'COLD', 'COAT', 'CITY', 'CENT', 'CELL', 'CASE', 'CARE', 'CARD', 'CAMP', 'CAME', 'CALL', 'BUSY', 'BURN', 'BOTH', 'BORN', 'BOOK', 'BONE', 'BODY', 'BOAT', 'BLUE', 'BLOW', 'BIRD', 'BEST', 'BELL', 'BEEN', 'BEAT', 'BEAR', 'BASE', 'BANK', 'BAND', 'BALL', 'BACK', 'BABY', 'ATOM', 'AREA', 'ALSO', 'ABLE', 'YOU', 'YET', 'YES', 'WIN', 'WHY', 'WHO', 'WAY', 'WAS', 'WAR', 'USE', 'TWO', 'TRY', 'TOP', 'TOO', 'TIE', 'THE', 'TEN', 'SUN', 'SON', 'SKY', 'SIX', 'SIT', 'SHE', 'SET', 'SEE', 'SEA', 'SAY', 'SAW', 'SAT', 'RUN', 'RUB', 'ROW', 'RED', 'RAN', 'PUT', 'PAY', 'OWN', 'OUT', 'OUR', 'ONE', 'OLD', 'OIL', 'OFF', 'NOW', 'NOR', 'NEW', 'NEC', 'MIX', 'MEN', 'MAY', 'MAP', 'MAN', 'LOW', 'LOT', 'LOG', 'LIE', 'LET', 'LEG', 'LED', 'LAY', 'LAW', 'KEY', 'JOY', 'JOB', 'ICE', 'HOW', 'HOT', 'HOT', 'HIT', 'HIS', 'HIM', 'HER', 'HAT', 'HAS', 'HAD', 'GUN', 'GOT', 'GET', 'GAS', 'FUN', 'FOR', 'FLY', 'FIT', 'FIG', 'FEW', 'FAT', 'FAR', 'EYE', 'END', 'EGG', 'EAT', 'EAR', 'DRY', 'DOG', 'DIE', 'DID', 'DAY', 'DAD', 'CUT', 'CRY', 'COW', 'CAT', 'CAR', 'CAN', 'BUY', 'BUT', 'BOY', 'BOX', 'BIT', 'BIG', 'BED', 'BAT', 'BAR', 'BAD', 'ASK', 'ART', 'ARM', 'ARE', 'ANY', 'AND', 'ALL', 'AIR', 'AGO', 'AGE', 'ADD', 'ACT', 'WE', 'US', 'UP', 'TO', 'SO', 'OR', 'ON', 'OH', 'OF', 'NO', 'MY', 'ME', 'IT', 'IS', 'IN', 'IF', 'HE', 'GO', 'DO', 'BY', 'BE', 'AT', 'AS', 'AN', 'AM', 'I', 'A']
# import pdb; pdb.set_trace()
# data.sort(reverse=true) | 904.9 | 8,844 | 0.547795 | 1,032 | 9,049 | 4.799419 | 0.98062 | 0.00323 | 0.004846 | 0.006057 | 0.009691 | 0.009691 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116145 | 9,049 | 10 | 8,845 | 904.9 | 0.61928 | 0.019892 | 0 | 0 | 0 | 0 | 0.546039 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 1 | 0 | 0 | 0 | 0 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
b626361e8ca4848acbb5a0011df51b40d5925331 | 279 | py | Python | threadify/__init__.py | 300bps/threadify | be8e5516f3909af388fe82b05557e78279637bc1 | [
"MIT"
] | null | null | null | threadify/__init__.py | 300bps/threadify | be8e5516f3909af388fe82b05557e78279637bc1 | [
"MIT"
] | null | null | null | threadify/__init__.py | 300bps/threadify | be8e5516f3909af388fe82b05557e78279637bc1 | [
"MIT"
] | null | null | null | # Threadify Python Package
#
# David Smith
# 3/10/21
# 'from threadify import *' will import the following list of modules and symbols from this file into the namespace
__all__ = ["Threadify"]
# Import the following from modules in the package
from .threadify import Threadify
| 25.363636 | 115 | 0.767025 | 40 | 279 | 5.25 | 0.6 | 0.214286 | 0.180952 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021645 | 0.172043 | 279 | 10 | 116 | 27.9 | 0.887446 | 0.741935 | 0 | 0 | 0 | 0 | 0.138462 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
b6452d96038954ac24f0917dbd0d0a94f30fc210 | 553 | py | Python | EZModule/__init__.py | deportir/EZ | 2cd031a2189dfaf5aa6e1a2ea738390f7611b88f | [
"Apache-2.0"
] | 9 | 2020-12-01T03:32:14.000Z | 2021-05-02T20:00:45.000Z | EZModule/__init__.py | deportir/EZ | 2cd031a2189dfaf5aa6e1a2ea738390f7611b88f | [
"Apache-2.0"
] | null | null | null | EZModule/__init__.py | deportir/EZ | 2cd031a2189dfaf5aa6e1a2ea738390f7611b88f | [
"Apache-2.0"
] | 6 | 2020-12-01T04:52:05.000Z | 2020-12-28T21:03:10.000Z | import smtplib
import datetime
import os
import time
import random
from random import randint
import string
import codecs
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email.utils import formataddr
from rich import print
from rich.console import Console
from rich.progress import track
from rich.progress import Progress
from rich.progress import (
BarColumn,
DownloadColumn,
TextColumn,
TransferSpeedColumn,
TimeRemainingColumn,
Progress,
TaskID,
)
| 21.269231 | 46 | 0.802893 | 70 | 553 | 6.342857 | 0.428571 | 0.09009 | 0.108108 | 0.148649 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162749 | 553 | 25 | 47 | 22.12 | 0.958963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.68 | 0 | 0.68 | 0.04 | 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 |
b66642b5005877b265c40c407e59b35f81c9e8a1 | 155 | py | Python | consent_form/apps.py | AurelienNioche/ModelingMadeEasyApp | dbb738dda204906c5f4b7aeb9c71feea961a4cce | [
"MIT"
] | null | null | null | consent_form/apps.py | AurelienNioche/ModelingMadeEasyApp | dbb738dda204906c5f4b7aeb9c71feea961a4cce | [
"MIT"
] | null | null | null | consent_form/apps.py | AurelienNioche/ModelingMadeEasyApp | dbb738dda204906c5f4b7aeb9c71feea961a4cce | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ConsentFormConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'consent_form'
| 22.142857 | 56 | 0.774194 | 18 | 155 | 6.5 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141935 | 155 | 6 | 57 | 25.833333 | 0.879699 | 0 | 0 | 0 | 0 | 0 | 0.264516 | 0.187097 | 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 |
b69fc1ce29365db77d7ee66d2d4781a8842daac9 | 3,870 | py | Python | sequential_inference/experiments/mixins/data.py | cvoelcker/sequential_inference | acdc23aa8fdbfc76ded771e82a4abcdd081a3280 | [
"MIT"
] | null | null | null | sequential_inference/experiments/mixins/data.py | cvoelcker/sequential_inference | acdc23aa8fdbfc76ded771e82a4abcdd081a3280 | [
"MIT"
] | null | null | null | sequential_inference/experiments/mixins/data.py | cvoelcker/sequential_inference | acdc23aa8fdbfc76ded771e82a4abcdd081a3280 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from sequential_inference.envs.vec_env.vec_env import VecEnv
from typing import Dict
import gym
import torch
from sequential_inference.util.data import gather_trajectory_data
from sequential_inference.data.data import (
BatchTrajectorySampler,
TrajectoryReplayBuffer,
)
from sequential_inference.abc.experiment import (
AbstractExperiment,
AbstractRLExperiment,
ExperimentMixin,
)
from sequential_inference.rl.agents import RandomAgent
class AbstractDataMixin(ExperimentMixin):
experiment: AbstractExperiment
env: VecEnv
buffer: TrajectoryReplayBuffer
def __init__(
self,
env: VecEnv,
buffer: TrajectoryReplayBuffer,
experiment: AbstractExperiment = None,
):
self.env = env
self.buffer = buffer
self.experiment = experiment
@abstractmethod
def get_batch(self, batch_size: int) -> Dict[str, torch.Tensor]:
pass
def set_experiment(self, experiment: AbstractExperiment):
self.experiment = experiment
def before_experiment(self):
pass
def after_epoch(self, log):
return log
class FixedDataSamplingMixin(AbstractDataMixin):
buffer: TrajectoryReplayBuffer
n: int
dataset: BatchTrajectorySampler
def set_num_sampling_steps(self, n_init: int) -> None:
self.n_init = n_init
def before_experiment(self) -> None:
agent = RandomAgent(self.env.action_space)
gather_trajectory_data(self.env, agent, self.buffer, self.n_init)
self.dataset = BatchTrajectorySampler(self.buffer)
def reload_preempted(self, run_dir):
# TODO: add data reloading shenanigans here
pass
def get_batch(self, batch_size: int) -> Dict[str, torch.Tensor]:
return self.dataset.get_next(batch_size)
class DataSamplingMixin(AbstractDataMixin):
buffer: TrajectoryReplayBuffer
n: int
n_init: int
experiment: AbstractRLExperiment
def set_num_sampling_steps(self, n: int, n_init: int) -> None:
self.n = n
self.n_init = n_init
def before_experiment(self) -> None:
agent = RandomAgent(self.env.action_space)
gather_trajectory_data(self.env, agent, self.buffer, self.n_init)
self.dataset = BatchTrajectorySampler(self.buffer)
def after_epoch(self, epoch_log: Dict[str, torch.Tensor]):
agent = self.experiment.get_agent()
gather_trajectory_data(self.env, agent, self.buffer, self.n)
self.dataset = BatchTrajectorySampler(self.buffer)
super().after_epoch(epoch_log)
def reload_preempted(self, run_dir):
# TODO: add data reloading shenanigans here
pass
def get_batch(self, batch_size: int) -> Dict[str, torch.Tensor]:
return self.dataset.get_next(batch_size)
class OnlineDataSamplingMixin(AbstractDataMixin):
n: int
n_init: int
def set_num_sampling_steps(self, n: int, n_init: int) -> None:
self.n = n
self.n_init = n_init
def reload_preempted(self, run_dir):
# TODO: add data reloading shenanigans here
pass
def get_batch(self, batch_size: int) -> Dict[str, torch.Tensor]:
# TODO: fix this shit
return {"TODO": torch.Tensor([0.0])}
class DynaSamplingMixin(AbstractDataMixin):
n: int
n_init: int
def set_num_sampling_steps(self, n: int, n_init: int) -> None:
self.n = n
self.n_init = n_init
def reload_preempted(self, run_dir):
super.reload_preempted(run_dir)
# TODO: add data reloading shenanigans here
def get_batch(self, batch_size: int) -> Dict[str, torch.Tensor]:
# TODO: fix this shit
return {"TODO": torch.Tensor([0.0])}
def get_model_batch(self) -> Dict[str, torch.Tensor]:
# TODO: fix this shit
return {"TODO": torch.Tensor([0.0])}
| 28.248175 | 73 | 0.684496 | 471 | 3,870 | 5.441614 | 0.159236 | 0.033164 | 0.032774 | 0.049161 | 0.588373 | 0.530238 | 0.525946 | 0.515412 | 0.499415 | 0.499415 | 0 | 0.002004 | 0.226357 | 3,870 | 136 | 74 | 28.455882 | 0.854041 | 0.058656 | 0 | 0.526316 | 0 | 0 | 0.003301 | 0 | 0 | 0 | 0 | 0.007353 | 0 | 1 | 0.221053 | false | 0.052632 | 0.094737 | 0.063158 | 0.578947 | 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 |
b6a706c76aa380f918ab2d49c06e36ee9223bc03 | 179 | py | Python | src/carts/urls.py | LeeSinLiang/eC2 | a7cd4333d479c8f5695f52c382fbe38c83975cde | [
"MIT"
] | 1 | 2019-06-09T12:09:21.000Z | 2019-06-09T12:09:21.000Z | src/carts/urls.py | LeeSinLiang/eC2 | a7cd4333d479c8f5695f52c382fbe38c83975cde | [
"MIT"
] | 7 | 2019-12-19T05:29:16.000Z | 2022-03-11T23:49:05.000Z | src/carts/urls.py | LeeSinLiang/eC2 | a7cd4333d479c8f5695f52c382fbe38c83975cde | [
"MIT"
] | null | null | null | from django.urls import path
from .views import *
urlpatterns = [
path('', CartView.as_view(), name='cart'),
path('count/', ItemCountView.as_view(), name='item_count'),
] | 25.571429 | 63 | 0.670391 | 23 | 179 | 5.086957 | 0.652174 | 0.102564 | 0.17094 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145251 | 179 | 7 | 64 | 25.571429 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 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 |
b6b2931f26629af0488a7bd70380a7799ddb3395 | 7,359 | py | Python | tests/read/test_read_api_service_data_endpoint.py | NRCan/backdrop | ba45e21b81c09859310ca4be249b25016b8731dc | [
"MIT"
] | null | null | null | tests/read/test_read_api_service_data_endpoint.py | NRCan/backdrop | ba45e21b81c09859310ca4be249b25016b8731dc | [
"MIT"
] | null | null | null | tests/read/test_read_api_service_data_endpoint.py | NRCan/backdrop | ba45e21b81c09859310ca4be249b25016b8731dc | [
"MIT"
] | 2 | 2020-05-20T13:33:21.000Z | 2021-01-03T22:48:33.000Z | import unittest
import urllib
import datetime
from hamcrest import assert_that, is_
from mock import patch
import pytz
from backdrop.core.timeseries import WEEK
from backdrop.read import api
from backdrop.core.query import Query
from tests.support.performanceplatform_client import fake_data_set_exists, fake_no_data_sets_exist
from tests.support.test_helpers import has_status, has_header, d_tz
class NoneData(object):
def data(self):
return None
class QueryingApiTestCase(unittest.TestCase):
def setUp(self):
self.app = api.app.test_client()
@fake_data_set_exists("foo", data_group="some-group", data_type="some-type")
@patch('backdrop.core.data_set.DataSet.execute_query')
def test_period_query_is_executed(self, mock_query):
mock_query.return_value = NoneData()
self.app.get(
'/data/some-group/some-type?period=week&' +
'start_at=' + urllib.quote("2012-11-05T00:00:00Z") + '&' +
'end_at=' + urllib.quote("2012-12-03T00:00:00Z"))
mock_query.assert_called_with(
Query.create(period=WEEK,
start_at=d_tz(2012, 11, 5),
end_at=d_tz(2012, 12, 3)))
@fake_data_set_exists("foo", data_group="some-group", data_type="some-type", raw_queries_allowed=True)
@patch('backdrop.core.data_set.DataSet.execute_query')
def test_filter_by_query_is_executed(self, mock_query):
mock_query.return_value = NoneData()
self.app.get('/data/some-group/some-type?filter_by=zombies:yes')
mock_query.assert_called_with(
Query.create(filter_by=[[u'zombies', u'yes']]))
@fake_data_set_exists("foo", data_group="some-group", data_type="some-type")
@patch('backdrop.core.data_set.DataSet.execute_query')
def test_group_by_query_is_executed(self, mock_query):
mock_query.return_value = NoneData()
self.app.get('/data/some-group/some-type?group_by=zombies')
mock_query.assert_called_with(
Query.create(group_by=[u'zombies']))
@fake_data_set_exists("foo", data_group="some-group", data_type="some-type", raw_queries_allowed=True)
@patch('backdrop.core.data_set.DataSet.execute_query')
def test_query_with_start_and_end_is_executed(self, mock_query):
mock_query.return_value = NoneData()
expected_start_at = datetime.datetime(2012, 12, 5, 8, 12, 43,
tzinfo=pytz.UTC)
expected_end_at = datetime.datetime(2012, 12, 12, 8, 12, 43,
tzinfo=pytz.UTC)
self.app.get(
'/data/some-group/some-type?start_at=' +
urllib.quote("2012-12-05T08:12:43+00:00") +
'&end_at=' + urllib.quote("2012-12-12T08:12:43+00:00")
)
mock_query.assert_called_with(
Query.create(start_at=expected_start_at, end_at=expected_end_at))
@fake_data_set_exists("foo", data_group="some-group", data_type="some-type")
@patch('backdrop.core.data_set.DataSet.execute_query')
def test_group_by_with_period_is_executed(self, mock_query):
mock_query.return_value = NoneData()
self.app.get(
'/data/some-group/some-type?period=week&group_by=stuff&' +
'start_at=' + urllib.quote("2012-11-05T00:00:00Z") + '&' +
'end_at=' + urllib.quote("2012-12-03T00:00:00Z"))
mock_query.assert_called_with(
Query.create(period=WEEK,
group_by=['stuff'],
start_at=d_tz(2012, 11, 5),
end_at=d_tz(2012, 12, 3)))
@fake_data_set_exists("foo", data_group="some-group", data_type="some-type", raw_queries_allowed=True)
@patch('backdrop.core.data_set.DataSet.execute_query')
def test_sort_query_is_executed(self, mock_query):
mock_query.return_value = NoneData()
self.app.get(
'/data/some-group/some-type?sort_by=value:ascending'
)
mock_query.assert_called_with(
Query.create(sort_by=["value", "ascending"]))
self.app.get(
'/data/some-group/some-type?sort_by=value:descending'
)
mock_query.assert_called_with(
Query.create(sort_by=["value", "descending"]))
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type", queryable=False)
def test_returns_404_when_data_set_is_not_queryable(self):
response = self.app.get('/data/some-group/some-type')
assert_that(response, has_status(404))
@fake_no_data_sets_exist()
def test_returns_404_when_data_set_does_not_exist(self):
response = self.app.get('/data/no-group/no-type')
assert_that(response, has_status(404))
class PreflightChecksApiTestCase(unittest.TestCase):
def setUp(self):
self.app = api.app.test_client()
api.storage._mongo.drop_database(api.app.config['DATABASE_NAME'])
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type")
def test_cors_preflight_requests_have_empty_body(self):
response = self.app.open(
'/data/some-group/some-type', method='OPTIONS')
assert_that(response.status_code, is_(200))
assert_that(response.data, is_(""))
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type")
def test_cors_preflight_are_allowed_from_all_origins(self):
response = self.app.open(
'/data/some-group/some-type', method='OPTIONS')
assert_that(response, has_header('Access-Control-Allow-Origin', '*'))
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type")
def test_cors_preflight_result_cache(self):
response = self.app.open(
'/data/some-group/some-type', method='OPTIONS')
assert_that(response, has_header('Access-Control-Max-Age', '86400'))
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type")
def test_cors_requests_can_cache_control(self):
response = self.app.open(
'/data/some-group/some-type', method='OPTIONS')
assert_that(response, has_header('Access-Control-Allow-Headers',
'cache-control, govuk-request-id, request-id'))
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type", raw_queries_allowed=True)
def test_max_age_is_30_min_for_non_realtime_data_sets(self):
response = self.app.get('/data/some-group/some-type')
assert_that(
response, has_header('Cache-Control', 'max-age=1800, must-revalidate'))
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type", realtime=True, raw_queries_allowed=True)
def test_max_age_is_2_min_for_realtime_data_sets(self):
response = self.app.get('/data/some-group/some-type')
assert_that(
response, has_header('Cache-Control', 'max-age=120, must-revalidate'))
@fake_data_set_exists("data_set", data_group="some-group", data_type="some-type", raw_queries_allowed=True, published=False)
def test_cache_control_is_set_to_no_cache_for_unpublished_data_sets(self):
response = self.app.get('/data/some-group/some-type')
assert_that(response, has_header('Cache-Control', 'no-cache'))
| 44.871951 | 128 | 0.671287 | 1,022 | 7,359 | 4.522505 | 0.14775 | 0.046949 | 0.035699 | 0.055171 | 0.776936 | 0.753137 | 0.734963 | 0.684985 | 0.678278 | 0.667244 | 0 | 0.029586 | 0.196222 | 7,359 | 163 | 129 | 45.147239 | 0.751817 | 0 | 0 | 0.496241 | 0 | 0 | 0.225166 | 0.128007 | 0 | 0 | 0 | 0 | 0.135338 | 1 | 0.135338 | false | 0 | 0.082707 | 0.007519 | 0.24812 | 0 | 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 |
fcc7ebca359663a68ca210ad61249c883d7e18de | 457 | py | Python | pytorch_tutorial0.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | null | null | null | pytorch_tutorial0.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | null | null | null | pytorch_tutorial0.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | null | null | null | import torch
x = torch.randn(3, requires_grad=True)
print(x)
y = x + 2
print(y)
z = y * y * 2
print(z)
z = z.mean()
print(z)
z.backward()
print(x.grad)
x = torch.randn(3, requires_grad=True)
print(x)
x.requires_grad_(False)
print(x)
x = torch.randn(3, requires_grad=True)
print(x)
x = x.detach()
print(x)
x = torch.randn(3, requires_grad=True)
print(x)
with torch.no_grad():
y = x + 2
print(y)
weights = torch.ones(4, requires_grad=True)
| 12.351351 | 43 | 0.656455 | 86 | 457 | 3.395349 | 0.244186 | 0.143836 | 0.273973 | 0.164384 | 0.575342 | 0.513699 | 0.513699 | 0.513699 | 0.513699 | 0.39726 | 0 | 0.021164 | 0.172867 | 457 | 36 | 44 | 12.694444 | 0.751323 | 0 | 0 | 0.64 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.04 | 0 | 0.04 | 0.44 | 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 |
fcc8012bbb5b165a8f4e3dfa85970ce1a5cff38b | 1,714 | py | Python | PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/pixel_transform.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/pixel_transform.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/pixel_transform.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | '''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p, constants as _cs, arrays
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_pixel_transform'
def _f( function ):
return _p.createFunction( function,_p.GL,'GL_EXT_pixel_transform',False)
_p.unpack_constants( """GL_PIXEL_TRANSFORM_2D_EXT 0x8330
GL_PIXEL_MAG_FILTER_EXT 0x8331
GL_PIXEL_MIN_FILTER_EXT 0x8332
GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
GL_CUBIC_EXT 0x8334
GL_AVERAGE_EXT 0x8335
GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338""", globals())
glget.addGLGetConstant( GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT, (1,) )
glget.addGLGetConstant( GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT, (1,) )
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLint)
def glPixelTransformParameteriEXT( target,pname,param ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLfloat)
def glPixelTransformParameterfEXT( target,pname,param ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLintArray)
def glPixelTransformParameterivEXT( target,pname,params ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLfloatArray)
def glPixelTransformParameterfvEXT( target,pname,params ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLintArray)
def glGetPixelTransformParameterivEXT( target,pname,params ):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLfloatArray)
def glGetPixelTransformParameterfvEXT( target,pname,params ):pass
def glInitPixelTransformEXT():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( EXTENSION_NAME )
| 39.860465 | 76 | 0.829055 | 242 | 1,714 | 5.483471 | 0.334711 | 0.072344 | 0.060286 | 0.049736 | 0.362472 | 0.362472 | 0.362472 | 0.314243 | 0.262999 | 0.239638 | 0 | 0.033523 | 0.077596 | 1,714 | 42 | 77 | 40.809524 | 0.805819 | 0.068261 | 0 | 0.263158 | 1 | 0 | 0.218789 | 0.157629 | 0 | 0 | 0.034048 | 0 | 0 | 1 | 0.210526 | false | 0.157895 | 0.105263 | 0.026316 | 0.368421 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
fcd52c3dc28f8943fa03703fe0efd220cf68be03 | 48 | py | Python | metadata_driver_interface/constants.py | nevermined-io/metadata-driver-interface | f23e98eefd4fb7b5833c9fba860a2d1b2601f124 | [
"Apache-2.0"
] | null | null | null | metadata_driver_interface/constants.py | nevermined-io/metadata-driver-interface | f23e98eefd4fb7b5833c9fba860a2d1b2601f124 | [
"Apache-2.0"
] | null | null | null | metadata_driver_interface/constants.py | nevermined-io/metadata-driver-interface | f23e98eefd4fb7b5833c9fba860a2d1b2601f124 | [
"Apache-2.0"
] | null | null | null | CONFIG_OPTION = 'metadata-driver'
DATA = 'data'
| 16 | 33 | 0.729167 | 6 | 48 | 5.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 48 | 2 | 34 | 24 | 0.809524 | 0 | 0 | 0 | 0 | 0 | 0.395833 | 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 |
fcd5507626aba313f5ca17dbe4b3c6373a42a424 | 1,547 | py | Python | resources.py | haakov/TTK4145-graphical-simulator | ac44dda1563a5179d15cbf7f513e8d19fe1e08e2 | [
"MIT"
] | 1 | 2019-03-15T12:47:58.000Z | 2019-03-15T12:47:58.000Z | resources.py | haakov/TTK4145-graphical-simulator | ac44dda1563a5179d15cbf7f513e8d19fe1e08e2 | [
"MIT"
] | null | null | null | resources.py | haakov/TTK4145-graphical-simulator | ac44dda1563a5179d15cbf7f513e8d19fe1e08e2 | [
"MIT"
] | null | null | null | import pyglet
from pyglet.window import key
class Resources():
elevator_img = pyglet.image.load("img/elevator.png")
doors_img = pyglet.image.load("img/doors.png")
stop_img = pyglet.image.load("img/stop.png")
signal_img = pyglet.image.load("img/signal.png")
arrow_img = pyglet.image.load("img/arrow.png")
arrow_down_img = pyglet.image.load("img/arrow_down.png")
background_img = pyglet.image.load("img/background.png")
floor_imgs = [ pyglet.image.load("img/floor_%d.png" % i) for i in range(0,4) ]
cab_order_imgs = [ pyglet.image.load("img/%d.png" % i) for i in range(0,4) ]
f_button_imgs = [ pyglet.image.load("img/f%d.png" % i) for i in range(1,4) ]
reset_keys = [ key.F1, key.F2, key.F3 ]
stop_key = key.ENTER
obstruction_key = key.BACKSPACE
ports = [ 15657, 15658, 15659 ]
order_keys = [
# Elevator 1
[[ None, key.Q, key.A, key.Z ], # Hall up
[ key._2, key.W, key.S, None ], # Hall down
[ key._3, key.E, key.D, key.C ]], # Cab
# Elevator 2
[[ None, key.R, key.F, key.V ],
[ key._5, key.T, key.G, None ],
[ key._6, key.Y, key.H, key.N ]],
# Elevator 3
[[ None, key.U, key.J, key.M ],
[ key._8, key.I, key.K, None ],
[ key._9, key.O, key.L, key.PERIOD ]]
]
| 36.833333 | 82 | 0.498384 | 215 | 1,547 | 3.469767 | 0.344186 | 0.147453 | 0.201072 | 0.241287 | 0.368633 | 0.13941 | 0.069705 | 0.048257 | 0.048257 | 0 | 0 | 0.032967 | 0.352941 | 1,547 | 41 | 83 | 37.731707 | 0.712288 | 0.034906 | 0 | 0 | 0 | 0 | 0.094949 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.642857 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
fcd96e681ece7698103120956dff8ce44f44374e | 332 | py | Python | output/models/nist_data/atomic/non_positive_integer/schema_instance/nistschema_sv_iv_atomic_non_positive_integer_max_inclusive_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/non_positive_integer/schema_instance/nistschema_sv_iv_atomic_non_positive_integer_max_inclusive_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/non_positive_integer/schema_instance/nistschema_sv_iv_atomic_non_positive_integer_max_inclusive_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.non_positive_integer.schema_instance.nistschema_sv_iv_atomic_non_positive_integer_max_inclusive_3_xsd.nistschema_sv_iv_atomic_non_positive_integer_max_inclusive_3 import NistschemaSvIvAtomicNonPositiveIntegerMaxInclusive3
__all__ = [
"NistschemaSvIvAtomicNonPositiveIntegerMaxInclusive3",
]
| 55.333333 | 257 | 0.918675 | 36 | 332 | 7.722222 | 0.583333 | 0.097122 | 0.183453 | 0.258993 | 0.366906 | 0.366906 | 0.366906 | 0.366906 | 0.366906 | 0.366906 | 0 | 0.012579 | 0.042169 | 332 | 5 | 258 | 66.4 | 0.861635 | 0 | 0 | 0 | 0 | 0 | 0.153614 | 0.153614 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fce2e5234cf827abc341b4902799cb2ff1c6028e | 140 | py | Python | desafio014.py | RickChaves29/Desafios-Python | 9d67036ca2ba9c6db2a649a381cac832ac83035f | [
"MIT"
] | null | null | null | desafio014.py | RickChaves29/Desafios-Python | 9d67036ca2ba9c6db2a649a381cac832ac83035f | [
"MIT"
] | null | null | null | desafio014.py | RickChaves29/Desafios-Python | 9d67036ca2ba9c6db2a649a381cac832ac83035f | [
"MIT"
] | null | null | null | grau = float(input('Digite a temperatura ºc: '))
f = (grau * 9 / 5) + 32
print('A temperatura em grau {}ºC e em grau {}ºF'.format(grau, f))
| 35 | 66 | 0.628571 | 25 | 140 | 3.52 | 0.64 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035088 | 0.185714 | 140 | 3 | 67 | 46.666667 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0.471429 | 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 | 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 |
fcf03f4cf7b29b4f159459d387c0fe60fae638f7 | 278 | py | Python | src/main.py | analimazn/python-fastapi-rest | b4fa275695378b0d9e074c13c6caa9b90694f9e9 | [
"MIT"
] | null | null | null | src/main.py | analimazn/python-fastapi-rest | b4fa275695378b0d9e074c13c6caa9b90694f9e9 | [
"MIT"
] | null | null | null | src/main.py | analimazn/python-fastapi-rest | b4fa275695378b0d9e074c13c6caa9b90694f9e9 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from src.controllers.healthcheck import healthcheck_controller
from src.controllers.home import home_controller
app = FastAPI()
app.add_api_route('/healthcheck', healthcheck_controller())
@app.get('/')
def route_home():
return home_controller() | 23.166667 | 62 | 0.802158 | 35 | 278 | 6.171429 | 0.428571 | 0.064815 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097122 | 278 | 12 | 63 | 23.166667 | 0.860558 | 0 | 0 | 0 | 0 | 0 | 0.046595 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0.125 | 0.625 | 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 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
1e08fcaaa63d45c151962b34f8a4aec7632a3048 | 97 | py | Python | src/panoramic/cli/husky/core/tel/enums.py | kubamahnert/panoramic-cli | 036f45a05d39f5762088ce23dbe367b938192f79 | [
"MIT"
] | 5 | 2020-11-13T17:26:59.000Z | 2021-03-19T15:11:26.000Z | src/panoramic/cli/husky/core/tel/enums.py | kubamahnert/panoramic-cli | 036f45a05d39f5762088ce23dbe367b938192f79 | [
"MIT"
] | 5 | 2020-10-28T10:22:35.000Z | 2021-01-27T17:33:58.000Z | src/panoramic/cli/husky/core/tel/enums.py | kubamahnert/panoramic-cli | 036f45a05d39f5762088ce23dbe367b938192f79 | [
"MIT"
] | 3 | 2021-01-26T07:58:03.000Z | 2021-03-11T13:28:34.000Z | from enum import Enum
class TelDialectType(str, Enum):
TAXON = 'taxon'
MODEL = 'model'
| 13.857143 | 32 | 0.659794 | 12 | 97 | 5.333333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.237113 | 97 | 6 | 33 | 16.166667 | 0.864865 | 0 | 0 | 0 | 0 | 0 | 0.103093 | 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 |
1e307df9b93cd39387f2cb45176c198db4375f3b | 306 | py | Python | pyrspy/log.py | GeorgeFesa/pyRSPY | 4e57f25a15d29c01456cefa4b10778bf860cfbf5 | [
"MIT"
] | null | null | null | pyrspy/log.py | GeorgeFesa/pyRSPY | 4e57f25a15d29c01456cefa4b10778bf860cfbf5 | [
"MIT"
] | null | null | null | pyrspy/log.py | GeorgeFesa/pyRSPY | 4e57f25a15d29c01456cefa4b10778bf860cfbf5 | [
"MIT"
] | null | null | null | from pathlib import Path
"""Class for setting the default path for the logs,
depending on the operating system"""
class Logs:
__path = Path('Data')
def get_path(self):
return self.__path
def set_path(self, new_path):
self.__path = Path(new_path)
custom_path = Logs()
| 16.105263 | 51 | 0.663399 | 44 | 306 | 4.363636 | 0.5 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.245098 | 306 | 18 | 52 | 17 | 0.831169 | 0 | 0 | 0 | 0 | 0 | 0.018605 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.125 | 0.75 | 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 |
1e53ff70c430ba407baf8bfabeaac323da9c921f | 115 | py | Python | tests/test_controller.py | exizt/tistory-skin-simulator | 0ede9e5daeadd7aa3ed1f74bf40d7e0924a1655a | [
"MIT"
] | 4 | 2021-09-29T08:55:37.000Z | 2022-03-06T18:01:58.000Z | tests/test_controller.py | exizt/tistory-skin-simulator | 0ede9e5daeadd7aa3ed1f74bf40d7e0924a1655a | [
"MIT"
] | null | null | null | tests/test_controller.py | exizt/tistory-skin-simulator | 0ede9e5daeadd7aa3ed1f74bf40d7e0924a1655a | [
"MIT"
] | null | null | null | import DataJsonLoader
def test_get_config():
r = DataJsonLoader.get_blog_config_json()
print(r['title'])
| 16.428571 | 45 | 0.730435 | 15 | 115 | 5.266667 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156522 | 115 | 6 | 46 | 19.166667 | 0.814433 | 0 | 0 | 0 | 0 | 0 | 0.043478 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1e5b07770facdd91dc2f613ceb4e7b6041610d02 | 187 | py | Python | Loops/while.py | 1302580MK/Udemy_Python | c7aef0645ae15a954c2356ba96288deaa087fb32 | [
"MIT"
] | null | null | null | Loops/while.py | 1302580MK/Udemy_Python | c7aef0645ae15a954c2356ba96288deaa087fb32 | [
"MIT"
] | null | null | null | Loops/while.py | 1302580MK/Udemy_Python | c7aef0645ae15a954c2356ba96288deaa087fb32 | [
"MIT"
] | null | null | null | var1 = "Hello World"
var2 = 100
# while something is true do stuff
while(var2 < 110):
print("still less than 110!")
var2 += 1
else:
print(f"Not less than 110: var2 = {var2}") | 23.375 | 46 | 0.631016 | 30 | 187 | 3.933333 | 0.666667 | 0.135593 | 0.186441 | 0.254237 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132867 | 0.235294 | 187 | 8 | 46 | 23.375 | 0.692308 | 0.171123 | 0 | 0 | 0 | 0 | 0.409091 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.285714 | 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 |
1e66a4d190e83e57c7be4432b3cda54baad4aa4f | 251 | py | Python | waveshapes/basic.py | TomVincentUK/waveshapes | 087119ad3648cb64e5b9af34c07f1fdbd6dd9a43 | [
"MIT"
] | null | null | null | waveshapes/basic.py | TomVincentUK/waveshapes | 087119ad3648cb64e5b9af34c07f1fdbd6dd9a43 | [
"MIT"
] | null | null | null | waveshapes/basic.py | TomVincentUK/waveshapes | 087119ad3648cb64e5b9af34c07f1fdbd6dd9a43 | [
"MIT"
] | null | null | null | from .node import NodeBase
from .inlets import Inlets
class Product(NodeBase):
"""
Multiplies all inputs.
"""
def __init__(self, scene, outlets=None):
super().__init__(scene, outlets)
self.inlets = Inlets(node=self)
| 19.307692 | 44 | 0.649402 | 29 | 251 | 5.344828 | 0.586207 | 0.154839 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.23506 | 251 | 12 | 45 | 20.916667 | 0.807292 | 0.087649 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | 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 | 0 | 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 |
1e79891fdaae0dcc707ce95af1b3a3b711c5f41a | 241 | py | Python | tests/test_misc.py | PipesNBottles/pycomm3 | 6622c7df5cf976817aefc7f44d86adad45c8a700 | [
"MIT"
] | null | null | null | tests/test_misc.py | PipesNBottles/pycomm3 | 6622c7df5cf976817aefc7f44d86adad45c8a700 | [
"MIT"
] | null | null | null | tests/test_misc.py | PipesNBottles/pycomm3 | 6622c7df5cf976817aefc7f44d86adad45c8a700 | [
"MIT"
] | null | null | null | import datetime
def test_get_time(plc):
time = plc.get_plc_time()
assert time
assert time.value['string'] == time.value['datetime'].strftime('%A, %B %d, %Y %I:%M:%S%p')
def test_set_time(plc):
assert plc.set_plc_time()
| 17.214286 | 94 | 0.647303 | 40 | 241 | 3.7 | 0.5 | 0.141892 | 0.189189 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178423 | 241 | 13 | 95 | 18.538462 | 0.747475 | 0 | 0 | 0 | 0 | 0 | 0.158996 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.428571 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1e9267541163ac05415fe9b5cdc4d36a40ad23d5 | 3,907 | py | Python | protos/control_pb2_grpc.py | uni-tue-kn/p4-ipsec | 10aae882de205b3601d2cfa7b3b2a4e4990b7476 | [
"Apache-2.0"
] | 13 | 2020-07-07T09:22:29.000Z | 2022-01-06T02:59:16.000Z | protos/control_pb2_grpc.py | uni-tue-kn/p4-ipsec | 10aae882de205b3601d2cfa7b3b2a4e4990b7476 | [
"Apache-2.0"
] | 3 | 2019-12-12T22:09:27.000Z | 2020-06-19T13:56:49.000Z | protos/control_pb2_grpc.py | uni-tue-kn/p4-macsec | 45b0fb39d15fdc8fc448075e35271dea90243cbc | [
"Apache-2.0"
] | 5 | 2019-07-25T02:10:36.000Z | 2020-12-19T13:53:46.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import control_pb2 as control__pb2
class ControlStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.addMACsecProtectRule = channel.unary_unary(
'/Control/addMACsecProtectRule',
request_serializer=control__pb2.MACsecProtectRule.SerializeToString,
response_deserializer=control__pb2.control_status.FromString,
)
self.addMACsecValidateRule = channel.unary_unary(
'/Control/addMACsecValidateRule',
request_serializer=control__pb2.MACsecValidateRule.SerializeToString,
response_deserializer=control__pb2.control_status.FromString,
)
self.deleteMACsecProtectRule = channel.unary_unary(
'/Control/deleteMACsecProtectRule',
request_serializer=control__pb2.MACsecProtectRule.SerializeToString,
response_deserializer=control__pb2.control_status.FromString,
)
self.deleteMACsecValidateRule = channel.unary_unary(
'/Control/deleteMACsecValidateRule',
request_serializer=control__pb2.MACsecValidateRule.SerializeToString,
response_deserializer=control__pb2.control_status.FromString,
)
class ControlServicer(object):
# missing associated documentation comment in .proto file
pass
def addMACsecProtectRule(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def addMACsecValidateRule(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def deleteMACsecProtectRule(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def deleteMACsecValidateRule(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ControlServicer_to_server(servicer, server):
rpc_method_handlers = {
'addMACsecProtectRule': grpc.unary_unary_rpc_method_handler(
servicer.addMACsecProtectRule,
request_deserializer=control__pb2.MACsecProtectRule.FromString,
response_serializer=control__pb2.control_status.SerializeToString,
),
'addMACsecValidateRule': grpc.unary_unary_rpc_method_handler(
servicer.addMACsecValidateRule,
request_deserializer=control__pb2.MACsecValidateRule.FromString,
response_serializer=control__pb2.control_status.SerializeToString,
),
'deleteMACsecProtectRule': grpc.unary_unary_rpc_method_handler(
servicer.deleteMACsecProtectRule,
request_deserializer=control__pb2.MACsecProtectRule.FromString,
response_serializer=control__pb2.control_status.SerializeToString,
),
'deleteMACsecValidateRule': grpc.unary_unary_rpc_method_handler(
servicer.deleteMACsecValidateRule,
request_deserializer=control__pb2.MACsecValidateRule.FromString,
response_serializer=control__pb2.control_status.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'Control', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
| 39.867347 | 77 | 0.761198 | 367 | 3,907 | 7.814714 | 0.179837 | 0.062762 | 0.055788 | 0.064156 | 0.691074 | 0.691074 | 0.691074 | 0.638075 | 0.638075 | 0.636681 | 0 | 0.005532 | 0.167136 | 3,907 | 97 | 78 | 40.278351 | 0.875845 | 0.115434 | 0 | 0.520548 | 1 | 0 | 0.117458 | 0.05596 | 0 | 0 | 0 | 0 | 0 | 1 | 0.082192 | false | 0.082192 | 0.027397 | 0 | 0.136986 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
1e933f25c7d229cfdb5944070102383bccefbc9f | 6,823 | py | Python | python/vespa/vespa/test_query.py | amahussein/vespa | 29d266ae1e5c95e25002b97822953fdd02b1451e | [
"Apache-2.0"
] | null | null | null | python/vespa/vespa/test_query.py | amahussein/vespa | 29d266ae1e5c95e25002b97822953fdd02b1451e | [
"Apache-2.0"
] | 1 | 2021-03-31T22:24:20.000Z | 2021-03-31T22:24:20.000Z | python/vespa/vespa/test_query.py | amahussein/vespa | 29d266ae1e5c95e25002b97822953fdd02b1451e | [
"Apache-2.0"
] | 1 | 2020-09-03T11:39:52.000Z | 2020-09-03T11:39:52.000Z | # Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
import unittest
from vespa.query import Query, OR, AND, WeakAnd, ANN, Union, RankProfile, VespaResult
class TestMatchFilter(unittest.TestCase):
def setUp(self) -> None:
self.query = "this is a test"
def test_and(self):
match_filter = AND()
self.assertEqual(
match_filter.create_match_filter(query=self.query),
'(userInput("this is a test"))',
)
self.assertDictEqual(match_filter.get_query_properties(query=self.query), {})
def test_or(self):
match_filter = OR()
self.assertEqual(
match_filter.create_match_filter(query=self.query),
'([{"grammar": "any"}]userInput("this is a test"))',
)
self.assertDictEqual(match_filter.get_query_properties(query=self.query), {})
def test_weak_and(self):
match_filter = WeakAnd(hits=10, field="field_name")
self.assertEqual(
match_filter.create_match_filter(query=self.query),
'([{"targetNumHits": 10}]weakAnd(field_name contains "this", field_name contains "is", field_name contains "", '
'field_name contains "a", field_name contains "test"))',
)
self.assertDictEqual(match_filter.get_query_properties(query=self.query), {})
def test_ann(self):
match_filter = ANN(
doc_vector="doc_vector",
query_vector="query_vector",
embedding_model=lambda x: [1, 2, 3],
hits=10,
label="label",
)
self.assertEqual(
match_filter.create_match_filter(query=self.query),
'([{"targetNumHits": 10, "label": "label"}]nearestNeighbor(doc_vector, query_vector))',
)
self.assertDictEqual(
match_filter.get_query_properties(query=self.query),
{"ranking.features.query(query_vector)": "[1, 2, 3]"},
)
def test_union(self):
match_filter = Union(
WeakAnd(hits=10, field="field_name"),
ANN(
doc_vector="doc_vector",
query_vector="query_vector",
embedding_model=lambda x: [1, 2, 3],
hits=10,
label="label",
),
)
self.assertEqual(
match_filter.create_match_filter(query=self.query),
'([{"targetNumHits": 10}]weakAnd(field_name contains "this", field_name contains "is", '
'field_name contains "", '
'field_name contains "a", field_name contains "test")) or '
'([{"targetNumHits": 10, "label": "label"}]nearestNeighbor(doc_vector, query_vector))',
)
self.assertDictEqual(
match_filter.get_query_properties(query=self.query),
{"ranking.features.query(query_vector)": "[1, 2, 3]"},
)
class TestRankProfile(unittest.TestCase):
def test_rank_profile(self):
rank_profile = RankProfile(name="rank_profile", list_features=True)
self.assertEqual(rank_profile.name, "rank_profile")
self.assertEqual(rank_profile.list_features, "true")
class TestQuery(unittest.TestCase):
def setUp(self) -> None:
self.query = "this is a test"
def test_default(self):
query = Query()
self.assertDictEqual(
query.create_body(query=self.query),
{
"yql": 'select * from sources * where (userInput("this is a test"));',
"ranking": {"profile": "default", "listFeatures": "false"},
},
)
def test_match_and_rank(self):
query = Query(
match_phase=ANN(
doc_vector="doc_vector",
query_vector="query_vector",
embedding_model=lambda x: [1, 2, 3],
hits=10,
label="label",
),
rank_profile=RankProfile(name="bm25", list_features=True),
)
self.assertDictEqual(
query.create_body(query=self.query),
{
"yql": 'select * from sources * where ([{"targetNumHits": 10, "label": "label"}]nearestNeighbor(doc_vector, query_vector));',
"ranking": {"profile": "bm25", "listFeatures": "true"},
"ranking.features.query(query_vector)": "[1, 2, 3]",
},
)
class TestVespaResult(unittest.TestCase):
def setUp(self) -> None:
self.raw_vespa_result_empty_hits = {
"root": {
"id": "toplevel",
"relevance": 1.0,
"fields": {"totalCount": 0},
"coverage": {
"coverage": 100,
"documents": 62529,
"full": True,
"nodes": 2,
"results": 1,
"resultsFull": 1,
},
}
}
self.raw_vespa_result = {
"root": {
"id": "toplevel",
"relevance": 1.0,
"fields": {"totalCount": 1083},
"coverage": {
"coverage": 100,
"documents": 62529,
"full": True,
"nodes": 2,
"results": 1,
"resultsFull": 1,
},
"children": [
{
"id": "id:covid-19:doc::40215",
"relevance": 30.368213170494712,
"source": "content",
"fields": {
"sddocname": "doc",
"body_text": "this is a body",
"title": "this is a title",
},
}
],
}
}
def test_json(self):
vespa_result = VespaResult(vespa_result=self.raw_vespa_result)
self.assertDictEqual(vespa_result.json, self.raw_vespa_result)
def test_hits(self):
empty_hits_vespa_result = VespaResult(
vespa_result=self.raw_vespa_result_empty_hits
)
self.assertEqual(empty_hits_vespa_result.hits, [])
vespa_result = VespaResult(vespa_result=self.raw_vespa_result)
self.assertEqual(
vespa_result.hits,
[
{
"id": "id:covid-19:doc::40215",
"relevance": 30.368213170494712,
"source": "content",
"fields": {
"sddocname": "doc",
"body_text": "this is a body",
"title": "this is a title",
},
}
],
)
| 35.722513 | 141 | 0.507695 | 645 | 6,823 | 5.172093 | 0.176744 | 0.065947 | 0.05036 | 0.035971 | 0.75 | 0.727818 | 0.702038 | 0.691247 | 0.666667 | 0.635492 | 0 | 0.028545 | 0.36846 | 6,823 | 190 | 142 | 35.910526 | 0.745649 | 0.015975 | 0 | 0.508876 | 0 | 0.005917 | 0.228546 | 0.04857 | 0 | 0 | 0 | 0 | 0.100592 | 1 | 0.076923 | false | 0 | 0.011834 | 0 | 0.112426 | 0 | 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 |
1ebbb67107b88cc8cbaf7c6e7a277635bf59ac6a | 9,701 | py | Python | tests/test_plugin.py | Colin-b/apispec_starlette | f79f332f610333992074f339a0f18019f8697671 | [
"MIT"
] | 1 | 2020-02-19T15:53:27.000Z | 2020-02-19T15:53:27.000Z | tests/test_plugin.py | Colin-b/apispec_starlette | f79f332f610333992074f339a0f18019f8697671 | [
"MIT"
] | null | null | null | tests/test_plugin.py | Colin-b/apispec_starlette | f79f332f610333992074f339a0f18019f8697671 | [
"MIT"
] | null | null | null | from apispec import APISpec
from starlette.applications import Starlette
from starlette.exceptions import HTTPException
from starlette.requests import Request
from apispec_starlette import StarlettePlugin, document_endpoint_oauth2_authentication
def test_without_exception_handlers_in_app():
app = Starlette()
spec = APISpec(
title="Test API",
version="0.0.1",
openapi_version="2.0",
plugins=[StarlettePlugin(app)],
)
assert spec.to_dict() == {
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {},
"swagger": "2.0",
}
def test_with_exception_handlers_in_app_without_status_code_but_yaml_docstring():
async def handle_exception(request: Request, exc: HTTPException):
"""
required:
- message
properties:
message:
type: string
description: Description of the error.
example: This is a description of the error.
type: object
"""
pass # pragma: no cover
app = Starlette(exception_handlers={HTTPException: handle_exception})
spec = APISpec(
title="Test API",
version="0.0.1",
openapi_version="2.0",
plugins=[StarlettePlugin(app)],
)
assert spec.to_dict() == {
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {},
"swagger": "2.0",
}
def test_with_exception_handlers_in_app_with_status_code_in_yaml_docstring():
async def handle_exception(request: Request, exc: HTTPException):
"""
400:
required:
- message
properties:
message:
type: string
description: Description of the error.
example: This is a description of the error.
type: object
"""
pass # pragma: no cover
app = Starlette(exception_handlers={HTTPException: handle_exception})
spec = APISpec(
title="Test API",
version="0.0.1",
openapi_version="2.0",
plugins=[StarlettePlugin(app)],
)
assert spec.to_dict() == {
"definitions": {
"Error400": {
"properties": {
"message": {
"description": "Description " "of " "the " "error.",
"example": "This is a " "description " "of the " "error.",
"type": "string",
}
},
"required": ["message"],
"type": "object",
}
},
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {},
"responses": {400: {"schema": {"$ref": "#/definitions/Error400"}}},
"swagger": "2.0",
}
def test_with_exception_handlers_in_app_with_status_code_in_handler_and_yaml_docstring():
async def handle_exception(request: Request, exc: HTTPException):
"""
required:
- message
properties:
message:
type: string
description: Description of the error.
example: This is a description of the error.
type: object
"""
pass # pragma: no cover
app = Starlette(exception_handlers={400: handle_exception})
spec = APISpec(
title="Test API",
version="0.0.1",
openapi_version="2.0",
plugins=[StarlettePlugin(app)],
)
assert spec.to_dict() == {
"definitions": {
"Error400": {
"properties": {
"message": {
"description": "Description " "of " "the " "error.",
"example": "This is a " "description " "of the " "error.",
"type": "string",
}
},
"required": ["message"],
"type": "object",
}
},
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {},
"responses": {400: {"schema": {"$ref": "#/definitions/Error400"}}},
"swagger": "2.0",
}
def test_with_exception_handlers_in_app_with_status_code_in_handler_but_without_yaml_docstring():
async def handle_exception(request: Request, exc: HTTPException):
pass # pragma: no cover
app = Starlette(exception_handlers={400: handle_exception})
spec = APISpec(
title="Test API",
version="0.0.1",
openapi_version="2.0",
plugins=[StarlettePlugin(app)],
)
assert spec.to_dict() == {
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {},
"swagger": "2.0",
}
def test_path_operations():
app = Starlette()
plugin = StarlettePlugin(app)
spec = APISpec(
title="Test API", version="0.0.1", openapi_version="2.0", plugins=[plugin]
)
spec.path(
"/test", operations={"get": {"responses": {"200": {"description": "ok"}}}}
)
spec.path(
"/test_overriden",
operations={"get": {"responses": {"200": {"description": "ok2"}}}},
)
@app.route("/test")
def test_endpoint(request):
pass # pragma: no cover
@app.route("/test_without_response")
def test_endpoint_without_response(request):
pass # pragma: no cover
@app.route("/test_overriden")
def test_endpoint_with_overriden_response(request):
"""
responses:
200:
description: "non ok"
"""
pass # pragma: no cover
for endpoint in plugin.endpoints():
spec.path(endpoint.path, endpoint=endpoint)
assert spec.to_dict() == {
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {
"/test": {
"get": {
"operationId": "get_test_endpoint",
"responses": {"200": {"description": "ok"}},
}
},
"/test_overriden": {
"get": {
"operationId": "get_test_endpoint_with_overriden_response",
"responses": {"200": {"description": "ok2"}},
}
},
"/test_without_response": {
"get": {"operationId": "get_test_endpoint_without_response"}
},
},
"swagger": "2.0",
}
def test_path_mixed_operations():
app = Starlette()
plugin = StarlettePlugin(app)
spec = APISpec(
title="Test API", version="0.0.1", openapi_version="2.0", plugins=[plugin]
)
document_endpoint_oauth2_authentication(
spec,
endpoint="/test",
method="get",
required_scopes=["scope1", "scope2"],
unauthorized_status_code=400,
forbidden_status_code=402,
)
@app.route("/test")
def endpoint():
"""
responses:
200:
description: ok
type: string
"""
pass # pragma: no cover
for endpoint in plugin.endpoints():
spec.path(endpoint.path, endpoint=endpoint)
assert spec.to_dict() == {
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {
"/test": {
"get": {
"operationId": "get_endpoint",
"responses": {
"200": {"description": "ok", "type": "string"},
"400": {
"description": "No "
"permission "
"-- "
"see "
"authorization "
"schemes",
"schema": {"type": "string"},
},
"402": {
"description": "Request "
"forbidden "
"-- "
"authorization "
"will "
"not "
"help",
"schema": {"type": "string"},
},
},
"security": [{"oauth2": ["scope1", "scope2"]}],
}
}
},
"swagger": "2.0",
}
def test_path_summary():
app = Starlette()
plugin = StarlettePlugin(app)
spec = APISpec(
title="Test API", version="0.0.1", openapi_version="2.0", plugins=[plugin]
)
@app.route("/test")
def test_endpoint(request):
"""This is the expected summary"""
pass # pragma: no cover
@app.route("/test_with_doc")
def test_endpoint_with_doc(request):
"""
This is the expected summary 2
---
responses:
200:
description: "ok"
"""
pass # pragma: no cover
for endpoint in plugin.endpoints():
spec.path(endpoint.path, endpoint=endpoint)
assert spec.to_dict() == {
"info": {"title": "Test API", "version": "0.0.1"},
"paths": {
"/test": {
"get": {
"operationId": "get_test_endpoint",
"summary": "This is the expected summary",
}
},
"/test_with_doc": {
"get": {
"summary": "This is the expected summary 2",
"operationId": "get_test_endpoint_with_doc",
"responses": {"200": {"description": "ok"}},
}
},
},
"swagger": "2.0",
}
| 30.221184 | 97 | 0.475415 | 851 | 9,701 | 5.252644 | 0.122209 | 0.032215 | 0.042953 | 0.068009 | 0.792617 | 0.73915 | 0.702685 | 0.663311 | 0.647204 | 0.647204 | 0 | 0.026364 | 0.386146 | 9,701 | 320 | 98 | 30.315625 | 0.724265 | 0.040717 | 0 | 0.586498 | 0 | 0 | 0.201827 | 0.022719 | 0 | 0 | 0 | 0 | 0.033755 | 1 | 0.059072 | false | 0.042194 | 0.021097 | 0 | 0.080169 | 0 | 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 |
1ec6fbfdeeb47d0082f5f1e4bdff328f3b727558 | 1,747 | py | Python | scripts/inversedynamics_openrave.py | personalrobotics/herbpy | ab48e9190b061759b31bc9c879a7f96a51d975f5 | [
"BSD-3-Clause"
] | 4 | 2017-03-04T06:18:21.000Z | 2019-01-04T08:03:41.000Z | scripts/inversedynamics_openrave.py | personalrobotics/herbpy | ab48e9190b061759b31bc9c879a7f96a51d975f5 | [
"BSD-3-Clause"
] | 87 | 2015-01-30T03:50:35.000Z | 2017-02-20T18:55:42.000Z | scripts/inversedynamics_openrave.py | personalrobotics/herbpy | ab48e9190b061759b31bc9c879a7f96a51d975f5 | [
"BSD-3-Clause"
] | 10 | 2015-07-29T13:13:05.000Z | 2019-02-13T22:11:24.000Z | #!/usr/bin/env python
"""
Provides a simple console that sets up basic functionality for
using herbpy and openravepy.
"""
import argparse, herbpy, numpy, openravepy
def iD():
robot.right_arm.SetActive()
jpos_list = [
[3.1670137672513565, -1.5896855774682224, -0.030490730254705722, 1.5286675450710463, -0.032386115821109854, -0.03605547869739324, -0.026511110707008654],
[5.147064052327087, - 1.3622957134787639, -0.46951207447023835, 1.4621965585328196, -0.6525084419130015, 0.9042586427293137, -1.00526432576227],
[4.121337486391367, 0.5703433599319374, -2.2175569328355724, 2.049783564999927, -0.2955432490571725, -0.646366247533136, -1.4040613050409545],
[3.102831025390782, - 0.04296665515610201, 0.1361467570187895, 0.045580105054784076, -3.0213214848284657, 0.0714728073293458, -0.24661498332101073]
]
for i, jpos in enumerate(jpos_list):
robot.SetActiveDOFValues(jpos, openravepy.KinBody.CheckLimitsAction.Nothing)
robot.SetActiveDOFVelocities(numpy.zeros(7))
jtor = robot.ComputeInverseDynamics([])
print 'jpos[{}] gravtorques: {}'.format(i, ' '.join(['{:7.3f}'.format(x) for x in jtor[robot.GetActiveDOFIndices()]]))
if __name__ == "__main__":
openravepy.RaveInitialize(True)
openravepy.misc.InitOpenRAVELogging()
# herbpy_args = {'sim':args.sim,
# 'attach_viewer':args.viewer,
# 'robot_xml':args.robot_xml,
# 'env_path':args.env_xml,
# 'segway_sim':args.segway_sim}
# if args.sim and not args.segway_sim:
# herbpy_args['segway_sim'] = args.sim
env, robot = herbpy.initialize(sim=True, segway_sim=True)
iD()
| 40.627907 | 163 | 0.673726 | 182 | 1,747 | 6.340659 | 0.538462 | 0.038995 | 0.033795 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.344975 | 0.196909 | 1,747 | 42 | 164 | 41.595238 | 0.477548 | 0.172295 | 0 | 0 | 0 | 0 | 0.029873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.052632 | null | null | 0.052632 | 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 |
1ecd79b38fac6e8d35a0c01874c8b6be54e89e29 | 767 | py | Python | src/pyri/plugins/webui_server.py | pyri-project/pyri-common | 90519356c594f9acb9b6a263b82009102c6622ba | [
"Apache-2.0"
] | null | null | null | src/pyri/plugins/webui_server.py | pyri-project/pyri-common | 90519356c594f9acb9b6a263b82009102c6622ba | [
"Apache-2.0"
] | null | null | null | src/pyri/plugins/webui_server.py | pyri-project/pyri-common | 90519356c594f9acb9b6a263b82009102c6622ba | [
"Apache-2.0"
] | null | null | null | from typing import List, Dict, Callable, Any
from . import util as plugin_util
class PyriWebUIServerPluginFactory:
def __init__(self):
super().__init__()
def get_plugin_name(self) -> str:
return ""
def get_plugin_route_handler(self) -> Callable[["sanic.request.Request",str],"sanic.response.BaseHTTPResponse"]:
return None
def get_webui_server_plugin_factories() -> List[PyriWebUIServerPluginFactory]:
return plugin_util.get_plugin_factories("pyri.plugins.webui_server")
def get_all_webui_server_route_handlers() -> Dict[str,Any]:
ret = dict()
factories = get_webui_server_plugin_factories()
for factory in factories:
ret[factory.get_plugin_name()] = factory.get_plugin_route_handler()
return ret | 31.958333 | 116 | 0.736636 | 95 | 767 | 5.568421 | 0.4 | 0.085066 | 0.045369 | 0.079395 | 0.109641 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162973 | 767 | 24 | 117 | 31.958333 | 0.823988 | 0 | 0 | 0 | 0 | 0 | 0.10026 | 0.10026 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.117647 | 0.176471 | 0.705882 | 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 |
1ed2d6562659c5a477be1bdc8aaf94caf2a3c2cd | 5,454 | py | Python | pymc4/random_variables/random_variable.py | kyleabeauchamp/pymc4 | 9ee5d5258be33f943f08a71c7013af07bc30314b | [
"Apache-2.0"
] | null | null | null | pymc4/random_variables/random_variable.py | kyleabeauchamp/pymc4 | 9ee5d5258be33f943f08a71c7013af07bc30314b | [
"Apache-2.0"
] | null | null | null | pymc4/random_variables/random_variable.py | kyleabeauchamp/pymc4 | 9ee5d5258be33f943f08a71c7013af07bc30314b | [
"Apache-2.0"
] | null | null | null | """
PyMC4 base random variable class.
Implements the RandomVariable base class and the necessary BackendArithmetic.
Also stores the type hints used in child classes.
- TensorLike is for float-like tensors (scalars, vectors, matrices, tensors)
- IntTensorLike like TensorLike, just for ints.
"""
from .. import _template_contexts as contexts
from tensorflow_probability import distributions as tfd
from tensorflow_probability import bijectors
from typing import NewType, Union, Sequence
class WithBackendArithmetic:
"""Helper class to implement the backend arithmetic necessary for the RandomVariable class."""
def __add__(self, other):
return self.as_tensor() + other
def __radd__(self, other):
return other + self.as_tensor()
def __sub__(self, other):
return self.as_tensor() - other
def __rsub__(self, other):
return other - self.as_tensor()
def __mul__(self, other):
return self.as_tensor() * other
def __rmul__(self, other):
return other * self.as_tensor()
def __matmul__(self, other):
return self.as_tensor() @ other
def __rmatmul__(self, other):
return other @ self.as_tensor()
def __truediv__(self, other):
return self.as_tensor() / other
def __rtruediv__(self, other):
return other / self.as_tensor()
def __floordiv__(self, other):
return self.as_tensor() // other
def __rfloordiv__(self, other):
return other // self.as_tensor()
def __mod__(self, other):
return self.as_tensor() % other
def __rmod__(self, other):
return other % self.as_tensor()
def __pow__(self, other):
return self.as_tensor() ** other
def __rpow__(self, other):
return other ** self.as_tensor()
def __and__(self, other):
return self.as_tensor() & other
def __rand__(self, other):
return other & self.as_tensor()
def __xor__(self, other):
return self.as_tensor() ^ other
def __rxor__(self, other):
return other ^ self.as_tensor()
def __or__(self, other):
return self.as_tensor() | other
def __ror__(self, other):
return other | self.as_tensor()
def __neg__(self):
return -self.as_tensor()
def __pos__(self):
return +self.as_tensor()
def __invert__(self):
return ~self.as_tensor()
def __getitem__(self, slice_spec, var=None):
return self.as_tensor().__getitem__(slice_spec, var=var)
class RandomVariable(WithBackendArithmetic):
"""Random variable base class.
Random variables must support 1) sampling, 2) computation of the log
probability, and 3) conversion to tensors.
The base distribution is transformed automatically by a default "identity"
bijector transform. For other classes of distributions, we can pass in
alternate transforms. The transformed distribution is used only when
calculating the log_prob, while the base distribution is used for sampling
purposes.
"""
_bijector = bijectors.Identity()
_base_dist = None
def __init__(self, *args, **kwargs):
self._parents = []
self._untransformed_distribution = self._base_dist(*args, **kwargs)
self._sample_shape = ()
self._dim_names = ()
ctx = contexts.get_context()
self.name = kwargs.get("name", None)
if isinstance(ctx, contexts.InferenceContext) and self.name is None:
# Unfortunately autograph does not allow changing the AST,
# thus we instead retrieve the name from when it was set
# ForwardContext where AST parsing is possible.
order_id = len(ctx.vars) # where am I in the order of RV creation?
self.name = ctx._names[order_id]
if not isinstance(ctx, contexts.FreeForwardContext) and self.name is None:
# We only require names for book keeping during inference
raise ValueError("No name was set. Supply one via the name kwarg.")
self._creation_context_id = id(ctx)
self._backend_tensor = None
# Override default bijector if provided
self._bijector = kwargs.get("bijector", self._bijector)
self._distribution = tfd.TransformedDistribution(
distribution=self._untransformed_distribution, bijector=bijectors.Invert(self._bijector)
)
ctx.add_variable(self)
def sample(self):
"""Forward sampling from the base distribution, unconditioned on data."""
return self._untransformed_distribution.sample()
def log_prob(self):
"""Log probability computation.
Done based on the transformed distribution, not the base distribution.
"""
return self._distribution.log_prob(self)
def as_tensor(self):
ctx = contexts.get_context()
if id(ctx) != self._creation_context_id:
raise ValueError("Cannot convert to tensor under new context.")
if self._backend_tensor is None:
self._backend_tensor = ctx.var_as_backend_tensor(self)
return self._bijector.forward(self._backend_tensor)
class PositiveContinuousRV(RandomVariable):
_bijector = bijectors.Exp()
class UnitContinuousRV(RandomVariable):
_bijector = bijectors.Sigmoid()
TensorLike = NewType("TensorLike", Union[Sequence[int], Sequence[float], int, float])
IntTensorLike = NewType("IntTensorLike", Union[int, Sequence[int]])
| 31.344828 | 100 | 0.675834 | 657 | 5,454 | 5.313546 | 0.287671 | 0.061873 | 0.089373 | 0.077342 | 0.25179 | 0.242051 | 0.220567 | 0.220567 | 0 | 0 | 0 | 0.000959 | 0.235607 | 5,454 | 173 | 101 | 31.526012 | 0.836412 | 0.234873 | 0 | 0.020833 | 0 | 0 | 0.030562 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3125 | false | 0 | 0.041667 | 0.270833 | 0.739583 | 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 |
94920f003f88151f537559d01fc0afd0c8542917 | 1,519 | py | Python | project/project/basicOpencv.py | LamLauChiu/DjangoReact-Boilerplate | 0ee00360e9746b04c4edf08a4599caff39702b34 | [
"MIT"
] | 1 | 2019-05-04T11:31:11.000Z | 2019-05-04T11:31:11.000Z | project/project/basicOpencv.py | LamLauChiu/DjangoReact-Boilerplate | 0ee00360e9746b04c4edf08a4599caff39702b34 | [
"MIT"
] | null | null | null | project/project/basicOpencv.py | LamLauChiu/DjangoReact-Boilerplate | 0ee00360e9746b04c4edf08a4599caff39702b34 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
from matplotlib import pyplot as plt
# sources: https://blog.gtwang.org/programming/opencv-basic-image-read-and-write-tutorial/
# 讀取圖檔
img = cv2.imread('/Users/Ivan.lam/Projects/DjangoReact-Boilerplate/project/project/human-20180303-01-1024x683.jpg')
# 查看資料型態
#type(img)
#img.shape
# 以灰階的方式讀取圖檔
#img_gray = cv2.imread('image.jpg', cv2.IMREAD_GRAYSCALE)
# 顯示圖片
#cv2.imshow('My Image', img)
# 按下任意鍵則關閉所有視窗
#cv2.waitKey(0)
#cv2.destroyAllWindows()
# 關閉 'My Image' 視窗
#cv2.destroyWindow('My Image')
# 讓視窗可以自由縮放大小
#cv2.namedWindow('My Image', cv2.WINDOW_NORMAL)
#cv2.imshow('My Image', img)
#cv2.waitKey(0)
#cv2.destroyAllWindows()
# 寫入圖檔
#cv2.imwrite('output.jpg', img)
# 寫入不同圖檔格式
#cv2.imwrite('output.png', img)
#cv2.imwrite('output.tiff', img)
# 設定 JPEG 圖片品質為 90(可用值為 0 ~ 100)
#cv2.imwrite('output.jpg', img, [cv2.IMWRITE_JPEG_QUALITY, 90])
# 設定 PNG 壓縮層級為 5(可用值為 0 ~ 9)
#cv2.imwrite('output.png', img, [cv2.IMWRITE_PNG_COMPRESSION, 5])
# 使用 OpenCV 讀取圖檔
#img_bgr = cv2.imread('/Users/Ivan.lam/Projects/DjangoReact-Boilerplate/project/project/human-20180303-01-1024x683.jpg')
# 將 BGR 圖片轉為 RGB 圖片
#img_rgb = img_bgr[:,:,::-1]
# 或是這樣亦可
# img_rgb = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB)
# 使用 Matplotlib 顯示圖片
#plt.imshow(img_rgb)
#plt.show()
# 使用 OpenCV 讀取灰階圖檔
img_gray = cv2.imread('/Users/Ivan.lam/Projects/DjangoReact-Boilerplate/project/project/human-20180303-01-1024x683.jpg', cv2.IMREAD_GRAYSCALE)
# 使用 Matplotlib 顯示圖片
plt.imshow(img_gray, cmap = 'gray')
plt.show()
| 22.014493 | 142 | 0.734036 | 229 | 1,519 | 4.79476 | 0.384279 | 0.063752 | 0.07286 | 0.04918 | 0.489071 | 0.357924 | 0.306922 | 0.248634 | 0.248634 | 0.248634 | 0 | 0.067597 | 0.104016 | 1,519 | 68 | 143 | 22.338235 | 0.739162 | 0.687953 | 0 | 0 | 0 | 0.285714 | 0.447005 | 0.437788 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 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 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
949620dd7548061eb94904c159b794186e693070 | 548 | py | Python | week3/exercises/globalvars.py | Nburkhal/mit-cs250 | a3d32a217deb2cfa1b94d8188bef73c0742b1245 | [
"MIT"
] | null | null | null | week3/exercises/globalvars.py | Nburkhal/mit-cs250 | a3d32a217deb2cfa1b94d8188bef73c0742b1245 | [
"MIT"
] | null | null | null | week3/exercises/globalvars.py | Nburkhal/mit-cs250 | a3d32a217deb2cfa1b94d8188bef73c0742b1245 | [
"MIT"
] | null | null | null | def fib(n):
global numFibCalls
numFibCalls += 1
if n == 1:
return 1
elif n == 2:
return 2
else:
return fib(n-1) + fib(n-2)
def fibef(n, d):
global numFibCalls
numFibCalls += 1
if n in d:
return d[n]
else:
ans = fibef(n-1, d) + fibef(n-2, d)
d[n] = ans
return ans
numFibCalls = 0
fibArg = #number here
print(fib(fibArg))
print('function calls', numFibCalls)
numFibCalls = 0
d = {1:1, 2:2}
print(fibef(fibArg, d))
print('function calls', numFibCalls)
| 16.117647 | 43 | 0.554745 | 82 | 548 | 3.707317 | 0.268293 | 0.039474 | 0.184211 | 0.190789 | 0.210526 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0.042667 | 0.315693 | 548 | 33 | 44 | 16.606061 | 0.768 | 0.020073 | 0 | 0.384615 | 0 | 0 | 0.052239 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.153846 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
94a4ab1d83fb7f27ad748bb7937fc9b276b1f934 | 478 | py | Python | 08/00/0.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | null | null | null | 08/00/0.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | 39 | 2017-07-31T22:54:01.000Z | 2017-08-31T00:19:03.000Z | 08/00/0.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | null | null | null | import string
print('string.ascii_letters', string.ascii_letters)
print('string.ascii_lowercase', string.ascii_lowercase)
print('string.ascii_uppercase', string.ascii_uppercase)
print('string.digits', string.digits)
print('string.hexdigits', string.hexdigits)
print('string.octdigits', string.octdigits)
print('string.punctuation', '>' + string.punctuation + '<')
print('string.printable', '>' + string.printable + '<')
print('string.whitespace', '>' + string.whitespace + '<')
| 43.454545 | 59 | 0.751046 | 53 | 478 | 6.660377 | 0.245283 | 0.280453 | 0.135977 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066946 | 478 | 10 | 60 | 47.8 | 0.79148 | 0 | 0 | 0 | 0 | 0 | 0.34728 | 0.09205 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.1 | 0 | 0.1 | 0.9 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
94a97a215ff96f35fb6326e06fe5788ceef1181c | 172 | py | Python | zen/urls.py | averrin/emergent | a031b57f6a498ae164c2a558e71af2a6199ef53b | [
"MIT"
] | 2 | 2015-12-11T08:01:57.000Z | 2015-12-11T08:02:00.000Z | zen/urls.py | averrin/emergent | a031b57f6a498ae164c2a558e71af2a6199ef53b | [
"MIT"
] | null | null | null | zen/urls.py | averrin/emergent | a031b57f6a498ae164c2a558e71af2a6199ef53b | [
"MIT"
] | null | null | null | # coding: utf8
from django.conf.urls import patterns, url
from views import IndexView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='zen-index'),
)
| 19.111111 | 54 | 0.697674 | 23 | 172 | 5.173913 | 0.782609 | 0.184874 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006803 | 0.145349 | 172 | 8 | 55 | 21.5 | 0.802721 | 0.069767 | 0 | 0 | 0 | 0 | 0.06962 | 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 |
94af6fc1402f8b9764b8dfe8bc672d9e68cf7af9 | 2,535 | py | Python | dashio/__init__.py | dashio-connect/python-dashio | 36ff84b07511deef4587ddd38bdb8d8ca800f264 | [
"MIT"
] | null | null | null | dashio/__init__.py | dashio-connect/python-dashio | 36ff84b07511deef4587ddd38bdb8d8ca800f264 | [
"MIT"
] | null | null | null | dashio/__init__.py | dashio-connect/python-dashio | 36ff84b07511deef4587ddd38bdb8d8ca800f264 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020 DashIO-Connect
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from .device import Device
from .tcpconnection import TCPConnection
from .mqttconnection import MQTTConnection
from .zmqconnection import ZMQConnection
from .dashconnection import DashConnection
# from .bleconnection import BLEConnection
from .iotcontrol.enums import (
Color,
Icon,
Precision,
SoundName,
Keyboard,
TextAlignment,
TitlePosition,
SliderBarType,
DialNumberPosition,
DialStyle,
GraphLineType,
TimeGraphLineType,
TimeGraphPositionOfKey,
ButtonState,
LabelStyle,
KnobStyle,
GraphXAxisLabelsStyle,
TextFormat,
DirectionStyle
)
from .iotcontrol.graph import Graph, GraphLine
from .iotcontrol.slider_single_bar import SliderSingleBar
from .iotcontrol.slider_double_bar import SliderDoubleBar
from .iotcontrol.textbox import TextBox
from .iotcontrol.button import Button
from .iotcontrol.time_graph import TimeGraph, TimeGraphLine, DataPoint
from .iotcontrol.knob import Knob
from .iotcontrol.dial import Dial
from .iotcontrol.direction import Direction
from .iotcontrol.map import Map, MapLocation, SimpleMapLocation
from .iotcontrol.alarm import Alarm
from .iotcontrol.menu import Menu
from .iotcontrol.selector import Selector
from .iotcontrol.label import Label
from .iotcontrol.device_view import DeviceView
from .iotcontrol.control import Control, ControlPosition
from .iotcontrol.button_group import ButtonGroup
from .iotcontrol.event_log import EventData, EventLog
| 36.73913 | 78 | 0.805917 | 322 | 2,535 | 6.319876 | 0.490683 | 0.130713 | 0.012776 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001854 | 0.149112 | 2,535 | 68 | 79 | 37.279412 | 0.941586 | 0.438659 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.545455 | 0 | 0.545455 | 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 |
94b21a42791d9ce88e22289fccaa0e1a06e976b6 | 625 | py | Python | src/tiles/__init__.py | sirdodger/acstat | d4e6014da3015ce2c5c339fd692458d35b7887fa | [
"MIT"
] | null | null | null | src/tiles/__init__.py | sirdodger/acstat | d4e6014da3015ce2c5c339fd692458d35b7887fa | [
"MIT"
] | null | null | null | src/tiles/__init__.py | sirdodger/acstat | d4e6014da3015ce2c5c339fd692458d35b7887fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Tiles that comprise a ship.
"""
import utils
from .tile import Tile
from .tile_cannon import CannonTile
from .tile_cargo import CargoTile
from .tile_cloak import CloakingTile
from .tile_engine import EngineTile
from .tile_helm import HelmTile
from .tile_hyperdrive import HyperdriveTile
from .tile_lifesupport import LifeSupportTile
from .tile_minelayer import MineLayerTile
from .tile_missile import MissileTile
from .tile_science import ScienceTile
from .tile_sickbay import SickBayTile
from .tile_teleporter import TeleporterTile
TILES = {t.ABBREVIATION: t for t in utils.subclasses(Tile)}
| 25 | 59 | 0.8256 | 85 | 625 | 5.929412 | 0.494118 | 0.206349 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001821 | 0.1216 | 625 | 24 | 60 | 26.041667 | 0.916211 | 0.0784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.933333 | 0 | 0.933333 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
94c519c34e03a00b0bd748b19ce6fbf0eba4846e | 125 | py | Python | python/test-data/testTypesSet1.py | Panteon32Om/write-your-python-program | 615b73113466c1c8f901fad0a076b480f62ad437 | [
"BSD-3-Clause"
] | 1 | 2021-09-30T10:17:57.000Z | 2021-09-30T10:17:57.000Z | python/test-data/testTypesSet1.py | Panteon32Om/write-your-python-program | 615b73113466c1c8f901fad0a076b480f62ad437 | [
"BSD-3-Clause"
] | 47 | 2020-11-16T14:02:52.000Z | 2022-03-18T12:44:38.000Z | python/test-data/testTypesSet1.py | Panteon32Om/write-your-python-program | 615b73113466c1c8f901fad0a076b480f62ad437 | [
"BSD-3-Clause"
] | 4 | 2020-10-28T13:54:44.000Z | 2022-01-20T17:36:24.000Z | from wypp import *
def appendSomething(l: set[int]) -> None:
l.add("foo")
l = set([1,2,3])
appendSomething(l)
print(l)
| 13.888889 | 41 | 0.632 | 21 | 125 | 3.761905 | 0.714286 | 0.405063 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028846 | 0.168 | 125 | 8 | 42 | 15.625 | 0.730769 | 0 | 0 | 0 | 0 | 0 | 0.024 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.333333 | 0.166667 | 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 |
94d03982d63aa9eb843169f36afedda8e4bdbb0e | 697 | py | Python | controllers/debug.py | sloe/metrics | c86f3b6baee1405e8044d03da9a2af1552566e53 | [
"Apache-2.0"
] | 1 | 2017-07-25T19:20:07.000Z | 2017-07-25T19:20:07.000Z | controllers/debug.py | sloe/metric | c86f3b6baee1405e8044d03da9a2af1552566e53 | [
"Apache-2.0"
] | null | null | null | controllers/debug.py | sloe/metric | c86f3b6baee1405e8044d03da9a2af1552566e53 | [
"Apache-2.0"
] | null | null | null |
@auth.requires_membership('admin')
def album():
grid = SQLFORM.grid(db.t_mtalbum)
return dict(grid=grid)
@auth.requires_membership('admin')
def dataset():
grid = SQLFORM.grid(db.t_mtdataset)
return dict(grid=grid)
@auth.requires_membership('admin')
def item():
grid = SQLFORM.grid(db.t_mtitem)
return dict(grid=grid)
@auth.requires_membership('admin')
def itemtype():
grid = SQLFORM.grid(db.t_mtitemtype)
return dict(grid=grid)
@auth.requires_membership('admin')
def search():
grid = SQLFORM.grid(db.t_mtsearch)
return dict(grid=grid)
@auth.requires_membership('admin')
def user():
grid = SQLFORM.grid(db.t_mtuser)
return dict(grid=grid)
| 19.361111 | 40 | 0.700143 | 96 | 697 | 4.958333 | 0.239583 | 0.151261 | 0.277311 | 0.340336 | 0.794118 | 0.504202 | 0.504202 | 0.504202 | 0.504202 | 0 | 0 | 0 | 0.153515 | 697 | 35 | 41 | 19.914286 | 0.80678 | 0 | 0 | 0.5 | 0 | 0 | 0.043103 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
94eca33b4f0da853b492816b54aa033cca25e269 | 263 | py | Python | igloo/models/utils.py | IglooCloud/igloo-python | a1a72db136309dcc85bd0f1bdb6579eb55665855 | [
"MIT"
] | 1 | 2020-10-22T17:25:49.000Z | 2020-10-22T17:25:49.000Z | igloo/models/utils.py | IglooCloud/igloo-python | a1a72db136309dcc85bd0f1bdb6579eb55665855 | [
"MIT"
] | null | null | null | igloo/models/utils.py | IglooCloud/igloo-python | a1a72db136309dcc85bd0f1bdb6579eb55665855 | [
"MIT"
] | null | null | null | async def _asyncWrapWith(res, wrapper_fn):
result = await res
return wrapper_fn(result["id"])
def wrapWith(res, wrapper_fn):
if isinstance(res, dict):
return wrapper_fn(res)
else:
return _asyncWrapWith(res, wrapper_fn)
| 23.909091 | 47 | 0.653992 | 33 | 263 | 5 | 0.454545 | 0.272727 | 0.218182 | 0.30303 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.250951 | 263 | 10 | 48 | 26.3 | 0.837563 | 0 | 0 | 0 | 0 | 0 | 0.007905 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.5 | 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 |
94fdb90dfedc7fcd33e6da48e3697c644d91b340 | 167 | py | Python | plugins/phpwiki_cms.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | 22 | 2016-09-01T08:27:07.000Z | 2021-01-11T13:32:59.000Z | plugins/phpwiki_cms.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | null | null | null | plugins/phpwiki_cms.py | cflq3/getcms | 6cf07da0ea3ec644866df715cff1f311a46ee378 | [
"MIT"
] | 20 | 2015-11-07T19:09:48.000Z | 2018-05-02T03:10:41.000Z | #!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_file(pluginname, "themes\default\Wikiwyg\Wikiwy\Phpwiki.js", "phpwiki")
| 23.857143 | 94 | 0.742515 | 23 | 167 | 5.304348 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006667 | 0.101796 | 167 | 6 | 95 | 27.833333 | 0.806667 | 0.215569 | 0 | 0 | 0 | 0 | 0.367188 | 0.3125 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a219f372d6a5e79322a5287d79b86db59c894e7a | 142 | py | Python | Lista1/ex005.py | Palhares17/Python_Exercicios_UFV | 8370e02a52b024a4170d11b1ec95c1c97851f09a | [
"MIT"
] | null | null | null | Lista1/ex005.py | Palhares17/Python_Exercicios_UFV | 8370e02a52b024a4170d11b1ec95c1c97851f09a | [
"MIT"
] | null | null | null | Lista1/ex005.py | Palhares17/Python_Exercicios_UFV | 8370e02a52b024a4170d11b1ec95c1c97851f09a | [
"MIT"
] | null | null | null | r = float(input('Raio = '))
h = float(input('Altura = '))
r2 = r ** 2
v = 3.14159 * h * r2
print('Volume da lata de óleo é {:.2f}'.format(v)) | 28.4 | 50 | 0.556338 | 26 | 142 | 3.038462 | 0.769231 | 0.253165 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088496 | 0.204225 | 142 | 5 | 50 | 28.4 | 0.610619 | 0 | 0 | 0 | 0 | 0 | 0.328671 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.2 | 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 |
bf68c7a0f44e7f03509c8ad8230e535656fee471 | 105 | py | Python | setup.py | siboehm/hgraph2graph | 91d0dc763be1f9bc97e0c2473b0a00a058b4a9f9 | [
"MIT"
] | null | null | null | setup.py | siboehm/hgraph2graph | 91d0dc763be1f9bc97e0c2473b0a00a058b4a9f9 | [
"MIT"
] | null | null | null | setup.py | siboehm/hgraph2graph | 91d0dc763be1f9bc97e0c2473b0a00a058b4a9f9 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="hgraph2graph",
author="Wengong Jin",
)
| 15 | 43 | 0.714286 | 12 | 105 | 6.166667 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011628 | 0.180952 | 105 | 6 | 44 | 17.5 | 0.848837 | 0 | 0 | 0 | 0 | 0 | 0.219048 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 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 |
bf6a18d37c089c22eefce06b943bf49ace102053 | 3,012 | py | Python | src/decorated_options/options.py | musically-ut/decorated_options | 5ff3c0e89804635092a2cc3ea326c3342869c9a6 | [
"BSD-2-Clause"
] | 8 | 2017-01-16T15:56:59.000Z | 2021-12-04T00:11:41.000Z | src/decorated_options/options.py | musically-ut/decorated_options | 5ff3c0e89804635092a2cc3ea326c3342869c9a6 | [
"BSD-2-Clause"
] | null | null | null | src/decorated_options/options.py | musically-ut/decorated_options | 5ff3c0e89804635092a2cc3ea326c3342869c9a6 | [
"BSD-2-Clause"
] | 2 | 2019-07-19T23:42:28.000Z | 2021-11-16T07:57:34.000Z | from functools import wraps
import inspect
# TODO: Make pickeable; will involve adding '__getstate__'
class Options(object):
"""An immutable place to save options for a simulation run."""
def __init__(self, **kwargs):
"""Pass the options to save using the """
super(Options, self).__setattr__('_internal_options_data', kwargs)
def __setattr__(self, attr, v):
raise NotImplementedError('Cannot set values. Use "update" instead.')
def __getattr__(self, attr):
return self._internal_options_data[attr]
def __contains__(self, k):
return k in self._internal_options_data
def keys(self):
return self._internal_options_data.keys()
def get(self, key):
return self._internal_options_data[key]
def set(self, *args, **kwargs):
"""Change values on the option."""
if len(args) == 2:
return self._update(**{args[0]: args[1]})
else:
return self._update(**kwargs)
def set_new(self, *args, **kwargs):
"""Set a new value on the option."""
if len(args) == 2:
return self._update_with_new_keys(**{args[0]: args[1]})
else:
return self._update_with_new_keys(**kwargs)
def _get_dict(self):
return self._internal_options_data.copy()
def _update_with_new_keys(self, **kwargs):
d = self._get_dict()
d.update(kwargs)
return Options(**d)
def _update(self, **kwargs):
for k in kwargs:
if k not in self._internal_options_data:
raise ValueError("Key {} not present in original options.".format(k))
return self._update_with_new_keys(**kwargs)
def optioned(option_arg='_opts'):
"""Returns a decorator which can 'fill-in' the arguments to function 'f' using the
option passed in with the name given by `option_arg` parameter.
:param: option_arg: The name of the argument which will contain the Options object.
"""
def _decorator(f):
sig = inspect.signature(f)
params = sig.parameters
f_args = params.keys()
@wraps(f)
def wrapped_f(*args, **kwargs):
if option_arg not in kwargs:
return f(*args, **kwargs)
else:
opts = kwargs[option_arg]
all_args_dict = opts._get_dict()
all_args_dict.update(kwargs)
new_arg_dict = {}
for idx, arg in enumerate(f_args):
if idx < len(args):
# This argument was passed positionally, ignore
pass
else:
if arg in all_args_dict:
new_arg_dict[arg] = all_args_dict[arg]
elif params[arg].default is not inspect._empty:
new_arg_dict[arg] = params[arg].default
return f(*args, **new_arg_dict)
return wrapped_f
return _decorator
| 32.387097 | 87 | 0.582337 | 372 | 3,012 | 4.446237 | 0.295699 | 0.054414 | 0.080411 | 0.083434 | 0.226723 | 0.161427 | 0.114873 | 0.114873 | 0.04474 | 0.04474 | 0 | 0.00292 | 0.317729 | 3,012 | 92 | 88 | 32.73913 | 0.801946 | 0.161023 | 0 | 0.131148 | 0 | 0 | 0.042622 | 0.008846 | 0 | 0 | 0 | 0.01087 | 0 | 1 | 0.229508 | false | 0.016393 | 0.032787 | 0.081967 | 0.52459 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
bfb873ce4386025b5c6aae34c1921854ed7f48ec | 233 | py | Python | terrascript/resource/stobias123/orion.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/resource/stobias123/orion.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/resource/stobias123/orion.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/resource/stobias123/orion.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:24:05 UTC)
import terrascript
class orion_ip_address(terrascript.Resource):
pass
__all__ = [
"orion_ip_address",
]
| 17.923077 | 73 | 0.759657 | 31 | 233 | 5.451613 | 0.709677 | 0.224852 | 0.16568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074627 | 0.137339 | 233 | 12 | 74 | 19.416667 | 0.766169 | 0.480687 | 0 | 0 | 1 | 0 | 0.135593 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.166667 | 0.166667 | 0 | 0.333333 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
44bdd4ecfe77abd329e760e65ef9dc2e529e09df | 526 | py | Python | org/apache/helix/store/HelixPropertyListener.py | davzhang/helix-python-binding | 11a9ecf730bce07720e0b0bcf7f0ec1cd2b25878 | [
"Apache-2.0"
] | 3 | 2015-04-08T22:51:04.000Z | 2015-05-03T06:42:35.000Z | org/apache/helix/store/HelixPropertyListener.py | zzhang5/helix-python-binding | 11a9ecf730bce07720e0b0bcf7f0ec1cd2b25878 | [
"Apache-2.0"
] | null | null | null | org/apache/helix/store/HelixPropertyListener.py | zzhang5/helix-python-binding | 11a9ecf730bce07720e0b0bcf7f0ec1cd2b25878 | [
"Apache-2.0"
] | 1 | 2020-03-31T21:43:01.000Z | 2020-03-31T21:43:01.000Z | # package org.apache.helix.store
#from org.apache.helix.store import *
class HelixPropertyListener:
def onDataChange(self, path):
"""
Returns void
Parameters:
path: String
"""
pass
def onDataCreate(self, path):
"""
Returns void
Parameters:
path: String
"""
pass
def onDataDelete(self, path):
"""
Returns void
Parameters:
path: String
"""
pass
| 13.15 | 37 | 0.484791 | 43 | 526 | 5.930233 | 0.465116 | 0.094118 | 0.176471 | 0.223529 | 0.529412 | 0.529412 | 0.529412 | 0.529412 | 0.360784 | 0 | 0 | 0 | 0.427757 | 526 | 39 | 38 | 13.487179 | 0.847176 | 0.36692 | 0 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0.428571 | 0 | 0 | 0.571429 | 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 |
44e5b3eaf5549e7305057c7d0189915cf2e55916 | 1,284 | py | Python | credentials.py | Joannsaj/password | fb364f8346e70077e5bbb542f0cabbf2296f7c4f | [
"MIT"
] | null | null | null | credentials.py | Joannsaj/password | fb364f8346e70077e5bbb542f0cabbf2296f7c4f | [
"MIT"
] | null | null | null | credentials.py | Joannsaj/password | fb364f8346e70077e5bbb542f0cabbf2296f7c4f | [
"MIT"
] | null | null | null | class Credentials:
"""
Class that generates new instances of credentials.
"""
credentials_list = [] #empty user list
def __init__(self,account,username,password):
self.account = account
self.username = username
self.password = password
def save_credentials(self):
'''
save_credentials method saves credentials objects into credentials_list
'''
Credentials.credentials_list.append(self)
def delete_credentials(self):
'''
delete_credentials method deletes a saved credential from the credentials_list
'''
Credentials.credentials_list.remove(self)
@classmethod
def find_by_account(cls,account):
'''
Method that takes in a account and returns a credentials that matches that account.
Args:
account: Phone account to search for
Returns :
Credentials of person that matches the account.
'''
for credentials in cls.credentials_list:
if credentials.account == account:
return credentials
@classmethod
def display_credentials(cls):
'''
method that returns the credentials list
'''
return cls.credentials_list | 24.226415 | 91 | 0.626947 | 130 | 1,284 | 6.053846 | 0.369231 | 0.152478 | 0.099111 | 0.094028 | 0.104193 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.308411 | 1,284 | 53 | 92 | 24.226415 | 0.886261 | 0.352025 | 0 | 0.111111 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0.111111 | 0 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
44e5f3c06221899f3177cd54d9d5ec5c1b93b5cc | 9,815 | py | Python | pytodz/pytodz_open.py | Alpha-Demon404/RE-14 | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 39 | 2020-02-26T09:44:36.000Z | 2022-03-23T00:18:25.000Z | pytodz/pytodz_open.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 15 | 2020-05-14T10:07:26.000Z | 2022-01-06T02:55:32.000Z | pytodz/pytodz_open.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 41 | 2020-03-16T22:36:38.000Z | 2022-03-17T14:47:19.000Z | # Filenames : xSODx
# python bytecode : 2.7
# Time Succses Parser : Fri Jul 24 14:09:24 2020
# Auto Parser Dis Version : 1.1.0
# Source : https://www.github.com/Datez-Kun
#!/usr/bin/python2
# -*- coding:utf-8 -*-
import os, sys, re, time
import binascii, base64, marshal, zlib
from py_compile import compile as _compile
try:
import uncompyle6
except ImportError:
os.system('pip2 install uncompyle6')
_0o0oO_ = u'S\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8m\x8e$S\xd8s)\x80\xa0\xcd\xc8\xc7?\xca\x9a\x80.\xc7/\xd1\xca\xcd%\x80\xeb`/\xc2/>/\x8e$S\xd8s)\x80\xeb\xc4\xca\xd1\xf8\xc8\x9a\x80\xe4?_\xf8\xd1%\xc1\x80\x17\x80\xe0\xc1\xc4?_\xf8\xd1%\xc1\x80\xf8`\xc8\xc7?>\x16\x8e$S\xd8s)\x80\xe5\xd1\xc8\xc7\xcd\xc2\x9a\x80\xc7\xc8\xc8\xf8\xcb\x9a\x07\x07\xc5\xd1\xc8\xc7\xcd\xc2\x06\xc4?_\x07\xcc\xeb!\xe0\xcc\x91\x91\x8eS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8mS\xd8m'
tod = []
def save_file(outfile, value):
open(outfile, 'w').write(value[0])
del value[::]
main_menu('[√] File Saved '+outfile)
class Compile:
def __init__(self, file):
try:
self.code = open(file).read()
self.outfile = str('enc_'+file)
self.filename = str(file)
except Exception as exception:
main_menu(exception)
def marshal(self):
tod.append('import marshal\nexec marshal.loads({code})'.format(code=repr(marshal.dumps(compile(self.code, self.filename, 'exec')))))
save_file(self.outfile, tod)
def pyc(self):
_compile(self.filename)
main_menu('[√] File Saved '+self.filename+'c')
def zlib(self):
tod.append('import zlib\nexec zlib.decompress({code})'.format(code=repr(zlib.compress(self.code))))
save_file(self.outfile, tod)
def base16(self):
tod.append('import base64\nexec base64.b16decode("{code}")'.format(code=base64.b16encode(self.code)))
save_file(self.outfile, tod)
def base32(self):
tod.append('import base64\nexec base64.b32decode("{code}")'.format(code=base64.b32encode(self.code)))
save_file(self.outfile, tod)
def base64(self):
tod.append('import base64\nexec base64.b64decode("{code}")'.format(code=base64.b64encode(self.code)))
save_file(self.outfile, tod)
def hex(self):
tod.append('import binascii\nexec binascii.unhexlify("%x" % int("{code}", 0))'.format(code=hex(int(binascii.hexlify(self.code),16))))
save_file(self.outfile, tod)
def bin(self):
tod.append('import binascii\nexec binascii.unhexlify("%x" % int("{code}", 0))'.format(code=bin(int(binascii.hexlify(self.code),16))))
save_file(self.outfile, tod)
class Decompile:
def __init__(self, file):
try:
self.code = open(file).read()
self.outfile = str('dec_'+file)
self.filename = str(file)
except Exception as exception:
main_menu(exception)
def marshal(self):
if 'marshal.loads' in self.code:
if 'c\\x00' in self.code:
if ')))' in self.code:
code = re.search('marshal.loads(.+)', self.code).group()[:-2]
elif '(marshal.loads(' in self.code:
code = re.search(r'[(]marshal.loads(.+)', self.code).group()[1:][:-1]
else:
code = re.search(r'marshal.loads(.+)', self.code).group()
else:
main_menu('[!] File not supported')
else:
main_menu('[!] File not supported')
open('_oOoOo_', 'w').write('import marshal, sys\n__import__("uncompyle6").main.decompile(2.7, {code}, sys.stdout)'.format(outfile=self.outfile, code=str(code)))
os.system('python2 _oOoOo_ > {hasil}'.format(hasil=self.outfile))
os.remove('_oOoOo_')
main_menu('[√] File saved '+self.outfile)
def pyc(self):
os.system('uncompyle6 {filename} > {hasil}'.format(filename=self.filename, hasil=self.filename[:-4]+'_dec.py'))
main_menu('[√] File saved '+self.filename[:-4]+'_dec.py')
def zlib(self):
if 'zlib.decompress' in self.code:
if ')))' in self.code:
code = re.search(r'zlib.decompress(.+)', self.code).group()[:-2]
elif '(zlib.decompress(' in self.code:
code = re.search(r'[(]zlib.decompress(.+)', self.code).group()[1:][:-1]
else:
code = re.search(r'zlib.decompress(.+)', self.code).group()
else:
main_menu('[!] File not supported')
exec 'print >> open("{hasil}", "w"), {code}'.format(hasil=self.outfile, code=str(code))
main_menu('[√] File saved '+self.outfile)
def base16(self):
if 'base64.b16decode' in self.code:
if ')))' in self.code:
code = re.search(r'base64.b16decode(.+)', self.code).group()[:-2]
elif '(base64.b16decode(' in self.code:
code = re.search(r'[(]base64.b16decode(.+)', self.code).group()[1:][:-1]
else:
code = re.search(r'base64.b16decode(.+)', self.code).group()
else:
main_menu('[!] File not supported')
exec 'print >> open("{hasil}", "w"), {code}'.format(code=str(code), hasil=self.outfile)
main_menu('[√] File saved '+self.outfile)
def base32(self):
if 'base64.b32decode' in self.code:
if ')))' in self.code:
code = re.search(r'base64.b32decode(.+)', self.code).group()[:-2]
elif '(base64.b32decode(' in self.code:
code = re.search(r'[(]base64.b32decode(.+)', self.code).group()[1:][:-1]
else:
code = re.search(r'base64.b32decode(.+)', self.code).group()
else:
main_menu('[!] File not supported')
exec 'print >> open("{hasil}", "w"), {code}'.format(code=str(code), hasil=self.outfile)
main_menu('[√] File saved '+self.outfile)
def base64(self):
if 'base64.b64decode' in self.code:
if ')))' in self.code:
code = re.search(r'base64.b64decode(.+)', self.code).group()[:-2]
elif '(base64.b64decode(' in self.code:
code = re.search(r'[(]base64.b64decode(.+)', self.code).group()[1:][:-1]
else:
code = re.search(r'base64.b64decode(.+)', self.code).group()
else:
main_menu('[!] File not supported')
exec 'print >> open("{hasil}", "w"), {code}'.format(code=str(code), hasil=self.outfile)
main_menu('[√] File saved '+self.outfile)
def hex(self):
if 'binascii.unhexlify' in self.code:
if '))))' in self.code:
code = re.search(r'binascii.unhexlify(.+)', self.code).group()[:-2]
elif '(binascii.unhexlify(' in self.code:
code = re.search(r'[(]binascii.unhexlify(.+)', self.code).group()[1:][:-1]
else:
code = re.search(r'binascii.unhexlify(.+)', self.code).group()
else:
main_menu('[!] File not supported')
exec 'print >> open("{outfile}", "w"), {code}'.format(outfile=self.outfile, code=str(code))
main_menu('[√] File saved '+self.outfile)
def bin(self):
if 'binascii.unhexlify' in self.code:
if '))))' in self.code:
code = re.search(r'binascii.unhexlify(.+)', self.code).group()[:-2]
elif '(binascii.unhexlify(' in self.code:
code = re.search(r'[(]binascii.unhexlify(.+)', self.code).group()[1:][:-1]
else:
code = re.search(r'binascii.unhexlify(.+)', self.code).group()
else:
main_menu('[!] File not supported')
exec 'print >> open("{outfile}", "w"), {code}'.format(outfile=self.outfile, code=str(code))
main_menu('[√] File saved '+self.outfile)
def main_menu(text=None):
if text is not None:
print text
time.sleep(1.5)
else:pass
os.system('clear')
print _0o0oO_.encode('cp500')
print ('[1] Compile {0}\n[2] Decompile {0}\n[3] Exit').format('Menu')
print '—'*48
try:
choose = raw_input('[•] Choose: ')
except (EOFError, KeyboardInterrupt):pass
if choose in ('1', '2', '3'):
choose = int(choose)
if choose == 1:
compile_menu()
elif choose == 2:
decompile_menu()
elif choose == 3:
sys.exit('[!] Exit')
else:
main_menu('[!] Wrong Input')
return
def compile_menu():
os.system('clear')
print _0o0oO_.encode('cp500')
print ('[1] {0} marshal\n[2] {0} pyc\n[3] {0} zlib\n[4] {0} base16\n[5] {0} base32\n[6] {0} base64\n[7] {0} hex\n[8] {0} bin\n[B] Back').format('Compile')
print '—'*48
try:
choose = raw_input('[•] Choose: ')
except (EOFError, KeyboardInterrupt):pass
if choose in ('1', '2', '3', '4', '5', '6', '7', '8'):
try:
file = raw_input('[•] Input File: ')
except Exception as exception:
main_menu(exception)
choose = int(choose)
if choose == 1:
Compile(file).marshal()
elif choose == 2:
Compile(file).pyc()
elif choose == 3:
Compile(file).zlib()
elif choose == 4:
Compile(file).base16()
elif choose == 5:
Compile(file).base32()
elif choose == 6:
Compile(file).base64()
elif choose == 7:
Compile(file).hex()
elif choose == 8:
Compile(file).bin()
elif choose in ['b', 'B']:
main_menu()
else:
main_menu('[!] Wrong Input')
return
def decompile_menu():
os.system('clear')
print _0o0oO_.encode('cp500')
print ('[1] {0} marshal\n[2] {0} pyc\n[3] {0} zlib\n[4] {0} base16\n[5] {0} base32\n[6] {0} base64\n[7] {0} hex\n[8] {0} bin\n[B] Back').format('Decompile')
print '—'*48
try:
choose = raw_input('[•] Choose: ')
except (EOFError, KeyboardInterrupt):pass
if choose in ('1', '2', '3', '4', '5', '6', '7', '8'):
try:
file = raw_input('[•] Input File: ')
except Exception as exception:
main_menu(exception)
choose = int(choose)
if choose == 1:
Decompile(file).marshal()
elif choose == 2:
Decompile(file).pyc()
elif choose == 3:
Decompile(file).zlib()
elif choose == 4:
Decompile(file).base16()
elif choose == 5:
Decompile(file).base32()
elif choose == 6:
Decompile(file).base64()
elif choose == 7:
Decompile(file).hex()
elif choose == 8:
Decompile(file).bin()
elif choose in ['b', 'B']:
main_menu()
else:
main_menu('[!] Wrong Input')
return
if __name__ == '__main__':
main_menu()
| 34.318182 | 946 | 0.650942 | 1,487 | 9,815 | 4.248151 | 0.118359 | 0.145639 | 0.213709 | 0.278613 | 0.754314 | 0.671838 | 0.657749 | 0.612633 | 0.586671 | 0.561501 | 0 | 0.055359 | 0.136831 | 9,815 | 285 | 947 | 34.438596 | 0.688149 | 0.020173 | 0 | 0.633333 | 0 | 0.016667 | 0.338468 | 0.143526 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.016667 | 0.054167 | null | null | 0.066667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
44fd4812ffcda907497c816a7cfa5e7142032a96 | 518 | py | Python | staff/migrations/0011_auto_20200318_1902.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | staff/migrations/0011_auto_20200318_1902.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | staff/migrations/0011_auto_20200318_1902.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-03-18 19:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('staff', '0010_auto_20200318_1846'),
]
operations = [
migrations.RenameField(
model_name='instructor',
old_name='text_history',
new_name='history',
),
migrations.RenameField(
model_name='student',
old_name='text_history',
new_name='history',
),
]
| 21.583333 | 47 | 0.567568 | 52 | 518 | 5.442308 | 0.634615 | 0.14841 | 0.183746 | 0.212014 | 0.226148 | 0.226148 | 0.226148 | 0 | 0 | 0 | 0 | 0.088319 | 0.322394 | 518 | 23 | 48 | 22.521739 | 0.717949 | 0.086873 | 0 | 0.470588 | 1 | 0 | 0.176221 | 0.048832 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7831887fe38433327ea872af2cb61d14089aaf3a | 368 | py | Python | Sixt_Day/Seventh_Day_Templet1.py | vijayingale/Adv_Python_Trainig | 39f0a2aff9ca0619a584aa9a33571e3bc5cf0895 | [
"BSD-3-Clause"
] | null | null | null | Sixt_Day/Seventh_Day_Templet1.py | vijayingale/Adv_Python_Trainig | 39f0a2aff9ca0619a584aa9a33571e3bc5cf0895 | [
"BSD-3-Clause"
] | null | null | null | Sixt_Day/Seventh_Day_Templet1.py | vijayingale/Adv_Python_Trainig | 39f0a2aff9ca0619a584aa9a33571e3bc5cf0895 | [
"BSD-3-Clause"
] | null | null | null | from jinja2 import Template
class Persone:
def __init__(self, name ,age):
self.name = name
self.age = age
def getAge(self):
return self.age
def getName(self):
return self.name
person = Persone('peter',23)
tn = Template("my name is {{ per.getName()}} and I am {{ per.getAge() }} ")
msg = tn.render(per=person)
print(msg) | 20.444444 | 75 | 0.611413 | 52 | 368 | 4.25 | 0.519231 | 0.108597 | 0.126697 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010909 | 0.252717 | 368 | 18 | 76 | 20.444444 | 0.792727 | 0 | 0 | 0 | 0 | 0 | 0.170732 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.076923 | 0.153846 | 0.538462 | 0.076923 | 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 |
7833577868c974eed9525b5947d4287952b3f98c | 96 | py | Python | heimdall/athena/apps.py | avdhari/heimdall | 421886f37afd49230b06e6c1bb12354d278f36d6 | [
"MIT"
] | null | null | null | heimdall/athena/apps.py | avdhari/heimdall | 421886f37afd49230b06e6c1bb12354d278f36d6 | [
"MIT"
] | null | null | null | heimdall/athena/apps.py | avdhari/heimdall | 421886f37afd49230b06e6c1bb12354d278f36d6 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class AthenaConfig(AppConfig):
name = 'heimdall.athena'
| 16 | 33 | 0.760417 | 11 | 96 | 6.636364 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15625 | 96 | 5 | 34 | 19.2 | 0.901235 | 0 | 0 | 0 | 0 | 0 | 0.15625 | 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 |
7858442d2b608e7d9890d46f1f79bfeee2b403ab | 1,552 | py | Python | Chapter21.TheBenchmarkingInterlude/timeseqs.py | mindnhand/Learning-Python-5th | 3dc1b28d6e048d512bf851de6c7f6445edfe7b84 | [
"MIT"
] | null | null | null | Chapter21.TheBenchmarkingInterlude/timeseqs.py | mindnhand/Learning-Python-5th | 3dc1b28d6e048d512bf851de6c7f6445edfe7b84 | [
"MIT"
] | null | null | null | Chapter21.TheBenchmarkingInterlude/timeseqs.py | mindnhand/Learning-Python-5th | 3dc1b28d6e048d512bf851de6c7f6445edfe7b84 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#encoding=utf-8
#-------------------------------------------------
# Usage: python3 timeseqs.py
# Description: the usage of time module
#-------------------------------------------------
'''
Test the relative speed of iteration tool alternatives
'''
import sys, timer
reps = 10000
repslist = list(range(reps))
def for_loop():
res = []
for x in repslist:
res.append(abs(x))
return res
def list_comp():
return [abs(x) for x in repslist]
def map_call():
return list(map(abs, repslist))
# return map(abs, repslist)
def gen_expr():
return list(abs(x) for x in repslist)
def gen_func():
def gen():
for x in repslist:
yield abs(x)
return list(gen())
print(sys.version)
for test in (for_loop, list_comp, map_call, gen_expr, gen_func):
(bestof, (total, result)) = timer.bestoftotal(5, 1000, test)
print('%-9s: %.5f => [%s...%s]' % (test.__name__, bestof, result[0], result[-1]))
'''
The Output Results:
0.0014824867248535156
(0.00011920928955078125, 'SPAM')
bestof time of tb1 = (0.0, 'SPAM')
bestof time of tb2 = 0.0028412342071533203
bestof time of tb3 = (0.00015926361083984375, (0.0001220703125, 'SPAM'))
bestoftotal time of tbt2 = (0.0001590251922607422, (0.00011897087097167969, 'SPAM'))
3.8.6 (default, Nov 9 2020, 16:14:32)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
for_loop : 1.14184 => [0...9999]
list_comp: 0.58819 => [0...9999]
map_call : 0.52128 => [0...9999]
gen_expr : 0.84307 => [0...9999]
gen_func : 0.84155 => [0...9999]
'''
| 20.693333 | 85 | 0.603093 | 222 | 1,552 | 4.130631 | 0.414414 | 0.027263 | 0.026172 | 0.061069 | 0.045802 | 0.045802 | 0.045802 | 0 | 0 | 0 | 0 | 0.191824 | 0.180412 | 1,552 | 74 | 86 | 20.972973 | 0.529088 | 0.179768 | 0 | 0.086957 | 0 | 0 | 0.033094 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0.043478 | 0.130435 | 0.521739 | 0.086957 | 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 |
78703cb364e3f28132c5287195f363b70bf60dd7 | 1,222 | py | Python | ctrlwin.py | Fluent-Aero/Desktop.Space | 5b126c4f1db105758bb9a4cf71eef318c3e0316a | [
"Apache-2.0"
] | null | null | null | ctrlwin.py | Fluent-Aero/Desktop.Space | 5b126c4f1db105758bb9a4cf71eef318c3e0316a | [
"Apache-2.0"
] | null | null | null | ctrlwin.py | Fluent-Aero/Desktop.Space | 5b126c4f1db105758bb9a4cf71eef318c3e0316a | [
"Apache-2.0"
] | null | null | null | import win32con
from win32 import win32gui
from PIL import Image, ImageGrab
import getwinsize as gws
class wc:
def close(i):
win32gui.PostMessage(i, win32con.WM_CLOSE, 0, 0)
def shownormal(i):
win32gui.ShowWindow(i,win32con.SW_SHOWNORMAL)
def minn(i):
win32gui.ShowWindow(i,win32con.SW_SHOWMINIMIZED)
def maxx(i):
win32gui.ShowWindow(i,win32con.SW_SHOWMAXIMIZED)
def focus(i):
win32gui.ShowWindow(i,win32con.SW_SHOW)
def findfocus():
return win32gui.GetForegroundWindow()
def getwindowsize(i):
return win32gui.GetWindowRect(i)
def getwindowname(i):
return win32gui.GetWindowText(i)
def mrwindow(i,x,y,w=-1,h=-1):
rect = win32gui.GetWindowRect(i)
if(w==-1):
w=rect.right-rect.left
if(h==-1):
h=rect.bottom-rect.top
win32gui.MoveWindow(i,x,y,w,h,True)
def clip(x,y,xw,yh):
return ImageGrab.grab((x,y,xw,yh))
def tl(i):
win32gui.SetWindowPos(i, win32con.HWND_TOPMOST, *gws.gcs(i),win32con.SWP_SHOWWINDOW)
def untl(i):
win32gui.SetWindowPos(i, win32con.HWND_TOP,*gws.gcs(i), win32con.SWP_SHOWWINDOW) | 34.914286 | 93 | 0.635025 | 163 | 1,222 | 4.705521 | 0.368098 | 0.105606 | 0.099087 | 0.104302 | 0.318123 | 0.318123 | 0 | 0 | 0 | 0 | 0 | 0.058378 | 0.243044 | 1,222 | 35 | 94 | 34.914286 | 0.770811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.352941 | false | 0 | 0.117647 | 0.117647 | 0.617647 | 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 |
78767cc15510ef1e339f69634b9d2493ff3191e2 | 574 | py | Python | dev/tools/roadnet_convert/geo/position.py | gusugusu1018/simmobility-prod | d30a5ba353673f8fd35f4868c26994a0206a40b6 | [
"MIT"
] | 50 | 2018-12-21T08:21:38.000Z | 2022-01-24T09:47:59.000Z | dev/tools/roadnet_convert/geo/position.py | gusugusu1018/simmobility-prod | d30a5ba353673f8fd35f4868c26994a0206a40b6 | [
"MIT"
] | 2 | 2018-12-19T13:42:47.000Z | 2019-05-13T04:11:45.000Z | dev/tools/roadnet_convert/geo/position.py | gusugusu1018/simmobility-prod | d30a5ba353673f8fd35f4868c26994a0206a40b6 | [
"MIT"
] | 27 | 2018-11-28T07:30:34.000Z | 2022-02-05T02:22:26.000Z | #Contains an (x,y) point, usually in projected coords.
class Point:
def __init__(self, x:float, y:float):
self.x = x
self.y = y
def __repr__(self):
return "Point(%f,%f)" % (self.x, self.y)
def __str__(self):
return "(%f,%f)" % (self.x, self.y)
#Contains a (lat/lng) location, usually as +/- rather than E/W
class Location:
def __init__(self, lat:float, lng:float):
self.lat = lat
self.lng = lng
def __repr__(self):
return "Location(%f,%f)" % (self.lat, self.lng)
def __str__(self):
return "(%f,%f)" % (self.lat, self.lng)
| 21.259259 | 62 | 0.608014 | 92 | 574 | 3.532609 | 0.293478 | 0.061538 | 0.073846 | 0.104615 | 0.270769 | 0.270769 | 0.135385 | 0 | 0 | 0 | 0 | 0 | 0.212544 | 574 | 26 | 63 | 22.076923 | 0.719027 | 0.198606 | 0 | 0.25 | 0 | 0 | 0.089912 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0 | 0.25 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
78a60f83f6ffc0cd34423ff884536730670a54a3 | 542 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/scripts/xsslint/xsslint/rules.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/scripts/xsslint/xsslint/rules.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/scripts/xsslint/xsslint/rules.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | class Rule:
def __init__(self, rule_id):
self.rule_id = rule_id
def __eq__(self, other):
return self.rule_id == other.rule_id
class RuleSet:
def __init__(self, **kwargs):
self.rules = {}
for k, v in kwargs.items():
self.rules[k] = Rule(v)
def __getattr__(self, attr_name):
return self.rules[attr_name]
def __add__(self, other):
result = self.__class__()
result.rules.update(self.rules)
result.rules.update(other.rules)
return result
| 23.565217 | 44 | 0.599631 | 71 | 542 | 4.140845 | 0.323944 | 0.102041 | 0.102041 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285978 | 542 | 22 | 45 | 24.636364 | 0.75969 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0 | 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 |
78c553fda0c8b1cb2fbf3d16f4f73417bd90fa67 | 280 | py | Python | th.py | Bigfoot0007/myneopixelpad | 75b28dfedd90bea2a25c7badb2804aedd5f1bb47 | [
"Apache-2.0"
] | null | null | null | th.py | Bigfoot0007/myneopixelpad | 75b28dfedd90bea2a25c7badb2804aedd5f1bb47 | [
"Apache-2.0"
] | null | null | null | th.py | Bigfoot0007/myneopixelpad | 75b28dfedd90bea2a25c7badb2804aedd5f1bb47 | [
"Apache-2.0"
] | null | null | null | from machine import Pin, I2C
import si7021
## this project neopixelpad
__i2c = I2C(scl=Pin(22), sda=Pin(21), freq=100000)
__temp_sensor = si7021.Si7021(__i2c)
def temperature():
return __temp_sensor.temperature
def humidity():
return __temp_sensor.relative_humidity
| 17.5 | 50 | 0.757143 | 38 | 280 | 5.210526 | 0.578947 | 0.151515 | 0.161616 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108787 | 0.146429 | 280 | 15 | 51 | 18.666667 | 0.719665 | 0.085714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 0.75 | 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 |
78c5e8cb8bb4de9f11b7e4f97a9fd1bf091d59fd | 894 | py | Python | ialarmclient/status.py | phoenix128/python-ialarmclient | c80790100c1e3f185d0043b00ac8a634787ecaa5 | [
"MIT"
] | null | null | null | ialarmclient/status.py | phoenix128/python-ialarmclient | c80790100c1e3f185d0043b00ac8a634787ecaa5 | [
"MIT"
] | null | null | null | ialarmclient/status.py | phoenix128/python-ialarmclient | c80790100c1e3f185d0043b00ac8a634787ecaa5 | [
"MIT"
] | null | null | null | """DTO for ialarm status definition"""
from typing import List
from .zone import IalarmZone
class IalarmStatus:
def __init__(
self,
sys_status: int,
arm_status: int,
alarmed_zones: List[IalarmZone]
):
self._sys_status = sys_status
self._arm_status = arm_status
self._alarmed_zones = alarmed_zones
@property
def sys_status(self) -> int:
return self._sys_status
@property
def power_source_failure(self):
return self.sys_status & 1 != 0
@property
def low_battery(self):
return self.sys_status & 2 != 0
@property
def panic_alarm(self):
return self.sys_status & 4 != 0
@property
def arm_status(self) -> int:
return self._arm_status
@property
def alarmed_zones(self) -> List[IalarmZone]:
return self._alarmed_zones
| 21.804878 | 48 | 0.620805 | 108 | 894 | 4.842593 | 0.314815 | 0.137667 | 0.14914 | 0.145315 | 0.219885 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009569 | 0.298658 | 894 | 40 | 49 | 22.35 | 0.824561 | 0.035794 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.233333 | false | 0 | 0.066667 | 0.2 | 0.533333 | 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 |
15388cc945b0fac5580b0d2a268b7d0dd1274616 | 630 | py | Python | app/main/forms.py | nyamzy/Bloggr | fc2faa351916e7dc2ad38171f2e253214cbdb9d7 | [
"Unlicense"
] | null | null | null | app/main/forms.py | nyamzy/Bloggr | fc2faa351916e7dc2ad38171f2e253214cbdb9d7 | [
"Unlicense"
] | null | null | null | app/main/forms.py | nyamzy/Bloggr | fc2faa351916e7dc2ad38171f2e253214cbdb9d7 | [
"Unlicense"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import InputRequired
class CommentForm(FlaskForm):
comment = TextAreaField('Your comment here', validators=[InputRequired()])
submit = SubmitField('Post')
class BlogForm(FlaskForm):
title = StringField('Blog title', validators=[InputRequired()])
content = TextAreaField('Say something', validators=[InputRequired()])
submit = SubmitField('Submit')
class UpdateProfile(FlaskForm):
bio = TextAreaField('Tell us about you.', validators=[InputRequired()])
submit = SubmitField('Submit')
| 37.058824 | 78 | 0.753968 | 61 | 630 | 7.770492 | 0.491803 | 0.194093 | 0.183544 | 0.253165 | 0.194093 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131746 | 630 | 16 | 79 | 39.375 | 0.866545 | 0 | 0 | 0.153846 | 0 | 0 | 0.11746 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.230769 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
155b8bfaec6be6e149bb5b05837a46c9564d0f78 | 717 | py | Python | concoord/object/semaphore.py | denizalti/concoord | 5a51ba2b475f44da221304ea7f0b9118f2e8511a | [
"BSD-3-Clause"
] | 36 | 2015-01-22T15:55:21.000Z | 2019-12-10T00:39:11.000Z | concoord/object/semaphore.py | liranz/concoord | bdb3798bf200d1cbd04bc50260cddaec6ba2a763 | [
"BSD-3-Clause"
] | 3 | 2016-11-15T16:58:49.000Z | 2018-05-25T11:32:50.000Z | concoord/object/semaphore.py | liranz/concoord | bdb3798bf200d1cbd04bc50260cddaec6ba2a763 | [
"BSD-3-Clause"
] | 13 | 2015-01-07T00:07:59.000Z | 2018-11-24T04:39:58.000Z | """
@author: Deniz Altinbuken, Emin Gun Sirer
@note: Example semaphore object
@copyright: See LICENSE
"""
from concoord.threadingobject.dsemaphore import DSemaphore
class Semaphore():
def __init__(self, count=1):
self.semaphore = DSemaphore(count)
def __repr__(self):
return repr(self.semaphore)
def acquire(self, _concoord_command):
try:
return self.semaphore.acquire(_concoord_command)
except Exception as e:
raise e
def release(self, _concoord_command):
try:
return self.semaphore.release(_concoord_command)
except Exception as e:
raise e
def __str__(self):
return str(self.semaphore)
| 24.724138 | 60 | 0.655509 | 80 | 717 | 5.625 | 0.45 | 0.144444 | 0.084444 | 0.097778 | 0.368889 | 0.368889 | 0.368889 | 0.186667 | 0.186667 | 0 | 0 | 0.00189 | 0.262204 | 717 | 28 | 61 | 25.607143 | 0.848771 | 0.135286 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.055556 | 0.111111 | 0.611111 | 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 |
1576d507cecda6e23fa83cf1e542d2e39d5a9106 | 338 | py | Python | clipboard_utils.py | larsaars/chord_tools | d26da88a34934d12cd2c2e4481507357e7a98ad2 | [
"Apache-2.0"
] | null | null | null | clipboard_utils.py | larsaars/chord_tools | d26da88a34934d12cd2c2e4481507357e7a98ad2 | [
"Apache-2.0"
] | null | null | null | clipboard_utils.py | larsaars/chord_tools | d26da88a34934d12cd2c2e4481507357e7a98ad2 | [
"Apache-2.0"
] | null | null | null | """
helper to get string from clipboard
and then return it to there
"""
import pyperclip
# create output string that can later on be appended
output = []
def read_clipboard() -> str:
return pyperclip.paste()
def write_clipboard():
global output
# set output as clipboard data again
pyperclip.copy('\n'.join(output))
| 16.9 | 52 | 0.704142 | 47 | 338 | 5.021277 | 0.723404 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204142 | 338 | 19 | 53 | 17.789474 | 0.877323 | 0.443787 | 0 | 0 | 0 | 0 | 0.011173 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.142857 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
157f54bcd83a4f4bf1ccedd8621ae90843c5ecae | 3,906 | py | Python | scanner/migrations/0001_initial.py | Shinpachi8/webscanner | 52aa377f0ee903a04ed19ea07433d0718697833d | [
"Apache-2.0"
] | 5 | 2018-04-27T12:34:08.000Z | 2020-11-09T10:47:02.000Z | scanner/migrations/0001_initial.py | Shinpachi8/webscanner | 52aa377f0ee903a04ed19ea07433d0718697833d | [
"Apache-2.0"
] | null | null | null | scanner/migrations/0001_initial.py | Shinpachi8/webscanner | 52aa377f0ee903a04ed19ea07433d0718697833d | [
"Apache-2.0"
] | 3 | 2019-04-08T19:58:20.000Z | 2020-04-07T15:35:07.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-22 08:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Domain',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('domain', models.CharField(blank=True, max_length=100, null=True)),
],
options={
'db_table': 'domain',
},
),
migrations.CreateModel(
name='PortTable',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ip', models.CharField(blank=True, max_length=35, null=True)),
('port', models.IntegerField(blank=True, null=True)),
('protocol', models.CharField(blank=True, max_length=30, null=True)),
('name', models.CharField(blank=True, max_length=150, null=True)),
('product', models.CharField(blank=True, max_length=100, null=True)),
('extrainfo', models.CharField(blank=True, max_length=100, null=True)),
('version', models.CharField(blank=True, max_length=100, null=True)),
('conf', models.CharField(blank=True, max_length=100, null=True)),
('id_domain', models.IntegerField(blank=True, null=True)),
('httptitle', models.TextField(blank=True, null=True)),
('cmstype', models.CharField(blank=True, max_length=100, null=True)),
('createtime', models.DateTimeField(auto_now_add=True)),
('updatetime', models.DateTimeField(auto_now=True)),
],
options={
'db_table': 'port_table',
},
),
migrations.CreateModel(
name='Subdomains',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('subdomain', models.CharField(blank=True, max_length=150, null=True)),
('id_domain', models.IntegerField(blank=True, null=True)),
('cmstype', models.CharField(blank=True, max_length=30, null=True)),
],
options={
'db_table': 'subdomains',
},
),
migrations.CreateModel(
name='Vulns',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('url', models.TextField(blank=True, null=True)),
('parameters', models.TextField(blank=True, null=True)),
('headers_string', models.TextField(blank=True, null=True)),
('method', models.CharField(blank=True, max_length=15, null=True)),
('delta_time', models.CharField(blank=True, max_length=50, null=True)),
('vuln_name', models.CharField(blank=True, max_length=150, null=True)),
('severity', models.CharField(blank=True, max_length=30, null=True)),
('checks', models.CharField(blank=True, max_length=150, null=True)),
('proof', models.TextField(blank=True, null=True)),
('seed', models.TextField(blank=True, null=True)),
('id_domain', models.IntegerField(blank=True, null=True)),
('md5', models.CharField(max_length=32, null=True)),
('createtime', models.DateTimeField(auto_now_add=True)),
('updatetime', models.DateTimeField(auto_now=True)),
],
options={
'db_table': 'vulns',
},
),
]
| 46.5 | 114 | 0.556068 | 397 | 3,906 | 5.342569 | 0.224181 | 0.101839 | 0.150872 | 0.181047 | 0.750589 | 0.737388 | 0.595474 | 0.595474 | 0.595474 | 0.411127 | 0 | 0.022859 | 0.294419 | 3,906 | 83 | 115 | 47.060241 | 0.746734 | 0.017665 | 0 | 0.413333 | 1 | 0 | 0.087898 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.026667 | 0 | 0.08 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 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 |
1591627547028142da4f9a96010048a72e74327e | 3,022 | py | Python | tests/test_ensure.py | scikit-hep/uhi | c10321ad296293b0fd8791f4d8ef203dc1cbf9b2 | [
"BSD-3-Clause"
] | 6 | 2021-02-24T08:32:03.000Z | 2021-08-16T08:54:25.000Z | tests/test_ensure.py | scikit-hep/uhi | c10321ad296293b0fd8791f4d8ef203dc1cbf9b2 | [
"BSD-3-Clause"
] | 14 | 2021-02-16T21:00:10.000Z | 2021-06-28T17:45:45.000Z | tests/test_ensure.py | scikit-hep/uhi | c10321ad296293b0fd8791f4d8ef203dc1cbf9b2 | [
"BSD-3-Clause"
] | 1 | 2021-05-27T08:02:05.000Z | 2021-05-27T08:02:05.000Z | import numpy as np
import pytest
from pytest import approx
from uhi.numpy_plottable import ensure_plottable_histogram
def test_from_numpy() -> None:
hist1 = ((1, 2, 3, 4, 1, 2), (0, 1, 2, 3))
h = ensure_plottable_histogram(hist1)
assert h.values() == approx(np.array(hist1[0]))
assert len(h.axes) == 1
assert len(h.axes[0]) == 3
assert h.axes[0][0] == (0, 1)
assert h.axes[0][1] == (1, 2)
assert h.axes[0][2] == (2, 3)
def test_from_numpy_2d() -> None:
np.random.seed(42)
x = np.random.normal(1, 2, 1000)
y = np.random.normal(-1, 1, 1000)
result = np.histogram2d(x, y) # type: ignore
h = ensure_plottable_histogram(result)
assert h.values() == approx(result[0])
assert len(h.axes) == 2
assert len(h.axes[0]) == 10
assert h.axes[0][0] == approx(result[1][0:2])
assert h.axes[0][1] == approx(result[1][1:3])
assert h.axes[1][0] == approx(result[2][0:2])
assert h.axes[1][1] == approx(result[2][1:3])
def test_from_numpy_dd() -> None:
np.random.seed(42)
x = np.random.normal(1, 2, 1000)
y = np.random.normal(-1, 1, 1000)
z = np.random.normal(3, 3, 1000)
result = np.histogramdd((x, y, z)) # type: ignore
h = ensure_plottable_histogram(result)
assert h.values() == approx(result[0])
assert len(h.axes) == 3
assert len(h.axes[0]) == 10
assert h.axes[0][0] == approx(result[1][0][0:2])
assert h.axes[0][1] == approx(result[1][0][1:3])
assert h.axes[1][0] == approx(result[1][1][0:2])
assert h.axes[1][1] == approx(result[1][1][1:3])
assert h.axes[2][0] == approx(result[1][2][0:2])
assert h.axes[2][1] == approx(result[1][2][1:3])
def test_from_bh_regular() -> None:
bh = pytest.importorskip("boost_histogram")
h1 = bh.Histogram(bh.axis.Regular(5, 0, 5))
h1[...] = (3, 2, 1, 2, 3)
h = ensure_plottable_histogram(h1)
assert h is h1
assert h.values() == approx(np.array((3, 2, 1, 2, 3)))
assert len(h.axes) == 1
assert len(h.axes[0]) == 5
assert h.axes[0][0] == approx(np.array((0, 1)))
assert h.axes[0][1] == approx(np.array((1, 2)))
assert h.axes[0][2] == approx(np.array((2, 3)))
def test_from_bh_integer() -> None:
bh = pytest.importorskip("boost_histogram")
h1 = bh.Histogram(bh.axis.Integer(1, 6))
h1[...] = (3, 2, 1, 2, 3)
h = ensure_plottable_histogram(h1)
assert h is h1
assert h.values() == approx(np.array((3, 2, 1, 2, 3)))
assert len(h.axes) == 1
assert len(h.axes[0]) == 5
assert h.axes[0][0] == 1
assert h.axes[0][1] == 2
assert h.axes[0][2] == 3
def test_from_bh_str_cat() -> None:
bh = pytest.importorskip("boost_histogram")
h1 = bh.Histogram(bh.axis.StrCategory(["hi", "ho"]))
h1.fill(["hi", "hi", "hi", "ho"])
h = ensure_plottable_histogram(h1)
assert h is h1
assert h.values() == approx(np.array((3, 1)))
assert len(h.axes) == 1
assert len(h.axes[0]) == 2
assert h.axes[0][0] == "hi"
assert h.axes[0][1] == "ho"
| 28.242991 | 58 | 0.581734 | 526 | 3,022 | 3.273764 | 0.110266 | 0.095819 | 0.073171 | 0.10453 | 0.800813 | 0.768873 | 0.688734 | 0.638211 | 0.62079 | 0.558072 | 0 | 0.085356 | 0.209133 | 3,022 | 106 | 59 | 28.509434 | 0.635146 | 0.008273 | 0 | 0.402597 | 0 | 0 | 0.020374 | 0 | 0 | 0 | 0 | 0 | 0.545455 | 1 | 0.077922 | false | 0 | 0.090909 | 0 | 0.168831 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1592effc076e506c438675c7cb8da7826725530e | 301 | py | Python | dataview/wrappers.py | joshloyal/DataView | 28fa57ff421115638244d59dccfaf5b3403be765 | [
"MIT"
] | null | null | null | dataview/wrappers.py | joshloyal/DataView | 28fa57ff421115638244d59dccfaf5b3403be765 | [
"MIT"
] | null | null | null | dataview/wrappers.py | joshloyal/DataView | 28fa57ff421115638244d59dccfaf5b3403be765 | [
"MIT"
] | null | null | null | import functools
registry = {}
def register_class(target_class):
registry[target_class.__name__] = target_class
class DataViewMeta(type):
def __new__(meta, name, bases, class_dict):
cls = type.__new__(meta, name, bases, class_dict)
register_class(cls)
return cls
| 18.8125 | 57 | 0.694352 | 37 | 301 | 5.135135 | 0.432432 | 0.173684 | 0.115789 | 0.168421 | 0.263158 | 0.263158 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212625 | 301 | 15 | 58 | 20.066667 | 0.801688 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
15a483a93ff293520323e62560b0dda36e956b6a | 91 | py | Python | django/models/m2mbasic/apps.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | django/models/m2mbasic/apps.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | django/models/m2mbasic/apps.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class M2MbasicConfig(AppConfig):
name = 'm2mbasic'
| 15.166667 | 33 | 0.758242 | 10 | 91 | 6.9 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 0.164835 | 91 | 5 | 34 | 18.2 | 0.881579 | 0 | 0 | 0 | 0 | 0 | 0.087912 | 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 |
15bb32490004b413460d9e6a18931defe312c9df | 415 | py | Python | chibi_dl_elasticsearch/config.py | dem4ply/chibi_dl_elasticsearch | 68adfdb8a7e7a26d56ee6a7f4dffcc3324504c92 | [
"WTFPL"
] | null | null | null | chibi_dl_elasticsearch/config.py | dem4ply/chibi_dl_elasticsearch | 68adfdb8a7e7a26d56ee6a7f4dffcc3324504c92 | [
"WTFPL"
] | null | null | null | chibi_dl_elasticsearch/config.py | dem4ply/chibi_dl_elasticsearch | 68adfdb8a7e7a26d56ee6a7f4dffcc3324504c92 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
import sys
import fileinput
import json
from elasticsearch_dsl import Document, field, InnerDoc
from elasticsearch_dsl.connections import connections
from chibi.config import configuration
def prepare():
connections.configure( **configuration.elasticsearch.connections )
from chibi_dl_elasticsearch.models.nhentai import Manga
if not Manga._index.exists():
Manga.init()
| 27.666667 | 70 | 0.792771 | 50 | 415 | 6.48 | 0.6 | 0.104938 | 0.123457 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002793 | 0.137349 | 415 | 14 | 71 | 29.642857 | 0.902235 | 0.050602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | true | 0 | 0.636364 | 0 | 0.727273 | 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 |
ec729c291d26b327b581d00ddc37a424d74dde46 | 48 | py | Python | sensorproxy/__init__.py | Nature40/pysensorproxy | ff3df2bc2a55bb06809afc96d7aa41683d4924a6 | [
"MIT"
] | 1 | 2019-03-02T09:23:06.000Z | 2019-03-02T09:23:06.000Z | sensorproxy/__init__.py | Nature40/pysensorproxy | ff3df2bc2a55bb06809afc96d7aa41683d4924a6 | [
"MIT"
] | 55 | 2019-02-21T09:37:02.000Z | 2020-07-20T10:23:38.000Z | sensorproxy/__init__.py | Nature40/pysensorproxy | ff3df2bc2a55bb06809afc96d7aa41683d4924a6 | [
"MIT"
] | null | null | null | __all__ = ["sensors", "lift", "wifi", "influx"]
| 24 | 47 | 0.583333 | 5 | 48 | 4.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 48 | 1 | 48 | 48 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0.4375 | 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 |
ec76ab7cc324a3c8135f54fe00bca8b41f237357 | 237 | py | Python | example_app/application.py | keotl/jivago | 892dfb0cae773e36245083c3e56f0f8523145523 | [
"MIT"
] | 12 | 2018-03-19T20:57:44.000Z | 2020-01-27T14:11:24.000Z | example_app/application.py | keotl/jivago | 892dfb0cae773e36245083c3e56f0f8523145523 | [
"MIT"
] | 73 | 2018-04-20T22:26:00.000Z | 2021-12-01T14:17:37.000Z | example_app/application.py | keotl/jivago | 892dfb0cae773e36245083c3e56f0f8523145523 | [
"MIT"
] | 1 | 2019-02-28T13:33:45.000Z | 2019-02-28T13:33:45.000Z | import logging
import example_app
from jivago.jivago_application import JivagoApplication
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
app = JivagoApplication(example_app, debug=True)
app.run_dev()
| 23.7 | 55 | 0.776371 | 28 | 237 | 6.142857 | 0.642857 | 0.116279 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135021 | 237 | 9 | 56 | 26.333333 | 0.839024 | 0 | 0 | 0 | 0 | 0 | 0.033755 | 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 |
ec7ea62884a96743df65fe934362b4dfbfb42931 | 496 | py | Python | instagram/migrations/0011_auto_20180512_1623.py | Kiptim54/Instagram | 8e05816ea15951f5c36fbecb986ef214cc452634 | [
"MIT"
] | null | null | null | instagram/migrations/0011_auto_20180512_1623.py | Kiptim54/Instagram | 8e05816ea15951f5c36fbecb986ef214cc452634 | [
"MIT"
] | null | null | null | instagram/migrations/0011_auto_20180512_1623.py | Kiptim54/Instagram | 8e05816ea15951f5c36fbecb986ef214cc452634 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-12 13:23
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('instagram', '0010_remove_photos_user'),
]
operations = [
migrations.RemoveField(
model_name='photos',
name='comment',
),
migrations.RemoveField(
model_name='photos',
name='likes',
),
]
| 20.666667 | 49 | 0.582661 | 49 | 496 | 5.693878 | 0.714286 | 0.150538 | 0.18638 | 0.215054 | 0.286738 | 0.286738 | 0 | 0 | 0 | 0 | 0 | 0.057803 | 0.302419 | 496 | 23 | 50 | 21.565217 | 0.748555 | 0.133065 | 0 | 0.375 | 1 | 0 | 0.131148 | 0.053864 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.3125 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ec7ee5cd3cfca9092bf3bea47c3c7cfce7922d77 | 1,587 | py | Python | pretty_bencode3/torrentparser.py | August-Ghost/pretty-bencode3 | eeff9cdcfdb9a7fc4f5bdda0f9cf73eaa302702a | [
"MIT"
] | null | null | null | pretty_bencode3/torrentparser.py | August-Ghost/pretty-bencode3 | eeff9cdcfdb9a7fc4f5bdda0f9cf73eaa302702a | [
"MIT"
] | null | null | null | pretty_bencode3/torrentparser.py | August-Ghost/pretty-bencode3 | eeff9cdcfdb9a7fc4f5bdda0f9cf73eaa302702a | [
"MIT"
] | null | null | null | # -*-coding: utf-8 -*-
from .belement import Bdict, BencodeError
class BitTorrent:
def __init__(self, io):
self.content = open(io, "rb").read() if type(io) == str else io.read()
self.bt = Bdict.load(self.content)[0]
@property
def infohash(self):
from hashlib import sha1
# infohash = SHA1(info_chunk)
if b"info" in self.content:
info_chunk_slice = slice(self.content.find(b"info") + 4,
self.content.find(b"nodes") - 2 if b"nodes" in self.content else -1)
return sha1(self.content[info_chunk_slice]).hexdigest()
else:
raise BencodeError("Invalid torrent file")
@property
def magnet(self):
return "magnet:?xt=urn:btih:{0}".format(self.infohash.upper())
def __getattr__(self, item):
try:
return object.__getattribute__(self, "bt")[item]
except KeyError:
raise AttributeError("{0} object has no attribute '{1}'".format(self.__class__.__name__, item))
def __getitem__(self, item):
return self.bt.__getitem__(item)
def __setitem__(self, key, value):
return self.bt.__setitem__(key, value)
def __delattr__(self, item):
return self.bt.__delitem__(item)
def dump(self):
return self.bt.dump()
def __str__(self):
return str(self.bt)
def __repr__(self):
return "{0}({1})".format(self.__class__.__name__, repr(self.bt))
def save(self, io):
with open(io, "wb") as output:
output.write(self.bt.dump()) | 31.117647 | 107 | 0.597984 | 201 | 1,587 | 4.39801 | 0.383085 | 0.061086 | 0.054299 | 0.045249 | 0.147059 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011178 | 0.267171 | 1,587 | 51 | 108 | 31.117647 | 0.748925 | 0.030246 | 0 | 0.054054 | 0 | 0 | 0.070267 | 0.014964 | 0 | 0 | 0 | 0 | 0 | 1 | 0.297297 | false | 0 | 0.054054 | 0.189189 | 0.621622 | 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 |
ec8046e4abe61f0c3d513279741a84145b645fcd | 218 | py | Python | python_oop_final_exam_10_april_2021/project/decoration/plant.py | Xamaneone/Python-OOP | 7514cdc92bb4f7adf27666516739cbf42a35453c | [
"MIT"
] | null | null | null | python_oop_final_exam_10_april_2021/project/decoration/plant.py | Xamaneone/Python-OOP | 7514cdc92bb4f7adf27666516739cbf42a35453c | [
"MIT"
] | null | null | null | python_oop_final_exam_10_april_2021/project/decoration/plant.py | Xamaneone/Python-OOP | 7514cdc92bb4f7adf27666516739cbf42a35453c | [
"MIT"
] | null | null | null | from project.decoration.base_decoration import BaseDecoration
class Plant(BaseDecoration):
init_comfort = 5
init_price = 10
def __init__(self):
super().__init__(self.init_comfort, self.init_price) | 27.25 | 61 | 0.747706 | 27 | 218 | 5.555556 | 0.592593 | 0.146667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016575 | 0.169725 | 218 | 8 | 62 | 27.25 | 0.812155 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.833333 | 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 |
ec9bf44c8ea9ebae98bd3bb8cc183fdaff6cf6b6 | 12,742 | py | Python | tests/test_trends.py | actlienholding/ttrpy | 128e9fa23cdaee83ff8be021b219a8b7d90bf589 | [
"Apache-2.0"
] | 17 | 2019-03-02T03:37:34.000Z | 2021-12-20T03:19:18.000Z | tests/test_trends.py | actlienholding/ttrpy | 128e9fa23cdaee83ff8be021b219a8b7d90bf589 | [
"Apache-2.0"
] | 1 | 2019-07-18T18:43:34.000Z | 2019-07-23T17:52:20.000Z | tests/test_trends.py | actlienholding/ttrpy | 128e9fa23cdaee83ff8be021b219a8b7d90bf589 | [
"Apache-2.0"
] | 9 | 2019-06-02T08:46:51.000Z | 2021-01-08T12:39:40.000Z | # Author: joelowj
# License: Apache License, Version 2.0
import pandas as pd
import unittest
from ttrpy.trend.sma import sma
from ttrpy.trend.wma import wma
from ttrpy.trend.ema import ema
from ttrpy.trend.dema import dema
from ttrpy.trend.tema import tema
from ttrpy.trend.trix import trix
from ttrpy.trend.trima import trima
from ttrpy.trend.t3 import t3
from ttrpy.trend.kama import kama
from ttrpy.trend.macd import macd
from ttrpy.trend.macdext import macdext
from ttrpy.trend.cci import cci
from ttrpy.trend.bop import bop
from ttrpy.trend.aroon import aroon
from ttrpy.trend.aroonosc import aroonosc
class TestTrendIndicators(unittest.TestCase):
def setUp(self):
self.wdf = (
pd.read_csv("tests/weekly_MSFT.csv")
.sort_values(by="timestamp")
.reset_index(drop=True)
)
def test_simple_moving_average(self):
self.wdf = (
sma(self.wdf, "open", "sma", 10).dropna().reset_index(drop=True)
)
self.assertEqual(len(self.wdf["sma"]), 1092)
self.assertAlmostEqual(self.wdf["sma"][0], 124.8190, places=4)
self.assertAlmostEqual(self.wdf["sma"][1], 119.9380, places=4)
self.assertAlmostEqual(self.wdf["sma"][2], 115.5950, places=4)
self.assertAlmostEqual(self.wdf["sma"][1089], 104.5530, places=4)
self.assertAlmostEqual(self.wdf["sma"][1090], 104.3520, places=4)
self.assertAlmostEqual(self.wdf["sma"][1091], 104.1600, places=4)
def test_weighted_moving_average(self):
self.wdf = (
wma(self.wdf, "open", "wma", 10).dropna().reset_index(drop=True)
)
self.assertEqual(len(self.wdf["wma"]), 1092)
self.assertAlmostEqual(self.wdf["wma"][0], 116.5182, places=4)
self.assertAlmostEqual(self.wdf["wma"][1], 108.8129, places=4)
self.assertAlmostEqual(self.wdf["wma"][2], 101.7678, places=4)
self.assertAlmostEqual(self.wdf["wma"][1089], 103.5624, places=4)
self.assertAlmostEqual(self.wdf["wma"][1090], 103.8727, places=4)
self.assertAlmostEqual(self.wdf["wma"][1091], 103.6033, places=4)
def test_exponential_moving_average(self):
self.wdf = (
ema(self.wdf, "open", "ema", 10).dropna().reset_index(drop=True)
)
self.assertEqual(len(self.wdf["ema"]), 1092)
self.assertAlmostEqual(self.wdf["ema"][0], 124.8190, places=4)
self.assertAlmostEqual(self.wdf["ema"][1], 117.1137, places=4)
self.assertAlmostEqual(self.wdf["ema"][2], 110.5821, places=4)
self.assertAlmostEqual(self.wdf["ema"][1089], 104.5003, places=4)
self.assertAlmostEqual(self.wdf["ema"][1090], 104.8202, places=4)
self.assertAlmostEqual(self.wdf["ema"][1091], 104.4656, places=4)
def test_double_exponential_moving_average(self):
self.wdf = dema(self.wdf, "open", "dema", 10)
self.assertEqual(len(self.wdf["dema"]), 1083)
self.assertAlmostEqual(self.wdf["dema"][0], 83.5329, places=4)
self.assertAlmostEqual(self.wdf["dema"][1], 82.2401, places=4)
self.assertAlmostEqual(self.wdf["dema"][2], 81.7171, places=4)
self.assertAlmostEqual(self.wdf["dema"][1080], 102.9559, places=4)
self.assertAlmostEqual(self.wdf["dema"][1081], 103.8184, places=4)
self.assertAlmostEqual(self.wdf["dema"][1082], 103.3559, places=4)
def test_triple_exponential_moving_average(self):
self.wdf = (
tema(self.wdf, "open", "tema", 10).dropna().reset_index(drop=True)
)
self.assertEqual(len(self.wdf["tema"]), 1074)
self.assertAlmostEqual(self.wdf["tema"][0], 108.3352, places=4)
self.assertAlmostEqual(self.wdf["tema"][1], 114.9284, places=4)
self.assertAlmostEqual(self.wdf["tema"][2], 116.7212, places=4)
self.assertAlmostEqual(self.wdf["tema"][1071], 102.5139, places=4)
self.assertAlmostEqual(self.wdf["tema"][1072], 103.9007, places=4)
self.assertAlmostEqual(self.wdf["tema"][1073], 103.3348, places=4)
def test_triple_smooth_exponential_moving_average(self):
self.wdf = trix(self.wdf, "close", "trix", 10)
self.assertEqual(len(self.wdf["trix"]), 1073)
self.assertAlmostEqual(self.wdf["trix"][0], -0.1181, places=4)
self.assertAlmostEqual(self.wdf["trix"][1], 0.1188, places=4)
self.assertAlmostEqual(self.wdf["trix"][2], 0.2755, places=4)
self.assertAlmostEqual(self.wdf["trix"][1069], -0.2203, places=4)
self.assertAlmostEqual(self.wdf["trix"][1070], -0.2046, places=4)
self.assertAlmostEqual(self.wdf["trix"][1071], -0.2006, places=4)
def test_triangular_moving_average_even(self):
self.wdf = trima(self.wdf, "open", "trima", 10)
self.assertEqual(len(self.wdf["trima"]), 1092)
self.assertAlmostEqual(self.wdf["trima"][0], 134.1987, places=4)
self.assertAlmostEqual(self.wdf["trima"][1], 127.8193, places=4)
self.assertAlmostEqual(self.wdf["trima"][2], 117.9463, places=4)
self.assertAlmostEqual(self.wdf["trima"][1088], 104.7717, places=4)
self.assertAlmostEqual(self.wdf["trima"][1089], 103.7377, places=4)
self.assertAlmostEqual(self.wdf["trima"][1090], 103.1233, places=4)
def test_triangular_moving_average_odd(self):
self.wdf = trima(self.wdf, "open", "trima", 11)
self.assertEqual(len(self.wdf["trima"]), 1091)
self.assertAlmostEqual(self.wdf["trima"][0], 129.8600, places=4)
self.assertAlmostEqual(self.wdf["trima"][1], 122.3894, places=4)
self.assertAlmostEqual(self.wdf["trima"][2], 112.2053, places=4)
self.assertAlmostEqual(self.wdf["trima"][1088], 104.3839, places=4)
self.assertAlmostEqual(self.wdf["trima"][1089], 103.5458, places=4)
self.assertAlmostEqual(self.wdf["trima"][1090], 103.1781, places=4)
def test_t3(self):
self.wdf = t3(self.wdf, "open", "t3", 10, 0.7)
self.assertEqual(len(self.wdf["t3"]), 1047)
self.assertAlmostEqual(self.wdf["t3"][1040], 109.5147, places=4)
self.assertAlmostEqual(self.wdf["t3"][1041], 108.6093, places=4)
self.assertAlmostEqual(self.wdf["t3"][1042], 107.6079, places=4)
self.assertAlmostEqual(self.wdf["t3"][1043], 106.5864, places=4)
self.assertAlmostEqual(self.wdf["t3"][1044], 105.7145, places=4)
self.assertAlmostEqual(self.wdf["t3"][1045], 105.0484, places=4)
def test_kaufman_adaptive_moving_average(self):
self.wdf = kama(self.wdf, "open", "kama", 10)
self.assertEqual(len(self.wdf["kama"]), 1091)
self.assertAlmostEqual(self.wdf["kama"][1084], 107.6661, places=4)
self.assertAlmostEqual(self.wdf["kama"][1085], 107.4394, places=4)
self.assertAlmostEqual(self.wdf["kama"][1086], 107.2784, places=4)
self.assertAlmostEqual(self.wdf["kama"][1087], 107.1760, places=4)
self.assertAlmostEqual(self.wdf["kama"][1088], 107.1712, places=4)
self.assertAlmostEqual(self.wdf["kama"][1089], 107.1627, places=4)
def test_moving_average_convergence_divergence(self):
self.wdf = macd(self.wdf, "open", "macd", 12, 26, 9)
self.assertEqual(len(self.wdf["macd"]), 1068)
self.assertAlmostEqual(self.wdf["macd_hist"][1062], -1.6971, places=4)
self.assertAlmostEqual(self.wdf["macd"][1062], 0.2448, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1062], 1.9419, places=4)
self.assertAlmostEqual(self.wdf["macd_hist"][1063], -1.6202, places=4)
self.assertAlmostEqual(self.wdf["macd"][1063], -0.0834, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1063], 1.5368, places=4)
self.assertAlmostEqual(self.wdf["macd_hist"][1064], -1.4845, places=4)
self.assertAlmostEqual(self.wdf["macd"][1064], -0.3188, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1064], 1.1657, places=4)
self.assertAlmostEqual(self.wdf["macd_hist"][1065], -1.0227, places=4)
self.assertAlmostEqual(self.wdf["macd"][1065], -0.1127, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1065], 0.9100, places=4)
self.assertAlmostEqual(self.wdf["macd_hist"][1066], -0.7192, places=4)
self.assertAlmostEqual(self.wdf["macd"][1066], 0.0110, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1066], 0.7302, places=4)
def test_moving_average_convergence_divergence_with_controllable_ma(self):
self.wdf = macdext(self.wdf, "open", "macd", 12, 26, 9, 0, 0, 0)
self.assertEqual(len(self.wdf["macd"]), 1068)
self.assertAlmostEqual(self.wdf["macd_hist"][1062], -3.4112, places=4)
self.assertAlmostEqual(self.wdf["macd"][1062], -1.4322, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1062], 1.9790, places=4)
self.assertAlmostEqual(self.wdf["macd_hist"][1063], -3.3148, places=4)
self.assertAlmostEqual(self.wdf["macd"][1063], -2.0378, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1063], 1.2770, places=4)
self.assertAlmostEqual(self.wdf["macd_hist"][1064], -3.0742, places=4)
self.assertAlmostEqual(self.wdf["macd"][1064], -2.5215, places=4)
self.assertAlmostEqual(self.wdf["macd_signal"][1064], 0.5527, places=4)
self.assertAlmostEqual(self.wdf["macd_hist"][1065], -2.5231, places=4)
self.assertAlmostEqual(self.wdf["macd"][1065], -2.6517, places=4)
self.assertAlmostEqual(
self.wdf["macd_signal"][1065], -0.1287, places=4
)
self.assertAlmostEqual(self.wdf["macd_hist"][1066], -1.9038, places=4)
self.assertAlmostEqual(self.wdf["macd"][1066], -2.6251, places=4)
self.assertAlmostEqual(
self.wdf["macd_signal"][1066], -0.7213, places=4
)
def test_commodity_channel_index(self):
self.wdf = cci(self.wdf, "high", "low", "close", "cci", 10)
self.assertEqual(len(self.wdf["cci"]), 1092)
self.assertAlmostEqual(self.wdf["cci"][0], -113.4523, places=4)
self.assertAlmostEqual(self.wdf["cci"][1], -84.9987, places=4)
self.assertAlmostEqual(self.wdf["cci"][2], -59.8165, places=4)
self.assertAlmostEqual(self.wdf["cci"][1088], 28.8765, places=4)
self.assertAlmostEqual(self.wdf["cci"][1089], 54.7324, places=4)
self.assertAlmostEqual(self.wdf["cci"][1090], -10.8754, places=4)
def test_balance_of_power(self):
self.wdf = bop(self.wdf, "open", "high", "low", "close", "bop")
self.assertEqual(len(self.wdf["bop"]), 1101)
self.assertAlmostEqual(self.wdf["bop"][0], -0.5477, places=4)
self.assertAlmostEqual(self.wdf["bop"][1], 0.9655, places=4)
self.assertAlmostEqual(self.wdf["bop"][2], 0.7007, places=4)
self.assertAlmostEqual(self.wdf["bop"][1097], 0.8750, places=4)
self.assertAlmostEqual(self.wdf["bop"][1098], 0.1391, places=4)
self.assertAlmostEqual(self.wdf["bop"][1099], -0.8074, places=4)
def test_aroon(self):
self.wdf = aroon(self.wdf, "high", "low", "aroon", 14)
self.assertEqual(len(self.wdf["aroon_up"]), 1088)
self.assertAlmostEqual(self.wdf["aroon_up"][1], 35.7143, places=4)
self.assertAlmostEqual(self.wdf["aroon_dn"][1], 57.1429, places=4)
self.assertAlmostEqual(self.wdf["aroon_up"][2], 28.5714, places=4)
self.assertAlmostEqual(self.wdf["aroon_dn"][2], 50.0000, places=4)
self.assertAlmostEqual(self.wdf["aroon_up"][3], 21.4286, places=4)
self.assertAlmostEqual(self.wdf["aroon_dn"][3], 42.8571, places=4)
self.assertAlmostEqual(self.wdf["aroon_up"][1084], 57.1429, places=4)
self.assertAlmostEqual(self.wdf["aroon_dn"][1084], 78.5714, places=4)
self.assertAlmostEqual(self.wdf["aroon_up"][1085], 50.0000, places=4)
self.assertAlmostEqual(self.wdf["aroon_dn"][1085], 71.4286, places=4)
self.assertAlmostEqual(self.wdf["aroon_up"][1086], 42.8571, places=4)
self.assertAlmostEqual(self.wdf["aroon_dn"][1086], 64.2857, places=4)
def test_aroon_oscillator(self):
self.wdf = aroonosc(self.wdf, "high", "low", "aroonosc", 10)
self.assertEqual(len(self.wdf["aroonosc"]), 1092)
self.assertAlmostEqual(self.wdf["aroonosc"][0], -30.0, places=4)
self.assertAlmostEqual(self.wdf["aroonosc"][1], -30.0, places=4)
self.assertAlmostEqual(self.wdf["aroonosc"][2], -30.0, places=4)
self.assertAlmostEqual(self.wdf["aroonosc"][1088], -30.0, places=4)
self.assertAlmostEqual(self.wdf["aroonosc"][1089], -30.0, places=4)
self.assertAlmostEqual(self.wdf["aroonosc"][1090], -30.0, places=4)
def tearDown(self):
self.wdf = None
if __name__ == "__main__":
unittest.main()
| 54.452991 | 79 | 0.653822 | 1,750 | 12,742 | 4.701143 | 0.162857 | 0.144646 | 0.364653 | 0.408411 | 0.740853 | 0.667193 | 0.613711 | 0.375593 | 0.255014 | 0.091163 | 0 | 0.123904 | 0.167713 | 12,742 | 233 | 80 | 54.686695 | 0.651862 | 0.004081 | 0 | 0.043269 | 0 | 0 | 0.071096 | 0.001655 | 0 | 0 | 0 | 0 | 0.653846 | 1 | 0.086538 | false | 0 | 0.081731 | 0 | 0.173077 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eca873476e7130331855c203dc1dd9113e2930b5 | 383 | py | Python | abhisek/Convert_Date_Style.py | abhisek-technicise/Python-Training | 35d773b529bd6f3961787c9ddb54c4a1e8cc227a | [
"MIT"
] | 1 | 2017-09-20T18:28:19.000Z | 2017-09-20T18:28:19.000Z | abhisek/Convert_Date_Style.py | backup1-technicise/Python-Training | 35d773b529bd6f3961787c9ddb54c4a1e8cc227a | [
"MIT"
] | 3 | 2017-06-16T07:01:57.000Z | 2017-06-16T07:31:05.000Z | abhisek/Convert_Date_Style.py | backup1-technicise/Python-Training | 35d773b529bd6f3961787c9ddb54c4a1e8cc227a | [
"MIT"
] | null | null | null | '''
Write a Python program to convert a date of yyyy-mm-dd format to to dd-mm-yyyy format.
'''
import re
dt1 = "2026-01-02"
List = re.split(r'-', dt1)
print List
temp = List[0]
List[0] = List[2]
List[2] = temp
new_date_format = '-'.join(List)
print new_date_format
print "Previous date format:", dt1
print "new_date_format:",
print re.sub(r'\d{4}-\d{2}-\d{2}', new_date_format, dt1) | 23.9375 | 86 | 0.684073 | 74 | 383 | 3.432432 | 0.418919 | 0.19685 | 0.204724 | 0.141732 | 0.181102 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057576 | 0.138381 | 383 | 16 | 87 | 23.9375 | 0.712121 | 0 | 0 | 0 | 0 | 0 | 0.227586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.083333 | null | null | 0.416667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
ecb7c1dd8b7c4d51b94603554aa08b2ef92f6754 | 643 | py | Python | 02 - Operators/04-assignment-augmented-operator-others.py | python-demo-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 2 | 2019-08-23T06:05:55.000Z | 2019-08-26T03:56:07.000Z | 02 - Operators/04-assignment-augmented-operator-others.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | null | null | null | 02 - Operators/04-assignment-augmented-operator-others.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 4 | 2020-10-01T07:16:07.000Z | 2021-07-17T07:55:08.000Z | # HEAD
# Augmented Assignment Operators
# DESCRIPTION
# Describes basic usage of all the augmented operators available
# RESOURCES
#
foo = 40
# Addition augmented operator
foo += 1
print(foo)
# Subtraction augmented operator
foo -= 1
print(foo)
# Multiplication augmented operator
foo *= 1
print(foo)
# Division augmented operator
foo /= 2
print(foo)
# Modulus augmented operator
foo %= 3
print(foo)
# Modulus augmented operator
foo //= 3
print(foo)
# Example Usage
strOne = 'Testing'
listOne = [1, 2]
strOne += ' String' # concat for strings and lists
print(strOne)
listOne *= 2 # replication for strings and lists
print(listOne)
| 15.309524 | 64 | 0.730949 | 84 | 643 | 5.595238 | 0.428571 | 0.217021 | 0.255319 | 0.134043 | 0.453191 | 0.355319 | 0.170213 | 0.170213 | 0.170213 | 0 | 0 | 0.020833 | 0.178849 | 643 | 41 | 65 | 15.682927 | 0.869318 | 0.580093 | 0 | 0.315789 | 0 | 0 | 0.055118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.421053 | 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 | 0 | 1 | 0 | 3 |
ecc1d971833dd8d3cdecfa47d675a5b19b3a7ecc | 19 | py | Python | comdutils/__init__.py | fatchur/CompDutils-computer-vision-deplyment-utils- | 4ea12917ba6584d7a768f2f129093b14e7fb469d | [
"MIT"
] | 1 | 2019-11-30T04:14:55.000Z | 2019-11-30T04:14:55.000Z | comdutils/__init__.py | fatchur/CompDutils-computer-vision-deplyment-utils- | 4ea12917ba6584d7a768f2f129093b14e7fb469d | [
"MIT"
] | null | null | null | comdutils/__init__.py | fatchur/CompDutils-computer-vision-deplyment-utils- | 4ea12917ba6584d7a768f2f129093b14e7fb469d | [
"MIT"
] | 1 | 2019-11-30T04:14:52.000Z | 2019-11-30T04:14:52.000Z | version = 'v0.3.1'
| 9.5 | 18 | 0.578947 | 4 | 19 | 2.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 0.157895 | 19 | 1 | 19 | 19 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0.315789 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
ecd0af033358c8b8b5d59b6e0da87c422e2f04f3 | 1,133 | py | Python | problems/804.Unique_Morse_Code_Words/li.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | problems/804.Unique_Morse_Code_Words/li.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | problems/804.Unique_Morse_Code_Words/li.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | # coding=utf-8
# Author: Jianghan LI
# Question: 804.Unique_Morse_Code_Words
# Complexity: O(N)
# Date: 2018-03-24 0:07:08 - 0:11:06, 0 wrong try
class Solution(object):
def uniqueMorseRepresentations(self, words):
"""
:type words: List[str]
:rtype: int
"""
d = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--",
"-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."]
res = set()
for word in words:
code = ''.join(d[ord(i) - ord('a')] for i in word)
res.add(code)
return len(res)
def uniqueMorseRepresentations(self, words):
d = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--",
"-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."]
return len({''.join(d[ord(i) - ord('a')] for i in w) for w in words})
############ test case ###########
s = Solution()
print s.uniqueMorseRepresentations(words=["gin", "zen", "gig", "msg"])
| 34.333333 | 106 | 0.352162 | 98 | 1,133 | 4.040816 | 0.602041 | 0.146465 | 0.166667 | 0.191919 | 0.09596 | 0.09596 | 0.09596 | 0.09596 | 0.09596 | 0 | 0 | 0.026964 | 0.247132 | 1,133 | 32 | 107 | 35.40625 | 0.43728 | 0.127979 | 0 | 0.4 | 0 | 0 | 0.199552 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.066667 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ecd5635d6e3a6fa5431381303b3b0ab4e59c6934 | 173 | py | Python | implementations/Python/version.py | DanielHreben/livr-multi-playground | 1066189136122e7813d63ae5acce2291f82f225b | [
"Artistic-2.0"
] | 3 | 2017-12-08T01:26:01.000Z | 2020-04-11T14:05:51.000Z | implementations/Python/version.py | DanielHreben/livr-multi-playground | 1066189136122e7813d63ae5acce2291f82f225b | [
"Artistic-2.0"
] | 4 | 2017-11-21T16:25:00.000Z | 2017-12-23T05:26:17.000Z | implementations/Python/version.py | DanielHreben/livr-multi-playground | 1066189136122e7813d63ae5acce2291f82f225b | [
"Artistic-2.0"
] | 1 | 2019-07-25T13:29:37.000Z | 2019-07-25T13:29:37.000Z | #!/usr/bin/env python3
import pkg_resources, platform
print(
'Python',
platform.python_version(),
'LIVR',
pkg_resources.get_distribution("LIVR").version
)
| 15.727273 | 50 | 0.693642 | 20 | 173 | 5.8 | 0.7 | 0.206897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006944 | 0.16763 | 173 | 10 | 51 | 17.3 | 0.798611 | 0.121387 | 0 | 0 | 0 | 0 | 0.092715 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.142857 | 0 | 0.142857 | 0.142857 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
01bf2501cd6a66136d2fc522bb6dda76e3ed5581 | 2,068 | py | Python | mov/app/models.py | fangxian/flask_exercise | 7973acc51d6444140976f6f6e1e63e77e8e3e07a | [
"MIT"
] | null | null | null | mov/app/models.py | fangxian/flask_exercise | 7973acc51d6444140976f6f6e1e63e77e8e3e07a | [
"MIT"
] | null | null | null | mov/app/models.py | fangxian/flask_exercise | 7973acc51d6444140976f6f6e1e63e77e8e3e07a | [
"MIT"
] | null | null | null | from . import db
from datetime import datetime
from werkzeug.security import check_password_hash
class User(db.Model):
__tablename__ = 'users'
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True, index=True) # 编号
name = db.Column(db.String(20), unique=True, index=True)
email = db.Column(db.String(100), unique=True, index=True)
pwd = db.Column(db.String(100))
info = db.Column(db.Text) # 个人说明
icon = db.Column(db.String(255), unique=True) # 头像,应该不用定义唯一
phone = db.Column(db.String(11), unique=True)
add_time = db.Column(db.DateTime, default=datetime.utcnow(), index=True)
uuid = db.Column(db.String(100), unique=True)
#userlogs = db.relationship('UserLog', backref='user') # 外键关联关系, 用user来反向检索到users表
articles = db.relationship('Article', backref='user')
#comments = db.relationship('Comment', backref='user')
def __repr__(self):
return "<User %r>" % self.name
def check_pwd(self, pwd):
return check_password_hash(self.pwd, pwd)
'''
class UserLog(db.Model):
pass
class Role(db.Model):
pass
'''
class Article(db.Model):
__tablename__ = 'articles'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
url = db.Column(db.String(255), unique=True)
title = db.Column(db.String(255), unique=True)
cate = db.Column(db.Integer, nullable=False)
icon = db.Column(db.String(100), nullable=False)
content = db.Column(db.Text)
add_time = db.Column(db.DateTime, default=datetime.utcnow(), index=True)
#comments = db.relationship("Comment", backref='article')
def __repr__(self):
return "<article %r>" % self.id
class Comment(db.Model):
__tablename = 'comments'
id = db.Column(db.Integer, primary_key=True)
content = db.Column(db.Text)
#article_id = db.Column(db.Integer, db.ForeignKey('article.id'))
#user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
def __repr__(self):
return "<Comment %r" % self.id | 34.466667 | 87 | 0.670696 | 287 | 2,068 | 4.689895 | 0.247387 | 0.124814 | 0.156018 | 0.106984 | 0.465825 | 0.346954 | 0.346954 | 0.216196 | 0.142645 | 0.142645 | 0 | 0.014654 | 0.175048 | 2,068 | 60 | 88 | 34.466667 | 0.774326 | 0.159091 | 0 | 0.236842 | 0 | 0 | 0.051932 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.105263 | false | 0.052632 | 0.078947 | 0.105263 | 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 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 |
01c22ca00f28fdc5c957e9e8d0972649c69c0479 | 1,011 | py | Python | samples/test.free_energy.py | SinHouse/qm3 | b2436ad813dd13c0c14bdee5d95f30436bc0a04d | [
"MIT"
] | null | null | null | samples/test.free_energy.py | SinHouse/qm3 | b2436ad813dd13c0c14bdee5d95f30436bc0a04d | [
"MIT"
] | null | null | null | samples/test.free_energy.py | SinHouse/qm3 | b2436ad813dd13c0c14bdee5d95f30436bc0a04d | [
"MIT"
] | null | null | null | import qm3.utils.free_energy
dene = [ 6.372, 5.995, 5.893, 4.233, 5.740, 5.230, 5.184, 4.128, 5.336, 5.004, 3.907, 5.164,
6.588, 6.661, 5.443, 6.704, 5.136, 2.071, 3.673, 4.948, 6.117, 5.776, 5.247, 7.117, 4.269,
6.832, 6.346, 6.158, 3.961, 3.197, 4.638, 5.314, 5.121, 6.549, 6.110, 5.151, 4.629, 4.772,
5.990, 5.979, 6.092, 5.058, 5.820, 5.658, 5.913, 6.007, 5.404, 4.699, 5.271, 6.511, 7.027 ]
for dat in qm3.utils.free_energy.fep_integrate( dene ):
print( "Samples: ", dat["Samples"] )
print( "dF: ", dat["dF"]/4.184, "+/-", dat["Error"]/4.184, "_kcal/mol" )
print( "Samp.rat:", dat["Sampling Ratio"] )
print( "Autocorr:", dat["Autocorrelation"] )
for dat in qm3.utils.free_energy.fep_integrate( dene, clusters = 2, tries = 10 ):
print( 80 * "-" )
print( "Samples: ", dat["Samples"] )
print( "dF: ", dat["dF"]/4.184, "+/-", dat["Error"]/4.184, "_kcal/mol" )
print( "Samp.rat:", dat["Sampling Ratio"] )
print( "Autocorr:", dat["Autocorrelation"] )
| 50.55 | 95 | 0.571711 | 186 | 1,011 | 3.069892 | 0.446237 | 0.028021 | 0.063047 | 0.094571 | 0.553415 | 0.553415 | 0.553415 | 0.553415 | 0.553415 | 0.553415 | 0 | 0.276029 | 0.182987 | 1,011 | 19 | 96 | 53.210526 | 0.415254 | 0 | 0 | 0.5 | 0 | 0 | 0.181009 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.0625 | 0 | 0.0625 | 0.5625 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
01f6e46f86236202f554ada2a06125aea3ea0d5a | 56 | py | Python | datbase/database.py | NikhilMunna/chinese-checkers- | 65ca18b6751451d64aae8842145b5337ccd33ac6 | [
"Apache-2.0"
] | 2 | 2019-12-05T05:37:43.000Z | 2020-03-05T10:03:31.000Z | datbase/database.py | NikhilMunna/chinese-checkers- | 65ca18b6751451d64aae8842145b5337ccd33ac6 | [
"Apache-2.0"
] | 6 | 2020-02-12T02:44:03.000Z | 2021-06-10T22:09:54.000Z | datbase/database.py | NikhilMunna/chinese-checkers- | 65ca18b6751451d64aae8842145b5337ccd33ac6 | [
"Apache-2.0"
] | 1 | 2020-06-13T13:40:19.000Z | 2020-06-13T13:40:19.000Z | import sqlite3
conn = sqlite3.connect('scores_file.txt') | 28 | 41 | 0.803571 | 8 | 56 | 5.5 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 0.071429 | 56 | 2 | 41 | 28 | 0.807692 | 0 | 0 | 0 | 0 | 0 | 0.263158 | 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 |
bf0c8e164626d1fb5173d2b27a33162bed96f18d | 259 | py | Python | lunarcalendar/__init__.py | bletham/LunarCalendar | 46e703709579e68bea60fe7edc1a86b45820b5dd | [
"MIT"
] | 35 | 2018-06-11T15:01:02.000Z | 2022-03-19T01:38:42.000Z | lunarcalendar/__init__.py | bletham/LunarCalendar | 46e703709579e68bea60fe7edc1a86b45820b5dd | [
"MIT"
] | 10 | 2018-05-28T14:58:55.000Z | 2021-06-10T16:17:04.000Z | lunarcalendar/__init__.py | bletham/LunarCalendar | 46e703709579e68bea60fe7edc1a86b45820b5dd | [
"MIT"
] | 16 | 2018-06-11T15:00:55.000Z | 2021-12-28T15:49:49.000Z | from .converter import Solar, Lunar, DateNotExist, Converter
from .festival import zh_festivals
from .solarterm import zh_solarterms
__all__ = [
'Solar', 'Lunar', 'DateNotExist', 'Converter',
'zh_festivals', 'zh_solarterms',
]
__version__ = '0.0.9'
| 23.545455 | 60 | 0.72973 | 30 | 259 | 5.9 | 0.5 | 0.112994 | 0.248588 | 0.350282 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013575 | 0.146718 | 259 | 10 | 61 | 25.9 | 0.78733 | 0 | 0 | 0 | 0 | 0 | 0.235521 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 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 |
bf21f5a479f982710d8f996381a14a91aad38199 | 74 | py | Python | atcoder/abc/a014.py | tomato-300yen/coding | db6f440a96d8c83f486005c650461a69f27e3926 | [
"MIT"
] | null | null | null | atcoder/abc/a014.py | tomato-300yen/coding | db6f440a96d8c83f486005c650461a69f27e3926 | [
"MIT"
] | null | null | null | atcoder/abc/a014.py | tomato-300yen/coding | db6f440a96d8c83f486005c650461a69f27e3926 | [
"MIT"
] | null | null | null | a = int(input())
b = int(input())
print(b - (a % b) if a % b != 0 else 0)
| 18.5 | 39 | 0.486486 | 16 | 74 | 2.25 | 0.5 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036364 | 0.256757 | 74 | 3 | 40 | 24.666667 | 0.618182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 1 | 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 |
170abc415d68a4474803335cef8552c9a0178010 | 151 | py | Python | django_base/bookmanager/book/urls.py | qdc520/repository | 15ba0f5cbbe82d0229f52428d53f1bf985e78eff | [
"MIT"
] | null | null | null | django_base/bookmanager/book/urls.py | qdc520/repository | 15ba0f5cbbe82d0229f52428d53f1bf985e78eff | [
"MIT"
] | null | null | null | django_base/bookmanager/book/urls.py | qdc520/repository | 15ba0f5cbbe82d0229f52428d53f1bf985e78eff | [
"MIT"
] | null | null | null | from django.urls import path
from book import views
# 这个是固定写法 urlpatterns = []
urlpatterns = [
# path(路由, 视图函数名)
path('index/', views.index)
] | 18.875 | 31 | 0.675497 | 19 | 151 | 5.368421 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.198676 | 151 | 8 | 32 | 18.875 | 0.842975 | 0.264901 | 0 | 0 | 0 | 0 | 0.055046 | 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 |
1726a8dc6460b01ad75be16f7d44062db015419a | 69 | py | Python | src/simple_commander/game/__init__.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | src/simple_commander/game/__init__.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | src/simple_commander/game/__init__.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | from collections import OrderedDict
REGISTERED_GAMES = OrderedDict() | 23 | 35 | 0.855072 | 7 | 69 | 8.285714 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101449 | 69 | 3 | 36 | 23 | 0.935484 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 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 |
174079e2c8e5cf2e11cb12c1c3e5001254a3e370 | 2,250 | py | Python | aliyun-python-sdk-hbase/aliyunsdkhbase/request/v20190101/ModifyBackupPlanConfigRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-hbase/aliyunsdkhbase/request/v20190101/ModifyBackupPlanConfigRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-hbase/aliyunsdkhbase/request/v20190101/ModifyBackupPlanConfigRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from aliyunsdkcore.request import RpcRequest
from aliyunsdkhbase.endpoint import endpoint_data
class ModifyBackupPlanConfigRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'HBase', '2019-01-01', 'ModifyBackupPlanConfig','hbase')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
if hasattr(self, "endpoint_regional"):
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
def get_FullBackupCycle(self):
return self.get_query_params().get('FullBackupCycle')
def set_FullBackupCycle(self,FullBackupCycle):
self.add_query_param('FullBackupCycle',FullBackupCycle)
def get_Tables(self):
return self.get_query_params().get('Tables')
def set_Tables(self,Tables):
self.add_query_param('Tables',Tables)
def get_ClusterId(self):
return self.get_query_params().get('ClusterId')
def set_ClusterId(self,ClusterId):
self.add_query_param('ClusterId',ClusterId)
def get_MinHFileBackupCount(self):
return self.get_query_params().get('MinHFileBackupCount')
def set_MinHFileBackupCount(self,MinHFileBackupCount):
self.add_query_param('MinHFileBackupCount',MinHFileBackupCount)
def get_NextFullBackupDate(self):
return self.get_query_params().get('NextFullBackupDate')
def set_NextFullBackupDate(self,NextFullBackupDate):
self.add_query_param('NextFullBackupDate',NextFullBackupDate) | 36.290323 | 85 | 0.776889 | 284 | 2,250 | 5.992958 | 0.387324 | 0.035253 | 0.041128 | 0.049941 | 0.091069 | 0.091069 | 0.091069 | 0 | 0 | 0 | 0 | 0.006126 | 0.129333 | 2,250 | 62 | 86 | 36.290323 | 0.862685 | 0.335111 | 0 | 0 | 0 | 0 | 0.164478 | 0.015204 | 0 | 0 | 0 | 0 | 0 | 1 | 0.366667 | false | 0 | 0.066667 | 0.166667 | 0.633333 | 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 |
1741b09c6e958548db9c20e2e8d11d87df0e5fb7 | 295 | py | Python | adapters/bitron/__init__.py | russdan/domoticz-zigbee2mqtt-plugin | d47895eab44bc87fc19ce151698d2afe9554fadc | [
"MIT"
] | 146 | 2018-09-19T11:38:48.000Z | 2022-03-21T11:54:12.000Z | adapters/bitron/__init__.py | russdan/domoticz-zigbee2mqtt-plugin | d47895eab44bc87fc19ce151698d2afe9554fadc | [
"MIT"
] | 783 | 2018-09-28T17:07:14.000Z | 2022-03-31T10:18:27.000Z | adapters/bitron/__init__.py | russdan/domoticz-zigbee2mqtt-plugin | d47895eab44bc87fc19ce151698d2afe9554fadc | [
"MIT"
] | 147 | 2018-09-25T18:39:51.000Z | 2022-03-01T19:31:27.000Z | from adapters.bitron.AV201032 import AV201032
from adapters.bitron.siren import BitronSirenAdapterWithBattery
bitron_adapters = {
'AV2010/32': AV201032, # Bitron Wireless wall thermostat with relay
'902010/29': BitronSirenAdapterWithBattery # Bitron Outdoor siren
}
| 36.875 | 91 | 0.749153 | 29 | 295 | 7.586207 | 0.586207 | 0.109091 | 0.163636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133891 | 0.189831 | 295 | 7 | 92 | 42.142857 | 0.786611 | 0.213559 | 0 | 0 | 0 | 0 | 0.078603 | 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 |
1780c1c270b8f0b2ada7c2ca622faf057a801678 | 896 | py | Python | auxil/zeekctl/testing/Cfg/plugins/commandtest.py | hugolin615/zeek-4.0.0-ele420520-spring2021 | 258e9b2ee1f2a4bd45c6332a75304793b7d44d40 | [
"Apache-2.0"
] | 1 | 2021-03-06T19:51:07.000Z | 2021-03-06T19:51:07.000Z | auxil/zeekctl/testing/Cfg/plugins/commandtest.py | hugolin615/zeek-4.0.0-ele420520-spring2021 | 258e9b2ee1f2a4bd45c6332a75304793b7d44d40 | [
"Apache-2.0"
] | null | null | null | auxil/zeekctl/testing/Cfg/plugins/commandtest.py | hugolin615/zeek-4.0.0-ele420520-spring2021 | 258e9b2ee1f2a4bd45c6332a75304793b7d44d40 | [
"Apache-2.0"
] | null | null | null | # Zeekctl test plugin that defines custom commands.
import ZeekControl.plugin
class CommandTest(ZeekControl.plugin.Plugin):
def __init__(self):
super(CommandTest, self).__init__(apiversion=1)
def name(self):
return "commandtest"
def pluginVersion(self):
return 1
def init(self):
return True
def commands(self):
return [("testcmd", "[<nodes>]", "Test command that expects arguments"),
("", "", "Another test command")]
def cmd_custom(self, cmd, args, cmdout):
results = ZeekControl.cmdresult.CmdResult()
# This is an easy way to force the plugin command to return failure.
if args == "fail":
results.ok = False
else:
results.ok = True
cmdout.info("Command name: %s" % cmd)
cmdout.info("Command args: %s" % args)
return results
| 25.6 | 80 | 0.602679 | 101 | 896 | 5.257426 | 0.475248 | 0.07533 | 0.041431 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003135 | 0.287946 | 896 | 34 | 81 | 26.352941 | 0.829154 | 0.129464 | 0 | 0 | 0 | 0 | 0.151866 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.045455 | 0.181818 | 0.590909 | 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 |
179e8f470a241da1e890122f762067de7d8b2324 | 724 | py | Python | sdk/turing/router/config/common/env_var.py | LeonLnj/turing | 93817f5cfb40d056a707bd85e9265b5cafdaeb94 | [
"Apache-2.0"
] | 1 | 2021-12-26T09:04:13.000Z | 2021-12-26T09:04:13.000Z | sdk/turing/router/config/common/env_var.py | LeonLnj/turing | 93817f5cfb40d056a707bd85e9265b5cafdaeb94 | [
"Apache-2.0"
] | null | null | null | sdk/turing/router/config/common/env_var.py | LeonLnj/turing | 93817f5cfb40d056a707bd85e9265b5cafdaeb94 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
import turing.generated.models
from turing.generated.model_utils import OpenApiModel
@dataclass
class EnvVar:
name: str
value: str
_name: str = field(init=False, repr=False)
_value: str = field(init=False, repr=False)
@property
def name(self) -> str:
return self._name
@name.setter
def name(self, name):
self._name = name
@property
def value(self) -> str:
return self._value
@value.setter
def value(self, value:str):
self._value = value
def to_open_api(self) -> OpenApiModel:
return turing.generated.models.EnvVar(
name=self.name,
value=self.value
)
| 20.111111 | 53 | 0.631215 | 89 | 724 | 5.033708 | 0.303371 | 0.071429 | 0.080357 | 0.075893 | 0.116071 | 0.116071 | 0 | 0 | 0 | 0 | 0 | 0 | 0.273481 | 724 | 35 | 54 | 20.685714 | 0.851711 | 0 | 0 | 0.076923 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.192308 | false | 0 | 0.115385 | 0.115385 | 0.615385 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
bd59791402575bd17f8b8f1edfbdb06e4f86785f | 89 | py | Python | environments/examiner.py | songheony/oplp | 7947fec7c0cf84d327c5bb3406e5dfd465e82a10 | [
"MIT"
] | null | null | null | environments/examiner.py | songheony/oplp | 7947fec7c0cf84d327c5bb3406e5dfd465e82a10 | [
"MIT"
] | null | null | null | environments/examiner.py | songheony/oplp | 7947fec7c0cf84d327c5bb3406e5dfd465e82a10 | [
"MIT"
] | null | null | null | class Examiner:
def answer(self, *args, **kwargs):
raise NotImplementedError
| 22.25 | 38 | 0.674157 | 9 | 89 | 6.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.224719 | 89 | 3 | 39 | 29.666667 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 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 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.