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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
072cbcaf1b4e307e4fb2c1041376b217c41bf6f0 | 2,905 | py | Python | Divide and Conquer/MergeSort/MergeSort.py | NiclasDev63/Algorithmen | 64c24d0501f9e12ea9be6ae4fa946ad8a40134f6 | [
"MIT"
] | null | null | null | Divide and Conquer/MergeSort/MergeSort.py | NiclasDev63/Algorithmen | 64c24d0501f9e12ea9be6ae4fa946ad8a40134f6 | [
"MIT"
] | null | null | null | Divide and Conquer/MergeSort/MergeSort.py | NiclasDev63/Algorithmen | 64c24d0501f9e12ea9be6ae4fa946ad8a40134f6 | [
"MIT"
] | null | null | null | """
Anfang des Algorithmus
"""
def mergeSort(list):
# überprüft, ob die Länge der übergebenen Liste größer als 1 ist
if len(list) > 1:
# länge der Liste
n = len(list)
# mitte der Liste
mitte = n //2
# linke hälfte der Liste
linke_haelfte = list[:mitt... | 32.640449 | 123 | 0.619621 |
4ae9786ca8ffcb225ebb57110db7cc8df8a943f5 | 29 | py | Python | frds/data/wrds/execucomp/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/data/wrds/execucomp/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/data/wrds/execucomp/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | from .anncomp import Anncomp
| 14.5 | 28 | 0.827586 |
918e75300fe04c031168c214fb97059362ff96a6 | 92 | py | Python | 2014/12/social-security-benefits-age/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/12/social-security-benefits-age/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/12/social-security-benefits-age/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1rn4wrIqnhLzikYukOvdxlbcPZL0h6GCLluwEZ57sKPM'
| 23 | 68 | 0.847826 |
fe7258b46d5b675697101e12e4807134f8b3a39f | 450 | py | Python | src/onegov/feriennet/views/calendar.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/calendar.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/calendar.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath.request import Response
from onegov.core.security import Public
from onegov.feriennet import FeriennetApp
from onegov.feriennet.models import AttendeeCalendar
@FeriennetApp.view(
model=AttendeeCalendar,
permission=Public)
def view_attendee_calendar(self, request):
return Response(
se... | 28.125 | 63 | 0.76 |
feb2bd3cfad0d130272ebf6e968522f8c8c04151 | 5,026 | py | Python | benchmark_test/scripts/main.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | benchmark_test/scripts/main.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | benchmark_test/scripts/main.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | from milvus import Milvus,DataType
import sys, getopt
import time
import logging
import milvus_toolkit as toolkit
import milvus_load
# import milvus_load as load
import config
def connect_server():
try:
milvus = Milvus(host=config.MILVUS_HOST, port=config.MILVUS_PORT)
return milvus
except E... | 29.052023 | 190 | 0.558695 |
fe166f2cb2378aa8c0ff87a20790b84ae0bd8218 | 2,223 | py | Python | research/cv/3dcnn/src/n4correction.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/3dcnn/src/n4correction.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/3dcnn/src/n4correction.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... | 36.442623 | 112 | 0.65857 |
a3f45dfd03f5aeef4b0b86c0a67a8ba9a99c57a3 | 262 | py | Python | leetcode/1389-Create-Target-Array-in-the-Given-Order/iteration.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/1389-Create-Target-Array-in-the-Given-Order/iteration.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/1389-Create-Target-Array-in-the-Given-Order/iteration.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
def createTargetArray(self, nums: List[int], index: List[int]) -> List[int]:
target = []
for i, num in enumerate(nums):
idx = index[i]
target = target[:idx] + [num] + target[idx:]
return target
| 32.75 | 80 | 0.545802 |
4a8515519924b899e3d88e839b3156001c20c902 | 3,761 | py | Python | add-new-cloud-location.py | globalwatchpost/CloudRegionsList | f428b39fc797403cf6ed5d38196a5df29f59d8af | [
"MIT"
] | null | null | null | add-new-cloud-location.py | globalwatchpost/CloudRegionsList | f428b39fc797403cf6ed5d38196a5df29f59d8af | [
"MIT"
] | null | null | null | add-new-cloud-location.py | globalwatchpost/CloudRegionsList | f428b39fc797403cf6ed5d38196a5df29f59d8af | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
import logging
import pprint
import argparse
import os
import sys
def _readRegionFile( regionFile, logger):
with open( regionFile ) as inputJson:
jsonContents = json.load(inputJson)
return jsonContents
def _appendOrCreateJson(args, logger):
if os.path.exists( ar... | 34.824074 | 112 | 0.635203 |
4ac1bfcff2ba03836ed0b44ba220d831e37cef68 | 743 | py | Python | lintcode/067-408-Add-Binary/AddBinary_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | lintcode/067-408-Add-Binary/AddBinary_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/067-408-Add-Binary/AddBinary_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {string} a a number
# @param {string} b a number
# @return {string} the result
def addBinary(self, a, b):
# Write your code here
alen, blen = len(a), len(b)
if alen > blen:
b = '0' * (alen - blen) + b
nlen = alen
else:
... | 26.535714 | 48 | 0.372813 |
60670e881b7f5631aa2ba8b36e794006776c5a97 | 1,699 | py | Python | TyphoonCon/2021/rev/Debug_Or_Me/program.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | TyphoonCon/2021/rev/Debug_Or_Me/program.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | TyphoonCon/2021/rev/Debug_Or_Me/program.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import os
import sys
import uuid
import shutil
import string
# Gets the file from the user
def get_file():
# Get the size of the file
print "Size: ",
size = int(raw_input())
if(size > 1000000):
print "File too big"
sys.exit(0)
print "File Contents\n"
print "================... | 24.271429 | 71 | 0.645085 |
e0c3fb11667f31764623059a9b9ce5383e28a829 | 728 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/ph-10.11-3-primel-e3.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/ph-10.11-3-primel-e3.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/ph-10.11-3-primel-e3.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def is_primel_4(n):
if n == 2:
return True # 2 is prime
if n % 2 == 0:
print(n, "is divisible by 2")
return False # all even numbers except 2 are not prime
if n < 2:
return False # numbers less then 2 are not prime
prime = True
m = n // 2 + 1
for x in range(3, ... | 26 | 68 | 0.532967 |
1c4340270dcdef2713ee8a18152ba3aebc09a59b | 2,836 | py | Python | pyventskalender/tag20.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag20.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag20.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | # Heute wollen wir ein externes Paket installieren.
#
# Dazu wird in Python `pip` verwendet.
#
# Setzt Datei virtualenv_und_pip.md voraus.
# %% Venv erstellen -- Tests 10 20
# Damit man Pakete später wieder einfach löschen kann, legt man am besten ein
# Virtual Environment an.
# Das geht am besten in der Konsole power... | 41.101449 | 98 | 0.744711 |
98ca7f1c2120931c40437aa3392b0f5dec9c624b | 3,276 | py | Python | test/test_tag13.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag13.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag13.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
import re
try:
from pyventskalender import tag13_loesung as heute
except ImportError:
from pyventskalender import tag13 as heute
def make_fake_input(replies, prompts):
"""
Create a function to use as mock for `input` that will store the pr... | 34.851064 | 147 | 0.579365 |
98ef24026fdfed7dce0ddb5b6011b9f3caad1442 | 6,454 | py | Python | src/test/tests/databases/bov.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/bov.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/databases/bov.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: bov.py
#
# Tests: mesh - 3D rectilinear, multiple domain
# plots - Pseudocolor, Subset, Label, Contour
# operators - Slice
#
# Programmer: Brad Whitlock
# Date: ... | 31.950495 | 102 | 0.630462 |
c7093baead0a3858b4a849f88382b23cebfef603 | 14,768 | py | Python | Packs/ServiceDeskPlus_On_Premise/Integrations/ServiceDeskPlus_On_Premise/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ServiceDeskPlus_On_Premise/Integrations/ServiceDeskPlus_On_Premise/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ServiceDeskPlus_On_Premise/Integrations/ServiceDeskPlus_On_Premise/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | EXPECTED_CREATE_REQUEST = {
'ServiceDeskPlus(val.ID===obj.ID)': {
'Request': {
'Subject': 'Create request test',
'Mode': {
'name': 'E-Mail',
'id': '123640000000006665'
},
'IsRead': False,
'CancellationRequested': Fal... | 34.504673 | 108 | 0.423483 |
c7a8a37b528a3a357e7dca76b59eb6031bafe297 | 664 | py | Python | exercises/zh/solution_02_13.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/solution_02_13.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/solution_02_13.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("zh_core_web_sm")
doc = nlp("荣耀将于7月16日发布新一代 MagicBook 锐龙笔记本,显然会配备7nm工艺、Zen2 架构的"
"全新锐龙4000系列,但具体采用低功耗的锐龙4000U 系列,还是高性能的锐龙4000H 系列,"
"目前还没有官方消息。今天,推特曝料大神公布了全新 MagicBook Pro 锐龙本的配置情况。"
)
# 创建匹配模板
pattern1 = [{"POS": "ADJ"},{"T... | 27.666667 | 67 | 0.691265 |
c7b641c8bd8cacb558deee4ba82032cf245d7a95 | 22,227 | py | Python | Packs/Polygon/Integrations/Polygon/Polygon.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Polygon/Integrations/Polygon/Polygon.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Polygon/Integrations/Polygon/Polygon.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 *
''' IMPORTS '''
import requests
from io import StringIO
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' CONSTANTS '''
INTEGRATION_NAME = "Group-IB THF Polygon"
LANGUAGE_TO_CODE = {
"english": "en",
"russian": "ru"
}
F... | 34.567652 | 110 | 0.567823 |
401334e1d42e7431ef24f6a8647a0328db046fa4 | 585 | py | Python | diversos/Casas.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/Casas.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/Casas.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | class House:
def __init__(self, price):
self._price = price
@property
def price(self):
return self._price
@price.setter
def price(self, new_price):
if new_price > 0 and isinstance(new_price, float):
self._price = new_price
else:
print("Pleas... | 20.892857 | 68 | 0.529915 |
dc16c0531eb8266f80582753cabb4f965f78d8e6 | 681 | py | Python | comp/zenefits/oa/oa3/QueensThreaten.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/zenefits/oa/oa3/QueensThreaten.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/zenefits/oa/oa3/QueensThreaten.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | def qt(a):
res = 0
n = len(a)
ldial, rdial = {}, {}
threat = []
for i in range(n):
j = a[i]
threat.append(0)
if i + j in ldial:
threat[i] += 1
pre = ldial[i + j][-1]
threat[pre] += 1
if threat[pre] == 4:
return 4... | 23.482759 | 34 | 0.358297 |
90a82a592519c118c8c2b46044d3d9aa57e4947d | 5,042 | py | Python | backend/apps/iamstudent/management/commands/createfakeusers.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/management/commands/createfakeusers.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/management/commands/createfakeusers.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from django.core.management.base import BaseCommand
import numpy as np
from apps.accounts.models import User
from apps.iamstudent.models import AUSBILDUNGS_TYPEN_COLUMNS, BEZAHLUNG_CHOICES, Student
from apps.ineedstudent.models import Hospital
from ._utils import BIG_CITY_PLZ... | 34.29932 | 94 | 0.545617 |
31e545b10c2193b6085f6ecba684524f2f876b5e | 953 | py | Python | Backend/migrations/alembic/versions/3610493d8979_create_cases_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/migrations/alembic/versions/3610493d8979_create_cases_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/migrations/alembic/versions/3610493d8979_create_cases_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create cases table
Revision ID: 3610493d8979
Revises:
Create Date: 2020-11-25 20:42:26.698495
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '3610493d8979'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.get_bind().execute("""
create table c... | 20.717391 | 47 | 0.681007 |
31ea940cb3251ed0ab119f4780f455aa41b51195 | 21,860 | py | Python | src/onegov/core/request.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/request.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/request.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import collections
import morepath
from cached_property import cached_property
from datetime import timedelta
from onegov.core.cache import lru_cache
from onegov.core.utils import append_query_param
from itsdangerous import (
BadSignature,
SignatureExpired,
TimestampSigner,
URLSafeSerializer,
URLSa... | 33.944099 | 79 | 0.634629 |
c34cd081b94daecadbc28c7a2816b0c0bd23c156 | 2,594 | py | Python | 3rdparty/webkit/Source/JavaScriptCore/Scripts/cssmin.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | null | null | null | 3rdparty/webkit/Source/JavaScriptCore/Scripts/cssmin.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | null | null | null | 3rdparty/webkit/Source/JavaScriptCore/Scripts/cssmin.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | 1 | 2019-01-25T13:55:25.000Z | 2019-01-25T13:55:25.000Z | #!/usr/bin/env python
# Copyright (C) 2013 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of... | 51.88 | 213 | 0.655359 |
825b21c8cfd435979399a40ff70ea26d798b757c | 363 | py | Python | Problems/Dynamic Programming/Hard/EditDistance/test_edit_distance.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Hard/EditDistance/test_edit_distance.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Hard/EditDistance/test_edit_distance.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from edit_distance import editDistance
class Test(TestCase):
def test_edit_distance(self):
self.assertEqual(editDistance("geek", "gesek"), 1)
self.assertEqual(editDistance("cat", "cut"), 1)
self.assertEqual(editDistance("sunday", "saturday"), 3)
self.as... | 40.333333 | 63 | 0.69697 |
7d9aa95179cc71bf37aa661d24c5733337502ae9 | 2,528 | py | Python | prompter.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | prompter.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | prompter.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | from data import Aspect
from log import Log
import tkinter as tk
import re
import time
class Prompter:
H_LIM = 30 # Number of character in the same row. Does not include tag.
V_LIM = 10 # Number of rows
def __init__(self, init_frame, name=None):
self.frame = init_frame
if name is None:
... | 31.209877 | 76 | 0.542326 |
7da97a4b26e2d6c08081677a580ce6ad5a06ebcc | 5,376 | py | Python | tests/utils/tensorflow/test_model_data_utils.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 30 | 2020-11-30T12:55:45.000Z | 2022-01-20T02:53:03.000Z | tests/utils/tensorflow/test_model_data_utils.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 209 | 2020-03-18T18:28:12.000Z | 2022-03-01T13:42:29.000Z | tests/utils/tensorflow/test_model_data_utils.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 10 | 2021-01-11T02:08:43.000Z | 2021-11-19T09:12:46.000Z | import scipy.sparse
import numpy as np
import copy
from rasa.shared.nlu.training_data.formats.markdown import INTENT
from rasa.utils.tensorflow import model_data_utils
from rasa.shared.nlu.training_data.features import Features
from rasa.shared.nlu.constants import ACTION_NAME
from rasa.utils.tensorflow.consta... | 36.080537 | 89 | 0.642485 |
816dee7e9951f5258ef805685b899e03f00f713f | 266 | py | Python | 4_loop/3_Gitter.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 4_loop/3_Gitter.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 4_loop/3_Gitter.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Gitter
- Schaffst du es mit einem zweiten Loop ein Gittermuster
herzustellen?
"""
newPage(300, 300)
for i in range(0, width(), 10):
stroke(0)
line((i,0),(i, width()))
for i in range(0, width(), 10):
stroke(0)
line((0,i),(width(),i))
| 15.647059 | 57 | 0.575188 |
81996e48d936abf4eebdb25aa7a17e8c1d951a23 | 13,157 | py | Python | Packs/Jira/Integrations/JiraV2/test_data/raw_response.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | Packs/Jira/Integrations/JiraV2/test_data/raw_response.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/Jira/Integrations/JiraV2/test_data/raw_response.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | QUERY_ISSUE_RESPONSE = {
"expand": "names,schema",
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"fields": {
"aggregateprogress": {
"progress": 0,
"total": 0
... | 43.279605 | 137 | 0.454891 |
c4a13038316d44f93ab753312eb6725827a6d46d | 15,882 | py | Python | Packs/TheHiveProject/Integrations/TheHiveProject/TheHiveProject_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/TheHiveProject/Integrations/TheHiveProject/TheHiveProject_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/TheHiveProject/Integrations/TheHiveProject/TheHiveProject_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import io
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def test_list_cases_command(requests_mock):
from TheHiveProject import list_cases_command, Client
mock_response = util_load_json('test_data/cases_list.json')
re... | 30.136622 | 87 | 0.591424 |
f20a7120affd6bdcca022e14213658a558b5e1ff | 4,652 | py | Python | tools/pythonpkg/tests/fast/arrow/test_tpch.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,824 | 2021-04-06T19:21:01.000Z | 2022-03-31T14:29:50.000Z | tools/pythonpkg/tests/fast/arrow/test_tpch.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/arrow/test_tpch.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
try:
import pyarrow
import pyarrow.parquet
import numpy as np
can_run = True
except:
can_run = False
def munge(cell):
try:
cell = round(float(cell), 2)
except (ValueError, TypeError):
cell = str(cell)
return cell
def check_result(result,answers):
for q... | 41.168142 | 155 | 0.622743 |
485ec9242818ff29033f359d413791762b7121d3 | 232 | py | Python | authApp/views/__init__.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | null | null | null | authApp/views/__init__.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | 1 | 2022-01-05T23:52:37.000Z | 2022-01-05T23:52:37.000Z | authApp/views/__init__.py | xlausae/Web-Service | fbc4b45f34fe5ac69d8da2ffe09e5c32046e27d5 | [
"MIT"
] | null | null | null | from .createUserView import UserCreateView
from .detailUserView import UserDetailView
from .transactionsView import TransactionCreateView, TransactionDeleteView, TransactionDetailView, TransactionUpdateView, TransactionsAccountView
| 58 | 145 | 0.900862 |
d2313b95a4f98218a3c51a4a61a6ad6dfefc3197 | 389 | py | Python | Packs/Arcanna/Scripts/PrepareArcannaRawJson/PrepareArcannaRawJson.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Arcanna/Scripts/PrepareArcannaRawJson/PrepareArcannaRawJson.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Arcanna/Scripts/PrepareArcannaRawJson/PrepareArcannaRawJson.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import json
JSON_CONTEXT_KEY = "JsonObject"
json_str = demisto.args()['input']
demisto.debug(json_str)
obj = json.loads(json_str)
if "_source" in obj:
new_obj = obj["_source"]
obj = new_obj
objStr = json.dumps(obj)
... | 19.45 | 46 | 0.74036 |
965eb667b722ff337f8561d51e25ed61e6384daf | 1,101 | py | Python | src/mvn-search.py | lburgazzoli/lb-py-misc | 714bfdaf557f7a05d35a6349c78cc8c281007345 | [
"Apache-2.0"
] | null | null | null | src/mvn-search.py | lburgazzoli/lb-py-misc | 714bfdaf557f7a05d35a6349c78cc8c281007345 | [
"Apache-2.0"
] | null | null | null | src/mvn-search.py | lburgazzoli/lb-py-misc | 714bfdaf557f7a05d35a6349c78cc8c281007345 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2014 lb.
#
# 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 ... | 32.382353 | 79 | 0.693915 |
f7048417b44c70cf49dfe6ef12bd1218e7cfb1d0 | 2,606 | py | Python | webinterface/tests/unit_tests/test_model_Assignment.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/tests/unit_tests/test_model_Assignment.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/tests/unit_tests/test_model_Assignment.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | from django.test import TestCase
from webinterface.models import *
class AssignmentTest(TestCase):
@classmethod
def setUpTestData(cls):
# Config
cls.reference_week = 2500
# Schedule
cls.schedule = Schedule.objects.create(name="schedule", cleaners_per_date=2, frequency=2, weekd... | 44.931034 | 116 | 0.719493 |
5446c83fc2f7a85f42a102a1bbaed3c5858ca1a8 | 1,743 | py | Python | official/nlp/emotect/src/finetune_eval_config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/emotect/src/finetune_eval_config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/emotect/src/finetune_eval_config.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... | 29.542373 | 101 | 0.662077 |
49a7953845572abec98c7db62b15b5b4affa533f | 9,211 | py | Python | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/misc/netG.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/misc/netG.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/misc/netG.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import torch
import torch.nn as nn
from torch.autograd import Variable
import pdb
import math
import numpy as np
import torch.nn.functional as F
from misc.share_Linear import share_Linear
from misc.utils import l2_norm
class _netG(nn.Module):
def __init__(self, rnn_type, ntoken, ninp, nhid, nlayers, dropout):
... | 47.973958 | 180 | 0.546629 |
49dbba4e4a61afb029c5d7a04add795b7d34877a | 993 | py | Python | oldp/apps/contact/tests/test_views.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/contact/tests/test_views.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/contact/tests/test_views.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from django.core import mail
from django.test import LiveServerTestCase
from django.urls import reverse
from oldp.apps.contact.views import MAIL_SUBJECT
class ContactViewsTestCase(LiveServerTestCase):
def test_form(self):
res = self.client.get(reverse('contact:form'))
self.assertTemplateUsed(re... | 29.205882 | 84 | 0.660624 |
b7334d108cd830477e0922532bc08c15a5dfc7bb | 1,128 | py | Python | aoc2020/day_18/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_18/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_18/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
from collections import deque
class Solution(SolutionABC):
expected = 693891
def solve(self) -> any:
return sum(self.resource_lines("input", self.evaluate))
@classmethod
def evaluate(cls, line) -> int:
stack = deque()
terms = []
for i in range(le... | 29.684211 | 63 | 0.441489 |
b78c52e8fca478308153b5f380df579e5e09aa10 | 2,451 | py | Python | tests/onegov/election_day/models/test_data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/models/test_data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/models/test_data_source.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.ballot import Election
from onegov.ballot import Vote
from onegov.election_day.models import DataSource
from onegov.election_day.models import DataSourceItem
def test_data_source(session):
session.add(DataSource(name='ds_vote', type='vote'))
session.add(DataSource(name='d... | 34.521127 | 78 | 0.683395 |
b7c0bcfe0eeca748484965b3a09def20f822745e | 2,924 | py | Python | oneflow/python/framework/job_build_and_infer_cfg_error.py | Ldpe2G/oneflow | 69febbe613c1dcc3aed1652a37e4ec7d18d2f1ba | [
"Apache-2.0"
] | 1 | 2020-12-24T09:26:36.000Z | 2020-12-24T09:26:36.000Z | oneflow/python/framework/job_build_and_infer_cfg_error.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/framework/job_build_and_infer_cfg_error.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
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... | 37.487179 | 98 | 0.661765 |
12ce0cae247f8eeec08ec7115cd9a3052b849886 | 242 | py | Python | src/model/device.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | null | null | null | src/model/device.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | 1 | 2021-05-24T19:25:35.000Z | 2021-05-24T19:25:35.000Z | src/model/device.py | agusalex/PacketSnifferServer | 95f72dfd5e3b4e11d4b8a70390be010b9bbb267f | [
"MIT"
] | null | null | null | from serial import Serial
class Device:
def __init__(self, port: str, baud_rate=9600):
self.serial = None
self.baud_rate = baud_rate
self.port = port
self.serial = Serial(self.port, int(self.baud_rate))
| 22 | 60 | 0.644628 |
424fd150653ae8e890c9d2e140629bc4ddfcb306 | 1,831 | py | Python | src/extras/psycholinguistic_db_creator.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/extras/psycholinguistic_db_creator.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/extras/psycholinguistic_db_creator.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Creates a CSV of psycholinguistic dictionary
# downloaded from web
# Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
from nltk import PorterStemmer
from extras import Logger
# The psycholinguistic database creator
class PsycholinguisticDbCreato... | 30.016393 | 105 | 0.611688 |
426672b8011b5bc1dadbb1dce2709dffeae830e5 | 352 | py | Python | nz_ueditor/app.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_ueditor/app.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_ueditor/app.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from flask import Flask,render_template
from flask_script import Manager
from ueditor import bp #导入蓝本
import config
app = Flask(__name__)
manager = Manager(app)
app.config.from_object(config) #让配置文件生效
app.register_blueprint(bp)
@app.route('/')
def hello_world():
return render_template('index.html')
if __name__ =... | 20.705882 | 40 | 0.761364 |
c46f622e16cbe221d0e9efb5647fccd9fd509255 | 761 | py | Python | src/python/test1.py | allenjzhang/playground | ef32d383d6c1751e204cb77db6658c6ed72624ad | [
"MIT"
] | 1 | 2020-06-10T11:34:59.000Z | 2020-06-10T11:34:59.000Z | src/python/test1.py | allenjzhang/playground | ef32d383d6c1751e204cb77db6658c6ed72624ad | [
"MIT"
] | null | null | null | src/python/test1.py | allenjzhang/playground | ef32d383d6c1751e204cb77db6658c6ed72624ad | [
"MIT"
] | 2 | 2020-05-26T06:39:04.000Z | 2020-11-16T06:34:23.000Z | nums = [2, 3, 4, 5, 7, 10, 12]
for n in nums:
print(n, end=", ")
class CartItem:
def __init__(self, name, price) -> None:
self.price = price
self.name = name
def __repr__(self) -> str:
return "({0}, ${1})".format(self.name, self.price)
class ShoppingCart:
def __init__(self) -> None:
se... | 18.560976 | 56 | 0.618922 |
fbfb73503d157eb9ad612355e7bd35c528340ac9 | 520 | py | Python | exercises/es/test_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
'spacy.blank("es")' in __solution__
), "¿Creaste el modelo de español en blanco?"
assert (
len(nlp.pipe_names) == 1 and nlp.pipe_names[0] == "ner"
), "¿Añadiste el entity recognizer al pipeline?"
assert (
len(ner.labels) == 1 and ner.labels[0] == "ROPA"
... | 32.5 | 92 | 0.601923 |
e15a62daad16e4a9b777e5357fb42b534ee37b68 | 91 | py | Python | Online-Judges/CodingBat/Python/String-01/05-extra_end.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/String-01/05-extra_end.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/String-01/05-extra_end.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def extra_end(str):
if len(str) <= 2:
return (str * 3)
return (str[-2:]*3)
| 18.2 | 24 | 0.494505 |
835747867c4bd1a9bf761077a8c936899b3852ba | 5,855 | py | Python | repo/script.video.F4mProxy/lib/flvlib/helpers.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.video.F4mProxy/lib/flvlib/helpers.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.video.F4mProxy/lib/flvlib/helpers.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | import os
import time
import datetime
from StringIO import StringIO
from UserDict import DictMixin
class UTC(datetime.tzinfo):
"""
A UTC tzinfo class, based on
http://docs.python.org/library/datetime.html#datetime.tzinfo
"""
ZERO = datetime.timedelta(0)
def utcoffset(self, d... | 28.42233 | 75 | 0.5462 |
55f6debea61e05e26edbf682dfd275eb15219ec8 | 981 | py | Python | checks.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | null | null | null | checks.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | null | null | null | checks.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | null | null | null | from discord import Member
from discord.ext import commands
from discord.ext.commands import Context as CommandContext, MissingPermissions
#ADMINS = [
# 333220752117596160,
# 368800541393813505,
#]
class NotADeveloper(Exception):
pass
class MissingPermissions(Exception):
pass
def ... | 26.513514 | 95 | 0.675841 |
1843f4b80dc8fca6d724dcdceffced88131aebef | 3,271 | py | Python | pew-religions/Religion-Leah.py | h4ckfu/data | bdc02fd5051dfb31e42f8e078832ceead92f9958 | [
"CC-BY-4.0"
] | 16,124 | 2015-01-01T06:18:12.000Z | 2022-03-31T00:46:52.000Z | pew-religions/Religion-Leah.py | h4ckfu/data | bdc02fd5051dfb31e42f8e078832ceead92f9958 | [
"CC-BY-4.0"
] | 179 | 2015-01-07T10:19:57.000Z | 2022-02-21T21:19:14.000Z | pew-religions/Religion-Leah.py | h4ckfu/data | bdc02fd5051dfb31e42f8e078832ceead92f9958 | [
"CC-BY-4.0"
] | 12,163 | 2015-01-03T14:23:36.000Z | 2022-03-31T10:10:23.000Z | #!/usr/bin/env python
import numpy as np
import pandas as pd
religions = ['Buddhist', 'Catholic', 'Evangel Prot', 'Hindu', 'Hist Black Prot', 'Jehovahs Witness', 'Jewish', 'Mainline Prot', 'Mormon', 'Muslim', 'Orthodox Christian', 'Unaffiliated']
csv = open("current.csv", 'w')
csv.truncate()
def write_row(matrix):
a... | 51.109375 | 185 | 0.653011 |
a13ff456b0d98bf11e3d99358f6e0855e84320f7 | 495 | py | Python | djangoForm/member/views.py | lanuxos/djangoForm | 4a0f02eaf27735c7eaaa4c282426cc911e2a399a | [
"MIT"
] | null | null | null | djangoForm/member/views.py | lanuxos/djangoForm | 4a0f02eaf27735c7eaaa4c282426cc911e2a399a | [
"MIT"
] | null | null | null | djangoForm/member/views.py | lanuxos/djangoForm | 4a0f02eaf27735c7eaaa4c282426cc911e2a399a | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from .models import Member
from .forms import AddMemberForm
def Add(request):
# context = {}
if request.POST:
form = AddMemberForm(request.POST)
if form.is_valid:
form.save()
return redirect('member-page')
else:
form ... | 24.75 | 62 | 0.644444 |
62e82875bcbd4b5feea4b7efbe9f6f3fb8563c7a | 19,720 | py | Python | mkdocs_static_i18n/plugin.py | NaviduRoshika/checklist-manager-documentation | c7a47c103b3c168c2665b247ba017bad77af7561 | [
"MIT"
] | 63 | 2021-02-08T14:04:02.000Z | 2022-03-27T09:33:04.000Z | mkdocs_static_i18n/plugin.py | NaviduRoshika/checklist-manager-documentation | c7a47c103b3c168c2665b247ba017bad77af7561 | [
"MIT"
] | 84 | 2021-02-08T13:30:14.000Z | 2022-03-31T07:13:05.000Z | mkdocs_static_i18n/plugin.py | ultrabug/mkdocs-static-i18n | 9432cef306ebd42a203cd11a0bfdf6cad712b32f | [
"MIT"
] | 16 | 2021-03-08T02:04:38.000Z | 2022-03-18T03:45:40.000Z | import logging
from collections import defaultdict
from copy import deepcopy
from pathlib import Path
from mkdocs import __version__ as mkdocs_version
from mkdocs.commands.build import _build_page, _populate_page
from mkdocs.config.config_options import Type
from mkdocs.plugins import BasePlugin
from mkdocs.structure.... | 41.25523 | 97 | 0.546501 |
3db4b1cff5b57c3e5445ca8b9d95963c7a0b931d | 5,447 | py | Python | balsn-2021-writeup/alldata/dist/src/challenge.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | balsn-2021-writeup/alldata/dist/src/challenge.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | balsn-2021-writeup/alldata/dist/src/challenge.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | class MasterMetaClass(type):
def __new__(cls, class_name, class_parents, class_attr):
def getFlag(self):
print('Here you go, my master')
with open('flag') as f:
print(f.read())
class_attr[getFlag.__name__] = getFlag
attrs = ((name, value) for name, ... | 29.443243 | 105 | 0.491463 |
9aa7346e1d7ff32b0e215e3bcb0acdee8be1f162 | 3,218 | py | Python | 03 Python/Smart Home Dashboard/aufgabe/hwio/dht11.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Smart Home Dashboard/aufgabe/hwio/dht11.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Smart Home Dashboard/aufgabe/hwio/dht11.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 random, time
import Adafruit_DHT
from .hwdevice import HardwareDevice
class DHT11Sensor(HardwareDevice):
"""
Simple Implementierung für den Zugriff auf einen DHT11-Luftsensor via
1-wire. Die Klasse kapselt im Grunde genommen einfach nur die Bibliothek
Adafruit_DHT und ermöglicht es dabei, sich i... | 31.54902 | 82 | 0.634556 |
9af950702a2ebb5f6336a283e2251b1ee7d247bf | 340 | py | Python | Webpage/arbeitsstunden/management/commands/importData.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/arbeitsstunden/management/commands/importData.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/arbeitsstunden/management/commands/importData.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from django.core.management.base import BaseCommand
from arbeitsstunden.management.commands.utils.csv import importCSV
class Command(BaseCommand):
help = "Import the given csv Files (ONLY FOR GIVEN STRUCT)"
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
... | 21.25 | 66 | 0.688235 |
627201e22f8a993ecbcd1fca02813ecf40503511 | 580 | py | Python | packages/watchmen-model/src/watchmen_model/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .connected_space import ConnectedSpace
from .connected_space_graphic import ConnectedSpaceGraphic, SubjectGraphic, TopicGraphic
from .dashboard import Dashboard, DashboardParagraph, DashboardReport
from .data_result_set import SubjectDataResultSet
from .report import Report, ReportDimension, ReportFunnel, ReportFu... | 72.5 | 119 | 0.887931 |
65517b6da935e28ce3d5338cf77a6c7704eb1338 | 402 | py | Python | data_tests/saved__backend__py3.9/python/subpackages.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/pythran/subpackages.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__/python/subpackages.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from numpy.fft import rfft
from numpy.random import randn
from numpy.linalg import matrix_power
from scipy.special import jv
def test_np_fft(u):
u_fft = rfft(u)
return u_fft
def test_np_linalg_random(u):
(nx, ny) = u.shape
u[:] = randn(nx, ny)
u2 = u.T * u
u4 = matrix_power(u2, 2)
return... | 16.08 | 37 | 0.651741 |
b2a6aaa575a111593f24942b3504db9fda9e4e79 | 381 | py | Python | tintz/newsletter/views.py | dcfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | null | null | null | tintz/newsletter/views.py | dcfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | 2 | 2021-03-19T21:51:51.000Z | 2021-06-10T18:22:50.000Z | tintz/newsletter/views.py | danielfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | null | null | null | from api.views import BaseApiView, SerializerFactory
from newsletter.models import Subscriber
class SubscriberApi(BaseApiView):
"""
Endpoint to add subscriber
"""
model = Subscriber
serializer_class = SerializerFactory(model)
http_method_names = ['post']
def post(self, request, *args, **k... | 25.4 | 52 | 0.706037 |
a24002ceaae927f83c59be3f7e52a69ad1e52916 | 85 | py | Python | emsite/emapp/apps.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | emsite/emapp/apps.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | emsite/emapp/apps.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class EmappConfig(AppConfig):
name = 'emapp'
| 14.166667 | 33 | 0.741176 |
ac1329a5f73c750f0af9c8360ea18569082039da | 2,425 | py | Python | __init__.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | 1 | 2020-06-29T12:33:15.000Z | 2020-06-29T12:33:15.000Z | __init__.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | null | null | null | __init__.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from jinja2 import Environment, FileSystemLoader
import os, shutil
from openpyxl import load_workbook
from resizer import resize
wb = load_workbook(filename = 'sbtmwebport.xlsx')
env = Environment(loader=FileSystemLoader(u'./templates'))
if os.path.isdir(u"./result"):
shutil.rmtree(u"./re... | 24.744898 | 170 | 0.698969 |
3bd5a6c29a4bcb1850274a7ecc8b8f9c5ef680cf | 807 | py | Python | backend/app/core/solver/select_images_analysis.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/app/core/solver/select_images_analysis.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/core/solver/select_images_analysis.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from typing import List, Tuple
class SelectImagesAnalysis:
@staticmethod
def check_select_images(
*, task_solution: List[str], user_solution: List[str]
) -> Tuple[List[str], List[str]]:
"""
Checks whether the user selected all images in the task solution or not.
Returns all... | 28.821429 | 80 | 0.630731 |
5a008d52465a3419cf13e549076903852b97db89 | 3,284 | py | Python | data/raspi/src/praxis/QualityAssurance2020/WestenDigitalRuleChecker.py | softwareengel/softwareengel-blog | e24192c096be4361c7f7bbe00d2c3e8263c9fd0b | [
"MIT"
] | null | null | null | data/raspi/src/praxis/QualityAssurance2020/WestenDigitalRuleChecker.py | softwareengel/softwareengel-blog | e24192c096be4361c7f7bbe00d2c3e8263c9fd0b | [
"MIT"
] | null | null | null | data/raspi/src/praxis/QualityAssurance2020/WestenDigitalRuleChecker.py | softwareengel/softwareengel-blog | e24192c096be4361c7f7bbe00d2c3e8263c9fd0b | [
"MIT"
] | null | null | null | class WesternDigitalRuleChecker(object):
def __init__(self):
self.estimated_value = 0
self.standard_deviation = 0
def __init__(self, estimated_value, standard_deviation):
self.estimated_value = estimated_value
self.standard_deviation = standard_deviation
def check_rule_1(s... | 45.611111 | 105 | 0.598965 |
5a8990b0df3ee178179e0281cae093af1f8af965 | 220 | py | Python | cpu_temp.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | cpu_temp.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | cpu_temp.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import subprocess
ret = subprocess.check_output(['vcgencmd', 'measure_temp']).decode('utf8')
_, temp = ret.split('=')
temp = temp[:-3]
print('Die Temperatur der CPU beträgt {} °C'.format(temp))
| 24.444444 | 74 | 0.686364 |
0c6de50a38db12ccb166644ee82778a2a9dbebf4 | 758 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/framework/partitioners/__init__.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/paddlevideo/modeling/framework/partitioners/__init__.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/paddlevideo/modeling/framework/partitioners/__init__.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.000Z | # copyright (c) 2020 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 applic... | 39.894737 | 74 | 0.779683 |
f05629f5eebc99e7a71e25bc24ed8f1b765d014b | 1,118 | py | Python | SBTK_League_Helper/test.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/test.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/test.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from src.interfacing.ogs.connect import Authentication
puppets = [1121, 1122, 1124, 1125]
a = Authentication("Leira", "Leira1234567890", testing=True)
# tourney id 7370
# a.post(['tournaments'],{
# "name":"Test Tournament 3",
# "group":9,
# "tournament_type":"roundrobin",
# "description":"A big grand tourna... | 28.666667 | 78 | 0.644007 |
b2f4e87f1f62bdb29286e3e662a4b78e9d38c5a0 | 422 | py | Python | PINp/2014/Koleganov_N_S/task_1_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Koleganov_N_S/task_1_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Koleganov_N_S/task_1_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 1. Вариант 10.
# Напишите программу, которая будет сообщать род деятельности и псевдоним под
# которым скрывается Ричард Дженкинс. После вывода информации программа должна
# дожидаться пока пользователь нажмет Enter для выхода.
# Колеганов Никита Сергеевич
# 29.05.2016
print("Ричард Дженкинс извествен по имен... | 42.2 | 102 | 0.800948 |
e8e120eaf3eb895d334ec7924c792d4839703574 | 2,091 | py | Python | graph/astar/node.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | graph/astar/node.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | graph/astar/node.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | 1 | 2020-04-16T01:17:04.000Z | 2020-04-16T01:17:04.000Z | #!/usr/bin/env python3
class Node():
def __init__(self, parent=None, position=None):
self.parent = parent # parent node
self.position = position
#self.position = (position[1], position[0]) # y, x
self.distance_from_start = 0
self.distance_to_end = 0
self.cost = ... | 32.671875 | 81 | 0.463893 |
68226c72f18553b4652b8598c98b21d42508b8d5 | 1,092 | py | Python | gemtown/musicians/migrations/0001_initial.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/musicians/migrations/0001_initial.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/musicians/migrations/0001_initial.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-04-20 06:10
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Musician',
fields=[
('id', models.AutoFiel... | 36.4 | 233 | 0.552198 |
d7e5865756cb44f4e1935edd2394e75b6b5ed892 | 59,271 | py | Python | Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | # type: ignore
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import copy
from requests import Response
from typing import Callable
INCIDENT_TYPE_NAME = "Azure DevOps"
OUTGOING_MIRRORED_FIELDS = {'status': 'The status of the pull request.',
'titl... | 35.598198 | 123 | 0.613217 |
cc107882b08662f5008275ceceac29457af32609 | 521 | py | Python | codeit/algorithm/greedy_min_fee.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/algorithm/greedy_min_fee.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/algorithm/greedy_min_fee.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def min_fee(pages_to_print):
sorted_pages_to_print = sorted(pages_to_print)
total_fee = 0
while sorted_pages_to_print:
size = len(sorted_pages_to_print)
minute = sorted_pages_to_print.pop(0)
total_fee += size * minute
return total_fee
if __name__ == '__main__':
from util ... | 27.421053 | 55 | 0.642994 |
cc111a60b1c3286389be46f24d927396c94313b7 | 363 | py | Python | Algorithms/Sorting/closest_numbers.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Sorting/closest_numbers.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Sorting/closest_numbers.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
N = int(input().strip())
arr = [int(i) for i in input().strip().split()]
sorted_arr = sorted(arr)
diff_arr = [sorted_arr[i + 1] - sorted_arr[i] for i in range(0, N - 1)]
min_diff = min(diff_arr)
idx = [i for i in range(len(diff_arr)) if diff_arr[i] == min_diff]
for i in idx:
print(sorted_arr... | 25.928571 | 71 | 0.636364 |
0bf77cc1ae923cdc3f7bea80df568d4bfe83a4fe | 191 | py | Python | src/d2py/tools/write/release.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 3 | 2022-03-09T14:08:42.000Z | 2022-03-10T04:17:17.000Z | src/d2py/tools/write/release.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 3 | 2021-11-07T13:11:26.000Z | 2022-03-19T03:28:48.000Z | src/d2py/tools/write/release.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 1 | 2022-03-15T14:18:32.000Z | 2022-03-15T14:18:32.000Z | '''代码,可能改变'''
from invoke import task
@task
def install(ctx, name='doc'):
# --use-feature=in-tree-build
ctx.run(f'pip install .[{name}] ')
# namespace = Collection(docs, deploy)
| 14.692308 | 38 | 0.633508 |
045e5f368eabae6bf0f87a44c614e05c252db2b2 | 5,614 | py | Python | beispielanwendungen/hallowelt/hallowelt10_eigenedialoge.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/hallowelt/hallowelt10_eigenedialoge.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/hallowelt/hallowelt10_eigenedialoge.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
import sys
from PyQt4 import QtCore, QtGui
def main(argv):
app = QtGui.QApplication(argv)
mainwindow = MainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MainWindow(QtGui.QMainWindow):
meinSignal = QtCore.pyqtSignal()
def __init__(self, *args):
QtGui.... | 36.69281 | 104 | 0.666726 |
9bd753870d6f410740e6851ca05dd67f66aeea43 | 243 | py | Python | dblp/python/conftest.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | null | null | null | dblp/python/conftest.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | null | null | null | dblp/python/conftest.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | 1 | 2019-11-06T11:29:31.000Z | 2019-11-06T11:29:31.000Z | import findspark
findspark.init()
import logging
import pytest
from pyspark import SparkContext
@pytest.fixture(scope='session')
def with_spark_context():
spark_context = SparkContext("local", "citationstest")
return spark_context
| 17.357143 | 58 | 0.781893 |
9bd7782d23b30891ee0402d04c746c8b3c0bea41 | 633 | py | Python | 7-assets/past-student-repos/Data-Structures-master/python/doubly_linked_list/doubly_linked_list.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Data-Structures-master/python/doubly_linked_list/doubly_linked_list.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Data-Structures-master/python/doubly_linked_list/doubly_linked_list.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | class ListNode:
def __init__(self, value, prev=None, next=None):
self.value = value
self.prev = prev
self.next = next
def insert_after(self, value):
pass
def insert_before(self, value):
pass
def delete(self):
pass
class DoublyLinkedList:
def __init__(self, node=None):
self.head... | 15.439024 | 50 | 0.650869 |
504ee35d6e2da31ab80aa629e72be7e0904a46ee | 3,067 | py | Python | qmk_firmware/lib/python/qmk/cli/bux.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/bux.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/bux.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """QMK Bux
World domination secret weapon.
"""
from milc import cli
from milc.subcommand import config
@cli.subcommand('QMK Bux miner.', hidden=True)
def bux(cli):
"""QMK bux
"""
if not cli.config.user.bux:
bux = 0
else:
bux = cli.config.user.bux
cli.args.read_only = False
co... | 61.34 | 100 | 0.332573 |
c5916359e5d72431df2b5c9e9826c3218944c704 | 253 | py | Python | Problems/Dynamic Programming/Easy/MaxGeneratedArray/test_max_generated_array.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Easy/MaxGeneratedArray/test_max_generated_array.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Easy/MaxGeneratedArray/test_max_generated_array.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from max_generated_array import getMaximumGenerated
class Test(TestCase):
def test_get_maximum_generated(self):
self.assertTrue(getMaximumGenerated(7) == 3)
self.assertTrue(getMaximumGenerated(2) == 1)
| 31.625 | 52 | 0.766798 |
767ad2baa5ca07c56d9b73ddc4713ecc4423cc06 | 9,093 | py | Python | language/template.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | language/template.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | language/template.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
from utils.lib import O
import numpy as np
from collections import deque, OrderedDict
from copy import deepcopy
from operator import mul
__author__ = "bigfatnoob"
class Component(... | 25.614085 | 119 | 0.648631 |
4f3d89a119a7ae4f782b13cef9e6699ec2490e03 | 17,143 | py | Python | Library/google/cloud/firestore_v1beta1/gapic/firestore_admin_client.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | 2 | 2018-02-01T06:30:24.000Z | 2018-04-12T15:39:56.000Z | Library/google/cloud/firestore_v1beta1/gapic/firestore_admin_client.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | 7 | 2020-03-24T15:50:06.000Z | 2021-06-08T19:57:39.000Z | Library/google/cloud/firestore_v1beta1/gapic/firestore_admin_client.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | 1 | 2018-09-19T05:55:27.000Z | 2018-09-19T05:55:27.000Z | # Copyright 2017, Google LLC 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 a... | 39.318807 | 142 | 0.638511 |
8c5196a9f7c1556012a57375507be658800819fc | 1,137 | py | Python | aoc2020/day_08/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_08/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_08/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
class Solution(SolutionABC):
expected, exit_code, pc, ax = 5, 0, 0, 0
program: list = None
trace: set = None
def solve(self) -> any:
self.load_program()
while self.pc < len(self.program):
if self.pc in self.trace:
self.exit_code = 1
... | 24.191489 | 81 | 0.525066 |
507f62fa5505ee4429b8005646cd139c236b0fb2 | 4,479 | py | Python | research/cv/squeezenet1_1/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/squeezenet1_1/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/squeezenet1_1/eval.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... | 40.718182 | 93 | 0.652378 |
fa3b5e7756920b789d762e94147125f340e0c719 | 1,755 | py | Python | Packs/HealthCheck/Scripts/HealthCheckCommonIndicators/HealthCheckCommonIndicators.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/HealthCheck/Scripts/HealthCheckCommonIndicators/HealthCheckCommonIndicators.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/HealthCheck/Scripts/HealthCheckCommonIndicators/HealthCheckCommonIndicators.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
THRESHOLDS = {
'relatedIndicatorCount': 1000,
}
def build_body(tenant_name):
query = f"account:{tenant_name}" if tenant_name != "" else ""
body = {
'page': 0,
'size': 10,
'query': f'{query}'... | 28.770492 | 119 | 0.590883 |
fa5ebf94623f7791fcb559f412d80a5c09463a06 | 3,550 | py | Python | code/sensors/camera/camera_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/camera/camera_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/camera/camera_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | from sensors.camera import camera
from sensors.pipeline import *
def color_filter_pipeline(color="magenta"):
return \
PipelineSequence(
camera.READ_CAMERA_PIPELINE,
camera.ConvertColorspacePipeline(to='hsv'),
camera.ColorThresholdPipeline(color=color),
camer... | 33.809524 | 119 | 0.590986 |
ad53aa1ec44ea7c115a69718b14b2b0d0993e51c | 7,357 | py | Python | src/Sephrasto/DatenbankEditWaffeWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/DatenbankEditWaffeWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/DatenbankEditWaffeWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 18 10:52:34 2017
@author: Aeolitus
"""
import Objekte
import UI.DatenbankEditWaffe
from Hilfsmethoden import Hilfsmethoden, WaffeneigenschaftException
from PyQt5 import QtWidgets, QtCore
from TextTagCompleter import TextTagCompleter
from Fertigkeiten import Kampffertigkei... | 39.132979 | 142 | 0.605002 |
0f4f0b79465c5333da5571a4e9c514551782cdc4 | 929 | py | Python | 02 Hardwaredesign/Grundschaltungen/src/led_pwm_blink.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 02 Hardwaredesign/Grundschaltungen/src/led_pwm_blink.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 02 Hardwaredesign/Grundschaltungen/src/led_pwm_blink.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | 1 | 2020-10-10T20:24:05.000Z | 2020-10-10T20:24:05.000Z | #! ./env/bin/python3
#encoding=utf-8
# Copyright (C) 2019 Dennis Schulmeister-Zimolong
#
# E-Mail: dhbw@windows3.de
# Webseite: https://www.wpvs.de
#
# Dieser Quellcode ist lizenziert unter einer
# Creative Commons Namensnennung 4.0 International Lizenz
"""
Minimalbeispiel einer mit Pulsweitenmodulation zum Blinken g... | 23.225 | 74 | 0.679225 |
0e36357ea582d0e57dfe9a2dd82e1108f0de7c4e | 1,096 | py | Python | cs/lambda_cs/07_computer_architecture/notes/674/lesson.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/07_computer_architecture/notes/674/lesson.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/07_computer_architecture/notes/674/lesson.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Computer Architecture - Day 4
"""
# === Stack frames === #
# Stack grows downward
# 701:
#
# 700: # return point 1 |
# 699: a = 2 | main()'s stack frame
# 698: b = ?? |
#
# 697: # return point 2 |
# 696: x = 2 |
# 695: y = 7 | mult2()'s stack ... | 13.530864 | 73 | 0.491788 |
0e4438b4526dd3446ad66b4e0e667874efe862f0 | 4,730 | py | Python | practices/practice_2/task4.1.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_2/task4.1.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_2/task4.1.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | from libs.can import CANSocket
from libs.myactuator import MyActuator
from time import perf_counter, sleep
import numpy as np
# import getpass
# password = getpass.getpass()
# the serial port of device
# you may find one by examing /dev/ folder,
# this is usually devices ttyACM
# os.system(f"sudo slcand -o -c -s8 /d... | 22.631579 | 175 | 0.569979 |
bc06d3542bbc4ea78df37d43aa38b90c5d777f21 | 26,340 | py | Python | research/cvtmodel/regnet/src/regnet_x_1_6gf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/regnet/src/regnet_x_1_6gf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/regnet/src/regnet_x_1_6gf.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... | 59.863636 | 119 | 0.521336 |
1dd5096658f15855ad9f07df912a3069bdb43a5c | 9,338 | py | Python | tests/test_connectors/test_confluent.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | tests/test_connectors/test_confluent.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | tests/test_connectors/test_confluent.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | import json
import logging
from random import randint
from typing import Any, List, Tuple
from unittest.mock import MagicMock, patch
from uuid import uuid4
import pytest
from pytest import LogCaptureFixture, MonkeyPatch
from example.data_models import InputMessage, OutputMessage
from tests.conftest import KafkaMessag... | 38.427984 | 114 | 0.72553 |
699b0219239116848d7da3660b2b986ed38bb28c | 567 | py | Python | Persistence/log.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | Persistence/log.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | Persistence/log.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | # pylint: disable=C0114
import logging
#pylint: disable=W0611
from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL
#pylint: enable=W0611
# we wrap logging because I want more control in getLogger.
def getLogger(name, fmt=None):
log_ = logging.getLogger(name)
if fmt is not None:
fm_ = logging.For... | 25.772727 | 59 | 0.684303 |
38b2df9c2515dcc0e10d27b97ffc352f3cb3936a | 596 | py | Python | tests/mock/test_base.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | tests/mock/test_base.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | tests/mock/test_base.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | import skil
import sys
import pytest
if sys.version_info >= (3, 3):
import unittest.mock as mock
else:
import mock as mock
@mock.patch('skil.Skil')
def test_skil_mock(Skil):
assert Skil is skil.Skil
skil_server = Skil()
assert Skil.called
skil_server.get_default_server_id = mock.MagicMock(ret... | 19.866667 | 73 | 0.718121 |
38b55e66c43a66681ef4587b0c1f30a1bca82e19 | 1,164 | py | Python | python/en/archive/topics/temp/newspaper_url2txt.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/newspaper_url2txt.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/newspaper_url2txt.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
newspaper_url2txt.py
Package Newspaper3k
Reference
- Newspaper On Python, DANIEL HOADLEY, JANUARY 5, 2017
http://carrefax.com/new-blog/2017/1/5/newspaper-on-python
import Newspaper
"""
from newspaper import Article
import sys
# Configure
script_name = sys.argv[0]
argc = len( sys.argv ... | 23.28 | 59 | 0.681271 |
38c31eeb66fd0e4f3a4e59c3019726f4bc49e155 | 13,340 | py | Python | examples/few_shot/pet/pet.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/few_shot/pet/pet.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/few_shot/pet/pet.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import sys
import random
import time
import json
from functools import partial
import numpy as np
import paddle
import paddle.nn.functional as F
import paddlenlp as ppnlp
from paddlenlp.data import Stack, Tuple, Pad
from paddlenlp.datasets import load_dataset
from paddlenlp.transformers impo... | 41.818182 | 167 | 0.563643 |
38c6dd0e646f6fdbf44249d6ec3b85fde888692b | 864 | py | Python | kts/cli/scripts.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/cli/scripts.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/cli/scripts.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import os
import click
from kts.cli.utils import check_existence, clear_all, list_files, create_config
KTS_PROJECT_PATHS = ['./input', './notebooks', './storage', './output', './submissions']
@click.group()
def cli():
pass
@cli.command()
def init():
"""Initialize empty KTS project.
Create ./input, .... | 24 | 88 | 0.630787 |
2a191dc86bd7b7063e6d80308ffb6904d766c4e7 | 12,550 | py | Python | py/models/inception_resnet_v1.py | zjZSTU/GoogLeNet | a0801e45006d34b4901a8834397961ce17f24e2e | [
"Apache-2.0"
] | 1 | 2021-04-18T15:36:33.000Z | 2021-04-18T15:36:33.000Z | py/models/inception_resnet_v1.py | zjZSTU/GoogLeNet | a0801e45006d34b4901a8834397961ce17f24e2e | [
"Apache-2.0"
] | null | null | null | py/models/inception_resnet_v1.py | zjZSTU/GoogLeNet | a0801e45006d34b4901a8834397961ce17f24e2e | [
"Apache-2.0"
] | 3 | 2020-07-10T11:45:52.000Z | 2022-01-15T08:46:14.000Z | # -*- coding: utf-8 -*-
"""
@date: 2020/4/12 下午3:49
@file: inception_resnet_v1.py
@author: zj
@description:
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class Inception_ResNet_v1(nn.Module):
__constants__ = ['transform_input']
def __init__(self, num_classes=1000, transform_input=... | 29.880952 | 87 | 0.575139 |
2a3c961206b22fc59fa5f02c0fe296322570e925 | 1,739 | py | Python | books/PythonCleanCode/ch4_solid/openclosed_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch4_solid/openclosed_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch4_solid/openclosed_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chater 4
The open/closed principle
Counter-example of the open/closed principle.
An example that does comply with this principle and should be refactored.
"""
class Event:
def __init__(self, raw_data):
self.raw_data = raw_data
class UnknownEvent(Event):
"... | 25.955224 | 80 | 0.60207 |
930e25677fea5ad0eade9badb8cdf47a5077dc8c | 312 | py | Python | USACOClassLiveTest/src/sortfile2.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | USACOClassLiveTest/src/sortfile2.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | USACOClassLiveTest/src/sortfile2.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | import sys
filename = sys.argv[1]
outfile = sys.argv[2]
lines = open(filename, "r").readlines()
def sortByFirstNumber(line):
#print(line.split(" "))
return int((line.split(" "))[0])
lines = sorted(lines, key = sortByFirstNumber)
ofile = open(outfile, "w")
for num in lines:
ofile.write(str(num))
| 26 | 46 | 0.660256 |
fabceebdc0a61f6c8fb053a5cf417962901374d5 | 855 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex12_pattern_checker_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex12_pattern_checker_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex12_pattern_checker_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch04_strings.solutions.ex12_pattern_checker import matches_pattern
@pytest.mark.parametrize("pattern, input, expected",
[("x", "", False),
("", "x", False)])
d... | 35.625 | 71 | 0.596491 |
fad49a3f30e9c3916c16f81c290ebafc15ca26da | 465 | py | Python | pyconuk/migrations/0008_scheduleslot_chair.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/migrations/0008_scheduleslot_chair.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/migrations/0008_scheduleslot_chair.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-12 15:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pyconuk', '0007_page_show_sponsors'),
]
operations = [
migrations.AddField(
... | 22.142857 | 62 | 0.621505 |
ea6714aa93841d6d9632b3382d84543727cf4ae0 | 259 | py | Python | python/cycle_detection.py | higoress/HackerRank | ac13fc378734e70eef08b357bb36c47655d7d0be | [
"MIT"
] | null | null | null | python/cycle_detection.py | higoress/HackerRank | ac13fc378734e70eef08b357bb36c47655d7d0be | [
"MIT"
] | null | null | null | python/cycle_detection.py | higoress/HackerRank | ac13fc378734e70eef08b357bb36c47655d7d0be | [
"MIT"
] | null | null | null | #identify cycles in a linked list
def has_cycle(head):
taboo_list = list()
temp = head
while temp:
if temp not in taboo_list:
taboo_list.append(temp)
temp = temp.next
else:
return 1
return 0
| 21.583333 | 35 | 0.559846 |
579e677fbc15325687e4f3b96043b6d0218adb1f | 8,453 | py | Python | src/aijack/defense/dp/manager/rdp.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/dp/manager/rdp.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/dp/manager/rdp.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | import math
import numpy as np
from scipy import special
from scipy.special import logsumexp
from .utils import _log_add, _log_erfc, _log_sub
def eps_gaussian(alpha, params):
if alpha == math.inf:
return min(
4 * (np.exp(eps_gaussian(2, params) - 1)),
2 * np.exp(eps_gaussian(2, p... | 28.751701 | 93 | 0.519342 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.