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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
356d59df18dd45cf4a5f02be8c0f6e7adc55e83f | 3,241 | py | Python | tests/test_resource.py | tozhovez/SurveyGizmo | ea36dde1167e7424a67d2f61ade0a0505e449a4b | [
"BSD-3-Clause"
] | null | null | null | tests/test_resource.py | tozhovez/SurveyGizmo | ea36dde1167e7424a67d2f61ade0a0505e449a4b | [
"BSD-3-Clause"
] | null | null | null | tests/test_resource.py | tozhovez/SurveyGizmo | ea36dde1167e7424a67d2f61ade0a0505e449a4b | [
"BSD-3-Clause"
] | null | null | null |
from unittest import TestCase
from surveygizmo import SurveyGizmo
client = SurveyGizmo(api_token='token', api_token_secret='secret', prepare_url=True)
client.api.base_url = ''
class ResourceTests(TestCase):
def test_authentication(self):
_, params = client.api.survey.get(1)
self.assertEqual(params['api_token'], 'token')
self.assertEqual(params['api_token_secret'], 'secret')
def test_methods(self):
_, params = client.api.survey.list()
self.assertNotIn('_method', params)
_, params = client.api.survey.get(1)
self.assertNotIn('_method', params)
_, params = client.api.survey.create('My Survey', 'poll')
self.assertEqual(params['_method'], 'PUT')
_, params = client.api.survey.update(1)
self.assertEqual(params['_method'], 'POST')
_, params = client.api.survey.copy(1)
self.assertEqual(params['_method'], 'POST')
_, params = client.api.survey.delete(1)
self.assertEqual(params['_method'], 'DELETE')
class FilteringTests(TestCase):
def test_copy_on_filter(self):
resource1 = client.api.survey
resource2 = resource1.filter('field', 'op', 'value')
self.assertIsNot(resource1, resource2)
def test_filter_chaining(self):
resource1 = client.api.survey
resource2 = resource1.filter('field', 'op', 'value')
resource3 = resource2.filter('field', 'op', 'value')
self.assertEqual(len(resource1._filters), 0)
self.assertEqual(len(resource2._filters), 1)
self.assertEqual(len(resource3._filters), 2)
def test_list_filters(self):
_, params = client.api.survey.filter('field', 'op', 'value').list()
self.assertEqual(params['filter[field][0]'], 'field')
self.assertEqual(params['filter[operator][0]'], 'op')
self.assertEqual(params['filter[value][0]'], 'value')
def test_duplicate_calls(self):
resource = client.api.survey.filter('field', 'op', 'value')
_, params = resource.list()
self.assertEqual(params['filter[field][0]'], 'field')
self.assertEqual(params['filter[operator][0]'], 'op')
self.assertEqual(params['filter[value][0]'], 'value')
_, params = resource.list()
self.assertEqual(params['filter[field][0]'], 'field')
self.assertEqual(params['filter[operator][0]'], 'op')
self.assertEqual(params['filter[value][0]'], 'value')
def test_no_persistence(self):
_, params = client.api.survey.filter('field', 'op', 'value').list()
self.assertEqual(params['filter[field][0]'], 'field')
self.assertEqual(params['filter[operator][0]'], 'op')
self.assertEqual(params['filter[value][0]'], 'value')
_, params = client.api.survey.list()
self.assertNotIn('filter[field][0]', params)
self.assertNotIn('filter[operator][0]', params)
self.assertNotIn('filter[value][0]', params)
def test_pagination(self):
_, params = client.api.surveyresponse.resultsperpage('3').list(1)
self.assertEqual(params['resultsperpage'], '3')
_, params = client.api.surveyresponse.page('5').list(1)
self.assertEqual(params['page'], '5')
| 35.615385 | 84 | 0.635298 | 365 | 3,241 | 5.517808 | 0.172603 | 0.171301 | 0.20854 | 0.160874 | 0.638034 | 0.526812 | 0.526812 | 0.467229 | 0.419563 | 0.419563 | 0 | 0.016104 | 0.19531 | 3,241 | 90 | 85 | 36.011111 | 0.756135 | 0 | 0 | 0.444444 | 0 | 0 | 0.159259 | 0 | 0 | 0 | 0 | 0 | 0.460317 | 1 | 0.126984 | false | 0 | 0.031746 | 0 | 0.190476 | 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 |
35781bf06f1397f76a2b9836a7e0fbf5e6de5c64 | 63 | gyp | Python | bindings/nodejs/binding.gyp | Evanfeenstra/wallet.rs | ad7fcbf59172cb62d40e02b89cef7b2b09f13416 | [
"Apache-2.0"
] | 256 | 2017-06-27T02:37:21.000Z | 2022-03-28T07:51:48.000Z | bindings/nodejs/binding.gyp | Evanfeenstra/wallet.rs | ad7fcbf59172cb62d40e02b89cef7b2b09f13416 | [
"Apache-2.0"
] | 379 | 2017-06-25T05:49:14.000Z | 2022-03-29T18:57:11.000Z | bindings/nodejs/binding.gyp | Evanfeenstra/wallet.rs | ad7fcbf59172cb62d40e02b89cef7b2b09f13416 | [
"Apache-2.0"
] | 113 | 2017-06-25T14:07:05.000Z | 2022-03-30T09:10:12.000Z | {
"targets": [
{
"target_name": "index"
}
]
} | 9 | 28 | 0.365079 | 4 | 63 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.412698 | 63 | 7 | 29 | 9 | 0.594595 | 0 | 0 | 0 | 0 | 0 | 0.359375 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
357b1e35b7ecc8f39461a01a5ea7427ea070f747 | 475 | py | Python | tests/__init__.py | adleida/adms | 98efcb70d9c06dc7e5ca3fd7f01daff84974a565 | [
"MIT"
] | null | null | null | tests/__init__.py | adleida/adms | 98efcb70d9c06dc7e5ca3fd7f01daff84974a565 | [
"MIT"
] | null | null | null | tests/__init__.py | adleida/adms | 98efcb70d9c06dc7e5ca3fd7f01daff84974a565 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import os
import adms
import pytest
# fixture could collect arguments which will be required of input
@pytest.fixture
def client(request):
from adms.config import Config
# Config.initialize(cfgpath=(lambda: os.path.dirname\
# (os.path.abspath(__file__))+'/etc/main.yaml')())
Config.initialize(cfgpath='etc/main.yaml')
from adms.app import app
def teardown():
pass
return app.test_client()
| 22.619048 | 65 | 0.688421 | 65 | 475 | 4.953846 | 0.630769 | 0.080745 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002611 | 0.193684 | 475 | 20 | 66 | 23.75 | 0.83812 | 0.435789 | 0 | 0 | 0 | 0 | 0.04943 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.181818 | false | 0.090909 | 0.454545 | 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 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
3586331909a4517a66040042bc3c67e40d945141 | 365 | py | Python | lamana/tests/__init__.py | par2/lamana | f3bcc3dd609ba69ff4ed203270fa0d2592195dda | [
"BSD-3-Clause"
] | 1 | 2016-03-15T01:59:08.000Z | 2016-03-15T01:59:08.000Z | lamana/tests/__init__.py | par2/lamana | f3bcc3dd609ba69ff4ed203270fa0d2592195dda | [
"BSD-3-Clause"
] | 4 | 2016-02-16T18:40:49.000Z | 2021-08-23T20:45:30.000Z | lamana/tests/__init__.py | par2/lamana | f3bcc3dd609ba69ff4ed203270fa0d2592195dda | [
"BSD-3-Clause"
] | 2 | 2016-02-09T18:47:04.000Z | 2016-02-16T05:24:59.000Z |
import matplotlib as mpl
mpl.use('Agg') # required to prevent DISPLAY error; must be before pyplot (REF 050)
import matplotlib.pyplot as plt
import numpy as np
class PlotTestCase(object):
'''Adatped from seaborn.'''
def setUp(self):
np.random.seed(33)
def tearDown(self):
plt.close('all')
| 24.333333 | 127 | 0.59726 | 46 | 365 | 4.73913 | 0.76087 | 0.146789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019763 | 0.306849 | 365 | 14 | 128 | 26.071429 | 0.841897 | 0.243836 | 0 | 0 | 0 | 0 | 0.022305 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | 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 |
3587fb18486d8eff4708fc8d0306deda75d669f2 | 2,852 | py | Python | pytdx/parser/ex_setup_commands.py | garywangiam02/vnpy | fbb168bf977d95ae874e92a3655c6c893db16a1f | [
"MIT"
] | null | null | null | pytdx/parser/ex_setup_commands.py | garywangiam02/vnpy | fbb168bf977d95ae874e92a3655c6c893db16a1f | [
"MIT"
] | null | null | null | pytdx/parser/ex_setup_commands.py | garywangiam02/vnpy | fbb168bf977d95ae874e92a3655c6c893db16a1f | [
"MIT"
] | null | null | null | # coding=utf-8
from pytdx.parser.base import BaseParser
from pytdx.helper import get_datetime, get_volume, get_price
from collections import OrderedDict
import struct
class ExSetupCmd1(BaseParser):
def setup(self):
# self.send_pkg = bytearray.fromhex("01 01 48 65 00 01 52 00 52 00 54 24 1f 32 c6 e5"
# "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 1f 32 c6 e5"
# "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 1f 32 c6 e5"
# "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 1f 32 c6 e5"
# "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 cc e1 6d ff"
# "d5 ba 3f b8 cb c5 7a 05 4f 77 48 ea")
self.send_pkg = bytearray.fromhex("01 01 48 65 00 01 52 00 52 00 54 24"
"FC F0 0E 92 F3 C8 37 83 1F 32 C6 E5 D5 3D FB 41 CD 9C"
"F2 07 FC D0 3C F6 F2 F7 A4 77 47 83 1D 59 9D CC 1F 91"
"D5 55 82 DC 09 07 EE 29 DD FE 4C 28 1F 32 C6 E5 D5 3D"
"FB 41 1F 32 C6 E5 D5 3D FB 41 F3 43 87 E6 68 A9 2A A3"
"70 11 E4 9C D2 6E B0 1A")
#
# exSetupCmd0 = []
# byte
# {0x01, 0x01, 0x48, 0x65, 0x00, 0x01, 0x52, 0x00, 0x52, 0x00, 0x54, 0x24,
# 0xFC, 0xF0, 0x0E, 0x92, 0xF3, 0xC8, 0x37, 0x83, 0x1F, 0x32, 0xC6, 0xE5, 0xD5, 0x3D, 0xFB, 0x41, 0xCD, 0x9C,
# 0xF2, 0x07, 0xFC, 0xD0, 0x3C, 0xF6, 0xF2, 0xF7, 0xA4, 0x77, 0x47, 0x83, 0x1D, 0x59, 0x9D, 0xCC, 0x1F, 0x91,
# 0xD5, 0x55, 0x82, 0xDC, 0x09, 0x07, 0xEE, 0x29, 0xDD, 0xFE, 0x4C, 0x28, 0x1F, 0x32, 0xC6, 0xE5, 0xD5, 0x3D,
# 0xFB, 0x41, 0x1F, 0x32, 0xC6, 0xE5, 0xD5, 0x3D, 0xFB, 0x41, 0xF3, 0x43, 0x87, 0xE6, 0x68, 0xA9, 0x2A, 0xA3,
# 0x70, 0x11, 0xE4, 0x9C, 0xD2, 0x6E, 0xB0, 0x1A}
# var
# exSetupCmd1 = []
# byte
# {0x01, 0x02, 0x48, 0x69, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0xF4, 0x23}
# var
# exSetupCmd2 = []
# byte
# {0x01, 0x03, 0x48, 0x66, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0xF0, 0x23}
# var
# exSetupCmd3 = []
# byte
# {0x01, 0x04, 0x48, 0x67, 0x00, 0x01, 0x08, 0x00, 0x08, 0x00, 0xF5, 0x23, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x01}
# var
# exSetupCmd4 = []
# byte
# {0x01, 0x05, 0x48, 0x67, 0x00, 0x01, 0x08, 0x00, 0x08, 0x00, 0xF5, 0x23, 0xF4, 0x01, 0x00, 0x00, 0xF4, 0x01}
# var
# exSetupCmd5 = []
# byte
# {0x01, 0x06, 0x48, 0x67, 0x00, 0x01, 0x08, 0x00, 0x08, 0x00, 0xF5, 0x23, 0xE8, 0x03, 0x00, 0x00, 0xF4, 0x01}
def parseResponse(self, body_buf):
pass
| 51.854545 | 118 | 0.497896 | 418 | 2,852 | 3.382775 | 0.449761 | 0.031117 | 0.046676 | 0.062235 | 0.410184 | 0.38331 | 0.349364 | 0.349364 | 0.270156 | 0.270156 | 0 | 0.395062 | 0.403576 | 2,852 | 54 | 119 | 52.814815 | 0.436214 | 0.595372 | 0 | 0 | 0 | 0 | 0.241719 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0.071429 | 0.285714 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
359e003a9597dc52689eb5a5a6a0a3788b14780e | 379 | py | Python | playground/nn/dropout.py | rodrigobaron/nn-playground | d93b3eba3d54d7602e9adb5895cca10a1e047f2e | [
"MIT"
] | 2 | 2018-03-24T18:09:23.000Z | 2020-01-04T13:14:45.000Z | playground/nn/dropout.py | rodrigobaron/nn-playground | d93b3eba3d54d7602e9adb5895cca10a1e047f2e | [
"MIT"
] | 1 | 2018-04-04T15:34:44.000Z | 2018-04-04T15:34:44.000Z | playground/nn/dropout.py | rodrigobaron/nn-playground | d93b3eba3d54d7602e9adb5895cca10a1e047f2e | [
"MIT"
] | null | null | null | import numpy as np
from .layer import Layer
class Dropout(Layer):
"""TODO: Dropout layer doc"""
def __init__(self, p=0.5):
super().__init__()
self.p = p
def forward(self, inputs):
self.rb = np.random.binomial(1, self.p, size=inputs.shape) / self.p
return inputs * self.rb
def backward(self, grad):
return grad * self.rb | 23.6875 | 75 | 0.604222 | 55 | 379 | 4.018182 | 0.509091 | 0.090498 | 0.081448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010791 | 0.266491 | 379 | 16 | 76 | 23.6875 | 0.784173 | 0.060686 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0 | 1 | 0.272727 | false | 0 | 0.181818 | 0.090909 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
35aebbc58c5541cfcea0982530d364cd60855183 | 300 | py | Python | tests/expr/expr06.py | ktok07b6/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 83 | 2015-11-30T09:59:13.000Z | 2021-08-03T09:12:28.000Z | tests/expr/expr06.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 4 | 2017-02-10T01:43:11.000Z | 2020-07-14T03:52:25.000Z | tests/expr/expr06.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 11 | 2016-11-18T14:39:15.000Z | 2021-02-23T10:05:20.000Z | from polyphony import testbench
def expr06(a, b):
return a < b
@testbench
def test():
assert False == expr06(0, 0)
assert True == expr06(0, 1)
assert False == expr06(1, 0)
assert True == expr06(-1, 0)
assert True == expr06(-2, -1)
assert False == expr06(1, -1)
test()
| 18.75 | 33 | 0.593333 | 45 | 300 | 3.955556 | 0.355556 | 0.185393 | 0.286517 | 0.286517 | 0.410112 | 0.235955 | 0 | 0 | 0 | 0 | 0 | 0.116592 | 0.256667 | 300 | 15 | 34 | 20 | 0.681614 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0.166667 | false | 0 | 0.083333 | 0.083333 | 0.333333 | 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 |
35e3b95f28d52f8d553c74d5fff3c751242a5bdf | 222 | py | Python | module10-packages/deepcloudlabs/__init__.py | deepcloudlabs/dcl160-2021-jul-05 | 0162afb24a5b89633531dbb1c195898d5066077a | [
"MIT"
] | null | null | null | module10-packages/deepcloudlabs/__init__.py | deepcloudlabs/dcl160-2021-jul-05 | 0162afb24a5b89633531dbb1c195898d5066077a | [
"MIT"
] | null | null | null | module10-packages/deepcloudlabs/__init__.py | deepcloudlabs/dcl160-2021-jul-05 | 0162afb24a5b89633531dbb1c195898d5066077a | [
"MIT"
] | null | null | null | print("deepcloudlabs module is loaded!")
from deepcloudlabs.dictionary import words
with open("deepcloudlabs/dictionary-tur.txt", mode="r") as afile:
for word in afile.readlines():
words.append(word.strip())
| 27.75 | 65 | 0.72973 | 29 | 222 | 5.586207 | 0.793103 | 0.283951 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144144 | 222 | 7 | 66 | 31.714286 | 0.852632 | 0 | 0 | 0 | 0 | 0 | 0.288288 | 0.144144 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 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 |
ea0a0a31c3f5dd030516816b779040785bd05064 | 3,251 | py | Python | commonmodel/schema_lookup.py | kvh/openmodel | 2473f54a8185f8eeac0e3ab67b43d55a61466685 | [
"BSD-3-Clause"
] | 1 | 2021-07-14T09:43:32.000Z | 2021-07-14T09:43:32.000Z | commonmodel/schema_lookup.py | kvh/openmodel | 2473f54a8185f8eeac0e3ab67b43d55a61466685 | [
"BSD-3-Clause"
] | null | null | null | commonmodel/schema_lookup.py | kvh/openmodel | 2473f54a8185f8eeac0e3ab67b43d55a61466685 | [
"BSD-3-Clause"
] | null | null | null | from .field_types import *
key_lookup = {
"alphavantage.AlphavantageCompanyOverview": "../schemas/alphavantage/AlphavantageCompanyOverview.yml",
"alphavantage.AlphavantageEodPrice": "../schemas/alphavantage/AlphavantageEodPrice.yml",
"core.Any": "../schemas/core/Any.yml",
"crunchbase.CrunchbaseFundingRound": "../schemas/crunchbase/CrunchbaseFundingRound.yml",
"crunchbase.CrunchbasePerson": "../schemas/crunchbase/CrunchbasePerson.yml",
"crunchbase.CrunchbaseOrganization": "../schemas/crunchbase/CrunchbaseOrganization.yml",
"mailchimp.MailchimpMember": "../schemas/mailchimp/MailchimpMember.yml",
"square.SquareCustomer": "../schemas/square/SquareCustomer.yml",
"square.SquareOrder": "../schemas/square/SquareOrder.yml",
"square.SquarePayment": "../schemas/square/SquarePayment.yml",
"square.SquareCatalogObject": "../schemas/square/SquareCatalogObject.yml",
"square.SquareLoyaltyAccount": "../schemas/square/SquareLoyaltyAccount.yml",
"bigcommerce.BigCommerceOrderProduct": "../schemas/bigcommerce/BigCommerceOrderProduct.yml",
"bigcommerce.BigCommerceOrder": "../schemas/bigcommerce/BigCommerceOrder.yml",
"fred.FredSeries": "../schemas/fred/FredSeries.yml",
"fred.FredObservation": "../schemas/fred/FredObservation.yml",
"shopify.ShopifyOrder": "../schemas/shopify/ShopifyOrder.yml",
"stocks.Ticker": "../schemas/stocks/Ticker.yml",
"stocks.EodPrice": "../schemas/stocks/EodPrice.yml",
"bi.Transaction": "../schemas/bi/Transaction.yml",
"stripe.StripeCharge": "../schemas/stripe/StripeCharge.yml",
"stripe.StripeRefund": "../schemas/stripe/StripeRefund.yml",
"stripe.StripeSubscription": "../schemas/stripe/StripeSubscription.yml",
"stripe.StripeInvoice": "../schemas/stripe/StripeInvoice.yml",
"stripe.StripeSubscriptionItem": "../schemas/stripe/StripeSubscriptionItem.yml",
}
namespace_lookup = {
"AlphavantageCompanyOverview": ["alphavantage.AlphavantageCompanyOverview"],
"AlphavantageEodPrice": ["alphavantage.AlphavantageEodPrice"],
"Any": ["core.Any"],
"CrunchbaseFundingRound": ["crunchbase.CrunchbaseFundingRound"],
"CrunchbasePerson": ["crunchbase.CrunchbasePerson"],
"CrunchbaseOrganization": ["crunchbase.CrunchbaseOrganization"],
"MailchimpMember": ["mailchimp.MailchimpMember", "mailchimp.MailchimpMember"],
"SquareCustomer": ["square.SquareCustomer"],
"SquareOrder": ["square.SquareOrder"],
"SquarePayment": ["square.SquarePayment"],
"SquareCatalogObject": ["square.SquareCatalogObject"],
"SquareLoyaltyAccount": ["square.SquareLoyaltyAccount"],
"BigCommerceOrderProduct": ["bigcommerce.BigCommerceOrderProduct"],
"BigCommerceOrder": ["bigcommerce.BigCommerceOrder"],
"FredSeries": ["fred.FredSeries"],
"FredObservation": ["fred.FredObservation"],
"ShopifyOrder": ["shopify.ShopifyOrder"],
"Ticker": ["stocks.Ticker"],
"EodPrice": ["stocks.EodPrice"],
"Transaction": ["bi.Transaction"],
"StripeCharge": ["stripe.StripeCharge"],
"StripeRefund": ["stripe.StripeRefund"],
"StripeSubscription": ["stripe.StripeSubscription"],
"StripeInvoice": ["stripe.StripeInvoice"],
"StripeSubscriptionItem": ["stripe.StripeSubscriptionItem"],
}
| 57.035088 | 106 | 0.730544 | 235 | 3,251 | 10.093617 | 0.191489 | 0.018971 | 0.032884 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096586 | 3,251 | 56 | 107 | 58.053571 | 0.807627 | 0 | 0 | 0 | 0 | 0 | 0.777914 | 0.573054 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.018182 | 0 | 0.018182 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ea0ddfeb067226ac46b17ba7bf1444399970a13a | 491 | py | Python | Regs/Block_G/RG125.py | BernardoB95/Extrator_SPEDFiscal | 10b4697833c561d24654251da5f22d044f03fc16 | [
"MIT"
] | 1 | 2021-04-25T13:53:20.000Z | 2021-04-25T13:53:20.000Z | Regs/Block_G/RG125.py | BernardoB95/Extrator_SPEDFiscal | 10b4697833c561d24654251da5f22d044f03fc16 | [
"MIT"
] | null | null | null | Regs/Block_G/RG125.py | BernardoB95/Extrator_SPEDFiscal | 10b4697833c561d24654251da5f22d044f03fc16 | [
"MIT"
] | null | null | null | from ..IReg import IReg
class RG125(IReg):
def __init__(self):
self._header = ['REG',
'COD_IND_BEM',
'DT_MOV',
'TIPO_MOV',
'VL_IMOB_ICMS_OP',
'VL_IMOB_ICMS_ST',
'VL_IMOB_ICMS_FRT',
'VL_IMOB_ICMS_DIF',
'NUM_PARC',
'VL_PARC_PASS']
self._hierarchy = "3"
| 25.842105 | 43 | 0.372709 | 44 | 491 | 3.590909 | 0.636364 | 0.151899 | 0.253165 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017544 | 0.535642 | 491 | 18 | 44 | 27.277778 | 0.675439 | 0 | 0 | 0 | 0 | 0 | 0.226069 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0.071429 | 0.071429 | 0 | 0.214286 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
ea105fe6d6aa22e0c704d9d2adfc6e19850b8be9 | 426 | py | Python | fastfood/detailview/views.py | Toffy-dev/bds-project-assignment-3 | 1256f07e4ef2d0c09020b2af5ca68da93945b9cd | [
"MIT"
] | null | null | null | fastfood/detailview/views.py | Toffy-dev/bds-project-assignment-3 | 1256f07e4ef2d0c09020b2af5ca68da93945b9cd | [
"MIT"
] | null | null | null | fastfood/detailview/views.py | Toffy-dev/bds-project-assignment-3 | 1256f07e4ef2d0c09020b2af5ca68da93945b9cd | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from main.models import *
from django.contrib.auth.decorators import user_passes_test
# Create your views here.
@user_passes_test(lambda u: u.is_superuser, login_url='/')
def order(response):
orders = Order_menu.objects.select_related('customer', 'address')
#orders = Order_menu.objects.all()
return render(response, "detailview/orderview.html", {'orders': orders})
| 35.5 | 76 | 0.762911 | 57 | 426 | 5.54386 | 0.684211 | 0.063291 | 0.088608 | 0.139241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117371 | 426 | 11 | 77 | 38.727273 | 0.840426 | 0.131455 | 0 | 0 | 0 | 0 | 0.128415 | 0.068306 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0.285714 | 0.428571 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
ea1088374bfb470a0247463cb918042b2fc910cb | 158 | py | Python | lib/commands/exit.py | paralax/shad0w | 226fb0635d310300e559a9e75d255a916e43b628 | [
"MIT"
] | 3 | 2022-02-08T15:40:28.000Z | 2022-03-03T18:36:28.000Z | lib/commands/exit.py | hkfmz/shad0w | fbb8aef4318a6d19374dcfbec592d9d3806974dc | [
"MIT"
] | null | null | null | lib/commands/exit.py | hkfmz/shad0w | fbb8aef4318a6d19374dcfbec592d9d3806974dc | [
"MIT"
] | 1 | 2020-09-22T21:13:24.000Z | 2020-09-22T21:13:24.000Z | #
# exit shad0w
#
import os, signal
__description__ = "Exit shad0w C2"
def main(shad0w, args):
# yea ik
os.kill(os.getpid(), signal.SIGTERM)
| 11.285714 | 40 | 0.632911 | 21 | 158 | 4.571429 | 0.714286 | 0.208333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033333 | 0.240506 | 158 | 13 | 41 | 12.153846 | 0.766667 | 0.113924 | 0 | 0 | 0 | 0 | 0.103704 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ea1b27532c019e39430c9416cb5da78f4311a51a | 2,576 | py | Python | saleor/hr/models.py | glosoftgroup/restaurant | 5b10a8f5199103e5bee01b45952c9638e63f28af | [
"BSD-3-Clause"
] | 1 | 2018-05-03T06:17:02.000Z | 2018-05-03T06:17:02.000Z | saleor/hr/models.py | glosoftgroup/restaurant | 5b10a8f5199103e5bee01b45952c9638e63f28af | [
"BSD-3-Clause"
] | 8 | 2018-05-07T16:42:35.000Z | 2022-02-26T03:31:56.000Z | saleor/hr/models.py | glosoftgroup/tenants | a6b229ad1f6d567b7078f83425a532830b71e1bb | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.utils.timezone import now
from django.db import models
class Contacts(models.Model):
name = models.CharField(max_length=100, null=True, blank=True)
mobile = models.CharField(max_length=100, null=True, blank=True)
relation = models.CharField(max_length=100, null=True, blank=True)
def __str__(self):
return str(self.name)
class Bank(models.Model):
name = models.CharField(max_length=100, null=True, blank=True)
def __str__(self):
return str(self.name)
class BankBranch(models.Model):
name = models.CharField(max_length=100, null=True, blank=True)
bank = models.ForeignKey(Bank, related_name='branch', max_length=100, null=True, blank=True)
def __str__(self):
return str(self.name)
class Department(models.Model):
name = models.CharField(max_length=100, null=True, blank=True)
def __str__(self):
return str(self.name)
class UserRole(models.Model):
name = models.CharField(max_length=100, null=True, blank=True)
def __str__(self):
return str(self.name)
# Create your models here.
class Employee(models.Model):
'''dsadad'''
added_on = models.DateTimeField(default=now, editable=False)
name = models.CharField(max_length=100, null=True, blank=True)
dob = models.CharField(max_length=100, null=True, blank=True)
doj = models.CharField(max_length=100, null=True, blank=True)
email = models.CharField(max_length=100, null=True, blank=True)
mpbile = models.CharField(max_length=100, null=True, blank=True)
nid = models.CharField(max_length=100, null=True, blank=True)
gender = models.CharField(max_length=100, null=True, blank=True)
department = models.CharField(max_length=100, null=True, blank=True)
role = models.CharField(max_length=100, null=True, blank=True)
marital_status = models.CharField(max_length=100, null=True, blank=True)
employement_type = models.CharField(max_length=100, null=True, blank=True)
'''education details'''
qualification = models.CharField(max_length=100, null=True, blank=True)
school = models.CharField(max_length=100, null=True, blank=True)
graduation_year = models.CharField(max_length=100, null=True, blank=True)
'''contacts details'''
contacts = models.ForeignKey(
Contacts, related_name='contacts', blank=True, null=True, default='')
phone = models.CharField(max_length=100, null=True, blank=True)
'''statutory details'''
amount = models.DecimalField(max_digits=100, decimal_places=2, null=True, blank=True)
'''Job History details'''
def __str__(self):
return str(self.name)
| 38.447761 | 97 | 0.743789 | 366 | 2,576 | 5.071038 | 0.199454 | 0.107759 | 0.168103 | 0.219828 | 0.677802 | 0.677802 | 0.677802 | 0.663254 | 0.663254 | 0.307651 | 0 | 0.032344 | 0.123835 | 2,576 | 66 | 98 | 39.030303 | 0.789987 | 0.012422 | 0 | 0.375 | 0 | 0 | 0.005726 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.0625 | 0.125 | 0.979167 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ea36a728311c50431812ccb4dd124ab949529db5 | 848 | py | Python | data_connector/model_word.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | data_connector/model_word.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | data_connector/model_word.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | import data_connector.model
class ModelWord(data_connector.model.Model):
@property
def word(self):
return self.__word
@word.setter
def word(self, value: str):
self.__word = value
@property
def translation(self):
return self.__translation
@translation.setter
def translation(self, value: str):
self.__translation = value
@property
def sentences(self):
return self.__sentences
@sentences.setter
def sentences(self, value: str):
self.__sentences = value
def to_sql(self):
return "insert into t_word values ('%s','%s','%s')" % (self.word, self.translation, self.sentences)
def __init__(self, word: str, sentences: str, trans: str):
self.__word = word
self.__sentences = sentences
self.__translation = trans
| 23.555556 | 107 | 0.639151 | 98 | 848 | 5.265306 | 0.255102 | 0.077519 | 0.081395 | 0.093023 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.255896 | 848 | 35 | 108 | 24.228571 | 0.81775 | 0 | 0 | 0.115385 | 0 | 0 | 0.049528 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.038462 | 0.153846 | 0.538462 | 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 |
ea3a330956b539ce5cfbba98ffe92d8a0291c984 | 159 | py | Python | problemsets/Codeforces/Python/A1358.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/Codeforces/Python/A1358.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/Codeforces/Python/A1358.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | """
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
for s in [*open(0)][1:]:
n,m=map(int,s.split())
print(0-(-n*m)//2) | 17.666667 | 38 | 0.566038 | 26 | 159 | 3.461538 | 0.769231 | 0.288889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030075 | 0.163522 | 159 | 9 | 39 | 17.666667 | 0.646617 | 0.471698 | 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 |
ea3bd0083d639fcf385c3d3d7d19d9f46ffa71ae | 4,662 | py | Python | hack/generators/release-controllers/content/development_rbac.py | etrunko/release | b27a85b546abe54a20ddde93008c20db320f3071 | [
"Apache-2.0"
] | null | null | null | hack/generators/release-controllers/content/development_rbac.py | etrunko/release | b27a85b546abe54a20ddde93008c20db320f3071 | [
"Apache-2.0"
] | 2 | 2021-12-07T10:55:43.000Z | 2022-03-03T18:40:32.000Z | hack/generators/release-controllers/content/development_rbac.py | etrunko/release | b27a85b546abe54a20ddde93008c20db320f3071 | [
"Apache-2.0"
] | 2 | 2022-02-23T12:16:04.000Z | 2022-03-16T14:20:32.000Z | import genlib
from config import Context
def _add_namespace_read_only_rbac(gendoc, namespace):
gendoc.append({
'apiVersion': 'authorization.openshift.io/v1',
'kind': 'Role',
'metadata': {
'name': 'release-controller-developers-read-only',
'namespace': namespace
},
'rules': [
{
'apiGroups': [''],
'resourceNames': ['release-upgrade-graph'],
'resources': ['secrets'],
'verbs': ['get', 'list', 'watch']
},
{
'apiGroups': ['image.openshift.io'],
'resources': ['imagestreams', 'imagestreamtags'],
'verbs': ['get', 'list', 'watch']
}]
})
gendoc.append({
'apiVersion': 'rbac.authorization.k8s.io/v1',
'kind': 'RoleBinding',
'metadata': {
'name': 'release-controller-developers-read-only-binding',
'namespace': namespace,
},
'roleRef': {
'apiGroup': 'rbac.authorization.k8s.io',
'kind': 'Role',
'name': 'release-controller-developers-read-only'
},
'subjects': [{
'apiGroup': 'rbac.authorization.k8s.io',
'kind': 'Group',
'name': 'openshift-release-controller-developers'
}]
})
def _add_deployment_monitoring_rbac(gendoc):
context = gendoc.context
gendoc.append({
'apiVersion': 'authorization.openshift.io/v1',
'kind': 'Role',
'metadata': {
'name': 'release-controller-developers-monitoring',
'namespace': context.config.rc_deployment_namespace
},
'rules': [
{
'apiGroups': [''],
'resources': ['pods'],
'verbs': ['get', 'list', 'watch']
}]
})
gendoc.append({
'apiVersion': 'rbac.authorization.k8s.io/v1',
'kind': 'RoleBinding',
'metadata': {
'name': 'release-controller-developers-monitoring-binding',
'namespace': context.config.rc_deployment_namespace,
},
'roleRef': {
'apiGroup': 'rbac.authorization.k8s.io',
'kind': 'Role',
'name': 'release-controller-developers-monitoring'
},
'subjects': [{
'apiGroup': 'rbac.authorization.k8s.io',
'kind': 'Group',
'name': 'openshift-release-controller-developers'
}]
})
def _add_cache_monitoring_rbac(gendoc):
context = gendoc.context
gendoc.append({
'apiVersion': 'authorization.openshift.io/v1',
'kind': 'Role',
'metadata': {
'name': 'release-controller-developers-monitoring',
'namespace': context.jobs_namespace
},
'rules': [
{
'apiGroups': ['batch/v1'],
'resources': ['jobs'],
'verbs': ['get', 'list', 'watch']
},
{
'apiGroups': [''],
'resources': ['pods/attach', 'pods/exec'],
'verbs': ['create']
},
{
'apiGroups': [''],
'resources': ['pods'],
'verbs': ['get', 'list', 'watch']
}]
})
gendoc.append({
'apiVersion': 'rbac.authorization.k8s.io/v1',
'kind': 'RoleBinding',
'metadata': {
'name': 'release-controller-developers-monitoring-binding',
'namespace': context.jobs_namespace,
},
'roleRef': {
'apiGroup': 'rbac.authorization.k8s.io',
'kind': 'Role',
'name': 'release-controller-developers-monitoring'
},
'subjects': [{
'apiGroup': 'rbac.authorization.k8s.io',
'kind': 'Group',
'name': 'openshift-release-controller-developers'
}]
})
def generate_development_rbac(config):
for private in (False, True):
for arch in config.arches:
context = Context(config, arch, private)
with genlib.GenDoc(config.paths.path_rc_deployments.joinpath(f'admin-{context.is_namespace}-rbac.yaml'), context) as gendoc:
_add_namespace_read_only_rbac(gendoc, context.is_namespace)
_add_deployment_monitoring_rbac(gendoc)
_add_cache_monitoring_rbac(gendoc)
context = Context(config, "x86_64", False)
with genlib.GenDoc(config.paths.path_rc_deployments.joinpath('admin-origin-rbac.yaml'), context) as gendoc:
_add_namespace_read_only_rbac(gendoc, 'origin')
| 31.931507 | 136 | 0.513085 | 376 | 4,662 | 6.239362 | 0.207447 | 0.086957 | 0.138107 | 0.118926 | 0.79838 | 0.757886 | 0.705456 | 0.698636 | 0.698636 | 0.654305 | 0 | 0.006421 | 0.331832 | 4,662 | 145 | 137 | 32.151724 | 0.746709 | 0 | 0 | 0.607692 | 0 | 0 | 0.355856 | 0.19305 | 0 | 0 | 0 | 0 | 0 | 1 | 0.030769 | false | 0 | 0.015385 | 0 | 0.046154 | 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 |
ea3ed4dbecef048ba99e1d1b81bff52926a4d5e0 | 2,700 | py | Python | utils/scripts/OOOlevelGen/src/daily_levels/182.py | fullscreennl/monkeyswipe | c56192e202674dd5ab18023f6cf14cf51e95fbd0 | [
"MIT"
] | null | null | null | utils/scripts/OOOlevelGen/src/daily_levels/182.py | fullscreennl/monkeyswipe | c56192e202674dd5ab18023f6cf14cf51e95fbd0 | [
"MIT"
] | null | null | null | utils/scripts/OOOlevelGen/src/daily_levels/182.py | fullscreennl/monkeyswipe | c56192e202674dd5ab18023f6cf14cf51e95fbd0 | [
"MIT"
] | null | null | null | import LevelBuilder
from sprites import *
def render(name,bg):
lb = LevelBuilder.LevelBuilder(name+".plist",background=bg)
lb.addObject(Beam.BeamSprite(x=318, y=269,width=326,height=13,angle='1',restitution=0.2,static='true',friction=0.5,density=20 ).setName('Beam'))
lb.addObject(Friend.FriendSprite(x=466, y=286,width=12,height=12,angle='0',restitution=0.2,static='false',friction=0.5,density=20 ).setName('Friend4'))
lb.addObject(Friend.FriendSprite(x=438, y=286,width=12,height=12,angle='0',restitution=0.2,static='false',friction=0.5,density=20 ).setName('Friend3'))
lb.addObject(Friend.FriendSprite(x=411, y=286,width=12,height=12,angle='0',restitution=0.2,static='false',friction=0.5,density=20 ).setName('Friend2'))
lb.addObject(Friend.FriendSprite(x=384, y=286,width=12,height=12,angle='0',restitution=0.2,static='false',friction=0.5,density=20 ).setName('Friend1'))
lb.addObject(Hero.HeroSprite(x=345, y=295,width=32,height=32))
lb.addObject(Joints.DistanceJoint(body1='Hero',body2='Friend1',damping='0.2',freq='5'))
lb.addObject(Joints.DistanceJoint(body1='Friend2',body2='Friend1',damping='0.2',freq='5'))
lb.addObject(Joints.DistanceJoint(body1='Friend2',body2='Friend3',damping='0.2',freq='5'))
lb.addObject(Joints.DistanceJoint(body1='Friend4',body2='Friend3',damping='0.2',freq='5'))
lb.addObject(Enemy.EnemySprite(x=397, y=304,width=28,height=28,angle='0',restitution=0.2,static='false',friction=0.5,density=20 ))
lb.addObject(Enemy.EnemySprite(x=426, y=304,width=28,height=28,angle='0',restitution=0.2,static='false',friction=0.5,density=20 ))
lb.addObject(Enemy.EnemySprite(x=453, y=304,width=28,height=28,angle='0',restitution=0.2,static='false',friction=0.5,density=20 ))
lb.addObject(Beam.BeamSprite(x=121, y=213,width=239,height=13,angle='-69',restitution=0.2,static='true',friction=0.5,density=20 ).setName('Beam'))
lb.addObject(Beam.BeamSprite(x=239, y=17,width=490,height=31,angle='0',restitution=0.95,static='true',friction=0.5,density=20 ).setName('Beam'))
lb.addObject(Beam.BeamSprite(x=39, y=195,width=81,height=14,angle='0',restitution=0.2,static='true',friction=0.5,density=20 ).setName('Beam'))
lb.addObject(Star.StarSprite(x=31, y=227,width=32,height=32))
lb.addObject(Beam.BeamSprite(x=294, y=153,width=127,height=14,angle='0',restitution=0.2,static='false',friction=0.5,density=2 ).setName('SlapBeam'))
lb.addObject(Nut.NutSprite(x=321, y=153,width=32,height=32,restitution=0.2,static='true',friction=0.5,density=20 ).setName('Nut'))
lb.addObject(Joints.RevoluteJoint(body1='Nut',body2='SlapBeam',motor_speed='50',enable_motor='true',torque='1000',lower_angle='12',upper_angle='50',enable_limit='false',collide_connected='false'))
lb.render() | 2,700 | 2,700 | 0.748889 | 452 | 2,700 | 4.460177 | 0.219027 | 0.109127 | 0.064484 | 0.109623 | 0.72123 | 0.619048 | 0.593254 | 0.593254 | 0.582341 | 0.560516 | 0 | 0.10882 | 0.03 | 2,700 | 1 | 2,700 | 2,700 | 0.660939 | 0 | 0 | 0 | 0 | 0 | 0.088486 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.04 | false | 0 | 0.08 | 0 | 0.12 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ea4151f224b995a3a7e9ffcd49241a6e052eb008 | 605 | py | Python | tnmlearn/examples/__init__.py | t2wain/machine-learning | 4b5e1a24fab7c4ab42f646f7785191ff3d3283ba | [
"MIT"
] | null | null | null | tnmlearn/examples/__init__.py | t2wain/machine-learning | 4b5e1a24fab7c4ab42f646f7785191ff3d3283ba | [
"MIT"
] | null | null | null | tnmlearn/examples/__init__.py | t2wain/machine-learning | 4b5e1a24fab7c4ab42f646f7785191ff3d3283ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .base_learning_model import BaseLearningModel
from .minivggnet_cifar10 import MiniVggNetCifar10
from .keras_cifar10 import KerasCifar10
from .keras_mnist import KerasMnist
from .lenet_mnist import LeNetMnist
from .shallownet_animals import ShallowNetAnimals
from .minivggnet_cifar10 import MiniVggNetCifar10
from .cifar10_monitor import Cifar10Monitor
from .cifar10_checkpoint import Cifar10Checkpoint
from .imagenet_pretrained import ImageNetPretrain
from .minivggnet_flowers17 import MiniVggNetFlowers17
from .minivggnet_flowers17_data_aug import MiniVggNetFlowers17DataAug | 43.214286 | 69 | 0.877686 | 66 | 605 | 7.818182 | 0.5 | 0.108527 | 0.081395 | 0.104651 | 0.186047 | 0.186047 | 0 | 0 | 0 | 0 | 0 | 0.052536 | 0.087603 | 605 | 14 | 69 | 43.214286 | 0.882246 | 0.034711 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
ea65a538d22d34297b337adaf2c3612c628b4fdf | 178 | py | Python | tests/serializers.py | WorkHorseIndustries/drf-raw-pagination | 728b552a103ecdc351b49b8945438a9c1a7d0326 | [
"MIT"
] | 3 | 2015-12-06T01:03:56.000Z | 2021-06-09T10:34:24.000Z | tests/serializers.py | WorkHorseIndustries/drf-raw-pagination | 728b552a103ecdc351b49b8945438a9c1a7d0326 | [
"MIT"
] | null | null | null | tests/serializers.py | WorkHorseIndustries/drf-raw-pagination | 728b552a103ecdc351b49b8945438a9c1a7d0326 | [
"MIT"
] | 3 | 2016-10-13T01:42:50.000Z | 2021-03-23T09:48:12.000Z | from .models import Foo
from rest_framework import serializers
class FooSerializer(serializers.ModelSerializer):
class Meta:
model = Foo
fields = ('name',)
| 19.777778 | 49 | 0.702247 | 19 | 178 | 6.526316 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.224719 | 178 | 8 | 50 | 22.25 | 0.898551 | 0 | 0 | 0 | 0 | 0 | 0.022472 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ea746f20915cd3dd61be3f2cd4b91760994bceb0 | 576 | py | Python | truck_microservice/truck/exceptions/invalid_input.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck/exceptions/invalid_input.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck/exceptions/invalid_input.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | class AccelerationException(Exception):
def __init__(self, message='This is neither acceleration nor deceleration... Go away and program Java, BooN'):
self.message = message
super().__init__(self.message)
class NoMemberException(Exception):
def __init__(self, message='This truck is not a convoy member'):
self.message = message
super().__init__(self.message)
class TruckBrokenException(Exception):
def __init__(self, message='A broken truck can\'t do this'):
self.message = message
super().__init__(self.message)
| 38.4 | 114 | 0.703125 | 68 | 576 | 5.602941 | 0.455882 | 0.259843 | 0.23622 | 0.15748 | 0.559055 | 0.488189 | 0.325459 | 0.225722 | 0 | 0 | 0 | 0 | 0.192708 | 576 | 14 | 115 | 41.142857 | 0.819355 | 0 | 0 | 0.5 | 0 | 0 | 0.227431 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ea75d35358c8b07d1796cc42b0a6ee9511987b59 | 175 | py | Python | cleverapi/action.py | ADM00103/Cleverbotvk | d19a4624cd0f218abdc81dfa369c0809cee6b7a4 | [
"MIT"
] | null | null | null | cleverapi/action.py | ADM00103/Cleverbotvk | d19a4624cd0f218abdc81dfa369c0809cee6b7a4 | [
"MIT"
] | null | null | null | cleverapi/action.py | ADM00103/Cleverbotvk | d19a4624cd0f218abdc81dfa369c0809cee6b7a4 | [
"MIT"
] | null | null | null | from enum import Enum
class Action(Enum):
WATCHED_GAME = 1,
JOIN_GAME = 2,
ANSWER_CORRECT = 3,
WIN_GAME = 4,
INVITE_FRIEND = 5,
COMMUNITY_NOTIFY = 6,
| 17.5 | 25 | 0.634286 | 25 | 175 | 4.2 | 0.84 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 0.28 | 175 | 9 | 26 | 19.444444 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 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 |
ea7d4faddc2db4ca1fee559f33e690b89b91068a | 6,020 | py | Python | pysimplegui/DemoPrograms/Demo_Desktop_Widget_Email_Notification.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | null | null | null | pysimplegui/DemoPrograms/Demo_Desktop_Widget_Email_Notification.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | 2 | 2020-06-06T00:30:56.000Z | 2021-06-10T22:30:37.000Z | pysimplegui/DemoPrograms/Demo_Desktop_Widget_Email_Notification.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import PySimpleGUI as sg
import email
import imaplib
from datetime import datetime
import calendar
'''
Usage of Notification in PSG
'''
IMAP_SERVER_GMAIL = 'imap.gmail.com' # gmail server address
IMAP_SERVER_HOTMAIL = 'imap-mail.outlook.com' # hotmail server address
################# Change these to match your email setup ################
LOGIN_EMAIL = 'you@mail.com'
LOGIN_PASSWORD = 'your email password'
# change to match your email service
IMAP_SERVER = IMAP_SERVER_GMAIL
MAX_EMAILS = 10
def gui():
sg.theme('Topanga')
sg.set_options(border_width=0, margins=(0, 0), element_padding=(4, 0))
color = ('#282923', '#282923')
layout = [[sg.Text('Email New Mail Notification' + 48 * ' '),
sg.Button('', image_data=refresh,
button_color=color,
key='-refresh-',
tooltip='refreshes Email'),
sg.Button('', image_data=red_x,
button_color=color,
key='-quit-',
tooltip='Closes window')],
[sg.Text('', key='-status-', size=(25, 1))], ]
for i in range(MAX_EMAILS):
layout.append([sg.Text('', size=(20, 1), key='{}date'.format(i), font='Sans 8'),
sg.Text('', size=(45, 1), font='Sans 8', key='{}from'.format(i))])
window = sg.Window('',
layout,
no_titlebar=True,
grab_anywhere=True,
keep_on_top=True,
alpha_channel=0,
finalize=True)
# move the window to the upper right corner of the screen
w, h = window.get_screen_dimensions()
window.move(w - 410, 0)
window.set_alpha(.9)
window.refresh()
status_elem = window['-status-']
while True:
status_elem.update('Reading...')
window.refresh()
read_mail(window)
status_elem.update('')
# return every 30 seconds
event, values = window.read(timeout=30 * 1000)
if event == '-quit-':
break
def read_mail(window):
"""
Reads late emails from IMAP server and displays them in the Window
:param window: window to display emails in
:return:
"""
mail = imaplib.IMAP4_SSL(IMAP_SERVER)
(retcode, capabilities) = mail.login(LOGIN_EMAIL, LOGIN_PASSWORD)
mail.list()
typ, data = mail.select('Inbox')
n = 0
now = datetime.now()
# get messages from today
search_string = '(SENTON {}-{}-{})'.format(now.day,
calendar.month_abbr[now.month], now.year)
(retcode, messages) = mail.search(None, search_string)
if retcode == 'OK':
# message numbers are separated by spaces, turn into list
msg_list = messages[0].split()
msg_list.sort(reverse=True) # sort messages descending
for n, message in enumerate(msg_list):
if n >= MAX_EMAILS:
break
from_elem = window['{}from'.format(n)]
date_elem = window['{}date'.format(n)]
from_elem.update('') # erase them so you know they're changing
date_elem.update('')
window.refresh()
typ, data = mail.fetch(message, '(RFC822)')
for response_part in data:
if isinstance(response_part, tuple):
original = email.message_from_bytes(response_part[1])
date_str = original['Date'][:22]
from_elem.update(original['From'])
date_elem.update(date_str)
window.refresh() # make the window changes show up right away
red_x = "R0lGODlhEAAQAPeQAIsAAI0AAI4AAI8AAJIAAJUAAJQCApkAAJoAAJ4AAJkJCaAAAKYAAKcAAKcCAKcDA6cGAKgAAKsAAKsCAKwAAK0AAK8AAK4CAK8DAqUJAKULAKwLALAAALEAALIAALMAALMDALQAALUAALYAALcEALoAALsAALsCALwAAL8AALkJAL4NAL8NAKoTAKwbAbEQALMVAL0QAL0RAKsREaodHbkQELMsALg2ALk3ALs+ALE2FbgpKbA1Nbc1Nb44N8AAAMIWAMsvAMUgDMcxAKVABb9NBbVJErFYEq1iMrtoMr5kP8BKAMFLAMxKANBBANFCANJFANFEB9JKAMFcANFZANZcANpfAMJUEMZVEc5hAM5pAMluBdRsANR8AM9YOrdERMpIQs1UVMR5WNt8X8VgYMdlZcxtYtx4YNF/btp9eraNf9qXXNCCZsyLeNSLd8SSecySf82kd9qqc9uBgdyBgd+EhN6JgtSIiNuJieGHhOGLg+GKhOKamty1ste4sNO+ueenp+inp+HHrebGrefKuOPTzejWzera1O7b1vLb2/bl4vTu7fbw7ffx7vnz8f///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAJAALAAAAAAQABAAAAjUACEJHEiwYEEABniQKfNFgQCDkATQwAMokEU+PQgUFDAjjR09e/LUmUNnh8aBCcCgUeRmzBkzie6EeQBAoAAMXuA8ciRGCaJHfXzUMCAQgYooWN48anTokR8dQk4sELggBhQrU9Q8evSHiJQgLCIIfMDCSZUjhbYuQkLFCRAMAiOQGGLE0CNBcZYmaRIDLqQFGF60eTRoSxc5jwjhACFWIAgMLtgUocJFy5orL0IQRHAiQgsbRZYswbEhBIiCCH6EiJAhAwQMKU5DjHCi9gnZEHMTDAgAOw=="
refresh = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACb0lEQVR4XpVTXUiTbxT/vePdFuF0BTFW9ufVvMlu+iACka6CQY1gQVdtEmTMpSKzzJT/RTdCRHhT4F0Us8LGVqlo1lZaFslWQWBkN+tDkpSpbfNz797T8zy6DbUbf/Dbec7vfOycMwa0DBJjM7Ko72mBtz+KplCS6Ronf3NNxNZBt2qv4dJzL0uKwGRqU/6zHDqyd1dBk32/xMnfXOMxkVPXXYlVSLjykk4fKIb/4zgUSxEO7zRBKd4Bjm/jU9ys8f2fJoCFhRiWl6pw6+Qw0BymhlfT5Lg/xmycHA++ktL+nsRqrUOrdpBpH6hhKC7yhObti0CgKUTu0KTgcd8X4j4aB2bYvj7UPqkQrO/1cU25ESV3eJJO8LzLIQ11/CYXn5Grf4KqGF19E3Ts9iixe2QPm0dtt5PtP6NcHxF5ZVfDhIbeqMQ6E0hcI4ec327jah513T4YDM5TR/dh8vc0hkfHUxI2gwuPKyDLb2wV5cIdePuZZGwWmQxSSyqICFBVyKgJJkFaQW4Hna4THQ4X/gUiD2+QXEwjNZsASJvTgWgMqoY95WWw7raAJdjheeTEeniCTqgZu2IxswnSmGI3gEZjMiQpAMocTC2nJcm4hU9gRjp9E+6Ajb07wKFpHqRVOzKqedFUhOX4HyRnEwSjMQCB8/4IqnxU2DYiaGnsIe7n2UlK61MWe0dbW18Ijdfk/wuy7IXeEEvEvmM+kcRM4XYYSkohW62ChtIS/NKbWGwO8z9+Anp9TNSsQU2wEtVdEZy5o7Gfi7Z5ewj/vxbkPs51kYhVP4zAw3I3IN+ohSVFcfZeEs67Gid/c03E1uEv5QpTFzvZK5EAAAAASUVORK5CYII='
gui()
| 52.807018 | 1,366 | 0.714784 | 482 | 6,020 | 8.809129 | 0.473029 | 0.014131 | 0.007065 | 0.007537 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055808 | 0.196346 | 6,020 | 113 | 1,367 | 53.274336 | 0.821827 | 0.087375 | 0 | 0.1 | 0 | 0.025 | 0.469649 | 0.424169 | 0 | 1 | 0 | 0 | 0 | 1 | 0.025 | false | 0.025 | 0.0625 | 0 | 0.0875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ea8c4b1ab6d926a3d0fbe2b59602685688a22005 | 169 | py | Python | project/router.py | Rajkumar-brk/Emotion-recognition-using-Text | d854247e1ce2721bcdf19bc237957c78ff1d100c | [
"MIT"
] | null | null | null | project/router.py | Rajkumar-brk/Emotion-recognition-using-Text | d854247e1ce2721bcdf19bc237957c78ff1d100c | [
"MIT"
] | null | null | null | project/router.py | Rajkumar-brk/Emotion-recognition-using-Text | d854247e1ce2721bcdf19bc237957c78ff1d100c | [
"MIT"
] | null | null | null | from user.api.viewsets import userviewsets
from rest_framework import routers
router = routers.DefaultRouter()
router.register('user',userviewsets,basename='user_api')
| 28.166667 | 56 | 0.828402 | 21 | 169 | 6.571429 | 0.619048 | 0.101449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 169 | 5 | 57 | 33.8 | 0.884615 | 0 | 0 | 0 | 0 | 0 | 0.071006 | 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 |
57726d766d77c6e066375aa5ac5429c90aa67f13 | 480 | py | Python | workspace/.c9/metadata/workspace/crawl/database.py | mannyhappenings/WebCrawler | 1451fe8e6dc55346a654665d736a7df2115e0c50 | [
"MIT"
] | null | null | null | workspace/.c9/metadata/workspace/crawl/database.py | mannyhappenings/WebCrawler | 1451fe8e6dc55346a654665d736a7df2115e0c50 | [
"MIT"
] | null | null | null | workspace/.c9/metadata/workspace/crawl/database.py | mannyhappenings/WebCrawler | 1451fe8e6dc55346a654665d736a7df2115e0c50 | [
"MIT"
] | null | null | null | {"filter":false,"title":"database.py","tooltip":"/crawl/database.py","undoManager":{"mark":-1,"position":-1,"stack":[]},"ace":{"folds":[],"scrolltop":486.5,"scrollleft":0,"selection":{"start":{"row":22,"column":23},"end":{"row":22,"column":23},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":5,"state":"start","mode":"ace/mode/python"}},"timestamp":1428000689000,"hash":"901e761cff14ac659067179bbfb56b586f1cb442"} | 480 | 480 | 0.69375 | 55 | 480 | 6.054545 | 0.727273 | 0.06006 | 0.066066 | 0.078078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114583 | 0 | 480 | 1 | 480 | 480 | 0.579167 | 0 | 0 | 0 | 0 | 0 | 0.596674 | 0.08316 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
577f444cf222affe2ec478d92e1c92045f619a42 | 647 | py | Python | venv3864/Lib/site-packages/PyInstaller/loader/rthooks/pyi_rth_certifi.py | JonRob812/SuperDuper | 51fdec82c04acf7c0b37f31e1ce2fce3eb22ce8b | [
"Apache-2.0"
] | 4 | 2019-08-28T21:01:08.000Z | 2021-06-30T06:27:35.000Z | venv3864/Lib/site-packages/PyInstaller/loader/rthooks/pyi_rth_certifi.py | JonRob812/SuperDuper | 51fdec82c04acf7c0b37f31e1ce2fce3eb22ce8b | [
"Apache-2.0"
] | 5 | 2019-11-10T16:20:09.000Z | 2019-12-02T14:23:58.000Z | venv3864/Lib/site-packages/PyInstaller/loader/rthooks/pyi_rth_certifi.py | JonRob812/SuperDuper | 51fdec82c04acf7c0b37f31e1ce2fce3eb22ce8b | [
"Apache-2.0"
] | 2 | 2019-08-27T22:21:05.000Z | 2021-06-30T06:27:41.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2018-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
import os
import ssl
import sys
# Use certificate from certifi only if cafile could not find by ssl.
if ssl.get_default_verify_paths().cafile is None:
os.environ['SSL_CERT_FILE'] = os.path.join(sys._MEIPASS, 'certifi', 'cacert.pem')
| 38.058824 | 85 | 0.581144 | 75 | 647 | 4.933333 | 0.746667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013986 | 0.11592 | 647 | 16 | 86 | 40.4375 | 0.632867 | 0.709428 | 0 | 0 | 0 | 0 | 0.167598 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.2 | 0.6 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
579416a39f6ee3780855c5223f91a53d25c637b2 | 2,139 | py | Python | pyvdms/util/xml.py | psmsmets/pyVDMS | cb3db93b655d3a02ae3aa1fdd418ae70dd249271 | [
"MIT"
] | 1 | 2020-04-22T14:38:23.000Z | 2020-04-22T14:38:23.000Z | pyvdms/util/xml.py | psmsmets/PyVDMS | cb3db93b655d3a02ae3aa1fdd418ae70dd249271 | [
"MIT"
] | null | null | null | pyvdms/util/xml.py | psmsmets/PyVDMS | cb3db93b655d3a02ae3aa1fdd418ae70dd249271 | [
"MIT"
] | null | null | null | r"""
:mod:`util.xml` -- XML utilities
================================
Some general XML helper utilities.
"""
# Mandatory imports
from xml.dom.minidom import Document
import re
__all__ = ['removeElementByTagName', 'removeElementAttribute']
def removeElementByTagName(xmldoc: Document, tag: str, attr: str = None,
regex: str = None, invert: bool = False):
"""Remove an xml element by its tag name, attribute and values.
"""
if not isinstance(xmldoc, Document):
raise TypeError('Xmldoc should be of type `xml.dom.minidom.Document`.')
nodes = xmldoc.getElementsByTagName(tag)
if attr:
if not isinstance(attr, str):
raise TypeError('Attribute should be of type str!')
regex = regex or '.' # match all
if not isinstance(regex, str):
raise TypeError('Regex should be of type str!')
r = re.compile(regex)
for node in nodes:
if not node.hasAttribute(attr):
continue
if bool(r.match(node.getAttribute(attr))) is invert:
continue
parent = node.parentNode
parent.removeChild(node)
else:
for node in nodes:
parent = node.parentNode
parent.removeChild(node)
def removeElementAttribute(xmldoc: Document, tag: str, attr: str, regex: str,
invert: bool = False):
"""Remove an xml element by its tag name, attribute and values.
"""
if not isinstance(xmldoc, Document):
raise TypeError('Xmldoc should be of type `xml.dom.minidom.Document`')
if not isinstance(attr, str):
raise TypeError('Attribute should be of type str!')
regex = regex or '.' # match all
if not isinstance(regex, str):
raise TypeError('Regex should be of type str!')
r = re.compile(regex)
nodes = xmldoc.getElementsByTagName(tag)
for node in nodes:
if not node.hasAttribute(attr):
continue
if bool(r.match(node.getAttribute(attr))) is invert:
continue
node.removeAttribute(attr)
| 23 | 79 | 0.597943 | 246 | 2,139 | 5.182927 | 0.260163 | 0.031373 | 0.070588 | 0.065882 | 0.73098 | 0.73098 | 0.624314 | 0.624314 | 0.624314 | 0.624314 | 0 | 0 | 0.29266 | 2,139 | 92 | 80 | 23.25 | 0.842697 | 0.127162 | 0 | 0.704545 | 0 | 0 | 0.145799 | 0.052575 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045455 | false | 0 | 0.045455 | 0 | 0.090909 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
57a0f952999bae69f528c36eebb0e9578fb28d08 | 600 | py | Python | projects/DensePose/densepose/layers/__init__.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/layers/__init__.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/layers/__init__.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | from .deform_conv import DFConv2d, DeformBottleneckBlock
from .ml_nms import ml_nms
from .iou_loss import IOULoss
from .conv_with_kaiming_uniform import conv_with_kaiming_uniform
from .bezier_align import BezierAlign
from .def_roi_align import DefROIAlign
from .naive_group_norm import NaiveGroupNorm
from .gcn import GCN
from .partialconv2d import PartialConv2d
from .sparse_conv_with_kaiming_uniform import sparse_conv_with_kaiming_uniform
from .san_block import SAN_BottleneckGN, SAN_BottleneckGN_GatedEarly, SAN_BottleneckGN_Gated
__all__ = [k for k in globals().keys() if not k.startswith("_")] | 46.153846 | 92 | 0.86 | 87 | 600 | 5.54023 | 0.471264 | 0.06639 | 0.124481 | 0.182573 | 0.248963 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005525 | 0.095 | 600 | 13 | 93 | 46.153846 | 0.882136 | 0 | 0 | 0 | 0 | 0 | 0.001664 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.916667 | 0 | 0.916667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
57a4ddc02fe3bbb4d30e322bea95f8497405a8ef | 911 | py | Python | conanfile.py | aversiveplusplus/aversiveplusplus | 5f5fe9faca50197fd6207e2c816efa7e9af6c804 | [
"BSD-3-Clause"
] | 29 | 2016-01-27T09:43:44.000Z | 2020-03-12T04:16:02.000Z | conanfile.py | aversiveplusplus/aversiveplusplus | 5f5fe9faca50197fd6207e2c816efa7e9af6c804 | [
"BSD-3-Clause"
] | 20 | 2016-01-22T15:59:33.000Z | 2016-10-28T10:22:45.000Z | conanfile.py | aversiveplusplus/aversiveplusplus | 5f5fe9faca50197fd6207e2c816efa7e9af6c804 | [
"BSD-3-Clause"
] | 6 | 2016-02-11T14:09:04.000Z | 2018-03-17T00:18:35.000Z | from conans import ConanFile, CMake, Embedded
class AversivePlusPlusModuleConan(ConanFile):
name = "AversivePlusPlus"
version = "0.1"
settings = "target"
requires = "base/0.1@AversivePlusPlus/dev", "device-2wheel/0.1@AversivePlusPlus/dev", "feetech/0.1@AversivePlusPlus/dev", "stream/0.1@AversivePlusPlus/dev", "container/0.1@AversivePlusPlus/dev", "device-control/0.1@AversivePlusPlus/dev", "filter/0.1@AversivePlusPlus/dev", "device/0.1@AversivePlusPlus/dev", "toolchain-switch/0.1@AversivePlusPlus/dev"
def config(self):
if self.settings.target == "native":
self.requires("sasiae/0.1@AversivePlusPlus/dev")
else:
embed = Embedded(self.settings)
if self.settings.target == "board":
if self.settings.target.board in ["arduino_uno", "arduino_mega"]:
self.requires("arduino/0.1@AversivePlusPlus/dev")
| 50.611111 | 355 | 0.679473 | 107 | 911 | 5.766355 | 0.373832 | 0.038898 | 0.320908 | 0.374392 | 0.212318 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033289 | 0.175631 | 911 | 17 | 356 | 53.588235 | 0.788282 | 0 | 0 | 0 | 0 | 0 | 0.47033 | 0.405495 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.071429 | 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 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
57b3150cb50ff0e521f25209297507fb2f54f66e | 7,430 | py | Python | pycatia/hybrid_shape_interfaces/hybrid_shape_axis_to_axis.py | evereux/catia_python | 08948585899b12587b0415ce3c9191a408b34897 | [
"MIT"
] | 90 | 2019-02-21T10:05:28.000Z | 2022-03-19T01:53:41.000Z | pycatia/hybrid_shape_interfaces/hybrid_shape_axis_to_axis.py | Luanee/pycatia | ea5eef8178f73de12404561c00baf7a7ca30da59 | [
"MIT"
] | 99 | 2019-05-21T08:29:12.000Z | 2022-03-25T09:55:15.000Z | pycatia/hybrid_shape_interfaces/hybrid_shape_axis_to_axis.py | Luanee/pycatia | ea5eef8178f73de12404561c00baf7a7ca30da59 | [
"MIT"
] | 26 | 2019-04-04T06:31:36.000Z | 2022-03-30T07:24:47.000Z | #! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-07-06 14:02:20.222384
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript functions work
and thus help debugging in pycatia.
"""
from pycatia.in_interfaces.reference import Reference
from pycatia.mec_mod_interfaces.hybrid_shape import HybridShape
class HybridShapeAxisToAxis(HybridShape):
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| System.IUnknown
| System.IDispatch
| System.CATBaseUnknown
| System.CATBaseDispatch
| System.AnyObject
| MecModInterfaces.HybridShape
| HybridShapeAxisToAxis
|
| Represents the hybrid shape axis to axis transformation feature
| object.
| Role: To access the data of the axis to axis transformation shape feature
| object. The data includes:
|
| The element to be transformed
| The reference axis system
| The target axis system
|
| LICENSING INFORMATION: Creation of volume result requires GSO
| License
| if GSO License is not granted , setting of Volume context has not
| effect
| Use the CATIAHybridShapeFactory to create HybridShapeFeature
| object.
|
| See also:
| HybridShapeFactory
"""
def __init__(self, com_object):
super().__init__(com_object)
self.hybrid_shape_axis_to_axis = com_object
@property
def creation_mode(self) -> bool:
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| o Property CreationMode() As boolean
|
| Returns or sets the creation mode(creation or
| modification).
| Legal values: True if the result is a creation feature and False if the
| result is a modification feature.
|
| Example:
|
| This example sets that the mode of
| the hybShpAxisToAxis hybrid shape axis to axis to
| creation
|
|
| hybShpAxisToAxis.CreationMode = True
:return: bool
:rtype: bool
"""
return self.hybrid_shape_axis_to_axis.CreationMode
@creation_mode.setter
def creation_mode(self, value: bool):
"""
:param bool value:
"""
self.hybrid_shape_axis_to_axis.CreationMode = value
@property
def elem_to_transform(self) -> Reference:
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| o Property ElemToTransform() As Reference
|
| Returns or sets the element to transform.
|
| Example:
| This example retrieves in Elem the element to transform for the
| AxisToAxis hybrid shape feature.
|
| Dim Elem As Reference
| Set Elem = AxisToAxis.ElemToTransform
:return: Reference
:rtype: Reference
"""
return Reference(self.hybrid_shape_axis_to_axis.ElemToTransform)
@elem_to_transform.setter
def elem_to_transform(self, value: Reference):
"""
:param Reference value:
"""
self.hybrid_shape_axis_to_axis.ElemToTransform = value.com_object
@property
def reference_axis(self) -> Reference:
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| o Property ReferenceAxis() As Reference
|
| Returns or sets the reference axis.
|
| Example:
| This example retrieves in Ref the reference axis for the AxisToAxis
| hybrid shape feature.
|
| Dim Ref As Reference
| Set Ref = AxisToAxis.ReferenceAxis
:return: Reference
:rtype: Reference
"""
return Reference(self.hybrid_shape_axis_to_axis.ReferenceAxis)
@reference_axis.setter
def reference_axis(self, value: Reference):
"""
:param Reference value:
"""
self.hybrid_shape_axis_to_axis.ReferenceAxis = value.com_object
@property
def target_axis(self) -> Reference:
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| o Property TargetAxis() As Reference
|
| Returns or sets the target axis.
|
| Example:
| This example retrieves in Ref the target axis for the AxisToAxis hybrid
| shape feature.
|
| Dim Ref As Reference
| Set Ref = AxisToAxis.ReferenceAxis
:return: Reference
:rtype: Reference
"""
return Reference(self.hybrid_shape_axis_to_axis.TargetAxis)
@target_axis.setter
def target_axis(self, value: Reference):
"""
:param Reference value:
"""
self.hybrid_shape_axis_to_axis.TargetAxis = value.com_object
@property
def volume_result(self) -> bool:
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| o Property VolumeResult() As boolean
|
| Returns or sets the volume result.
| Legal values: True if the result of axis to axis transformation is required
| as volume (option is effective only in case of volumes,requires GSO License))
| and False if it is needed as surface .
|
| Example:
|
| This example sets that the result of
| the hybShpAxisToAxis hybrid shape AxisToAxis is
| volume.
|
|
| hybShpAxisToAxis.VolumeResult = True
:return: bool
:rtype: bool
"""
return self.hybrid_shape_axis_to_axis.VolumeResult
@volume_result.setter
def volume_result(self, value: bool):
"""
:param bool value:
"""
self.hybrid_shape_axis_to_axis.VolumeResult = value
def __repr__(self):
return f'HybridShapeAxisToAxis(name="{self.name}")'
| 32.587719 | 108 | 0.509152 | 702 | 7,430 | 5.269231 | 0.222222 | 0.053528 | 0.040552 | 0.059746 | 0.545012 | 0.471479 | 0.399567 | 0.350635 | 0.329549 | 0.329549 | 0 | 0.035949 | 0.427187 | 7,430 | 227 | 109 | 32.731278 | 0.833177 | 0.604307 | 0 | 0.131579 | 1 | 0 | 0.022905 | 0.022905 | 0 | 0 | 0 | 0 | 0 | 1 | 0.315789 | false | 0 | 0.052632 | 0.026316 | 0.552632 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
57baf41eb7d36e85d20dbe081fa9476cfd98e8f7 | 1,208 | py | Python | ansible/playbooks/roles/repository/files/download-requirements/tests/command/test_rpm.py | cicharka/epiphany | 8f7ac8916ba32919629c792cc7bdb9156d4295d7 | [
"Apache-2.0"
] | 2 | 2019-02-12T14:02:33.000Z | 2019-07-16T08:44:24.000Z | ansible/playbooks/roles/repository/files/download-requirements/tests/command/test_rpm.py | cicharka/epiphany | 8f7ac8916ba32919629c792cc7bdb9156d4295d7 | [
"Apache-2.0"
] | null | null | null | ansible/playbooks/roles/repository/files/download-requirements/tests/command/test_rpm.py | cicharka/epiphany | 8f7ac8916ba32919629c792cc7bdb9156d4295d7 | [
"Apache-2.0"
] | null | null | null | from tests.mocks.command_run_mock import CommandRunMock
from src.command.rpm import Rpm
def test_interface_is_package_installed(mocker):
''' Check argument construction for `rpm --query` '''
with CommandRunMock(mocker, Rpm(1).is_package_installed, {'package': 'vim'}) as call_args:
assert call_args == ['rpm', '--query', '--quiet', 'vim']
def test_interface_import_key(mocker):
''' Check argument construction for `rpm --import` '''
with CommandRunMock(mocker, Rpm(1).import_key, {'key': 'some_key'}) as call_args:
assert call_args == ['rpm', '--import', 'some_key']
def test_interface_get_package_capabilities(mocker):
''' Check argument construction for `rpm -q --provides` '''
with CommandRunMock(mocker, Rpm(1).get_package_capabilities, {'filename': 'some_file'}) as call_args:
assert call_args == ['rpm', '-q', '--provides', 'some_file']
def test_interface_which_packages_provides_file(mocker):
''' Check argument construction for `rpm -q --whatprovides` '''
with CommandRunMock(mocker, Rpm(1).which_packages_provides_file, {'filename': 'some_file'}) as call_args:
assert call_args == ['rpm', '-q', '--whatprovides', 'some_file']
| 43.142857 | 109 | 0.697848 | 153 | 1,208 | 5.248366 | 0.267974 | 0.079701 | 0.079701 | 0.154421 | 0.503113 | 0.363636 | 0.271482 | 0.109589 | 0.109589 | 0.109589 | 0 | 0.003884 | 0.147351 | 1,208 | 27 | 110 | 44.740741 | 0.775728 | 0.168046 | 0 | 0 | 0 | 0 | 0.149132 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.285714 | false | 0 | 0.357143 | 0 | 0.642857 | 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 |
57c6572e5e8ffe77423060111e9c5e3396a94b8e | 368 | py | Python | deuterium/detection/Detector.py | TheMab/Deuterium | bdd493af883b825276b4127f195ff24c52a9dc7e | [
"BSD-3-Clause"
] | 1 | 2019-01-21T07:06:46.000Z | 2019-01-21T07:06:46.000Z | deuterium/detection/Detector.py | TheMab/Deuterium | bdd493af883b825276b4127f195ff24c52a9dc7e | [
"BSD-3-Clause"
] | null | null | null | deuterium/detection/Detector.py | TheMab/Deuterium | bdd493af883b825276b4127f195ff24c52a9dc7e | [
"BSD-3-Clause"
] | null | null | null |
class Detector(object):
"""detection algorithm to be implemented by sub class
input parameters: self and frame to be worked with
Must return frame after being processed and radius"""
def __init__(self):
"""init function"""
pass
def detection_algo(self, frame):
"""To be implemented by subclass"""
pass
| 21.647059 | 57 | 0.630435 | 45 | 368 | 5.044444 | 0.644444 | 0.052863 | 0.132159 | 0.14978 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.290761 | 368 | 16 | 58 | 23 | 0.869732 | 0.532609 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0.4 | 0 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
57d9031e8bf7340e1fba57689814314d857054c3 | 796 | py | Python | setup.py | Hamuko/Sopu | 4783fde890bb48262ed2152b5c09362427d65500 | [
"Apache-2.0"
] | 4 | 2016-10-25T15:15:09.000Z | 2018-03-02T21:53:56.000Z | setup.py | Hamuko/Sopu | 4783fde890bb48262ed2152b5c09362427d65500 | [
"Apache-2.0"
] | null | null | null | setup.py | Hamuko/Sopu | 4783fde890bb48262ed2152b5c09362427d65500 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='Sopu',
version=0.0,
description='Unofficial Syncplay client',
url='https://github.com/Hamuko/Sopu',
author='Hamuko',
author_email='hamuko@burakku.com',
license='Apache2',
classifiers=[
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
packages=find_packages(),
install_requires=[
'click',
'Twisted'
],
entry_points={
'console_scripts': ['sopu=sopu.cli:main'],
}
)
| 26.533333 | 61 | 0.594221 | 79 | 796 | 5.911392 | 0.64557 | 0.162741 | 0.214133 | 0.222698 | 0.115632 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01692 | 0.257538 | 796 | 29 | 62 | 27.448276 | 0.773266 | 0 | 0 | 0.074074 | 0 | 0 | 0.492462 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.037037 | 0 | 0.037037 | 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 |
57e88cd3cd3253f547e604488ab7dc927f05c44b | 102 | py | Python | src/rpdk/core/__init__.py | priyap286/cloudformation-cli | 9462cdb75bdb3c6cfa3e33937bca5f08d8caeb48 | [
"Apache-2.0"
] | null | null | null | src/rpdk/core/__init__.py | priyap286/cloudformation-cli | 9462cdb75bdb3c6cfa3e33937bca5f08d8caeb48 | [
"Apache-2.0"
] | null | null | null | src/rpdk/core/__init__.py | priyap286/cloudformation-cli | 9462cdb75bdb3c6cfa3e33937bca5f08d8caeb48 | [
"Apache-2.0"
] | null | null | null | import logging
__version__ = "0.2.21"
logging.getLogger(__name__).addHandler(logging.NullHandler())
| 17 | 61 | 0.784314 | 12 | 102 | 6 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042553 | 0.078431 | 102 | 5 | 62 | 20.4 | 0.723404 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 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 |
57f595ce77bc512ce55492001fa7073006077482 | 225 | py | Python | EvenFibonacci/fib.py | amiritoo/EulerProjects | b2213d455fa3cd49cde620d22f27a9fc266f132d | [
"MIT"
] | 1 | 2020-09-16T10:33:06.000Z | 2020-09-16T10:33:06.000Z | EvenFibonacci/fib.py | amiritoo/EulerProjects | b2213d455fa3cd49cde620d22f27a9fc266f132d | [
"MIT"
] | null | null | null | EvenFibonacci/fib.py | amiritoo/EulerProjects | b2213d455fa3cd49cde620d22f27a9fc266f132d | [
"MIT"
] | null | null | null | first_number= 1
sec_number= 2
sum= 0
while (first_number < 4000000):
new= first_number + sec_number
first_number= sec_number
sec_number= new
if(first_number % 2== 0):
sum= sum+first_number
print(sum)
| 18.75 | 34 | 0.684444 | 35 | 225 | 4.114286 | 0.342857 | 0.458333 | 0.3125 | 0.277778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.068571 | 0.222222 | 225 | 11 | 35 | 20.454545 | 0.754286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.1 | 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 |
57f95fb63d51d8fc5963944d660a1a8d6c1dccbc | 560 | py | Python | position.py | Sheshkon/CubeRecognition | 0d65831a9c43ce7231f8758bf57a75f49ea2aca2 | [
"MIT"
] | 2 | 2022-02-15T09:15:43.000Z | 2022-02-18T07:39:32.000Z | position.py | Sheshkon/CubeRecognition | 0d65831a9c43ce7231f8758bf57a75f49ea2aca2 | [
"MIT"
] | null | null | null | position.py | Sheshkon/CubeRecognition | 0d65831a9c43ce7231f8758bf57a75f49ea2aca2 | [
"MIT"
] | null | null | null | start_position = {
(1, 2): "y", (1, 3): "", (1, 5): "y'", (1, 6): "y2",
(2, 1): "z' y'", (2, 3): "z'", (2, 4): "z' y", (2, 6): "z' y2",
(3, 1): "x y2", (3, 2): "x y", (3, 4): "x", (3, 5): "x y'",
(4, 2): "z2 y'", (4, 3): "z2", (4, 5): "z2 y", (4, 6): "x2",
(5, 1): "z y", (5, 3): "z", (5, 4): "z y'", (5, 6): "z y2",
(6, 1): "x'", (6, 2): "x' y", (6, 4): "x' y2", (6, 5): "x' y'"
}
sorted_sides = [3, 5, 6, 2, 1, 4]
scramble_board_position = {
5: (1, 0),
4: (2, 1),
1: (1, 1),
6: (1, 2),
2: (0, 1),
3: (3, 1)
} | 29.473684 | 67 | 0.298214 | 116 | 560 | 1.405172 | 0.163793 | 0.04908 | 0.03681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.207161 | 0.301786 | 560 | 19 | 68 | 29.473684 | 0.209719 | 0 | 0 | 0 | 0 | 0 | 0.131907 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
17b3cfc984e8bff5a5d9a275052ce6f4c3e2b56a | 450 | py | Python | solution/v3/core/Host.py | mjastad/automation | f84742dc044954484679243fc51bd5eb2c660d44 | [
"CC-BY-3.0"
] | 1 | 2020-01-01T22:28:00.000Z | 2020-01-01T22:28:00.000Z | solution/v3/core/Host.py | mjastad/automation | f84742dc044954484679243fc51bd5eb2c660d44 | [
"CC-BY-3.0"
] | null | null | null | solution/v3/core/Host.py | mjastad/automation | f84742dc044954484679243fc51bd5eb2c660d44 | [
"CC-BY-3.0"
] | 4 | 2018-01-23T15:09:04.000Z | 2020-02-11T20:15:34.000Z | from Service import Service
class Host:
def __init__(self, ip, port):
self.ip_address = ip
self.port_address = port
self.service = Service()
@property
def port(self):
return self.port_address
@property
def ip(self):
return self.ip_address
def service(self):
return self.service
@property
def url(self):
return "https://%s:%s%s" % (self.ip, self.port, self.service.name)
| 18 | 73 | 0.617778 | 60 | 450 | 4.5 | 0.283333 | 0.088889 | 0.155556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.271111 | 450 | 24 | 74 | 18.75 | 0.823171 | 0 | 0 | 0.176471 | 0 | 0 | 0.033333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.058824 | 0.235294 | 0.647059 | 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 |
17bdb3cd028e688b5cec1e58e733670833a9ac32 | 186 | py | Python | airflow_dbt_python/__version__.py | marcusintrohive/airflow-dbt-python | d6b8e9e091965ee2319ecc0009f2e2dc00d27819 | [
"MIT"
] | 37 | 2021-06-15T23:23:28.000Z | 2022-03-22T08:16:49.000Z | airflow_dbt_python/__version__.py | marcusintrohive/airflow-dbt-python | d6b8e9e091965ee2319ecc0009f2e2dc00d27819 | [
"MIT"
] | 29 | 2021-06-01T21:03:39.000Z | 2022-03-12T15:09:33.000Z | airflow_dbt_python/__version__.py | marcusintrohive/airflow-dbt-python | d6b8e9e091965ee2319ecc0009f2e2dc00d27819 | [
"MIT"
] | 5 | 2021-08-04T08:48:31.000Z | 2022-02-07T19:14:56.000Z | """The module's version information."""
__author__ = "Tomás Farías Santana"
__copyright__ = "Copyright 2021 Tomás Farías Santana"
__title__ = "airflow-dbt-python"
__version__ = "0.11.0"
| 31 | 53 | 0.752688 | 23 | 186 | 5.391304 | 0.73913 | 0.177419 | 0.290323 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04878 | 0.11828 | 186 | 5 | 54 | 37.2 | 0.707317 | 0.177419 | 0 | 0 | 0 | 0 | 0.537415 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
17d76541ffabae5b9b86a394719fa668d33d57b8 | 135 | py | Python | scripts/deploy_ex1.py | isunyoo/NFT_Init1 | 46375adee96442b49f38eb03fab1adc93c2da6c5 | [
"MIT"
] | null | null | null | scripts/deploy_ex1.py | isunyoo/NFT_Init1 | 46375adee96442b49f38eb03fab1adc93c2da6c5 | [
"MIT"
] | null | null | null | scripts/deploy_ex1.py | isunyoo/NFT_Init1 | 46375adee96442b49f38eb03fab1adc93c2da6c5 | [
"MIT"
] | null | null | null | from brownie import Contrat1, accounts
def main():
compte = accounts.load('MY_ACCOUNT1')
t = Contrat1.deploy({'from': compte}) | 27 | 41 | 0.696296 | 17 | 135 | 5.470588 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026549 | 0.162963 | 135 | 5 | 42 | 27 | 0.79646 | 0 | 0 | 0 | 0 | 0 | 0.110294 | 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 |
17e7cbd431346e117b31a127d67024a4afe0b8cf | 276 | py | Python | build/lib/agrimetscraper/utils/mongoDB.py | lixiaopi1985/agrimet_scraper | eb566d2bbb6f1882656a1bc5319e9f35ad7dc5df | [
"MIT"
] | null | null | null | build/lib/agrimetscraper/utils/mongoDB.py | lixiaopi1985/agrimet_scraper | eb566d2bbb6f1882656a1bc5319e9f35ad7dc5df | [
"MIT"
] | null | null | null | build/lib/agrimetscraper/utils/mongoDB.py | lixiaopi1985/agrimet_scraper | eb566d2bbb6f1882656a1bc5319e9f35ad7dc5df | [
"MIT"
] | null | null | null | from pymongo import MongoClient
def get_db(dbname, connect_string, port=27017):
if connect_string != r"localhost":
client = MongoClient(connect_string)
else:
client = MongoClient(connect_string, port)
db = client[dbname]
return db, client
| 19.714286 | 50 | 0.688406 | 33 | 276 | 5.606061 | 0.545455 | 0.281081 | 0.183784 | 0.324324 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023474 | 0.228261 | 276 | 13 | 51 | 21.230769 | 0.84507 | 0 | 0 | 0 | 0 | 0 | 0.032847 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0 | 0.375 | 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 |
17ffca2af57ebc105e9465bf86d3dba304516d9b | 226 | py | Python | __init__.py | RuijieYu/algo | 280d3711ef87af900276dfc24b842c5f2acc47f0 | [
"MIT"
] | null | null | null | __init__.py | RuijieYu/algo | 280d3711ef87af900276dfc24b842c5f2acc47f0 | [
"MIT"
] | 1 | 2019-06-10T15:37:01.000Z | 2019-06-10T15:37:01.000Z | __init__.py | JAMESY9868/algo | 280d3711ef87af900276dfc24b842c5f2acc47f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env -S python3 #-i
'''
This package supplies with some algorithms to be reused in
other projects.
'''
from . import shared;
from . import data;
from . import funcs;
from . import iters;
from . import sort;
| 18.833333 | 62 | 0.681416 | 33 | 226 | 4.666667 | 0.757576 | 0.324675 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005587 | 0.207965 | 226 | 11 | 63 | 20.545455 | 0.854749 | 0.451327 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
aa31b3cd871b444e4fb5dad0b23aa60882d12b1f | 385 | py | Python | app/conf/production_settings.py | fufuok/FF.PyAdmin | 031fcafe70ecb78488876d0c61e30ca4fb4290af | [
"MIT"
] | 56 | 2019-11-26T15:42:29.000Z | 2022-03-10T12:28:07.000Z | app/conf/production_settings.py | fufuok/FF.PyAdmin | 031fcafe70ecb78488876d0c61e30ca4fb4290af | [
"MIT"
] | 4 | 2020-03-20T01:51:47.000Z | 2022-03-30T22:10:56.000Z | app/conf/production_settings.py | fufuok/FF.PyAdmin | 031fcafe70ecb78488876d0c61e30ca4fb4290af | [
"MIT"
] | 15 | 2019-11-26T15:42:33.000Z | 2022-03-09T05:41:44.000Z | """
production_settings.py
~~~~~~~~
生产环境配置项(高优先级)
先根据配置文件需要, 设置环境变量:
e.g.::
cp scripts/etc-profile.d-ffpyadmin.sh /etc/profile.d/ffpyadmin.sh
chmod +x /etc/profile.d/ffpyadmin.sh
source /etc/profile.d/ffpyadmin.sh
:author: Fufu, 2019/9/2
"""
##########
# CORE
##########
# 根据需求, 指定正式环境的域名和端口
SERVER_NAME = 'pyadmin.xunyou.com:777'
| 16.73913 | 73 | 0.581818 | 48 | 385 | 4.625 | 0.6875 | 0.18018 | 0.198198 | 0.36036 | 0.396396 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029801 | 0.215584 | 385 | 22 | 74 | 17.5 | 0.705298 | 0.711688 | 0 | 0 | 0 | 0 | 0.478261 | 0.478261 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
aa383d8dfe37afba53502d686d6d12cc13dd1e00 | 236 | py | Python | api/runtime_nochalice/helpers.py | viniciusao/awscdk-demo | 483ea234dc2d8a1bc24b938776f176323bc22060 | [
"MIT"
] | 1 | 2022-01-07T21:54:38.000Z | 2022-01-07T21:54:38.000Z | api/runtime_nochalice/helpers.py | viniciusao/awscdk-demo | 483ea234dc2d8a1bc24b938776f176323bc22060 | [
"MIT"
] | null | null | null | api/runtime_nochalice/helpers.py | viniciusao/awscdk-demo | 483ea234dc2d8a1bc24b938776f176323bc22060 | [
"MIT"
] | null | null | null | import os
import chars
def init_chars_repository() -> chars.CharsRepository:
dynamodb_database = chars.DynamoDBDatabase(
os.environ["DYNAMODB_TABLE_NAME"]
)
return chars.CharsRepository(database=dynamodb_database) | 23.6 | 60 | 0.762712 | 25 | 236 | 6.96 | 0.56 | 0.229885 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15678 | 236 | 10 | 60 | 23.6 | 0.874372 | 0 | 0 | 0 | 0 | 0 | 0.080169 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
aa473f81514aea65f815042cb5b6cf8cfabcea98 | 1,182 | py | Python | milksets/vtypes.py | luispedro/milksets | 84fc8cba4d4a87acf573ce562cd065b0ee37fadd | [
"MIT"
] | 7 | 2015-05-15T19:49:25.000Z | 2021-02-04T10:18:15.000Z | milksets/vtypes.py | luispedro/milksets | 84fc8cba4d4a87acf573ce562cd065b0ee37fadd | [
"MIT"
] | null | null | null | milksets/vtypes.py | luispedro/milksets | 84fc8cba4d4a87acf573ce562cd065b0ee37fadd | [
"MIT"
] | 2 | 2021-02-04T10:18:17.000Z | 2021-04-20T02:26:38.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2010, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
# Software Distributed under the MIT License
'''
Value types: An hierarchy of value types.
Hierarchy:
vtype
|- numeric
| |-ordinal
| | |- ordinalrange
| | - boolean
| | - integer
| -continuous
- categorical
- boolean
'''
class vtype(object):
def __init__(self,name):
self.name = name
class numeric(vtype):
def __init__(self,name):
vtype.__init__(self,name)
class continuous(numeric):
def __init__(self,name):
vtype.__init__(self,name)
class ordinal(numeric):
def __init__(self,name):
vtype.__init__(self,name)
class ordinalrange(ordinal):
def __init__(self,name,max,min):
ordinal.__init__(self,name)
self.max = max
self.min = min
class integer(ordinal):
pass
class categorical(vtype):
def __init__(self,name, categories):
vtype.__init__(self,name)
self.categories = categories
class boolean(categorical, ordinal):
def __init__(self,name):
vtype.__init__(self,name)
| 20.37931 | 65 | 0.63621 | 139 | 1,182 | 5.035971 | 0.352518 | 0.16 | 0.222857 | 0.15 | 0.301429 | 0.224286 | 0.224286 | 0.224286 | 0.178571 | 0.125714 | 0 | 0.013438 | 0.244501 | 1,182 | 57 | 66 | 20.736842 | 0.770437 | 0.336717 | 0 | 0.384615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0.038462 | 0 | 0 | 0.576923 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a4b458bb9dc5f8e2a8edf9784b482889ca84cbad | 143 | py | Python | votion/main.py | weastur/votion | 7a5d7beb06b27ad089b7f39796b327de66e4e027 | [
"MIT"
] | null | null | null | votion/main.py | weastur/votion | 7a5d7beb06b27ad089b7f39796b327de66e4e027 | [
"MIT"
] | 1 | 2020-04-25T20:41:10.000Z | 2020-04-25T20:41:10.000Z | votion/main.py | weastur/votion | 7a5d7beb06b27ad089b7f39796b327de66e4e027 | [
"MIT"
] | 3 | 2020-04-25T20:38:30.000Z | 2020-07-11T15:58:28.000Z | """Module entrypoint."""
def main() -> None:
"""Execute package entrypoint."""
print("Test")
if __name__ == "__main__":
main()
| 13 | 37 | 0.573427 | 14 | 143 | 5.285714 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216783 | 143 | 10 | 38 | 14.3 | 0.660714 | 0.321678 | 0 | 0 | 0 | 0 | 0.139535 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a4d85b37794d2ca43ee5a05dbb9137bc48807448 | 801 | py | Python | qcloudsdkiothub/CreateTopicRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkiothub/CreateTopicRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkiothub/CreateTopicRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class CreateTopicRequest(Request):
def __init__(self):
super(CreateTopicRequest, self).__init__(
'iothub', 'qcloudcliV1', 'CreateTopic', 'iothub.api.qcloud.com')
def get_action_name(self):
return self.get_params().get('action_name')
def set_action_name(self, action_name):
self.add_param('action_name', action_name)
def get_privilege(self):
return self.get_params().get('privilege')
def set_privilege(self, privilege):
self.add_param('privilege', privilege)
def get_thingtype_name(self):
return self.get_params().get('thingtype_name')
def set_thingtype_name(self, thingtype_name):
self.add_param('thingtype_name', thingtype_name)
| 28.607143 | 76 | 0.68789 | 97 | 801 | 5.350515 | 0.298969 | 0.115607 | 0.080925 | 0.098266 | 0.165703 | 0.165703 | 0.115607 | 0 | 0 | 0 | 0 | 0.003077 | 0.188514 | 801 | 27 | 77 | 29.666667 | 0.795385 | 0.026217 | 0 | 0 | 0 | 0 | 0.150386 | 0.026992 | 0 | 0 | 0 | 0 | 0 | 1 | 0.411765 | false | 0 | 0.058824 | 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 |
a4fe729b0f3ef416f52a0b7ba8b1e7d53d42a09b | 121 | py | Python | automatedtest_backend/autotest_service/celery_task/test.py | zhousheng0325/AutomationPlatform | e7e41e4a26c63fc8151b191bccb0f4a412a3388d | [
"MIT"
] | null | null | null | automatedtest_backend/autotest_service/celery_task/test.py | zhousheng0325/AutomationPlatform | e7e41e4a26c63fc8151b191bccb0f4a412a3388d | [
"MIT"
] | 10 | 2020-06-06T01:30:29.000Z | 2022-03-12T00:16:52.000Z | automatedtest_backend/autotest_service/celery_task/test.py | zhousheng0325/AutomationPlatform | e7e41e4a26c63fc8151b191bccb0f4a412a3388d | [
"MIT"
] | null | null | null | from celery_task.autotask import tasks
def test():
tasks.add.delay(1)
if __name__ == '__main__':
test()
| 15.125 | 39 | 0.636364 | 16 | 121 | 4.25 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.239669 | 121 | 7 | 40 | 17.285714 | 0.728261 | 0 | 0 | 0 | 0 | 0 | 0.070175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.2 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3512e1b5dbbf13a149d3bc09583bfb2494224f2a | 222 | py | Python | src/wai/spectralio/foss/_ConstituentValues.py | waikato-datamining/wai-spectral-io | a0edba2208b0b646ed54782cb0832ce10eed0d5e | [
"MIT"
] | null | null | null | src/wai/spectralio/foss/_ConstituentValues.py | waikato-datamining/wai-spectral-io | a0edba2208b0b646ed54782cb0832ce10eed0d5e | [
"MIT"
] | 3 | 2020-07-01T01:54:03.000Z | 2020-12-02T07:47:30.000Z | src/wai/spectralio/foss/_ConstituentValues.py | waikato-datamining/wai-spectral-io | a0edba2208b0b646ed54782cb0832ce10eed0d5e | [
"MIT"
] | null | null | null | from typing import List
from ..api import LoggingObject
class ConstituentValues(LoggingObject):
"""
Constituent (or reference) values.
"""
def __init__(self):
self.constituents: List[float] = []
| 18.5 | 43 | 0.671171 | 22 | 222 | 6.590909 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.220721 | 222 | 11 | 44 | 20.181818 | 0.83815 | 0.153153 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 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 |
3513328bd241641224498d275aacdb263c4287fa | 2,712 | py | Python | tseries_patterns/common/utils/Comparisons.py | tr8dr/patterns | 757a0b9d4936a0c6af633af6f16c0ca8ee676bb0 | [
"MIT"
] | 127 | 2020-07-12T21:48:20.000Z | 2022-03-27T21:12:26.000Z | tseries_patterns/common/utils/Comparisons.py | tr8dr/patterns | 757a0b9d4936a0c6af633af6f16c0ca8ee676bb0 | [
"MIT"
] | 11 | 2020-08-08T05:17:16.000Z | 2022-02-23T13:29:23.000Z | tseries_patterns/common/utils/Comparisons.py | tr8dr/patterns | 757a0b9d4936a0c6af633af6f16c0ca8ee676bb0 | [
"MIT"
] | 46 | 2020-07-22T20:50:55.000Z | 2021-12-16T00:57:50.000Z | #
# MIT License
#
# Copyright (c) 2020 Jonathan Shore
#
# 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.
#
import numpy as np
def isZero (v: float, eps=1e-7):
return abs(v) < eps
def EQ (a: float, b: float, eps=1e-7):
return abs(a-b) < eps
def GT (a: float, b: float, eps=1e-7):
return (a-b) > eps
def GE (a: float, b: float, eps=1e-7):
return (a-b) > -eps
def LT (a: float, b: float, eps=1e-7):
return (a-b) < -eps
def LE (a: float, b: float, eps=1e-7):
return (a-b) < eps
def vbetween (vec, a: float, b: float):
return np.logical_and (vec >= a, vec <= b)
def vBetween (vec, a: float, b: float):
return np.logical_and (vec >= a, vec <= b)
def vAnd (vecA, vecB):
return np.logical_and (vecA, vecB)
def vOr (vecA, vecB):
return np.logical_or (vecA, vecB)
def vLE (vec, v: float):
return (vec <= v)
def vGE (vec, v: float):
return (vec >= v)
def constrain(x, xmin, xmax):
"""
Constrain a value x between [xmin,xmax]
"""
if x < xmin:
return xmin
else:
return min(x, xmax)
def frange(start: float, end: float, incr: float):
"""
float range
"""
eps = incr / 100
while (end - start) > -eps:
yield start
start += incr
def rotate(l,n):
"""
Rotate a list
:param l: list to be rotated
:param n: the rotation amount (+ shifts right and - shifts left)
"""
return l[-n:] + l[:-n]
def ifelse (pred:bool, cons, alt):
"""
If predicate consequent else alternative
"""
if pred:
return cons
else:
return alt
def OR (v, default):
"""
return value unless is None
"""
return v if v is not None else default
| 24.654545 | 80 | 0.647493 | 424 | 2,712 | 4.132075 | 0.384434 | 0.050228 | 0.027968 | 0.047945 | 0.210616 | 0.184361 | 0.171233 | 0.146119 | 0.13242 | 0.13242 | 0 | 0.009268 | 0.2441 | 2,712 | 109 | 81 | 24.880734 | 0.845366 | 0.478245 | 0 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.386364 | false | 0 | 0.022727 | 0.272727 | 0.818182 | 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 |
3516b50ff9871faf28629deeaea9e21a0a2a6f93 | 397 | py | Python | src/solutions/part1/q014_longest_common_prefix.py | hychrisli/PyAlgorithms | 71e537180f3b371d0d2cc47b11cb68ec13a8ac68 | [
"Apache-2.0"
] | null | null | null | src/solutions/part1/q014_longest_common_prefix.py | hychrisli/PyAlgorithms | 71e537180f3b371d0d2cc47b11cb68ec13a8ac68 | [
"Apache-2.0"
] | null | null | null | src/solutions/part1/q014_longest_common_prefix.py | hychrisli/PyAlgorithms | 71e537180f3b371d0d2cc47b11cb68ec13a8ac68 | [
"Apache-2.0"
] | null | null | null | from src.base.solution import Solution
class LongestCommonPrefix(Solution):
def print_output(self, output):
pass
def verify_output(self, test_output, output):
pass
def run_test(self, input):
pass
def gen_test_cases(self):
pass
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
| 17.26087 | 49 | 0.596977 | 45 | 397 | 5.133333 | 0.511111 | 0.121212 | 0.112554 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.309824 | 397 | 22 | 50 | 18.045455 | 0.843066 | 0.083123 | 0 | 0.363636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.454545 | false | 0.363636 | 0.090909 | 0 | 0.636364 | 0.090909 | 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 |
351ee41a141819cecb0e618d49825763662443b2 | 204 | py | Python | scripts/008-find-minimum-in-rotated-sorted-array-ii.py | ZhiShiMao/leetcode-python | 8b0573e8c99b59d39f7afaab98d33254d2966e05 | [
"MIT"
] | null | null | null | scripts/008-find-minimum-in-rotated-sorted-array-ii.py | ZhiShiMao/leetcode-python | 8b0573e8c99b59d39f7afaab98d33254d2966e05 | [
"MIT"
] | null | null | null | scripts/008-find-minimum-in-rotated-sorted-array-ii.py | ZhiShiMao/leetcode-python | 8b0573e8c99b59d39f7afaab98d33254d2966e05 | [
"MIT"
] | null | null | null | from typing import List
class Solution:
"""
示例 1:
输入:nums = [1,3,5]
输出:1
示例 2:
输入:nums = [2,2,2,0,1]
输出:0
"""
def findMin(self, nums: List[int]) -> int:
pass | 13.6 | 46 | 0.47549 | 34 | 204 | 2.852941 | 0.588235 | 0.123711 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091603 | 0.357843 | 204 | 15 | 47 | 13.6 | 0.648855 | 0.29902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
353ae095471409d7f2e0c12d3fabfb77b4db43c3 | 531 | py | Python | mhdata/binary/parsers/decrypt.py | nicolas43000/MHWorldData | 64174782e0ec2d31948819e07a1dfc9515cafb78 | [
"MIT"
] | 129 | 2018-05-18T05:06:17.000Z | 2022-03-20T05:37:04.000Z | mhdata/binary/parsers/decrypt.py | nicolas43000/MHWorldData | 64174782e0ec2d31948819e07a1dfc9515cafb78 | [
"MIT"
] | 27 | 2018-05-17T02:34:52.000Z | 2021-06-10T01:01:55.000Z | mhdata/binary/parsers/decrypt.py | nicolas43000/MHWorldData | 64174782e0ec2d31948819e07a1dfc9515cafb78 | [
"MIT"
] | 44 | 2018-06-04T08:12:03.000Z | 2022-03-12T01:20:14.000Z | """
File used to decrypt certain files.
Decryption scheme was learned from the open source QuestDataDump project.
"""
from Crypto.Cipher import Blowfish
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
def endianness_reversal(data):
return b''.join(map(lambda x: x[::-1],chunks(data, 4)))
def CapcomBlowfish(data, key):
cipher = Blowfish.new(key, Blowfish.MODE_ECB)
return endianness_reversal(cipher.decrypt(endianness_reversal(data)))
| 27.947368 | 73 | 0.700565 | 79 | 531 | 4.658228 | 0.620253 | 0.146739 | 0.038043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006803 | 0.169492 | 531 | 18 | 74 | 29.5 | 0.827664 | 0.282486 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.111111 | 0.111111 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
10344da4c00d697a28ddf2148c3d013fb15fae3d | 922 | py | Python | tsanley/common/static.py | ofnote/tsanley | 07fadf2d5611605369efe425802b322db8cfdb71 | [
"Apache-2.0"
] | 39 | 2019-10-09T23:41:08.000Z | 2021-11-22T00:02:48.000Z | tsanley/common/static.py | ofnote/tsanley | 07fadf2d5611605369efe425802b322db8cfdb71 | [
"Apache-2.0"
] | null | null | null | tsanley/common/static.py | ofnote/tsanley | 07fadf2d5611605369efe425802b322db8cfdb71 | [
"Apache-2.0"
] | 2 | 2019-10-25T12:35:56.000Z | 2021-11-22T00:02:50.000Z | from collections import namedtuple
class DVal ():
def __init__(self, shape=None, val=None):
self._shape, self._val = shape, val
@property
def shape(self): return self._shape
@property
def val(self): return self._val
def __repr__(self):
s = f'(shape: {self._shape}, val: {self._val})'
return s
class ArgList (list):
def __init__(self, l):
if isinstance (l, DVal): l = [l]
else:
#print (type(l))
assert isinstance (l, list)
list.__init__(self, l)
def __getitem__(self, key):
return list.__getitem__(self, key)
def __add__(self, x):
if isinstance (x, DVal): x = [x]
assert isinstance(x, (list, ArgList))
x = list.__add__(self,x)
return ArgList(x)
def __repr__(self):
return list.__repr__(self)
RefArg = namedtuple('RefArg', ['ref', 'args'])
| 22.487805 | 55 | 0.570499 | 115 | 922 | 4.173913 | 0.286957 | 0.075 | 0.045833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.299349 | 922 | 40 | 56 | 23.05 | 0.743034 | 0.016269 | 0 | 0.148148 | 0 | 0 | 0.058564 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 1 | 0.296296 | false | 0 | 0.037037 | 0.148148 | 0.555556 | 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 |
1037361ae833bf6fd9f59f63b9cdd61c6b1248b0 | 579 | py | Python | fastapi-master-api/app/api/manual_models/adapter.py | SionAbes/fullstack-porfolio | 6ca74da425a0f6e2d9b65b2aeb8d5452ff1565a9 | [
"MIT"
] | 1 | 2021-12-25T09:19:25.000Z | 2021-12-25T09:19:25.000Z | fastapi-master-api/app/api/manual_models/adapter.py | SionAbes/fullstack-porfolio | 6ca74da425a0f6e2d9b65b2aeb8d5452ff1565a9 | [
"MIT"
] | null | null | null | fastapi-master-api/app/api/manual_models/adapter.py | SionAbes/fullstack-porfolio | 6ca74da425a0f6e2d9b65b2aeb8d5452ff1565a9 | [
"MIT"
] | null | null | null | from typing import Union
from app.api.models.liebherr_lidat_adapter import LiebherrLidatAdapter
from app.api.models.takeuchi_tfm_adapter import TakeuchiTfmAdapter
from app.api.models.volvo_caretrack_adapter import VolvoCaretrackAdapter
from app.api.models.wacker_neuson_kramer_adapter import WackerNeusonKramerAdapter
from pydantic import BaseModel, Field
class Adapter(BaseModel):
__root__: Union[
WackerNeusonKramerAdapter,
TakeuchiTfmAdapter,
VolvoCaretrackAdapter,
LiebherrLidatAdapter,
] = Field(..., discriminator="adapter_name")
| 34.058824 | 81 | 0.804836 | 59 | 579 | 7.661017 | 0.474576 | 0.061947 | 0.088496 | 0.141593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138169 | 579 | 16 | 82 | 36.1875 | 0.905812 | 0 | 0 | 0 | 0 | 0 | 0.020725 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.461538 | 0 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
103c0ee9ebd76a5a6880e85267f070872c6af2d1 | 224 | py | Python | content_g_dictionaries/ex56_similar_objects.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | 3 | 2020-11-28T08:26:54.000Z | 2020-12-23T18:37:37.000Z | content_g_dictionaries/ex56_similar_objects.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | 1 | 2021-02-12T12:17:49.000Z | 2021-02-12T12:17:49.000Z | content_g_dictionaries/ex56_similar_objects.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | null | null | null | favorite_languages = {'jen': 'python', 'sarah': 'c', 'edward': 'ruby', 'phil': 'python',}
for name, language in favorite_languages.items():
print('{} favorite language is {}'.format(name.title(), language.capitalize())) | 56 | 89 | 0.665179 | 26 | 224 | 5.653846 | 0.730769 | 0.231293 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111607 | 224 | 4 | 90 | 56 | 0.738693 | 0 | 0 | 0 | 0 | 0 | 0.271111 | 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 |
104d653c03bea4863014f130889a9b036bc547f0 | 170 | py | Python | CodeForces/A2OJ Ladder/37_318_a_even_odds_final.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | CodeForces/A2OJ Ladder/37_318_a_even_odds_final.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | CodeForces/A2OJ Ladder/37_318_a_even_odds_final.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | # http://codeforces.com/problemset/problem/318/A
n, k = map(int, input().split())
if k <= (n + 1) / 2:
print(k * 2 - 1)
else:
print(int(k - n / 2) * 2)
| 18.888889 | 49 | 0.505882 | 29 | 170 | 2.965517 | 0.62069 | 0.046512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.072581 | 0.270588 | 170 | 8 | 50 | 21.25 | 0.620968 | 0.270588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.4 | 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 |
105f9709d6dd186e2d27f55218211f742e688116 | 578 | py | Python | aiohue/v2/models/bridge_home.py | BenoitAnastay/aiohue | 1f0ce96b1fbfd098c34e4913c1ea3b16437e0c8f | [
"Apache-2.0"
] | null | null | null | aiohue/v2/models/bridge_home.py | BenoitAnastay/aiohue | 1f0ce96b1fbfd098c34e4913c1ea3b16437e0c8f | [
"Apache-2.0"
] | null | null | null | aiohue/v2/models/bridge_home.py | BenoitAnastay/aiohue | 1f0ce96b1fbfd098c34e4913c1ea3b16437e0c8f | [
"Apache-2.0"
] | null | null | null | """Model(s) for bridge_home resource on HUE bridge."""
from dataclasses import dataclass
from .resource import ResourceTypes
from .group import Group
@dataclass
class BridgeHome(Group):
"""
Represent BridgeHome object as retrieved from the api.
Home resource lists all rooms in a home and all devices which are not assigned to a room.
Home only contains resources of type "device" and "room"
clip-api.schema.json#/definitions/BridgeHomeGet
clip-api.schema.json#/definitions/BridgeHomePut
"""
type: ResourceTypes = ResourceTypes.BRIDGE_HOME
| 27.52381 | 93 | 0.749135 | 77 | 578 | 5.597403 | 0.61039 | 0.046404 | 0.060325 | 0.078886 | 0.12993 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178201 | 578 | 20 | 94 | 28.9 | 0.907368 | 0.602076 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
107c74bc55de5a97b0f83341b8138681eb5f80e3 | 207 | py | Python | psycogreen/__init__.py | Uxio0/psycogreen | 6674b71955f0fb1b526beb0cd4aebd8d1c42f4d0 | [
"BSD-3-Clause"
] | 65 | 2020-02-23T07:04:45.000Z | 2022-03-08T07:23:28.000Z | psycogreen/__init__.py | Uxio0/psycogreen | 6674b71955f0fb1b526beb0cd4aebd8d1c42f4d0 | [
"BSD-3-Clause"
] | 4 | 2020-07-20T09:17:49.000Z | 2021-10-14T08:39:25.000Z | psycogreen/__init__.py | Uxio0/psycogreen | 6674b71955f0fb1b526beb0cd4aebd8d1c42f4d0 | [
"BSD-3-Clause"
] | 3 | 2020-03-12T12:02:18.000Z | 2022-01-08T21:26:41.000Z | """Integration of psycopg2 with coroutine framework
"""
# Copyright (C) 2010-2020 Daniele Varrazzo <daniele.varrazzo@gmail.com>
# All rights reserved. See COPYING file for details.
__version__ = '1.0.2'
| 23 | 71 | 0.743961 | 28 | 207 | 5.357143 | 0.928571 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067797 | 0.144928 | 207 | 8 | 72 | 25.875 | 0.779661 | 0.826087 | 0 | 0 | 0 | 0 | 0.178571 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
109e3038d2e5cc436b1ff82442e4e3aaa6dcd3f0 | 174 | py | Python | GMiguel/User02_test.py | pdamiano-11/Team-4-Code | 39736f258ca14b96410d74e30e1f57d5e0fe18ba | [
"MIT"
] | 4 | 2020-09-19T21:23:47.000Z | 2020-10-02T19:17:04.000Z | GMiguel/User02_test.py | pdamiano-11/Team-4-Code | 39736f258ca14b96410d74e30e1f57d5e0fe18ba | [
"MIT"
] | 1 | 2020-10-05T15:19:24.000Z | 2020-10-05T15:19:24.000Z | GMiguel/User02_test.py | pdamiano-11/Team-4-Code | 39736f258ca14b96410d74e30e1f57d5e0fe18ba | [
"MIT"
] | 1 | 2020-10-02T19:36:23.000Z | 2020-10-02T19:36:23.000Z | import Project02
import user02
import pandas as pd
import unittest
class Testuser02(unittest.TestCase):
#all marriages after birth
def test01(self):
x = "" | 15.818182 | 36 | 0.712644 | 22 | 174 | 5.636364 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.059259 | 0.224138 | 174 | 11 | 37 | 15.818182 | 0.859259 | 0.143678 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.571429 | 0 | 0.857143 | 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 |
52b7b0c7ed55036f131c9c3b1789134f79adc425 | 186 | py | Python | constance/__init__.py | abendleiter/django-constance | 95181401ad7227e237add18395371a33ad4eb0d8 | [
"BSD-3-Clause"
] | null | null | null | constance/__init__.py | abendleiter/django-constance | 95181401ad7227e237add18395371a33ad4eb0d8 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T23:01:19.000Z | 2021-06-10T17:55:33.000Z | constance/__init__.py | abendleiter/django-constance | 95181401ad7227e237add18395371a33ad4eb0d8 | [
"BSD-3-Clause"
] | null | null | null | from constance.config import Config
try:
from django.apps import AppConfig
except ImportError:
config = Config()
else:
default_app_config = 'constance.apps.ConstanceConfig'
| 20.666667 | 57 | 0.763441 | 22 | 186 | 6.363636 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 186 | 8 | 58 | 23.25 | 0.903226 | 0 | 0 | 0 | 0 | 0 | 0.16129 | 0.16129 | 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 |
52e10e3e21d113f38cd3118e3aca210dea8e2cbd | 110 | py | Python | apps/restapi/urls.py | adepeter/pythondailytip | 8b114b68d417e7631d139f1ee2267f6f0e061cdf | [
"MIT"
] | null | null | null | apps/restapi/urls.py | adepeter/pythondailytip | 8b114b68d417e7631d139f1ee2267f6f0e061cdf | [
"MIT"
] | null | null | null | apps/restapi/urls.py | adepeter/pythondailytip | 8b114b68d417e7631d139f1ee2267f6f0e061cdf | [
"MIT"
] | null | null | null | from django.urls import path, include
urlpatterns = [
path('twee/', include('apps.restapi.twee.urls'))
]
| 110 | 110 | 0.690909 | 14 | 110 | 5.428571 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145455 | 110 | 1 | 110 | 110 | 0.808511 | 0 | 0 | 0 | 0 | 0 | 0.245455 | 0.2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
52f769d4f3d7823472ab97a6c29e18e65241500a | 974 | py | Python | privacy_id3a_docker/config.py | cochennec/privacyidea-ansible-docker | cd14f70be5dd07221b30271f724e2c0c50546575 | [
"MIT"
] | null | null | null | privacy_id3a_docker/config.py | cochennec/privacyidea-ansible-docker | cd14f70be5dd07221b30271f724e2c0c50546575 | [
"MIT"
] | null | null | null | privacy_id3a_docker/config.py | cochennec/privacyidea-ansible-docker | cd14f70be5dd07221b30271f724e2c0c50546575 | [
"MIT"
] | null | null | null | # The realm, where users are allowed to login as administrators
SUPERUSER_REALM = ['super', 'administrators']
# Your database mysql://u:p@host/db
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:Pa55w0rd@localhost:5432/privacy_idea'
# This is used to encrypt the auth_token
SECRET_KEY = 't0p s3cr3t'
# This is used to encrypt the admin passwords
PI_PEPPER = 'Never know...'
# This is used to encrypt the token data and token passwords
PI_ENCFILE = '/opt/conda/envs/privacyidea/lib/python3.7/site-packages/enckey'
# This is used to sign the audit log
PI_AUDIT_KEY_PRIVATE = '/opt/conda/envs/privacyidea/lib/python3.7/site-packages/private.pem'
PI_AUDIT_KEY_PUBLIC = '/opt/conda/envs/privacyidea/lib/python3.7/site-packages/public.pem'
# PI_AUDIT_MODULE = <python audit module>
# PI_AUDIT_SQL_URI = <special audit log DB uri>
# PI_LOGFILE = '....'
# PI_LOGLEVEL = 20
# PI_INIT_CHECK_HOOK = 'your.module.function'
# PI_CSS = '/location/of/theme.css'
# PI_UI_DEACTIVATED = True
| 46.380952 | 92 | 0.767967 | 153 | 974 | 4.712418 | 0.529412 | 0.033287 | 0.055479 | 0.066574 | 0.28294 | 0.28294 | 0.191401 | 0.191401 | 0.191401 | 0 | 0 | 0.020857 | 0.113963 | 974 | 20 | 93 | 48.7 | 0.8146 | 0.511294 | 0 | 0 | 0 | 0.285714 | 0.638528 | 0.547619 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5e1c18c3d2870c01c08bb4a25bd328323f10b069 | 441 | py | Python | modules/utils.py | thewhiteninja/flowgen | 75a334aa84a5e995e8fe7cb83ca6f3bc98c8e925 | [
"MIT"
] | 2 | 2021-03-16T08:56:35.000Z | 2021-09-25T08:55:19.000Z | modules/utils.py | thewhiteninja/flowgen | 75a334aa84a5e995e8fe7cb83ca6f3bc98c8e925 | [
"MIT"
] | null | null | null | modules/utils.py | thewhiteninja/flowgen | 75a334aa84a5e995e8fe7cb83ca6f3bc98c8e925 | [
"MIT"
] | 2 | 2021-02-08T08:48:15.000Z | 2021-03-07T01:58:40.000Z | import random
def random_mac_address(vendor=0):
return vendor << 24 | random.randint(0, 0xffffff)
def random_ephemeral_port():
return random.randint(32768, 61000)
def humansize(nbytes):
suffixes = ['Bs', 'KB', 'MB', 'GB', 'TB', 'PB']
if nbytes == 0:
return '0 B'
i = 0
while nbytes >= 1024 and i < len(suffixes) - 1:
nbytes /= 1024.0
i += 1
return '%.02f %s' % (nbytes, suffixes[i])
| 21 | 53 | 0.578231 | 61 | 441 | 4.114754 | 0.557377 | 0.071713 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095385 | 0.263039 | 441 | 20 | 54 | 22.05 | 0.676923 | 0 | 0 | 0 | 0 | 0 | 0.052154 | 0 | 0 | 0 | 0.018141 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.071429 | 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 |
eaa3f7b807f6b2336fe27c9d916bfeaf16151856 | 560 | py | Python | IDLErobotkinematics.py | wsdsgqc/Robot_Code | c825963f53cadca552abf7a0dc3058b87c05b96f | [
"MIT"
] | null | null | null | IDLErobotkinematics.py | wsdsgqc/Robot_Code | c825963f53cadca552abf7a0dc3058b87c05b96f | [
"MIT"
] | null | null | null | IDLErobotkinematics.py | wsdsgqc/Robot_Code | c825963f53cadca552abf7a0dc3058b87c05b96f | [
"MIT"
] | null | null | null | Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> from graphics import *
win = graphics.GraphWin('RobotKinematicsSimulation',500,500)
x1 = 10
y1 = 10
x2 = 10
y2 = 10
link1 = Line(Point(250,450),Point(x1,y1))
SyntaxError: multiple statements found while compiling a single statement
>>> imo graphics
win = graphics.GraphWin('RobotKinematicsSimulation',500,500)
x1 = 10
y1 = 10
x2 = 10
y2 = 10
link1 = Line(Point(250,450),Point(x1,y1))
| 31.111111 | 97 | 0.716071 | 90 | 560 | 4.455556 | 0.633333 | 0.009975 | 0.094763 | 0.219451 | 0.473815 | 0.473815 | 0.473815 | 0.473815 | 0.473815 | 0.473815 | 0 | 0.182195 | 0.1375 | 560 | 17 | 98 | 32.941176 | 0.648033 | 0 | 0 | 0.705882 | 0 | 0 | 0.141071 | 0.089286 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.058824 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eabd59dc5d46c0fde6e7ca9e7411352435e0e8ac | 110 | py | Python | Codeforces/A_Gerald_apos_s_Hexagon.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/A_Gerald_apos_s_Hexagon.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/A_Gerald_apos_s_Hexagon.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | a=list(map(int,input().split()))
k=(a[2]+a[3]+a[4])
ans=(k*k)-((a[0]*a[0])+(a[2]*a[2])+(a[4]*a[4]))
print(ans) | 27.5 | 47 | 0.481818 | 30 | 110 | 1.766667 | 0.433333 | 0.113208 | 0.169811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084112 | 0.027273 | 110 | 4 | 48 | 27.5 | 0.411215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d80181c786f2ebb5c98f14e0ac0dedebc20cd6a7 | 298 | py | Python | jpl/rules/__init__.py | thejig/jpl | be58184e29588f01e494f218354791516d481f3b | [
"MIT"
] | null | null | null | jpl/rules/__init__.py | thejig/jpl | be58184e29588f01e494f218354791516d481f3b | [
"MIT"
] | 7 | 2020-02-17T16:10:08.000Z | 2020-02-28T01:08:48.000Z | jpl/rules/__init__.py | thejig/jpl | be58184e29588f01e494f218354791516d481f3b | [
"MIT"
] | 1 | 2020-02-19T16:11:59.000Z | 2020-02-19T16:11:59.000Z | from itertools import chain
from jpl.rules.playbook import info, PlayBookExists
from jpl.rules.pipeline import pipeline
from jpl.rules.task import function, task
rules = list(chain.from_iterable([info.rules, pipeline.rules]))
task_rules = list(chain.from_iterable([function.rules, task.rules]))
| 29.8 | 68 | 0.802013 | 43 | 298 | 5.488372 | 0.325581 | 0.114407 | 0.152542 | 0.152542 | 0.254237 | 0.254237 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097315 | 298 | 9 | 69 | 33.111111 | 0.877323 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
d80262973166950b663d16865f893845ab47cdd7 | 390 | py | Python | timetables/schemas/classroom.py | szkolny-eu/timetables-lib | 3d2a346d0be7fba21f49df6491e41820bd52a994 | [
"MIT"
] | null | null | null | timetables/schemas/classroom.py | szkolny-eu/timetables-lib | 3d2a346d0be7fba21f49df6491e41820bd52a994 | [
"MIT"
] | null | null | null | timetables/schemas/classroom.py | szkolny-eu/timetables-lib | 3d2a346d0be7fba21f49df6491e41820bd52a994 | [
"MIT"
] | null | null | null | from typing import Optional
from pydantic import Field, PrivateAttr
from ..base import Nameable
from .url import URL
class Classroom(Nameable):
name: str = Field(title="Name", description="Name of the classroom")
url: Optional[URL] = Field(
None, title="URL", description="An URL of this classroom's timetable"
)
__name_full__: Optional[str] = PrivateAttr(None)
| 26 | 77 | 0.715385 | 51 | 390 | 5.372549 | 0.470588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184615 | 390 | 14 | 78 | 27.857143 | 0.861635 | 0 | 0 | 0 | 0 | 0 | 0.164103 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.8 | 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 |
d81a0957da36744863e3e05d5384c21a21899883 | 18,849 | py | Python | resolwe_bio/tests/processes/test_alignment.py | HudoGriz/resolwe-bio | 4f7363cfa7d9d5a43f1a70ef36c69be3faed7fea | [
"Apache-2.0"
] | null | null | null | resolwe_bio/tests/processes/test_alignment.py | HudoGriz/resolwe-bio | 4f7363cfa7d9d5a43f1a70ef36c69be3faed7fea | [
"Apache-2.0"
] | null | null | null | resolwe_bio/tests/processes/test_alignment.py | HudoGriz/resolwe-bio | 4f7363cfa7d9d5a43f1a70ef36c69be3faed7fea | [
"Apache-2.0"
] | null | null | null | # pylint: disable=missing-docstring
from resolwe.flow.models import Data
from resolwe.test import tag_process, with_resolwe_host
from resolwe_bio.models import Sample
from resolwe_bio.utils.test import KBBioProcessTestCase
class AlignmentProcessorTestCase(KBBioProcessTestCase):
@tag_process('alignment-bowtie')
def test_bowtie(self):
with self.preparation_stage():
genome = self.prepare_genome()
reads_single = self.prepare_reads()
reads_paired = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'],
mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz'])
inputs = {
'genome': genome.id,
'reads': reads_single.id,
'trimming': {'trim_iter': 2, 'trim_nucl': 4},
'reporting': {'r': "-a -m 1 --best --strata"}
}
alignment = self.run_process('alignment-bowtie', inputs)
self.assertFile(alignment, 'stats', 'bowtie_single_reads_report.tab.gz', compression='gzip')
self.assertFields(alignment, 'species', 'Dictyostelium discoideum')
self.assertFields(alignment, 'build', 'dd-05-2009')
inputs = {
'genome': genome.id,
'reads': reads_paired.id,
'trimming': {'trim_iter': 2, 'trim_nucl': 4},
'reporting': {'r': "-a -m 1 --best --strata"},
'use_se': True
}
alignment = self.run_process('alignment-bowtie', inputs)
self.assertFile(alignment, 'stats', 'bowtie_use_SE_report.tab.gz', compression='gzip')
inputs = {
'genome': genome.id,
'reads': reads_paired.id,
'trimming': {'trim_iter': 2, 'trim_nucl': 4},
'reporting': {'r': "-a -m 1 --best --strata"}
}
alignment = self.run_process('alignment-bowtie', inputs)
self.assertFile(alignment, 'stats', 'bowtie_paired_reads_report.tab.gz', compression='gzip')
@tag_process('alignment-bowtie2')
def test_bowtie2(self):
with self.preparation_stage():
genome = self.prepare_genome()
reads = self.prepare_reads()
reads_paired = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'],
mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz'])
# Values for alignment options are default according to the documentation. However, L may not be set
# correctly as there is some incongruency. See https://github.com/BenLangmead/bowtie2/issues/215
inputs = {
'genome': genome.pk,
'reads': reads.pk,
'trimming': {'trim_iter': 2, 'trim_nucl': 4},
'reporting': {'rep_mode': "def"},
'alignment_options': {'N': 0, 'gbar': 4, 'L': 22, 'mp': '6', 'rdg': '5,3', 'rfg': '5,3',
'score_min': 'L,-0.6,-0.6'}
}
aligned_reads = self.run_process('alignment-bowtie2', inputs)
self.assertFile(aligned_reads, 'stats', 'bowtie2_reads_report.txt')
self.assertFields(aligned_reads, 'species', 'Dictyostelium discoideum')
self.assertFields(aligned_reads, 'build', 'dd-05-2009')
inputs = {
'genome': genome.id,
'reads': reads_paired.id,
'trimming': {'trim_iter': 2, 'trim_nucl': 4},
'reporting': {'rep_mode': "def"},
'alignment_options': {'N': 0, 'gbar': 4, 'L': 22, 'mp': '6,2', 'rdg': '5,3', 'rfg': '5,3',
'score_min': 'L,-0.6,-0.6'}
}
aligned_reads = self.run_process('alignment-bowtie2', inputs)
self.assertFile(aligned_reads, 'stats', 'bowtie2_paired_end_report.txt')
inputs = {
'genome': genome.id,
'reads': reads_paired.id,
'trimming': {'trim_iter': 2, 'trim_nucl': 4},
'reporting': {'rep_mode': "def"},
'PE_options': {'use_se': True},
'alignment_options': {'N': 0, 'gbar': 4, 'L': 22, 'mp': '6,2', 'rdg': '5,3', 'rfg': '5,3',
'score_min': 'L,-0.6,-0.6'}
}
aligned_reads = self.run_process('alignment-bowtie2', inputs)
self.assertFile(aligned_reads, 'stats', 'bowtie2_use_SE_report.txt')
@tag_process('alignment-star-index')
def test_star_index(self):
with self.preparation_stage():
annotation_gtf = self.prepare_annotation(fn='HS chr21_short.gtf.gz', source='UCSC',
species='Homo sapiens', build='hg19')
star_index_fasta = self.prepare_adapters(fn='HS chr21_ensembl.fa.gz')
genome = self.prepare_genome()
annotation_gff3 = self.prepare_annotation_gff()
inputs_gtf = {'annotation': annotation_gtf.id, 'genome2': star_index_fasta.id}
self.run_process('alignment-star-index', inputs_gtf)
# Test genome indexing without the input annotation file
inputs_gtf = {'genome2': star_index_fasta.id}
self.run_process('alignment-star-index', inputs_gtf)
inputs_gff3 = {'annotation': annotation_gff3.id, 'genome': genome.id}
star_index = self.run_process('alignment-star-index', inputs_gff3)
self.assertAlmostEqual(star_index.output['index']['size'], 1566163859, delta=5)
@with_resolwe_host
@tag_process('alignment-star')
def test_star(self):
with self.preparation_stage():
reads = self.prepare_reads(['SRR2124780_1 1k.fastq.gz'])
paired_reads = self.prepare_paired_reads(mate1=['SRR2124780_1 1k.fastq.gz'],
mate2=['SRR2124780_2 1k.fastq.gz'])
annotation = self.prepare_annotation(fn='HS chr21_short.gtf.gz', source='ENSEMBL',
species='Homo sapiens', build='GRCh38_ens90')
inputs = {
'src': 'HS chr21_ensembl.fa.gz',
'species': 'Homo sapiens',
'build': 'GRCh38_ens90',
'source': 'ENSEMBL',
}
star_index_fasta = self.run_process('upload-fasta-nucl', inputs)
inputs = {'annotation': annotation.id, 'genome2': star_index_fasta.id}
star_index = self.run_process('alignment-star-index', inputs)
star_index_wo_annot = self.run_process('alignment-star-index', {'genome2': star_index_fasta.id})
for data in Data.objects.all():
self.assertStatus(data, Data.STATUS_DONE)
inputs = {
'genome': star_index.id,
'reads': reads.id,
't_coordinates': {
'quantmode': True,
'gene_counts': True,
},
'two_pass_mapping': {
'two_pass_mode': True,
},
}
aligned_reads = self.run_process('alignment-star', inputs)
for data in Data.objects.all():
self.assertStatus(data, Data.STATUS_DONE)
self.assertFile(aligned_reads, 'gene_counts', 'gene_counts_star_single.tab.gz', compression='gzip')
self.assertFields(aligned_reads, 'species', 'Homo sapiens')
self.assertFields(aligned_reads, 'build', 'GRCh38_ens90')
exp = Data.objects.last()
self.assertFile(exp, 'exp', 'star_expression_single.tab.gz', compression='gzip')
self.assertFields(exp, 'source', 'ENSEMBL')
self.assertFields(exp, 'species', 'Homo sapiens')
self.assertFields(exp, 'build', 'GRCh38_ens90')
self.assertFields(exp, 'feature_type', 'gene')
inputs = {
'genome': star_index_wo_annot.id,
'reads': reads.id,
'annotation': annotation.id,
't_coordinates': {
'quantmode': True,
'gene_counts': True,
},
'two_pass_mapping': {
'two_pass_mode': True,
},
}
aligned_reads = self.run_process('alignment-star', inputs)
for data in Data.objects.all():
self.assertStatus(data, Data.STATUS_DONE)
self.assertFile(aligned_reads, 'gene_counts', 'gene_counts_star_single.tab.gz', compression='gzip')
self.assertFields(aligned_reads, 'species', 'Homo sapiens')
self.assertFields(aligned_reads, 'build', 'GRCh38_ens90')
exp = Data.objects.last()
self.assertFile(exp, 'exp', 'star_expression_single.tab.gz', compression='gzip')
self.assertFields(exp, 'source', 'ENSEMBL')
self.assertFields(exp, 'species', 'Homo sapiens')
self.assertFields(exp, 'build', 'GRCh38_ens90')
self.assertFields(exp, 'feature_type', 'gene')
inputs = {
'genome': star_index.id,
'reads': paired_reads.id,
't_coordinates': {
'quantmode': True,
'gene_counts': True,
},
'two_pass_mapping': {
'two_pass_mode': True,
},
}
aligned_reads = self.run_process('alignment-star', inputs)
self.assertFile(aligned_reads, 'bigwig', 'bigwig_star_ens_paired.bw')
for data in Data.objects.all():
self.assertStatus(data, Data.STATUS_DONE)
self.assertFile(aligned_reads, 'gene_counts', 'gene_counts_star_paired.tab.gz', compression='gzip')
exp = Data.objects.last()
self.assertFile(exp, 'exp', 'star_expression_paired.tab.gz', compression='gzip')
self.assertFields(exp, 'source', 'ENSEMBL')
self.assertFile(exp, 'exp_set', 'star_out_exp_set.txt.gz', compression='gzip')
self.assertJSON(exp, exp.output['exp_set_json'], '', 'star_exp_set.json.gz')
@tag_process('alignment-bwa-aln')
def test_bwa_bt(self):
with self.preparation_stage():
genome = self.prepare_genome()
reads = self.prepare_reads()
reads_paired = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'],
mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz'])
inputs = {'genome': genome.id, 'reads': reads.id}
aligned_reads = self.run_process('alignment-bwa-aln', inputs)
self.assertFile(aligned_reads, 'stats', 'bwa_bt_reads_report.txt')
inputs = {'genome': genome.id, 'reads': reads_paired.id}
aligned_reads = self.run_process('alignment-bwa-aln', inputs)
self.assertFile(aligned_reads, 'stats', 'bwa_bt_paired_reads_report.txt')
self.assertFields(aligned_reads, 'species', 'Dictyostelium discoideum')
self.assertFields(aligned_reads, 'build', 'dd-05-2009')
@tag_process('alignment-bwa-sw')
def test_bwa_sw(self):
with self.preparation_stage():
genome = self.prepare_genome()
reads = self.prepare_reads()
reads_paired = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'],
mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz'])
inputs = {'genome': genome.id, 'reads': reads.id}
aligned_reads = self.run_process('alignment-bwa-sw', inputs)
self.assertFile(aligned_reads, 'bam', 'bwa_sw_reads_mapped.bam')
self.assertFile(aligned_reads, 'stats', 'bwa_sw_reads_report.txt')
inputs = {'genome': genome.id, 'reads': reads_paired.id}
aligned_reads = self.run_process('alignment-bwa-sw', inputs)
self.assertFile(aligned_reads, 'bam', 'bwa_sw_paired_reads_mapped.bam')
self.assertFile(aligned_reads, 'stats', 'bwa_sw_paired_reads_report.txt')
self.assertFields(aligned_reads, 'species', 'Dictyostelium discoideum')
self.assertFields(aligned_reads, 'build', 'dd-05-2009')
@tag_process('alignment-bwa-mem')
def test_bwa_mem(self):
with self.preparation_stage():
genome = self.prepare_genome()
reads = self.prepare_reads()
reads_paired = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'],
mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz'])
inputs = {'genome': genome.id, 'reads': reads.id}
aligned_reads = self.run_process('alignment-bwa-mem', inputs)
self.assertFile(aligned_reads, 'stats', 'bwa_mem_reads_report.txt')
inputs = {'genome': genome.id, 'reads': reads_paired.id}
aligned_reads = self.run_process('alignment-bwa-mem', inputs)
self.assertFile(aligned_reads, 'stats', 'bwa_mem_paired_reads_report.txt')
self.assertFile(aligned_reads, 'unmapped', 'bwa_mem_unmapped_reads.fastq.gz', compression='gzip', sort=True)
self.assertFields(aligned_reads, 'species', 'Dictyostelium discoideum')
self.assertFields(aligned_reads, 'build', 'dd-05-2009')
@tag_process('alignment-hisat2')
def test_hisat2(self):
with self.preparation_stage():
genome = self.prepare_genome()
reads = self.prepare_reads()
sample = Sample.objects.get(data=reads)
sample.name = 'Single reads'
sample.save()
reads_paired = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'],
mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz'])
sample_paired = Sample.objects.get(data=reads_paired)
sample_paired.name = 'Paired-end reads'
sample_paired.save()
inputs = {
'genome': genome.id,
'reads': reads.id}
aligned_reads = self.run_process('alignment-hisat2', inputs)
self.assertFile(aligned_reads, 'stats', 'hisat2_report.txt')
self.assertFile(aligned_reads, 'unmapped_f', 'hisat2_unmapped.fastq.gz', compression='gzip', sort=True)
self.assertFileExists(aligned_reads, 'splice_junctions')
inputs = {
'genome': genome.id,
'reads': reads_paired.id}
aligned_reads = self.run_process('alignment-hisat2', inputs)
self.assertFile(aligned_reads, 'stats', 'hisat2_paired_report.txt')
self.assertFile(aligned_reads, 'bigwig', 'hisat2_paired_bigwig.bw')
self.assertFile(aligned_reads, 'unmapped_f', 'hisat2_unmapped_1.fastq.gz', compression='gzip', sort=True)
self.assertFile(aligned_reads, 'unmapped_r', 'hisat2_unmapped_2.fastq.gz', compression='gzip', sort=True)
self.assertFileExists(aligned_reads, 'splice_junctions')
self.assertFields(aligned_reads, 'species', 'Dictyostelium discoideum')
self.assertFields(aligned_reads, 'build', 'dd-05-2009')
@tag_process('alignment-subread')
def test_subread(self):
with self.preparation_stage():
genome = self.prepare_genome()
inputs = {
'src': 'my.strange.genome name$.fasta.gz',
'species': 'Dictyostelium discoideum',
'build': 'dd-05-2009',
}
genome_2 = self.run_process('upload-genome', inputs)
reads = self.prepare_reads()
reads_paired = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'],
mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz'])
inputs = {'genome': genome.id, 'reads': reads.id}
aligned_reads = self.run_process('alignment-subread', inputs)
self.assertFile(aligned_reads, 'stats', 'subread_reads_report.txt')
self.assertFile(aligned_reads, 'bam', 'subread_single.bam')
self.assertFields(aligned_reads, 'species', 'Dictyostelium discoideum')
self.assertFields(aligned_reads, 'build', 'dd-05-2009')
inputs = {'genome': genome_2.id, 'reads': reads_paired.id}
aligned_reads = self.run_process('alignment-subread', inputs)
self.assertFile(aligned_reads, 'stats', 'subread_paired_reads_report.txt')
self.assertFile(aligned_reads, 'bam', 'subread_paired.bam')
@tag_process('alignment-hisat2')
def test_hisat2_bigwig(self):
with self.preparation_stage():
paired_reads_ucsc = self.prepare_paired_reads(mate1=['SRR2124780_1 1k.fastq.gz'],
mate2=['SRR2124780_2 1k.fastq.gz'])
paired_reads_ncbi = self.prepare_paired_reads(mate1=['GRCh38.p12_NCBIchr21_R1.fq.gz'],
mate2=['GRCh38.p12_NCBIchr21_R2.fq.gz'])
inputs = {
'src': 'hg38_chr21_9M.fa.gz',
'species': 'Homo sapiens',
'build': 'hg38',
}
genome_ucsc = self.run_process('upload-genome', inputs)
inputs = {
'src': 'GRCh38.p12_NCBIchr21_9M.fasta.gz',
'species': 'Homo sapiens',
'build': 'GRCh38.p12',
}
genome_ncbi = self.run_process('upload-genome', inputs)
inputs = {
'genome': genome_ucsc.id,
'reads': paired_reads_ucsc.id,
}
aligned_reads = self.run_process('alignment-hisat2', inputs)
self.assertFile(aligned_reads, 'bigwig', 'hisat2_paired_ucsc_bigwig.bw')
inputs = {
'genome': genome_ncbi.id,
'reads': paired_reads_ncbi.id,
}
aligned_reads = self.run_process('alignment-hisat2', inputs)
self.assertFile(aligned_reads, 'bigwig', 'hisat2_paired_ncbi_bigwig.bw')
@tag_process('alignment-hisat2')
def test_empty_bam(self):
with self.preparation_stage():
genome = self.prepare_genome()
reads = self.prepare_reads(['reads-map-to-nowhere.fastq'])
aligned_reads = self.run_process('alignment-hisat2', input_={
'reads': reads.id,
'genome': genome.id,
})
self.assertEqual(aligned_reads.process_warning, ['Bam file has no entries. No bigWig file will be made.'])
@tag_process('alignment-hisat2')
def test_no_bigwig_mappings(self):
"""Use dicty genome and reads but declare it as human so no mapping to UCSC can happen."""
with self.preparation_stage():
reads = self.prepare_reads()
genome = self.run_process('upload-genome', {
'src': 'genome.fasta.gz',
'species': 'Homo sapiens',
'build': 'GRCh38.p12',
})
aligned_reads = self.run_process('alignment-hisat2', {
'reads': reads.id,
'genome': genome.id,
})
msg = 'Neither of the chromosomes in the input file has a valid UCSC pair. No mapping will be done.'
self.assertEqual(aligned_reads.process_warning, [msg])
| 47.1225 | 116 | 0.59287 | 2,125 | 18,849 | 5.042353 | 0.110588 | 0.076155 | 0.043117 | 0.060103 | 0.795427 | 0.758656 | 0.708259 | 0.676528 | 0.64685 | 0.632758 | 0 | 0.022407 | 0.270731 | 18,849 | 399 | 117 | 47.240602 | 0.757093 | 0.019524 | 0 | 0.57478 | 0 | 0 | 0.264454 | 0.053649 | 0 | 0 | 0 | 0 | 0.211144 | 1 | 0.035191 | false | 0.017595 | 0.01173 | 0 | 0.049853 | 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 |
d81c957ffb1a30d5eda83b65a749ce5dee0ea233 | 197 | py | Python | example.py | CruelSoftware/wordstat | 526229b0abf33b9daf4b4e28159728ff13dc952c | [
"MIT"
] | null | null | null | example.py | CruelSoftware/wordstat | 526229b0abf33b9daf4b4e28159728ff13dc952c | [
"MIT"
] | null | null | null | example.py | CruelSoftware/wordstat | 526229b0abf33b9daf4b4e28159728ff13dc952c | [
"MIT"
] | null | null | null | from wordstat.wordstat import WordStat
word_stat = WordStat()
print(word_stat)
all_words = word_stat.get_all_words()
all_files = word_stat.get_files()
words_stat = word_stat.get_func_words_stat()
| 24.625 | 44 | 0.817259 | 32 | 197 | 4.59375 | 0.34375 | 0.272109 | 0.22449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091371 | 197 | 7 | 45 | 28.142857 | 0.821229 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.166667 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d82dc41cb61fbd97157eb0ec967ea81771f3f3dd | 572 | py | Python | Cryptography/Paillier/demo.py | hacky1997/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 14 | 2017-06-14T06:10:07.000Z | 2019-02-22T03:21:15.000Z | Cryptography/Paillier/demo.py | rookie-12/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 1 | 2021-04-30T21:19:32.000Z | 2021-04-30T21:19:32.000Z | Cryptography/Paillier/demo.py | rookie-12/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 7 | 2015-10-01T09:47:05.000Z | 2022-01-21T14:25:37.000Z | #!/usr/bin/env python
from paillier import *
print "Generating keypair..."
priv, pub = generate_keypair(512)
x = 3
print "x =", x
print "Encrypting x..."
cx = encrypt(pub, x)
print "cx =", cx
y = 5
print "y =", y
print "Encrypting y..."
cy = encrypt(pub, y)
print "cy =", cy
print "Computing cx + cy..."
cz = e_add(pub, cx, cy)
print "cz =", cz
print "Decrypting cz..."
z = decrypt(priv, pub, cz)
print "z =", z
print "Computing decrypt((cz + 2) * 3) ..."
print "result =", decrypt(priv, pub,
e_mul_const(pub, e_add_const(pub, cz, 2), 3))
| 18.451613 | 71 | 0.592657 | 91 | 572 | 3.659341 | 0.362637 | 0.063063 | 0.084084 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020179 | 0.22028 | 572 | 30 | 72 | 19.066667 | 0.726457 | 0.034965 | 0 | 0 | 1 | 0 | 0.274047 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.045455 | null | null | 0.590909 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
d833d7926aec9705c952a12b541bbdf0041bfad7 | 208 | py | Python | convertToTitle.py | bourneagain/pythonBytes | be115162147e52718aacbfb9cd2763aa02754f28 | [
"MIT"
] | 1 | 2017-05-29T02:02:27.000Z | 2017-05-29T02:02:27.000Z | convertToTitle.py | bourneagain/pythonBytes | be115162147e52718aacbfb9cd2763aa02754f28 | [
"MIT"
] | null | null | null | convertToTitle.py | bourneagain/pythonBytes | be115162147e52718aacbfb9cd2763aa02754f28 | [
"MIT"
] | null | null | null | import time
def convertToTitle( num):
print num
if num == 0:
return ""
else :
return convertToTitle((num - 1) / 26) + chr((num - 1) % 26 + ord('A'))
print convertToTitle(27)
print convertToTitle(703)
| 18.909091 | 72 | 0.653846 | 29 | 208 | 4.689655 | 0.586207 | 0.25 | 0.088235 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071856 | 0.197115 | 208 | 10 | 73 | 20.8 | 0.742515 | 0 | 0 | 0 | 0 | 0 | 0.004808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.111111 | null | null | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d83529e69184b82cbf38db2e167c6186f3c40381 | 58 | py | Python | notebooks/_solutions/pandas_07_reshaping_data35.py | rprops/Python_DS-WS | b2fc449a74be0c82863e5fcf1ddbe7d64976d530 | [
"BSD-3-Clause"
] | 183 | 2016-08-24T12:32:07.000Z | 2022-03-26T14:05:04.000Z | notebooks/_solutions/pandas_07_reshaping_data35.py | rprops/Python_DS-WS | b2fc449a74be0c82863e5fcf1ddbe7d64976d530 | [
"BSD-3-Clause"
] | 100 | 2016-12-15T03:44:06.000Z | 2022-03-07T08:14:07.000Z | notebooks/_solutions/pandas_07_reshaping_data35.py | rprops/Python_DS-WS | b2fc449a74be0c82863e5fcf1ddbe7d64976d530 | [
"BSD-3-Clause"
] | 204 | 2016-08-24T14:22:58.000Z | 2022-03-29T15:09:03.000Z | df.groupby(['Pclass', 'Sex'])['Survived'].mean().unstack() | 58 | 58 | 0.637931 | 7 | 58 | 5.285714 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017241 | 58 | 1 | 58 | 58 | 0.649123 | 0 | 0 | 0 | 0 | 0 | 0.288136 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
dc1c499e1668036f6aae3291a6fae9aaac2318fd | 603 | py | Python | src/Kernel/HatKernelInst.cc.py | markguozhiming/spheral | bbb982102e61edb8a1d00cf780bfa571835e1b61 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 1 | 2020-10-21T01:56:55.000Z | 2020-10-21T01:56:55.000Z | src/Kernel/HatKernelInst.cc.py | markguozhiming/spheral | bbb982102e61edb8a1d00cf780bfa571835e1b61 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | null | null | null | src/Kernel/HatKernelInst.cc.py | markguozhiming/spheral | bbb982102e61edb8a1d00cf780bfa571835e1b61 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | null | null | null | text = """
//---------------------------------Spheral++----------------------------------//
// HatKernel -- The B spline interpolation kernel.
//
// Created by JMO, Wed Dec 11 17:33:57 PST 2002
//----------------------------------------------------------------------------//
#include "Kernel.hh"
#include "HatKernel.hh"
#include <math.h>
//------------------------------------------------------------------------------
// Explicit instantiation.
//------------------------------------------------------------------------------
namespace Spheral {
template class HatKernel< Dim< %(ndim)s > >;
}
"""
| 31.736842 | 80 | 0.321725 | 38 | 603 | 5.105263 | 0.815789 | 0.092784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021779 | 0.086235 | 603 | 18 | 81 | 33.5 | 0.330309 | 0 | 0 | 0.125 | 0 | 0 | 0.976783 | 0.53068 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
dc63846536a1f84f3f7a079fe6d65c4ea3322cae | 266 | py | Python | tests/sources/simple-test.py | hugovk/python-versions | c27507421a8edf9cfe1817c0615054bf6c7211b6 | [
"MIT"
] | 92 | 2020-04-17T22:04:56.000Z | 2022-03-11T19:19:45.000Z | tests/sources/simple-test.py | Yuriy-Kukushkin/python-versions | ae216d3a0bc2b7e26696e35b476b4ef1e8e55b36 | [
"MIT"
] | 18 | 2020-04-27T06:17:15.000Z | 2022-01-18T17:25:41.000Z | tests/sources/simple-test.py | Yuriy-Kukushkin/python-versions | ae216d3a0bc2b7e26696e35b476b4ef1e8e55b36 | [
"MIT"
] | 77 | 2020-05-01T22:59:35.000Z | 2022-03-20T08:38:58.000Z | import sys
print(sys.version)
print(sys.prefix)
# Python program to find the factorial of a number
num = 65
factorial = 1
print("Find the factorial of ", num)
for i in range(1, num + 1):
factorial = factorial*i
print("The factorial of ", num, " is ", factorial) | 24.181818 | 50 | 0.703008 | 44 | 266 | 4.25 | 0.5 | 0.192513 | 0.224599 | 0.192513 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023041 | 0.184211 | 266 | 11 | 51 | 24.181818 | 0.83871 | 0.180451 | 0 | 0 | 0 | 0 | 0.198157 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 0.444444 | 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 |
dc6db4dfa93f6899b57ab5b83ebdcd05c8705f6c | 733 | py | Python | profles_api/permissions.py | khandyana95/rest-django-apis | b0da21e9dc5f3601fa36f532d8976d87f151d6af | [
"MIT"
] | null | null | null | profles_api/permissions.py | khandyana95/rest-django-apis | b0da21e9dc5f3601fa36f532d8976d87f151d6af | [
"MIT"
] | 6 | 2020-06-06T01:29:00.000Z | 2021-06-10T19:48:19.000Z | profles_api/permissions.py | khandyana95/rest-django-apis | b0da21e9dc5f3601fa36f532d8976d87f151d6af | [
"MIT"
] | null | null | null | from rest_framework import permissions
class UpdateOwnUserProfile(permissions.BasePermission):
"""Adding object level permission to User for profile"""
def has_object_permission(self, request, view, obj):
"""restricting object permissions"""
if request.method in permissions.SAFE_METHODS:
return True
return obj.id == request.user.id
class UpdateOwnUserProfileFeed(permissions.BasePermission):
"""Adding Object level permission to profile feed"""
def has_object_permission(self, request, view, obj):
"""Restricting the Object Permissions"""
if request.method in permissions.SAFE_METHODS:
return True
return obj.user.id == request.user.id
| 31.869565 | 60 | 0.705321 | 82 | 733 | 6.219512 | 0.414634 | 0.035294 | 0.121569 | 0.145098 | 0.705882 | 0.705882 | 0.705882 | 0.494118 | 0.494118 | 0.294118 | 0 | 0 | 0.21146 | 733 | 22 | 61 | 33.318182 | 0.882353 | 0.222374 | 0 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.181818 | false | 0 | 0.090909 | 0 | 0.818182 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
dc8118dbf0544f9a1f21dbddcb2b11c6e284aa06 | 1,039 | py | Python | tests/test_tokenization.py | Helsinki-NLP/OpusFilter | 837e2e8ff34d643bdd46ba4b9ba6dddedcad3f0a | [
"MIT"
] | 57 | 2020-02-15T00:41:26.000Z | 2022-03-23T13:55:57.000Z | tests/test_tokenization.py | Helsinki-NLP/OpusFilter | 837e2e8ff34d643bdd46ba4b9ba6dddedcad3f0a | [
"MIT"
] | 26 | 2020-02-19T10:22:49.000Z | 2022-02-28T07:17:09.000Z | tests/test_tokenization.py | Helsinki-NLP/OpusFilter | 837e2e8ff34d643bdd46ba4b9ba6dddedcad3f0a | [
"MIT"
] | 11 | 2020-05-21T02:02:24.000Z | 2022-01-15T14:01:47.000Z | import argparse
import logging
import os
import tempfile
import unittest
from opusfilter import tokenization
class TestTokenization(unittest.TestCase):
def test_dummy(self):
tokenize = tokenization.get_tokenize(None)
self.assertEqual(tokenize("Hello, world!"), "Hello, world!")
def test_dummy_detok(self):
tokenize = tokenization.get_tokenize(None)
self.assertEqual(tokenize.detokenize("Hello , world !"), "Hello , world !")
def test_moses(self):
tokenize = tokenization.get_tokenize(('moses', 'en'))
self.assertEqual(tokenize("Hello, world!"), "Hello , world !")
def test_moses_detok(self):
tokenize = tokenization.get_tokenize(('moses', 'en'))
self.assertEqual(tokenize.detokenize("Hello , world !"), "Hello, world!")
def test_moses_options(self):
tokenize = tokenization.get_tokenize(('moses', 'en', {'aggressive_dash_splits': True}))
self.assertEqual(tokenize("Hello, fine-looking world!"), "Hello , fine @-@ looking world !")
| 33.516129 | 100 | 0.682387 | 114 | 1,039 | 6.087719 | 0.289474 | 0.115274 | 0.172911 | 0.194525 | 0.646974 | 0.646974 | 0.632565 | 0.564842 | 0.564842 | 0.341499 | 0 | 0 | 0.180943 | 1,039 | 30 | 101 | 34.633333 | 0.815511 | 0 | 0 | 0.363636 | 0 | 0 | 0.205005 | 0.021174 | 0 | 0 | 0 | 0 | 0.227273 | 1 | 0.227273 | false | 0 | 0.272727 | 0 | 0.545455 | 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 |
dc9ceb8f5d90cb3fd3746a06f49367dbbdd837f2 | 101 | py | Python | src/musekafka/exceptions.py | dailymuse/musekafka-py | 3aec3d5ae620d5760733b2d9b73e9ac135dbd875 | [
"MIT"
] | 1 | 2020-11-10T22:15:49.000Z | 2020-11-10T22:15:49.000Z | src/musekafka/exceptions.py | dailymuse/musekafka-py | 3aec3d5ae620d5760733b2d9b73e9ac135dbd875 | [
"MIT"
] | 2 | 2020-11-13T16:32:49.000Z | 2020-11-17T05:36:31.000Z | src/musekafka/exceptions.py | dailymuse/musekafka-py | 3aec3d5ae620d5760733b2d9b73e9ac135dbd875 | [
"MIT"
] | null | null | null | class ConsumerException(Exception):
"""Raise to indicate a general exception in the consumer."""
| 33.666667 | 64 | 0.752475 | 12 | 101 | 6.333333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148515 | 101 | 2 | 65 | 50.5 | 0.883721 | 0.534653 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
dc9dda423421beae9a29effa1c9811f9ca34a7e3 | 594 | py | Python | src/05_communication/decorator_set.py | rurumimic/concurrency-python | 3eb7875dd4848872226f8035d295a31a40e32bf0 | [
"MIT"
] | null | null | null | src/05_communication/decorator_set.py | rurumimic/concurrency-python | 3eb7875dd4848872226f8035d295a31a40e32bf0 | [
"MIT"
] | null | null | null | src/05_communication/decorator_set.py | rurumimic/concurrency-python | 3eb7875dd4848872226f8035d295a31a40e32bf0 | [
"MIT"
] | null | null | null | import threading
from functools import wraps
def lock(func):
print('lock', func)
@wraps(func)
def wrapper(self, *args, **kwargs):
with self._lock:
return func(self, *args, **kwargs)
return wrapper
class DecoratorLockedSet(set):
def __init__(self, *args, **kwargs):
self._lock = threading.Lock()
super(DecoratorLockedSet, self).__init__(*args, **kwargs)
@lock
def add(self, e):
return super(DecoratorLockedSet, self).add(e)
@lock
def remove(self, e):
return super(DecoratorLockedSet, self).remove(e)
| 22 | 65 | 0.62963 | 69 | 594 | 5.275362 | 0.333333 | 0.10989 | 0.115385 | 0.087912 | 0.208791 | 0.208791 | 0 | 0 | 0 | 0 | 0 | 0 | 0.242424 | 594 | 26 | 66 | 22.846154 | 0.808889 | 0 | 0 | 0.105263 | 0 | 0 | 0.006734 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0 | 0.105263 | 0.105263 | 0.631579 | 0.052632 | 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 |
dca0122b50ea289dabe6baacede35d9de841ee01 | 2,242 | py | Python | imps/tests/test_smarkets.py | bootandy/imps | 21c84b788d44a296d8db4f655bedcef3fad12c36 | [
"Apache-2.0"
] | 13 | 2017-07-11T18:43:32.000Z | 2020-12-29T23:13:12.000Z | imps/tests/test_smarkets.py | bootandy/imps | 21c84b788d44a296d8db4f655bedcef3fad12c36 | [
"Apache-2.0"
] | 4 | 2018-06-15T09:33:11.000Z | 2019-02-09T10:46:56.000Z | imps/tests/test_smarkets.py | bootandy/imps | 21c84b788d44a296d8db4f655bedcef3fad12c36 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function
from imps.core import Sorter
def test_smarkets_style():
input = '''from __future__ import absolute_import, division, print_function
import ast
import configparser
import os
import StringIO
import sys
from functools import *
from os import path
import flake8
import pytest
from flake8.defaults import NOQA_INLINE_REGEXP, STATISTIC_NAMES
from flake8.exceptions import *
from pytest import *
from pytest import capture
from pytest import compat, config
from common.interfaces import Config
from common.rest.decorators import jsonify
from han.db import Database
from winners.server.db_access import (
acknowledge_winner_exposure_for_market,
get_acknowledged_winner_exposures_for_market,
)
from . import A
from . import B
from .A import A
from .B import B
from .. import A
from .. import B
from ..A import A
from ..B import B
'''
assert Sorter('s', 80, ['common', 'winners', 'han']).sort(input) == input
def test_smarkets_style_from_import_capitals_are_not_lowered():
input = '''from __future__ import absolute_import, division, print_function
from imps.strings import AAAA
from imps.strings import get_doc_string, strip_to_module_name, strip_to_module_name_from_import
from imps.strings import ZZZZ
'''
# Possible alternative:
# output = '''from __future__ import absolute_import, division, print_function
#
# from imps.strings import (
# AAAA,
# get_doc_string,
# strip_to_module_name,
# strip_to_module_name_from_import
# ZZZZ,
# )
# '''
assert Sorter('s', max_line_length=110).sort(input) == input
def test_newlines_reduced():
s = Sorter('s', 80, ['local'])
input = """import io
import sys
import A
"""
output = """import io
import sys
import A
"""
assert s.sort(input) == output
def test_no_new_line_between_same_type():
s = Sorter(type='s', max_line_length=110, indent=" ")
input_str = """
from __future__ import absolute_import, division, print_function
import re
from collections import OrderedDict
"""
correct = """from __future__ import absolute_import, division, print_function
import re
from collections import OrderedDict
"""
assert s.sort(input_str) == correct
| 22.19802 | 95 | 0.751561 | 311 | 2,242 | 5.118971 | 0.302251 | 0.04397 | 0.060302 | 0.090452 | 0.494975 | 0.447236 | 0.417085 | 0.417085 | 0.417085 | 0.375 | 0 | 0.006926 | 0.162801 | 2,242 | 100 | 96 | 22.42 | 0.841236 | 0.106155 | 0 | 0.292308 | 0 | 0 | 0.656627 | 0.091867 | 0 | 0 | 0 | 0 | 0.061538 | 1 | 0.061538 | false | 0 | 0.707692 | 0 | 0.769231 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
dcaea2798ed33d0b843c5c471f48319e0017184b | 81 | py | Python | ch6/review3.py | hajin-kim/2020-HighSchool-Python-Tutoring | 352025a954bff37d21cc3d59e7d5e0f0269a1f17 | [
"MIT"
] | null | null | null | ch6/review3.py | hajin-kim/2020-HighSchool-Python-Tutoring | 352025a954bff37d21cc3d59e7d5e0f0269a1f17 | [
"MIT"
] | null | null | null | ch6/review3.py | hajin-kim/2020-HighSchool-Python-Tutoring | 352025a954bff37d21cc3d59e7d5e0f0269a1f17 | [
"MIT"
] | null | null | null | string = input("텍스트를 입력하고 엔터를 눌러주세요: ")
print("입력하신 텍스트는 " + string + " 입니다.")
| 16.2 | 39 | 0.604938 | 11 | 81 | 4.454545 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209877 | 81 | 4 | 40 | 20.25 | 0.765625 | 0 | 0 | 0 | 0 | 0 | 0.45 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
f493d7cd0817e3d0ec5c24c7522973b4fadd1354 | 136 | py | Python | python-package/_lib_file_extension.py | vlad17/BlitzML | f13e089acf7435416bec17e87e5b3130426fc2cd | [
"BSD-3-Clause"
] | 6 | 2015-06-16T05:17:17.000Z | 2018-08-02T05:50:01.000Z | python-package/_lib_file_extension.py | vlad17/BlitzML | f13e089acf7435416bec17e87e5b3130426fc2cd | [
"BSD-3-Clause"
] | 2 | 2018-05-13T13:53:58.000Z | 2019-06-11T14:53:26.000Z | python-package/_lib_file_extension.py | vlad17/BlitzML | f13e089acf7435416bec17e87e5b3130426fc2cd | [
"BSD-3-Clause"
] | 3 | 2018-08-02T05:50:03.000Z | 2021-02-21T04:44:15.000Z | # coding: utf-8
import os
def get_lib_file_extension():
if os.name == 'nt':
# Windows
return "dll"
else:
return "so"
| 11.333333 | 29 | 0.595588 | 20 | 136 | 3.9 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010101 | 0.272059 | 136 | 11 | 30 | 12.363636 | 0.777778 | 0.154412 | 0 | 0 | 0 | 0 | 0.063063 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | true | 0 | 0.166667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f49c7eb4df5681cd9c22969ae67d4cdfbef3a46b | 106 | py | Python | tokenBot.py | mariomtzjr/linqBotPublic | c98ec04dac760669bf2cc5e4155c02e128258e1e | [
"MIT"
] | null | null | null | tokenBot.py | mariomtzjr/linqBotPublic | c98ec04dac760669bf2cc5e4155c02e128258e1e | [
"MIT"
] | null | null | null | tokenBot.py | mariomtzjr/linqBotPublic | c98ec04dac760669bf2cc5e4155c02e128258e1e | [
"MIT"
] | null | null | null | def setToken():
"""Authentication TOKEN for Telegram API
"""
token = ""
return token
| 17.666667 | 45 | 0.566038 | 10 | 106 | 6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.320755 | 106 | 5 | 46 | 21.2 | 0.833333 | 0.349057 | 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 |
f4a0c653be1f76c1bb34789b3d73960eb9797657 | 354 | py | Python | src/169. Majority Element.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/169. Majority Element.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/169. Majority Element.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | class Solution(object):
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
mv, mc = nums[0], 1
for i in xrange(1, len(nums)):
n = nums[i]
if n == mv:
mc += 1
else:
mc -= 1
if mc < 0:
mv, mc = n, 1
return mv
print Solution().majorityElement([1])
print Solution().majorityElement([1,1,2]) | 17.7 | 41 | 0.559322 | 55 | 354 | 3.6 | 0.472727 | 0.060606 | 0.282828 | 0.292929 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042308 | 0.265537 | 354 | 20 | 41 | 17.7 | 0.719231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.142857 | 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 |
f4b1368eec83b00261ba73ef25a25fba54c666b7 | 16 | py | Python | sparkipy/readers/__init__.py | Valuraise/sparkipy | 20448e0c13a3b9c2768a554c26883c27ba87c59e | [
"MIT"
] | 2 | 2019-09-19T10:17:15.000Z | 2019-09-19T21:19:58.000Z | sparkipy/readers/__init__.py | Valuraise/sparkipy | 20448e0c13a3b9c2768a554c26883c27ba87c59e | [
"MIT"
] | null | null | null | sparkipy/readers/__init__.py | Valuraise/sparkipy | 20448e0c13a3b9c2768a554c26883c27ba87c59e | [
"MIT"
] | null | null | null | name = "readers" | 16 | 16 | 0.6875 | 2 | 16 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 16 | 1 | 16 | 16 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0.411765 | 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 |
f4e09fc9c7edaa462b9a75a9111d3dea4c946972 | 4,210 | py | Python | notebooks/libs/PythonLibs/vectors.py | kantel/jupyter | c36e67b146a9f6c5e249e12c48a471c82e9abd49 | [
"MIT"
] | null | null | null | notebooks/libs/PythonLibs/vectors.py | kantel/jupyter | c36e67b146a9f6c5e249e12c48a471c82e9abd49 | [
"MIT"
] | null | null | null | notebooks/libs/PythonLibs/vectors.py | kantel/jupyter | c36e67b146a9f6c5e249e12c48a471c82e9abd49 | [
"MIT"
] | null | null | null | # Copyright (c) 2017, Dr. Edmund Weitz
# simple vector library for educational purposes without any error
# checking or optimizations; not recommended for production use
# to create a new Vector object, call Vector with the components of
# the vector as arguments as in Vector(3, 4, 5)
# alternatively, use something like Vector([3, 4, 5]) or Vector((3, 4, 5)) to create vectors from lists or tuples;
# finally, you can use Vector(M) if M is a matrix
# (see file matrices.py) with only one column or only one row
# there's also a static method Vector.polar to create vectors from a
# length and an angle
# Vector objects are printed as tuples with a "v" in front
# you can read an individual component of a Vector object v using the
# syntax v[2]
# the method len returns the number of components
# copy returns a vector with the same components; you can also create
# a copy of v with Vector(v)
# Vector objects should be treated as if they were immutable;
# specifically, you should not alter the contents of their "comp"
# property
# vectors of the same length can be added or subtracted and you can
# also write -v to create the additive inverse of a vector v
# to multiply a vector v with a scalar a you can write a * v and also
# v * a; furthermore, you can use v / a instead of (1 / a) * v
# v.transpose() will return a one-row matrix with the vector's
# components
# v.norm() returns the Euclidean norm of the vector and v.normalize()
# returns v divided by its norm
# for the dot product of two vectors v and w, write v * w
# if you write v * M where M is a matrix, the result will be the
# product of two matrices where the first factor is the transposed
# vector; for M * v, see matrices.py
# vectors can be used as iterators; specifically, you can use *v if v
# is a Vector object
from math import sqrt, sin, cos
from numbers import Number
import matrices
class Vector (object):
def __init__ (self, *args):
if len(args) == 1:
if type(args[0]) is tuple or type(args[0]) is list:
self.comp = tuple(args[0])
elif type(args[0]) is Vector:
self.comp = args[0].comp
elif type(args[0]) is matrices.Matrix:
if args[0].size()[0] == 1:
self.comp = tuple(args[0].row(0))
elif args[0].size()[1] == 1:
self.comp = tuple(args[0].col(0))
elif isinstance(args[0], Number):
self.comp = args
else:
self.comp = args
def __iter__ (self):
return self.comp.__iter__()
def __repr__ (self):
return "v" + str(self.comp)
@staticmethod
def polar (r, phi):
return r * Vector(cos(phi), sin(phi))
def copy (self):
return Vector(self)
def transpose (self):
return matrices.Matrix([list(self)])
def __mul__ (self, other):
if type(other) is Vector:
return sum(c * o for c, o in zip(self, other))
elif type(other) is matrices.Matrix:
return (self.transpose()) * other
else:
return Vector(*(other * c for c in self))
def __rmul__ (self, other):
return self.__mul__(other)
def __mod__ (self, other):
if len(self) == 3 and type(other) is Vector and len(other) == 3:
return Vector(self[1] * other[2] - self[2] * other[1],
self[2] * other[0] - self[0] * other[2],
self[0] * other[1] - self[1] * other[0])
def norm (self):
return sqrt(self * self)
def normalize (self):
n = self.norm()
if n == 0:
return Vector([0] * len(self))
else:
return Vector(*(c / n for c in self))
def __truediv__ (self, other):
return self.__mul__(1 / other)
def __add__ (self, other):
return Vector(*(c + o for c, o in zip(self, other)))
def __neg__ (self):
return Vector(*(-c for c in self))
def __sub__(self, other):
return self + other.__neg__()
def __len__(self):
return len(self.comp)
def __getitem__(self, key):
return self.comp[key]
| 31.893939 | 114 | 0.607601 | 642 | 4,210 | 3.884735 | 0.261682 | 0.022053 | 0.014435 | 0.017642 | 0.085405 | 0.043304 | 0.01684 | 0.01684 | 0.01684 | 0 | 0 | 0.016795 | 0.292874 | 4,210 | 131 | 115 | 32.137405 | 0.820961 | 0.409976 | 0 | 0.078125 | 0 | 0 | 0.000408 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.265625 | false | 0 | 0.046875 | 0.203125 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
f4e606ee8e5aa63aa55de4d10ff20c49b5b34ced | 536 | py | Python | quantumcat/gates/custom_gates/cirq/cu1_gate.py | santanu-banerjee/quantumcat | bf02f77c7e196c21e964cba37d995e2c1a00a3c5 | [
"Apache-2.0"
] | 20 | 2021-05-10T07:04:41.000Z | 2021-12-13T17:12:05.000Z | quantumcat/gates/custom_gates/cirq/cu1_gate.py | santanu-banerjee/quantumcat | bf02f77c7e196c21e964cba37d995e2c1a00a3c5 | [
"Apache-2.0"
] | 2 | 2021-04-26T05:34:52.000Z | 2021-05-16T13:46:22.000Z | quantumcat/gates/custom_gates/cirq/cu1_gate.py | santanu-banerjee/quantumcat | bf02f77c7e196c21e964cba37d995e2c1a00a3c5 | [
"Apache-2.0"
] | 17 | 2021-04-02T18:09:33.000Z | 2022-02-10T16:38:57.000Z | import cirq
import numpy
class CU1Gate(cirq.Gate):
def __init__(self, lam):
super(CU1Gate, self).__init__()
self.lam = lam
def _num_qubits_(self):
return 2
def _unitary_(self, dtype=None):
exp1 = numpy.exp(1j*self.lam)
return numpy.array([[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, exp1]], dtype=dtype)
def _circuit_diagram_info_(self, args):
return ["CU1_c", "CU1_t"]
| 23.304348 | 58 | 0.483209 | 68 | 536 | 3.529412 | 0.455882 | 0.075 | 0.075 | 0.05 | 0.0625 | 0.0625 | 0.0625 | 0.0625 | 0.0625 | 0.0625 | 0 | 0.069697 | 0.384328 | 536 | 22 | 59 | 24.363636 | 0.657576 | 0 | 0 | 0 | 0 | 0 | 0.018657 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
f4f1757b25fea29bd0209d1749207af46431343f | 1,119 | py | Python | jsonstreamer/tape.py | kashifrazzaqui/json-streamer | 92591a9d8cc1d7431e561420aa29b94e754ef91b | [
"MIT"
] | 207 | 2015-02-10T11:24:26.000Z | 2022-03-10T20:57:32.000Z | jsonstreamer/tape.py | Aanok/r20chronicler | 33fed4f3da552b46e0306867a310136e44b2a411 | [
"Unlicense"
] | 10 | 2015-02-12T17:40:25.000Z | 2021-06-07T12:43:40.000Z | jsonstreamer/tape.py | Aanok/r20chronicler | 33fed4f3da552b46e0306867a310136e44b2a411 | [
"Unlicense"
] | 19 | 2015-07-11T23:46:19.000Z | 2021-06-23T12:21:18.000Z | class Tape:
"""
Allows writing to end of a file-like object while maintaining the read pointer accurately.
The read operation actually removes characters read from the buffer.
"""
def __init__(self, initial_value:str=''):
"""
:param initial_value: initialize the Tape with a preset string
"""
self._buffer = initial_value
def read(self, size:int=None):
"""
:param size: number of characters to read from the buffer
:return: string that has been read from the buffer
"""
if size:
result = self._buffer[0:size]
self._buffer = self._buffer[size:]
return result
else:
result = self._buffer
self._buffer = ''
return result
def write(self, s:str):
"""
:param s: some characters to write to the end of the tape
:return: length of characters written
"""
self._buffer += s
return len(s)
def __len__(self):
return len(self._buffer)
def __str__(self):
return self._buffer
| 27.292683 | 94 | 0.576408 | 135 | 1,119 | 4.6 | 0.385185 | 0.144928 | 0.05314 | 0.082126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001355 | 0.340483 | 1,119 | 40 | 95 | 27.975 | 0.840108 | 0.381591 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0 | 0 | 0.105263 | 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 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
521a7dc7f8ce190e12282ba6d66fc32ad5963e42 | 288 | py | Python | client_dev.py | CanDIG/candig-client | f4acfe593dbcf623070ca0ec04b015aa002ace31 | [
"Apache-2.0"
] | null | null | null | client_dev.py | CanDIG/candig-client | f4acfe593dbcf623070ca0ec04b015aa002ace31 | [
"Apache-2.0"
] | 5 | 2019-04-23T20:08:03.000Z | 2020-01-29T16:51:22.000Z | client_dev.py | CanDIG/candig-client | f4acfe593dbcf623070ca0ec04b015aa002ace31 | [
"Apache-2.0"
] | 1 | 2019-04-24T18:27:16.000Z | 2019-04-24T18:27:16.000Z | """
Simple shim for running the client program during development.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import dev_glue # NOQA
import candig.client.cli as cli
if __name__ == "__main__":
cli.client_main()
| 22.153846 | 62 | 0.788194 | 39 | 288 | 5.205128 | 0.666667 | 0.147783 | 0.236453 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149306 | 288 | 12 | 63 | 24 | 0.828571 | 0.236111 | 0 | 0 | 0 | 0 | 0.037736 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.714286 | 0 | 0.714286 | 0.142857 | 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 |
5225eba717e15373cb88abf55006a95af336cb1a | 23 | py | Python | examples/stats/__init__.py | darkzeb/py-bscscan-api | 78b27162ad6cc1aee92909742a7bda819018b5aa | [
"MIT"
] | 10 | 2021-02-17T17:02:19.000Z | 2022-03-27T15:39:33.000Z | examples/stats/__init__.py | darkzeb/py-bscscan-api | 78b27162ad6cc1aee92909742a7bda819018b5aa | [
"MIT"
] | null | null | null | examples/stats/__init__.py | darkzeb/py-bscscan-api | 78b27162ad6cc1aee92909742a7bda819018b5aa | [
"MIT"
] | 3 | 2021-03-29T05:46:14.000Z | 2021-09-25T14:10:50.000Z | __author__ = 'darkzeb'
| 11.5 | 22 | 0.73913 | 2 | 23 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 23 | 1 | 23 | 23 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0.304348 | 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 |
522c7e421f1e536339e55354c3b2263309a4728d | 1,461 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GLES2/EXT/occlusion_query_boolean.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GLES2/EXT/occlusion_query_boolean.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GLES2/EXT/occlusion_query_boolean.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GLES2_EXT_occlusion_query_boolean'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.GLES2,'GLES2_EXT_occlusion_query_boolean',error_checker=_errors._error_checker)
GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT=_C('GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT',0x8D6A)
GL_ANY_SAMPLES_PASSED_EXT=_C('GL_ANY_SAMPLES_PASSED_EXT',0x8C2F)
GL_CURRENT_QUERY_EXT=_C('GL_CURRENT_QUERY_EXT',0x8865)
GL_QUERY_RESULT_AVAILABLE_EXT=_C('GL_QUERY_RESULT_AVAILABLE_EXT',0x8867)
GL_QUERY_RESULT_EXT=_C('GL_QUERY_RESULT_EXT',0x8866)
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint)
def glBeginQueryEXT(target,id):pass
@_f
@_p.types(None,_cs.GLsizei,arrays.GLuintArray)
def glDeleteQueriesEXT(n,ids):pass
@_f
@_p.types(None,_cs.GLenum)
def glEndQueryEXT(target):pass
@_f
@_p.types(None,_cs.GLsizei,arrays.GLuintArray)
def glGenQueriesEXT(n,ids):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLuintArray)
def glGetQueryObjectuivEXT(id,pname,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLintArray)
def glGetQueryivEXT(target,pname,params):pass
@_f
@_p.types(_cs.GLboolean,_cs.GLuint)
def glIsQueryEXT(id):pass
| 36.525 | 130 | 0.824093 | 229 | 1,461 | 4.855895 | 0.336245 | 0.01259 | 0.044065 | 0.059353 | 0.472122 | 0.273381 | 0.163669 | 0.116906 | 0.079137 | 0.079137 | 0 | 0.019751 | 0.064339 | 1,461 | 39 | 131 | 37.461538 | 0.793709 | 0.068446 | 0 | 0.257143 | 1 | 0 | 0.145495 | 0.116691 | 0 | 0 | 0.022157 | 0 | 0 | 1 | 0.228571 | false | 0.257143 | 0.171429 | 0.028571 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
524e4562eea4dc3ebca19fb40b327d8346950c9f | 172 | py | Python | docs/examples/random_values.py | NotBobTheBuilder/gpiozero | aeb9d30056ec97e6bf896152e71a870bd0099b4e | [
"BSD-3-Clause"
] | 743 | 2019-07-31T02:57:08.000Z | 2022-03-31T08:48:30.000Z | docs/examples/random_values.py | NotBobTheBuilder/gpiozero | aeb9d30056ec97e6bf896152e71a870bd0099b4e | [
"BSD-3-Clause"
] | 259 | 2019-07-29T14:26:40.000Z | 2022-03-27T00:17:56.000Z | docs/examples/random_values.py | NotBobTheBuilder/gpiozero | aeb9d30056ec97e6bf896152e71a870bd0099b4e | [
"BSD-3-Clause"
] | 127 | 2019-08-03T19:30:18.000Z | 2022-02-24T14:33:50.000Z | from gpiozero import PWMLED
from gpiozero.tools import random_values
from signal import pause
led = PWMLED(4)
led.source = random_values()
led.source_delay = 0.1
pause()
| 17.2 | 40 | 0.784884 | 27 | 172 | 4.888889 | 0.555556 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02027 | 0.139535 | 172 | 9 | 41 | 19.111111 | 0.871622 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
52506d3de5fcbb9fc7d9dbd9d679553e5e092933 | 154 | py | Python | pandas_django/src/customers/urls.py | mohsenebrahimyir/django-with-data-science | c876e94ec6e3a7b8e58b731d9627fc73947d43b7 | [
"MIT"
] | null | null | null | pandas_django/src/customers/urls.py | mohsenebrahimyir/django-with-data-science | c876e94ec6e3a7b8e58b731d9627fc73947d43b7 | [
"MIT"
] | null | null | null | pandas_django/src/customers/urls.py | mohsenebrahimyir/django-with-data-science | c876e94ec6e3a7b8e58b731d9627fc73947d43b7 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import *
app_name = "customers"
urlpatterns = [
path('', customer_corr_view, name='main-customers-view'),
] | 19.25 | 61 | 0.714286 | 20 | 154 | 5.35 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149351 | 154 | 8 | 62 | 19.25 | 0.816794 | 0 | 0 | 0 | 0 | 0 | 0.180645 | 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 |
5274305d4c908efadc882126d360933b414d0255 | 163 | py | Python | blackjack/cmake/cmdpart/ScopeTypes.py | grbd/GBD.Build.BlackJack | 3e8d027625b7528af3674a373fd9931e3feaaab4 | [
"Apache-2.0"
] | 1 | 2017-05-26T00:18:26.000Z | 2017-05-26T00:18:26.000Z | blackjack/cmake/cmdpart/ScopeTypes.py | grbd/GBD.Build.BlackJack | 3e8d027625b7528af3674a373fd9931e3feaaab4 | [
"Apache-2.0"
] | null | null | null | blackjack/cmake/cmdpart/ScopeTypes.py | grbd/GBD.Build.BlackJack | 3e8d027625b7528af3674a373fd9931e3feaaab4 | [
"Apache-2.0"
] | null | null | null | from enum import Enum
class ScopeTypes(Enum):
"""Type of Scopes for Include Directories, and definitions"""
INTERFACE = 1
PUBLIC = 2
PRIVATE = 3
| 20.375 | 65 | 0.668712 | 22 | 163 | 5 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02439 | 0.245399 | 163 | 7 | 66 | 23.285714 | 0.861789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.2 | 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 |
527eca07e336c1fa611f20e2f2c6ed2792d5c8ba | 349 | py | Python | deep_phospho/proteomics_utils/colors/rgb_hex.py | weizhenFrank/DeepPhospho | e720b867528d92f9a1a5ec840484989af2b8eb63 | [
"MIT"
] | 2 | 2021-11-25T01:06:18.000Z | 2021-12-22T06:34:53.000Z | deep_phospho/proteomics_utils/colors/rgb_hex.py | weizhenFrank/DeepPhospho | e720b867528d92f9a1a5ec840484989af2b8eb63 | [
"MIT"
] | null | null | null | deep_phospho/proteomics_utils/colors/rgb_hex.py | weizhenFrank/DeepPhospho | e720b867528d92f9a1a5ec840484989af2b8eb63 | [
"MIT"
] | 1 | 2021-04-26T03:00:48.000Z | 2021-04-26T03:00:48.000Z |
def hex_to_rgb(hex_color, base=256):
return tuple(int(hex_color[i:i + 2], 16) for i in (1, 3, 5))
def rgb_to_hex(rgb, with_sharp=False, upper=True):
hex_code = ''.join([hex(one_channel)[2:] for one_channel in rgb])
if with_sharp:
hex_code = '#' + hex_code
if upper:
hex_code = hex_code.upper()
return hex_code
| 26.846154 | 69 | 0.636103 | 62 | 349 | 3.322581 | 0.451613 | 0.203884 | 0.097087 | 0.135922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0369 | 0.223496 | 349 | 12 | 70 | 29.083333 | 0.723247 | 0 | 0 | 0 | 0 | 0 | 0.002874 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0 | 0.111111 | 0.444444 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
528378520db0613464798ca1f3c92937224c8e62 | 67 | py | Python | blankpythonproject/__init__.py | JacksonBurns/blank-python-project | b6cf741b9be4d554c5959d7198c197bf01690709 | [
"MIT"
] | null | null | null | blankpythonproject/__init__.py | JacksonBurns/blank-python-project | b6cf741b9be4d554c5959d7198c197bf01690709 | [
"MIT"
] | null | null | null | blankpythonproject/__init__.py | JacksonBurns/blank-python-project | b6cf741b9be4d554c5959d7198c197bf01690709 | [
"MIT"
] | null | null | null | from .blankpythonproject import placeholder
__version__ = "0.0.0"
| 16.75 | 43 | 0.791045 | 8 | 67 | 6.125 | 0.75 | 0.081633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050847 | 0.119403 | 67 | 3 | 44 | 22.333333 | 0.779661 | 0 | 0 | 0 | 0 | 0 | 0.074627 | 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 |
bfe1a40057a8fda5fadc65d0424b0e95e080cd4e | 2,094 | py | Python | bites/bite199.py | ChidinmaKO/Chobe-bitesofpy | 2f933e6c8877a37d1ce7ef54ea22169fc67417d3 | [
"MIT"
] | null | null | null | bites/bite199.py | ChidinmaKO/Chobe-bitesofpy | 2f933e6c8877a37d1ce7ef54ea22169fc67417d3 | [
"MIT"
] | null | null | null | bites/bite199.py | ChidinmaKO/Chobe-bitesofpy | 2f933e6c8877a37d1ce7ef54ea22169fc67417d3 | [
"MIT"
] | 1 | 2019-07-16T19:12:52.000Z | 2019-07-16T19:12:52.000Z | # see __mro__ output in Bite description# see __mro__ output in Bite description
class Person:
def __str__(self):
return f"I am a person"
class Father(Person):
def __str__(self):
return f"{super().__str__()} and cool daddy"
class Mother(Person):
def __str__(self):
return f"{super().__str__()} and awesome mom"
class Child(Father, Mother):
def __str__(self):
return f"I am the coolest kid"
# tests
import inspect
import pytest
from person import Person, Father, Mother, Child
@pytest.fixture
def person():
return Person()
@pytest.fixture
def dad():
return Father()
@pytest.fixture
def mom():
return Mother()
@pytest.fixture
def child():
return Child()
def test_string_repr_person(person):
assert str(person) == 'I am a person'
def test_string_repr_dad(dad):
assert str(dad) == 'I am a person and cool daddy'
def test_string_repr_mom(mom):
assert str(mom) == 'I am a person and awesome mom'
def test_string_repr_child(child):
assert str(child) == 'I am the coolest kid'
def test_mro_of_person():
assert Person.__mro__ == (Person, object)
def test_mro_of_dad():
assert Father.__mro__ == (Father, Person, object)
def test_mro_of_mom():
assert Mother.__mro__ == (Mother, Person, object)
def test_mro_of_child():
assert Child.__mro__ == (Child, Father, Mother, Person, object)
def test_subclass_person():
assert issubclass(Person, object)
def test_subclass_dad():
assert issubclass(Father, Person)
assert issubclass(Father, object)
def test_subclass_mom():
assert issubclass(Mother, Person)
assert issubclass(Mother, object)
def test_subclass_child():
assert issubclass(Child, Father)
assert issubclass(Child, Mother)
assert issubclass(Child, Person)
assert issubclass(Child, object)
def test_use_inheritance():
# dry code!
# should not duplicate substr in subclass
substr = 'I am a person'
for src in (inspect.getsource(Father),
inspect.getsource(Mother)):
assert substr not in src | 19.211009 | 80 | 0.688157 | 286 | 2,094 | 4.751748 | 0.188811 | 0.066961 | 0.076527 | 0.036792 | 0.26858 | 0.179544 | 0.07947 | 0.050037 | 0.050037 | 0 | 0 | 0 | 0.209647 | 2,094 | 109 | 81 | 19.211009 | 0.821148 | 0.063515 | 0 | 0.131148 | 0 | 0 | 0.104806 | 0 | 0 | 0 | 0 | 0 | 0.295082 | 1 | 0.344262 | false | 0 | 0.04918 | 0.131148 | 0.590164 | 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 |
bfef6a7419b193cc14753fa9fbc374a5ecd7fbe3 | 369 | py | Python | main/admin.py | molinitomario/feynman-it | e471003df25f2b068f5e9fbd1c4cff3620c9b9a6 | [
"MIT"
] | null | null | null | main/admin.py | molinitomario/feynman-it | e471003df25f2b068f5e9fbd1c4cff3620c9b9a6 | [
"MIT"
] | 8 | 2021-09-22T01:11:36.000Z | 2021-10-10T15:36:48.000Z | main/admin.py | molinitomario/feynman-it | e471003df25f2b068f5e9fbd1c4cff3620c9b9a6 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Permission
from .models import User, Note, Folder, Link, Iteration
admin.site.register(User, UserAdmin)
admin.site.register(Permission)
admin.site.register(Note)
admin.site.register(Folder)
admin.site.register(Link)
admin.site.register(Iteration)
| 28.384615 | 55 | 0.821138 | 52 | 369 | 5.826923 | 0.307692 | 0.178218 | 0.336634 | 0.138614 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078591 | 369 | 12 | 56 | 30.75 | 0.891176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
bff07ba69884c004b8817dde6a92b92e1b90a83d | 607 | py | Python | mclumi/__init__.py | cribbslab/mclumi | 3c38f1dd4de11f0f20121a4027f7e104c4059bbe | [
"MIT"
] | 3 | 2021-12-18T09:55:09.000Z | 2022-01-12T10:25:28.000Z | mclumi/__init__.py | cribbslab/mclumi | 3c38f1dd4de11f0f20121a4027f7e104c4059bbe | [
"MIT"
] | null | null | null | mclumi/__init__.py | cribbslab/mclumi | 3c38f1dd4de11f0f20121a4027f7e104c4059bbe | [
"MIT"
] | null | null | null | __all__ = [
'align',
'deduplicate',
'fastq',
'network',
'trim',
'util',
]
from .deduplicate import *
from .align import *
from .fastq import *
from .network import *
from .trim import *
from .util import *
from .Main import *
from .Path import *
# ## /*** block. local ***/
# try:
# from mclumi.deduplicate import *
# from mclumi.align import *
# from mclumi.fastq import *
# from mclumi.network import *
# from mclumi.trim import *
# from mclumi.util import *
# from mclumi.Main import *
# from mclumi.Path import *
# except ImportError:
# pass | 20.233333 | 38 | 0.614498 | 69 | 607 | 5.347826 | 0.26087 | 0.379404 | 0.303523 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.257002 | 607 | 30 | 39 | 20.233333 | 0.818182 | 0.507414 | 0 | 0 | 0 | 0 | 0.126761 | 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 |
872f154c3a94b8074ae5565f5b8b694582d83751 | 142 | py | Python | alice/makebrain.py | ekt1701/Alexa-AIML-Chatbot | e2135a524ca62a8ad5bc0fa8cdcec3d3d48e62a7 | [
"MIT"
] | 2 | 2017-07-20T14:22:22.000Z | 2019-03-27T13:23:50.000Z | alice/makebrain.py | ekt1701/Alexa-AIML-Chatbot | e2135a524ca62a8ad5bc0fa8cdcec3d3d48e62a7 | [
"MIT"
] | 1 | 2017-10-24T19:28:16.000Z | 2017-10-24T19:28:16.000Z | alice/makebrain.py | ekt1701/Alexa-AIML-Chatbot | e2135a524ca62a8ad5bc0fa8cdcec3d3d48e62a7 | [
"MIT"
] | null | null | null | import os
import aiml
bot = aiml.Kernel()
bot.bootstrap(learnFiles = "startup.xml", commands = "LOAD ALICE")
bot.saveBrain("bot_brain.brn")
| 17.75 | 66 | 0.732394 | 20 | 142 | 5.15 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119718 | 142 | 7 | 67 | 20.285714 | 0.824 | 0 | 0 | 0 | 0 | 0 | 0.239437 | 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 |
873a0d05832e14cd7378b8cffbec637b3fc4f3ce | 210 | py | Python | CustomUploader/CustomUploader.py | JBAnderson/MalwareCollectorSlack | 049b2fd8a71a5f629e7ebe5e096881c11685be07 | [
"MIT"
] | 4 | 2017-07-21T23:20:00.000Z | 2020-04-19T16:34:06.000Z | CustomUploader/CustomUploader.py | JBAnderson/MalwareCollectorSlack | 049b2fd8a71a5f629e7ebe5e096881c11685be07 | [
"MIT"
] | 2 | 2017-11-01T23:30:46.000Z | 2017-11-01T23:31:15.000Z | CustomUploader/CustomUploader.py | JBAnderson/MalwareCollectorSlack | 049b2fd8a71a5f629e7ebe5e096881c11685be07 | [
"MIT"
] | null | null | null | # CustomUploader.py
import requests
def CustomUploader(n):
url = 'http://IP.OF.YOUR.MHN.DROPLET:8080/upload'
files = {'file':open(n, 'rb')}
r = requests.post(url, files=files)
| 23.333333 | 58 | 0.595238 | 27 | 210 | 4.62963 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025157 | 0.242857 | 210 | 8 | 59 | 26.25 | 0.761006 | 0.080952 | 0 | 0 | 0 | 0 | 0.247368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.2 | 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 |
874471f884b8601cb7cb8c89541d1017463bbd39 | 6,949 | py | Python | 000_novice/python/problems.py | paulohrpinheiro/test-driven-learning | 84f2eb98152d815e3d1703e893c0341064099065 | [
"MIT"
] | 10 | 2016-02-16T15:57:33.000Z | 2021-07-28T17:44:17.000Z | 000_novice/python/problems.py | DavidGomesh/test-driven-learning | 84f2eb98152d815e3d1703e893c0341064099065 | [
"MIT"
] | 1 | 2016-02-27T20:33:52.000Z | 2016-02-27T20:33:52.000Z | 000_novice/python/problems.py | DavidGomesh/test-driven-learning | 84f2eb98152d815e3d1703e893c0341064099065 | [
"MIT"
] | 4 | 2016-02-27T15:31:53.000Z | 2021-02-22T19:19:53.000Z | """
Test Driven Learning Project.
Desenvolva TDD e programação com TDD e programação!
Módulo novice.
The MIT License (MIT)
Copyright (c) 2016 Paulo Henrique Rodrigues Pinheiro <paulohrpinheiro@gmail.com>
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.
>>> __name__
'__main__'
"""
# Precisa de algum módulo? importe aqui:
def negue(valor):
"""
A função `negue` deve receber um valor boleano (verdadeiro ou falso) e
retornar a negação desse valor.
>>> negue(True)
False
>>> negue(False)
True
"""
# no lugar desse 'pass', coloque seu código
pass
def diga_ola(nome):
"""A função `diga_ola` deve ser escrita de tal forma que receba como
parâmetro um argumento *string*. Deve retornar a *string* "Olá, ", seguida
do argumento recebido, mais um ponto final. A *string* recebida deve estar
limpa, ou seja, sem caracteres de espaço no começo ou no fim. Se a *string*
estiver vazia, retorna apenas "Olá!"
>>> diga_ola('')
'Olá!'
>>> diga_ola(' ')
'Olá!'
>>> diga_ola('Paulo')
'Olá, Paulo.'
>>> diga_ola(' Paulo ')
'Olá, Paulo.'
"""
# no lugar desse 'pass', coloque seu código
pass
def lista_numeros_pares(quantos):
"""A função `lista_numeros_pares` deve receber um parâmetro numérico
inteiro que determina quantos números pares devem estar em um array que
será o retorno da função.
>>> lista_numeros_pares(0)
[]
>>> lista_numeros_pares(1)
[2]
>>> lista_numeros_pares(4)
[2, 4, 6, 8]
>>> lista_numeros_pares(5)
[2, 4, 6, 8, 10]
>>> lista_numeros_pares(-1)
[]
"""
# no lugar desse 'pass', coloque seu código
pass
def lista_multiplos(quantos, base):
"""A função `lista_multiplos` deve receber dois parâmetros numéricos
inteiros e retornar uma lista de números inteiros. O tamanho da lista é
determinado pelo primeiro parâmetro, e o número base será o segundo
parâmetro.
>>> lista_multiplos(0, 10)
[]
>>> lista_multiplos(-1, 10)
[]
>>> lista_multiplos(3, -1)
[-3, -2, -1]
>>> lista_multiplos(3, 0)
[]
>>> lista_multiplos(3, 10)
[10, 20, 30]
"""
# no lugar desse 'pass', coloque seu código
pass
def soma(inteiros):
"""A função `soma` deve receber um *array* de números inteiros, e retornar
a sua soma. Se a lista for vazia, deve retornar zero.
>>> soma([])
0
>>> soma([1])
1
>>> soma([1, 2])
3
"""
# no lugar desse 'pass', coloque seu código
pass
def subtracao(inteiros):
"""A função `subtracao` deve receber um *array* de números inteiros, e
retornar a subtração de todos os elementos em sequência. Por exemplo,
subtracao([3,2,1]) deve retornar 0, e subtracao([10,2,3]) deve retornar 5.
Se a lista for vazia, deve retornar zero.
>>> subtracao([3, 2, 1])
0
>>> subtracao([10, 2, 3])
5
>>> subtracao([])
0
>>> subtracao([1, 2])
-1
>>> subtracao([-1, -2, -3])
4
>>> subtracao([9, 3, 2, 1])
3
"""
# no lugar desse 'pass', coloque seu código
pass
def multiplicacao(inteiros):
"""A função `multiplicação` deve receber um *array* de números inteiros, e
retornar o seu produto. Se a lista for vazia, deve retornar zero.
>>> multiplicacao([1, 2, 3])
6
>>> multiplicacao([])
0
>>> multiplicacao([-2, 1, 4])
-8
>>> multiplicacao([-2, -1, 4])
8
"""
# no lugar desse 'pass', coloque seu código
pass
def divisao(inteiros):
"""A função `divisao` deve receber um *array* de números inteiros, e
retornar o resultado da sequência de divisões por cada elemento. Por
exemplo, divisão([16, 4, 2]) deve retornar 2, e divisão([100,2,10]) deve
retornar 5. Se a lista for vazia, deve retornar zero.
>>> divisao([5, 2])
2
>>> divisao([])
0
>>> divisao([0])
0
>>> divisao([0, 1])
0
>>> divisao([1, 0])
Traceback (most recent call last):
...
return functools.reduce(operator.floordiv, inteiros)
ZeroDivisionError: integer division or modulo by zero
"""
# no lugar desse 'pass', coloque seu código
pass
def operacao(operador, inteiros):
"""A função `operacao` deve receber dois parâmetros. O primeiro parâmetro é
um caractere indicando a operação aritmética básica a ser realizada ('+',
'-', '\*', '/'). O segundo parâmetro é um *array* de números inteiros, para
os quais a operação deve ser aplicada. A função deve retornar o resultado
da operação no *array*. Chame as funções já criadas para cada operação. Em
caso de operação inválida, gere uma exceção.
>>> operacao('+', [1, 2])
3
>>> operacao('-', [1, 2])
-1
>>> operacao('*', [1, 2])
2
>>> operacao('/', [1, 2])
0
>>> operacao('=', [1, 2])
Traceback (most recent call last):
...
Exception: Operador inválido
"""
# no lugar desse 'pass', coloque seu código
pass
def maior(inteiros):
"""A função `maior` deve receber um *array* de números inteiros e retornar
qual é o maior deles.
>>> maior([0, 1 ,100])
100
>>> maior([0])
0
>>> maior([])
Traceback (most recent call last):
...
ValueError: max() arg is an empty sequence
"""
# no lugar desse 'pass', coloque seu código
pass
def intersecao(a, b):
"""A função `intersecao` deve receber dois *arrays* contendo números
inteiros, e retornar a interseção entre os conjuntos, ou seja, um *array*
que contenha apenas os números que estejam contidos nos dois *arrays*
passados para a função.
>>> intersecao([], [])
[]
>>> intersecao([1, 2], [3, 4])
[]
>>> intersecao([1, 2], [2, 3])
[2]
"""
# no lugar desse 'pass', coloque seu código
pass
if __name__ == "__main__":
"""Se executar o script, os testes serão executados."""
import doctest
doctest.testmod(verbose=True)
| 25.929104 | 80 | 0.635343 | 956 | 6,949 | 4.573222 | 0.3159 | 0.020814 | 0.030192 | 0.040256 | 0.238564 | 0.193504 | 0.186642 | 0.186642 | 0.163769 | 0.100183 | 0 | 0.028277 | 0.246798 | 6,949 | 267 | 81 | 26.026217 | 0.807031 | 0.812491 | 0 | 0.44 | 0 | 0 | 0.012987 | 0 | 0 | 0 | 0 | 0.003745 | 0 | 1 | 0.44 | false | 0.44 | 0.04 | 0 | 0.48 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 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.