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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
683ee5841672b25680289b705a30bfe8691854df | 963 | py | Python | src/showcase/asr/asr.py | th-koeln-intia/ip-sprachassistent-team1 | 69fbc06a326da91fd3d84f222eba6cd2b1a79975 | [
"MIT"
] | 1 | 2021-04-28T09:45:34.000Z | 2021-04-28T09:45:34.000Z | src/showcase/asr/asr.py | th-koeln-intia/ip-sprachassistent-team1 | 69fbc06a326da91fd3d84f222eba6cd2b1a79975 | [
"MIT"
] | 1 | 2020-09-24T07:20:16.000Z | 2020-09-24T07:20:16.000Z | src/showcase/asr/asr.py | th-koeln-intia/ip-sprachassistent-team1 | 69fbc06a326da91fd3d84f222eba6cd2b1a79975 | [
"MIT"
] | 1 | 2020-12-04T13:38:33.000Z | 2020-12-04T13:38:33.000Z | import json
import logging
logger = logging.getLogger('pocketsphinx_asr')
def on_asr_activation(client, userdata, msg):
logger.info("ASR service activated")
def on_asr_deactivation(client, userdata, msg):
logger.info("ASR service deactivated")
def on_asr_start_listen(client, userdata, msg):
payload =... | 31.064516 | 105 | 0.712357 |
68b5b4b5c365192fd90113ceab0b07accd0d7d14 | 89 | py | Python | slcytest.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | slcytest.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | slcytest.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | import cv2
import numpy as np
filepath = '/home/pi/img.jpg'
img = cv2.imread(filepath)
| 12.714286 | 29 | 0.719101 |
cc1800a7677328b394069de770c6f4473345aca4 | 10,905 | py | Python | tensorflow/basic-rl/tutorial12/code/train_cartpole_pg.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial12/code/train_cartpole_pg.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial12/code/train_cartpole_pg.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import tensorflow as tf
import numpy as np
import random
import gym
import math
import matplotlib.pyplot as plt
"""
Vanilla Policy Gradient (PG)
- Sources of inspiration:
- https://github.com/kvfrans/openai-cartpole/blob/master/cartpole-policygradient.py
- http://kvfrans.com/simple-algoritms-for-solving-cartp... | 42.104247 | 143 | 0.609445 |
cc242fea898dd40ccaa74b0022759b6e212177ac | 598 | py | Python | Beginner/03. Python/Rotate_Array.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2021-10-06T13:55:02.000Z | 2021-10-06T13:55:02.000Z | Beginner/03. Python/Rotate_Array.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/Rotate_Array.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | #Given an array, rotate the array to the right by k steps, where k is non-negative.
#Example 1
"""Input: nums = [1,2,3,4,5,6,7], k = 3
Output: [5,6,7,1,2,3,4]
Explanation:
rotate 1 steps to the right: [7,1,2,3,4,5,6]
rotate 2 steps to the right: [6,7,1,2,3,4,5]
rotate 3 steps to the right: [5,6,7,1,2,3,4]"""
class S... | 24.916667 | 83 | 0.555184 |
acc8f73097ffbdd4aec4dc7bdb6217547f9befb1 | 1,171 | py | Python | dipol-formular.py | dl1nux/dipol-formular | b2e62845774e2a9fc4b8ec9dbabbf3fd54f06359 | [
"CC0-1.0"
] | null | null | null | dipol-formular.py | dl1nux/dipol-formular | b2e62845774e2a9fc4b8ec9dbabbf3fd54f06359 | [
"CC0-1.0"
] | null | null | null | dipol-formular.py | dl1nux/dipol-formular | b2e62845774e2a9fc4b8ec9dbabbf3fd54f06359 | [
"CC0-1.0"
] | null | null | null | # Funktion "Berechnung"
def berechnung():
# Abfrage von Ist-Länge und Ist-QRG
print()
laengeist = float(input("Aktuelle Schenkellänge des Dipols in Meter: "))
qrgist = float(input("Aktuelle Resonanzfrequenz in MHz mit bestem SWV: "))
# Abfrage von Soll-QRG
qrgsoll = float(input("Gewünschte Frequ... | 33.457143 | 78 | 0.659266 |
acf6ddfa979456bcab43c2ea5fdc401c1cf2c14d | 1,533 | py | Python | jumeaux/commands/init/main.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/commands/init/main.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/commands/init/main.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | """Initialize a project template for Jumeaux
Usage:
{cli} (-h | --help)
{cli} [<name>]
Options:
<name> Initialize template name
-h --help Show this screen.
"""
import os
import shutil
from owlmixin import OwlMixin
from owlmixin import TOption
from jumea... | 25.131148 | 73 | 0.572081 |
c5ee45eccae1259458b8e7a6aa852744755ab05f | 1,793 | py | Python | model/topoml_util/geom_fourier_descriptors.py | Empythy/geometry-learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 21 | 2018-10-09T08:15:29.000Z | 2022-03-16T08:23:08.000Z | model/topoml_util/geom_fourier_descriptors.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 31 | 2017-09-20T13:30:37.000Z | 2018-03-01T13:24:58.000Z | model/topoml_util/geom_fourier_descriptors.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 7 | 2018-11-29T11:39:02.000Z | 2022-01-12T07:10:26.000Z | import numpy as np
from pyefd import elliptic_fourier_descriptors
np.seterr(all='raise')
def geom_fourier_descriptors(shapes, order):
"""
Creates a stacked array of different variations of fourier descriptors: normalized, non-normalized
:param shapes: a list of shapely shapes
:param order: the fourie... | 38.978261 | 102 | 0.72783 |
c5f6e0eac15d739ecb40165581f10995e723aadd | 10,054 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/ocs_network_action.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/ocs_network_action.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/ocs_network_action.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# -*- codi... | 42.601695 | 194 | 0.61846 |
a8932cff5f384ced042b1914e12c332e92502e3c | 963 | py | Python | v351/python/rechteck.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v351/python/rechteck.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v351/python/rechteck.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import uncertainties.unumpy as unp
from uncertainties.unumpy import (std_devs as stds)
from scipy.stats import sem
import matplotlib.pyplot as plt
from uncertainties import ufloat
x = np.ones(10)
dv, ve, u, ue = np.genfromtxt('python/rechteckanalyse.txt', unpack=True)
for i in range(10):
x[i] =... | 23.487805 | 107 | 0.657321 |
769605260d60805cb589bf0b6f661e1b1536c7ba | 355 | py | Python | python/python_backup/PRAC_PYTHON/diya.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/diya.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/diya.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | m=[[0 for j in range(5)] for i in range(5)]
for i in range(5):
for j in range(5):
m[i][j]=input()
for i in range(5):
for j in range(5):
if i==j:
print "1",
if i==(j-1):
print "0",
if i==(j-2):
print"1",
if i==(j-3):
print "0",
if i==(j-4):
print "1",
else:... | 15.434783 | 45 | 0.422535 |
8c11a46b22af62b7e647e5866958993595e2c923 | 235 | py | Python | nz_django/day2/template_demo2/template_demo2/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day2/template_demo2/template_demo2/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day2/template_demo2/template_demo2/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.shortcuts import render
def index(request):
context = {
'persons':[
'张三',
'李四',
'王五',
'赵六'
]
}
return render(request,'index.html',context=context) | 19.583333 | 55 | 0.468085 |
8c9fd26370de97e16dfb8b50591d5dd8ce9b4b1d | 1,780 | py | Python | views.py | EGoesche/temperature-api | 7dfe8f67bfd14cab0bf376ac20b101c4ce8ad79a | [
"MIT"
] | null | null | null | views.py | EGoesche/temperature-api | 7dfe8f67bfd14cab0bf376ac20b101c4ce8ad79a | [
"MIT"
] | null | null | null | views.py | EGoesche/temperature-api | 7dfe8f67bfd14cab0bf376ac20b101c4ce8ad79a | [
"MIT"
] | null | null | null | from flask import Blueprint, jsonify, request
from app import db
from models import Temperature
main = Blueprint('main', __name__)
# Route to answer for standard request
@main.route('/')
def welcome():
return 'Welcome to the Temperature-API!'
# Route to get all temperatures
@main.route('/temperatures')
def list_... | 32.962963 | 112 | 0.720787 |
8cb1b221c8ef19df3a6cefb4933a4c8a746eb778 | 1,240 | py | Python | exercises/de/exc_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("en_core_web_sm")
doc = nlp(
"Twitch Prime, the perks program for Amazon Prime members offering free "
"loot, games and other benefits, is ditching one of its best features: "
"ad-free viewing. According to an email sent out to Amazon Prime me... | 42.758621 | 81 | 0.728226 |
50fcae8e6a6fc2ce443cd4bcf84b5d4b41e0d0ac | 2,424 | py | Python | prak_2/miller_rabin.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | prak_2/miller_rabin.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | prak_2/miller_rabin.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | import random
import math
def miller_rabin(n, it):
if n != int(n) or n < 2:
return False
n=int(n)
#Miller-Rabin test for prime
if n==0 or n==1 or n==4 or n==6 or n==8 or n==9:
return False
if n==2 or n==3 or n==5 or n==7:
return True
for i in range(it):#number ... | 22.654206 | 71 | 0.509076 |
e8a273c86cf686e4f0958427e6998de1869387b7 | 213 | py | Python | src/aijack/utils/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/utils/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/utils/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | from .dataloader import prepareFederatedMNISTDataloaders # noqa: F401
from .metrics import total_variation # noqa: F401
from .utils import NumpyDataset, try_gpu # noqa: F401
from .configloader import loadConfig | 53.25 | 70 | 0.816901 |
fa42c9af48b01b7acf3ffd639e6a52cbb371fd6f | 1,689 | py | Python | 0-notes/job-search/Leetcode/02-MinMovesString.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Leetcode/02-MinMovesString.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Leetcode/02-MinMovesString.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Min Moves to Obtain String Without 3 Identical Consecutive Letters
# You are given a string S consisting of N letters ‘a’ and/or ‘b’.
# In one move, you can swap one letter for the other (‘a’ for ‘b’ or ‘b’ for ‘a’).
# Write a function solution that, given such a string S, returns the minimum number
# of moves... | 39.27907 | 86 | 0.692126 |
d749203e03e7b4277bcb2ccea10f36b76c0991ef | 362 | py | Python | csv2db.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | csv2db.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | csv2db.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | 2 | 2022-03-22T12:38:59.000Z | 2022-03-23T07:33:29.000Z | from db.data import insert, start, stop
import csv
session = start()
with open('data.csv', 'r', encoding="utf8") as csvfile:
reader = csv.reader(csvfile, delimiter=';')
line = 0
for row in reader:
if line != 0:
#print('Inserting line {}'.format(line))
insert(row[2], row[5],... | 24.133333 | 55 | 0.582873 |
d13308a4d41c72b99db1b72631d2bcaf77cca23a | 1,451 | py | Python | cs/lambda_cs/06_graphs/projects/ancestor/ancestor.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/06_graphs/projects/ancestor/ancestor.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/06_graphs/projects/ancestor/ancestor.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Graphs :: Day 2 Project
"""
import sys
import os
sys.path.append(os.path.abspath("../graph"))
from graph import Graph
def earliest_ancestor(ancestors: list, starting_node: int) -> int:
# === Instantiate graph === #
graph = Graph()
for rel in ancestors: # Loop through input to add all vertices
... | 29.612245 | 67 | 0.574776 |
7e4a8b358553804292f1c85cbf40b255d878848e | 2,059 | py | Python | aoc2020/day_22/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_22/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_22/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from collections import deque
from itertools import islice
from functools import reduce
from .part_1 import Solution as Part1
class Solution(Part1):
expected = 291
def solve(self) -> any:
p1, p2 = self.load_decks()
w, s = self.play_game(p1, p2)
print("Winner:", w)
return s
... | 31.19697 | 97 | 0.568723 |
0e7375290a2caca009fd104a571de0217f636db7 | 5,521 | py | Python | NeuralNet/Oli/libs/ProcessingPipeline.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | 6 | 2017-04-12T14:05:19.000Z | 2021-01-29T11:23:50.000Z | NeuralNet/Oli/libs/ProcessingPipeline.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | NeuralNet/Oli/libs/ProcessingPipeline.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | from keras.optimizers import RMSprop
from keras.utils import np_utils
from numpy.core.multiarray import ndarray
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
import numpy as np
from NeuralNet.Oli.libs.TrainingLogger import TrainingLogger
from NeuralNet.Oli.libs.Ima... | 40.007246 | 113 | 0.67361 |
adfa2ecfdd3492ead8856576d658f32ee0eec26a | 3,198 | py | Python | yolov5-coreml-tflite-converter/tflite/tf_model/keras_model.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_model/keras_model.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_model/keras_model.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | import time
import tensorflow as tf
from models.tf import TFDetect
from tensorflow import keras
from constants import BATCH_SIZE, NB_CHANNEL, DEFAULT_IOU_THRESHOLD, DEFAULT_CONF_THRESHOLD, GREEN, BLUE, END_COLOR, RED
from tf_model.tf_model import tf_Model
from tf_utils.parameters import ModelParameters, Postprocessin... | 44.416667 | 135 | 0.650407 |
70db479068eabbe6c10cef90018f59355052f343 | 920 | py | Python | python/socket_client.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | python/socket_client.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | python/socket_client.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | import socket
# client端
s = socket.socket() # socket():建立 socket 與設定使用哪種通訊協定,AF_INET是設置地址格式爲IPv4、AF_INET6是設置地址格式爲IPv6,SOCK_STREAM參數表示使用TCP的傳輸方式、SOCK_DGRAM參數表示使用UDP協定的傳輸方式,若不填參數,預設採IPv4位址和TCP協定通訊
s.connect(('192.168.1.94', 8080))#連接伺服器,前後端的主機名稱和埠號必須一致,否則無法相連。
while True:
msg = input('請輸入訊息:') #讀取... | 61.333333 | 231 | 0.670652 |
69fa941a7a1ecc7cd969d49e155d44185f247e7d | 12,598 | py | Python | research/cv/RefineDet/src/eval_utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/RefineDet/src/eval_utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/RefineDet/src/eval_utils.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.994444 | 108 | 0.550722 |
2a2515abc02f1e068a21df82a40ae9edb96a8220 | 2,325 | py | Python | basketball/player/NBA_Player.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | basketball/player/NBA_Player.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | basketball/player/NBA_Player.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null |
import os
import urllib.request
import nba_api
from nba_api.stats.endpoints import *
from nba_api.stats.static import *
class NBA_Player():
"""
Hold information about an NBA Player
"""
def __init__(self, fullName=None):
self.__is_valid = False
self.playerID = self.__nameToI... | 31 | 153 | 0.621505 |
aaabe857760b6b034280cfd61aecd28300fbec63 | 700 | py | Python | solutions/graph_based_recommend/webserver/src/common/config.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/graph_based_recommend/webserver/src/common/config.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/graph_based_recommend/webserver/src/common/config.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import os
from milvus import Milvus, IndexType, MetricType, Status
MILVUS_HOST = os.getenv("MILVUS_HOST", "127.0.0.1")
MILVUS_PORT = os.getenv("MILVUS_PORT", 19530)
VECTOR_DIMENSION = os.getenv("VECTOR_DIMENSION", 256)
METRIC_TYPE = os.getenv("METRIC_TYPE", MetricType.IP)
TOP_K = os.getenv("TOP_K", 100)
MILVUS_TABLE ... | 38.888889 | 61 | 0.732857 |
2dd85155ad1b15fc69083184216511289b6944f2 | 561 | py | Python | tools/pythonpkg/tests/fast/test_replacement_scan.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1 | 2021-12-13T06:00:18.000Z | 2021-12-13T06:00:18.000Z | tools/pythonpkg/tests/fast/test_replacement_scan.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 32 | 2021-09-24T23:50:09.000Z | 2022-03-29T09:37:26.000Z | tools/pythonpkg/tests/fast/test_replacement_scan.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | null | null | null | import duckdb
import os
class TestReplacementScan(object):
def test_csv_replacement(self, duckdb_cursor):
filename = os.path.join(os.path.dirname(os.path.realpath(__file__)),'data','integers.csv')
res = duckdb_cursor.execute("select count(*) from '%s'"%(filename))
assert res.fetchone()[0] == 2
def test_parq... | 37.4 | 101 | 0.73262 |
fac923e09ca1e4318b71947ad239fb0d85fa6084 | 8,091 | py | Python | rfvision/models/pose_estimators/articulation/optimization/optimizer.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | rfvision/models/pose_estimators/articulation/optimization/optimizer.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | rfvision/models/pose_estimators/articulation/optimization/optimizer.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | import os
import json
import numpy as np
from .utils import ransac, joint_transformation_estimator, joint_transformation_verifier, get_3d_bbox
INSTANCE_CLASSES = ('BG', 'box', 'stapler', 'cutter', 'drawer', 'scissor')
label_maps = {'box': (0, 1, 2),
'stapler': (0, 3, 4),
'cutter': (0, 5, 6... | 45.201117 | 134 | 0.587566 |
87a10103cf0964205bf70d45be222fc3381851ba | 212 | py | Python | exam_notes/exam_notes/web/helpers.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | exam_notes/exam_notes/web/helpers.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | exam_notes/exam_notes/web/helpers.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from exam_notes.web.models import Profile, Note
def get_profile():
profile = Profile.objects.first()
if profile:
return profile
return None
def get_notes():
return Note.objects.all()
| 15.142857 | 47 | 0.679245 |
87cc747193e80e64382e0d53d9aaa1be00cf30a9 | 1,586 | py | Python | src/examples/explainMass.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-26T16:16:14.000Z | 2020-05-26T16:16:14.000Z | src/examples/explainMass.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | null | null | null | src/examples/explainMass.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-16T20:09:17.000Z | 2020-05-16T20:09:17.000Z | import pyopenms
from pyopenms import *
import sys
# Example for mass decomposition (mass explanation)
# Internal residue masses (as observed e.g. as mass shifts in tandem mass spectra)
# are decomposed in possible amino acid strings that match in mass.
mass = float(sys.argv[1]) # provide mass as first command... | 38.682927 | 99 | 0.718159 |
355c6047c4754b72ad35c22020e2f9cb1e52bb43 | 957 | py | Python | tools/check_include_guard/check_include_guard.py | myoukaku/bksge | 0f8b60e475a3f1709723906e4796b5e60decf06e | [
"MIT"
] | 4 | 2018-06-10T13:35:32.000Z | 2021-06-03T14:27:41.000Z | tools/check_include_guard/check_include_guard.py | myoukaku/bksge | 0f8b60e475a3f1709723906e4796b5e60decf06e | [
"MIT"
] | 566 | 2017-01-31T05:36:09.000Z | 2022-02-09T05:04:37.000Z | tools/check_include_guard/check_include_guard.py | myoukaku/bksge | 0f8b60e475a3f1709723906e4796b5e60decf06e | [
"MIT"
] | 1 | 2018-07-05T04:40:53.000Z | 2018-07-05T04:40:53.000Z | # -*- coding: utf-8 -*-
import os
import os.path
import codecs
#import sys
import argparse
import subprocess
parser = argparse.ArgumentParser(description='')
parser.add_argument("-r", "--root_path")
parser.add_argument("-p", "--project")
args = parser.parse_args()
root_path = args.root_path
project ... | 25.864865 | 98 | 0.636364 |
35abfea57c3efe4197ebe6c2dae92bc9d4f38cab | 1,030 | py | Python | ___Python/Marco/PythonProj/p02_datenstrukturen/m01_temperaturen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p02_datenstrukturen/m01_temperaturen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p02_datenstrukturen/m01_temperaturen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | celsius_temperaturen = (0.7 , 2.1, 4.2, 8.2, 12.5, 15.6, 16.9, 16.3, 13.6, 9.5, 4.6, 2.3)#Durchschnittstemeraturen Bielefeld nach Jahren
# Aufgabe: Neue Liste fahrenheit erzeugen, die die Temp. in Fahrenheit enthält.
# Lösung 1) for-Schleife
fahrenheit= []
for temperatur in celsius_temperaturen:
fahrenheit.a... | 33.225806 | 137 | 0.715534 |
ea2d8d862b33dc7126d164532db93038fb087cd3 | 2,453 | py | Python | Ac_auto.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | Ac_auto.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | 1 | 2020-11-21T08:09:17.000Z | 2020-12-03T13:14:52.000Z | Ac_auto.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | import time
# AC自动机算法
class node(object):
def __init__(self):
self.next = {}
self.fail = None
self.isWord = False
self.word = ""
class ac_automation(object):
def __init__(self):
self.root = node()
# 添加敏感词函数
def addword(self, word):
temp_root = self.roo... | 26.956044 | 61 | 0.465552 |
57842f356fba68abd9f8d7c39e8f45bdca7c178c | 319 | py | Python | exercises/en/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("en_core_web_sm")
text = "It’s official: Apple is the first U.S. public company to reach a $1 trillion market value"
# Process the text
doc = nlp(text)
# Iterate over the predicted entities
for ent in doc.ents:
# Print the entity text and its label
print(ent.text, ent.label_)
| 22.785714 | 98 | 0.721003 |
10409bf7a11ff6480454e8740b9625babf161144 | 779 | py | Python | Packs/CommonScripts/Scripts/WordTokenizeTest/WordTokenizeTest_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/WordTokenizeTest/WordTokenizeTest_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/WordTokenizeTest/WordTokenizeTest_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from WordTokenizeTest import main
from CommonServerPython import formats
import demistomock as demisto
# Note: this test will fail locally (in your editor) as it requires downloading punkt nltk data
# If you want to run locally install punkt data by running:
# pipenv run python -m nltk.downloader punkt
def test_main(... | 41 | 95 | 0.724005 |
52fbfa976b54370facd49a01f538e760f039f2a9 | 5,803 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/wcscli/wcs_shell.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/wcscli/wcs_shell.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/wcscli/wcs_shell.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# -*- codi... | 34.541667 | 144 | 0.533862 |
df372e2d9d90ad7153a71dbc8a1cb463dc14a3dd | 414 | py | Python | 20-fs-ias-lec/groups/05-loraLink/src/LoRa_PC_Link/Wifi_Link_PC/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/05-loraLink/src/LoRa_PC_Link/Wifi_Link_PC/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/05-loraLink/src/LoRa_PC_Link/Wifi_Link_PC/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from lora_sync_layer import Lora_Sync_Layer
from lora_feed_layer import Lora_Feed_Layer
from lora_test_sensor_layer import Lora_Test_Sensor_Layer
import os
try:
os.remove("Sensor_Feed.pcap")
os.remove("Control_Feed.pcap")
except:
print("Cannot delete files")
feed_layer = Lora_Feed_Layer()
test... | 27.6 | 58 | 0.794686 |
10c9f6e55d7e295db165822542b63b96042a6091 | 1,297 | py | Python | research/cv/tsn/src/basic_ops.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/tsn/src/basic_ops.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/tsn/src/basic_ops.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.057143 | 87 | 0.645335 |
1d57e6b875f2cbacfffecaf888068e40d12a4407 | 934 | py | Python | src/main/python/cluster/dbscan/main.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/cluster/dbscan/main.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/cluster/dbscan/main.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | '''
Created on Feb 13, 2014
@author: sushant
'''
from dbscanner import *
import csv
import re
from context import resource_manager
configPath = resource_manager.Properties.getRootPath()+"cluster/dbscan/config"
dataPath = resource_manager.Properties.getRootPath()+"cluster/dbscan/aggregation.txt"
def ma... | 21.72093 | 86 | 0.566381 |
f68e6328d52e37aace87e99944207f4b152e9337 | 11,510 | py | Python | tests/test_trace.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | tests/test_trace.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | tests/test_trace.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""test_trace.py - unit tests for the trace-module of DHParser
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 use this file except in compliance with the License.
Yo... | 35.091463 | 92 | 0.553692 |
1217cdb41418febff6cccc0655fe5758990bde11 | 1,743 | py | Python | applications/neural_search/recall/milvus/milvus_recall.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/neural_search/recall/milvus/milvus_recall.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/neural_search/recall/milvus/milvus_recall.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.571429 | 74 | 0.661503 |
f621de5cc1684e00e668507ba7fff9fb3294edd8 | 3,849 | py | Python | apps/index/views.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/index/views.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/index/views.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | import logging
from django.shortcuts import render, HttpResponseRedirect
from django.http import HttpResponse
from .forms import RegisterForm
from .forms import AuthenticationForm
from django.views.decorators.csrf import csrf_exempt
from apps.projects.models import Experiment, Project, Datarow, Value
from apps.user.mod... | 46.939024 | 224 | 0.585866 |
143c468b5cf0e332e896be2f02dea0ea1bae0c03 | 206 | py | Python | leetcode/231-Power-of-Two/PowofTwo_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/231-Power-of-Two/PowofTwo_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/231-Power-of-Two/PowofTwo_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer} n
# @return {boolean}
def isPowerOfTwo(self, n):
res = 0
while n > 0:
res += n & 1
n = n >> 1
return res == 1
| 18.727273 | 30 | 0.427184 |
b4d1cf77fb2672be9dea3588092b4bde52381e59 | 1,415 | py | Python | Python/Memes/main.py | boneskewer69/ifis | 926323f60bf8eac55ccc67b6f6e536fe19c6b4c2 | [
"MIT"
] | null | null | null | Python/Memes/main.py | boneskewer69/ifis | 926323f60bf8eac55ccc67b6f6e536fe19c6b4c2 | [
"MIT"
] | null | null | null | Python/Memes/main.py | boneskewer69/ifis | 926323f60bf8eac55ccc67b6f6e536fe19c6b4c2 | [
"MIT"
] | null | null | null | import os
import time
from datetime import datetime
def get_all_files_in_directory(p_path: str) -> list:
return [f for f in os.listdir(p_path) if os.path.isfile(os.path.join(p_path, f))]
def get_filetype(p_path: str) -> str:
return p_path.split(".")[-1]
path = "C:\\Users\\fritz\\Desktop\\rename_memes\\renam... | 32.906977 | 101 | 0.639576 |
2c147e0032b30495561c3827c058d06161e2f245 | 285 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/meta/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/meta/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/meta/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .data_source_service import DataSourceService
from .external_writer_service import ExternalWriterService
from .key_store_service import KeyStoreService
from .pipeline_service import PipelineService
from .tenant_service import TenantService
from .topic_service import TopicService
| 40.714286 | 58 | 0.894737 |
9f22e3fce2f16cc122abf75c3be39212214355fe | 1,860 | py | Python | cleaning.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | cleaning.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | cleaning.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | 1 | 2020-09-08T13:42:16.000Z | 2020-09-08T13:42:16.000Z | import pandas as pd
import numpy as np
import csv
from tqdm import trange
def clean(file_name,targets=['11612','11613']):
data = pd.read_csv(file_name)
data['result'].fillna(0,inplace=True)
data['result'] = data['result'].astype(int)
items = pd.unique(data['item_id'].values).to... | 28.615385 | 80 | 0.575269 |
4c975e35898f76175cc2aa098650ad683c8a4a95 | 1,905 | py | Python | AdvancePython-master/chapter08/attr_desc.py | xuyifeiCoco/python | 83af27b3baf1caf157b330c580f356a94095e44d | [
"MIT"
] | 26 | 2019-09-17T12:48:36.000Z | 2022-02-24T12:27:01.000Z | AdvancePython-master/chapter08/attr_desc.py | xuyifeiCoco/python | 83af27b3baf1caf157b330c580f356a94095e44d | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | coding-200/chapter08/attr_desc.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 20 | 2019-05-31T14:21:00.000Z | 2021-07-27T15:58:25.000Z | from datetime import date, datetime
import numbers
class IntField:
#数据描述符
def __get__(self, instance, owner):
return self.value
def __set__(self, instance, value):
if not isinstance(value, numbers.Integral):
raise ValueError("int value need")
if value < 0:
ra... | 23.518519 | 74 | 0.647769 |
e226cce8400f7adaf8fa2bc9c6e39c70d0e45a17 | 6,215 | py | Python | gemtown/utils/abi.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/utils/abi.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/utils/abi.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown_abi=[{"constant":True,"inputs":[{"name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"tokenId","type":"uint256"}],"name":"tokenMETADATA","outputs":[{"name":"","type"... | 6,215 | 6,215 | 0.648753 |
80f01b28a0222298d67949d8587c58a2102fc2d7 | 3,100 | py | Python | HW1/test_line_finder.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/test_line_finder.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/test_line_finder.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#kverdey1@jhu.edu
#Computer Vision EN.601.461
#Assignment 1
#Programming section 2, test_line_finder
#test_line_finder: test module for p5, p6, p7
import cv2
import numpy as np
import matplotlib.pyplot as plt
from p5 import p5
from p6 import p6
from p7 import p7
hough_simple_1 = cv2.imread('hough_simpl... | 43.055556 | 99 | 0.859355 |
039e1504f90367655a81f68f749b287b053ec962 | 489 | py | Python | pacman-termux/test/pacman/tests/skip-remove-with-glob-chars.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/skip-remove-with-glob-chars.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/skip-remove-with-glob-chars.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "transferred file with glob characters that match a removed file"
lp = pmpkg("foo")
lp.files = ["foo/b*r", "foo/bar"]
self.addpkg2db("local", lp)
sp1 = pmpkg("foo", "1.0-2")
self.addpkg(sp1)
sp2 = pmpkg("bar", "1.0-2")
sp2.files = ["foo/b*r"]
self.addpkg(sp2)
self.args = "-U %s %s" % (sp1.filenam... | 24.45 | 84 | 0.666667 |
206d3313a8079c4f1150ad4899ce68adb4f74e80 | 397 | py | Python | Curso-Em-Video-Python/2Exercicios/085_lista_com_pares_e_impares.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/085_lista_com_pares_e_impares.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/085_lista_com_pares_e_impares.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from random import randint
dados = [[], []]
valor = 0
for c in range(0, 7):
valor = randint(1, 10)
#valor = int(input(f'Digite o {c + 1}° Valor: '))
if valor % 2 == 0:
dados[0].append(valor)
else:
dados[1].append(valor)
dados[0].sort()
dados[1].sort()
print(f'Os valores pares digitados f... | 24.8125 | 56 | 0.602015 |
20daeb44bd066876e1009f7f354a8fd73863356e | 8,560 | py | Python | tarefas-poo/lista-01/calculos/testes.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/testes.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/testes.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | from model.calculos import *
# testando media_de_tres_numeros
try:
print('\nIniciando teste media_de_tres_numeros...')
media = media_de_tres_numeros(10,20,30)
assert media == 20, f'media_de_tres_numeros(10,20,30) deveria retornar 20 mas retornou {media}'
media = media_de_tres_numeros(10,10,10)
asse... | 40.187793 | 108 | 0.708061 |
ff8ed520af0fb42fbadae960e3eded6dad677fda | 1,916 | py | Python | Licence 1/I11/TP6/ex4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP6/ex4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP6/ex4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | from pocketgl import *
from math import *
width = 700
height = 500
middle_x = 350
middle_y = 250
init_window ("Fonctions", width, height)
"""
Affichage du quadrillage
"""
current_color("grey")
for x in range(-3, 4):
box(middle_x + x * 100, 0, middle_x + x * 100, height)
for y in range(-2, 3):
box(0, ... | 18.601942 | 58 | 0.582463 |
92205dc85cc17e2876c9bd3f2bdb2d42fdf2d305 | 1,452 | py | Python | rev/goper/solver.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | rev/goper/solver.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | rev/goper/solver.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | encoded = "472817216138472861341721172161414728472861401721172161214728472861261721613517214728472861411721472817216136172147286114472861311721472861241721472861221721612517214728472817216086172147286136608617214728172147286113613447281721172147286123472817216086172161264728612847281721172147286125472861291721472860861... | 50.068966 | 1,068 | 0.880854 |
4715dd6fad1bf9d7b5e1f2ecac4d0d085cf5f455 | 213 | py | Python | club/forms.py | miglesias91/dt | 6e00f883ebdb581f87750852f18cf9e3058aae2f | [
"MIT"
] | null | null | null | club/forms.py | miglesias91/dt | 6e00f883ebdb581f87750852f18cf9e3058aae2f | [
"MIT"
] | null | null | null | club/forms.py | miglesias91/dt | 6e00f883ebdb581f87750852f18cf9e3058aae2f | [
"MIT"
] | null | null | null | from django import forms
from club.models import LogMessage
class LogMessageForm(forms.ModelForm):
class Meta:
model = LogMessage
fields = ("mensaje",) # NOTE: the trailing comma is required | 30.428571 | 70 | 0.70892 |
5bd7201df716917ba34e2032fc89f3be1b31d6f2 | 1,042 | py | Python | Licence 1/I11/TP4/ex6.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP4/ex6.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP4/ex6.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def tuple_sum(u, v):
if len(u) == len(v):
sum = ()
i = 0
while i < len(u):
sum += (u[i] + v[i],)
i += 1
return sum
def tuple_ask():
size = int(input("Entrez une taille de tuple:"))
tuple = ()
while size != 0:
tuple += (float(input("Valeur:... | 23.155556 | 57 | 0.52975 |
7530ad1d06bf967d90362570639c63df075fc8d9 | 95 | py | Python | hw3-cloudmesh/oliveral_cloudmesh_ex2.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | hw3-cloudmesh/oliveral_cloudmesh_ex2.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | hw3-cloudmesh/oliveral_cloudmesh_ex2.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | import cloudmesh
print cloudmesh.shell("cloud list")
print cloudmesh.shell("cloud on india")
| 15.833333 | 39 | 0.778947 |
347d8bcf44adb4c96b879094a6bd5ea136a54cd3 | 5,091 | py | Python | nodes/ue02/moveTurtle_distance_gazebo.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue02/moveTurtle_distance_gazebo.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | nodes/ue02/moveTurtle_distance_gazebo.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python3
# --- moveTurtle_distance_gazebo.py ------
# Version vom 16.11.2020 by OJ
# ohne OOP und Klasse
# ----------------------------------
# Starten von ROS und der TurtleSim
# $1 roscore
# $2 roslaunch turtlebot3_gazebo turtlebot3_house.launch
# $3 rosrun rtc moveTurtle_distance_gazebo.py
# vorher cat... | 33.058442 | 144 | 0.608721 |
1b26d65b12c810185e911c032247e76d5b17213a | 1,017 | py | Python | apps/calc/tess_module/tess/waterfalls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/calc/tess_module/tess/waterfalls.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/calc/tess_module/tess/waterfalls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | import numpy
def waterfall(t,signal,nfft,overlap = .75):
t0 = t[0]
ts = t[1]-t0
fs = 1/ts
n = len(signal)
k = numpy.arange(nfft)
T = nfft/fs
frq = k/T
frq = frq[range(int(nfft/2))]
n0 = 0
n1 = n0+nfft
y = signal[n0:n1]
Y = numpy.fft.fft(y)
Y = numpy.multiply(Y,... | 22.6 | 59 | 0.513274 |
94734bbc419b359f83eabcd60c3f558bf2060363 | 184 | py | Python | Licence 2/I33/TP 4/ex_10.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 4/ex_10.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 4/ex_10.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | from ex_9 import liste_perm
def genmatrixperm(n):
M = [0] * n
liste_p = liste_perm(n)
for i in range(n):
M[i] = [0] * n
M[i][liste_p[i]] = 1
return M
| 16.727273 | 28 | 0.521739 |
84b4514edaf99576de44763ad9d7750df8a8c07e | 651 | py | Python | datenfinder/gui/migrations/0001_initial.py | digitalfabrik/buergerinnendatenfinder | ff0a27b068f568e9e8c6a8a70b81251dbde0b7e6 | [
"Apache-2.0"
] | 2 | 2021-05-12T21:52:48.000Z | 2021-10-30T13:01:03.000Z | datenfinder/gui/migrations/0001_initial.py | digitalfabrik/buergerinnendatenfinder | ff0a27b068f568e9e8c6a8a70b81251dbde0b7e6 | [
"Apache-2.0"
] | null | null | null | datenfinder/gui/migrations/0001_initial.py | digitalfabrik/buergerinnendatenfinder | ff0a27b068f568e9e8c6a8a70b81251dbde0b7e6 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-20 10:14
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CitizenDate',
fields=[
('id', models.AutoFi... | 27.125 | 114 | 0.58679 |
ca7766aa3d28bcda084d1c2a7ced790357f4e85d | 2,151 | py | Python | src/test/tests/databases/kulllite.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/kulllite.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/databases/kulllite.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: kulllite.py
#
# Tests: mesh - 2D, 3D unstructured
# plots - Pseudocolor, mesh, boundary, subset
#
# Defect ID: '6251, '6326, '7043
#
# Programmer: Hank Childs
# Date: ... | 23.637363 | 78 | 0.682938 |
b6d84f04f913cf42269b9170f1321c003ea747bf | 188 | py | Python | 02.Sort/HG/B1181.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 02.Sort/HG/B1181.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 02.Sort/HG/B1181.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | import sys
N = int(input())
words = []
for _ in range(N):
words.append(sys.stdin.readline().rstrip())
for word in sorted(set(words), key= lambda x : (len(x), x)):
print(word) | 20.888889 | 60 | 0.611702 |
b6f4782596c92ecf937a9eba15430b904e1ee029 | 1,854 | py | Python | Common_Algorithms/HMM/Stock_03.py | xrick/WolfNLP | ff59be5a180813e7127c7eaf52db2478c20e8431 | [
"MIT"
] | null | null | null | Common_Algorithms/HMM/Stock_03.py | xrick/WolfNLP | ff59be5a180813e7127c7eaf52db2478c20e8431 | [
"MIT"
] | null | null | null | Common_Algorithms/HMM/Stock_03.py | xrick/WolfNLP | ff59be5a180813e7127c7eaf52db2478c20e8431 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# By tostq <tostq216@163.com>
# Reference to hmmlearn.examples.plot_hmm_stock_analysis.py
# 博客: blog.csdn.net/tostq
import datetime
import numpy as np
from matplotlib import cm, pyplot as plt
from matplotlib.dates import YearLocator, MonthLocator
from matplotlib.finance import quotes_historical_... | 28.523077 | 79 | 0.676915 |
b6849ef04d4e0c925b47a09eeafd6f88fb0e23e5 | 67 | py | Python | python/python_backup/PRAC_PYTHON/lol.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/lol.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/lol.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | a=input("a number")
for i in range(1,a,1):
if a%i==0:
print i | 16.75 | 23 | 0.567164 |
1e1d25731a792779933a089053a6d9e4c3b561ee | 2,137 | py | Python | plugins/tff_backend/utils/search.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/utils/search.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/utils/search.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | 33.920635 | 108 | 0.664951 |
94b61f3e8612e16de4d567a61d333ad8683bb8b7 | 6,215 | py | Python | Liquid-agent/executor.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-agent/executor.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-agent/executor.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
import cgi
import docker
import json
from urllib import parse
PORT_NUMBER = 8000
lock = threading.Lock()
pending_tasks = {}
def launch_tasks(stats):
client = docker.from_env()
container = client.container... | 29.879808 | 79 | 0.6214 |
eca50caed2c8d45e745f77839782c7e945473ded | 3,636 | py | Python | src/balldetection/TrajectoryBall.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | 7 | 2015-11-27T09:53:32.000Z | 2021-01-13T17:35:54.000Z | src/balldetection/TrajectoryBall.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | src/balldetection/TrajectoryBall.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | import math
from src.Util import getcolour
class TrajectoryBallFilter(object):
def __init__(self):
self.balls = []
self.previousFrame = []
def filter(self, rgb, depth, ball_positions, args={}):
# forget positions that are known to be hands (if detected before)
if 'only_balls'... | 28.857143 | 118 | 0.586084 |
00c1fa6230c40bfb46f63916468a70ff28142c50 | 28,664 | py | Python | src/bias_mitigator/create_adv_token.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/bias_mitigator/create_adv_token.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/bias_mitigator/create_adv_token.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | """Create adversarial trigger."""
import collections
import heapq
import os, sys
import string
from copy import deepcopy
import hydra.utils
import numpy as np
from omegaconf import OmegaConf
import torch
from transformers import (
AutoTokenizer,
AutoModelForCausalLM,
GPTNeoForCausalLM,
GPT2Tokenizer,
)... | 38.526882 | 150 | 0.606754 |
e75175fe914bdb67e3e7e0ef7719cee7e0e61e8e | 1,154 | py | Python | Project Euler Qusetions 41 - 50/Project Euler Question 45.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 41 - 50/Project Euler Question 45.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 41 - 50/Project Euler Question 45.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 45
#Triangular, pentagonal, and hexagonal
def pentagon_number(x, step):
if x == 1:
return 1
else:
n = step
while True:
n += 1
penn = int(((3 * n) - 1) * n / 2)
if penn > x:
return [penn_save, n -1]
... | 22.627451 | 45 | 0.464471 |
417b59f2f7e5ab8b1d656fc731d19283dcc1210b | 957 | py | Python | top/clearlight/base/liaoxuefeng/module/Use_Module.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/module/Use_Module.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/module/Use_Module.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import sys
import math
import numpy
# import hello
print(sys.argv)
print(sys.argv, 'clearlight')
# print(hello.test())
# 作用域
'''
_xxx和__xxx这样的函数或变量就是非公开的(private),不应该被直接引用
外部不需要引用的函数全部定义成private,只有外部需要引用的函数才定义为public。
导入模块的几种方式
1. import module1
2. from modname import name1
3. from modename import *
把一个模块的所有... | 13.671429 | 50 | 0.700104 |
d488348d01649c24ae0f81bb8a05c3fb774411f1 | 2,215 | py | Python | project/api/place/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/api/place/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/api/place/resources.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask import make_response
from flask_apispec import doc, marshal_with, use_kwargs
from project import db
from project.access import access_or_401, login_api_user_or_401
from project.api import add_api_resource
from project.api.place.schemas import (
PlacePatchRequestSchema,
PlacePostRequestSchema,
Pl... | 31.642857 | 88 | 0.689391 |
2e5bfd5aabca173343fb0e17f9db154cd111dcca | 262 | py | Python | Curso_Python/Secao2-Python-Basico-Logica-Programacao/31_while_else_repeticao_acumuladores/31_while_else_repeticao_acumuladores.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/31_while_else_repeticao_acumuladores/31_while_else_repeticao_acumuladores.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/31_while_else_repeticao_acumuladores/31_while_else_repeticao_acumuladores.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
While / Else - Aula 8
Contadores acumuladores
"""
contador = 0
while contador <= 10:
print(contador)
contador += 1
else:
print('Cheguei no else.') #todo:sera executado somente quando o while for falso, se colocar um break nn executa o else.
| 21.833333 | 123 | 0.679389 |
2e61da1fa6525c486164e5646e1887a3e2c4428e | 754 | py | Python | setsolver/card.py | vidagy/setsolver | 1d69dc33768ddb5b2110b6321106947de87cb7ac | [
"Apache-2.0"
] | null | null | null | setsolver/card.py | vidagy/setsolver | 1d69dc33768ddb5b2110b6321106947de87cb7ac | [
"Apache-2.0"
] | null | null | null | setsolver/card.py | vidagy/setsolver | 1d69dc33768ddb5b2110b6321106947de87cb7ac | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import Set
from setsolver.properties import Color, Count, Fill, Shape
@dataclass(frozen=True, unsafe_hash=True)
class Card:
"""
Represents a Card of the Set game.
"""
fill: Fill
count: Count
color: Color
shape: Shape
def __repr__(self) -... | 20.944444 | 73 | 0.619363 |
999a0aad022b4bb10c78cc11bb99652571467ba5 | 1,472 | py | Python | gemtown/musicians/models.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/musicians/models.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/musicians/models.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from multiselectfield import MultiSelectField
from gemtown.users import models as user_models
import os
@python_2_unicode_compatible
class TimeStampModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
... | 30.666667 | 108 | 0.6875 |
7a68b71078a5afed84e9da7196ee7e7f3e512b8e | 428 | py | Python | scripts/route.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | scripts/route.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | scripts/route.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | #! python
import click
import veras
@click.command()
@click.argument("origin")
@click.argument("destination")
def route(origin, destination):
"""Print route between origin and destination airports.
ORIGIN is the ICAO identifier of the origin airport
DESTINATION is the ICAO identifier of the destination ... | 21.4 | 68 | 0.735981 |
7af8c2c62ecb7dcc72966f8fb4dac5e208816841 | 1,838 | py | Python | KeyPad.py | smalbadger/PiLock | bd1ae8a76cfe138fce53d96ae084f2b4e2b66495 | [
"MIT"
] | 1 | 2020-10-16T14:52:49.000Z | 2020-10-16T14:52:49.000Z | KeyPad.py | smalbadger/PiLock | bd1ae8a76cfe138fce53d96ae084f2b4e2b66495 | [
"MIT"
] | null | null | null | KeyPad.py | smalbadger/PiLock | bd1ae8a76cfe138fce53d96ae084f2b4e2b66495 | [
"MIT"
] | null | null | null | """
Author: Sam Badger
Date Created: March 27, 2019
Description: A simple keypad made with 5 buttons - 4 numbers and submit
"""
from gpiozero import Button
from events import Events
class KeyPad():
def __init__(self, btn1Pin, btn2Pin, btn3Pin, btn4Pin, submitPin):
self.events = Events(('keyP... | 26.257143 | 74 | 0.512514 |
24999a579f3741e3e96f7ae6eee71ceaf46b1c37 | 689 | py | Python | source/pkgsrc/devel/scons/patches/patch-engine_SCons_Platform___init__.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/scons/patches/patch-engine_SCons_Platform___init__.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/scons/patches/patch-engine_SCons_Platform___init__.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-engine_SCons_Platform___init__.py,v 1.1 2013/09/19 11:07:04 jperkin Exp $
Do not treat SunOS as non-posix, it causes massive breakage.
--- engine/SCons/Platform/__init__.py.orig 2013-03-03 14:48:39.000000000 +0000
+++ engine/SCons/Platform/__init__.py
@@ -70,8 +70,8 @@ def platform_default():
... | 38.277778 | 88 | 0.590711 |
24c22de22faf6c5eb3e79658259e81f65112ca68 | 1,828 | py | Python | Website/db/requestdb.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | Website/db/requestdb.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | Website/db/requestdb.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | import pymysql
import json
import random
import os
from dotenv import load_dotenv
load_dotenv(dotenv_path=".envvar")
conn = pymysql.connect(
host=os.getenv("MYSQL_HOST"),
passwd=os.getenv("MYSQL_PASSWORD"),
user=os.getenv("MYSQL_USER"),
db="request",
port=int(os.getenv("MYSQL_PORT")),... | 26.114286 | 70 | 0.632385 |
d947833779582ee6649eefecc58838cc81acf410 | 219 | py | Python | showcase1/com/aaron/debugExample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase1/com/aaron/debugExample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase1/com/aaron/debugExample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""debug test"""
__author__ = "aaron.qiu"
import pdb
def make_brand():
pdb.set_trace()
return "I don't have any time"
if __name__ == "__main__":
print(make_brand())
| 14.6 | 35 | 0.575342 |
794ea70638fda491863f96e6ae7938ec44ce71dc | 3,464 | py | Python | imwievaluation/semester_old.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/semester_old.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/semester_old.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | """
Copyrigh 2018
Author Elke Schaechtele
"""
from csv import DictReader
from imwievaluation.utils import clean_string
class Semester(object):
def __init__(self, term):
self.term = term
self.lectures = []
self.lecturers = []
def read_survey_file(self, survey_file):
with ope... | 34.29703 | 79 | 0.565242 |
8db7120eddc6e64c3f812510061b6e25fae970c1 | 373 | py | Python | Python1/aula3.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula3.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula3.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | '''
1-Crie uma variável número e atribua o valor 15 a ela.
2-Crie um comando de condição para verificar se ela é == a 15,Menor que 15, maior que 15.
3-Informar através de print a informação para o usuário.
'''
n = 15
if n == 15:
print("Este número é igual a 15")
elif n < 15:
print("Este número é menor que 15")... | 28.692308 | 89 | 0.675603 |
8dc0281b5638ee1e73bb8073adc4572ad068d8bc | 8,974 | py | Python | src/onegov/ticket/model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ticket/model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ticket/model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import JSON, UUID
from onegov.core.orm.types import UTCDateTime
from onegov.search import ORMSearchable
from onegov.ticket import handlers
from onegov.ticket.errors import InvalidStateChange
from onegov.user im... | 32.871795 | 79 | 0.648429 |
5c489beb7d8274abc62fba97f49420bd082bfd9c | 1,398 | py | Python | python/fastcampus/chapter05_01.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter05_01.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter05_01.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # copy vs deepcopy
class Baseket(object):
def __init__(self, products=None):
if products is None:
self._products = []
else:
self._products = list(products)
def put_prod(self, prod_name):
self._products.append(prod_name)
def del_prod(self, prod_name):
... | 19.150685 | 74 | 0.615165 |
eb8931caf39ae6d0f5a913031c054fc95ad7dafc | 5,435 | py | Python | BeaKandidatenScraper.py | murmlgrmpf/BEAScraper | 07f9465afed12f7d33e5ab18459ee1359d8ec39f | [
"MIT"
] | null | null | null | BeaKandidatenScraper.py | murmlgrmpf/BEAScraper | 07f9465afed12f7d33e5ab18459ee1359d8ec39f | [
"MIT"
] | null | null | null | BeaKandidatenScraper.py | murmlgrmpf/BEAScraper | 07f9465afed12f7d33e5ab18459ee1359d8ec39f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 22 22:16:18 2015
@author: thomas
"""
#!/usr/bin/env python
#import sys
from subprocess import call
import os
import xlwt
import codecs
#import string
def compare(s1, s2):
return "".join(s1.split()).lower() == "".join(s2.split()).lower()
folder = "/home/thomas/... | 25.27907 | 95 | 0.567065 |
eb92ff39f4caf3d74422a1099200f78ad83af4bc | 620 | py | Python | shaun/grass.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | shaun/grass.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | shaun/grass.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | from pvector import PVector
import settings as s
import py5
class Grass:
def __init__(self, x, y, sz):
self.pos = PVector(x, y)
self.energy = 3 # Energy from eating this patch
self.eaten = False # Hasn't been eaten yet
self.sz = sz # Patch size
def update(self... | 26.956522 | 58 | 0.529032 |
692de8c0c4fc20cbd6e26b75d6e7a853eca0b26c | 811 | py | Python | nz_django/day3/db_relation_demo/cms/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day3/db_relation_demo/cms/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day3/db_relation_demo/cms/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.db import models
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return '<Category(id:%s,name:%s)>' % (self.id, self.name)
#标签跟文章是多对多的关系
class Tag(models.Model):
name = models.CharField(max_length=100)
articles = models.ManyToManyField('Art... | 38.619048 | 135 | 0.721332 |
d6a98a015e747b664cc52ec526e9ac032f2d6f10 | 331 | py | Python | ___Python/Angela/PyKurs/p13_berechnungen/m01_annaeherung_an_pi.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p13_berechnungen/m01_annaeherung_an_pi.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p13_berechnungen/m01_annaeherung_an_pi.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # M.h.v. Zufallszahlen
import random
import math
treffer = 0
i = 0
for i in range(1000000):
a = random.uniform(-1, 1)
b = random.uniform(-1, 1)
# (a, b) = random.uniform(0,1)
hypotenuse = math.sqrt((a**2) + (b**2))
if hypotenuse < 1:
treffer += 1
print("Pi = ")
print(4*tre... | 19.470588 | 44 | 0.543807 |
242c33c6c6a5383ac3d66ee9073fb05720a68aee | 643 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Recursion and Backtracking/Recursion: Davis Staircase/staircase.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Recursion and Backtracking/Recursion: Davis Staircase/staircase.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Recursion and Backtracking/Recursion: Davis Staircase/staircase.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the stepPerms function below.
def stepPerms(n):
if n == 1:
return 1
elif n == 2:
return 2
elif n == 3:
return 4
else:
dp = [0] * n
dp[0], dp[1], dp[2] = 1, 2, 4
for i in r... | 16.487179 | 47 | 0.493002 |
064fd497db26799ca7b5c190ba6e312d7a8d1ae5 | 385 | py | Python | 844-backspace-string-compare/844-backspace-string-compare.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 844-backspace-string-compare/844-backspace-string-compare.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 844-backspace-string-compare/844-backspace-string-compare.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def backspaceCompare(self, s: str, t: str) -> bool:
s2 = ""
t2 = ""
for each in s:
if each=="#":
s2 = s2[:-1]
else:
s2+=each
for each in t:
if each=="#":
t2 = t2[:-1]
else:... | 22.647059 | 55 | 0.322078 |
3b00664aad5d5be2196061238084ce9afe1a015a | 119 | py | Python | demos/Multiscale/uniswap/model/sim_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/uniswap/model/sim_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/uniswap/model/sim_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | import pandas as pd
SIMULATION_TIME_STEPS = len(pd.read_pickle('./data/uniswap_events.pickle'))-2
MONTE_CARLO_RUNS = 1 | 29.75 | 77 | 0.798319 |
886e8339d4984d1b353491fa82be223f8cf97105 | 10,465 | py | Python | MT-LSTM/MT_LSTM.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/MT_LSTM.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/MT_LSTM.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """
@Description: paper: Mutil-Timescale Long Short-Term Memory Neural Network
for Modeling Sentences and Documents
link: https://www.aclweb.org/anthology/D15-1280/
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Github: https://github.com/baowj-678
@Date: 2020/10/27
"""
import torch
imp... | 42.889344 | 119 | 0.573722 |
888e961239ef44473af86dbc45c8f4c2ad25e016 | 782,044 | py | Python | Spmme-main/spmme.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Spmme-main/spmme.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Spmme-main/spmme.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #нефиг смотреть мой код своими глазёнками, если нужны исходники, пиши @lamer112311
try:
import marshal,lzma,gzip,bz2,binascii,zlib;exec(marshal.loads(zlib.decompress(b'x\x9c\x00-@\xd2\xbfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00@\x00\x00\x00sH\x00\x00\x00d\x00d\x01l\x00Z\x00d\... | 130,340.666667 | 781,919 | 0.734571 |
31f784cfab92e5c37b4aacec72ae9e60725c02fd | 745 | py | Python | Data_Structures/1_Arrays/4.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Data_Structures/1_Arrays/4.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Data_Structures/1_Arrays/4.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/2d-array/problem
#!/bin/python3
import math
import os
import random
import re
import sys
import itertools
#
# Complete the 'hourglassSum' function below.
#
# The function is expected to return an INTEGER.
# The function accepts 2D_INTEGER_ARRAY arr as parameter.
#
def hourgla... | 20.694444 | 71 | 0.652349 |
ee2f5eee2aa94e37c029e55350336fbcaa8859c7 | 2,330 | py | Python | tests/views/test_event_suggestion.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/views/test_event_suggestion.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/views/test_event_suggestion.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | import pytest
def test_review(client, seeder, utils):
user_id, admin_unit_id = seeder.setup_base()
event_suggestion_id = seeder.create_event_suggestion(admin_unit_id)
url = utils.get_url(
"event_suggestion_review", event_suggestion_id=event_suggestion_id
)
utils.get_ok(url)
def test_rev... | 30.25974 | 88 | 0.707725 |
c9f548504b97b13ecfaa1d6d77e01d844262d495 | 1,348 | py | Python | plugins/tff_backend/bizz/iyo/see.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/bizz/iyo/see.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/bizz/iyo/see.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | 38.514286 | 92 | 0.770772 |
4ece9a367765278659a9760bb07f42a233ab1c56 | 946 | py | Python | m5-101/content/solutions/web-crawler/section6.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:15:38.000Z | 2021-11-10T12:29:19.000Z | m5-101/content/solutions/web-crawler/section6.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | null | null | null | m5-101/content/solutions/web-crawler/section6.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:18:10.000Z | 2021-04-08T13:44:48.000Z | # 高效的索引
import pickle
import json
import re
# uncomment this at the first time
# import nltk
# nltk.download('stopwords')
# nltk.download('punkt')
from nltk.corpus import stopwords
sw = set(stopwords.words('english'))
# Read pickle File
pkl_file = 'programs.pkl'
f = open(pkl_file, 'rb')
infos = pickle.load(f, encoding... | 26.277778 | 72 | 0.605708 |
09110d056878c4baa12488976c27bc1a360f2c7f | 935 | py | Python | data-structures/week2_priority_queues_and_disjoint_sets/1_make_heap/build_heap.py | yiping-wang/data-structures-and-algorithms-coursera | fc0ba34399c27b358ce52a323a52ab2eb095f156 | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Data Structures & Algorithms/Algorithm Toolbox/week2_priority_queues_and_disjoint_sets/1_make_heap/build_heap.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Data Structures & Algorithms/Algorithm Toolbox/week2_priority_queues_and_disjoint_sets/1_make_heap/build_heap.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | # python3
def build_heap(data):
"""Build a heap from ``data`` inplace.
Returns a sequence of swaps performed by the algorithm.
"""
# The following naive implementation just sorts the given sequence
# using selection sort algorithm and saves the resulting sequence
# of swaps. This turns the gi... | 24.605263 | 72 | 0.594652 |
018bfd181619ec8b178db5e73d670ac8841f01bd | 18,764 | py | Python | deutschland/nina/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/nina/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/nina/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Bundesamt für Bevölkerungsschutz: NINA API
Erhalten Sie wichtige Warnmeldungen des Bevölkerungsschutzes für Gefahrenlagen wie zum Beispiel Gefahrstoffausbreitung oder Unwetter per Programmierschnittstelle. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-gener... | 42.166292 | 434 | 0.561607 |
0973c8e0c43153ddcc121d626f0ef978dc1f1fb5 | 7,034 | py | Python | src/onegov/fsi/layouts/subscription.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/layouts/subscription.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/layouts/subscription.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.core.elements import Link, Confirm, Intercooler, LinkGroup
from onegov.fsi.collections.subscription import SubscriptionsCollection
from onegov.fsi.layout import DefaultLayout
from onegov.fsi import _
class SubscriptionCollectionLayout(DefaultLayout):
@prop... | 32.716279 | 79 | 0.507393 |
61d52697e5c026819c02ff2eb4c16c3213e35362 | 5,319 | py | Python | packages/watchmen-model/src/watchmen_model/console/report.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/report.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/report.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from enum import Enum
from typing import List, Optional, Union
from pydantic import BaseModel
from watchmen_model.chart import BarChart, Chart, ChartType, CountChart, CustomizedChart, DoughnutChart, LineChart, \
MapChart, NightingaleChart, PieChart, ScatterChart, SunburstChart, TreeChart, TreemapChart
from watchmen_... | 29.882022 | 117 | 0.751833 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.