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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11332acb1f7eba6cba5ac4e821c56a772f157539 | 285 | py | Python | kill_pid.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | kill_pid.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | kill_pid.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | import os, subprocess, signal
p = subprocess.Popen(['ps', '-elf'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
if 'merge' in line:
pid = int(line.split()[3])
os.kill(pid, signal.SIGKILL)
print('killed %d' % pid) | 31.666667 | 61 | 0.6 |
3a1d53074c30f39f5ba9a1372c93fb65bc9e4948 | 18,495 | py | Python | TreeModelLib/BelowgroundCompetition/OGSLargeScale3D/OGSLargeScale3D.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeModelLib/BelowgroundCompetition/OGSLargeScale3D/OGSLargeScale3D.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeModelLib/BelowgroundCompetition/OGSLargeScale3D/OGSLargeScale3D.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: jasper.bathmann@ufz.de
"""
import numpy as np
from TreeModelLib import TreeModel
from TreeModelLib.BelowgroundCompetition.OGS.helpers import CellInformation
from ProjectLib.Logger import method_logger
import vtk as vtk
from lxml import etree
... | 44.782082 | 80 | 0.627413 |
28d3b2192c54151feae966ce9198b9a1502e70d2 | 25,189 | py | Python | data-pipeline/src/data_pipeline/datasets/gnomad_v3/gnomad_v3_short_tandem_repeats.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | data-pipeline/src/data_pipeline/datasets/gnomad_v3/gnomad_v3_short_tandem_repeats.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | data-pipeline/src/data_pipeline/datasets/gnomad_v3/gnomad_v3_short_tandem_repeats.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 12 | 2018-02-22T09:45:43.000Z | 2020-02-27T21:37:52.000Z | import itertools
import json
from collections import defaultdict
import hail as hl
def _parse_region_id(region_id):
[chrom, position_range] = region_id.split(":")
chrom = chrom[3:]
[start, stop] = map(int, position_range.split("-"))
return {
"chrom": chrom,
"start": start,
"st... | 42.69322 | 120 | 0.436103 |
3a73ea345ac20f4b09d75f47513e54b736723a09 | 2,549 | py | Python | Fortgeschrittenenpraktikum/Protokolle/V27_Zeeman-Effekt/Python/auswertung_rot_pi.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2019-03-07T08:55:36.000Z | 2019-04-22T18:13:03.000Z | Fortgeschrittenenpraktikum/Protokolle/V27_Zeeman-Effekt/Python/auswertung_rot_pi.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | null | null | null | Fortgeschrittenenpraktikum/Protokolle/V27_Zeeman-Effekt/Python/auswertung_rot_pi.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2017-10-27T13:26:43.000Z | 2018-01-13T09:12:24.000Z | import numpy as np
from scipy.stats import sem
import scipy.constants as const
from uncertainties import ufloat
import uncertainties.unumpy as unp
from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from PIL import Image
import... | 27.706522 | 97 | 0.640643 |
c92abf6d1d13e4caa094daada464e65c461505c6 | 406 | py | Python | PINp/2014/Cheraneva A.S/task_5_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Cheraneva A.S/task_5_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Cheraneva A.S/task_5_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 5. Вариант 24.
#Напишите программу, которая бы при запуске случайным образом отображала название одной из шести шахматных фигур.
#Cheraneva A.S.
#25.03.16
print('\n Программа случайным образом отображает название одной из шести шахматных фигур.')
import random
edin=('Король','Ферзь','Слон','Ладья','Конь','... | 27.066667 | 113 | 0.751232 |
a31042b787b95e9fdbb8c20260bb05196093c125 | 155 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/83criando_lendo_escrevendo_apagando_arquivos/json.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/83criando_lendo_escrevendo_apagando_arquivos/json.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/83criando_lendo_escrevendo_apagando_arquivos/json.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import json
d1 = {'Pessoa 1': {'nome': 'Pedro', 'idade': 23}, 'Pessoa 2': {'nome': 'João', 'idade': 40}}
d1_json = dumps(d1, indent=True)
print(d1_json)
| 22.142857 | 92 | 0.6 |
42b7abc209ea1b061e895a8617f8909880ddb40d | 4,008 | py | Python | user/models.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | user/models.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | user/models.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | 2 | 2020-04-20T07:26:51.000Z | 2020-04-30T11:51:54.000Z | from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth.models import User, Group
from django.dispatch import receiver
from plan.models import FieldOfStudy
from rest_framework.authtoken.models import Token
# Create your models here.
@receiver(post_save, sender=User, disp... | 36.108108 | 105 | 0.710329 |
6c2d5f617dde3f361ca69ba22bf1ed009b8c34ab | 3,667 | py | Python | python_experiments/paper_figures/vldbj/draw_maximum_error.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/paper_figures/vldbj/draw_maximum_error.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/paper_figures/vldbj/draw_maximum_error.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import matplotlib.pyplot as plt
from data_analysis.vldbj_data_parsing.generate_accuracy_markdown import *
from data_analysis.vldbj_data_parsing.probesim_querying_time_statistics import probesim_gt_tag
from paper_figures.vldbj.draw_indexing_time_size import get_name_dict, LABEL_SIZE, TICK_SIZE, LEGEND_SIZE
data_names ... | 44.180723 | 117 | 0.583583 |
66cf3fd21f8ecd56f259fbff280d5a87944c2c36 | 1,681 | py | Python | 2019/finals/crypto-fractorization/secrets.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/finals/crypto-fractorization/secrets.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/finals/crypto-fractorization/secrets.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 28.982759 | 74 | 0.679358 |
6610adc6806129a8267117b08e3b6c17d5b53d06 | 10,678 | py | Python | src/bias_mitigator/sample_from_gpt2.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/bias_mitigator/sample_from_gpt2.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/bias_mitigator/sample_from_gpt2.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | """Sample from LM using trigger + prompts."""
import os
import hydra.utils
import torch
import torch.nn.functional as F
from transformers import (
AutoModelWithLMHead,
AutoModelForCausalLM,
AutoTokenizer,
GPT2Tokenizer,
GPT2LMHeadModel,
)
import re
import numpy as np
import pandas as pd
import sr... | 35.832215 | 111 | 0.603952 |
6618d657a1141d3258d3ee8d69ab29a5b4ce4d8d | 428 | py | Python | blinkingtest.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | blinkingtest.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | blinkingtest.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | initialState = "10000"
lighting = list(map(int,list(initialState)))
for x in range(200):
print("T = "+str(x).ljust(5)+" ",end = "")
prevstate = lighting[:]
for i in range(-1,len(lighting) - 1):
if prevstate[i % len(lighting)]:
if lighting[i+1] == 0:
lighting[i+1] = 1
... | 32.923077 | 46 | 0.523364 |
b0ea5676c205b79cacaa04b2c60ab08bd2ff7abf | 3,703 | py | Python | Utils/py/GoPro/LEDServer.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/LEDServer.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/LEDServer.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf8 -*-
import RPi.GPIO as GPIO
import socket
import time
import json
import traceback
import tempfile
from utils import Logger, Daemonize
import os
class LED():
def __init__(self, PIN):
self.PIN = PIN
#GPIO.setwarnings(False)
GPIO.setup(self.PIN, GPIO.OUT)
... | 22.442424 | 83 | 0.558466 |
b00d89236c4024c74c2987e776a3bb7a33e4e6a5 | 143 | py | Python | 3.Python/nayana21.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | 8 | 2020-10-01T14:15:53.000Z | 2021-10-03T06:10:03.000Z | 3.Python/nayana21.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | null | null | null | 3.Python/nayana21.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | 29 | 2020-10-02T14:24:53.000Z | 2020-10-12T10:52:31.000Z | name, age = "Nayana Girish ", 21
username = "nayana21 "
print ('Hello!')
print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
| 28.6 | 68 | 0.629371 |
b0285d8c0000a8457c8615f5e0b8617d8a3e9c7b | 2,338 | py | Python | SoSe-21/Uebung-6/A1-Stein-Schere-Papier.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-6/A1-Stein-Schere-Papier.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-6/A1-Stein-Schere-Papier.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Aufgabe 1 - Übung 6
#
# Teil a)
# Wirtschaftsinformatik II
# Labor - Übung 6
# Programmieren Sie das Spiel Stein-Schere-Papier für zwei Spieler. Jeder Spieler kann entweder Stein, Schere oder Papier wählen.
# Die Regeln:
# Stein schlägt Schere Schere schlägt Papier Papier schlägt den Stein
# • Fragen Sie nach dem Na... | 34.895522 | 129 | 0.686056 |
05febc8360614ad691590ebee6f23f4744d2b7c1 | 17,335 | py | Python | Python-BlueEdTech-main/projeto-poo/game.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | 3 | 2021-05-30T20:01:06.000Z | 2021-07-07T00:46:37.000Z | Python-BlueEdTech-main/projeto-poo/game.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | Python-BlueEdTech-main/projeto-poo/game.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | from casa import Casa
from pessoa import Pessoa
from relogio import Relogio
from random import randint
def aleatorios_multiplos_5(lim_inf=1, lim_sup=100):
'''
Essa função recebe dois argumentos inteiros, o limite inferior e
superior de um intervalo, e gera uma lista com multiplos de 5.
Ela retorna um... | 44.448718 | 79 | 0.49576 |
af0132cd71c9059358b81e5a3f520fa5d3e37117 | 506 | py | Python | Crashkurs Python/19_Funktionen plotten numpy.py | slogslog/Kurzgeschichten-in-CSharp | 3918c4174220e558cdeeada0edac941811418b93 | [
"Unlicense"
] | 2 | 2019-03-15T20:48:34.000Z | 2019-04-22T15:24:09.000Z | Crashkurs Python/19_Funktionen plotten numpy.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs Python/19_Funktionen plotten numpy.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def poly(x): # x^3 - x + 2
return x**3-x+2
# Die Kurven sollen auf x = [-2, +1.5] mit 100 Punkten
# gezeichnet werden.
xmin = -2
xmax = 1.5
# x = [-2 -1.9 ... +1.4 +1.5]
x = np.linspace(xmin, xmax, 100) # Erzeugt 100 Wert von -2 bis +1.5
plt.figure(figsize=(4... | 23 | 67 | 0.612648 |
bbc0f77533c9fbfeb7640c69c4f02401c84725db | 15,733 | py | Python | gui/trimming.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | 1 | 2022-01-18T12:53:17.000Z | 2022-01-18T12:53:17.000Z | gui/trimming.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | gui/trimming.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './gui/trimming.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# 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 QtCor... | 55.01049 | 115 | 0.721668 |
abdc78dea9648f288ef8e618759bd025d2137c6f | 3,108 | py | Python | projects/g4h2-graduation-project/src/backends/scf_functions/utils/request.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h2-graduation-project/src/backends/scf_functions/utils/request.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h2-graduation-project/src/backends/scf_functions/utils/request.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | """集成请求
包装了一些从 SCF 的入参 `event` 中解析出 API 网关“集成请求”内容的方法
详见 https://cloud.tencent.com/document/product/583/12513
"""
import cgi
import json
import logging
import urllib.parse
from io import BytesIO
from typing import Any, Dict, List, Optional
from .exceptions import BadRequest
logger = logging.getLogg... | 31.393939 | 104 | 0.595238 |
051c7decf2babe9414cf6ced17d7ee770568e72e | 1,372 | py | Python | repo/script.module.urlresolver/lib/urlresolver/plugins/bitporno.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.module.urlresolver/lib/urlresolver/plugins/bitporno.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.module.urlresolver/lib/urlresolver/plugins/bitporno.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | '''
urlresolver XBMC Addon
Copyright (C) 2017
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 3 of the License, or
(at your option) any later version.
This program is distribu... | 39.2 | 107 | 0.719388 |
75d28c66cfcc45ecc5b04427978364001021faf3 | 1,368 | py | Python | python/odmlFromDatacite/crcns_parse_and_fetch.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odmlFromDatacite/crcns_parse_and_fetch.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odmlFromDatacite/crcns_parse_and_fetch.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | """
Query the public Datacite API for CRCNS specific publications and
download all available data entries as XML files.
"""
import json
import requests
# Adjust as required
DATACITE_API_ENDPOINT = "https://api.datacite.org/dois"
# Page size might be required to be increased at some point
DATACITE_QUERY = "?query=publi... | 32.571429 | 83 | 0.701754 |
f9726ee083f2736f93e200a07fd6e2fad0f762bf | 71 | py | Python | Chapter3_BasicFeatures/MemoryManagement/my_lib.py | kernbeisser/UdemyPythonPro | 000d5e66031bcc22b2d8f115edfbd5ef0e80d5b9 | [
"MIT"
] | null | null | null | Chapter3_BasicFeatures/MemoryManagement/my_lib.py | kernbeisser/UdemyPythonPro | 000d5e66031bcc22b2d8f115edfbd5ef0e80d5b9 | [
"MIT"
] | null | null | null | Chapter3_BasicFeatures/MemoryManagement/my_lib.py | kernbeisser/UdemyPythonPro | 000d5e66031bcc22b2d8f115edfbd5ef0e80d5b9 | [
"MIT"
] | null | null | null | POWER_OF = 2
def my_function(a):
b = a**POWER_OF
print(a, b)
| 10.142857 | 19 | 0.577465 |
f9d953c7c77973f847d6e97c6219992ea8b81b18 | 1,502 | py | Python | jburt/checks.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | jburt/checks.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | jburt/checks.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | import json
from pathlib import Path
from typing import Any
from typing import Container
from typing import Union
def is_string_like(obj: Any) -> bool:
""" Check whether `obj` behaves like a string. """
try:
obj + ''
except (TypeError, ValueError):
return False
return True
def is_jso... | 21.768116 | 79 | 0.609188 |
bd4f02115ee529dc7c42662d1ece83e66d8d3ee8 | 2,903 | py | Python | mitglieder/tests/test_urls.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/mitglieder/tests/test_urls.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/mitglieder/tests/test_urls.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django.test import SimpleTestCase
from django.urls import reverse, resolve
from mitglieder.views import *
class TestUrls(SimpleTestCase):
def test_main_screen_url_resolves(self):
url = reverse('mitglieder:homepage')
self.assertEqual(resolve(url).func, main_screen)
"""
Member erst... | 34.975904 | 80 | 0.707888 |
2f347c8794db35f8dfd50d275d8fb1bbed7469f5 | 219 | py | Python | web/main.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 1 | 2019-07-30T14:39:43.000Z | 2019-07-30T14:39:43.000Z | web/main.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | 11 | 2019-07-31T13:40:30.000Z | 2019-08-07T21:54:52.000Z | web/main.py | ralfkret/hvz | 842c25d58fb3c30060080efcfa8b3d183b78e2ab | [
"MIT"
] | null | null | null | from flask import Blueprint, redirect, url_for
main = Blueprint('main', __name__)
from . import errors
@main.route('/')
@main.route('/defaultsite')
def index():
return redirect(url_for('adminsite.product_list')) | 19.909091 | 54 | 0.726027 |
2f54eba467a092f70fd7503cf06d102acd163467 | 1,791 | py | Python | 2016/day04_security_through_obscurity/python/src/part2.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day04_security_through_obscurity/python/src/part2.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | 2016/day04_security_through_obscurity/python/src/part2.py | tlake/advent-of-code | 17c729af2af5f1d95ba6ff68771a82ca6d00b05d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Docstring."""
from collections import Counter
from common import get_input
class RoomAnalyzer:
"""."""
def __init__(self, input_list=[]):
"""."""
self.input_list = input_list
def process_room_string(self, room_string):
"""."""
name = room_string... | 29.85 | 162 | 0.589056 |
85fb04ddb716d7ca686e0d0f1abdc0404d80ea77 | 5,865 | py | Python | repo/service.vpn.manager/windowfilter.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/service.vpn.manager/windowfilter.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/service.vpn.manager/windowfilter.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# 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 3 of the License, or
# (at your... | 38.84106 | 175 | 0.587553 |
c0dedf11c82fad74183dd13109994578d97d6f4c | 2,310 | py | Python | python/exceptionhandler.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | python/exceptionhandler.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | python/exceptionhandler.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | import os
import linecache
import sys
def PrintException(e):
exc_type, exc_obj, tb = sys.exc_info()
f = tb.tb_frame
lineno = tb.tb_lineno
filename = f.f_code.co_filename
linecache.checkcache(filename)
line = linecache.getline(filename, lineno, f.f_globals)
# print('EXCEPTIO({}, LINE {} "{}"... | 36.09375 | 163 | 0.681385 |
23a6c1678e9320abd33cda8f2f1f5c3373749f8f | 410 | py | Python | INBa/2015/Shirlin_V_V/task_5_32.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shirlin_V_V/task_5_32.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shirlin_V_V/task_5_32.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задание 5, вариант 32
# Напишите программу, которая бы при запуске случайным образом отображала имя одного из шестнадцати официальных чемпионов Мира по шахматам..
# Ширлин Вячеслав Викторович
# 24.03.2016
import random
print("Программа случайным образом отображает имя одного из шестнадцати официальных чемпионов Мира ... | 51.25 | 152 | 0.792683 |
b5b5acc0b97cc41e376f6a2fffb2c9ebe3e492ae | 1,238 | py | Python | Packs/CommonScripts/Scripts/LowerCidrNumAddresses/LowerCidrNumAddresses.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/LowerCidrNumAddresses/LowerCidrNumAddresses.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/LowerCidrNumAddresses/LowerCidrNumAddresses.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # STD packages
import ipaddress
# Local imports
from CommonServerPython import *
# The following script check if given IPv4 CIDR availble addresses is lower from a given number.
def cidr_network_addresses_lower_from_const(ip_cidr: str, max_num_addresses: str) -> bool:
""" Decide if num_adddresses const is lower ... | 34.388889 | 113 | 0.692246 |
a945d148f37edf15e6d673f0eede21a23c8c9446 | 774 | py | Python | DataStructures/Tree/TopView.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/TopView.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/TopView.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def top_view(root):
stack = [root]
while stack:
node = stack.pop()
if node.left:
stack.append(node)
stack.append(node.left)
node.left = None
else:
print node.data,
while root.right:
print root.right.data,
count =... | 18.428571 | 35 | 0.540052 |
9399e9ff04eac000d6782154d3a8686a2b29dc9e | 9,118 | py | Python | genesis/model.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | genesis/model.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | genesis/model.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
import pydot as dot
import networkx as nx
from utils.lib import O, MINIMIZE
from genesis.gen_utils import GraphPoint, Objective, Vocabulary, Statement, choice
__author__ = "bigfat... | 31.013605 | 99 | 0.653652 |
9e0413d6858ba948b943da95c09a99d75e4cf772 | 1,925 | py | Python | CoinJoin_Research/CoinJoin_Theory/CashFusion/sim2_fyookball.py | 6102bitcoin/CoinJoin-Research | 2e26089a3755e8d3312b338fb18e722b8cdda651 | [
"MIT"
] | 51 | 2019-08-08T03:06:03.000Z | 2022-03-27T20:01:31.000Z | CoinJoin_Research/CoinJoin_Theory/CashFusion/sim2_fyookball.py | BitcoinQnA/CoinJoin-Research | 2e26089a3755e8d3312b338fb18e722b8cdda651 | [
"MIT"
] | 20 | 2019-08-06T23:42:31.000Z | 2022-03-27T20:02:44.000Z | CoinJoin_Research/CoinJoin_Theory/CashFusion/sim2_fyookball.py | 6102bitcoin/CoinJoin-Research | 2e26089a3755e8d3312b338fb18e722b8cdda651 | [
"MIT"
] | 16 | 2019-08-15T23:49:45.000Z | 2021-04-02T19:53:01.000Z | # Source: https://gist.github.com/fyookball/0b79a56b484063ac25d1ccaf22894dbb
from scipy.special import comb, factorial
import numpy as np
from itertools import combinations
Nplayers = 3 # don't change this.
Ninputsperplayer = 6 # don't go above 6 because it will take FOREVER to enumerate
typicalamount = 100 # re... | 32.083333 | 98 | 0.703896 |
277c9844552d704179a4cfb53fc12a5cd2ca003a | 579 | py | Python | _posts/code/inverse-transform-sampling/inverse-transform-sampling.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/inverse-transform-sampling/inverse-transform-sampling.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/inverse-transform-sampling/inverse-transform-sampling.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def quantile_exponential_distribution(lambda_param, y):
return -np.log(1-y) / lambda_param
def main():
n = 10000
exponential_samples = np.random.exponential(1,n)
plt.hist(exponential_samples)
plt.show()
uniform_samples = np.random.uniform(0... | 23.16 | 106 | 0.732297 |
8bf9e94560b4cc9e4999f873f22cc384d93ad092 | 2,300 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch09_search_and_sort/solutions/ex03_binary_search.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch09_search_and_sort/solutions/ex03_binary_search.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch09_search_and_sort/solutions/ex03_binary_search.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def binary_search(sorted_values, search_for):
mid_pos = len(sorted_values) // 2
# Rekursiver Abbruch
if search_for == sorted_values[mid_pos]:
return True
if len(sorted_values) > 1: # es gibt noch mindeste... | 27.058824 | 73 | 0.620435 |
7bd55a2257616889a33057b234d298a442fc97d5 | 875 | py | Python | Coursera/Interfacing with the Raspberry Pi/Week-4/Assignment/PWMLed.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Interfacing with the Raspberry Pi/Week-4/Assignment/PWMLed.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Interfacing with the Raspberry Pi/Week-4/Assignment/PWMLed.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import RPi.GPIO as GPIO
import time
class PWMControl():
def __init__(self):
self.LedPin = 12
self.pwm = None
def setMode(self):
GPIO.setmode(GPIO.BOARD)
GPIO.setup(self.LedPin, GPIO.OUT)
self.pwm = GPIO.PWM(self.LedPin, 1000)
self.pwm.start(0)
d... | 26.515152 | 47 | 0.485714 |
19040bccb36c980b235a0b62a06169e473dc153e | 1,048 | py | Python | year_3/comppi_0/TGAdmin/urls.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_0/TGAdmin/urls.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_0/TGAdmin/urls.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | """
TGAdmin URL Configuration
"""
from django.contrib import admin
from django.conf.urls import url
from django.urls import path
from tgadmincore import views as coreviews
from analytics import views as anlviews
from managing import views as mngviews
from publication import views as pblviews
from tgbot import views as... | 37.428571 | 73 | 0.718511 |
ef73a319959a590a130b0c6897ff0b815086fb4c | 6,658 | py | Python | easyp2p/p2p_credentials.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/p2p_credentials.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/p2p_credentials.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""
Module for getting and saving credentials in the system keyring / from the user.
"""
from typing import Optional, Tuple
import keyring
from keyring.errors import PasswordDeleteError
from PyQt5.QtCore import (
QCoreApplication, QObject, pyq... | 28.331915 | 80 | 0.656954 |
3e9502c3384338cf13c99adb94e866ad30a6d42e | 5,030 | py | Python | research/audio/fcn-4/modelarts/utils/convert2npy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/audio/fcn-4/modelarts/utils/convert2npy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/audio/fcn-4/modelarts/utils/convert2npy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # coding: utf-8
# 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 ... | 33.533333 | 89 | 0.59165 |
3efa7dfab5e1f34519605b1405788615a56e33ff | 105 | py | Python | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/distance_between_two-points.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/distance_between_two-points.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/distance_between_two-points.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import math
p1=[4,0]
p2=[6,6]
distance=math.sqrt( ((p1[0]-p2[0])**2)+((p1[1]-p2[1])**2))
print(distance)
| 17.5 | 58 | 0.580952 |
de7aba9b625b52ba3ec6e29ce50cd2d5ca65dffb | 10,761 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/drivers/adapter/khdf/liteos/test/tools/hc-gen/test/unittest/hcgen_test.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.1/drivers/adapter/khdf/liteos/test/tools/hc-gen/test/unittest/hcgen_test.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/drivers/adapter/khdf/liteos/test/tools/hc-gen/test/unittest/hcgen_test.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. 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. Redistributions of source code must retain the above ... | 34.712903 | 93 | 0.672893 |
dedcb86ef12150f54953fcf28ebe1924949fb083 | 3,887 | py | Python | official/cv/crnn_seq2seq_ocr/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/crnn_seq2seq_ocr/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/crnn_seq2seq_ocr/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... | 42.25 | 117 | 0.601749 |
19ee03ddfde3fbb33c778d595db379c79e8463f3 | 22,032 | py | Python | src/onegov/feriennet/views/booking.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/booking.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/booking.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
import urllib.parse
from collections import defaultdict, OrderedDict
from datetime import date
from decimal import Decimal
from onegov.activity import Activity, AttendeeCollection
from onegov.activity import Attendee
from onegov.activity import Booking
from onegov.activity import BookingCollection
from... | 30.473029 | 79 | 0.580247 |
26e86150aea0f1efaf65e6dafa2063ee2a0156cd | 239 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-006/ph-6.20-nested-for-or-while-loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-006/ph-6.20-nested-for-or-while-loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-006/ph-6.20-nested-for-or-while-loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | import turtle
turtle.color("red")
turtle.speed(5)
counter = 0
while counter < 36:
for i in range(4):
turtle.forward(100)
turtle.right(90)
turtle.right(10)
print(counter)
counter += 1
turtle.exitonclick()
| 14.9375 | 27 | 0.631799 |
39e954fbbb240ec75c70f609e6a661e669c2f029 | 335 | py | Python | ___Python/KarPoo/po1_kennenlernen/p06_persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p06_persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p06_persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import json
from p01_kennenlernen.m01_kennenlernen import teilnehmerliste
# Schreiben
with open("teilnehmer.json", "w") as datei:
json.dump(teilnehmerliste, datei, default=str) # Datumsangaben werden als string serialisiert
# Lesen
with open("teilnehmer.json", "r") as datei:
liste = json.load(datei)
... | 27.916667 | 98 | 0.737313 |
f2707c36e138bb955e823745e61c6be9bc9a2f58 | 470 | py | Python | src/onegov/org/forms/reservation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/reservation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/reservation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.org import _
from wtforms.fields.html5 import EmailField
from wtforms.validators import Email, InputRequired
# include all fields used below so we can filter them out
# when we merge this form with the custom form definition
RESERVED_FIELDS = ['email']
class ReservationForm(... | 23.5 | 57 | 0.73617 |
0a1a940a5d004f5e70f0f1caf569f031c1a29337 | 315 | py | Python | python/encoding/make_bitseq.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/encoding/make_bitseq.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/encoding/make_bitseq.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def make_bitseq(s: str) -> str:
if not s.isascii():
raise ValueError("ASCII only allowed")
return " ".join(f"{ord(i):08b}" for i in s)
if __name__ == "__main__":
print(make_bitseq("bits"))
print(make_bitseq("CAPS"))
print(make_bitseq("$25.43"))
print(make_bitseq("~5"))
| 26.25 | 48 | 0.587302 |
0a621528c30e0a261215159744061e785461728d | 52 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.1-text-to-print.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.1-text-to-print.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.1-text-to-print.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | text_to_print = "Hello World!"
print(text_to_print)
| 17.333333 | 30 | 0.788462 |
7c32b060680abfe65655ab52f79ed9275f18cef6 | 369 | py | Python | SocketServerClient/client.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | SocketServerClient/client.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | SocketServerClient/client.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # GitHub : https://www.github.com/niirmaaltwaatii/SocketServerClient
# N11rm44L 7w44711
#!/bin/python
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((socket.gethostname(), 87))
fmsg = ''
while True:
msg = s.recv(8).decode("utf-8")
if len(msg) <= 0 :
break
else :
... | 16.772727 | 68 | 0.639566 |
7cff69f0266eb3238356e3c539af323f4a051626 | 1,357 | py | Python | test/test_map.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 5 | 2015-07-16T20:44:58.000Z | 2016-04-19T03:47:46.000Z | test/test_map.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 6 | 2015-12-23T07:05:06.000Z | 2016-07-03T22:29:03.000Z | test/test_map.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | null | null | null | from cocos.director import director
from cocos import layer
import panzee.maputils
import cocos
class MockCell(object):
"""Mock a cocos2d tile cell for testing purposes.
Implements everything but the cell attribute.
"""
def __init__(self, i, j, properties=None):
self.i = i
self.j = j
... | 27.14 | 81 | 0.671334 |
86213d4dc0e51915550c0c934783e5c4a66c4b43 | 136 | py | Python | Licence 2/I33/TP 1/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 1/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 1/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def somme_ind_pair(L):
somme = 0
i = 0
while i < len(L):
somme += L[i]
i += 2
return somme
print(somme_ind_pair([3,2,5,7,4,1])) | 15.111111 | 36 | 0.595588 |
86b4d8e0d150291e5db65c0f8a44925a4aad2d6e | 937 | py | Python | examples/restaurantbot/actions.py | ALT-F1/rasa | 8d4a734616f72aca14f122716fbf338c42644188 | [
"Apache-2.0"
] | 4 | 2020-04-17T17:08:59.000Z | 2021-07-21T16:25:00.000Z | examples/restaurantbot/actions.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 56 | 2020-06-09T00:16:14.000Z | 2020-11-16T00:25:20.000Z | examples/restaurantbot/actions.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3 | 2019-02-27T10:13:16.000Z | 2019-07-26T08:33:45.000Z | from rasa_sdk import Action
from rasa_sdk.events import SlotSet
class RestaurantAPI:
def search(self, info):
return "papi's pizza place"
class ActionSearchRestaurants(Action):
def name(self):
return "action_search_restaurants"
def run(self, dispatcher, tracker, domain):
dispatch... | 29.28125 | 81 | 0.677695 |
86f255c754f5eb02c66b835b40edd8de592e356f | 2,879 | py | Python | sdks/python/apache_beam/runners/interactive/dataproc/types.py | diegomez17/beam | 29dea08c873abc75871674762e68fd5b29b8052b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2021-12-29T09:01:21.000Z | 2022-02-26T14:32:16.000Z | sdks/python/apache_beam/runners/interactive/dataproc/types.py | diegomez17/beam | 29dea08c873abc75871674762e68fd5b29b8052b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 4 | 2021-12-21T21:15:41.000Z | 2022-02-15T19:21:28.000Z | sdks/python/apache_beam/runners/interactive/dataproc/types.py | diegomez17/beam | 29dea08c873abc75871674762e68fd5b29b8052b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 17 | 2021-12-15T19:31:54.000Z | 2022-01-31T18:54:23.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 32.715909 | 79 | 0.757555 |
813c5a3e8ce672fc2b131b10c5d487596a44205f | 12,035 | py | Python | Packs/FeedCyrenThreatInDepth/Scripts/CyrenThreatInDepthRenderRelated/CyrenThreatInDepthRenderRelated_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedCyrenThreatInDepth/Scripts/CyrenThreatInDepthRenderRelated/CyrenThreatInDepthRenderRelated_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedCyrenThreatInDepth/Scripts/CyrenThreatInDepthRenderRelated/CyrenThreatInDepthRenderRelated_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import demistomock as demisto
from CommonServerPython import Common
import json
FILE_INDICATOR = {
"CustomFields": {
"cyrenfeedrelationships": [
{
"indicatortype": "SHA-256", "timestamp": "2020-10-28T14:45:24.921Z", "entitycategory": "malware",
"de... | 49.526749 | 123 | 0.621521 |
d4b45ba5322b0e01cce89b30ff6dd3533ec9e6d0 | 508 | py | Python | 数据结构/NowCode/KthNode.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/KthNode.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/KthNode.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# 返回对应节点TreeNode
def KthNode(self, pRoot, k):
retList = []
def preOrder(pRoot):
if pRoot == None:
return None
preOrder(pRoot.... | 25.4 | 37 | 0.51378 |
d4e2666f7dad1a59775fae787317bdc2c5208d6d | 5,752 | py | Python | research/cv/retinanet_resnet152/src/coco_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-07-03T06:52:20.000Z | 2021-07-03T06:52:20.000Z | research/cv/retinanet_resnet152/src/coco_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/retinanet_resnet152/src/coco_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 29.19797 | 110 | 0.558936 |
ed010cd17aa83a43e3a82169ade1baaf6d71a3d5 | 3,701 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/report/item_price_stock/item_price_stock.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/report/item_price_stock/item_price_stock.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/report/item_price_stock/item_price_stock.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
columns=get_columns()
data=get_data(filters,columns)
return columns, da... | 26.818841 | 96 | 0.689543 |
ed0e1755c6be6b13abef70bd97edc2ffccd1a039 | 889 | py | Python | top/clearlight/reptile/bilibili/bj_tech_mooc/bs4_02_html_loop.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/reptile/bilibili/bj_tech_mooc/bs4_02_html_loop.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/reptile/bilibili/bj_tech_mooc/bs4_02_html_loop.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import requests
from bs4 import BeautifulSoup
r = requests.get("http://python123.io/ws/demo.html")
demo = r.text
soup = BeautifulSoup(demo, "html.parser")
# print(soup.prettify())
print(soup.head)
print(soup.head.contents)
print(soup.body)
print(soup.body.contents)
# 获取body儿子节点的数量
print(len(soup.body.contents))
# 检索... | 18.520833 | 52 | 0.723285 |
ed18413bd3153c7b536b2b489d278522b503d5c8 | 299 | py | Python | storage/emulated/0/qpython/scripts3/say_time.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/scripts3/say_time.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/scripts3/say_time.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | """Speak the time."""
__author__ = 'T.V. Raman <raman@google.com>'
__copyright__ = 'Copyright (c) 2009, Google Inc.'
__license__ = 'Apache License, Version 2.0'
import androidhelper
import time
droid = androidhelper.Android()
droid.ttsSpeak(time.strftime("%I %M %p on %A, %B %e, %Y"))
| 24.916667 | 59 | 0.668896 |
ed64f74ab02e32b18b59853c5478343f011eeb12 | 5,007 | py | Python | tests/integration/server/api/tasks_api_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | tests/integration/server/api/tasks_api_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | tests/integration/server/api/tasks_api_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 37.646617 | 83 | 0.634711 |
b96d2be51109b61f6019cfa1187fc414402ae89e | 3,812 | py | Python | research/cv/wdsr/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/wdsr/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/wdsr/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.318182 | 114 | 0.600997 |
6a0af75019168a5eeaf3152183fc70ef52661080 | 3,545 | py | Python | Packs/DevSecOps/Integrations/GitLab/GitLab_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/DevSecOps/Integrations/GitLab/GitLab_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/DevSecOps/Integrations/GitLab/GitLab_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import io
import json
from typing import Dict, Callable, Union, List, Any
import pytest
from CommonServerPython import CommandResults
from GitLab import Client, gitlab_pipelines_schedules_list_command, gitlab_pipelines_list_command, \
gitlab_jobs_list_command, gitlab_artifact_get_command, gitlab_merge_requests_li... | 49.236111 | 113 | 0.707193 |
0ed64181620d156370128e97b625fc044b4f32e4 | 6,608 | py | Python | Dnnme2-main/bots/Bot3.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Dnnme2-main/bots/Bot3.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Dnnme2-main/bots/Bot3.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 telebot
from telebot import types
import time
import random
log = open('bot-log.txt', 'a+', encoding='utf-8')
ID = ''
bot = telebot.TeleBot("")
bot.send_message(ID, '!BOT STARTED!')
print("Бот запущен!")
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.i... | 32.712871 | 108 | 0.70566 |
16e65e76cf21c9a2055d541b169c002b4578182f | 3,957 | py | Python | rasa/cli/arguments/run.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 37 | 2019-06-07T07:39:00.000Z | 2022-01-27T08:32:57.000Z | rasa/cli/arguments/run.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 209 | 2020-03-18T18:28:12.000Z | 2022-03-01T13:42:29.000Z | rasa/cli/arguments/run.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 65 | 2019-05-21T12:16:53.000Z | 2022-02-23T10:54:15.000Z | import argparse
from typing import Union
from rasa.cli.arguments.default_arguments import add_model_param, add_endpoint_param
from rasa.core import constants
def set_run_arguments(parser: argparse.ArgumentParser):
"""Arguments for running Rasa directly using `rasa run`."""
add_model_param(parser)
add_ser... | 31.91129 | 89 | 0.654284 |
4c1a2f58e077e4ae987a4821d2ff39123328ebec | 9,108 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_calculate_multiply.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_calculate_multiply.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_calculate_multiply.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformCalculate(unittest.TestCase):
def setUp(self):
self.data = {
"testvalue1": 5,
"testvalue2": 3.7,
"testarray1": [5, 4, 7, 1, 3, 6],
"tes... | 36.142857 | 110 | 0.3722 |
4c3d497294d198eec76d3f773e1445cb1bddcbfb | 19,892 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/tools/buildman/func_test.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/buildman/func_test.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/buildman/func_test.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2014 Google, Inc
#
import os
import shutil
import sys
import tempfile
import unittest
import board
import bsettings
import cmdline
import command
import control
import gitutil
import terminal
import toolchain
settings_data = '''
# Buildman settings file
[toolchain... | 36.973978 | 122 | 0.636487 |
4c664d8e8be69931a7a4a3b213e4c51e534b624d | 415 | py | Python | pacman-arch/test/pacman/tests/sync021.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/sync021.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/sync021.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install a group from a sync db with a package in IgnorePkg"
sp1 = pmpkg("pkg1")
sp1.groups = ["grp"]
sp2 = pmpkg("pkg2")
sp2.groups = ["grp"]
sp3 = pmpkg("pkg3")
sp3.groups = ["grp"]
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p);
self.option["IgnorePkg"] = ["pkg2"]
self.args = "-S grp"
s... | 18.863636 | 79 | 0.648193 |
d5e336c5b263fd66b9e5945c2fffe88c33789e85 | 6,384 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_membership.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_membership.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_membership.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# 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 =... | 28.886878 | 114 | 0.689066 |
5de55d26d14785abfd42119341802a24b25bd66d | 8,825 | py | Python | tests/onegov/election_day/utils/test_summaries.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/utils/test_summaries.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/utils/test_summaries.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from freezegun import freeze_time
from onegov.ballot import Election
from onegov.ballot import ElectionCompound
from onegov.ballot import Vote
from onegov.election_day.collections import ArchivedResultCollection
from tests.onegov.election_day.common import DummyRequest
from onegov.election_day... | 32.208029 | 77 | 0.556487 |
ab297c2e9f0f28e31314a323e59638c0cae0ae23 | 5,362 | py | Python | main.py | undso/ing-balance-crawler | 4adba708e49c2369389b6b33ac279137d28673ae | [
"MIT"
] | null | null | null | main.py | undso/ing-balance-crawler | 4adba708e49c2369389b6b33ac279137d28673ae | [
"MIT"
] | null | null | null | main.py | undso/ing-balance-crawler | 4adba708e49c2369389b6b33ac279137d28673ae | [
"MIT"
] | null | null | null | import logging
import os
import requests
import time
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import WebDriverException
from urllib.parse import urlencode, quote_plus
from pathlib import Path
logger = logging.getLogger("postbank")
lo... | 37.760563 | 143 | 0.690041 |
db6c8c86dc3a37e7327b117fee70c49d1afe6e2a | 2,855 | py | Python | research/cv/DeepID/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/DeepID/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/DeepID/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 44.609375 | 119 | 0.711734 |
530d1d7f9044c305335e62a1933a32795db51d92 | 20,718 | py | Python | src/onegov/wtfs/forms/scan_job.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/scan_job.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/scan_job.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from dateutil.parser import parse
from onegov.core.orm.func import unaccent
from onegov.form import Form
from onegov.form.fields import ChosenSelectMultipleField
from onegov.form.fields import MultiCheckboxField
from onegov.form.fields import PreviewField
from onegov.wtfs import _
from onegov.... | 33.201923 | 78 | 0.596245 |
beb64328d05e347730f0c893410ae1295cb2f9bb | 454 | py | Python | ___Python/Marco/PythonProj/p02_datenstrukturen/m04_Woerterbuch_invertieren.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p02_datenstrukturen/m04_Woerterbuch_invertieren.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p02_datenstrukturen/m04_Woerterbuch_invertieren.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | d = {"Tisch": "table",
"Stuhl": "chair",
"Schreibtisch": "desk"}
#Ziel: neues Wörterbuch aufbauen, das als Schlüssel engl. Begriffe enthält
# 1. Ansatz:
l = []
for tupel in d.items():
l.append((tupel[1], tupel[0]))
# 2. Ansatz:
l = [] # List comprehension
l = [(tupel[1], tupel[0])for tupel... | 18.916667 | 75 | 0.559471 |
bec00850470b82f0641692ad496accbf5c3e8792 | 2,969 | py | Python | 7-assets/past-student-repos/Whiteboard-Pairing-master/SetOfStacks/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 13 | 2021-03-11T00:25:22.000Z | 2022-03-19T00:19:23.000Z | 7-assets/past-student-repos/Whiteboard-Pairing-master/SetOfStacks/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 160 | 2021-04-26T19:04:15.000Z | 2022-03-26T20:18:37.000Z | 7-assets/past-student-repos/Whiteboard-Pairing-master/SetOfStacks/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 12 | 2021-04-26T19:43:01.000Z | 2022-01-31T08:36:29.000Z | class SetOfStacks:
def __init__(self, capacity):
self.capacity = capacity
self.stacks = [[]]
# the index of the current stack we're on
self.stack_index = 0
# returns the number of stacks
def __len__(self):
return self.stack_index + 1
def push(self, item):
# check to see if the current ... | 36.654321 | 77 | 0.692489 |
fe5e209cb7ce066cb2cb3ef86f52699cd3a2e0c1 | 435 | py | Python | gestionTomaDatos/migrations/0004_estudio_clave_protocolo.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T01:20:45.000Z | 2021-01-09T01:20:45.000Z | gestionTomaDatos/migrations/0004_estudio_clave_protocolo.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T00:53:55.000Z | 2021-01-09T00:53:55.000Z | gestionTomaDatos/migrations/0004_estudio_clave_protocolo.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-07T23:57:28.000Z | 2021-01-07T23:57:28.000Z | # Generated by Django 2.2.17 on 2021-01-17 21:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gestionTomaDatos', '0003_auto_20210117_2058'),
]
operations = [
migrations.AddField(
model_name='estudio',
name='cl... | 22.894737 | 81 | 0.627586 |
22ae1ca13abc53ac1da73a5fcb11cf54a33eaef5 | 7,626 | py | Python | closed/PengChengLaboratory/code/ad/tiny/v0.1/training/anomaly_detection/03_tflite_test.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | 5 | 2021-06-22T15:34:37.000Z | 2022-03-29T06:12:03.000Z | closed/PengChengLaboratory/code/ad/tiny/v0.1/training/anomaly_detection/03_tflite_test.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | null | null | null | closed/PengChengLaboratory/code/ad/tiny/v0.1/training/anomaly_detection/03_tflite_test.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | 5 | 2021-08-02T16:39:02.000Z | 2022-03-29T06:12:04.000Z | """
@file 03_tflite_test.py
@brief Script for testing tflite performance
@author Csaba Kiraly (based on 01_test.py)
Copyright (C) 2020 Hitachi, Ltd. All right reserved.
"""
########################################################################
# import default python-library
##################################... | 44.337209 | 122 | 0.457514 |
22b29b378944a00631d2c113cdcc82de9a0ff227 | 1,716 | py | Python | other/scan_net.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | null | null | null | other/scan_net.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | 1 | 2020-07-31T16:37:23.000Z | 2020-07-31T16:37:23.000Z | other/scan_net.py | AndrVLDZ/Start_DAW | 1825038a832ecd32496e4930d9c829a192fda752 | [
"Apache-2.0"
] | null | null | null | import os
import socket
import multiprocessing
import subprocess
import os
def pinger(job_q, results_q):
"""
Do Ping
:param job_q:
:param results_q:
:return:
"""
DEVNULL = open(os.devnull, 'w')
while True:
ip = job_q.get()
if ip is None:
break
try... | 19.280899 | 71 | 0.558275 |
43560d2f73f58f1f805042b4dc4af5e30cc9064d | 4,600 | py | Python | haas_lib_bundles/python/docs/examples/rc522_write_read/haas506/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/rc522_write_read/haas506/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/rc522_write_read/haas506/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from driver import GPIO
import network
import ujson
import utime as time
import modem
from aliyunIoT import Device
import kv
import read
import write
import _thread
import mfrc522
import ujson
from driver import WDT
wdt = WDT()
wdt.open('wdt')
wdt.feed()
global g_connect_status,net,device,deviceSecr... | 26.900585 | 123 | 0.663913 |
437dfb0f58fece6e6b95c287de50683c35e4e204 | 2,419 | py | Python | pyconuk/models.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/models.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | pyconuk/models.py | OddBloke/2016.pyconuk.org | 831d510a83c9cab8541198005c8024003b5049f5 | [
"MIT"
] | null | null | null | from django.db import models
from django_amber.models import ModelWithContent, ModelWithoutContent
class Page(ModelWithContent):
title = models.CharField(max_length=255)
callout_big_1 = models.CharField(max_length=255)
callout_big_2 = models.CharField(max_length=255)
callout_small = models.CharField(m... | 26.010753 | 69 | 0.687888 |
602cfbc5e18556e42b1c6835a3800a3e5ceb93b2 | 13,852 | py | Python | rezepdatenbank.py | l0ggik/Rezepdatenbank | a6bdd63909263c6fe39daac5ad69dec0654a43d0 | [
"Apache-2.0"
] | null | null | null | rezepdatenbank.py | l0ggik/Rezepdatenbank | a6bdd63909263c6fe39daac5ad69dec0654a43d0 | [
"Apache-2.0"
] | null | null | null | rezepdatenbank.py | l0ggik/Rezepdatenbank | a6bdd63909263c6fe39daac5ad69dec0654a43d0 | [
"Apache-2.0"
] | null | null | null | import sqlite3
import tkinter as tk
from tkinter import messagebox
import database_connection
def main():
database_connection.init_database()
gui_root = tk.Tk()
init_app = GuiWindow(master=gui_root)
init_app.mainloop()
class GuiWindow(tk.Frame):
def __init__(self, master=None):
super... | 43.2875 | 143 | 0.621138 |
71a89bee9b1859c0fa4a091c29ac644014f99807 | 14,076 | py | Python | pluginsinterface/PlugFilter.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | pluginsinterface/PlugFilter.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | 1 | 2020-09-22T02:30:40.000Z | 2020-09-22T02:30:40.000Z | pluginsinterface/PlugFilter.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import re
import traceback
from module.msgStream import SendMessage
from pluginsinterface.TypeExtension import PlugMsgTypeEnum
from helper import getlogger
logger = getlogger(__name__)
"""
插件消息过滤类
"""
class PlugMsgFilter:
"""
使用正则表达式匹配消息起始部分,会忽略标准数据段以外的数据段
正则表达式起始不为(时将使用()包... | 34.415648 | 80 | 0.388036 |
e07f2955e47db2d97d6b2c19a99fb4581255c875 | 4,546 | py | Python | scriptsForPreprocessing/crete_mask_manual.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | scriptsForPreprocessing/crete_mask_manual.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | scriptsForPreprocessing/crete_mask_manual.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import os, json
import random
import cv2
import numpy as np
from PIL import Image, ImageDraw
def random_color():
levels = range(32, 256, 32)
return tuple(random.choice(levels) for _ in range(3))
points = []
cropping = False
def click_and_crop(event, x, y, flags, param):
global points, cropping
# i... | 38.201681 | 105 | 0.596568 |
40ac8d64ad3df9e758d05023efa2abcc4acef4e2 | 166 | py | Python | Tutorials/30 Days of Code/Day 10/binary.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Tutorials/30 Days of Code/Day 10/binary.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Tutorials/30 Days of Code/Day 10/binary.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
import re
n = int(input().strip())
binary = "{0:b}".format(n)
max_len = max([len(s) for s in re.findall(r'1+', binary)])
print(max_len)
| 13.833333 | 58 | 0.63253 |
40d3a1e38dbd734a66ac8c40621c8254627dcd5c | 12,090 | py | Python | docker/api/api/endpoints/edit_groups.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 2 | 2021-03-23T20:32:38.000Z | 2021-04-21T11:20:12.000Z | docker/api/api/endpoints/edit_groups.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 4 | 2021-04-19T11:00:55.000Z | 2021-04-20T08:21:48.000Z | docker/api/api/endpoints/edit_groups.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Corona-Info-App
#
# © 2020 Tobias Höpp
# Include dependencies
from flask import request, jsonify
# Include modules
from main import api, db, jwt
from flask_jwt_extended import jwt_required
from models.measures import displayGroup, display
from utils.edit_display_utils import addDefaultGrou... | 39.639344 | 180 | 0.538792 |
90a4c410aa42375010c92fda834b3c6ade2bd8e6 | 3,885 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/matrix_pierre.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/matrix_pierre.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/matrix_pierre.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | # Author : Pierre Schnizer
"""
The matrix module.
This module provides mappings to some functions of gsl vectors as descirbed
in Chapter 8. of the gsl reference document. All functions accept one
dimensional Numeric arrays instead of gsl vectors, or return Numeric arrays.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... | 28.566176 | 79 | 0.63269 |
90b6c3a0f5867e0d7ded50d22c7e58bdbc1360b1 | 648 | gyp | Python | source/pkgsrc/lang/nodejs10/patches/patch-deps_cares_cares.gyp | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/nodejs12/patches/patch-deps_cares_cares.gyp | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/nodejs12/patches/patch-deps_cares_cares.gyp | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-deps_cares_cares.gyp,v 1.1 2019/12/09 20:05:40 adam Exp $
Add support for NetBSD.
--- deps/cares/cares.gyp.orig 2013-03-14 10:55:24.000000000 +0900
+++ deps/cares/cares.gyp 2013-03-14 10:55:47.000000000 +0900
@@ -140,6 +140,10 @@
'include_dirs': [ 'config/freebsd' ],
'sources': [ ... | 36 | 72 | 0.555556 |
293d23b63f92e93e1ba78ec531c2aade385e4ca0 | 3,948 | py | Python | test/test_npu/test_le.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_le.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_le.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... | 36.897196 | 79 | 0.68845 |
296b323ff887c28c47d62284d679384215a10e7d | 21 | py | Python | addnew.py | s0ber23/hackt0berf3st | 2575d7e3ecece785d84890e3c9a8ae9d08acc2cc | [
"MIT"
] | null | null | null | addnew.py | s0ber23/hackt0berf3st | 2575d7e3ecece785d84890e3c9a8ae9d08acc2cc | [
"MIT"
] | null | null | null | addnew.py | s0ber23/hackt0berf3st | 2575d7e3ecece785d84890e3c9a8ae9d08acc2cc | [
"MIT"
] | 3 | 2020-10-20T05:50:08.000Z | 2020-10-20T06:08:06.000Z | print("hello s0ber")
| 10.5 | 20 | 0.714286 |
46846bd26192359834cab6dc5bf436d5cc24e396 | 1,029 | py | Python | Sorting/algos/merge.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | null | null | null | Sorting/algos/merge.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | null | null | null | Sorting/algos/merge.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | 1 | 2020-09-25T18:31:34.000Z | 2020-09-25T18:31:34.000Z | import numpy as np
import matplotlib.pyplot as plt
def merge(arr, start, mid, end):
temp_arr = np.array(arr)
i = start
j = mid
k = start
while i < mid and j < end and k < end:
if arr[i] <= arr[j]:
temp_arr[k] = arr[i]
i = i + 1
else:
temp_arr[k] ... | 20.176471 | 42 | 0.498542 |
31803a477b2b553ba995ca4b45a6e6c0546c6fe2 | 997 | py | Python | exercises/ja/test_04_10.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/test_04_10.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/test_04_10.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert len(TRAINING_DATA) == 4, "トレーニングデータの数がおかしいです。正しくは4つです。"
assert all(
len(entry) == 2 and isinstance(entry[1], dict) for entry in TRAINING_DATA
), "学習データのフォーマットがおかしいです。二番目の要素が辞書となるタプルのリストにしてください。"
assert all(
entry[1].get("entities") for entry in TRAINING_DATA
), "すべ... | 35.607143 | 110 | 0.63992 |
31b5198481c549589a372f2e1044c5edd135b13d | 3,491 | py | Python | polybar/modules/player-mpris-tail.py | ytelitenoob/dotfiles_archpad | 8defe43a9b36fe3116a458437b7195928970110b | [
"MIT"
] | null | null | null | polybar/modules/player-mpris-tail.py | ytelitenoob/dotfiles_archpad | 8defe43a9b36fe3116a458437b7195928970110b | [
"MIT"
] | null | null | null | polybar/modules/player-mpris-tail.py | ytelitenoob/dotfiles_archpad | 8defe43a9b36fe3116a458437b7195928970110b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
import sys
import subprocess
import gi
gi.require_version('Playerctl', '1.0')
from gi.repository import Playerctl, GLib
MUSIC_ICON = '🎝'
PAUSE_ICON = ''
PLAYER_CLOSED_ICON = '-'
def listPlayers():
return [
playername.split('"')[1].split('.')[-1]
for playernam... | 30.094828 | 177 | 0.578344 |
b43898f14ab4c42fa7dfb45c1571561bb330fb63 | 1,300 | py | Python | src/aijack/defense/dp/manager/privacy_manager.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/dp/manager/privacy_manager.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/dp/manager/privacy_manager.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | from torch.utils.data import DataLoader
from .dataloader import PoissonSampler
from .optimizer import attach_differential_privacy_mechanism
class PrivacyManager:
def __init__(
self,
accountant,
optimizer_cls,
l2_norm_clip,
dataset,
lot_size,
batch_size,
... | 27.659574 | 86 | 0.623846 |
d2b2727a15169864a42290289286706b5e29069a | 100 | py | Python | python/python_backup/PRAC_PYTHON/fd1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/fd1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/fd1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | out=open("abc.txt","r")
for i in range(1,10,1):
l=out.readline()
print l
out.close()
| 16.666667 | 24 | 0.55 |
d2d778d05434452941b8c2d3062fb48b9572d24f | 876 | py | Python | ML Algorithms/kNearestNeighbour.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | ML Algorithms/kNearestNeighbour.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | ML Algorithms/kNearestNeighbour.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | 1 | 2020-09-30T18:53:05.000Z | 2020-09-30T18:53:05.000Z | import matplotlib.pyplot as plt
import numpy as np
import math
f=[[10,5],[40,7],[3,2],[5,3]]
l=['good','good','bad','bad']
x=[]
y=[]
s=len(set(l)) #shows all categories present
for i in range(len(f)):
f1=f[i][0]
x=np.append(x,f1)
f2=f[i][1]
y=np.append(y,f2)
print(x," ",y)
for i in range(len(f)):
i... | 20.857143 | 61 | 0.56621 |
8253c91c82238c07d932af68eef37e6d69b61d83 | 1,402 | py | Python | ML/polynomialRegression - income per position/polynomial_regression.py | DorianBul/UE_US_Projekt_ML | 6065b1fa0069163dced0b3cdede9a2a822829694 | [
"MIT"
] | null | null | null | ML/polynomialRegression - income per position/polynomial_regression.py | DorianBul/UE_US_Projekt_ML | 6065b1fa0069163dced0b3cdede9a2a822829694 | [
"MIT"
] | null | null | null | ML/polynomialRegression - income per position/polynomial_regression.py | DorianBul/UE_US_Projekt_ML | 6065b1fa0069163dced0b3cdede9a2a822829694 | [
"MIT"
] | null | null | null | # Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('incomePerPositionAtCompany.csv')
X = dataset.iloc[:, 1:-1].values
y = dataset.iloc[:, -1].values
# Liniowa regresja
from sklearn.linear_model import LinearRegression
lin_reg ... | 30.478261 | 106 | 0.766049 |
4871200af6687f7537bf0034c180c5018ba77c79 | 4,231 | py | Python | src/Sephrasto/DatenbankEditWaffeneigenschaftWrapper.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/DatenbankEditWaffeneigenschaftWrapper.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/DatenbankEditWaffeneigenschaftWrapper.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 18 10:52:34 2017
@author: Aeolitus
"""
import Objekte
import UI.DatenbankEditWaffeneigenschaft
from PyQt5 import QtWidgets, QtCore
from Wolke import Wolke
class DatenbankEditWaffeneigenschaftWrapper(object):
def __init__(self, datenbank, waffeneigenschaft=None, reado... | 44.072917 | 159 | 0.677145 |
4886cf52eef8f7883e9324245643b0812ca6a56b | 4,068 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOphoto.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOphoto.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOphoto.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from builtins import str
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtCore import QObject
from qgis.core import QgsProject
import os
class run(QObject):
def __init__(self, id, gtotool, config, debug):
super(run, self).__init__()
try:
se... | 42.375 | 129 | 0.492625 |
962e4ff1e20d43ab93db2b181b7f54d518585839 | 5,111 | py | Python | src/main/python/floatingpoints/floating_points_fixed_controller.py | mkisser-tgm/floating_points | ef6c93c1d1fa5bbb38615c0d2fc7632b31f06e8e | [
"MIT"
] | null | null | null | src/main/python/floatingpoints/floating_points_fixed_controller.py | mkisser-tgm/floating_points | ef6c93c1d1fa5bbb38615c0d2fc7632b31f06e8e | [
"MIT"
] | null | null | null | src/main/python/floatingpoints/floating_points_fixed_controller.py | mkisser-tgm/floating_points | ef6c93c1d1fa5bbb38615c0d2fc7632b31f06e8e | [
"MIT"
] | null | null | null | import sys, time
from PyQt5.Qt import *
from PyQt5.QtWidgets import *
from floatingpoints import floating_points_fixed_view as view, floating_points_fixed_model as model
class FloatingPointController(QWidget):
"""
MVC pattern: Creates a controller according to the mvc pattern.
:ivar safe_close: Safe clo... | 31.745342 | 117 | 0.597926 |
96a9461a269f88ca42b97711b80f04992aa74af4 | 3,899 | py | Python | src/measurements_service/main.py | wbpascal/statuswebsite | 7a81e530a9176c53abeab0582cb710113101b716 | [
"MIT"
] | 1 | 2021-04-18T20:21:03.000Z | 2021-04-18T20:21:03.000Z | src/measurements_service/main.py | wbpascal/statuswebsite | 7a81e530a9176c53abeab0582cb710113101b716 | [
"MIT"
] | null | null | null | src/measurements_service/main.py | wbpascal/statuswebsite | 7a81e530a9176c53abeab0582cb710113101b716 | [
"MIT"
] | 1 | 2021-04-18T20:21:08.000Z | 2021-04-18T20:21:08.000Z | from influxdb import InfluxDBClient
from datetime import datetime
from flask import Flask,request
from itertools import chain
import json
import os
app = Flask(__name__) # Needs to be here so we can compile because the @app.route annotation needs this before main() is run
def main():
global client
u... | 44.816092 | 199 | 0.580149 |
96af50cb5a242a350fc3a08aefc427e0b11f6868 | 167 | py | Python | data_tests/saved__backend__py3.9/python/boosted_func_use_import.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/python/boosted_func_use_import.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__py3.9/python/boosted_func_use_import.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from exterior_import_boost import func_import
def func(a, b):
return (a * np.log(b)).max() + func_import()
__transonic__ = ("0.3.0.post0",)
| 16.7 | 48 | 0.682635 |
fb70ac9497b7251a5c795c3d34a8dece3b959733 | 2,129 | py | Python | research/hpc/pinns/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/pinns/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/pinns/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... | 38.709091 | 97 | 0.65148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.