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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35d6581a2c709a8bc2bab9b814493d970210ca9c | 196 | py | Python | ckanext/example_blanket_implementation/helpers.py | EricSoroos/ckan | aa3097637534f9fd4bff153adf7931f1f28c78d4 | [
"BSD-3-Clause"
] | 2,805 | 2015-01-02T18:13:15.000Z | 2022-03-31T03:35:01.000Z | ckanext/example_blanket_implementation/helpers.py | EricSoroos/ckan | aa3097637534f9fd4bff153adf7931f1f28c78d4 | [
"BSD-3-Clause"
] | 3,801 | 2015-01-02T11:05:36.000Z | 2022-03-31T19:24:37.000Z | ckanext/example_blanket_implementation/helpers.py | EricSoroos/ckan | aa3097637534f9fd4bff153adf7931f1f28c78d4 | [
"BSD-3-Clause"
] | 1,689 | 2015-01-02T19:46:43.000Z | 2022-03-28T14:59:43.000Z | # -*- coding: utf-8 -*-
# must be ignored by blanket
from random import randrange
def blanket_helper():
pass
def _hidden_helper():
pass
def bed():
pass
def pillow():
pass
| 9.333333 | 28 | 0.622449 | 26 | 196 | 4.576923 | 0.692308 | 0.176471 | 0.218487 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006944 | 0.265306 | 196 | 20 | 29 | 9.8 | 0.819444 | 0.244898 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.444444 | true | 0.444444 | 0.111111 | 0 | 0.555556 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
ea135785533f758932cbe4f1841c0f7ea258eb34 | 113 | py | Python | utils/out_of.py | Tijana37/chimera | bd496e43ba4bb8949eb593ce412b5e91aaae7023 | [
"MIT"
] | 125 | 2019-04-09T10:29:48.000Z | 2022-02-24T07:57:09.000Z | utils/out_of.py | Tijana37/chimera | bd496e43ba4bb8949eb593ce412b5e91aaae7023 | [
"MIT"
] | 23 | 2019-04-10T08:38:40.000Z | 2022-03-10T13:33:30.000Z | utils/out_of.py | Tijana37/chimera | bd496e43ba4bb8949eb593ce412b5e91aaae7023 | [
"MIT"
] | 26 | 2019-04-09T11:02:19.000Z | 2022-03-06T06:37:30.000Z | def out_of(numerator, denominator):
if denominator == 0:
return 0
return numerator / denominator
| 22.6 | 35 | 0.672566 | 13 | 113 | 5.769231 | 0.615385 | 0.533333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02381 | 0.256637 | 113 | 4 | 36 | 28.25 | 0.869048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
ea4149a793a0b89867728d3d17f62373ec83f98c | 211 | py | Python | tensorprob/distributions/__init__.py | ibab/tensorfit | 53bbb324520f34335a272dc057c3ae6e9d2c575e | [
"MIT"
] | 95 | 2016-02-29T08:25:07.000Z | 2021-06-02T15:33:01.000Z | tensorprob/distributions/__init__.py | tensorprob/tensorprob | 53bbb324520f34335a272dc057c3ae6e9d2c575e | [
"MIT"
] | 27 | 2016-02-29T14:49:16.000Z | 2019-04-28T21:01:38.000Z | tensorprob/distributions/__init__.py | ibab/tensorfit | 53bbb324520f34335a272dc057c3ae6e9d2c575e | [
"MIT"
] | 19 | 2016-02-29T00:14:34.000Z | 2020-06-18T06:07:39.000Z | from .combinators import Mix2, Mix3, MixN
from .exponential import Exponential
from .normal import Normal
from .poisson import Poisson
from .polynomial import Polynomial
from .uniform import Uniform, UniformInt
| 30.142857 | 41 | 0.829384 | 27 | 211 | 6.481481 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.127962 | 211 | 6 | 42 | 35.166667 | 0.940217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
ea4caaeb3e0e658f4e68a3cb303293a414c0a713 | 151 | py | Python | py_tdlib/constructors/update_unread_message_count.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/update_unread_message_count.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/update_unread_message_count.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Type
class updateUnreadMessageCount(Type):
unread_count = None # type: "int32"
unread_unmuted_count = None # type: "int32"
| 21.571429 | 45 | 0.741722 | 18 | 151 | 6.055556 | 0.611111 | 0.165138 | 0.238532 | 0.330275 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031496 | 0.15894 | 151 | 6 | 46 | 25.166667 | 0.826772 | 0.178808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
ea6a3e6f907c9bc416e8948a0d3f6c54d71f77da | 95 | py | Python | api/wecubek8s/wecubek8s/apps/model/__init__.py | zgyzgyhero/wecube-plugins-kubernetes | 99982a7a21dff2e54653ecf61055c54e08065087 | [
"Apache-2.0"
] | 6 | 2020-12-07T01:32:40.000Z | 2021-07-16T05:52:41.000Z | api/wecubek8s/wecubek8s/apps/model/__init__.py | zgyzgyhero/wecube-plugins-kubernetes | 99982a7a21dff2e54653ecf61055c54e08065087 | [
"Apache-2.0"
] | 1 | 2021-06-11T13:18:24.000Z | 2021-06-11T13:18:24.000Z | api/wecubek8s/wecubek8s/apps/model/__init__.py | zgyzgyhero/wecube-plugins-kubernetes | 99982a7a21dff2e54653ecf61055c54e08065087 | [
"Apache-2.0"
] | 2 | 2020-12-23T08:17:13.000Z | 2021-06-11T13:10:16.000Z | # coding=utf-8
from __future__ import absolute_import
from wecubek8s.apps.model import route
| 15.833333 | 38 | 0.821053 | 14 | 95 | 5.214286 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024096 | 0.126316 | 95 | 5 | 39 | 19 | 0.855422 | 0.126316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
ea6ded8bab1795bfe1c4dae24591f950dcbcc31e | 83 | py | Python | addons/azureblobstorage/__init__.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 11 | 2018-12-11T16:39:40.000Z | 2022-02-26T09:51:32.000Z | addons/azureblobstorage/__init__.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 52 | 2018-04-13T05:03:21.000Z | 2022-03-22T02:56:19.000Z | addons/azureblobstorage/__init__.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 16 | 2018-07-09T01:44:51.000Z | 2021-06-30T01:57:16.000Z | default_app_config = 'addons.azureblobstorage.apps.AzureBlobStorageAddonAppConfig'
| 41.5 | 82 | 0.891566 | 7 | 83 | 10.285714 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036145 | 83 | 1 | 83 | 83 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0.710843 | 0.710843 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
5785bebb8b99f6f426d996bd4996ff8f7a96ecd3 | 125 | py | Python | LeetCode/Arrays/Squares of a Sorted Array.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 13 | 2021-09-02T07:30:02.000Z | 2022-03-22T19:32:03.000Z | LeetCode/Dec 2020 Leetcoding Challenge/Squares of a Sorted Array.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | null | null | null | LeetCode/Dec 2020 Leetcoding Challenge/Squares of a Sorted Array.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 3 | 2021-08-24T16:06:22.000Z | 2021-09-17T15:39:53.000Z | class Solution:
def sortedSquares(self, nums: List[int]) -> List[int]:
return sorted([num * num for num in nums]) | 41.666667 | 58 | 0.648 | 18 | 125 | 4.5 | 0.722222 | 0.17284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216 | 125 | 3 | 59 | 41.666667 | 0.826531 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
579622e811cc4324f791db68eeb0a36cb74b42e9 | 135 | py | Python | app/login/__init__.py | RandyDeng/InterviewScheduler | 044d39873c4efb0d523772c42af62e8699336f63 | [
"MIT"
] | null | null | null | app/login/__init__.py | RandyDeng/InterviewScheduler | 044d39873c4efb0d523772c42af62e8699336f63 | [
"MIT"
] | null | null | null | app/login/__init__.py | RandyDeng/InterviewScheduler | 044d39873c4efb0d523772c42af62e8699336f63 | [
"MIT"
] | null | null | null | from flask import Blueprint
login = Blueprint('login', __name__, url_prefix='/login',
template_folder='templates')
| 22.5 | 57 | 0.666667 | 14 | 135 | 6 | 0.785714 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 135 | 5 | 58 | 27 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.666667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 5 |
579ec4b890b8370b7dd232335c696f3ef5b29bcd | 6,544 | py | Python | homework/hw07/editor/arithmetic.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | 3 | 2021-11-21T06:09:39.000Z | 2022-03-12T08:05:27.000Z | project/pro4-scheme/editor/arithmetic.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | project/pro4-scheme/editor/arithmetic.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | from typing import List
from datamodel import Expression, Number, bools, SingletonFalse, ValueHolder, Pair, SingletonTrue
from environment import global_attr
from evaluate_apply import Frame
from helper import assert_all_numbers, verify_exact_callable_length, verify_min_callable_length
from primitives import BuiltIn, SingleOperandPrimitive
@global_attr("+")
class Add(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame):
assert_all_numbers(operands)
return Number(sum(operand.value for operand in operands))
@global_attr("-")
class Subtract(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame):
verify_min_callable_length(self, 1, len(operands))
assert_all_numbers(operands)
if len(operands) == 1:
return Number(-operands[0].value)
return Number(operands[0].value - sum(operand.value for operand in operands[1:]))
@global_attr("*")
class Multiply(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame):
assert_all_numbers(operands)
out = 1
for operand in operands:
out *= operand.value
return Number(out)
@global_attr("/")
class Divide(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_min_callable_length(self, 1, len(operands))
assert_all_numbers(operands)
if len(operands) == 1:
return Number(1 / operands[0].value)
out = operands[0].value
for operand in operands[1:]:
out /= operand.value
return Number(out)
@global_attr("abs")
class Abs(SingleOperandPrimitive):
def execute_simple(self, operand: Expression) -> Expression:
assert_all_numbers([operand])
return Number(abs(operand.value))
@global_attr("expt")
class Expt(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
return Number(operands[0].value ** operands[1].value)
@global_attr("modulo")
class Modulo(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
return Number(operands[0].value % abs(operands[1].value))
@global_attr("quotient")
class Quotient(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
negate = (operands[0].value < 0) != (operands[1].value < 0)
negate = -1 if negate else 1
return Number(negate * operands[0].value // operands[1].value)
@global_attr("remainder")
class Remainder(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
negate = (operands[0].value < 0)
negate = -1 if negate else 1
return Number(negate * (abs(operands[0].value) % abs(operands[1].value)))
@global_attr("=")
class NumEq(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
return bools[operands[0].value == operands[1].value]
@global_attr("<")
class Less(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
return bools[operands[0].value < operands[1].value]
@global_attr("<=")
class LessOrEq(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
return bools[operands[0].value <= operands[1].value]
@global_attr(">")
class Greater(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
return bools[operands[0].value > operands[1].value]
@global_attr(">=")
class GreaterOrEq(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame) -> Expression:
verify_exact_callable_length(self, 2, len(operands))
assert_all_numbers(operands)
return bools[operands[0].value >= operands[1].value]
@global_attr("even?")
class IsEven(SingleOperandPrimitive):
def execute_simple(self, operand: Expression) -> Expression:
assert_all_numbers([operand])
return bools[not operand.value % 2]
@global_attr("odd?")
class IsOdd(SingleOperandPrimitive):
def execute_simple(self, operand: Expression) -> Expression:
assert_all_numbers([operand])
return bools[operand.value % 2]
@global_attr("zero?")
class IsZero(SingleOperandPrimitive):
def execute_simple(self, operand: Expression) -> Expression:
assert_all_numbers([operand])
return bools[operand.value == 0]
@global_attr("not")
class Not(SingleOperandPrimitive):
def execute_simple(self, operand: Expression) -> Expression:
return bools[operand is SingletonFalse]
@global_attr("eq?")
class IsEq(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame):
verify_exact_callable_length(self, 2, len(operands))
if all(isinstance(x, ValueHolder) for x in operands):
return bools[operands[0].value == operands[1].value]
return bools[operands[0] is operands[1]]
@global_attr("equal?")
class IsEqual(BuiltIn):
def execute_evaluated(self, operands: List[Expression], frame: Frame):
verify_exact_callable_length(self, 2, len(operands))
if all(isinstance(x, ValueHolder) for x in operands):
return bools[operands[0].value == operands[1].value]
elif all(isinstance(x, Pair) for x in operands):
return bools[IsEqual().execute_evaluated([operands[0].first, operands[1].first], frame) is SingletonTrue and
IsEqual().execute_evaluated([operands[0].rest, operands[1].rest], frame) is SingletonTrue]
else:
return IsEq().execute_evaluated(operands, frame)
| 36.154696 | 120 | 0.693918 | 787 | 6,544 | 5.609911 | 0.105464 | 0.047565 | 0.065232 | 0.088335 | 0.795243 | 0.763986 | 0.748358 | 0.732503 | 0.684711 | 0.669309 | 0 | 0.01203 | 0.187042 | 6,544 | 180 | 121 | 36.355556 | 0.817857 | 0 | 0 | 0.442029 | 0 | 0 | 0.010238 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 1 | 0.144928 | false | 0 | 0.043478 | 0.007246 | 0.514493 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
57e087f0b7740e759af09d12ede4b216037a0286 | 294 | py | Python | brick/ida/modules/postprocessor/uefi/rt/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 60 | 2021-06-20T15:12:41.000Z | 2022-03-29T10:47:01.000Z | brick/ida/modules/postprocessor/uefi/rt/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 3 | 2021-09-21T14:20:57.000Z | 2022-02-06T23:31:56.000Z | brick/ida/modules/postprocessor/uefi/rt/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 7 | 2021-06-20T16:31:28.000Z | 2022-03-29T10:47:03.000Z | from ..factory.factory import UefiCallFactory
from .GetVariable import GetVariableCall
from .SetVariable import SetVariableCall
EfiRuntimeServices = UefiCallFactory()
EfiRuntimeServices.register('GetVariable', GetVariableCall)
EfiRuntimeServices.register('SetVariable', SetVariableCall) | 36.75 | 62 | 0.843537 | 23 | 294 | 10.782609 | 0.434783 | 0.209677 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088435 | 294 | 8 | 63 | 36.75 | 0.925373 | 0 | 0 | 0 | 0 | 0 | 0.074576 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
17e21582b0b199c5771064bb37546426d546f9fb | 169 | py | Python | tests/web_platform/css_flexbox_1/test_flexbox_align_self_flexend.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/css_flexbox_1/test_flexbox_align_self_flexend.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/css_flexbox_1/test_flexbox_align_self_flexend.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | 1 | 2020-01-16T01:56:41.000Z | 2020-01-16T01:56:41.000Z | from tests.utils import W3CTestCase
class TestFlexbox_AlignSelfFlexend(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'flexbox_align-self-flexend'))
| 28.166667 | 81 | 0.816568 | 19 | 169 | 6.894737 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019355 | 0.08284 | 169 | 5 | 82 | 33.8 | 0.825806 | 0 | 0 | 0 | 0 | 0 | 0.154762 | 0.154762 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
17ef21c8ca707c9aaae93653cac4e1d3d6197360 | 916 | py | Python | steinbock/_cli/__init__.py | TambourineClub/steinbock | 548ccf69e80a1ec3cb144a16ec67070fcab5474c | [
"MIT"
] | 1 | 2022-03-03T13:22:27.000Z | 2022-03-03T13:22:27.000Z | steinbock/_cli/__init__.py | TambourineClub/steinbock | 548ccf69e80a1ec3cb144a16ec67070fcab5474c | [
"MIT"
] | null | null | null | steinbock/_cli/__init__.py | TambourineClub/steinbock | 548ccf69e80a1ec3cb144a16ec67070fcab5474c | [
"MIT"
] | null | null | null | import click
from .apps import apps_cmd_group
from .utils import OrderedClickGroup
from ..preprocessing._cli import preprocess_cmd_group
from ..classification._cli import classify_cmd_group
from ..segmentation._cli import segment_cmd_group
from ..measurement._cli import measure_cmd_group
from ..export._cli import export_cmd_group
from ..utils._cli import utils_cmd_group
from .._version import version as steinbock_version
@click.group(name="steinbock", cls=OrderedClickGroup)
@click.version_option(steinbock_version)
def steinbock_cmd_group():
pass
steinbock_cmd_group.add_command(preprocess_cmd_group)
steinbock_cmd_group.add_command(classify_cmd_group)
steinbock_cmd_group.add_command(segment_cmd_group)
steinbock_cmd_group.add_command(measure_cmd_group)
steinbock_cmd_group.add_command(export_cmd_group)
steinbock_cmd_group.add_command(utils_cmd_group)
steinbock_cmd_group.add_command(apps_cmd_group)
| 33.925926 | 53 | 0.867904 | 133 | 916 | 5.518797 | 0.210526 | 0.239782 | 0.185286 | 0.190736 | 0.322888 | 0.286104 | 0.286104 | 0 | 0 | 0 | 0 | 0 | 0.067686 | 916 | 26 | 54 | 35.230769 | 0.859485 | 0 | 0 | 0 | 0 | 0 | 0.009825 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.047619 | true | 0.047619 | 0.47619 | 0 | 0.52381 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
aa3f382040329137afc046052ede2f1d8bbee1f5 | 1,818 | py | Python | test/python/interfaces/unit_message.py | ztnel/SimpleDBus | 8531bedffd274278445cc78c25f2fb6cf278ed3e | [
"MIT"
] | 1 | 2022-01-08T15:25:46.000Z | 2022-01-08T15:25:46.000Z | third_party/SimpleDBus/test/python/interfaces/unit_message.py | HDPNC/brainflow | ede79fbd5fcc823c1c64bcc3af3e88b4d12177bf | [
"MIT"
] | null | null | null | third_party/SimpleDBus/test/python/interfaces/unit_message.py | HDPNC/brainflow | ede79fbd5fcc823c1c64bcc3af3e88b4d12177bf | [
"MIT"
] | null | null | null | from dbus_next.service import ServiceInterface, method
class MessageUnit(ServiceInterface):
def __init__(self, bus):
self.bus = bus
super().__init__("simpledbus.tester.message")
def export(self):
self.bus.export("/", self)
@method()
def Reset(self):
"""
Resets the state of the tester.
"""
pass
@method()
def SendReceiveBoolean(self, value: "b") -> "b":
return value
@method()
def SendReceiveByte(self, value: "y") -> "y":
return value
@method()
def SendReceiveInt16(self, value: "n") -> "n":
return value
@method()
def SendReceiveUint16(self, value: "q") -> "q":
return value
@method()
def SendReceiveInt32(self, value: "i") -> "i":
return value
@method()
def SendReceiveUint32(self, value: "u") -> "u":
return value
@method()
def SendReceiveInt64(self, value: "x") -> "x":
return value
@method()
def SendReceiveUint64(self, value: "t") -> "t":
return value
@method()
def SendReceiveDouble(self, value: "d") -> "d":
return value
@method()
def SendReceiveString(self, value: "s") -> "s":
return value
@method()
def SendReceiveObjectPath(self, value: "o") -> "o":
return value
@method()
def SendReceiveSignature(self, value: "g") -> "g":
return value
@method()
def SendReceiveArrayInt32(self, value: "ai") -> "ai":
return value
@method()
def SendReceiveArrayString(self, value: "as") -> "as":
return value
@method()
def SendReceiveDictInt32(self, value: "a{iv}") -> "a{iv}":
return value
@method()
def SendReceiveDictString(self, value: "a{sv}") -> "a{sv}":
return value
| 22.170732 | 63 | 0.561056 | 188 | 1,818 | 5.37766 | 0.31383 | 0.151335 | 0.252226 | 0.296736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012346 | 0.287129 | 1,818 | 81 | 64 | 22.444444 | 0.767747 | 0.017052 | 0 | 0.568966 | 0 | 0 | 0.044243 | 0.01418 | 0 | 0 | 0 | 0 | 0 | 1 | 0.327586 | false | 0.017241 | 0.017241 | 0.275862 | 0.637931 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
35333771b41ae9d821aa703ce5ea90bd6a42d5b7 | 37 | py | Python | src/server_design/algorithms/compressor/designSolutions/sol_788.py | robertpardillo/Funnel | f45e419f55e085bbb95e17c47b4c94a7c625ba9b | [
"MIT"
] | 1 | 2021-05-18T16:10:49.000Z | 2021-05-18T16:10:49.000Z | src/server_design/algorithms/compressor/designSolutions/sol_788.py | robertpardillo/Funnel | f45e419f55e085bbb95e17c47b4c94a7c625ba9b | [
"MIT"
] | null | null | null | src/server_design/algorithms/compressor/designSolutions/sol_788.py | robertpardillo/Funnel | f45e419f55e085bbb95e17c47b4c94a7c625ba9b | [
"MIT"
] | null | null | null | def sol788(design_parameters):
pass | 18.5 | 31 | 0.810811 | 5 | 37 | 5.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0.108108 | 37 | 2 | 32 | 18.5 | 0.787879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
1027b5244e81c82ea6241f769300d739f3cdf5e9 | 40 | py | Python | ml_snek/dataloaders/base_dataloader.py | joram/ml-snek | e1ed8aa831a4683dfe51a6af0cb25a44c3978903 | [
"MIT"
] | null | null | null | ml_snek/dataloaders/base_dataloader.py | joram/ml-snek | e1ed8aa831a4683dfe51a6af0cb25a44c3978903 | [
"MIT"
] | 13 | 2019-12-25T21:04:49.000Z | 2020-01-04T20:25:05.000Z | ml_snek/dataloaders/base_dataloader.py | joram/ml-snek | e1ed8aa831a4683dfe51a6af0cb25a44c3978903 | [
"MIT"
] | null | null | null |
class BaseDataloader(object):
pass
| 10 | 29 | 0.725 | 4 | 40 | 7.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 40 | 3 | 30 | 13.333333 | 0.90625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
108e5db272565b0a4842bb7d9f226a3ec61292f7 | 91 | py | Python | creepers/admin.py | Mmarcos01/fear-space | 7414f8b325d9a07d689ada99136ecde30a7e2253 | [
"MIT"
] | null | null | null | creepers/admin.py | Mmarcos01/fear-space | 7414f8b325d9a07d689ada99136ecde30a7e2253 | [
"MIT"
] | null | null | null | creepers/admin.py | Mmarcos01/fear-space | 7414f8b325d9a07d689ada99136ecde30a7e2253 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Creeper
admin.site.register(Creeper)
| 18.2 | 32 | 0.824176 | 13 | 91 | 5.769231 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.10989 | 91 | 4 | 33 | 22.75 | 0.925926 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
109193e0a4ef8625ae70393c5a99880900a51443 | 3,690 | py | Python | tests/algorithms/scaling/test_gaussian_smoother.py | toastisme/dials | 6bc8ababc33bfe334513677f8adb65c0e90003f3 | [
"BSD-3-Clause"
] | 58 | 2015-10-15T09:28:20.000Z | 2022-03-28T20:09:38.000Z | tests/algorithms/scaling/test_gaussian_smoother.py | toastisme/dials | 6bc8ababc33bfe334513677f8adb65c0e90003f3 | [
"BSD-3-Clause"
] | 1,741 | 2015-11-24T08:17:02.000Z | 2022-03-31T15:46:42.000Z | tests/algorithms/scaling/test_gaussian_smoother.py | toastisme/dials | 6bc8ababc33bfe334513677f8adb65c0e90003f3 | [
"BSD-3-Clause"
] | 45 | 2015-10-14T13:44:16.000Z | 2022-03-22T14:45:56.000Z | from math import exp
import pytest
from dials.algorithms.scaling.model.components.smooth_scale_components import (
GaussianSmoother2D,
GaussianSmoother3D,
)
from dials.array_family import flex
def test_2DGaussianSmoother():
"""Test the behaviour of the 2D Gaussian Smoother"""
GS2D = GaussianSmoother2D([0, 1], 1, [0, 4], 4)
assert GS2D.num_x_values() == 2
assert GS2D.num_y_values() == 6
assert GS2D.num_x_average() == 2
assert GS2D.num_y_average() == 3
parameters = flex.double(
[1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0]
)
x = flex.double([0.5, 0.25])
y = flex.double([1.0, 0.75])
value, weight, sumw = GS2D.multi_value_weight(x, y, parameters)
assert weight.non_zeroes == 6 * 2
assert GS2D.sigma() == 0.65
# Calculate tand verify the expected value at the first position.
expected_sumw = (2.0 * exp(-2.5 / (0.65 ** 2))) + 4.0 * exp(-0.5 / (0.65 ** 2))
assert expected_sumw == pytest.approx(sumw[0])
expected_value_numerator = (10.0 * exp(-0.5 / (0.65 ** 2))) + (
2.0 * exp(-2.5 / (0.65 ** 2))
)
assert value[0] == pytest.approx(expected_value_numerator / expected_sumw)
# Do the same calculation but calling the single value_weight function.
x = 0.5
y = 1.0
value, weight, sumw = GS2D.value_weight(x, y, parameters)
assert weight.non_zeroes == 6
assert value == pytest.approx(expected_value_numerator / expected_sumw)
# Test again for another small number of params
GS2D = GaussianSmoother2D([0, 2], 2, [0, 4], 4)
assert GS2D.num_x_values() == 3
assert GS2D.num_y_values() == 6
assert GS2D.num_x_average() == 3
assert GS2D.num_y_average() == 3
# Test again for another number of params
GS2D = GaussianSmoother2D([0, 4], 4, [0, 5], 5)
assert GS2D.num_x_values() == 6
assert GS2D.num_y_values() == 7
assert GS2D.num_x_average() == 3
assert GS2D.num_y_average() == 3
def test_3DGaussianSmoother():
"""Test the behaviour of the 2D Gaussian Smoother"""
GS3D = GaussianSmoother3D([0, 1], 1, [0, 3], 3, [0, 1], 1)
assert GS3D.num_x_values() == 2
assert GS3D.num_y_values() == 5
assert GS3D.num_z_values() == 2
assert GS3D.num_x_average() == 2
assert GS3D.num_y_average() == 3
assert GS3D.num_z_average() == 2
parameters = flex.double([1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0] * 2)
x = flex.double([0.5, 0.25])
y = flex.double([1.0, 0.75])
z = flex.double([0.5, 0.25])
value, weight, sumw = GS3D.multi_value_weight(x, y, z, parameters)
assert weight.non_zeroes == 6 * 2 * 2
assert GS3D.sigma() == 0.65
# Calculate tand verify the expected value at the first position.
expected_sumw = (4.0 * exp(-2.75 / (0.65 ** 2))) + (8.0 * exp(-0.75 / (0.65 ** 2)))
assert expected_sumw == pytest.approx(sumw[0])
expected_value_numerator = (20.0 * exp(-0.75 / (0.65 ** 2))) + (
4.0 * exp(-2.75 / (0.65 ** 2))
)
assert value[0] == pytest.approx(expected_value_numerator / expected_sumw)
# Do the same calculation but calling the single value_weight function.
x = 0.5
y = 1.0
z = 0.5
value, weight, sumw = GS3D.value_weight(x, y, z, parameters)
assert weight.non_zeroes == 6 * 2
assert value == pytest.approx(expected_value_numerator / expected_sumw)
# Test again for another number of params
GS3D = GaussianSmoother3D([0, 1], 1, [0, 2], 2, [0, 3], 3)
assert GS3D.num_x_values() == 2
assert GS3D.num_y_values() == 3
assert GS3D.num_z_values() == 5
assert GS3D.num_x_average() == 2
assert GS3D.num_y_average() == 3
assert GS3D.num_y_average() == 3
| 37.653061 | 87 | 0.6271 | 601 | 3,690 | 3.708819 | 0.134775 | 0.043966 | 0.069987 | 0.037685 | 0.832212 | 0.787797 | 0.716465 | 0.680126 | 0.604307 | 0.604307 | 0 | 0.095304 | 0.220867 | 3,690 | 97 | 88 | 38.041237 | 0.68 | 0.132249 | 0 | 0.394737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.473684 | 1 | 0.026316 | false | 0 | 0.052632 | 0 | 0.078947 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 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 | 5 |
10b1e64b3213be1d1227a4bb22414457ef2e906e | 60 | py | Python | supercap/__init__.py | venkat0249/SuperCap-Python | e2f96e426e4c3b9bb6d80cc55f9b372bb6160b02 | [
"MIT"
] | 5 | 2020-07-26T13:13:06.000Z | 2022-03-03T21:41:20.000Z | supercap/__init__.py | venkat0249/SuperCap-Python | e2f96e426e4c3b9bb6d80cc55f9b372bb6160b02 | [
"MIT"
] | null | null | null | supercap/__init__.py | venkat0249/SuperCap-Python | e2f96e426e4c3b9bb6d80cc55f9b372bb6160b02 | [
"MIT"
] | 1 | 2020-12-14T11:31:31.000Z | 2020-12-14T11:31:31.000Z | from supercap.supercapacitormodel import SuperCapacitorModel | 60 | 60 | 0.933333 | 5 | 60 | 11.2 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 60 | 1 | 60 | 60 | 0.982456 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
52cc141d5fbdd83ffb55db2884c041759f50b28e | 166 | py | Python | _includes/examples/02features/library.py | sjirwin/pygotham2108-dataclasses | a3a30e9b43b268867088e3d95280c47f62fcebac | [
"CC0-1.0",
"MIT"
] | null | null | null | _includes/examples/02features/library.py | sjirwin/pygotham2108-dataclasses | a3a30e9b43b268867088e3d95280c47f62fcebac | [
"CC0-1.0",
"MIT"
] | null | null | null | _includes/examples/02features/library.py | sjirwin/pygotham2108-dataclasses | a3a30e9b43b268867088e3d95280c47f62fcebac | [
"CC0-1.0",
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List
from book import Book
@dataclass
class Library:
books: List[Book] = field(default_factory=list)
| 20.75 | 51 | 0.789157 | 23 | 166 | 5.652174 | 0.565217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150602 | 166 | 7 | 52 | 23.714286 | 0.921986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
52d9b01f18f284c371434d33b27d4a44a119a290 | 241 | py | Python | openwebinars/Openwebinar.py | OpenWebinarsNet/Taller-publica-un-paquete-en-Pypi | 48b19457a6d0bf948bd499e952d4b2a294a70ee8 | [
"MIT"
] | null | null | null | openwebinars/Openwebinar.py | OpenWebinarsNet/Taller-publica-un-paquete-en-Pypi | 48b19457a6d0bf948bd499e952d4b2a294a70ee8 | [
"MIT"
] | null | null | null | openwebinars/Openwebinar.py | OpenWebinarsNet/Taller-publica-un-paquete-en-Pypi | 48b19457a6d0bf948bd499e952d4b2a294a70ee8 | [
"MIT"
] | 2 | 2021-11-21T14:03:51.000Z | 2022-03-26T22:57:03.000Z | from string_utils.validation import is_string
class Openwebinar:
def __init__(self, name):
if is_string(name):
self.name = name
else:
self.name = ''
def __str__(self):
return self.name | 24.1 | 45 | 0.593361 | 29 | 241 | 4.551724 | 0.551724 | 0.242424 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.323651 | 241 | 10 | 46 | 24.1 | 0.809816 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0.111111 | 0.555556 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
52eb91363550556ca49d2d027338f9d8ba7ce483 | 170 | py | Python | app/apps/core/admin.py | swelanauguste/workstation-cms | 41c109394ae8636a2cd4931783351c2a208e69fe | [
"MIT"
] | null | null | null | app/apps/core/admin.py | swelanauguste/workstation-cms | 41c109394ae8636a2cd4931783351c2a208e69fe | [
"MIT"
] | null | null | null | app/apps/core/admin.py | swelanauguste/workstation-cms | 41c109394ae8636a2cd4931783351c2a208e69fe | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Workstation, Owner, Report
admin.site.register(Workstation)
admin.site.register(Owner)
admin.site.register(Report)
| 21.25 | 46 | 0.817647 | 23 | 170 | 6.043478 | 0.478261 | 0.194245 | 0.366906 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088235 | 170 | 7 | 47 | 24.285714 | 0.896774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
eaabc14dabfa90bda7ed0de60a2d53d85b4df49e | 548 | py | Python | onnx_tf/common/legacy.py | jsigee87/onnx-tensorflow | 90a58bed24a18f5260ebe9f22bf4997f9d591f62 | [
"Apache-2.0"
] | 6 | 2019-02-26T07:38:01.000Z | 2020-07-08T22:18:22.000Z | onnx_tf/common/legacy.py | jsigee87/onnx-tensorflow | 90a58bed24a18f5260ebe9f22bf4997f9d591f62 | [
"Apache-2.0"
] | 1 | 2019-02-26T07:48:26.000Z | 2019-02-26T22:00:22.000Z | onnx_tf/common/legacy.py | jsigee87/onnx-tensorflow | 90a58bed24a18f5260ebe9f22bf4997f9d591f62 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import onnx
def get_onnx_version():
return map(int, onnx.version.version.split("."))
# Returns whether onnx version is prior to 1.2.
def legacy_onnx_pre_1_2():
major, minor, revision = get_onnx_version()
return major == 1 and minor < 2
# Returns whether the opset version accompanying the
# onnx installation is prior to 6.
def legacy_opset_pre_6():
return onnx.defs.onnx_opset_version() < 6 | 28.842105 | 52 | 0.791971 | 84 | 548 | 4.785714 | 0.428571 | 0.099502 | 0.159204 | 0.099502 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019027 | 0.136861 | 548 | 19 | 53 | 28.842105 | 0.830867 | 0.235401 | 0 | 0 | 0 | 0 | 0.002404 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.416667 | 0.166667 | 0.916667 | 0.083333 | 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 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 5 |
eab051a3888d5f2d34860854e9761b3c34e138e2 | 2,752 | py | Python | tests/unittests/authentication/api_usage/test_redis_api_usage_incrementor.py | jabertuhin/fastapi-with-redis | aad3fd2c3c1ae011c43bfb37f29903ef7835026e | [
"MIT"
] | 5 | 2021-08-14T17:08:48.000Z | 2022-01-06T18:29:16.000Z | tests/unittests/authentication/api_usage/test_redis_api_usage_incrementor.py | jabertuhin/fastapi-with-redis | aad3fd2c3c1ae011c43bfb37f29903ef7835026e | [
"MIT"
] | 2 | 2021-09-25T11:24:09.000Z | 2021-09-25T11:24:20.000Z | tests/unittests/authentication/api_usage/test_redis_api_usage_incrementor.py | jabertuhin/fastapi-with-redis | aad3fd2c3c1ae011c43bfb37f29903ef7835026e | [
"MIT"
] | null | null | null | from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch, AsyncMock
from app.utils.config_parser import ConfigFileParser
from app.cache_server.server_client import CacheServerClient
from app.authentication.api_usage.redis_api_usage_incrementor import RedisApiUsageIncrementor
class TestRedisApiUsageIncrementor(IsolatedAsyncioTestCase):
@patch("app.authentication.api_usage.redis_api_usage_incrementor.get_api_key_with_time")
@patch.object(ConfigFileParser, 'get_config_section')
async def test_increment_when_key_doesnt_exists_should_call_set_key_value_with_expiry_time_once(self,
mock_config_section,
mock_get_api_key_with_time):
api_key = "123abc"
mock_get_api_key_with_time.return_value = f"{api_key}:2"
mock_config_section.return_value = {"second": 60}
cache_server_client = AsyncMock(wraps=CacheServerClient)
cache_server_client.key_exists.return_value = 0
cache_server_client.set_key_value_with_expiry_time.return_value = None
api_usage_incrementor = RedisApiUsageIncrementor(cache_server_client)
actual = await api_usage_incrementor.increment(api_key=api_key)
self.assertIsNone(actual)
cache_server_client.key_exists.assert_awaited_once()
cache_server_client.set_key_value_with_expiry_time.assert_awaited_once()
@patch("app.authentication.api_usage.redis_api_usage_incrementor.get_api_key_with_time")
@patch.object(ConfigFileParser, 'get_config_section')
async def test_increment_when_key_exists_should_call_increment_value_by_key_once(self,
mock_config_section,
mock_get_api_key_with_time):
api_key = "123abc"
mock_get_api_key_with_time.return_value = f"{api_key}:2"
mock_config_section.return_value = {"second": 60}
cache_server_client = AsyncMock(wraps=CacheServerClient)
cache_server_client.key_exists.return_value = 1
cache_server_client.increment_value_by_key.return_value = None
api_usage_incrementor = RedisApiUsageIncrementor(cache_server_client)
actual = await api_usage_incrementor.increment(api_key=api_key)
self.assertIsNone(actual)
cache_server_client.key_exists.assert_awaited_once()
cache_server_client.set_key_value_with_expiry_time.assert_not_awaited()
cache_server_client.increment_value_by_key.assert_awaited_once()
| 52.923077 | 128 | 0.696221 | 314 | 2,752 | 5.576433 | 0.194268 | 0.08795 | 0.126214 | 0.044546 | 0.79269 | 0.79269 | 0.778412 | 0.737293 | 0.709309 | 0.685323 | 0 | 0.006776 | 0.249273 | 2,752 | 51 | 129 | 53.960784 | 0.840755 | 0 | 0 | 0.615385 | 0 | 0 | 0.086483 | 0.056686 | 0 | 0 | 0 | 0 | 0.179487 | 1 | 0 | false | 0 | 0.128205 | 0 | 0.153846 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
eae67dc8c817e37f93e3399ebb67cd6c4271ca17 | 196 | py | Python | playback/templates/external_interface.py | jiasir/playback | 58b2a5d669dcfaa8cad50c544a4b068dcacf9b69 | [
"MIT"
] | 6 | 2015-05-09T10:39:54.000Z | 2017-07-02T21:19:42.000Z | playback/templates/external_interface.py | jiasir/playback | 58b2a5d669dcfaa8cad50c544a4b068dcacf9b69 | [
"MIT"
] | 20 | 2015-06-10T05:02:42.000Z | 2022-03-29T21:54:07.000Z | playback/templates/external_interface.py | jiasir/playback | 58b2a5d669dcfaa8cad50c544a4b068dcacf9b69 | [
"MIT"
] | 6 | 2015-03-25T06:13:38.000Z | 2016-04-08T02:22:05.000Z | conf_external_interface = """# The external network interface
auto {{ public_interface }}
iface {{ public_interface }} inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down"""
| 32.666667 | 61 | 0.75 | 29 | 196 | 4.931034 | 0.551724 | 0.20979 | 0.125874 | 0.167832 | 0.237762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158163 | 196 | 5 | 62 | 39.2 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0.831633 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
eafa8076c805d82a52a680ef7ef23dd3cfa8e2e7 | 100 | py | Python | impute/decomposition/__init__.py | nimily/low-rank-impute | 0b2fb5c911a4b7505e61f9a7e412bcb11bf3e89a | [
"MIT"
] | null | null | null | impute/decomposition/__init__.py | nimily/low-rank-impute | 0b2fb5c911a4b7505e61f9a7e412bcb11bf3e89a | [
"MIT"
] | null | null | null | impute/decomposition/__init__.py | nimily/low-rank-impute | 0b2fb5c911a4b7505e61f9a7e412bcb11bf3e89a | [
"MIT"
] | null | null | null | from .base import SVD
from .exact_svd import exact_svd
from .randomized_svd import randomized_svd
| 16.666667 | 42 | 0.83 | 16 | 100 | 4.9375 | 0.375 | 0.177215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14 | 100 | 5 | 43 | 20 | 0.918605 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
dc2a881b39698ece598ae7572b3d7be7ba4119a0 | 309 | py | Python | dbaas/logical/admin/__init__.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | 303 | 2015-01-08T10:35:54.000Z | 2022-02-28T08:54:06.000Z | dbaas/logical/admin/__init__.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 124 | 2015-01-14T12:56:15.000Z | 2022-03-22T20:45:11.000Z | dbaas/logical/admin/__init__.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 110 | 2015-01-02T11:59:48.000Z | 2022-02-28T08:54:06.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.contrib import admin
from .. import models
from .project import ProjectAdmin
from .database import DatabaseAdmin
admin.site.register(models.Project, ProjectAdmin)
admin.site.register(models.Database, DatabaseAdmin)
| 30.9 | 56 | 0.812298 | 38 | 309 | 6.447368 | 0.5 | 0.073469 | 0.138776 | 0.187755 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003597 | 0.100324 | 309 | 9 | 57 | 34.333333 | 0.877698 | 0.067961 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.714286 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
dc6dc3bacd38da37c3c9988da5699e9177bce121 | 513 | py | Python | tests/test_unit_convertions.py | z86961027/pycatia | 5dd9b7eb5d21f2261198d6a2af489abafb2f5f32 | [
"MIT"
] | null | null | null | tests/test_unit_convertions.py | z86961027/pycatia | 5dd9b7eb5d21f2261198d6a2af489abafb2f5f32 | [
"MIT"
] | null | null | null | tests/test_unit_convertions.py | z86961027/pycatia | 5dd9b7eb5d21f2261198d6a2af489abafb2f5f32 | [
"MIT"
] | null | null | null | #! /usr/bin/python3.6
from pycatia.csv_tools import convert_units, unit_conversion
def test_units():
input_unit = 5
assert input_unit == (input_unit * unit_conversion['mm'])
assert 50 == (input_unit * unit_conversion['cm'])
assert 5000 == (input_unit * unit_conversion['m'])
assert 5e+6 == (input_unit * unit_conversion['km'])
assert 127 == (input_unit * unit_conversion['in'])
assert 8046720 == (input_unit * unit_conversion['mile'])
# todo: add test for convert_units function.
| 30.176471 | 61 | 0.692008 | 70 | 513 | 4.8 | 0.471429 | 0.214286 | 0.232143 | 0.410714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049412 | 0.17154 | 513 | 16 | 62 | 32.0625 | 0.741176 | 0.122807 | 0 | 0 | 0 | 0 | 0.029018 | 0 | 0 | 0 | 0 | 0.0625 | 0.666667 | 1 | 0.111111 | false | 0 | 0.111111 | 0 | 0.222222 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
f491724e586c40213cd243fe568669bd25056279 | 65 | py | Python | example_config.py | th2/teleswitch | 41ef1cf2c47bc8fb913d65e04d143487b3b7e424 | [
"MIT"
] | null | null | null | example_config.py | th2/teleswitch | 41ef1cf2c47bc8fb913d65e04d143487b3b7e424 | [
"MIT"
] | null | null | null | example_config.py | th2/teleswitch | 41ef1cf2c47bc8fb913d65e04d143487b3b7e424 | [
"MIT"
] | null | null | null | token = '123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ'
userId = 12345678
| 21.666667 | 46 | 0.830769 | 5 | 65 | 10.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.288136 | 0.092308 | 65 | 2 | 47 | 32.5 | 0.627119 | 0 | 0 | 0 | 0 | 0 | 0.553846 | 0.553846 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
f4bb1e350d156542b4f8570d6db44adef58abec1 | 85 | py | Python | assignments/assignment2/metrics.py | iptkachev/dlcourse_ai | bf4d8c7639fa0597580130ae65e1dea0f26d1b4a | [
"MIT"
] | null | null | null | assignments/assignment2/metrics.py | iptkachev/dlcourse_ai | bf4d8c7639fa0597580130ae65e1dea0f26d1b4a | [
"MIT"
] | null | null | null | assignments/assignment2/metrics.py | iptkachev/dlcourse_ai | bf4d8c7639fa0597580130ae65e1dea0f26d1b4a | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
from assignment1.metrics import multiclass_accuracy
| 21.25 | 51 | 0.811765 | 11 | 85 | 6.181818 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012821 | 0.082353 | 85 | 3 | 52 | 28.333333 | 0.858974 | 0 | 0 | 0 | 0 | 0 | 0.023529 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
f4d52861d0d5939b5fc239d629b8c16c6354451f | 307 | py | Python | sift-core/core/admin.py | readevalprint/sift | 3015a2f704816a687a7c0f1974b873d7cda43444 | [
"Apache-2.0"
] | 1 | 2020-02-04T04:28:09.000Z | 2020-02-04T04:28:09.000Z | sift-core/core/admin.py | readevalprint/sift | 3015a2f704816a687a7c0f1974b873d7cda43444 | [
"Apache-2.0"
] | 3 | 2020-06-05T17:34:59.000Z | 2021-06-10T22:45:45.000Z | sift-core/core/admin.py | readevalprint/sift | 3015a2f704816a687a7c0f1974b873d7cda43444 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from reversion_compare.admin import CompareVersionAdmin
from .models import Survey, MapFunction, ReduceFunction
admin.site.register(ReduceFunction, CompareVersionAdmin)
admin.site.register(MapFunction, CompareVersionAdmin)
admin.site.register(Survey, CompareVersionAdmin)
| 34.111111 | 56 | 0.863192 | 32 | 307 | 8.25 | 0.4375 | 0.102273 | 0.193182 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071661 | 307 | 8 | 57 | 38.375 | 0.926316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
f4db3c4eb698cb30c8a209c9f70185e510b2d2a7 | 167 | py | Python | 7kyu/regex_validate_pin_code.py | nhsz/codewars | 82703959e910254d6feff4162f78c6dbd7a1c3ed | [
"MIT"
] | 1 | 2018-12-02T23:04:38.000Z | 2018-12-02T23:04:38.000Z | 7kyu/regex_validate_pin_code.py | nhsz/codewars | 82703959e910254d6feff4162f78c6dbd7a1c3ed | [
"MIT"
] | null | null | null | 7kyu/regex_validate_pin_code.py | nhsz/codewars | 82703959e910254d6feff4162f78c6dbd7a1c3ed | [
"MIT"
] | null | null | null | # http://www.codewars.com/kata/55f8a9c06c018a0d6e000132/
def validate_pin(pin):
return (len(pin) == 4 or len(pin) == 6) and all(digit.isdigit() for digit in pin)
| 33.4 | 85 | 0.700599 | 26 | 167 | 4.461538 | 0.769231 | 0.103448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131944 | 0.137725 | 167 | 4 | 86 | 41.75 | 0.673611 | 0.323353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
f4f38c140cd2cf94b04cb0175d920b3fd4218627 | 72 | py | Python | 8 kyu/Lario and Muigi Pipe Problem.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 6 | 2020-09-03T09:32:25.000Z | 2020-12-07T04:10:01.000Z | 8 kyu/Lario and Muigi Pipe Problem.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 1 | 2021-12-13T15:30:21.000Z | 2021-12-13T15:30:21.000Z | 8 kyu/Lario and Muigi Pipe Problem.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | null | null | null | def pipe_fix(nums):
return [x for x in range(min(nums),max(nums)+1)] | 36 | 52 | 0.666667 | 15 | 72 | 3.133333 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016393 | 0.152778 | 72 | 2 | 52 | 36 | 0.754098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
f4feaa112967cb761af072b7c5c52f6e48164ba8 | 428 | py | Python | backend/swpp/serializers.py | 2019-swpp-8/swpp | 62a4c6bc4ae44efb3f19c95c1e4b17a5d77ff12b | [
"MIT"
] | 7 | 2019-04-13T05:20:26.000Z | 2019-06-17T02:38:39.000Z | backend/swpp/serializers.py | 2019-swpp-8/swpp | 62a4c6bc4ae44efb3f19c95c1e4b17a5d77ff12b | [
"MIT"
] | 68 | 2019-04-18T07:05:05.000Z | 2021-05-08T13:22:36.000Z | backend/swpp/serializers.py | 2019-swpp-8/swpp | 62a4c6bc4ae44efb3f19c95c1e4b17a5d77ff12b | [
"MIT"
] | 1 | 2019-04-19T06:24:19.000Z | 2019-04-19T06:24:19.000Z | from swpp.serializer.user import UserSerializer
from swpp.serializer.profile import ProfileSerializer
from swpp.serializer.tutor import TutorWriteSerializer, TutorReadSerializer
from swpp.serializer.lecture import LectureSerializer
from swpp.serializer.request import RequestWriteSerializer, RequestReadSerializer
from swpp.serializer.times import TimesSerializer
from swpp.serializer.notification import NotificationSerializer
| 53.5 | 81 | 0.892523 | 44 | 428 | 8.681818 | 0.454545 | 0.146597 | 0.329843 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.070093 | 428 | 7 | 82 | 61.142857 | 0.959799 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
52193e1b4c04670454a288cde24f3a0055cabf62 | 14,836 | py | Python | pybind/slxos/v16r_1_00b/logging/raslog/message/msgId/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/logging/raslog/message/msgId/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/logging/raslog/message/msgId/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
class msgId(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-ras - based on the path /logging/raslog/message/msgId. Each member element of
the container is represented as a class variable - with a specific
YANG type.
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__msgId','__severity','__suppress','__syslog',)
_yang_name = 'msgId'
_rest_name = 'msgId'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__syslog = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="syslog", rest_name="syslog", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable syslog logging for internal raslog message', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)
self.__msgId = YANGDynClass(base=unicode, is_leaf=True, yang_name="msgId", rest_name="msgId", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Specify the Msg ID'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='string', is_config=True)
self.__severity = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'INFO': {'value': 1}, u'CRITICAL': {'value': 4}, u'WARNING': {'value': 3}, u'DEFAULT': {'value': 5}, u'ERROR': {'value': 2}},), is_leaf=True, yang_name="severity", rest_name="severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure raslog message severity', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='message-severity', is_config=True)
self.__suppress = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="suppress", rest_name="suppress", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Suppress raslog message'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'logging', u'raslog', u'message', u'msgId']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'logging', u'raslog', u'message', u'msgId']
def _get_msgId(self):
"""
Getter method for msgId, mapped from YANG variable /logging/raslog/message/msgId/msgId (string)
"""
return self.__msgId
def _set_msgId(self, v, load=False):
"""
Setter method for msgId, mapped from YANG variable /logging/raslog/message/msgId/msgId (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_msgId is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_msgId() directly.
"""
parent = getattr(self, "_parent", None)
if parent is not None and load is False:
raise AttributeError("Cannot set keys directly when" +
" within an instantiated list")
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="msgId", rest_name="msgId", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Specify the Msg ID'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='string', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """msgId must be of a type compatible with string""",
'defined-type': "string",
'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="msgId", rest_name="msgId", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Specify the Msg ID'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='string', is_config=True)""",
})
self.__msgId = t
if hasattr(self, '_set'):
self._set()
def _unset_msgId(self):
self.__msgId = YANGDynClass(base=unicode, is_leaf=True, yang_name="msgId", rest_name="msgId", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Specify the Msg ID'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='string', is_config=True)
def _get_severity(self):
"""
Getter method for severity, mapped from YANG variable /logging/raslog/message/msgId/severity (message-severity)
"""
return self.__severity
def _set_severity(self, v, load=False):
"""
Setter method for severity, mapped from YANG variable /logging/raslog/message/msgId/severity (message-severity)
If this variable is read-only (config: false) in the
source YANG file, then _set_severity is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_severity() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'INFO': {'value': 1}, u'CRITICAL': {'value': 4}, u'WARNING': {'value': 3}, u'DEFAULT': {'value': 5}, u'ERROR': {'value': 2}},), is_leaf=True, yang_name="severity", rest_name="severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure raslog message severity', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='message-severity', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """severity must be of a type compatible with message-severity""",
'defined-type': "brocade-ras:message-severity",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'INFO': {'value': 1}, u'CRITICAL': {'value': 4}, u'WARNING': {'value': 3}, u'DEFAULT': {'value': 5}, u'ERROR': {'value': 2}},), is_leaf=True, yang_name="severity", rest_name="severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure raslog message severity', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='message-severity', is_config=True)""",
})
self.__severity = t
if hasattr(self, '_set'):
self._set()
def _unset_severity(self):
self.__severity = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'INFO': {'value': 1}, u'CRITICAL': {'value': 4}, u'WARNING': {'value': 3}, u'DEFAULT': {'value': 5}, u'ERROR': {'value': 2}},), is_leaf=True, yang_name="severity", rest_name="severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure raslog message severity', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='message-severity', is_config=True)
def _get_suppress(self):
"""
Getter method for suppress, mapped from YANG variable /logging/raslog/message/msgId/suppress (empty)
"""
return self.__suppress
def _set_suppress(self, v, load=False):
"""
Setter method for suppress, mapped from YANG variable /logging/raslog/message/msgId/suppress (empty)
If this variable is read-only (config: false) in the
source YANG file, then _set_suppress is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_suppress() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="suppress", rest_name="suppress", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Suppress raslog message'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """suppress must be of a type compatible with empty""",
'defined-type': "empty",
'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="suppress", rest_name="suppress", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Suppress raslog message'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)""",
})
self.__suppress = t
if hasattr(self, '_set'):
self._set()
def _unset_suppress(self):
self.__suppress = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="suppress", rest_name="suppress", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Suppress raslog message'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)
def _get_syslog(self):
"""
Getter method for syslog, mapped from YANG variable /logging/raslog/message/msgId/syslog (empty)
"""
return self.__syslog
def _set_syslog(self, v, load=False):
"""
Setter method for syslog, mapped from YANG variable /logging/raslog/message/msgId/syslog (empty)
If this variable is read-only (config: false) in the
source YANG file, then _set_syslog is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_syslog() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="syslog", rest_name="syslog", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable syslog logging for internal raslog message', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """syslog must be of a type compatible with empty""",
'defined-type': "empty",
'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="syslog", rest_name="syslog", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable syslog logging for internal raslog message', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)""",
})
self.__syslog = t
if hasattr(self, '_set'):
self._set()
def _unset_syslog(self):
self.__syslog = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="syslog", rest_name="syslog", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable syslog logging for internal raslog message', u'hidden': u'debug'}}, namespace='urn:brocade.com:mgmt:brocade-ras', defining_module='brocade-ras', yang_type='empty', is_config=True)
msgId = __builtin__.property(_get_msgId, _set_msgId)
severity = __builtin__.property(_get_severity, _set_severity)
suppress = __builtin__.property(_get_suppress, _set_suppress)
syslog = __builtin__.property(_get_syslog, _set_syslog)
_pyangbind_elements = {'msgId': msgId, 'severity': severity, 'suppress': suppress, 'syslog': syslog, }
| 63.67382 | 713 | 0.699447 | 1,968 | 14,836 | 5.059959 | 0.097561 | 0.046194 | 0.050613 | 0.022494 | 0.776762 | 0.748142 | 0.734686 | 0.721229 | 0.721229 | 0.708375 | 0 | 0.002096 | 0.16406 | 14,836 | 232 | 714 | 63.948276 | 0.800839 | 0.131841 | 0 | 0.421053 | 0 | 0.026316 | 0.33712 | 0.10714 | 0 | 0 | 0 | 0 | 0 | 1 | 0.098684 | false | 0 | 0.052632 | 0 | 0.276316 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
5259b452469d81d866f091b463cc9129aa16b980 | 27 | py | Python | distance/_pyimports.py | lehaontherun/distance_leven | b2d10a41bbc2c03444463608465274d863d4f7af | [
"Unlicense"
] | null | null | null | distance/_pyimports.py | lehaontherun/distance_leven | b2d10a41bbc2c03444463608465274d863d4f7af | [
"Unlicense"
] | null | null | null | distance/_pyimports.py | lehaontherun/distance_leven | b2d10a41bbc2c03444463608465274d863d4f7af | [
"Unlicense"
] | null | null | null | from .levenshtein import *
| 13.5 | 26 | 0.777778 | 3 | 27 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 27 | 1 | 27 | 27 | 0.913043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
8703874758f0b203d2ca493da875bae33f22be69 | 22,223 | py | Python | pySDC/implementations/problem_classes/GrayScott_MPIFFT.py | janEbert/pySDC | 167d78c4118bc3a5a446ec973fe65fb35db94471 | [
"BSD-2-Clause"
] | null | null | null | pySDC/implementations/problem_classes/GrayScott_MPIFFT.py | janEbert/pySDC | 167d78c4118bc3a5a446ec973fe65fb35db94471 | [
"BSD-2-Clause"
] | null | null | null | pySDC/implementations/problem_classes/GrayScott_MPIFFT.py | janEbert/pySDC | 167d78c4118bc3a5a446ec973fe65fb35db94471 | [
"BSD-2-Clause"
] | 1 | 2021-07-27T11:44:54.000Z | 2021-07-27T11:44:54.000Z | import numpy as np
import scipy.sparse as sp
from mpi4py import MPI
from mpi4py_fft import PFFT
from pySDC.core.Errors import ParameterError, ProblemError
from pySDC.core.Problem import ptype
from pySDC.implementations.datatype_classes.parallel_mesh import parallel_mesh, parallel_imex_mesh, parallel_comp2_mesh
from mpi4py_fft import newDistArray
class grayscott_imex_diffusion(ptype):
"""
Example implementing the Gray-Scott equation in 2-3D using mpi4py-fft for solving linear parts,
IMEX time-stepping (implicit diffusion, explicit reaction)
mpi4py-fft: https://mpi4py-fft.readthedocs.io/en/latest/
Attributes:
fft: fft object
X: grid coordinates in real space
ndim: number of spatial dimensions
Ku: Laplace operator in spectral space (u component)
Kv: Laplace operator in spectral space (v component)
"""
def __init__(self, problem_params, dtype_u=parallel_mesh, dtype_f=parallel_imex_mesh):
"""
Initialization routine
Args:
problem_params (dict): custom parameters for the example
dtype_u: fft data type (will be passed to parent class)
dtype_f: fft data type wuth implicit and explicit parts (will be passed to parent class)
"""
if 'L' not in problem_params:
problem_params['L'] = 2.0
# if 'init_type' not in problem_params:
# problem_params['init_type'] = 'circle'
if 'comm' not in problem_params:
problem_params['comm'] = MPI.COMM_WORLD
# these parameters will be used later, so assert their existence
essential_keys = ['nvars', 'Du', 'Dv', 'A', 'B', 'spectral']
for key in essential_keys:
if key not in problem_params:
msg = 'need %s to instantiate problem, only got %s' % (key, str(problem_params.keys()))
raise ParameterError(msg)
if not (isinstance(problem_params['nvars'], tuple) and len(problem_params['nvars']) > 1):
raise ProblemError('Need at least two dimensions')
# Creating FFT structure
self.ndim = len(problem_params['nvars'])
axes = tuple(range(self.ndim))
self.fft = PFFT(problem_params['comm'], list(problem_params['nvars']), axes=axes, dtype=np.float64,
collapse=True, backend='fftw')
# get test data to figure out type and dimensions
tmp_u = newDistArray(self.fft, problem_params['spectral'])
# add two components to contain field and temperature
self.ncomp = 2
sizes = tmp_u.shape + (self.ncomp,)
# invoke super init, passing the communicator and the local dimensions as init
super(grayscott_imex_diffusion, self).__init__(init=(sizes, problem_params['comm'], tmp_u.dtype),
dtype_u=dtype_u, dtype_f=dtype_f, params=problem_params)
L = np.array([self.params.L] * self.ndim, dtype=float)
# get local mesh
X = np.ogrid[self.fft.local_slice(False)]
N = self.fft.global_shape()
for i in range(len(N)):
X[i] = -L[i] / 2 + (X[i] * L[i] / N[i])
self.X = [np.broadcast_to(x, self.fft.shape(False)) for x in X]
# get local wavenumbers and Laplace operator
s = self.fft.local_slice()
N = self.fft.global_shape()
k = [np.fft.fftfreq(n, 1. / n).astype(int) for n in N[:-1]]
k.append(np.fft.rfftfreq(N[-1], 1. / N[-1]).astype(int))
K = [ki[si] for ki, si in zip(k, s)]
Ks = np.meshgrid(*K, indexing='ij', sparse=True)
Lp = 2 * np.pi / L
for i in range(self.ndim):
Ks[i] = (Ks[i] * Lp[i]).astype(float)
K = [np.broadcast_to(k, self.fft.shape(True)) for k in Ks]
K = np.array(K).astype(float)
self.K2 = np.sum(K * K, 0, dtype=float)
self.Ku = -self.K2 * self.params.Du
self.Kv = -self.K2 * self.params.Dv
# Need this for diagnostics
self.dx = self.params.L / problem_params['nvars'][0]
self.dy = self.params.L / problem_params['nvars'][1]
def eval_f(self, u, t):
"""
Routine to evaluate the RHS
Args:
u (dtype_u): current values
t (float): current time
Returns:
dtype_f: the RHS
"""
f = self.dtype_f(self.init)
if self.params.spectral:
f.impl[..., 0] = self.Ku * u[..., 0]
f.impl[..., 1] = self.Kv * u[..., 1]
tmpu = newDistArray(self.fft, False)
tmpv = newDistArray(self.fft, False)
tmpu[:] = self.fft.backward(u[..., 0], tmpu)
tmpv[:] = self.fft.backward(u[..., 1], tmpv)
tmpfu = -tmpu * tmpv ** 2 + self.params.A * (1 - tmpu)
tmpfv = tmpu * tmpv ** 2 - self.params.B * tmpv
f.expl[..., 0] = self.fft.forward(tmpfu)
f.expl[..., 1] = self.fft.forward(tmpfv)
else:
u_hat = self.fft.forward(u[..., 0])
lap_u_hat = self.Ku * u_hat
f.impl[..., 0] = self.fft.backward(lap_u_hat, f.impl[..., 0])
u_hat = self.fft.forward(u[..., 1])
lap_u_hat = self.Kv * u_hat
f.impl[..., 1] = self.fft.backward(lap_u_hat, f.impl[..., 1])
f.expl[..., 0] = -u[..., 0] * u[..., 1] ** 2 + self.params.A * (1 - u[..., 0])
f.expl[..., 1] = u[..., 0] * u[..., 1] ** 2 - self.params.B * u[..., 1]
return f
def solve_system(self, rhs, factor, u0, t):
"""
Simple FFT solver for the diffusion part
Args:
rhs (dtype_f): right-hand side for the linear system
factor (float) : abbrev. for the node-to-node stepsize (or any other factor required)
u0 (dtype_u): initial guess for the iterative solver (not used here so far)
t (float): current time (e.g. for time-dependent BCs)
Returns:
dtype_u: solution as mesh
"""
me = self.dtype_u(self.init)
if self.params.spectral:
me[..., 0] = rhs[..., 0] / (1.0 - factor * self.Ku)
me[..., 1] = rhs[..., 1] / (1.0 - factor * self.Kv)
else:
rhs_hat = self.fft.forward(rhs[..., 0])
rhs_hat /= (1.0 - factor * self.Ku)
me[..., 0] = self.fft.backward(rhs_hat, me[..., 0])
rhs_hat = self.fft.forward(rhs[..., 1])
rhs_hat /= (1.0 - factor * self.Kv)
me[..., 1] = self.fft.backward(rhs_hat, me[..., 1])
return me
def u_exact(self, t):
"""
Routine to compute the exact solution at time t=0, see https://www.chebfun.org/examples/pde/GrayScott.html
Args:
t (float): current time
Returns:
dtype_u: exact solution
"""
assert t == 0.0, 'Exact solution only valid as initial condition'
assert self.ndim == 2, 'The initial conditions are 2D for now..'
me = self.dtype_u(self.init, val=0.0)
# This assumes that the box is [-L/2, L/2]^2
if self.params.spectral:
tmp = 1.0 - np.exp(-80.0 * ((self.X[0] + 0.05) ** 2 + (self.X[1] + 0.02) ** 2))
me[..., 0] = self.fft.forward(tmp)
tmp = np.exp(-80.0 * ((self.X[0] - 0.05) ** 2 + (self.X[1] - 0.02) ** 2))
me[..., 1] = self.fft.forward(tmp)
else:
me[..., 0] = 1.0 - np.exp(-80.0 * ((self.X[0] + 0.05) ** 2 + (self.X[1] + 0.02) ** 2))
me[..., 1] = np.exp(-80.0 * ((self.X[0] - 0.05) ** 2 + (self.X[1] - 0.02) ** 2))
# tmpu = np.load('data/u_0001.npy')
# tmpv = np.load('data/v_0001.npy')
#
# me[..., 0] = self.fft.forward(tmpu)
# me[..., 1] = self.fft.forward(tmpv)
return me
class grayscott_imex_linear(grayscott_imex_diffusion):
def __init__(self, problem_params, dtype_u=parallel_mesh, dtype_f=parallel_imex_mesh):
"""
Init routine for the IMEX problem class with linear splitting
"""
super(grayscott_imex_linear, self).__init__(problem_params, dtype_u=dtype_u, dtype_f=dtype_f)
self.Ku -= self.params.A
self.Kv -= self.params.B
def eval_f(self, u, t):
"""
Routine to evaluate the RHS
Args:
u (dtype_u): current values
t (float): current time
Returns:
dtype_f: the RHS
"""
f = self.dtype_f(self.init)
if self.params.spectral:
f.impl[..., 0] = self.Ku * u[..., 0]
f.impl[..., 1] = self.Kv * u[..., 1]
tmpu = newDistArray(self.fft, False)
tmpv = newDistArray(self.fft, False)
tmpu[:] = self.fft.backward(u[..., 0], tmpu)
tmpv[:] = self.fft.backward(u[..., 1], tmpv)
tmpfu = -tmpu * tmpv ** 2 + self.params.A
tmpfv = tmpu * tmpv ** 2
f.expl[..., 0] = self.fft.forward(tmpfu)
f.expl[..., 1] = self.fft.forward(tmpfv)
else:
u_hat = self.fft.forward(u[..., 0])
lap_u_hat = self.Ku * u_hat
f.impl[..., 0] = self.fft.backward(lap_u_hat, f.impl[..., 0])
u_hat = self.fft.forward(u[..., 1])
lap_u_hat = self.Kv * u_hat
f.impl[..., 1] = self.fft.backward(lap_u_hat, f.impl[..., 1])
f.expl[..., 0] = -u[..., 0] * u[..., 1] ** 2 + self.params.A
f.expl[..., 1] = u[..., 0] * u[..., 1] ** 2
return f
class grayscott_mi_diffusion(grayscott_imex_diffusion):
def __init__(self, problem_params, dtype_u=parallel_mesh, dtype_f=parallel_comp2_mesh):
"""
Init routine for the multi-implicit problem class with diffusion splitting
"""
if 'newton_maxiter' not in problem_params:
raise ParameterError('need newton_maxiter as parameter for the problem class')
if 'newton_tol' not in problem_params:
raise ParameterError('need newton_tol as parameter for the problem class')
super(grayscott_mi_diffusion, self).__init__(problem_params, dtype_u=dtype_u, dtype_f=dtype_f)
# This may not run in parallel yet..
assert self.params.comm.Get_size() == 1
def eval_f(self, u, t):
"""
Routine to evaluate the RHS
Args:
u (dtype_u): current values
t (float): current time
Returns:
dtype_f: the RHS
"""
f = self.dtype_f(self.init)
if self.params.spectral:
f.comp1[..., 0] = self.Ku * u[..., 0]
f.comp1[..., 1] = self.Kv * u[..., 1]
tmpu = newDistArray(self.fft, False)
tmpv = newDistArray(self.fft, False)
tmpu[:] = self.fft.backward(u[..., 0], tmpu)
tmpv[:] = self.fft.backward(u[..., 1], tmpv)
tmpfu = -tmpu * tmpv ** 2 + self.params.A * (1 - tmpu)
tmpfv = tmpu * tmpv ** 2 - self.params.B * tmpv
f.comp2[..., 0] = self.fft.forward(tmpfu)
f.comp2[..., 1] = self.fft.forward(tmpfv)
else:
u_hat = self.fft.forward(u[..., 0])
lap_u_hat = self.Ku * u_hat
f.comp1[..., 0] = self.fft.backward(lap_u_hat, f.comp1[..., 0])
u_hat = self.fft.forward(u[..., 1])
lap_u_hat = self.Kv * u_hat
f.comp1[..., 1] = self.fft.backward(lap_u_hat, f.comp1[..., 1])
f.comp2[..., 0] = -u[..., 0] * u[..., 1] ** 2 + self.params.A * (1 - u[..., 0])
f.comp2[..., 1] = u[..., 0] * u[..., 1] ** 2 - self.params.B * u[..., 1]
return f
def solve_system_1(self, rhs, factor, u0, t):
"""
Solver for the first component, can just call the super function
Args:
rhs (dtype_f): right-hand side for the linear system
factor (float) : abbrev. for the node-to-node stepsize (or any other factor required)
u0 (dtype_u): initial guess for the iterative solver (not used here so far)
t (float): current time (e.g. for time-dependent BCs)
Returns:
dtype_u: solution as mesh
"""
me = super(grayscott_mi_diffusion, self).solve_system(rhs, factor, u0, t)
return me
def solve_system_2(self, rhs, factor, u0, t):
"""
Newton-Solver for the second component
Args:
rhs (dtype_f): right-hand side for the linear system
factor (float) : abbrev. for the node-to-node stepsize (or any other factor required)
u0 (dtype_u): initial guess for the iterative solver (not used here so far)
t (float): current time (e.g. for time-dependent BCs)
Returns:
dtype_u: solution as mesh
"""
u = self.dtype_u(u0)
if self.params.spectral:
tmpu = newDistArray(self.fft, False)
tmpv = newDistArray(self.fft, False)
tmpu[:] = self.fft.backward(u[..., 0], tmpu)
tmpv[:] = self.fft.backward(u[..., 1], tmpv)
tmprhsu = newDistArray(self.fft, False)
tmprhsv = newDistArray(self.fft, False)
tmprhsu[:] = self.fft.backward(rhs[..., 0], tmprhsu)
tmprhsv[:] = self.fft.backward(rhs[..., 1], tmprhsv)
else:
tmpu = u[..., 0]
tmpv = u[..., 1]
tmprhsu = rhs[..., 0]
tmprhsv = rhs[..., 1]
# start newton iteration
n = 0
res = 99
while n < self.params.newton_maxiter:
# print(n, res)
# form the function g with g(u) = 0
tmpgu = tmpu - tmprhsu - factor * (-tmpu * tmpv ** 2 + self.params.A * (1 - tmpu))
tmpgv = tmpv - tmprhsv - factor * (tmpu * tmpv ** 2 - self.params.B * tmpv)
# if g is close to 0, then we are done
res = max(np.linalg.norm(tmpgu, np.inf), np.linalg.norm(tmpgv, np.inf))
if res < self.params.newton_tol:
break
# assemble dg
dg00 = 1 - factor * (-tmpv ** 2 - self.params.A)
dg01 = -factor * (-2 * tmpu * tmpv)
dg10 = -factor * (tmpv ** 2)
dg11 = 1 - factor * (2 * tmpu * tmpv - self.params.B)
# interleave and unravel to put into sparse matrix
dg00I = np.ravel(np.kron(dg00, np.array([1, 0])))
dg01I = np.ravel(np.kron(dg01, np.array([1, 0])))
dg10I = np.ravel(np.kron(dg10, np.array([1, 0])))
dg11I = np.ravel(np.kron(dg11, np.array([0, 1])))
# put into sparse matrix
dg = sp.diags(dg00I, offsets=0) + sp.diags(dg11I, offsets=0)
dg += sp.diags(dg01I, offsets=1, shape=dg.shape) + sp.diags(dg10I, offsets=-1, shape=dg.shape)
# interleave g terms to apply inverse to it
g = np.kron(tmpgu.flatten(), np.array([1, 0])) + np.kron(tmpgv.flatten(), np.array([0, 1]))
# invert dg matrix
b = sp.linalg.spsolve(dg, g)
# update real space vectors
tmpu[:] -= b[::2].reshape(self.params.nvars)
tmpv[:] -= b[1::2].reshape(self.params.nvars)
# increase iteration count
n += 1
if np.isnan(res) and self.params.stop_at_nan:
raise ProblemError('Newton got nan after %i iterations, aborting...' % n)
elif np.isnan(res):
self.logger.warning('Newton got nan after %i iterations...' % n)
if n == self.params.newton_maxiter:
self.logger.warning('Newton did not converge after %i iterations, error is %s' % (n, res))
# self.newton_ncalls += 1
# self.newton_itercount += n
me = self.dtype_u(self.init)
if self.params.spectral:
me[..., 0] = self.fft.forward(tmpu)
me[..., 1] = self.fft.forward(tmpv)
else:
me[..., 0] = tmpu
me[..., 1] = tmpv
return me
class grayscott_mi_linear(grayscott_imex_linear):
def __init__(self, problem_params, dtype_u=parallel_mesh, dtype_f=parallel_comp2_mesh):
"""
Init routine for the multi-implicit problem class with linear splitting
"""
if 'newton_maxiter' not in problem_params:
raise ParameterError('need newton_maxiter as parameter for the problem class')
if 'newton_tol' not in problem_params:
raise ParameterError('need newton_tol as parameter for the problem class')
super(grayscott_mi_linear, self).__init__(problem_params, dtype_u=dtype_u, dtype_f=dtype_f)
# This may not run in parallel yet..
assert self.params.comm.Get_size() == 1
def eval_f(self, u, t):
"""
Routine to evaluate the RHS
Args:
u (dtype_u): current values
t (float): current time
Returns:
dtype_f: the RHS
"""
f = self.dtype_f(self.init)
if self.params.spectral:
f.comp1[..., 0] = self.Ku * u[..., 0]
f.comp1[..., 1] = self.Kv * u[..., 1]
tmpu = newDistArray(self.fft, False)
tmpv = newDistArray(self.fft, False)
tmpu[:] = self.fft.backward(u[..., 0], tmpu)
tmpv[:] = self.fft.backward(u[..., 1], tmpv)
tmpfu = -tmpu * tmpv ** 2 + self.params.A
tmpfv = tmpu * tmpv ** 2
f.comp2[..., 0] = self.fft.forward(tmpfu)
f.comp2[..., 1] = self.fft.forward(tmpfv)
else:
u_hat = self.fft.forward(u[..., 0])
lap_u_hat = self.Ku * u_hat
f.comp1[..., 0] = self.fft.backward(lap_u_hat, f.comp1[..., 0])
u_hat = self.fft.forward(u[..., 1])
lap_u_hat = self.Kv * u_hat
f.comp1[..., 1] = self.fft.backward(lap_u_hat, f.comp1[..., 1])
f.comp2[..., 0] = -u[..., 0] * u[..., 1] ** 2 + self.params.A
f.comp2[..., 1] = u[..., 0] * u[..., 1] ** 2
return f
def solve_system_1(self, rhs, factor, u0, t):
"""
Solver for the first component, can just call the super function
Args:
rhs (dtype_f): right-hand side for the linear system
factor (float) : abbrev. for the node-to-node stepsize (or any other factor required)
u0 (dtype_u): initial guess for the iterative solver (not used here so far)
t (float): current time (e.g. for time-dependent BCs)
Returns:
dtype_u: solution as mesh
"""
me = super(grayscott_mi_linear, self).solve_system(rhs, factor, u0, t)
return me
def solve_system_2(self, rhs, factor, u0, t):
"""
Newton-Solver for the second component
Args:
rhs (dtype_f): right-hand side for the linear system
factor (float) : abbrev. for the node-to-node stepsize (or any other factor required)
u0 (dtype_u): initial guess for the iterative solver (not used here so far)
t (float): current time (e.g. for time-dependent BCs)
Returns:
dtype_u: solution as mesh
"""
u = self.dtype_u(u0)
if self.params.spectral:
tmpu = newDistArray(self.fft, False)
tmpv = newDistArray(self.fft, False)
tmpu[:] = self.fft.backward(u[..., 0], tmpu)
tmpv[:] = self.fft.backward(u[..., 1], tmpv)
tmprhsu = newDistArray(self.fft, False)
tmprhsv = newDistArray(self.fft, False)
tmprhsu[:] = self.fft.backward(rhs[..., 0], tmprhsu)
tmprhsv[:] = self.fft.backward(rhs[..., 1], tmprhsv)
else:
tmpu = u[..., 0]
tmpv = u[..., 1]
tmprhsu = rhs[..., 0]
tmprhsv = rhs[..., 1]
# start newton iteration
n = 0
res = 99
while n < self.params.newton_maxiter:
# print(n, res)
# form the function g with g(u) = 0
tmpgu = tmpu - tmprhsu - factor * (-tmpu * tmpv ** 2 + self.params.A)
tmpgv = tmpv - tmprhsv - factor * (tmpu * tmpv ** 2)
# if g is close to 0, then we are done
res = max(np.linalg.norm(tmpgu, np.inf), np.linalg.norm(tmpgv, np.inf))
if res < self.params.newton_tol:
break
# assemble dg
dg00 = 1 - factor * (-tmpv ** 2)
dg01 = -factor * (-2 * tmpu * tmpv)
dg10 = -factor * (tmpv ** 2)
dg11 = 1 - factor * (2 * tmpu * tmpv)
# interleave and unravel to put into sparse matrix
dg00I = np.ravel(np.kron(dg00, np.array([1, 0])))
dg01I = np.ravel(np.kron(dg01, np.array([1, 0])))
dg10I = np.ravel(np.kron(dg10, np.array([1, 0])))
dg11I = np.ravel(np.kron(dg11, np.array([0, 1])))
# put into sparse matrix
dg = sp.diags(dg00I, offsets=0) + sp.diags(dg11I, offsets=0)
dg += sp.diags(dg01I, offsets=1, shape=dg.shape) + sp.diags(dg10I, offsets=-1, shape=dg.shape)
# interleave g terms to apply inverse to it
g = np.kron(tmpgu.flatten(), np.array([1, 0])) + np.kron(tmpgv.flatten(), np.array([0, 1]))
# invert dg matrix
b = sp.linalg.spsolve(dg, g)
# update real-space vectors
tmpu[:] -= b[::2].reshape(self.params.nvars)
tmpv[:] -= b[1::2].reshape(self.params.nvars)
# increase iteration count
n += 1
if np.isnan(res) and self.params.stop_at_nan:
raise ProblemError('Newton got nan after %i iterations, aborting...' % n)
elif np.isnan(res):
self.logger.warning('Newton got nan after %i iterations...' % n)
if n == self.params.newton_maxiter:
self.logger.warning('Newton did not converge after %i iterations, error is %s' % (n, res))
# self.newton_ncalls += 1
# self.newton_itercount += n
me = self.dtype_u(self.init)
if self.params.spectral:
me[..., 0] = self.fft.forward(tmpu)
me[..., 1] = self.fft.forward(tmpv)
else:
me[..., 0] = tmpu
me[..., 1] = tmpv
return me
| 37.730051 | 119 | 0.534446 | 3,014 | 22,223 | 3.848042 | 0.115793 | 0.04587 | 0.033626 | 0.033109 | 0.772375 | 0.747888 | 0.713571 | 0.706932 | 0.701242 | 0.701242 | 0 | 0.028392 | 0.320074 | 22,223 | 588 | 120 | 37.794218 | 0.739179 | 0.219142 | 0 | 0.689769 | 0 | 0 | 0.047031 | 0 | 0 | 0 | 0 | 0 | 0.013201 | 1 | 0.046205 | false | 0 | 0.026403 | 0 | 0.118812 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
8711c6721bc22985453db5547d8e379641b3a07b | 39 | py | Python | tests/components/youless/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/youless/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/youless/__init__.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Tests for the youless component."""
| 19.5 | 38 | 0.692308 | 5 | 39 | 5.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128205 | 39 | 1 | 39 | 39 | 0.794118 | 0.820513 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
8732ca023b53ffcaffc3416afa43890778a55c9b | 106 | py | Python | validation/certs/utils/setup.py | Werxis/usable-cert-validation | d166af6accbd1054f1ecd9db7a70600ca9c1bf8e | [
"MIT"
] | 13 | 2019-07-11T11:41:14.000Z | 2021-12-18T23:50:56.000Z | validation/certs/utils/setup.py | Werxis/usable-cert-validation | d166af6accbd1054f1ecd9db7a70600ca9c1bf8e | [
"MIT"
] | 115 | 2019-07-11T13:46:38.000Z | 2022-03-08T18:28:31.000Z | validation/certs/utils/setup.py | Werxis/usable-cert-validation | d166af6accbd1054f1ecd9db7a70600ca9c1bf8e | [
"MIT"
] | 9 | 2020-05-05T17:11:17.000Z | 2021-12-19T15:04:48.000Z | from setuptools import setup, find_packages
setup(name='utils', version='1.0', packages=find_packages())
| 26.5 | 60 | 0.773585 | 15 | 106 | 5.333333 | 0.733333 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020619 | 0.084906 | 106 | 3 | 61 | 35.333333 | 0.804124 | 0 | 0 | 0 | 0 | 0 | 0.075472 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
877065f7c29047e46c558fb9f9fb47eee6fd1479 | 11,174 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py | wilbeacham85/genielibs | 519da71e3956b86d4211d8649667c0d931dd2715 | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py | wilbeacham85/genielibs | 519da71e3956b86d4211d8649667c0d931dd2715 | [
"Apache-2.0"
] | 1 | 2020-08-01T00:59:29.000Z | 2020-08-01T00:59:32.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py | jeaubin/genielibs | b4c9c4c0e7b85a7bef94ab77cc477a1c8592a0cb | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import sys
import unittest
import logging
sys.path = ['.', '..'] + sys.path
from blitz.rpcverify import RpcVerify
# TODO: Needs to be part of genielibs test run
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
operstate = """<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" \
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" \
message-id="urn:uuid:d0c1123f-2f54-49bb-aafe-ec3723318163">
<data>
<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
<name xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> \
GigabitEthernet2</name>
<statistics>
<discontinuity-time>2019-05-31T14:37:03.000993+00:00 \
</discontinuity-time>
<in-octets>330</in-octets>
<in-unicast-pkts>5</in-unicast-pkts>
<in-broadcast-pkts>6</in-broadcast-pkts>
<in-multicast-pkts>7</in-multicast-pkts>
<in-discards>8</in-discards>
<in-errors>9</in-errors>
<in-unknown-protos>10</in-unknown-protos>
<out-octets>11</out-octets>
<out-unicast-pkts>12</out-unicast-pkts>
<out-broadcast-pkts>13</out-broadcast-pkts>
<out-multicast-pkts>14</out-multicast-pkts>
<out-discards>17</out-discards>
<out-errors>16</out-errors>
</statistics>
</interface>
</interfaces-state>
</data>
</rpc-reply>"""
class TestRpcVerify(unittest.TestCase):
"""Test cases for the rpcverify.RpcVerify methods."""
@classmethod
def setUpClass(cls):
cls.log = log
cls.cap = ['urn:ietf:params:netconf:capability:with-defaults:1.0?\
basic-mode=explicit&also-supported=report-all-tagged']
cls.rpcv = RpcVerify(log=cls.log, capabilities=cls.cap)
cls.operstate = operstate
def test_operational_state_pass(self):
"""Process rpc-reply and check opfields for match."""
# xpath used for match instead of ID.
opfields = [
{'selected': 'true',
'name': 'in-unicast-pkts',
'xpath': '/interfaces-state/interface/statistics/in-unicast-pkts',
'value': '5',
'op': '=='},
{'selected': 'true',
'name': 'in-octets',
'xpath': '/interfaces-state/interface/statistics/in-octets',
'value': '330',
'op': '>='},
{'selected': 'true',
'name': 'out-discards',
'xpath': '/interfaces-state/interface/statistics/out-discards',
'value': '17',
'op': '=='},
{'selected': 'true',
'name': 'out-errors',
'xpath': '/interfaces-state/interface/statistics/out-errors',
'value': '16',
'op': '=='}]
resp = self.rpcv.process_rpc_reply(operstate)
result = self.rpcv.process_operational_state(resp, opfields)
self.assertTrue(result)
def test_operational_state_fail(self):
"""Process rpc-reply and check opfields with one mismatch."""
# xpath used for match instead of ID.
opfields = [
{'selected': 'true',
'name': 'in-unicast-pkts',
'xpath': '/interfaces-state/interface/statistics/in-unicast-pkts',
'value': '5',
'op': '=='},
{'selected': 'true',
'name': 'in-octets',
'xpath': '/interfaces-state/interface/statistics/in-octets',
'value': '3300',
'op': '>='},
{'selected': 'true',
'name': 'out-discards',
'xpath': '/interfaces-state/interface/statistics/out-discards',
'value': '17',
'op': '=='},
{'selected': 'true',
'name': 'out-errors',
'xpath': '/interfaces-state/interface/statistics/out-errors',
'value': '16',
'op': '=='}]
resp = self.rpcv.process_rpc_reply(self.operstate)
result = self.rpcv.process_operational_state(resp, opfields)
self.assertFalse(result)
def test_operational_state_uint_datatype_pass(self):
"""Process rpc-reply and check opfields for datatype match."""
# xpath used for match instead of ID.
opfields = [
{'selected': 'true',
'name': 'in-unicast-pkts',
'xpath': '/interfaces-state/interface/statistics/in-unicast-pkts',
'value': 5,
'datatype': 'uint8',
'op': '=='},
{'selected': 'true',
'name': 'in-octets',
'xpath': '/interfaces-state/interface/statistics/in-octets',
'value': 330,
'datatype': 'uint16',
'op': '>='},
{'selected': 'true',
'name': 'out-discards',
'xpath': '/interfaces-state/interface/statistics/out-discards',
'value': '17',
'op': '=='},
{'selected': 'true',
'name': 'out-errors',
'xpath': '/interfaces-state/interface/statistics/out-errors',
'value': '16',
'datatype': 'uint8',
'op': '=='}]
resp = self.rpcv.process_rpc_reply(self.operstate)
result = self.rpcv.process_operational_state(resp, opfields)
self.assertTrue(result)
def test_operational_state_int_datatype_positive(self):
"""Process rpc-reply and check opfields with int8-64 > 0 matchs."""
oper = self.operstate.replace('330', '30000')
oper = oper.replace('17', '70000')
oper = oper.replace('16', '7000000000')
opfields = [
{'selected': 'true',
'name': 'in-unicast-pkts',
'xpath': '/interfaces-state/interface/statistics/in-unicast-pkts',
'value': 5,
'datatype': 'int8',
'op': '=='},
{'selected': 'true',
'name': 'in-octets',
'xpath': '/interfaces-state/interface/statistics/in-octets',
'value': 30000,
'datatype': 'int16',
'op': '>='},
{'selected': 'true',
'name': 'out-discards',
'xpath': '/interfaces-state/interface/statistics/out-discards',
'value': 70000,
'datatype': 'int32',
'op': '=='},
{'selected': 'true',
'name': 'out-errors',
'xpath': '/interfaces-state/interface/statistics/out-errors',
'value': 7000000000,
'datatype': 'int64',
'op': '=='}]
resp = self.rpcv.process_rpc_reply(oper)
result = self.rpcv.process_operational_state(resp, opfields)
self.assertTrue(result)
def test_operational_state_int_datatype_negative(self):
"""Process rpc-reply and check opfields with int8-64 > 0 matchs."""
oper = self.operstate.replace('5', '-5')
oper = oper.replace('330', '-30000')
oper = oper.replace('17', '-70000')
oper = oper.replace('16', '-7000000000')
opfields = [
{'selected': 'true',
'name': 'in-unicast-pkts',
'xpath': '/interfaces-state/interface/statistics/in-unicast-pkts',
'value': -5,
'datatype': 'int8',
'op': '=='},
{'selected': 'true',
'name': 'in-octets',
'xpath': '/interfaces-state/interface/statistics/in-octets',
'value': -30000,
'datatype': 'int16',
'op': '>='},
{'selected': 'true',
'name': 'out-discards',
'xpath': '/interfaces-state/interface/statistics/out-discards',
'value': -70000,
'datatype': 'int32',
'op': '=='},
{'selected': 'true',
'name': 'out-errors',
'xpath': '/interfaces-state/interface/statistics/out-errors',
'value': -7000000000,
'datatype': 'int64',
'op': '=='}]
resp = self.rpcv.process_rpc_reply(oper)
result = self.rpcv.process_operational_state(resp, opfields)
self.assertTrue(result)
def test_operational_state_uint_datatypes(self):
"""Process rpc-reply and check opfields with uint8-64 match."""
oper = self.operstate.replace('330', '30000')
oper = oper.replace('17', '70000')
oper = oper.replace('16', '18446744073709551614')
opfields = [
{'selected': 'true',
'name': 'in-unicast-pkts',
'xpath': '/interfaces-state/interface/statistics/in-unicast-pkts',
'value': 5,
'datatype': 'uint8',
'op': '=='},
{'selected': 'true',
'name': 'in-octets',
'xpath': '/interfaces-state/interface/statistics/in-octets',
'value': 30000,
'datatype': 'uint16',
'op': '>='},
{'selected': 'true',
'name': 'out-discards',
'xpath': '/interfaces-state/interface/statistics/out-discards',
'value': 70000,
'datatype': 'uint32',
'op': '=='},
{'selected': 'true',
'name': 'out-errors',
'xpath': '/interfaces-state/interface/statistics/out-errors',
'value': 18446744073709551614,
'datatype': 'uint64',
'op': '=='}]
resp = self.rpcv.process_rpc_reply(oper)
result = self.rpcv.process_operational_state(resp, opfields)
self.assertTrue(result)
def test_operational_state_other_datatype(self):
"""Check opfields empty, boolean, pattern matches."""
oper = self.operstate.replace('5', '')
oper = oper.replace('330', 'true')
oper = oper.replace('17', 'false')
oper = oper.replace('16', 'abc[123]DEFghblahblah')
opfields = [
{'selected': 'true',
'name': 'in-unicast-pkts',
'xpath': '/interfaces-state/interface/statistics/in-unicast-pkts',
'value': 'empty',
'datatype': 'empty',
'op': '=='},
{'selected': 'true',
'name': 'in-octets',
'xpath': '/interfaces-state/interface/statistics/in-octets',
'value': 'true',
'datatype': 'boolean',
'op': '=='},
{'selected': 'true',
'name': 'out-discards',
'xpath': '/interfaces-state/interface/statistics/out-discards',
'value': 'False',
'datatype': 'boolean',
'op': '=='},
{'selected': 'true',
'name': 'out-errors',
'xpath': '/interfaces-state/interface/statistics/out-errors',
'value': '([^a-zA-Z1-3\\[])|(blah)',
'datatype': 'pattern',
'op': '=='}]
resp = self.rpcv.process_rpc_reply(oper)
result = self.rpcv.process_operational_state(resp, opfields)
self.assertTrue(result)
if __name__ == '__main__':
unittest.main()
| 38.267123 | 79 | 0.521836 | 1,078 | 11,174 | 5.345083 | 0.165121 | 0.078098 | 0.077751 | 0.140923 | 0.746789 | 0.737591 | 0.72631 | 0.721104 | 0.707567 | 0.687608 | 0 | 0.040629 | 0.306157 | 11,174 | 291 | 80 | 38.398625 | 0.702567 | 0.05486 | 0 | 0.67451 | 0 | 0.019608 | 0.401008 | 0.214816 | 0 | 0 | 0 | 0.003436 | 0.027451 | 1 | 0.031373 | false | 0.007843 | 0.015686 | 0 | 0.05098 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
87718ba3e4a20fe4d5e3c589251eb1ed3c6e392a | 147 | py | Python | setup.py | lund5000/chirpradio | e084d53e92d897766ac19fe85eeabad68a1d7e39 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2016-01-26T08:09:59.000Z | 2019-03-23T23:27:07.000Z | setup.py | lund5000/chirpradio | e084d53e92d897766ac19fe85eeabad68a1d7e39 | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2016-02-16T03:36:14.000Z | 2020-05-04T16:19:00.000Z | setup.py | lund5000/chirpradio | e084d53e92d897766ac19fe85eeabad68a1d7e39 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2016-04-16T02:51:35.000Z | 2021-12-06T19:25:15.000Z | #!/usr/bin/env python
import sys
sys.stdout.write('This is not a real setup.py script\n')
sys.stdout.write('It only exists for readthedocs.org\n')
| 29.4 | 56 | 0.748299 | 28 | 147 | 3.928571 | 0.821429 | 0.163636 | 0.254545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108844 | 147 | 4 | 57 | 36.75 | 0.839695 | 0.136054 | 0 | 0 | 0 | 0 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
877295c188af78dbf802f456108492368d458fb3 | 802 | py | Python | tests/test_utf8_validation.py | stachenov/PyLeetCode | cb13700d428854eff46a762542a63d691578d5b6 | [
"Unlicense"
] | null | null | null | tests/test_utf8_validation.py | stachenov/PyLeetCode | cb13700d428854eff46a762542a63d691578d5b6 | [
"Unlicense"
] | null | null | null | tests/test_utf8_validation.py | stachenov/PyLeetCode | cb13700d428854eff46a762542a63d691578d5b6 | [
"Unlicense"
] | null | null | null | import pytest
from problems.utf8_validation import Solution
@pytest.mark.parametrize("data,expected", [
([0], True),
([0b10000000], False),
([0b11000000], False),
([0b11000000, 0b10000000], True),
([0b11100000, 0b10000000, 0b10000000], True),
([0b11110000, 0b10000000, 0b10000000, 0b10000000], True),
([0b11111000, 0b10000000, 0b10000000, 0b10000000, 0b10000000], True),
([0b11111100, 0b10000000, 0b10000000, 0b10000000, 0b10000000, 0b10000000], True),
([0b11111110, 0b10000000, 0b10000000, 0b10000000, 0b10000000, 0b10000000, 0b10000000], True),
([0b11111110, 0b10000000, 0b10000000, 0b10000000, 0b10000000, 0b10000000], False),
([0b11111111], False),
])
def test(data, expected):
solution = Solution()
assert solution.validUtf8(data) == expected
| 38.190476 | 97 | 0.704489 | 72 | 802 | 7.833333 | 0.361111 | 0.673759 | 0.691489 | 0.567376 | 0.411348 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0 | 0.480176 | 0.150873 | 802 | 20 | 98 | 40.1 | 0.348018 | 0 | 0 | 0 | 0 | 0 | 0.016209 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 1 | 0.055556 | false | 0 | 0.111111 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
8778a60bf3a16069c6d12707716d37a9431b7c85 | 102 | py | Python | python/leap/leap.py | dalprahcd/exercism-solutions | ba320c22c0c2283d89bf20ffa3a410e09b289242 | [
"MIT"
] | 1 | 2022-03-10T10:40:57.000Z | 2022-03-10T10:40:57.000Z | python/leap/leap.py | dalprahcd/exercism-solutions | ba320c22c0c2283d89bf20ffa3a410e09b289242 | [
"MIT"
] | null | null | null | python/leap/leap.py | dalprahcd/exercism-solutions | ba320c22c0c2283d89bf20ffa3a410e09b289242 | [
"MIT"
] | null | null | null | def leap_year(year : int) -> bool:
return (year % 4 == 0 and year % 100 != 0) or year % 400 == 0
| 34 | 66 | 0.54902 | 18 | 102 | 3.055556 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136986 | 0.284314 | 102 | 2 | 67 | 51 | 0.616438 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
5e419f81ff2ea6eb12a58eb34362b401d8e0ff22 | 1,957 | py | Python | geo/tests/test_top_k_acc.py | stefantaubert/life | 14fe8c0d631eb22f6c3f9e41430dbcfcd1718012 | [
"MIT"
] | 2 | 2018-06-28T13:02:35.000Z | 2018-12-25T08:58:26.000Z | geo/tests/test_top_k_acc.py | stefantaubert/life | 14fe8c0d631eb22f6c3f9e41430dbcfcd1718012 | [
"MIT"
] | null | null | null | geo/tests/test_top_k_acc.py | stefantaubert/life | 14fe8c0d631eb22f6c3f9e41430dbcfcd1718012 | [
"MIT"
] | null | null | null | import unittest
from geo.metrics.top_k_acc import top_k_acc
from geo.metrics.top_k_acc import top_k_accuracy
class TestGetRanksMethod(unittest.TestCase):
'''Class for tests of the method get_score() and top_k_acc() of the module top_k_acc.'''
def test_basic(self):
y_pred = [
[0.1, 0.2, 0.3, 0.4],
[0.1, 0.2, 0.3, 0.4],
[0.1, 0.2, 0.3, 0.4],
[0.1, 0.2, 0.3, 0.4],
]
class_map = [1,2,3,4]
y_true = [1,2,3,4]
self.assertEqual(0.25, top_k_acc(y_pred, y_true, class_map, 1))
self.assertEqual(0.5, top_k_acc(y_pred, y_true, class_map, 2))
self.assertEqual(0.75, top_k_acc(y_pred, y_true, class_map, 3))
self.assertEqual(1, top_k_acc(y_pred, y_true, class_map, 4))
def test_multicore(self):
y_pred = [
[0.1, 0.2, 0.3, 0.4],
[0.1, 0.2, 0.3, 0.4],
[0.1, 0.2, 0.3, 0.4],
[0.1, 0.2, 0.3, 0.4],
]
class_map = [1,2,3,4]
y_true = [1,2,3,4]
t = top_k_accuracy()
self.assertEqual(0.25, t.get_score(y_pred, y_true, class_map, 1))
self.assertEqual(0.5, t.get_score(y_pred, y_true, class_map, 2))
self.assertEqual(0.75, t.get_score(y_pred, y_true, class_map, 3))
self.assertEqual(1, t.get_score(y_pred, y_true, class_map, 4))
def test_extrem(self):
l = 1000000
y_pred = [[0.1, 0.2, 0.3, 0.4] for _ in range(l)]
class_map = [x for x in range(1,4)]
y_true = [4 for x in range(l)]
top_k_acc(y_pred, y_true, class_map, 1)
def test_extrem_multicore(self):
l = 1000000
y_pred = [[0.1, 0.2, 0.3, 0.4] for _ in range(l)]
class_map = [x for x in range(1,4)]
y_true = [4 for x in range(l)]
t = top_k_accuracy()
self.assertEqual(1, t.get_score(y_pred, y_true, class_map, 1))
if __name__ == '__main__':
unittest.main() | 32.081967 | 92 | 0.554931 | 365 | 1,957 | 2.731507 | 0.134247 | 0.070211 | 0.070211 | 0.04012 | 0.78335 | 0.78335 | 0.742227 | 0.742227 | 0.742227 | 0.60682 | 0 | 0.104317 | 0.289729 | 1,957 | 61 | 93 | 32.081967 | 0.61295 | 0.041901 | 0 | 0.521739 | 0 | 0 | 0.004278 | 0 | 0 | 0 | 0 | 0 | 0.195652 | 1 | 0.086957 | false | 0 | 0.065217 | 0 | 0.173913 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
5e826678254eebc378755d7a100a509f401facd8 | 418 | py | Python | biothings/web/__main__.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | 30 | 2017-07-23T14:50:29.000Z | 2022-02-08T08:08:16.000Z | biothings/web/__main__.py | kevinxin90/biothings.api | 8ff3bbaecd72d04db4933ff944898ee7b7c0e04a | [
"Apache-2.0"
] | 163 | 2017-10-24T18:45:40.000Z | 2022-03-28T03:46:26.000Z | biothings/web/__main__.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | 22 | 2017-06-12T18:30:15.000Z | 2022-03-01T18:10:47.000Z | """
Biothings API
Support running biothings.web as a module
>> python -m biothings.web
>> python -m biothings.web --dir=~/mygene.info/src
>> python -m biothings.web --dir=~/mygene.info/src --conf=config_web
>> python -m biothings.web --conf=biothings.web.settings.default
See more supported parameters in biothings.web.launcher.
"""
from biothings.web.launcher import main
main()
| 23.222222 | 72 | 0.684211 | 56 | 418 | 5.089286 | 0.482143 | 0.336842 | 0.224561 | 0.266667 | 0.333333 | 0.245614 | 0.245614 | 0.245614 | 0 | 0 | 0 | 0 | 0.188995 | 418 | 17 | 73 | 24.588235 | 0.840708 | 0.782297 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
5e92160f7fec30a2a1424ce1f8fc00c5fe2b6367 | 235 | py | Python | rgsync/__init__.py | spicy-sauce/rgsync | 45d00696c1d01931a95a5f1e97b552d5e212e9fa | [
"BSD-3-Clause"
] | 59 | 2020-03-26T07:21:45.000Z | 2022-03-28T15:22:32.000Z | rgsync/__init__.py | spicy-sauce/rgsync | 45d00696c1d01931a95a5f1e97b552d5e212e9fa | [
"BSD-3-Clause"
] | 39 | 2020-04-14T17:01:08.000Z | 2022-03-28T15:32:24.000Z | rgsync/__init__.py | spicy-sauce/rgsync | 45d00696c1d01931a95a5f1e97b552d5e212e9fa | [
"BSD-3-Clause"
] | 25 | 2020-04-02T19:34:52.000Z | 2022-01-12T08:18:10.000Z | from .redis_gears_write_behind import (
RGWriteBehind,
RGWriteThrough,
RGJSONWriteBehind,
RGJSONWriteThrough
)
__all__ = [
'RGWriteBehind',
'RGWriteThrough',
'RGJSONWriteBehind',
'RGJSONWriteThrough',
] | 18.076923 | 39 | 0.702128 | 15 | 235 | 10.533333 | 0.733333 | 0.341772 | 0.556962 | 0.78481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208511 | 235 | 13 | 40 | 18.076923 | 0.849462 | 0 | 0 | 0 | 0 | 0 | 0.262712 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0 | 1 | 0 | 1 | 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 | 5 |
5ea5654a54d5574b3163792e71cc5a695ce017e0 | 56 | py | Python | cflearn/misc/internal_/callbacks/models/__init__.py | carefree0910/carefree-learn | 2043812afbe9c56f01ec1639961736313ee062ba | [
"MIT"
] | 400 | 2020-07-05T18:55:49.000Z | 2022-02-21T02:33:08.000Z | cflearn/misc/internal_/callbacks/models/__init__.py | carefree0910/carefree-learn | 2043812afbe9c56f01ec1639961736313ee062ba | [
"MIT"
] | 82 | 2020-08-01T13:29:38.000Z | 2021-10-09T07:13:44.000Z | cflearn/misc/internal_/callbacks/models/__init__.py | carefree0910/carefree-learn | 2043812afbe9c56f01ec1639961736313ee062ba | [
"MIT"
] | 34 | 2020-07-05T21:15:34.000Z | 2021-12-20T08:45:17.000Z | from .vq_vae import *
from .clip_vqgan_aligner import *
| 18.666667 | 33 | 0.785714 | 9 | 56 | 4.555556 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 56 | 2 | 34 | 28 | 0.854167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
5eb009ec98ab547b88e981baf137bf916df9f86a | 211 | py | Python | routes/__init__.py | FreakyGoblin/odie-server | 472c4971d7b50e8cc2a362e42cf914def7feb079 | [
"MIT"
] | 9 | 2015-06-04T17:13:45.000Z | 2021-11-09T21:26:39.000Z | routes/__init__.py | FreakyGoblin/odie-server | 472c4971d7b50e8cc2a362e42cf914def7feb079 | [
"MIT"
] | 49 | 2015-02-15T14:42:42.000Z | 2020-08-19T11:42:55.000Z | routes/__init__.py | FreakyGoblin/odie-server | 472c4971d7b50e8cc2a362e42cf914def7feb079 | [
"MIT"
] | 8 | 2015-06-04T20:46:18.000Z | 2020-08-18T15:38:06.000Z | #! /usr/bin/env python3
import config
from .common import *
from .accounting import *
from .documents import *
from .printing import *
from .misc import *
if config.LOCAL_SERVER:
from .sso_login import *
| 16.230769 | 28 | 0.729858 | 29 | 211 | 5.241379 | 0.586207 | 0.263158 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00578 | 0.180095 | 211 | 12 | 29 | 17.583333 | 0.872832 | 0.104265 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.875 | 0 | 0.875 | 0.125 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0d708ddd660c368e4e36a42f9a3fa2eb1ce3d0cd | 434 | py | Python | eots/exceptions.py | lextoumbourou/eyeofthestorm | bbcb5b535c0a051e63ad1949b7107bc617094279 | [
"Unlicense"
] | null | null | null | eots/exceptions.py | lextoumbourou/eyeofthestorm | bbcb5b535c0a051e63ad1949b7107bc617094279 | [
"Unlicense"
] | null | null | null | eots/exceptions.py | lextoumbourou/eyeofthestorm | bbcb5b535c0a051e63ad1949b7107bc617094279 | [
"Unlicense"
] | null | null | null | from cyclone.web import HTTPError
class RESTException(Exception):
pass
class UnversionedResourceException(RESTException):
pass
class NoRendererException(RESTException):
pass
class ResourceVersionNotFoundError(HTTPError, RESTException):
pass
class UnsupportedMediaType(HTTPError, RESTException):
pass
class ParseError(RESTException):
pass
class AuthFailedError(HTTPError, RESTException):
pass
| 14.466667 | 61 | 0.781106 | 36 | 434 | 9.416667 | 0.416667 | 0.159292 | 0.324484 | 0.182891 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16129 | 434 | 29 | 62 | 14.965517 | 0.931319 | 0 | 0 | 0.466667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.466667 | 0.066667 | 0 | 0.533333 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
0d88d6d5c892117ad06dca0aaa33184a160f92b9 | 40 | py | Python | tests/__init__.py | mehmetalivarol/handson_ml | 7b431c60cfa1cbf2e1679fd409ba6b83c199645c | [
"MIT"
] | null | null | null | tests/__init__.py | mehmetalivarol/handson_ml | 7b431c60cfa1cbf2e1679fd409ba6b83c199645c | [
"MIT"
] | null | null | null | tests/__init__.py | mehmetalivarol/handson_ml | 7b431c60cfa1cbf2e1679fd409ba6b83c199645c | [
"MIT"
] | null | null | null | """Unit test package for handson_ml."""
| 20 | 39 | 0.7 | 6 | 40 | 4.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 40 | 1 | 40 | 40 | 0.771429 | 0.825 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
0d8c9f20bc50d511ff4324801784df429c430d41 | 52 | py | Python | simplenet/__init__.py | kirkbroadhurst/simple_neural_network | 36c1f9e40093c21c809bbbad20c301716cbbf293 | [
"Apache-2.0"
] | null | null | null | simplenet/__init__.py | kirkbroadhurst/simple_neural_network | 36c1f9e40093c21c809bbbad20c301716cbbf293 | [
"Apache-2.0"
] | null | null | null | simplenet/__init__.py | kirkbroadhurst/simple_neural_network | 36c1f9e40093c21c809bbbad20c301716cbbf293 | [
"Apache-2.0"
] | null | null | null | import lib
from simple_machine import SimpleMachine
| 17.333333 | 40 | 0.884615 | 7 | 52 | 6.428571 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 52 | 2 | 41 | 26 | 0.978261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0db21bca30eca10aedccfdf1200d23cb2c3151f1 | 186 | py | Python | policosm/classes/__init__.py | ComplexCity/policosm | 548d4d694df49603f91cd45af7fe50ced79aea68 | [
"MIT"
] | 6 | 2017-06-05T07:30:46.000Z | 2022-03-07T00:47:22.000Z | policosm/classes/__init__.py | ComplexCity/policosm | 548d4d694df49603f91cd45af7fe50ced79aea68 | [
"MIT"
] | 1 | 2017-12-14T05:40:42.000Z | 2017-12-14T05:40:42.000Z | policosm/classes/__init__.py | ComplexCity/policosm | 548d4d694df49603f91cd45af7fe50ced79aea68 | [
"MIT"
] | 1 | 2020-10-22T19:18:30.000Z | 2020-10-22T19:18:30.000Z | from .buildings import Buildings
#from .distances import Distances, customMetric
from .greenSpaces import GreenSpaces
from .roads import Roads
from .transportation import Transportation
| 31 | 47 | 0.849462 | 21 | 186 | 7.52381 | 0.380952 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112903 | 186 | 5 | 48 | 37.2 | 0.957576 | 0.247312 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0db90923fd1ec5c8f68491c947fc9cd7b40b1acc | 238 | py | Python | lib/pandas_option.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | null | null | null | lib/pandas_option.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | 4 | 2020-10-03T20:37:55.000Z | 2020-10-04T23:11:38.000Z | lib/pandas_option.py | yuta-komura/amateras | cf8cc8fe0b5d8c382090fd1784a3ce96e6953157 | [
"MIT"
] | null | null | null | import pandas as pd
def display_max_columns():
pd.options.display.max_columns = None
def display_max_rows():
pd.options.display.max_rows = None
def display_round_down():
pd.options.display.float_format = '{:.2f}'.format
| 17 | 53 | 0.726891 | 35 | 238 | 4.685714 | 0.457143 | 0.243902 | 0.292683 | 0.231707 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004975 | 0.155462 | 238 | 13 | 54 | 18.307692 | 0.810945 | 0 | 0 | 0 | 0 | 0 | 0.02521 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | true | 0 | 0.142857 | 0 | 0.571429 | 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 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
0dd59a645d2533b0eea8b94e95741ea763cb7ed8 | 71 | py | Python | src/core/cmp/parser/__init__.py | 2kodevs/cool-compiler-2020 | 7b4e36706562d616c6bf900049edf52281ac2e2b | [
"MIT"
] | 3 | 2020-02-11T23:45:43.000Z | 2021-09-03T15:18:06.000Z | src/core/cmp/parser/__init__.py | 2kodevs/cool-compiler-2020 | 7b4e36706562d616c6bf900049edf52281ac2e2b | [
"MIT"
] | null | null | null | src/core/cmp/parser/__init__.py | 2kodevs/cool-compiler-2020 | 7b4e36706562d616c6bf900049edf52281ac2e2b | [
"MIT"
] | 3 | 2022-02-23T21:41:26.000Z | 2022-02-26T20:53:27.000Z | from .LR1 import LR1Parser
from .shift_reduce import ShiftReduceParser
| 23.666667 | 43 | 0.859155 | 9 | 71 | 6.666667 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031746 | 0.112676 | 71 | 2 | 44 | 35.5 | 0.920635 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0deca909862d778d5eb7e9c9c24e3a964ff5f4b9 | 211 | py | Python | flask_awesomemongokit/__init__.py | angstwad/flask-awesomemongokit | e48dd1237df38f437f1b51fa6147f0407cbc1cb9 | [
"Apache-2.0"
] | null | null | null | flask_awesomemongokit/__init__.py | angstwad/flask-awesomemongokit | e48dd1237df38f437f1b51fa6147f0407cbc1cb9 | [
"Apache-2.0"
] | null | null | null | flask_awesomemongokit/__init__.py | angstwad/flask-awesomemongokit | e48dd1237df38f437f1b51fa6147f0407cbc1cb9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask_awesomemongokit.extension import AwesomeMongoKit
from flask_awesomemongokit.index import index_all_docs
__all__ = ['AwesomeMongoKit', 'index_all_docs']
| 26.375 | 59 | 0.78673 | 26 | 211 | 6 | 0.576923 | 0.115385 | 0.307692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005263 | 0.099526 | 211 | 7 | 60 | 30.142857 | 0.815789 | 0.199052 | 0 | 0 | 0 | 0 | 0.173653 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0df1cd71c6ad9e2423515727f1e27bfdad846131 | 40 | py | Python | credsweeper/utils/__init__.py | ARKAD97/CredSweeper | 0f613cded13d6c28c19c57eac54dd245b2c318ea | [
"MIT"
] | 1 | 2022-03-03T18:11:59.000Z | 2022-03-03T18:11:59.000Z | credsweeper/utils/__init__.py | shadowscatcher/CredSweeper | 0387ed76aca4a12154e15c49db8dc0901a014275 | [
"MIT"
] | null | null | null | credsweeper/utils/__init__.py | shadowscatcher/CredSweeper | 0387ed76aca4a12154e15c49db8dc0901a014275 | [
"MIT"
] | null | null | null | from credsweeper.utils.util import Util
| 20 | 39 | 0.85 | 6 | 40 | 5.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 40 | 1 | 40 | 40 | 0.944444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
2181a3fb24b9ae532d7e95357707e78a2e963177 | 155 | py | Python | IMA/Python/Kivy/try.py | homdx/edu | a32c9f1777f80a54c3d4a3fc8389748fe27739c0 | [
"MIT"
] | null | null | null | IMA/Python/Kivy/try.py | homdx/edu | a32c9f1777f80a54c3d4a3fc8389748fe27739c0 | [
"MIT"
] | null | null | null | IMA/Python/Kivy/try.py | homdx/edu | a32c9f1777f80a54c3d4a3fc8389748fe27739c0 | [
"MIT"
] | 1 | 2018-09-15T21:30:43.000Z | 2018-09-15T21:30:43.000Z | from kivy.app import App
from kivy.uix.label import Label
class TestApp(App):
def build(self):
return Label(text="hi there")
TestApp().run()
| 17.222222 | 37 | 0.683871 | 24 | 155 | 4.416667 | 0.666667 | 0.150943 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.193548 | 155 | 8 | 38 | 19.375 | 0.848 | 0 | 0 | 0 | 0 | 0 | 0.051613 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0.166667 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 5 |
21a366851c6c07feb71a34eabd0c5a8380808740 | 43 | py | Python | hive/envs/atari/__init__.py | chandar-lab/RLHive | c5b1b77a3daf87aeb877e10c4f65bcd7e2bc1ff8 | [
"MIT"
] | 81 | 2021-12-14T21:02:47.000Z | 2022-03-23T08:04:41.000Z | hive/envs/atari/__init__.py | chandar-lab/RLHive | c5b1b77a3daf87aeb877e10c4f65bcd7e2bc1ff8 | [
"MIT"
] | 14 | 2021-12-15T02:05:51.000Z | 2022-03-22T23:16:36.000Z | hive/envs/atari/__init__.py | chandar-lab/RLHive | c5b1b77a3daf87aeb877e10c4f65bcd7e2bc1ff8 | [
"MIT"
] | null | null | null | from hive.envs.atari.atari import AtariEnv
| 21.5 | 42 | 0.837209 | 7 | 43 | 5.142857 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 43 | 1 | 43 | 43 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
21bf4ca9455a2d6ac1a3aa3208903ec03e777b1e | 90 | py | Python | learn_django_drf/apps/cars_cbv/admin.py | csouflis/learn | 520f888d676b33aefc869ee9183731b17255d85c | [
"MIT"
] | null | null | null | learn_django_drf/apps/cars_cbv/admin.py | csouflis/learn | 520f888d676b33aefc869ee9183731b17255d85c | [
"MIT"
] | null | null | null | learn_django_drf/apps/cars_cbv/admin.py | csouflis/learn | 520f888d676b33aefc869ee9183731b17255d85c | [
"MIT"
] | null | null | null | from django.contrib import admin
from cars_cbv.models import Car
admin.site.register(Car) | 22.5 | 32 | 0.833333 | 15 | 90 | 4.933333 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 90 | 4 | 33 | 22.5 | 0.91358 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
21d32eb08e94383dfba319b545ce0dce7cac20e9 | 1,431 | py | Python | terrascript/tfe/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/tfe/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/tfe/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/tfe/r.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class tfe_agent_pool(terrascript.Resource):
pass
class tfe_agent_token(terrascript.Resource):
pass
class tfe_notification_configuration(terrascript.Resource):
pass
class tfe_oauth_client(terrascript.Resource):
pass
class tfe_organization(terrascript.Resource):
pass
class tfe_organization_membership(terrascript.Resource):
pass
class tfe_organization_token(terrascript.Resource):
pass
class tfe_policy_set(terrascript.Resource):
pass
class tfe_policy_set_parameter(terrascript.Resource):
pass
class tfe_registry_module(terrascript.Resource):
pass
class tfe_run_trigger(terrascript.Resource):
pass
class tfe_sentinel_policy(terrascript.Resource):
pass
class tfe_ssh_key(terrascript.Resource):
pass
class tfe_team(terrascript.Resource):
pass
class tfe_team_access(terrascript.Resource):
pass
class tfe_team_member(terrascript.Resource):
pass
class tfe_team_members(terrascript.Resource):
pass
class tfe_team_organization_member(terrascript.Resource):
pass
class tfe_team_token(terrascript.Resource):
pass
class tfe_variable(terrascript.Resource):
pass
class tfe_workspace(terrascript.Resource):
pass
| 15.223404 | 79 | 0.77638 | 170 | 1,431 | 6.3 | 0.288235 | 0.156863 | 0.45098 | 0.522876 | 0.676937 | 0.474323 | 0.151261 | 0 | 0 | 0 | 0 | 0.000824 | 0.151642 | 1,431 | 93 | 80 | 15.387097 | 0.881384 | 0.047519 | 0 | 0.446809 | 1 | 0 | 0.028676 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.446809 | 0.042553 | 0 | 0.489362 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
21ee214bb6f2f5e0de25f8f68b35c04c5ec4c6a8 | 187 | py | Python | 25/02/bytearray.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | null | null | null | 25/02/bytearray.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | 46 | 2017-06-30T22:19:07.000Z | 2017-07-31T22:51:31.000Z | 25/02/bytearray.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | null | null | null | # class bytearray([source[, encoding[, errors]]])
print(bytearray()) # 引数がなければ長さ 0 の配列を生成する
print(bytearray(1)) # 引数が正数ならバイトサイズになる
print(bytearray('a', 'utf-8')) # 引数が文字列ならencodingも与えること
| 37.4 | 55 | 0.737968 | 20 | 187 | 6.9 | 0.75 | 0.304348 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017647 | 0.090909 | 187 | 4 | 56 | 46.75 | 0.794118 | 0.57754 | 0 | 0 | 0 | 0 | 0.081081 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
1d0bc05e0271df1753b23ad16ee09d45c03bab4e | 175 | py | Python | bizdays_calendar/test/context.py | raface/python-bizdays_calendar | 7f5811ae6b5e84a069c9d65e8e95c705f6992a08 | [
"Apache-2.0"
] | null | null | null | bizdays_calendar/test/context.py | raface/python-bizdays_calendar | 7f5811ae6b5e84a069c9d65e8e95c705f6992a08 | [
"Apache-2.0"
] | null | null | null | bizdays_calendar/test/context.py | raface/python-bizdays_calendar | 7f5811ae6b5e84a069c9d65e8e95c705f6992a08 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import datetime
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from bizdays_calendar import Calendar, Businessdays | 35 | 83 | 0.771429 | 26 | 175 | 5 | 0.576923 | 0.138462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006329 | 0.097143 | 175 | 5 | 84 | 35 | 0.816456 | 0 | 0 | 0 | 0 | 0 | 0.011628 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.8 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
df24ae4597a3703d458414416dc953011fbcc11d | 188 | py | Python | src/error.py | samuelsenior/ReBel | 77b14994c1fe220d7a080ede2783774056f33efa | [
"BSD-3-Clause"
] | 2 | 2020-05-14T10:27:16.000Z | 2020-05-15T12:22:38.000Z | src/error.py | samuelsenior/ReBel | 77b14994c1fe220d7a080ede2783774056f33efa | [
"BSD-3-Clause"
] | 1 | 2020-05-15T15:48:48.000Z | 2020-05-15T17:25:16.000Z | src/error.py | samuelsenior/ReBel | 77b14994c1fe220d7a080ede2783774056f33efa | [
"BSD-3-Clause"
] | 1 | 2020-05-15T12:01:06.000Z | 2020-05-15T12:01:06.000Z | import sys
class Error:
def __init__(self):
pass
def error(self, message, returnCode):
sys.stderr.write("[ERROR] {}".format(message))
sys.exit(returnCode) | 20.888889 | 54 | 0.617021 | 22 | 188 | 5.090909 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 188 | 9 | 55 | 20.888889 | 0.794326 | 0 | 0 | 0 | 0 | 0 | 0.05291 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.142857 | 0.142857 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
df29b5549a0b6d307e18b4a530b858fd94fca737 | 200 | py | Python | utils/test.py | fioushen/ParallelismPrediction | 8324c0d7d99b960db968fa3c2382c27548643c81 | [
"MIT"
] | null | null | null | utils/test.py | fioushen/ParallelismPrediction | 8324c0d7d99b960db968fa3c2382c27548643c81 | [
"MIT"
] | null | null | null | utils/test.py | fioushen/ParallelismPrediction | 8324c0d7d99b960db968fa3c2382c27548643c81 | [
"MIT"
] | 1 | 2020-07-03T10:25:42.000Z | 2020-07-03T10:25:42.000Z |
import utils.xfg_util.xfg as xfg
import data_util as du
if __name__ == '__main__':
xfg.construct_xfg("data_gen/data/handled/parallel")
xfg.construct_xfg("data_gen/data/handled/unparallel")
| 22.222222 | 57 | 0.76 | 31 | 200 | 4.451613 | 0.483871 | 0.173913 | 0.217391 | 0.275362 | 0.478261 | 0.478261 | 0.478261 | 0 | 0 | 0 | 0 | 0 | 0.125 | 200 | 8 | 58 | 25 | 0.788571 | 0 | 0 | 0 | 0 | 0 | 0.353535 | 0.313131 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
df3c66a3b829b188867dd430ac50beda894c409a | 181 | py | Python | src/backendServer/requestHandler/admin.py | JiahongHe/Personal-Facial-Identification-System | 11ed41a5afda02f46f04f539036fb1c27dc756d6 | [
"MIT"
] | null | null | null | src/backendServer/requestHandler/admin.py | JiahongHe/Personal-Facial-Identification-System | 11ed41a5afda02f46f04f539036fb1c27dc756d6 | [
"MIT"
] | null | null | null | src/backendServer/requestHandler/admin.py | JiahongHe/Personal-Facial-Identification-System | 11ed41a5afda02f46f04f539036fb1c27dc756d6 | [
"MIT"
] | 1 | 2018-11-27T16:59:30.000Z | 2018-11-27T16:59:30.000Z | from django.contrib import admin
from requestHandler.models import User, Song, SystemSetting
admin.site.register(User)
admin.site.register(Song)
admin.site.register(SystemSetting)
| 25.857143 | 59 | 0.834254 | 24 | 181 | 6.291667 | 0.5 | 0.178808 | 0.337748 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077348 | 181 | 6 | 60 | 30.166667 | 0.904192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
800c54e7c8e9f364427d9e6ffd218ee74138090d | 106 | py | Python | src/piest/file.py | ru5j4r0/piest | 4306f9ab398f00d2ed54432dbee2ef2d8e245184 | [
"Apache-2.0"
] | null | null | null | src/piest/file.py | ru5j4r0/piest | 4306f9ab398f00d2ed54432dbee2ef2d8e245184 | [
"Apache-2.0"
] | null | null | null | src/piest/file.py | ru5j4r0/piest | 4306f9ab398f00d2ed54432dbee2ef2d8e245184 | [
"Apache-2.0"
] | null | null | null | import os
import stat
def add_xu(fn: str) -> None:
os.chmod(fn, os.stat(fn).st_mode | stat.S_IXUSR)
| 15.142857 | 52 | 0.669811 | 21 | 106 | 3.238095 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179245 | 106 | 6 | 53 | 17.666667 | 0.781609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.5 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
801f188359ae31b3e83c31ac9e395470b08764c5 | 38 | py | Python | slack_cheat/__init__.py | dgnsrekt/slack-cheat.sh | e76afa173339ab1b187fdbfda45995ff49714929 | [
"MIT"
] | 1 | 2020-02-20T19:13:07.000Z | 2020-02-20T19:13:07.000Z | slack_cheat/__init__.py | dgnsrekt/slack-cheat.sh | e76afa173339ab1b187fdbfda45995ff49714929 | [
"MIT"
] | 3 | 2021-03-31T19:26:04.000Z | 2021-12-13T20:28:20.000Z | slack_cheat/__init__.py | dgnsrekt/slack-cheat.sh | e76afa173339ab1b187fdbfda45995ff49714929 | [
"MIT"
] | null | null | null | """Top-level package for slackbot."""
| 19 | 37 | 0.684211 | 5 | 38 | 5.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 38 | 1 | 38 | 38 | 0.764706 | 0.815789 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
8052caf52ec1bed330ba149a53a6b245d0c1d332 | 38 | py | Python | olmonopolet/vmp_scraper/__init__.py | joarkm/olmonopolet-api | 5fb605f53d6fc87c441ae0f72360c524cb0d3fb7 | [
"MIT"
] | 2 | 2020-11-21T13:15:53.000Z | 2021-05-18T19:17:41.000Z | olmonopolet/vmp_scraper/__init__.py | joarkm/olmonopolet-api | 5fb605f53d6fc87c441ae0f72360c524cb0d3fb7 | [
"MIT"
] | 6 | 2021-03-21T19:24:26.000Z | 2021-09-22T19:09:31.000Z | olmonopolet/vmp_scraper/__init__.py | joarkm/olmonopolet-api | 5fb605f53d6fc87c441ae0f72360c524cb0d3fb7 | [
"MIT"
] | 1 | 2021-05-20T21:52:10.000Z | 2021-05-20T21:52:10.000Z | '''Scrape data from Vinmonopolet.no''' | 38 | 38 | 0.736842 | 5 | 38 | 5.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078947 | 38 | 1 | 38 | 38 | 0.8 | 0.842105 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
339aa61b00322a58fb09d727f5a910090bf6e23d | 27 | py | Python | phenom/pn/__init__.py | LBJ-Wade/phenom | 8f0fdc14099dac09cb2eef36d825e577340a8421 | [
"MIT"
] | 1 | 2020-05-12T00:55:53.000Z | 2020-05-12T00:55:53.000Z | phenom/pn/__init__.py | LBJ-Wade/phenom | 8f0fdc14099dac09cb2eef36d825e577340a8421 | [
"MIT"
] | null | null | null | phenom/pn/__init__.py | LBJ-Wade/phenom | 8f0fdc14099dac09cb2eef36d825e577340a8421 | [
"MIT"
] | 1 | 2021-04-10T22:31:49.000Z | 2021-04-10T22:31:49.000Z | from phenom.pn.pn import *
| 13.5 | 26 | 0.740741 | 5 | 27 | 4 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 27 | 1 | 27 | 27 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
339b865934bd9e00d738d2e660d4bba6c82c24d6 | 23 | py | Python | Chapter 01/Chap01_Example1.173.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 01/Chap01_Example1.173.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 01/Chap01_Example1.173.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | print(complex(6.5,'7')) | 23 | 23 | 0.652174 | 5 | 23 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 0 | 23 | 1 | 23 | 23 | 0.521739 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
339dd1ab50f03e1aa2ef954059d104d1c16d4b62 | 195 | py | Python | test_conjugator.py | SamuelNewton/spanish-conjugator | 087703580f71eabeadfe351f00a57e1a18273168 | [
"MIT"
] | null | null | null | test_conjugator.py | SamuelNewton/spanish-conjugator | 087703580f71eabeadfe351f00a57e1a18273168 | [
"MIT"
] | null | null | null | test_conjugator.py | SamuelNewton/spanish-conjugator | 087703580f71eabeadfe351f00a57e1a18273168 | [
"MIT"
] | null | null | null | from src.spanishconjugator import Conjugator
def test_imperfect_imperitive_yo_ar():
expected = "hablaba"
assert Conjugator().conjugate('hablar','imperfect','imperitive','yo') == expected | 39 | 85 | 0.764103 | 21 | 195 | 6.904762 | 0.761905 | 0.262069 | 0.289655 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107692 | 195 | 5 | 85 | 39 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.173469 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d500ac864f0d349747b9793ca0ff6db7dea93d4f | 84 | py | Python | Lib/site-packages/registration/tests/__init__.py | pablotose/Curso-Django | 812ffc0b45cf8c26b3b052ad2e5a5ce22fa7ad7f | [
"bzip2-1.0.6"
] | 68 | 2019-05-02T06:54:59.000Z | 2022-03-08T07:54:06.000Z | registration/tests/__init__.py | arjunkr123/Final-Senior-Year-Project- | 12b65915dbd9bf5a4a2ae7e3c56c7eaedcb8646b | [
"MIT"
] | 4 | 2019-12-26T16:41:30.000Z | 2022-01-18T22:02:03.000Z | registration/tests/__init__.py | arjunkr123/Final-Senior-Year-Project- | 12b65915dbd9bf5a4a2ae7e3c56c7eaedcb8646b | [
"MIT"
] | 40 | 2019-03-08T20:21:05.000Z | 2022-03-15T03:48:46.000Z | from registration import admin, urls
def test():
assert admin
assert urls
| 12 | 36 | 0.702381 | 11 | 84 | 5.363636 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 84 | 6 | 37 | 14 | 0.936508 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0.25 | true | 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 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
1d69ab005c49cc24f241eaba0a3e6d3d436be09f | 116 | py | Python | temp/ray_test/rllib_test.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | temp/ray_test/rllib_test.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | temp/ray_test/rllib_test.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | 1 | 2021-11-23T12:30:37.000Z | 2021-11-23T12:30:37.000Z | from ray import tune
from ray.rllib.agents.ppo import PPOTrainer
tune.run(PPOTrainer, config={"env": "CartPole-v0"}) | 38.666667 | 51 | 0.775862 | 18 | 116 | 5 | 0.722222 | 0.155556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009434 | 0.086207 | 116 | 3 | 51 | 38.666667 | 0.839623 | 0 | 0 | 0 | 0 | 0 | 0.119658 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
1d6a2e4f62a6de0e1efc17054546f8463f2fceea | 35 | py | Python | Ann.py | Germiona1/Anuta | e26bdd09f60854337cc687b0824561bfdb5e0c43 | [
"CC0-1.0"
] | null | null | null | Ann.py | Germiona1/Anuta | e26bdd09f60854337cc687b0824561bfdb5e0c43 | [
"CC0-1.0"
] | null | null | null | Ann.py | Germiona1/Anuta | e26bdd09f60854337cc687b0824561bfdb5e0c43 | [
"CC0-1.0"
] | 1 | 2021-04-10T10:03:50.000Z | 2021-04-10T10:03:50.000Z | print("привет")
print("ygs boga!")
| 11.666667 | 18 | 0.657143 | 5 | 35 | 4.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085714 | 35 | 2 | 19 | 17.5 | 0.71875 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
d52a271ad1c584f6a0a58a6a2cd04583ce24f26a | 119 | py | Python | nabu/neuralnetworks/__init__.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | 18 | 2017-10-16T13:12:46.000Z | 2022-02-15T01:20:00.000Z | nabu/neuralnetworks/__init__.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | null | null | null | nabu/neuralnetworks/__init__.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | 9 | 2017-10-03T18:10:10.000Z | 2020-11-13T08:26:31.000Z | '''@package neuralnetworks
The neural network functionality
'''
from . import models, trainers, evaluators, components
| 23.8 | 54 | 0.789916 | 12 | 119 | 7.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 119 | 4 | 55 | 29.75 | 0.895238 | 0.470588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
d55a431ffdd3e277e244a5581695b9acadde5112 | 2,792 | py | Python | tests/data/test_preprocessing.py | titus-chin/rooms-for-rent-in-malaysia | 6d5b3f22b8a63e08fa445ec11b3a658abb8e607d | [
"MIT"
] | null | null | null | tests/data/test_preprocessing.py | titus-chin/rooms-for-rent-in-malaysia | 6d5b3f22b8a63e08fa445ec11b3a658abb8e607d | [
"MIT"
] | null | null | null | tests/data/test_preprocessing.py | titus-chin/rooms-for-rent-in-malaysia | 6d5b3f22b8a63e08fa445ec11b3a658abb8e607d | [
"MIT"
] | null | null | null | from src.data.preprocessing import check_urls, get_contents, get_next_page
import pytest
import requests
from collections import defaultdict
@pytest.fixture
def valid_rental_url():
url = "https://my.roomz.asia/api?c=Rooms&a=getAsyncDataForListPage&area=melaka&rentalType=3&page=1"
response = requests.get(url)
return response.json()
@pytest.fixture
def invalid_rental_url():
url = "https://my.roomz.asia/api?c=Rooms&a=getAsyncDataForListPage&area=melaka&rentalType=3&page=1000"
response = requests.get(url)
return response.json()
class TestCheckUrls:
def test_on_valid_rental_url(self, valid_rental_url):
content = valid_rental_url
assert check_urls(content) == "valid_urls"
assert isinstance(check_urls(content), str)
def test_on_invalid_rental_url(self, invalid_rental_url):
content = invalid_rental_url
assert check_urls(content) is None
class TestGetContents:
def test_on_valid_rental_url(self, valid_rental_url):
content = valid_rental_url
rental_dict = defaultdict(list)
if check_urls(content) == "valid_urls":
get_contents(
content=content,
dict=rental_dict,
country_code="my",
min_rent=200,
max_rent=1500,
)
assert [*rental_dict.keys()] == [
"Area",
"Location",
"Rent (RM/month)",
"Headline",
"Link",
]
assert len(rental_dict) >= 1
def test_on_invalid_rental_url(self, invalid_rental_url):
content = invalid_rental_url
rental_dict = defaultdict(list)
if check_urls(content) == "valid_urls":
get_contents(
content=content,
dict=rental_dict,
country_code="my",
min_rent=200,
max_rent=1500,
)
assert [*rental_dict.keys()] == []
assert len(rental_dict) == 0
class TestGetNextPage:
def test_on_page_1(self):
current_page = "https://my.roomz.asia/api?c=Rooms&a=getAsyncDataForListPage&area=melaka&rentalType=3&page=1"
next_page = "https://my.roomz.asia/api?c=Rooms&a=getAsyncDataForListPage&area=melaka&rentalType=3&page=2"
assert get_next_page(current_page) == next_page
assert isinstance(get_next_page(current_page), str)
def test_on_page_99(self):
current_page = "https://my.roomz.asia/api?c=Rooms&a=getAsyncDataForListPage&area=melaka&rentalType=3&page=99"
next_page = "https://my.roomz.asia/api?c=Rooms&a=getAsyncDataForListPage&area=melaka&rentalType=3&page=100"
assert get_next_page(current_page) == next_page
assert isinstance(get_next_page(current_page), str)
| 34.9 | 117 | 0.650788 | 347 | 2,792 | 4.982709 | 0.213256 | 0.072874 | 0.05668 | 0.055523 | 0.782533 | 0.777328 | 0.75188 | 0.70561 | 0.70561 | 0.70561 | 0 | 0.017511 | 0.243195 | 2,792 | 79 | 118 | 35.341772 | 0.800757 | 0 | 0 | 0.515152 | 0 | 0.090909 | 0.223854 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.121212 | false | 0 | 0.060606 | 0 | 0.257576 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d562fa2f2e0d35a38d0a98973823dca823e84505 | 96 | py | Python | venv/lib/python3.8/site-packages/poetry/repositories/legacy_repository.py | GiulianaPola/select_repeats | 17a0d053d4f874e42cf654dd142168c2ec8fbd11 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/poetry/repositories/legacy_repository.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/poetry/repositories/legacy_repository.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/b9/a0/ad/61b0d9fbcae963cee85f684c12ce12a9923718bd164339504f3bf8df5c | 96 | 96 | 0.895833 | 9 | 96 | 9.555556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.385417 | 0 | 96 | 1 | 96 | 96 | 0.510417 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d56ffd3dd9c267447f667566c0cca90ed0927ca5 | 47 | py | Python | foiamachine/local/lib/python2.7/encodings/iso2022_jp_2004.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | 3 | 2021-08-07T04:01:55.000Z | 2021-08-07T05:12:11.000Z | foiamachine/local/lib/python2.7/encodings/iso2022_jp_2004.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | null | null | null | foiamachine/local/lib/python2.7/encodings/iso2022_jp_2004.py | dwillis/foiamachine | 26d3b02870227696cdaab639c39d47b2a7a42ae5 | [
"Unlicense",
"MIT"
] | 1 | 2021-08-05T22:51:14.000Z | 2021-08-05T22:51:14.000Z | /usr/lib/python2.7/encodings/iso2022_jp_2004.py | 47 | 47 | 0.851064 | 9 | 47 | 4.222222 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212766 | 0 | 47 | 1 | 47 | 47 | 0.595745 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d5aee0be31bcb9250741bafb57cf89cf849a2b76 | 814 | py | Python | modules/quadkey/redshift/test/unit/test_init.py | huq-industries/carto-spatial-extension | ddd7448995932535c2e1533309f4b4141c61af4b | [
"BSD-3-Clause"
] | 68 | 2019-10-21T04:05:04.000Z | 2021-02-04T08:27:36.000Z | modules/quadkey/redshift/test/unit/test_init.py | huq-industries/carto-spatial-extension | ddd7448995932535c2e1533309f4b4141c61af4b | [
"BSD-3-Clause"
] | 165 | 2021-02-12T06:44:26.000Z | 2022-03-07T09:07:42.000Z | modules/quadkey/redshift/test/unit/test_init.py | huq-industries/carto-spatial-extension | ddd7448995932535c2e1533309f4b4141c61af4b | [
"BSD-3-Clause"
] | 25 | 2019-10-23T16:30:00.000Z | 2021-02-04T15:48:31.000Z | from lib import quadkeyLib
from lib._version import __version__
def test_init():
assert quadkeyLib.__version__ == __version__
assert hasattr(quadkeyLib, 'quadint_from_zxy')
assert hasattr(quadkeyLib, 'zxy_from_quadint')
assert hasattr(quadkeyLib, 'sibling')
assert hasattr(quadkeyLib, 'to_children')
assert hasattr(quadkeyLib, 'to_parent')
assert hasattr(quadkeyLib, 'kring')
assert hasattr(quadkeyLib, 'kring_distances')
assert hasattr(quadkeyLib, 'quadint_from_location')
assert hasattr(quadkeyLib, 'quadint_from_quadkey')
assert hasattr(quadkeyLib, 'quadkey_from_quadint')
assert hasattr(quadkeyLib, 'bbox')
assert hasattr(quadkeyLib, 'quadint_to_geojson')
assert hasattr(quadkeyLib, 'clip_number')
assert hasattr(quadkeyLib, 'geojson_to_quadints')
| 38.761905 | 55 | 0.760442 | 90 | 814 | 6.522222 | 0.277778 | 0.310051 | 0.548552 | 0.204429 | 0.289608 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144963 | 814 | 20 | 56 | 40.7 | 0.843391 | 0 | 0 | 0 | 0 | 0 | 0.235872 | 0.025799 | 0 | 0 | 0 | 0 | 0.833333 | 1 | 0.055556 | true | 0 | 0.111111 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
63548178ac713124fb65da6f2b8cbf1cabca3b90 | 39 | py | Python | examples/coordinates1.py | r0the/gpanel | 34cb31ef5abf08b139330fce6b301d920b22cea4 | [
"MIT"
] | 1 | 2021-03-22T06:31:38.000Z | 2021-03-22T06:31:38.000Z | examples/coordinates1.py | r0the/gpanel | 34cb31ef5abf08b139330fce6b301d920b22cea4 | [
"MIT"
] | 8 | 2021-03-10T09:50:04.000Z | 2021-03-22T06:33:18.000Z | examples/coordinates1.py | r0the/gpanel | 34cb31ef5abf08b139330fce6b301d920b22cea4 | [
"MIT"
] | null | null | null | from gpanel import *
line(0, 0, 1, 1)
| 9.75 | 20 | 0.615385 | 8 | 39 | 3 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 0.230769 | 39 | 3 | 21 | 13 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
636478f1a7f296f2e1c10b04a04e64cd9b83d88d | 64 | py | Python | src/StatisticalAnalysis/__init__.py | Marcel-Rodekamp/qcdanalysistools | 945c8201337ba0d52bc37267198d367bbe3e75e3 | [
"MIT"
] | null | null | null | src/StatisticalAnalysis/__init__.py | Marcel-Rodekamp/qcdanalysistools | 945c8201337ba0d52bc37267198d367bbe3e75e3 | [
"MIT"
] | null | null | null | src/StatisticalAnalysis/__init__.py | Marcel-Rodekamp/qcdanalysistools | 945c8201337ba0d52bc37267198d367bbe3e75e3 | [
"MIT"
] | null | null | null | from .dataAnalysis import *
from .analyse_numblock_dep import *
| 21.333333 | 35 | 0.8125 | 8 | 64 | 6.25 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 64 | 2 | 36 | 32 | 0.892857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
6392ca239b89bbac1a8194dc70f42ceeb27a2384 | 89 | py | Python | src/pre2/inc_digits.py | shimech/higashi | c99cb028c642be3c63a3e76de1194d114284b29b | [
"MIT"
] | 1 | 2020-06-14T20:27:09.000Z | 2020-06-14T20:27:09.000Z | src/pre2/inc_digits.py | shimech/higashi | c99cb028c642be3c63a3e76de1194d114284b29b | [
"MIT"
] | null | null | null | src/pre2/inc_digits.py | shimech/higashi | c99cb028c642be3c63a3e76de1194d114284b29b | [
"MIT"
] | null | null | null | def inc_digits(s, n):
return "".join(map(lambda x: str((int(x) + n) % 10), list(s)))
| 29.666667 | 66 | 0.561798 | 17 | 89 | 2.882353 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027397 | 0.179775 | 89 | 2 | 67 | 44.5 | 0.643836 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
639751145b238d26d54cdf6251cd780c7477fb27 | 130 | py | Python | OpenGLCffi/GLES2/EXT/EXT/tessellation_shader.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | OpenGLCffi/GLES2/EXT/EXT/tessellation_shader.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | OpenGLCffi/GLES2/EXT/EXT/tessellation_shader.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | from OpenGLCffi.GLES2 import params
@params(api='gles2', prms=['pname', 'value'])
def glPatchParameteriEXT(pname, value):
pass
| 18.571429 | 45 | 0.738462 | 16 | 130 | 6 | 0.75 | 0.208333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017241 | 0.107692 | 130 | 6 | 46 | 21.666667 | 0.810345 | 0 | 0 | 0 | 0 | 0 | 0.117188 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
63ad45e6bf3c4102fde2b5c5c79f574545a43f12 | 110 | py | Python | tests/stemma_soil_test.py | ECU-Sensing/ecu-sensing | 3b47d8169f05bde4228aac44a1f3cf82ce5451b5 | [
"MIT"
] | null | null | null | tests/stemma_soil_test.py | ECU-Sensing/ecu-sensing | 3b47d8169f05bde4228aac44a1f3cf82ce5451b5 | [
"MIT"
] | null | null | null | tests/stemma_soil_test.py | ECU-Sensing/ecu-sensing | 3b47d8169f05bde4228aac44a1f3cf82ce5451b5 | [
"MIT"
] | null | null | null | from devices import stemma_soil as stem
assert stem.get_data() != [0,0], "No data was found using the script" | 36.666667 | 69 | 0.745455 | 20 | 110 | 4 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021505 | 0.154545 | 110 | 3 | 69 | 36.666667 | 0.83871 | 0 | 0 | 0 | 0 | 0 | 0.306306 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | true | 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 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
63aff34771ef2f58b6d4985fc5f3f53ba710ceeb | 34 | py | Python | __init__.py | nusc2016/lambdata-DS15 | b98d13d2155c741bb4fdda7f0ad74cbb12be3bb1 | [
"MIT"
] | null | null | null | __init__.py | nusc2016/lambdata-DS15 | b98d13d2155c741bb4fdda7f0ad74cbb12be3bb1 | [
"MIT"
] | null | null | null | __init__.py | nusc2016/lambdata-DS15 | b98d13d2155c741bb4fdda7f0ad74cbb12be3bb1 | [
"MIT"
] | null | null | null | # This will be left blank for now. | 34 | 34 | 0.735294 | 7 | 34 | 3.571429 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.205882 | 34 | 1 | 34 | 34 | 0.925926 | 0.941176 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
63be7662a05577a16ce7e7a5d0734929fc973e63 | 55 | py | Python | mlpipeline_analyzer/__init__.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | mlpipeline_analyzer/__init__.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | mlpipeline_analyzer/__init__.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | from .visualizer.PipelineDiagram import PipelineDiagram | 55 | 55 | 0.909091 | 5 | 55 | 10 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054545 | 55 | 1 | 55 | 55 | 0.961538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
63bf9563ebf3d8bb23fafe69a743b085d3421488 | 238 | py | Python | main.py | PoutyDani/TFM-Analisis_y_visualizacion_de_datos_masivos | 99234e537287a6cd515247388ac1bd1069cea752 | [
"MIT"
] | null | null | null | main.py | PoutyDani/TFM-Analisis_y_visualizacion_de_datos_masivos | 99234e537287a6cd515247388ac1bd1069cea752 | [
"MIT"
] | null | null | null | main.py | PoutyDani/TFM-Analisis_y_visualizacion_de_datos_masivos | 99234e537287a6cd515247388ac1bd1069cea752 | [
"MIT"
] | null | null | null | from movie_titles_extractor import MovieTitlesExtractor
from subtitle_web_scraper import SubtitleWebScraper
titles_extractor = MovieTitlesExtractor()
titles_extractor.generate_csv()
SubtitleWebScraper().run(titles_extractor.read_csv())
| 29.75 | 55 | 0.878151 | 25 | 238 | 8 | 0.56 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.063025 | 238 | 7 | 56 | 34 | 0.896861 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
63c61ec4029b6619748c920c2ecd241869da7f86 | 70 | py | Python | wipe_db.py | glaserL/unsc-ne | b8fef1cee26e96349979384df0f46c23fdf6cdf0 | [
"CC0-1.0"
] | null | null | null | wipe_db.py | glaserL/unsc-ne | b8fef1cee26e96349979384df0f46c23fdf6cdf0 | [
"CC0-1.0"
] | null | null | null | wipe_db.py | glaserL/unsc-ne | b8fef1cee26e96349979384df0f46c23fdf6cdf0 | [
"CC0-1.0"
] | null | null | null | from unscne.graph import connect_graph
g = connect_graph()
g.clear()
| 14 | 38 | 0.771429 | 11 | 70 | 4.727273 | 0.636364 | 0.461538 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128571 | 70 | 4 | 39 | 17.5 | 0.852459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
893afad333be8db4563de7e54bcdf795b1e98916 | 53 | py | Python | src/mossel/__main__.py | hvbargen/mossel | 8a239b8f76d5e69508e5f72a18f1301f2ff40ee6 | [
"BSD-3-Clause"
] | null | null | null | src/mossel/__main__.py | hvbargen/mossel | 8a239b8f76d5e69508e5f72a18f1301f2ff40ee6 | [
"BSD-3-Clause"
] | null | null | null | src/mossel/__main__.py | hvbargen/mossel | 8a239b8f76d5e69508e5f72a18f1301f2ff40ee6 | [
"BSD-3-Clause"
] | null | null | null | import typer
from .main import main
typer.run(main)
| 10.6 | 22 | 0.773585 | 9 | 53 | 4.555556 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150943 | 53 | 4 | 23 | 13.25 | 0.911111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
897c4ee321075cee734af0c55affadbd0f8648d5 | 213 | py | Python | scipy2d.py | vmchale/img-fut | 2377b78c0de7222c28e7528480f396dd6c034e37 | [
"BSD-3-Clause"
] | 4 | 2020-01-29T01:07:54.000Z | 2020-02-02T00:20:57.000Z | scipy2d.py | vmchale/img-fut | 2377b78c0de7222c28e7528480f396dd6c034e37 | [
"BSD-3-Clause"
] | 1 | 2020-02-06T18:31:18.000Z | 2020-02-06T18:31:18.000Z | scipy2d.py | vmchale/img-fut | 2377b78c0de7222c28e7528480f396dd6c034e37 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T09:22:22.000Z | 2020-02-05T09:22:22.000Z | import numpy as np
import scipy.ndimage
def sobel2d(img):
dx = scipy.ndimage.sobel(img, 1)
dy = scipy.ndimage.sobel(img, 0)
mag = np.hypot(dx, dy)
# normalize
return mag * (1.0 / np.max(mag))
| 21.3 | 36 | 0.629108 | 35 | 213 | 3.828571 | 0.542857 | 0.268657 | 0.253731 | 0.298507 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030488 | 0.230047 | 213 | 9 | 37 | 23.666667 | 0.786585 | 0.042254 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
89860ec46e2613dbfce4e6f60642ca6d33ba4817 | 195 | py | Python | variance/cli/__init__.py | ExpandingDev/Variance | 3afba3638ae0557673f171c571d4acc29ee363b4 | [
"Unlicense"
] | null | null | null | variance/cli/__init__.py | ExpandingDev/Variance | 3afba3638ae0557673f171c571d4acc29ee363b4 | [
"Unlicense"
] | null | null | null | variance/cli/__init__.py | ExpandingDev/Variance | 3afba3638ae0557673f171c571d4acc29ee363b4 | [
"Unlicense"
] | null | null | null | from . import db
from . import permissions
from . import user
from . import unit
from . import equipment
from . import gym
from . import muscle
from . import exercise
from . import load_fixtures
| 19.5 | 27 | 0.769231 | 28 | 195 | 5.321429 | 0.428571 | 0.604027 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184615 | 195 | 9 | 28 | 21.666667 | 0.937107 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
9824a3b9315fadde9effcae5cf297d3751747851 | 62 | py | Python | wise_man/internal/compiler/cc.py | jaiswalpuru/discord_bots | 39d01ae1aa5016170ca61aba2d38de9fe58be572 | [
"Apache-2.0"
] | null | null | null | wise_man/internal/compiler/cc.py | jaiswalpuru/discord_bots | 39d01ae1aa5016170ca61aba2d38de9fe58be572 | [
"Apache-2.0"
] | null | null | null | wise_man/internal/compiler/cc.py | jaiswalpuru/discord_bots | 39d01ae1aa5016170ca61aba2d38de9fe58be572 | [
"Apache-2.0"
] | null | null | null | def comcc(message = ""):
return "not implemented yet..."
| 15.5 | 35 | 0.612903 | 7 | 62 | 5.428571 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209677 | 62 | 3 | 36 | 20.666667 | 0.77551 | 0 | 0 | 0 | 0 | 0 | 0.360656 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
984358df3e7ea96a756f5a8ba35043e475878196 | 161 | py | Python | pytest_factoryboy/compat.py | hugovk/pytest-factoryboy | bb6508f9540472061b9e873f4c228ef2179b91b2 | [
"MIT"
] | 266 | 2015-04-09T12:49:35.000Z | 2022-03-31T20:09:50.000Z | pytest_factoryboy/compat.py | hugovk/pytest-factoryboy | bb6508f9540472061b9e873f4c228ef2179b91b2 | [
"MIT"
] | 99 | 2015-04-15T22:27:22.000Z | 2021-12-12T18:42:43.000Z | pytest_factoryboy/compat.py | hugovk/pytest-factoryboy | bb6508f9540472061b9e873f4c228ef2179b91b2 | [
"MIT"
] | 37 | 2015-04-15T22:15:45.000Z | 2022-03-02T15:25:39.000Z | try:
from factory.declarations import PostGenerationContext
except ImportError: # factory_boy < 3.2.0
from factory.builder import PostGenerationContext
| 32.2 | 58 | 0.801242 | 18 | 161 | 7.111111 | 0.722222 | 0.171875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021898 | 0.149068 | 161 | 4 | 59 | 40.25 | 0.912409 | 0.118012 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
9851133e0f0b7333db5e25bb37edf42fa555c68b | 2,133 | py | Python | test/test_loss.py | Renovamen/tinyark | da536e8f8132ef531c5bef3feebd3178c1877fce | [
"MIT"
] | 15 | 2021-02-08T16:01:52.000Z | 2021-02-10T07:49:26.000Z | test/test_loss.py | Renovamen/tinyark | da536e8f8132ef531c5bef3feebd3178c1877fce | [
"MIT"
] | null | null | null | test/test_loss.py | Renovamen/tinyark | da536e8f8132ef531c5bef3feebd3178c1877fce | [
"MIT"
] | 2 | 2021-05-10T06:40:45.000Z | 2021-05-10T14:47:03.000Z | import os
import sys
import unittest
import numpy as np
import torch
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
import flint
class TestLoss(unittest.TestCase):
def test_mse(self):
a_init = np.random.randn(3, 5).astype(np.float32)
b_init = np.random.randn(3, 5).astype(np.float32)
def test_flint():
loss_function = flint.nn.MSELoss()
input = flint.Tensor(a_init.copy(), requires_grad=True)
target = flint.Tensor(b_init.copy())
loss = loss_function(input, target)
loss.backward()
return loss.data, input.grad
def test_torch():
loss_function = torch.nn.MSELoss()
input = torch.tensor(a_init.copy(), requires_grad=True)
target = torch.tensor(b_init.copy())
loss = loss_function(input, target)
loss.backward()
return loss.detach().numpy(), input.grad.numpy()
for x, y in zip(test_flint(), test_torch()):
np.testing.assert_allclose(x, y, atol=1e-5)
def test_bce(self):
a_init = np.random.randn(3, 5).astype(np.float32)
b_init = np.random.randn(3, 5).astype(np.float32)
def test_flint():
loss_function = flint.nn.BCELoss()
sigmoid = flint.nn.Sigmoid()
input = flint.Tensor(a_init.copy(), requires_grad=True)
target = flint.Tensor(b_init.copy())
loss = loss_function(sigmoid(input), target)
loss.backward()
return loss.data, input.grad
def test_torch():
loss_function = torch.nn.BCELoss()
sigmoid = torch.nn.Sigmoid()
input = torch.tensor(a_init.copy(), requires_grad=True)
target = torch.tensor(b_init.copy())
loss = loss_function(sigmoid(input), target)
loss.backward()
return loss.detach().numpy(), input.grad.numpy()
for x, y in zip(test_flint(), test_torch()):
np.testing.assert_allclose(x, y, atol=1e-5)
if __name__ == '__main__':
unittest.main()
| 28.824324 | 79 | 0.588842 | 274 | 2,133 | 4.408759 | 0.226277 | 0.07947 | 0.039735 | 0.056291 | 0.783113 | 0.783113 | 0.783113 | 0.783113 | 0.783113 | 0.783113 | 0 | 0.013029 | 0.280356 | 2,133 | 73 | 80 | 29.219178 | 0.773941 | 0 | 0 | 0.64 | 0 | 0 | 0.004688 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0.12 | false | 0 | 0.12 | 0 | 0.34 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
98694470b42e0918cd425509f978cefac23c73c3 | 128 | py | Python | python.py | KimShun/Git_GUI_Tutorial | c5644f0947a2ba2a4278df5e5c0f35a25f9a3300 | [
"MIT"
] | null | null | null | python.py | KimShun/Git_GUI_Tutorial | c5644f0947a2ba2a4278df5e5c0f35a25f9a3300 | [
"MIT"
] | null | null | null | python.py | KimShun/Git_GUI_Tutorial | c5644f0947a2ba2a4278df5e5c0f35a25f9a3300 | [
"MIT"
] | null | null | null | a = 1;
b = 2;
c = 5;
print("Hello from GitHub");
print("Hello from Local");
print("This is nothing!");
print("Time tto merge");
| 16 | 27 | 0.625 | 22 | 128 | 3.636364 | 0.772727 | 0.25 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028037 | 0.164063 | 128 | 7 | 28 | 18.285714 | 0.719626 | 0 | 0 | 0 | 0 | 0 | 0.492188 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.571429 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
9886d1e3fb6289db8fb3684b7afe0159064b7dc3 | 144 | py | Python | facial_feature_extractor/__init__.py | smdsbz/facial-feature-extractor | 6490110dbfb381fe6456e92700278416dbf32e1d | [
"MIT"
] | null | null | null | facial_feature_extractor/__init__.py | smdsbz/facial-feature-extractor | 6490110dbfb381fe6456e92700278416dbf32e1d | [
"MIT"
] | null | null | null | facial_feature_extractor/__init__.py | smdsbz/facial-feature-extractor | 6490110dbfb381fe6456e92700278416dbf32e1d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .face_cropper import get_face_crop_coords, get_face_crops
from .face_landmarker_72pts import get_landmarks_coords
| 28.8 | 62 | 0.8125 | 22 | 144 | 4.863636 | 0.636364 | 0.149533 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023256 | 0.104167 | 144 | 4 | 63 | 36 | 0.806202 | 0.145833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
98948aeac5e78d0e830649dc004db202476a0616 | 434 | py | Python | genrl/agents/deep/dqn/__init__.py | mehulrastogi/genrl | 589a3619497b38eaa376168c78b9f84d4ff434e5 | [
"MIT"
] | null | null | null | genrl/agents/deep/dqn/__init__.py | mehulrastogi/genrl | 589a3619497b38eaa376168c78b9f84d4ff434e5 | [
"MIT"
] | null | null | null | genrl/agents/deep/dqn/__init__.py | mehulrastogi/genrl | 589a3619497b38eaa376168c78b9f84d4ff434e5 | [
"MIT"
] | null | null | null | from genrl.agents.deep.dqn.base import DQN # noqa
from genrl.agents.deep.dqn.categorical import CategoricalDQN # noqa
from genrl.agents.deep.dqn.double import DoubleDQN # noqa
from genrl.agents.deep.dqn.dueling import DuelingDQN # noqa
from genrl.agents.deep.dqn.noisy import NoisyDQN # noqa
from genrl.agents.deep.dqn.prioritized import PrioritizedReplayDQN # noqa
from genrl.agents.deep.dqn.utils import ddqn_q_target # noqa
| 54.25 | 74 | 0.806452 | 65 | 434 | 5.353846 | 0.338462 | 0.181034 | 0.301724 | 0.382184 | 0.511494 | 0.448276 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112903 | 434 | 7 | 75 | 62 | 0.903896 | 0.078341 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
98b2d7677c3814ee3dec1bb0e2dc6faab43b67d7 | 131 | py | Python | example/soundex.py | pontakornth/pythainlp | 26ec714b7fb2a3e9081b1db6d0bcb95f742a45f3 | [
"Apache-2.0"
] | 1 | 2018-10-10T19:01:43.000Z | 2018-10-10T19:01:43.000Z | example/soundex.py | pontakornth/pythainlp | 26ec714b7fb2a3e9081b1db6d0bcb95f742a45f3 | [
"Apache-2.0"
] | null | null | null | example/soundex.py | pontakornth/pythainlp | 26ec714b7fb2a3e9081b1db6d0bcb95f742a45f3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from pythainlp.soundex import LK82,Udom83
print(LK82('รถ')==LK82('รด'))
print(Udom83('วรร')==Udom83('วัน')) | 32.75 | 41 | 0.648855 | 21 | 131 | 4.095238 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107438 | 0.076336 | 131 | 4 | 42 | 32.75 | 0.595041 | 0.160305 | 0 | 0 | 0 | 0 | 0.091743 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0.666667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 5 |
7f3aa69eb0d5245272aa4842a2bacef65fbf9b8f | 86 | py | Python | monolens/util.py | maxnoe/monolens | fa7ae5665e13d9479b503f64358fee89d5097ad8 | [
"MIT"
] | null | null | null | monolens/util.py | maxnoe/monolens | fa7ae5665e13d9479b503f64358fee89d5097ad8 | [
"MIT"
] | null | null | null | monolens/util.py | maxnoe/monolens | fa7ae5665e13d9479b503f64358fee89d5097ad8 | [
"MIT"
] | null | null | null | def clip(x, xmin, xmax):
if x < xmin:
return xmin
return min(x, xmax)
| 17.2 | 24 | 0.546512 | 14 | 86 | 3.357143 | 0.571429 | 0.212766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.337209 | 86 | 4 | 25 | 21.5 | 0.824561 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
7f49b65d46ca3384b0e4a647fa8ea1a9a760d1ab | 127 | py | Python | versionhelper/_serialization.py | erose1337/versionhelper | 15c643c6321a0427f88ad2803bd592eafa1cdb7b | [
"MIT"
] | 1 | 2019-02-25T14:14:21.000Z | 2019-02-25T14:14:21.000Z | versionhelper/_serialization.py | erose1337/versionhelper | 15c643c6321a0427f88ad2803bd592eafa1cdb7b | [
"MIT"
] | null | null | null | versionhelper/_serialization.py | erose1337/versionhelper | 15c643c6321a0427f88ad2803bd592eafa1cdb7b | [
"MIT"
] | null | null | null | import pride.functions.serializer
serialize = pride.functions.serializer.dumps
deserialize = pride.functions.serializer.loads
| 25.4 | 46 | 0.850394 | 14 | 127 | 7.714286 | 0.571429 | 0.388889 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.070866 | 127 | 4 | 47 | 31.75 | 0.915254 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
7f7574073981b131e8919da67964b24744711d6b | 177 | py | Python | dephell_specifier/__init__.py | pombredanne/dephell_specifier | f18134a8e2df6c10dd52f533f33f8d5ff4f88780 | [
"MIT"
] | 5 | 2019-09-04T05:11:23.000Z | 2021-01-04T04:27:16.000Z | dephell_specifier/__init__.py | pombredanne/dephell_specifier | f18134a8e2df6c10dd52f533f33f8d5ff4f88780 | [
"MIT"
] | 9 | 2019-05-19T04:14:59.000Z | 2021-08-04T12:41:50.000Z | dephell_specifier/__init__.py | pombredanne/dephell_specifier | f18134a8e2df6c10dd52f533f33f8d5ff4f88780 | [
"MIT"
] | 3 | 2019-07-07T03:30:56.000Z | 2021-09-28T02:44:22.000Z | from .git_specifier import GitSpecifier
from .range_specifier import RangeSpecifier
from .specifier import Specifier
__all__ = ['GitSpecifier', 'RangeSpecifier', 'Specifier']
| 25.285714 | 57 | 0.813559 | 18 | 177 | 7.666667 | 0.444444 | 0.326087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107345 | 177 | 6 | 58 | 29.5 | 0.873418 | 0 | 0 | 0 | 0 | 0 | 0.19774 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.