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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
905ccf64edf3569b29794f5c917b00212bf5ed68 | 12,745 | py | Python | gameoflife.py | malteschmitz/gameoflife | defdc1acd7f8453f8b759d2aa574ef4d19bd61c4 | [
"MIT"
] | null | null | null | gameoflife.py | malteschmitz/gameoflife | defdc1acd7f8453f8b759d2aa574ef4d19bd61c4 | [
"MIT"
] | null | null | null | gameoflife.py | malteschmitz/gameoflife | defdc1acd7f8453f8b759d2aa574ef4d19bd61c4 | [
"MIT"
] | null | null | null | # Conways Spiel des Lebens mit Python 3 und Tk
#
# Dieser Quelltext ist frei unter der MIT-Lizenz.
#
# Copyright (c) 2013 Malte Schmitz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software with... | 39.828125 | 110 | 0.612711 |
d3b843fb2493ff18e0c9f2636f646022477fe32a | 4,133 | py | Python | 20-fs-ias-lec/groups/12-logSync/src/feed_control.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/12-logSync/src/feed_control.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/12-logSync/src/feed_control.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from feedCtrl.uiFunctionsHandler import UiFunctionHandler
from feedCtrl.uiFunctionsHandler import generate_test_data # noqa: F401
from logStore.verific.verify_insertion import Verification # noqa: F401
from logStore.funcs.EventCreationTool import EventFactory # noqa: F401
from logStore.appconn.feed_ctrl_connection ... | 32.543307 | 120 | 0.547786 |
7328a115a283d0f77cb8314279d702997622eff2 | 24,019 | py | Python | xmlns/dogmood/specgen.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | xmlns/dogmood/specgen.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | xmlns/dogmood/specgen.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf8 -*-
#
# SpecGen v5, ontology specification generator tool
# <http://forge.morfeo-project.org/wiki_en/index.php/SpecGen>
#
# Copyright (c) 2003-2008 Christopher Schmidt <crschmidt@crschmidt.net>
# Copyright (c) 2005-2008 Uldis Bojars <uldis.bojars@deri.org>
# Copyright (c) 2007-2008... | 34.2151 | 139 | 0.584371 |
734d5749897816991ec6c0a13eebed1253be59fa | 1,877 | py | Python | GmailCrack-master/GmailCrack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | GmailCrack-master/GmailCrack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | GmailCrack-master/GmailCrack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # Program: Gmail Dictionary Attack v2
print"Join Ethical Hacker's Community"
#Information
print "Author: Kinghacker0"
print "YouTube - www.YouTube.com/Hacker's King "
print "Website - www.hackersking.in"
print" * * "
print" * ... | 39.104167 | 66 | 0.352158 |
b4195347e9ebfc6da1ba8502282e447f086d60ef | 2,069 | py | Python | scripts/gh_create_issue.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 1 | 2022-02-05T16:40:13.000Z | 2022-02-05T16:40:13.000Z | scripts/gh_create_issue.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 31 | 2021-06-17T11:59:33.000Z | 2022-03-19T07:05:18.000Z | scripts/gh_create_issue.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | null | null | null | import random
import click
from github3 import login, exceptions
from spotify_gender_ex.replacement_table import ReplacementTable
REPO_OWNER = 'Theta-Dev'
REPO_NAME = 'Spotify-Gender-Ex'
PHRASES = [
'Es wurden neue Gendersternchen entdeckt!',
'Ein wildes Gendersternchen erscheint!',
'Und täglich grüßt d... | 24.341176 | 117 | 0.681005 |
b461878b90be295be953c248c1cc67edc006d90a | 1,547 | py | Python | loesung/blatt1a_4a.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | 1 | 2019-09-27T13:47:20.000Z | 2019-09-27T13:47:20.000Z | loesung/blatt1a_4a.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | loesung/blatt1a_4a.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | # Hier soll der User eine Chance bekommen eine Zahl zu errraten.
# Das hier ist die Zahl, die der User erraten soll. Hier bei handelt es sich um
# eine sogenannte Konstante. Das ist eine Variabele, dessen Wert konstant ist.
# Das heißt deren Wert sich nie verändert und sich auch nie verändern soll.
# Die Abmachung in ... | 45.5 | 79 | 0.766645 |
b48887f14cba542908b7bacec092a0682f12ea0c | 1,729 | py | Python | mltrain-nips-2017/ben_athiwaratkun/pytorch-bayesgan/models/bayes.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | mltrain-nips-2017/ben_athiwaratkun/pytorch-bayesgan/models/bayes.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | mltrain-nips-2017/ben_athiwaratkun/pytorch-bayesgan/models/bayes.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import torch
#from distributions import Normal
from torch.autograd import Variable
class NoiseLoss(torch.nn.Module):
# need the scale for noise standard deviation
# scale = noise std
def __init__(self, params, scale=None, observed=None):
super(NoiseLoss, self).__init__()
# initialize the distribution fo... | 32.018519 | 75 | 0.681319 |
81f64a5702c46b8a740ec5030d78b8bf07c6554e | 6,917 | py | Python | Agent5/No simulation forward kin/forward_kin_Agent5.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent5/No simulation forward kin/forward_kin_Agent5.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent5/No simulation forward kin/forward_kin_Agent5.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | import numpy as np
from math import cos, sin, pi
import time
import random
import gym
from gym import spaces
import transformations as tf
metadata = {'render.modes': ['human']}
class PandaRobotGymEnv(gym.Env):
def __init__(self, max_steps=50):
super(PandaRobotGymEnv, self).__init__()
self._env_... | 37.592391 | 134 | 0.559057 |
6f1a43bf9b316e2397950621dd49fa824eb88189 | 7,771 | py | Python | data/randomData.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | 2 | 2021-05-31T13:11:50.000Z | 2021-06-05T04:37:51.000Z | data/randomData.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | data/randomData.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | import random
xing = [
'赵', '钱', '孙', '李', '周', '吴', '郑', '王', '冯', '陈', '褚', '卫', '蒋', '沈', '韩', '杨', '朱', '秦', '尤', '许',
'何', '吕', '施', '张', '孔', '曹', '严', '华', '金', '魏', '陶', '姜', '戚', '谢', '邹', '喻', '柏', '水', '窦', '章',
'云', '苏', '潘', '葛', '奚', '范', '彭', '郎', '鲁', '韦', '昌', '马', '苗', '凤', '花', '方', '俞',... | 57.562963 | 103 | 0.279372 |
48d74178c96d46a3ef394f85c7287419012df95e | 556 | py | Python | exercises/fr/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("fr")
# Traite le texte
doc = nlp(
"En 1990, plus de 60 % de la population d'Asie orientale vivait dans une pauvreté extrême. "
"Actuellement c'est moins de 4 %."
)
# Itère sur les tokens du doc
for token in doc:
# Vérifie si le token ressemble à un nombre
if ____.____:... | 27.8 | 96 | 0.640288 |
7dee920927db039bcdfcfcafcc7a5a545de295ca | 2,872 | py | Python | rfvision/models/builder.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | rfvision/models/builder.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | rfvision/models/builder.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | import warnings
from rflib.cnn import MODELS as RFLIB_MODELS
from rflib.utils import Registry
MODELS = Registry('models', parent=RFLIB_MODELS)
BACKBONES = MODELS
NECKS = MODELS
ROI_EXTRACTORS = MODELS
SHARED_HEADS = MODELS
HEADS = MODELS
LOSSES = MODELS
DETECTORS = MODELS
FUSION_LAYERS = MODELS
POSE_ESTIMATORS = MOD... | 31.217391 | 71 | 0.694638 |
81cf99b4840c118f723812b9b465a942ead19dfa | 2,248 | py | Python | Modulos/Criptografia/Scrt_Cesar.py | Jonatan966/SODA | 046d8c1e7b9bac3a555526c9fe2f365c2b338aca | [
"MIT"
] | null | null | null | Modulos/Criptografia/Scrt_Cesar.py | Jonatan966/SODA | 046d8c1e7b9bac3a555526c9fe2f365c2b338aca | [
"MIT"
] | null | null | null | Modulos/Criptografia/Scrt_Cesar.py | Jonatan966/SODA | 046d8c1e7b9bac3a555526c9fe2f365c2b338aca | [
"MIT"
] | null | null | null | import sys
sys.path.append('Nucleo/')
from Nucleo.smain_Variaveis import *
abc = '''ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#"'&()[]|`\/@°+=*$£€<> '''
n = 0
# error = 'Informacao Invalida'
class sMain_CESAR:
def cifrar(self, texto, rot):
text_cifrado = ''
texto = str... | 38.758621 | 121 | 0.575623 |
96a208947c6946212306b663f2eaac1b554b5a55 | 54,371 | py | Python | abfahrt/Travel_Center.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | 1 | 2022-01-30T14:30:02.000Z | 2022-01-30T14:30:02.000Z | abfahrt/Travel_Center.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | abfahrt/Travel_Center.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | """
This is Travel_Center for managing travels and routes
"""
import math
# This module provides access to the mathematical functions defined by the C standard. (https://docs.python.org/3/library/math.html)
import sys
# This module provides access to some variables used or maintained by the interpreter and to funct... | 43.323506 | 301 | 0.597892 |
fb7953950e5d0a7f615114813dc07066fd5d5dae | 5,014 | py | Python | luechenbresse/dotfolder.py | turkishmaid/luechenbresse | 2527b19eb2f961cef5ddb62e816b471e5d04847d | [
"MIT"
] | null | null | null | luechenbresse/dotfolder.py | turkishmaid/luechenbresse | 2527b19eb2f961cef5ddb62e816b471e5d04847d | [
"MIT"
] | 4 | 2020-05-12T07:26:52.000Z | 2020-05-23T12:21:49.000Z | luechenbresse/dotfolder.py | turkishmaid/luechenbresse | 2527b19eb2f961cef5ddb62e816b471e5d04847d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""
Collect code that works with the files in teh .luechenbresse folder directly.
Created: 15.05.20
"""
import sys
import os
from pathlib import Path
import sqlite3
import logging
import logging.handlers
import configparser
from luechenbresse import data
from luechenbresse impo... | 34.108844 | 110 | 0.654567 |
fbdf62091f423efbc21f88622609eefd4aa31588 | 605 | py | Python | exercises/pt/solution_03_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_03_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_03_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.language import Language
# Defina o componente customizado
@Language.component("length_component")
def length_component_function(doc):
# Calcule o tamanho do doc
doc_length = len(doc)
print(f"Este documento tem {doc_length} tokens.")
# Retorne o doc
return doc
# Carregue o... | 26.304348 | 79 | 0.757025 |
e3f51a16815448c7e661ab273f7e3246c0a3696a | 724 | py | Python | Python/B9-Sanduhr_rueckwaerts/B9-Sanduhr_rueckwaerts.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B9-Sanduhr_rueckwaerts/B9-Sanduhr_rueckwaerts.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B9-Sanduhr_rueckwaerts/B9-Sanduhr_rueckwaerts.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Reihe = 0
Spalte = 0
def on_button_pressed_a():
global Reihe, Spalte
basic.show_leds("""
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
""")
Reihe = 0
Spalte = 0
for index in range(5):
for index2 in range(5):
led... | 22.625 | 55 | 0.43232 |
54002b9a6ab8a070f3e61fd0455bab6f6f5798c1 | 786 | py | Python | libs/langdetect/LangDetectDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | libs/langdetect/LangDetectDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | libs/langdetect/LangDetectDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null |
from langdetect import detect
from langdetect import detect_langs
print("------------------------------------------------------------------------")
print("Start LangDetectDemo")
print("------------------------------------------------------------------------")
text = "War doesn't show who's right, just who's left."
p... | 24.5625 | 81 | 0.541985 |
587e2ec3dec893d4a87c2438594a1d74aeadbf7b | 361 | py | Python | python/generator_tricks_for_systemprogrammer/test.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/test.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/test.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import time
def countup(n):
while True:
n += 2
yield n
def countdown(n):
while True:
n = n - 1
yield n
def main(n):
while True:
n = next(countup(n))
print(n)
time.sleep(0.5)
n = next(countdown(n))
print(n)
time.sleep(0.5)... | 12.892857 | 30 | 0.473684 |
4d71c80c88183f7e1320c4121af6d4e7a5d0edf7 | 60 | py | Python | tradingbot/__init__.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 3 | 2018-05-10T13:51:42.000Z | 2020-07-05T16:43:45.000Z | tradingbot/__init__.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | null | null | null | tradingbot/__init__.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 1 | 2020-04-22T09:06:17.000Z | 2020-04-22T09:06:17.000Z | from .core.bot import Bot
from .core.grapher import Grapher
| 20 | 33 | 0.8 |
4dd2337731c9f4a4e90e032f14f392fbb239925e | 3,094 | py | Python | nz_crawl_demo/day9/Agent/useragent_demo/useragent_demo/middlewares.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day9/Agent/useragent_demo/useragent_demo/middlewares.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day9/Agent/useragent_demo/useragent_demo/middlewares.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class UseragentDemoSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# ... | 32.914894 | 93 | 0.659987 |
429cb341977fa869a13722ada1567176725ecf2d | 1,370 | py | Python | tests/test_standorteigenschaftenstrom.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_standorteigenschaftenstrom.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_standorteigenschaftenstrom.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import pytest # type:ignore[import]
from bo4e.com.standorteigenschaftenstrom import StandorteigenschaftenStrom, StandorteigenschaftenStromSchema
from tests.serialization_helper import assert_serialization_roundtrip # type:ignore[import]
example_standorteigenschaften_strom = StandorteigenschaftenStrom(
regelzone... | 35.128205 | 108 | 0.677372 |
679ec18e7269b6d726c83921214d0c82f3a256a6 | 778 | py | Python | src/formatMath.py | stasj145/Bachelorarbeit-Texterzeugungsmodelle | a62519d7b1f7288927811a0bac76c4db4f0c1129 | [
"Apache-2.0"
] | null | null | null | src/formatMath.py | stasj145/Bachelorarbeit-Texterzeugungsmodelle | a62519d7b1f7288927811a0bac76c4db4f0c1129 | [
"Apache-2.0"
] | null | null | null | src/formatMath.py | stasj145/Bachelorarbeit-Texterzeugungsmodelle | a62519d7b1f7288927811a0bac76c4db4f0c1129 | [
"Apache-2.0"
] | null | null | null | import io
import re
fileName="../data/algebra_linear_1d.txt"
stopAfterNExamples=200000
rePattern='^Solve\s([\S\s]+)\sfor\s(\w)\.$'
f=open(fileName)
lines = f.readlines()
f.close()
print(len(lines))
se, f, s, e = "<|startoftext|>\n[EQUATION]: ", "\n[SOLVEFOR]: ", "\n[SOLUTION]: ", "<|endoftext|>\n"
newF = io.open("m... | 19.45 | 100 | 0.606684 |
67c8a6d0c3d3cc724aab11de2eb06ce07138d2f2 | 1,609 | py | Python | src/onegov/pay/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pay/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pay/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import namedtuple
from decimal import Decimal
from functools import total_ordering
from onegov.core.orm import Base
@total_ordering
class Price(namedtuple('PriceBase', ('amount', 'currency', 'fee'))):
""" A single price.
The amount includes the fee. To get the net amount use the net_amount
... | 26.816667 | 77 | 0.642014 |
97e73adae488a05554506f1727b70fc2ac8dc9aa | 2,941 | py | Python | Backend/migrations/alembic/versions/5cf8d4366856_create_divi_meldungen_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/migrations/alembic/versions/5cf8d4366856_create_divi_meldungen_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/migrations/alembic/versions/5cf8d4366856_create_divi_meldungen_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create divi_meldungen table
Revision ID: 5cf8d4366856
Revises: 56a467c77bd8
Create Date: 2020-11-25 21:20:46.363912
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '5cf8d4366856'
down_revision = '56a467c77bd8'
branch_labels = None
depends_on = None
def upgrade():
op.get_bind()... | 35.433735 | 93 | 0.581435 |
58e339e7f3986ce080006ec90a65fb810c722f70 | 2,908 | py | Python | Packs/IP-API/Integrations/IPAPI/IPAPI.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/IP-API/Integrations/IPAPI/IPAPI.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/IP-API/Integrations/IPAPI/IPAPI.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import traceback
from typing import Any, Dict, List
import demistomock as demisto # noqa: F401
import urllib3
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
urllib3.disable_warnings()
class Client(BaseClient):
def get_ip_reputation(self, ip: str) -> Dict[str, Any]:
params = ... | 28.792079 | 94 | 0.592503 |
18a1fe26ede59faa22094717c800dd30420db21f | 145 | py | Python | 2185-counting-words-with-a-given-prefix/2185-counting-words-with-a-given-prefix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 2185-counting-words-with-a-given-prefix/2185-counting-words-with-a-given-prefix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 2185-counting-words-with-a-given-prefix/2185-counting-words-with-a-given-prefix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def prefixCount(self, words: List[str], pref: str) -> int:
return sum([1 for word in words if word.startswith(pref)]) | 48.333333 | 66 | 0.668966 |
18d720dd874e58bb84cd856e5f8d06ef0e2d4099 | 336 | py | Python | python/generator_tricks_for_systemprogrammer/genfind.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genfind.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genfind.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # genfind.py
#
# A function that generates files that match a given filename pattern
from pathlib import Path
def gen_find(filepath, top):
yield from Path(top).rglob(filepath)
# Example use
if __name__ == "__main__":
lognames = gen_find("access-log*", "www")
for name in lognames:
... | 18.666667 | 70 | 0.654762 |
e1414656f6a68e65b389e121836513737be89f16 | 44 | py | Python | AdvinheAFruta/run.py | jvpersuhn/hb | 5487abf4fc5b742cf21086ca5b823b915132445d | [
"MIT"
] | null | null | null | AdvinheAFruta/run.py | jvpersuhn/hb | 5487abf4fc5b742cf21086ca5b823b915132445d | [
"MIT"
] | null | null | null | AdvinheAFruta/run.py | jvpersuhn/hb | 5487abf4fc5b742cf21086ca5b823b915132445d | [
"MIT"
] | null | null | null | from Jogo import Jogo
j = Jogo()
j.jogar()
| 8.8 | 21 | 0.659091 |
a1c9c0fc83144e916f8fc2a35b592d41ea2ad27b | 3,249 | py | Python | python/oneflow/compatible/single_client/benchmarks/cnn_benchmark/vgg_model.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/benchmarks/cnn_benchmark/vgg_model.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/benchmarks/cnn_benchmark/vgg_model.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 34.56383 | 78 | 0.669745 |
773296aacbb94d97f7a078bae12ce8da4b45c215 | 256 | py | Python | leetcode/343-Integer-Break/IntegerBreak.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/343-Integer-Break/IntegerBreak.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/343-Integer-Break/IntegerBreak.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def integerBreak(self, n):
"""
:type n: int
:rtype: int
"""
if n < 4:
return n - 1
num3 = (n - 2) / 3
rem = (n - 2) % 3
return (3 ** num3) * (rem + 2)
| 19.692308 | 38 | 0.371094 |
77373289da434e0f182b9f27facc5a81774178bc | 8,539 | py | Python | Project3/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project3/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project3/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import lib
import matplotlib as mpl
def power_iteration(M: np.ndarray, epsilon: float = -1.0) -> (np.ndarray, list):
"""
Compute largest eigenvector of matrix M using power iteration. It is assumed that the
largest eigenvalue of M, in magnitude, is well separated.
Arguments:
M:... | 30.496429 | 115 | 0.652535 |
7750a7293f8e3fe7114072c080dad33dc168afd8 | 1,603 | py | Python | Contrib-Inspur/openbmc/poky/meta/lib/oeqa/runtime/cases/date.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/meta/lib/oeqa/runtime/cases/date.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/meta/lib/oeqa/runtime/cases/date.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #
# SPDX-License-Identifier: MIT
#
import re
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.runtime.decorator.package import OEHasPackage
class DateTest(OERuntimeTestCase):
def setUp(self):
if self.tc.td.get('VIRTUAL-RUNTIME_init_manager')... | 37.27907 | 79 | 0.638802 |
6599b5a5af9cb7a32bb7b80be4dfe72b9ae65d70 | 2,319 | py | Python | model/unet.py | JugendForscht-CoLoS/SunDetection-NeuralNetwork | 139bcc314cf6b5b84a82b08fda8b1e4455f7cf93 | [
"MIT"
] | 4 | 2021-02-26T15:47:28.000Z | 2021-03-04T16:46:00.000Z | model/unet.py | JugendForscht-CoLoS/SunDetection-NeuralNetwork | 139bcc314cf6b5b84a82b08fda8b1e4455f7cf93 | [
"MIT"
] | null | null | null | model/unet.py | JugendForscht-CoLoS/SunDetection-NeuralNetwork | 139bcc314cf6b5b84a82b08fda8b1e4455f7cf93 | [
"MIT"
] | 1 | 2021-02-24T13:01:21.000Z | 2021-02-24T13:01:21.000Z | from tensorflow.keras.layers import MaxPooling2D, UpSampling2D, Conv2D, Conv2DTranspose, Input, Add
from tensorflow.keras.models import Model
OUTPUT_CHANNELS = 1
ACTIVATION='relu'
PICTURE_SIZE=224
inputs = Input(shape=(PICTURE_SIZE, PICTURE_SIZE, 3))
def downsample(input, filters=8, third_conv=False, padding=... | 43.754717 | 118 | 0.711082 |
65a1166dd63c43148a4cd0ac9d932341ed8e7986 | 286 | py | Python | Decorators/Basic/dec_3.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | Decorators/Basic/dec_3.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | Decorators/Basic/dec_3.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | def smart_divide(func):
def inner(a,b):
print("divide %s/%s is:" % (a,b))
return func(a,b)
return inner
@smart_divide
def divide(a,b):
return a/b
if __name__ == '__main__':
print(divide(10,5))
'''
divide = smart_divide(divide)
'''
| 14.3 | 41 | 0.545455 |
b23ce0c954038df836180b5eadc4239e07281325 | 3,377 | py | Python | pruebas.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | pruebas.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | pruebas.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | # Cargar todo el contenido del Synop en una sola linea
# Funciones en Modulo Personal
from module_functions import clear, creation_date
clear()
path_txt_synop = 'C:\\LIBRETA\\SYNOP.TXT'
archivo_synop = open(path_txt_synop)
misynop = ''
for linea_synop in archivo_synop.readlines():
if ord(linea_synop[0])!=1 and or... | 31.268519 | 104 | 0.511993 |
b2a26f95476c670e8c18a907df79c6c787cf346e | 39,982 | py | Python | python-bildungslogin/ucs-test/97_bildungslogin_python/03_test_assignments.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/ucs-test/97_bildungslogin_python/03_test_assignments.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/ucs-test/97_bildungslogin_python/03_test_assignments.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | #!/usr/share/ucs-test/runner /usr/bin/py.test -slvv --cov --cov-config=.coveragerc --cov-append --cov-report=
# -*- coding: utf-8 -*-
#
# Copyright 2021 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero Gener... | 52.538765 | 109 | 0.671152 |
0c2c809d65f7c4233a8d5bfdc7f435c157e58bdb | 3,836 | py | Python | spg-2020-11-03.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | spg-2020-11-03.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | spg-2020-11-03.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | import random
import time
def fill(n):
return [random.randint(0,1000) for i in range(n)]
def nej(l):
biggest = l[0]
for i in l:
if i > biggest:
biggest = i
return biggest
def druhejnej(l):
biggest = nej(l)
biggest2 = 0
for i in l:
if i < biggest and i > bigges... | 24.278481 | 148 | 0.497393 |
a74e6c27a6ac445087188e790e8d432b9440caac | 421 | py | Python | software/supervisor/insert_into_database.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/supervisor/insert_into_database.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/supervisor/insert_into_database.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | from database import Panels, Strings, session, panels, strings
import time
newstring = Strings()
newstring.stringnumber = 3
newstring.stringcurrent = 25.342
newstring.timestamp = time.time()
session.add(newstring)
session.flush()
# newmodule = Panels()
# newmodule.serialnumber = 1
# newmodule.voltage = 230
# newmodul... | 22.157895 | 62 | 0.760095 |
a777c0b5f740a69bee9ba8e6a22a9de60c6ca6a2 | 3,038 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m7/74a1/day3.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/74a1/day3.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/74a1/day3.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Problem 1: Merge Two Sorted Lists
# Merge two sorted linked lists and return it as a new sorted list.
# The new list should be made by splicing together the nodes of the first two lists.
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, val=0, next=None):
# self.val =... | 36.166667 | 189 | 0.609941 |
ac2469f5b185b5cef55c20b099c0e6ca32b67c95 | 1,073 | py | Python | examples/server.py | Lindenk/goods | 59978225ae6c682cfbc37920a2e8da904b19caa3 | [
"Apache-2.0",
"MIT"
] | null | null | null | examples/server.py | Lindenk/goods | 59978225ae6c682cfbc37920a2e8da904b19caa3 | [
"Apache-2.0",
"MIT"
] | null | null | null | examples/server.py | Lindenk/goods | 59978225ae6c682cfbc37920a2e8da904b19caa3 | [
"Apache-2.0",
"MIT"
] | null | null | null | import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map = {
'.manifest': 'text/cache-manifest',
'.html': 'text/html',
'.png': 'image/png',
'.jpg': 'ima... | 27.512821 | 67 | 0.621622 |
ac42a72fa2799c604ab28ee9d128e2ef99f027cf | 1,340 | py | Python | geotagger/exif.py | jakubroztocil/geotagger | fa79945e88facafadc29090a991abe95f57e7ad5 | [
"MIT"
] | 26 | 2017-03-14T01:20:12.000Z | 2021-11-30T20:37:10.000Z | geotagger/geotagger/exif.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2017-06-25T22:08:04.000Z | 2018-05-26T20:10:06.000Z | geotagger/exif.py | jakubroztocil/geotagger | fa79945e88facafadc29090a991abe95f57e7ad5 | [
"MIT"
] | 10 | 2017-04-18T13:18:15.000Z | 2020-04-27T11:50:26.000Z | from pprint import pprint
from geotagger import settings
from geotagger.utils import parse_date
from geotagger.packages import exiftool
def parse_metadata(metadata):
location = None
if 'EXIF:GPSLatitude' in metadata:
location = {
'latitude': metadata['EXIF:GPSLatitude'],
'long... | 26.27451 | 75 | 0.641045 |
ac44b39980f83af3b2fe7e7f6339aaa352d63c1f | 2,785 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cnos/test_cnos_banner.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cnos/test_cnos_banner.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cnos/test_cnos_banner.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | 44.206349 | 144 | 0.745063 |
021daa773e7f3eb4508602a654ab25c866a270eb | 512 | py | Python | Algorithms/Implementation/lisas_workbook.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/lisas_workbook.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/lisas_workbook.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
n, k = list(map(int, input().strip().split(' ')))
t = list(map(int, input().strip().split(' ')))
res = []
for num in t:
for i in range(1, num + 1):
res.append(i)
div, mod = divmod(num, k)
if mod == 0:
r = 0
else:
r = k - mod
for i in range(r):
r... | 25.6 | 76 | 0.482422 |
ce6b390290d9dd1e78839533bff35abe2470ef66 | 4,402 | py | Python | Packs/AttackIQFireDrill/Integrations/AttackIQFireDrill/AttackIQFireDrill_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AttackIQFireDrill/Integrations/AttackIQFireDrill/AttackIQFireDrill_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AttackIQFireDrill/Integrations/AttackIQFireDrill/AttackIQFireDrill_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from AttackIQFireDrill import build_transformed_dict, activate_assessment_command, create_invalid_id_err_msg, \
get_assessment_execution_status_command, get_test_execution_status_command, get_test_results_command, \
list_assessments_command, get_assessment_by_id_command, list_tests_by_assessment_... | 45.854167 | 119 | 0.768969 |
0c9d013816dbde4f47e37900f2db3bbac8414a53 | 9,658 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/tests/Issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/Issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | 56.811765 | 151 | 0.616691 |
4903640cddc7c847a53feaa8dceccce984be5639 | 98 | py | Python | python/python_backup/PRAC_PYTHON/lop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/lop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/lop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | for i in range(5+1,1,-1):
for j in range(1,i,1):
print"*",
print "" | 24.5 | 30 | 0.397959 |
0b585dc7a6f6a1e13b817f37a6aabd27d440dee5 | 7,728 | py | Python | main.py | hsdllcw/everyonepiano-music-database | d440544ad31131421c1f6b5df0f039974521eb8d | [
"MIT"
] | 17 | 2020-12-01T05:27:50.000Z | 2022-03-28T05:03:34.000Z | main.py | hsdllcw/everyonepiano-music-database | d440544ad31131421c1f6b5df0f039974521eb8d | [
"MIT"
] | null | null | null | main.py | hsdllcw/everyonepiano-music-database | d440544ad31131421c1f6b5df0f039974521eb8d | [
"MIT"
] | 2 | 2021-08-24T08:58:58.000Z | 2022-02-08T08:22:52.000Z | # python3.7
import codecs
import json
import os
import shutil
import sqlite3
import sys
import html2text as ht
import urllib3
from bs4 import BeautifulSoup
# 创建连接
http = urllib3.PoolManager()
text_maker = ht.HTML2Text()
init_music_no = "0000000"
def delete_exists_file(down_load_dir):
# 移除.exists文件可重复执行脚本
fo... | 39.428571 | 140 | 0.563147 |
0bbc6cc0ba578da50b8f2adf1722083bf18dbf67 | 1,011 | py | Python | Common_Algorithms/HMM/Dice_01.py | xrick/WolfNLP | ff59be5a180813e7127c7eaf52db2478c20e8431 | [
"MIT"
] | null | null | null | Common_Algorithms/HMM/Dice_01.py | xrick/WolfNLP | ff59be5a180813e7127c7eaf52db2478c20e8431 | [
"MIT"
] | null | null | null | Common_Algorithms/HMM/Dice_01.py | xrick/WolfNLP | ff59be5a180813e7127c7eaf52db2478c20e8431 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# By tostq <tostq216@163.com>
# 博客: blog.csdn.net/tostq
from hmmlearn.hmm import MultinomialHMM
import numpy as np
import hmm
dice_num = 3
x_num = 8
dice_hmm = hmm.DiscreteHMM(3, 8)
dice_hmm.start_prob = np.ones(3)/3.0
dice_hmm.transmat_prob = np.ones((3,3))/3.0
dice_hmm.emission_prob = np.array... | 28.885714 | 111 | 0.581602 |
b2e43a82b250fbb70955322bc1123419304e21d4 | 2,666 | py | Python | Webpage/jollen/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/jollen/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/jollen/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from unicodedata import name
from django.db import models
from django.db.models.base import Model
from tinymce import HTMLField
from phonenumber_field.modelfields import PhoneNumberField
from django_resized import ResizedImageField
from django.contrib.auth.models import User
from django.contrib.auth import get_user_mod... | 35.546667 | 144 | 0.706677 |
68371f36dd426e0d0aa4aad79ae85ef2599f8d9d | 278 | py | Python | Curso_Python/Secao5-modulos-uteis/136_jupyter_notebook/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/136_jupyter_notebook/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/136_jupyter_notebook/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
Jupyter notebook é uma aplicação qeb que permite a execução de codigo em tempo
real, visualização de dados e textos explicativos.
Cientitas de dados podem criar, executar o código e explicar o processo
enquanto executam o codigo e mostram os dados
pip install jupyter
"""
| 27.8 | 78 | 0.794964 |
f0a89d297cf7aaa5158b8177ba1590dfa4f02e2b | 5,699 | py | Python | addresses/demo.py | DariusParvin/segwit_tutorial | a5ed6776bbed5eaf1e24b6a1d9228c39d30c0376 | [
"MIT"
] | 10 | 2019-03-12T22:32:26.000Z | 2022-01-05T06:36:52.000Z | addresses/demo.py | DariusParvin/segwit_tutorial | a5ed6776bbed5eaf1e24b6a1d9228c39d30c0376 | [
"MIT"
] | 2 | 2019-10-30T14:31:00.000Z | 2019-11-02T01:27:08.000Z | addresses/demo.py | DariusParvin/segwit_tutorial | a5ed6776bbed5eaf1e24b6a1d9228c39d30c0376 | [
"MIT"
] | 3 | 2019-10-31T13:56:04.000Z | 2022-01-19T21:40:09.000Z | # Generating random number
import random
private_key = (random.getrandbits(256)).to_bytes(32, byteorder="little", signed=False)
# Attaching private key to SECP256k1 using ECDSA
import ecdsa
signing_key = ecdsa.SigningKey.from_string(private_key, curve = ecdsa.SECP256k1)
verifying_key = signing_key.get_verifying_key()... | 35.842767 | 118 | 0.645201 |
f0d633bc38df53f949f057628d56d0e10e09b98f | 7,398 | py | Python | rfvision/models/human_analyzers/iknet.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | rfvision/models/human_analyzers/iknet.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | rfvision/models/human_analyzers/iknet.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | from rfvision.models.builder import build_backbone, HUMAN_ANALYZERS
from rfvision.models.detectors3d import Base3DDetector
import torch.nn as nn
import torch
import torch.nn.functional as F
from rfvision.components.utils import (normalize_quaternion, quaternion_to_angle_axis,
qua... | 36.087805 | 128 | 0.583131 |
502bba8cf51a1815548cce385d3b6c3b363617f4 | 14,232 | py | Python | marathon/marathon-lb/utils.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | marathon/marathon-lb/utils.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 103 | 2017-10-28T02:25:41.000Z | 2019-02-26T05:09:58.000Z | marathon/marathon-lb/utils.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/usr/bin/env python3
import hashlib
from io import BytesIO
import logging
import socket
import pycurl
from common import DCOSAuth
from lrucache import LRUCache
logger = logging.getLogger('utils')
# The maximum number of clashes to allow when assigning a port.
MAX_CLASHES = 50
class ServicePortAssigner(object):... | 32.493151 | 79 | 0.597667 |
acb80a74ccbe4e48b1be482bda5775c5ac55d536 | 4,318 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/check_point/test_checkpoint_access_rule.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/check_point/test_checkpoint_access_rule.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/check_point/test_checkpoint_access_rule.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Red Hat
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible i... | 40.735849 | 155 | 0.725104 |
c5c97bdd98161f8408317d12d5d3a7074848205d | 2,459 | py | Python | day13/debugging.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day13/debugging.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day13/debugging.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | ############DEBUGGING#####################
# # Describe Problem
# def my_function():
# for i in range(1, 20):
# if i == 20:
# print("You got it")
# my_function()
# the code never reaches the print statement
# range goes only till 20 not including.
# Bugfix: make the range +1 or change the if statement to ... | 23.644231 | 74 | 0.626271 |
680f06fbc598aabed977d4c14ccbb88c36387300 | 5,646 | py | Python | LibMS/libapp/admin.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | 2 | 2021-05-31T13:11:50.000Z | 2021-06-05T04:37:51.000Z | LibMS/libapp/admin.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | LibMS/libapp/admin.py | StephenWayen/LibMS | df6078a8171f77b75f2ad3ac91e9747ef753d2a6 | [
"MIT"
] | null | null | null | import datetime
from django.contrib import admin
from django.core.mail import send_mail
from django.db.models import Q, F
from .models import *
from django.utils import timezone
# Register your models here.
admin.site.site_header = '上海大学图书借阅管理系统'
admin.site.site_title = '借阅管理'
@admin.register(CIP)
class CIPAdmin(a... | 27.676471 | 105 | 0.595466 |
769663a6e7f0b6932693b19f9aa14a0945cabc54 | 11,619 | py | Python | python/coursera_python/WESLEYAN/week3/COURSERA/2nd_Ass.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/WESLEYAN/week3/COURSERA/2nd_Ass.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/WESLEYAN/week3/COURSERA/2nd_Ass.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 29 16:44:20 2017
@author: root
"""
# -ProblemSet2.py *- coding: utf-8 -*-
"""
Each problem will be a function to write.
Remember that you can execute just the code between the #%% signs by clicking
somewhere in that space and the using Ctrl-E... | 28.547912 | 81 | 0.680093 |
769b349b164ed1d556db8a30d438ae8cfcc40b43 | 382 | py | Python | ANN/e11/e11.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | ANN/e11/e11.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | ANN/e11/e11.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | N = [
[1.0352447188],
[2.5855945787],
[3.2388323353],
[3.4710646839],
[3.5579700434],
[3.5936432168],
[3.6094908928],
]
grau = 7
b = 1
for i in range(grau - 1):
for j in range(grau - i - 1):
N[j].append(
((2 ** (i * b + b) * N[j + 1][i]) - N[j][i]) / (2 ** (i * b + ... | 19.1 | 81 | 0.421466 |
4f7f0f874ad8a1c7f79704ff7b4ad839e5178ad5 | 1,877 | py | Python | Packs/GoogleChronicleBackstory/Scripts/ChronicleAssetIdentifierScript/ChronicleAssetIdentifierScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleAssetIdentifierScript/ChronicleAssetIdentifierScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleAssetIdentifierScript/ChronicleAssetIdentifierScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
@pytest.mark.parametrize('input_key, output', [('key1', True), ('key4', False)])
def test_has_key(input_key, output):
from ChronicleAssetIdentifierScript import has_key
dummy_dict = {
'key1': 'value1',
'key2': 'value2'
}
expected_output = has_key(dummy_dict, key=input_ke... | 29.793651 | 80 | 0.683005 |
4fb4aa9e7f74cf5eb79da2357bbf138d76635a35 | 3,730 | py | Python | tests/test_list.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 126 | 2019-09-16T15:28:20.000Z | 2022-03-20T10:57:53.000Z | tests/test_list.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 54 | 2019-09-30T08:44:01.000Z | 2022-03-20T11:10:00.000Z | tests/test_list.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 11 | 2020-01-02T08:32:46.000Z | 2022-03-20T11:10:24.000Z | import builtins
import random
import pytest
from hypothesis import assume, given
from hypothesis.strategies import integers
from hypothesis.strategies import lists as lists_
from pfun import List, compose, identity
from pfun.hypothesis_strategies import anything, lists, unaries
from pfun.list import filter_, for_each... | 29.603175 | 78 | 0.603753 |
4fd60639652bc51919bd317c3d343351e1b282ab | 1,034 | py | Python | codejam/kickstart_2020-c/C.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 6 | 2018-10-15T18:45:05.000Z | 2022-03-29T04:30:10.000Z | codejam/kickstart_2020-c/C.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | null | null | null | codejam/kickstart_2020-c/C.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 4 | 2018-01-07T06:20:07.000Z | 2019-08-21T15:45:59.000Z | def input1(type=int):
return type(input())
def input2(type=int):
[a, b] = list(map(type, input().split()))
return a, b
def input3(type=int):
[a, b, c] = list(map(type, input().split()))
return a, b, c
def input_array(type=int):
return list(map(type, input().split()))
def input_string():
s = input(... | 18.464286 | 62 | 0.458414 |
0fafc881f2b65294dd6e10c7891f4c1beea88a2a | 1,328 | py | Python | zencad/gui/util.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/gui/util.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/gui/util.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import os
import tempfile
def create_temporary_file(zencad_template=False):
path = tempfile.mktemp(".py")
if zencad_template:
f = open(path, "w")
f.write(
"#!/usr/bin/env python3\n#coding: utf-8\n\... | 19.529412 | 110 | 0.625 |
fa0fe8410964390c851b08f0c64fd19df09026c5 | 7,313 | py | Python | Implementierung/ResearchEnvironment/AuthorizationManagement/views.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/views.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/views.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.views import generic
from django.contrib.auth.decorators import login_required
from .models import Resource
from .models import User
from .models import Owner
from .models import AccessRequest
from django.core.files import Fi... | 33.392694 | 124 | 0.685492 |
d74ca6163646ad2e74f6b5276922e5325e90c0a9 | 367 | py | Python | src/built_in_functions/callable_function.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/built_in_functions/callable_function.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/built_in_functions/callable_function.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
print("------------------------------------------------")
# callable 方法,如果传入的参数是可以调用的函数,则返回 true ,否则返回 false
st = 'wyz'
print('字符串的doc属性是否可调用:')
print(callable(getattr(st, '__doc__')))
# False
print("------------------------------------------------")
print("字符串的split方法是否可调用:"... | 24.466667 | 57 | 0.498638 |
0e5b4ba4d87aa37243c708b32673bbffa37ff6bf | 10,940 | py | Python | preprocessing/augmentation.py | mWollenhaupt/Mask_R-CNN_3D-Buildings | 220f20b41a7290a01c0bb47672453e646254f8fc | [
"MIT"
] | 2 | 2021-05-20T22:49:28.000Z | 2021-06-16T06:35:07.000Z | preprocessing/augmentation.py | mWollenhaupt/Mask_R-CNN_3D-Buildings | 220f20b41a7290a01c0bb47672453e646254f8fc | [
"MIT"
] | null | null | null | preprocessing/augmentation.py | mWollenhaupt/Mask_R-CNN_3D-Buildings | 220f20b41a7290a01c0bb47672453e646254f8fc | [
"MIT"
] | null | null | null | from imgaug.augmentables.segmaps import SegmentationMapsOnImage
import imgaug.augmenters as iaa
import skimage.external.tifffile
import skimage.io
import numpy as np
import shutil
import os
from utils.logger import ProgressLogger
class ImageSet:
def __init__(self, path, augmented=False):
self.root = path... | 39.071429 | 110 | 0.544881 |
0eae042b68ebb46489c09031f1e4b74421427efe | 1,653 | py | Python | xlutils/tests/test_styles.py | drmelectronic/MIT | e28a82cd02dcc52ac233b89b43f29ede00993d11 | [
"MIT"
] | null | null | null | xlutils/tests/test_styles.py | drmelectronic/MIT | e28a82cd02dcc52ac233b89b43f29ede00993d11 | [
"MIT"
] | null | null | null | xlutils/tests/test_styles.py | drmelectronic/MIT | e28a82cd02dcc52ac233b89b43f29ede00993d11 | [
"MIT"
] | null | null | null | # Copyright (c) 2009 Simplistix Ltd
#
# This Software is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.html
# See license.txt for more details.
from mock import Mock
from testfixtures import should_raise
from unittest import TestSuite,TestCase,makeSuite
from xlutils.styles import Sty... | 26.238095 | 53 | 0.556564 |
69e150600b7f88c1f12d565da40cff0d808d813f | 19,810 | py | Python | hisim/postprocessing/postprocessing_main.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/postprocessing/postprocessing_main.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/postprocessing/postprocessing_main.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import sys
import inspect
import subprocess
#import tkinter as tk
import tkinter.filedialog as filedialog
from enum import Enum
#currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
#parentdir = os.path.dirname(currentdir)
#sys.path.insert(0, parentdir)
... | 48.082524 | 170 | 0.585714 |
2a2b937c7ad08222e1d590317318748a85383830 | 4,707 | py | Python | week3/recognize_computer_vision_linear_model.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 12 | 2020-05-25T08:21:25.000Z | 2022-02-22T09:02:00.000Z | week3/recognize_computer_vision_linear_model.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | null | null | null | week3/recognize_computer_vision_linear_model.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 6 | 2020-06-02T11:54:03.000Z | 2022-02-22T09:03:05.000Z | #coding:utf-8
# code for week2,recognize_computer_vision.py
# houchangligong,zhaomingming,20200520,
import torch
from itertools import product
def generate_data():
# 本函数生成0-9,10个数字的图片矩阵
image_data=[]
num_0 = torch.tensor(
[[0,0,1,1,0,0],
[0,1,0,0,1,0],
[0,1,0,0,1,0],
[0,1,0,0,1,0],
[0,0... | 24.904762 | 80 | 0.517952 |
aae0dd7c94b4650a7901fe1100985af9f1b6f0d8 | 2,714 | py | Python | m5-101/content/solutions/equation-solver-1.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:15:38.000Z | 2021-11-10T12:29:19.000Z | m5-101/content/solutions/equation-solver-1.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | null | null | null | m5-101/content/solutions/equation-solver-1.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:18:10.000Z | 2021-04-08T13:44:48.000Z | # -*- coding: utf-8 -*-
'''
Author: Chonghan Chen (paulcccccch@gmail.com)
-----
Last Modified: Thursday, 18th March 2021 3:06:59 pm
Modified By: Chonghan Chen (paulcccccch@gmail.com)
-----
Copyright (c) 2021 IceWould Information Technology Co., Ltd.
'''
import math
#################
### Section 1 ###
#################... | 25.364486 | 69 | 0.498895 |
9311f0e135e8f1a1a39679617a5279a6cbabdb1e | 6,389 | py | Python | chord_rec/main.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/main.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/main.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | import os
import h5py
import random
import numpy as np
import sys
import pickle as pkl
from collections import Counter
from omegaconf import OmegaConf, DictConfig
import torch
from torch.utils.data import DataLoader, Dataset, SubsetRandomSampler, Subset
from torchtext.vocab import Vocab
import pytorch_lightning as ... | 38.257485 | 172 | 0.681953 |
931bd83c0b65336d82ed9bd94afda0a8aac799e1 | 147 | py | Python | hardware/chip/rtl872xd/hal/hal_test/wdg/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | hardware/chip/rtl872xd/hal/hal_test/wdg/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | hardware/chip/rtl872xd/hal/hal_test/wdg/ucube.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | src = Split('''
flash_test.c
''')
component = aos_component('flash_test', src)
component.add_cflags('-Wall')
component.add_cflags('-Werror')
| 16.333333 | 44 | 0.693878 |
93644db0bc0c533c4dc50888405598ba335f2003 | 2,696 | py | Python | src/onegov/feriennet/models/invoice_action.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/models/invoice_action.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/models/invoice_action.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.activity import InvoiceItem
class InvoiceAction(object):
def __init__(self, session, id, action, extend_to=None, text=None):
self.session = session
self.id = id
self.action = action
self.extend_to = extend_to
self.tex... | 28.680851 | 76 | 0.591988 |
facdba18b8e5b53572c63497c07dadf20cb0ab86 | 1,909 | py | Python | build BST.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | build BST.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | build BST.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
class BSTnode:
def __init__(self):
self.val=None
self.left=None
self.right=None
class BST:
def __init__(self):
self.root=BSTnode()
def __str__(self):
#this function print out a tree
print 'root:',self.root.val
self.rec_print(self.root,'')
return ''
def rec_print(self,node,i... | 16.316239 | 39 | 0.671032 |
87e11fca2dc2a7269ece79a929343f4ae8290b4f | 1,368 | py | Python | projects/g3h2-algorithm/practice1/3-quick-sort.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice1/3-quick-sort.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice1/3-quick-sort.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | from random import choice
from time import time
def quick_sort(source: list) -> None:
_quick_sort(source, 0, len(source) - 1)
def _quick_sort(source: list, p: int, r: int) -> None:
if p < r:
q, t = partition(source, p, r)
_quick_sort(source, p, q - 1)
_quick_sort(source, t + 1, r)
... | 23.186441 | 61 | 0.516813 |
356785951900bfe16218d2644cb3ede10c610509 | 350 | py | Python | tmp/analyses/analyse.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | tmp/analyses/analyse.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | tmp/analyses/analyse.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from pathlib import Path
from transonic.analyses.util import print_dumped
from transonic.backends.pythran import make_pythran_code
path_examples = Path("examples")
paths = sorted(path_examples.glob("*.py"))
path = paths[4]
# path = Path("~/Dev/fluidsim/fluidsim/base/time_stepping/pseudo_spect.py")
code = make_py... | 19.444444 | 75 | 0.777143 |
3580c75111a5d2298df95112fe35d55f1f40f164 | 3,243 | py | Python | Miniprojekt och Studio/Mini3/VLE.py | Guziobi/GKT-Projekt | b0d63974fe672380345c83c9882cc782db81b182 | [
"MIT"
] | null | null | null | Miniprojekt och Studio/Mini3/VLE.py | Guziobi/GKT-Projekt | b0d63974fe672380345c83c9882cc782db81b182 | [
"MIT"
] | null | null | null | Miniprojekt och Studio/Mini3/VLE.py | Guziobi/GKT-Projekt | b0d63974fe672380345c83c9882cc782db81b182 | [
"MIT"
] | null | null | null | from math import *
# Beräknar ångtryck med Antoines lag
def antoine(ABC, T):
#ABC = [A, B, C]
P0_i = 10**(ABC[0] - (ABC[1])/(T + ABC[2]))
return P0_i
# Interpolerar mellan två gissnigar och genererar nästa värde
def interpolation(T_n, T_n1, P, P_n, P_n1):
T_n2 = T_n1 + ((P - P_n1) * (T_n - T_n1))/(P... | 23.5 | 105 | 0.575702 |
35e82ef6fd64b6476d77eba4f1214b278bbf3a3a | 471 | py | Python | elements/python/5/14/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/5/14/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/5/14/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def open_doors_naive(n):
state = [0]*n
for i in range(1, n+1):
for door in range(i, n+1, i):
state[door-1] ^= 1
return [i+1 for i, s in enumerate(state) if s == 1]
def open_doors(n):
squares = []
x = 1
s = 1
while s <= n:
squares.append(s)
x += 1
... | 17.444444 | 55 | 0.515924 |
17bbb9257586b1b6f5fc739c0df66a7c3210f56a | 255 | py | Python | Uebung2/Uebung2_Aufgabe5_1_forschleife.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-18T19:10:06.000Z | 2018-04-18T19:10:06.000Z | Uebung2/Uebung2_Aufgabe5_1_forschleife.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | null | null | null | Uebung2/Uebung2_Aufgabe5_1_forschleife.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-29T08:48:00.000Z | 2018-04-29T08:48:00.000Z | # Einlesen des Wertes R
R = float(input("Rate:"))
# Einlesen des Wertes p
p = float(input("Zins:"))
# Einlesen des Wertes n
n = float(input("Perioden:"))
K = 0
zaehler = int(n)
for _ in range(1,zaehler+1):
K = (K + R)*(1+p)
print("Endkapital:",K)
| 15.9375 | 29 | 0.615686 |
52ee4ee3f169f5f7da9e4c60ce2176fe442ecbdd | 50,311 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/mgmt_switch.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/commonapi/controls/mgmt_switch.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/commonapi/controls/mgmt_switch.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.
#!/usr/bin... | 31.152322 | 115 | 0.557532 |
bfee4dcdb603562255dc6b003f8f166d676705cb | 2,534 | py | Python | research/cv/mobilenetv3_large/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/mobilenetv3_large/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/mobilenetv3_large/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.870968 | 106 | 0.712313 |
8705e58f90931b3a6bbad04729d160f027832149 | 12,013 | py | Python | pyROI/old/ROI_video_graph.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 4 | 2017-06-20T19:56:22.000Z | 2021-05-29T10:07:47.000Z | pyROI/old/ROI_video_graph.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 11 | 2017-05-31T19:14:32.000Z | 2018-09-12T23:44:11.000Z | pyROI/old/ROI_video_graph.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 2 | 2017-06-20T17:14:38.000Z | 2017-06-20T19:51:34.000Z | import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy as np
np.set_printoptions(suppress=True) # don't show exponential notation
import os
import subprocess
import sys
import glob
import shutil
import read_roi
class TiffVid:
def __init__(self,folder,clean=False):
print("LOADING TIFF ... | 36.963077 | 108 | 0.532839 |
0d8f850d92ba36b6440a1c06195825e2569b3847 | 212 | py | Python | playbooks/roles/ood-apps-robinhood/files/robinhood/app.py | ltalirz/az-hop | b773628a43b81d7549fee0db48c3c88e96a8f922 | [
"MIT"
] | 17 | 2021-07-13T04:17:08.000Z | 2022-03-01T22:14:43.000Z | playbooks/roles/ood-apps-robinhood/files/robinhood/app.py | ltalirz/az-hop | b773628a43b81d7549fee0db48c3c88e96a8f922 | [
"MIT"
] | 253 | 2021-07-13T07:19:13.000Z | 2022-03-31T07:11:15.000Z | playbooks/roles/ood-apps-robinhood/files/robinhood/app.py | ltalirz/az-hop | b773628a43b81d7549fee0db48c3c88e96a8f922 | [
"MIT"
] | 13 | 2021-07-12T17:39:29.000Z | 2022-03-04T13:29:22.000Z | from flask import Flask, request, redirect
MyApp = Flask(__name__)
@MyApp.route("/")
def index():
return redirect(request.host_url+"rnode/robinhood/80/robinhood")
if __name__ == "__main__":
MyApp.run()
| 21.2 | 68 | 0.712264 |
21b9f86fb9c0482b23034742372b3811f7bc7357 | 3,224 | py | Python | jumeaux/addons/res2res/json_sort.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/res2res/json_sort.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/res2res/json_sort.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
import json
from typing import Any
from owlmixin import OwlMixin, TList, TOption
from jumeaux.addons.res2res import Res2ResExecutor
from jumeaux.utils import exact_match, when_filter
from jumeaux.logger import Logger
from jumeaux.models import Res2ResAddOnPayload, Response
logger: Logger = Lo... | 31.300971 | 98 | 0.5884 |
10f340dde2dc93a20dc49e94b1cfdaac44f7b618 | 346 | py | Python | src/python/py-accepted/118A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/118A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/118A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 118A
# Created on : 2019-01-14 20:55:34
def Main():
vowels = "AOYEUIaoyeui"
s = input().lower()
for let in set(s):
if let in vowels:
s = s.replace(let, '')
elif let.isalpha():
s = s.replace(let, '.' + let)
print(s)
if __name__ ... | 19.222222 | 41 | 0.491329 |
80170bffcd42515d77936c236bd2452b7a00a3f4 | 1,070 | py | Python | basic/19-brownie/Brownie/tests/exchange/test_token.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 634 | 2021-06-28T15:48:19.000Z | 2021-12-19T08:33:57.000Z | basic/19-brownie/Brownie/tests/exchange/test_token.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 73 | 2021-07-04T03:53:57.000Z | 2021-12-18T06:17:13.000Z | basic/19-brownie/Brownie/tests/exchange/test_token.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 263 | 2021-06-28T15:26:56.000Z | 2021-12-19T08:14:37.000Z | from brownie import accounts
def test_initial_state(HAY_token):
assert HAY_token.name() == 'HAYAHEI'
assert HAY_token.symbol() == 'HAY'
assert HAY_token.decimals() == 18
assert HAY_token.totalSupply() == 1000 * 10**18
def test_ERC20(HAY_token):
a0 = accounts[0]
a1 = accounts[1]
assert HA... | 33.4375 | 88 | 0.668224 |
801e655cf2d2c5b6eba44a892f98535daca8361e | 1,312 | py | Python | lego/servertest.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/servertest.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/servertest.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | import asyncio
import json
from calculus.expression import Expression
class EchoServerProtocol(asyncio.Protocol):
def connection_made(self, transport):
peername = transport.get_extra_info('peername')
print('Connection from {}'.format(peername))
self.transport = transport
self.loop... | 27.914894 | 61 | 0.626524 |
896036f4f664fd21fa34d223ef731193816c3629 | 751 | py | Python | apps/password/urls.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/password/urls.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/password/urls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django.urls import path, reverse
from django.contrib.auth import views as auth_views
from django.utils.functional import lazy
reverse_lazy = lazy(reverse, str)
app_name = 'password'
urlpatterns = [
path(
'forget/',
auth_views.PasswordResetView.as_view(
success_url=reverse_lazy('pa... | 30.04 | 90 | 0.673768 |
f6d3a13c168ffc378b330744068fe2f7d120f00a | 612 | py | Python | module/LangConv/__init__.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | module/LangConv/__init__.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | module/LangConv/__init__.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | from .lang_conv import Converter
"""
来自https://raw.githubusercontent.com/skydark/nstools/master/zhtools
的繁简转换代码
"""
def simple2tradition(line):
"""
将简体转换成繁体
"""
line = Converter('zh-hant').convert(line)
return line
def tradition2simple(line):
"""
将繁体转换成简体
"""
line = C... | 21.103448 | 70 | 0.596405 |
1207537653559b153e8a8bce049dd7571ab7b4ea | 6,010 | py | Python | ScanQLi-master/scanqli.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | ScanQLi-master/scanqli.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | ScanQLi-master/scanqli.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python
import function
import requests
import time
import config
from termcolor import colored
import optparse_mooi
import optparse
import validators
import progressbar
import json
from operator import is_not
from functools import partial
import logo
import numpy
import os
try:
import urlparse # Python2... | 38.525641 | 237 | 0.669717 |
d61b02157b8773f2a7d166812ff81a00ad623b12 | 1,407 | py | Python | 08.Graph/Dijkstra2.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 08.Graph/Dijkstra2.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 08.Graph/Dijkstra2.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | # 6 10
# 1 2 2
# 1 3 5
# 1 4 1
# 2 3 3
# 2 4 2
# 3 4 3
# 3 5 1
# 3 6 5
# 4 5 1
# 5 6 2
import sys
N, M = map(int, input().split(" "))
G = [[0]* (N+1) for _ in range(N+1)]
def pprint(arr):
for line in arr:
print(line)
for _ in range(M):
v1, v2, cost = map(int,sys.stdin.readline().split(" "))
G... | 20.691176 | 63 | 0.426439 |
c3dc34630a0057b24ebc8d503cea1df86ffcfec7 | 4,413 | py | Python | Packs/Malware/Scripts/RemoveFileWrapper/RemoveFileWrapper.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-11-02T05:36:38.000Z | 2021-11-02T05:36:38.000Z | Packs/Malware/Scripts/RemoveFileWrapper/RemoveFileWrapper.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/Malware/Scripts/RemoveFileWrapper/RemoveFileWrapper.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | from CommonServerPython import *
import traceback
''' STANDALONE FUNCTION '''
def create_commands(device_ids: List[str], file_path: str, file_hash: str) -> List[CommandRunner.Command]:
"""
Create a list of `Command` of the remove file command to `Cortex XDR` and `CrowdstrikeFalcon`
:param device_ids: d... | 35.878049 | 106 | 0.63041 |
618723df9fb95a150209bc0fc787f41a77f8dbb7 | 1,452 | py | Python | top/clearlight/base/csdn/thread/threading_demo_01.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/csdn/thread/threading_demo_01.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/csdn/thread/threading_demo_01.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import threading
from threading import Thread
import time
'''
Python 3.X threading 模块演示 Demo
threading 的 Thread 类基本使用方式(继承重写 run 方法及直接传递方法)
'''
class NormalThread(Thread):
'''
重写类比 Java 的 Runnable 中 run 方法方式
'''
def __init__(self, name=None):
Thread.__init__(self, name=name)
self.count... | 26.4 | 76 | 0.639118 |
4eeaab78a25285cd96638c4e4848728d0aac53b2 | 3,380 | py | Python | skil/utils/yolo.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | notebooks/tensorflow-yolo/utils.py | pcrete/skil-demo | c0524806f92cecd47bf8c0405ffaf68d4918c52e | [
"MIT"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | notebooks/tensorflow-yolo/utils.py | pcrete/skil-demo | c0524806f92cecd47bf8c0405ffaf68d4918c52e | [
"MIT"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | try:
import cv2
except ImportError:
cv2 = None
COLORS = [
"#6793be", "#990000", "#00ff00", "#ffbcc9", "#ffb9c7", "#fdc6d1",
"#fdc9d3", "#6793be", "#73a4d4", "#9abde0", "#9abde0", "#8fff8f", "#ffcfd8", "#808080", "#808080",
"#ffba00", "#6699ff", "#009933", "#1c1c1c", "#08375f", "#116ebf", "#e61d35",... | 41.219512 | 102 | 0.526036 |
0d1b2337238fa16e8beea6b0042bb7c91dc565c3 | 37 | py | Python | lib/python3.5/posixpath.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/posixpath.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/posixpath.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/posixpath.py | 37 | 37 | 0.810811 |
d378dd3183ebe1734a96a1fdd89a3f1604eeae68 | 4,488 | py | Python | x2paddle/project_convertor/pytorch/torch2paddle/nn_functional.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/project_convertor/pytorch/torch2paddle/nn_functional.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/project_convertor/pytorch/torch2paddle/nn_functional.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.000Z | # 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 appl... | 31.605634 | 80 | 0.616756 |
6c93f774867ccef5300502479b8f8dfdb991d412 | 87 | py | Python | Webpage/jollen/apps.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/jollen/apps.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/jollen/apps.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class jollenConfig(AppConfig):
name = 'jollen'
| 14.5 | 33 | 0.747126 |
4cb2084e35b0a2c4c6785460cac39aa348733736 | 720 | py | Python | Theories/DataStructures/BinaryTree/LowestCommonAncestorBinaryTree/lca_binary_tree.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Theories/DataStructures/BinaryTree/LowestCommonAncestorBinaryTree/lca_binary_tree.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Theories/DataStructures/BinaryTree/LowestCommonAncestorBinaryTree/lca_binary_tree.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
# Recursive O(N), O(N)
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
self.ans = None
def search(cur_node: 'Tr... | 23.225806 | 93 | 0.581944 |
e2599b2cb965f25197276bc64fc73e8248ded50c | 1,287 | py | Python | markdown/etree_loader.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | markdown/etree_loader.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | markdown/etree_loader.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 2,271 | 2015-01-05T14:14:34.000Z | 2022-03-31T02:17:43.000Z |
from markdown import message, CRITICAL
import sys
## Import
def importETree():
"""Import the best implementation of ElementTree, return a module object."""
etree_in_c = None
try: # Is it Python 2.5+ with C implemenation of ElementTree installed?
import xml.etree.cElementTree as etree_in_c
exce... | 37.852941 | 80 | 0.636364 |
e26310b8e115619120c8df9cc7aabb3f06bde1f3 | 1,184 | py | Python | pvtool/routes/_main.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | 1 | 2019-10-31T13:34:12.000Z | 2019-10-31T13:34:12.000Z | pvtool/routes/_main.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | 1 | 2019-05-27T13:03:25.000Z | 2019-05-27T13:03:25.000Z | pvtool/routes/_main.py | schmocker/pv-FHNW | 5066e0bc7ce76be5d1a930b50034c746b232a9f8 | [
"MIT"
] | null | null | null | """Contains home domain and error handlers"""
from flask import Blueprint, render_template, flash, jsonify, request
from urllib.parse import urlparse, urljoin
main_routes = Blueprint('main', __name__, template_folder='templates')
@main_routes.route('/')
def home():
"""render main page"""
return render_templa... | 29.6 | 85 | 0.728885 |
3901a22382e82d597d6c7b37907ba1d37de6e6dd | 2,412 | py | Python | SC101_Assignments/SC101_Assignment5/sierpinski.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment5/sierpinski.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment5/sierpinski.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | """
File: sierpinski.py
Name:
---------------------------
This file recursively prints the Sierpinski triangle on GWindow.
The Sierpinski triangle is a fractal described in 1915 by Waclaw Sierpinski.
It is a self similar structure that occurs at different levels of iterations.
"""
from campy.graphics.gwindow import G... | 31.324675 | 100 | 0.762852 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.