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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8004d295c0b4c212b8bd4f21c31af4652537bfb6 | 12,312 | py | Python | scheduleSynchronizer/graph_helper.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/graph_helper.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/graph_helper.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | from ast import parse
from os import name
import requests
import json
from scheduleSynchronizer.debug import *
graph_url = 'https://graph.microsoft.com/v1.0'
def get_user(token):
# Send GET to /me
user = requests.get(
'{0}/me'.format(graph_url),
headers={
'Authorization': 'Bearer ... | 35.481268 | 147 | 0.638889 |
3379d701a6ea9172c6c8665833b55b19853ce150 | 431 | py | Python | python/python_backup/Python_Progs/speech.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/speech.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/speech.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import pyttsx
def onStart(name):
print 'starting', name
def onWord(name, location, length):
print 'word', name, location, length
def onEnd(name, completed):
print 'finishing', name, completed
engine = pyttsx.init()
engine.connect('started-utterance', onStart)
engine.connect('started-word', onWord)
engine.conne... | 33.153846 | 59 | 0.74942 |
33a53115b8ae46d8c476dbe5352b6482e02a86cd | 924 | py | Python | spark_sql/test1.py | xiaolifeipiao/xiaolifeipiao-spark-integrated-curriculum | f9b502ac4a7bd8663005f1bfd2c8ebec5bce9e74 | [
"Apache-2.0"
] | 6 | 2021-11-11T01:06:08.000Z | 2021-11-18T02:45:25.000Z | spark_sql/test1.py | xiaolifeipiao/xiaolifeipiao-spark-integrated-curriculum | f9b502ac4a7bd8663005f1bfd2c8ebec5bce9e74 | [
"Apache-2.0"
] | null | null | null | spark_sql/test1.py | xiaolifeipiao/xiaolifeipiao-spark-integrated-curriculum | f9b502ac4a7bd8663005f1bfd2c8ebec5bce9e74 | [
"Apache-2.0"
] | null | null | null | from pyspark.sql import SparkSession
from pyspark.sql import Row
def basic_datasource_example(spark):
return False
def generic_file_source_options_example(spark):
# spark.sql("set spark.sql.files.ignoreCorruptFiles=true")
# test_corropt_df = spark.read.parquet("./input/20news-bydate-train/rec.autos/")
... | 31.862069 | 94 | 0.745671 |
639cb6aa571298be345d412789fc733caa008056 | 1,017 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex07_rotation.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex07_rotation.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/solutions/ex07_rotation.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch08_binary_trees.util import TreeUtils
from ch08_binary_trees.intro import ExampleTrees
# Rotation
def rotate_left(node):
if node.right is None:
raise ValueError("can't rotate left, no valid root")
rc = nod... | 19.188679 | 70 | 0.696165 |
7f9b8d5b0d14f63709af669287686a705dff1343 | 243 | py | Python | zencad/examples/OpenscadLike/csg.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/OpenscadLike/csg.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/OpenscadLike/csg.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from zencad import *
m1 = box(15, center=True) + sphere(10)
m2 = box(15, center=True) ^ sphere(10)
m3 = box(15, center=True) - sphere(10)
display(m1.left(24))
display(m2)
display(m3.right(24))
show()
| 16.2 | 38 | 0.662551 |
f6dd71aa5340e43c68c96fd84763d30086c8c928 | 1,275 | py | Python | lintcode/000-Find-the-Weak-Connected-Component-in-DAG/WeakConnCompinDAG_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/000-Find-the-Weak-Connected-Component-in-DAG/WeakConnCompinDAG_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/000-Find-the-Weak-Connected-Component-in-DAG/WeakConnCompinDAG_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for a directed graph node
# class DirectedGraphNode:
# def __init__(self, x):
# self.label = x
# self.neighbors = []
class Solution:
# @param {DirectedGraphNode[]} nodes a array of directed graph node
# @return {int[][]} a connected set of a directed graph
def connectedSet2(... | 29.651163 | 71 | 0.529412 |
d621347e0b5a20fbef7ea4ce7a5fc000177c68b8 | 92 | py | Python | 2014/05/audio-fees-profiles/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/05/audio-fees-profiles/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/05/audio-fees-profiles/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1NGVfKxUEE8D-irMQNdPNFfzEhjuwsyVPRF88DTjDDm4'
| 23 | 68 | 0.836957 |
c3ba1c3d3f9bc049b121b65846bbe805e7574041 | 3,967 | py | Python | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline_schema/compiled_single_unit.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline_schema/compiled_single_unit.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline_schema/compiled_single_unit.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from logging import getLogger
from traceback import format_exc
from watchmen_auth import PrincipalService
from watchmen_data_kernel.storage_bridge import now, parse_prerequisite_defined_as, parse_prerequisite_in_memory, \
PipelineVariables, spent_ms
from watchmen_model.admin import Pipeline, PipelineStage, PipelineUn... | 38.892157 | 115 | 0.800101 |
f61a939a88de7c1de5dfb2c82c780a37a82bea32 | 5,841 | py | Python | classifier_speech_features.py | gumaga/-audiotechnik_gruppe_3_finale_abgabe- | b31b5d7db064b09a2f6f97e08b54eff0cd12d091 | [
"Unlicense"
] | 1 | 2021-03-12T20:02:23.000Z | 2021-03-12T20:02:23.000Z | classifier_speech_features.py | gumaga/-audiotechnik_gruppe_3_finale_abgabe- | b31b5d7db064b09a2f6f97e08b54eff0cd12d091 | [
"Unlicense"
] | null | null | null | classifier_speech_features.py | gumaga/-audiotechnik_gruppe_3_finale_abgabe- | b31b5d7db064b09a2f6f97e08b54eff0cd12d091 | [
"Unlicense"
] | null | null | null | """
script classifier_speech_features.py
This file may be run as a script or used as a class.
For information on this file see: README.md
Authors: Leon Hochberger, Daniel-José Alcala Padilla, Tobias Danneleit
Date: March 10th, 2021
License: 3-clause BSD (see: https://github.com/gumaga/-audiotechnik_gruppe_3_finale_... | 39.466216 | 136 | 0.656223 |
9cc73504b1b2e73ec3dc29f343a61cfae2b30e33 | 3,584 | py | Python | python/data_sutram/pypath/PyPath/json_sqlite/2_get_all_routes_sqlite.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/pypath/PyPath/json_sqlite/2_get_all_routes_sqlite.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/pypath/PyPath/json_sqlite/2_get_all_routes_sqlite.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | """
__author__ : Jimut Bahan Pal
It has been found that most of the data are not there, so try and except is used for every data-fetch.
This program converts the get_all_routes() JSON object to sqlite database.
Stores in db.sqlite under the table get_all_routes
TOTAL OF 1167 entries found.
"""
import sqlite3
co... | 28 | 255 | 0.611328 |
14b1d4266bf7ca28f419729a61aef1487fa92de9 | 649 | py | Python | exercises/de/test_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"after='ner'" in __solution__ or 'after="ner"' in __solution__
), "Fügst du die Komponente explizit nach dem Entity Recognizer hinzu?"
assert (
nlp.pipe_names[-1] == "animal_component"
), "Hast du die Komponente nach dem Entity Recognizer hinzugefügt?"
assert len... | 38.176471 | 75 | 0.662558 |
dcc138e1d4cdd1cc6b14bf79e7578c4e83df6df4 | 864 | py | Python | ryu/app/simulation/lib.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/simulation/lib.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/simulation/lib.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | class TcpPacket:
def __init__(self, srcIp, dstIp, port, dataLen):
self.srcIp = srcIp
self.dstIp = dstIp
self.port = port
self.dataLen = dataLen
class FlowPacket:
def __init__(self, tcpPacket):
self.tcpPacket = tcpPacket
self.inPort = 0
self.type = None
... | 22.736842 | 70 | 0.565972 |
0d194153a8ef52f596004bffcb8771e6a893721f | 753 | py | Python | beispielanwendungen/designer/helloworld3.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/designer/helloworld3.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/designer/helloworld3.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
import sys
from PyQt4 import QtCore, QtGui
from ui_helloworld import Ui_MainWindow
def main(argv):
app = QtGui.QApplication(argv)
mainwindow = MyMainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MyMainWindow(QtGui.QMainWindow, Ui_MainWindow):
def __init__(s... | 22.818182 | 63 | 0.679947 |
0d3340264e13d4c5aa3dee43259b402f87ed574c | 2,211 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/workflow_leave_application.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/workflow_leave_application.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/workflow_leave_application.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.a_row_exists("Leave Application"):
frappe.reload_doc("hr", "doctype", "leave_application")
frappe.reload_doc("workflow", "docty... | 32.043478 | 124 | 0.644052 |
b4989019ba2bf16d600df9b2d6c88df79fb48874 | 370 | py | Python | Curso-Em-Video-Python/2Exercicios/ex108/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex108/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex108/moedas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | def metade(valor=0):
return valor / 2
def dobro(valor=0):
return valor * 2
def aumentar(valor=0, porcento=0):
aumento = valor + (valor * porcento / 100)
return aumento
def reduzir(valor=0, porcento=0):
reduz = valor - (valor * porcento / 100)
return reduz
def moeda(preco=0, moeda='R$'):
... | 18.5 | 50 | 0.616216 |
2ea293f86356ba6ca3e6c70b73f8e0c08ff22f77 | 1,019 | py | Python | src/telemetry/events.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/telemetry/events.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/telemetry/events.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import os
from snowplow_tracker import (
AsyncEmitter,
Emitter,
Subject,
Tracker,
logger as snowplow_logger,
)
import logging
snowplow_logger.setLevel(100)
SNOWPLOW_URL = "monosi-spipeline-collector-lb-1716143593.us-west-2.elb.amazonaws.com"
send_anonymous_stats = os.getenv('SEND_ANONYMOUS_STATS',... | 22.644444 | 86 | 0.65947 |
2584e021b9ba701c1677bb3a254ccc40dcbcbec5 | 5,271 | py | Python | pk/data/main_demo.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/main_demo.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/main_demo.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | from numpy import *
from pandas import *
from tools import logger
import shutil
import os
import sys,getopt
from context import resource_manager
import math
log = logger.getLogger()
def conv(o):
x = np.array(o)
y = x.astype(np.float)
return y
def save(name='default'):
"""
保存id和data数据
:return... | 35.614865 | 162 | 0.688484 |
4ce2e1df8017c8d7d4208834e57bfa4885605201 | 855 | py | Python | Course_1/Week_04/2_minimum_cut_2.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | Course_1/Week_04/2_minimum_cut_2.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | 1 | 2020-07-16T08:03:22.000Z | 2020-07-16T08:09:34.000Z | Course_1/Week_04/2_minimum_cut_2.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
import time
import codecs
import random
def build_graph(path):
graph = {}
with codecs.open(path) as file:
for line in file:
line = line.strip().split('\t')
node = int(line[0])
others = list(map(int, line[1:]))
graph[node] = others
return graph
def contract(graph, v, w):
for node in... | 19.883721 | 43 | 0.652632 |
2c935436a2c20ce94f5ff1817fef9de20110e311 | 467 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_2/seprate_manufacture_and_repack.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v4_2/seprate_manufacture_and_repack.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_2/seprate_manufacture_and_repack.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""update `tabStock Entry` set purpose='Manufacture' where purpose='Manufacture/Repack' and ifnull(work_ord... | 51.888889 | 137 | 0.747323 |
2c9adb2dfc50efd42977ef30cbf5e532a30f31ec | 8,768 | py | Python | tests/test_messlokation.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_messlokation.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_messlokation.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import json
from datetime import datetime
from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.bo.messlokation import Messlokation, MesslokationSchema
from bo4e.bo.zaehler import Zaehler
from bo4e.com.adresse import Adresse
from bo4e.com.dienstleistung import Dienstleistung
from bo4e.com.externe... | 40.40553 | 118 | 0.599795 |
1a7e0b0b79181aa6933ead627533ade5aa162841 | 2,227 | py | Python | PSA/modules/BroModule.py | SECURED-FP7/secured-psa-nsm | 20c8f790ebc2d2aa8c33bda1e047f8f29275a0be | [
"Apache-2.0"
] | null | null | null | PSA/modules/BroModule.py | SECURED-FP7/secured-psa-nsm | 20c8f790ebc2d2aa8c33bda1e047f8f29275a0be | [
"Apache-2.0"
] | null | null | null | PSA/modules/BroModule.py | SECURED-FP7/secured-psa-nsm | 20c8f790ebc2d2aa8c33bda1e047f8f29275a0be | [
"Apache-2.0"
] | null | null | null | # -*- Mode:Python;indent-tabs-mode:nil; -*-
#
# BroModule.py
#
# A parent interface for all Bro modules.
#
# Each Bro module should define the functions declared in the
# BroModule class. Futhremore, each module must define module
# variable 'module' that contains the BroModule class defined
# in the module. The module... | 30.094595 | 78 | 0.65604 |
46c46ad43c8296b6b9ecc2f23bd20533284ab9a9 | 645 | py | Python | src/utils/socketdatareader.py | muhammedtiftikci/Proje-A | 363ddb8e03afe0387d144621479ed742d2d40dc6 | [
"MIT"
] | null | null | null | src/utils/socketdatareader.py | muhammedtiftikci/Proje-A | 363ddb8e03afe0387d144621479ed742d2d40dc6 | [
"MIT"
] | null | null | null | src/utils/socketdatareader.py | muhammedtiftikci/Proje-A | 363ddb8e03afe0387d144621479ed742d2d40dc6 | [
"MIT"
] | null | null | null |
class SocketDataReader:
def __init__(self, database):
self._database = database
def read(self, data):
splitted_data = data.split(",")
model = {
'client_type': splitted_data[0],
'username': splitted_data[1],
'password': splitted_data[2],
... | 25.8 | 89 | 0.547287 |
376b42a457d1ceb2dcbf5dccc7cf10628d007bff | 1,287 | py | Python | nettest-own-port80.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | nettest-own-port80.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | nettest-own-port80.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | # Eigener Versuch, nur Port 80 in IP Bereich, Threaded
# Anregungen + Codeschnipsel von... https://www.tutorialspoint.com/python_penetration_testing/python_penetration_testing_network_scanner.htm
# und https://www.geeksforgeeks.org/threaded-port-scanner-using-sockets-in-python/?ref=rp
import socket
import time
import... | 24.75 | 141 | 0.675214 |
80a20252a55eb615442a24af2243bae516dcea07 | 86 | py | Python | app-backend/main.py | MarlonSchultz/SHM | f9082afb34d41ba20de564939c2e7de0caed907e | [
"MIT"
] | null | null | null | app-backend/main.py | MarlonSchultz/SHM | f9082afb34d41ba20de564939c2e7de0caed907e | [
"MIT"
] | 1 | 2019-03-12T13:35:46.000Z | 2019-03-12T13:35:46.000Z | app-backend/main.py | MarlonSchultz/SHM | f9082afb34d41ba20de564939c2e7de0caed907e | [
"MIT"
] | 1 | 2019-03-15T13:29:57.000Z | 2019-03-15T13:29:57.000Z | from app import app_object
if __name__ == '__main__':
app_object.run(debug=True)
| 17.2 | 30 | 0.732558 |
80b896f358aa0dfc984bf3435c33ca5bd0757dac | 719 | py | Python | exercises/fr/test_01_12_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/test_01_12_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/test_01_12_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
len(pattern) == 2
), "Le motif doit décrire deux tokens (deux dictionnaires)."
assert isinstance(pattern[0], dict) and isinstance(
pattern[1], dict
), "Chaque élément d'un motif doit être un dictionnaire."
assert (
len(pattern[0]) == 1 and len(pattern[1])... | 37.842105 | 71 | 0.613352 |
80ca8c1b29f9f539ce7befb7ec9d90b3f7966ca8 | 311 | py | Python | Group1-module1-OmokaroLoveth/Day 8 (Python Task).py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Group1-module1-OmokaroLoveth/Day 8 (Python Task).py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Group1-module1-OmokaroLoveth/Day 8 (Python Task).py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null |
img= cv2.imread(r"C:\Users\HP\Untitled Folder\nature picture.jpg", 1)
cv2.imshow(img)
#Making a copy of the previous image and displaying it
imgcopy= img.copy()
cv2.imshow(imgcopy)
#Resizing the copied image and displaying it
resized_imgcopy = cv2.resize(img, (600,600))
cv2.imshow(resized_imgcopy) | 28.272727 | 70 | 0.745981 |
80fa35fb1670e640f9cc551fad4c9cd21cf5b700 | 746 | py | Python | setup.py | HyperHamster535/PyreFrame | d9087e2d6e2cff339df27590149f8a4be50a6c8f | [
"MIT"
] | 1 | 2019-05-29T17:31:10.000Z | 2019-05-29T17:31:10.000Z | setup.py | HyperHamster535/PyreFrame | d9087e2d6e2cff339df27590149f8a4be50a6c8f | [
"MIT"
] | 1 | 2019-05-23T15:14:30.000Z | 2019-05-23T15:14:30.000Z | setup.py | HyperHamster535/PyWireframe | d9087e2d6e2cff339df27590149f8a4be50a6c8f | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="PyWireframe",
version="0.5.0",
author="HyperHamster534",
author_email="joshua@the-britains.com",
description="PyreFrame is a wireframe 3D graphics engine which uses turtle graphics. It is ... | 33.909091 | 172 | 0.691689 |
205a5dab4efc867742bf1cf6ccf453b723f7c081 | 63 | py | Python | .vscode/extensions/ms-vscode.cpptools-1.9.0/debugAdapters/lldb/lib/python2.7/site-packages/lldb/runtime/__init__.py | Kvahn-ui/dotfiles | 3f1364410f5bebcaacca6ae38a8e5fbb9bb51285 | [
"MIT"
] | null | null | null | .vscode/extensions/ms-vscode.cpptools-1.9.0/debugAdapters/lldb/lib/python2.7/site-packages/lldb/runtime/__init__.py | Kvahn-ui/dotfiles | 3f1364410f5bebcaacca6ae38a8e5fbb9bb51285 | [
"MIT"
] | 4 | 2019-06-16T09:52:03.000Z | 2019-08-18T02:11:35.000Z | .vscode/extensions/ms-vscode.cpptools-1.9.0/debugAdapters/lldb/lib/python2.7/site-packages/lldb/runtime/__init__.py | Kvahn-ui/dotfiles | 3f1364410f5bebcaacca6ae38a8e5fbb9bb51285 | [
"MIT"
] | null | null | null | __all__ = []
for x in __all__:
__import__('lldb.runtime.' + x) | 21 | 32 | 0.666667 |
20e8eb5fe06f76c0d926b311c8d9f712bad99196 | 462 | py | Python | INBa/2015/Mitin_D_S/task_3_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Mitin_D_S/task_3_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Mitin_D_S/task_3_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 3. Вариант 15.
# Напишите программу, которая выводит имя "Лариса Петровна Косач-Квитка", и запрашивает его псевдоним.
# Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
# Mitin D.S.
# 05.03.2016, 23:14.
print('Введите псевдоним Ларисы Петровны "К... | 42 | 113 | 0.75974 |
aff8f3dfec86025953e0740b4694f69db66b56d8 | 2,096 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/wekatest.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/wekatest.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/wekatest.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from pylab import *
from marsyas import MarSystemManager,MarControlPtr
msm = MarSystemManager()
weka= msm.create("WekaSource", "weka")
classifier= msm.create("GaussianClassifier", "classifier")
summary= msm.create("Summary", "summary")
pipe = msm.create("Series","pipe")
pipe.addMarSystem(weka)... | 30.823529 | 99 | 0.805821 |
b33c0a75bfe959bb07e7d46f2b154b33163f08cb | 4,651 | py | Python | code/snake/main.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 1 | 2020-03-30T09:25:53.000Z | 2020-03-30T09:25:53.000Z | code/snake/main.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 2 | 2020-02-05T14:00:23.000Z | 2020-03-30T19:57:19.000Z | code/snake/main.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | null | null | null | # Do not remove "from Algorithms import *". It's needed for reflection
from Algorithms import *
from Algorithms.Algorithms import Algorithm
import sys
import gym
import pygame
import random
from datetime import datetime
import SnakeGym
from Algorithms.Algorithms import Visual
from Algorithms.RandomChoice import RandomC... | 32.753521 | 121 | 0.692539 |
6402ae48f8cd28672a0c27eef3ebdaeeea653852 | 1,527 | py | Python | extender/darkstar/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | extender/darkstar/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | extender/darkstar/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2022-02-16T14:59:12.000Z | 2022-02-16T14:59:12.000Z | from conans import ConanFile, CMake, tools
import glob
import os.path
import sys
# conan install . -s arch=x86
class LocalConanFile(ConanFile):
name = "darkstar-core"
version = "0.5.1"
build_requires = "cmake/3.22.0"
settings = "os", "compiler", "build_type", "arch"
requires = "detours/4.0.1@micro... | 30.54 | 120 | 0.59594 |
a63960a4b122db600690070e171e584f6086b830 | 418 | py | Python | Externals/twitter/RO.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | Externals/twitter/RO.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | Externals/twitter/RO.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | # pylint: disable=C0114
import Persistence.log as log
from Externals.twitter.Api import TwitterBase as BaseApi
log_ = log.getLogger(__name__)
class ReadOnly(BaseApi):
# pylint: disable=R0903
def __init__(self):
super().__init__()
log_.setLevel(log_.getEffectiveLevel() - 10)
log_.info(
... | 29.857143 | 97 | 0.698565 |
7544f08ed568b199b361c832af209939376090ec | 1,084 | py | Python | Arrays and Strings/SubarrayWithGivenSum.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/SubarrayWithGivenSum.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/SubarrayWithGivenSum.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | """
Subarray with given sum
https://practice.geeksforgeeks.org/problems/subarray-with-given-sum/0/?ref=self
"""
def subarray_with_given_sum(numbers, size, required_sum):
"""
Given an unsorted array of non-negative integers,
find a continuous sub-array which adds to a given number.
"""
start = 0
... | 25.809524 | 79 | 0.575646 |
f35eccdae4ebc30ce24708b5b35d7c413d310050 | 745 | py | Python | 21-fs-ias-lec/03-BACnetCore/src/core/interface/subscribed_subfeed.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/03-BACnetCore/src/core/interface/subscribed_subfeed.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/03-BACnetCore/src/core/interface/subscribed_subfeed.py | cn-uofbasel/BCN | 2d0852e00f2e7f3c4f7cf30f60c6765f2761f80a | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from .feed import Feed
class SubscribedSubFeed(Feed):
"""
This class represents a Feed which is not owned by another Node and is not it's master_feed.
Additional to the normal feed-functionality it has a method to determine the Owner/Master of this feed
"""
def __init__(self, feed_id, storage_con... | 35.47619 | 119 | 0.711409 |
f3a7ab02720f61c992d66eaeb499b7ed5982fec3 | 3,314 | py | Python | yolov5-coreml-tflite-converter/tflite/tf_metadata/input_metadata_writer.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_metadata/input_metadata_writer.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_metadata/input_metadata_writer.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | from tflite_support import metadata_schema_py_generated as _metadata_fb
from constants import IMAGE_NAME, IOU_NAME, CONF_NAME, NORMALIZED_SUFFIX, QUANTIZED_SUFFIX
from tf_metadata.metadata_utils import MetadataHelper
class InputMetadataWriter(MetadataHelper):
def __init__(self, input_order, img_size, normalized,... | 45.39726 | 193 | 0.646047 |
340868d358a2fd8e8425e43050d52d9f50821dde | 1,645 | py | Python | AP_SS16/503/python/plot.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/503/python/plot.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | AP_SS16/503/python/plot.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import os
import numpy as np
from uncertainties.unumpy import uarray
import data
import helpers as hel
import plot_helpers as plot
import main as m
import functions as f
import matplotlib as mpl
import matplotlib.pyplot as plt
#plot.plot(range(len(m.q)),m.q, "Teilchennummer","Ladung","../plots/ladung.pdf", None)
#p... | 31.037736 | 125 | 0.675988 |
340ea85a5b213e3a629d9ba903138e93c3473583 | 34 | py | Python | tests/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | pytest_plugins = ['tests.shared']
| 17 | 33 | 0.735294 |
f3dd808c5fe5cb93fa0c8924c385a5f737773357 | 7,642 | py | Python | beispielanwendungen/hallowelt/hallowelt3.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/hallowelt/hallowelt3.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/hallowelt/hallowelt3.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
import sys
from PyQt4 import QtCore, QtGui
def main(argv):
app = QtGui.QApplication(argv)
#mainwindow = QtGui.QMainWindow()
mainwindow = MainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MainWindow(QtGui.QMainWindow):
def __init__(self, *args):
... | 39.391753 | 110 | 0.609003 |
6d48e4ff8a6e3aad9b9230bd591cb6c568f2ca28 | 9,857 | py | Python | RDS/circle2_use_cases/exporter/tests/test_service.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle2_use_cases/exporter/tests/test_service.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle2_use_cases/exporter/tests/test_service.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import unittest
from lib.Service import Service
from pactman import Consumer, Provider
import json
from RDS import FileTransferArchive, FileTransferMode
pact = Consumer("ServiceExporter").has_pact_with(Provider("Zenodo"), port=3000)
testingaddress = "http://localhost:3000"
class Test_Service(unittest.TestCase):
... | 34.344948 | 88 | 0.530486 |
61164e80848d7be16e2e133551116853c9c52af8 | 3,002 | py | Python | stanford1/py/search_in_graph.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | stanford1/py/search_in_graph.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | stanford1/py/search_in_graph.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Info:
# http://eddmann.com/posts/depth-first-search-and-breadth-first-search-in-python/
#
# ToThink:
# http://opendatastructures.org/versions/edition-0.1e/ods-java/12_3_Graph_Traversal.html - зависит от вх. предст.
from pprint import pprint
import copy
from Queue import Queue # Thread-safe - overh... | 23.092308 | 126 | 0.564624 |
b62cf007e66924273df385233d4407492fab057c | 10,625 | py | Python | users/dennytom/chording_engine/parser.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 105 | 2021-08-28T11:53:18.000Z | 2022-03-27T14:00:02.000Z | users/dennytom/chording_engine/parser.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 1 | 2021-09-24T00:36:29.000Z | 2021-09-24T03:05:18.000Z | users/dennytom/chording_engine/parser.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 7 | 2021-09-02T05:09:50.000Z | 2022-02-03T14:54:25.000Z | #!/usr/bin/env python3
import json
from functools import reduce
from chord import *
import sys
comma_separator = (lambda x, y: str(x) + ", " + str(y))
string_sum = (lambda x, y: str(x) + " + " + str(y))
newline_separator = (lambda x, y: str(x) + "\n" + str(y))
def add_includes(data):
output_buffer = ""
if n... | 45.995671 | 201 | 0.624753 |
b632d752e7a4ec9a3f81865609584ac913f18658 | 851 | py | Python | python/course/leetcode/1~27/20. Valid Parentheses_0416.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/course/leetcode/1~27/20. Valid Parentheses_0416.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/course/leetcode/1~27/20. Valid Parentheses_0416.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time:2020/6/21 16:22
# @Author:TimVan
# @File:20. Valid Parentheses.py
# @Software:PyCharm
class Solution:
def isValid(self, s: str) -> bool:
if len(s) % 2 == 1:
return False
bracketList = []
bracket = {"}": "{", "]": "[", ")": "("}
for i in ra... | 23 | 81 | 0.441833 |
fcb1c69540cca9981d9bbb01a2b414072e01cd55 | 1,746 | py | Python | test/test_arps_basics.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | test/test_arps_basics.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | test/test_arps_basics.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from dcapy import dca
class TestArpsBasic(unittest.TestCase):
def test_arps_exp_rate(self):
time1 = [0,2,3,4,10]
qi1 = 500
di1 = 0.3
result = dca.arps_exp_rate(time1,qi1,di1)
np.testing.assert_allclose(result,[500., 274.40581805, 203.2848... | 31.745455 | 106 | 0.598511 |
1e442b57a7d9a59f6cf6828f3b3ca7b66706c5eb | 2,957 | py | Python | research/cvtmodel/regnet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/regnet/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/regnet/export.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... | 39.959459 | 117 | 0.73791 |
1e45e9d1fe90a46b8988275c33cc9ad9bb3ff9cb | 447 | py | Python | 599-minimum-index-sum-of-two-lists/599-minimum-index-sum-of-two-lists.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 599-minimum-index-sum-of-two-lists/599-minimum-index-sum-of-two-lists.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 599-minimum-index-sum-of-two-lists/599-minimum-index-sum-of-two-lists.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def findRestaurant(self, list1: List[str], list2: List[str]) -> List[str]:
output = []
for item in set(list1)&set(list2):
output.append((list1.index(item)+list2.index(item), item))
soutput = sorted(output)
result = [soutput[0][1]]
minval = soutput[... | 37.25 | 78 | 0.550336 |
bf8cf476ad765135d8fc79b603ad7db78375c67a | 7,655 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/test/xdevice/src/xdevice/_core/environment/manager_env.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/test/xdevice/src/xdevice/_core/environment/manager_env.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/test/xdevice/src/xdevice/_core/environment/manager_env.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 32.436441 | 79 | 0.604703 |
44e315792cd103feb14822b6a2ffec1b40c62281 | 3,595 | py | Python | analyze/plots_for_variations.py | no-ora/solitadds | 18c5868af00441a8e67311679a0b848c836975d2 | [
"MIT"
] | null | null | null | analyze/plots_for_variations.py | no-ora/solitadds | 18c5868af00441a8e67311679a0b848c836975d2 | [
"MIT"
] | null | null | null | analyze/plots_for_variations.py | no-ora/solitadds | 18c5868af00441a8e67311679a0b848c836975d2 | [
"MIT"
] | null | null | null | import sys, re, pdb, os
import logging
import argparse
import numpy as np
import pandas as pd
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg
import datetime
import utils, data_helper
import applications
def draw_plots_for_month(ou... | 36.313131 | 107 | 0.680946 |
789bff666cbcb9ecbfe406836d206de8b13537af | 2,208 | py | Python | kernel/accounts/views.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/accounts/views.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/accounts/views.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | from django.urls import reverse_lazy
from django.views import generic
from django.shortcuts import render
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth import logout as auth_logout
from django.contrib.auth import authenticate
from django.contrib.auth import login
from django.http import ... | 26.926829 | 69 | 0.70788 |
17701216eaa5438ecb6e58da6cb93a8b545d79dc | 345 | py | Python | Lehrjahr_2/Modul_122/python/fib_rek.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 5 | 2015-05-19T14:26:53.000Z | 2016-06-24T17:03:03.000Z | Lehrjahr_2/Modul_122/python/fib_rek.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | null | null | null | Lehrjahr_2/Modul_122/python/fib_rek.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 6 | 2015-05-26T06:25:05.000Z | 2020-04-30T07:25:30.000Z | #!/usr/bin/python3.4
#
#SCRIPT: fib_rek.py
#AUTHOR: Severin Kaderli
#PURPOSE: Calculates Fibonacci sequence
#USAGE: ./fib_rek.py
number = input("Anzahl Zahlen: ")
def fibonacci(n):
if n <= 2:
return 1
else:
return fibonacci(n-1) + fibonacci(n-2)
for i in range(1, int(number)+1):
print("fib(" + str(i) + ") = " ... | 21.5625 | 57 | 0.655072 |
da61f69e449ca0d0821dcbb9eb2dfe87bb2a22ea | 1,232 | py | Python | Packs/Phishing/Scripts/LinkToPhishingCampaign/LinkToPhishingCampaign.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Phishing/Scripts/LinkToPhishingCampaign/LinkToPhishingCampaign.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Phishing/Scripts/LinkToPhishingCampaign/LinkToPhishingCampaign.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
BLACK_COLOR = "color:rgb(64,65,66)"
server_url = ""
html = ""
try:
incident = demisto.incidents()
incident_id = incident[0].get('id', {})
campaign_incident_id = str(incident[0].get('CustomFields', {}).get('partofc... | 36.235294 | 101 | 0.662338 |
97241ad77dffc0662a48a3b80887a6fc00f154d3 | 4,221 | py | Python | scripts/qt2/pyqt_sw10_TicTacToe.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt2/pyqt_sw10_TicTacToe.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt2/pyqt_sw10_TicTacToe.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
pyqt_sw10_TicTacToe.py
TicTacToe-Spiel mit QPushButton
erweitert durch Vererbung um
reihe, spalte
Author: Olaf Just
Website: robotik.bocholt@w-hs.de
Last edited: 20.11.2018
"""
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QWidget, QPushButton, QA... | 34.040323 | 115 | 0.563611 |
97549be845fc7056d7aa1f4cd1196d7ba0c91a8f | 4,420 | py | Python | src/util/genmod.py | CorvusPrudens/Corisc | e30abde099dc3c1979c2f7d7ff6d37f7d990f852 | [
"MIT"
] | null | null | null | src/util/genmod.py | CorvusPrudens/Corisc | e30abde099dc3c1979c2f7d7ff6d37f7d990f852 | [
"MIT"
] | null | null | null | src/util/genmod.py | CorvusPrudens/Corisc | e30abde099dc3c1979c2f7d7ff6d37f7d990f852 | [
"MIT"
] | null | null | null | from re import compile
import os
"""
NOTE -- this utility makes a few assumptions
1. The module's name is the same as its file
2. There's only one module per file
3. The indentation is 2 spaces
4. The search space isn't very big (careful with large submodules)
"""
param_regex = compile(r'module +([A-Za-z_][A-Za-z_0-9... | 35.079365 | 128 | 0.622172 |
979337af604a6c29ff56f8899382c8e20d9a56d2 | 2,534 | py | Python | Architectures/FeedForward.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | Architectures/FeedForward.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | 7 | 2020-07-19T03:29:21.000Z | 2022-03-02T06:46:12.000Z | Architectures/FeedForward.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | from keras.models import Sequential
from keras.layers import Dense
from keras.models import load_model
from Architectures.Algorithm import Algorithm
# noinspection PyMethodOverriding
class FeedForward(Algorithm):
''''A simple multilayer feed forward neural network
:param hidden_units: a list of ints specify... | 37.264706 | 108 | 0.672455 |
e7cb3f846fcf92be9b45815618ffa0df810d1de0 | 1,416 | py | Python | official/recommend/ncf/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/ncf/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/ncf/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.263158 | 78 | 0.614407 |
68effd42d94e534cc8d982b54b085ea2d2a0528b | 440 | py | Python | HackerRank/30-Days-of-Code/Day 1: Data Types/data_types.py | tareqmahmud/Competitive-Programming | ad5e53300d70280bccbd5046ca01278fb246f314 | [
"MIT"
] | 2 | 2020-11-19T19:03:28.000Z | 2021-01-04T19:52:11.000Z | 30-Days-of-Code/Day 1: Data Types/data_types.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | 30-Days-of-Code/Day 1: Data Types/data_types.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | # Read and save an integer, double, and String to your variables.
read_integer = int(input())
read_double = float(input())
read_string = input()
# Print the sum of both integer variables on a new line.
print(i + read_integer)
# Print the sum of the double variables on a new line.
print(d + read_double)
# Concatenate... | 27.5 | 65 | 0.743182 |
6bee7af92aac37e05732e141664125b5ea2e1d3f | 2,211 | py | Python | scripts/convert_posts.py | schlos/okfnde | 73080177564c6387c6bdcd4df3ccd9ba6f9eaa27 | [
"MIT"
] | null | null | null | scripts/convert_posts.py | schlos/okfnde | 73080177564c6387c6bdcd4df3ccd9ba6f9eaa27 | [
"MIT"
] | null | null | null | scripts/convert_posts.py | schlos/okfnde | 73080177564c6387c6bdcd4df3ccd9ba6f9eaa27 | [
"MIT"
] | null | null | null | import glob
import re
import yaml
import html2text
from lxml import html
html2text.config.UNICODE_SNOB = 1
BBCODE_RE = re.compile(r'\[\w+(?: \w+="[^"]*")*\](.*)\[/\w+\]', re.U | re.M)
TRAILING_WS = re.compile(r'\s*$')
def ydump(e):
return yaml.safe_dump(e, allow_unicode=True, default_flow_style=False, encodin... | 29.092105 | 105 | 0.524649 |
2e3bf15c80ed1d0d2edc76b73164742da2a65fef | 1,104 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_common_value_not_in_range.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_common_value_not_in_range.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_common_value_not_in_range.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from logging import getLogger
from typing import Any, List, Tuple
from watchmen_data_kernel.storage import TopicDataService
from watchmen_model.admin import Factor
from watchmen_model.dqc import MonitorRule
from watchmen_utilities import ArrayHelper, is_not_blank
from .types import RuleRe... | 33.454545 | 94 | 0.793478 |
d8861ff4b4daf8e94de846da62bc6c36764dcb76 | 2,571 | py | Python | 36. Validate Sudoku.py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | 1 | 2018-09-03T23:53:43.000Z | 2018-09-03T23:53:43.000Z | 36. Validate Sudoku.py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | null | null | null | 36. Validate Sudoku.py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | null | null | null | # problem description: https://leetcode.com/problems/valid-sudoku/description/
class Solution:
def isValidSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: bool
"""
# k is the row number of what you want to exam
# def exam_rows(board):
mistake... | 34.743243 | 105 | 0.489304 |
5ab034a5b640b05471213e1b2f8cd54a573c88bf | 1,118 | py | Python | books/PythonAutomate/phone_and_email.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/phone_and_email.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/phone_and_email.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pyperclip
import re
phone_regex = re.compile(r'''(
(\d{3}|\(\d{3}\))? # area code
(?:\s|-|\.)? # separator
(\d{3}) # first 3 digits
(?:\s|-|\.) # separator
(\d{4}) # last 4 digits
(\s*(ext|x|ext.)\s*(\d{2,5}))? # extension
)''', re.V... | 26.619048 | 55 | 0.526834 |
517ecdb528a2a98c27acdbc8853e25113e5d8650 | 3,604 | py | Python | site/public/courses/CS-1.2/Code/Simplified_Starter_Code/dictogram.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.2/Code/Simplified_Starter_Code/dictogram.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.2/Code/Simplified_Starter_Code/dictogram.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | from random import randint
class Dictogram:
def __init__(self, word_list):
'''Initializes the dictogram properties'''
self.word_list = word_list
self.dictionary_histogram = self.build_dictogram()
self.tokens = sum(self.dictionary_histogram.values())
se... | 39.173913 | 114 | 0.641232 |
cfa06bbcbd0dbcf32e61c57a4c460ea69dd5be38 | 10,685 | py | Python | examples/text_summarization/pointer_summarizer/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_summarization/pointer_summarizer/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_summarization/pointer_summarizer/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import paddle
import paddle.nn.initializer as I
import paddle.nn as nn
import paddle.nn.functional as F
import config
def paddle2D_scatter_add(x_tensor, index_tensor, update_tensor, dim=0):
dim0, dim1 = update_tensor.shape
update_tensor = paddle.flatten(update_tensor, start_axis=0, stop... | 38.297491 | 83 | 0.576696 |
8fb1c84cb9e02cdae69f7dad4fba23c961bd160b | 16,691 | py | Python | tests/data/test_blank_index.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | tests/data/test_blank_index.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | tests/data/test_blank_index.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | """
Test fence.blueprints.data.indexd.BlankIndex
"""
import json
import uuid
import copy
from unittest.mock import MagicMock
import mock
from mock import patch
import pytest
from fence.config import config
from fence.blueprints.data.indexd import BlankIndex, flask
from fence.errors import InternalError
def test_bl... | 33.249004 | 98 | 0.620933 |
8fd37b0218021e998c0378daab70afd8c5171897 | 41 | py | Python | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/05.Debugging.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/05.Debugging.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/05.Debugging.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | a = 2
x = 3
y = a
sm = x + y
print(sm)
| 5.125 | 10 | 0.414634 |
856b757f8306bc6ab35f55d298310586278f49c0 | 147 | py | Python | diversos/ListComrp.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/ListComrp.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/ListComrp.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | x = [1,2,3,4,5]
y = []
w = [ i for i in x if i%2==1]
for i in x:
y.append(i**2)
z = [i**2 for i in y]
print (x)
print (y)
print (z)
print (w) | 12.25 | 29 | 0.482993 |
857fecf835c960d630131479ffc4ae5d31b18c4c | 5,939 | py | Python | research/cv/ghostnet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ghostnet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ghostnet/train.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... | 42.120567 | 113 | 0.679071 |
a48b1553570479728f1cd97c22020abab0648a53 | 1,132 | py | Python | PMIa/2014/KHASANOVA_I_F/task_7_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/KHASANOVA_I_F/task_7_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/KHASANOVA_I_F/task_7_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 7. Вариант 30.
# Создайте игру, в которой компьютер загадывает название одного из двенадцати
# месяцев, а игрок должен его угадать.
# Khasanova I. F.
# 14.04.2016
import random
name = random.randint(1,12)
if name == 1 :
name = 'Январь'
elif name == 2 :
name = 'Февраль'
elif name == 3 :
name = '... | 19.186441 | 77 | 0.556537 |
74755b14579a3a3332f6a82718a0ffc7489c29a7 | 7,556 | py | Python | test/test_npu/test_network_ops/test_matmul.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_matmul.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_matmul.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... | 45.245509 | 102 | 0.573849 |
7794d15be825b7dd6d6cd995d1832ae05c17afd3 | 12,704 | py | Python | pupil_invisible_monitor/src/pupil_invisible_monitor/observable.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/src/pupil_invisible_monitor/observable.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/src/pupil_invisible_monitor/observable.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | """
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2018 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
----------------------------... | 39.453416 | 88 | 0.63972 |
77aac578fc3fc121120a66e8b88c60f7dc5f69c3 | 2,550 | py | Python | Anime/mudae_cogs/__init__.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | Anime/mudae_cogs/__init__.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | Anime/mudae_cogs/__init__.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | from datetime import datetime as dt, timedelta as td
from psycopg2 import connect, ProgrammingError
import pandas as pd, numpy as np
import sys
# ENV
with open('../.env') as f:
ENV = {l.strip().split('=')[0]: l.strip().split('=')[1] for l in f.readlines()}
# CONSTANTS
waifu_channel = 761112336286220309
mudae_id = 43... | 28.651685 | 111 | 0.696078 |
704cba5f39f5453836dea42d87dbbe9cd9b8167c | 1,307 | py | Python | src/comex_stat/assets/migrations/0005_auto_20181115_0203.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | src/comex_stat/assets/migrations/0005_auto_20181115_0203.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | src/comex_stat/assets/migrations/0005_auto_20181115_0203.py | mdicgovbr/2018.2-ComexStat | 9eb339e6995585061317d41eabed99b569472806 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-15 02:03
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assets', '0004_auto_20181115_0202'),
]
operations = [
migrations.AlterField(
model_name='ncm',
... | 43.566667 | 287 | 0.613619 |
3b4372ea3a849d959f04080b2b7fa1bd051fe3c6 | 1,851 | py | Python | research/cv/vit_base/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/vit_base/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/vit_base/postprocess.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.23913 | 107 | 0.667747 |
8e71d7f7b7d34c79b7e33922281097843ef849ca | 1,489 | py | Python | src/torch/contrib/npu/optimized_lib/module/preloader.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | src/torch/contrib/npu/optimized_lib/module/preloader.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | src/torch/contrib/npu/optimized_lib/module/preloader.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... | 33.088889 | 96 | 0.65413 |
ebdca7bfe669c2f31d3019aebcbd17231677f34c | 577 | py | Python | ProjectEuler_plus/euler_055.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_055.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_055.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict
def is_palindromic(n):
return n == n[::-1]
def e55():
d = defaultdict(int)
n = int(input().strip())
for i in range(1, n + 1):
if is_palindromic(str(i)):
d[i] += 1
continue
num = i
for j in ran... | 20.607143 | 56 | 0.495667 |
6908ed7887534a8f0530564dbf878d5cd1af0dca | 3,449 | py | Python | src/http_.py | yunyuyuan/wuziqi-back | 448632e4eee81f411564e2e9199fb603029e8008 | [
"MIT"
] | null | null | null | src/http_.py | yunyuyuan/wuziqi-back | 448632e4eee81f411564e2e9199fb603029e8008 | [
"MIT"
] | null | null | null | src/http_.py | yunyuyuan/wuziqi-back | 448632e4eee81f411564e2e9199fb603029e8008 | [
"MIT"
] | null | null | null | from src import app, tables, find_table, lock
from flask import jsonify, request
from time import time
from secrets import token_hex
from src.socket_ import socket_io
@app.route('/get_table', methods=['post'])
def get_table():
return jsonify(list(map(lambda item: {
'player1': {
'nick'... | 28.983193 | 122 | 0.443897 |
d6932a722ecaacd9a761dd3893fe1e96534410b7 | 434 | py | Python | python/extend_to_c/py_prime.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/extend_to_c/py_prime.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/extend_to_c/py_prime.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import time
def isPrime(n):
for num in range(2, n//2):
if n%num == 0:
return False
return True
def kth_prime(k):
candidate = 2
while k:
if isPrime(candidate):
k -= 1
candidate += 1
return candidate - 1
# Driver code
start = time.time()
print(kth_... | 18.869565 | 60 | 0.585253 |
d69f0f8a18c8e5d58d23bdf9fd12bf14d8593fce | 72 | py | Python | RunFaster/simple_workouts/processor_count.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | RunFaster/simple_workouts/processor_count.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | RunFaster/simple_workouts/processor_count.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | import multiprocessing
print("No of cpu:", multiprocessing.cpu_count()) | 24 | 48 | 0.791667 |
d6db693e4557481fb28baf26740eb8482d29f46a | 6,008 | py | Python | transonic/backends/for_classes.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/backends/for_classes.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/backends/for_classes.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """Make the Pythran files for the classes
=========================================
"""
from tokenize import tokenize, untokenize, NAME, OP
# from token import tok_name
import inspect
from io import BytesIO
from transonic.signatures import compute_signatures_from_typeobjects
# from transonic.log import logger
from... | 30.190955 | 82 | 0.619674 |
ba513a728502427a4f8dd346acf6a2475a74e317 | 233 | py | Python | python/deep_learning/Socratica/numbers.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/deep_learning/Socratica/numbers.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/deep_learning/Socratica/numbers.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # Types of numbers : int, long, float, complex
# whole numbers : int, long
a = 28
print(type(a)) # to see the type of a
#a
import sys
print(sys.maxint)
# creation of complex numbers
z = 3 + 5.7j
print(z.real)
print(z.imag)
| 10.590909 | 46 | 0.656652 |
ba9ab166770eda562e77b3dc458a845223457d25 | 6,552 | py | Python | Packs/AzureWAF/Integrations/AzureWAF/AzureWAF_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AzureWAF/Integrations/AzureWAF/AzureWAF_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AzureWAF/Integrations/AzureWAF/AzureWAF_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import AzureWAF as waf
import demistomock as demisto
GET_COMMAND_DATA = [
(
{'policy_name': 'pol1', 'resource_group_name': 'res1', 'verbose': 'false', 'limit': '10'},
# args, case: custom resource_group
{"method": "GET",
"url_suffix":
"/resourceGroups/res... | 36.198895 | 118 | 0.625305 |
3073171302b064d6e359fb70f34e5c02077bbde6 | 3,314 | py | Python | pylvm2/pylvm/objects.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | pylvm2/pylvm/objects.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | pylvm2/pylvm/objects.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | PETA_SUFFIX = "PB"
TERA_SUFFIX = "TB"
GIGA_SUFFIX = "GB"
MEGA_SUFFIX = "MB"
KILO_SUFFIX = "KB"
BYTE_SUFFIX = "Bytes"
class Volume:
def __init__(self, name, path, vgname, used, attr, uuid):
self.name = name
self.path = path
self.vgname = vgname
self.used = used
self.attr = attr
self.uuid = uuid
self.prop... | 27.616667 | 92 | 0.703983 |
23813731bc980ff367b439df2b2fb33c01a87f08 | 2,437 | py | Python | DriverBehaviorAnalyser/Demo.py | kharezga/DBA | cc3ab4c4080b0083ab7022c1412e5667aaa59f5d | [
"MIT"
] | null | null | null | DriverBehaviorAnalyser/Demo.py | kharezga/DBA | cc3ab4c4080b0083ab7022c1412e5667aaa59f5d | [
"MIT"
] | null | null | null | DriverBehaviorAnalyser/Demo.py | kharezga/DBA | cc3ab4c4080b0083ab7022c1412e5667aaa59f5d | [
"MIT"
] | null | null | null | # This file contains all demo functions
import numpy as np
import mediapipe as mp
import cv2 as cv
import os
def faceRecognition():
actions = np.array(['left', 'right', 'straight'])
DATA_PATH = os.path.join('Extracted_Values')
mp_holistic = mp.solutions.holistic # Holistic model
mp_drawing = mp.solu... | 44.309091 | 121 | 0.555191 |
9d7b5a4c81b52b574d880b59347f4479d6d309ab | 10,998 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/pre_settings.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/pre_settings.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/pre_settings.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# -*- codi... | 31.603448 | 123 | 0.614112 |
9dbce493865350ecaeb57a653bbc413f22a2ee7f | 764 | py | Python | app/validators/user.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | app/validators/user.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | app/validators/user.py | zucc-acm-devteam/zuccacm-sso | 9c7d2f0b9cc069962f32b555152732a98bf2e94a | [
"Apache-2.0"
] | null | null | null | from app.validators.base import BaseForm
from wtforms.fields import StringField
from wtforms.validators import DataRequired, ValidationError
from app.models.user import User
class RegisterForm(BaseForm):
username = StringField(validators=[DataRequired(message='用户名不能为空')])
password = StringField(validators=[D... | 36.380952 | 89 | 0.763089 |
88a5877601e277ed38c350d3911ebea9ed11e3fd | 529 | py | Python | ProjectEuler_plus/euler_065.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_065.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_065.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
N = int(input().strip())
if N == 1:
print(2)
sys.exit(1)
elif N == 2:
print(3)
sys.exit(1)
n = [8, 11, 8 + 11]
d = [3, 4, 3 + 4]
i = 5
M = 4
while i < N + 1:
if i % 3 == 0:
n[0] = n[2] * M + n[1]
d[0] = d[2] * M + d[1]
M += 1
elif i % ... | 17.064516 | 37 | 0.351607 |
6d7aff6334726df4ff58b5fde3dbc5243df5eb3e | 535 | py | Python | src/visuanalytics/tests/server/test_init.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/server/test_init.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/server/test_init.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | """Enthält Initialisierungsfunktionen für Flask Server Testmodule."""
from visuanalytics.server import server
def setup_client():
"""Flask Server Testclient einrichten.
erstellt, eine neue Flask Server Instanz,
konfiguriert diese zum Testen und erstellten einen Test Client.
:return: einen Server Tes... | 28.157895 | 69 | 0.738318 |
61e98623c759f274301cf4f7d4cc2409fcbe64c2 | 9,751 | py | Python | src/onegov/gazette/forms/notice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/forms/notice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/forms/notice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.form import Form
from onegov.form.fields import ChosenSelectField
from onegov.form.fields import PhoneNumberField
from onegov.gazette import _
from onegov.gazette.fields import MultiCheckboxField
from onegov.gazette.layout import Layout
from onegov.gazette.models import Category
fr... | 32.075658 | 78 | 0.609681 |
fed5a47a4abd60a767cd616fca98a5962774b2a8 | 849 | py | Python | scenarios/base_env.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | scenarios/base_env.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | scenarios/base_env.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | class BaseScenario:
def __init__(self):
return
def render(self):
raise NotImplementedError
def get_obs(self):
obs = None
return obs
def get_adj(self):
adj = None
return adj
def get_done(self):
done = None
return done
de... | 22.342105 | 58 | 0.600707 |
aaea0d00857ef40813f765e538b864763a2e2807 | 794 | py | Python | python/logging/lowermodule_json.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/logging/lowermodule_json.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/logging/lowermodule_json.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import logging.config
import traceback
import time
logger = logging.getLogger(__name__)
logging.config.fileConfig('logging2.conf', disable_existing_loggers=False)
def word_count(myfile):
try:
starttime = time.time()
with open(myfile, 'r') as f:
file_data = f.read()
words =... | 27.37931 | 100 | 0.630982 |
c951e2bd9e42b1d6fce6742bf8e95d5cd1cea8ab | 1,493 | py | Python | source/pkgsrc/devel/meson/patches/patch-mesonbuild_environment.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/meson/patches/patch-mesonbuild_environment.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/meson/patches/patch-mesonbuild_environment.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-mesonbuild_environment.py,v 1.4 2020/07/28 23:28:23 tnn Exp $
Specify c++ language when making CXX parse standard input.
Fixes problem where graphics/MesaLib fails to build due to:
> clang++ -std=c++14 -dM -E -
> error: invalid argument '-std=c++14' not allowed with 'C'
--- mesonbuild/environment.py.o... | 42.657143 | 104 | 0.567314 |
a31930420bf346f432556ba5cf227b09ea0f68b7 | 62 | py | Python | tests/__init__.py | samanmon/che696_fall2018 | 07a141d2655cbf4bfefae0fadb4fadff9c2b09b8 | [
"MIT"
] | null | null | null | tests/__init__.py | samanmon/che696_fall2018 | 07a141d2655cbf4bfefae0fadb4fadff9c2b09b8 | [
"MIT"
] | null | null | null | tests/__init__.py | samanmon/che696_fall2018 | 07a141d2655cbf4bfefae0fadb4fadff9c2b09b8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Unit test package for lin_reg."""
| 15.5 | 36 | 0.564516 |
6e2974424c0f2effef9a21da5ae37afe8ff7f906 | 3,333 | py | Python | easyp2p/platforms/viainvest.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/platforms/viainvest.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/platforms/viainvest.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # Copyright (c) 2018-2020 Niko Sandschneider
"""
Download and parse Viventor statement.
"""
import pandas as pd
from easyp2p.p2p_parser import P2PParser
from easyp2p.p2p_session import P2PSession
from easyp2p.platforms.base_platform import BasePlatform
class Viainvest(BasePlatform):
"""
Contains methods ... | 35.084211 | 80 | 0.631563 |
957e48aead4491d7a8bc5abbd82fd8dc06e89da7 | 8,858 | py | Python | Fortgeschrittenenpraktikum/Protokolle/V61_HeNe_Laser/Python/auswertung.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2019-03-07T08:55:36.000Z | 2019-04-22T18:13:03.000Z | Fortgeschrittenenpraktikum/Protokolle/V61_HeNe_Laser/Python/auswertung.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | null | null | null | Fortgeschrittenenpraktikum/Protokolle/V61_HeNe_Laser/Python/auswertung.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2017-10-27T13:26:43.000Z | 2018-01-13T09:12:24.000Z | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from uncertainties import ufloat
import uncertainties.unumpy as unp
from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
from pint import UnitRegistry
u = UnitRegistry()
Q_ = u.Quantity
def Polarisationsmess... | 40.447489 | 162 | 0.687175 |
66e97e6dcb03946aee2d3e72e29c9f92609ced96 | 210 | py | Python | quant/example/ex_coinegg.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/example/ex_coinegg.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/example/ex_coinegg.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# python -m quant.example.ex_coinegg
from quant.api.coinegg import PublicClient
client = PublicClient()
print(client.ticker('bcc'))
# print(client.depth('bcc'))
| 19.090909 | 42 | 0.704762 |
c6b5d7a56e6ca93cc417f0cc0ed203dab6665490 | 1,123 | py | Python | books/PythonAutomate/sending_mail_message/random_chores.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/sending_mail_message/random_chores.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/sending_mail_message/random_chores.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """random_chores.py
사람들의 이메일 주소 목록과 해야 할 잡일 목록을 받고,
무작위로 할당해 메일 보내기
"""
import smtplib
import random
from settings import GMAIL_ID, GMAIL_PW
# Context Manager 사용
class MailServer(object):
def __init__(self, id, pw):
print("Connect Gmail SMTP server")
self.smtp_obj = smtplib.SMTP_SSL(host="smtp.gma... | 25.522727 | 74 | 0.595726 |
a5a25f8f9a47e29d65f8665764a66b174c9c0bac | 7,970 | py | Python | udm-bildungslogin/ucs-test/97_bildungslogin_udm/000_encoders.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | udm-bildungslogin/ucs-test/97_bildungslogin_udm/000_encoders.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | udm-bildungslogin/ucs-test/97_bildungslogin_udm/000_encoders.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 -*-
## desc: Test simple UDM API encoders for bildungslogin/*
## roles: [domaincontroller_master, domaincontroller_backup, domaincontroller_slave]
## exposure: dangerous
## tags: [bildungslo... | 41.295337 | 109 | 0.671016 |
b1eb980cdcf26e0bc271839fdad2419f3beee112 | 630 | py | Python | api/urls.py | aidun/seite50 | 761a8e76f9e4473f70a8705dce169d61bf660267 | [
"Apache-2.0"
] | null | null | null | api/urls.py | aidun/seite50 | 761a8e76f9e4473f70a8705dce169d61bf660267 | [
"Apache-2.0"
] | 2 | 2018-05-11T18:26:18.000Z | 2018-05-12T18:49:38.000Z | api/urls.py | aidun/seite50 | 761a8e76f9e4473f70a8705dce169d61bf660267 | [
"Apache-2.0"
] | 1 | 2018-10-10T19:52:17.000Z | 2018-10-10T19:52:17.000Z | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from api.views.author import CreateAuthorView, DetailsAuthorView
from api.views.book import CreateBookView, DetailsBookView
urlpatterns = {
url(r'book/$', CreateBookView.as_view(), name="create_book"),
url(r'book/(?P... | 35 | 71 | 0.712698 |
3cd7026995c921b5cc81fcdaf9448c2acdbd9fa7 | 2,403 | py | Python | Einkommenssteuertarif.py | ThoEngel/rentenplanung | 879c9a678ba1ff951a1f92b0c42673a7943a18e6 | [
"MIT"
] | 3 | 2022-01-01T18:24:46.000Z | 2022-01-08T15:28:46.000Z | Einkommenssteuertarif.py | ThoEngel/Finanzen-Simuliert | 879c9a678ba1ff951a1f92b0c42673a7943a18e6 | [
"MIT"
] | null | null | null | Einkommenssteuertarif.py | ThoEngel/Finanzen-Simuliert | 879c9a678ba1ff951a1f92b0c42673a7943a18e6 | [
"MIT"
] | null | null | null | '''
Vorsicht vor der 4% Regel (Teil 3) – welchen Einfluss haben Steuern auf die sichere Entnahmerate?
Sichere Entnahmerate mit Steuer
https://www.finanzen-erklaert.de/vorsicht-vor-der-4-regel-teil-3-welchen-einfluss-haben-steuern-auf-die-sichere-entnahmerate/
'''
import pandas as pd
import time
import plotly.expres... | 27.62069 | 125 | 0.714524 |
05505ac787221a9fc985d59222cad449d34ef8c8 | 268 | py | Python | 01_class/sub_class.py | wuyueCreator/python-test | 6072ac9264a257c89925469238c14fff3bda5630 | [
"MIT"
] | 1 | 2019-03-25T03:44:54.000Z | 2019-03-25T03:44:54.000Z | 01_class/sub_class.py | wuyueCreator/python-test | 6072ac9264a257c89925469238c14fff3bda5630 | [
"MIT"
] | null | null | null | 01_class/sub_class.py | wuyueCreator/python-test | 6072ac9264a257c89925469238c14fff3bda5630 | [
"MIT"
] | null | null | null | from .base_model import BaseModel
import os
class Model1(BaseModel):
def init_subclass_basename(self):
# Do something init _subclass_basename
self._subclass_basename = os.path.basename(__file__)
if __name__ == '__main__':
print(Model1()())
| 20.615385 | 60 | 0.716418 |
e9a3ea191542946cf0ae48ab17e038e55e9e11a6 | 317 | py | Python | benchmark/ldbc/download-benchmark-data.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | benchmark/ldbc/download-benchmark-data.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | benchmark/ldbc/download-benchmark-data.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import urllib.request
import tarfile
import tempfile
import os
dirname = os.path.dirname(os.path.realpath(__file__))
tf = tempfile.NamedTemporaryFile()
urllib.request.urlretrieve('https://github.com/cwida/duckdb-data/releases/download/v1.0/ldbc-snb-sf0.1.tar.gz', tf.name)
tarfile.open(tf.name).extractall(dirname)
| 28.818182 | 120 | 0.794953 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.