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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12b84bd8319e8290620b0d12b0755ba7891479f2 | 6,993 | py | Python | SQL_python/DataBasePython/company_animal.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | SQL_python/DataBasePython/company_animal.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | SQL_python/DataBasePython/company_animal.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null |
import psycopg2
from random import randint
import random
import time
import random
import sys
import csv
espece = ['dog', 'puppy', 'cat', 'kitten', 'owl', 'owlet', 'bird', 'parrot', 'turtle', 'tortoise', 'mouse', 'lizard', 'horse', 'pork', 'hen', 'turkey cock'
'flock', 'lamb', 'fly', 'elefant']
nouns = ... | 37 | 155 | 0.555556 |
35fdbf8dc14e58b674f2c230bf0fb2240747c5ec | 1,030 | py | Python | nnc/urls.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | nnc/urls.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | nnc/urls.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
app_name = "nnc"
urlpatterns = [
path('',views.home,name = 'home'),
path('products/<slug:slug>/',views.productpage,name = 'product'),
path('allproducts/',views.allproductpage, name = 'allproduct'),
path('cart/',views.cart,name = 'cart'),
path('addto... | 46.818182 | 82 | 0.67767 |
674fae64202f7fd835d9e37d4dee72dc9a42c50b | 693 | py | Python | src/onegov/election_day/forms/upload/party_results.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/party_results.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/party_results.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day import _
from onegov.election_day.forms.upload.common import ALLOWED_MIME_TYPES
from onegov.election_day.forms.upload.common import MAX_FILE_SIZE
from onegov.form import Form
from onegov.form.fields import UploadField
from onegov.form.validators import FileSizeLimit
from onegov.form.validators ... | 31.5 | 70 | 0.75469 |
67b48b62a4ab973a6651054e5ab9c0ac649e390c | 1,007 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/client.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/client.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/client.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from net import protocol
from utils import color
import _thread
from pathlib import Path
BUFFER_SIZE = 8 * 1024
class Client:
def __init__(self, conn, addr, unionpath):
self.socket = conn
self.addr = addr
self.IP = self.addr[0]
self.unionpath = unionpath
self.protocol = pro... | 26.5 | 72 | 0.595829 |
58cf5c872d29b613446b6d84a2a17864497daa07 | 1,603 | py | Python | src/handlers/2nd-lambda-function.py | Olaowokoya/HackathonFeb14 | 9341620901c155061606c5c9f37a3d3d4ccffb39 | [
"MIT-0"
] | null | null | null | src/handlers/2nd-lambda-function.py | Olaowokoya/HackathonFeb14 | 9341620901c155061606c5c9f37a3d3d4ccffb39 | [
"MIT-0"
] | null | null | null | src/handlers/2nd-lambda-function.py | Olaowokoya/HackathonFeb14 | 9341620901c155061606c5c9f37a3d3d4ccffb39 | [
"MIT-0"
] | null | null | null |
import json
import boto3
codecommit = boto3.client('codecommit')
def lambda_handler(event, context):
#Log the updated references from the event
references = { reference['ref'] for reference in event['Records'][0]['codecommit']['references'] }
print("References: " + str(references))
#Get the rep... | 38.166667 | 149 | 0.639426 |
18c8aaac44c9a92867a890243f2561959d24a9d2 | 1,290 | py | Python | Endpräsentation/Python-Skripte/AM.py | tomg404/WSeminar19-21 | 6f1ebaf6222f0db892b568bf021b87717d461345 | [
"MIT"
] | null | null | null | Endpräsentation/Python-Skripte/AM.py | tomg404/WSeminar19-21 | 6f1ebaf6222f0db892b568bf021b87717d461345 | [
"MIT"
] | null | null | null | Endpräsentation/Python-Skripte/AM.py | tomg404/WSeminar19-21 | 6f1ebaf6222f0db892b568bf021b87717d461345 | [
"MIT"
] | null | null | null | # (c) Tom Gaimann, 2020
# Zusammensetzung eines amplitudenmodulierten Signals
# Ref: https://medium.com/@nabanita.sarkar/simulating-amplitude-modulation-using-python-6ed03eb4e712
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 22})
A_modulator = 1 # Amplitude der Nachrichten Well... | 26.875 | 100 | 0.717829 |
18e5f15abecdb1028838658a9daa0157938fa1fe | 92 | py | Python | 2015/misc/test-line-1-cooper/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/misc/test-line-1/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/misc/test-line-1/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1ppNXheLUyF7PJbZ-wZhiAxEoqIdH9rlx3xPtbS37JCU'
| 23 | 68 | 0.836957 |
365d98163db2fc218a61451c3336c1c02e938983 | 1,188 | py | Python | research/cv/tsn/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/tsn/src/metrics.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/tsn/src/metrics.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... | 34.941176 | 78 | 0.680976 |
a1498e74e36ad1c750ae0a48c7938dc62f5f077a | 7,294 | py | Python | hashing/scripts/progressive_sort.py | ShuhaoZhangTony/WalnutDB | 9ccc10b23351aa2e6793e0f5c7bd3dd511d7b050 | [
"MIT"
] | null | null | null | hashing/scripts/progressive_sort.py | ShuhaoZhangTony/WalnutDB | 9ccc10b23351aa2e6793e0f5c7bd3dd511d7b050 | [
"MIT"
] | null | null | null | hashing/scripts/progressive_sort.py | ShuhaoZhangTony/WalnutDB | 9ccc10b23351aa2e6793e0f5c7bd3dd511d7b050 | [
"MIT"
] | null | null | null | import getopt
import os
import sys
from math import ceil
import matplotlib as mpl
from numpy import double
from numpy.ma import arange
mpl.use('Agg')
import matplotlib.pyplot as plt
import pylab
from matplotlib.font_manager import FontProperties
OPT_FONT_NAME = 'Helvetica'
TICK_FONT_SIZE = 24
LABEL_FONT_SIZE = 28
L... | 32.417778 | 133 | 0.588292 |
c53d769f5db75c4ae413c5f3af545f859dfe5a70 | 86 | py | Python | src/Sephrasto/Version.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Version.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Version.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | _sephrasto_version_major = 1
_sephrasto_version_minor = 7
_sephrasto_version_build = 0 | 28.666667 | 28 | 0.872093 |
65c2c73213d3bfa524f02e4351e168bcd420c196 | 1,110 | py | Python | tensorflow/basic-rl/tutorial11/code/train_mountaincar_continuous_ppo1.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial11/code/train_mountaincar_continuous_ppo1.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial11/code/train_mountaincar_continuous_ppo1.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | import gym
from baselines.ppo1 import mlp_policy, pposgd_simple
import tensorflow as tf
env = gym.make("MountainCarContinuous-v0")
g = tf.Graph()
with g.as_default():
# tf.reset_default_graph()
def policy_fn(name, ob_space, ac_space):
return mlp_policy.MlpPolicy(name=name, ob_space=ob_space, ac_space=... | 35.806452 | 103 | 0.640541 |
b86636c318ad684d893768dff2ccf80b0493bc44 | 1,734 | py | Python | DataProcess/my_paper/reproduce_gyro.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | 3 | 2021-12-24T04:52:03.000Z | 2021-12-27T02:14:49.000Z | DataProcess/my_paper/reproduce_gyro.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | DataProcess/my_paper/reproduce_gyro.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project :DataProcess
@File :reproduce_gyro.py
@Author :Zhang Qihang
@Description: 复现Gyro论文中的消除跳频方法
@Date :2021/12/21 16:07
"""
import filters
from config import *
from myplot import *
def gyro(refer_mat, init_df):
"""
Args:
refer_... | 31.527273 | 96 | 0.67301 |
b8979f27220b39bbc53ea2b2de6e48459b93dde0 | 341 | py | Python | Style Guide/resources/meth.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | Style Guide/resources/meth.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | Style Guide/resources/meth.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | def example_method(param1, param2):
"""Class methods are similar to regular functions.
Note:
Special cases, side effects, etc.
Args:
param1: The first parameter.
param2: The second parameter.
Returns:
True if successful, False otherwise.
"""
pa... | 18.944444 | 54 | 0.601173 |
a270f497e0b2234437e2ed606d9d26d1f25e37c1 | 1,001 | py | Python | ___Python/Jonas/Python/p02_datenstrukturen/m02_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Jonas/Python/p02_datenstrukturen/m02_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Jonas/Python/p02_datenstrukturen/m02_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # Wörterbuch/Dictionary (Paare von Schlüsseln und Werten), Hashtabelle/Hashtable/Hashmap, assoziatives Feld/ associative Array
d = {"Tisch": "table",
"Stuhl": "chair",
"Schreibtisch": "desk"}
# Aus einem Wörterbuch einen Wert anhand eines Schlüssels ermitteln
# print(d["Stuhl"])
deutsch = input("D... | 28.6 | 127 | 0.69031 |
ce7a819ba2287172b1f3f87c0ac6311064bf9c16 | 3,154 | py | Python | experiment/exp_voc/config.py | Wangyf46/deeplabv3plus-pytorch | dbbbe88d7774d6e02f7ea13e770ee4278dc528fd | [
"MIT"
] | 2 | 2019-08-03T12:02:12.000Z | 2019-08-03T12:35:46.000Z | experiment/exp_voc/config.py | Wangyf46/deeplabv3plus-pytorch | dbbbe88d7774d6e02f7ea13e770ee4278dc528fd | [
"MIT"
] | null | null | null | experiment/exp_voc/config.py | Wangyf46/deeplabv3plus-pytorch | dbbbe88d7774d6e02f7ea13e770ee4278dc528fd | [
"MIT"
] | null | null | null | # ----------------------------------------
# Written by Yude Wang
# ----------------------------------------
import torch
import argparse
import os
import sys
import cv2
import time
class Configuration():
def __init__(self):
self.DATE = time.strftime("%Y-%m-%d", time.localtime())
self.EXP_NAME = 'e... | 36.674419 | 146 | 0.625238 |
0c691a2d028b733f22ac03ca90387adbd682a882 | 228 | py | Python | 7-assets/past-student-repos/_Individual-Projects/Computer-Architecture-Notes-master/lectureII/instructions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-03-19T19:25:39.000Z | 2021-03-19T19:25:39.000Z | 7-assets/past-student-repos/_Individual-Projects/Computer-Architecture-Notes-master/lectureII/instructions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_Individual-Projects/Computer-Architecture-Notes-master/lectureII/instructions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 1 # PRINT_BEEJ
1 # PRINT_BEEJ
1 # PRINT_BEEJ
4 # SAVE 65 in register 2
12
2
4 # SAVE 20 in register 3
36
3
6 # ADD register 3 onto register 2
2
3
5 # PRINT_REGISTER register 2
2
1 # PRINT_BEEJ
2 # HALT | 14.25 | 37 | 0.631579 |
0b88ba48040382764aaf77240243afcc00d3b983 | 216 | py | Python | huTools/calendar/__init__.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/calendar/__init__.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/calendar/__init__.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
Calendar-related functions.
Copyright (c) 2006-2010 HUDORA GmbH. Published under a 'BSD License'.
"""
from __future__ import unicode_literals
__revision__ = "$Revision$"
| 19.636364 | 69 | 0.740741 |
f00e027858a6c78cd43f0b56076355d69f03be15 | 1,351 | py | Python | src/data_science/data_science/simulation/time.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/simulation/time.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | src/data_science/data_science/simulation/time.py | viclule/api_models_deployment_framework | 7595cf0b4f3e277925b968014102d7561547bcd4 | [
"MIT"
] | null | null | null | import time
class TimeSimulator:
"""A simple time simulator.
It provides an accelerated time stamp for simulation purposes.
"""
def __init__(self, time_factor=1):
"""Initialize the Time_Simulator.
Keyword arguments:
time_factor -- how faster or slower is the time behaving
... | 27.571429 | 68 | 0.588453 |
f04285c15c68fba50368b1cc1e0b0c494b6e7d5f | 4,009 | py | Python | apps/modules/common/tools/common/run_dart_tests.py | bleonard252-forks/pangolin-mobile | 392df6c8a66d39f31d0e2512caf3d31ae40c758f | [
"Apache-2.0"
] | null | null | null | apps/modules/common/tools/common/run_dart_tests.py | bleonard252-forks/pangolin-mobile | 392df6c8a66d39f31d0e2512caf3d31ae40c758f | [
"Apache-2.0"
] | null | null | null | apps/modules/common/tools/common/run_dart_tests.py | bleonard252-forks/pangolin-mobile | 392df6c8a66d39f31d0e2512caf3d31ae40c758f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# NOTE(youngseokyoon): Currently, the dart tests are run using `flutter test`
# from the command line, instead of using any GN build tar... | 34.86087 | 90 | 0.636817 |
b2d78102ff8129121e70d7e6317966aa5c299b86 | 4,654 | py | Python | python/odml/odml_demo.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/odml_demo.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/odml_demo.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
import odml
# create an empty document and save it
doc = odml.Document()
filename = str(Path.joinpath(Path.home(), 'Chaos', 'work', 'ginrepos', 'demo',
'elegans_oxygen.odml'))
odml.save(doc, filename)
# add some document information
doc.author = 'Michael Sonnta... | 34.220588 | 90 | 0.707349 |
6843149c707cdb30a99fff4707f21bd82de5cb91 | 1,125 | py | Python | src/ztc/ldap/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/ldap/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/ldap/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
"""
ZTC Ldap check
Copyright (c) 2012 Vladimir Rusinov <vladimir@greenmice.info>
This file is part of ZTC and distributed under the same license.
Requirements:
* python-ldap
"""
import time
import ldap
from ztc.check import ZTCCheck
class LDAPCheck(ZTCCheck):
name = "ldap"
def... | 22.5 | 71 | 0.568889 |
d7d22f50c9f39ed99c4da4a4c5c677845ec8b71d | 1,266 | py | Python | books/PythonCleanCode/ch7_generator/generators_pythonic_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/generators_pythonic_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/generators_pythonic_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 7: Using Generators
> Idiomatic Iteration
"""
class NumberSequence:
"""
>>> seq = NumberSequence()
>>> seq.next()
0
>>> seq.next()
1
>>> seq2 = NumberSequence(10)
>>> seq2.next()
10
>>> seq2.next()
11
"""
d... | 17.830986 | 65 | 0.453397 |
cc2fc59f41ae3f519c43ff2a93327271f756aa9d | 8,024 | py | Python | frappe-bench/apps/erpnext/erpnext/selling/doctype/customer/test_customer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/doctype/customer/test_customer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/doctype/customer/test_customer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.accounts.party import get_due_date
from frappe.test_runner import make_test_records
from erpnext.exceptions... | 35.821429 | 108 | 0.761341 |
aca7b45641f71a9e26734a0afe6a4807f70d5fc9 | 366 | py | Python | _includes/snippets/python/monkey-patching/dynamic_static_classmethods.py | MarauderXtreme/justus | 229703abda2bd90d34232c97c64999c216d98239 | [
"CC-BY-4.0"
] | 1 | 2020-02-02T16:09:43.000Z | 2020-02-02T16:09:43.000Z | _includes/snippets/python/monkey-patching/dynamic_static_classmethods.py | MrNick7373/justusadam.github.io | 0660026a7846389647cb3ce52d9f776aab10e3cd | [
"CC-BY-4.0"
] | 1 | 2020-02-02T13:22:42.000Z | 2020-02-02T13:22:42.000Z | _includes/snippets/python/monkey-patching/dynamic_static_classmethods.py | MarauderXtreme/justus | 229703abda2bd90d34232c97c64999c216d98239 | [
"CC-BY-4.0"
] | null | null | null | #! /usr/bin/env python3
class TestClass:
pass
def foo():
print('foo is executing')
def bar(cls):
print('bar is executing')
print(cls)
TestClass.static_foo = staticmethod(foo)
TestClass.class_bar = classmethod(bar)
TestClass.static_foo()
# =>> foo is executing
TestClass.class_bar()
# =>> bar is... | 14.076923 | 40 | 0.677596 |
a886c90f88d782973028901852d2cb902a5af4b4 | 2,831 | py | Python | LSTMcell/python/main.py | JerrytTom/FPGA-Based-LSTM-Accelerator | 512253b82b5966e7914477d0317c4671c87853de | [
"MIT"
] | 3 | 2021-07-02T03:26:35.000Z | 2021-12-07T02:52:51.000Z | LSTMcell/python/main.py | JerrytTom/FPGA-Based-LSTM-Accelerator | 512253b82b5966e7914477d0317c4671c87853de | [
"MIT"
] | null | null | null | LSTMcell/python/main.py | JerrytTom/FPGA-Based-LSTM-Accelerator | 512253b82b5966e7914477d0317c4671c87853de | [
"MIT"
] | 3 | 2021-08-29T14:24:54.000Z | 2022-01-28T11:22:34.000Z | import os
import json
import time
import math
import matplotlib.pyplot as plt
from core.data_processor import DataLoader
from core.model import Model
import numpy as np
def plot_results(predicted_data, true_data):
fig = plt.figure(facecolor='white')
ax = fig.add_subplot(111)
ax.plot(true_data, label='True... | 28.59596 | 132 | 0.656658 |
4f323c6b7e4e0e249c56bd73e65bd78fd0d35bc9 | 2,444 | py | Python | test/test_npu/test_reciprocal.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_reciprocal.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_reciprocal.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... | 34.914286 | 74 | 0.655892 |
96c9912e6289394fd074e7b443412ee3066bc90c | 1,238 | py | Python | cogs/prefix.py | zImPinguin/Bump-Bot | 3f449a4e5581a35a5cff998e94a13ae33dbe2b04 | [
"MIT"
] | 1 | 2021-09-03T15:14:40.000Z | 2021-09-03T15:14:40.000Z | cogs/prefix.py | zImPinguin/Bump-Bot | 3f449a4e5581a35a5cff998e94a13ae33dbe2b04 | [
"MIT"
] | 1 | 2022-01-02T15:18:08.000Z | 2022-02-14T12:46:20.000Z | cogs/prefix.py | zImPinguin/Bump-Bot | 3f449a4e5581a35a5cff998e94a13ae33dbe2b04 | [
"MIT"
] | null | null | null | import discord
from core.database import Servers
from core.files import Data
from core import embeds
commands = discord.ext.commands
def getPrefix(bot, message):
prefix = [Data('config').yaml_read()['prefix']]
if message.guild:
server = Servers(message.guild.id)
prefix = [server.getPrefix()]
... | 33.459459 | 143 | 0.668821 |
8c48dd220d897aa269cadeb3ec45e6e2b3320384 | 396 | py | Python | PINp/2015/DANILENKOV_M_A/task_3_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/DANILENKOV_M_A/task_3_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2015/DANILENKOV_M_A/task_3_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 3.
#Напишите программу, которая выводит имя "Борис Николаевич Бугаев", и запрашивает его псевдоним. Программа должна #сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
#Danilenkov M.A.
name = "Борис Николаевич Бугаев"
print(name)
psevdonim = input("Введите псевдон... | 39.6 | 209 | 0.760101 |
0fdd2b68e72f6818c8b6f3e645aab6fc2b2cd8ee | 13,656 | py | Python | classification/scripts/RulebasedClassifier.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | 1 | 2020-07-11T04:24:40.000Z | 2020-07-11T04:24:40.000Z | classification/scripts/RulebasedClassifier.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | null | null | null | classification/scripts/RulebasedClassifier.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Imports
from luigi.contrib.spark import PySparkTask
from luigi.parameter import IntParameter
from luigi.format import UTF8
from luigi import LocalTarget, Task, WrapperTask
import datetime
import re
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
f... | 61.513514 | 2,261 | 0.584505 |
e8655234391087696fb885d925d33f39a1d5e922 | 293 | py | Python | src/tango_sdp_master/SDPMaster/__init__.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/tango_sdp_master/SDPMaster/__init__.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/tango_sdp_master/SDPMaster/__init__.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | # -*- coding: utf-8 -*-
"""SDP Master device package."""
# pylint: disable=invalid-name
from . import release
from .SDPMaster import SDPMaster, HealthState, main
__all__ = ["SDPMaster", "HealthState", "main", "release"]
__version__ = release.VERSION
__version_info__ = release.VERSION_INFO
| 24.416667 | 57 | 0.730375 |
ad1c15817a5cc14a8ef3e194a156960e885c815b | 41 | py | Python | Shivani/Address.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/Address.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/Address.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | a=input("enter your address\n")
print(a)
| 13.666667 | 31 | 0.707317 |
0f5bf6e6dd3775b91be9b4406e482e47a7a62ff0 | 2,886 | py | Python | tools/legacy/pac-man/sspm.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | tools/legacy/pac-man/sspm.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | tools/legacy/pac-man/sspm.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | from clint.textui import progress
from functools import partial
from multiprocessing.pool import ThreadPool
from threading import Lock
from time import time as timer
import json
import click
import core
import plugins
import os
s_print_lock = Lock()
def s_print(*a, **b):
"""Thread safe print function"""
with ... | 37 | 134 | 0.663895 |
7e4c4d0748c8bc336ae30e7feb9fda9ce77d0b43 | 47 | py | Python | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/common/exception.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/common/exception.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/common/exception.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | class InquiryKernelException(Exception):
pass
| 15.666667 | 40 | 0.851064 |
7e871e31431577761e631ecbc85ac3e4db986f8b | 1,746 | py | Python | DataStructure/U1/Lecture/topoSort.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | DataStructure/U1/Lecture/topoSort.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | DataStructure/U1/Lecture/topoSort.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | import intReader
def TopoSort():
print ("Topologischen Sortieren.")
# Einlesen
input = intReader.readInt()
n = next(input)
# Inititalisieren array:
Knotenliste = [None] + [ Knoten(i) for i in range(1,n+1) ]
# Einlesen Kanten
try:
while True:
e = Knotenliste[ne... | 25.304348 | 72 | 0.542383 |
0e71104b1564decdf3f57373c156ed5912b993c5 | 3,689 | py | Python | rbac/common/protobuf/relationship_state_pb2.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | rbac/common/protobuf/relationship_state_pb2.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | rbac/common/protobuf/relationship_state_pb2.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: relationship_state.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflectio... | 31.529915 | 248 | 0.76064 |
7d25c4b3a875deca90b010dab44164f8f13cfc98 | 1,005 | py | Python | challenges/countSumOfTwoRepresentations3/python3/countSumOfTwoRepresentations3.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/countSumOfTwoRepresentations3/python3/countSumOfTwoRepresentations3.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/countSumOfTwoRepresentations3/python3/countSumOfTwoRepresentations3.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def countSumOfTwoRepresentations3(n, l, r):
return max(0, 1 + n//2 - max(l, n-r))
if __name__ == '__main__':
input0 = [6, 10, 6, 5, 10, 9, 24, 24]
input1 = [2, 3, 3, 1, 9, 5, 8, 10]
input2 = [4, 5, 3, 5, 11, 10, 16, 12]
expectedOutput = [2, 1, 1, 2, 0, 0, 5, 1]
assert len(input0) == len(expectedOutput), '# input... | 67 | 159 | 0.656716 |
69efe112c2acecd9ecc693c7490571e2e5c26440 | 5,788 | py | Python | python_experiments/paper_figures/tkde/tkde_draw_varying_datasets_time_mem.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/paper_figures/tkde/tkde_draw_varying_datasets_time_mem.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/paper_figures/tkde/tkde_draw_varying_datasets_time_mem.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import matplotlib.pyplot as plt
import numpy as np
from data_analysis.parallel_statistics.err_mem_size_statistics import *
from data_analysis.parallel_statistics.previous_data_statistics import *
from data_analysis.parallel_statistics.generate_parallel_speedup_md import *
from paper_figures.tkde.data_legacy.static_data... | 44.183206 | 97 | 0.650657 |
69f33425d5865f53d275178d58bf066fa90bc701 | 121 | py | Python | scripts/hello_world_brunosxs.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_brunosxs.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_brunosxs.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | # LANGUAGE: Python
# AUTHOR: BrunoSXS
# GITHUB: https://github.com/brunosxs
#!/usr/bin/python3
print ("Hello, World!")
| 15.125 | 37 | 0.694215 |
2a298a4be02bc7af567efd6c7eeef42898384b15 | 3,486 | py | Python | PythonCruds/CrudClassificacao.py | iRnx/Crud-Filmes | 001d95879a955b64b9f918d8ddc90593cea97821 | [
"MIT"
] | null | null | null | PythonCruds/CrudClassificacao.py | iRnx/Crud-Filmes | 001d95879a955b64b9f918d8ddc90593cea97821 | [
"MIT"
] | null | null | null | PythonCruds/CrudClassificacao.py | iRnx/Crud-Filmes | 001d95879a955b64b9f918d8ddc90593cea97821 | [
"MIT"
] | null | null | null | import mysql.connector
def conectar():
"""
Função para conectar ao servidor
"""
try:
conn = mysql.connector.connect(
host='localhost',
user='root',
password='root',
database='todos_filmes')
return conn
except mysql.conne... | 27.234375 | 87 | 0.542456 |
2dca56779f9574750c26b55566b5f471390c9de2 | 774 | py | Python | Hackerrank_problems/Day_Of_The_Programmer/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/Day_Of_The_Programmer/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/Day_Of_The_Programmer/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # Complete the dayOfProgrammer function below.
def dayOfProgrammer(year):
#Check if the year is before or after 1918
if year > 1918:
#If the year is after 1918
#Check if the year is leap
if (year%400==0) or ((year%4==0)and (year%100!=0)):
#If the year is leap
r... | 29.769231 | 59 | 0.524548 |
9313c16d744ed3b575f01b6e6256c5cab3f5e76e | 332 | py | Python | tests/test_presseportal.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | 1 | 2022-03-07T13:26:35.000Z | 2022-03-07T13:26:35.000Z | tests/test_presseportal.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | tests/test_presseportal.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | from deutschland.presseportal import PresseportalApi
from deutschland.presseportal import Company, Entity, Story
presseportal = PresseportalApi("YOUR_KEY_HERE")
try:
stories = presseportal.get_stories()
except Exception as e:
print(str(e))
assert str(e) == "The API returned error code 101 (authentificatio... | 30.181818 | 81 | 0.774096 |
fad04a6a147fe4d0854c33313f32bd3693f4b209 | 19,300 | py | Python | python_playground/data/simrank.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_playground/data/simrank.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_playground/data/simrank.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import itertools
import time
import networkx as nx
from scipy.sparse.linalg import inv
from sklearn import preprocessing
from utils import *
# set the printing config
np.set_printoptions(precision=4)
ITERATIONS = 50
# test graphs
A = [
(3, 1),
(3, 2),
(3, 4),
(3, 5),
(4, 6),
(5, 6),
(6,... | 27.65043 | 119 | 0.528342 |
879c73bc0deb4cb5437f669d5c32874c5b971b34 | 16,853 | py | Python | src/krotov/convergence.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 49 | 2018-11-07T06:43:33.000Z | 2022-03-18T20:53:06.000Z | src/krotov/convergence.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 94 | 2018-11-06T20:15:04.000Z | 2022-01-06T09:06:15.000Z | src/krotov/convergence.py | qucontrol/krotov | 9f9a22336c433dc3a37637ce8cc8324df4290b46 | [
"BSD-3-Clause"
] | 20 | 2018-11-06T20:03:11.000Z | 2022-03-12T05:29:21.000Z | r"""Routines for `check_convergence` in :func:`krotov.optimize.optimize_pulses`
A `check_convergence` function may be used to determine whether an optimization
is converged, and thus can be stopped before the maximum number of
iterations (`iter_stop`) is reached. A function suitable for
`check_convergence` must receiv... | 40.12619 | 79 | 0.658874 |
ea502361c097a1ec8d247ca2c815021670c5d4a0 | 3,750 | py | Python | src/onegov/election_day/forms/upload/vote.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/vote.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/forms/upload/vote.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day import _
from onegov.election_day.forms.upload.common import ALLOWED_MIME_TYPES
from onegov.election_day.forms.upload.common import MAX_FILE_SIZE
from onegov.form import Form
from onegov.form.fields import UploadField
from onegov.form.validators import FileSizeLimit
from onegov.form.validators ... | 29.527559 | 78 | 0.580533 |
ea53be4f00fa1b963e75c2fe3b701c483ee9292f | 5,352 | py | Python | app.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | null | null | null | app.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | null | null | null | app.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import time
from multiprocessing import Process
from thread import start_new_thread
from sentinel.config import DEFAULT_GAS
from sentinel.config import VERSION
from sentinel.cosmos import call as cosmos_call
from sentinel.helpers import end_session
from sentinel.helpers import update_session_status
from... | 33.873418 | 110 | 0.564088 |
57a949b04dcc7b15c07500ba37ef97565a3844df | 455 | py | Python | order/migrations/0005_auto_20201106_1534.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | order/migrations/0005_auto_20201106_1534.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | order/migrations/0005_auto_20201106_1534.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.16 on 2020-11-06 07:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0004_auto_20201106_1513'),
]
operations = [
migrations.AlterField(
model_name='order',
name=... | 23.947368 | 108 | 0.589011 |
aa0ad1206909e1955b2c4e49c481027070dbfe0f | 577 | py | Python | src/onegov/org/forms/fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.org.utils import annotate_html, remove_empty_paragraphs
from onegov.form.fields import HtmlField as HtmlFieldBase
class HtmlField(HtmlFieldBase):
""" A textfield with html with integrated sanitation and annotation,
cleaning the html and adding extra information including setting the
image size... | 30.368421 | 72 | 0.694974 |
5e087987bdf07613247f0708ff45cffb10ce5515 | 405 | py | Python | exercises/ja/exc_01_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/exc_01_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/exc_01_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
# Matcherをインポート
from spacy.____ import ____
nlp = spacy.load("ja_core_news_sm")
doc = nlp("AppleはiPhone Xの予約受付開始を発表しました。")
# 共有語彙データを用いてMatcherを初期化
matcher = ____(____.____)
# 「iPhone」と「X」にマッチするパターンを作成
pattern = [____]
# matcherにパターンを追加
____.____("IPHONE_X_PATTERN", ____)
# docに対してmatcherを用いる
matches... | 19.285714 | 76 | 0.758025 |
eaf6a2c029ca80db070abfad7f3f854bf7573a3d | 805 | py | Python | source/pkgsrc/math/py-numpy/patches/patch-numpy_distutils_fcompiler_g95.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/math/py-numpy/patches/patch-numpy_distutils_fcompiler_g95.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/math/py-numpy/patches/patch-numpy_distutils_fcompiler_g95.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-numpy_distutils_fcompiler_g95.py,v 1.3 2015/04/17 00:41:38 wen Exp $
Band aid to make sure that pic_flags is actually used.
--- numpy/distutils/fcompiler/g95.py.orig 2014-10-26 14:36:14.000000000 +0000
+++ numpy/distutils/fcompiler/g95.py
@@ -19,9 +19,9 @@ class G95FCompiler(FCompiler):
executab... | 40.25 | 83 | 0.551553 |
d8025a03eb12af9d61a8525c7df75f41398e742a | 2,678 | py | Python | 7-assets/past-student-repos/Graphs-master/projects/ancestor/ancestor2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Graphs-master/projects/ancestor/ancestor2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Graphs-master/projects/ancestor/ancestor2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | class Queue():
def __init__(self):
self.queue = []
def enqueue(self, value):
self.queue.append(value)
def dequeue(self):
if self.size() > 0:
return self.queue.pop(0)
else:
return None
def size(self):
return len(self.queue)
class Graph:
... | 30.781609 | 146 | 0.599328 |
dc32de11c3a9deff86c66bcfa46b2fd0089ba5db | 840 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/14_2048_autoplay.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/14_2048_autoplay.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/14_2048_autoplay.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 14_2048_autoplay.py
# Dieses Script soll mittels Selenium die Website https://play2048.co/ öffnen und
# durch ein Bestimmtes Muster von Tasteneingaben das entsprechende Spiel spielen.
# https://play2048.co/
# Spielmuster: hoch, rechs, unten, links
import os
from selenium import webdriver
from selenium.webdriver.comm... | 36.521739 | 81 | 0.789286 |
8754fe37e3da503edb34584ed48aae90f7a910fd | 1,841 | py | Python | crawler/spiders/products_spider.py | abel3t/web_crawler | c1eb570743299676489f279b5df1b8d18d94a782 | [
"MIT"
] | 2 | 2021-03-23T00:52:24.000Z | 2021-09-07T03:42:40.000Z | crawler/spiders/products_spider.py | abel3t/web_crawler | c1eb570743299676489f279b5df1b8d18d94a782 | [
"MIT"
] | null | null | null | crawler/spiders/products_spider.py | abel3t/web_crawler | c1eb570743299676489f279b5df1b8d18d94a782 | [
"MIT"
] | null | null | null | import scrapy
import os
import time
from scrapy.selector import Selector
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
basedir = os.path.dirname(os.path.realpath('__file__'))
class ProductsSpider(scrapy.Spider):
name = 'products'
start_urls = ['https://www.bestieship.com... | 37.571429 | 117 | 0.664313 |
1d0d0d89d9476b0216ecc4195df55235ec3bd940 | 6,182 | py | Python | src/onegov/feriennet/models/activity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/models/activity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/models/activity.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.activity import Activity, ActivityCollection, Occasion
from onegov.activity import PublicationRequestCollection
from onegov.activity.models import DAYS
from onegov.core.templates import render_macro
from onegov.feriennet import _
from onegov.core.elements import L... | 29.438095 | 76 | 0.558072 |
df48654b3889729ab922bcad9596bebdf57a3625 | 1,012 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_macholib_dyld.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_macholib_dyld.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_macholib_dyld.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_ctypes_macholib_dyld.py,v 1.1 2021/06/23 18:30:24 schmonz Exp $
darwin20 support, via MacPorts.
--- Lib/ctypes/macholib/dyld.py.orig 2021-06-22 19:20:28.000000000 +0000
+++ Lib/ctypes/macholib/dyld.py
@@ -7,6 +7,12 @@ from framework import framework_info
from dylib import dylib_info
from itertool... | 30.666667 | 82 | 0.666996 |
1d5aaeb1d6ba86b6ce0404135bd37a63f366e678 | 2,139 | py | Python | PM0N/ProcNetworkMon.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | PM0N/ProcNetworkMon.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | PM0N/ProcNetworkMon.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python3
#-*- coding:utf-8 -*-
try:
from Pmon import *
except ImportError:
print("[!] Error Module : Pmon not found !")
__VERSION__ = "0.1"
banner = '''
\t___ _ _ _ _ ____ _ _
\t|__] |\ | |\/| | | |\ |
\t| | \| | | |__| | \|\n\n
\t\tAuthor : Unam3dd
\t\tGithub : https://github.com/Unam3... | 31.925373 | 69 | 0.422627 |
d54905fd188f647a35bf259b3c8843ccf1c291c7 | 2,204 | py | Python | reqflood/main.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | reqflood/main.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | reqflood/main.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/env python3
import argparse
from time import sleep
import sys
import requests
requests_counter = 0
time = 0
_url = ""
parser = argparse.ArgumentParser(description="./main.py -u [url]")
parser.add_argument('-u', '--url', help="HTTP requests to flood", action="store", dest="url")
parser.add_argument('-P', ... | 34.4375 | 119 | 0.507713 |
d5a54a413880aef3d81d2eec899034d0e460dbf5 | 662 | gyp | Python | bsp-gonk/vendor/silk/silk-properties/binding.gyp | silklabs/silk | 08c273949086350aeddd8e23e92f0f79243f446f | [
"MIT"
] | 172 | 2016-06-07T09:02:34.000Z | 2022-03-18T07:43:55.000Z | bsp-gonk/vendor/silk/silk-properties/binding.gyp | silklabs/silk | 08c273949086350aeddd8e23e92f0f79243f446f | [
"MIT"
] | 24 | 2016-06-08T08:09:39.000Z | 2017-09-08T04:15:51.000Z | bsp-gonk/vendor/silk/silk-properties/binding.gyp | silklabs/silk | 08c273949086350aeddd8e23e92f0f79243f446f | [
"MIT"
] | 37 | 2016-06-08T16:56:14.000Z | 2021-10-05T09:49:08.000Z | {
"variables": {
"library_type%": "loadable_module",
},
"targets": [
{
"target_name": "silk-properties",
"type": "<(library_type)",
"sources": [
"bindings.cpp",
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
],
"conditions": [
[
... | 20.060606 | 64 | 0.371601 |
639bd340388389a55da37ba665f4952c9a184dd8 | 1,790 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/__init__.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/__init__.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/__init__.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 47.105263 | 80 | 0.748603 |
7f63e14347c4733d5946190bb96be04956f29451 | 14 | py | Python | 1_Datentypen/03_tuples/_02_short_swap_tricks.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | 1_Datentypen/03_tuples/_02_short_swap_tricks.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | 1_Datentypen/03_tuples/_02_short_swap_tricks.py | DavidStahl97/Python-Grundkurs | 6796d19116d2f838b193b106d00bc2e74a8cdcb4 | [
"MIT"
] | null | null | null | x = 7
y = 11
| 3.5 | 6 | 0.357143 |
7fb8e9a410750d5a55c2304e6c3d9cb46108703b | 738 | py | Python | day03/loveCalculator.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day03/loveCalculator.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day03/loveCalculator.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | # 🚨 Don't change the code below 👇
print("Welcome to the Love Calculator!")
name1 = input("What is your name? \n")
name2 = input("What is their name? \n")
# 🚨 Don't change the code above 👆
#Write your code below this line 👇
names = name1.lower() + name2.lower()
score = 0
score += names.count("t")
score += names.c... | 27.333333 | 74 | 0.647696 |
f6bac03d351939c7a108e7d27e18db0a5dbd8813 | 295 | py | Python | python/decorator/decorate_a_class.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/decorate_a_class.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/decorate_a_class.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from real_world_example import timer
@timer
class Calculator:
def __init__(self, num):
self.num = num
import time
time.sleep(2)
def doubled_and_add(self):
res = sum([i * 2 for i in range(self.num)])
print(f'Result: {res}')
c = Calculator(100) | 18.4375 | 51 | 0.60339 |
f6c7ea5cc9a10343f66529374fc820c1fd588880 | 1,107 | py | Python | DB_Konverter/old_db_model.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 3 | 2019-05-04T21:34:33.000Z | 2022-01-25T10:00:25.000Z | DB_Konverter/old_db_model.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 4 | 2019-04-11T05:03:55.000Z | 2020-07-09T06:52:58.000Z | DB_Konverter/old_db_model.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 1 | 2020-02-13T19:04:31.000Z | 2020-02-13T19:04:31.000Z | from peewee import *
database = SqliteDatabase('db_coffee.db3', **{})
class UnknownField(object):
def __init__(self, *_, **__): pass
class BaseModel(Model):
class Meta:
database = database
class Benutzer(BaseModel):
kaffeelimit = IntegerField(null=True)
konto = FloatField(null=True)
n... | 20.5 | 55 | 0.66486 |
1205ebc4bb5ad51d03eb408795aa08f60b94879d | 3,043 | py | Python | examples/quadratic_equation_test.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | examples/quadratic_equation_test.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | examples/quadratic_equation_test.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from fbtor.FBoolectorTypes import FPType, RMode, WIDTH
from fbtor.FBoolector import FBoolector
from pyboolector import BTOR_OPT_MODEL_GEN
if __name__ == "__main__":
fptype = FPType.double
rmode = RMode.to_zero
# Try to solve a simple quadratic equation which is 0 at the following p... | 34.977011 | 98 | 0.622741 |
d6049a88c3ca4ebe9aa91e3fd0c2e8378b4af205 | 5,819 | py | Python | examples/lexical_analysis/data.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/lexical_analysis/data.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/lexical_analysis/data.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 34.02924 | 103 | 0.551469 |
c3ad922b934bdefb85bff5e633e5186a46c6dd7e | 2,147 | py | Python | LCS.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | LCS.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | LCS.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#Program to find the longest common subsequence, in a sequence.
#LCS for input Sequences ABCDGH and AEDFHR is ADH of length 3.
#LCS for input Sequences AGGTAB and GXTXAYB is GTAB of length 4.
def rec_search(S,T,count):#Try to find a match for S[0] in T
if len(S)==0:
static_result.append(count)
... | 20.065421 | 72 | 0.646949 |
f60832243afad100c38117ab89ca83e069ebae72 | 305 | py | Python | wk-sentiment/app/main/service/sentiment_service.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | 4 | 2020-10-08T15:05:02.000Z | 2021-08-03T01:00:08.000Z | wk-sentiment/app/main/service/sentiment_service.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | null | null | null | wk-sentiment/app/main/service/sentiment_service.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | 1 | 2020-10-08T15:05:04.000Z | 2020-10-08T15:05:04.000Z | from textblob import TextBlob
class SentimentService:
"""This class represents the knapsacks service"""
def AnalyzeSentence(self, sentence):
"""Analyzes the sentiment of a given sentence"""
polarity = TextBlob(sentence).sentences[0].polarity
return sentence, polarity
| 23.461538 | 59 | 0.704918 |
f63252fb1246f6ac42ae424640e3443caedb5d9d | 1,223 | py | Python | SleekSecurity/layers/plugins/audit/robots.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/audit/robots.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/audit/robots.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,I
from lib.utils.check import *
from lib.utils.printer import *
from lib.utils.readfi... | 27.795455 | 55 | 0.631235 |
1429e4102d3378e3c304a94dcd4bdbcec5279ca6 | 6,743 | py | Python | hisim/components/configuration.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/components/configuration.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/components/configuration.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | 1 | 2022-03-13T16:15:36.000Z | 2022-03-13T16:15:36.000Z | class WarmWaterStorageConfig:
tank_diameter = 1 # 0.9534 # [m]
tank_height = 2 # 3.15 # [m]
tank_start_temperature: float = 65 # [°C]
temperature_difference = 0.3 # [°C]
tank_u_value = 0 # 0.35 # [W/m^2*K]
slice_height_minimum = 0.05 # [m]
cl... | 40.866667 | 173 | 0.619012 |
b4e55b759502408ded816466caf989941be11d37 | 7,703 | py | Python | HW3/MakeDatasetRandom.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW3/MakeDatasetRandom.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW3/MakeDatasetRandom.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#Computer Vision EN.600.461 HW3
#MakeDatasetRandom.py
#Implementation of MakeDataset.py that includes random shuffling.
#Probability of transform: 70%
#Can apply mirror flipping, rotation -/+ 30 degrees, translation -/+ 10 px, scaling 0.7-1.3
import random
import numpy as np
from PIL import Image, Image... | 32.365546 | 120 | 0.660782 |
25d19692ed16f69d60e2d8bdd34ff5e942f8bd7d | 306 | py | Python | bin/transform_jsonld.py | zbw/cdv2021-pressemappe20 | 3b364034c2ff9f802659d4cdfe6a539d80359ac8 | [
"CC0-1.0"
] | null | null | null | bin/transform_jsonld.py | zbw/cdv2021-pressemappe20 | 3b364034c2ff9f802659d4cdfe6a539d80359ac8 | [
"CC0-1.0"
] | null | null | null | bin/transform_jsonld.py | zbw/cdv2021-pressemappe20 | 3b364034c2ff9f802659d4cdfe6a539d80359ac8 | [
"CC0-1.0"
] | null | null | null | from pyld import jsonld
import json
frame_fh = open('../data/frame.jsonld').read()
frame = json.loads(frame_fh)
data_fh = open('../data/pm20_cdv2021.interim.jsonld').read()
data = json.loads(data_fh)
#result = jsonld.flatten(data)
result = jsonld.frame(data, frame)
print(json.dumps(result, indent=2))
| 21.857143 | 60 | 0.728758 |
980df50ae36f4ef637117586fa190c3825b95b5e | 796 | py | Python | utils/DownloadUtil.py | wanglikang/zzuARTensorflow | 7ac59bd8988888ca5c4d7406ffc8869c9dc4121f | [
"MIT"
] | 1 | 2019-04-07T02:53:31.000Z | 2019-04-07T02:53:31.000Z | utils/DownloadUtil.py | wanglikang/zzuARTensorflow | 7ac59bd8988888ca5c4d7406ffc8869c9dc4121f | [
"MIT"
] | null | null | null | utils/DownloadUtil.py | wanglikang/zzuARTensorflow | 7ac59bd8988888ca5c4d7406ffc8869c9dc4121f | [
"MIT"
] | null | null | null | import urllib.request
import os
import yolo.myconfig as cfg
class DownloadUtil(object):
def __init__(self):
#self.domain = 'oyqquzum6.bkt.clouddn.com/'
self.domain = cfg.qiniuDomain+'/'
#self.httpDomain = 'http://oyqquzum6.bkt.clouddn.com/'
self.httpDomain = 'http://'+self.domain
... | 33.166667 | 62 | 0.626884 |
e289baafbec254e7901af9f63bfa82c44372ded9 | 38,181 | py | Python | paddlenlp/transformers/roformerv2/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/roformerv2/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/roformerv2/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 41.187702 | 133 | 0.606375 |
2c5b8865f11cec8bf90fb76dde7499bfe646d0e1 | 78 | py | Python | MeinProgramm.py | ritschmaster/LaTeX-Template | 6f8070d6e11ed6453b605cf6acac985edd02b8c1 | [
"Apache-2.0"
] | null | null | null | MeinProgramm.py | ritschmaster/LaTeX-Template | 6f8070d6e11ed6453b605cf6acac985edd02b8c1 | [
"Apache-2.0"
] | null | null | null | MeinProgramm.py | ritschmaster/LaTeX-Template | 6f8070d6e11ed6453b605cf6acac985edd02b8c1 | [
"Apache-2.0"
] | 1 | 2020-11-27T13:30:06.000Z | 2020-11-27T13:30:06.000Z | print("Hallo Welt")
print("Dieser Teil wird nicht mehr von Latex angezeigt")
| 19.5 | 56 | 0.75641 |
64d8d775c79ba74420f56a4cdbf0beb40c438566 | 2,692 | py | Python | busigyo/images.py | chieteia/akemines | 243e84a782ef7d26295100eeb33aa7e2e2879a08 | [
"MIT"
] | null | null | null | busigyo/images.py | chieteia/akemines | 243e84a782ef7d26295100eeb33aa7e2e2879a08 | [
"MIT"
] | null | null | null | busigyo/images.py | chieteia/akemines | 243e84a782ef7d26295100eeb33aa7e2e2879a08 | [
"MIT"
] | null | null | null | import urllib.request
import urllib.error
import time
import pprint
import os
test = """
100 晴れ
101 晴れ時々くもり
102 晴れ一時雨
103 晴れ時々雨
104 晴れ一時雪
105 晴れ時々雪
106 晴れ一時雨か雪
107 晴れ時々雨か雪
108 晴れ一時雨か雷雨
110 晴れのち時々くもり
111 晴れのちくもり
112 晴れのち一時雨
113 晴れのち時々雨
114 晴れのち雨
115 晴れのち一時雪
116 晴れのち時々雪
117 晴れのち雪
118 晴れのち雨か雪
119 晴れのち雨か雷雨
120 晴れ朝夕一時雨
121... | 13.326733 | 68 | 0.76263 |
206969f31931f076c957cf5b5d1b5e1af671c1cc | 844 | py | Python | 1IMG_PICKER.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | 1IMG_PICKER.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | 1IMG_PICKER.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 24 19:09:28 2019
@author: bian
"""
import os,shutil
small_pads=os.listdir('./imgsave/0small_pad')
for pad in small_pads:
path00='./imgsave/0small_pad/'+pad
path01='./imgsave/pure/0small_pad/'+pad
path10='./imgsave/1origin/'+pad
path... | 26.375 | 47 | 0.622038 |
20e84a115a15f79c0cf60a09947e9cc04c500596 | 7,721 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/generateParkingLots.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/generateParkingLots.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/generateParkingLots.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 45.152047 | 117 | 0.584639 |
4407262904a9dd4969fc281d65d5a7405bc6b076 | 2,177 | py | Python | pyconuk/management/commands/parseschedule.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/management/commands/parseschedule.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/management/commands/parseschedule.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | import os
import shutil
import yaml
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **kwargs):
shutil.rmtree('schedule')
with open('schedule.yml') as f:
schedule = yaml.load(f.read())
for date in schedule:
p... | 44.428571 | 135 | 0.396417 |
44440a1b8062ee80312f0b424d2a6139f314ff95 | 374 | py | Python | python/generator_tricks_for_systemprogrammer/up_and_down.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/up_and_down.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/up_and_down.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # 'yield from' can be used to delegate iteration
def countdown(n):
while n > 0:
yield n
n -= 1
def countup(stop):
n = 1
while n < stop:
yield n
n += 1
def up_and_down(n):
yield from countup(n)
yield from countdown(n)
if __name__ == "__main... | 14.96 | 49 | 0.513369 |
4464788b62eadee80d53fde76b1c7b8ae45fb3f4 | 3,340 | py | Python | Packs/NCSCCyberAsssessmentFramework/Scripts/NCSCReportOverview/NCSCReportOverview.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/NCSCCyberAsssessmentFramework/Scripts/NCSCReportOverview/NCSCReportOverview.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/NCSCCyberAsssessmentFramework/Scripts/NCSCReportOverview/NCSCReportOverview.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def calculate_overall(data: dict = None) -> str:
if not data:
return ""
results = [x["Result"] for x in data]
if "Not Achieved" in results:
return "Not Achieved"
elif "Partially Achi... | 36.304348 | 120 | 0.628443 |
2ba25d15102dd8b3f9fcd4931790f8e2f692410b | 151 | py | Python | tikz/graph-triangles/coordinates.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | tikz/graph-triangles/coordinates.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | tikz/graph-triangles/coordinates.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | def give_coordinates(n):
for y in range(0, n):
for x in range(y, 2*n-y, 2):
print(x, y)
print("")
give_coordinates(5)
| 18.875 | 36 | 0.516556 |
2bb5d4bc1482f434ef2ab9652e02ec0d6038c172 | 6,893 | py | Python | src/visitpy/visit_flow/flow/src/filters/pyocl_compile.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/src/filters/pyocl_compile.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/src/filters/pyocl_compile.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: pyocl_compile.py
author: Cyrus Harrison <cyrush@llnl.gov>
Maysam Moussalem <ma... | 34.293532 | 76 | 0.560279 |
ca7446ab4d5f0b245906f96e43664c319f20cce7 | 3,657 | py | Python | server/bumf/settings.py | bumfiness/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | 6 | 2017-01-07T17:59:46.000Z | 2017-02-10T13:19:46.000Z | server/bumf/settings.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | server/bumf/settings.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | """
Django settings for bumf.
"""
import os
import string
from django.utils.crypto import get_random_string
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
secret_file = os.path.join(BASE_DIR, '.secret')
if os.path.exists(secret_file):
with open(secret_file, 'r') as secret_stream:
... | 24.218543 | 91 | 0.665846 |
0462354a5d29188d97998574ba38e750e8dcef22 | 1,061 | py | Python | day26/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day26/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day26/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | # List Comprehension
# For Loop
import random
numbers = [1, 2, 3]
new_list = []
for n in numbers:
add_1 = n + 1
new_list.append(add_1)
# List Comprehension
new_list = [n + 1 for n in numbers]
# String as List
name = "Angela"
letters_list = [letter for letter in name]
# Range as List
range_list = [n * 2 for n... | 20.803922 | 68 | 0.683318 |
b6e6e21ae6b6f0831557088b409d42cfc5745c79 | 125 | py | Python | _transonic_testing/for_test_exterior_import_jit_2.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | _transonic_testing/for_test_exterior_import_jit_2.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/exterior_import_boost_2.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import gast
import numpy as np
const = 1
foo = 1
def func_import_2():
return const
def use_gast():
print(gast)
| 8.333333 | 20 | 0.656 |
61128d07b07aaf85e8ad498f0b09cc9eed52850d | 9,892 | py | Python | project/api/user/resources.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/api/user/resources.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/api/user/resources.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from flask import url_for
from flask.helpers import make_response
from flask_apispec import doc, marshal_with, use_kwargs
from flask_security import current_user
from project import db
from project.api import add_api_resource
from project.api.place.schemas import (
UserPlaceListRequestSchema,
UserPlaceListResp... | 29.616766 | 84 | 0.687727 |
b6566ad52ed09da573579067aff828d2202fc336 | 3,542 | py | Python | kernel/slovaki/admin.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/slovaki/admin.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/slovaki/admin.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import SlovakiAwardsContent
from .models import SlovakiNews
from .models import SlovakiNewsGroup
from .models import SlovakiNewsMovies
from .models import SlovakiNewsPhotos
from .models import SlovakiNewsTags
from .models import SlovakiProduct
from .models import SlovakiPr... | 27.246154 | 82 | 0.679277 |
b6a8f84c8bfc16ac5c4520f5158d7c40c300d52b | 143 | py | Python | 2114-maximum-number-of-words-found-in-sentences/2114-maximum-number-of-words-found-in-sentences.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 2114-maximum-number-of-words-found-in-sentences/2114-maximum-number-of-words-found-in-sentences.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 2114-maximum-number-of-words-found-in-sentences/2114-maximum-number-of-words-found-in-sentences.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def mostWordsFound(self, sentences: List[str]) -> int:
return max(len(sent.split()) for sent in sentences)
| 35.75 | 59 | 0.643357 |
bf4667227ed4aeab55c4356b9e111b710fabee91 | 449 | py | Python | tools/pythonpkg/tests/fast/types/test_unsigned.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_unsigned.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_unsigned.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z |
class TestUnsigned(object):
def test_unsigned(self, duckdb_cursor):
duckdb_cursor.execute('create table unsigned (a utinyint, b usmallint, c uinteger, d ubigint)')
duckdb_cursor.execute('insert into unsigned values (1,1,1,1), (null,null,null,null)')
duckdb_cursor.execute('select * from unsi... | 40.818182 | 103 | 0.668151 |
bf847af5a4fd48df51c0744dca6bbde51fc4fe92 | 1,233 | py | Python | DataStructure/U2/Lecture/StueckweiseKonstant.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | DataStructure/U2/Lecture/StueckweiseKonstant.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | DataStructure/U2/Lecture/StueckweiseKonstant.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null |
def berechne(F,x):
if x<F[0] or x>=F[-1]: return None
i=2
while x>=F[i]: i+=2
return F[i-1]
def add(F,G):
ff = fg = fh = None
i = j = 0
ausgabe = (max(F[0],G[0]),)
while True:
# Invariante:
# ff ist der Wert der Funktion F links von F[i]
# fg ist der Wert der F... | 23.711538 | 71 | 0.42498 |
ecf4b9414e27a35c3ae84954cee55508cebcbb87 | 1,170 | py | Python | deeplearning2020/submission.py | akuechle/deeplearning2020 | 678dc0a4b231866c6d96a55640c33971a92a23db | [
"MIT"
] | 1 | 2020-03-22T17:06:04.000Z | 2020-03-22T17:06:04.000Z | deeplearning2020/submission.py | akuechle/deeplearning2020 | 678dc0a4b231866c6d96a55640c33971a92a23db | [
"MIT"
] | null | null | null | deeplearning2020/submission.py | akuechle/deeplearning2020 | 678dc0a4b231866c6d96a55640c33971a92a23db | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
import kerasltisubmission as klti
from kerasltisubmission.exceptions import KerasLTISubmissionBadResponseException
if TYPE_CHECKING: # pragma: no cover
import keras.models
class Submission:
def __init__(
self,
user_token: klti.AnyIDType,
assignment_i... | 30.789474 | 88 | 0.663248 |
01dfad0115edb07891c22e872d0336832f5069bd | 737 | py | Python | quant/observers/logger.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/observers/logger.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/observers/logger.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | import logging
from quant import config
from .observer import Observer
class Logger(Observer):
def opportunity(self, profit, volume, bprice, kask, sprice, kbid, perc, w_bprice, w_sprice, base_currency="CNY",
market_currency="BTC"):
super(Logger, self).opportunity(profit, volume, bpric... | 49.133333 | 116 | 0.626866 |
bd79b75d6b6704cd6f09c3495ecc7f1879f44e52 | 829 | py | Python | main.py | matthewmercuri/mdbacktestv2 | 2525113458cdf71e7d99ac208ad35aea92169b99 | [
"MIT"
] | null | null | null | main.py | matthewmercuri/mdbacktestv2 | 2525113458cdf71e7d99ac208ad35aea92169b99 | [
"MIT"
] | null | null | null | main.py | matthewmercuri/mdbacktestv2 | 2525113458cdf71e7d99ac208ad35aea92169b99 | [
"MIT"
] | null | null | null | from backtester import Backtest
from actions import Actions
import pandas as pd
''' Eventually we would want to load these from a config file
'''
start_cash = 10000
benchmark = 'SPY'
tickers = ['AAPL', 'AMD']
start_date = '2002-03-27'
end_date = '2019-12-13'
Backtest = Backtest(start_cash, tickers, benchmark, start_... | 23.027778 | 73 | 0.711701 |
bde031044870deadbd1ab2de2d8440f0b7419278 | 1,775 | py | Python | AP8/paper/csv-line-plot/transform.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 6 | 2016-08-15T17:57:45.000Z | 2019-03-19T05:08:29.000Z | AP8/paper/csv-line-plot/transform.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 10 | 2016-04-11T10:20:34.000Z | 2016-08-09T21:47:48.000Z | AP8/paper/csv-line-plot/transform.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 7 | 2016-06-21T04:08:58.000Z | 2018-09-01T14:02:40.000Z | #!/usr/bin/env python
"""Transform a list of scores to correct CSV."""
import tensorvision.analyze as tva
cms = [{0: {0: 38231923, 1: 817300}, 1: {0: 1022789, 1: 2935988}},
{0: {0: 37928715, 1: 1120508}, 1: {0: 541973, 1: 3416804}},
{0: {0: 38559550, 1: 489673}, 1: {0: 872737, 1: 3086040}},
{0: ... | 45.512821 | 66 | 0.541972 |
da9de3d87675c98391740d8e0d5fb3d9b01f1436 | 1,315 | py | Python | 数据结构/NowCode/36_Print.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/36_Print.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/36_Print.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | # 按之字形顺序打印二叉树
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def Print(self, pRoot):
if pRoot == None:
return []
# write code here
stack1 = [pRoot]
stack2 = []
# 存储打印
ret ... | 30.581395 | 52 | 0.420532 |
daadfdcb313b05783a7050c8988f2c76683e445b | 2,060 | py | Python | packages/watchmen-model/src/watchmen_model/console/connected_space_graphic.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/connected_space_graphic.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/connected_space_graphic.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional, Union
from pydantic import BaseModel
from watchmen_model.common import ConnectedSpaceId, DataModel, GraphicRect, SubjectId, TopicId, UserBasedTuple
from watchmen_utilities import ArrayHelper
from .utils import construct_rect
class TopicGraphic(DataModel, BaseModel):
topicId: Topi... | 27.466667 | 110 | 0.756311 |
daee22d3b22b93c7b20a1c4d59b49282b5acd4a1 | 238 | py | Python | Online-Judges/CodingBat/Python/Warmup-02/05-last2.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Warmup-02/05-last2.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Warmup-02/05-last2.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def last2(str):
if len(str) <= 2:
return 0
last2_sub = str[len(str)-2:]
count = 0
for i in range(len(str)-2):
if str[i] == last2_sub[0] and str[i+1] == last2_sub[1]:
count += 1
return count
| 23.8 | 63 | 0.508403 |
c1405ef2df24888af6e558bc971e606c0251f54d | 1,537 | py | Python | spo/spo/report/spo_fallbibliothek/spo_fallbibliothek.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | null | null | null | spo/spo/report/spo_fallbibliothek/spo_fallbibliothek.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/spo/report/spo_fallbibliothek/spo_fallbibliothek.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # Copyright (c) 2013, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [
{"label": _("Klicken für anonyme Ansicht"), "fieldname": "anonym", "fieldtype": "Data"}... | 40.447368 | 135 | 0.634353 |
de035c442d0a31c11976731e71728dc7979eea9c | 154 | py | Python | exercises/ja/exc_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/exc_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/exc_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# ja_core_news_mdモデルをロード
nlp = ____
# テキストを処理
doc = nlp("パジャマを着た2つのバナナ")
# 「バナナ」のベクトルを取得
bananas_vector = ____.____
print(bananas_vector)
| 12.833333 | 26 | 0.766234 |
e72b626a364c28a41fe7aa2526924f83f39d279f | 5,589 | py | Python | tuta/model/pretrains.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 36 | 2021-06-15T01:04:27.000Z | 2022-03-19T16:36:54.000Z | tuta/model/pretrains.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 6 | 2021-09-03T11:29:36.000Z | 2021-12-15T11:33:57.000Z | tuta/model/pretrains.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 8 | 2021-11-03T04:32:36.000Z | 2022-02-02T13:43:47.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Aggregated Model Frameworks for Pre-Training. """
import torch.nn as nn
import model.heads as hds
import model.backbones as bbs
# %% Pre-training Models
class TUTAbase(nn.Module):
def __init__(self, config):
super(TUTAbase, self).__init__()... | 34.5 | 86 | 0.616926 |
e74fb0c999d8445f35c2273cc0f9a5a6288de8ea | 1,669 | py | Python | Utils/py/TeamCommGenerator/utils/TeamCommReceiver.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/TeamCommGenerator/utils/TeamCommReceiver.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/TeamCommGenerator/utils/TeamCommReceiver.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf8 -*-
import sys, os, socket
import threading
from threading import Event
import time
from naoth.SPLMessage import SPLMessage
class TeamCommReceiver(threading.Thread):
def __init__(self, loop_control:Event, host='localhost', port=10004):
threading.Thread.__init__... | 29.280702 | 89 | 0.580587 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.