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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
155a0ace95bd2b01eeecc571f7a5ae3f012a8ef9 | 400 | py | Python | backend/api/migrations/0005_parking_streetnosuffix.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/migrations/0005_parking_streetnosuffix.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/migrations/0005_parking_streetnosuffix.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-09-11 13:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20210911_1521'),
]
operations = [
migrations.AddField(
model_name='parking',
name='StreetNoSuffix',... | 21.052632 | 61 | 0.605 |
ecd89f2fd66b7ef8ae2b1906759061e3a9ce5f31 | 1,414 | py | Python | fastapi/tutorial-1-2-api-doc/main.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | fastapi/tutorial-1-2-api-doc/main.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | fastapi/tutorial-1-2-api-doc/main.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | # https://fastapi.tiangolo.com/
from typing import Optional
from fastapi import FastAPI
from pydantic import BaseModel
tags_metadata = [
{
"name": "items",
"description": "Manage items",
"externalDocs": {
"description": "Items external docs",
"url": "https://fastapi... | 25.709091 | 95 | 0.6471 |
01d5f1d18cf0092b4e65020169837f333fcabddc | 965 | py | Python | neighbor.py | bariseser/elbow_algorithm | 7dd61404422818ddc777321c439f8e6e50aee41d | [
"MIT"
] | null | null | null | neighbor.py | bariseser/elbow_algorithm | 7dd61404422818ddc777321c439f8e6e50aee41d | [
"MIT"
] | null | null | null | neighbor.py | bariseser/elbow_algorithm | 7dd61404422818ddc777321c439f8e6e50aee41d | [
"MIT"
] | null | null | null | from knn_modules import distance
import operator
def get_neighbors(training_set, test_set, k, metric="euclidean"):
distances = []
length = len(test_set) - 1
for x in range(len(training_set)):
if metric == "euclidean":
dist = distance.euclidean(test_set, training_set[x], length)
... | 31.129032 | 86 | 0.640415 |
bdda582c9ceb5d67c7732145958731784d4ce5ab | 361 | py | Python | pacman-arch/test/pacman/tests/upgrade050.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade050.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade050.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Upgrade package with a conflict == depend (not installed)"
p1 = pmpkg("pkg1")
p1.conflicts = ["pkg2"]
p1.depends = ["pkg2"]
self.addpkg(p1)
p2 = pmpkg("pkg2")
self.addpkg(p2)
self.args = "-U %s" % " ".join([p.filename() for p in (p1, p2)])
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIS... | 22.5625 | 78 | 0.66759 |
e5c10cca4d112eada5c8d5e761e3d023ee4f6e8b | 6,519 | py | Python | service/wkb/quick_response_code/qr_code.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/quick_response_code/qr_code.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/quick_response_code/qr_code.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
# test created on 14-10-28 下午12:48
# Copyright 2014 offbye@gmail.com
"""生成带logo的二维码
参数解释:
version:控制二维码的大小,取值范围从1到40。取最小值1时,二维码大小为21*21。
取值为 None (默认)或者使用fit=true参数(默认)时,二维码会自动调整大小。
error_correction:控制二维码纠错级别。
ERROR_CORRECT_L:大约7%或者更少的错误会被更正。
ERROR_CORRECT_M:默认值,大约15%或者更少的错... | 37.251429 | 329 | 0.645038 |
e5e7c9bbaaef7423306c9acd2b533e5f5e732154 | 13,580 | py | Python | energielenker/energielenker/page/navision_export/navision_export.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | null | null | null | energielenker/energielenker/page/navision_export/navision_export.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | null | null | null | energielenker/energielenker/page/navision_export/navision_export.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | 1 | 2021-08-14T22:22:57.000Z | 2021-08-14T22:22:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import six
import json
from six import BytesIO
import openpyxl
from openpyxl.styles import Font
@frappe.whitelist()
def get_data(suchparamete... | 44.52459 | 416 | 0.574227 |
c1227de6b68065592c989eb9afe15dd651672d46 | 1,237 | py | Python | week3/how_to_use_auto_grad.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 12 | 2020-05-25T08:21:25.000Z | 2022-02-22T09:02:00.000Z | week3/how_to_use_auto_grad.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | null | null | null | week3/how_to_use_auto_grad.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 6 | 2020-06-02T11:54:03.000Z | 2022-02-22T09:03:05.000Z | #coding:utf-8
import torch
# 当x 是一个维度的时候
print("%s%s"%("-"*20,"当x是1x1的时候"))
x = torch.ones(1,1,requires_grad = True)
y = (x+2)*(x+2)*3
y.backward()
print(x.grad)
print("%s%s"%("-"*20,"当x是1x2的时候"))
x = torch.ones(1,2,requires_grad = True)
y = (x+2)*(x+2)*3
z = y.sum()
z.backward()
print(x.grad)
# 如何把autograd用到我们线性... | 22.907407 | 84 | 0.584479 |
e735dee01d7b445986ec638632349b58ff49fa35 | 3,572 | py | Python | example/model_inversion/mi_face.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | example/model_inversion/mi_face.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | example/model_inversion/mi_face.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision.transforms as transforms
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score
from aijack.attack import MI_FACE
from aijack.utils import NumpyDatase... | 29.278689 | 89 | 0.609462 |
4148ecbf287eea6d46a5ad4967d8b3264a974623 | 6,465 | py | Python | WiFiBroot-master/pull.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | WiFiBroot-master/pull.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | WiFiBroot-master/pull.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z |
import sys
import os
import random
__log__ = r'''%s
_ ___ ___ ___ ___ ___
\\ _ /\*\___*\__\\__\/ \ / \\___
\ \\ \\\ \\__\\ /\ ) \\ ) \\ \
\__\\__\\\ \\__\\ \\__ / \___/ \__\
%s
%sv1.0. Coded by @hash3liZer.%s
'''
__mode__='''
Syntax:
$ python wifibroot.py [--mode [modes... | 29.253394 | 86 | 0.539211 |
6ba86f711f4ad45deed9901babcd6fa98f6a74c5 | 1,167 | py | Python | process_gcov.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 5 | 2015-07-28T17:45:21.000Z | 2019-11-24T15:47:01.000Z | process_gcov.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-22T15:21:36.000Z | 2020-05-22T15:38:48.000Z | process_gcov.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-09T21:23:59.000Z | 2020-05-09T21:23:59.000Z | #!/usr/bin/python3
import os, json
from utilities import printing_system
with open("settings.json") as settings_file:
settings_json = json.loads(settings_file.read())
build_location = settings_json["build_location"]
build_location = os.path.abspath(build_location)
gcov_location = settings_json["gcov_loc... | 37.645161 | 79 | 0.625536 |
d40ef50ec9d6f29328c1d35ce445dcf29d3e490a | 951 | py | Python | tests/helpers.py | noirbizarre/pelican-myst | c2c7b44803ebc33e70d915c35b692df14597469b | [
"MIT"
] | null | null | null | tests/helpers.py | noirbizarre/pelican-myst | c2c7b44803ebc33e70d915c35b692df14597469b | [
"MIT"
] | 21 | 2021-12-21T16:47:35.000Z | 2022-03-29T04:34:59.000Z | tests/helpers.py | noirbizarre/pelican-myst | c2c7b44803ebc33e70d915c35b692df14597469b | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Any
from pelican import readers
from pelican.plugins.myst.reader import MystReader
from pelican.settings import DEFAULT_CONFIG
TEST_DIR = Path(__file__).parent
DATA_PATH = TEST_DIR / "data"
def get_settings(**kwargs) -> dict[str, Any]:
settings = DEFAULT_CONFIG.copy()... | 27.970588 | 71 | 0.723449 |
2e004a3f1d4bf5f7def3110d299066125e7c78ab | 6,816 | py | Python | querybig4_pp_parallel.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | querybig4_pp_parallel.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | querybig4_pp_parallel.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from numpy import *
import time
import datetime
import pp
'''
模板以元组的形式保存,例如:('前缀1', '后缀1')
所有模板保存在列表中
'''
seeds = ('北京', '成都', '石家庄', '武汉', '长沙') # 种子(保存在元组中)
file_path = 'querybig_1000000.txt'
def Caltime(date1, date2): # 参考网址:http://blog.csdn.net/zhangdedezhu/article/details/7942344
... | 31.555556 | 111 | 0.613703 |
cf7b429249ddcdd608bbf2ca93044e2826a2d2e8 | 589 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v6_0/fix_planned_qty.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v6_0/fix_planned_qty.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_0/fix_planned_qty.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.stock.stock_balance import get_planned_qty, update_bin_qty
def execute():
for item_code, warehouse in frappe.db.sql("""s... | 39.266667 | 91 | 0.7691 |
d8b1c406c9b5a747b8a6e73206211a0199ce283b | 5,695 | py | Python | casts/migrations/0001_initial.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | casts/migrations/0001_initial.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | casts/migrations/0001_initial.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-19 20:31
import casts.models
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import sorl.thumbnail.fields
class Migration(migrations.Migration):
initial = True
dependencies = [("users", "0002_userphoto")]
ope... | 33.5 | 88 | 0.372432 |
d8d24f610d427837bc7c32b6c37298551c89c875 | 148 | py | Python | python/coursera_python/MICHIGAN/DataStructures/test/a.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/DataStructures/test/a.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/DataStructures/test/a.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | c = {'a':10, 'b':1, 'c':22}
tmp = list()
for k,v in c.items():
tmp.append( (v,k) )
print(tmp)
tmp = sorted(tmp, reverse=True)
print(tmp)
| 8.222222 | 31 | 0.533784 |
51d735f7aa146a26b55506113a62b0469fbfded5 | 475 | py | Python | tools/pythonpkg/tests/fast/types/test_hugeint.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/types/test_hugeint.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/types/test_hugeint.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z |
import numpy
import pandas
class TestHugeint(object):
def test_hugeint(self, duckdb_cursor):
duckdb_cursor.execute('SELECT 437894723897234238947043214')
result = duckdb_cursor.fetchall()
assert result == [(437894723897234238947043214,)]
def test_hugeint_numpy(self, duckdb_cursor)... | 26.388889 | 67 | 0.684211 |
cfc905522f5509963a2c6dec903e78fdd245bffb | 4,062 | py | Python | app/database.py | Inniag/murmeltier-backend | b9512808e4e8a14443216ddccd8bb2f3d37e5a14 | [
"MIT"
] | null | null | null | app/database.py | Inniag/murmeltier-backend | b9512808e4e8a14443216ddccd8bb2f3d37e5a14 | [
"MIT"
] | null | null | null | app/database.py | Inniag/murmeltier-backend | b9512808e4e8a14443216ddccd8bb2f3d37e5a14 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine, select, func
from sqlalchemy import Table, Column, Integer, String, DateTime, MetaData, ForeignKey
from sqlalchemy.dialects.postgresql import UUID
import uuid
import hashlib
import datetime
import os
import random
# get these from environment
MURMEL_POSTGRES_USER = os.getenv("MUR... | 23.754386 | 112 | 0.661497 |
2d30ae08bd6e3d5ff5c14a1a49331f159ad673ec | 214 | py | Python | py_client/update.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | py_client/update.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | py_client/update.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | import requests
endpoint = "http://localhost:8000/api/products/1/update"
data = {"title": "this is the updated title", "price": 76.34}
get_response = requests.put(endpoint, json=data)
print(get_response.json())
| 23.777778 | 61 | 0.728972 |
740c15cf202ff0b94136db22f838060e30832dc6 | 441 | py | Python | demos/Multiscale/uniswap/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/uniswap/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/uniswap/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | import pandas as pd
sys_params = {
'fee_numerator': [997, 997, 997, 997,
995, 995, 995, 995],
'fee_denominator': [1000],
'uniswap_events': [pd.read_pickle('./data/uniswap_events.pickle')],
'fix_cost': [-1], # -1 to deactivate
'retail_precision': [3,3,15,15,
3... | 33.923077 | 71 | 0.53288 |
7495727520ce207b38ebb7726d62f0eb26e71e0e | 2,468 | py | Python | ntlm_cracker/ntlm_cracker.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | ntlm_cracker/ntlm_cracker.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | ntlm_cracker/ntlm_cracker.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python2
#-*- coding:utf-8 -*-
#Created By Unamed
import hashlib
import binascii
import os
import sys
import logging
try:
from datetime import datetime
except ImportError:
print("\033[31m[!] Error Datetime Not Found !")
import time
banner = '''
\033[32m
__ _ _______ _______
| \ | ... | 32.906667 | 145 | 0.519044 |
7ae84f04ee73c8e9fb99903dc5280d49df8b8288 | 6,108 | py | Python | _Dist/ImageRecognition/Main.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/ImageRecognition/Main.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/ImageRecognition/Main.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
import time
import shutil
import imghdr
import argparse
import numpy as np
import tensorflow as tf
from _Dist.ImageRecognition.ToolBox import Pipeline, Extractor
from NN.NN import NNDist
def fetch_img_data(name="_Data"):
img_paths, labels = [], []
data_folder_lst = os.list... | 36.357143 | 113 | 0.562705 |
7007ee7abda220102b281d54768c10b8a7fca5ce | 2,512 | py | Python | src/onegov/town6/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains upgrade tasks that are executed when the application is being
upgraded on the server. See :class:`onegov.core.upgrade.upgrade_task`.
"""
import textwrap
from onegov.town6.theme.town_theme import MERRIWEATHER, ROBOTO_CONDENSED
from onegov.core.upgrade import upgrade_task
from onegov.org.models import Organ... | 25.12 | 74 | 0.60828 |
7045a41d5fccb523b7059bcc475bd600679be376 | 3,586 | py | Python | utest/prim2d_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | utest/prim2d_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | utest/prim2d_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import unittest
import zencad
import os
class Prim2dprobe(unittest.TestCase):
def setUp(self):
zencad.lazy.encache = False
zencad.lazy.decache = False
zencad.lazy.fastdo = True
def test_rectangle_probe(self):
x = 10
y = 20
a = 10
zencad.rectangle(x, y, ... | 38.978261 | 78 | 0.622142 |
3b27183c4c2aff798326ef2903e7c5fa913f071b | 4,697 | py | Python | mysite/test_runbrowser.py | lidia-struzyna/django_projekt | ba15ef43fdf6f765a0f6615ad23e31434ae01bcc | [
"bzip2-1.0.6"
] | null | null | null | mysite/test_runbrowser.py | lidia-struzyna/django_projekt | ba15ef43fdf6f765a0f6615ad23e31434ae01bcc | [
"bzip2-1.0.6"
] | null | null | null | mysite/test_runbrowser.py | lidia-struzyna/django_projekt | ba15ef43fdf6f765a0f6615ad23e31434ae01bcc | [
"bzip2-1.0.6"
] | null | null | null | import unittest
from selenium import webdriver
from django.test import TestCase
import time
from faker import Faker
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
class MyTestCase(unittest.TestCase):
def registerNewUser(s... | 38.818182 | 117 | 0.687247 |
7988ed613333668e2e7812e3a9e2aec3f88023dc | 1,442 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/cache/key_store_cache.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/cache/key_store_cache.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/cache/key_store_cache.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional, Tuple
from watchmen_model.common import TenantId
from watchmen_model.system import KeyStore
from .cache_manager import get_key_store_by_type_cache
from .internal_cache import InternalCache
class KeyStoreCache:
"""
key store cache will not impact other caches
"""
def __init__(s... | 28.84 | 90 | 0.742025 |
79ae5f1ea46178b7edcbe9dca9ee144d21d7609d | 5,739 | py | Python | tests/onegov/ballot/collections/test_elections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ballot/collections/test_elections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ballot/collections/test_elections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.ballot import Election
from onegov.ballot import ElectionCollection
def test_elections_by_date(session):
session.add(Election(
title="first",
domain='federation',
type='majorz',
date=date(2015, 6, 14)
))
session.add(Election(
ti... | 26.693023 | 72 | 0.607597 |
8dc7d174dc3aa42ddf3d4dc063182dcbe6b4450b | 509 | py | Python | IJCTF/2021/crypto/Square_Sum/problem.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | IJCTF/2021/crypto/Square_Sum/problem.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | IJCTF/2021/crypto/Square_Sum/problem.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from Crypto.Util.number import getPrime, inverse, bytes_to_long
from Crypto.Random.random import randint
from secret import MSG, FLAG
p = getPrime(1024)
q = getPrime(1024)
n = p * q
n2 = n**2
halfpq_sqr_sum = (p//2)**2 + (q//2)**2
k = randint(1, n-1)
g = 1 + k*n
r = randint(2, n2-1)
cmsg = (pow(g, bytes_to_long(MS... | 21.208333 | 63 | 0.646365 |
8de90ef5573cda726989382dc42d3664a0b2bf5d | 9,664 | py | Python | shinrl/envs/base/env.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/envs/base/env.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/envs/base/env.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | """
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
from abc import ABC, abstractmethod
from typing import Any, Dict, Optional, Tuple
import gym
import jax
import jax.numpy as jnp
import numpy as np
from chex import Array, PRNGKey
from cpprb import ReplayBuffer
import shinrl as srl
from .config import EnvCon... | 29.553517 | 87 | 0.57709 |
d68db5dd9a0265ab5c542f89d3cbb89cc43310fa | 1,930 | py | Python | zer0pts/2021/web/baby_sqli/public/server.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | zer0pts/2021/web/baby_sqli/public/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | zer0pts/2021/web/baby_sqli/public/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import flask
import os
import re
import hashlib
import subprocess
app = flask.Flask(__name__)
app.secret_key = os.urandom(32)
def sqlite3_query(sql):
p = subprocess.Popen(['sqlite3', 'database.db'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
... | 27.971014 | 78 | 0.58601 |
d68e8a1daf8c72cf2e43f14fb46e5ada3bed996b | 1,878 | py | Python | Aulas/ESP8266/Arduino IDE/wamp_8266/wamp8266-heroku/votos.py | mateusjunges/sistemas-embarcados-2018 | ee70b8900f7cef4422a1d1a83ee254e91cb73462 | [
"MIT"
] | 1 | 2018-12-09T03:43:08.000Z | 2018-12-09T03:43:08.000Z | Aulas/ESP8266/Arduino IDE/wamp_8266/wamp8266-heroku/votos.py | mateusjunges/sistemas-embarcados-2018 | ee70b8900f7cef4422a1d1a83ee254e91cb73462 | [
"MIT"
] | null | null | null | Aulas/ESP8266/Arduino IDE/wamp_8266/wamp8266-heroku/votos.py | mateusjunges/sistemas-embarcados-2018 | ee70b8900f7cef4422a1d1a83ee254e91cb73462 | [
"MIT"
] | 2 | 2018-12-09T03:46:42.000Z | 2018-12-10T00:34:45.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from autobahn import wamp
from autobahn.twisted.wamp import ApplicationSession
from twisted.internet.defer import inlineCallbacks
import json
class VotosBackend(ApplicationSession):
#Construtor usado para inicializacao
def __init__(self, config):
Applicat... | 34.145455 | 92 | 0.632588 |
d6aba3ece20e5611e298e0b9eb5a12bc8f2e39d0 | 510 | py | Python | Grundgeruest/migrations/0004_scholariumprofile_land1.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Grundgeruest/migrations/0004_scholariumprofile_land1.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Grundgeruest/migrations/0004_scholariumprofile_land1.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-04-29 16:30
from __future__ import unicode_literals
from django.db import migrations
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('Grundgeruest', '0003_mitwirkende'),
]
operations = [
... | 23.181818 | 80 | 0.65098 |
79fb9dd87c10c3d4d2972f477ce52c5be54b291c | 5,590 | py | Python | practices/practice_4/task3.1.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_4/task3.1.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | practices/practice_4/task3.1.py | br4ch1st0chr0n3/robotic_systems_labs | 23b8b81dc845e00cf02460258b9cec817019957b | [
"MIT"
] | null | null | null | from matplotlib.pyplot import contour
from libs.can import CANSocket
from libs.myactuator import MyActuator
from time import perf_counter
import numpy as np
# the serial port of device
# you may find one by examing /dev/ folder,
# this is usually devices ttyACM
serial_device = "ttyACM0"
# Initiate the can bus socket
... | 28.666667 | 126 | 0.588551 |
034dced827fe70f52c70f937a23ba2ecea41a2e2 | 895 | py | Python | Packs/Campaign/Scripts/ShowCampaignIncidentsOwners/ShowCampaignIncidentsOwners_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/ShowCampaignIncidentsOwners/ShowCampaignIncidentsOwners_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/ShowCampaignIncidentsOwners/ShowCampaignIncidentsOwners_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import ShowCampaignIncidentsOwners
def demisto_execute_command(command, args):
return [{'Contents': '[{"owner": "owner_1"}, {"owner": "owner_2"}]', 'Type': 3}]
def test_show_incident_owners(mocker):
"""
Given:
- Incident IDs.
When:
- Running the show ow... | 31.964286 | 97 | 0.690503 |
03544414533a33cbd13c2841f38469ef2e5ecd4a | 25,079 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/HTSeq-0.6.1p1-py2.7-linux-x86_64.egg/HTSeq/StepVector.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | ABLIRC/install/external_lib/HTSeq/StepVector.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:16:03.000Z | 2020-02-25T13:16:03.000Z | ABLIRC/install/external_lib/HTSeq/StepVector.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | 44.153169 | 120 | 0.70246 |
036474c69944c1d76c1257d6a7f83e44fd9aa9d5 | 1,358 | py | Python | src/onegov/winterthur/models/address.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/models/address.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/models/address.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import Text
class WinterthurAddress(Base):
__tablename__ = 'winterthur_addresses'
#: the adress id
id = Column(Integer, nullable=False, primary_key=True)
#: the street
street_id = Colum... | 24.25 | 73 | 0.634757 |
06702630d81649ab8edde7909122adafcf57a8fa | 1,073 | py | Python | 2-resources/_PYTHON/code-examples-master/aws/python/rds/list_rds_tags_per_db.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/aws/python/rds/list_rds_tags_per_db.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/aws/python/rds/list_rds_tags_per_db.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | import boto3
session = boto3.Session(
region_name='eu-west-1',
profile_name='test'
)
missing_tag_value = 'N/A'
rds = session.client('rds')
response = rds.describe_db_instances()
rds_resource_arns = []
for rds_db_id in response['DBInstances']:
rds_resource_arns.append(rds_db_id['DBInstanceArn'])
def get_resource... | 24.953488 | 111 | 0.739049 |
ebf0487f0eb906691152907ad42d6061852d99da | 3,145 | py | Python | tools/rotate_mol_vasp.py | cwandtj/A2P2 | a5999f6dbcd7da194fbded8b8c113affdb419c3b | [
"MIT"
] | 1 | 2017-08-25T07:46:30.000Z | 2017-08-25T07:46:30.000Z | tools/rotate_mol_vasp.py | cwandtj/A2P2 | a5999f6dbcd7da194fbded8b8c113affdb419c3b | [
"MIT"
] | null | null | null | tools/rotate_mol_vasp.py | cwandtj/A2P2 | a5999f6dbcd7da194fbded8b8c113affdb419c3b | [
"MIT"
] | null | null | null | #################################################
## rotate_mol_vasp.py #
## Decription: Rotate a molecule from POSCAR #
## Developver: feihoom82@gmail.com #
## Date: 2018-05-02 #
#################################################
### Start of Seting ###
center = 65 # Index of the center atom
ids_mol = ... | 31.767677 | 134 | 0.609539 |
ccd322fadef54eec42faff4da7028a861acf7b13 | 7,300 | py | Python | 2018/quals/crypto-dm-col/not_des.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2018/quals/crypto-dm-col/not_des.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2018/quals/crypto-dm-col/not_des.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/env python3
#
# 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 ... | 25.978648 | 78 | 0.519589 |
aebd2a383c26777d60cd831a970ff8c669694850 | 2,284 | py | Python | src/assets/experiences/sortierroboter/libs/berrysort.py | TU-Blueberry/bluestberry | fbde8dbcd730fe5c4e69ba15a1208a5c0903aa7d | [
"MIT"
] | 1 | 2022-03-28T17:23:03.000Z | 2022-03-28T17:23:03.000Z | src/assets/experiences/sortierroboter/libs/berrysort.py | TU-Blueberry/bluestberry | fbde8dbcd730fe5c4e69ba15a1208a5c0903aa7d | [
"MIT"
] | null | null | null | src/assets/experiences/sortierroboter/libs/berrysort.py | TU-Blueberry/bluestberry | fbde8dbcd730fe5c4e69ba15a1208a5c0903aa7d | [
"MIT"
] | null | null | null | import os
import random
import js
import numpy as np
from skimage import io
from sklearn import metrics
path = "BlueberryData/TestData/"
class TestDataLoader:
_loaded_test_data = None
def _load_images(self):
# TODO fix for later version
# if not os.path.isdir("BlueberryData/NoisyTestData/")... | 34.606061 | 111 | 0.602452 |
9de3558d4facda48470bbf0c66519d5e9b212846 | 3,598 | py | Python | src/aemter/models.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 1 | 2021-12-20T20:15:26.000Z | 2021-12-20T20:15:26.000Z | src/aemter/models.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | src/aemter/models.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | from django.db import models
from simple_history.models import HistoricalRecords
class Organisationseinheit(models.Model):
"""
Datenbankmodell Organisationseinheit
Felder:
* bezeichnung
* history
* funktionen_ohne_unterbereich_count
"""
bezeichnung = models.CharFie... | 31.561404 | 115 | 0.671484 |
888786bb82f771e821470500cf4e6fbc5bab8da1 | 1,284 | py | Python | etc/shdn_program.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | 1 | 2021-06-15T08:59:02.000Z | 2021-06-15T08:59:02.000Z | etc/shdn_program.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | etc/shdn_program.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null |
# Nach einem Beispiel von
# http://www.netzmafia.de/skripten/hardware/RasPi/Projekt-OnOff/index.html
import RPi.GPIO as GPIO
import subprocess, time, sys, os
# GPIO-Pin 22
PORT = 22
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(PORT, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# Zeitdauer des Tastendrucks
dur... | 21.762712 | 74 | 0.617601 |
c9f3503224e30932503a47dff403e1221cb4ebb3 | 8,500 | py | Python | hardware/chip/rtl872xd/gen_crc_bin.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | hardware/chip/rtl872xd/gen_crc_bin.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | hardware/chip/rtl872xd/gen_crc_bin.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# Copyright (C) 2021 Alibaba Group Holding Limited
"""
Generate the bin files including ota bin and the final bin files for chip rtl872xd.
"""
import sys
import os
import shutil
import subprocess
import platform
home_path = os.path.expanduser("~")
toolchain_path = os.... | 44.041451 | 103 | 0.692353 |
11d9afe842e9863e4dad00533ad7d100b922c000 | 92 | py | Python | languages/python/exercises/concept/strings/strings.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 200 | 2019-12-12T13:50:59.000Z | 2022-02-20T22:38:42.000Z | languages/python/exercises/concept/strings/strings.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 1,938 | 2019-12-12T08:07:10.000Z | 2021-01-29T12:56:13.000Z | languages/python/exercises/concept/strings/strings.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 239 | 2019-12-12T14:09:08.000Z | 2022-03-18T00:04:07.000Z | def extract_message():
pass
def change_log_level():
pass
def reformat():
pass
| 10.222222 | 23 | 0.652174 |
6dca564a5388c5a955a93968c12df10ff8d14d5f | 2,760 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/storage/topic_storage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/storage/topic_storage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/storage/topic_storage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Callable
from watchmen_data_kernel.common import ask_storage_echo_enabled, DataKernelException
from watchmen_model.system import DataSource, DataSourceType
from watchmen_storage import TopicDataStorageSPI
def build_mysql_storage(data_source: DataSource) -> Callable[[], TopicDataStorageSPI]:
from ... | 51.111111 | 114 | 0.853261 |
c9231def9c59aefa86632011d6b8a4799fcb40cf | 1,803 | py | Python | file-management/multimedia/test_check_and_process_multimedia_file_process.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | null | null | null | file-management/multimedia/test_check_and_process_multimedia_file_process.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | 1 | 2022-03-02T10:43:58.000Z | 2022-03-02T10:43:58.000Z | file-management/multimedia/test_check_and_process_multimedia_file_process.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | null | null | null | import unittest
import check_and_process_multimedia_file
class Test_CheckAndProcessMultimediaFile(unittest.TestCase):
TEST_FOLDER_PATH = "D:\\gbesancon\\00-temp\\Photos"
def test_main_no_args_process(self):
valid = check_and_process_multimedia_file.main(["-d", self.TEST_FOLDER_PATH, "-p"])
... | 50.083333 | 162 | 0.701054 |
a31b7f130f07d4eecbb8d7b79cc266d7a46f4fc8 | 1,517 | py | Python | build/lib/AESEncryptor_heureka_code/Exceptions/FileExceptions.py | heureka-code/AESEncryptor-heureka-code | 9b11ed77148971672f6e6113a4411fae56e5712c | [
"MIT"
] | null | null | null | build/lib/AESEncryptor_heureka_code/Exceptions/FileExceptions.py | heureka-code/AESEncryptor-heureka-code | 9b11ed77148971672f6e6113a4411fae56e5712c | [
"MIT"
] | null | null | null | build/lib/AESEncryptor_heureka_code/Exceptions/FileExceptions.py | heureka-code/AESEncryptor-heureka-code | 9b11ed77148971672f6e6113a4411fae56e5712c | [
"MIT"
] | null | null | null | __date__ = "11.03.2021"
__status__ = "Development"
__annotations__ = "Enthält die Exceptions für Passworte"
__doc__ = """
Datei Exceptions:
FileError:
ist die Klasse, von der die anderen File-Exceptions erben.
FileIsEncrypted:
wird ausgelöst, wenn eine Datei reschlüsselt werden soll, die bereits verschlüssel... | 26.155172 | 114 | 0.692156 |
a359da805258bc84baa8c8d3e221c340f98fe5d9 | 857 | py | Python | agspiel/api/ceo.py | KingKevin23/agspiel-python-api | 33e74ff6bee2f9ce353da757bdb99e929acc1a13 | [
"MIT"
] | 1 | 2021-03-09T21:37:41.000Z | 2021-03-09T21:37:41.000Z | agspiel/api/ceo.py | KingKevin23/agspiel-python-api | 33e74ff6bee2f9ce353da757bdb99e929acc1a13 | [
"MIT"
] | 4 | 2020-11-13T19:34:58.000Z | 2021-07-24T16:25:27.000Z | agspiel/api/ceo.py | KingKevin23/agspiel-python-api | 33e74ff6bee2f9ce353da757bdb99e929acc1a13 | [
"MIT"
] | 1 | 2020-08-24T14:38:18.000Z | 2020-08-24T14:38:18.000Z | # Copyright (c) 2021 | KingKevin23 (@kingkevin023)
from datetime import datetime
from .index import Index
class Ceo:
def __init__(self, name: str, index: Index, registrierung_datum: datetime, gesperrt: bool, userprojekt: bool):
self._name: str = name
self._index: Index = index
self._reg... | 25.205882 | 114 | 0.662777 |
286f68b757cfb9e15a7f74d9d3fb08ccd2ce43b3 | 16,788 | py | Python | python-bildungslogin/tests/test_license_retrieval.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/tests/test_license_retrieval.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/tests/test_license_retrieval.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import tempfile
from copy import deepcopy
import pytest
from jsonschema import ValidationError, validate
from mock import Mock, mock_open, patch
from typing import List, Optional, Type
from univention.bildungslogin.exceptions import AuthError, BiloServerError, LicenseNotFoundError, \
Licen... | 41.451852 | 119 | 0.674946 |
9586a68ef3fff53c9b9985dba3600c12234d8f87 | 1,184 | py | Python | bolt/utils/misc.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | bolt/utils/misc.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | bolt/utils/misc.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | import os
import importlib
class attrdict(dict):
__getattr__ = dict.__getitem__
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
def snakecase_to_camelcase(string):
return ''.join(x.title() for x in string.split('_'))
def find_plugins(path):
for file in os.listdir(path):
i... | 23.68 | 115 | 0.566723 |
2501195a9dbe21ca1a90874cdad6e9da67a22b29 | 132 | py | Python | Verzweigungen/Mehrfach/mehrfach.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Verzweigungen/Mehrfach/mehrfach.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Verzweigungen/Mehrfach/mehrfach.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | x = -5
print("x:", x)
if x > 0:
print("x ist positiv")
elif x < 0:
print("x ist negativ")
else:
print("x ist gleich 0")
| 14.666667 | 27 | 0.537879 |
25371b11ea5b18cd22789b2662d4e49c40f11d99 | 1,062 | py | Python | examples/poissonLED.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | examples/poissonLED.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | examples/poissonLED.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | #!/usr/bin/python
"""PoissonLED
LED flashing according to a random Poission Process
"""
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import time, sys, math, random, threading
import RPi.GPIO as gpio
gpio.setmode(gpio.BCM)
def LEDflash(pin, dt):
# flash ... | 23.086957 | 71 | 0.687382 |
66eeceda29d3a3bebbcde147b08f51c8eb49e958 | 2,361 | py | Python | src/wormhole.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/wormhole.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/wormhole.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | """
ID: isaiahl1
LANG: PYTHON2
TASK: wormhole
"""
TASK = 'wormhole'
def readints(fin):
return tuple(int(x) for x in fin.readline().split())
def readint(fin):
return int(fin.readline())
def main(fin, fout):
N = readint(fin)
wormholes = []
for _ in xrange(N):
x, y = readints(fin)
wormholes.append((x, y))
pr... | 20.179487 | 71 | 0.628124 |
af45f1655b35c9ba966d71276c597b13181d13c1 | 216 | py | Python | src/onegov/shared/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/shared/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/shared/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import module_path
def asset(path):
""" Returns the absolute path to an asset path relative to this module. """
return module_path('onegov.shared', 'assets' + '/' + path.lstrip('/'))
| 30.857143 | 79 | 0.685185 |
a5a79d8632bab33769a01735759b686cb1c453dd | 1,265 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex11_bst_checker.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex11_bst_checker.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex11_bst_checker.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch08_binary_trees.util import TreeUtils
from ch08_binary_trees.intro.ExampleTrees import create_integer_number_tree
from ch08_binary_trees.intro.intro_binary_tree_node import BinaryTreeNode
def is_bst(node):
# rekursiver... | 24.326923 | 75 | 0.682213 |
b1bffd3931b132c8ec0ba6e39eb395f3ec32355a | 1,258 | py | Python | src/bo4e/com/regionalepreisgarantie.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/regionalepreisgarantie.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/regionalepreisgarantie.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains RegionalePreisgarantie class
and corresponding marshmallow schema for de-/serialization
"""
import attr
from marshmallow import fields
from bo4e.com.preisgarantie import Preisgarantie, PreisgarantieSchema
from bo4e.com.regionalegueltigkeit import RegionaleGueltigkeit, RegionaleGueltigkeitSchema
# pylin... | 34 | 199 | 0.794118 |
b1fd8ad46ec03e456d032f26f3799175bc670d9b | 1,894 | py | Python | EC3/spider.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | EC3/spider.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | EC3/spider.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from urllib.request import urlopen
import urllib.error as error
import urllib
import lxml
import re
import random
base_url = "https://baike.baidu.com"
url = "https://baike.baidu.com/item/%E6%96%87%E6%9C%AC%E5%88%86%E6%9E%90"
html = urlopen(url).read().decode('utf-8')
soup = BeautifulSoup(... | 31.04918 | 97 | 0.601901 |
3cb1ef0abb9dfedae6ea91675df9fdff48b2fc97 | 1,506 | py | Python | app/email.py | kalbe09/Kicards | ad64cfa808307b10f98f95dbb8cf0350995c3afd | [
"MIT"
] | null | null | null | app/email.py | kalbe09/Kicards | ad64cfa808307b10f98f95dbb8cf0350995c3afd | [
"MIT"
] | null | null | null | app/email.py | kalbe09/Kicards | ad64cfa808307b10f98f95dbb8cf0350995c3afd | [
"MIT"
] | null | null | null | from threading import Thread
from flask import current_app, render_template, url_for
from flask_mail import Message
from . import mail
from . import config
import smtplib
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, token, **kwargs):
a... | 28.961538 | 85 | 0.639442 |
a7258d67b378a526fc5cd6b4e859be39132225c0 | 3,026 | py | Python | app/freelancer/views.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/freelancer/views.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/freelancer/views.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | 1 | 2022-03-06T17:44:49.000Z | 2022-03-06T17:44:49.000Z | from django.db.models.query_utils import Q
from rest_framework import viewsets, mixins, status
from rest_framework.response import Response
from rest_framework.decorators import action
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models... | 29.666667 | 125 | 0.69729 |
5543f823abdd6183fde15b240f70ded4216bab7d | 1,602 | py | Python | School/G12/Document Word Count/main.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | School/G12/Document Word Count/main.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | School/G12/Document Word Count/main.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | def show(msg, typ = 1):
if typ == 1:
print("[INFO]", msg)
elif typ == 2:
print("[WARN]", msg)
elif typ == 3:
print("[ERROR]", msg)
# Opening
show("Document Viewer, made by Makan")
show("------------------------------")
show("Reading data file..")
data = open("DATA.txt", "r", encodin... | 28.607143 | 86 | 0.511236 |
9b2eba2d69d92f5bf79039d197a8be6737682e80 | 94 | py | Python | setup.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 485 | 2020-03-10T20:10:44.000Z | 2022-03-27T16:11:30.000Z | setup.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 682 | 2020-03-17T09:55:12.000Z | 2022-03-28T15:16:24.000Z | setup.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 224 | 2020-03-09T11:42:13.000Z | 2022-03-22T13:16:33.000Z | from setuptools import setup, find_packages
setup(name="scrapers", packages=find_packages())
| 23.5 | 48 | 0.808511 |
fd039288a7bb03cae74fa79a689981a5e4a57d79 | 3,855 | py | Python | kredit_tilgung.py | alfkoehn/Darlehensrechner | 8ff7550d84435a0c41ede52b08e64b24ec37e92b | [
"MIT"
] | null | null | null | kredit_tilgung.py | alfkoehn/Darlehensrechner | 8ff7550d84435a0c41ede52b08e64b24ec37e92b | [
"MIT"
] | null | null | null | kredit_tilgung.py | alfkoehn/Darlehensrechner | 8ff7550d84435a0c41ede52b08e64b24ec37e92b | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Entspricht den Werten des Online-Rechners von
(1) https://www.sparkasse.de/themen/eigenheim-finanzieren/tilgungsfalle.html
(2) https://www.verivox.de/baufinanzierung/tilgungsrechner/
(3)* https://www.finanztip.de/baufinanzierungsrechner/
(4)* https://tilgungsrechner.fmh.de/rechner3/fmh2/tilgungsrech... | 40.578947 | 99 | 0.586511 |
bd07e177a2677b2cd9f9457bf766e495711a8a1f | 2,322 | py | Python | src/test/tests/databases/Xmdv.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/Xmdv.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/Xmdv.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: Xmdv.py
#
# Tests: mesh - 3D point mesh
#
# Defect ID: none
#
# Programmer: Hank Childs
# Date: July 21, 2005
#
# Modifications:
# Brad Whitlock, Wed Aug 10 10:00:45 PDT 2005
# ... | 21.90566 | 78 | 0.666236 |
1fbdb95d244e00c1740185662a7d2ff4248868b0 | 881 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch03_recursion/ex01_fibonacci_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch03_recursion/ex01_fibonacci_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch03_recursion/ex01_fibonacci_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch03_recursion.solutions.ex01_fibonacci import fib_rec, fib_iterative
def input_and_expected():
return [(1, 1), (2, 1), (3, 2), (4, 3),
(5, 5), (6, 8), (7, 13), (8, 21)]
@pytest.mark.parametri... | 23.184211 | 74 | 0.687855 |
1f2334b3e213b22d5616173c8e7688a111d0f4f3 | 703 | py | Python | exercises/ja/test_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/test_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/test_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert [(ent.text, ent.label_) for ent in doc1.ents] == [
("アスムテルダム", "GPE")
], "doc1の固有表現は正しくないようです!"
assert [(ent.text, ent.label_) for ent in doc2.ents] == [
("パリ", "GPE")
], "doc2の固有表現は正しくないようです!"
assert [(ent.text, ent.label_) for ent in doc3.ents] == [
("アーカ... | 31.954545 | 61 | 0.576102 |
2f28b14c14e2c7113130cf3adc555e5b247de29b | 1,394 | py | Python | checkpoint_cli.py | landmark-b/webiot_hackathon2019 | 2f6c38a380d4831a00b1515ee8ad8fb34d78d843 | [
"MIT"
] | null | null | null | checkpoint_cli.py | landmark-b/webiot_hackathon2019 | 2f6c38a380d4831a00b1515ee8ad8fb34d78d843 | [
"MIT"
] | null | null | null | checkpoint_cli.py | landmark-b/webiot_hackathon2019 | 2f6c38a380d4831a00b1515ee8ad8fb34d78d843 | [
"MIT"
] | null | null | null | import socket
import json
import webbrowser
# read config file
f = open("config_cli.json", "r")
config = f.read()
config = json.loads(config) # json to dict
config_str = json.dumps(config)
M_SIZE = 1024
# Serverのアドレスを用意。Serverのアドレスは確認しておく必要がある。
serv_address = ('127.0.0.1', 8890)
# ①ソケットを作成する
sock = socket.socket(so... | 26.807692 | 82 | 0.599713 |
2f51e675c251ce56b982e5a3fac2c4d57766a794 | 130 | py | Python | components/genie_service/utility/crc/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | utility/crc/ucube.py | NotToday666/genie-bt-mesh-stack | a19e58f61b3707505b6b0287f870de0c03840fe6 | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | utility/crc/ucube.py | NotToday666/genie-bt-mesh-stack | a19e58f61b3707505b6b0287f870de0c03840fe6 | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | src = Split('''
crc16.c
crc32.c
''')
component = aos_component('crc', src)
component.add_global_includes('include')
| 16.25 | 40 | 0.638462 |
23a678fda9b6efabf9ab90e1014bf5bc5e08b4dc | 2,027 | py | Python | 28. Implement strStr().py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | 1 | 2018-09-03T23:53:43.000Z | 2018-09-03T23:53:43.000Z | 28. Implement strStr().py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | null | null | null | 28. Implement strStr().py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | null | null | null | """
Example 1:
Input: haystack = "hello", needle = "ll"
Output: 2
Example 2:
Input: haystack = "aaaaa", needle = "bba"
Output: -1
"""
class Solution:
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
if needle == "":
... | 36.196429 | 116 | 0.552541 |
cdbfafb9951512935a2d6bd92d87d926f6c49dc1 | 4,531 | py | Python | comparacion.py | jpcrespo/twanalysis | 16047f22796983464dd6367aab110947e18b1670 | [
"MIT"
] | null | null | null | comparacion.py | jpcrespo/twanalysis | 16047f22796983464dd6367aab110947e18b1670 | [
"MIT"
] | null | null | null | comparacion.py | jpcrespo/twanalysis | 16047f22796983464dd6367aab110947e18b1670 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import font_manager as fm, rcParams
import matplotlib.dates as mdates
from datetime import datetime, timedelta
import locale, os
data1 = np.load('resultados/LuchoXBolivia.npy', allow_pickle=True)
data2 = np.load('resultados/LuisF... | 40.455357 | 196 | 0.708011 |
b565d8360033ab99664dccd3cd743ada839cc2b2 | 5,658 | py | Python | 0CTF/2021/Quals/crypto/cloudpass/task.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | 0CTF/2021/Quals/crypto/cloudpass/task.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | 0CTF/2021/Quals/crypto/cloudpass/task.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
import socketserver
import random
import signal
import string
import struct
from hashlib import sha256
import secrets
import pykeepass
from flag import flag
MAXSIZE = 0x2000
class Task(socketserver.BaseRequestHandler):
def proof_of_work(self):
proof = ''.join([random.choice(s... | 38.489796 | 146 | 0.536409 |
570dd1b8d5c37e7b54336d2476c66bcfea58043a | 63 | py | Python | server/apps/recommendation/__init__.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/recommendation/__init__.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/recommendation/__init__.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | default_app_config = "recommendation.apps.RecommendationConfig" | 63 | 63 | 0.888889 |
f56f37aa549086872a39967744f12a72624f8779 | 30 | py | Python | code/ImportantKeywords.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/ImportantKeywords.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/ImportantKeywords.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | # break, continue, pass, main
| 15 | 29 | 0.7 |
27e6397d0ff119e417956650959442eab4058f6b | 4,121 | py | Python | tests/onegov/gazette/test_views_notice_attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_views_notice_attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_views_notice_attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from freezegun import freeze_time
from onegov.core.utils import module_path
from tests.onegov.gazette.common import accept_notice
from tests.onegov.gazette.common import login_users
from tests.onegov.gazette.common import submit_notice
from pytest import mark
from webtest.forms import Upload
@mark.parametrize("pdf_1,... | 42.484536 | 79 | 0.660277 |
fdb3473c5a022e8bd4afa3038e8721e2fe8c7cdf | 3,111 | py | Python | tests/onegov/wtfs/test_views_invoice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_invoice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_invoice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from freezegun import freeze_time
from onegov.core.request import CoreRequest
from unittest.mock import patch
from webtest.forms import Upload
def test_views_invoices(client):
# Add a municipality with dates
client.login_admin()
add = client.get('/municipalities').click(href='/add')
add.form['name'] ... | 35.758621 | 78 | 0.640951 |
8ba1afac8a04c15b021b0bc10a6f2fcbd1f9fdec | 3,628 | py | Python | data/augmentation.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | 8 | 2021-03-07T10:25:21.000Z | 2022-02-20T23:57:24.000Z | data/augmentation.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null | data/augmentation.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null | import tensorflow as tf
"""
Implement the augmentation to the image and labels (contains categories and mask)
Note: The accepted image pass to the function is scaled to the range [0, 1]
Image and labels should have type tf.float32
"""
def randomBrightness(image, cat=None, mask=None, max_delta=0.2):
"""randomly... | 36.28 | 83 | 0.670342 |
d0a844015613c80b4e6d0d9becf2e2491665af31 | 1,684 | py | Python | setup.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | setup.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | setup.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | """Setup for pip package."""
from setuptools import Extension, dist, find_packages, setup
class BinaryDistribution(dist.Distribution):
"""This class is needed in order to create OS specific wheels."""
def has_ext_modules(self):
return True
setup(
name="larq-compute-engine",
version="0.0.1"... | 34.367347 | 131 | 0.644893 |
dfa8a83d48da204338b0250109c0d44bfb6f48aa | 3,192 | py | Python | RoundF2019/problem2/main.py | pauvrepetit/KickStart | 72ddb45c810a2ae4697fd0597c9e8f2dc3d35ea9 | [
"MIT"
] | null | null | null | RoundF2019/problem2/main.py | pauvrepetit/KickStart | 72ddb45c810a2ae4697fd0597c9e8f2dc3d35ea9 | [
"MIT"
] | null | null | null | RoundF2019/problem2/main.py | pauvrepetit/KickStart | 72ddb45c810a2ae4697fd0597c9e8f2dc3d35ea9 | [
"MIT"
] | null | null | null | import bisect
def getSubSkill(skillList):
length = len(skillList)
for i in range(length):
skillList[i] = int(skillList[i]) + 1000
skillList.sort()
subSkillList = []
skillStr = ''
for i in range(length):
subSkillList.append(int(skillList[i]))
skillList[i] = str(skillList[... | 44.957746 | 106 | 0.62312 |
39fd77604e30be9487b2efa26dd5aebd740e27ae | 5,913 | py | Python | workshop/pre_build.py | sparkgene/aws-iot-edukit-tutorials | c4508192a3807336017c8fe1ed49ea4465cfa45f | [
"MIT-0"
] | 41 | 2020-05-06T12:11:04.000Z | 2022-03-20T21:48:04.000Z | workshop/pre_build.py | sparkgene/aws-iot-edukit-tutorials | c4508192a3807336017c8fe1ed49ea4465cfa45f | [
"MIT-0"
] | 13 | 2019-09-21T16:25:14.000Z | 2021-09-27T17:12:09.000Z | workshop/pre_build.py | sparkgene/aws-iot-edukit-tutorials | c4508192a3807336017c8fe1ed49ea4465cfa45f | [
"MIT-0"
] | 26 | 2020-05-09T19:31:07.000Z | 2021-12-07T05:38:49.000Z | import json
import toml
import os
import requests
import logging
import datetime
import boto3
from boto3.dynamodb.conditions import Key, Attr
from requests_aws4auth import AWS4Auth
from botocore.utils import ContainerMetadataFetcher
logger = logging.getLogger()
def main():
# Parameters from ENV
region = os.env... | 36.726708 | 101 | 0.579232 |
2659ddc20812fa56f73a6f3e72df661ae2efb854 | 177 | py | Python | 2-resources/Lambda-weeks/m7/71e1/cs-sprint-challenge-hash-tables-master/hashtables/ex4/ex4.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/Lambda-weeks/m7/71e1/cs-sprint-challenge-hash-tables-master/hashtables/ex4/ex4.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/Lambda-weeks/m7/71e1/cs-sprint-challenge-hash-tables-master/hashtables/ex4/ex4.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | def has_negatives(a):
"""
YOUR CODE HERE
"""
# Your code here
return result
if __name__ == "__main__":
print(has_negatives([-1, -2, 1, 2, 3, 4, -4]))
| 14.75 | 50 | 0.542373 |
cd897afd926ae7a23d08fe401988e46a43e45447 | 2,110 | py | Python | SleekSecurity/layers/plugins/fingerprint/header/header.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/header/header.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/header/header.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt
from re import findall,search,I
from lib.utils.printer import *
class header:
def __run__(self,header):
x... | 39.074074 | 136 | 0.694313 |
f84ac55cf3a9f99aa0342e4d4bbbb9f3967d4bed | 1,518 | py | Python | packages/watchmen-model/src/watchmen_model/admin/pipeline_action.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_action.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_action.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from enum import Enum
from typing import Union
from pydantic import BaseModel
from watchmen_model.common import DataModel, FactorId, ParameterJoint, PipelineActionId, TopicId
class SystemActionType(str, Enum):
ALARM = 'alarm',
COPY_TO_MEMORY = 'copy-to-memory',
WRITE_TO_EXTERNAL = 'write-to-external'
class Rea... | 19.973684 | 110 | 0.761528 |
e41c5264fe110bdedc2e1f3b51a6cf77dd0876ab | 1,732 | py | Python | scripts/aiven/service_type_config.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 13 | 2021-05-04T07:46:38.000Z | 2022-03-31T15:46:59.000Z | scripts/aiven/service_type_config.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 656 | 2021-04-16T12:05:11.000Z | 2022-03-31T19:33:26.000Z | scripts/aiven/service_type_config.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 24 | 2021-04-21T04:17:13.000Z | 2022-03-31T19:14:39.000Z | import requests
import argparse
def print_row(param, value_type, title, desc, indent=0):
preamble = ''
for i in range(indent):
preamble = preamble + ' '
print(f"{preamble}{param} => *{value_type}*")
print(f"{preamble} **{title}** {desc}")
print("")
def print_service_type_docs(service_... | 27.935484 | 76 | 0.542148 |
e471d234ca5bb58a1f60beec876ec32d33f2ce6d | 1,357 | py | Python | Packs/Kafka/Integrations/Kafka_V2/test_data/kafka_client_example.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Kafka/Integrations/Kafka_V2/test_data/kafka_client_example.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Kafka/Integrations/Kafka_V2/test_data/kafka_client_example.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pykafka
from pykafka.common import OffsetType
# Example demonstrating how to fetch 5 messages and then fetch another 5 from the point we left off
# running using: python kafka_client_example.py
def consume_messages(topic, offsets, max):
part_offset_dict = {}
# default consumer starts from beginning
... | 33.097561 | 112 | 0.696389 |
90113a4e0f4e90bb6ab449339b79fee6b639e0a5 | 7,219 | py | Python | vae2gan/core/network.py | x6rulin/AiLab | b810590d4da645915b8472554794d0c6908109e3 | [
"MIT"
] | null | null | null | vae2gan/core/network.py | x6rulin/AiLab | b810590d4da645915b8472554794d0c6908109e3 | [
"MIT"
] | null | null | null | vae2gan/core/network.py | x6rulin/AiLab | b810590d4da645915b8472554794d0c6908109e3 | [
"MIT"
] | null | null | null | """Generator (Decoder) and Critic (Encoder) networks."""
from math import sqrt, log2
import torch
from vae2gan.ganlib.normalize import pixel_norm, instance_norm, minibatch_stddev_layer
from vae2gan.ganlib.eqlr import Linear, Conv2d
from vae2gan.ganlib.scale import UpscaleConv2d, ConvDownscale2d
def _normalization(ke... | 40.329609 | 100 | 0.59565 |
8a06d1c4e6b4952a9573bc151d055d5db599390c | 1,121 | py | Python | Projects/Opencv/mouse events.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2021-10-04T05:41:43.000Z | 2021-10-04T05:41:43.000Z | Projects/Opencv/mouse events.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Projects/Opencv/mouse events.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
#There are different type of mouse events in opencv like left click,right click etc..
# events =[i for i in dir(cv2) if "EVENT" in i]
# print(events)
#callback function
def click_event(event,x,y, flags,param):
if event ==cv2.EVENT_LBUTTONUP:#Left click on the window display the co... | 33.969697 | 116 | 0.652988 |
76f50a8746e024976e3ae4c1621ae4139cdc3452 | 9,960 | py | Python | official/cv/retinanet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/retinanet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/retinanet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.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... | 38.90625 | 114 | 0.595582 |
6aa7364d9c77cc84ed37f8e975e16e0b2fe3ee4a | 1,046 | py | Python | fmod_tool/default_settings.py | hurbeana/fmod_tool | ed6a1c44906b1efd454de5fb03d305362e27a18d | [
"MIT"
] | 1 | 2020-06-12T11:51:44.000Z | 2020-06-12T11:51:44.000Z | fmod_tool/default_settings.py | hurbeana/fmod_tool | ed6a1c44906b1efd454de5fb03d305362e27a18d | [
"MIT"
] | null | null | null | fmod_tool/default_settings.py | hurbeana/fmod_tool | ed6a1c44906b1efd454de5fb03d305362e27a18d | [
"MIT"
] | null | null | null | from pathlib import Path
settings_file = Path.cwd() / "settings.yml"
done_path = Path.cwd() / "done"
not_done_path = Path.cwd() / "not_done"
names_txt_path = Path.cwd() / "names.txt"
default_settings = \
"""# Please enter the maximum points available here (key = exercise Nr., value = max points)
"Maximum Points":... | 29.885714 | 113 | 0.631931 |
7c76779c521600b7f2e33821aaedf553c7566395 | 1,934 | py | Python | training_mode/swin_training/optimizer.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1 | 2022-02-07T02:03:37.000Z | 2022-02-07T02:03:37.000Z | training_mode/swin_training/optimizer.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | training_mode/swin_training/optimizer.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
from torch import optim as optim
def build_optimizer(model, lr, weight... | 33.344828 | 98 | 0.593588 |
7c97ee51a6300981fe41c73f18ec3f5703fbbbb0 | 1,653 | py | Python | display_info.py | PabloFreitasUfsc/bist-du-da | 551dc29ec07bc182e12d86d4ee5e103a98089de4 | [
"MIT"
] | null | null | null | display_info.py | PabloFreitasUfsc/bist-du-da | 551dc29ec07bc182e12d86d4ee5e103a98089de4 | [
"MIT"
] | null | null | null | display_info.py | PabloFreitasUfsc/bist-du-da | 551dc29ec07bc182e12d86d4ee5e103a98089de4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
# Created By : Pablo Freitas Santos
# Created Date: 19.07.2021
# =============================================================================
"""The Module Has Been Build for..."""
# Referenc... | 25.045455 | 79 | 0.450696 |
7cfd1913eeba43b039412f23cbcc81d7d980f97e | 814 | py | Python | tag_1/p_3_1_summe_einer_reihe.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_3_1_summe_einer_reihe.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_3_1_summe_einer_reihe.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
3 for/while-Schleifen (Tag 1)
3.1 Bilde folgende Summe für ein vorher festgelegtes n:
summe(k=1, limit=n, ausdruck=1 / x)
Beispiel:
- n = 100
- Ergebnis der Summierung: 5.187377517639621
Hinweis:
- Die Lösung kann sowohl mit 'for' als auch mit 'while' realisiert werden.
"""
def summef(*... | 22 | 78 | 0.589681 |
d4f5d076263589487d89ab11ab78bb35e866423f | 12,909 | py | Python | methods/transformers/src/transformers/tokenization_roberta.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/src/transformers/tokenization_roberta.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/src/transformers/tokenization_roberta.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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... | 48.713208 | 127 | 0.639476 |
ed5d36e292cb692946128a90cda6c6b7c66cd29e | 6,770 | py | Python | paddlenlp/taskflow/text_generation.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/taskflow/text_generation.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/taskflow/text_generation.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# Copyright (c) 2021 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 req... | 35.631579 | 103 | 0.609306 |
92c41ecd4bb50eaa5289ecb2ad0ae4cf4910ef4f | 4,598 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/11_brute_force_pdf/11_brute_force_pdf.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/11_brute_force_pdf/11_brute_force_pdf.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/11_brute_force_pdf/11_brute_force_pdf.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 11_brute_force_pdf.py
# In diesem Übungsbeispiel geht es darum ein verschlüsseltes PDF zu knacken mittels der
# Dictionary-Attack- oder Brute-Force-Methode
import os, PyPDF2
os.chdir(os.path.dirname(__file__))
bruteforce_characters=[' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l'... | 34.833333 | 87 | 0.512397 |
13800d9342524c3bca023d858946d5f0351c2256 | 4,226 | py | Python | 0-notes/job-search/SamplesDSAlgos/sort/sort_tim.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/sort/sort_tim.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/sort/sort_tim.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # https://www.geeksforgeeks.org/timsort/
'''
TimSort is a sorting algorithm based on Insertion Sort and Merge Sort.
A stable sorting algorithm works in O(n Log n) time
Used in Java’s Arrays.sort() as well as Python’s sorted() and sort().
First sort small pieces using Insertion Sort, then merges the pieces using
... | 29.971631 | 87 | 0.560104 |
13ac46eab877a14fb8026a0298e7e6859931b7b5 | 3,118 | py | Python | pyhokchew/models/CikLinSyllable.py | MindongLab/PyHokchew | 7d742ab5547d2da8c214bd1ebd80f9b6f963965d | [
"MIT"
] | 3 | 2018-04-05T12:04:08.000Z | 2020-04-30T14:00:58.000Z | python/pyhokchew/models/CikLinSyllable.py | MindongLab/libhokchew | 7e5b2e11377ec57bf9a5bb8bb66be6d99237640c | [
"MIT"
] | 6 | 2020-04-25T05:20:04.000Z | 2021-08-30T09:08:50.000Z | python/pyhokchew/models/CikLinSyllable.py | MindongLab/libhokchew | 7e5b2e11377ec57bf9a5bb8bb66be6d99237640c | [
"MIT"
] | 1 | 2018-04-05T11:52:07.000Z | 2018-04-05T11:52:07.000Z | FINALS_CEIK = ['春','花','香','秋','山','開','嘉','賓','歡','歌',
'須','杯','孤','燈','光','輝','燒','銀','釭','之',
'東','郊','過','西','橋','雞','聲','催','初','天',
'奇','歪','溝']
FINALS_LING = ['公','瓜','姜','周','干','哉','佳','京','官','高',
'車','盃','姑','庚','光','龜','嬌','恭','綱','箕',
... | 33.526882 | 118 | 0.480436 |
13d59c83ea3f2f0d6f708491203577356f62d427 | 2,794 | py | Python | oneflow/python/test/ops/test_pad.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/ops/test_pad.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/ops/test_pad.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.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... | 34.493827 | 86 | 0.499642 |
b98bce39a87fa4928054816103c05adf49c84e83 | 1,589 | py | Python | dcapy/filters/filters.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | dcapy/filters/filters.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | dcapy/filters/filters.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from scipy import stats
from datetime import datetime, date
def zscore(x:np.ndarray,y:np.ndarray,thld:float=2)->np.ndarray:
"""zscore. Filter for time series production. Estimate the first order derivative of
the natural logaritmic of rate with respect to time. Return ... | 21.472973 | 91 | 0.58842 |
6a0a076589084fe481e0b844fd897cf24ff8a56c | 394 | py | Python | pkgs/all-pkgs/b/build-python-package/run_setup.py | ccce/nixpkgs | e647f8a7f34254de0145c35950c1d6f1c93ea3da | [
"MIT"
] | 64 | 2016-01-06T09:46:17.000Z | 2022-03-23T03:07:34.000Z | pkgs/all-pkgs/b/build-python-package/run_setup.py | ccce/nixpkgs | e647f8a7f34254de0145c35950c1d6f1c93ea3da | [
"MIT"
] | 93 | 2016-01-02T18:27:38.000Z | 2021-03-15T16:50:09.000Z | pkgs/all-pkgs/b/build-python-package/run_setup.py | ccce/nixpkgs | e647f8a7f34254de0145c35950c1d6f1c93ea3da | [
"MIT"
] | 13 | 2016-01-15T19:03:55.000Z | 2021-06-25T16:54:54.000Z | import setuptools
import tokenize
# This is a setuptools shim so that setuptools is imported before distutils.
# Based on pip's: https://github.com/pypa/pip/pull/3265
# https://github.com/pypa/pip/blob/master/pip/utils/setuptools_build.py
__file__='setup.py'
f=getattr(tokenize, 'open', open)(__file__)
code=f.read().... | 26.266667 | 76 | 0.730964 |
e0052735864c19cf2fa045dd9263a6395ed75d84 | 1,246 | py | Python | caffe_analyser.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 794 | 2018-09-06T07:38:41.000Z | 2022-03-16T06:30:37.000Z | caffe_analyser.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 111 | 2018-12-04T11:18:27.000Z | 2022-03-31T07:39:11.000Z | caffe_analyser.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 221 | 2018-11-22T08:11:03.000Z | 2022-03-16T07:11:43.000Z | # coding=utf-8
from __future__ import absolute_import
import argparse
from analysis.CaffeA import *
from Caffe import caffe_net
from analysis.utils import save_csv
"""
Before you analyse your network, [Netscope](http://ethereon.github.io/netscope/#/editor)
is recommended to visiualize your network.
Command:`python ca... | 42.965517 | 137 | 0.753612 |
e045f830e38a149ba27918917ccfa89e82914295 | 11,468 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/icx/test_icx_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/icx/test_icx_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/icx/test_icx_vlan.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright: (c) 2019, 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
from ansible_collections.community.general.tests.unit.compat.mock import patch
from ansible_collecti... | 40.957143 | 139 | 0.571416 |
e06df0fac82584c08af7987c812e1e473a0aad33 | 516 | py | Python | exercises/zh/test_02_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/test_02_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/test_02_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"list(doc.ents) + [span]" in __solution__
), "你有将span添加到doc.ents里吗?"
assert (
"span_root_head = span.root.head" in __solution__
), "你有得到span的根词符的头吗?"
assert (
"print(span_root_head.text" in __solution__
), "你有打印出span的根头词符的文本吗?"
ents = [ent for ent... | 30.352941 | 59 | 0.622093 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.