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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5681b5b8ef37b8596f36e166e70e339fe0dd8e7e | 459 | py | Python | scripts/open_cv/sw02_readWebcam.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/open_cv/sw02_readWebcam.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/open_cv/sw02_readWebcam.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | import cv2
# initialisiere WebCam
cam = cv2.VideoCapture(0)
# lese ein Bild von der WebCam
ret, image = cam.read()
ret, image = cam.read()
ret, image = cam.read()
# zeige das Bild an
cv2.imshow("Bild von Webcam,", image)
# konvertiere das Bild in Graustufen
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# zei... | 20.863636 | 68 | 0.723312 |
5693a317d801d21b7e8b2e97e0c71713d76da64d | 3,679 | py | Python | test/test_npu/test_network_ops/test_grid_sampler_3d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_grid_sampler_3d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_grid_sampler_3d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 45.419753 | 103 | 0.689318 |
d91860b649314297441b16c334a3fd50b9f32edc | 30,808 | py | Python | src/rki_covid19csv_parser/csv_parser.py | Hoffmann77/rki-covid19csv-parser | bd1a543e33c341573b4eb3a40c8c5f0181bd17b3 | [
"Apache-2.0"
] | null | null | null | src/rki_covid19csv_parser/csv_parser.py | Hoffmann77/rki-covid19csv-parser | bd1a543e33c341573b4eb3a40c8c5f0181bd17b3 | [
"Apache-2.0"
] | null | null | null | src/rki_covid19csv_parser/csv_parser.py | Hoffmann77/rki-covid19csv-parser | bd1a543e33c341573b4eb3a40c8c5f0181bd17b3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 8 20:25:55 2021
@author: Julius Hoffmann
"""
#Import required modules
import csv
import numpy as np
import datetime
import dateutil.parser as parser
import os
#Constanst
_AGE_GROUPS = {'A00-A04': 0, 'A05-A14': 1, 'A1... | 39.446863 | 168 | 0.554239 |
79d8dd8e9ae15f4db109295d202e81dfe43e28f0 | 4,850 | py | Python | S3cr3t/S3cr3t_client.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | S3cr3t/S3cr3t_client.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | S3cr3t/S3cr3t_client.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python2
#-*- coding:utf-8 -*-
import os
import time
import platform
import socket
import sys
import select
import logging
import readline
banner = '''
\033[1;96m
██████ ▓█████ ▄████▄ ██▀███ ▓█████▄▄▄█████▓
▒██ ▒ ▓█ ▀ ▒██▀ ▀█ ▓██ ▒ ██▒▓█ ▀▓ ██▒ ▓▒
░ ▓██▄ ▒███ ▒▓█ ▄ ▓██ ░▄█ ▒▒███ ▒ ▓██... | 32.550336 | 94 | 0.488866 |
30a48fe46ea5358de3cab34464378cc6f9d5b962 | 3,195 | py | Python | pyScript/custom_src/FlowStylusModesWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/FlowStylusModesWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/FlowStylusModesWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QWidget, QPushButton, QHBoxLayout
class FlowStylusModesWidget(QWidget):
def __init__(self, flow):
super(FlowStylusModesWidget, self).__init__()
self.flow = flow
self.set_stylus_mode_comment_button = QPushButton('comment')
self.set_stylus_mode_comment... | 33.989362 | 91 | 0.599687 |
ebaced977c40ad341b3daf69fcef829c9ff27d51 | 264 | py | Python | src/python/py-accepted/110A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/110A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/110A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 110A
# Created on : 2019-01-15 20:50:10
def Main():
s = input()
t = sum([s.count(str(x)) for x in [4, 7]])
if t is 4 or t is 7:
print("YES")
return
print("NO")
if __name__ == '__main__':
Main()
| 14.666667 | 46 | 0.492424 |
691806cdb05735842cd6aa8c8f60743807a3d8c5 | 261 | py | Python | exercises/es/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Importa la clase de lenguaje "German"
from spacy.lang.de import German
# Crea el objeto nlp
nlp = German()
# Procesa un texto (aquí dice "Saludos cordiales!" en alemán)
doc = nlp("Liebe Grüße!")
# Imprime en pantalla el texto del documento
print(doc.text)
| 21.75 | 61 | 0.731801 |
d676eebb4b1189dd89845eff3d9a0a3324506829 | 440 | py | Python | HackerRank/30-Days-of-Code/Day 26: Nested Logic/nested_logic.py | tareqmahmud/Competitive-Programming | ad5e53300d70280bccbd5046ca01278fb246f314 | [
"MIT"
] | 2 | 2020-11-19T19:03:28.000Z | 2021-01-04T19:52:11.000Z | 30-Days-of-Code/Day 26: Nested Logic/nested_logic.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | 30-Days-of-Code/Day 26: Nested Logic/nested_logic.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | d_actual, m_actual, y_actual = map(int, input().strip().split())
d_expected, m_expected, y_expected = map(int, input().strip().split())
fine = 0
if y_actual == y_expected and m_actual == m_expected and d_expected < d_actual:
fine = 15 * (d_actual - d_expected)
elif y_actual == y_expected and m_expected < m_actual... | 27.5 | 79 | 0.690909 |
d6c03fc26a1e2aa62d5595b4e10c172a65fe41df | 740 | py | Python | leetcode/298-Binary-Tree-Longest-Consecutive-Sequence/BinTreeLgstConsSeq_recursive.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/298-Binary-Tree-Longest-Consecutive-Sequence/BinTreeLgstConsSeq_recursive.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/298-Binary-Tree-Longest-Consecutive-Sequence/BinTreeLgstConsSeq_recursive.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def longestConsecutive(self, root):
"""
:type root: TreeNode
:rtype: int
"""
def... | 28.461538 | 67 | 0.531081 |
ebf49dcff127c6c8d52aa45f78d97a9a0df9df24 | 3,227 | py | Python | 2019/finals/crypto-ofidiologist/solve/solve.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/finals/crypto-ofidiologist/solve/solve.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/finals/crypto-ofidiologist/solve/solve.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/env python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 26.891667 | 74 | 0.670282 |
002e552d487bc2144ac992877e2348b4c7eda607 | 265 | py | Python | frds/measures/bank.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/measures/bank.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/measures/bank.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | from .func_absorption_ratio import absorption_ratio
from .func_dip import distress_insurance_premium
from .func_mes import marginal_expected_shortfall
from .func_ses import systemic_expected_shortfall
from .func_cca import cca
from .func_bank_z_score import z_score | 44.166667 | 51 | 0.890566 |
aeb897d2f3b39dedc871f45fb87290ab9eef531c | 303 | py | Python | jumeaux/addons/store_criterion/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/store_criterion/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/store_criterion/__init__.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
from jumeaux.models import StoreCriterionAddOnPayload, StoreCriterionAddOnReference
class StoreCriterionExecutor:
def exec(self, payload: StoreCriterionAddOnPayload, reference: StoreCriterionAddOnReference) -> StoreCriterionAddOnPayload:
raise NotImplementedError()
| 37.875 | 127 | 0.808581 |
9d8d66578b46334ac651c4bb45aba255c558c3b4 | 34 | py | Python | 5_ifElse/1_if.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 5_ifElse/1_if.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 5_ifElse/1_if.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Bedingungen
Keine Lösung
"""
| 5.666667 | 12 | 0.647059 |
d189056b0c45ed9a12e2bfd6a67fbd0cbde03653 | 3,368 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/rename_prevdoc_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/rename_prevdoc_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/rename_prevdoc_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
import json
from frappe.model.utils.rename_field import update_reports, rename_field, update_property_setters
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
def execute():
frappe.reload_doctype('Purchase Order Item')
frappe.reload_doctype('Purchase Receipt Item')... | 44.315789 | 133 | 0.772862 |
ee28352484f5d3d998c5d2d047f1f3d94b9f6762 | 473 | py | Python | cpp_tutorial/cpp_prime_plus/remove.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | cpp_tutorial/cpp_prime_plus/remove.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | cpp_tutorial/cpp_prime_plus/remove.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import os
import shutil
import re
for folder, subfolders, filenames in os.walk('.'):
for subfolder in subfolders:
if subfolder in ['Debug', 'x64']:
# Debug 폴더는 제거
shutil.rmtree(os.path.join(folder, subfolder))
for filename in filenames:
pattern = '.*\.vcxproj.*'
... | 27.823529 | 58 | 0.585624 |
c9cdec285ce4c32f72f0f3fe168cf456d2af3395 | 8,004 | py | Python | Aufgaben/abgabe2/neuronalNetworkLayer.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/neuronalNetworkLayer.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/neuronalNetworkLayer.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | __authors__ = "Rosario Allegro (1813064), Sedat Cakici (1713179), Joshua Joost (1626034)"
# maintainer = who fixes buggs?
__maintainer = __authors__
__date__ = "2020-05-01"
__version__ = "1.0"
__status__ = "Ready"
# kernel imports
import numpy as np
# own data imports
from neuron import neuron
from ownFunctions impo... | 32.938272 | 205 | 0.653798 |
4e70b37e639343c7dcb4014cbd066febe436580a | 1,241 | py | Python | src/visitpy/visit_flow/flow/src/core/log.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/src/core/log.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/src/core/log.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: logs.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 3/24/2012
description:
... | 25.854167 | 73 | 0.665592 |
eeea4e8b51693fad8b00a5618e2b75d22eba6b84 | 828 | py | Python | marsyas-vamp/marsyas/src/swig/python/test.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/swig/python/test.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/swig/python/test.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from marsyas import MarSystemManager,MarControlPtr
msm = MarSystemManager()
file = msm.create("SoundFileSource","file")
sink = msm.create("AudioSink","sink")
gain = msm.create("Gain", "gain")
pipe = msm.create("Series","pipe")
pipe.addMarSystem(file)
pipe.addMarSystem(gain)
pipe.addMarSystem(s... | 25.875 | 70 | 0.753623 |
0126a977cdde5908b22fe636a9c52935e50c3301 | 130 | py | Python | book/_build/jupyter_execute/docs/1004_Risiken_und_Nutzen_bei_der_Verwendung_saurer_und_alkalischer_Loesungen.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | book/_build/jupyter_execute/docs/1004_Risiken_und_Nutzen_bei_der_Verwendung_saurer_und_alkalischer_Loesungen.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | book/_build/jupyter_execute/docs/1004_Risiken_und_Nutzen_bei_der_Verwendung_saurer_und_alkalischer_Loesungen.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # 1004_Risiken und Nutzen bei der Verwendung saurer und alkalischer Lösungen
#
# **8h**
| 18.571429 | 78 | 0.707692 |
6d9f00e04bd384227ae48ed7ed140eeae8317ed8 | 45 | py | Python | dcapy/console/__init__.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | dcapy/console/__init__.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | dcapy/console/__init__.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | from .console import console, schedule_layout | 45 | 45 | 0.866667 |
6dda82884b7d5a59497992a12048cc672dc09402 | 686 | py | Python | solution/divide_and_conquer/1802/main.py | gkgg123/baekjoon | 4ff8a1238a5809e4958258b5f2eeab7b22105ce9 | [
"MIT"
] | 2,236 | 2019-08-05T00:36:59.000Z | 2022-03-31T16:03:53.000Z | solution/divide_and_conquer/1802/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 225 | 2020-12-17T10:20:45.000Z | 2022-01-05T17:44:16.000Z | solution/divide_and_conquer/1802/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 602 | 2019-08-05T00:46:25.000Z | 2022-03-31T13:38:23.000Z | # // Authored by : chj3748
# // Co-authored by : -
# // Link : http://boj.kr/28603d67d3014c79af724768c75865af
import sys
def input():
return sys.stdin.readline().rstrip()
def origami(start, end):
if start == end:
return True
mid = (start + end) // 2
sign = True
for i in range(start,mid):
... | 23.655172 | 64 | 0.555394 |
09cdae496988f47b7f368ee517368cacac3dfb98 | 3,722 | py | Python | python/sql_alchemy/create_models.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/sql_alchemy/create_models.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/sql_alchemy/create_models.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine, Column, ForeignKey
from sqlalchemy.types import Integer, Text, String, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column... | 30.508197 | 101 | 0.666846 |
114e10fc7bd211282ad955843a8cbba78d48e55e | 1,044 | py | Python | python/course/leetcode/58. Length of Last Word.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/course/leetcode/58. Length of Last Word.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/course/leetcode/58. Length of Last Word.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time:2020/6/29 18:52
# @Author:TimVan
# @File:53. Maximum Subarray.py
# @Software:PyCharm
# 58. Length of Last Word
# Given a string s consists of upper/lower-case alphabets and empty space characters ' ',
# return the length of last word
# (last word means the last appearing word if we loop... | 23.2 | 89 | 0.608238 |
e91fdba8ff3059726ad15c45b5bd23b3e441bb6d | 450 | py | Python | Rangoli_py/hexagonrangoli.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | Rangoli_py/hexagonrangoli.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | Rangoli_py/hexagonrangoli.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | 1 | 2020-09-30T18:53:05.000Z | 2020-09-30T18:53:05.000Z | from turtle import *
from random import randint
bgcolor('black')
red=[210,0,0,255,255,255]
green=[0,128,0,128,255,255]
blue=[0,128,128,0,0,255]
#m=int(input("Enter the size "))
#s=int(input("Enter the speed "))
x=j=10
speed(200)#put s instead of 200 for custom speed
pensize(5)#put m for custom size
... | 18 | 53 | 0.606667 |
3ae0c705e64c6973494dc5956b7daeab6b746368 | 2,257 | py | Python | bindings/python/ensmallen/datasets/monarchinitiative.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/datasets/monarchinitiative.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/datasets/monarchinitiative.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | """Module providing graphs available from MonarchInitiative.
References
----------
Please cite:
```bib
@article{mungall2017monarch,
title={The Monarch Initiative: an integrative data and analytic platform connecting phenotypes to genotypes across species},
author={Mungall, Christopher J and McMurry, Julie A and K... | 30.093333 | 224 | 0.677891 |
286721154b4f73e7ca5593a05187a6a8c4b81d69 | 1,680 | py | Python | src/onegov/translator_directory/forms/settings.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/forms/settings.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/forms/settings.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cgi import FieldStorage
from io import BytesIO
from onegov.form import Form
from onegov.form.fields import UploadField
from onegov.form.validators import WhitelistedMimeType
from onegov.gis import CoordinatesField
from onegov.translator_directory import _
ALLOWED_MIME_TYPES = {
'application/excel',
'app... | 32.307692 | 77 | 0.679167 |
2885198eb343d6d81b5d9c8035ce718f92efe33a | 1,044 | py | Python | IS201/Fermat.py | czx99/my_IScourse | 24a63c6a1874a89df1e48fe558df37e2fa777083 | [
"MIT"
] | 2 | 2020-10-29T16:25:37.000Z | 2020-11-22T11:19:19.000Z | IS201/Fermat.py | Snowfall99/my_IScourse | 24a63c6a1874a89df1e48fe558df37e2fa777083 | [
"MIT"
] | null | null | null | IS201/Fermat.py | Snowfall99/my_IScourse | 24a63c6a1874a89df1e48fe558df37e2fa777083 | [
"MIT"
] | 1 | 2020-09-17T14:36:23.000Z | 2020-09-17T14:36:23.000Z | import math
import random
def relatively_prime(a, b): # a > b
while b != 0:
temp = b
b = a % b
a = temp
if a == 1:
return True
else:
return False
def Fermat(num):
flag = True
TestList = []
for i in range(30):
# 产生一个整数b,满足(b,num)=1
b = ... | 18.315789 | 66 | 0.468391 |
95b71eff8a0296c19156ff131c068c121e9bf8c4 | 1,154 | py | Python | GroupMonitorForFF/utils.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | GroupMonitorForFF/utils.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | GroupMonitorForFF/utils.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | # -*-coding=utf8-*-
import configparser
import time
import os
def get_date():
return time.strftime('%Y%m%d', time.localtime(time.time()))
def get_timestamp():
return time.strftime('%Y%m%d_%H%M%S', time.localtime(time.time()))
def get_config(file='./config.ini'):
settings = {}
cp = configparser.Config... | 33.941176 | 93 | 0.620451 |
c2e8907c2df1cb99551e21557257ed1a2b1c468c | 6,298 | py | Python | aecb/api/migrations/0001_initial.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/migrations/0001_initial.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/migrations/0001_initial.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-17 04:05
import aecb.api.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
... | 48.821705 | 157 | 0.57161 |
66f0a0ca5a107e1c520a56055d53af322e9b09e7 | 3,016 | py | Python | stock/Stock.py | mamenglong/StockFund | e80d8a185c37023c3e7849a1b7b03d81a165af6f | [
"Apache-2.0"
] | null | null | null | stock/Stock.py | mamenglong/StockFund | e80d8a185c37023c3e7849a1b7b03d81a165af6f | [
"Apache-2.0"
] | null | null | null | stock/Stock.py | mamenglong/StockFund | e80d8a185c37023c3e7849a1b7b03d81a165af6f | [
"Apache-2.0"
] | null | null | null | import datetime
import random
import threading
import time
import requests
from stock.SinaStock import SinaStock
from stock.StockInterface import StockInterface
class Stock(StockInterface):
def __init__(self, stockSource, ua):
self.headers = {
'authority': 'ec.snssdk.com',
'User-... | 35.904762 | 115 | 0.56134 |
dd832012e22423d5b0e7d1a6131823fe8eb40a24 | 9,085 | py | Python | test/test_npu/test_network_ops/test_index_fill_d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_index_fill_d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_index_fill_d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 48.844086 | 100 | 0.542763 |
06da38c17f8bccb5bb0ba67a1d1ceddb2a3a3386 | 581 | py | Python | v703/python/nachentladung.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v703/python/nachentladung.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v703/python/nachentladung.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
from uncertainties import ufloat
from scipy.stats import sem
import uncertainties.unumpy as unp
u, te = np.genfromtxt('python/daten/nachentladung.txt', unpack=True)
te = te*10**(-3)
temean = np.mean(te)
tesem = sem(te)
tem = ufloat(temean, tesem)
print('tem', tem)
te = te/u
temean = np.mean(te)
te... | 22.346154 | 68 | 0.681583 |
bbf26629e2902c0ff158067b663b018bef9a8f64 | 5,018 | py | Python | python/GenVariablesFile.py | Greakz/mdh-cmake-cubevis | 6c64ec0e14dcdd07e69fa1f018aa7954eeeaf173 | [
"MIT"
] | null | null | null | python/GenVariablesFile.py | Greakz/mdh-cmake-cubevis | 6c64ec0e14dcdd07e69fa1f018aa7954eeeaf173 | [
"MIT"
] | 5 | 2021-08-24T11:09:54.000Z | 2021-08-24T21:14:15.000Z | python/GenVariablesFile.py | Greakz/mdh-cmake-cubevis | 6c64ec0e14dcdd07e69fa1f018aa7954eeeaf173 | [
"MIT"
] | null | null | null | from Expression import Expression
from Whitespace import ws
class VariablesFileGenerator:
@staticmethod
def generate(data):
mdh_variable_template_file = open("./src/mdhconfig/include/gen_templates/gen_mdh_variables.template.h", "r")
raw_template = mdh_variable_template_file.read()
mdh... | 43.258621 | 116 | 0.603428 |
a5579f15b904994e2bc7ece20a6dfb1e47b1aaa6 | 20,465 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/pvoc.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/pvoc.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/pvoc.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from pylab import *
import os
import sys
from marsyas import MarSystemManager,MarControlPtr
def multires(infile):
print "MultiResolution phasevocoding for " + infile
# Build the processing network
mng = MarSystemManager()
pvseries = mng.create("Series", "pvseries")
pvseries.addMarSyste... | 38.252336 | 96 | 0.769411 |
0547442f4dfeb1b7c9c815d1b54bc5f17519aa57 | 621 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/02aluno/aluno.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/02aluno/aluno.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/02aluno/aluno.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | # ex: aluno nome, nota,
# media e total
# App 4 notas
class Aluno:
def __init__(self, nome, nota):
self.nome = nome
self.nota = nota
def total(self, nota):
self.nota += nota
def resultado(self):
resultado = self.nota / 4
if resultado >= 6:
... | 27 | 86 | 0.545894 |
0576e2b32cf70c9ba392d8918fde993bb946921b | 6,882 | py | Python | Packs/QSS/Integrations/QSS/QSS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/QSS/Integrations/QSS/QSS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/QSS/Integrations/QSS/QSS.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 * # noqa: F401
import json
import urllib3
import traceback
from typing import Any, Dict, Tuple, List, Optional, cast
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
MAX_INCIDENT... | 30.317181 | 105 | 0.614211 |
75f43a7b31af68578b09eff03ed619b39f64ec64 | 532 | py | Python | python/decorator/real_world_example.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/real_world_example.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/real_world_example.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import time
from functools import wraps
def timer(func):
@wraps(func)
def wrapper(*args, **kwargs):
start_time = time.perf_counter()
value = func(*args, **kwargs)
end_time = time.perf_counter()
run_time = end_time - start_time
print(f'Finised {repr(func.__name__)} in {r... | 22.166667 | 65 | 0.640977 |
f9afbb11f678d0ebe8a6e152e8f1ffc31a695f46 | 5,818 | py | Python | research/cv/faceboxes/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/faceboxes/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/faceboxes/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.124138 | 99 | 0.575455 |
9baebde550fb37a4680f281535df28c47f044472 | 536 | py | Python | musterloesungen/3.1/vergleich.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/3.1/vergleich.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/3.1/vergleich.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kurs: Python: Grundlagen der Programmierung für Nicht-Informatiker
# Semester: Herbstsemester 2018
# Homepage: http://accaputo.ch/kurs/python-uzh-hs-2018/
# Author: Giuseppe Accaputo
# Aufgabe: 3.1
import math
def vergleich(a,b):
if a > b:
print("Erste ... | 26.8 | 76 | 0.647388 |
32cf44d785772e16516bda22cb0dbbe91631cad6 | 3,368 | py | Python | examples/myqueryset/simplerelate/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/myqueryset/simplerelate/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/myqueryset/simplerelate/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.test import TestCase, TransactionTestCase
from .models import Article, Tag, Publication, Author
# Create your tests here.
class SimpleTest(TransactionTestCase):
reset_sequences = True
def test_a_select_relate(self):
# 准备数据
publication_1 = Publication.objects.create(title="Python ... | 49.529412 | 180 | 0.671318 |
fd02d0442ece6685668f87b88ab6c29867a5eb62 | 659 | py | Python | 数据结构/NowCode/35_isSymmetrical.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/35_isSymmetrical.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/35_isSymmetrical.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def isSymmetrical(self, pRoot):
if pRoot == None:
return True
def isMirror(left, right):
if left == None and right == None:
ret... | 28.652174 | 51 | 0.52352 |
9500a264f356d4590b452b95a7a1796e021b9703 | 3,784 | py | Python | tests/onegov/wtfs/test_views_daily_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_daily_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_daily_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from freezegun import freeze_time
from onegov.core.request import CoreRequest
from unittest.mock import patch
from webtest.forms import Upload
def test_views_daily_job(client):
# Add a municipality with dates
client.login_admin()
add = client.get('/municipalities').click(href='/add')
add.form['name']... | 35.037037 | 78 | 0.65592 |
952e4347b99f4255ba149b1baf603f03ba87fe62 | 8,661 | py | Python | projects/g3h1-cp-fml-interpreter/src/semantic/semantic.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/semantic/semantic.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/semantic/semantic.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | from enum import Enum, unique
from fml_parser import Terminals, NonTerminals
from math import sin, cos, tan, sqrt, exp, log, pi, e
class Semantic(object):
def __init__(self, grammar_tree):
self.grammar_tree = grammar_tree
self.operation_queue = []
self.analyse(self.grammar_tree)
def g... | 41.84058 | 114 | 0.527537 |
c834199ad52a31a4d7e0a73c46684f2c07ca295f | 3,690 | py | Python | evo_algorithm/ea_shapes/spamming.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | evo_algorithm/ea_shapes/spamming.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | evo_algorithm/ea_shapes/spamming.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | #!/usr/bin/env python3
"""
This approach draws random shapes onto a black surface. After every drawing step, the picture is sent to the API and
classified. Once the API returns a high enough confidence value, the image is saved under the prediced class's name.
The method will pretty much always find an answer, though t... | 30.245902 | 118 | 0.677507 |
9e5462bfbefe22fe0553974877e55eb1695875d7 | 1,940 | py | Python | app/models/abtms/BankingBillet.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/abtms/BankingBillet.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/abtms/BankingBillet.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z | # Class BankingBillet
# It is resposable for:
# Save banking billets on database
from app.models.auth.DatabaseFactory import DatabaseFactory
class BankingBillet():
def __init__(self, created_at="", value="0", cpf="", charge_id="", expire_at=""):
self.created_at = created_at
self.value = value
... | 30.793651 | 145 | 0.587629 |
cdcd9ce9a80a79d83fe10d1ad313587d931b3b55 | 1,204 | py | Python | ppyt/rules/conditions/breakout_conditions.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 4 | 2016-08-16T07:47:15.000Z | 2017-12-11T10:08:47.000Z | ppyt/rules/conditions/breakout_conditions.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | null | null | null | ppyt/rules/conditions/breakout_conditions.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 2 | 2018-06-15T04:43:15.000Z | 2020-05-02T07:47:15.000Z | # coding: utf-8
import logging
from ppyt.rules.conditions import ConditionBase
from ppyt.indicators.breakout_indicators import (
UpperBreakoutIndicator, LowerBreakoutIndicator
)
logger = logging.getLogger(__name__)
class BreakoutCondition(ConditionBase):
"""ブレイクアウトしたかを判定します。"""
_findkey = 'Breakout'
... | 25.083333 | 53 | 0.654485 |
b55a3b65715765c769a31d980f97704e6508805b | 2,008 | py | Python | creating_question_set.py | RAJVARDHAN123/Kbc-Game | 774f955dc57998fbdea2422eb6b166a141b20e6f | [
"MIT"
] | 1 | 2019-01-23T08:12:20.000Z | 2019-01-23T08:12:20.000Z | creating_question_set.py | RAJVARDHAN123/Kbc-Game | 774f955dc57998fbdea2422eb6b166a141b20e6f | [
"MIT"
] | null | null | null | creating_question_set.py | RAJVARDHAN123/Kbc-Game | 774f955dc57998fbdea2422eb6b166a141b20e6f | [
"MIT"
] | 6 | 2020-05-22T17:37:18.000Z | 2022-03-27T10:16:35.000Z | import json
questions = {}
questions['data'] = []
questions['data'].append({
'question':'Q1.Which son was most loved by Sumitra?',
'answer':'''A) Laxman and Shatrughan
B) Ram
C) Laxman
D) All four brothers'''
})
questions['data'].append({
'question':'Q2.Who built the famous Shalimar bagh of Srinagar?',
'answer':'''A... | 22.065934 | 135 | 0.692729 |
b57533b93b12a661e4d059571fd3b73ce18c7bf0 | 344 | py | Python | Project Euler Questions 31 - 40/Project Euler Question 31.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 31 - 40/Project Euler Question 31.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 31 - 40/Project Euler Question 31.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 31
#Coin sums
def coin_comb(money):
coins = [1, 2, 5, 10, 20, 50, 100, 200]
ways = [1] + ([0] * money)
for coin in coins:
for i in range(coin, (money + 1)):
ways[i] += ways[(i - coin)]
#print (ways)
return ways[money]
print (coin_comb(200), "is the ... | 24.571429 | 55 | 0.561047 |
fdc9ced9f2b826c3e11a580b0bd66688eb438e93 | 5,107 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/hashserv/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/hashserv/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/hashserv/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) 2018 Garmin Ltd.
#
# SPDX-License-Identifier: GPL-2.0-only
#
from http.server import BaseHTTPRequestHandler, HTTPServer
import contextlib
import urllib.parse
import sqlite3
import json
import traceback
import logging
from datetime import datetime
logger = logging.getLogger('hashserv')
class HashEquiv... | 35.713287 | 153 | 0.510867 |
fdfc9c11feedc483a2ade18493918720e3867f9a | 739 | py | Python | src/test/test_datasets.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/test/test_datasets.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/test/test_datasets.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null | import pytest
from datasets.washington import Washington
from datasets.divahisdb import HisDBDataset
import json
import os
from pathlib import Path
import numpy as np
config = json.load(open(os.path.expanduser("~/.thesis.conf")))
db_folder = Path(config['datasets'])
def getdatasetpath(name):
folder = db_folder... | 21.114286 | 62 | 0.729364 |
ef8789fe190882e2fd9f26037c69c8b7bff494d5 | 1,923 | py | Python | helperScripts/removeFilesFromDataset.py | thorstenMueller/deep-learning-german-tts | 122171331493c0254032b97be899ee557b00eb42 | [
"CC0-1.0"
] | 189 | 2019-11-01T15:11:10.000Z | 2022-03-23T09:13:24.000Z | helperScripts/removeFilesFromDataset.py | wildone/deep-learning-german-tts | c35507b1f769c93f07c255554343475b8edc62e3 | [
"CC0-1.0"
] | 28 | 2020-01-09T19:23:11.000Z | 2022-03-21T16:37:25.000Z | helperScripts/removeFilesFromDataset.py | wildone/deep-learning-german-tts | c35507b1f769c93f07c255554343475b8edc62e3 | [
"CC0-1.0"
] | 15 | 2020-05-12T13:47:20.000Z | 2022-02-15T01:46:46.000Z | # This script removes recordings from an ljspeech file/directory structured dataset based on CSV file from "getDatasetSpeechRate"
# Writte by Thorsten Müller (deep-learning-german@gmx.net) and provided without any warranty.
# https://github.com/thorstenMueller/deep-learning-german-tts/
# https://twitter.com/ThorstenVoi... | 39.244898 | 129 | 0.679667 |
effc24b0c424ac310fb9282c216d597ea2d052cd | 585 | py | Python | exercises/pt/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("pt")
# Processar o texto
doc = nlp(
"Em 1990, mais de 60% da população da Ásia Oriental estava em situação de extrema pobreza."
"Agora, menos de 4% está nessa situação."
)
# Iterar os tokens de um documento doc
for token in doc:
# Checar se o token é composto por algarism... | 29.25 | 95 | 0.65812 |
ef4d0bb9e1c149cd6e6ec69fa354579c55c5755f | 866 | pyde | Python | sketches/newtonfractal/newtonfractal.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/newtonfractal/newtonfractal.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/newtonfractal/newtonfractal.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | xa = -1.0
xb = 1.0
ya = -1.0
yb = 1.0
maxIt = 20
h = 1e-6
eps = 1e-3
def setup():
size(512, 512)
this.surface.setTitle("Newton Fractal")
noLoop()
def draw():
img = createImage(width, height, RGB)
img.loadPixels()
for y in range(height):
zy = y*(yb - ya)/(height - 1) + ya
for x... | 23.405405 | 74 | 0.444573 |
ef6724dec3d84c9ffd7a3d4285c13041d5d3e2e4 | 1,014 | py | Python | CodeChef_problems/CHEFK1/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | CodeChef_problems/CHEFK1/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | CodeChef_problems/CHEFK1/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #Question Link
#https://www.codechef.com/problems/CHEFK1
t=int(input())
import math
for tc in range(t):
n,m=map(int,input().split())
maxp=(n*(n+1))//2
maxm=(n*(n-1))//2
if n==1 and m==0: #corner cases
print(0)
elif n==1 and m==1: #corner cases
print(1)
elif n==1 and (m>1): #cor... | 24.142857 | 67 | 0.461538 |
0894e8c9e4b299b8a4ccd0176277ce434fb0ba23 | 1,381 | py | Python | python/en/archive/practice_python/practice_python-exercise06-String Lists.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/practice_python/practice_python-exercise06-String Lists.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/practice_python/practice_python-exercise06-String Lists.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
2018-10-25 (Thu)
PRACTICE PYTHON, https://www.practicepython.org/
Exercise 6. String Lists
https://www.practicepython.org/exercise/2014/03/12/06-string-lists.html
Ask the user for a string and print out whether this string is a palindrome or
not. (A palindrome is a string that re... | 28.183673 | 82 | 0.692252 |
08a86cd759cbb3371506949b128d73f3d854abf6 | 2,892 | py | Python | tests/rbac/common/task/create_task_helper.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | tests/rbac/common/task/create_task_helper.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2018-09-10T19:12:31.000Z | 2018-09-10T19:12:31.000Z | tests/rbac/common/task/create_task_helper.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 32.133333 | 86 | 0.651107 |
de36066f7ca20da1dd624d1ed4c9e179070cef1d | 7,395 | py | Python | Packs/LogsignSiem/Integrations/LogsignSiem/test_data/sample_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/LogsignSiem/Integrations/LogsignSiem/test_data/sample_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/LogsignSiem/Integrations/LogsignSiem/test_data/sample_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | DATE_FORMAT: str = '%Y-%m-%dT%H:%M:%SZ' # ISO8601 format with UTC, default in XSOAR
DATE_FORMAT_WITH_MICROSECOND = '%Y-%m-%dT%H:%M:%S.%fZ'
DEFAULT_FETCH_LIMIT = '50'
DEFAULT_FIRST_FETCH = '1 hour'
CONTENT_TYPE_JSON = 'application/json'
URL_SUFFIX = {
'FETCH_INCIDENTS': 'get_incidents',
'GET_COLUMN': 'get_colu... | 30.183673 | 99 | 0.386207 |
9d49dbe577fdc05725f56fbc48b9b84137c5e8dd | 229 | py | Python | Scripts/joseph.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 8 | 2020-10-26T06:51:06.000Z | 2021-04-02T13:01:27.000Z | Scripts/joseph.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 71 | 2020-10-25T22:46:02.000Z | 2021-10-14T06:47:39.000Z | Scripts/joseph.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 77 | 2020-10-24T01:53:46.000Z | 2021-10-01T06:25:27.000Z | from os import listdir
from os.path import isfile, join
mypath = "./"
onlyfiles = [f.split(".")[0] for f in listdir(mypath) if isfile(join(mypath, f))]
for fname in onlyfiles:
print(f"Hello, {fname}!")
print("Hello World!")
| 25.444444 | 81 | 0.676856 |
a072061fb138794582a13dc0e0c076701b465bf0 | 2,331 | py | Python | sensors/sensor_bme280.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | sensors/sensor_bme280.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | sensors/sensor_bme280.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | # coding: utf-8
from logging import error, info
import smbus2
import bme280
from tentacle.measurement import Measurement
from tentacle.unit import Temperature, Relative_Humidity, Pressure
from tentacle.capability import Capability
from tentacle.sensor import Sensor
import warnings
def discover(port=1, address=0x... | 29.1375 | 147 | 0.614758 |
3e66ab2eb7d4481aa77f987419b7fabafa91b86a | 1,002 | py | Python | backend/models/queue.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 10 | 2020-03-20T19:14:43.000Z | 2020-10-29T21:31:40.000Z | backend/models/queue.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 41 | 2020-03-20T20:27:55.000Z | 2020-03-24T21:49:37.000Z | backend/models/queue.py | methodpark/digitaleswarten | 024c0b88df54e9727925b202e139b3c5b2ce73d6 | [
"Apache-2.0"
] | 1 | 2020-03-21T09:31:51.000Z | 2020-03-21T09:31:51.000Z | from flask import abort
from sqlalchemy.exc import IntegrityError
from app import db
from utils.id_generator import generate_queue_id
class Queue(db.Model):
id = db.Column(db.String, primary_key=True)
name = db.Column(db.String)
place_id = db.Column(db.String, db.ForeignKey('place.id'), primary_key=True)
... | 27.081081 | 80 | 0.632735 |
e4618cdc5345cf2a7991cf782aafd061a94c4bc4 | 5,853 | py | Python | python-bildungslogin/src/univention/bildungslogin/license_retrieval/cmd_license_retrieval.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/src/univention/bildungslogin/license_retrieval/cmd_license_retrieval.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/src/univention/bildungslogin/license_retrieval/cmd_license_retrieval.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2022 Univention GmbH
#
# http://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions o... | 39.02 | 116 | 0.686827 |
398eea2d3d3fade9c3c7353f9d7f8d5c848cde8a | 492 | py | Python | ListenUp/core/background.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | ListenUp/core/background.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | ListenUp/core/background.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | import threading
from threading import RLock
import requests
from util.oop import override
lock = threading.RLock() # type: RLock
@override(requests)
def request(_super, method, url, **kwargs):
# NOT WORKING
"""Only allow request when lock is free."""
print('waiting to request {}'.format... | 23.428571 | 48 | 0.650407 |
f26f1cf5692ca5b698aa04f6ae1f7dcf8858e2a4 | 460 | py | Python | src/python/py-stuff/m.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-stuff/m.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-stuff/m.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/python
from pathlib import Path
import os.path
# can do ""macros""
p = print
r = range
for i in r(10):
p(i)
fname = 'new'
if (os.path.isfile(fname)):
print('yes, %s is a file' % (fname))
else:
print('no, %s is not a file' % (fname))
f = Path("new")
if f.is_file():
print ('is file')
if f... | 13.142857 | 43 | 0.563043 |
f2c2b482e0f8f8d9b3ec17f43a6ec239fc7deece | 2,161 | py | Python | tests/onegov/town6/test_homepage_widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/town6/test_homepage_widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/town6/test_homepage_widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import scan_morepath_modules
from onegov.core.widgets import transform_structure
from onegov.town6 import TownApp
def test_focus_widget():
class App(TownApp):
pass
scan_morepath_modules(App)
App.commit()
widgets = App().config.homepage_widget_registry.values()
res... | 26.679012 | 68 | 0.625636 |
29a2f2827d97db6ea448880af874040b40ab8491 | 32 | py | Python | 2_postitionierung/3_rotieren.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 2_postitionierung/3_rotieren.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 2_postitionierung/3_rotieren.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Rotation
Keine Lösung
"""
| 4.571429 | 12 | 0.59375 |
29b1cccea5064c1136cbefcd2bed9964cfefb61f | 1,889 | py | Python | HW1/p4.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/p4.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/p4.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#kverdey1@jhu.edu
#Computer Vision EN.601.461
#Assignment 1
#Programming section 1, p4
#Recognizes objects in an image given a database.
import cv2
import numpy as np
from p3 import p3, getvectors
def p4(labeled_image, database): #return output_image
output_image = np.copy(labeled_image)
image_db, thro... | 46.073171 | 123 | 0.760191 |
d9c2e71a692905fc37d6249eeb1136790ea46f60 | 525 | py | Python | exercises/es/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Define el componente personalizado
def length_component(doc):
# Obtén la longitud del doc
doc_length = len(doc)
print(f"Este documento tiene {doc_length} tokens.")
# Devuelve el doc
return doc
# Carga el modelo pequeño de español
nlp = spacy.load("es_core_news_sm")
# Añade el comp... | 23.863636 | 63 | 0.739048 |
6ab5fd62da30af223cf5172aa98e85efcfb51de0 | 1,061 | py | Python | service/pwned_passwords.py | fausecteam/faustctf-2019-responsivesecurity | 65b4e02bdc9de278166c38697ab992638977d511 | [
"0BSD"
] | null | null | null | service/pwned_passwords.py | fausecteam/faustctf-2019-responsivesecurity | 65b4e02bdc9de278166c38697ab992638977d511 | [
"0BSD"
] | null | null | null | service/pwned_passwords.py | fausecteam/faustctf-2019-responsivesecurity | 65b4e02bdc9de278166c38697ab992638977d511 | [
"0BSD"
] | null | null | null | import flask
import os
import mmap
hash_file = open("hashes.lst.sorted", "rb")
mm = mmap.mmap(hash_file.fileno(), 0, access=mmap.ACCESS_READ)
nhashes = len(mm) // 41 # 41 = length of sha1-hash + newline
print("nhashes", nhashes)
pwned = flask.Blueprint("pwned", __name__)
@pwned.route("/")
def index():
return "... | 22.574468 | 62 | 0.541942 |
0ab9c6e33e14f372d368ef42f955a1f720a48997 | 2,592 | py | Python | 03_TicTacToe/tic_tac_toe.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | 03_TicTacToe/tic_tac_toe.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | 03_TicTacToe/tic_tac_toe.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | from turtle import *
import time
from tic_tac_toe_ansicht import *
from tic_tac_toe_modell import *
# Test 1: Passe die Ausgabe so an, dass ein Spielfeld mit Turtle gezeichnet wird
ansicht = Ansicht()
ansicht.zeichne_spielfeld()
ansicht.zeichne_symbol(Pos.OBEN_LINKS, Belegung.KREUZ)
ansicht.zeichne_symbol(Pos.MITTE_L... | 39.272727 | 80 | 0.751543 |
0ac9d4b204d23abca78687e4d3b037dccea7d19e | 6,595 | py | Python | src/lcdoc/call_flows/call_flow_charting.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | src/lcdoc/call_flows/call_flow_charting.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | src/lcdoc/call_flows/call_flow_charting.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | import json
from lcdoc.tools import project, write_file
from lcdoc.call_flows import markdown
from lcdoc.call_flows.viz_sequence import Plant
vizs = {'plantuml': Plant} # , 'mermaid': Mermaid}
def make_call_flow_chart(flow, d_dest, fn=None, viz_name='plantuml', ILS=None):
"""
- flow from original ILS.call... | 37.471591 | 93 | 0.488097 |
7c5d73d3d98541118b70eebb6ebc3a2b4ebb628c | 94 | py | Python | 2-resources/__DATA-Structures/Data-Structures-Algos-Codebase-master/_Extra-Practice/30-days-of-code-master/day5_loops.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Data-Structures-Algos-Codebase-master/_Extra-Practice/30-days-of-code-master/day5_loops.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Data-Structures-Algos-Codebase-master/_Extra-Practice/30-days-of-code-master/day5_loops.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import sys
n = int(input().strip())
for i in range(10):
print(n,'x',i+1,'=',(n*(i+1)))
| 11.75 | 34 | 0.510638 |
6b1792676c144c0c1917797a2532daf346c667ef | 2,500 | py | Python | KNN/showData.py | lance52587/MachineLearningNote | 0184f8de178990ee31ace2a43809830874313697 | [
"MIT"
] | 37 | 2018-06-06T05:58:54.000Z | 2022-02-21T04:49:54.000Z | KNN/showData.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | null | null | null | KNN/showData.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | 35 | 2018-10-01T16:12:34.000Z | 2022-02-21T03:35:33.000Z | # -*- coding: utf-8 -*-
# @Date : 2017-04-28 16:52:44
# @Author : Alan Lau (rlalan@outlook.com)
# @Language : Python3.5
from matplotlib import pyplot as plt
import numpy as np
import math
# 定义四个点的坐标
a1 = np.array([1, 1])
a2 = np.array([1, 2])
b1 = np.array([3, 3])
b2 = np.array([3, 4])
c = np.array([2, 1])
# 四... | 24.752475 | 71 | 0.6012 |
866a7218fc69824a0794f5b4a35424f23974bf81 | 2,754 | py | Python | pandemie/util/operations.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/util/operations.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/util/operations.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | 1 | 2020-03-28T00:02:41.000Z | 2020-03-28T00:02:41.000Z | """
This file provides all necessary information about the possible operations / answers
you can give to a game state (initial and per round prices) as well as the functions
themselves.
"""
# This list contains all possible operation names
OPERATIONS = ["end_round",
"put_under_quarantine",
... | 28.989474 | 98 | 0.63435 |
868b74b186ee96af6fb0dfb4ed3f1d07c3d29340 | 10,181 | py | Python | test/test_transferagent.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | null | null | null | test/test_transferagent.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | null | null | null | test/test_transferagent.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | null | null | null | """
pghoard
Copyright (c) 2015 Ohmu Ltd
See LICENSE for details
"""
import os
import time
from pathlib import Path
from queue import Empty, Queue
from unittest.mock import ANY, Mock, patch
import pytest
from pghoard import metrics
from pghoard.common import CallbackEvent, FileType, QuitEvent
from pghoard.rohmu.error... | 39.30888 | 123 | 0.627345 |
86b1bab02ada7dccc2ea8bf69652bd51e4858dae | 8,614 | py | Python | Packs/RSANetWitness_v11_1/Integrations/RSANetWitness_v11_1/RSANetWitness_v11_1_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/RSANetWitness_v11_1/Integrations/RSANetWitness_v11_1/RSANetWitness_v11_1_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/RSANetWitness_v11_1/Integrations/RSANetWitness_v11_1/RSANetWitness_v11_1_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
INCIDENT_NEW = {
"items": [{
"eventCount": 1,
"alertMeta": {
"SourceIp": ["8.8.8.8"],
"DestinationIp": ["8.8.4.4"]
},
"openRemediationTaskCount": 0,
"sources": [
None
],
"id": "INC-3",
... | 28.90604 | 103 | 0.540748 |
86bb2c780ff85246ac19d46e4b101e461f73d6e0 | 670 | py | Python | tmp/analyses/examples/6_issue29_blocks_func.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | tmp/analyses/examples/6_issue29_blocks_func.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | tmp/analyses/examples/6_issue29_blocks_func.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """
See https://foss.heptapod.net/fluiddyn/transonic/issues/6
"""
from transonic import with_blocks, block
T = int
def non_pythranizable(arg):
"""represent a function that can not be compiled by Pythran"""
return arg
@with_blocks
def func0(arg: int):
a = b = non_pythranizable(arg)
c: float = 1.2
... | 15.227273 | 66 | 0.570149 |
813c6a9f0e5210fde64935054477ebf55cdd65af | 9,499 | py | Python | rbac/common/base/base_address.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | rbac/common/base/base_address.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | rbac/common/base/base_address.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 37.25098 | 94 | 0.64112 |
ed8bfd0520d9bed9cdcdc0c02fd554ad760a0968 | 24,424 | py | Python | Packs/Kenna/Integrations/KennaV2/KennaV2.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/Kenna/Integrations/KennaV2/KennaV2.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/Kenna/Integrations/KennaV2/KennaV2.py | henry-sue-pa/content | 043c6badfb4f9c80673cad9242fdea72efe301f7 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from typing import Tuple, Callable
import urllib3
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
urllib3.disable_warnings()
def parse_response(raw_data: List[Dict[str, Any]], wanted_keys: List[Any], actual_keys: List[Any]) -> \
List[Di... | 40.638935 | 125 | 0.597118 |
9c4f0527bb5d22ea688172cd72517dab4de1a75b | 2,228 | py | Python | Packs/CommonScripts/Scripts/TimeStampCompare/TimeStampCompare.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/TimeStampCompare/TimeStampCompare.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/TimeStampCompare/TimeStampCompare.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 * # noqa: E402 lgtm [py/polluting-import]
from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import]
import dateparser
EQUAL = 'equal'
BEFORE = 'before'
AFTER = 'after'
TIMESTAMP_FORMAT = '%Y-%m-%dT%H:%M:%S%Z'
DT_STRING = "TimeStampCom... | 29.706667 | 108 | 0.660682 |
130f589b451f2819aef40502772f7d3c31f7aa00 | 88 | py | Python | Python/triangle_quest.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | 1 | 2021-05-19T06:44:03.000Z | 2021-05-19T06:44:03.000Z | Python/triangle_quest.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | null | null | null | Python/triangle_quest.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | null | null | null | for i in range(1,int(input())):
# print (i*'{}'.format(i))
print((10**(i)//9)*i) | 29.333333 | 31 | 0.488636 |
b917890495935295e65a3869694ac69e548c4de9 | 100 | py | Python | src/onegov/winterthur/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.winterthur.theme.winterthur_theme import WinterthurTheme
__all__ = ['WinterthurTheme']
| 25 | 68 | 0.84 |
b9d15e87526dacebb8beb97b390bb8b2ea363a3d | 552 | py | Python | test/etc_indy/indy_config.py | mgmgwi/indy-node-container | dd6073f5f4152aabdf60d4c6a0ef3d3645c15135 | [
"MIT"
] | 5 | 2021-03-16T09:41:20.000Z | 2021-04-15T15:46:36.000Z | test/etc_indy/indy_config.py | mgmgwi/indy-node-container | dd6073f5f4152aabdf60d4c6a0ef3d3645c15135 | [
"MIT"
] | 62 | 2021-05-14T09:39:35.000Z | 2022-01-28T11:13:19.000Z | test/etc_indy/indy_config.py | mgmgwi/indy-node-container | dd6073f5f4152aabdf60d4c6a0ef3d3645c15135 | [
"MIT"
] | 5 | 2021-05-25T20:05:34.000Z | 2022-02-17T16:43:15.000Z |
# Disable stdout logging
enableStdOutLogging = True
# Directory to store ledger.
LEDGER_DIR = '/var/lib/indy'
# Directory to store logs.
LOG_DIR = '/var/log/indy'
# Directory to store keys.
KEYS_DIR = '/var/lib/indy'
# Directory to store genesis transactions files.
GENESIS_DIR = '/var/lib/indy'
# Directory to sto... | 19.714286 | 48 | 0.737319 |
b9f7cdd84ee43e4686fcdd40cfb3be2e56fa68f5 | 17,350 | py | Python | src/Sephrasto/UI/Einstellungen.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/UI/Einstellungen.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/UI/Einstellungen.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Einstellungen.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore... | 58.221477 | 121 | 0.732161 |
0ebd21ecf2a768810fce144eb18fdc9ccf169aae | 9,550 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cumulus/test_nclu.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cumulus/test_nclu.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/cumulus/test_nclu.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.com>
#
# 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, o... | 42.825112 | 97 | 0.552147 |
162dc5ffa0423f9d468a357ce8f4cc10633ef97a | 452 | py | Python | verto/errors/NoVideoIdentifierError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/errors/NoVideoIdentifierError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/errors/NoVideoIdentifierError.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from verto.errors.Error import Error
class NoVideoIdentifierError(Error):
'''Exception raised when no identifier is found for a video
Attributes:
block: block where tag was not matched
url: original url
message: explanation of why error was thrown
'''
def __init__(self, block... | 25.111111 | 63 | 0.650442 |
1652ff3eda822246a4abf49001b54e041ceec5da | 881 | py | Python | MAIN/STM32F405_C/NORMAL/history/V37/userControl.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405_C/NORMAL/history/V37/userControl.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405_C/NORMAL/history/V37/userControl.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | from pyb import Pin, LED
import utime
#USER LED FUCTION
RED = Pin('B14', Pin.OUT_PP)
BLUE = Pin('B12', Pin.OUT_PP)
def REDLed(value=False):
if value == True:
RED.high()
else:
RED.low()
def BLUELed(value=False):
if value == True:
BLUE.high()
else:
BLUE.low()
#TACTILE S... | 20.488372 | 47 | 0.6084 |
166a2b94b993e1a5b974902ae21eb124da6013e2 | 5,270 | py | Python | python/oneflow/compatible/single_client/test/ops/test_masked_fill.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/test/ops/test_masked_fill.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/test/ops/test_masked_fill.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... | 36.597222 | 88 | 0.644402 |
16ac94f97f21988d6ab8c0a0f32d900131134931 | 11,273 | py | Python | evo_algorithm/ea_shapes/polygon_test.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | evo_algorithm/ea_shapes/polygon_test.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | evo_algorithm/ea_shapes/polygon_test.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | import requests
import os
import random
import json
import webbrowser
import math
import copy
import time
import io
from PIL import Image, ImageDraw
from pandas import DataFrame
global population
global api_calls
global stop
global MUTATION_RATE
ROTATION_OFFSET = math.pi / 4
ROTATION_OFFSET_DEG = 45
population = []
ap... | 31.844633 | 125 | 0.589107 |
bce1c6dc5aaddc7d88c1ffe2cc131f63589d8587 | 522 | py | Python | db/data.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | db/data.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | db/data.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | from flask import session
from .schema import Tax
from . import Session
def start():
session = Session()
return session
def insert(company, tax_paid, session):
session.add(Tax(company=company, tax_paid=string2float(tax_paid)))
def stop(session):
session.commit()
session.close()
def string2float(... | 21.75 | 70 | 0.680077 |
bcf342f29cb980c7dd7b0f040fb165e5db177b47 | 428 | py | Python | Python/Exercícios_Python/068_tabuada_v3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/068_tabuada_v3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/068_tabuada_v3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""068 - Tabuada v3
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/18alW9jDKJXrTlOUfX6_sJ7oDInDdh34n
"""
while True:
num = int(input("Informe um número para ver a sua tabuada (Número negativo para parar): "))
if num < 0... | 26.75 | 95 | 0.649533 |
4c1f27c79e9721eca7f9086f96d1e5110571fc53 | 532 | py | Python | src/data/transform.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/data/transform.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/data/transform.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | from math import floor
from settings import scope
__all__ = ["lon_to_index", "lat_to_index"]
def lon_to_index(lon: float) -> int:
longitude_min, longitude_max, _, _ = scope
if longitude_min <= lon < longitude_max:
return floor((lon - longitude_min) / 0.005 + 0.5)
else:
return -1
def l... | 22.166667 | 62 | 0.637218 |
91060b1f8ba67aa96481fa7ca0cf410d9f523d1e | 166 | py | Python | day01/input.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day01/input.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day01/input.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | # input nimmt Benutzer eingaben an
print("Hello " + input("What's your name? ") + "!")
print("You typed " + str(len(input("Give a word or text: "))) + " characters") | 41.5 | 78 | 0.63253 |
914f67a708ef919a5d7e979babe69c555e593e67 | 2,656 | py | Python | loesung/blatt1a_4b.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | 1 | 2019-09-27T13:47:20.000Z | 2019-09-27T13:47:20.000Z | loesung/blatt1a_4b.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | loesung/blatt1a_4b.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | # Hier soll Aufgabe 4a nun verbessert werden, indem der User mehr als nur einen
# Versuch bekommt. Hierbei sollen seine Versuche gezählt werden und ihm am Ende
# ausgegeben werden. Außerdem soll dem User ein nach jedem Versuch gesagt werden
# ob die zu erratene Zahl größer oder kleiner ist. Als eigene Verbesserung soll... | 45.016949 | 82 | 0.725151 |
e677b86b23b9f98f6104cbde37c6970461039202 | 1,328 | py | Python | MA/00 Archive/cv2colorfilter2.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/00 Archive/cv2colorfilter2.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/00 Archive/cv2colorfilter2.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
cap = cv2.VideoCapture(0)
# ADJUST THESE VALUES!!
lower = np.array([25,10,0])
upper = np.array([60,100,255])
while True:
_, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
mask = cv2.inRange(hsv, lower, upper)
res = cv2.... | 25.056604 | 51 | 0.533886 |
e6b1828a48fba905e7d6d096a310d63d2c880b46 | 93 | py | Python | Python/Django/Django_Pseudo-Hashmap/adventure/apps.py | extrajp2014/computer-science-notes | fa06b72f7c388cb31630cf9aea9fefc46340756d | [
"MIT"
] | 22 | 2016-03-22T07:28:42.000Z | 2022-02-12T16:03:17.000Z | Python/Django/Django_Pseudo-Hashmap/adventure/apps.py | extrajp2014/computer-science-notes | fa06b72f7c388cb31630cf9aea9fefc46340756d | [
"MIT"
] | 103 | 2017-04-14T23:19:19.000Z | 2022-01-27T03:05:36.000Z | cs/lambda_cs/04_cs_build_week_1/adventure/apps.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 7 | 2019-04-09T16:12:10.000Z | 2021-12-15T17:09:32.000Z | from django.apps import AppConfig
class AdventureConfig(AppConfig):
name = 'adventure'
| 15.5 | 33 | 0.763441 |
fc09198dec0c3ff4a3ce5d594f01d17a224cb047 | 818 | py | Python | example/solid_example/computer_srp_bad.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | example/solid_example/computer_srp_bad.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | example/solid_example/computer_srp_bad.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class Computer:
def __init__(self, mouse, keyboard, monitor):
self.mouse = mouse
self.keyboard = keyboard
self.monitor = monitor
self.input = ''
def mouse_click(self):
print(f'{self.mouse}: 클릭')
def mouse_right_click(self):
print(f'{self.mouse}: 우클릭')
... | 27.266667 | 64 | 0.622249 |
5db1d0a1b8ff466367320a98b664206d73f2c152 | 1,616 | py | Python | user/views.py | ykomashiro/webtest | 2587d14de7ae9107e8d7d98c1db90f0a9608177e | [
"MIT"
] | null | null | null | user/views.py | ykomashiro/webtest | 2587d14de7ae9107e8d7d98c1db90f0a9608177e | [
"MIT"
] | null | null | null | user/views.py | ykomashiro/webtest | 2587d14de7ae9107e8d7d98c1db90f0a9608177e | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic.base import View
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
from .forms import LoginForm, RegisterForm, ForgetPwdForm, ModifyPwdForm
def demo(request):
return HttpResponse("Hello, You're at the demo page.")... | 33.666667 | 76 | 0.558168 |
f8f2facb1c8d3d32cd2333fc059c2f25ff76a62f | 4,403 | py | Python | lib/python/qmk/decorators.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/decorators.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/decorators.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | """Helpful decorators that subcommands can use.
"""
import functools
from pathlib import Path
from milc import cli
from qmk.keymap import is_keymap_dir
from qmk.path import is_keyboard, under_qmk_firmware
def automagic_keyboard(func):
"""Sets `cli.config.<subcommand>.keyboard` based on environment.
This wi... | 50.609195 | 168 | 0.643198 |
53c8708eb19391f3bef56a4f8e9fea9edb6f6d94 | 432 | py | Python | Crashkurs Python/10_List Comprehension.py | slogslog/Kurzgeschichten-in-CSharp | 3918c4174220e558cdeeada0edac941811418b93 | [
"Unlicense"
] | 2 | 2019-03-15T20:48:34.000Z | 2019-04-22T15:24:09.000Z | Crashkurs Python/10_List Comprehension.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs Python/10_List Comprehension.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | # Alle Quadratzahlen von 1..12 in eine Liste kopieren
domain = range(1,13)
# langsam
squares = []
for i in domain:
squares.append(i*i)
print(squares)
# list comprehension
squares2 = [i*i for i in domain]
print(squares2)
# nur für die ungeraden Zahlen
squares3 = [i*i for i in domain if i % 2 == 1]
print(squares... | 18.782609 | 58 | 0.664352 |
4ad902895e40a1a40165b9a20449180b01f57cec | 350 | py | Python | ProjectEuler_plus/euler_001.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_001.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_001.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
t = int(input().strip())
nums = []
for a0 in range(t):
n = int(input().strip())
nums.append(n)
for n in nums:
n1 = (n - 1) // 3
n2 = (n - 1) // 5
n3 = (n - 1) // 15
r1 = 3 * (n1 * (n1 + 1) // 2)
r2 = 5 * (n2 * (n2 + 1) // 2)
r3 = 15 * (n3 * (n3 + 1) ... | 17.5 | 34 | 0.417143 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.