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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
955a09282bf250c467f9451b291ec2f791f99331 | 202 | py | Python | 10.3389/fevo.2021.762173/scripts/rename.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fevo.2021.762173/scripts/rename.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fevo.2021.762173/scripts/rename.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | import os
import sys
in_fname = sys.argv[1]
out_fname = in_fname.replace(' ', 'sp')
out_fname = out_fname.replace('(', 'lb')
out_fname = out_fname.replace(')', 'rb')
os.rename(in_fname, out_fname)
| 15.538462 | 40 | 0.683168 |
6c177d82d2f741222b6853683ca39cd1a6cffad9 | 394 | py | Python | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_service_unit/patient_service_unit.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_service_unit/patient_service_unit.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_service_unit/patient_service_unit.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, earthians and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.utils.nestedset import NestedSet
class PatientServiceUnit(NestedSet):
nsm_parent_field = 'parent_patient_service_unit'
def on_update(self):... | 26.266667 | 49 | 0.78934 |
6c5773a8df5613afdb44dc1cff7a374e3c871810 | 100 | py | Python | Curso_Python/Secao2-Python-Basico-Logica-Programacao/4/aula4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/4/aula4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/4/aula4.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | #print(1234)
#print('luiz', 'otavio', sep='-', end='')
print('João', 'e', 'Maria', sep='-', end='')
| 25 | 44 | 0.51 |
6619f675b61f3b98a2e6036b8e7785d7206b9cbf | 486 | py | Python | nz_django/day6/model_form_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day6/model_form_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day6/model_form_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.db import models
from django.core import validators
class Book(models.Model):
title = models.CharField(max_length=100)
page = models.IntegerField()
price = models.FloatField(validators=[validators.MaxValueValidator(limit_value=1000)])
class User(models.Model):
username = models.CharField(... | 34.714286 | 102 | 0.759259 |
c6bdb320be1e95cb1a52fe124f030133ea3333cb | 471 | py | Python | Algorithms/Strings/caesar_cipher.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/caesar_cipher.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/caesar_cipher.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
n = int(input().strip())
S = input().strip()
k = int(input().strip())
for s in S:
if ord(s) > 64 and ord(s) < 91: # A to Z, 65 - 90
new_s = ord(s) + (k % 26)
while new_s > 90:
new_s -= 26
elif ord(s) > 96 and ord(s) < 123: # a to z, 97 - 122
... | 23.55 | 58 | 0.471338 |
af520f47a493170c83c92e394126bab322bd0dbd | 79 | py | Python | examples/adminEx2/ex/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/adminEx2/ex/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/adminEx2/ex/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.apps import AppConfig
class ExConfig(AppConfig):
name = 'ex'
| 13.166667 | 33 | 0.721519 |
af8cb7ad9219f8bce2ce97261ea078d3a90c4a83 | 28,600 | py | Python | SBTK_League_Helper/TUTORIAL.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/TUTORIAL.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/TUTORIAL.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | ##########################################################################
## A Comfortably Executable Walk-Through. ##
## ##
## I'll keep this file as clean as possible, so that it is literally & ##
## straight-forwardl... | 38.964578 | 150 | 0.524196 |
3c367fa8b3165075d6fcc3c52d25ee20aa8becaf | 248 | py | Python | erpnext_documentation/www/docs/index.py | gwhitney/erpnext_documentation | 0eafc5876dfc06ad071524d84863adf2a8ab1ec6 | [
"MIT"
] | 67 | 2020-03-10T18:11:31.000Z | 2022-03-11T16:51:25.000Z | erpnext_documentation/www/docs/index.py | gwhitney/erpnext_documentation | 0eafc5876dfc06ad071524d84863adf2a8ab1ec6 | [
"MIT"
] | 106 | 2020-04-06T06:49:17.000Z | 2021-07-23T01:13:59.000Z | erpnext_documentation/www/docs/index.py | gwhitney/erpnext_documentation | 0eafc5876dfc06ad071524d84863adf2a8ab1ec6 | [
"MIT"
] | 162 | 2020-02-25T07:17:08.000Z | 2022-03-17T08:25:29.000Z | # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def get_context(context):
frappe.flags.redirect_location = '/'
raise frappe.Redirect | 27.555556 | 68 | 0.774194 |
59b03744617720cd05668b4af2cc89c20b0d03b1 | 1,719 | py | Python | PyQT5/template/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | PyQT5/template/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | PyQT5/template/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | """
This is an example of a basic UI top level module.
Most of the GUI work is handled in the "central" widget.
This level handles signal/slot connections so all the different
level can interact
"""
import logging
import PyQt5
import PyQt5.QtCore
import PyQt5.QtWidgets
import UI_Widget
class UI(PyQt5.QtWidgets.QMai... | 28.65 | 85 | 0.666085 |
59e596e269046dfe2bec94e0f112f2bc17870f0b | 698 | py | Python | Imgenes_sat.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | Imgenes_sat.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | Imgenes_sat.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | # Funciones en Modulo Personal
import module_functions
import urllib.request
module_functions.clear()
#URL = 'https://estaticos.smn.gob.ar/vmsr/satelite/TOP_C13_CEN_ALTA_20200517_212015Z.jpg' # El link de la imagen
# url = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS5yeB4na6pQStQjUiiqOdwdiF_MqXI5gBCkBGV6f... | 27.92 | 118 | 0.729226 |
e97ad2aa1e83d02647b795de337d0e04809c7bb6 | 1,168 | py | Python | Uebung8/Aufgabe22.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-18T19:10:06.000Z | 2018-04-18T19:10:06.000Z | Uebung8/Aufgabe22.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | null | null | null | Uebung8/Aufgabe22.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-29T08:48:00.000Z | 2018-04-29T08:48:00.000Z | def zulaessig(stellung):
n = len(stellung)
for i in range(n-1):
if stellung[i] == stellung[n-1]:
return False
if abs(stellung[i]-stellung[n-1]) == n-1-i:
return False
return True
def vervollstaendige(stellung, count = 0):
global counter
counter = count
#s... | 22.461538 | 57 | 0.612158 |
e99ea1495d74a3342565827516aabc1d03bc2531 | 7,770 | py | Python | Packs/MicrosoftAdvancedThreatAnalytics/Integrations/MicrosoftAdvancedThreatAnalytics/MicrosoftAdvancedThreatAnalytics_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicrosoftAdvancedThreatAnalytics/Integrations/MicrosoftAdvancedThreatAnalytics/MicrosoftAdvancedThreatAnalytics_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicrosoftAdvancedThreatAnalytics/Integrations/MicrosoftAdvancedThreatAnalytics/MicrosoftAdvancedThreatAnalytics_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import io
import json
ATA_CENTER_URL = 'https://atacenter.contoso.com/api/management'
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def test_get_suspicious_activity(requests_mock):
"""
Given:
- Microsoft ATA client
When:
... | 30.590551 | 114 | 0.717503 |
f939c59bccf94d8fb7820ebf42b777f5fb8821ef | 382 | py | Python | deprecated/benchmark/ps/distribute_word2vec/paddle/eval.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/ps/distribute_word2vec/paddle/eval.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/ps/distribute_word2vec/paddle/eval.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | from model import word2vec
import paddle.fluid as fluid
from argument import params_args
import os
params = params_args()
model = word2vec()
model_path = params.test_model_dir
result = {}
files = os.listdir(model_path)
for model_dir in files:
epoch = model_dir.split('_')[-1]
print "process %s" % model_dir
... | 23.875 | 64 | 0.746073 |
f9ba77ce69edb3793e0aba0eb0b7ceb8f834c1f6 | 739 | py | Python | src/aijack/attack/inversion/utils/distance.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/attack/inversion/utils/distance.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/attack/inversion/utils/distance.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | def l2(fake_gradients, received_gradients, gradient_ignore_pos):
distance = 0
for i, (f_g, c_g) in enumerate(zip(fake_gradients, received_gradients)):
if i not in gradient_ignore_pos:
distance += ((f_g - c_g) ** 2).sum()
return distance
def cossim(fake_gradients, received_gradients, gr... | 36.95 | 76 | 0.641407 |
f9d95a766b68b153d14e4237318e7addc1024f31 | 4,430 | py | Python | Packs/epo/Scripts/EPOFindSystem/EPOFindSystem.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/epo/Scripts/EPOFindSystem/EPOFindSystem.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/epo/Scripts/EPOFindSystem/EPOFindSystem.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def createSystemContext(system):
context = {}
context["AutoID"] = system["EPOBranchNode.AutoID"]
context["CPUSerialNum"] = system["EPOComputerProperties.CPUSerialNum"]
context["CPUSpeed"] = system["EPOComputerPr... | 56.075949 | 116 | 0.719639 |
fb1ee42c90a0ba7728e135239a33a53b2c77a28a | 4,651 | py | Python | VirusCrafter-master/ViruzCrafter.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | VirusCrafter-master/ViruzCrafter.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | VirusCrafter-master/ViruzCrafter.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | �
��=[c @ s� d d l Z d d l Z d d l Z d � Z d � Z d � Z d Z d Z d Z d Z d Z
d
Z d Z e j
d � d
e e f GHe j
d � d e GHd e
GHd e GHd e
GHd e GHd e
GHd e GHd e
GHd e GHd e
GHd e GHe d � Z e d k se d k r9... | 54.081395 | 1,331 | 0.459041 |
1fa82154815bd226258a8217443fc7c46edfd572 | 1,871 | py | Python | Build a Water Hack/web_plants.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-05T14:30:34.000Z | 2021-07-05T14:30:34.000Z | Build a Water Hack/web_plants.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-02T15:36:02.000Z | 2021-07-02T15:37:25.000Z | Build a Water Hack/web_plants.py | Akshu-on-github/MLH-INIT-2022 | cf3fbbc8abd3eae3b958d3d482ed1fa1467f559e | [
"MIT"
] | 1 | 2021-07-02T15:15:17.000Z | 2021-07-02T15:15:17.000Z | from flask import Flask, render_template, redirect, url_for
import psutil
import datetime
import water
import os
app = Flask(__name__)
def template(title = "Ish's Watering Depot", text = ""):
now = datetime.datetime.now()
timeString = now
templateDate = {
'title' : title,
'time' : timeStri... | 27.514706 | 69 | 0.614645 |
1fbc6dc04ef276553bfb05fab91924311865f39e | 449 | py | Python | Algorithms/Greedy/grid_challenge.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Greedy/grid_challenge.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Greedy/grid_challenge.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
for _ in range(int(input().strip())):
arr = [list(input()) for _ in range(int(input().strip()))]
new_arr = []
for ar in arr:
temp = ([ord(a) for a in ar])
new_arr.append(sorted(temp))
for i in range(0, len(new_arr) - 1):
if new_arr[i + 1][0] <... | 24.944444 | 85 | 0.512249 |
1f1acde1151d9a6cc6f9c085f58f2ac5100f1b85 | 180 | py | Python | model.py | Mayner0220/DUA | 2d53045689812cae96f32d943bda33bdde068992 | [
"MIT"
] | null | null | null | model.py | Mayner0220/DUA | 2d53045689812cae96f32d943bda33bdde068992 | [
"MIT"
] | null | null | null | model.py | Mayner0220/DUA | 2d53045689812cae96f32d943bda33bdde068992 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.layers import *
class Model(tf.keras.Model):
def __init__(self):
super(Model, self).__init__()
self.lstm = LSTM() | 25.714286 | 37 | 0.677778 |
c86531ebda5631ee36b9684e31eb266b26f06484 | 981 | py | Python | src/SurfaceInfos/SurfaceInfoNoContext.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/SurfaceInfos/SurfaceInfoNoContext.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/SurfaceInfos/SurfaceInfoNoContext.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | from src.Texture import Texture
import json
from src.SurfaceInfos.SurfaceInfo import SurfaceInfo
class SurfaceInfoNoContext(SurfaceInfo):
"""
SurfaceInfo is a class to store information about the surface of a FESS
"""
def __init__(self, function_name, args):
super().__init__(function_name, ar... | 30.65625 | 105 | 0.66055 |
f19b601aa22abb1b0ec22925adf8516592ac343b | 836 | py | Python | veras/route_database.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | veras/route_database.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | veras/route_database.py | Slanman3755/VERAS | 07a6b26f9360e7bc605b767489cc86c683b57fae | [
"MIT"
] | null | null | null | from neo4j import GraphDatabase
class RouteDatabase:
def __init__(self, uri, user, password):
self.driver = GraphDatabase.driver(uri, auth=(user, password))
def close(self):
self.driver.close()
def print_route(self, origin, destination):
with self.driver.session() as session:
... | 38 | 113 | 0.636364 |
9e6df1b085fd8146d6edae666e6954eff8adaaaf | 729 | py | Python | Fastir_Collector/hooks/hook-cachedns.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/hooks/hook-cachedns.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/hooks/hook-cachedns.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | import sys
if sys.maxsize > 2 ** 32:
datas = [("./../_x64/boost_python-vc120-gd-1_55.dll", ''),
("./../_x64/boost_python-vc120-gd-1_55.lib", ''),
("./../_x64/boost_python-vc120-mt-gd-1_55.lib", ''),
("./../_x64/msvcp120d.dll", ''),
("./../_x64/msvcr120d.dll", ''... | 33.136364 | 65 | 0.449931 |
8d4ec11d3c9de6e0e94be644c50f3019d39398b5 | 11,659 | py | Python | v2/es.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | 1 | 2021-03-31T03:41:06.000Z | 2021-03-31T03:41:06.000Z | v2/es.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | v2/es.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3.9
# vim: ts=2 sw=2 sts=2 et :
"""
espy : version2, optimization via data mining
(c) 2021, Tim Menzies, http://unlicense.org
:-------:
| Ba | Bad <----.
| 56 | |
:-------:------: |
| B | v explore =... | 31.007979 | 80 | 0.499614 |
8d740185f90ffb574e48034bc72dd47a314b1870 | 410 | py | Python | Coursera/Python Data Structures/Assignment-8.5.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Python Data Structures/Assignment-8.5.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Python Data Structures/Assignment-8.5.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | if __name__ == '__main__':
fname = input("Enter file name: ")
if len(fname) < 1:
fname = "mbox-short.txt"
fh = open(fname)
con = 0
for line in fh:
line = line.strip()
if not line.startswith('From '):
continue
ls = line.split()
print(ls[1])
... | 24.117647 | 78 | 0.526829 |
93fd824ae0b86d7fb95b799e338e438ec8ab3771 | 191 | py | Python | python/decorator/function_argument.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/function_argument.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/function_argument.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def say_hello(name):
print(f'Hello, {name}')
def say_goodbye(name):
print(f'Goodbye, {name}')
def say_to_bob(func):
func('Bob')
say_to_bob(say_hello)
say_to_bob(say_goodbye) | 13.642857 | 29 | 0.680628 |
f5a8123eccd291950b5ff60fcd9c21b5da28c751 | 325 | py | Python | webapp/dash_tutorial/authentication.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/dash_tutorial/authentication.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/dash_tutorial/authentication.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import dash
import dash_auth
import dash_html_components as html
VALID_USERNAME_PASSWORD_PAIRS = [
['hello', 'world']
]
app = dash.Dash('auth')
auth = dash_auth.BasicAuth(
app,
VALID_USERNAME_PASSWORD_PAIRS
)
app.layout = html.H1(
children='Hello World'
)
if __name__ == '__main__':
app.run_ser... | 14.772727 | 35 | 0.704615 |
27a11b5ace0e64174e193ec26c80fddcc19db19d | 925 | py | Python | 20-fs-ias-lec/groups/01-dev2dev/Code/application/playground.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/01-dev2dev/Code/application/playground.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/01-dev2dev/Code/application/playground.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z |
from logMerge.PCAP import PCAP
import os
try:
print("payload")
for file in os.listdir("payload"):
packets_list = PCAP.read_pcap("payload/" + file)
print(packets_list)
print("peer payload")
for file in os.listdir("peerPayload"):
packets_list = PCAP.read_pcap("peerPayload/" + fil... | 23.125 | 122 | 0.665946 |
27d61ed6447855e149b9975e3b12c63e77594751 | 2,592 | py | Python | pyUnnenberg/play_audiofile.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | pyUnnenberg/play_audiofile.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | pyUnnenberg/play_audiofile.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from contextlib import closing
import alsaaudio, wave, time
from itertools import izip_longest
import logging
from logging_helper import *
# module-level logger
ml = logging.getLogger('PAF')
ml.addHandler(logging.NullHandler())
ml = LazyLoggerAdapter(ml)
def _pad(n, it... | 28.483516 | 110 | 0.648534 |
a90531296929af2180c850839f36a265e8fd6471 | 588 | py | Python | checklisten/templatetags/t_checklisten/get_perms.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/checklisten/templatetags/t_checklisten/get_perms.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/checklisten/templatetags/t_checklisten/get_perms.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django import template
from checklisten.models import ChecklisteRecht
register = template.Library()
@register.filter
def get_perms(checklist_id):
"""
Gets all ChecklisteRecht objects that belong to the Checkliste identified by checklist_id.
:param checklist_id: The ID of the Checkliste to fetch the... | 30.947368 | 94 | 0.770408 |
8bd5bf4aaa530717330b62f07bcde38c1f274981 | 727 | py | Python | backend/app/schemas/task_statistic.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/app/schemas/task_statistic.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/schemas/task_statistic.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from datetime import datetime
from typing import List, Union
from pydantic import BaseModel
from app.schemas.polygon_data import AnnotationData
from app.schemas.task import TaskFeedback
class TaskStatisticBase(BaseModel):
user_id: int
task_id: int
base_task_id: int
solved_date: datetime... | 19.648649 | 58 | 0.727648 |
47dd94724cdb4512fcc494a0741a19f91199374e | 189 | py | Python | 02_Python/square.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/square.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/square.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | from functions import square
# Or import functions and call functions.square
def main():
for i in range(9):
print(square(i))
return
if __name__ == '__main__':
main()
| 15.75 | 47 | 0.650794 |
4bca2aebc55bd9049fbdf0961f662f1580b5dc40 | 1,834 | py | Python | p01/src/hello.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/hello.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/src/hello.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import asyncio
import time
import producer
import json
p1 = producer.MyProducter()
async def fun1(a,b,result):
p1.publish("fun1. running")
await asyncio.sleep(2)
result["c"] = a+b
#print(f"fun1 {c}")
p1.publish("fun1. done")
p1.publish(json.dumps(result))
async def fu... | 20.606742 | 55 | 0.625954 |
f5ee3cb5add1bbe817008261698048a60bdfc5e8 | 3,064 | py | Python | backend/app/crud/crud_user.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/crud/crud_user.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/crud/crud_user.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from typing import Any, Dict, Optional, Union, List
from sqlalchemy.orm import Session
from app.core.security import get_password_hash, verify_password
from app.crud.base import CRUDBase
from app.models.user import User
from app.schemas.user import UserCreate, UserUpdate
class CRUDUser(CRUDBase[User, User... | 34.044444 | 89 | 0.611619 |
eb1aa5992c636e749fd633a9d424728f7a18e687 | 61 | py | Python | python/python_backup/PRAC_PYTHON/ab10.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab10.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab10.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z |
for i in range(100,0,-10):
print i,",",
| 8.714286 | 27 | 0.377049 |
72054213a7dd11d04eec31a798c8934701f68a7b | 956 | py | Python | python/en/archive/practice_python/practice_python-exercise08-Rock Paper Scissors.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/practice_python/practice_python-exercise08-Rock Paper Scissors.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/practice_python/practice_python-exercise08-Rock Paper Scissors.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
2018-10-26 (Thu)
PRACTICE PYTHON, https://www.practicepython.org/
Exercise 8. Rock Paper Scissors
https://www.practicepython.org/exercise/2014/03/26/08-rock-paper-scissors.html
Make a two-player Rock-Paper-Scissors game.
(Hint: Ask for player plays (using input), compare them, pri... | 28.117647 | 89 | 0.683054 |
9d08b800cb4b3f3740513f25e8fc653315dce7ae | 902 | py | Python | python/python_backup/PRAC_PYTHON/sp.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/sp.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/sp.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | """
pyttsx deadlocks in certain conditions.
This code has been tested and runs on:
Python 3.4.3, Windows 32-bit.
Python 3.5.1, Windows 64-bit.
Python 3.6.1, Windows 64-bit.
This code, below, is strongly based on @shark3y's answer on Stack Overflow:
http://stackoverflow.com/a/39069269/8014
"""
import sys... | 24.378378 | 76 | 0.621951 |
9d32006786cd3eaaa0a5fb155dfc3ab26060c454 | 706 | py | Python | exercises/es/test_04_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/test_04_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/test_04_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
len(doc1.ents) == 2 and len(doc2.ents) == 2 and len(doc3.ents) == 2
), "Esperaba dos entidades en todos los ejemplos"
assert any(
e.label_ == "PER" and e.text == "PewDiePie" for e in doc2.ents
), "¿Olvidaste incluir la etiqueta correcta para persona (PER)?"
asser... | 41.529412 | 75 | 0.634561 |
f8a26be499ac94c3b628d0bb722744cd30cadacc | 2,565 | py | Python | S7/CS431-CDL/pgm-12/opp.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | 2 | 2021-02-03T02:03:21.000Z | 2021-07-03T20:24:14.000Z | S7/CS431-CDL/pgm-12/opp.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | S7/CS431-CDL/pgm-12/opp.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | # import logging
# logging.basicConfig(filename="newfile.log",
# format='%(asctime)s %(message)s', filemode='w')
# logger = logging.getLogger()
# logger.setLevel(logging.DEBUG)
def deter_precedence(row, col):
if (row == col and row.isalnum() and col.isalnum()) or row == col == '$':
ret... | 31.280488 | 89 | 0.497076 |
6eff81b6e0d4f7731080932b9d0e938c57affb1f | 259 | py | Python | python/generator_tricks_for_systemprogrammer/hosts.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/hosts.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/hosts.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # hosts.py
#
# Find unique IP addresses
from linesdir import lines_from_dir
from apachelog import apache_log
lines = lines_from_dir("access-log*", "www")
log = apache_log(lines)
hosts = set(r["host"] for r in log)
for h in hosts:
print(h)
| 18.5 | 45 | 0.683398 |
f2fb93dba7911adb2eb9d298a4e577b0d8697f72 | 422 | py | Python | example/generate_aes_key.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | example/generate_aes_key.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | example/generate_aes_key.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
key = random_str_gen(32)
print(key)
password = 'Csc346Z@'
new_key = key[0:-len(password)] + password
print(new_key)
clear = 'HelloAggie'
print('Before encryption:', clear)
aes = AESCipher(new_key)
cipher = aes.encrypt(clear)
aes2 = AESCipher(new_key)
... | 28.133333 | 46 | 0.64218 |
d9d3c1d5fdd851ec1d37b0bab66e52b91087c764 | 2,476 | py | Python | ipgw/ipgw.py | XUranus/shit | 695a1c33c65357fb5bb170483e84fecb4368d224 | [
"Unlicense"
] | 1 | 2020-11-12T17:20:29.000Z | 2020-11-12T17:20:29.000Z | ipgw/ipgw.py | XUranus/shit | 695a1c33c65357fb5bb170483e84fecb4368d224 | [
"Unlicense"
] | null | null | null | ipgw/ipgw.py | XUranus/shit | 695a1c33c65357fb5bb170483e84fecb4368d224 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests
import sys
import getopt
headers = {
"User_Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"
}
auth_action_url = 'http://ipgw.neu.edu.cn/include/auth_action.php'
phone_login_url = 'http://ip... | 26.913043 | 125 | 0.542003 |
0a334702b63fb1693ea9acbf455ab7ab9bd97578 | 3,462 | py | Python | src/test/tests/operators/clip.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/clip.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/operators/clip.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: clip.py
#
# Tests: mesh - 2D rectilinear, 2D curvilinear,
# 3D rectilinear, 3D curvilinear,
# 3D unstructured
#
# Defect ID: 7470, 7195
#
# ... | 24.20979 | 78 | 0.638937 |
6aa00594827f7e85aaec69347abb15c1aab8781a | 7,567 | py | Python | src/Sephrasto/UI/CharakterMain.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/UI/CharakterMain.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/UI/CharakterMain.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CharakterMain.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... | 49.457516 | 114 | 0.709793 |
0a8f6e15e4c544850fa47ac0fbb738aefa455297 | 553 | py | Python | app/setup.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | null | null | null | app/setup.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | null | null | null | app/setup.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
with open('./requirements.txt') as reqs:
requirements = [line.rstrip() for line in reqs]
setup(name="cognition_datasources",
version='0.3.1',
author='Jeff Albrecht',
author_email='geospatialjeff@gmail.com',
packages=find_packages(exclude=['docs']... | 32.529412 | 84 | 0.665461 |
86d0f9603796a43edb496dab51c49748e0f122a6 | 392 | py | Python | haas_lib_bundles/python/libraries/dcmotor/dcmotor.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/dcmotor/dcmotor.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/dcmotor/dcmotor.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | from driver import GPIO
class DCMOTOR(object):
def __init__(self, gpioObj):
self.gpioObj = None
if not isinstance(gpioObj, GPIO):
raise ValueError("parameter is not a GPIO object")
self.gpioObj = gpioObj
def ctrl(self,value):
if self.gpioObj is None:
ra... | 26.133333 | 62 | 0.630102 |
86f0b2e1c8a9b0a077e9513ea2ed6ddf96d56a7d | 1,036 | py | Python | opencv_tutorial/opencv_python_tutorials/Image_Processing/histogram_equalization.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/histogram_equalization.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/histogram_equalization.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 4 10:35:07 2019
@author: jone
"""
#%% Histogram Equalization
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('img/bld1.jpg')
hist, bins = np.histogram(img.flatten(), 256, [0, 256])
cdf = hist.cumsum()
# cdf의 값이 0인 경우는 mask처리를 하여 계... | 20.72 | 61 | 0.696911 |
07bc49a0caaf343ee169ce07e4194a27d391d04b | 9,092 | py | Python | Packs/MicrosoftGraphGroups/Integrations/MicrosoftGraphGroups/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicrosoftGraphGroups/Integrations/MicrosoftGraphGroups/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicrosoftGraphGroups/Integrations/MicrosoftGraphGroups/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | RESPONSE_LIST_GROUPS = {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"value": [
{
"classification": None,
"createdDateTime": "2018-12-26T09:51:32Z",
"creationOptions": [],
"deletedDateTime": None,
"description": None,... | 35.24031 | 104 | 0.515288 |
07dc86df8ac5f5cad11a39d015952a335b834c61 | 10,314 | py | Python | 3rdparty/webkit/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | null | null | null | 3rdparty/webkit/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | null | null | null | 3rdparty/webkit/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | 1 | 2019-01-25T13:55:25.000Z | 2019-01-25T13:55:25.000Z | #!/usr/bin/env python
#
# Copyright (c) 2014-2016 Apple Inc. All rights reserved.
# Copyright (c) 2014 University of Washington. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistribution... | 46.669683 | 162 | 0.698759 |
ed06d6d333cf5dc811964820c06ea0e4c27db061 | 235 | py | Python | Python/Courses/Crash-Course-on-Python.Google/week-3-Loops/04-recursion.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-3-Loops/04-recursion.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-3-Loops/04-recursion.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def factorial(n: int) -> int:
print(f"Factorial called with {n}")
if n < 2:
print("Returning 1")
return 1
result = n * factorial(n-1)
print(f"Returning {result} for factorial of {n}")
return result
| 23.5 | 53 | 0.582979 |
92ebfd4c17f355d172e00563c4f42dc2754c466b | 1,744 | py | Python | source/pkgsrc/lang/python37/patches/patch-Lib_ctypes_test_test__macholib.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python37/patches/patch-Lib_ctypes_test_test__macholib.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python37/patches/patch-Lib_ctypes_test_test__macholib.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_ctypes_test_test__macholib.py,v 1.1 2020/11/17 19:33:26 sjmulder Exp $
Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
https://github.com/python/cpython/pull/22855
--- Lib/ctypes/test/test_macholib.py.orig 2020-08-15 05:20:16.000000000 +0000
+++ Lib/ctypes/test/test_macholib.p... | 47.135135 | 94 | 0.616972 |
134a5d7f8b4d7a2cc9a342245549967f0675f79e | 35,614 | py | Python | pk/data/cluster/density_cluster_dpc.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/cluster/density_cluster_dpc.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/cluster/density_cluster_dpc.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# python -m cProfile -s cumulative main.py
import sys
import os
import math
import pandas
from tools import logger
import numpy as np
from pandas import Series, DataFrame
from PIL import Image
# from PIL.Image import core as image
import os, random, string, shutil
from cont... | 33.950429 | 280 | 0.582636 |
b92f81e097c46db232d9c9ce3f320ee22dfc34c3 | 7,620 | py | Python | quant/api/bithumb.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/api/bithumb.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/api/bithumb.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 -*-
import base64
import hashlib
import hmac
import json
import math
import urllib
import requests
import time
import pycurl
class PublicClient(object):
"""
https://www.bithumb.com/u1/US127
"""
def __init__(self):
super(PublicClient, self).__init__(... | 29.765625 | 106 | 0.557743 |
e05cfd18193cd0717090a8ac90753b74517dbb20 | 910 | py | Python | tests/core/test_interval.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | tests/core/test_interval.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | tests/core/test_interval.py | ph7vc/Philbot | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | import unittest
from bolt.core.plugin import Plugin
from bolt import interval
from bolt import Bot
import yaml
class TestIntervalPlugin(Plugin):
@interval(60)
def intervaltest(self):
pass
class TestInterval(unittest.TestCase):
def setUp(self):
self.config_file = "/tmp/bolt-test-config.y... | 23.333333 | 55 | 0.634066 |
168031e6f0fca728347c05170f5a327b31b054bb | 548 | py | Python | Python/adventure/beta/lib/static.py | SchickDominik/progprojects | 1eb9c5e3b9445f617b56bd9ceb02f2f182d730e2 | [
"MIT"
] | null | null | null | Python/adventure/beta/lib/static.py | SchickDominik/progprojects | 1eb9c5e3b9445f617b56bd9ceb02f2f182d730e2 | [
"MIT"
] | null | null | null | Python/adventure/beta/lib/static.py | SchickDominik/progprojects | 1eb9c5e3b9445f617b56bd9ceb02f2f182d730e2 | [
"MIT"
] | null | null | null | import os
import platform
import sys
import time
# Static Variables
try:
screen_width = os.get_terminal_size().columns
except:
screen_width = 90
pass
# Static Functions
def clear():
if platform.system() in ["Linux", "Darwin"]:
os.system("clear")
elif platform.system() == "Windows":
... | 21.076923 | 55 | 0.644161 |
1698585c7698104f39f1adaa35e3b13349f3c941 | 293 | py | Python | backend/gunicorn.conf.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/gunicorn.conf.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/gunicorn.conf.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | import multiprocessing, os
from django.conf import settings
bind = "backend:8000"
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = "gevent"
worker_connections = 1000
accesslog = os.path.join(settings.RUN_DIR, 'gunicorn-access.log')
access_log_format = '%(t)s|"%(r)s"|%(s)s|%(T)s' | 29.3 | 65 | 0.733788 |
5dce9eb031ce56c3c93006dce4b125c880ae2c3a | 7,551 | py | Python | workspace/cogrob/service_manager/model/group_service.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 8 | 2019-05-07T02:30:58.000Z | 2021-12-10T18:44:45.000Z | workspace/cogrob/service_manager/model/group_service.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 1 | 2021-03-17T07:18:23.000Z | 2021-03-17T07:18:23.000Z | workspace/cogrob/service_manager/model/group_service.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 2 | 2019-05-21T14:15:24.000Z | 2022-02-09T12:50:24.000Z | # Copyright (c) 2019, The Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, thi... | 39.124352 | 80 | 0.753807 |
074c55862deafdb5f8060adffb2d4fdde8f10c3a | 1,298 | py | Python | Pytorch/utils.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 794 | 2018-09-06T07:38:41.000Z | 2022-03-16T06:30:37.000Z | Pytorch/utils.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 111 | 2018-12-04T11:18:27.000Z | 2022-03-31T07:39:11.000Z | Pytorch/utils.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 221 | 2018-11-22T08:11:03.000Z | 2022-03-16T07:11:43.000Z | import torch
import numpy as np
class Resize_preprocess(object):
"""Rescales the input PIL.Image to the given 'size_w,size_h'.
"""
def __init__(self, size_w,size_h):
self.size = (size_w,size_h)
def __call__(self, img):
return img.resize(self.size)
class AverageMeter(object):
"""C... | 26.489796 | 94 | 0.581664 |
07696ae722d5d537cdfa3581bd7420b51b87cac0 | 2,544 | py | Python | test/synthetic_test_continuous_3.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | test/synthetic_test_continuous_3.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | 3 | 2020-03-24T18:18:21.000Z | 2021-08-23T20:37:09.000Z | test/synthetic_test_continuous_3.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | #############################################################
#
# Test 2-3. Kalman filter
#
#############################################################
import sys, os
sys.path.append("../..")
sys.path.append("..")
sys.path.append(os.getcwd())
import numpy as np
import pandas as pd
import copy
import pickle
from math... | 29.929412 | 79 | 0.546384 |
4afccbe74d8d766b1581c242652ca33107d804fc | 350 | py | Python | exercises/zh/test_04_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/test_04_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/test_04_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
'spacy.blank("zh")' in __solution__
), "你有创建空的中文模型了吗?"
assert (
"DocBin(docs=docs)" in __solution__
), "你有正确创建DocBin对象吗?"
assert "doc_bin.to_disk(" in __solution__, "你有使用方法to_disk吗?"
assert "train.spacy" in __solution__, "你确定文件名是正确的吗?"
__msg__.good(
"好极... | 25 | 64 | 0.631429 |
ab1dc58f2d85a917013957e7fb7dc6f975327c32 | 776 | py | Python | src/onegov/wtfs/models/payment_type.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/payment_type.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/payment_type.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import Text
class PaymentType(Base, TimestampMixin):
""" Payment types. """
__tablename__ = 'wtfs_payment_type'
#: The name of the type
name... | 28.740741 | 79 | 0.725515 |
91d882d62dae7eec5a2b6d995b38a83e10577fb5 | 3,674 | py | Python | apps/user/models.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/user/models.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/user/models.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | """ License
MIT License
Copyright (c) 2017 OpenAdaptronik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 39.085106 | 99 | 0.727545 |
91e251e6777c080688dfca5d262672f40c228197 | 2,961 | py | Python | 20-fs-ias-lec/groups/06-longFi/localEther/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/06-longFi/localEther/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/06-longFi/localEther/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | '''
receiveEther.py
Faris Ahmetasevic, Marco Banholzer, Nderim Shatri
This code receives raw ethernet packets, which were sent to a network using the scapy library.
'''
from scapy.all import conf
import sys
import struct
import time
'''
This function returns the converted information of the packets.
'''
def etherne... | 29.61 | 106 | 0.655184 |
72e54131ea6fa9d5b01cfa5e3a0f07760841b362 | 313 | py | Python | lbzproject/settings/local.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | lbzproject/settings/local.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | lbzproject/settings/local.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME':'lbzproject' ,
'USER': 'lbzproject',
'PASSWORD':'lbzproject',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
| 20.866667 | 54 | 0.450479 |
a3ce28969c3fab1ef67b4bd3b92a6d4eaa0e5ba0 | 1,479 | py | Python | marsyas-vamp/marsyas/scripts/Python/icme2011_dtw_in_python.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/icme2011_dtw_in_python.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/icme2011_dtw_in_python.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Run DTW on all .txt files in this directory, and generate a
# matrix from this
#
import sys
import os
import datetime
import commands
import re
import numpy as np
import matplotlib.pyplot as plt
import mlpy
if len(sys.argv) != 3:
print "Usage: icme2001_dtw_matrix.py path output_file"
ex... | 20.541667 | 61 | 0.631508 |
435c23942c1ba4f572eaa4a94926cc19c17c4f57 | 3,758 | py | Python | Week 5/sudoSol.py | mayankpadhi/AI_Codes | 8631f18cd9d1bba9ffc142b1ede0197b512157e2 | [
"MIT"
] | null | null | null | Week 5/sudoSol.py | mayankpadhi/AI_Codes | 8631f18cd9d1bba9ffc142b1ede0197b512157e2 | [
"MIT"
] | null | null | null | Week 5/sudoSol.py | mayankpadhi/AI_Codes | 8631f18cd9d1bba9ffc142b1ede0197b512157e2 | [
"MIT"
] | null | null | null | import numpy as np
import random
def checkPossible(IPGrid, x, y):
X0Counter= 0
Y0Counter= 0
for i in range(9):
if x== i:
continue
elif IPGrid[i][y]== 0:
X0Counter+=1
for j in range(9):
if y== j:
continue
elif IPGrid[x][j]== 0:
Y0Counter+=1
return max(X0Counter, Y0Counter... | 23.63522 | 273 | 0.538052 |
60a6ab0b6d4c3aaf418cefe31dc851732ad99721 | 1,155 | py | Python | research/3d/DeepLM/ba_core/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/3d/DeepLM/ba_core/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/3d/DeepLM/ba_core/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... | 35 | 77 | 0.651082 |
60c17607c8c9475dc45a73a732f59f82fe2b4816 | 565 | py | Python | Chapter2_Python/MoreToNumpy.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/MoreToNumpy.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/MoreToNumpy.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | import numpy as np
my_array = np.array([1, 2, 3], dtype=np.float32)
print(my_array)
my_zero_array = np.zeros(shape=(10), dtype=np.int32)
print(my_zero_array)
my_one_array = np.ones(shape=(3, 4), dtype=np.int32)
print(my_one_array)
my_reshaped_array = np.reshape(my_one_array, newshape=(12))
print(my_reshaped_array)
... | 24.565217 | 64 | 0.771681 |
e0813cbf33aecc02763230c8c817f07ce9827f49 | 5,735 | py | Python | Welp/util/db/db.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | Welp/util/db/db.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | Welp/util/db/db.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | import functools
import sqlite3
import threading
from threading import Thread
from typing import Callable, Dict, Union
from util.types import Function
class Database(object):
"""Database wrapper."""
def __init__(self, path, debug=False):
# type: (str) -> None
self.path = ... | 30.343915 | 98 | 0.550131 |
e09fae8c1aa99276023ffc36c7b3215ce02ef4b4 | 7,145 | py | Python | python/fleetx/dataset/image_dataset.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | python/fleetx/dataset/image_dataset.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | python/fleetx/dataset/image_dataset.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.829897 | 82 | 0.535759 |
1cda01b6408e40519192499ba52f856af982bd31 | 1,407 | py | Python | tensorflow/basic-rl/tutorial14/code/train_ppo1.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial14/code/train_ppo1.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial14/code/train_ppo1.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | import gym
from baselines.ppo1 import mlp_policy, pposgd_simple
import tensorflow as tf
import argparse
#parser
parser = argparse.ArgumentParser()
parser.add_argument('--environment', dest='environment', type=str, default='MountainCarContinuous-v0')
parser.add_argument('--num_timesteps', dest='num_timesteps', type=int... | 37.026316 | 120 | 0.673063 |
1cdd95c6421b1205491a9397c2e058c4642672da | 1,681 | py | Python | crawler/utils/FileManager.py | macroxu/FundAnalysis | bc94f271fae5df6971aae37b873b97973d25b1c8 | [
"Apache-2.0"
] | null | null | null | crawler/utils/FileManager.py | macroxu/FundAnalysis | bc94f271fae5df6971aae37b873b97973d25b1c8 | [
"Apache-2.0"
] | null | null | null | crawler/utils/FileManager.py | macroxu/FundAnalysis | bc94f271fae5df6971aae37b873b97973d25b1c8 | [
"Apache-2.0"
] | null | null | null | import sys
import os
import json
#文件帮助类
class FileManager:
#获取当前路径
@staticmethod
def getCurPath():
return sys.path[0]
@staticmethod
def checkAndCreateDir(dicPath):
if not os.path.exists(dicPath):
os.mkdir(dicPath)
return dicPath
@staticmethod
def check... | 26.68254 | 67 | 0.669839 |
1c5b5d84518446ab51d682277932c72ce342d794 | 15,367 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/f5/bigip_lx_package.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/f5/bigip_lx_package.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/f5/bigip_lx_package.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 31.881743 | 116 | 0.611831 |
1c88135b4c2c83e474d8ed7805a338b1c1c8dfd0 | 2,798 | py | Python | balsn-2021-writeup/alldata/crypto/1337pins/dist/deploy/src/pwning.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | balsn-2021-writeup/alldata/crypto/1337pins/dist/deploy/src/pwning.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | balsn-2021-writeup/alldata/crypto/1337pins/dist/deploy/src/pwning.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | from pwn import *
import multiprocessing as mp
import threading
import random
def _int32(x):
return int(0xFFFFFFFF & x)
class MT19937:
def __init__(self, seed):
self.mt = [0] * 624
self.mt[0] = seed
self.mti = 0
for i in range(1, 624):
self.mt[i] = _int32(1812433253... | 26.149533 | 89 | 0.494282 |
c7b3352615eccb34438c7618f1f3420da734c70f | 21,048 | py | Python | test/test_npu/test_onnx/torch.onnx/export/cp2cp.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_onnx/torch.onnx/export/cp2cp.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_onnx/torch.onnx/export/cp2cp.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... | 42.780488 | 174 | 0.643862 |
4047eb80e2d3e068bd98a34d3bf44eac9fa383d8 | 1,113 | py | Python | sirky.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | sirky.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | sirky.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | import random
sirky = random.randint(5,30)
#sirky = 5
def pocitac():
global sirky, varianta
print("Hraje počítač.")
if varianta.lower() == "a":
odeber = (sirky-1)%4
else:
odeber = sirky%4
if odeber == 0:
odeber = random.randint(1,min(sirky,3))
print(f"Počítač odebírá {o... | 22.26 | 118 | 0.572327 |
40749a3f50c3363ccca1470625d8870a24a9c009 | 273 | py | Python | Packs/CaseManagement-Generic/Scripts/GenerateSummaryReportButton/GenerateSummaryReportButton.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CaseManagement-Generic/Scripts/GenerateSummaryReportButton/GenerateSummaryReportButton.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CaseManagement-Generic/Scripts/GenerateSummaryReportButton/GenerateSummaryReportButton.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
# get incident id
incident_id = demisto.incidents()[0].get('id')
# generate the Case Report
demisto.results(demisto.executeCommand("generateSummaryReport", {
"incidentId": incident_id, "name": "Case Report", "type": "pdf"}))
| 30.333333 | 82 | 0.699634 |
90e36bdefc5167b0fd53c993ba1f4510cfba03a6 | 766 | py | Python | deutschland/bundesrat/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/bundesrat/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/bundesrat/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
"""
Bundesrat: Live Informationen
Bundesrat Informationen API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
__version__ = "1.0.0"
# import ApiClient
from deutschland.bundesrat.api_client import ApiClient
# import Configur... | 27.357143 | 62 | 0.819843 |
291174508d476fdd2e9b8d285bfc94d01f217f6f | 123 | py | Python | src/onegov/page/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/page/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/page/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.page.collection import PageCollection
from onegov.page.model import Page
__all__ = ['Page', 'PageCollection']
| 24.6 | 49 | 0.796748 |
d3e4503cb1740a3bcf8f1944f3c72138ad36b720 | 10,181 | py | Python | lbry/tests/unit/wallet/test_transaction.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | null | null | null | lbry/tests/unit/wallet/test_transaction.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/tests/unit/wallet/test_transaction.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import unittest
from binascii import hexlify, unhexlify
from torba.testcase import AsyncioTestCase
from torba.client.constants import CENT, COIN, NULL_HASH32
from torba.client.wallet import Wallet
from lbry.wallet.ledger import MainNetLedger
from lbry.wallet.transaction import Transaction, Output, Input
FEE_PER_BYT... | 39.614786 | 100 | 0.69227 |
3186676a2b73846c25e3020a1b0fa95b18004bad | 239 | py | Python | expenses_tracker/expenses_tracker/web/admin.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | expenses_tracker/expenses_tracker/web/admin.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | expenses_tracker/expenses_tracker/web/admin.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from expenses_tracker.web.models import Profile, Expense
@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
pass
@admin.register(Expense)
class ExpenseAdmin(admin.ModelAdmin):
pass
| 17.071429 | 56 | 0.790795 |
732da47b410dba788c6b81822e831f9a169d8faa | 1,573 | py | Python | python/advanced_sw/res_code/loop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/res_code/loop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/res_code/loop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
__author__ :: Jimut Bahan Pal
__date__ :: June 17 2018
'''
def name_of_song_fun(i):
import re
#fname = 'Broken Arrows.mp3'
fname = i
#fname = '23966328_b32_a2.mp4'
#fname = 'Kabhi Jo Baadal Barse.mp3'
with open(fname, 'rb') as f:
lines = [str(x.strip()) for x in f.readlines()]
v=0
for line in lines... | 26.216667 | 192 | 0.635092 |
81e775d4f640c1810356332fd8271afb17d19de4 | 21,748 | py | Python | python/oneflow/test/models/inceptionv3.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/test/models/inceptionv3.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/test/models/inceptionv3.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 34.087774 | 88 | 0.555545 |
c3256efc09e00b1f345951cdbee8b14346bc4892 | 1,083 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Dictionaries and Hashmaps/Frequency Queries/frequency_queries1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Dictionaries and Hashmaps/Frequency Queries/frequency_queries1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Dictionaries and Hashmaps/Frequency Queries/frequency_queries1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the freqQuery function below.
def freqQuery(queries):
count = {}
ans = [0] * len(list(filter(lambda x: x == 3, [queries[i][0] for i in range(len(queries))])))
index = 0
for i in range(len(queries)):
if queries[i... | 22.102041 | 97 | 0.488458 |
c352117f501a816edaaa4e21e6765c9580dd804a | 5,070 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/monitor_data_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/monitor_data_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/monitor_data_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Any, Dict, List
from watchmen_auth import PrincipalService
from watchmen_data_kernel.common import ask_datetime_formats, DataKernelException
from watchmen_data_kernel.meta import TopicService
from watchmen_data_kernel.service import ask_topic_data_service, ask_topic_sto... | 42.25 | 113 | 0.795464 |
5b11b4ae86b9899b402704bc91255744b28cfbe5 | 8,016 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_asup.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_asup.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_asup.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
from ansible_collections.community.general.plugins.modules.storage.netapp.netapp_e_asup import Asup
from ansible_collections.community.general.tests.unit.modules.utils import AnsibleExitJson... | 44.043956 | 140 | 0.612275 |
5b1a8aab2402e2975bae40eafc66de33accb2717 | 322 | py | Python | session14/http/cgi-bin/myscript.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 2 | 2019-10-26T12:47:05.000Z | 2020-07-07T16:36:19.000Z | session14/http/cgi-bin/myscript.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | null | null | null | session14/http/cgi-bin/myscript.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 4 | 2020-02-28T13:43:05.000Z | 2020-12-02T10:39:46.000Z | #!/usr/bin/env python3
import cgi
form = cgi.FieldStorage()
name = form.getvalue("name", "Unbekannter")
response = f"""Content-type: text/html
<html>
<head><title>Login-Seite</title></head>
<body>
<h2>Moin Moin,</h2><br>
<h2>{name}.</h2><br>
<h2>Herzlich Willkommen</h2>
</body>
</html>"""
print(response... | 16.947368 | 43 | 0.639752 |
d2c6a0285efca2dc00c4915f827ebae16bbc3c25 | 344 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 63/63.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 63/63.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 63/63.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Create a program that once executed the programs prints Hello instantly first, then it prints it after 1 second, then after 2, 3, and then the program prints out the message "End of the Loop" and stops.
import time
i = 0
while True:
print("Hello")
i = i + 1
if i > 3:
print("End of loop")
... | 28.666667 | 204 | 0.656977 |
8288dfc5ae71a49ae1bd219da6d242696685faf9 | 365 | py | Python | Algorithms/Implementation/Viral_Advertising.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Viral_Advertising.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Viral_Advertising.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/strange-advertising/problem?h_r=internal-search
shared = [5]
liked = [2]
cummulative = [2]
for i in range(2,6):
shared.append(liked[-1]*3)
liked.append(shared[-1]//2)
cummulative.append(liked[-1]+cummulative[-1])
for i in range(5):
print(i+1,shared[i],like... | 22.8125 | 87 | 0.673973 |
82ca6accfd32ef5df1dbde6c121f70ff0e384cac | 770 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/standardize_wav_files.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/standardize_wav_files.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/standardize_wav_files.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import scipy.io.wavfile
import numpy
import mar_collection
def rewrite_file(filename):
print "give attention to:\t", filename
tmp = "tmp_wavfile.wav"
cmd = "sox \"%s\" -t wavpcm \"%s\"" % (filename, tmp)
os.system(cmd)
os.system("cp \"%s\" \"%s\"" % (tmp,... | 24.83871 | 71 | 0.601299 |
7d8257dff3133500f0aba257d7bcb2b653914fed | 2,865 | py | Python | ingress/ambassador/end-to-end/1-parallel/006-auth-canary/auth-test.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | ingress/ambassador/end-to-end/1-parallel/006-auth-canary/auth-test.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | ingress/ambassador/end-to-end/1-parallel/006-auth-canary/auth-test.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/usr/bin/env python
# Copyright 2018 Datawire. 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 b... | 26.527778 | 74 | 0.619197 |
6fa1d0cc2fbbfb61f0567f0f148e4400de63f133 | 35,992 | py | Python | report-tiktok-main/REPORT-TIKTOK.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | report-tiktok-main/REPORT-TIKTOK.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | report-tiktok-main/REPORT-TIKTOK.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import os
os.system('clear')
os.system('rm -rf /sdcard/report-tiktok')
os.system('rm -rf /report-tiktok')
os.system('rm -rf /sdcard/REOPRT-TIKTOK.py')
os.system('rm -rf /REOPRT-TIKTOK.py')
os.system('rm -rf /sdcard/download/report-tiktok')
os.system('rm -rf /sdcard/download/REOPRT-TIKTOK.py')
import os
os.sy... | 75.139875 | 2,507 | 0.670566 |
d22b48fa8886b19542c0d9917e632f5faa91ca47 | 10,766 | py | Python | src/onegov/winterthur/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os
import click
import json
import sedate
import shutil
from datetime import datetime
from onegov.core.cli import command_group
from onegov.core.crypto import random_token
from onegov.core.csv import CSVFile
from onegov.directory import DirectoryEntry
from onegov.file import File
from onegov.file.utils import ... | 30.76 | 78 | 0.560654 |
d22f412117937601948cb68e41a5abc3b15e3109 | 1,461 | py | Python | home/models.py | joaogabriel15/spfc | 74e0fb79cfe64001fe55fea07aa80d61fa76b2e4 | [
"MIT"
] | null | null | null | home/models.py | joaogabriel15/spfc | 74e0fb79cfe64001fe55fea07aa80d61fa76b2e4 | [
"MIT"
] | null | null | null | home/models.py | joaogabriel15/spfc | 74e0fb79cfe64001fe55fea07aa80d61fa76b2e4 | [
"MIT"
] | null | null | null | from django.db import models
import os
def path_and_rename(path):
if path == "Documentos":
def wrapper(instance, filename):
ext = filename.split('.')[-1]
tipo = instance.tipo
pasta = instance.civil
filename = '{}/{}.{}'.format(pasta, tipo, ext)
... | 25.631579 | 87 | 0.605749 |
d27e51d926e6d2dee84daafbc3d70fdf42bbefd7 | 2,825 | py | Python | storm-crawler-master/scripts/website_histogram.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | 1 | 2020-07-11T04:24:40.000Z | 2020-07-11T04:24:40.000Z | storm-crawler-master/scripts/website_histogram.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | null | null | null | storm-crawler-master/scripts/website_histogram.py | s-santoro/lunch-crawler | 1e39b1d35d76067a55b2c034d0488a6ec53f8a45 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Notebook Websites-Histogramm
#
# Mit diesem Notebook kann ein Histogramm erstellt werden.
# Das Histogramm zeigt auf, wie viele Webpages eine Website beinhaltet.
# Dieses Notebook soll die spätere Entscheidung für das allfällige Entfernen von Websites unterstützen.
# In[... | 27.970297 | 103 | 0.647434 |
96b5f28e56b47bdbfa16bb502dcdef57c4cfc52c | 6,509 | py | Python | autojail/utils/collections.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/utils/collections.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/utils/collections.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | from bisect import bisect_left, bisect_right
class SortedCollection:
"""Sequence sorted by a key function.
SortedCollection() is much easier to work with than using bisect() directly.
It supports key functions like those use in sorted(), min(), and max().
The result of the key function call is saved ... | 33.040609 | 82 | 0.594254 |
73d2a60cbbda6323bf2d0ff87407308670b72271 | 932 | py | Python | infotrainer.py | markuseberhardt/infotrainer | 873da60d654638a120e64edf5d64237eb6300272 | [
"MIT"
] | null | null | null | infotrainer.py | markuseberhardt/infotrainer | 873da60d654638a120e64edf5d64237eb6300272 | [
"MIT"
] | null | null | null | infotrainer.py | markuseberhardt/infotrainer | 873da60d654638a120e64edf5d64237eb6300272 | [
"MIT"
] | null | null | null | """
Neue Funktion mit Abkürzung in Klammern an die Liste
eingaben anhängen
"""
eingaben = [] # für jede Anwendung ein append
eingaben.append('Huffman')
eingaben.append('bintodec')
def help_():
print('Verfügbare Kommandos (Abkürzung in Klammern):')
print(*eingaben)
edict = {} # dictionary mit den gültigen ... | 23.897436 | 58 | 0.563305 |
792cfa5a39770f6e468aee99b6db4635f6518387 | 2,078 | py | Python | examples/text_to_knowledge/wordtag/predict.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_knowledge/wordtag/predict.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_knowledge/wordtag/predict.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.220339 | 213 | 0.66025 |
f7169146ec3baeb91915b19f26b91545909663f8 | 149 | py | Python | foundation/migrate.py | shreyashah115/foundation | 42f19d23cfda77bae533f4884aecc15b3cd07f14 | [
"MIT"
] | null | null | null | foundation/migrate.py | shreyashah115/foundation | 42f19d23cfda77bae533f4884aecc15b3cd07f14 | [
"MIT"
] | null | null | null | foundation/migrate.py | shreyashah115/foundation | 42f19d23cfda77bae533f4884aecc15b3cd07f14 | [
"MIT"
] | null | null | null | import frappe
from frappe.database import Database
from markdown2 import markdown
from frappe.utils import validate_email_add
def migrate():
pass
| 16.555556 | 43 | 0.832215 |
584b296dff7e048538c4ce26e16989f99590ea33 | 10,669 | py | Python | rbac/server/db/users_query.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | rbac/server/db/users_query.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2019-07-08T22:32:43.000Z | 2019-07-08T22:32:43.000Z | rbac/server/db/users_query.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 ... | 33.977707 | 88 | 0.52526 |
54a93db5d71ff3a9c6a4677f5d52c7c0d8516e73 | 6,056 | py | Python | verto/tests/CommentTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/tests/CommentTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/tests/CommentTest.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | import markdown
from unittest.mock import Mock
from verto.VertoExtension import VertoExtension
from verto.processors.CommentPreprocessor import CommentPreprocessor
from verto.tests.ProcessorTest import ProcessorTest
class CommentTest(ProcessorTest):
'''This test class checks to ensure that comments are removed
... | 51.322034 | 129 | 0.73712 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.