hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b8f234408750b227769b34d83859898e7d7d93c4 | 2,742 | py | Python | test_model.py | bsolano/Alzheimer-Resnets | b7b4f0d240f932513ef3427924894358b87dd68f | [
"MIT"
] | 3 | 2020-04-01T08:13:31.000Z | 2020-10-30T01:01:41.000Z | test_model.py | bsolano/Alzheimer-Resnets | b7b4f0d240f932513ef3427924894358b87dd68f | [
"MIT"
] | null | null | null | test_model.py | bsolano/Alzheimer-Resnets | b7b4f0d240f932513ef3427924894358b87dd68f | [
"MIT"
] | 1 | 2021-01-27T11:46:49.000Z | 2021-01-27T11:46:49.000Z | # encoding: utf-8
"""
The main implementation.
"""
import sys
from lib.functions import get_test_predicted
from lib.functions import print_info_and_plots
from models.densenet import densenet121
from adni_dataset import NumpyADNI_Dataset
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from tor... | 34.275 | 101 | 0.688184 |
b827beb9789d62a5df9f3d5fe601605ca11459a7 | 1,254 | py | Python | scripts/fuzzing/merge_corpus.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/fuzzing/merge_corpus.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/fuzzing/merge_corpus.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import sys
from lib.args import Args
from lib.cipd import Cipd
from lib.corpus import Corpus
from lib.devi... | 27.866667 | 80 | 0.6563 |
b23163fbfec2fefeb9334f0d72b7f74df2350f87 | 544 | py | Python | python/contextlib/contextlib_exitstack_callbacks_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/contextlib/contextlib_exitstack_callbacks_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/contextlib/contextlib_exitstack_callbacks_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """
Callbacks make a convenient way to clearly define cleanup logic without
the overhead of creating a new context manager class.
To improve code readability, that logic can be encapsulated in an
inline function, and callback() can be used as a decorator.
"""
import contextlib
with contextlib.ExitStack() as stack:
... | 30.222222 | 71 | 0.731618 |
b290a812bbb42c02ca4a32436c3147dd29f9661e | 569 | py | Python | exercises/pt/solution_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/pt/solution_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.tokens import Span
nlp = spacy.blank("en")
doc1 = nlp("i went to amsterdem last year and the canals were beautiful")
doc1.ents = [Span(doc1, 3, 4, label="GPE")]
doc2 = nlp("You should visit Paris once, but the Eiffel Tower is kinda boring")
doc2.ents = [Span(doc2, 3, 4, label="GPE")]
doc3 = ... | 33.470588 | 83 | 0.683656 |
a2f71a3fd8692cfcbc940ccd285775ca7e45f125 | 302 | py | Python | data_tests/saved__backend__/numba/add_inline.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/numba/add_inline.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__py3.9/numba/add_inline.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | # __protected__ from numba import njit
# __protected__ @njit(cache=True, fastmath=True)
def add(a, b):
return a + b
# __protected__ @njit(cache=True, fastmath=True)
def use_add(n=10000):
tmp = 0
for _ in range(n):
tmp = add(tmp, 1)
return tmp
__transonic__ = ("0.4.7",)
| 15.1 | 48 | 0.63245 |
a76e639ccd1999dd6ad4dffe9ddd06ffe58a7653 | 878 | py | Python | listings/chapter08/neural-network-sklearn-mnist.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter08/neural-network-sklearn-mnist.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter08/neural-network-sklearn-mnist.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import csv
from sklearn.datasets import load_digits
from sklearn.neural_network import MLPClassifier
from sklearn.model_selection import train_test_split
X_train = []
y_train = []
X_test = []
y_test = []
with open('mnist_train.csv', 'r') as train_file:
for line in csv.reader(train_file, quoting=csv.QUOTE_NONNUMERI... | 29.266667 | 69 | 0.722096 |
ce1cf7f06c5273bbbef4e3bcee696778673de9aa | 1,901 | py | Python | DSTN/Crackme 2/Solution/F9/executeUntilWorks.py | apuromafo/RCE_Lab | f74b49030e96e6b74ce6047401c7795e0a4e9669 | [
"MIT"
] | 43 | 2018-01-19T03:20:49.000Z | 2022-01-03T15:30:43.000Z | DSTN/Crackme 2/Solution/F9/executeUntilWorks.py | apuromafo/RCE_Lab | f74b49030e96e6b74ce6047401c7795e0a4e9669 | [
"MIT"
] | 1 | 2018-05-28T13:34:49.000Z | 2018-05-28T13:34:49.000Z | DSTN/Crackme 2/Solution/F9/executeUntilWorks.py | apuromafo/RCE_Lab | f74b49030e96e6b74ce6047401c7795e0a4e9669 | [
"MIT"
] | 18 | 2018-05-04T23:03:27.000Z | 2021-03-08T20:29:45.000Z | #-*- coding: utf-8 -*-
import os
import sys
import idc
import idaapi
import idautils
import time
API_FUNC_TO_BP_NAME = "j_VirtualAlloc"
START_FUNC_NAME = "start"
VALUE_TO_GET = 0x400000
NumberOfErrors = 0
def getAddrOfFunctionInCode(func_name):
'''
Obtener la referencia en código de una función
@param func_name: ... | 23.469136 | 81 | 0.734876 |
65f00068a3ea4a044ff3eb96b5bbad83c857c9fc | 287 | py | Python | nz_crawl_demo/day2/requests/proxy.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/requests/proxy.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day2/requests/proxy.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | import requests
import json
url = "http://www.httpbin.org/ip"
headers = {
'User-Agent':"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0"
}
proxy = {
'http':'58.22.204.55:9999'
}
res = requests.get(url=url,headers=headers,proxies=proxy)
print(res.text)
| 20.5 | 91 | 0.679443 |
e7e698d46b105a24fada341b6d605274038370e0 | 1,191 | py | Python | simple-sklearn-demo/test4/irisTest2.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-sklearn-demo/test4/irisTest2.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-sklearn-demo/test4/irisTest2.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | """
交叉验证 cross validation
多次更换不同的测试集和验证集, 取平均值作为最终结果
网格搜索 grid search
遍历可能的k值, 进行交叉验证, 最终得出最合适的k值
"""
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_select... | 28.357143 | 81 | 0.721243 |
f07aa980205f181bda8eca0d8506874ff3231e3f | 819 | py | Python | login_sch_net.py | DiDongDongDi/schnet | 379a68dae3e2646310366ad329a9ff9215af786a | [
"MIT"
] | 4 | 2019-09-25T07:31:59.000Z | 2019-09-29T12:47:20.000Z | login_sch_net.py | DiDongDongDi/schnet | 379a68dae3e2646310366ad329a9ff9215af786a | [
"MIT"
] | null | null | null | login_sch_net.py | DiDongDongDi/schnet | 379a68dae3e2646310366ad329a9ff9215af786a | [
"MIT"
] | 1 | 2020-11-28T07:41:55.000Z | 2020-11-28T07:41:55.000Z | import requests
try:
requests.get('https://www.baidu.com/', timeout=0.5)
except Exception:
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36'
}
data = {
'action': 'login',
'ac_id': '3',
... | 28.241379 | 133 | 0.59707 |
e8ef4b28ba8c3f4283291b2ce903194b34e149ef | 790 | py | Python | leetcode/052-N-Queens-II/NQueens_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/052-N-Queens-II/NQueens_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/052-N-Queens-II/NQueens_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def totalNQueens(self, n):
"""
:type n: int
:rtype: int
"""
if n < 1:
return []
res = self.search(n, [])
return len(res)
def isValid(self, cols, row):
m = len(cols)
for i in range(m):
if abs(... | 23.235294 | 43 | 0.41519 |
043020c76766a8461ce3d4e6c9a1de9cdaf376ab | 1,743 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex13_excel_magic.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex13_excel_magic.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex13_excel_magic.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def generate_following_values(current_value, sequence_length):
result = []
while sequence_length > 0:
result.append(current_value)
current_value += 1
sequence_length -= 1
return result
def g... | 27.666667 | 89 | 0.659208 |
0b17f20ea22c02c7e23a63d80dec3816be550ee9 | 10,900 | py | Python | research/nlp/senta/infer/util/data_processor_seq.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/senta/infer/util/data_processor_seq.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/senta/infer/util/data_processor_seq.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 35.973597 | 100 | 0.439908 |
0b1d2b29470c8051c080fcf4d7552976b5741866 | 557 | py | Python | exercises/fr/test_02_05_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/test_02_05_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/test_02_05_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"from spacy.tokens import Doc" in __solution__
), "Importes-tu correctement la classe Doc ?"
assert (
len(spaces) == 5
), "Il semble que le nombre d'espaces ne correspond pas au nombre de mots."
assert all(isinstance(s, bool) for s in spaces), "Les espaces doiven... | 46.416667 | 97 | 0.640934 |
c59d64aa2f383b6293496f3632c0c527b21b0ef7 | 383 | py | Python | python/coding_dojang/decorator_variable_argument.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/decorator_variable_argument.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/decorator_variable_argument.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def trace(func):
def wrapper(*args, **kwargs):
r = func(*args, **kwargs)
print('{0}(args={1}, kwargs={2}) -> {3}'.format(func.__name__, args, kwargs, r))
return r
return wrapper
@trace
def get_max(*args):
return max(args)
@trace
def get_min(**kwargs):
return min(kwargs.value... | 17.409091 | 88 | 0.590078 |
c5e623c3de8bdd48593c810837bf20bd6f75fc7e | 155 | py | Python | tools/parentdir.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | tools/parentdir.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | tools/parentdir.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | """Add parent directory to sys.path for module importing"""
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parents[1]))
| 25.833333 | 59 | 0.76129 |
a8d6db44c4595245bf9a43813833de8e3f53e3fd | 1,525 | py | Python | packages/watchmen-cli/src/watchmen_cli/main.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-cli/src/watchmen_cli/main.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-cli/src/watchmen_cli/main.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Optional
from watchmen_cli.common.constants import MixedImportType
from watchmen_cli.common.exception import ConfigException
from watchmen_cli.service import Deployment
from watchmen_cli.settings import settings
class CommandLineInterfaces:
@staticmethod
def deploy_asset():
if set... | 42.361111 | 120 | 0.677377 |
4f39b32854267f16ca4987f4c50831ee917173cf | 15,197 | py | Python | Packs/Smokescreen_IllusionBLACK/Integrations/Smokescreen_IllusionBLACK/Smokescreen_IllusionBLACK.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Smokescreen_IllusionBLACK/Integrations/Smokescreen_IllusionBLACK/Smokescreen_IllusionBLACK.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Smokescreen_IllusionBLACK/Integrations/Smokescreen_IllusionBLACK/Smokescreen_IllusionBLACK.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from datetime import timezone
from typing import List, Dict, Any
import json
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
class Client(BaseClient):
"""
Client will implement the service API, and shoul... | 38.669211 | 120 | 0.602751 |
8c32c9ffb7c5de7c2ca26c54f005c922b95abf1a | 15,771 | py | Python | src/Sephrasto/CharakterEquipmentWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterEquipmentWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterEquipmentWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 10 17:25:53 2017
@author: Lennart
"""
from Wolke import Wolke
import UI.CharakterEquipment
from PyQt5 import QtWidgets, QtCore
import Objekte
import Definitionen
from WaffenPicker import WaffenPicker
from RuestungPicker import RuestungPicker
import logging
from Hilfsmetho... | 39.825758 | 178 | 0.582905 |
ba297302d608aa2ac1e3889ed240fcb1237c2d7f | 1,651 | py | Python | UI.py | Tordja/VVS-Kalkulator | eb83454998bdd8b42363ad45ad3346dfd0fc3e9d | [
"MIT"
] | null | null | null | UI.py | Tordja/VVS-Kalkulator | eb83454998bdd8b42363ad45ad3346dfd0fc3e9d | [
"MIT"
] | null | null | null | UI.py | Tordja/VVS-Kalkulator | eb83454998bdd8b42363ad45ad3346dfd0fc3e9d | [
"MIT"
] | null | null | null | import Ventilasjonskalkulator as VK
from tkinter import *
class Kalkulatorvindu:
def __init__(self, root):
self.root = root
self.entry_value = StringVar(root, value="")
root.title("Kanalkalkulator")
root.geometry("700x50")
self.quitButton = Button(root, ... | 26.629032 | 81 | 0.621442 |
e85c30ed11e2a09eb098e9441f60d1049b72ef48 | 298 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/bldcontrol/admin.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/bldcontrol/admin.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/bldcontrol/admin.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #
# SPDX-License-Identifier: GPL-2.0-only
#
from django.contrib import admin
from django.contrib.admin.filters import RelatedFieldListFilter
from .models import BuildEnvironment
class BuildEnvironmentAdmin(admin.ModelAdmin):
pass
admin.site.register(BuildEnvironment, BuildEnvironmentAdmin)
| 22.923077 | 63 | 0.825503 |
fa1867b5feea4efa9f9c558d5714c1f4ae552a34 | 405 | py | Python | RasPi/gpioswitch.py | Jugendhackt/SMocket | 6aa495f3052c85f503ebf0e81b3ee5799cea37b2 | [
"MIT"
] | null | null | null | RasPi/gpioswitch.py | Jugendhackt/SMocket | 6aa495f3052c85f503ebf0e81b3ee5799cea37b2 | [
"MIT"
] | null | null | null | RasPi/gpioswitch.py | Jugendhackt/SMocket | 6aa495f3052c85f503ebf0e81b3ee5799cea37b2 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
import sys
from time import sleep
ident = int(sys.argv[1])
value = int(sys.argv[2])
GPIO.setmode(GPIO.BCM)
dic = [[17, 27], [15, 18], [27, 22]]
pair = dic[ident-1]
print(pair)
if value == 0:
pin = pair[1]
elif value == 1:
pin = pair[0]
print(pin)
GPIO.setup(pi... | 15 | 37 | 0.6 |
fa4d5393835edb089113907549a0fe1d60d4df8a | 590 | py | Python | rabbitmq/tutorial/emit_log_topic.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/emit_log_topic.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/emit_log_topic.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pika
import sys
credentials = pika.PlainCredentials('admin', '1q2w3e')
parameters = pika.ConnectionParameters('192.168.1.197', 5672, '/', credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.exchange_declare(exchange='topic_logs', exchange_type='topic')
routing_... | 34.705882 | 79 | 0.747458 |
fa656a31ef2a1cffe8861143271d602bc592b5af | 15,498 | py | Python | UserInterface/DataVisualizer.py | Robsen01/Brain_Interface | 2525dc5e90bc5ac6b67f8f596fdf26a9ae6b391e | [
"Apache-2.0"
] | null | null | null | UserInterface/DataVisualizer.py | Robsen01/Brain_Interface | 2525dc5e90bc5ac6b67f8f596fdf26a9ae6b391e | [
"Apache-2.0"
] | null | null | null | UserInterface/DataVisualizer.py | Robsen01/Brain_Interface | 2525dc5e90bc5ac6b67f8f596fdf26a9ae6b391e | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append('../../Brain_Interface')
import ArduinoToPiDataTransfer.PiDataReceiver as PDR
from FileExport import FileOpener, FileSaver
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar
from PySide2.QtWidgets ... | 38.266667 | 210 | 0.657569 |
ad6aaccdf824ff9c73c1da9cd02b7e25e8ffe88d | 113 | py | Python | day01/strings.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day01/strings.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day01/strings.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | print("Hello World!\nand a second line")
print("Hello" + " " + "Matthias :P")
# indentation is realy a thing :P | 22.6 | 40 | 0.654867 |
d14aaf1eecaef7ab853fad2b2ef82ce9077c2677 | 964 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/utils/preprocess.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/utils/preprocess.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/utils/preprocess.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.000Z | """ extract frames and pcm"""
import os
import sys
import shutil
def ffmpeg_frames(mp4_addr, frame_out_folder, fps=5):
"""ffmpeg_frames"""
if os.path.exists(frame_out_folder):
shutil.rmtree(frame_out_folder)
os.makedirs(frame_out_folder)
cmd = './src/utils/ffmpeg -v 0 -i %s -r %d -q 0 %s/%s.jp... | 26.054054 | 106 | 0.640041 |
7e783efbb2962e2d7f56271948c54e80636f3848 | 5,641 | py | Python | devices/l298n.py | MiaranaDIY/Salamigal | 44ac98fa6463d46694e1f9343a0ebc788e7a88f8 | [
"MIT"
] | 3 | 2017-08-02T12:26:34.000Z | 2021-01-13T01:06:26.000Z | devices/l298n.py | MiaranaDIY/Salamigal | 44ac98fa6463d46694e1f9343a0ebc788e7a88f8 | [
"MIT"
] | null | null | null | devices/l298n.py | MiaranaDIY/Salamigal | 44ac98fa6463d46694e1f9343a0ebc788e7a88f8 | [
"MIT"
] | 3 | 2017-02-14T22:10:00.000Z | 2021-01-02T14:26:43.000Z | #Setup logging
import logging
import logging.config
logging.config.fileConfig('logging.conf')
# create logger
logger = logging.getLogger('root')
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM) # set board mode to Broadcom
GPIO.setwarnings(False)
import devices.device as device
import time
import traceback
class L298... | 32.796512 | 65 | 0.543343 |
adc6bfff3da0b347d869743ec2f284cceb327369 | 420 | py | Python | order/migrations/0002_order_is_deliver.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | order/migrations/0002_order_is_deliver.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | order/migrations/0002_order_is_deliver.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.16 on 2020-11-03 06:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='order',
name='is_deliver',... | 22.105263 | 78 | 0.57619 |
70f3360293db3abef904be20fc008b551da9284c | 558 | py | Python | gdp1/assignment_5/reduce.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_5/reduce.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_5/reduce.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | from functools import reduce
from gdp1.common.input_helpers import float_list_input
def arithmetic_mean(enum):
if len(enum) == 0:
return None
return reduce(lambda acc, val: acc + val, enum) / len(enum)
def main():
print("Please enter a list of floats. When done, enter \"end\".")
floats = fl... | 25.363636 | 91 | 0.654122 |
cb2b7f43223aa2c7009e58effff1c347a23f919a | 14,509 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_traffic_class.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_traffic_class.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_traffic_class.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 44.506135 | 129 | 0.606796 |
6996e336c55d7961c3608cd0eb4c6d2598878d54 | 4,147 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_username.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_username.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_username.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import pa... | 41.47 | 103 | 0.726549 |
2a0e7f7710d98a2b29f59b6c1bd70563af6735e5 | 4,628 | py | Python | Packs/MalwareInvestigationAndResponse/Scripts/KillProcessWrapper/KillProcessWrapper_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/MalwareInvestigationAndResponse/Scripts/KillProcessWrapper/KillProcessWrapper_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/MalwareInvestigationAndResponse/Scripts/KillProcessWrapper/KillProcessWrapper_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | """
Unit Tests for KillProcessWrapper script.
"""
import pytest
import demistomock as demisto
@pytest.mark.parametrize('endpoint_id, process_id, process_name, expected_commands', [
('endpoint_id_test', 'process_id_test', None, ['cs-falcon-rtr-kill-process']),
('endpoint_id_test', None, 'process_name_test', [... | 39.896552 | 118 | 0.672861 |
2a95bb834514e34358c4984db4e31e35675f6728 | 1,153 | py | Python | 02.Sort/HG/B2578.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 02.Sort/HG/B2578.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 02.Sort/HG/B2578.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | import sys
import pprint
def pprint(arr):
for line in arr:
print(line)
def check(board, row, col, diag):
# row
for i, line in enumerate(board):
if sum(line) == 0:
row[i] = 1
# col
for i, line in enumerate(zip(*board)):
if sum(line) == 0:
col[i] = 1
... | 18.901639 | 55 | 0.51431 |
2a971ed46972aec613548ba6aa9dd3c0df286e41 | 4,554 | py | Python | AP3/position_classifier.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 6 | 2016-08-15T17:57:45.000Z | 2019-03-19T05:08:29.000Z | AP3/position_classifier.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 10 | 2016-04-11T10:20:34.000Z | 2016-08-09T21:47:48.000Z | AP3/position_classifier.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 7 | 2016-06-21T04:08:58.000Z | 2018-09-01T14:02:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The constant classifier which always guesses the most common class."""
import json
import os
import logging
from PIL import Image
import numpy
import scipy.misc
import pickle
from tensorvision.utils import load_segmentation_mask
import sys
sys.path.append(
os.pat... | 29.192308 | 79 | 0.581467 |
93605d3cd5707216638d516c60ee2038d6cf2805 | 772 | py | Python | python_gui_tkinter/Combinatorics-1.4.5/setup.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/Combinatorics-1.4.5/setup.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/Combinatorics-1.4.5/setup.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #!/usr/bin/env python
from distutils.core import setup
setup(name='Combinatorics',
version='1.4.5',
description='Basic Combinatorics Functions',
author='Phillip M. Feldman',
author_email='Phillip.M.Feldman@gmail.com',
long_description="""
This module was created to supplement Pytho... | 38.6 | 80 | 0.699482 |
87fa578e608552dc64b13fa65e42120ef5a50d70 | 30,429 | py | Python | FP_2017/18/PythonSkript.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | FP_2017/18/PythonSkript.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | FP_2017/18/PythonSkript.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | ##################################################### Import system libraries ######################################################
import matplotlib as mpl
mpl.rcdefaults()
mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc'))
import matplotlib.pyplot as plt
import numpy as np
import scipy.constants as c... | 43.782734 | 224 | 0.671432 |
57648f7ee270c5af737362b964fec3cf36e1c9df | 904 | py | Python | mod/units/card_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 1 | 2015-06-28T15:26:52.000Z | 2015-06-28T15:26:52.000Z | mod/units/card_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | null | null | null | mod/units/card_handler.py | HeraldStudio/wechat | b023b7460a6b4284ea782333e13f24d169ddaff4 | [
"MIT"
] | 6 | 2015-03-20T16:36:22.000Z | 2021-08-28T07:58:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2015-03-17 18:38:13
# @Author : yml_bright@163.com
import tornado.web
from ..models.user import User
from get_api_return import get_api_return
import json
TEMPLATE = u'<center><h1 style="margin-top:30%">{content}</h2></center>'
class CradHandler... | 27.393939 | 73 | 0.587389 |
5e2b7e7c14bba3135aa5f5e50d7f9e556d531338 | 9,955 | py | Python | cifar10/edition2/cifar10.py | nowgood/ComputeVersion | f2475570bfb33779b2a71bb9da03f12ffe5609c5 | [
"Apache-2.0"
] | null | null | null | cifar10/edition2/cifar10.py | nowgood/ComputeVersion | f2475570bfb33779b2a71bb9da03f12ffe5609c5 | [
"Apache-2.0"
] | null | null | null | cifar10/edition2/cifar10.py | nowgood/ComputeVersion | f2475570bfb33779b2a71bb9da03f12ffe5609c5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | 37.007435 | 114 | 0.696133 |
eaa7b362b042997cf5f06c832c8daa6ec83e99be | 1,611 | py | Python | HW1/p5.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/p5.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/p5.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#kverdey1@jhu.edu
#Computer Vision EN.601.461
#Assignment 1
#Programming section 2, p5.py
#Finds the locations of edge points in the image.
#this implementation employs the Sobel 3x3 gradient algorithm.
import cv2
import numpy as np
def p5(image): #return edge_image
dimensions = np.shape(image)
rows ... | 39.292683 | 298 | 0.631906 |
871178e7c9ad151f65855fa404f441fbecfbfcdc | 1,860 | py | Python | measurements/custom/HiFiMAN HE400S with Focus Pads/HE400S.py | mmshivesh/AutoEq | 43414bfd71ac5c5ce5b5ae0e8d3ce7a11af2d5bf | [
"MIT"
] | 1 | 2020-01-16T14:03:51.000Z | 2020-01-16T14:03:51.000Z | data/HiFiMAN HE400S with Focus Pads/HE400S.py | hyshuma/AutoEq | 4c3ad3478d6b74fc794bd7d973b330d38da338b9 | [
"MIT"
] | null | null | null | data/HiFiMAN HE400S with Focus Pads/HE400S.py | hyshuma/AutoEq | 4c3ad3478d6b74fc794bd7d973b330d38da338b9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from frequency_response import FrequencyResponse
import matplotlib.pyplot as plt
def main():
stock = FrequencyResponse.read_from_csv('data/HE400S stock.csv')
focus = FrequencyResponse.read_from_csv('data/HE400S focus.csv')
base = FrequencyResponse.read_from_csv('innerfid... | 42.272727 | 137 | 0.747849 |
0de81e1abfe9954fc17c9696b57ae0e10f170c70 | 554 | py | Python | projects/g3h2-algorithm/practice3/2_SJF.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice3/2_SJF.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice3/2_SJF.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | import functools
def sjf(jobs):
scheduling_order = sorted([[i, jobs[i], 0] for i in range(len(jobs))], key=lambda a: a[1])
avg_completion_time = 0
for i in range(len(scheduling_order)):
avg_completion_time += scheduling_order[i][1] * (len(scheduling_order) - i)
for j in range(i, len(schedu... | 30.777778 | 94 | 0.666065 |
217366745ea7f29e10bf7f260ac951f47ce2c029 | 1,952 | py | Python | proj_intel.py | OrangeB0lt/interview_project_intelX | 66833f8d4c1049d33fb7a4bdeba62ec27e5b16f8 | [
"MIT"
] | null | null | null | proj_intel.py | OrangeB0lt/interview_project_intelX | 66833f8d4c1049d33fb7a4bdeba62ec27e5b16f8 | [
"MIT"
] | null | null | null | proj_intel.py | OrangeB0lt/interview_project_intelX | 66833f8d4c1049d33fb7a4bdeba62ec27e5b16f8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''
Command interpreter for Projects
'''
import cmd
class PROJCommand(cmd.Cmd):
'''
Coomand interpreter class
'''
promt = '(intelX) '
ERR = [
'** class name missing **'
'** class doesn\'t exist **'
'** instance id missing **'
'** no instance fou... | 21.932584 | 57 | 0.446209 |
0dfd87fcf1dd34e62b6a71b7cd1c11cb74136eee | 5,854 | py | Python | .github/actions-scripts/fr-add-docs-reviewers-requests.py | papakeyso/docs | f1e5d022f365f953d986675b3f5c2beeba40293e | [
"CC-BY-4.0",
"MIT"
] | 17 | 2021-01-05T16:29:05.000Z | 2022-02-26T09:08:44.000Z | .github/actions-scripts/fr-add-docs-reviewers-requests.py | moonlightnigh/docs | 37b2dc7444c4f38bd089298a097a755dd0df46ab | [
"CC-BY-4.0",
"MIT"
] | 54 | 2020-10-14T00:31:26.000Z | 2020-11-05T20:39:46.000Z | .github/actions-scripts/fr-add-docs-reviewers-requests.py | moonlightnigh/docs | 37b2dc7444c4f38bd089298a097a755dd0df46ab | [
"CC-BY-4.0",
"MIT"
] | 2 | 2022-03-22T08:04:48.000Z | 2022-03-28T10:54:40.000Z | # TODO: Convert to JavaScript for language consistency
import json
import logging
import os
import requests
# Constants
endpoint = 'https://api.github.com/graphql'
# ID of the github/github repo
github_repo_id = "MDEwOlJlcG9zaXRvcnkz"
# ID of the docs-reviewers team
docs_reviewers_id = "MDQ6VGVhbTQzMDMxMzk="
# ID ... | 25.124464 | 138 | 0.52289 |
df1d9c4adf39a6d9285508033a6515b15c174761 | 7,631 | py | Python | cow3-main/data/cp_detect.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | cow3-main/data/cp_detect.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | cow3-main/data/cp_detect.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python3
#coding=utf-8
"""
Copyright © 2021 - 2023 | Latip176
Semua codingan dibuat oleh Latip176.
"""
import requests as req,re
from bs4 import BeautifulSoup as par
#data - data
data,data2={},{}
aman,cp,salah=0,0,0
ubahP,pwBaru=[],[]
P = "\x1b[0;97m"
M = "\x1b[0;91m"
H = "\x1b[0;92m"
K = "\x1b[0;93m"
... | 38.933673 | 222 | 0.596514 |
1d1194e6da13dd7788a45021c5c815fe75c4f411 | 469 | py | Python | nz_django/day7/context_professor_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day7/context_professor_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day7/context_professor_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.db import models
from django.core.validators import MinLengthValidator,RegexValidator
class User(models.Model):
username = models.CharField(max_length=100,validators=[MinLengthValidator(6)])
password = models.CharField(max_length=100,validators=[MinLengthValidator(6)])
telephone = models.CharFie... | 67 | 111 | 0.793177 |
1da1c3f6aa274126d3f72c1a14458dd7ce115b6d | 5,708 | py | Python | easyp2p/platforms/base_platform.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/platforms/base_platform.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/platforms/base_platform.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # Copyright (c) 2018-2020 Niko Sandschneider
"""
Implements BasePlatform, the parent class for all P2P platforms. It contains
two public methods:
* download_statement: For downloading the account statement for a given date
range. This needs to be implemented by each child class separately.
* parse_statement: For... | 33.186047 | 80 | 0.640505 |
d58fc59d2e734261ab05ae803a537d4c82caf579 | 1,685 | py | Python | ssrmgmt/settings/production.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | ssrmgmt/settings/production.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | ssrmgmt/settings/production.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['*']
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'ssrmgmt',
'USER':... | 22.77027 | 65 | 0.664688 |
63b123b631f4c8ae1b1ac5aa4a49cf1a1bd73560 | 203 | py | Python | listings/chapter06/import-json.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter06/import-json.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter06/import-json.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import json
with open('iris.json', 'r', newline='') as json_file:
irises = json.load(json_file)
print(f"{len(irises)} Datensätze importiert.")
print(irises[0])
print(irises[50])
print(irises[100])
| 20.3 | 53 | 0.699507 |
8960a7876c809f2d919ad491e9fb6dad86de4a82 | 783 | py | Python | abfahrt/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | 1 | 2022-01-30T14:30:02.000Z | 2022-01-30T14:30:02.000Z | abfahrt/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | abfahrt/__init__.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | """
This is the abfahrt-Package for the InformatiCup 2022.
Developers:
Berkehan Ünal, Han, Linda, Lukas Dreyer
"""
from abfahrt.classes.Station import Station
from abfahrt.classes.Train import Train
from abfahrt.classes.Line import Line
from abfahrt.classes.Passenger import Passenger
from abfahrt.classes.... | 32.625 | 58 | 0.832695 |
9853e7cf0939c6e6389ced5ef30231bdee81d4f7 | 553 | py | Python | src/autograph/tasks.py | RobetSlovev39/AutoGraph | c8bdb358b95143ab0d8c6f7c475a6c21f7a76b95 | [
"MIT"
] | null | null | null | src/autograph/tasks.py | RobetSlovev39/AutoGraph | c8bdb358b95143ab0d8c6f7c475a6c21f7a76b95 | [
"MIT"
] | null | null | null | src/autograph/tasks.py | RobetSlovev39/AutoGraph | c8bdb358b95143ab0d8c6f7c475a6c21f7a76b95 | [
"MIT"
] | null | null | null | # Таски для Celery ( обновление базы данными из AutoGraph )
from .services.core import (
auth,
update_schemas,
update_devices
)
from settings import celery_app
@celery_app.task(name='autograph_auth')
def ag_auth() -> bool:
''' Обновление token'а '''
return auth()
@celery_app.task(name='update... | 18.433333 | 59 | 0.688969 |
7f4d55c8b55dbefe6066325fd7356c4367e904ce | 794 | py | Python | filters/inline_file.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | filters/inline_file.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | filters/inline_file.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z |
import base64
import urllib
from mimetypes import MimeTypes
from jinja2 import contextfilter
mime = MimeTypes()
@contextfilter
def inline_file(context, path, mime_type=None):
if mime_type is None:
mime_type = mime.guess_type(path)[0]
if mime_type is None:
raise Valu... | 25.612903 | 88 | 0.634761 |
7f66c2fbcc81a00ff888494cbb2d795725a89d30 | 2,547 | py | Python | solutions/im2recipe/src/insert.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/im2recipe/src/insert.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/im2recipe/src/insert.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import json
import numpy as np
import math
from src.get_embedding import get_recipe_embed
from src.milvus import has_table, create_table, create_index, milvus_insert, milvus_collection_rows
from src.mysql_toolkits import create_table_mysql, load_data_to_mysql
from src.config import temp_file_path, TABLE_NAME, rec... | 36.913043 | 230 | 0.664311 |
f6815d022432a3a774d6db1133aff4d01dccedf4 | 4,222 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/S3/S3Session.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 282 | 2016-06-16T14:41:44.000Z | 2022-03-02T03:43:02.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/S3/S3Session.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 146 | 2016-06-16T08:55:45.000Z | 2020-09-08T10:37:32.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/S3/S3Session.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 94 | 2016-06-16T10:49:07.000Z | 2022-03-28T09:14:03.000Z | import logging
import boto
import boto.s3
from boto.s3.connection import OrdinaryCallingFormat, SubdomainCallingFormat
from mongodb_consistent_backup.Errors import OperationError
class S3Session:
def __init__(self, region, access_key, secret_key, bucket_name, secure=True, num_retries=5, socket_timeout=15,
... | 44.914894 | 129 | 0.569872 |
9cf058155094c0d5738a93716a5ab6f48654b965 | 6,334 | py | Python | pandemie/visualization/visualization.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/visualization/visualization.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/visualization/visualization.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | 1 | 2020-03-28T00:02:41.000Z | 2020-03-28T00:02:41.000Z | """
This file contains everything needed to visualize games or individual rounds using the dash framework with plotly.
"""
import logging
import sys
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from plotly.graph_objs.layout.geo import Projection
... | 28.531532 | 114 | 0.649037 |
9cf2f7f24d4506ffd650dfbf1d18f716816158dd | 1,114 | py | Python | source/pkgsrc/comms/py-colorama/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/comms/py-colorama/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/comms/py-colorama/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2021/01/09 00:43:43 mef Exp $
This patch is necessary only for python-3.6
Traceback (most recent call last):
File "setup.py", line 36, in <module>
long_description=read_file('README.rst'),
File "setup.py", line 19, in read_file
return fp.read()
File "/usr/pkg/lib/python3.6/... | 31.828571 | 132 | 0.690305 |
14666f7f15d08ff6339a37727b0c73388eaec8ec | 1,362 | py | Python | hisim/components/random_numbers.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 12 | 2021-10-05T11:38:24.000Z | 2022-03-25T09:56:08.000Z | hisim/components/random_numbers.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 6 | 2021-10-06T13:27:55.000Z | 2022-03-10T12:55:15.000Z | hisim/components/random_numbers.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 4 | 2022-02-21T19:00:50.000Z | 2022-03-22T11:01:38.000Z | # Generic/Built-in
import random
from typing import List
# Owned
from hisim.component import Component, SingleTimeStepValues, ComponentInput, ComponentOutput
from hisim import loadtypes as lt
from hisim.simulationparameters import SimulationParameters
class RandomNumbers(Component):
RandomOutput: str = "Random Num... | 37.833333 | 131 | 0.661527 |
1ae8fb69e18fce55d08220e3685826a9661fe7e0 | 1,414 | py | Python | simple-sklearn-demo/test5/gridSearchTest.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-sklearn-demo/test5/gridSearchTest.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-sklearn-demo/test5/gridSearchTest.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import GridSearchCV
def grid_search_test():
# df = pd.read_csv(r"./data2.csv", encoding="gbk")
df = pd.read_... | 32.883721 | 85 | 0.689533 |
211a631c0e239a4f83b84d785848b61fc9787876 | 1,215 | py | Python | Bibliothek/migrations/0006_auto_20171002_1052.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Bibliothek/migrations/0006_auto_20171002_1052.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Bibliothek/migrations/0006_auto_20171002_1052.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-10-02 10:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Bibliothek', '0005_auto_20171001_1105'),
]
operations = [
migrations.AddFie... | 29.634146 | 90 | 0.581893 |
dcc140f6d6b7835dca472b0576276a0503c66807 | 3,791 | py | Python | modules/feed.py | git2samus/SubscriptionBot | d90aa4a854308b5dbf229da2699ba27a56adf0fa | [
"MIT"
] | 2 | 2020-01-19T15:18:06.000Z | 2021-02-09T00:56:20.000Z | modules/feed.py | git2samus/SubscriptionBot | d90aa4a854308b5dbf229da2699ba27a56adf0fa | [
"MIT"
] | null | null | null | modules/feed.py | git2samus/SubscriptionBot | d90aa4a854308b5dbf229da2699ba27a56adf0fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Reddit SubscriptionBot - Feed Parser
Usage: subscription_bot.py feed <subreddit> [--sticky] [(--after=<submission-url>|--reset-after)] [--debug]
subscription_bot.py feed -h | --help
Options:
--sticky Whether or not to make bot comments sticky on posts (requires ... | 43.574713 | 188 | 0.678449 |
b4ce9178647ebf39ca92f60aea0875819c3ff69d | 1,941 | py | Python | Lab1/main.py | rajatgupta310198/DL-Lab | cf17b92f9f6643877619d158552b70488879767c | [
"MIT"
] | null | null | null | Lab1/main.py | rajatgupta310198/DL-Lab | cf17b92f9f6643877619d158552b70488879767c | [
"MIT"
] | null | null | null | Lab1/main.py | rajatgupta310198/DL-Lab | cf17b92f9f6643877619d158552b70488879767c | [
"MIT"
] | null | null | null | from dataset import CatDog
import tensorflow as tf
data = CatDog()
X = tf.placeholder("float")
Y = tf.placeholder("float")
dropout = tf.placeholder("float")
def nn(x_data, drop_out):
x_img = tf.reshape(x_data, [-1, 50, 50 , 3])
layer1 = tf.layers.conv2d(x_img, filters=32, kernel_size=[3, 3], activation=tf... | 38.058824 | 117 | 0.724369 |
b4d7c8433ba725037fe4e517e28e773b58650d97 | 49,493 | py | Python | models/sqlnet/sqlnet.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/sqlnet/sqlnet.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/sqlnet/sqlnet.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import os
import torch
import numpy as np
import traceback
import torch.nn as nn
from collections import defaultdict
from torch.autograd import Variable
from commons.embeddings.word_embedding import WordEmbedding
from commons.embeddings.bert_container import BertContainer
from models.sqlnet.modules.sel_predict import S... | 42.703192 | 156 | 0.524276 |
2ede58341d728c3d1a9850d9d6f41432db0d5fe6 | 568 | py | Python | leetcode/303-Range-Sum-Query--Immutable/RangeSumQueryImmutable.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/303-Range-Sum-Query--Immutable/RangeSumQueryImmutable.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/303-Range-Sum-Query--Immutable/RangeSumQueryImmutable.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class NumArray(object):
def __init__(self, nums):
"""
initialize your data structure here.
:type nums: List[int]
"""
csums = [0] + nums
for i in range(len(nums)):
csums[i + 1] += csums[i]
self.csums = csums
def sumRange(self, i, j):
""... | 25.818182 | 58 | 0.475352 |
2c011bd60ad0058d86e8716fb48ac1e145bb95bf | 637 | py | Python | Problem Solving/magic_square_formation.py | aja512/HackerRank | 5ddf3c03447732922f2075bca2690a1591163f7b | [
"MIT"
] | null | null | null | Problem Solving/magic_square_formation.py | aja512/HackerRank | 5ddf3c03447732922f2075bca2690a1591163f7b | [
"MIT"
] | null | null | null | Problem Solving/magic_square_formation.py | aja512/HackerRank | 5ddf3c03447732922f2075bca2690a1591163f7b | [
"MIT"
] | null | null | null | s = []
for i in range(3):
s.append([int(i) for i in input().split()])
orig = [[4, 9, 2], [3, 5, 7], [8, 1, 6]]
all_squares = [orig]
all_squares.append(orig[::-1])
all_squares.append([i[::-1] for i in orig])
all_squares.append(all_squares[2][::-1])
all_squares.append([[4, 3, 8], [9, 5, 1], [2, 7, 6]])
all_squares.ap... | 25.48 | 53 | 0.577708 |
d3750e7a5943bdfad77bd4890439c38511743e4b | 4,599 | py | Python | deprecated/benchmark/ps/ctr/dist_ctr.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/ps/ctr/dist_ctr.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/ps/ctr/dist_ctr.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# 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 app... | 37.696721 | 114 | 0.684062 |
9f34eab848e86b4aa492bb4780dea5e83db84921 | 421 | py | Python | app/models/auth/DatabaseFactory.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/auth/DatabaseFactory.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/auth/DatabaseFactory.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z | import pymysql.cursors
class DatabaseFactory():
def __init__(self):
self.connection = pymysql.connect(host='localhost',
user='root',
password='mysql',
db='authdb',
charset='utf8mb4'... | 32.384615 | 95 | 0.508314 |
e2789b9222970a235397c213e7f1253d23c2985d | 1,142 | py | Python | ebenezer/atencion/models/clase.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | ebenezer/atencion/models/clase.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | 3 | 2020-02-11T23:15:00.000Z | 2021-06-10T20:52:17.000Z | ebenezer/atencion/models/clase.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | from uuid import uuid4
from django.db import models
from .dominio import Dominio
class Clase(models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid4, editable=False)
dominio = models.ForeignKey(
Dominio, related_name='clase_dominio_set',
db_column='dominio_id'... | 24.826087 | 51 | 0.567426 |
2c40f20cc38c6a95888ff6afb9ede753e72b22d5 | 1,293 | py | Python | examples/machine_translation/transformer/deploy/serving/utils/recorder.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/utils/recorder.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/utils/recorder.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import time
import paddle
class Recorder(object):
def __init__(self, batch_size, model_name, mem_info=None):
self.model_name = model_name
self.precision = "fp32"
self.batch_size = batch_size
self.infer_time = 0
self.samples = 0
self.start = 0
def tic(self):
... | 34.945946 | 76 | 0.488786 |
e2d45495f107a27ca76db3dd036b44bfe83dd8af | 9,892 | py | Python | Dataset_Generation/Umwandlungsskript_v1.1.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | 4 | 2019-03-17T19:55:43.000Z | 2019-04-30T15:22:36.000Z | Dataset_Generation/Umwandlungsskript_v1.1.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | null | null | null | Dataset_Generation/Umwandlungsskript_v1.1.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | null | null | null | AnzahlBilder = 49430
for i in range(AnzahlBilder):
f = open("C:\\Users\\ramon\\Downloads\\darknet-master\\darknet-master\\build\\darknet\\x64\\data\\obj\\"+str(i)+ "_scene.txt", "r")
first= f.readline()
second = f.readline()
third = f.readline()
#NUMMER1
if first[2] == " ":
XCenter =... | 48.729064 | 223 | 0.501415 |
201aceba9173b47d0912048508884d8bfa1e06b0 | 11,126 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/generateParkingAreaRerouters.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/generateParkingAreaRerouters.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/generateParkingAreaRerouters.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 41.984906 | 104 | 0.599317 |
201f5efd3ffe059cabef5536b9b14e29f85452b2 | 6,951 | py | Python | python/sqlite_interface/sbtab_dict.py | derHahn/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 4 | 2015-02-20T09:20:10.000Z | 2018-02-05T10:54:10.000Z | python/sqlite_interface/sbtab_dict.py | tlubitz/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 80 | 2018-04-13T13:46:24.000Z | 2022-02-16T16:01:46.000Z | python/sqlite_interface/sbtab_dict.py | tlubitz/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 6 | 2018-06-06T19:55:32.000Z | 2021-09-30T15:16:40.000Z | """
tablib.dictionary.sbtab_dict
~~~~~~~~~~~~~
A wrapper object for handling an SBtab with multiple tables using
a dictionary.
Also, includes methods for I/O between SQLite and SBtab.
"""
# -*- coding: utf-8 -*-
import misc
from SBtab import SBtabTable, SBtabError
import tablib
import tablibIO
import sqlite3
class SBt... | 41.375 | 105 | 0.554165 |
2058d839e4441e11796bc4ece206bcdc2e98b5f2 | 7,771 | py | Python | tests/test_cache.py | pricez/werkzeug_cache_mongodb | 039a7cf6f70ac0a7f36ef3885b1012e014e638c6 | [
"MIT"
] | null | null | null | tests/test_cache.py | pricez/werkzeug_cache_mongodb | 039a7cf6f70ac0a7f36ef3885b1012e014e638c6 | [
"MIT"
] | 5 | 2015-07-08T00:58:13.000Z | 2015-07-20T21:34:38.000Z | tests/test_cache.py | pricez/werkzeug_cache_mongodb | 039a7cf6f70ac0a7f36ef3885b1012e014e638c6 | [
"MIT"
] | null | null | null | # coding: UTF-8
from __future__ import absolute_import
import unittest
import mock
from pymongo import MongoClient
from mongo_cache import MongoCache
class MockData(object):
def __init__(self, x):
self.x = x
def __eq__(self, mock_data):
return self.x == mock_data.x
class TestCache(unitt... | 25.646865 | 94 | 0.610217 |
b3d3af0435c41728891203d6961a505d1c1384ab | 3,558 | py | Python | app/main/music.py | marwanad/music_bot | c7a9c704f510d455fc6d1d7c057d5cfa31dcd7cf | [
"MIT"
] | 1 | 2020-12-07T13:30:59.000Z | 2020-12-07T13:30:59.000Z | app/main/music.py | marwanad/music_bot | c7a9c704f510d455fc6d1d7c057d5cfa31dcd7cf | [
"MIT"
] | null | null | null | app/main/music.py | marwanad/music_bot | c7a9c704f510d455fc6d1d7c057d5cfa31dcd7cf | [
"MIT"
] | null | null | null | import json
import random
import spotipy
import setup
preview_base_url="https://p.scdn.co/mp3-preview/"
PLAYLIST_IDS = ['5FJXhjdILmRA2z5bvz4nzf', '4hOKQuZbraPDIfaGbM3lKI', '5nPXGgfCxfRpJHGRY4sovK', '5UFRIQ89nVPcVsrWjLyjqI', '445ES7sgFV8zJHebmbUW0L']
class SP(object):
sp = spotipy.Spotify(auth=setup.get_spotify_... | 33.885714 | 145 | 0.607926 |
20dd32143d9b20d0cd5334d1b110b868a202c921 | 6,102 | py | Python | python/oneflow/compatible/single_client/test/ops/test_multi_optimizer.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_multi_optimizer.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_multi_optimizer.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
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 agr... | 35.894118 | 88 | 0.616519 |
45e568c84bf330cd5774934349580883856ed9c6 | 166 | py | Python | rasa/nlu/training_data/__init__.py | ALT-F1/rasa | 8d4a734616f72aca14f122716fbf338c42644188 | [
"Apache-2.0"
] | 4 | 2019-12-06T22:21:15.000Z | 2021-04-23T21:54:39.000Z | rasa/nlu/training_data/__init__.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 56 | 2020-06-09T00:16:14.000Z | 2020-11-16T00:25:20.000Z | rasa/nlu/training_data/__init__.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3 | 2019-02-27T10:13:16.000Z | 2019-07-26T08:33:45.000Z | from rasa.nlu.training_data.loading import load_data
from rasa.nlu.training_data.message import Message
from rasa.nlu.training_data.training_data import TrainingData
| 41.5 | 61 | 0.873494 |
446e93df619688635d56c989351bdc1e418dfff3 | 6,547 | py | Python | SA.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | 1 | 2018-04-18T19:55:42.000Z | 2018-04-18T19:55:42.000Z | SA.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | null | null | null | SA.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | null | null | null | import numpy as np
from numpy import *
from random import *
import random
import itertools
import math
import time
from itertools import permutations
# load the distance matrix from file
def loadDistances():
distancesFile = open("citiesAndDistances.txt")
cities = distancesFile.readline().split()
del citi... | 28.58952 | 125 | 0.632962 |
9238e4de66ba8f21cb3ddfa042f788ab51d245e3 | 1,491 | py | Python | sdks/python/apache_beam/utils/python_callable.py | diegomez17/beam | 29dea08c873abc75871674762e68fd5b29b8052b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2021-12-29T09:01:21.000Z | 2022-02-26T14:32:16.000Z | sdks/python/apache_beam/utils/python_callable.py | diegomez17/beam | 29dea08c873abc75871674762e68fd5b29b8052b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 4 | 2021-12-21T21:15:41.000Z | 2022-02-15T19:21:28.000Z | sdks/python/apache_beam/utils/python_callable.py | diegomez17/beam | 29dea08c873abc75871674762e68fd5b29b8052b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2018-01-25T23:26:58.000Z | 2018-01-25T23:26:58.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 35.5 | 79 | 0.742455 |
2bf70618fb1255d045c1f859eb4f5b529b454867 | 482 | py | Python | plots/jahresumsatz.py | Schwub/bwl_presentation | 9b57def1a440d1f713cf417522a108372893d752 | [
"MIT"
] | null | null | null | plots/jahresumsatz.py | Schwub/bwl_presentation | 9b57def1a440d1f713cf417522a108372893d752 | [
"MIT"
] | null | null | null | plots/jahresumsatz.py | Schwub/bwl_presentation | 9b57def1a440d1f713cf417522a108372893d752 | [
"MIT"
] | null | null | null | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style("whitegrid")
df = pd.read_csv("jahresumsatz.csv")
g=sns.barplot(x='Jahr', y='Umsatz in Millionen Euro', data=df)
#g=sns.barplot(x='Jahr', y='Umsatz in Millionen Euro', data=df, palette=sns.color_palette('YlOrBr', 4))
for index, row ... | 43.818182 | 103 | 0.721992 |
471148a9a54fcaa26effa694f7717c81c6d46bcb | 14,041 | py | Python | TreeModelLib/BelowgroundCompetition/SimpleHydro/SimpleHydro.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeModelLib/BelowgroundCompetition/SimpleHydro/SimpleHydro.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeModelLib/BelowgroundCompetition/SimpleHydro/SimpleHydro.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: jasper.bathmann@ufz.de
"""
import numpy as np
import math
from TreeModelLib import TreeModel
from ProjectLib.Logger import method_logger
class SimpleHydro(TreeModel):
## Simple approach to reduce water availability due to osmotic potent... | 46.959866 | 131 | 0.535432 |
47303e9a00e1c7e70d76c891db179881851a0d5a | 2,370 | py | Python | Packs/DNSOverHttps/Integrations/DNSOverHttps/DNSOverHttps.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DNSOverHttps/Integrations/DNSOverHttps/DNSOverHttps.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DNSOverHttps/Integrations/DNSOverHttps/DNSOverHttps.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import ast
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def test_module(client, base_url):
params = {'name': 'paloaltonetworks.com',
'type': 'A'}
result = client._http_request('GET', full_url=base_url, params=params)
if result:
return 'o... | 30.384615 | 87 | 0.603797 |
5bdff1f17db1f07939cd70bbe48bda7f35a4a7cd | 707 | py | Python | Buttons/buttons.py | CoasterFreakDE/Discord-Shorts | 11433486c6964386e72915a27735f23ab28c1569 | [
"MIT"
] | null | null | null | Buttons/buttons.py | CoasterFreakDE/Discord-Shorts | 11433486c6964386e72915a27735f23ab28c1569 | [
"MIT"
] | null | null | null | Buttons/buttons.py | CoasterFreakDE/Discord-Shorts | 11433486c6964386e72915a27735f23ab28c1569 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='!')
class StandardButton(discord.ui.Button):
def __init__(self):
super().__init__(
label="Klicke mich!",
style=discord.enums.ButtonStyle.blurple,
custom_id="interaction:DefaultButton"
... | 28.28 | 97 | 0.674682 |
45eb8fb6844ebfdd9609254e9f8219da990af05b | 686 | py | Python | AccessPoint03/AccessPoint/views.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | AccessPoint03/AccessPoint/views.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | 5 | 2021-03-30T13:53:38.000Z | 2021-09-22T19:18:06.000Z | AccessPoint03/AccessPoint/views.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from AccessPoint.models import AreaBandWidthDetails,AccessPoint
from AccessPoint.serializers import *
from rest_framework import viewsets
from rest_framework.response import Response
class AccessPointView(vi... | 27.44 | 64 | 0.74344 |
cae76c6cbab8d5037943cb100808a72e9ffed20d | 671 | py | Python | 5_ifElse/3_switchOnOff.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 5_ifElse/3_switchOnOff.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 5_ifElse/3_switchOnOff.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Switch on, switch off
1. Erstelle Variablen für die Hintergrundfarbe und die Farbe des Kreises
2. Schaffst du es folgende Bedingung herzustellen?
'True': Kreis schwarz, Hintergrund weiss
'False': Kreis weiss, Hintergrund schwarz
3. Kannst du eine Variable erstellen, die als Schalter ... | 18.638889 | 72 | 0.681073 |
1b6f5f7cc692c15be03840931b9483a378200c66 | 21,392 | py | Python | code/02_study_population/CCU013_17_paper_survival_cohort.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | code/02_study_population/CCU013_17_paper_survival_cohort.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | code/02_study_population/CCU013_17_paper_survival_cohort.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | # Databricks notebook source
# MAGIC %run /Workspaces/dars_nic_391419_j3w9t_collab/CCU013/COVID-19-SEVERITY-PHENOTYPING/CCU013_00_helper_functions
# COMMAND ----------
from pyspark.sql.functions import lit, to_date, col, udf, substring, regexp_replace, max, when, date_add
from pyspark.sql import functions as f
from d... | 31.551622 | 203 | 0.750561 |
940fdd7d02baf1fddf7ca7421442d43f6edd9390 | 475 | py | Python | exercises/de/test_03_16_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/test_03_16_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/test_03_16_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
'with nlp.select_pipes(disable=["tagger", "lemmatizer"])' in __solution__
or 'with nlp.select_pipes(disable=["lemmatizer", "tagger"])' in __solution__
), "Verwendest du nlp.select_pipes mit den korrekten Komponenten?"
__msg__.good(
"Perfekt! Du hast nun Tipps un... | 39.583333 | 84 | 0.671579 |
942cb1ef4cda4fc9618a63c6351d35b9a51c1185 | 181 | py | Python | integration/suites/ansible/python_encoding/script.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,426 | 2020-06-05T13:43:08.000Z | 2022-03-31T19:58:57.000Z | integration/suites/ansible/python_encoding/script.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,053 | 2020-06-17T14:58:08.000Z | 2022-03-31T15:44:52.000Z | integration/suites/ansible/python_encoding/script.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 84 | 2020-06-05T14:28:46.000Z | 2022-03-29T22:42:05.000Z | # -*- coding: UTF-8 -*-
# Функция приветствия. Приветствует вызывающего эту функцию.
# Не принимает аргументов.
# Не возвращает значений.
def greet():
print("Привет")
greet()
| 18.1 | 60 | 0.696133 |
84887d9c3d8f3d10fa93067132e7b0e795a3be61 | 24,653 | py | Python | year_3/comppi_1/core/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_1/core/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_1/core/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from django.contrib.auth import authenticate
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.db.models.query import QuerySet
from django.http import... | 40.816225 | 108 | 0.616031 |
b6febbd49276106f476a41dc477fea5e21ba15c0 | 460 | py | Python | INBa/2015/Mitin_D_S/task_1_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Mitin_D_S/task_1_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Mitin_D_S/task_1_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 1. Вариант 15.
# Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Аркадий Петрович Голиков.
# После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
# Mitin D.S.
# 18.02.2016, 23:00.
print("Аркадий Петрович Голиков - известн... | 46 | 122 | 0.786957 |
6d3dbf97cf411babb33cd8804b2c55255e4e3ddc | 208 | py | Python | Algorithms/Implementation/find_digits.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/find_digits.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/find_digits.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
t = int(input().strip())
for a0 in range(t):
n = list(map(int, input()))
num = int(''.join(map(str, n)))
print(len([i for i in n if i != 0 and num % i == 0]))
| 18.909091 | 57 | 0.543269 |
b6a915879fa35c813e3e0eafd9d7cfdc33000deb | 2,223 | py | Python | other/re-risky/split-version/task2/spoilers_and_source/src/checker.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | other/re-risky/split-version/task2/spoilers_and_source/src/checker.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | other/re-risky/split-version/task2/spoilers_and_source/src/checker.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python
# Copyright 2018 Google LLC
#
# 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 agree... | 51.697674 | 1,164 | 0.787224 |
44a49ab3091ac42fda1298c70684cfbdd071b84c | 1,935 | py | Python | IVTa/2014/BRONNIKOV_I_S/task_4_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BRONNIKOV_I_S/task_4_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BRONNIKOV_I_S/task_4_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 4. Вариант 50
# Напишите программу, которая выводит имя, под которым скрывается Максимилиан Гольдман .
# Дополнительно необходимо вывести область интересов указанной личности, место рождения,
# годы рождения и смерти (если человек умер), вычислить возраст на данный момент
# (или момент смерти). Для хранени... | 33.947368 | 97 | 0.637209 |
01cb0b06ce1bc12f95d74a312ce99549cd20f309 | 2,971 | py | Python | v302/python/mittelwert-spule.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v302/python/mittelwert-spule.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v302/python/mittelwert-spule.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
from scipy.stats import sem
print('====================')
print('Spule Wert 17 ANFANG')
print('====================')
print('Induktivitätsmessbrücke ANFANG')
rao2 = 980
lao2 = 27.5 * 10**(-3)
pot1 = 0.865
r2 = ufloat(rao2, rao2 * 0.... | 24.966387 | 89 | 0.619657 |
17340ea9cef885311b7a7e54def90c89703b1fa1 | 10,114 | py | Python | research/cv/Auto-DeepLab/src/core/encoder.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Auto-DeepLab/src/core/encoder.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Auto-DeepLab/src/core/encoder.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 37.598513 | 117 | 0.567431 |
bd97dc3bc2fbc0caebdee1fbc440499758a51e1f | 1,452 | py | Python | BIZa/2014/Zyabko_A_A/Task_8_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Zyabko_A_A/Task_8_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Zyabko_A_A/Task_8_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 8
#Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков, по которой бы игроки, отгадавшие слово без подсказки,... | 34.571429 | 355 | 0.736226 |
bda8a4e45a60d1ef651e53780d28869cdb763af5 | 385 | py | Python | leetcode/050-Pow/Pow_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/050-Pow/Pow_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/050-Pow/Pow_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {float} x
# @param {integer} n
# @return {float}
def myPow(self, x, n):
if n < 0:
return 1 / self.pow(x, -n)
return self.pow(x, n)
def pow(self, x, n):
if n == 0:
return 1
half = self.pow(x, n / 2)
if n % 2 == ... | 22.647059 | 38 | 0.436364 |
bdb670b1bdebcad6e2d1f52d8b0134b8e496daf8 | 579 | py | Python | docker/django/restaurant/restapi/serializers/foodmenu_serializer.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 3 | 2019-08-29T10:14:40.000Z | 2021-03-05T09:50:15.000Z | docker/django/restaurant/restapi/serializers/foodmenu_serializer.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | null | null | null | docker/django/restaurant/restapi/serializers/foodmenu_serializer.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 1 | 2021-03-05T09:50:29.000Z | 2021-03-05T09:50:29.000Z | from rest_framework import serializers
from rest_framework.validators import UniqueTogetherValidator
from restapi.models import FoodMenu
from .restaurant_serializer import RestaurantSerializer
class FoodMenuSerializer(serializers.ModelSerializer):
restaurant_id = RestaurantSerializer
class Meta:
mod... | 32.166667 | 118 | 0.739206 |
da626383c3edf7588d2934ea06f8b6dd54c14903 | 725 | py | Python | transonic/test_util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/test_util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/test_util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from transonic import util
from transonic.util import query_yes_no, timeit, print_versions, timeit_verbose
def test_query_yes_no():
util.input = lambda: "y"
query_yes_no("test", default="y")
query_yes_no("test", default="n")
query_yes_no("test")
util.input = lambda: ""
query_yes_no("test", ... | 21.323529 | 79 | 0.663448 |
00860bc305c6242a73646ef82b92a30fcb64cee3 | 2,635 | py | Python | src/onegov/election_day/views/election/list_entity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/election/list_entity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/election/list_entity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Election
from onegov.ballot import List
from onegov.core.security import Public
from onegov.election_day import _
from onegov.election_day import ElectionDayApp
from onegov.election_day.layouts import DefaultLayout
from onegov.election_day.layouts import ElectionLayout
from onegov.election_day... | 25.833333 | 78 | 0.625806 |
a9e98fbdf88301784dd5791b45f392fa5ee3ffb4 | 7,832 | py | Python | kts/validation/experiment.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/validation/experiment.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/validation/experiment.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import time
from copy import copy
from typing import Union, Optional
import numpy as np
import pandas as pd
import kts.ui.components as ui
from kts.core.feature_set import FeatureSet
from kts.feature_selection import Builtin
from kts.settings import cfg
from kts.ui.docstring import html_docstring
from kts.ui.feature_... | 37.295238 | 162 | 0.646961 |
413b08cc3d6b5c917ffbd395ac0afc0aa60edb47 | 1,270 | py | Python | 03 Python/Entwicklung eines IoT-Devices/loesung/src/my_iot_device/button.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Entwicklung eines IoT-Devices/loesung/src/my_iot_device/button.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Entwicklung eines IoT-Devices/loesung/src/my_iot_device/button.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | 1 | 2020-10-10T20:24:05.000Z | 2020-10-10T20:24:05.000Z | import RPi.GPIO as GPIO
BUTTON_GPIO = 21
class ButtonHandler:
"""
Publisher-Klasse für den Hardwarebutton. Setzt eine Callback-Methode auf,
die darauf wartet, dass der Button gedrückt wird und dann eine Nachricht
an den Luftsensor schickt, um eine neue Messung anzustoßen.
"""
def __init__... | 32.564103 | 78 | 0.662992 |
41892f469c567bdc2a0b1859902e70c171df1db2 | 1,105 | py | Python | elements/python/10/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/10/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/10/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Node(object):
def __init__(self, v, l=None, r=None):
self.value = v
self.left = l
self.right = r
lnum = self.left.num if self.left is not None else 0
rnum = self.right.num if self.right is not None else 0
self.num = lnum + 1 + rnum
def in_order_kth(n, k):
... | 24.555556 | 80 | 0.477828 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.