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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
763ce769c194b0e1d43da286968c22bf046acadb | 660 | py | Python | src/dsalgo/minimum_cost_flow.py | kagemeka/python-algorithms | dface89b8c618845cf524429aa8e97c4b2b10ceb | [
"MIT"
] | 1 | 2022-02-10T02:13:07.000Z | 2022-02-10T02:13:07.000Z | src/dsalgo/minimum_cost_flow.py | kagemeka/python-algorithms | dface89b8c618845cf524429aa8e97c4b2b10ceb | [
"MIT"
] | 6 | 2022-01-05T09:15:54.000Z | 2022-01-09T05:48:43.000Z | src/dsalgo/minimum_cost_flow.py | kagemeka/python-algorithms | dface89b8c618845cf524429aa8e97c4b2b10ceb | [
"MIT"
] | null | null | null | # // pub fn primal_dual(g: &[Vec<(usize, u64, i64)>]) -> Option<(i64, u64)> {
# // fn preprocess_graph(g: &[Vec<(usize, u64, i64)>]) -> Vec<Vec<(usize, u64, i64, usize)>> {
# // let n = g.len();
# // let mut t = vec![vec![]; n];
# // for u in 0..n {
# // for &(v, cap, cost) in g[u].iter() {
# // t[u].push((v, cap, cost, t[v].len()));
# // t[v].push((u, 0, -cost, t[u].len() - 1));
# // }
# // }
# // t
# // }
# // let g = preprocess_graph(g);
# // // bellman ford
# // // dijkstra
# // }
def mincost_flow_primal_dual() -> None:
...
| 26.4 | 98 | 0.387879 | 83 | 660 | 3.012048 | 0.409639 | 0.096 | 0.132 | 0.168 | 0.12 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044186 | 0.348485 | 660 | 24 | 99 | 27.5 | 0.537209 | 0.868182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
764ed7088837326fe57876482b1c21ab71eeb1d5 | 242 | py | Python | signup/admin.py | khoobgard/smartx | 76380819bb0e44b12cd65e6142c65a9be3d283d7 | [
"MIT"
] | null | null | null | signup/admin.py | khoobgard/smartx | 76380819bb0e44b12cd65e6142c65a9be3d283d7 | [
"MIT"
] | null | null | null | signup/admin.py | khoobgard/smartx | 76380819bb0e44b12cd65e6142c65a9be3d283d7 | [
"MIT"
] | null | null | null | from django.contrib import admin
from vehicles.models import Vehicle,Master
from signup.models import UserProfileInfo
# Register your models here.
admin.site.register(UserProfileInfo)
admin.site.register(Vehicle)
admin.site.register(Master)
| 26.888889 | 42 | 0.838843 | 32 | 242 | 6.34375 | 0.46875 | 0.133005 | 0.251232 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086777 | 242 | 8 | 43 | 30.25 | 0.918552 | 0.107438 | 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 | 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 | 4 |
7688566c7810a88fc3348c7e479494d195256a20 | 77 | py | Python | dia_1/arquivos-python/0_basics/01_hello.py | mariogen/curso_python | 767512edd07ee02f72293f539aa61b73e1dfe78d | [
"MIT"
] | null | null | null | dia_1/arquivos-python/0_basics/01_hello.py | mariogen/curso_python | 767512edd07ee02f72293f539aa61b73e1dfe78d | [
"MIT"
] | null | null | null | dia_1/arquivos-python/0_basics/01_hello.py | mariogen/curso_python | 767512edd07ee02f72293f539aa61b73e1dfe78d | [
"MIT"
] | null | null | null |
# This is a comment!
# print("won't show anything")
print('Hello World')
| 9.625 | 30 | 0.649351 | 12 | 77 | 4.166667 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.194805 | 77 | 7 | 31 | 11 | 0.806452 | 0.61039 | 0 | 0 | 0 | 0 | 0.44 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
768c4565513253342bb44044658387300d0d2772 | 98 | py | Python | z3py/examples/expr.8.py | rainoftime/rainoftime.github.io | d6316f153db0ed96309d81a5f32af9887c6f1a9a | [
"MIT"
] | 1 | 2021-08-01T07:28:03.000Z | 2021-08-01T07:28:03.000Z | z3py/examples/expr.8.py | rainoftime/rainoftime.github.io | d6316f153db0ed96309d81a5f32af9887c6f1a9a | [
"MIT"
] | null | null | null | z3py/examples/expr.8.py | rainoftime/rainoftime.github.io | d6316f153db0ed96309d81a5f32af9887c6f1a9a | [
"MIT"
] | null | null | null | x = Const('x', IntSort())
print eq(x, Int('x'))
a, b = Consts('a b', BoolSort())
print And(a, b)
| 16.333333 | 32 | 0.55102 | 19 | 98 | 2.842105 | 0.578947 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173469 | 98 | 5 | 33 | 19.6 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0.05102 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
76b807e4aad3de3646ec9d49829224481d055761 | 268 | py | Python | dialRL/utils/data_reader.py | PawelMlyniec/Dail-a-ride | 2b8954f9041b7635bcf8fa44e9129f2cd391f457 | [
"MIT"
] | 1 | 2020-12-24T22:08:52.000Z | 2020-12-24T22:08:52.000Z | dialRL/utils/data_reader.py | Thibaud-Ardoin/Dial-a-Ride | 7d9b3cd904d3194dccad31fec2533e2cf58cad0c | [
"MIT"
] | null | null | null | dialRL/utils/data_reader.py | Thibaud-Ardoin/Dial-a-Ride | 7d9b3cd904d3194dccad31fec2533e2cf58cad0c | [
"MIT"
] | null | null | null | import csv
import torch
import pandas as pd
file_name = './data/experiments/distant/re_AE13-19-54'
# statistics = pd.read_csv(file_name)
# print(statistics)
# statistics_tensor = torch.tensor(statistics.values)
#
# print(statistics_tensor)
print(statistics_tensor)
| 19.142857 | 54 | 0.783582 | 37 | 268 | 5.486486 | 0.540541 | 0.221675 | 0.206897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0.104478 | 268 | 13 | 55 | 20.615385 | 0.820833 | 0.485075 | 0 | 0 | 0 | 0 | 0.30303 | 0.30303 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 0.2 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
76cb5f4b61aa7e75521e86931b609ffbc9d1671e | 2,977 | py | Python | applications/migrations/0023_auto_20201004_1721.py | Ilmanfordinner/registration | d729f9a990d6f63dc29e14c1657dba87c3233971 | [
"MIT"
] | null | null | null | applications/migrations/0023_auto_20201004_1721.py | Ilmanfordinner/registration | d729f9a990d6f63dc29e14c1657dba87c3233971 | [
"MIT"
] | null | null | null | applications/migrations/0023_auto_20201004_1721.py | Ilmanfordinner/registration | d729f9a990d6f63dc29e14c1657dba87c3233971 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-10-04 16:21
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('applications', '0022_auto_20200521_0418'),
]
operations = [
migrations.RemoveField(
model_name='hackerapplication',
name='under_age',
),
migrations.RemoveField(
model_name='mentorapplication',
name='under_age',
),
migrations.RemoveField(
model_name='volunteerapplication',
name='under_age',
),
migrations.AddField(
model_name='hackerapplication',
name='date_of_birth',
field=models.DateField(default=datetime.date(2000, 1, 1)),
preserve_default=False,
),
migrations.AddField(
model_name='mentorapplication',
name='date_of_birth',
field=models.DateField(default=datetime.date(2000, 1, 1)),
preserve_default=False,
),
migrations.AddField(
model_name='volunteerapplication',
name='date_of_birth',
field=models.DateField(default=datetime.date(2000, 1, 1)),
preserve_default=False,
),
migrations.AlterField(
model_name='hackerapplication',
name='graduation_year',
field=models.IntegerField(choices=[(2020, '2020'), (2021, '2021'), (2022, '2022'), (2023, '2023'), (2024, '2024'), (2025, '2025'), (2026, '2026')], default=2018),
),
migrations.AlterField(
model_name='mentorapplication',
name='graduation_year',
field=models.IntegerField(choices=[(2020, '2020'), (2021, '2021'), (2022, '2022'), (2023, '2023'), (2024, '2024'), (2025, '2025'), (2026, '2026')], default=2018),
),
migrations.AlterField(
model_name='mentorapplication',
name='which_hack',
field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(0, 'Oxford Hack 2020 2016'), (1, 'Oxford Hack 2020 2017'), (2, 'Oxford Hack 2020 2018'), (3, 'Oxford Hack 2020 2019')], max_length=7, null=True),
),
migrations.AlterField(
model_name='volunteerapplication',
name='graduation_year',
field=models.IntegerField(choices=[(2020, '2020'), (2021, '2021'), (2022, '2022'), (2023, '2023'), (2024, '2024'), (2025, '2025'), (2026, '2026')], default=2018),
),
migrations.AlterField(
model_name='volunteerapplication',
name='which_hack',
field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[(0, 'Oxford Hack 2020 2016'), (1, 'Oxford Hack 2020 2017'), (2, 'Oxford Hack 2020 2018'), (3, 'Oxford Hack 2020 2019')], max_length=7, null=True),
),
]
| 40.780822 | 229 | 0.588512 | 296 | 2,977 | 5.790541 | 0.27027 | 0.05776 | 0.065344 | 0.084597 | 0.734539 | 0.734539 | 0.694282 | 0.645274 | 0.645274 | 0.645274 | 0 | 0.139662 | 0.264024 | 2,977 | 72 | 230 | 41.347222 | 0.642629 | 0.023178 | 0 | 0.846154 | 1 | 0 | 0.212392 | 0.007917 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.061538 | 0 | 0.107692 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4f106216c27212a90a72aee5bc63beadace7f117 | 199 | py | Python | pfcon/tests/test_pfurl.py | mamurak/pfcon | f3de65393ea566aaa64394164722fa7a6a2ef4a5 | [
"MIT"
] | 1 | 2020-04-24T01:48:35.000Z | 2020-04-24T01:48:35.000Z | pfcon/tests/test_pfurl.py | mamurak/pfcon | f3de65393ea566aaa64394164722fa7a6a2ef4a5 | [
"MIT"
] | 23 | 2017-06-13T19:50:46.000Z | 2021-02-06T19:32:56.000Z | pfcon/tests/test_pfurl.py | mamurak/pfcon | f3de65393ea566aaa64394164722fa7a6a2ef4a5 | [
"MIT"
] | 10 | 2017-04-25T20:17:07.000Z | 2020-09-08T21:22:32.000Z | from unittest import TestCase
from pfurl import pfurl
class TestPfurl(TestCase):
def test_pfurl_constructor(self):
#myMan = pfurl()
# didn't crash
self.assertTrue(True)
| 19.9 | 37 | 0.678392 | 24 | 199 | 5.541667 | 0.708333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.246231 | 199 | 9 | 38 | 22.111111 | 0.886667 | 0.140704 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 4 |
4f3ad139bf2236e8617853d5b5a8074648347944 | 97 | py | Python | bluebird/sim_proxy/__init__.py | rkm/bluebird | 2325ebb151724d4444c092c095a040d7365dda79 | [
"MIT"
] | 8 | 2019-01-29T15:19:39.000Z | 2020-07-16T03:55:36.000Z | bluebird/sim_proxy/__init__.py | rkm/bluebird | 2325ebb151724d4444c092c095a040d7365dda79 | [
"MIT"
] | 46 | 2019-02-08T14:23:11.000Z | 2021-04-06T13:45:10.000Z | bluebird/sim_proxy/__init__.py | rkm/bluebird | 2325ebb151724d4444c092c095a040d7365dda79 | [
"MIT"
] | 3 | 2019-05-06T14:18:07.000Z | 2021-06-17T10:39:59.000Z | """
Package contains modules which can store a proxy representation of the simulator's
state
"""
| 19.4 | 82 | 0.773196 | 14 | 97 | 5.357143 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154639 | 97 | 4 | 83 | 24.25 | 0.914634 | 0.907216 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4f42f6019a4c9261215a300abdcb0a2242fc4f24 | 24 | py | Python | novaagent/__init__.py | rackmetzler/nova-agent | 2525c074be9a0c242ef6b6e8811edc354155cd00 | [
"Apache-2.0"
] | null | null | null | novaagent/__init__.py | rackmetzler/nova-agent | 2525c074be9a0c242ef6b6e8811edc354155cd00 | [
"Apache-2.0"
] | null | null | null | novaagent/__init__.py | rackmetzler/nova-agent | 2525c074be9a0c242ef6b6e8811edc354155cd00 | [
"Apache-2.0"
] | null | null | null |
__version__ = '2.1.22'
| 8 | 22 | 0.625 | 4 | 24 | 2.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0.166667 | 24 | 2 | 23 | 12 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0.26087 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4f4d47a5bb1f13bb98c7785c75eff65b89c29184 | 4,732 | py | Python | deep-learning/activations.py | czas09/programming-practice | 80a8daced33cb45e8848a451b7770dff403a4611 | [
"MIT"
] | null | null | null | deep-learning/activations.py | czas09/programming-practice | 80a8daced33cb45e8848a451b7770dff403a4611 | [
"MIT"
] | null | null | null | deep-learning/activations.py | czas09/programming-practice | 80a8daced33cb45e8848a451b7770dff403a4611 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
import numpy as np
class ActivationBase(ABC):
def __init__(self, **kwargs):
"""Initialize the ActivationBase object"""
super().__init__()
def __call__(self, z):
"""Apply the activation function to an input"""
if z.ndim == 1:
z = z.reshape(1, -1)
return self.fn(z)
@abstractmethod
def fn(self, z):
"""Applu the activation function to an input"""
raise NotImplementedError
@abstractmethod
def grad(self, x, **kwargs):
"""Compute the gradient of the activation function wrt the input"""
raise NotImplementedError
class Sigmoid(ActivationBase):
def __init__(self):
"""A logistic sigmoid activation function"""
super().__init__()
def __str__(self):
"""Return a string representation of the activation function"""
return "Sigmoid"
def fn(self, z):
r"""
Evaluate the logistic sigmoid, :math:`\sigma`, on the elements of imput `z`
.. math::
\sigma(x_i) = \frac{1}{1 + e^{-x_i}}
"""
return 1 / (1 + np.exp(-z))
def grad(self, x):
r"""
Evaluate the first derivative of the logistic sigmoid on the elements of `x`
.. math::
\frac{\partial \sigma}{\partial x_i} = \sigma(x_i) (1 - \sigma(x_i))
"""
fn_x = self.fn(x)
return fn_x * (1 - fn_x)
def grad2(self, x):
r"""
Evaluate the second derivative of the logistic sigmoid on the elements of `x`
.. math::
\frac{\partial^2 \sigma}{\partial x_i^2} =
\frac{\partial \sigma}{\partial x_i} (1 - 2 \sigma(x_i))
"""
fn_x = self.fn(x)
return fn_x * (1 - fn_x) * (1 - 2 * fn_x)
class ReLU(ActivationBase):
"""
A rectified linear activation function
Notes
-----
"ReLU unis can be fragile during training and can "die". For example, a
large gradient flowing through a ReLU neuron could cause the weights to
update in such a way that the neuron will never activate on any datapoint
again. If this happens, then the gradient flowing through the unit will
forever be zero from that point on. That is, the ReLU units can
irreversibly die during training since they can get knocked off the data
manifold.
"""
def __init__(self):
super().__init__()
def __str__(self):
"""Return a string representation of the activation function"""
return "ReLU"
def fn(self, z):
r"""
"""
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class LeakyReLU(ActivationBase):
def __init__(self):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class Tanh(ActivationBase):
def __init__(self):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class Affine(ActivationBase):
def __init__(self, slope=1, intercept=0):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class Identity(Affine):
def __init__(self):
pass
def __str__(self):
pass
class ELU(ActivationBase):
def __init__(self):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class Exponential(ActivationBase):
def __init__(self):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class SELU(ActivationBase):
def __init__(self):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class HardSigmoid(ActivationBase):
def __init__(self):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass
class SoftPlus(ActivationBase):
def __init__(self):
pass
def __str__(self):
pass
def fn(self, z):
pass
def grad(self, x):
pass
def grad2(self, x):
pass | 19.393443 | 85 | 0.531488 | 576 | 4,732 | 4.152778 | 0.217014 | 0.102425 | 0.067726 | 0.045987 | 0.538462 | 0.51505 | 0.473662 | 0.473662 | 0.461538 | 0.461538 | 0 | 0.009349 | 0.367075 | 4,732 | 244 | 86 | 19.393443 | 0.789316 | 0.282122 | 0 | 0.779412 | 0 | 0 | 0.00346 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.411765 | false | 0.330882 | 0.014706 | 0 | 0.558824 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
4f566722e261b4641f0eeb785f2c0f6b36c17ef8 | 148 | py | Python | core/app/anotherdepdf.py | vinaynpp/patravali | d7469cbe86164640163b87966a21905bf39c9b58 | [
"MIT"
] | null | null | null | core/app/anotherdepdf.py | vinaynpp/patravali | d7469cbe86164640163b87966a21905bf39c9b58 | [
"MIT"
] | null | null | null | core/app/anotherdepdf.py | vinaynpp/patravali | d7469cbe86164640163b87966a21905bf39c9b58 | [
"MIT"
] | null | null | null | import depdf
with open("Output.html", "wb") as html_file:
html_file.write(depdf.convert_pdf_to_html(pdf_file_path="aisc.pdf").encode('utf-8'))
| 29.6 | 88 | 0.743243 | 26 | 148 | 3.961538 | 0.692308 | 0.15534 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007407 | 0.087838 | 148 | 4 | 89 | 37 | 0.755556 | 0 | 0 | 0 | 0 | 0 | 0.175676 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
4f6b2e37c74a9f726b0ecef2a295db4212b45723 | 93 | py | Python | mansystem/apps.py | kedtech/titledeed | aee085cb62a553c9ebb042fe172290cee8d6f653 | [
"BSD-3-Clause"
] | null | null | null | mansystem/apps.py | kedtech/titledeed | aee085cb62a553c9ebb042fe172290cee8d6f653 | [
"BSD-3-Clause"
] | null | null | null | mansystem/apps.py | kedtech/titledeed | aee085cb62a553c9ebb042fe172290cee8d6f653 | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class MansystemConfig(AppConfig):
name = 'mansystem'
| 15.5 | 33 | 0.763441 | 10 | 93 | 7.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16129 | 93 | 5 | 34 | 18.6 | 0.910256 | 0 | 0 | 0 | 0 | 0 | 0.096774 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
4f6fdacdb44621dfe5ce5a02eaf1bcfe462a6aa2 | 168 | py | Python | yt/analysis_modules/spectral_integrator/api.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-09-15T08:17:43.000Z | 2021-09-15T08:17:43.000Z | yt/analysis_modules/spectral_integrator/api.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | 8 | 2020-04-02T16:51:49.000Z | 2022-01-11T14:12:44.000Z | yt/analysis_modules/spectral_integrator/api.py | stonnes/yt | aad3cfa3b4ebab7838352ab467275a27c26ff363 | [
"BSD-3-Clause-Clear"
] | 2 | 2020-08-12T15:46:11.000Z | 2021-02-09T13:09:17.000Z | raise RuntimeError(
"The spectral_integrator module as been moved to yt.fields."
"'add_xray_emissivity_field' can now be imported "
"from the yt module."
)
| 28 | 64 | 0.72619 | 24 | 168 | 4.916667 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.196429 | 168 | 5 | 65 | 33.6 | 0.874074 | 0 | 0 | 0 | 0 | 0 | 0.744048 | 0.160714 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4f795fb3ff6434558835368e215bab966ee63ada | 103 | py | Python | applications/startupconfort/apps.py | guinslym/python-color-palette | 3643e4d1d7d12f9a57b130337f50ee4e072ea08f | [
"MIT"
] | null | null | null | applications/startupconfort/apps.py | guinslym/python-color-palette | 3643e4d1d7d12f9a57b130337f50ee4e072ea08f | [
"MIT"
] | null | null | null | applications/startupconfort/apps.py | guinslym/python-color-palette | 3643e4d1d7d12f9a57b130337f50ee4e072ea08f | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class StartupconfortConfig(AppConfig):
name = 'startupconfort'
| 17.166667 | 38 | 0.786408 | 10 | 103 | 8.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145631 | 103 | 5 | 39 | 20.6 | 0.920455 | 0 | 0 | 0 | 0 | 0 | 0.135922 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
96c8a0ee4e7b1cd3016a122949bc287282e9202f | 75 | py | Python | datahub/company_referral/__init__.py | alixedi/data-hub-api-cd-poc | a5e5ea45bb496c0d2a06635864514af0c7d4291a | [
"MIT"
] | null | null | null | datahub/company_referral/__init__.py | alixedi/data-hub-api-cd-poc | a5e5ea45bb496c0d2a06635864514af0c7d4291a | [
"MIT"
] | 16 | 2020-04-01T15:25:35.000Z | 2020-04-14T14:07:30.000Z | datahub/company_referral/__init__.py | alixedi/data-hub-api-cd-poc | a5e5ea45bb496c0d2a06635864514af0c7d4291a | [
"MIT"
] | null | null | null | default_app_config = 'datahub.company_referral.apps.CompanyReferralConfig'
| 37.5 | 74 | 0.88 | 8 | 75 | 7.875 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 75 | 1 | 75 | 75 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0.68 | 0.68 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
96dda0d078b8161b648029ded040e519153b1649 | 81 | py | Python | nlu/apps.py | aborsu/multichat | 9c4de49a885c414a4aaccea6ecacabdf1ccb862e | [
"MIT"
] | null | null | null | nlu/apps.py | aborsu/multichat | 9c4de49a885c414a4aaccea6ecacabdf1ccb862e | [
"MIT"
] | null | null | null | nlu/apps.py | aborsu/multichat | 9c4de49a885c414a4aaccea6ecacabdf1ccb862e | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class NluConfig(AppConfig):
name = 'nlu'
| 13.5 | 33 | 0.728395 | 10 | 81 | 5.9 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.185185 | 81 | 5 | 34 | 16.2 | 0.893939 | 0 | 0 | 0 | 0 | 0 | 0.037037 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
8c099095d6905b22f743894b5a229d10528af798 | 241 | py | Python | src/models/__init__.py | Informatik-HS-KL/BEGGEL-SP-Map-Matcher-WS19 | c3532a86640631dcafa4e88d6efb32360f0faf0f | [
"Apache-2.0"
] | 1 | 2021-07-21T13:51:18.000Z | 2021-07-21T13:51:18.000Z | src/models/__init__.py | Informatik-HS-KL/BEGGEL-SP-Map-Matcher-WS19 | c3532a86640631dcafa4e88d6efb32360f0faf0f | [
"Apache-2.0"
] | null | null | null | src/models/__init__.py | Informatik-HS-KL/BEGGEL-SP-Map-Matcher-WS19 | c3532a86640631dcafa4e88d6efb32360f0faf0f | [
"Apache-2.0"
] | null | null | null | from .link import Link
from .link_id import LinkId
from .node import NodeId, Node
from .link_user import Car, LinkUser, Cyclist, Pedestrian
from .bounding_box import BoundingBox
from .tile import Tile
from .link_distance import LinkDistance
| 30.125 | 57 | 0.821577 | 36 | 241 | 5.388889 | 0.5 | 0.164948 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13278 | 241 | 7 | 58 | 34.428571 | 0.92823 | 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 | 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 | 4 |
8c16cdde78a76b711979432de198a63b8ac7418f | 2,994 | py | Python | server/tests/conftest.py | SNH48Live/KVM48 | 35baf962c43b87fef4fca09d552e68f2ae7aa539 | [
"MIT"
] | 11 | 2018-02-18T22:44:59.000Z | 2020-02-13T01:16:47.000Z | server/tests/conftest.py | SNH48Live/KVM48 | 35baf962c43b87fef4fca09d552e68f2ae7aa539 | [
"MIT"
] | 16 | 2018-02-24T07:25:44.000Z | 2019-06-01T11:21:46.000Z | server/tests/conftest.py | SNH48Live/KVM48 | 35baf962c43b87fef4fca09d552e68f2ae7aa539 | [
"MIT"
] | null | null | null | import os
import pytest
def pytest_configure():
os.environ["TEST"] = "1"
@pytest.fixture(scope="session")
def database():
from database import PerfVOD, db, init_database
try:
init_database()
PerfVOD.create(
canon_id="324479006241787906",
l4c_club_id=1,
l4c_id=2777,
title="X队出道四周年",
subtitle="TEAM X剧场公演",
start_time=1555843500,
sd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-liuchang/324479006241787906.m3u8",
hd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-gaoqing/324479006241787906.m3u8",
fhd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-gaoqing/324479006241787906.m3u8",
)
PerfVOD.create(
canon_id="326091353251188736",
l4c_club_id=1,
l4c_id=2774,
title="莫寒咖啡店生日会",
subtitle="参加成员:莫寒",
start_time=1555836300,
sd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-liuchang/326091353251188736.m3u8",
hd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-gaoqing/326091353251188736.m3u8",
fhd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-gaoqing/326091353251188736.m3u8",
)
PerfVOD.create(
canon_id="324479006245982208",
l4c_club_id=1,
l4c_id=2772,
title="《重生计划》剧场公演",
subtitle="莫寒生日公演",
start_time=1555825500,
sd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-liuchang/324479006245982208.m3u8",
hd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-gaoqing/324479006245982208.m3u8",
fhd_stream="http://cychengyuan-vod.48.cn/snh/20190421/9999-gaoqing/324479006245982208.m3u8",
)
PerfVOD.create(
canon_id="324918581187645440",
l4c_club_id=2,
l4c_id=2775,
title="《UNIVERSE》剧场公演",
subtitle="TeamE剧场公演",
start_time=1555845900,
sd_stream="http://cychengyuan-vod.48.cn/bej/20190421/9999-liuchang/324918581187645440.m3u8",
hd_stream="http://cychengyuan-vod.48.cn/bej/20190421/9999-gaoqing/324918581187645440.m3u8",
fhd_stream="http://cychengyuan-vod.48.cn/bej/20190421/9999-gaoqing/324918581187645440.m3u8",
)
PerfVOD.create(
canon_id="324479006241787904",
l4c_club_id=3,
l4c_id=2773,
title="《Fiona.N》剧场公演",
subtitle="孙馨生日公演",
start_time=1555826400,
sd_stream="http://cychengyuan-vod.48.cn/gnz/20190421/9999-liuchang/324479006241787904.m3u8",
hd_stream="http://cychengyuan-vod.48.cn/gnz/20190421/9999-gaoqing/324479006241787904.m3u8",
fhd_stream="http://cychengyuan-vod.48.cn/gnz/20190421/9999-gaoqing/324479006241787904.m3u8",
)
yield
finally:
PerfVOD.delete().execute()
| 40.459459 | 104 | 0.622244 | 328 | 2,994 | 5.54878 | 0.237805 | 0.082418 | 0.173077 | 0.197802 | 0.625824 | 0.581868 | 0.557143 | 0.554945 | 0.545055 | 0.497802 | 0 | 0.305024 | 0.248831 | 2,994 | 73 | 105 | 41.013699 | 0.504224 | 0 | 0 | 0.119403 | 0 | 0.223881 | 0.45658 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.029851 | true | 0 | 0.044776 | 0 | 0.074627 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8c19d9fec3877c09401e5c6f805739789791222c | 755 | py | Python | planet-gen/Util.py | BandW2011/personal-twitter-bot | 3cf3d48af01eef6e87804272770f26110f9fd42c | [
"MIT"
] | 1 | 2019-07-13T02:09:25.000Z | 2019-07-13T02:09:25.000Z | planet-gen/Util.py | BandW2011/personal-twitter-bot | 3cf3d48af01eef6e87804272770f26110f9fd42c | [
"MIT"
] | null | null | null | planet-gen/Util.py | BandW2011/personal-twitter-bot | 3cf3d48af01eef6e87804272770f26110f9fd42c | [
"MIT"
] | null | null | null | """
Holds general purpose math functions
"""
import random
def r_int(inc_begin, inc_end):
return random.randint(inc_begin, inc_end)
def r_flo(inc_begin, inc_end):
return random.uniform(inc_begin, inc_end)
def r_bool():
return bool(random.getrandbits(1))
def r_tri(inc_begin, inc_end, median):
return random.triangular(inc_begin, inc_end, median)
def r_choice(sequence):
return random.choice(sequence)
def r_wchoice(sequence, weights):
return random.choices(sequence, weights, k=1)[0]
def seedGen(new_seed):
random.seed(new_seed)
def color_distance(color_a, color_b):
R = (color_b[0] - color_a[0]) * 2
G = (color_b[1] - color_a[1]) * 2
B = (color_b[2] - color_a[2]) * 2
return ((R + G + B) ** 0.5).real
| 22.878788 | 56 | 0.686093 | 126 | 755 | 3.880952 | 0.325397 | 0.04908 | 0.134969 | 0.171779 | 0.261759 | 0.179959 | 0 | 0 | 0 | 0 | 0 | 0.022472 | 0.174834 | 755 | 32 | 57 | 23.59375 | 0.76244 | 0.047682 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.05 | 0.3 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
8c1ffb5966c6b8e6cad6eddcd0a63f1043a22665 | 109 | py | Python | test.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | test.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | test.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | import random
for _ in range(random.randint(10 ** 5, 10 ** 5 * 2)):
print(random.randint(0, 9), end='')
| 21.8 | 53 | 0.605505 | 18 | 109 | 3.611111 | 0.722222 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.102273 | 0.192661 | 109 | 4 | 54 | 27.25 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
8c4b15d5db50cd0ef92405a72a2f72ba0d5808f3 | 133 | py | Python | pada/templates/project_template/{{cookiecutter.project_slug}}/url.py | eleveyuan/kada | 45811783170193b8949b58eb63f5a9f243f2d880 | [
"MIT"
] | 4 | 2022-03-01T12:27:41.000Z | 2022-03-02T11:23:43.000Z | pada/templates/project_template/{{cookiecutter.project_slug}}/url.py | eleveyuan/kada | 45811783170193b8949b58eb63f5a9f243f2d880 | [
"MIT"
] | 2 | 2022-02-27T09:08:30.000Z | 2022-03-01T12:33:30.000Z | pada/templates/project_template/{{cookiecutter.project_slug}}/url.py | eleveyuan/kada | 45811783170193b8949b58eb63f5a9f243f2d880 | [
"MIT"
] | 1 | 2022-03-01T12:32:47.000Z | 2022-03-01T12:32:47.000Z | from pada.assemble.locates import url
from definition import feature_definition
urls_pattern = [
url(feature_definition, '*')
] | 19 | 41 | 0.774436 | 16 | 133 | 6.25 | 0.625 | 0.34 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 133 | 7 | 42 | 19 | 0.877193 | 0 | 0 | 0 | 0 | 0 | 0.007463 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
4fe7190c1ebe37f7db849a60b8e27d68d3c6d20e | 99 | py | Python | util/chunk.py | DeflatedPickle/timezone-chan | 133c1a6c9466d2fdecbb78ea021d479b98e65b1a | [
"MIT"
] | 1 | 2022-03-01T22:40:55.000Z | 2022-03-01T22:40:55.000Z | util/chunk.py | DeflatedPickle/timezone-chan | 133c1a6c9466d2fdecbb78ea021d479b98e65b1a | [
"MIT"
] | null | null | null | util/chunk.py | DeflatedPickle/timezone-chan | 133c1a6c9466d2fdecbb78ea021d479b98e65b1a | [
"MIT"
] | null | null | null | def chunk(li: list, length: int):
return [li[x:x + length] for x in range(0, len(li), length)]
| 33 | 64 | 0.626263 | 19 | 99 | 3.263158 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0125 | 0.191919 | 99 | 2 | 65 | 49.5 | 0.7625 | 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 | 0 | 0 | 0 | 4 |
8c7555c6aaf491a6c7e4b76b74dfe558f67d739b | 96 | py | Python | folder_structure.py | vanandjiwala/random_utils | 17a187d656db36adf2486ac34625b1b94a2372c5 | [
"MIT"
] | null | null | null | folder_structure.py | vanandjiwala/random_utils | 17a187d656db36adf2486ac34625b1b94a2372c5 | [
"MIT"
] | null | null | null | folder_structure.py | vanandjiwala/random_utils | 17a187d656db36adf2486ac34625b1b94a2372c5 | [
"MIT"
] | null | null | null | from Utils.pathUtils import PathUtils
if __name__ == '__main__':
PathUtils.create_day_dir() | 24 | 37 | 0.770833 | 12 | 96 | 5.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135417 | 96 | 4 | 38 | 24 | 0.771084 | 0 | 0 | 0 | 0 | 0 | 0.082474 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
8c920cc6e5b810a7eedcae4b6a59b056ccb7444c | 198 | py | Python | code_all/day03/demo08.py | testcg/python | 4db4bd5d0e44af807d2df80cf8c8980b40cc03c4 | [
"MIT"
] | null | null | null | code_all/day03/demo08.py | testcg/python | 4db4bd5d0e44af807d2df80cf8c8980b40cc03c4 | [
"MIT"
] | null | null | null | code_all/day03/demo08.py | testcg/python | 4db4bd5d0e44af807d2df80cf8c8980b40cc03c4 | [
"MIT"
] | null | null | null | """
条件表达式
变量 = 满足条件的值 if 条件 else 不满足条件的值
"""
# 根据一个条件,为变量赋值
# if input("请输入性别:") == "男":
# value = 1
# else:
# value = 0
value = 1 if input("请输入性别:") == "男" else 0
print(value)
| 15.230769 | 42 | 0.515152 | 28 | 198 | 3.642857 | 0.571429 | 0.137255 | 0.235294 | 0.254902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028571 | 0.292929 | 198 | 12 | 43 | 16.5 | 0.7 | 0.580808 | 0 | 0 | 0 | 0 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
8ca9fea07e5792e053505ca5682c1b15d7a14958 | 79 | py | Python | web/ca/apps.py | pimlie/thevpn.co.uk | f2074e4bb0e1838519fa6c9f1b8695eb3a1437b2 | [
"MIT"
] | 19 | 2016-11-16T05:49:17.000Z | 2022-01-19T03:50:17.000Z | web/ca/apps.py | pimlie/thevpn.co.uk | f2074e4bb0e1838519fa6c9f1b8695eb3a1437b2 | [
"MIT"
] | 6 | 2020-06-05T23:05:14.000Z | 2022-02-10T10:42:31.000Z | web/ca/apps.py | pimlie/thevpn.co.uk | f2074e4bb0e1838519fa6c9f1b8695eb3a1437b2 | [
"MIT"
] | 8 | 2016-08-30T13:48:07.000Z | 2022-01-19T03:55:26.000Z | from django.apps import AppConfig
class CaConfig(AppConfig):
name = 'ca'
| 13.166667 | 33 | 0.721519 | 10 | 79 | 5.7 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189873 | 79 | 5 | 34 | 15.8 | 0.890625 | 0 | 0 | 0 | 0 | 0 | 0.025316 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
8ce731fae90142afeb29b71aa2a480675f675acb | 124 | py | Python | exercicio3.py | shyga362/projetoPython | 1efad8c234b3e728cb23cb02fc11c8e1b7887a25 | [
"MIT"
] | 2 | 2022-01-06T23:31:00.000Z | 2022-01-06T23:35:49.000Z | exercicio3.py | shyga362/projetoPython | 1efad8c234b3e728cb23cb02fc11c8e1b7887a25 | [
"MIT"
] | null | null | null | exercicio3.py | shyga362/projetoPython | 1efad8c234b3e728cb23cb02fc11c8e1b7887a25 | [
"MIT"
] | null | null | null | n1 = int(input('digite um numero'))
n2 = int(input('digite outro numero'))
r = n1 + n2
print('o resultado é {}'.format(r)) | 20.666667 | 38 | 0.637097 | 21 | 124 | 3.761905 | 0.666667 | 0.202532 | 0.35443 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 0.16129 | 124 | 6 | 39 | 20.666667 | 0.721154 | 0 | 0 | 0 | 0 | 0 | 0.408 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 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 | 0 | 0 | 4 |
8cf4108e9ccfb45465690dca312ce1ee2aa942e7 | 241 | py | Python | mugoyawatch/admin.py | trevor-ngugi/mugoya-watch | 6604016172600b7867587246ef1b2ae3c7c12336 | [
"Unlicense"
] | null | null | null | mugoyawatch/admin.py | trevor-ngugi/mugoya-watch | 6604016172600b7867587246ef1b2ae3c7c12336 | [
"Unlicense"
] | 6 | 2020-06-06T00:47:33.000Z | 2022-03-12T00:17:11.000Z | mugoyawatch/admin.py | trevor-ngugi/mugoya-watch | 6604016172600b7867587246ef1b2ae3c7c12336 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Profile,Neighbourhood,Posts,Business
# Register your models here.
admin.site.register(Profile)
admin.site.register(Neighbourhood)
admin.site.register(Posts)
admin.site.register(Business)
| 26.777778 | 56 | 0.829876 | 32 | 241 | 6.25 | 0.4375 | 0.18 | 0.34 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074689 | 241 | 8 | 57 | 30.125 | 0.896861 | 0.107884 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 4 |
5065c1fb558ca083a83bb0129d8e67cf512897ee | 142 | py | Python | server/app/routes/diagnostics.py | hunterparks/recipe-collector-back-end | b3784d91b9c0a61c1c0dbc34e5551e5e725e2f12 | [
"0BSD"
] | null | null | null | server/app/routes/diagnostics.py | hunterparks/recipe-collector-back-end | b3784d91b9c0a61c1c0dbc34e5551e5e725e2f12 | [
"0BSD"
] | null | null | null | server/app/routes/diagnostics.py | hunterparks/recipe-collector-back-end | b3784d91b9c0a61c1c0dbc34e5551e5e725e2f12 | [
"0BSD"
] | null | null | null | from flask_restful import Resource
class Info(Resource):
def get(self):
return {
'version': '1.0.0'
}
| 17.75 | 35 | 0.521127 | 16 | 142 | 4.5625 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033708 | 0.373239 | 142 | 7 | 36 | 20.285714 | 0.786517 | 0 | 0 | 0 | 0 | 0 | 0.088889 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0.166667 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
506f794951705843bef4dd7540490959b0224940 | 75 | py | Python | Lib/lib2to3/tests/data/fixers/no_fixer_cls.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 52,316 | 2015-01-01T15:56:25.000Z | 2022-03-31T23:19:01.000Z | Lib/lib2to3/tests/data/fixers/no_fixer_cls.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 25,286 | 2015-03-03T23:18:02.000Z | 2022-03-31T23:17:27.000Z | Lib/lib2to3/tests/data/fixers/no_fixer_cls.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 31,623 | 2015-01-01T13:29:37.000Z | 2022-03-31T19:55:06.000Z | # This is empty so trying to fetch the fixer class gives an AttributeError
| 37.5 | 74 | 0.8 | 13 | 75 | 4.615385 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.186667 | 75 | 1 | 75 | 75 | 0.983607 | 0.96 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
507019d50f79f25c87597d69c2a2753fd21f72a4 | 1,031 | py | Python | bluebottle/deeds/migrations/0006_auto_20210222_1643.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/deeds/migrations/0006_auto_20210222_1643.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/deeds/migrations/0006_auto_20210222_1643.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-02-22 15:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('deeds', '0005_auto_20210222_1101'),
]
operations = [
migrations.AlterModelOptions(
name='deedparticipant',
options={'permissions': (('api_read_deedparticipant', 'Can view deed through the API'), ('api_add_deedparticipant', 'Can add deed through the API'), ('api_change_deedparticipant', 'Can change deed through the API'), ('api_delete_deedparticipant', 'Can delete deed through the API'), ('api_read_own_deedparticipant', 'Can view own deed through the API'), ('api_add_own_deedparticipant', 'Can add own deed through the API'), ('api_change_own_deedparticipant', 'Can change own deed through the API'), ('api_delete_own_deedparticipant', 'Can delete own deed through the API')), 'verbose_name': 'Participant', 'verbose_name_plural': 'Participants'},
),
]
| 51.55 | 656 | 0.7129 | 129 | 1,031 | 5.457364 | 0.395349 | 0.204545 | 0.159091 | 0.193182 | 0.28267 | 0.225852 | 0 | 0 | 0 | 0 | 0 | 0.039489 | 0.164888 | 1,031 | 19 | 657 | 54.263158 | 0.778165 | 0.066925 | 0 | 0 | 1 | 0 | 0.600626 | 0.247132 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.416667 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
50904e56160286b28c8a91dcd4e7cb5048d44682 | 186 | py | Python | tasks/serializers.py | Hernandes-Silva/To-do-list-API | fff8e4c3a795285f659d63363d1d0c66f018b357 | [
"MIT"
] | null | null | null | tasks/serializers.py | Hernandes-Silva/To-do-list-API | fff8e4c3a795285f659d63363d1d0c66f018b357 | [
"MIT"
] | null | null | null | tasks/serializers.py | Hernandes-Silva/To-do-list-API | fff8e4c3a795285f659d63363d1d0c66f018b357 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Task
class TaskSerializer(serializers.ModelSerializer):
class Meta:
model = Task
exclude = ('slug','user') | 26.571429 | 50 | 0.715054 | 20 | 186 | 6.6 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204301 | 186 | 7 | 51 | 26.571429 | 0.891892 | 0 | 0 | 0 | 0 | 0 | 0.042781 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
50977727beb61bf4e4095826572675d65c6ad1b0 | 279 | py | Python | py_pdf_term/candidates/_candidates/filters/term/propernoun/english.py | kumachan-mis/py-pdf-term | 282505826ce8c626003e753068d15738d772ce46 | [
"MIT"
] | null | null | null | py_pdf_term/candidates/_candidates/filters/term/propernoun/english.py | kumachan-mis/py-pdf-term | 282505826ce8c626003e753068d15738d772ce46 | [
"MIT"
] | 1 | 2021-08-02T13:02:12.000Z | 2021-08-02T13:02:12.000Z | py_pdf_term/candidates/_candidates/filters/term/propernoun/english.py | kumachan-mis/py-pdf-term | 282505826ce8c626003e753068d15738d772ce46 | [
"MIT"
] | null | null | null | from py_pdf_term._common.data import Term
from ..base import BaseEnglishCandidateTermFilter
class EnglishProperNounFilter(BaseEnglishCandidateTermFilter):
def __init__(self) -> None:
pass
def is_candidate(self, scoped_term: Term) -> bool:
return True
| 23.25 | 62 | 0.749104 | 30 | 279 | 6.666667 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.182796 | 279 | 11 | 63 | 25.363636 | 0.877193 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.142857 | 0.285714 | 0.142857 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 4 |
50c2f9e15422ffe26979554f870397176a520843 | 2,085 | py | Python | forest/visitor/node_counter.py | Marghrid/Forest | 2f1730fd7cb1e3579fcce222c67b91c5bb1aa5f4 | [
"Apache-2.0"
] | 7 | 2020-06-24T12:14:40.000Z | 2022-01-19T17:01:02.000Z | forest/visitor/node_counter.py | Marghrid/Forest | 2f1730fd7cb1e3579fcce222c67b91c5bb1aa5f4 | [
"Apache-2.0"
] | null | null | null | forest/visitor/node_counter.py | Marghrid/Forest | 2f1730fd7cb1e3579fcce222c67b91c5bb1aa5f4 | [
"Apache-2.0"
] | null | null | null | from forest.dsl import Node
from .post_order import PostOrderInterpreter
class NodeCounter(PostOrderInterpreter):
# */+/? concat |
# {"kleene":3, "copies":3, "posit":3, "option":3, "concat":2, "union":1}
def __init__(self):
super().__init__()
def eval_Input(self, v):
return 0
def eval_Number(self, v):
return 0
def eval_Bool(self, v):
return 0
def eval_Value(self, v):
return 0
def eval_RegexLit(self, v):
return 0
def eval_RangeLit(self, v):
return 1
def eval_conj(self, node: Node, args) -> str:
"""Bool -> Bool, Bool;"""
return 1 + sum(args)
def eval_number(self, node, args) -> str:
"""Number -> Input;"""
return 1 + sum(args)
def eval_is_int(self, node, args) -> str:
'''Bool -> Input;'''
return 1 + sum(args)
def eval_is_real(self, node, args) -> str:
'''Bool -> Input;'''
return 1 + sum(args)
def eval_is_string(self, node, args) -> str:
'''Bool -> Input;'''
return 1 + sum(args)
def eval_string(self, node, args) -> str:
'''String -> Input;'''
return 1 + sum(args)
def eval_len(self, node, args) -> str:
'''Number -> String;'''
return 1 + sum(args)
def eval_le(self, node, args) -> str:
''''Bool -> Number, Number;'''
return 1 + sum(args)
def eval_ge(self, node, args) -> str:
'''Bool -> Number, Number;'''
return args[0] + " >= " + args[1]
def eval_re(self, node, args):
return 1 + sum(args)
def eval_kleene(self, node: Node, args):
return 1 + sum(args)
def eval_option(self, node, args):
return 1 + sum(args)
def eval_posit(self, node, args):
return 1 + sum(args)
def eval_range(self, node, args):
return 1 + sum(args)
def eval_concat(self, node, args):
return 1 + sum(args)
def eval_union(self, node, args):
return 1 + sum(args)
def eval_match(self, node, args):
return sum(args)
| 23.693182 | 76 | 0.543405 | 278 | 2,085 | 3.94964 | 0.169065 | 0.14663 | 0.136612 | 0.191257 | 0.651184 | 0.588342 | 0.449909 | 0.42623 | 0.306922 | 0.126594 | 0 | 0.02 | 0.304556 | 2,085 | 87 | 77 | 23.965517 | 0.737241 | 0.120863 | 0 | 0.392157 | 0 | 0 | 0.00224 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.470588 | false | 0 | 0.039216 | 0.27451 | 0.980392 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
50d73f9dd281d5109f300e2544bd9e2a9b2ad260 | 164 | py | Python | gammapy/_fermipy/__init__.py | grburgess/gammapy | 609e460698caca7223afeef5e71826c7b32728d1 | [
"BSD-3-Clause"
] | 3 | 2019-01-28T12:21:14.000Z | 2019-02-10T19:58:07.000Z | gammapy/_fermipy/__init__.py | grburgess/gammapy | 609e460698caca7223afeef5e71826c7b32728d1 | [
"BSD-3-Clause"
] | null | null | null | gammapy/_fermipy/__init__.py | grburgess/gammapy | 609e460698caca7223afeef5e71826c7b32728d1 | [
"BSD-3-Clause"
] | null | null | null | """
This is a temporary folder, used to migrate code from Fermipy to Gammapy.
Do not import or use code from here!
Fermipy: https://github.com/fermiPy/fermipy
""" | 23.428571 | 73 | 0.743902 | 27 | 164 | 4.518519 | 0.777778 | 0.131148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158537 | 164 | 7 | 74 | 23.428571 | 0.884058 | 0.95122 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
dd0008f9f8743430c94e7345089b6db4ccb344d8 | 4,625 | py | Python | test/features/tasks_test.py | ayonymus/gits | 1d7fc8741a69e731d3bee56e155132ff3d3490e5 | [
"MIT"
] | 4 | 2019-07-15T19:36:14.000Z | 2022-03-09T18:30:46.000Z | test/features/tasks_test.py | ayonymus/gits | 1d7fc8741a69e731d3bee56e155132ff3d3490e5 | [
"MIT"
] | null | null | null | test/features/tasks_test.py | ayonymus/gits | 1d7fc8741a69e731d3bee56e155132ff3d3490e5 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import Mock
from features.taskhandler import TaskHandler
BRANCH = "barbie"
BRANCH2 = "barbie2"
TASK1 = "go go go"
TASK2 = "go go go2"
TASK3 = "go go go3"
class TestTasksMethods(unittest.TestCase):
def setUp(self):
self.storage = Mock()
self.tasks = TaskHandler(storage=self.storage)
def test_store_first_task(self):
self.storage.load_all_tasks.return_value = dict()
self.tasks.assign_task(BRANCH, TASK1)
self.storage.store_tasks.assert_called_with({BRANCH: [TASK1]})
def test_store_more_task(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1]}
self.tasks.assign_task(BRANCH, TASK2)
self.storage.store_tasks.assert_called_with({BRANCH: [TASK1, TASK2]})
def test_get_all_tasks_return_all_tasks(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
result = self.tasks.get_all_tasks()
self.assertEqual({BRANCH: [TASK1, TASK2]}, result)
def test_get_tasks_return_all_branch_tasks(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
result = self.tasks.get_tasks(BRANCH)
self.assertEqual([TASK1, TASK2], result)
def test_get_tasks_returns_empty_list(self):
self.storage.load_all_tasks.return_value = dict()
result = self.tasks.get_tasks(BRANCH)
self.assertEqual([], result)
def test_remove_task_should_return_true(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
result = self.tasks.remove_task(BRANCH, 0)
self.storage.store_tasks.assert_called_with({BRANCH: [TASK2]})
self.assertTrue(result)
def test_remove_task_should_return_false_when_wrong_index(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
result = self.tasks.remove_task(BRANCH, 20)
self.storage.store_tasks.assert_not_called()
self.assertFalse(result)
def test_remove_task_should_return_false_when_wrong_branch(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
result = self.tasks.remove_task(BRANCH2, 0)
self.storage.store_tasks.assert_not_called()
self.assertFalse(result)
def test_get_done_tasks_returns_empty_list(self):
self.storage.load_all_done_tasks.return_value = dict()
result = self.tasks.get_done_tasks(BRANCH)
self.assertEqual([], result)
def test_get_done_tasks_return_all_branch_tasks(self):
self.storage.load_all_done_tasks.return_value = {BRANCH: [TASK1, TASK2]}
result = self.tasks.get_done_tasks(BRANCH)
self.assertEqual([TASK1, TASK2], result)
def test_set_task_done_should_return_false_when_wrong_index(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
self.storage.load_all_done_tasks.return_value = {}
result = self.tasks.set_task_done(BRANCH, 10)
self.assertFalse(result)
self.storage.store_tasks.assert_not_called()
self.storage.store_done_tasks.assert_not_called()
def test_set_task_done_should_return_true_when_index_exists(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
self.storage.load_all_done_tasks.return_value = {}
result = self.tasks.set_task_done(BRANCH, 1)
self.assertTrue(result)
#self.storage.store_tasks.assert_called_with({BRANCH: [TASK1]})
self.storage.store_done_tasks.assert_called_with({BRANCH: [TASK2]})
def test_remove_done_tasks(self):
self.storage.load_all_done_tasks.return_value = {BRANCH: [TASK1, TASK2]}
self.tasks.remove_done_tasks(BRANCH)
self.storage.store_done_tasks.assert_called_with({})
def test_move_task_should_return_false_when_wrong_index(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2]}
result = self.tasks.move_task(BRANCH, 10, 0)
self.assertFalse(result)
self.storage.store_tasks.assert_not_called()
result = self.tasks.move_task(BRANCH, 0, 10)
self.assertFalse(result)
self.storage.store_tasks.assert_not_called()
def test_move_task_should_return_true_when_right_index(self):
self.storage.load_all_tasks.return_value = {BRANCH: [TASK1, TASK2, TASK3]}
result = self.tasks.move_task(BRANCH, 2, 0)
self.storage.store_tasks.assert_called_with({BRANCH: [TASK3, TASK1, TASK2]})
self.assertTrue(result)
if __name__ == '__main__':
unittest.main()
| 32.342657 | 84 | 0.708541 | 617 | 4,625 | 4.951378 | 0.10859 | 0.115221 | 0.08347 | 0.100164 | 0.825859 | 0.807856 | 0.747954 | 0.70802 | 0.664157 | 0.481506 | 0 | 0.016999 | 0.185946 | 4,625 | 142 | 85 | 32.570423 | 0.794422 | 0.013405 | 0 | 0.402299 | 0 | 0 | 0.010303 | 0 | 0 | 0 | 0 | 0 | 0.287356 | 1 | 0.183908 | false | 0 | 0.034483 | 0 | 0.229885 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0f9d3d17b9144302f5bf189fe21503f776a20d76 | 155 | py | Python | src/controllers/__init__.py | ewanlee/pymarl | ecfae3160f63f9fe4b1161830de7adfeb811d7df | [
"Apache-2.0"
] | null | null | null | src/controllers/__init__.py | ewanlee/pymarl | ecfae3160f63f9fe4b1161830de7adfeb811d7df | [
"Apache-2.0"
] | null | null | null | src/controllers/__init__.py | ewanlee/pymarl | ecfae3160f63f9fe4b1161830de7adfeb811d7df | [
"Apache-2.0"
] | null | null | null | REGISTRY = {}
from .basic_controller import BasicMAC
from .maac_controller import MAACMAC
REGISTRY["basic_mac"] = BasicMAC
REGISTRY["maac_mac"] = MAACMAC | 22.142857 | 38 | 0.787097 | 19 | 155 | 6.210526 | 0.473684 | 0.271186 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116129 | 155 | 7 | 39 | 22.142857 | 0.861314 | 0 | 0 | 0 | 0 | 0 | 0.108974 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
0fc80f4862f237b1c0b084b8c6bd01468858bbac | 137 | py | Python | src/api/content_repo/main.py | praekeltfoundation/rdw-ingestion-tools | 80fe14b82abd6e04721116bddc87b22b43ef1732 | [
"MIT"
] | null | null | null | src/api/content_repo/main.py | praekeltfoundation/rdw-ingestion-tools | 80fe14b82abd6e04721116bddc87b22b43ef1732 | [
"MIT"
] | null | null | null | src/api/content_repo/main.py | praekeltfoundation/rdw-ingestion-tools | 80fe14b82abd6e04721116bddc87b22b43ef1732 | [
"MIT"
] | null | null | null | from api.content_repo.requests.page_views import PageViews
from . import session
class pyContent:
pageviews = PageViews(session)
| 15.222222 | 58 | 0.788321 | 17 | 137 | 6.235294 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153285 | 137 | 8 | 59 | 17.125 | 0.913793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
0fda08b01e171418d49d0752331361b7b99a3631 | 210 | py | Python | MyGPyOpt/core/task/__init__.py | Paul1298/GPyOpt | d26bd4fb57a0b83a5cdaa0e7e97aa3692eb31187 | [
"BSD-3-Clause"
] | null | null | null | MyGPyOpt/core/task/__init__.py | Paul1298/GPyOpt | d26bd4fb57a0b83a5cdaa0e7e97aa3692eb31187 | [
"BSD-3-Clause"
] | null | null | null | MyGPyOpt/core/task/__init__.py | Paul1298/GPyOpt | d26bd4fb57a0b83a5cdaa0e7e97aa3692eb31187 | [
"BSD-3-Clause"
] | 1 | 2021-03-22T17:21:15.000Z | 2021-03-22T17:21:15.000Z | # Copyright (c) 2016, the MyGPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .objective import SingleObjective
from . import space
from . import cost
from .cost import CostModel
| 26.25 | 59 | 0.780952 | 30 | 210 | 5.466667 | 0.7 | 0.121951 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028249 | 0.157143 | 210 | 7 | 60 | 30 | 0.898305 | 0.466667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
e83dec2612b16c6c6b296e9c8ce56de9d081d553 | 141 | py | Python | private/compile.py | sloe/metrics | c86f3b6baee1405e8044d03da9a2af1552566e53 | [
"Apache-2.0"
] | 1 | 2017-07-25T19:20:07.000Z | 2017-07-25T19:20:07.000Z | private/compile.py | sloe/metric | c86f3b6baee1405e8044d03da9a2af1552566e53 | [
"Apache-2.0"
] | null | null | null | private/compile.py | sloe/metric | c86f3b6baee1405e8044d03da9a2af1552566e53 | [
"Apache-2.0"
] | null | null | null |
from pprint import pprint
import gluon.admin
result = gluon.admin.app_compile(request.application, request)
if result:
pprint(result)
| 15.666667 | 62 | 0.780142 | 19 | 141 | 5.736842 | 0.578947 | 0.220183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141844 | 141 | 8 | 63 | 17.625 | 0.900826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.4 | 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 | 0 | 0 | 4 |
e84758e5f4937ed73111a57687020eb3d724055f | 2,669 | py | Python | nncf/tensorflow/algorithm_selector.py | sarthakpati/nncf | 29ad62c664c1dd53b3c8c50fc001a1b36bd1e8ac | [
"Apache-2.0"
] | 310 | 2020-10-29T09:22:42.000Z | 2022-03-31T04:53:34.000Z | nncf/tensorflow/algorithm_selector.py | sarthakpati/nncf | 29ad62c664c1dd53b3c8c50fc001a1b36bd1e8ac | [
"Apache-2.0"
] | 615 | 2020-10-28T10:22:25.000Z | 2022-03-29T18:09:23.000Z | nncf/tensorflow/algorithm_selector.py | sarthakpati/nncf | 29ad62c664c1dd53b3c8c50fc001a1b36bd1e8ac | [
"Apache-2.0"
] | 86 | 2020-10-28T11:34:34.000Z | 2022-03-31T08:00:35.000Z | """
Copyright (c) 2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from typing import Dict
from typing import Type
import tensorflow as tf
from nncf.api.compression import CompressionAlgorithmController
from nncf.common.compression import NO_COMPRESSION_ALGORITHM_NAME
from nncf.common.graph.transformations.layout import TransformationLayout
from nncf.common.schedulers import StubCompressionScheduler
from nncf.common.utils.logger import logger
from nncf.common.utils.registry import Registry
from nncf.common.statistics import NNCFStatistics
from nncf.common.compression import BaseCompressionAlgorithmController
from nncf.tensorflow.api.compression import TFCompressionAlgorithmBuilder
from nncf.tensorflow.loss import TFZeroCompressionLoss
TF_COMPRESSION_ALGORITHMS = Registry('compression algorithm', add_name_as_attr=True)
@TF_COMPRESSION_ALGORITHMS.register(NO_COMPRESSION_ALGORITHM_NAME)
class NoCompressionAlgorithmBuilder(TFCompressionAlgorithmBuilder):
def get_transformation_layout(self, _) -> TransformationLayout:
return TransformationLayout()
def _build_controller(self, model: tf.keras.Model) -> CompressionAlgorithmController:
return NoCompressionAlgorithmController(model)
def initialize(self, model: tf.keras.Model) -> None:
pass
def _get_algo_specific_config_section(self) -> Dict:
return {}
class NoCompressionAlgorithmController(BaseCompressionAlgorithmController):
def __init__(self, target_model: tf.keras.Model):
super().__init__(target_model)
self._loss = TFZeroCompressionLoss()
self._scheduler = StubCompressionScheduler()
@property
def loss(self) -> TFZeroCompressionLoss:
return self._loss
@property
def scheduler(self) -> StubCompressionScheduler:
return self._scheduler
def statistics(self, quickly_collected_only: bool = False) -> NNCFStatistics:
return NNCFStatistics()
def get_compression_algorithm_builder(algo_name: str) -> Type[TFCompressionAlgorithmBuilder]:
logger.info('Creating compression algorithm: {}'.format(algo_name))
return TF_COMPRESSION_ALGORITHMS.get(algo_name)
| 39.25 | 93 | 0.792432 | 304 | 2,669 | 6.802632 | 0.434211 | 0.038685 | 0.047389 | 0.024662 | 0.05029 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003493 | 0.142001 | 2,669 | 67 | 94 | 39.835821 | 0.899563 | 0.209442 | 0 | 0.05 | 0 | 0 | 0.026291 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.225 | false | 0.025 | 0.325 | 0.15 | 0.775 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
e85309d79bf809adbbe4ce0cfcfd6d771ac1789a | 186 | py | Python | main.py | iqbal1987/pykm-tool | b4b3c1f02eae6a79263dccf4465a8b41e8cb77a3 | [
"Apache-2.0"
] | null | null | null | main.py | iqbal1987/pykm-tool | b4b3c1f02eae6a79263dccf4465a8b41e8cb77a3 | [
"Apache-2.0"
] | null | null | null | main.py | iqbal1987/pykm-tool | b4b3c1f02eae6a79263dccf4465a8b41e8cb77a3 | [
"Apache-2.0"
] | null | null | null | import sys
#from PyQt5.QtWidgets import QApplication, QMainWindow, QDockWindow, QPlainTextEdit
import PyQt5.QtWidgets as QtWidgets as qt
Class MainWindow(qt.QMainWindow):
| 23.25 | 83 | 0.774194 | 21 | 186 | 6.857143 | 0.619048 | 0.194444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012987 | 0.172043 | 186 | 7 | 84 | 26.571429 | 0.922078 | 0.44086 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.666667 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
e8567750e3c957c63ceee2b9473d0d72ddfa7755 | 125 | py | Python | src/parser/__init__.py | icewing1996/self-attentive-parser | 35ba70951eddefa63a294186077373fbe3e74185 | [
"MIT"
] | 1 | 2019-04-02T14:42:20.000Z | 2019-04-02T14:42:20.000Z | parser/__init__.py | icewing1996/biaffine-parser | f5a4ece7ba9a087d81b76dd6a8ea6aa7d90c6c82 | [
"MIT"
] | null | null | null | parser/__init__.py | icewing1996/biaffine-parser | f5a4ece7ba9a087d81b76dd6a8ea6aa7d90c6c82 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .model import Model
from .parser import BiaffineParser
__all__ = ['BiAffineParser', 'Model']
| 15.625 | 37 | 0.688 | 14 | 125 | 5.857143 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009524 | 0.16 | 125 | 7 | 38 | 17.857143 | 0.771429 | 0.168 | 0 | 0 | 0 | 0 | 0.186275 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
e87ab21b334ec2ba027ab2a37799984b175e75fb | 81 | py | Python | mcq/apps.py | OmolloCaleb/django-quiz-app-master | d937deed51352eabc5de29f0ee88e309439f67ff | [
"MIT"
] | 1 | 2020-02-07T15:40:52.000Z | 2020-02-07T15:40:52.000Z | mcq/apps.py | OmolloCaleb/django-quiz-app-master | d937deed51352eabc5de29f0ee88e309439f67ff | [
"MIT"
] | 5 | 2020-06-06T01:22:42.000Z | 2021-06-10T19:43:44.000Z | mcq/apps.py | OmolloCaleb/django-quiz-app-master | d937deed51352eabc5de29f0ee88e309439f67ff | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class McqConfig(AppConfig):
name = 'mcq'
| 13.5 | 33 | 0.728395 | 10 | 81 | 5.9 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.185185 | 81 | 5 | 34 | 16.2 | 0.893939 | 0 | 0 | 0 | 0 | 0 | 0.037037 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
e89760cf7223c78484873e5cd0b8d287d7dae399 | 134 | py | Python | tests/conftest.py | luizoti/webdriver_manager | deba3c2a00f54edd73e62a3074def80302bae20a | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | luizoti/webdriver_manager | deba3c2a00f54edd73e62a3074def80302bae20a | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | luizoti/webdriver_manager | deba3c2a00f54edd73e62a3074def80302bae20a | [
"Apache-2.0"
] | null | null | null | import os
import pytest
@pytest.fixture(scope='function')
def ssl_verify_enable():
yield
os.environ['WDM_SSL_VERIFY'] = ''
| 13.4 | 37 | 0.701493 | 18 | 134 | 5 | 0.722222 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164179 | 134 | 9 | 38 | 14.888889 | 0.803571 | 0 | 0 | 0 | 0 | 0 | 0.164179 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | true | 0 | 0.333333 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
e8d12a70ebc185d2227e954881ba27749b8dc450 | 384 | py | Python | wbutil/__init__.py | wbadart/wbutil-py | 500e0e25ff52ec1eae37707bcc9743a9b017e963 | [
"MIT"
] | null | null | null | wbutil/__init__.py | wbadart/wbutil-py | 500e0e25ff52ec1eae37707bcc9743a9b017e963 | [
"MIT"
] | null | null | null | wbutil/__init__.py | wbadart/wbutil-py | 500e0e25ff52ec1eae37707bcc9743a9b017e963 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
wbutil/__init__.py
Main manifest of wbutil modules.
Will Badart <wbadart@live.com>
created: JAN 2018
'''
from . import coroutine
from . import func
from . import fs
from . import math
from . import misc
from . import pipeline
from .coroutine import *
from .fs import *
from .func import *
from .math import *
from .misc import *
from .pipeline import *
| 15.36 | 32 | 0.723958 | 56 | 384 | 4.892857 | 0.482143 | 0.218978 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012698 | 0.179688 | 384 | 24 | 33 | 16 | 0.857143 | 0.320313 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
2ce65a85120e44b9a126314d2c93b227e2db64ef | 1,953 | py | Python | env/Lib/site-packages/OpenGL/GL/AMD/framebuffer_sample_positions.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GL/AMD/framebuffer_sample_positions.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GL/AMD/framebuffer_sample_positions.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension AMD.framebuffer_sample_positions
This module customises the behaviour of the
OpenGL.raw.GL.AMD.framebuffer_sample_positions to provide a more
Python-friendly API
Overview (from the spec)
In unextended GL, the sub-pixel loations of multisampled textures and
renderbuffers are generally determined in an implementation dependent
manner. Some algorithms -- in particular custom antialiasing functions --
depend on the knowledge of, or even require control over the positions of
samples within each pixel.
The AMD_sample_positions extension added some control over the positions
of samples within a single framebuffer. However, it forced all pixels
within a framebuffer to have the set of sample positions.
This extension provides a mechanism to explicitly set sample positions for
a framebuffer object with multi-sampled attachments in a repeating pattern,
allowing different pixels to use different sub-pixel locations for their
samples. The sample locations used by the FBO can be fixed for all pixels
in the FBOs attachments or they can be fixed for a sampling pattern
comprised of multiple pixels, where the sampling pattern is repeated over
all pixels. The rate of repeat of this sampling pattern size itself is
fixed and is implementation-dependent.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/AMD/framebuffer_sample_positions.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.AMD.framebuffer_sample_positions import *
from OpenGL.raw.GL.AMD.framebuffer_sample_positions import _EXTENSION_NAME
def glInitFramebufferSamplePositionsAMD():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
### END AUTOGENERATED SECTION | 44.386364 | 76 | 0.817204 | 278 | 1,953 | 5.676259 | 0.467626 | 0.076046 | 0.063371 | 0.091888 | 0.136882 | 0.136882 | 0.136882 | 0.063371 | 0.063371 | 0 | 0 | 0 | 0.144393 | 1,953 | 44 | 77 | 44.386364 | 0.944345 | 0.84639 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.777778 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
fa27cd903f7b2dcc895bcd99410d15c7803ebe6b | 206 | py | Python | seedstar_casestudy_one/emaillist/apps.py | elayira/seedstar_casestudy_one | a1ed30f464546f1d9de5c1eb353585a720990bc2 | [
"MIT"
] | null | null | null | seedstar_casestudy_one/emaillist/apps.py | elayira/seedstar_casestudy_one | a1ed30f464546f1d9de5c1eb353585a720990bc2 | [
"MIT"
] | null | null | null | seedstar_casestudy_one/emaillist/apps.py | elayira/seedstar_casestudy_one | a1ed30f464546f1d9de5c1eb353585a720990bc2 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class EmaillistConfig(AppConfig):
name = "seedstar_casestudy_one.emaillist"
verbose_name = _("email list")
| 25.75 | 54 | 0.786408 | 25 | 206 | 6.24 | 0.8 | 0.128205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140777 | 206 | 7 | 55 | 29.428571 | 0.881356 | 0 | 0 | 0 | 0 | 0 | 0.203884 | 0.15534 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
fa334de43da0aaf3a0b8358b8f6f00f69277cc5a | 1,043 | py | Python | OOP/Exercises/Polymorphism_and_Abstraction_Lab/4_shapes.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | 2 | 2022-03-04T11:39:03.000Z | 2022-03-13T07:13:23.000Z | OOP/Exercises/Polymorphism_and_Abstraction_Lab/4_shapes.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | null | null | null | OOP/Exercises/Polymorphism_and_Abstraction_Lab/4_shapes.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from math import pi
class Shape(ABC):
@abstractmethod
def calculate_area(self):
pass
@abstractmethod
def calculate_perimeter(self):
pass
class Circle(Shape):
def __init__(self, radius) -> None:
self.radius = radius
def calculate_area(self):
return self.radius ** 2 * pi
def calculate_perimeter(self):
return self.radius * 2 * pi
class Rectangle(Shape):
def __init__(self, height, width):
self.height = height
self.width = width
def calculate_area(self):
return self.height * self.width
def calculate_perimeter(self):
return 2 * self.height + 2 * self.width
# Zero Tests
if __name__ == "__main__":
circle = Circle(5)
print(circle.calculate_area())
print(circle.calculate_perimeter())
# 78.53981633974483
# 31.41592653589793
rectangle = Rectangle(10, 20)
print(rectangle.calculate_area())
print(rectangle.calculate_perimeter())
# 200
# 60
| 18.963636 | 47 | 0.645254 | 121 | 1,043 | 5.347107 | 0.31405 | 0.111283 | 0.074189 | 0.092736 | 0.222566 | 0.142195 | 0 | 0 | 0 | 0 | 0 | 0.059432 | 0.25791 | 1,043 | 54 | 48 | 19.314815 | 0.776486 | 0.050815 | 0 | 0.322581 | 0 | 0 | 0.00813 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.258065 | false | 0.064516 | 0.064516 | 0.129032 | 0.548387 | 0.129032 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 4 |
fa3840ad9f955605a2aaf701120ea218fb4f8698 | 147 | py | Python | src/tests/conftest.py | henkkah/ohtu-miniprojekti | b843b74d21068a2a502537c0baee2fa946d1e673 | [
"MIT"
] | null | null | null | src/tests/conftest.py | henkkah/ohtu-miniprojekti | b843b74d21068a2a502537c0baee2fa946d1e673 | [
"MIT"
] | null | null | null | src/tests/conftest.py | henkkah/ohtu-miniprojekti | b843b74d21068a2a502537c0baee2fa946d1e673 | [
"MIT"
] | null | null | null |
from database import db
def pytest_configure():
"""Alustaa tietokannan testejä varten"""
db.drop_tables_from_db()
db.reset_database() | 21 | 44 | 0.727891 | 19 | 147 | 5.368421 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170068 | 147 | 7 | 45 | 21 | 0.836066 | 0.231293 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
fa60991fa4ea88387d7ab8431874109639fb44f4 | 170 | py | Python | src/pykatsuyou/naAdj.py | SmashinFries/PyKatsuyou | ad7f220e4bf1a4f42d0f9f164c04119522d8200f | [
"MIT"
] | 1 | 2022-01-09T22:39:25.000Z | 2022-01-09T22:39:25.000Z | src/pykatsuyou/naAdj.py | SmashinFries/PyKatsuyou | ad7f220e4bf1a4f42d0f9f164c04119522d8200f | [
"MIT"
] | null | null | null | src/pykatsuyou/naAdj.py | SmashinFries/PyKatsuyou | ad7f220e4bf1a4f42d0f9f164c04119522d8200f | [
"MIT"
] | null | null | null | # な adjectives cant be conjugated. Maybe provide helpful examples/tips instead?
# May implement at a later date.
class NAadj:
def __init__(self) -> None:
pass | 34 | 79 | 0.717647 | 24 | 170 | 4.916667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211765 | 170 | 5 | 80 | 34 | 0.880597 | 0.635294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.333333 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
fa65f9a04ae74d15412270258ae510efe169bc79 | 13,824 | py | Python | vumi/components/tests/test_message_store_cache.py | apopheniac/vumi | e04bf32a0cf09292f03dfe8628798adff512b709 | [
"BSD-3-Clause"
] | null | null | null | vumi/components/tests/test_message_store_cache.py | apopheniac/vumi | e04bf32a0cf09292f03dfe8628798adff512b709 | [
"BSD-3-Clause"
] | null | null | null | vumi/components/tests/test_message_store_cache.py | apopheniac/vumi | e04bf32a0cf09292f03dfe8628798adff512b709 | [
"BSD-3-Clause"
] | 2 | 2018-03-05T18:01:45.000Z | 2019-11-02T19:34:18.000Z | # -*- coding: utf-8 -*-
"""Tests for vumi.components.message_store_cache."""
from datetime import datetime, timedelta
from twisted.internet.defer import inlineCallbacks, returnValue
from vumi.message import TransportMessage
from vumi.application.tests.test_base import ApplicationTestCase
from vumi.components import MessageStore
class TestMessageStoreCache(ApplicationTestCase):
use_riak = True
@inlineCallbacks
def setUp(self):
yield super(TestMessageStoreCache, self).setUp()
self.redis = yield self.get_redis_manager()
self.manager = yield self.get_riak_manager()
self.store = yield MessageStore(self.manager, self.redis)
self.cache = self.store.cache
self.batch_id = 'a-batch-id'
self.cache.batch_start(self.batch_id)
def mkmsg_out(self, **kwargs):
defaults = {
'message_id': TransportMessage.generate_id(),
}
defaults.update(kwargs)
return super(TestMessageStoreCache, self).mkmsg_out(**defaults)
def mkmsg_in(self, **kwargs):
defaults = {
'message_id': TransportMessage.generate_id(),
}
defaults.update(kwargs)
return super(TestMessageStoreCache, self).mkmsg_in(**defaults)
@inlineCallbacks
def add_messages(self, batch_id, callback, count=10):
messages = []
now = datetime.now()
for i in range(count):
msg = self.mkmsg_in(from_addr='from-%s' % (i,),
to_addr='to-%s' % (i,))
msg['timestamp'] = now - timedelta(seconds=i)
yield callback(batch_id, msg)
messages.append(msg)
returnValue(messages)
@inlineCallbacks
def test_add_outbound_message(self):
msg = self.mkmsg_out()
yield self.cache.add_outbound_message(self.batch_id, msg)
[msg_key] = yield self.cache.get_outbound_message_keys(self.batch_id)
self.assertEqual(msg_key, msg['message_id'])
@inlineCallbacks
def test_get_outbound_message_keys(self):
messages = yield self.add_messages(self.batch_id,
self.cache.add_outbound_message)
# make sure we get keys back ordered according to timestamp, which
# means the reverse of how we put them in.
keys = yield self.cache.get_outbound_message_keys(self.batch_id)
self.assertEqual(len(keys), 10)
self.assertEqual(keys, list([m['message_id'] for m in messages]))
@inlineCallbacks
def test_count_outbound_message_keys(self):
yield self.add_messages(self.batch_id,
self.cache.add_outbound_message)
count = yield self.cache.count_outbound_message_keys(self.batch_id)
self.assertEqual(count, 10)
@inlineCallbacks
def test_paged_get_outbound_message_keys(self):
messages = yield self.add_messages(self.batch_id,
self.cache.add_outbound_message)
# make sure we get keys back ordered according to timestamp, which
# means the reverse of how we put them in.
keys = yield self.cache.get_outbound_message_keys(self.batch_id, 0, 4)
self.assertEqual(len(keys), 5)
self.assertEqual(keys, list([m['message_id'] for m in messages])[:5])
@inlineCallbacks
def test_get_batch_ids(self):
yield self.cache.batch_start('batch-1')
yield self.cache.add_outbound_message('batch-1', self.mkmsg_out())
yield self.cache.batch_start('batch-2')
yield self.cache.add_outbound_message('batch-2', self.mkmsg_out())
self.assertEqual((yield self.cache.get_batch_ids()), set([
self.batch_id, 'batch-1', 'batch-2']))
@inlineCallbacks
def test_add_inbound_message(self):
msg = self.mkmsg_in()
yield self.cache.add_inbound_message(self.batch_id, msg)
[msg_key] = yield self.cache.get_inbound_message_keys(self.batch_id)
self.assertEqual(msg_key, msg['message_id'])
@inlineCallbacks
def test_get_inbound_message_keys(self):
messages = yield self.add_messages(self.batch_id,
self.cache.add_inbound_message)
keys = yield self.cache.get_inbound_message_keys(self.batch_id)
self.assertEqual(len(keys), 10)
self.assertEqual(keys, list([m['message_id'] for m in messages]))
@inlineCallbacks
def test_count_inbound_message_keys(self):
yield self.add_messages(self.batch_id,
self.cache.add_inbound_message)
count = yield self.cache.count_inbound_message_keys(self.batch_id)
self.assertEqual(count, 10)
@inlineCallbacks
def test_paged_get_inbound_message_keys(self):
messages = yield self.add_messages(self.batch_id,
self.cache.add_inbound_message)
keys = yield self.cache.get_inbound_message_keys(self.batch_id, 0, 4)
self.assertEqual(len(keys), 5)
self.assertEqual(keys, list([m['message_id'] for m in messages])[:5])
@inlineCallbacks
def test_get_from_addrs(self):
yield self.add_messages(self.batch_id,
self.cache.add_inbound_message)
from_addrs = yield self.cache.get_from_addrs(self.batch_id)
self.assertEqual(from_addrs, ['from-%s' % i for i in range(10)])
@inlineCallbacks
def test_count_from_addrs(self):
yield self.add_messages(self.batch_id,
self.cache.add_inbound_message)
count = yield self.cache.count_from_addrs(self.batch_id)
self.assertEqual(count, 10)
@inlineCallbacks
def test_get_to_addrs(self):
yield self.add_messages(self.batch_id,
self.cache.add_outbound_message)
to_addrs = yield self.cache.get_to_addrs(self.batch_id)
self.assertEqual(to_addrs, ['to-%s' % i for i in range(10)])
@inlineCallbacks
def test_count_to_addrs(self):
yield self.add_messages(self.batch_id,
self.cache.add_outbound_message)
count = yield self.cache.count_to_addrs(self.batch_id)
self.assertEqual(count, 10)
@inlineCallbacks
def test_add_event(self):
msg = self.mkmsg_out()
self.cache.add_outbound_message(self.batch_id, msg)
ack = self.mkmsg_ack(user_message_id=msg['message_id'],
sent_message_id=TransportMessage.generate_id())
delivery = self.mkmsg_delivery(user_message_id=msg['message_id'])
yield self.cache.add_event(self.batch_id, ack)
yield self.cache.add_event(self.batch_id, delivery)
status = yield self.cache.get_event_status(self.batch_id)
self.assertEqual(status, {
'delivery_report': 1,
'delivery_report.delivered': 1,
'delivery_report.failed': 0,
'delivery_report.pending': 0,
'ack': 1,
'nack': 0,
'sent': 1,
})
@inlineCallbacks
def test_add_event_idempotence(self):
msg = self.mkmsg_out()
self.cache.add_outbound_message(self.batch_id, msg)
acks = [self.mkmsg_ack(user_message_id=msg['message_id'],
sent_message_id=msg['message_id'])
for i in range(10)]
for ack in acks:
# send exact same event multiple times
ack['event_id'] = 'identical'
yield self.cache.add_event(self.batch_id, ack)
status = yield self.cache.get_event_status(self.batch_id)
self.assertEqual(status, {
'delivery_report': 0,
'delivery_report.delivered': 0,
'delivery_report.failed': 0,
'delivery_report.pending': 0,
'ack': 1,
'nack': 0,
'sent': 1,
})
@inlineCallbacks
def test_add_outbound_message_idempotence(self):
for i in range(10):
msg = self.mkmsg_out()
msg['message_id'] = 'the-same-thing'
yield self.cache.add_outbound_message(self.batch_id, msg)
status = yield self.cache.get_event_status(self.batch_id)
self.assertEqual(status['sent'], 1)
self.assertEqual(
(yield self.cache.get_outbound_message_keys(self.batch_id)),
['the-same-thing'])
@inlineCallbacks
def test_add_inbound_message_idempotence(self):
for i in range(10):
msg = self.mkmsg_in()
msg['message_id'] = 'the-same-thing'
self.cache.add_inbound_message(self.batch_id, msg)
self.assertEqual(
(yield self.cache.get_inbound_message_keys(self.batch_id)),
['the-same-thing'])
@inlineCallbacks
def test_clear_batch(self):
msg_in = self.mkmsg_in()
msg_out = self.mkmsg_out()
ack = self.mkmsg_ack(user_message_id=msg_out['message_id'],
sent_message_id=msg_out['message_id'])
dr = self.mkmsg_delivery(user_message_id=msg_out['message_id'],
status='delivered')
yield self.cache.add_inbound_message(self.batch_id, msg_in)
yield self.cache.add_outbound_message(self.batch_id, msg_out)
yield self.cache.add_event(self.batch_id, ack)
yield self.cache.add_event(self.batch_id, dr)
self.assertEqual(
(yield self.cache.get_event_status(self.batch_id)),
{
'ack': 1,
'delivery_report': 1,
'delivery_report.delivered': 1,
'delivery_report.failed': 0,
'delivery_report.pending': 0,
'nack': 0,
'sent': 1,
})
yield self.cache.clear_batch(self.batch_id)
yield self.cache.batch_start(self.batch_id)
self.assertEqual(
(yield self.cache.get_event_status(self.batch_id)),
{
'ack': 0,
'delivery_report': 0,
'delivery_report.delivered': 0,
'delivery_report.failed': 0,
'delivery_report.pending': 0,
'nack': 0,
'sent': 0,
})
self.assertEqual(
(yield self.cache.count_from_addrs(self.batch_id)), 0)
self.assertEqual(
(yield self.cache.count_to_addrs(self.batch_id)), 0)
self.assertEqual(
(yield self.cache.count_inbound_message_keys(self.batch_id)), 0)
self.assertEqual(
(yield self.cache.count_outbound_message_keys(self.batch_id)), 0)
@inlineCallbacks
def test_count_inbound_throughput(self):
# test for empty batches.
self.assertEqual(
(yield self.cache.count_inbound_throughput(self.batch_id)), 0)
now = datetime.now()
for i in range(10):
msg_in = self.mkmsg_in()
msg_in['timestamp'] = now - timedelta(seconds=i * 10)
yield self.cache.add_inbound_message(self.batch_id, msg_in)
self.assertEqual(
(yield self.cache.count_inbound_throughput(self.batch_id)), 10)
self.assertEqual(
(yield self.cache.count_inbound_throughput(self.batch_id,
sample_time=1)), 1)
self.assertEqual(
(yield self.cache.count_inbound_throughput(self.batch_id,
sample_time=10)), 2)
@inlineCallbacks
def test_count_outbound_throughput(self):
# test for empty batches.
self.assertEqual(
(yield self.cache.count_outbound_throughput(self.batch_id)), 0)
now = datetime.now()
for i in range(10):
msg_out = self.mkmsg_out()
msg_out['timestamp'] = now - timedelta(seconds=i * 10)
yield self.cache.add_outbound_message(self.batch_id, msg_out)
self.assertEqual(
(yield self.cache.count_outbound_throughput(self.batch_id)), 10)
self.assertEqual(
(yield self.cache.count_outbound_throughput(self.batch_id,
sample_time=1)), 1)
self.assertEqual(
(yield self.cache.count_outbound_throughput(self.batch_id,
sample_time=10)), 2)
def test_get_query_token(self):
cache = self.store.cache
# different ordering in the dict should result in the same token.
token1 = cache.get_query_token('inbound', [{'a': 'b', 'c': 'd'}])
token2 = cache.get_query_token('inbound', [{'c': 'd', 'a': 'b'}])
self.assertEqual(token1, token2)
@inlineCallbacks
def test_start_query(self):
token = yield self.cache.start_query(self.batch_id, 'inbound', [
{'key': 'key', 'pattern': 'pattern', 'flags': 'flags'}])
self.assertTrue(
(yield self.cache.is_query_in_progress(self.batch_id, token)))
@inlineCallbacks
def test_store_query_results(self):
now = datetime.now()
message_ids = []
# NOTE: we're writing these messages oldest first so we can check
# that the cache is returning them in the correct order
# when we pull out the search results.
for i in range(10):
msg_in = self.mkmsg_in(content='hello-%s' % (i,))
msg_in['timestamp'] = now + timedelta(seconds=i * 10)
yield self.cache.add_inbound_message(self.batch_id, msg_in)
message_ids.append(msg_in['message_id'])
token = yield self.cache.start_query(self.batch_id, 'inbound', [
{'key': 'msg.content', 'pattern': 'hello', 'flags': ''}])
yield self.cache.store_query_results(self.batch_id, token, message_ids,
'inbound', 120)
self.assertFalse(
(yield self.cache.is_query_in_progress(self.batch_id, token)))
self.assertEqual(
(yield self.cache.get_query_results(self.batch_id, token)),
list(reversed(message_ids)))
self.assertEqual(
(yield self.cache.count_query_results(self.batch_id, token)),
10)
| 40.069565 | 79 | 0.630064 | 1,734 | 13,824 | 4.77624 | 0.093426 | 0.080415 | 0.092973 | 0.043468 | 0.816711 | 0.768896 | 0.708283 | 0.667955 | 0.663125 | 0.650205 | 0 | 0.010671 | 0.261068 | 13,824 | 344 | 80 | 40.186047 | 0.800098 | 0.043186 | 0 | 0.568493 | 0 | 0 | 0.066162 | 0.021196 | 0 | 0 | 0 | 0 | 0.140411 | 1 | 0.092466 | false | 0 | 0.017123 | 0 | 0.123288 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
fa695055cb3a25737b33bbd6ae853195918a1482 | 50 | py | Python | src/utils/exceptions.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 24 | 2018-12-12T08:54:52.000Z | 2021-12-07T08:45:13.000Z | src/utils/exceptions.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 3 | 2019-07-18T20:14:41.000Z | 2022-03-12T01:03:28.000Z | src/utils/exceptions.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 9 | 2018-12-12T16:18:39.000Z | 2022-03-30T16:25:47.000Z | class ModalityNotPresentError(KeyError):
pass
| 16.666667 | 40 | 0.8 | 4 | 50 | 10 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14 | 50 | 2 | 41 | 25 | 0.930233 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
3afcac20dfd8d06b2e1b2ec7feaa7d5a7d1c603f | 4,656 | py | Python | AOC2020/python/day17.py | hbldh/AdventOfCode2016 | 9e737e07edddffdfd7a39c1dd410f9bce1192e4e | [
"MIT"
] | null | null | null | AOC2020/python/day17.py | hbldh/AdventOfCode2016 | 9e737e07edddffdfd7a39c1dd410f9bce1192e4e | [
"MIT"
] | null | null | null | AOC2020/python/day17.py | hbldh/AdventOfCode2016 | 9e737e07edddffdfd7a39c1dd410f9bce1192e4e | [
"MIT"
] | null | null | null | import itertools
from collections import defaultdict
neighbours_3 = tuple(
filter(
lambda x: x != (0, 0, 0),
list(itertools.product([-1, 0, 1], [-1, 0, 1], [-1, 0, 1])),
)
)
neighbours_4 = tuple(
filter(
lambda x: x != (0, 0, 0, 0),
list(itertools.product([-1, 0, 1], [-1, 0, 1], [-1, 0, 1], [-1, 0, 1])),
)
)
def iterate_3(map):
new_map = defaultdict(lambda: ".")
x = [k[0] for k in map.keys()]
x_start = min(x) - 1
x_end = max(x) + 1
y = [k[1] for k in map.keys()]
y_start = min(y) - 1
y_end = max(y) + 1
z = [k[2] for k in map.keys()]
z_start = min(z) - 1
z_end = max(z) + 1
for layer_idx in range(z_start, z_end + 1):
for row_idx in range(y_start, y_end + 1):
for column_idx in range(x_start, x_end + 1):
n_activated_neighbours = 0
for neighbour in neighbours_3:
n_activated_neighbours += int(
map[
(
column_idx + neighbour[0],
row_idx + neighbour[1],
layer_idx + neighbour[2],
)
]
== "#"
)
if map[(column_idx, row_idx, layer_idx)] == ".":
if n_activated_neighbours == 3:
new_map[(column_idx, row_idx, layer_idx)] = "#"
else:
new_map[(column_idx, row_idx, layer_idx)] = "."
else:
if 2 <= n_activated_neighbours <= 3:
new_map[(column_idx, row_idx, layer_idx)] = "#"
else:
new_map[(column_idx, row_idx, layer_idx)] = "."
return new_map
def iterate_4(map):
new_map = defaultdict(lambda: ".")
x = [k[0] for k in map.keys()]
x_start = min(x) - 1
x_end = max(x) + 1
y = [k[1] for k in map.keys()]
y_start = min(y) - 1
y_end = max(y) + 1
z = [k[2] for k in map.keys()]
z_start = min(z) - 1
z_end = max(z) + 1
w = [k[3] for k in map.keys()]
w_start = min(w) - 1
w_end = max(w) + 1
for temporal_idx in range(w_start, w_end + 1):
for layer_idx in range(z_start, z_end + 1):
for row_idx in range(y_start, y_end + 1):
for column_idx in range(x_start, x_end + 1):
n_activated_neighbours = 0
for neighbour in neighbours_4:
n_activated_neighbours += int(
map[
(
column_idx + neighbour[0],
row_idx + neighbour[1],
layer_idx + neighbour[2],
temporal_idx + neighbour[3],
)
]
== "#"
)
if map[(column_idx, row_idx, layer_idx, temporal_idx)] == ".":
if n_activated_neighbours == 3:
new_map[
(column_idx, row_idx, layer_idx, temporal_idx)
] = "#"
else:
new_map[
(column_idx, row_idx, layer_idx, temporal_idx)
] = "."
else:
if 2 <= n_activated_neighbours <= 3:
new_map[
(column_idx, row_idx, layer_idx, temporal_idx)
] = "#"
else:
new_map[
(column_idx, row_idx, layer_idx, temporal_idx)
] = "."
return new_map
def solve_part_1(map):
for i in range(6):
map = iterate_3(map)
return len([v for v in map.values() if v == "#"])
def solve_part_2(map):
for i in range(6):
map = iterate_4(map)
return len([v for v in map.values() if v == "#"])
def solve(data):
map_3 = defaultdict(lambda: ".")
map_4 = defaultdict(lambda: ".")
for y, row in enumerate(data.splitlines()):
for x, cell in enumerate(row):
map_3[(x, y, 0)] = cell
map_4[(x, y, 0, 0)] = cell
return solve_part_1(map_3), solve_part_2(map_4)
if __name__ == "__main__":
from AOC2020.python import run_solver
run_solver(solve, __file__)
| 33.73913 | 82 | 0.422466 | 555 | 4,656 | 3.29009 | 0.113514 | 0.061336 | 0.078861 | 0.082147 | 0.78149 | 0.757941 | 0.757941 | 0.757941 | 0.694414 | 0.674151 | 0 | 0.039184 | 0.462844 | 4,656 | 137 | 83 | 33.985401 | 0.690924 | 0 | 0 | 0.616667 | 0 | 0 | 0.005584 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | false | 0 | 0.025 | 0 | 0.108333 | 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 | 0 | 0 | 0 | 4 |
d70a0c6508a479e9a860954695b6e3ba36db8918 | 359 | py | Python | students/K33401/Gutin_Evgenii/practical_work/2/django_project_gutin/project_first_app/admin.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 4 | 2020-09-03T15:41:42.000Z | 2021-12-24T15:28:20.000Z | students/K33401/Gutin_Evgenii/practical_work/2/django_project_gutin/project_first_app/admin.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 48 | 2020-09-13T20:22:42.000Z | 2021-04-30T11:13:30.000Z | students/K33401/Gutin_Evgenii/practical_work/2/django_project_gutin/project_first_app/admin.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 69 | 2020-09-06T10:32:37.000Z | 2021-11-28T18:13:17.000Z | from .models import *
from django.contrib import admin
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
pass
@admin.register(DriverLicense)
class DriverLicenseAdmin(admin.ModelAdmin):
pass
@admin.register(Vehicle)
class VehicleAdmin(admin.ModelAdmin):
pass
@admin.register(Property)
class PropertyAdmin(admin.ModelAdmin):
pass
| 15.608696 | 43 | 0.768802 | 40 | 359 | 6.9 | 0.45 | 0.188406 | 0.275362 | 0.26087 | 0.347826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133705 | 359 | 22 | 44 | 16.318182 | 0.88746 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.285714 | 0.142857 | 0 | 0.428571 | 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 | 0 | 0 | 0 | 4 |
d7103c050437df81b9fc5fb1c0fb645f5876a127 | 233 | py | Python | inventory/views.py | Drabant/homeinventory | ba718338c8242898383da902386d3f9cf5754a85 | [
"BSD-3-Clause"
] | null | null | null | inventory/views.py | Drabant/homeinventory | ba718338c8242898383da902386d3f9cf5754a85 | [
"BSD-3-Clause"
] | null | null | null | inventory/views.py | Drabant/homeinventory | ba718338c8242898383da902386d3f9cf5754a85 | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from .models import Item
# Create your views here.
def index(request):
return HttpResponse(', '.join([item.name for item in Item.objects.order_by('name')]))
| 25.888889 | 86 | 0.76824 | 34 | 233 | 5.235294 | 0.705882 | 0.11236 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124464 | 233 | 8 | 87 | 29.125 | 0.872549 | 0.098712 | 0 | 0 | 0 | 0 | 0.028846 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.6 | 0.2 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
d71db226cf1d6578f766fabf9c4d2f9eb64b70f3 | 201 | py | Python | algorithms/python/functional_lcm.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | 1 | 2017-02-20T21:04:47.000Z | 2017-02-20T21:04:47.000Z | algorithms/python/functional_lcm.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | null | null | null | algorithms/python/functional_lcm.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | 2 | 2017-02-20T21:04:49.000Z | 2021-05-18T11:29:16.000Z | from fractions import gcd
def lcm(numbers):
return reduce(lambda x, y: (x*y)/gcd(x,y), numbers, 1)
print lcm((3, 4))
print lcm((3, 6))
print lcm((4, 6))
print lcm((3, 6))
print lcm(range(1, 20))
| 18.272727 | 58 | 0.626866 | 40 | 201 | 3.15 | 0.475 | 0.31746 | 0.214286 | 0.15873 | 0.285714 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0.071856 | 0.169154 | 201 | 10 | 59 | 20.1 | 0.682635 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.125 | null | null | 0.625 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
d74a5490f145b81b5ae7c327e1b6e43ddd76f640 | 342 | py | Python | xloa/__init__.py | harvey103565/Ofauto | 1adb276390210c13517ea002a05f67edd870aaac | [
"MIT"
] | null | null | null | xloa/__init__.py | harvey103565/Ofauto | 1adb276390210c13517ea002a05f67edd870aaac | [
"MIT"
] | null | null | null | xloa/__init__.py | harvey103565/Ofauto | 1adb276390210c13517ea002a05f67edd870aaac | [
"MIT"
] | null | null | null | #! /usr/bin/python3
# -*- coding: utf-8 -*-
from .xlerror import XlError
from .xlneuro import App
from .xlneuro import Book
from .xlneuro import Books
from .xlneuro import Sheet
from .xlneuro import Sheets
from .xlneuro import Range
from .charts import Chart
from .charts import Charts
from .macro import Macro
from .address import Address
| 21.375 | 28 | 0.77193 | 50 | 342 | 5.28 | 0.4 | 0.25 | 0.386364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00692 | 0.154971 | 342 | 15 | 29 | 22.8 | 0.906574 | 0.116959 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
d77255fa34147e0fd37556306b9cfc8164a7251a | 619 | py | Python | dskc/visualization/terminal/jupyter.py | NovaSBE-DSKC/predict-campaing-sucess-rate | fec339aee7c883f55d64130eb69e490f765ee27d | [
"MIT"
] | null | null | null | dskc/visualization/terminal/jupyter.py | NovaSBE-DSKC/predict-campaing-sucess-rate | fec339aee7c883f55d64130eb69e490f765ee27d | [
"MIT"
] | null | null | null | dskc/visualization/terminal/jupyter.py | NovaSBE-DSKC/predict-campaing-sucess-rate | fec339aee7c883f55d64130eb69e490f765ee27d | [
"MIT"
] | null | null | null | from IPython.display import display, Markdown
from tabulate import tabulate
import pandas as pd
def markdown_h1(text):
text = "# " + text
display(Markdown(text))
def markdown_h2(text):
text = "## " + text
display(Markdown(text))
def markdown_h3(text):
text = "### " + text
display(Markdown(text))
def markdown(text):
display(Markdown(text))
def markdown_table(table, format="github"):
if type(table) == pd.DataFrame:
table = tabulate(table, headers='keys')
else:
table = tabulate(table[1:], headers=table[0], tablefmt=format)
display(Markdown(table))
| 18.757576 | 70 | 0.654281 | 76 | 619 | 5.276316 | 0.342105 | 0.224439 | 0.189526 | 0.229426 | 0.399002 | 0.399002 | 0.314214 | 0.314214 | 0 | 0 | 0 | 0.010204 | 0.208401 | 619 | 32 | 71 | 19.34375 | 0.808163 | 0 | 0 | 0.2 | 0 | 0 | 0.030695 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.15 | 0 | 0.4 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d78be9276bfd1e8b2f09c93b76c36b1afdb08f7e | 198 | py | Python | tests/KeyboardTest.py | Programming-2/Lil-Sheds-Get-Good-In | dac4a16d8f188f399ca831ca9614a31e10aff717 | [
"MIT"
] | 2 | 2018-02-28T14:39:48.000Z | 2018-02-28T23:44:02.000Z | tests/KeyboardTest.py | Programming-2/CS-Fighter | dac4a16d8f188f399ca831ca9614a31e10aff717 | [
"MIT"
] | 56 | 2018-02-06T14:01:16.000Z | 2018-06-04T11:36:18.000Z | tests/KeyboardTest.py | Programming-2/CS-Fighter | dac4a16d8f188f399ca831ca9614a31e10aff717 | [
"MIT"
] | null | null | null | import pygame
from inputmanager.KeyboardManager import KeyboardManager
keyboardManager = KeyboardManager()
while True:
keyboardManager.update()
print(keyboardManager.keysDown[pygame.K_a])
| 22 | 56 | 0.813131 | 19 | 198 | 8.421053 | 0.631579 | 0.375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116162 | 198 | 8 | 57 | 24.75 | 0.914286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
ad44933a59ff3165447b87b0fd4e5893fd3f9779 | 242 | py | Python | test_apps/python_app/example/flows/o1_testcases/additional_erase.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | test_apps/python_app/example/flows/o1_testcases/additional_erase.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | 127 | 2019-11-23T17:09:35.000Z | 2021-09-02T11:06:20.000Z | test_apps/python_app/example/flows/o1_testcases/additional_erase.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | with Flow() as flow:
if flow.options.get("force"):
flow.func("erase_all", number=flow.options["number"])
else:
with flow.if_enable('additional_erase'):
flow.func("erase_all", number=flow.options["number"])
| 34.571429 | 65 | 0.628099 | 32 | 242 | 4.625 | 0.4375 | 0.222973 | 0.175676 | 0.216216 | 0.527027 | 0.527027 | 0.527027 | 0.527027 | 0 | 0 | 0 | 0 | 0.202479 | 242 | 6 | 66 | 40.333333 | 0.766839 | 0 | 0 | 0.333333 | 0 | 0 | 0.210744 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ad6c9f3a0356f88f51c64fcaf243ce89445fb55d | 107 | py | Python | tests/resources/module_without_license_and_shebang_skip.py | henryiii/pre-commit-hooks | 93b709d9ca27610518f5435fa9a51d98f7ada18d | [
"MIT"
] | 62 | 2015-07-26T06:20:40.000Z | 2022-03-26T21:05:59.000Z | tests/resources/module_without_license_and_shebang_skip.py | henryiii/pre-commit-hooks | 93b709d9ca27610518f5435fa9a51d98f7ada18d | [
"MIT"
] | 25 | 2015-07-24T08:34:52.000Z | 2022-03-10T20:22:45.000Z | tests/resources/module_without_license_and_shebang_skip.py | henryiii/pre-commit-hooks | 93b709d9ca27610518f5435fa9a51d98f7ada18d | [
"MIT"
] | 30 | 2015-07-18T17:40:25.000Z | 2022-02-10T19:55:53.000Z | #!/bin/usr/env python
# -*- coding: utf-8 -*-
# SKIP LICENSE INSERTION
import sys
sys.stdout.write("FOO")
| 15.285714 | 24 | 0.663551 | 16 | 107 | 4.4375 | 0.9375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.140187 | 107 | 6 | 25 | 17.833333 | 0.76087 | 0.607477 | 0 | 0 | 0 | 0 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
ad8f21aae3e238e5c1db889f887fe6e8beca0a1c | 87 | py | Python | lua_ast/__init__.py | paluh/python-lua-ast | aa5ba43557ccf63fb82b35105110270edb23784b | [
"BSD-3-Clause"
] | 1 | 2020-11-03T20:44:55.000Z | 2020-11-03T20:44:55.000Z | lua_ast/__init__.py | paluh/python-lua-ast | aa5ba43557ccf63fb82b35105110270edb23784b | [
"BSD-3-Clause"
] | null | null | null | lua_ast/__init__.py | paluh/python-lua-ast | aa5ba43557ccf63fb82b35105110270edb23784b | [
"BSD-3-Clause"
] | 1 | 2020-12-25T02:20:01.000Z | 2020-12-25T02:20:01.000Z | from __future__ import absolute_import
from .parser import parse
__all__ = ['parse']
| 14.5 | 38 | 0.781609 | 11 | 87 | 5.363636 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149425 | 87 | 5 | 39 | 17.4 | 0.797297 | 0 | 0 | 0 | 0 | 0 | 0.057471 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
ad956ff64be031a80e06881e3b101d5dd9d8c027 | 721 | py | Python | bom_data_parser/__init__.py | amacd31/bom_data_parser | df3cc8495269cf4f974ce44b1d5c663749d84311 | [
"BSD-3-Clause"
] | 6 | 2015-11-09T12:30:56.000Z | 2021-05-05T04:31:53.000Z | bom_data_parser/__init__.py | amacd31/bom_data_parser | df3cc8495269cf4f974ce44b1d5c663749d84311 | [
"BSD-3-Clause"
] | null | null | null | bom_data_parser/__init__.py | amacd31/bom_data_parser | df3cc8495269cf4f974ce44b1d5c663749d84311 | [
"BSD-3-Clause"
] | null | null | null | from bom_data_parser.acorn_sat import read_acorn_sat_csv
from bom_data_parser.climate_data_online import read_climate_data_online_csv
from bom_data_parser.climate_data_online import read_climate_data_online_zip
from bom_data_parser.hrs import read_hrs_csv
from bom_data_parser.observations_json import read_obs_json
from bom_data_parser.seasonal_streamflow import read_ssf_csv
from bom_data_parser.soi import read_soi_html
from bom_data_parser.water_storages import read_water_storage_series
from bom_data_parser.water_storages import read_water_storage_states
from bom_data_parser.water_storages import read_water_storage_urns
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| 48.066667 | 76 | 0.905687 | 120 | 721 | 4.891667 | 0.258333 | 0.11925 | 0.187394 | 0.289608 | 0.551959 | 0.483816 | 0.483816 | 0.483816 | 0.483816 | 0.483816 | 0 | 0 | 0.069348 | 721 | 14 | 77 | 51.5 | 0.874814 | 0 | 0 | 0 | 0 | 0 | 0.009709 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.846154 | 0 | 0.846154 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
ada10508a9d617880302f07678c44473423d39e8 | 179 | py | Python | canvasapi/peer_review.py | damianfs/canvasapi | 10ef96d268a0535c888d8fdd8169da31d9a66e3f | [
"MIT"
] | 386 | 2017-03-31T15:44:40.000Z | 2022-03-31T12:28:41.000Z | canvasapi/peer_review.py | damianfs/canvasapi | 10ef96d268a0535c888d8fdd8169da31d9a66e3f | [
"MIT"
] | 502 | 2017-04-03T19:06:06.000Z | 2022-03-10T21:59:23.000Z | canvasapi/peer_review.py | damianfs/canvasapi | 10ef96d268a0535c888d8fdd8169da31d9a66e3f | [
"MIT"
] | 148 | 2017-04-03T14:26:38.000Z | 2022-03-14T15:07:00.000Z | from canvasapi.canvas_object import CanvasObject
class PeerReview(CanvasObject):
def __str__(self):
return "{} {} ({})".format(self.asset_id, self.user_id, self.id)
| 25.571429 | 72 | 0.703911 | 22 | 179 | 5.409091 | 0.727273 | 0.10084 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156425 | 179 | 6 | 73 | 29.833333 | 0.788079 | 0 | 0 | 0 | 0 | 0 | 0.055866 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 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 | 0 | 0 | 0 | 4 |
a8e1e2c2e691573ed5ca21bfaf506de7364423a4 | 97 | py | Python | python/src/utils/types.py | vigenere23/finger-angles-predictions-EMG | b5aa3e5fb0159a18fa909bc4c51f6ee62ef3888d | [
"Apache-2.0"
] | null | null | null | python/src/utils/types.py | vigenere23/finger-angles-predictions-EMG | b5aa3e5fb0159a18fa909bc4c51f6ee62ef3888d | [
"Apache-2.0"
] | 2 | 2021-12-18T18:09:15.000Z | 2021-12-18T18:09:15.000Z | python/src/utils/types.py | vigenere23/finger-angles-predictions-EMG | b5aa3e5fb0159a18fa909bc4c51f6ee62ef3888d | [
"Apache-2.0"
] | null | null | null | from typing import TypeVar
InputType = TypeVar('InputType')
OutputType = TypeVar('OutputType')
| 16.166667 | 34 | 0.773196 | 10 | 97 | 7.5 | 0.6 | 0.426667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.123711 | 97 | 5 | 35 | 19.4 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0.195876 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 4 |
a8eb1d35876dd282631cf6d8441fb9916f7bc0f5 | 210 | py | Python | debutizer/commands/repo_metadata/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | 2 | 2022-03-08T01:53:20.000Z | 2022-03-08T01:53:26.000Z | debutizer/commands/repo_metadata/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | 64 | 2021-10-19T01:03:43.000Z | 2022-01-02T18:42:46.000Z | debutizer/commands/repo_metadata/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | null | null | null | from .packages import add_packages_files
from .release import add_release_files
from .sources import add_sources_files
__all__ = [
"add_packages_files",
"add_release_files",
"add_sources_files",
]
| 21 | 40 | 0.77619 | 28 | 210 | 5.25 | 0.285714 | 0.183673 | 0.217687 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152381 | 210 | 9 | 41 | 23.333333 | 0.825843 | 0 | 0 | 0 | 0 | 0 | 0.247619 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 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 | 0 | 0 | 0 | 4 |
d1387aa6e3ee9def90b072ed7bed72cf7ec2e495 | 159 | py | Python | zss/__init__.py | TheChuckster/zhang-shasha | 138c9914520ddac69c8d4a3bfd41f4ab2ca323ce | [
"BSD-3-Clause"
] | 1 | 2018-10-30T05:01:30.000Z | 2018-10-30T05:01:30.000Z | zss/__init__.py | bauerca/zhang-shasha | 138c9914520ddac69c8d4a3bfd41f4ab2ca323ce | [
"BSD-3-Clause"
] | null | null | null | zss/__init__.py | bauerca/zhang-shasha | 138c9914520ddac69c8d4a3bfd41f4ab2ca323ce | [
"BSD-3-Clause"
] | null | null | null | from compare import (
distance,
simple_distance,
)
from simple_tree import Node
__all__ = ['distance', 'simple_distance', 'Node']
__version__ = '1.1'
| 17.666667 | 49 | 0.704403 | 19 | 159 | 5.315789 | 0.526316 | 0.277228 | 0.435644 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015267 | 0.176101 | 159 | 8 | 50 | 19.875 | 0.755725 | 0 | 0 | 0 | 0 | 0 | 0.188679 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
d14ca2f6a2a11f1ec09e6ad4e22f2ba84a1a2636 | 108 | py | Python | code/__init__.py | masonrogers14/speedbot | f71f4b4dbdb60b68c111e9c9bb935c0e7b6644c6 | [
"MIT"
] | null | null | null | code/__init__.py | masonrogers14/speedbot | f71f4b4dbdb60b68c111e9c9bb935c0e7b6644c6 | [
"MIT"
] | null | null | null | code/__init__.py | masonrogers14/speedbot | f71f4b4dbdb60b68c111e9c9bb935c0e7b6644c6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 25 14:04:33 2019
@author: Mason
"""
| 12 | 35 | 0.592593 | 18 | 108 | 3.555556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159091 | 0.185185 | 108 | 8 | 36 | 13.5 | 0.568182 | 0.87963 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d151363b84a3409d92a2b76bdd2934689fa5144e | 17 | py | Python | datalad_fuse/consts.py | datalad/datalad-fuse | 35df143cde90a7dd1b877fc1f7d1f397ef09b0f4 | [
"MIT"
] | null | null | null | datalad_fuse/consts.py | datalad/datalad-fuse | 35df143cde90a7dd1b877fc1f7d1f397ef09b0f4 | [
"MIT"
] | 65 | 2021-09-03T14:56:28.000Z | 2022-03-23T18:54:39.000Z | datalad_fuse/consts.py | datalad/datalad-fuse | 35df143cde90a7dd1b877fc1f7d1f397ef09b0f4 | [
"MIT"
] | 2 | 2021-09-15T16:10:03.000Z | 2021-10-01T18:38:11.000Z | CACHE_SIZE = 128
| 8.5 | 16 | 0.764706 | 3 | 17 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.214286 | 0.176471 | 17 | 1 | 17 | 17 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d1702e84c860da70cebf2338c97f7c60b3973892 | 51 | py | Python | client/__init__.py | tombh/deis | f98fd5e43acfa13c0780c25cfd40dd34d4d1bcc0 | [
"Apache-2.0"
] | 1 | 2016-05-28T08:44:13.000Z | 2016-05-28T08:44:13.000Z | client/__init__.py | tombh/deis | f98fd5e43acfa13c0780c25cfd40dd34d4d1bcc0 | [
"Apache-2.0"
] | null | null | null | client/__init__.py | tombh/deis | f98fd5e43acfa13c0780c25cfd40dd34d4d1bcc0 | [
"Apache-2.0"
] | null | null | null | """
A command-line client for the Deis system.
"""
| 12.75 | 42 | 0.666667 | 8 | 51 | 4.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 51 | 3 | 43 | 17 | 0.809524 | 0.823529 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d1703520947311b55cf13c1bcc0088b4ec954f7e | 123 | py | Python | utils/augment/cutmix.py | kingqiuol/pytorch-template | 8bc78f996fbbc15ae54a3055cd3d33199b4a96d8 | [
"MIT"
] | null | null | null | utils/augment/cutmix.py | kingqiuol/pytorch-template | 8bc78f996fbbc15ae54a3055cd3d33199b4a96d8 | [
"MIT"
] | null | null | null | utils/augment/cutmix.py | kingqiuol/pytorch-template | 8bc78f996fbbc15ae54a3055cd3d33199b4a96d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2022/2/10 16:23
# @Author : jinqiu
# @Site :
# @File : cutmix.py
# @Software: PyCharm
| 13.666667 | 25 | 0.552846 | 17 | 123 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0.219512 | 123 | 8 | 26 | 15.375 | 0.583333 | 0.878049 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0f4dbadaeb76195539a88248543b3020f4f68494 | 5,175 | py | Python | plugins/easteregg.py | Avedo/Ezrael | ce2b9ac40ed6100ec86267ab0636a442c7a83f7a | [
"Apache-2.0"
] | 1 | 2016-09-24T18:11:43.000Z | 2016-09-24T18:11:43.000Z | plugins/easteregg.py | Avedo/Ezrael | ce2b9ac40ed6100ec86267ab0636a442c7a83f7a | [
"Apache-2.0"
] | 6 | 2015-05-15T13:21:13.000Z | 2015-06-23T18:47:22.000Z | plugins/easteregg.py | Bornageek/Ezrael | ce2b9ac40ed6100ec86267ab0636a442c7a83f7a | [
"Apache-2.0"
] | 1 | 2016-02-26T14:17:38.000Z | 2016-02-26T14:17:38.000Z | from core.plugin import Plugin
# DEPRECATED. TODO: save those Easter-Eggs using record plugin
class EasterEgg(Plugin):
def onMsg(self, irc, channel, nick, msg):
# Ensure that the given message starts with a command.
if msg[0] != '!':
return
# Extract the current command.
command = msg[1:].split()[0].strip().lower()
if command == "moo":
self.send_message("MOO yourself, " + nick, channel)
elif command == "xkcd":
self.send_message("https://c.xkcd.com/random/comic/", channel)
elif command == "train":
self.send_message("Choo Choo! It's the Mystery Train!", channel)
elif command == "poo":
self.send_message("Don't be a potty mouth", channel)
elif command == "duck":
self.send_message("__(\"<", channel)
self.send_message("\__/", channel)
self.send_message(" ^^", channel)
self.send_message("DUCKTALES UhhhHuuuuuuu", channel)
elif command == "tux":
self.send_message(" .--.", channel)
self.send_message(" |o_o |", channel)
self.send_message(" |:_/ |", channel)
self.send_message(" // \\ \\", channel)
self.send_message(" (| | )", channel)
self.send_message("/'\\_ _/`\\", channel)
self.send_message("\\___)=(___/", channel)
elif command == "arch":
self.send_message(" -`", channel)
self.send_message(" .o+`", channel)
self.send_message(" `ooo/", channel)
self.send_message(" `+oooo:", channel)
self.send_message(" `+oooooo:", channel)
self.send_message(" -+oooooo+:", channel)
self.send_message(" `/:-:++oooo+:", channel)
self.send_message(" `/++++/+++++++:", channel)
self.send_message(" `/++++++++++++++:", channel)
self.send_message(" `/+++ooooooooooooo/`", channel)
self.send_message(" ./ooosssso++osssssso+`", channel)
self.send_message(" .oossssso-````/ossssss+`", channel)
self.send_message(" -osssssso. :ssssssso.", channel)
self.send_message(" :osssssss/ osssso+++.", channel)
self.send_message(" /ossssssss/ +ssssooo/-", channel)
self.send_message(" `/ossssso+/:- -:/+osssso+-", channel)
self.send_message(" `+sso+:-` `.-/+oso:", channel)
self.send_message("`++:. `-/+/", channel)
self.send_message(".` `", channel)
elif command == "archlinux":
self.send_message(" .", channel)
self.send_message(" /#\\", channel)
self.send_message(" /###\\ # | *", channel)
self.send_message(" /p^###\\ a##e #%\" a#\"e 6##% | | |-^-. | | \\ /", channel)
self.send_message(" /##P^q##\\ .oOo# # # # # | | | | | | X", channel)
self.send_message(" /##( )##\\ %OoO# # %#e\" # # | | | | ^._.| / \\ TM", channel)
self.send_message(" /###P q#,^\\", channel)
self.send_message("/P^ ^q\\ TM", channel)
elif command == "duckduck":
self.send_message(".......ENTE......:", channel)
self.send_message(": ,~~. :", channel)
self.send_message("E ( 6 )-_, E", channel)
self.send_message("N (\___ )=='-' N", channel)
self.send_message("T \ . ) ) T", channel)
self.send_message("E \ `-' / E", channel)
self.send_message(": ~~'`~'`~'`~`~' :", channel)
self.send_message(":......ENTE......:", channel)
elif command == "gurke":
self.send_message(" #. ,# ", channel)
self.send_message(" \ `-._____,-'=/", channel)
self.send_message("____`._ ----- _,'_____PhS", channel)
self.send_message(" `-----'", channel)
elif command == "avedo":
self.send_message(" ]j TL", channel)
self.send_message(" ]j wL", channel)
self.send_message(" [L NYCLvLvLvLLLvLL]*I4 *v", channel)
self.send_message(" *LLvLLLLLLLLLLLLLLLLLLLLLLL?R", channel)
self.send_message("lLLLLLLLLLLLLLLLLLLLLLLLLLLLLLl", channel)
self.send_message("LLLLLLLLLLLLLLLLLLLLLLLLLLLLL?l", channel)
self.send_message("vv $|?[LLLLL?jQ$ *Uv", channel)
self.send_message("vL *LLLL? %Lv", channel)
self.send_message("v?I jLLLLL* jLL", channel)
self.send_message("vLLjE CLLLLLvLL?T *LLLL", channel)
self.send_message("[LvLLLLLLLLLL wLLLLLLLvLLvL@", channel)
self.send_message(" @LvLvvLLLLLLL[LLLLLLLLLvLj", channel)
| 56.868132 | 104 | 0.473237 | 454 | 5,175 | 5.171806 | 0.268722 | 0.224872 | 0.421635 | 0.515332 | 0.445911 | 0.366695 | 0.336031 | 0.318995 | 0.249148 | 0.203152 | 0 | 0.001783 | 0.349758 | 5,175 | 90 | 105 | 57.5 | 0.695988 | 0.02744 | 0 | 0 | 0 | 0.036145 | 0.321535 | 0.032412 | 0 | 0 | 0 | 0.011111 | 0 | 1 | 0.012048 | false | 0 | 0.012048 | 0 | 0.048193 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0f8e93d36e7df9a90ce2f74a5372516a26adc075 | 134 | py | Python | indexd/auth/errors.py | victorskl/gen3-indexd | c22ffb1f1472e0732d3b44cd39b1241ff8156cc6 | [
"Apache-2.0"
] | 11 | 2018-05-31T06:29:44.000Z | 2020-10-21T14:09:36.000Z | indexd/auth/errors.py | victorskl/gen3-indexd | c22ffb1f1472e0732d3b44cd39b1241ff8156cc6 | [
"Apache-2.0"
] | 171 | 2017-11-13T16:56:35.000Z | 2022-03-29T19:37:35.000Z | indexd/auth/errors.py | victorskl/gen3-indexd | c22ffb1f1472e0732d3b44cd39b1241ff8156cc6 | [
"Apache-2.0"
] | 25 | 2018-03-06T19:03:24.000Z | 2021-11-27T19:39:49.000Z | class AuthError(Exception):
"""
Base auth error.
"""
class AuthzError(Exception):
"""
Base authz error.
"""
| 12.181818 | 28 | 0.552239 | 12 | 134 | 6.166667 | 0.666667 | 0.351351 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.298507 | 134 | 10 | 29 | 13.4 | 0.787234 | 0.253731 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
7e776f428a89d21c8e38bc58d0467c401fd1418b | 796 | py | Python | algorithms/string_to_integer_atoi_test.py | kainonly/leetcode | 83a84ad48d517eb7f1377cb2a3aa3fe763da6627 | [
"MIT"
] | null | null | null | algorithms/string_to_integer_atoi_test.py | kainonly/leetcode | 83a84ad48d517eb7f1377cb2a3aa3fe763da6627 | [
"MIT"
] | null | null | null | algorithms/string_to_integer_atoi_test.py | kainonly/leetcode | 83a84ad48d517eb7f1377cb2a3aa3fe763da6627 | [
"MIT"
] | null | null | null | import unittest
from .string_to_integer_atoi import Solution
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.sol = Solution()
def test_example1(self):
self.assertEqual(self.sol.myAtoi('42'), 42)
def test_example2(self):
self.assertEqual(self.sol.myAtoi(' -42'), -42)
def test_example3(self):
self.assertEqual(self.sol.myAtoi('4193 with words'), 4193)
def test_example4(self):
self.assertEqual(self.sol.myAtoi('words and 987'), 0)
def test_example5(self):
self.assertEqual(self.sol.myAtoi('-91283472332'), -2147483648)
def test_example6(self):
self.assertEqual(self.sol.myAtoi('+-12'), 0)
def test_example7(self):
self.assertEqual(self.sol.myAtoi('+1'), 1)
| 26.533333 | 70 | 0.657035 | 102 | 796 | 5.029412 | 0.372549 | 0.095517 | 0.259259 | 0.31384 | 0.479532 | 0.479532 | 0.167641 | 0.167641 | 0.167641 | 0.167641 | 0 | 0.083333 | 0.201005 | 796 | 29 | 71 | 27.448276 | 0.72327 | 0 | 0 | 0 | 0 | 0 | 0.067839 | 0 | 0 | 0 | 0 | 0 | 0.35 | 1 | 0.4 | false | 0 | 0.1 | 0 | 0.55 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
0e315e02e12052c3534a613df71f3a116b3aa426 | 213 | py | Python | py/solns/karatsubaMultiply/karatsubaMultiply.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | 1 | 2022-01-26T16:33:45.000Z | 2022-01-26T16:33:45.000Z | py/solns/karatsubaMultiply/karatsubaMultiply.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | null | null | null | py/solns/karatsubaMultiply/karatsubaMultiply.py | zcemycl/algoTest | 9518fb2b60fd83c85aeb2ab809ff647aaf643f0a | [
"MIT"
] | 1 | 2022-01-26T16:35:44.000Z | 2022-01-26T16:35:44.000Z |
class Solution:
@staticmethod
def naive(a,b):
c = a*b
return c
@staticmethod
def primary(a,b):
c = 0
return c
@staticmethod
def karatsuba(a,b):
pass | 16.384615 | 23 | 0.507042 | 27 | 213 | 4 | 0.481481 | 0.074074 | 0.055556 | 0.407407 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007874 | 0.403756 | 213 | 13 | 24 | 16.384615 | 0.84252 | 0 | 0 | 0.416667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.083333 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
0e5069d69c62035cf2ec9fac81ffc2c2e18be990 | 87 | py | Python | Week1/Lecture2/Fexes/l2f5.py | MorbidValkyria/MIT6.0001x | 3c80ffd50871387f560c2e820ad1fa05c61d9132 | [
"MIT"
] | null | null | null | Week1/Lecture2/Fexes/l2f5.py | MorbidValkyria/MIT6.0001x | 3c80ffd50871387f560c2e820ad1fa05c61d9132 | [
"MIT"
] | null | null | null | Week1/Lecture2/Fexes/l2f5.py | MorbidValkyria/MIT6.0001x | 3c80ffd50871387f560c2e820ad1fa05c61d9132 | [
"MIT"
] | null | null | null | # Pretty simple, remember not to define happy
#if happy > 2:
# print("hello world") | 21.75 | 45 | 0.678161 | 13 | 87 | 4.538462 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014493 | 0.206897 | 87 | 4 | 46 | 21.75 | 0.84058 | 0.91954 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0e62bf3735bf8064635b5218478ff503d1d8cfdf | 130 | py | Python | pyretri/config/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 1,063 | 2020-04-21T12:42:05.000Z | 2022-03-31T06:32:50.000Z | pyretri/config/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 39 | 2020-05-07T07:24:19.000Z | 2022-02-02T23:49:23.000Z | pyretri/config/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 174 | 2020-04-26T04:33:11.000Z | 2022-03-17T02:58:45.000Z | # -*- coding: utf-8 -*-
from .config import setup_cfg, get_defaults_cfg
__all__ = [
'get_defaults_cfg',
'setup_cfg',
]
| 13 | 47 | 0.638462 | 17 | 130 | 4.294118 | 0.647059 | 0.219178 | 0.383562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009709 | 0.207692 | 130 | 9 | 48 | 14.444444 | 0.699029 | 0.161538 | 0 | 0 | 0 | 0 | 0.233645 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
0e91eb0c4b1d6002d23b798089ea315492c1861c | 438 | py | Python | codewars/8kyu/amrlotfy77/Remove First and Last Character/test_main.py | ictcubeMENA/Training_one | dff6bee96ba42babe4888e5cf9a9448a6fd93fc3 | [
"MIT"
] | null | null | null | codewars/8kyu/amrlotfy77/Remove First and Last Character/test_main.py | ictcubeMENA/Training_one | dff6bee96ba42babe4888e5cf9a9448a6fd93fc3 | [
"MIT"
] | 2 | 2019-01-22T10:53:42.000Z | 2019-01-31T08:02:48.000Z | codewars/8kyu/amrlotfy77/Remove First and Last Character/test_main.py | ictcubeMENA/Training_one | dff6bee96ba42babe4888e5cf9a9448a6fd93fc3 | [
"MIT"
] | 13 | 2019-01-22T10:37:42.000Z | 2019-01-25T13:30:43.000Z | import unittest
from main import remove_char
class Test_remove_char(unittest.TestCase):
def test(self):
self.assertEqual(remove_char('eloquent'), 'loquen')
self.assertEqual(remove_char('country'), 'ountr')
self.assertEqual(remove_char('person'), 'erso')
self.assertEqual(remove_char('place'), 'lac')
self.assertEqual(remove_char('ok'), '')
if __name__ == '__main__':
unittest.main() | 23.052632 | 59 | 0.66895 | 50 | 438 | 5.54 | 0.46 | 0.252708 | 0.379061 | 0.451264 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.182648 | 438 | 19 | 60 | 23.052632 | 0.773743 | 0 | 0 | 0 | 0 | 0 | 0.123007 | 0 | 0 | 0 | 0 | 0 | 0.454545 | 1 | 0.090909 | false | 0 | 0.181818 | 0 | 0.363636 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0ea3b84805ccd2049905a7e8bfcf442b2dcd768f | 3,256 | py | Python | tests/test_entrypoints/test_analyze.py | vgrabovets/benchmarkit | d59d3f2cf13a2bf6ddb2d4a7bccae17de17aca52 | [
"MIT"
] | 20 | 2019-05-22T20:02:27.000Z | 2021-06-27T12:44:58.000Z | tests/test_entrypoints/test_analyze.py | vgrabovets/benchmarkit | d59d3f2cf13a2bf6ddb2d4a7bccae17de17aca52 | [
"MIT"
] | 20 | 2019-05-24T17:01:39.000Z | 2020-03-10T18:00:01.000Z | tests/test_entrypoints/test_analyze.py | vgrabovets/benchmarkit | d59d3f2cf13a2bf6ddb2d4a7bccae17de17aca52 | [
"MIT"
] | 2 | 2019-10-13T13:22:00.000Z | 2020-03-10T16:58:53.000Z | from tests.settings import (
BENCHMARK_MODEL_OUTPUT_FILE, BENCHMARK_TIME_OUTPUT_FILE,
)
def test_entrypoint(script_runner):
result = script_runner.run(
'benchmark_analyze',
BENCHMARK_TIME_OUTPUT_FILE,
)
assert result.success
result = ' '.join(result.stdout.split())
expected = (
'File: [36mbenchmark_functions.jsonl[0m Function: '
'[36msearch_in_list[0m date time branch commit commit_date comment '
'best_time mean_time mean_time_diff [32m0 2019-05-09 10:59:52 master '
'b0f9ccc 2019-05-07 N=100 0.0033 0.0039 NaN[0m 1 2019-05-09 11:00:21 '
'master b0f9ccc 2019-05-07 N=1000 0.0126 0.0135 0.0096 2 2019-05-09 '
'11:00:46 master b0f9ccc 2019-05-07 N=10000 0.0993 0.1011 0.0876 '
'[31m3 2019-05-09 11:01:06 master b0f9ccc 2019-05-07 N=100000 0.9553 '
'1.0057 0.9046[0m ----------------------------------------------------'
'------------------------------------------------ '
'File: [36mbenchmark_functions.jsonl[0m Function: '
'[36msearch_in_set[0m date time branch commit commit_date comment '
'best_time mean_time mean_time_diff [32m0 2019-05-09 10:59:53 master '
'b0f9ccc 2019-05-07 N=100 0.0017 0.0025 NaN[0m 1 2019-05-09 11:00:22 '
'master b0f9ccc 2019-05-07 N=1000 0.0020 0.0026 0.0001 [31m2 '
'2019-05-09 11:00:47 master b0f9ccc 2019-05-07 N=10000 0.0022 '
'0.0028 0.0002[0m [31m3 2019-05-09 11:01:08 master b0f9ccc '
'2019-05-07 N=100000 0.0023 0.0028 0.0000[0m -------------------------'
'----------------------------------------------------------------------'
'----- File: [36mbenchmark_functions.jsonl[0m [36mTotal[0m date '
'time branch commit commit_date comment best_time mean_time '
'mean_time_diff [32m0 2019-05-09 10:59:52 master b0f9ccc 2019-05-07 '
'N=100 0.0050 0.0064 NaN[0m 1 2019-05-09 11:00:21 master b0f9ccc '
'2019-05-07 N=1000 0.0146 0.0161 0.0097 2 2019-05-09 11:00:46 master '
'b0f9ccc 2019-05-07 N=10000 0.1015 0.1039 0.0878 [31m3 2019-05-09 '
'11:01:06 master b0f9ccc 2019-05-07 N=100000 0.9576 1.0085 0.9046[0m '
'----------------------------------------------------------------------'
'------------------------------'
)
assert result == expected
result = script_runner.run(
'benchmark_analyze',
BENCHMARK_MODEL_OUTPUT_FILE,
'--metric=score',
'--bigger_is_better',
'--extra_fields=C',
)
assert result.success
result = ' '.join(result.stdout.split())
assert result == (
'File: [36mbenchmark_model.jsonl[0m Function: '
'[36mlog_regression[0m date time branch commit commit_date comment '
'best_time mean_time C score score_diff [32m0 2019-05-18 12:14:14 '
'master cd69686 2019-05-12 baseline model 67.4097 67.4097 1.0 0.973333 '
'NaN[0m [31m1 2019-05-18 12:14:14 master cd69686 2019-05-12 stronger '
'regularization 22.8525 22.8525 0.5 0.966667 -0.006667[0m '
'----------------------------------------------------------------------'
'--------------------------------------------------------'
)
| 48.597015 | 80 | 0.548526 | 487 | 3,256 | 3.63655 | 0.262834 | 0.094862 | 0.054207 | 0.128741 | 0.695088 | 0.673631 | 0.673631 | 0.612084 | 0.498024 | 0.464709 | 0 | 0.262442 | 0.210074 | 3,256 | 66 | 81 | 49.333333 | 0.412908 | 0 | 0 | 0.220339 | 0 | 0.237288 | 0.707924 | 0.190725 | 0 | 0 | 0 | 0 | 0.067797 | 1 | 0.016949 | false | 0 | 0.016949 | 0 | 0.033898 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
7eeb7075ef703d87e081120c6e7ea2995421bb62 | 131 | py | Python | examples/closure_basic.py | igfish/toyvm | bb1ab371a8c71ba01522556235fc9f017c9b6b8f | [
"MIT"
] | null | null | null | examples/closure_basic.py | igfish/toyvm | bb1ab371a8c71ba01522556235fc9f017c9b6b8f | [
"MIT"
] | null | null | null | examples/closure_basic.py | igfish/toyvm | bb1ab371a8c71ba01522556235fc9f017c9b6b8f | [
"MIT"
] | null | null | null | def foo(w):
print(w)
i = 5
def bar(v=9):
print(w)
print(i)
print(v)
return bar
foo(1)(2)
| 10.916667 | 17 | 0.419847 | 22 | 131 | 2.5 | 0.545455 | 0.218182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.053333 | 0.427481 | 131 | 11 | 18 | 11.909091 | 0.68 | 0 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0 | 0 | 0.333333 | 0.444444 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
7d293119fc8773da46a6c76242871d2420fa9173 | 164 | py | Python | HiggsAnalysis/Skimming/python/higgsToZZ4Leptons_SkimPaths_cff.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | HiggsAnalysis/Skimming/python/higgsToZZ4Leptons_SkimPaths_cff.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | HiggsAnalysis/Skimming/python/higgsToZZ4Leptons_SkimPaths_cff.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
from HiggsAnalysis.Skimming.higgsToZZ4Leptons_Sequences_cff import *
HZZFilterPath = cms.Path(higgsToZZ4LeptonsSequence)
| 27.333333 | 68 | 0.865854 | 17 | 164 | 8.235294 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013245 | 0.079268 | 164 | 5 | 69 | 32.8 | 0.913907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
7d354d352c928e60417abf617c8e619fb6af93b4 | 31 | py | Python | tests/helpers.py | perses76/ppc | 622cd2d7c47636fb848dd85a5c8b1382e302bc14 | [
"BSD-2-Clause"
] | null | null | null | tests/helpers.py | perses76/ppc | 622cd2d7c47636fb848dd85a5c8b1382e302bc14 | [
"BSD-2-Clause"
] | null | null | null | tests/helpers.py | perses76/ppc | 622cd2d7c47636fb848dd85a5c8b1382e302bc14 | [
"BSD-2-Clause"
] | null | null | null | """Helper untits for tests."""
| 15.5 | 30 | 0.645161 | 4 | 31 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129032 | 31 | 1 | 31 | 31 | 0.740741 | 0.774194 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
7d3eda341228684cdfd0e7f0dd1e797d5cde027c | 358 | py | Python | catalyst/dl/utils/scripts.py | sergeyshilin/catalyst | f4dfaac7bc3fe98b2a0a9cf0b4347b100750f82f | [
"Apache-2.0"
] | 3 | 2019-11-02T05:37:06.000Z | 2020-01-13T02:26:07.000Z | catalyst/dl/utils/scripts.py | sergeyshilin/catalyst | f4dfaac7bc3fe98b2a0a9cf0b4347b100750f82f | [
"Apache-2.0"
] | null | null | null | catalyst/dl/utils/scripts.py | sergeyshilin/catalyst | f4dfaac7bc3fe98b2a0a9cf0b4347b100750f82f | [
"Apache-2.0"
] | null | null | null | import pathlib
from catalyst.utils.scripts import import_module
def import_experiment_and_runner(expdir: pathlib.Path):
if not isinstance(expdir, pathlib.Path):
expdir = pathlib.Path(expdir)
m = import_module(expdir)
Experiment, Runner = m.Experiment, m.Runner
return Experiment, Runner
__all__ = ["import_experiment_and_runner"]
| 25.571429 | 55 | 0.75419 | 45 | 358 | 5.733333 | 0.422222 | 0.151163 | 0.197674 | 0.193798 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162011 | 358 | 13 | 56 | 27.538462 | 0.86 | 0 | 0 | 0 | 0 | 0 | 0.078212 | 0.078212 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.555556 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
adad13effaa674766d8d387a310194d85df53861 | 4,287 | py | Python | App/models.py | mr-liunian/AXF | 8f14c73f80efb20fda5c9745e26b49bf72dfbcd2 | [
"Apache-2.0"
] | null | null | null | App/models.py | mr-liunian/AXF | 8f14c73f80efb20fda5c9745e26b49bf72dfbcd2 | [
"Apache-2.0"
] | null | null | null | App/models.py | mr-liunian/AXF | 8f14c73f80efb20fda5c9745e26b49bf72dfbcd2 | [
"Apache-2.0"
] | null | null | null | import hashlib
from django.db import models
# Create your models here.
class Main(models.Model):
img = models.CharField(max_length=200)
name = models.CharField(max_length=100)
trackid = models.CharField(max_length=16)
class Meta:
abstract = True
class MainWheel(Main):
class Meta:
db_table = 'axf_wheel'
class MainNav(Main):
class Meta:
db_table = 'axf_nav'
class MainMustBuy(Main):
class Meta:
db_table = 'axf_mustbuy'
class MainShop(Main):
class Meta:
db_table = 'axf_shop'
'''(trackid,name,img,categoryid,brandname,img1,childcid1,productid1,
longname1,price1,marketprice1,img2,childcid2,productid2,longname2,
price2,marketprice2,img3,childcid3,productid3,longname3,price3,
marketprice3)'''
class MainShow(Main):
categoryid = models.CharField(max_length=16)
brandname = models.CharField(max_length=12)
img1 = models.CharField(max_length=200)
childcid1 = models.CharField(max_length=20)
productid1 = models.CharField(max_length=16)
longname1 = models.CharField(max_length=128)
price1 = models.FloatField(default=1)
marketprice1 = models.FloatField(default=2)
img2 = models.CharField(max_length=200)
childcid2 = models.CharField(max_length=20)
productid2 = models.CharField(max_length=16)
longname2 = models.CharField(max_length=128)
price2 = models.FloatField(default=1)
marketprice2 = models.FloatField(default=2)
img3 = models.CharField(max_length=200)
childcid3 = models.CharField(max_length=20)
productid3 = models.CharField(max_length=16)
longname3 = models.CharField(max_length=128)
price3 = models.FloatField(default=1)
marketprice3 = models.FloatField(default=2)
class Meta:
db_table = 'axf_mainshow'
class FoodType(models.Model):
typeid = models.CharField(max_length=16)
typename = models.CharField(max_length=32)
childtypenames = models.CharField(max_length=200)
typesort = models.IntegerField(default=2)
class Meta:
db_table = 'axf_foodtypes'
'''(productid,productimg,productname,productlongname,isxf,pmdesc,
specifics,price,marketprice,categoryid,childcid,childcidname,dealerid,
storenums,productnum)'''
class Goods(models.Model):
productid = models.CharField(max_length=16)
productimg = models.CharField(max_length=200)
productname = models.CharField(max_length=128)
productlongname = models.CharField(max_length=200)
isxf = models.BooleanField(default=True)
pmdesc = models.BooleanField(default=False)
specifics = models.CharField(max_length=32)
price = models.FloatField(default=0)
marketprice = models.FloatField(default=1)
categoryid = models.CharField(max_length=16)
childcid = models.CharField(max_length=16)
childcidname = models.CharField(max_length=32)
dealerid = models.CharField(max_length=32)
storenums = models.IntegerField(default=5)
productnum = models.IntegerField(default=10)
class Meta:
db_table = 'axf_goods'
class UserModel(models.Model):
u_name = models.CharField(max_length=16,unique=True)
u_password = models.CharField(max_length=256)
u_email = models.CharField(max_length=128,unique=True)
u_icon = models.ImageField(upload_to='icons')
is_delete = models.BooleanField(default=False)
is_active = models.BooleanField(default=False)
def set_password(self,password):
hash = hashlib.md5()
hash.update(password.encode('utf-8'))
result = hash.hexdigest()
self.u_password = result
def verify_password(self,password):
hash = hashlib.md5()
hash.update(password.encode('utf-8'))
result = hash.hexdigest()
return result == self.u_password
class CartModel(models.Model):
c_user = models.ForeignKey(UserModel)
c_goods = models.ForeignKey(Goods)
c_goods_num = models.IntegerField(default=1)
c_is_select = models.BooleanField(default=True)
class Order(models.Model):
o_user = models.ForeignKey(UserModel)
o_status = models.IntegerField(default=1)
o_get_time = models.DateTimeField(auto_now=True)
class OrderGoods(models.Model):
order = models.ForeignKey(Order)
goods = models.ForeignKey(Goods)
goods_num = models.IntegerField(default=1)
| 31.522059 | 70 | 0.725682 | 521 | 4,287 | 5.838772 | 0.253359 | 0.157791 | 0.189349 | 0.252465 | 0.398751 | 0.147272 | 0.071006 | 0.053254 | 0.053254 | 0.053254 | 0 | 0.037182 | 0.165617 | 4,287 | 135 | 71 | 31.755556 | 0.813251 | 0.005598 | 0 | 0.163265 | 0 | 0 | 0.021638 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.020408 | false | 0.071429 | 0.020408 | 0 | 0.846939 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
adae22e1fa0df029c96e3efbb7fe449fb8bff926 | 356 | py | Python | palogging/palog.py | 0x10F8/PasswordAnalyser | 854b723a3bd0f61abf24a70bb45a9d234a4cdbe4 | [
"MIT"
] | 1 | 2019-10-08T12:21:55.000Z | 2019-10-08T12:21:55.000Z | palogging/palog.py | 0x10F8/PasswordAnalyser | 854b723a3bd0f61abf24a70bb45a9d234a4cdbe4 | [
"MIT"
] | null | null | null | palogging/palog.py | 0x10F8/PasswordAnalyser | 854b723a3bd0f61abf24a70bb45a9d234a4cdbe4 | [
"MIT"
] | null | null | null | import colorama
def log(string):
print("[{0}+{1}] {2}".format(colorama.Fore.GREEN, colorama.Fore.RESET, string))
def warning_log(string):
print("[{0}?{1}] {2}".format(
colorama.Fore.YELLOW, colorama.Fore.RESET, string))
def error_log(string):
print("[{0}*{1}] {2}".format(
colorama.Fore.RED, colorama.Fore.RESET, string))
| 22.25 | 83 | 0.632022 | 49 | 356 | 4.55102 | 0.346939 | 0.32287 | 0.188341 | 0.201794 | 0.704036 | 0.470852 | 0.470852 | 0.470852 | 0.470852 | 0 | 0 | 0.03 | 0.157303 | 356 | 15 | 84 | 23.733333 | 0.713333 | 0 | 0 | 0 | 0 | 0 | 0.109551 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.111111 | 0 | 0.444444 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ade338151135ce10a70bfe59ad7151a51345c455 | 1,216 | py | Python | rl687/agents/fchc.py | purujitgoyal/rl-framework-687-public | c315ba64267b2f15aa18fe098259243bec521954 | [
"MIT"
] | 3 | 2019-09-11T01:35:31.000Z | 2019-09-20T00:23:35.000Z | rl687/agents/fchc.py | purujitgoyal/rl-framework-687-public | c315ba64267b2f15aa18fe098259243bec521954 | [
"MIT"
] | null | null | null | rl687/agents/fchc.py | purujitgoyal/rl-framework-687-public | c315ba64267b2f15aa18fe098259243bec521954 | [
"MIT"
] | 17 | 2019-09-12T02:16:40.000Z | 2019-10-06T18:32:48.000Z | import numpy as np
from .bbo_agent import BBOAgent
from typing import Callable
class FCHC(BBOAgent):
"""
First-choice hill-climbing (FCHC) for policy search is a black box optimization (BBO)
algorithm. This implementation is a variant of Russell et al., 2003. It has
remarkably fewer hyperparameters than CEM, which makes it easier to apply.
Parameters
----------
sigma (float): exploration parameter
theta (np.ndarray): initial mean policy parameter vector
numEpisodes (int): the number of episodes to sample per policy
evaluationFunction (function): evaluates a provided policy.
input: policy (np.ndarray: a parameterized policy), numEpisodes
output: the estimated return of the policy
"""
def __init__(self, theta:np.ndarray, sigma:float, evaluationFunction:Callable, numEpisodes:int=10):
self._name = "First_Choice_Hill_Climbing"
#TODO
pass
@property
def name(self)->str:
return self._name
@property
def parameters(self)->np.ndarray:
#TODO
pass
def train(self)->np.ndarray:
#TODO
pass
def reset(self)->None:
#TODO
pass
| 27.636364 | 103 | 0.657895 | 148 | 1,216 | 5.337838 | 0.560811 | 0.056962 | 0.037975 | 0.058228 | 0.060759 | 0.060759 | 0 | 0 | 0 | 0 | 0 | 0.006674 | 0.260691 | 1,216 | 43 | 104 | 28.27907 | 0.87208 | 0.503289 | 0 | 0.352941 | 0 | 0 | 0.048059 | 0.048059 | 0 | 0 | 0 | 0.023256 | 0 | 1 | 0.294118 | false | 0.235294 | 0.176471 | 0.058824 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
ade72ef725c784de7cdb7299cee30ba5f19d64b0 | 84 | py | Python | robolearn/utils/launchers/config.py | domingoesteban/robolearn | 0d20125425c352b80ef2eeed1c0b11ab6497b11a | [
"BSD-3-Clause"
] | 1 | 2020-01-13T09:44:22.000Z | 2020-01-13T09:44:22.000Z | robolearn/utils/launchers/config.py | domingoesteban/robolearn | 0d20125425c352b80ef2eeed1c0b11ab6497b11a | [
"BSD-3-Clause"
] | null | null | null | robolearn/utils/launchers/config.py | domingoesteban/robolearn | 0d20125425c352b80ef2eeed1c0b11ab6497b11a | [
"BSD-3-Clause"
] | 1 | 2021-12-22T00:41:20.000Z | 2021-12-22T00:41:20.000Z | # Change this
# LOCAL_LOG_DIR = '/tmp/rlkit/'
LOCAL_LOG_DIR = '/home/desteban/logs'
| 21 | 37 | 0.714286 | 13 | 84 | 4.307692 | 0.769231 | 0.285714 | 0.392857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119048 | 84 | 3 | 38 | 28 | 0.756757 | 0.488095 | 0 | 0 | 0 | 0 | 0.475 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
bc13676fdee903eb020ae261e510d85a9e6572d9 | 471 | py | Python | tests/test_graphical_units/test_polyhedra.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | 2 | 2022-03-31T08:31:00.000Z | 2022-03-31T08:31:43.000Z | tests/test_graphical_units/test_polyhedra.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | 21 | 2022-03-02T15:25:49.000Z | 2022-03-07T11:15:45.000Z | tests/test_graphical_units/test_polyhedra.py | DD2480-Group-10/manim | e147a9fc6c117332221e42437481f3efba76499a | [
"MIT"
] | null | null | null | from __future__ import annotations
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
__module_test__ = "polyhedra"
@frames_comparison
def test_Tetrahedron(scene):
scene.add(Tetrahedron())
@frames_comparison
def test_Octahedron(scene):
scene.add(Octahedron())
@frames_comparison
def test_Icosahedron(scene):
scene.add(Icosahedron())
@frames_comparison
def test_Dodecahedron(scene):
scene.add(Dodecahedron())
| 17.444444 | 67 | 0.787686 | 55 | 471 | 6.4 | 0.345455 | 0.272727 | 0.215909 | 0.261364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121019 | 471 | 26 | 68 | 18.115385 | 0.850242 | 0 | 0 | 0.25 | 0 | 0 | 0.019108 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.1875 | 0 | 0.4375 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
bc1420c7fdd89d0636b3af7e0fb9e8627cb06803 | 29 | py | Python | api/__init__.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 5 | 2019-07-01T17:50:44.000Z | 2022-02-20T02:44:42.000Z | api/__init__.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 3 | 2020-06-05T21:44:33.000Z | 2021-06-10T21:39:26.000Z | api/__init__.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 1 | 2021-12-09T06:32:40.000Z | 2021-12-09T06:32:40.000Z | """API app for EveryVoter"""
| 14.5 | 28 | 0.655172 | 4 | 29 | 4.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 29 | 1 | 29 | 29 | 0.76 | 0.758621 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
bc33dae7205ae4f7c899c39b88b0d49935f9c442 | 139 | py | Python | tests/asp/AllAnswerSets/aggregates/count.example15.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/AllAnswerSets/aggregates/count.example15.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/AllAnswerSets/aggregates/count.example15.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
1 2 3 2 3 4 5
1 3 3 2 2 4 5
1 4 3 2 2 3 5
1 5 0 0
2 6 3 0 3 2 3 4
1 1 1 1 6
0
4 c
3 b
2 a
0
B+
0
B-
1
0
1
"""
output = """
"""
| 6.318182 | 15 | 0.453237 | 54 | 139 | 1.166667 | 0.222222 | 0.126984 | 0.095238 | 0.126984 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.594937 | 0.431655 | 139 | 21 | 16 | 6.619048 | 0.202532 | 0 | 0 | 0.095238 | 0 | 0 | 0.776978 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
bc3e17ec2b5c08896685581c36134416624326b4 | 256 | py | Python | modules/core.py | Okma/BroBot | 0e46128736847ce949e8f32497f29f15ea17dd96 | [
"Apache-2.0"
] | null | null | null | modules/core.py | Okma/BroBot | 0e46128736847ce949e8f32497f29f15ea17dd96 | [
"Apache-2.0"
] | 4 | 2021-06-01T23:39:43.000Z | 2021-06-28T21:03:47.000Z | modules/core.py | Okma/BroBot | 0e46128736847ce949e8f32497f29f15ea17dd96 | [
"Apache-2.0"
] | null | null | null | from discord import Guild, VoiceChannel
import env
from modules import bot
def get_guild() -> Guild:
return bot.get_guild(int(env.guild_id))
def get_members_channel(guild: Guild) -> VoiceChannel:
return guild.get_channel(int(env.member_channel_id))
| 19.692308 | 54 | 0.785156 | 39 | 256 | 4.948718 | 0.410256 | 0.176166 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121094 | 256 | 12 | 55 | 21.333333 | 0.857778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.428571 | 0.285714 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
70acda96e7e0d5cc4cf7483e9a4cd4eeb59d7e56 | 649 | py | Python | app/dependencies.py | cuthbeorht/todo | e3970a7be856fa5243b0f0c2b6aac755d0ef4d2a | [
"Apache-2.0"
] | null | null | null | app/dependencies.py | cuthbeorht/todo | e3970a7be856fa5243b0f0c2b6aac755d0ef4d2a | [
"Apache-2.0"
] | 8 | 2022-01-09T01:55:28.000Z | 2022-03-06T21:13:30.000Z | app/dependencies.py | cuthbeorht/todo | e3970a7be856fa5243b0f0c2b6aac755d0ef4d2a | [
"Apache-2.0"
] | null | null | null | from sqlalchemy.ext.asyncio import AsyncSession
from app.database import async_sessionmaker
from fastapi import Depends
from app.repositories.todos import TodoRepository
from app.services.todos import Service as TodoService
async def sql_session() -> AsyncSession:
async with async_sessionmaker() as session:
yield session
await session.close()
# Todo Related dependencies
async def todo_repository(db: AsyncSession = Depends(sql_session)) -> TodoRepository:
return TodoRepository(db)
async def todo_service(repository: TodoRepository = Depends(todo_repository)) -> TodoService:
return TodoService(repository)
| 24.961538 | 93 | 0.784284 | 75 | 649 | 6.693333 | 0.426667 | 0.041833 | 0.047809 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152542 | 649 | 25 | 94 | 25.96 | 0.912727 | 0.038521 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0 | 1 | 0 | true | 0 | 0.384615 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
70e57c490b310000b41f6b7644ac53373322987e | 82 | py | Python | show.py | N3mT3nta/Projetos | 0887a63d9f248caef4c5f7e61669384a2540a38f | [
"MIT"
] | null | null | null | show.py | N3mT3nta/Projetos | 0887a63d9f248caef4c5f7e61669384a2540a38f | [
"MIT"
] | null | null | null | show.py | N3mT3nta/Projetos | 0887a63d9f248caef4c5f7e61669384a2540a38f | [
"MIT"
] | null | null | null | from random import randint
while True:
print(f'\033[3{randint(1, 9)}mShow!')
| 16.4 | 41 | 0.682927 | 14 | 82 | 4 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 0.158537 | 82 | 4 | 42 | 20.5 | 0.724638 | 0 | 0 | 0 | 0 | 0 | 0.329268 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
70f17da9f23373ef634f72e5ae668b9adb7bf804 | 3,147 | py | Python | examples/keystore/interfaces.py | nirs/py-lmdb | 5341338964c0fe34eb29020cb7ca2716c22475d9 | [
"OLDAP-2.8"
] | 241 | 2015-01-06T07:12:08.000Z | 2019-06-08T19:20:27.000Z | examples/keystore/interfaces.py | nirs/py-lmdb | 5341338964c0fe34eb29020cb7ca2716c22475d9 | [
"OLDAP-2.8"
] | 119 | 2015-02-16T08:56:00.000Z | 2019-06-08T01:00:12.000Z | examples/keystore/interfaces.py | nirs/py-lmdb | 5341338964c0fe34eb29020cb7ca2716c22475d9 | [
"OLDAP-2.8"
] | 61 | 2015-02-04T08:19:31.000Z | 2019-06-07T18:14:24.000Z |
from __future__ import absolute_import
import zope.interface
class IKeyStoreSync(zope.interface.Interface):
def get(key):
"""
Fetch a key
@return None or bytestring value.
"""
def put(key, value):
"""
Create or overwrite a key.
@param key Bytestring key.
@param value Bytestring alue.
@return deferred producing None or error.
"""
def delete(key):
"""
Delete a key.
@param key Bytestring key.
@return deferred producing None or error.
"""
def seek(key):
"""
Seek to a key, or the next highest key.
@param key Bytestring key.
"""
def first():
"""
Seek to the first key in the store.
@return True if positioned on a key.
"""
def last():
"""
Seek to the last key in the store.
@return True if positioned on a key.
"""
def next():
"""
Seek to the next key in the store.
@return True if positioned on a key.
"""
def prev():
"""
Seek to the previous key in the store.
@return True if positioned on a key.
"""
class IKeyStore(zope.interface.Interface):
def get(key):
"""
Fetch a key.
@return deferred producing None or bytestring value.
"""
def getKeys(key, count):
"""
Fetch a list of keys.
@param key
Bytestring first key to return, or None for first/last key
in space.
@param count Number of keys including first key to return.
"""
def getKeysReverse(key, count):
"""
Fetch a list of keys, walking in reverse.
@param key
Bytestring first key to return, or None for first/last key
in space.
@param count Number of keys including first key to return.
"""
def getItems(key, count):
"""
Fetch a list of (key, value) tuples.
@param key
Bytestring first key to return, or None for first/last key
in space.
@param count Number of keys including first key to return.
"""
def getItemsReverse(key, count):
"""
Fetch a list of (key, value) tuples.
@param key
Bytestring first key to return, or None for first/last key
in space.
@param count Number of keys including first key to return.
"""
def put(key):
"""
Create or overwrite a key.
@param key Bytestring key.
@param value Bytestring alue.
@return deferred producing None or error.
"""
def delete(key):
"""
Delete a key.
@param key Bytestring key.
@return deferred producing None or error.
"""
def putGroup(func):
"""
Execute a function in the context of synchronous (IKeyStoreSync)
transaction, in a private thread.
@param func Function accepting IKeyStoreSync parameter.
@returns deferred producing None or error.
"""
| 24.97619 | 72 | 0.548777 | 375 | 3,147 | 4.592 | 0.186667 | 0.025552 | 0.094077 | 0.074332 | 0.75842 | 0.703833 | 0.690476 | 0.662602 | 0.662602 | 0.662602 | 0 | 0 | 0.372418 | 3,147 | 125 | 73 | 25.176 | 0.871899 | 0.57674 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.8 | false | 0 | 0.1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
cb16fba592e0a2c039cc810b25e1c7db64991366 | 102 | py | Python | sandero.py | CptShock/AuroraModules | 4503326384ed34312be9d1d0f52242f1f8774eeb | [
"MIT"
] | null | null | null | sandero.py | CptShock/AuroraModules | 4503326384ed34312be9d1d0f52242f1f8774eeb | [
"MIT"
] | null | null | null | sandero.py | CptShock/AuroraModules | 4503326384ed34312be9d1d0f52242f1f8774eeb | [
"MIT"
] | null | null | null | import willie
@willie.module.commands('sandero')
def sander(bot, trigger):
bot.say('PORN PORN PORN') | 20.4 | 34 | 0.745098 | 15 | 102 | 5.066667 | 0.733333 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.098039 | 102 | 5 | 35 | 20.4 | 0.826087 | 0 | 0 | 0 | 0 | 0 | 0.203884 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 4 |
cb8734628f63fdc7905f1af2233f8aa3b3000c92 | 2,518 | py | Python | huxley/core/migrations/0023_auto_20170809_1436.py | srisainachuri/huxley | 7166a1423e49b506d6d5f142c748eac4e5d2314c | [
"BSD-3-Clause"
] | 18 | 2015-07-12T00:55:51.000Z | 2021-12-13T15:41:06.000Z | huxley/core/migrations/0023_auto_20170809_1436.py | srisainachuri/huxley | 7166a1423e49b506d6d5f142c748eac4e5d2314c | [
"BSD-3-Clause"
] | 288 | 2015-01-13T23:05:09.000Z | 2022-03-25T17:35:36.000Z | huxley/core/migrations/0023_auto_20170809_1436.py | srisainachuri/huxley | 7166a1423e49b506d6d5f142c748eac4e5d2314c | [
"BSD-3-Clause"
] | 47 | 2015-05-12T15:39:57.000Z | 2022-03-30T09:12:48.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-09 14:36
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0022_auto_20170806_2350'),
]
operations = [
migrations.AlterModelOptions(
name='countrypreference',
options={'ordering': ['-registration', 'rank']},
),
migrations.RemoveField(
model_name='assignment',
name='school',
),
migrations.RemoveField(
model_name='school',
name='advanced_delegates',
),
migrations.RemoveField(
model_name='school',
name='assignments_finalized',
),
migrations.RemoveField(
model_name='school',
name='beginner_delegates',
),
migrations.RemoveField(
model_name='school',
name='chinese_speaking_delegates',
),
migrations.RemoveField(
model_name='school',
name='committeepreferences',
),
migrations.RemoveField(
model_name='school',
name='countrypreferences',
),
migrations.RemoveField(
model_name='school',
name='fees_owed',
),
migrations.RemoveField(
model_name='school',
name='fees_paid',
),
migrations.RemoveField(
model_name='school',
name='intermediate_delegates',
),
migrations.RemoveField(
model_name='school',
name='modified_at',
),
migrations.RemoveField(
model_name='school',
name='registered',
),
migrations.RemoveField(
model_name='school',
name='registration_comments',
),
migrations.RemoveField(
model_name='school',
name='spanish_speaking_delegates',
),
migrations.RemoveField(
model_name='school',
name='waitlist',
),
migrations.RemoveField(
model_name='school',
name='waivers_completed',
),
migrations.AlterUniqueTogether(
name='countrypreference',
unique_together=set([('country', 'registration')]),
),
migrations.RemoveField(
model_name='countrypreference',
name='school',
),
]
| 27.369565 | 63 | 0.530183 | 185 | 2,518 | 7.005405 | 0.367568 | 0.275463 | 0.341049 | 0.393519 | 0.516204 | 0.516204 | 0.26929 | 0.087963 | 0 | 0 | 0 | 0.020408 | 0.357824 | 2,518 | 91 | 64 | 27.67033 | 0.781076 | 0.027006 | 0 | 0.654762 | 1 | 0 | 0.199428 | 0.056804 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.02381 | 0 | 0.059524 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
cba6a8c8034d63434d8bb9fc1f4b1f094d4bdbe9 | 213 | py | Python | Uche Clare/Phase 1/Python Basic 1/Day 8/Task 64.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Uche Clare/Phase 1/Python Basic 1/Day 8/Task 64.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Uche Clare/Phase 1/Python Basic 1/Day 8/Task 64.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | #program to get file creation and modification date/times.
import os.path, time
print("Last modified: %s" % time.ctime(os.path.getmtime("Anaconda")))
print("Created: %s" % time.ctime(os.path.getctime("Anaconda"))) | 53.25 | 69 | 0.737089 | 32 | 213 | 4.90625 | 0.6875 | 0.11465 | 0.127389 | 0.152866 | 0.203822 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.089202 | 213 | 4 | 70 | 53.25 | 0.809278 | 0.267606 | 0 | 0 | 0 | 0 | 0.282051 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0.666667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 4 |
cbb1a740c213433b4e11a92c0c7b5567bd63b74f | 111 | py | Python | download_model.py | gmeher/coldstart | f7509837143dda0b5776d5e7f007335925887ac2 | [
"MIT"
] | 2 | 2020-03-29T09:09:18.000Z | 2020-05-17T20:46:21.000Z | download_model.py | gmeher/coldstart | f7509837143dda0b5776d5e7f007335925887ac2 | [
"MIT"
] | 8 | 2020-09-07T17:34:47.000Z | 2022-02-26T20:32:13.000Z | download_model.py | gmeher/coldstart | f7509837143dda0b5776d5e7f007335925887ac2 | [
"MIT"
] | 2 | 2019-10-17T17:44:09.000Z | 2020-04-16T16:29:01.000Z | from keras import applications
model = applications.mobilenet.MobileNet()
model.save('./mobilenet-model.h5')
| 18.5 | 42 | 0.783784 | 13 | 111 | 6.692308 | 0.615385 | 0.321839 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009901 | 0.09009 | 111 | 5 | 43 | 22.2 | 0.851485 | 0 | 0 | 0 | 0 | 0 | 0.18018 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 4 |
1dac4329351dd264c91bae66eb235bce7eb77acd | 33 | py | Python | bayes_filters/particle_filters/__init__.py | wenh06/bayes_filters | 6c9fadf0f84d0a960fde1fd2e15fc198db398613 | [
"MIT"
] | null | null | null | bayes_filters/particle_filters/__init__.py | wenh06/bayes_filters | 6c9fadf0f84d0a960fde1fd2e15fc198db398613 | [
"MIT"
] | null | null | null | bayes_filters/particle_filters/__init__.py | wenh06/bayes_filters | 6c9fadf0f84d0a960fde1fd2e15fc198db398613 | [
"MIT"
] | null | null | null | """
Module: particle_filters
"""
| 8.25 | 24 | 0.666667 | 3 | 33 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 33 | 3 | 25 | 11 | 0.724138 | 0.727273 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
1db67c56fda844d2bcf03d5babed83ac392e0020 | 120 | py | Python | tophat/utils/log.py | JasonTam/tophat | ab0fc93f9caa319698db00de1586012f4049d7c1 | [
"MIT"
] | 2 | 2019-06-29T17:05:36.000Z | 2020-11-02T04:00:37.000Z | tophat/utils/log.py | JasonTam/tophat | ab0fc93f9caa319698db00de1586012f4049d7c1 | [
"MIT"
] | null | null | null | tophat/utils/log.py | JasonTam/tophat | ab0fc93f9caa319698db00de1586012f4049d7c1 | [
"MIT"
] | 1 | 2021-01-26T12:51:15.000Z | 2021-01-26T12:51:15.000Z | import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
logger.setLevel(level=logging.INFO)
| 24 | 39 | 0.825 | 15 | 120 | 6.6 | 0.533333 | 0.242424 | 0.323232 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058333 | 120 | 4 | 40 | 30 | 0.876106 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.