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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dbdf4681c8315c30d07f86ec062381cf7da9e8d5 | 1,342 | py | Python | spider/Config_2019.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/Config_2019.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/Config_2019.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# got文件、MongoDB数据库和Redis数据库配置文件
import os
import sys
import pymongo
# import redis
def get_noau_config():
# got文件
if sys.version_info[0] < 3:
# print('import got')
import got
else:
# print('import got333333333333333333333333333')
# import got
i... | 27.958333 | 81 | 0.655738 |
0edd2dee96976c08dc40974f087649b10764b73a | 6,196 | py | Python | sample/rpz-sensor/python3/tsl2572.py | yappy/RpzIrSensor | 8ff11ad594e81380975ff84e2394ff0834d380cf | [
"MIT"
] | null | null | null | sample/rpz-sensor/python3/tsl2572.py | yappy/RpzIrSensor | 8ff11ad594e81380975ff84e2394ff0834d380cf | [
"MIT"
] | null | null | null | sample/rpz-sensor/python3/tsl2572.py | yappy/RpzIrSensor | 8ff11ad594e81380975ff84e2394ff0834d380cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
TSL2572 Control Module via I2C
2018/11/15
"""
import smbus
import time
class TSL2572:
AGAIN_0_16 = 0
AGAIN_1 = 1
AGAIN_8 = 2
AGAIN_16 = 3
AGAIN_120 = 4
ATIME_50MS = 0xED
ATIME_200MS = 0xB6
ATIME_600MS = 0x24
def __init__(self, i2c_addr):
self.... | 29.932367 | 96 | 0.551323 |
1600965384d4954b6c890ff800eb7a1c2fbb9595 | 701 | py | Python | solutions/MFA/webserver/src/deep_speaker/encode.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-04-06T06:13:20.000Z | 2021-04-06T06:13:20.000Z | solutions/MFA/webserver/src/deep_speaker/encode.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/MFA/webserver/src/deep_speaker/encode.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import numpy as np
import random
from deep_speaker.audio import read_mfcc
from deep_speaker.batcher import sample_from_mfcc
from deep_speaker.constants import SAMPLE_RATE, NUM_FRAMES
from deep_speaker.conv_models import DeepSpeakerModel
from deep_speaker.test import batch_cosine_similarity
def voc_to_vec(voc):
np... | 33.380952 | 117 | 0.7903 |
16c17e40745319deae0b17ecebfaee869a182247 | 1,062 | py | Python | examples/flask_caching.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 1 | 2022-03-01T07:38:32.000Z | 2022-03-01T07:38:32.000Z | examples/flask_caching.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 12 | 2021-07-13T12:33:36.000Z | 2021-07-14T05:25:19.000Z | examples/flask_caching.py | xinetzone/dash-book | 1f624e87e2aa02c9931318918df969e44bdd2c07 | [
"Apache-2.0"
] | null | null | null | import datetime
import os
from dash import dcc, html
from dash.dependencies import Input, Output
from flask_caching import Cache
from app import app
cache = Cache(app.server, config={
# try 'filesystem' if you don't want to setup redis
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': os.environ.get('REDIS_URL', ... | 27.947368 | 76 | 0.644068 |
bc7333e25a48def30179d76d4ea3dfb0cdb7dabd | 21 | py | Python | __init__.py | dustinmaurer/options-strategy-backtester | 1974bfd672d163a39f928208f36a8470a99e1a48 | [
"MIT"
] | null | null | null | __init__.py | dustinmaurer/options-strategy-backtester | 1974bfd672d163a39f928208f36a8470a99e1a48 | [
"MIT"
] | null | null | null | __init__.py | dustinmaurer/options-strategy-backtester | 1974bfd672d163a39f928208f36a8470a99e1a48 | [
"MIT"
] | 1 | 2021-04-11T07:18:55.000Z | 2021-04-11T07:18:55.000Z | from . import option
| 10.5 | 20 | 0.761905 |
4c4069bc986efb5251f07ea9fc42f08bfe83c3a3 | 855 | py | Python | chord_rec/datasets/vec_datasets.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/datasets/vec_datasets.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/datasets/vec_datasets.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | from torch.utils.data import Dataset
import numpy as np
class Vec45Dataset(Dataset):
def __init__(self, note_vec_seq, chord_seq, vocab):
'Initialization'
self.note_vec_seq = note_vec_seq
self.chord_seq = chord_seq
self.vocab = vocab
def __len__(self):
'Get the total leng... | 25.147059 | 79 | 0.625731 |
4c6eade565b287a3e519871de24a1eb1cee990c9 | 3,010 | py | Python | test/test_npu/test_network_ops/test_dim_arange.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_dim_arange.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_dim_arange.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 41.232877 | 82 | 0.701661 |
9121defb61945cae4cade362dbee1b1b6c95fa15 | 21,859 | py | Python | deprecated/examples/deepFM/distribute_base.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/examples/deepFM/distribute_base.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/examples/deepFM/distribute_base.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | #!/usr/bin/python
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 41.795411 | 115 | 0.613386 |
e6a062d0572ef02718e8fbdebe1537c58e1ff6a3 | 838 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/maf_print_chroms.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/maf_print_chroms.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/maf_print_chroms.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/python2.7
"""
Read a maf from stdin and print the chromosome number for each alignment. It
searches for 'chr' in each alignment block src, and may not be robust if other
src formats are used.
NOTE: See 'align_print_template.py' for a more general variation of this
program.
usage: %prog refindex [op... | 22.052632 | 78 | 0.695704 |
e6d3f8b600851c189da362904eab887decd97dd9 | 443 | py | Python | zencad/examples/Models/organizer/assembly.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/Models/organizer/assembly.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/Models/organizer/assembly.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import case
import organizer
from zencad import *
w = 27
h = 20
l = 64
t = 1.5
r = 27 / 2 - 4
z = 1
s = 0.965
d = 5
d2 = 5
m = 3
n = 5
st = organizer.organizer(m, n, w, h, l, t, d, d2)
cs = case.case(w, h, l, t, r, z, s)
ucs = union(
[
cs.translate(t * 1.5 + (w + t) * i, 0, t + ... | 12.657143 | 63 | 0.489842 |
fc63a193df46720c73df607e84a4485a4acadc4d | 4,043 | py | Python | projects/001-geburtstag/Firecat.py | gaylordmartin179/start-projects | 094c7b3ab379bea39eabb31174e479307f9a3af0 | [
"MIT"
] | null | null | null | projects/001-geburtstag/Firecat.py | gaylordmartin179/start-projects | 094c7b3ab379bea39eabb31174e479307f9a3af0 | [
"MIT"
] | 2 | 2021-04-04T09:16:43.000Z | 2021-04-07T08:53:53.000Z | projects/001-geburtstag/Firecat.py | gaylordmartin179/start-projects | 094c7b3ab379bea39eabb31174e479307f9a3af0 | [
"MIT"
] | 2 | 2021-04-04T09:19:31.000Z | 2021-05-02T15:06:50.000Z | #
# Firecat's birthday task code
#
import os
names = []
birthdays = []
def get_cmd():
cmd = input()
if cmd:
return cmd.split(" ")
else:
print("Please enter something as a command.\n")
return
def exe_cmd(cmd):
base_cmd = cmd[0]
if base_cmd == "help":
print("help: ... | 36.754545 | 118 | 0.509523 |
5d0e09d93b212966e3392eaa84308543f3b04d3f | 709 | py | Python | WiSe-2122/Wiederholung/Vorlesung/kontrollstrukturen-ausnahmebehandlungen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Wiederholung/Vorlesung/kontrollstrukturen-ausnahmebehandlungen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Wiederholung/Vorlesung/kontrollstrukturen-ausnahmebehandlungen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | richtige_eingabe = False
while not richtige_eingabe:
try:
# Inhaltliche Prüfung der Variablen
a = int(input("Bitte geben Sie eine Zahl ein: "))
b = int(input("Bitte geben Sie eine zweite Zahl ein: "))
if a > b:
print(a, "ist größer als", b)
richtige_eingabe =... | 35.45 | 79 | 0.572638 |
53de4ed232ee780b58dc033dbcc6a4c83d45a927 | 1,484 | py | Python | LF7/EMail/1Stunde.py | JohannesMuelle/workshops | af9140159e3872aff75864ced99b5163d7bba1ba | [
"CC0-1.0"
] | 5 | 2016-07-07T09:00:31.000Z | 2017-03-09T22:46:33.000Z | LF7/EMail/1Stunde.py | JohannesMuelle/workshops | af9140159e3872aff75864ced99b5163d7bba1ba | [
"CC0-1.0"
] | null | null | null | LF7/EMail/1Stunde.py | JohannesMuelle/workshops | af9140159e3872aff75864ced99b5163d7bba1ba | [
"CC0-1.0"
] | 8 | 2016-05-13T14:29:06.000Z | 2019-10-20T16:43:32.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, subprocess
import sys, traceback
import crypt
print("Kopiere: .my.cnf kann das Passwort und Benutzername von MySQL-Nutzern hinterlegt werden. Achtung: Sicherheitsrisiko!")
cmd1 = os.system("cp my.cnf ~/.my.cnf")
# Update Upgrade
print("Update und Upgrade des Be... | 49.466667 | 125 | 0.724394 |
4aeea47200170052629377961f8ba8cc3b36c93f | 2,513 | py | Python | py-td3-cinema/gui/edit.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td3-cinema/gui/edit.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td3-cinema/gui/edit.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from gi.repository import Gtk
allValues = {}
struct = None
removeID = 0
def create(builder, s):
"""Edite une Struct dans l'interface utilisateur."""
global allValues, struct, removeID
allValues = {}
struct = s
builder.get_object("indexList").hide()
builder.get_ob... | 27.315217 | 80 | 0.68842 |
db68614f2cc9f1f2f998d1580306625cae561358 | 577 | py | Python | 数据结构/NowCode/5_ReplaceSpace.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/5_ReplaceSpace.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/5_ReplaceSpace.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | # 替换空格
# 请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
class Solution:
# s 源字符串
def replaceSpace(self, s):
return s.replace(' ', '%20')
def replaceSpace2(self, s):
strLen = len(s)
aaa = []
for i in range(0, strLen):
if s[i] == " ... | 27.47619 | 81 | 0.506066 |
535f8bdaa8e6e41f06359cf8a97ab1ad425aa3c6 | 4,073 | py | Python | bazzell/www/basket.py | libracore/bazzell | f4cf4ec5b9f264f68d853e7b946fd49bd0d5e4d9 | [
"MIT"
] | null | null | null | bazzell/www/basket.py | libracore/bazzell | f4cf4ec5b9f264f68d853e7b946fd49bd0d5e4d9 | [
"MIT"
] | null | null | null | bazzell/www/basket.py | libracore/bazzell | f4cf4ec5b9f264f68d853e7b946fd49bd0d5e4d9 | [
"MIT"
] | 1 | 2021-08-14T22:25:24.000Z | 2021-08-14T22:25:24.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, libracore.com and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import json
from bazzell.www.selection import get_customer, get_stocks
from erpnext.selling.doctype.quotation.quotation import make_sale... | 50.283951 | 249 | 0.678861 |
be529258ff6077cd6d47f0a0128fe7d14511cf42 | 825 | py | Python | src/ingestion/transformers/monosi/anomalies.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/ingestion/transformers/monosi/anomalies.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/ingestion/transformers/monosi/anomalies.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from ingestion.transformers.base import Transformer
class AnomalyTransformer(Transformer):
@classmethod
def _transform(cls, zscores):
return list(filter(lambda x: x['error'] == True, zscores))
@classmethod
def _original_schema(cls):
return {
"type": "array",
"items"... | 23.571429 | 66 | 0.437576 |
22e073034c450e34ebbcbff8a89c350bce34306b | 220 | py | Python | src/onegov/swissvotes/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.swissvotes.collections.pages import TranslatablePageCollection
from onegov.swissvotes.collections.votes import SwissVoteCollection
__all__ = (
'SwissVoteCollection',
'TranslatablePageCollection',
)
| 24.444444 | 74 | 0.822727 |
4aaa930b3aa1eaf5428764e58a328d69c64d9262 | 1,686 | py | Python | myspiders/ruia/middleware.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/ruia/middleware.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/ruia/middleware.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | from collections import deque
from functools import wraps
class Middleware:
"""
Define a middleware to customize the crawler request or response
eg: middleware = Middleware()
Middleware的目的是对每次请求前后进行一番处理,分下面两种情况:
在每次请求之前做一些事 @middleware.request
在每次请求后做一些事 @middleware.response
"""
def... | 29.578947 | 76 | 0.655991 |
4ac548c2d7298281e9294aca2405d481b5fb5b82 | 2,051 | py | Python | project/cli/test.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/cli/test.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/cli/test.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | import json
import click
from flask.cli import AppGroup
from flask_migrate import stamp
from sqlalchemy import MetaData
from project import app, db
from project.init_data import create_initial_data
from tests.model_seeder import ModelSeeder
test_cli = AppGroup("test")
seeder = ModelSeeder(db)
@test_cli.command("re... | 22.293478 | 71 | 0.691858 |
435ec39933a6d7197454e318f6a7670bb2e4ed7e | 424 | py | Python | src/onegov/org/views/qrcode.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/qrcode.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/qrcode.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath.request import Response
from onegov.core.security import Public
from onegov.org import OrgApp
from onegov.qrcode import QrCode
@OrgApp.view(model=QrCode, permission=Public, request_method='GET')
def get_qr_code_from_payload(self, request):
return Response(
self.encoded_image,
content... | 30.285714 | 72 | 0.766509 |
436151138c15608b115e78d6e2e8fb01df231ba8 | 2,838 | py | Python | tapia/exercise1/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | tapia/exercise1/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | tapia/exercise1/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | """@package docstring
Author: Roxana Tapia Campos
Module: Advanced practical programming skills for scientists
SS17 - TU Berlin
Exercise 1: GeoMean
"""
import sys
import math
LINES_COUNT = 0
VALID_VALUES_LOC1 = 0
LOG_SUM_LOC1 = 0
VALID_VALUES_LOC2 = 0
LOG_SUM_LOC2 = 0
def read_file(filename):
"""
Reads ... | 23.262295 | 89 | 0.653629 |
43a121e2caf0c3426f2fb9231a89716afa22c661 | 309 | py | Python | handlemoursedata/main.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | handlemoursedata/main.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | handlemoursedata/main.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Created on 2019-04-19
@FileName: main.py
@Description: 项目入口
@author: 'Aaron.Qiu'
@version V1.0.0
'''
from com.aaron.load_mouse_data import load_excel
from com.aaron.dao.base_dao import create_db,drop_db
if __name__ == "__main__":
# create_db()
# drop_db()
load_excel() | 20.6 | 52 | 0.68932 |
e82315a6966f473770759385f5d38a54b2f2b827 | 2,363 | py | Python | kicker/control_human_automatic_strategy.py | GeorgJohn/2D_Kicker_git | 8a451f2d573d703ceac1c2011f26e6ff953d2090 | [
"MIT"
] | null | null | null | kicker/control_human_automatic_strategy.py | GeorgJohn/2D_Kicker_git | 8a451f2d573d703ceac1c2011f26e6ff953d2090 | [
"MIT"
] | null | null | null | kicker/control_human_automatic_strategy.py | GeorgJohn/2D_Kicker_git | 8a451f2d573d703ceac1c2011f26e6ff953d2090 | [
"MIT"
] | 1 | 2018-08-24T17:53:41.000Z | 2018-08-24T17:53:41.000Z | import math
from kicker.CONST_BALL import Coordinate
from kicker.CONST_KICKER import COURT_HEIGHT
from kicker.CONST_GAME_FIGURES import FIGURE_FOOT_HEIGHT
class HumanStrategy:
def __init__(self, kicker):
self.kicker = kicker
def next_move(self):
if - math.pi / 2 < self.kicker.ball.angle < m... | 50.276596 | 117 | 0.645366 |
1c7d1ee3ec47c77b70391dda7b6af41c07b50aa8 | 7,361 | py | Python | Python-Encrypt-master/sploit.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Python-Encrypt-master/sploit.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Python-Encrypt-master/sploit.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 base64, zlib, marshal, sys
W = '\x1b[1;37m'
RR = '\x1b[1;37m\x1b[31m'
O = '\x1b[33m'
B = '\x1b[34m'
print ("{}{}\n______ _ \n| ___ \\ | | \n| |_/ / _ _ ___ _ __ _ _ _ __ | |_ ___ _ __ \n| __/ | |... | 44.884146 | 1,136 | 0.416248 |
c7b8e741206c3c42c8548aaad20a97708a25b815 | 452 | py | Python | admin-tutorial/AdminDateHierarchy/simple/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | admin-tutorial/AdminDateHierarchy/simple/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | admin-tutorial/AdminDateHierarchy/simple/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.db import models
# Create your models here.
class ArticleModel(models.Model):
title = models.CharField(verbose_name="文章标题", max_length=200)
content = models.TextField(verbose_name="文章内容", max_length=5000)
author = models.CharField(verbose_name="作者", max_length=50)
date_joined = models.Da... | 34.769231 | 83 | 0.763274 |
4000322822874c488bff48d0776c518876b9a472 | 28,140 | py | Python | Packs/Oracle_IAM/Integrations/OracleIAM/OracleIAM.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Oracle_IAM/Integrations/OracleIAM/OracleIAM.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Oracle_IAM/Integrations/OracleIAM/OracleIAM.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 *
import traceback
import base64
import urllib3
# Disable insecure warnings
urllib3.disable_warnings()
ERROR_CODES_TO_SKIP = [
404
]
'''CLIENT CLASS'''
def build_body_request_for_update_user(old_user_data, new_user_data):
operations = []
for ... | 36.736292 | 120 | 0.603198 |
406d75c1bbdd0a3a8947d69ef9f39f580ed500b2 | 2,666 | py | Python | Pimoroni/sgp30_simpletest.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-03-22T18:38:43.000Z | 2021-03-22T18:38:43.000Z | Pimoroni/sgp30_simpletest.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | null | null | null | Pimoroni/sgp30_simpletest.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-02-06T10:07:36.000Z | 2021-02-06T10:07:36.000Z | # sgp30_simpletest.py
# https://github.com/alexmrqt/micropython-sgp30
# adaption to the I2C bus of Raspberry Pi Pico by
# 2021-03-11 Claus Kühnel info@ckuehnel.ch
"""
Example for using the SGP30 with MicroPython and the Adafruit library.
Uses instructions from "SGP30 Driver Integration (for Software I²C)" to handle
s... | 28.666667 | 82 | 0.685296 |
294088911bd3105d4c586280dab7103564976714 | 1,899 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/mar_collection.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | 18 | 2020-01-22T14:58:18.000Z | 2022-02-21T12:07:51.000Z | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/mar_collection.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | 2 | 2020-02-24T13:14:05.000Z | 2020-09-21T13:34:53.000Z | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/mar_collection.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | 1 | 2020-01-22T14:55:36.000Z | 2020-01-22T14:55:36.000Z | #!/usr/bin/env python
import os
try:
marsyas_datadir = os.environ['MARSYAS_DATADIR']
except:
marsyas_datadir = "."
class MarCollection():
def __init__(self, mf_filename=None):
self.data = []
if mf_filename is not None:
try:
self.read_mf(mf_filename)
... | 28.772727 | 59 | 0.54871 |
46511f7f3881a08595f0b1950e9988fb1a58cb8f | 13,340 | py | Python | Packs/Syslog/Integrations/Syslogv2/Syslogv2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Syslog/Integrations/Syslogv2/Syslogv2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Syslog/Integrations/Syslogv2/Syslogv2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from dataclasses import dataclass
from tempfile import NamedTemporaryFile
from typing import Callable
import syslogmp
from gevent.server import StreamServer
from syslog_rfc5424_parser import SyslogMessage, ParseError
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUs... | 37.055556 | 118 | 0.666792 |
31107869ae687d5a76f261e9b17e7d5e0bd24f53 | 34 | py | Python | insomniac/__main__.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 533 | 2020-06-01T10:40:11.000Z | 2022-03-29T17:05:50.000Z | insomniac/__main__.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 399 | 2020-06-01T22:01:55.000Z | 2022-03-29T20:39:29.000Z | insomniac/__main__.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 166 | 2020-06-01T21:51:52.000Z | 2022-03-12T14:14:44.000Z | import insomniac
insomniac.run()
| 8.5 | 16 | 0.794118 |
7362ca85718b460645bd5b10716c15e229e93db6 | 405 | py | Python | Python/M01_ProgrammingBasics/L06_NestedLoops/Lab/Solutions/P05_Travelling.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L06_NestedLoops/Lab/Solutions/P05_Travelling.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L06_NestedLoops/Lab/Solutions/P05_Travelling.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | destination = 0
new_savings = 0
savings = 0
while destination != "End":
destination = input()
if destination == "End":
break
min_budget = float(input())
while min_budget >= new_savings:
savings = float(input())
new_savings += savings
if new_savings >= min_budget:
... | 23.823529 | 45 | 0.575309 |
c33d80695edc09acc64b42f7bb98e56ef52342b3 | 1,133 | py | Python | loesungsvorschlaege/ml_1_lineare_regression/praxis/diabetes/lin_reg_mit_scikit.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/ml_1_lineare_regression/praxis/diabetes/lin_reg_mit_scikit.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/ml_1_lineare_regression/praxis/diabetes/lin_reg_mit_scikit.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import sklearn.linear_model as lin
# Die ersten 10 Spalten beinhalten die Features. Die letzte Spalte beinhaltet das Label (Target).
diabetes_data_set = pd.read_csv("diabetes_daten.csv", header=None)
# Matrix X: alle 442 Zeilen und die ersten 10 Spalten => X hat die Dimension 44... | 39.068966 | 97 | 0.761695 |
5edc0378e1634ca2d7249cd7e7467ab9220d7b94 | 12,433 | py | Python | frappe-bench/apps/erpnext/erpnext/education/api.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/api.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/api.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import flt, cstr
from frappe.email... | 32.891534 | 129 | 0.756535 |
48b2f168061329c24e1f6812589cc116688ec631 | 389 | py | Python | production/pygsl-0.9.5/pygsl/math.py | juhnowski/FishingRod | 457e7afb5cab424296dff95e1acf10ebf70d32a9 | [
"MIT"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | production/pygsl-0.9.5/pygsl/math.py | juhnowski/FishingRod | 457e7afb5cab424296dff95e1acf10ebf70d32a9 | [
"MIT"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/math.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | """
Simple Mathematical functions
fcmp(a, b, epsilon) -> -1, 0, 1
"""
import pygsl._gslwrap
log1p = pygsl._gslwrap.gsl_log1p
expm1 = pygsl._gslwrap.gsl_expm1
hypot = pygsl._gslwrap.gsl_hypot
acosh = pygsl._gslwrap.gsl_acosh
asinh = pygsl._gslwrap.gsl_asinh
atanh = pygsl._gslwrap.gsl_atanh
ldexp = pygsl._gslwrap.gsl_ld... | 24.3125 | 32 | 0.77892 |
5b11720c74506829605adbbd168ba8a1a231fa4d | 11,119 | py | Python | fhirclient/r4models/invoice.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/invoice.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/invoice.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Invoice) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class Invoice(domainresource.DomainResource):
""" Invoice containing ChargeItems from an Accoun... | 40.140794 | 132 | 0.611836 |
826419ad44e28f827131ca0f6175dddaf17a403b | 261,090 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/demand/virtualpop.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/demand/virtualpop.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/demand/virtualpop.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 45.414855 | 359 | 0.555241 |
82d2b952befcbe8fdee350a27ecabae2d3c8354c | 10,333 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/icx/icx_linkagg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/icx/icx_linkagg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/icx/icx_linkagg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 31.503049 | 130 | 0.594697 |
7deb667920a923ac182cb42d859bb0ae9070aef2 | 3,853 | py | Python | project/api/recycling_street/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/api/recycling_street/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/api/recycling_street/schemas.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from flask_security import current_user
from marshmallow import fields
from project.api import marshmallow
from project.api.recycling_event.schemas import (
RecyclingEventListRequestSchema,
RecyclingEventListResponseSchema,
)
from project.api.schemas import (
IdSchemaMixin,
PaginationRequestSchema,
... | 26.210884 | 88 | 0.770049 |
815034a5e92e8cf1e5ee0f471595f333ede10ef8 | 3,196 | py | Python | official/cv/yolov4/ascend310_quant_infer/post_quant.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/yolov4/ascend310_quant_infer/post_quant.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/yolov4/ascend310_quant_infer/post_quant.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.974359 | 118 | 0.721527 |
c4a6c90e2fd76ddc71b16aaab643ac3ad4615ad2 | 266 | py | Python | busigyo/welcomepage/forms.py | chieteia/akemines | 243e84a782ef7d26295100eeb33aa7e2e2879a08 | [
"MIT"
] | null | null | null | busigyo/welcomepage/forms.py | chieteia/akemines | 243e84a782ef7d26295100eeb33aa7e2e2879a08 | [
"MIT"
] | null | null | null | busigyo/welcomepage/forms.py | chieteia/akemines | 243e84a782ef7d26295100eeb33aa7e2e2879a08 | [
"MIT"
] | null | null | null | from django import forms
class TestForm(forms.Form):
num = forms.IntegerField(label='天気コード')
class Form(forms.Form):
loc = forms.CharField(label = '', max_length='100', required=True)
#lat = forms.FloatField(label='緯度')
#lon = forms.FloatField(label='経度')
| 24.181818 | 67 | 0.706767 |
f216d7c9118cf366a451ccb7a9baa2adc58f4b5d | 13,283 | py | Python | src/xrt/ipc/shared/proto.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | src/xrt/ipc/shared/proto.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | src/xrt/ipc/shared/proto.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
"""Generate code from a JSON file describing the IPC protocol."""
import argparse
from ipcproto.common import (Proto, write_decl, write_invocation,
write_result_handler)
header = '''// Copyright 2... | 30.819026 | 79 | 0.534066 |
6ffe8a183561256d1f648294460c2def7c537ba5 | 1,346 | py | Python | VoiceControl/aws_lambda/lambda.py | lociii/symcon-voicecontrol | 40be8c879e9fd2209e484323df6cb32246f67b71 | [
"MIT"
] | null | null | null | VoiceControl/aws_lambda/lambda.py | lociii/symcon-voicecontrol | 40be8c879e9fd2209e484323df6cb32246f67b71 | [
"MIT"
] | null | null | null | VoiceControl/aws_lambda/lambda.py | lociii/symcon-voicecontrol | 40be8c879e9fd2209e484323df6cb32246f67b71 | [
"MIT"
] | null | null | null | import json
import urllib2
import httplib
from uuid import uuid4
import logging
logger = logging.getLogger('lambda')
def build_error_response(reason):
return {
'header': {
'namespace': 'Alexa.ConnectedHome.Control',
'name': reason,
'payloadVersion': '2',
'me... | 29.911111 | 75 | 0.663447 |
73a3a2995b1aeb060291d8aa6f129e5ef6ccfb96 | 860 | py | Python | Project1/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project1/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project1/lib.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | import time
import matplotlib.pyplot as plt
def timedcall(fn, *args):
"""
Run a function and measure execution time.
Arguments:
fn : function to be executed
args : arguments to function fn
Return:
dt : execution time
result : result of function
Usage example:
You want to ... | 20 | 68 | 0.60814 |
79028f363aec5299347603f6c4801f13319c7e79 | 1,165 | py | Python | Codeforces_problems/Reverse Binary Strings/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Codeforces_problems/Reverse Binary Strings/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Codeforces_problems/Reverse Binary Strings/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # We need to make our string alternating, i. e. si≠si+1. When we reverse substring sl…sr,
# we change no more than two pairs sl−1,sl and sr,sr+1. Moreover, one pair should be a
# consecutive pair 00 and other — 11. So, we can find lower bound to our answer as maximum
# between number of pairs of 00 and number of pair... | 36.40625 | 93 | 0.593133 |
f768d46f66b6b97f24f78dfd1b6bc540af553b94 | 162 | py | Python | Shivani/leap year.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/leap year.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/leap year.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | n=int(input("enter year\n"))
if(n%400==0 and n%100==0):
print("leap year")
elif(n%4==0 and n%100!=0):
print("leap year")
else:
print("not leap year")
| 20.25 | 28 | 0.58642 |
586428275f3b29e74ff970b0acd5d57b3c302f28 | 1,290 | py | Python | app/models/user.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | app/models/user.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | app/models/user.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | import datetime
from flask_login import UserMixin
from sqlalchemy import Column, String, Enum
from werkzeug.security import check_password_hash, generate_password_hash
from app import login_manager
from app.libs.enumerate import UserPermission
from app.libs.error_code import AuthFailed
from app.models.base import Bas... | 27.446809 | 76 | 0.721705 |
54975dd40b2c8606432908f492f3c453698f2239 | 3,790 | py | Python | src/visuanalytics/analytics/processing/audio/parts/part.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 1 | 2020-11-27T17:26:27.000Z | 2020-11-27T17:26:27.000Z | src/visuanalytics/analytics/processing/audio/parts/part.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 85 | 2021-01-02T11:38:59.000Z | 2021-07-26T07:13:47.000Z | src/visuanalytics/analytics/processing/audio/parts/part.py | Biebertal-mach-mit-TV/Data-Analytics | 70cda2393e61f7ca0a1a4a5965646e908bd0faa9 | [
"MIT"
] | 1 | 2021-04-19T06:50:53.000Z | 2021-04-19T06:50:53.000Z | """
Modul, welches die grundlegenden Funktionen der verschiedenen Arten zur Textgenerierung für die Text-to-Speech-Umwandlung beeinhaltet.
"""
from random import randint
from visuanalytics.analytics.util.step_errors import AudioError, raise_step_error
from visuanalytics.analytics.util.step_utils import execute_type_op... | 33.839286 | 138 | 0.715303 |
b7a81d2dc6c5fb849d41361fefa7c28e9b8b16ed | 1,122 | py | Python | weibo/test/testReCompile.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testReCompile.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testReCompile.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #encoding:utf8
'''
Created on 2016年4月12日
@author: wb-zhaohaibo
'''
import re
from bs4 import BeautifulSoup
html_cont = open("text.html","r").read()
soup = BeautifulSoup(html_cont,"html.parser",from_encoding="utf-8")
# sss = "/u/5888088457?refer_flag=1005050008_"
# pattern = re.compile(r"/u/[0-9]+\?refer_fla... | 28.05 | 89 | 0.637255 |
4d10985a2b796d551cb3b521b635f3fd15d7848d | 658 | py | Python | backend/migrations/versions/712fec4b34b0_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/712fec4b34b0_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/712fec4b34b0_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | """empty message
Revision ID: 712fec4b34b0
Revises: 523e4c992f6b
Create Date: 2018-08-30 15:43:38.687542
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '712fec4b34b0'
down_revision = '523e4c992f6b'
branch_labels = None
depends_on = None
def upgrade():
# ... | 22.689655 | 82 | 0.693009 |
4206177f4105ea34a996e3e6e54823a220493ded | 3,031 | py | Python | demo.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | null | null | null | demo.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | 16 | 2020-01-28T23:04:13.000Z | 2022-03-12T00:02:40.000Z | demo.py | ChristianKitte/Textextraktion-und-Einordnung-mit-Hilfe-neuronaler-Netze | 53d3fc6b1c17f31146741cdebd743f4aa12a09e0 | [
"MIT"
] | null | null | null | """ Function of demo.py
This script allows you to easily test the functionality of the solution using
images stored in the income directory.
The image stored there is transferred to an instance of the scanner, processed
and then returned as a new image and stored in the outcome directory.
The application of th... | 40.413333 | 100 | 0.646321 |
425e7db076c0e09054a0a98f3e180e19a885d306 | 2,006 | py | Python | 2019/quals/pwn-secureboot/healthcheck/healthcheck.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/quals/pwn-secureboot/healthcheck/healthcheck.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/quals/pwn-secureboot/healthcheck/healthcheck.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 26.746667 | 90 | 0.688933 |
220c2684af594a57dc51144cd540b6a6d406a4f4 | 394 | py | Python | Chapter5_DNN/Chapter5_2_BostonRegression/bostonVisualization.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | 11 | 2020-10-12T14:06:31.000Z | 2022-02-22T09:16:32.000Z | Chapter5_DNN/Chapter5_2_BostonRegression/bostonVisualization.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter5_DNN/Chapter5_2_BostonRegression/bostonVisualization.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | 8 | 2020-10-29T07:53:49.000Z | 2022-03-17T11:01:20.000Z | import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import load_boston
if __name__ == "__main__":
dataset = load_boston()
x = dataset.data
y = dataset.target
df = pd.DataFrame(x, columns=dataset.feature_names)
df["y"] = y
print(df.head(n=10))
print(df.info())
pr... | 19.7 | 55 | 0.649746 |
221076f3e4174dbf40154858347cc60f8940a7d3 | 11,647 | py | Python | hyperts/experiment.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | hyperts/experiment.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | hyperts/experiment.py | zhangxjohn/HyperTS | c43c8d820d26dd362510997c1c294341279ce1e1 | [
"Apache-2.0"
] | null | null | null | import copy
import numpy as np
import pandas as pd
from hypernets.core import set_random_state
from hypernets.experiment.compete import SteppedExperiment, ExperimentStep, \
EnsembleStep, FinalTrainStep
from hypernets.utils import logging
from hypernets.tabular impor... | 43.137037 | 122 | 0.626599 |
227bbd6ac7fa871b720a32599c74f87a9867fcc7 | 1,074 | py | Python | rating/contact_link.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | rating/contact_link.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | rating/contact_link.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
Checks whether the pages has a link "Kontakt"
"""
from rating.abstract_rater import AbstractRater
class Rater(AbstractRater):
rating_type = 'boolean'
default_value = False
depends_on_checks = ['hyperlinks']
max_score = 1
def __init__(self, check_results):
super().__init__(check_resul... | 24.409091 | 71 | 0.549348 |
e1c9db7b17e34a6d8d78423ca393b4dc77997b03 | 23,802 | py | Python | oldp/apps/cases/processing/processing_steps/extract_refs.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/cases/processing/processing_steps/extract_refs.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/cases/processing/processing_steps/extract_refs.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import logging
import re
import nltk
from django.utils.text import slugify
from oldp.apps.backend.processing import ProcessingError, AmbiguousReferenceError
from oldp.apps.cases.models import Case
from oldp.apps.cases.processing.processing_steps import CaseProcessingStep
from oldp.apps.laws.models import LawBook
from... | 34.696793 | 163 | 0.479245 |
bed101cb50e67e664cfce00e4f5d3b98b401ee2d | 1,423 | py | Python | oneflow/python/ops/transpose_util.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/ops/transpose_util.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/ops/transpose_util.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.707317 | 81 | 0.730148 |
bedf8e929db12d88cc3efac45c3b428ee3fcffa7 | 1,088 | py | Python | python/en/_matplotlib/gallery/lines_bars_and_markers/plotting_coherence_of_two_signals.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/lines_bars_and_markers/plotting_coherence_of_two_signals.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/lines_bars_and_markers/plotting_coherence_of_two_signals.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
lines_bars_and_markers/plotting_coherence_of_two_signals.py
Matplotlib > Gallery > Lines, bars and markers > Plotting the coherence of two signals
https://matplotlib.org/gallery/lines_bars_and_markers/cohere.html#sphx-glr-gallery-lines-bars-and-markers-cohere-py
"""
... | 27.897436 | 115 | 0.672794 |
367126969a4a48f727aa1045f7e7edc7106073ed | 7,925 | py | Python | sdks/pysdk/pyevtsdk/base.py | Laighno/evt | 90b94e831aebb62c6ad19ce59c9089e9f51cfd77 | [
"MIT"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | sdks/pysdk/pyevtsdk/base.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | sdks/pysdk/pyevtsdk/base.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | import json
from pyevt import abi, address, ecc, libevt
libevt.init_lib()
# Type and Structures
class BaseType:
def __init__(self, **kwargs):
self.kwargs = kwargs
def dict(self):
return self.kwargs
def dumps(self):
return json.dumps(self.kwargs)
class User:
def __init__(... | 28.102837 | 93 | 0.614006 |
3d598b2423d1ed1482449026604af7fc10ae1f71 | 1,400 | py | Python | task/bert_base.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | task/bert_base.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | task/bert_base.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | import torch
import task.common as util
from util.utils import timestamp
def import_model():
model = torch.hub.load('huggingface/pytorch-transformers:v2.5.0', 'model',
'bert-base-cased')
util.set_fullname(model, 'bert_base')
#hook for start up time
#need to o... | 29.166667 | 82 | 0.610714 |
1823597198c3561b7a515bdedceca880ca3144ad | 571 | py | Python | top/clearlight/base/runoob/print/percent_oper.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/runoob/print/percent_oper.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/runoob/print/percent_oper.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | '''
第一个 % 后面的内容为显示的格式说明,6 为显示宽度,3 为小数点位数,f 为浮点数类型
第二个 % 后面为显示的内容来源,输出结果右对齐,2.300 长度为 5,故前面有一空格
'''
print("%6.3f" % 2.3)
# 2.300
'''
x 为表示 16 进制,显示宽度为 10,前面有 8 个空格。
'''
print("%+10x" % 10)
# +a
'''
%s 字符串 (采用str()的显示)
%r 字符串 (采用repr()的显示)
%c 单个字符
%b 二进制整数
%d 十进制整数
%i 十进制整数
%o 八进制整数
%x ... | 14.641026 | 46 | 0.534151 |
62ca481b929979c6b203219b94afc72421886bd5 | 915 | py | Python | rev/rev-optimizeme/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | 2 | 2021-08-09T17:08:12.000Z | 2021-08-09T17:08:17.000Z | rev/rev-optimizeme/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | rev/rev-optimizeme/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | 1 | 2021-10-09T16:51:56.000Z | 2021-10-09T16:51:56.000Z | from Crypto.Util.number import long_to_bytes
def optimizedlcg(b, p, state, rounds): # optimized LCG where a = 2
state = pow(2,rounds,p) * state + b * (pow(2,rounds,p) - 1)
return state
p = 48569718278242303506230209619975923780743060131772701186017298107559924284242635979759825505782161830376129653325924722665978... | 70.384615 | 316 | 0.89071 |
c5081669b032f058e7973d4092f171de22b88ee5 | 1,566 | py | Python | examples/Introduction/recompile_grammar.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | examples/Introduction/recompile_grammar.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | examples/Introduction/recompile_grammar.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""recompile_grammar.py - recompiles any .ebnf files in the current
directory if necessary
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2017 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not ... | 33.319149 | 100 | 0.698595 |
c522964a4aea77fb16681473a187333b6dc6dfdd | 6,982 | py | Python | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline_schema/distributed_compiled_unit.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline_schema/distributed_compiled_unit.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline_schema/distributed_compiled_unit.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from __future__ import annotations
from copy import deepcopy
from logging import getLogger
from typing import Any, List, Optional, Tuple, Union
from dask import config
from distributed import Client
from watchmen_auth import PrincipalService
from watchmen_data_kernel.meta import TopicService
from watchmen_data_kerne... | 33.729469 | 109 | 0.804354 |
770479aa701daa02e80467347cebb4bb227afc99 | 764 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 98/98.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 98/98.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 98/98.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Create a program that asks the user to submit text through a GUI
from tkinter import *
window = Tk()
file = open("user_gui.txt", "a+")
def add():
file.write(user_value.get() + "\n")
entry.delete(0, END)
def save():
global file
file.close()
file = open("user_gui.txt", "a+")
def close():
fi... | 21.222222 | 67 | 0.693717 |
774a6b50cee68a0aa0d378c50037c731e744d729 | 154 | py | Python | Kirk Byers - Python for Network Engineers/Lesson 1/Exercise 1.py | Caradawg/HBS | 467b73c52bbba7b43f37a62e4302a4ff84ff0684 | [
"MIT"
] | null | null | null | Kirk Byers - Python for Network Engineers/Lesson 1/Exercise 1.py | Caradawg/HBS | 467b73c52bbba7b43f37a62e4302a4ff84ff0684 | [
"MIT"
] | null | null | null | Kirk Byers - Python for Network Engineers/Lesson 1/Exercise 1.py | Caradawg/HBS | 467b73c52bbba7b43f37a62e4302a4ff84ff0684 | [
"MIT"
] | null | null | null | from __future__ import print_function
ip_addr1 = '192.168.16.1'
ip_addr2 = '10.10.1.1'
ip_addr3 = '172.16.31.17'
print(ip_addr1,ip_addr2,ip_addr3) | 22 | 38 | 0.720779 |
b27b9e614f3fb3036e8d4587d028456d7675dc31 | 1,430 | py | Python | seq2.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | seq2.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | seq2.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, "A... | 23.833333 | 262 | 0.691608 |
a73f3a6d589e37cbfa96660cb3a174536d13635f | 1,819 | py | Python | ImagePyramid.py | saikat-d/DIP2018-Midterm | 06c3a74ae4fefc2ec6d47d970bf86ab8062df1bf | [
"BSD-2-Clause"
] | null | null | null | ImagePyramid.py | saikat-d/DIP2018-Midterm | 06c3a74ae4fefc2ec6d47d970bf86ab8062df1bf | [
"BSD-2-Clause"
] | null | null | null | ImagePyramid.py | saikat-d/DIP2018-Midterm | 06c3a74ae4fefc2ec6d47d970bf86ab8062df1bf | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 20:07:42 2018
@author: Saikat
"""
import numpy as np
import cv2
from cv2 import ml
from matplotlib import pyplot as plt
from sklearn.metrics import roc_curve, auc
from os.path import isfile,join
DB_path = 'images\\Pyramid\\'
RES_path = 'images\\Pyramid\\res\... | 30.830508 | 86 | 0.59978 |
a7d5d185324a1cc56c12cf84274cd09c06b3df22 | 1,153 | py | Python | chapter6/trainninganalysis.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | 1 | 2020-02-16T13:31:42.000Z | 2020-02-16T13:31:42.000Z | chapter6/trainninganalysis.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | chapter6/trainninganalysis.py | yangzhijiang/GeektimeTensorflow | 80479426a216d1d27fc78e53c581008ccec46cbe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2019/3/13 21:49
# @Author : LunaFire
# @Email : gilgemesh2012@gmail.com
# @File : trainninganalysis.py
import glob
import pickle
import matplotlib.pyplot as plt
HISTORY_DIR = '../history/captcha/' # 训练记录文件路径
def plot_training(history=None, metric='acc', title='Model ... | 28.825 | 89 | 0.640937 |
38fe6f07d73718a136466c655babdda74ad2401f | 90,776 | py | Python | _Dist/NeuralNetworks/DistBase.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/NeuralNetworks/DistBase.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/NeuralNetworks/DistBase.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
root_path = os.path.abspath("../../")
if root_path not in sys.path:
sys.path.append(root_path)
import time
import math
import random
import pickle
import shutil
import logging
import itertools
import collections
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
tf.log... | 42.981061 | 114 | 0.588691 |
ce33095d639f433a869a59cf8b5064b41dae7b53 | 159 | py | Python | tests/test_p_7_satz_von_pick.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tests/test_p_7_satz_von_pick.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tests/test_p_7_satz_von_pick.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
Teste die 'pick()' funktion.
"""
from tag_2.p_7_satz_von_pick import pick
def test_satz_von_pick():
assert pick(innenpunkte=37, randpunkte=42) == 57
| 17.666667 | 52 | 0.716981 |
5a7627a1fe051975fcfc3d64d8e12a10d27962c1 | 804 | py | Python | orgnummer_generator/generator.py | navikt/testnorge-ereg-mapper | 936afa2dd08baa2d7d242f61d231438b7f8ddf4d | [
"MIT"
] | null | null | null | orgnummer_generator/generator.py | navikt/testnorge-ereg-mapper | 936afa2dd08baa2d7d242f61d231438b7f8ddf4d | [
"MIT"
] | 1 | 2020-05-20T12:45:32.000Z | 2020-05-20T12:45:32.000Z | orgnummer_generator/generator.py | navikt/testnorge-ereg-mapper | 936afa2dd08baa2d7d242f61d231438b7f8ddf4d | [
"MIT"
] | 1 | 2019-09-07T16:06:22.000Z | 2019-09-07T16:06:22.000Z | import random
import requests
def make_orgnummer():
r = random.randint(80000000, 99999999)
r_str = str(r)
w = "32765432"
sum = 0
for i, c in enumerate(r_str):
sum += (int(c) * int(w[i]))
control_digit = 11 - (sum % 11)
final = r_str + str(control_digit)
req = requests.ge... | 21.72973 | 100 | 0.621891 |
cec5837c5ce2ece44c9c18ede781d3a57534daa3 | 489 | py | Python | books/PythonAutomate/pdf_word_documents/reading_word.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/pdf_word_documents/reading_word.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/pdf_word_documents/reading_word.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """reading_word.py
워드 문서 읽기
"""
import docx
doc = docx.Document("demo.docx")
print(len(doc.paragraphs)) # paragraph 갯수
print(doc.paragraphs[0].text) # 첫번째 paragraph 문자열
print(doc.paragraphs[1].text) # 두번째 paragraph 문자열
print(len(doc.paragraphs[1].runs)) # 두번쨰 paragraph의 run 갯수
print(doc.paragraphs[1].runs[0].tex... | 30.5625 | 67 | 0.725971 |
6502dd254712848e7e901a4bd68509a0933c8184 | 4,582 | py | Python | Server/JsonWriter.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/JsonWriter.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/JsonWriter.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import json
import random
import DHT as dht
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008
import RPi.GPIO as GPIO
import time
import calendar
import smbus
#sets the wiring from the pi
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.IN)
GPIO.setup(11, GPIO.IN)
GPI... | 25.597765 | 68 | 0.665212 |
651a54e75f0c07c0181a8708ac38016cb9cd9c4b | 4,729 | py | Python | src/server/handlers/metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/handlers/metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/handlers/metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import logging
from flask_restful import Resource, abort, request
from sqlalchemy import func
from server.models import Metric, ZScore
from server.middleware.db import db
from .monitors import MonitorResource
# class MetricListResource(Resource):
# def _validate(self, req):
# pass
# # return ... | 32.840278 | 121 | 0.550433 |
6536b18b80a0674c73f4767a84b77dcd2adc41a6 | 6,039 | py | Python | src/test/tests/operators/moveoperators.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/moveoperators.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/operators/moveoperators.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: moveoperators.py
#
# Tests: plots - Pseudocolor, Mesh, FilledBoundary
# operators - Erase, Isosurface, Reflect, Slice, Transform
#
# Defect ID: '1837
#
# Programmer: Brad Whitloc... | 26.721239 | 78 | 0.656897 |
0be7b2204441a9a284657f32102fe27e90db3c14 | 234 | py | Python | 1323-maximum-69-number/1323-maximum-69-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1323-maximum-69-number/1323-maximum-69-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1323-maximum-69-number/1323-maximum-69-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def maximum69Number (self, num: int) -> int:
try:
numstr = list(str(num))
numstr[numstr.index('6')]='9'
return int("".join(numstr))
except:
return num | 29.25 | 48 | 0.495726 |
043e1df3fcc62ca14be719c44d897ca00b52ed86 | 231 | py | Python | Exercicios/ex09-3e.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex09-3e.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex09-3e.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | #calculo da area do losango
diagonal1 = float(input('Insira a primeira diagonal: '))
diagonal2 = float(input('Insira a segunda diagonal: '))
area = (diagonal1*diagonal2)/2
msg = 'A area do losango é {}'
print(msg.format(area))
| 21 | 56 | 0.709957 |
ac8e575d2629002261a978c87e3f8844ff7e1132 | 354 | py | Python | PYTHON/Regex_and_Parsing/findall.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/findall.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/findall.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import re
if __name__ == '__main__':
input_str = input()
ret = ([r.group(0) for r in re.finditer(r'([aeiou])+', input_str, re.I) if len(r.group(0)) > 1])
if len(ret) == 0:
print(-1)
else:
if ret[-1] == input_str[(-1 * len(ret[-1])):]:
ret.po... | 25.285714 | 100 | 0.516949 |
acd516c116f068c0b5e1561eb1397b219090fc81 | 182 | py | Python | sources/stage03/enten.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage03/enten.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage03/enten.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | suffix = "ack"
praefixe = "JKLMNOPQ"
for praefix in praefixe:
if praefix == "O" or praefix == "Q":
print(praefix + "u" + suffix)
else:
print(praefix + suffix) | 26 | 40 | 0.582418 |
76b1a0c398c6cbf56adab19ef011b95aa0a8bab9 | 12,696 | py | Python | src/onegov/election_day/formats/election/internal_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/formats/election/internal_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/formats/election/internal_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Candidate
from onegov.ballot import CandidateResult
from onegov.ballot import ElectionResult
from onegov.ballot import List
from onegov.ballot import ListConnection
from onegov.ballot import ListResult
from onegov.ballot import PanachageResult
from onegov.election_day import _
from onegov.elec... | 33.410526 | 79 | 0.624921 |
4fb9d8fc7d4533ef8f4fd9fa273b9faacccf348e | 1,958 | py | Python | python_gui_tkinter/KALU/GARBAGE1/ALLOUTDATED/TESTING2/TEST/nextTest.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE1/ALLOUTDATED/TESTING2/TEST/nextTest.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE1/ALLOUTDATED/TESTING2/TEST/nextTest.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from tkinter import *
info = [
("Name (TEXT):",1),
("e-mail (TEXT):",2),
("Flat no. (TEXT):",3),
("Tower no. (TEXT):",4),
("Area (NUMBER):",5),
("Parking (TEXT):",6),
("Recpt. Fess (NUMBER):",7),
("Address (TEXT):",8),
("Contact number (TEXT):",9)
]
e=["","","","","","","","","",""] # entries
cla... | 33.758621 | 148 | 0.600613 |
e880c76bba866f062de0d0d63aac62a9bb9e1286 | 1,289 | py | Python | Packs/Confluera/Scripts/IqHubLog/IqHubLog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Confluera/Scripts/IqHubLog/IqHubLog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Confluera/Scripts/IqHubLog/IqHubLog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from CommonServerUserPython import *
# Executes confluera-fetch-detections command/script
detections_data = demisto.executeCommand('confluera-fetch-detections', {'hours': '72'})
if detections_data[0] and detections_data[0]['Contents'] and detections_data[0]['Contents']['Detections URL... | 28.021739 | 118 | 0.692009 |
ad1b22685fb173bc89ee5114a91f4ea875e57d50 | 280 | py | Python | new-docs/examples/python/getting-started/application/expenses-flask/tests/conftest.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | new-docs/examples/python/getting-started/application/expenses-flask/tests/conftest.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | new-docs/examples/python/getting-started/application/expenses-flask/tests/conftest.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | import pytest
from app import create_app
@pytest.fixture(scope="module")
def test_client():
flask_app = create_app()
flask_app.testing = True
test_client = flask_app.test_client()
ctx = flask_app.app_context()
ctx.push()
yield test_client
ctx.pop()
| 18.666667 | 41 | 0.696429 |
7e7e5a5b174edec8a01206e1a4ec02ea683ae133 | 30 | py | Python | Scripts/kim.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 8 | 2020-10-26T06:51:06.000Z | 2021-04-02T13:01:27.000Z | Scripts/kim.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 71 | 2020-10-25T22:46:02.000Z | 2021-10-14T06:47:39.000Z | Scripts/kim.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 77 | 2020-10-24T01:53:46.000Z | 2021-10-01T06:25:27.000Z | ##
print("Hello Kimbo!")
| 3.75 | 21 | 0.5 |
7d16e094d7bca22f2cd4702b2c9116984cb7e4dd | 3,318 | py | Python | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from typing import Tuple
from urllib import parse
import demistomock as demisto
from CommonServerPython import *
SCRIPT_NAME = 'CustomPackInstaller'
def build_url_parameters(skip_verify: bool, skip_validation: bool) -> str:
is_server_ge_to_6_5 = is_demisto_version_ge('6.5.0')
is_server_ge_to_6_6 = is_demist... | 31.6 | 105 | 0.648885 |
cbce52c33c14f05b9ae6d491cdb2df97a7bebb53 | 518 | py | Python | ffeKiosk/urls.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | ffeKiosk/urls.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | ffeKiosk/urls.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from django.views.generic import RedirectView
from django.contrib import admin
from django.contrib.auth import views
urlpatterns = [
url(r'^favicon\.ico$', RedirectView.as_view(url='/static/img/favicon.ico')),
url(r'^admin/', admin.site.urls),
url(r'', include('kio... | 37 | 87 | 0.681467 |
1dbc6f6a09f562bcb58345fb6cae76b92cf531eb | 2,648 | py | Python | test.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | test.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | test.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | from pprint import pprint
import django
from fractions import Fraction as frac
if __name__ == "__main__":
django.setup()
from apps.multivers.tools import Multivers
products = [
(12, frac(123348, 100), 2),
(4, frac(29000, 100), 2),
(5, frac(36470, 100), 2),
(7, frac(6496, 1... | 29.422222 | 67 | 0.4679 |
3865cea1b31a09ca887ee377b4aa61e5c6c64c08 | 1,877 | py | Python | test/test_npu/test_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_softmax.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 36.803922 | 74 | 0.649973 |
2a67cec3ec3f9d6b13f24ec35a4d8ca69882112b | 1,065 | py | Python | lang-python/sandbox/build.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/sandbox/build.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/sandbox/build.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | #!/usr/bin/python
## -*- coding: utf-8 -*-
# Import basic modules
import os
import sys
# Initialization
I_WORKING_DIR = os.getcwd()
I_GETENV_USER = os.getenv("USER")
I_SYS_SCRIPTNAME = sys.argv[0]
G_APPLICATION_NAME = "Generic"
G_APPLICATION_VERSION = "1.0.1"
G_APPLICATION_RELEASE = "19.12.130"
####################... | 20.882353 | 105 | 0.578404 |
2ab3b47b940c269bc9dda2b2719f193b140e2cb1 | 5,508 | py | Python | test/test_npu/test_network_ops/test_index_put.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_index_put.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_index_put.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 40.8 | 77 | 0.628722 |
932b92dd4689005b070ebdb3822b43d75ae061e9 | 6,410 | py | Python | HeuristicSummary.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | 1 | 2019-12-21T02:32:07.000Z | 2019-12-21T02:32:07.000Z | HeuristicSummary.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | null | null | null | HeuristicSummary.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | null | null | null | from Model import Pool, MetaslabGroup, LogSpaceMapGroup
import math
q = 100
class SummaryEntry(object):
#
# s - startTXG
# e - endTXG
# m - metaslabs needed to flush
# b - blocks that would be freed
#
def __init__(self, s, m, b):
self.s, self.e = s, s
self.m, self.b = m, b
... | 33.736842 | 99 | 0.551794 |
fae1b20c5c3fa4cde361c36faded37bf8e7e5df6 | 1,197 | py | Python | 03_Objektorientierung/properties_demo.py | Hananja/DQI19-Python | 63749c49910b5be57d09bb98a5fe728c8fdd5280 | [
"Unlicense"
] | null | null | null | 03_Objektorientierung/properties_demo.py | Hananja/DQI19-Python | 63749c49910b5be57d09bb98a5fe728c8fdd5280 | [
"Unlicense"
] | null | null | null | 03_Objektorientierung/properties_demo.py | Hananja/DQI19-Python | 63749c49910b5be57d09bb98a5fe728c8fdd5280 | [
"Unlicense"
] | null | null | null | # Demonstration von Properties
class MyClassVanilla:
""" Klasse mit einfachem Attribut (ohne Propertie) """
def __init__(self):
self.value = 0
class MyClassProperties:
""" Klasse mit Propertie, das im Setter überprüft wird.
Entscheidendes Kriterium: Eine nachträgliche Abstraktion
... | 23.470588 | 84 | 0.651629 |
87c52b3194e192d0797d5b91a3809cb3cd6eb95f | 132 | py | Python | app/models/__init__.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/models/__init__.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/models/__init__.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | from .users import User
from .documents import Document
from .files import File
from .tags import Tag
from .file_tags import FileTag | 26.4 | 31 | 0.818182 |
eaa03773285dfb7d0eacf3849611533d31441481 | 2,418 | py | Python | twitoff/twitter.py | Pdugovich/TwitOff | 9c06677ed763cf5d14fec53a10024126792681c4 | [
"MIT"
] | null | null | null | twitoff/twitter.py | Pdugovich/TwitOff | 9c06677ed763cf5d14fec53a10024126792681c4 | [
"MIT"
] | 1 | 2021-06-02T00:47:17.000Z | 2021-06-02T00:47:17.000Z | twitoff/twitter.py | Pdugovich/TwitOff | 9c06677ed763cf5d14fec53a10024126792681c4 | [
"MIT"
] | null | null | null | """Retreive tweets, embeddings, and persist in the database"""
import basilica
import tweepy
from decouple import config
from .models import DB, Tweet, User
TWITTER_AUTH = tweepy.OAuthHandler(config('TWITTER_CONSUMER_KEY'),
config('TWITTER_CONSUMER_SECRET'))
TWITTER_AUTH.set_access_t... | 37.78125 | 81 | 0.602564 |
577102893949329ef02e4700e4f6d577f7dc0594 | 2,918 | py | Python | main.py | Peetee06/compilerbau_ws2122_hsbochum | 9b71e33f7385ba946ce7f4d375b7ca68b21dd97f | [
"MIT"
] | null | null | null | main.py | Peetee06/compilerbau_ws2122_hsbochum | 9b71e33f7385ba946ce7f4d375b7ca68b21dd97f | [
"MIT"
] | null | null | null | main.py | Peetee06/compilerbau_ws2122_hsbochum | 9b71e33f7385ba946ce7f4d375b7ca68b21dd97f | [
"MIT"
] | 2 | 2022-03-13T18:48:24.000Z | 2022-03-20T16:45:19.000Z | ###########
# simple GUI for a compiler subject "Compilerbau WS21/22"
# Firstly the code should be saved in a document or loaded before using run.
# the code should be a one-liner
# Func is a placeholder for the Backend.
# The interface is to implement under line 69 Func.run.
###########
from lexer_tokenizer import Tok... | 28.607843 | 127 | 0.631254 |
57e2dbfd02cbf79ca0b5f697d8f799f329adff9e | 238 | py | Python | src/jmx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/jmx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/jmx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/python
"""
jmx.* scripts item
Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info>
License: GNU GPL3
This file is part of ZTC
"""
from ztc.java.jmx import JMXCheck
j = JMXCheck()
m = j.args[0]
j.get(m, *j.args[1:])
| 15.866667 | 61 | 0.689076 |
5e0e5fca539da462da271668e65fa2c4eb9c11de | 4,500 | py | Python | gen_cs_proto_msg_ids.py | thanklzhang/Proto_Pre | e6d1998aa41b52f01b5244a59fbbbe700d6dd64c | [
"MIT"
] | null | null | null | gen_cs_proto_msg_ids.py | thanklzhang/Proto_Pre | e6d1998aa41b52f01b5244a59fbbbe700d6dd64c | [
"MIT"
] | null | null | null | gen_cs_proto_msg_ids.py | thanklzhang/Proto_Pre | e6d1998aa41b52f01b5244a59fbbbe700d6dd64c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!usr/bin/python
# coding=gbk
import os
import string
import traceback
import openpyxl
import sys
import time
import re
import shutil
definestr = ""
baseDir = os.getcwd()
EnumName = "ProtoIDs"
def get_proto_file_list(dir, flist):
print("\n")
print("start get proto files ...")
... | 30.201342 | 101 | 0.483333 |
d83ba320f6f7d9ff9f17f7d422feff1893fca3e5 | 6,795 | py | Python | research/nlp/dscnn/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/dscnn/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/dscnn/train.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... | 38.607955 | 120 | 0.700515 |
dc5070d0865bbc9f48d127fb5d572caf248b1ae1 | 4,260 | py | Python | andinopy/base_devices/andino_io_oled.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/base_devices/andino_io_oled.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/base_devices/andino_io_oled.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | # _ _ _
# / \ _ __ __| (_)_ __ ___ _ __ _ _
# / _ \ | '_ \ / _` | | '_ \ / _ \| '_ \| | | |
# / ___ \| | | | (_| | | | | | (_) | |_) | |_| |
# /_/ \_\_| |_|\__,_|_|_| |_|\___/| .__/ \__, |
# |_| |___/
# by Jakob Groß
import sys
from typ... | 33.28125 | 97 | 0.504695 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.