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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e3c65515ee77e5bafd003da0a3d97f1d89684a39 | 773 | pyde | Python | sketches/rainbow_noise/rainbow_noise.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/rainbow_noise/rainbow_noise.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/rainbow_noise/rainbow_noise.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | colors = [color(146, 82, 161), color(240, 99, 164), color(49, 197, 244),
color(248, 239, 34), color(248, 158, 80), color(240, 80, 37),
color(129, 122, 198)]
a = 10 # alpha
def setup():
global t, i, pg
size(640, 480)
this.surface.setTitle("Perlin Noise Worm")
pg = createGraphics(w... | 24.15625 | 72 | 0.49806 |
5435da667325f04d54ffd7c05e19538e29b86c31 | 8,957 | py | Python | snake/snakeV3V2.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | snake/snakeV3V2.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | snake/snakeV3V2.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | from tkinter import Tk, Canvas
import random
POCET = 40
VEL = 800/POCET
FPS = 300
DROBKY = 10
CISLA = False
randomColor = lambda: "#%06x" % random.randint(0, 0xFFFFFF)
class Bunka:
def __init__(self, x,y):
self.vzhled = platno.create_rectangle(x*VEL, y*VEL+50, (x+1)*VEL, (y+1)*VEL+50, fill="white",outlin... | 35.26378 | 157 | 0.422686 |
5458886726793f03b78829a16292fb77ccf7e1e6 | 1,522 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_14_Arbeiten_mit_CSV_und_JSON_Daten/04_json_wikiartikel_abrufen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_14_Arbeiten_mit_CSV_und_JSON_Daten/04_json_wikiartikel_abrufen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_14_Arbeiten_mit_CSV_und_JSON_Daten/04_json_wikiartikel_abrufen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 04_json_wikieintrag_abrufen.py
# In dieser Übung geht es darum über die API von Wikipedia einen Artikel
# abzurufen und anschliessend auszugeben. Ziel ist es auch dass man das sowohl über ein
# kommandozeilenelement als auch über das Script selber machen kann.
import json, sys, requests, re
max_text_length=70
max_... | 42.277778 | 136 | 0.718791 |
49b361e475678181cb4422575878232135b883d3 | 6,582 | py | Python | CC8550-SimulacaoETesteDeSoftware/Lab05/Lab05.py | phdomingues/FEI-CS | e1dc19c190d61f5f13492ba5179f5d41295f1b50 | [
"MIT"
] | null | null | null | CC8550-SimulacaoETesteDeSoftware/Lab05/Lab05.py | phdomingues/FEI-CS | e1dc19c190d61f5f13492ba5179f5d41295f1b50 | [
"MIT"
] | null | null | null | CC8550-SimulacaoETesteDeSoftware/Lab05/Lab05.py | phdomingues/FEI-CS | e1dc19c190d61f5f13492ba5179f5d41295f1b50 | [
"MIT"
] | null | null | null | import random
from math import log, factorial # log = base e
# Seed para padronizar os resultados
random.seed(0)
# ================== #
# === DEFINICOES === #
# ================== #
class computador:
def __init__(self, a, ts, c, nome="Computador"):
self.nome = nome
self.a = a/3600
self.ts ... | 40.134146 | 117 | 0.539806 |
b7cc667ab72d9c64b9fd6d30fa1e65b1e0e9c636 | 990 | py | Python | pyBarcode-0.6/barcode/upc.py | fau-fablab/etiketten | 5f4fcdd14001807e183164ae66df48d86c8f7a3e | [
"Unlicense"
] | 1 | 2018-12-15T04:07:38.000Z | 2018-12-15T04:07:38.000Z | pyBarcode-0.6/barcode/upc.py | fau-fablab/etiketten | 5f4fcdd14001807e183164ae66df48d86c8f7a3e | [
"Unlicense"
] | 14 | 2015-01-02T10:37:33.000Z | 2021-10-03T13:42:15.000Z | pyBarcode-0.6/barcode/upc.py | fau-fablab/etiketten | 5f4fcdd14001807e183164ae66df48d86c8f7a3e | [
"Unlicense"
] | 1 | 2018-12-15T04:07:40.000Z | 2018-12-15T04:07:40.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""barcode.upc
"""
__docformat__ = 'restructuredtext en'
from barcode.ean import EuropeanArticleNumber13
class UniversalProductCodeA(EuropeanArticleNumber13):
"""Initializes new UPC-A barcode. Can be rendered as EAN-13 by passing
`True` to th... | 23.571429 | 74 | 0.645455 |
127b330714af22ea33c29d3ab207ed38aa688868 | 1,923 | py | Python | http/piface_lauflicht_vorlage.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | http/piface_lauflicht_vorlage.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | http/piface_lauflicht_vorlage.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Notwendige Bibliothek installieren:
# sudo apt install python3-flask
# oder
# pip3 install flask
import time
import threading
from flask import Flask
from flask import request
# TODO: Bibliothek zur Ansteuerung des PiFace importieren und PiFace initialisieren
# initialisiere Flas... | 31.52459 | 109 | 0.687467 |
12f06bfb20d5bd1609f3e1eff4e6ef847eb6f486 | 436 | py | Python | leetcode/187-Repeated-DNA-Sequences/RepeatedDNASeq_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/187-Repeated-DNA-Sequences/RepeatedDNASeq_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/187-Repeated-DNA-Sequences/RepeatedDNASeq_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {string} s
# @return {string[]}
def findRepeatedDnaSequences(self, s):
if len(s) < 11:
return []
a = {}
for t in range(len(s) - 9):
if s[t:t + 10] not in a:
a[s[t:t + 10]] = 1
else:
a[s[t:t +... | 24.222222 | 42 | 0.364679 |
4247dd2102ac756ac637eb8af47de654ab13977e | 1,770 | py | Python | Algorithms/Search/Ice_cream_parlor.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Search/Ice_cream_parlor.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Search/Ice_cream_parlor.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/icecream-parlor/problem?h_r=internal-search
# algorithm => index-base
def pool(cost,money):
# length
n = len(cost)
# loop execution
for i in range(n//2):
# indices
f = i
b = (n-1)-i
m = n//2
# directions
front = ... | 23.289474 | 112 | 0.471186 |
c45532e75b6bd018d49f3d506164c877450ded18 | 1,434 | py | Python | Packs/Forescout/Integrations/Forescout/Forescout_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Forescout/Integrations/Forescout/Forescout_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Forescout/Integrations/Forescout/Forescout_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from Forescout import dict_to_formatted_string
# disable-secrets-detection-start
example_dict = {
'again': 'FsoDxgFGKJYhqNQPmWRY',
'church': {
'buy': 'omarjoseph@gmail.com',
'cut': 14,
'full': 6526,
'go': 'pArcBeCGHYaqtfhFqVzU',
'grow': 'gtaylor@hotmail.com',
'mo... | 28.68 | 68 | 0.608089 |
db1193fc4a35065c556f3d8ab97040b41e97323a | 9,041 | py | Python | tp2/source/MDP.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp2/source/MDP.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp2/source/MDP.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
Trabalho Pratico 2: Inteligência Artificial
Autor: Hugo Araujo de Sousa (2013007463)
MDP.py: Markov Decision Problem class.
'''
import numpy as np
import operator as op
from Map import Map
class MDP():
WALL = '#'
FREE = '-'
TABLET = '0'
GHOST = '&'
UP = '^'
LEFT... | 30.338926 | 79 | 0.516978 |
18844f6af1376f783b081bdafc3a5db8d6e20e8f | 3,748 | py | Python | TimeSeries/not_finished/other/lstm.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | null | null | null | TimeSeries/not_finished/other/lstm.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-02-11T23:44:52.000Z | 2021-02-11T23:44:52.000Z | TimeSeries/not_finished/other/lstm.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:02:23.000Z | 2021-12-16T01:02:23.000Z | """
LSTM
LSTM - encoder/decoder
https://machinelearningmastery.com/how-to-develop-lstm-models-for-multi-step-time-series-forecasting-of-household-power-consumption/
"""
# %%
import numpy as np
import pandas as pd
from time import process_time, time
from sklearn.preprocessing import StandardScaler
import matplotlib.py... | 24.657895 | 132 | 0.701974 |
18898d6b6ea5edfb2d57e9337347c0afd6ada41d | 2,037 | py | Python | webapp/sample.py | patrickbucher/mongomir-pytkovic | 4f6ea608c9b95b236ce3aee925277451bf4c2e9f | [
"MIT"
] | null | null | null | webapp/sample.py | patrickbucher/mongomir-pytkovic | 4f6ea608c9b95b236ce3aee925277451bf4c2e9f | [
"MIT"
] | null | null | null | webapp/sample.py | patrickbucher/mongomir-pytkovic | 4f6ea608c9b95b236ce3aee925277451bf4c2e9f | [
"MIT"
] | 1 | 2018-12-05T11:08:47.000Z | 2018-12-05T11:08:47.000Z | #!/usr/bin/env python3
import falcon
from pymongo import MongoClient
import logging
import os
import pprint
client = MongoClient()
mongo_db = client.soccer
logger = logging.getLogger('Match')
logger.setLevel(logging.DEBUG)
logdir = os.environ['LOGDIR']
logpath = os.path.join(logdir, 'falcon.log')
fh = logging.FileHan... | 29.1 | 82 | 0.509082 |
834d105d697940f72b54184f1f5209f8d61ea6de | 256 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import frappe
import unittest
test_records = frappe.get_test_records('Monthly Distribution')
class TestMonthlyDistribution(unittest.TestCase):
pass
| 23.272727 | 85 | 0.8125 |
55d56a21feb3f8a25d18dfdd5145a8257c95860d | 902 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/parse-cands.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/parse-cands.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/parse-cands.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
def extended_harmonic_accuracy(bpm_detected, bpm_ground):
tolerance = 0.04
for m in [1, 2, 3]:
#for m in [1, 2, 3]:
diff = abs(m*bpm_detected - bpm_ground)
if diff <= tolerance * bpm_ground:
return True
diff = abs(1.0/m*bpm_detected - bp... | 23.128205 | 61 | 0.596452 |
360b3b92218d0a6f4cff19e591346b48c83be5c5 | 1,800 | py | Python | src/test/tests/simulation/point.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/simulation/point.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/simulation/point.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: point.py
#
# Tests: libsim - connecting to simulation and retrieving data from it.
# mesh - point mesh
#
# Programmer: Kathleen Biagas
# Date: June 25, 2014
#
# Modificati... | 22.78481 | 78 | 0.601667 |
7fe731d416e4c167646ffe7d548822ec36af9a46 | 536 | pyde | Python | sketches/rotatingtriangles/rotatingtriangles3/rotatingtriangles3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/rotatingtriangles/rotatingtriangles3/rotatingtriangles3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/rotatingtriangles/rotatingtriangles3/rotatingtriangles3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # rotating triangle 3
t = 0
def setup():
size(600, 600)
rectMode(CENTER)
background(234, 218, 184)
noLoop()
def draw():
global t
noFill()
stroke(150, 100, 100)
translate(width/2, height/2)
for _ in range(90):
rotate(radians(360/90))
with pushMatrix():
... | 18.482759 | 41 | 0.518657 |
490b270a7b97cfa3a11a23b8e3bff8beb7562b79 | 27,006 | py | Python | Utils/py/WhistleDetector/cpp_spectrum.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2015-01-12T10:46:29.000Z | 2022-03-28T05:13:14.000Z | Utils/py/WhistleDetector/cpp_spectrum.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-01-20T21:07:50.000Z | 2020-01-22T14:00:28.000Z | Utils/py/WhistleDetector/cpp_spectrum.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-02-07T18:18:10.000Z | 2019-10-15T17:01:41.000Z | cpp_spectrum = [-0.982269,
-0.409133,
-0.189426,
0.20145,
0.256364,
0.0605595,
-0.0921119,
0.274297,
0.142932,
-0.251888,
-0.859689,
-0.735024,
... | 26.321637 | 29 | 0.253277 |
62341f575739c9dde1bb0dc88cb31357442c1c01 | 2,808 | py | Python | apps/grolsch/models.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/grolsch/models.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/grolsch/models.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | import django
import os
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_string
from django.urls import reverse_lazy, reverse
from apps.grolsch.scraping import DeKlok
from settings import FULL_URL_PREFIX
class Product(models.Model):
grolsch_article_... | 33.831325 | 108 | 0.67557 |
f301c8795782d1f2976d5999ab45ed27a5bacbcb | 2,539 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/tests/Reaction.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Reaction.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Reaction.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2017 Nicolas Agustín Torres <nicolastrres@gmail.com> #
# Copyright 2018 sfdye <tsfdye@gmail.com> ... | 55.195652 | 117 | 0.459236 |
b8c437de7b2d9dbe9ec7ef525dc71c1f1c4c322f | 1,093 | py | Python | Packs/RubrikPolaris/Scripts/RubrikSonarOpenAccessFiles/RubrikSonarOpenAccessFiles.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/RubrikPolaris/Scripts/RubrikSonarOpenAccessFiles/RubrikSonarOpenAccessFiles.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/RubrikPolaris/Scripts/RubrikSonarOpenAccessFiles/RubrikSonarOpenAccessFiles.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import *
def main() -> None:
ORANGE_HTML_STYLE = "color:#FF9000;font-size:250%;>"
GREEN_HTML_STYLE = "color:#00CD33;font-size:275%;>"
RED_HTML_STYLE = "color:#FF1744;font-size:275%;>"
DIV_HTML_STYLE = "display:block;text-align:center... | 33.121212 | 119 | 0.660567 |
a74ed54a34e06c4f9397cd355690dc55b9db6034 | 682 | py | Python | manage.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | manage.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | manage.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from flask_script import Manager
from apps import create_app
from flask_migrate import MigrateCommand
from apps.models.users import User
from apps.models.posts import Posts
from apps.extensions import db
#python manage.py db init
#实例化对象并跟app完成绑定
app = create_app('default') #指定此刻我们是什么环境
#详情查看 config 文件
manager = Manage... | 21.3125 | 49 | 0.71261 |
a7b7fcfaa9f3e7b92162b589781f7d5f02db73f1 | 98 | py | Python | src/backend/__init__.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | 2 | 2021-04-07T03:12:33.000Z | 2021-05-25T10:01:40.000Z | src/backend/__init__.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | null | null | null | src/backend/__init__.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | 3 | 2021-04-07T03:12:44.000Z | 2021-04-13T11:21:03.000Z | from .utils.time_utils import TimeOfWeek, TimeSlot
from .course import Course, Session, Instructor | 49 | 50 | 0.836735 |
5a6f55ddca8d9f1e1381add5010c0d999b53df23 | 4,487 | py | Python | models/encoder_decoder.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | null | null | null | models/encoder_decoder.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | 5 | 2021-03-19T14:21:08.000Z | 2022-03-12T00:42:00.000Z | models/encoder_decoder.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn import init
import functools
class EncoderDecoderGenerator(nn.Module):
"""Create a EncoderDecoder-based generator"""
def __init__(self, input_nc, output_nc, num_downs, ngf=64, norm_layer=nn.BatchNorm2d, use_dropout=False):
"""Construct a Unet generator
... | 41.546296 | 113 | 0.479608 |
0c691c3bd6343b4023754171648d033bde4f19c2 | 3,759 | py | Python | migrator.py | jk-shah/pg2pg | c4038015aba3efcc8da71b00e210d296b6e327a8 | [
"Apache-2.0"
] | null | null | null | migrator.py | jk-shah/pg2pg | c4038015aba3efcc8da71b00e210d296b6e327a8 | [
"Apache-2.0"
] | null | null | null | migrator.py | jk-shah/pg2pg | c4038015aba3efcc8da71b00e210d296b6e327a8 | [
"Apache-2.0"
] | null | null | null | import psycopg2
from faker import Faker
import os
import traceback
import psycopg2.extras
import random
import string
import time
from threading import Condition
from subprocess import Popen, PIPE
def connect_db(dbname, user, host, passwd, port):
conn = psycopg2.connect(
"dbname='{0}' use... | 40.419355 | 97 | 0.513966 |
0b7942c24f34daa14a9306cd4db8b1fdb3729a17 | 188 | py | Python | Crawler/links/forms.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/forms.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/forms.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | from django import forms
from logging import PlaceHolder
from django.forms.widgets import URLInput
class UrlForm(forms.Form):
Url = forms.URLField(label="URL", widget=URLInput)
| 20.888889 | 54 | 0.765957 |
0b95b84023ac74c30ad22af7827bed0b9c5168c3 | 2,245 | py | Python | x2paddle/optimizer/optimizer.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/optimizer/optimizer.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/optimizer/optimizer.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.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 appl... | 39.385965 | 75 | 0.602673 |
333eb48a856e4fd923391257ccd2663c6ff2e1ea | 3,359 | py | Python | flipui/gui/settingsdialog_ui.py | julianschick/flipdot-brose-code | b2caf2c52c55a0d5b80dbf3d5adbbf5aec1d79c2 | [
"MIT"
] | null | null | null | flipui/gui/settingsdialog_ui.py | julianschick/flipdot-brose-code | b2caf2c52c55a0d5b80dbf3d5adbbf5aec1d79c2 | [
"MIT"
] | null | null | null | flipui/gui/settingsdialog_ui.py | julianschick/flipdot-brose-code | b2caf2c52c55a0d5b80dbf3d5adbbf5aec1d79c2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'settingsdialog.ui'
##
## Created by: Qt User Interface Compiler version 5.14.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###########... | 40.46988 | 103 | 0.69217 |
689c06ad2c6c4cfac0cdd3982989371dcd9d074e | 5,411 | py | Python | packages/watchmen-rest-doll/src/watchmen_rest_doll/console/report_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/console/report_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/console/report_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Callable, List, Optional
from fastapi import APIRouter, Body, Depends
from starlette.responses import Response
from watchmen_auth import PrincipalService
from watchmen_meta.common import ask_meta_storage, ask_snowflake_generator
from watchmen_meta.console import ReportService, SubjectService
from w... | 35.834437 | 114 | 0.8017 |
0425f7cc974acc2534fcc244856f058d41b0b6d7 | 199 | py | Python | skimind/kernel/learningModels/__init__.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/learningModels/__init__.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/learningModels/__init__.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | #-*-coding: utf-*-
# interfacedb
from .. import interfacedb
# skimind.config
from .. import config as skiconfig
# collections
from .. import interfacedb
# gFunctions
from .. import gFunctions
| 11.705882 | 34 | 0.718593 |
0439d18b9b8cf699a26838048122a8436af4e65f | 1,817 | py | Python | src/sft/qsft/client.py | huykingsofm/FileTransmitter | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | 1 | 2020-08-28T19:06:13.000Z | 2020-08-28T19:06:13.000Z | src/sft/qsft/client.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | src/sft/qsft/client.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | import os
from hks_pylib.logger import Display
from hks_pylib.logger.standard import StdUsers
from hks_pylib.cryptography.ciphers.hkscipher import HKSCipher
from hks_pylib.cryptography.ciphers.symmetrics import NoCipher
from hks_pylib.logger.logger_generator import InvisibleLoggerGenerator, LoggerGenerator
from sft.c... | 31.327586 | 90 | 0.665382 |
9be82792fe93a943f63c1676a2732934c079ae2c | 232 | py | Python | python/coding_dojang/decorator_param_return.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/decorator_param_return.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/decorator_param_return.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def trace(func):
def wrapper(a, b):
r = func(a, b)
print('{0}(a={1}, b={2}) -> {3}'.format(func.__name__, a, b, r))
return r
return wrapper
@trace
def add(a, b):
return a + b
print(add(10, 20))
| 17.846154 | 72 | 0.5 |
c58a81e8919f621a2690c24d4c6c440e3bd8c2ce | 1,086 | py | Python | code/generalizing_diamond_square/threedim.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | 2 | 2022-02-09T14:02:59.000Z | 2022-03-23T11:50:47.000Z | code/generalizing_diamond_square/threedim.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | null | null | null | code/generalizing_diamond_square/threedim.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | null | null | null | from matplotlib import cm
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from mpl_toolkits.mplot3d import Axes3D
from pandas import DataFrame
from pylab import *
import matplotlib.pyplot as plt
import numpy as np
exec(open("ndim_diamond_square.py").... | 19.392857 | 63 | 0.714549 |
c5b7958ca45918a8a110b05b3894b0104a343ee2 | 1,217 | py | Python | packages/watchmen-model/src/watchmen_model/admin/pipeline_action_system.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_action_system.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_action_system.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from enum import Enum
from watchmen_model.common import construct_parameter, construct_parameter_joint, ExternalWriterId, Parameter
from .conditional import Conditional
from .pipeline_action import MemoryWriter, PipelineAction, SystemActionType
class AlarmActionSeverity(str, Enum):
LOW = 'low',
MEDIUM = 'medium',
... | 27.044444 | 109 | 0.777321 |
a8a9d8f143370f986d251e29fdcc72020dc7bcc4 | 4,522 | py | Python | Packs/MongoDB/Integrations/MongoDBLog/MongoDBLog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MongoDB/Integrations/MongoDBLog/MongoDBLog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MongoDB/Integrations/MongoDBLog/MongoDBLog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
""" IMPORTS """
from datetime import datetime
from pymongo import MongoClient
""" GLOBALS/PARAMS """
# Get Credentials
USERNAME = demisto.params().get('credentials').get('identifier')
PASSWORD = demisto.params().get('... | 35.328125 | 119 | 0.649491 |
4f15b82c7ef72adea3e6086a4bb8ae617e9a9920 | 638 | py | Python | vkapp/vk/urls.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | 1 | 2017-11-23T13:33:13.000Z | 2017-11-23T13:33:13.000Z | vkapp/vk/urls.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | vkapp/vk/urls.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
# api_url=https://api.vk.com/api.php
# &api_settings=0
# &viewer_id=123456
# &group_id=654321
# &is_app_user=0
urlpatterns = [
url(
regex=r'^auth/',
view=views.init,
name='auth'
),
url(
regex=r'^blogers/',
view=... | 16.789474 | 36 | 0.509404 |
4f1f64e958895786297b4a5a895beafc1c1e502d | 188 | py | Python | python/subprocess/subprocess_poll.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/subprocess/subprocess_poll.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/subprocess/subprocess_poll.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import subprocess
proc = subprocess.Popen(['sleep', '0.3'])
while proc.poll() is None:
print('Working...')
# some time-consuming work
# ...
print('Exit status', proc.poll())
| 18.8 | 41 | 0.62234 |
4f3bddecaed43e3616d6df6f1706ac7c1020f008 | 545 | py | Python | 002-Finding-Nemo/main.py | hello-arun/Python-Tutorial | aec3978f414e48d762a5fbc5cce581163c1f5f1e | [
"MIT"
] | null | null | null | 002-Finding-Nemo/main.py | hello-arun/Python-Tutorial | aec3978f414e48d762a5fbc5cce581163c1f5f1e | [
"MIT"
] | null | null | null | 002-Finding-Nemo/main.py | hello-arun/Python-Tutorial | aec3978f414e48d762a5fbc5cce581163c1f5f1e | [
"MIT"
] | null | null | null | from turtle import clear
def get_total_paths(n: int, m: int, path):
if n == 1:
answer = 1
path += "R"*(m-1)
paths.append(path)
elif m == 1:
answer = 1
path += "D"*(n-1)
paths.append(path)
else:
answer = get_total_paths(n, m-1, path+"R") +\
... | 20.185185 | 53 | 0.544954 |
4f6c31451a19710e3954f84775035d714d475191 | 330 | py | Python | listings/chapter17/iris-import-json2.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 6 | 2021-08-04T19:42:53.000Z | 2022-01-17T14:24:45.000Z | listings/chapter17/iris-import-json2.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2021-08-30T06:32:08.000Z | 2021-08-30T06:42:46.000Z | listings/chapter17/iris-import-json2.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2022-02-17T10:32:17.000Z | 2022-02-17T10:32:17.000Z | import json
json_file = open('iris.json', 'r')
try:
irises = json.load(
json_file,
object_hook = lambda object: list(object.values())
)
json_file.close()
print(len(irises))
print(irises[0])
print(irises[50])
print(irises[100])
except json.JSONDecodeError:
print("Ungültig... | 20.625 | 58 | 0.630303 |
96ddf8dafe89d221e4086d6a513f2fbbfa591e02 | 2,054 | py | Python | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/prescription_duration/prescription_duration.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 2 | 2021-08-11T06:13:23.000Z | 2021-08-11T06:19:34.000Z | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/prescription_duration/prescription_duration.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/prescription_duration/prescription_duration.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
from frappe.utils import cstr
class PrescriptionDuration(Document):
def autoname(self):
s... | 28.136986 | 68 | 0.663096 |
8c095bbada935bbde00ee33f2971119de1816ef0 | 62 | py | Python | listings/chapter04/args1.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter04/args1.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter04/args1.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | from sys import argv
for arg in argv:
print(f"- {arg}")
| 10.333333 | 21 | 0.612903 |
4fdd04785dde77ac45336566adeae9adf11ce5b9 | 2,522 | py | Python | research/cv/UNet3+/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/UNet3+/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/UNet3+/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.550725 | 99 | 0.640761 |
2ce4efa95830c4b93c235d9a4d9c485ab5b4ee0a | 1,765 | py | Python | Packs/Campaign/Scripts/ShowCampaignRecipients/ShowCampaignRecipients_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Campaign/Scripts/ShowCampaignRecipients/ShowCampaignRecipients_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Campaign/Scripts/ShowCampaignRecipients/ShowCampaignRecipients_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import pytest
import ShowCampaignRecipients
INCIDENT_IDS = [{"id": '1'}, {"id": '2'}, {"id": '3'}]
DEMISTO_RESULT = [
{
'Contents': '[{"emailto": "example1@support.com"}, {"emailto": "example2@support.com"}, '
'{"emailto": "example1@support.com", "emailbc... | 40.113636 | 98 | 0.635127 |
fa1665d06327e4484fb63ed07575446d15164231 | 3,129 | py | Python | DataProcess/auto_rotation/phase_orientation_time_tag_pair_eight.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/auto_rotation/phase_orientation_time_tag_pair_eight.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/auto_rotation/phase_orientation_time_tag_pair_eight.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
from scipy.interpolate import interpolate
from filters import hampel
from cal_rotation_cycle_time_main import cal_rotation_cycle_time
from scipy.signal import find_peaks
from utils.base_list import get_freq_list
"""
转动标签对,相位差随时间(角度)的变... | 29.242991 | 120 | 0.606903 |
d174e2785b256acf92609ad2419dc677ba2e0138 | 3,662 | py | Python | Classes/Player.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Player.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Player.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | import pygame
import time
import glob
import Classes.Board as board
import Classes.Bomb as bom
import Classes.Wall as wal
import Classes.Brick as brick
import Classes.Powerup as powerup
import re
import json
from PyQt5 import QtCore
from PyQt5.QtCore import pyqtSlot
from threading import Thread
class Player(QtCore.QO... | 31.843478 | 109 | 0.56308 |
0f527c3b55503975f94fda7181cbf89653b88293 | 7,971 | py | Python | Packs/ApiModules/Scripts/AWSApiModule/AWSApiModule.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ApiModules/Scripts/AWSApiModule/AWSApiModule.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/ApiModules/Scripts/AWSApiModule/AWSApiModule.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from CommonServerPython import *
from CommonServerUserPython import *
import boto3
from botocore.config import Config
def validate_params(aws_default_region, aws_role_arn, aws_role_session_name, aws_access_key_id, aws_secret_access_key):
"""
Validates that the provided parameters are compatible with the appro... | 45.810345 | 119 | 0.628528 |
7e7b408c2157389a0f9e137c95dc8ab597404a60 | 6,330 | py | Python | src/core/command/distribute_utils.py | openharmony-gitee-mirror/test_developertest | 49c7d7ade2ee54a3a49a306fedb06d1c845042db | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/src/core/command/distribute_utils.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/src/core/command/distribute_utils.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2021-09-13T12:03:37.000Z | 2021-09-13T12:03:37.000Z | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device 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... | 36.171429 | 79 | 0.567615 |
7e91548e7a401f519f47f0e97fd0dacbc4b71501 | 4,212 | py | Python | project/forms/admin_unit.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/forms/admin_unit.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/forms/admin_unit.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask_babelex import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import DecimalField, FormField, StringField, SubmitField
from wtforms.fields.core import BooleanField
from wtforms.fields.html5 import EmailField, TelField, URLField
from wtforms.validators import DataRequired, Length, Optional, Regexp
... | 36.310345 | 105 | 0.669041 |
7d38914af28672a8a0fe9b113258a528047b3c09 | 7,637 | py | Python | addition_module/face_mask_adding/FMA-3D/model/prnet.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | addition_module/face_mask_adding/FMA-3D/model/prnet.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | addition_module/face_mask_adding/FMA-3D/model/prnet.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author: Jun Wang
@date: 20201020
@contact: jun21wangustc@gmail.com
"""
# based on:
# https://github.com/liguohao96/pytorch-prnet
from torch import nn
class Conv2d(nn.Module):
def __init__(self, input_size, in_channel, out_channel, kernel_size=4, stride=1):
super(Conv2d, self).__init__()
outp... | 46.852761 | 134 | 0.619353 |
384d22f3851f42d6329de21677b1aea39fa76d17 | 1,746 | py | Python | Algorithms/Implementation/bigger_is_greater.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/bigger_is_greater.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/bigger_is_greater.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
https://www.nayuki.io/page/next-lexicographical-permutation-algorithm
0. Initial sequence
[0, 1, 2, 5, 3, 3, 0] len=7
1. Find longest non-increasing suffix
[0, 1, 2, 5, 3, 3, 0]
0 < 1
1 < 2
2 < 5 --- longest ---
i = 7 - 1 - 3 = 3
2. Identif... | 21.825 | 72 | 0.462199 |
aa4b3b71b47ba1ef485686c1dc3403e598264e5c | 2,978 | py | Python | tests/test_sft.py | huykingsofm/FileTransmitter | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | 1 | 2020-08-28T19:06:13.000Z | 2020-08-28T19:06:13.000Z | tests/test_sft.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | tests/test_sft.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | from sys import path
import threading
import time
from sft.listener import SFTListener
from sft.client import SFTClientResponser
from sft.protocol.definition import SFTProtocols, SFTRoles
from hks_pylib.logger import Display
from hks_pylib.logger import StandardLoggerGenerator
from hks_pylib.logger.standard import St... | 30.387755 | 96 | 0.678979 |
aaa235af21c5a88116005d893167c7da368c97aa | 1,123 | py | Python | algos/cycle_removel.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | 1 | 2021-07-22T10:28:40.000Z | 2021-07-22T10:28:40.000Z | algos/cycle_removel.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | null | null | null | algos/cycle_removel.py | weberja/praktikum_graphen | da3ecefdf1327078697e3787cfe19414a9ac13c4 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import algos.walker as wk
from digraph import DiGraph
from helper_functions import graph_helper_functions as gh
def run(path, figsize=(20, 20), key=None):
G = gh.load_file(path, key=key)
print("Cycle removal...")
G_cycle_remo... | 32.085714 | 81 | 0.684773 |
2ab4f8ec5f88ed3f1e0c95b4d672b26bf0e5c53e | 1,654 | py | Python | PyStellar/stellar/commit/dao/commit_dao.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 3 | 2021-01-24T17:07:55.000Z | 2021-02-20T20:11:13.000Z | PyStellar/stellar/commit/dao/commit_dao.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 61 | 2021-01-10T12:59:01.000Z | 2021-06-24T09:19:20.000Z | PyStellar/stellar/commit/dao/commit_dao.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 1 | 2021-01-14T05:23:32.000Z | 2021-01-14T05:23:32.000Z | import re
import pymysql
from stellar.settings import MYSQLUSER, MYSQLPASSWORD, MYSQLHOST, MYSQLNAME
class CommitDao:
def insertcommit(self, attachments):
return_json = {}
commit = []
commit_json = {}
sql = "INSERT INTO commit_info(git_name, commit_text, commit_link, commit_dat... | 29.535714 | 114 | 0.463724 |
2df26271e35d78ca3e222fa9c9127fad07ed5dc8 | 9,378 | py | Python | biowardrobe_airflow_advanced/utils/analyze.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | null | null | null | biowardrobe_airflow_advanced/utils/analyze.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | 1 | 2018-09-30T16:57:06.000Z | 2018-09-30T16:57:06.000Z | biowardrobe_airflow_advanced/utils/analyze.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import logging
import decimal
from json import dumps, loads, load
from biowardrobe_airflow_advanced.utils.connect import HookConnect
from biowardrobe_airflow_advanced.utils.utilities import norm_path, get_files, fill_template, export_to_file
logger = logging.getLogger(__name__)
de... | 47.125628 | 169 | 0.570911 |
87829c73d6188fbed792653be552570b70572fc2 | 13,728 | py | Python | bach_code/legacy/data_orig.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 5 | 2015-12-08T21:47:41.000Z | 2020-10-28T12:39:08.000Z | bach_code/legacy/data_orig.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | null | null | null | bach_code/legacy/data_orig.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 1 | 2020-10-28T12:39:09.000Z | 2020-10-28T12:39:09.000Z | from helpers import * # includes music21
import math
import time
import sys
import os
from ordered_set import OrderedSet
from glob import glob
from random import shuffle
import numpy as npy
import h5py
#####
#
# data.py
#
# Goal: create a data representation of the entire Bach chorale set - that is, the 371 chorales
... | 35.020408 | 119 | 0.667614 |
57a51a1240bae948840da2bd66ad8354f44b33f7 | 16,527 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/dellemc/ome_device_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/dellemc/ome_device_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/dellemc/ome_device_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 1.2
# Copyright (C) 2019 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# All rights reserved. Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidia... | 39.538278 | 129 | 0.637926 |
a4cdb6904f3924d62c9d8d7d72d48191793390c5 | 2,463 | py | Python | spo/spo/doctype/vollmacht/vollmacht.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | null | null | null | spo/spo/doctype/vollmacht/vollmacht.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/spo/doctype/vollmacht/vollmacht.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class Vollmacht(Document):
pass
@frappe.whitelist()
def check_todesfall(man... | 25.926316 | 63 | 0.682095 |
eaf91e3bdacc77bbb6f18afbac26508f792ff841 | 3,204 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/04_subprozesse_verwenden/04_subprozesse_verwenden.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/04_subprozesse_verwenden/04_subprozesse_verwenden.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/04_subprozesse_verwenden/04_subprozesse_verwenden.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 04_subprozesse_verwenden.py
# In diesem Beispiel geht es darum andere Prozesse mittels Python aufzurufen.
# Seien dies eigenständige Programme oder Scripts.
# Dazu wird das Modul subprocess benötigt
import os, subprocess, re, sys
os.chdir(os.path.dirname(__file__))
for name in sys.path:
if 'Python' in name[-10:]... | 64.08 | 320 | 0.756242 |
d8114860c1bce2df6ce650b848c430e17662ae9b | 12,129 | py | Python | .vscode/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/jedilsp/pygls/lsp/types/general_messages.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | .vscode/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/jedilsp/pygls/lsp/types/general_messages.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | .vscode/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/jedilsp/pygls/lsp/types/general_messages.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | ############################################################################
# Original work Copyright 2017 Palantir Technologies, Inc. #
# Original work licensed under the MIT License. #
# See ThirdPartyNotices.txt in the project root for license information. #
# All modifi... | 54.635135 | 110 | 0.625196 |
dc75733baa8347398c28ab530f6f88e71a0b5af1 | 305 | py | Python | 20-fs-ias-lec/groups/09-loraSense/SenseLink/LoRaSense - Sensor/lib/deleter.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/09-loraSense/SenseLink/LoRaSense - Sensor/lib/deleter.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/09-loraSense/SenseLink/LoRaSense - Sensor/lib/deleter.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import os
class Deleter():
def __init__(self):
try:
print("PCAPS DELETED")
os.remove("Sensor_Feed.pcap")
os.remove("Control_Feed.pcap")
except:
print("UNABLE TO DELETE PCAPS.")
print(os.listdir())
pass | 25.416667 | 45 | 0.491803 |
800e38145ebcbefd1f783312a723a908467ca6a1 | 33 | py | Python | utilities/__init__.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 1 | 2020-06-04T13:20:45.000Z | 2020-06-04T13:20:45.000Z | utilities/__init__.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 6 | 2020-06-03T18:45:11.000Z | 2022-02-10T01:51:03.000Z | utilities/__init__.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | null | null | null | """
Created by Florian Fricke
""" | 11 | 25 | 0.666667 |
1da1ac0b5b81f3976afdebb534ecaf177c0400a4 | 325 | py | Python | exercises/es/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("es_core_news_md")
doc = nlp(
"Estuvimos en un restaurante genial. Luego, fuimos a un bar muy divertido."
)
# Crea los spans para "restaurante genial" y "bar muy divertido"
span1 = ____
span2 = ____
# Obtén la similitud entre los dos spans
similarity = ____.____(____)
print(similar... | 20.3125 | 79 | 0.735385 |
635b29d081ed6d0462d641995c0808e5dfdc459e | 4,360 | py | Python | modules/image_generation.py | NETMVAS/feecc-agent-geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | 1 | 2021-05-13T09:03:51.000Z | 2021-05-13T09:03:51.000Z | modules/image_generation.py | arseniiarsenii/robonomics_qa_geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | null | null | null | modules/image_generation.py | arseniiarsenii/robonomics_qa_geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | 1 | 2021-05-24T15:45:01.000Z | 2021-05-24T15:45:01.000Z | import qrcode
import time
import os
import typing as tp
from PIL import Image, ImageOps, ImageDraw, ImageFont
from datetime import datetime as dt
def create_qr(link: str, config: tp.Dict[str, tp.Dict[str, tp.Any]]) -> str:
"""
:param link: full yourls url. E.g. url.today/6b
:type link: str
:param conf... | 34.330709 | 120 | 0.650459 |
639f011f7b04074d16d7dcaf4dfe2515ace4c21b | 1,470 | py | Python | export/__init__.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | export/__init__.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | export/__init__.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
Exports data from the database to JSON files for use in a static webapp
"""
import datetime
import logging
import sys
import os
from hashlib import md5
import json
import requests
class DateTimeEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
retu... | 30 | 99 | 0.631293 |
f69e7dfcfec6032d9422ec59bcd8920f49a4a634 | 261 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/46_47_ 48_49_50_51_funcoes_2/ex4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/46_47_ 48_49_50_51_funcoes_2/ex4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/46_47_ 48_49_50_51_funcoes_2/ex4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from random import randint
def buzz(n1):
if n1 % 3 == 0 and n1 % 5 == 0:
return 'FizzBuzz'
if n1 % 3 == 0:
return 'Fizz'
if n1 % 5 == 0:
return 'Buzz'
return n1
for c in range(0, 20):
print(buzz(randint(0, 100)))
| 16.3125 | 35 | 0.509579 |
89e291e659059097da15872cf3036898c8685fbe | 613 | py | Python | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0005_auto_20181005_0847.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0005_auto_20181005_0847.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0005_auto_20181005_0847.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | # Generated by Django 2.0.5 on 2018-10-05 00:47
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rbac', '0004_auto_20181005_0840'),
]
operations = [
migrations.AlterModelOptions(
name='menu',
... | 25.541667 | 121 | 0.611746 |
89f07f287318839ed86c44df4e993e21f7246ff9 | 527 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_2/set_company_country.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v4_2/set_company_country.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_2/set_company_country.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
def execute():
country = frappe.db.get_single_value("Global Defaults", "country")
if not country:
print("Country not ... | 32.9375 | 68 | 0.749526 |
61c10846f0f4d5efdb60c31a8f79ca2599f20762 | 4,964 | py | Python | aoc2020/day_20/part_1_yuk.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_20/part_1_yuk.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_20/part_1_yuk.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | """
123 781 567 345 123
8 4 -> 6 2 -> 4 8 -> 2 6 -> 8 4
765 543 321 187 765
765
123 345 567 781
781 123 345 567
567 781 123 345
345 567 781 123
123 345 567 781
"""
from aoc2020 import *
from aoc2020.utils import math_product
from typing import Optional
f... | 29.2 | 252 | 0.508864 |
140f0560fc5c0faa90bc78c21668b27cc4fda8b6 | 1,313 | py | Python | DesignPatterns/StructuralPattern/Facade/facade_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | DesignPatterns/StructuralPattern/Facade/facade_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | DesignPatterns/StructuralPattern/Facade/facade_p.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | ####################################
# Author: "BALAVIGNESH" #
# Maintainer: "BALAVIGNESH" #
# License: "CC0 1.0 Universal" #
# Date: "25/04/2021" #
####################################
class Sensor:
def __init__(self) -> None:
pass
def sensorOn(self):
p... | 20.84127 | 36 | 0.49505 |
145bfc09798abf3ad981d2cfd411f70337576048 | 1,042 | py | Python | src/combo.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/combo.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/combo.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | """
ID: isaiahl1
LANG: PYTHON2
TASK: combo
"""
TASK = 'combo'
def readints(fin):
return tuple(int(x) for x in fin.readline().split())
def readint(fin):
return int(fin.readline())
def main(fin, fout):
N = readint(fin)
sol1 = readints(fin)
sol2 = readints(fin)
print 'sol', sol1, sol2
count = 0
for a in xrange(... | 17.081967 | 93 | 0.557582 |
21035b82f02fa42a3ec39f696c471cf3e7c6e4f8 | 4,083 | py | Python | test/test_wor_basics.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | test/test_wor_basics.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | test/test_wor_basics.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | import unittest
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
import os
from datetime import date
from dcapy import dca
from dcapy.schedule import Period
class TestArpsBasic(unittest.TestCase):
def setUp(self):
workdir = os.path.dirname(__file__)
self.df1 = pd... | 40.425743 | 149 | 0.525839 |
0d3faa758a1a7394cbd1119d5fbbd04d95b15c79 | 2,331 | py | Python | pandasguide/com/aaron/es_query.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | pandasguide/com/aaron/es_query.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | pandasguide/com/aaron/es_query.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # _*_ encoding:utf-8 _*_
"""
es query test
pip install requests
requests 模块号称 HTTP for Human
"""
__author__="aaron.qiu"
import requests
from pprint import pprint
import json
import pandas as pd
# ES_URL = 'http://192.168.1.105:9200/test_partnum_entity_alias/_search'
ES_URL = 'http://172.19.106.187:9200/partnum_entity... | 24.797872 | 125 | 0.569713 |
b4a651bec0cf800629de549bbe1a82c5df3a9795 | 7,571 | py | Python | kiosk/charts.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | kiosk/charts.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | kiosk/charts.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | from kiosk.queries import readFromDatabase
from django.utils import timezone
from .models import Kontostand
from jchart import Chart
from jchart.config import Axes, DataSet, rgba
class Chart_Un_Bezahlt(Chart):
chart_type = 'doughnut'
responsive = True
def get_datasets(self, **kwargs):
data = readFromDatabase(... | 26.75265 | 137 | 0.692247 |
b4cca68fbfc60574ac8d7eb7a7606cde84f822cd | 63 | py | Python | Build a Water Hack/auto_water.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-05T14:30:34.000Z | 2021-07-05T14:30:34.000Z | Build a Water Hack/auto_water.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-02T15:36:02.000Z | 2021-07-02T15:37:25.000Z | auto_water.py | KVessey/AdvancedWaterControlWebApp | 0fcda95eea422d0415e0e385184891b1d3143c47 | [
"MIT"
] | 1 | 2021-07-02T15:15:17.000Z | 2021-07-02T15:15:17.000Z | import water
if __name__ == "__main__":
water.auto_water() | 15.75 | 26 | 0.698413 |
2ebb36756dc23e8a04679d6f5715e128fe318468 | 1,330 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/random_traversal_direction_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/random_traversal_direction_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/random_traversal_direction_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import numpy as np
from ch06_arrays.intro.intro_directions_example import Direction
def main():
world = np.array([list("ABCDEF"),
list("GHIJKL"),
list("MNOPQR"),
... | 22.931034 | 73 | 0.566917 |
2c1a3cef0aa9b8347bafd83bd93caff5973414a9 | 753 | py | Python | RDS/circle3_central_services/research_manager/src/api/User/user.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/api/User/user.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/api/User/user.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import Singleton
from flask import jsonify, request, abort
import logging
logger = logging.getLogger()
def get(user_id):
result = []
try:
result = Singleton.ProjectService.getProject(user_id)
except:
return jsonify([]), 404
return jsonify(result)
def post(user_id):
result = No... | 17.113636 | 61 | 0.622842 |
e245feabace8958815bf6fcc5c96f7239cc648a8 | 592 | py | Python | Kirk Byers - Python for Network Engineers/Lesson 1/Exercise 4.py | Caradawg/HBS | 467b73c52bbba7b43f37a62e4302a4ff84ff0684 | [
"MIT"
] | null | null | null | Kirk Byers - Python for Network Engineers/Lesson 1/Exercise 4.py | Caradawg/HBS | 467b73c52bbba7b43f37a62e4302a4ff84ff0684 | [
"MIT"
] | null | null | null | Kirk Byers - Python for Network Engineers/Lesson 1/Exercise 4.py | Caradawg/HBS | 467b73c52bbba7b43f37a62e4302a4ff84ff0684 | [
"MIT"
] | null | null | null | from __future__ import print_function, unicode_literals
show_version = "*0 CISCO881-SEC-K9 FTX0000038X "
show_version + show_version.strip()
fields = show_version.split()
model = fields[1]
serial_number = fields[2]
print()
print("-" * 60)
print()
vender_cisco = 'cisco' in model.lower()
pr... | 25.73913 | 69 | 0.679054 |
e29d66f2845afd8dbf1a61e583863664b491edc2 | 405 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_0/opportunity_not_submittable.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v5_0/opportunity_not_submittable.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_0/opportunity_not_submittable.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # 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
def execute():
frappe.reload_doctype("Opportunity")
frappe.db.sql("update tabDocPerm set submit=0, cancel=0, amend=0 where parent='Oppo... | 36.818182 | 94 | 0.785185 |
2ca22eb108cd6ec41733373946775aabebcbb648 | 1,954 | py | Python | tests/test_qsft.py | huykingsofm/FileTransmitter | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | 1 | 2020-08-28T19:06:13.000Z | 2020-08-28T19:06:13.000Z | tests/test_qsft.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | tests/test_qsft.py | huykingsofm/sft | f0f8cd0d6f941903bb8c42291a81b711055fcb1a | [
"MIT"
] | null | null | null | import time
import threading
from hks_pylib.logger.standard import StdUsers, StdLevels
from sft.protocol import DEFAULT_TOKEN
from sft.protocol.definition import SFTRoles
from hks_pylib.logger import StandardLoggerGenerator
from sft.qsft.server import QSFTServer
from sft.qsft.client import QSFTClient
KEY = b"01234... | 26.767123 | 91 | 0.688332 |
39238c3a2ea6eb16b7f34e1a0a8d596226b6e515 | 497 | py | Python | python/primary/while.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/primary/while.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/primary/while.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: while.py
number = 23
running=True
while running:
guess = int(raw_input('Enter an integer:'))
if guess == number:
print 'Congratulations, you guessed it.'
running=False
elif guess < number:
print 'No, it is a little higher than that'
else:
... | 22.590909 | 76 | 0.655936 |
46cab7856bb38202ed295f12d1b48fe4e219eb75 | 23,298 | py | Python | Packs/AWS-ILM/Integrations/AWSILM/AWSILM_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AWS-ILM/Integrations/AWSILM/AWSILM_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AWS-ILM/Integrations/AWSILM/AWSILM_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import requests_mock
from AWSILM import Client, main, get_group_command, create_group_command, update_group_command, delete_group_command
from IAMApiModule import *
userUri = '/scim/v2/Users/'
groupUri = '/scim/v2/Groups/'
RETURN_ERROR_TARGET = 'AWSILM.return_error'
APP_USER_OUTPUT = {
"id": "mock_... | 38.006525 | 117 | 0.614903 |
20511288fd5d0f4fda469a984799276acc6c4e47 | 13,525 | py | Python | Packs/MicrosoftTeams/Integrations/MicrosoftTeamsManagement/MicrosoftTeamsManagement_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicrosoftTeams/Integrations/MicrosoftTeamsManagement/MicrosoftTeamsManagement_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicrosoftTeams/Integrations/MicrosoftTeamsManagement/MicrosoftTeamsManagement_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import io
import json
import pytest
from MicrosoftTeamsManagement import (Client, add_member, archive_team,
clone_team, create_team,
create_team_from_group, delete_team,
get_member, get_team, list_joined_... | 28.837953 | 119 | 0.608651 |
64aaf84e3351fab688b6bf7f3c517676e23686de | 275 | py | Python | foundation/www/members/details.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 59 | 2017-03-15T08:14:52.000Z | 2021-11-17T14:21:58.000Z | foundation/www/members/details.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 147 | 2017-01-25T10:44:47.000Z | 2020-11-05T04:24:22.000Z | foundation/www/members/details.py | prafful1234/foundation | 6fcb027e76eae8d307c3dd70436a9657ff681f01 | [
"MIT"
] | 134 | 2017-03-14T14:04:21.000Z | 2022-03-18T08:19:47.000Z | import frappe
import foundation
no_cache = 1
def get_context(context):
if frappe.session.user != 'Guest':
context.show_sidebar = True
context.last_membership = foundation.get_last_membership()
context.all_memberships = foundation.get_all_memberships_of_one_member()
| 25 | 74 | 0.803636 |
37833f2b1d2781441d717bf224e3f771c69dd9da | 544 | py | Python | site/public/courses/SPD-2.31/archive/lab/refactoring/split_temp_variable.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/SPD-2.31/exercises/composing-methods-more/burger_toppings.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/SPD-2.31/exercises/composing-methods-more/burger_toppings.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Split temporary variable
patty = 70 # [gr]
pickle = 20 # [gr]
tomatoes = 25 # [gr]
lettuce = 15 # [gr]
buns = 95 # [gr]
sandwich_weight = (2 * patty + 4 * pickle + 3 * tomatoes + 2 * lettuce
+ 2 * buns)
print("NY Burger Weight", sandwich_weight)
kimchi = 30 # [gr]
mayo =... | 28.631579 | 71 | 0.590074 |
807b2810f84796e0be87c5001a5ed35756f33ded | 2,589 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_16_Mails_und_SMS_senden/07_kapitel_16_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_16_Mails_und_SMS_senden/07_kapitel_16_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_16_Mails_und_SMS_senden/07_kapitel_16_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 07_kapitel_16_repetitionsfragen.py
import re
max_text_length=70
max_text_delta=24
def output(title, string):
print('╔'+''.center(max_text_length+8, '═')+'╗')
print('║ '+title.center(max_text_length+7).upper()+'║')
print('╠'+''.center(max_text_length+8, '═')+'╣')
string=string+' '*max_text_length
... | 69.972973 | 432 | 0.753187 |
03e49f6a9116cab5ce75c2a4bc9f754ef4084f53 | 689 | py | Python | 30-Days-of-Code/Day13-AbstractClasses.py | sadikkuzu/HackerRank | 2b1ed2cf41f6a5404c5b9293186f301b646b5d33 | [
"Apache-2.0"
] | 5 | 2019-03-09T22:44:01.000Z | 2021-09-14T00:11:38.000Z | 30-Days-of-Code/Day13-AbstractClasses.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 4 | 2018-08-16T09:39:47.000Z | 2018-09-14T17:37:07.000Z | 30-Days-of-Code/Day13-AbstractClasses.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 1 | 2020-06-01T23:38:35.000Z | 2020-06-01T23:38:35.000Z | # https://www.hackerrank.com/challenges/30-abstract-classes
# Python 3
from abc import ABCMeta, abstractmethod
class Book:
__metaclass__ = ABCMeta
def __init__(self,title,author):
self.title=title
self.author=author
@abstractmethod
def display(): pass
# Write MyBook class
class MyBook(Bo... | 26.5 | 59 | 0.679245 |
03e9a79e292f558de7346f95cd23b477731c2163 | 230 | py | Python | Flask/FastAPI/Django/Python-API-Development.freeCodeCamp.org/16-Testing/test/main_test.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Flask/FastAPI/Django/Python-API-Development.freeCodeCamp.org/16-Testing/test/main_test.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Flask/FastAPI/Django/Python-API-Development.freeCodeCamp.org/16-Testing/test/main_test.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | from fastapi.testclient import TestClient
from app.main import app
clinet = TestClient(app)
def test_root():
res = clinet.get("/")
assert res.json().get("msg") == "Hello from API Root"
assert res.status_code == 200
| 20.909091 | 57 | 0.686957 |
2069593e062f8927f03cf05127e29398e170fb6c | 3,572 | py | Python | src/onegov/notice/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/notice/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/notice/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains upgrade tasks that are executed when the application is being
upgraded on the server. See :class:`onegov.core.upgrade.upgrade_task`.
"""
from onegov.core.orm.types import UTCDateTime
from onegov.core.upgrade import upgrade_task
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy impo... | 36.824742 | 79 | 0.702688 |
64432d9ad44d953e9900d355babb138231a901ef | 146 | py | Python | exercises/zh/solution_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/solution_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/solution_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # 导入西班牙语类
import spacy
# 创建西班牙语nlp对象
nlp = spacy.blank("es")
# 处理文本 (这是西班牙语"How are you?"的意思)
doc = nlp("¿Cómo estás?")
# 打印文本
print(doc.text)
| 12.166667 | 32 | 0.664384 |
4485b908682745a797775128bb1edf00b95e951b | 1,986 | py | Python | Packs/GLPI/Scripts/GLPIIncidentStatus/GLPIIncidentStatus.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-11-02T05:36:38.000Z | 2021-11-02T05:36:38.000Z | Packs/GLPI/Scripts/GLPIIncidentStatus/GLPIIncidentStatus.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/GLPI/Scripts/GLPIIncidentStatus/GLPIIncidentStatus.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | """GLPIIncidentStatus Script for Cortex XSOAR (aka Demisto)"""
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import traceback
COLORS = {
'1 - New': '#00CD33', # (success green)
'2 - Processing (assigned)': '#7995D4', # (royal blue)
'3 - Processing ... | 24.825 | 81 | 0.625881 |
9253d28c4db2743b09420827f313ee010ae1effb | 3,407 | py | Python | tests/service/ai/test_pathfinding_search_tree_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | tests/service/ai/test_pathfinding_search_tree_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | tests/service/ai/test_pathfinding_search_tree_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import unittest
from datetime import datetime
from multiprocessing import Value
import tests
from chillow.model.action import Action
from chillow.service.ai.pathfinding_search_tree_ai import PathfindingSearchTreeAI
from chillow.model.cell import Cell
from chillow.model.direction import Direction
from chillow.model.gam... | 40.559524 | 119 | 0.721749 |
92725e21c394997ad9f644db93027f0504ac81d5 | 647 | py | Python | scripts/update_substrait.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1 | 2021-12-13T06:00:18.000Z | 2021-12-13T06:00:18.000Z | scripts/update_substrait.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 32 | 2021-09-24T23:50:09.000Z | 2022-03-29T09:37:26.000Z | scripts/update_substrait.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | null | null | null | # Requires buf
import os
import shutil
# Change to substrait folder
sub_folder = os.path.join(os.path.dirname(os.path.realpath(__file__)),'..','third_party','substrait')
os.chdir(sub_folder)
# Delete Current CPP files
shutil.rmtree(os.path.join(sub_folder,'substrait'))
# Clone Proto Files
os.system("git clone http... | 24.884615 | 102 | 0.752705 |
2b8078a59a745cb4cea01a5a6b7db52cb9de613e | 1,981 | py | Python | research/cv/PGAN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/PGAN/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/PGAN/src/dataset.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.155172 | 101 | 0.624937 |
2bbb6efa6f5b9ba8d310c6cad84c9bf2649a4f55 | 255 | py | Python | code/1/timmons.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/1/timmons.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/1/timmons.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | from utest import ok
import random
@ok
def ok_gbt ( ) :
"""This function should fail with the current seed"""
random.seed (15)
val = ( 0.5 > random.random() )
print "Gregory Timmons is " + ("cool" if val else "not cool");
assert val
| 21.25 | 66 | 0.623529 |
753cb5bae3c07d139f4d26972cd68b665e040618 | 10,296 | py | Python | indl/old_reference/test_gen_var_rnn.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | 1 | 2021-02-22T01:39:50.000Z | 2021-02-22T01:39:50.000Z | indl/old_reference/test_gen_var_rnn.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | indl/old_reference/test_gen_var_rnn.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras.layers as tfkl
from tensorflow.python.keras import backend as K
import tensorflow_probability as tfp
from tensorflow.python.keras.utils import generic_utils
from tensorflow.python.ops import state_ops
from tensorflow.pyth... | 42.196721 | 137 | 0.63073 |
f378f979c9bc580c83c8300c0b52b81b53755d0e | 122 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/pg-9.7-list-pop-method.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/pg-9.7-list-pop-method.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.01-list/pg-9.7-list-pop-method.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | fruits = ['apple', 'mango', 'coconut', 'banana', 'orange', ]
print(fruits)
item = fruits.pop()
print(fruits)
print(item)
| 17.428571 | 60 | 0.647541 |
341417bdb202208683afd35ff3c315c2103a0108 | 2,285 | py | Python | config/config.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | config/config.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | config/config.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from usbdrive import File
class BaseConfig:
def get_config_map(self) -> dict:
return dict()
class GeneralConfig(BaseConfig):
_hold_time = 10
def set_hold_time(self, hold_time: int):
if 0 < hold_time <= 99:
self._hold_time = hold_time
def get_hold_time(self) -> int:
... | 24.052632 | 55 | 0.587746 |
cacdb85ce070ccb0bbb49f9b31568dcfa36b0094 | 946 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_2/delete_old_print_formats.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v4_2/delete_old_print_formats.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_2/delete_old_print_formats.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # 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
def execute():
old_formats = ("Sales Invoice", "Sales Invoice Spartan", "Sales Invoice Modern",
"Sales Invoice Classic",
"Sales Orde... | 39.416667 | 81 | 0.738901 |
941bc7ca9ca4c7f840582a4cabb7e00db9ca5b86 | 1,445 | py | Python | 05 Hardwarenutzung/Fallbeispiele/src/lautstaerke.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 05 Hardwarenutzung/Fallbeispiele/src/lautstaerke.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 05 Hardwarenutzung/Fallbeispiele/src/lautstaerke.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | 1 | 2020-10-10T20:24:05.000Z | 2020-10-10T20:24:05.000Z | #! ./env/bin/python3
#encoding=utf-8
# Copyright (C) 2020 Dennis Schulmeister-Zimolong
#
# E-Mail: dhbw@windows3.de
# Webseite: https://www.wpvs.de
#
# Diese Quellcode ist lizenziert unter einer
# Creative Commons Namensnennung 4.0 International Lizenz
"""
Beispiel zur Messung der Umgebungslautstärke mit dem KY-037 M... | 25.350877 | 77 | 0.635986 |
1700c1c1fa2fe924a35d3c8ff5f02a5e36393858 | 4,990 | py | Python | tests/test_layers.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 235 | 2017-03-01T14:34:29.000Z | 2021-06-03T16:16:16.000Z | tests/test_layers.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 39 | 2017-03-25T01:20:25.000Z | 2020-10-30T11:51:47.000Z | tests/test_layers.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 105 | 2017-04-13T21:31:46.000Z | 2021-11-01T17:25:48.000Z | import pytest
import numpy as np
import keras.backend as K
from keras_fcn.layers import CroppingLike2D, BilinearUpSampling2D
from keras.utils.test_utils import keras_test
@keras_test
def test_bilinear_upsampling_2d():
num_samples = 2
stack_size = 2
input_len_dim1 = 5
input_len_dim2 = 5
target_len_... | 44.553571 | 78 | 0.531062 |
fcdfbc31e37f967f4da7fe612747c2662d5980fa | 2,820 | py | Python | Packs/AzureKubernetesServices/Integrations/AzureKubernetesServices/AzureKubernetesServices_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AzureKubernetesServices/Integrations/AzureKubernetesServices/AzureKubernetesServices_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AzureKubernetesServices/Integrations/AzureKubernetesServices/AzureKubernetesServices_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import io
import json
import pytest
from AzureKubernetesServices import (API_VERSION, AKSClient,
clusters_addon_update, clusters_list)
app_id = 'app_id'
subscription_id = 'subscription_id'
resource_group_name = 'resource_group_name'
@pytest.fixture()
def client(mocker):
moc... | 30.322581 | 119 | 0.650709 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.