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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
33d30df87de5e9c98c36123b32e5d77e16226f1f | 955 | py | Python | tests/cli/test_notifications.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | tests/cli/test_notifications.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | tests/cli/test_notifications.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from tests.seeder import Seeder
from tests.utils import UtilActions
def test_send_recycling_events(app, db, seeder: Seeder, utils: UtilActions):
from project.dateutils import create_berlin_date
app.config["SERVER_NAME"] = "127.0.0.1"
utils.mock_now(2022, 4, 20, 18)
tomorrow = create_berlin_date(2022,... | 35.37037 | 76 | 0.756021 |
1d53f481fe2eecd13b331bac55002b5ebbb40a17 | 1,108 | py | Python | Project Euler Qusetions 41 - 50/Project Euler Question 49.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 41 - 50/Project Euler Question 49.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 41 - 50/Project Euler Question 49.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 49
#Prime permutations
import math
import itertools
def prime_check(x):
if x > 2:
if x % 2 == 0:
return False
else:
for factor in range(3, int(math.sqrt(x) + 1), 2):
if (x % factor) == 0:
return False
el... | 29.157895 | 86 | 0.516245 |
63b0ff58ba3112ce9344814489be4c21445b4dc8 | 640 | py | Python | bot/database/database.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/database/database.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/database/database.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import logging
from gino import Gino
from bot.constants import Database as DatabaseConfig
db = Gino()
log = logging.getLogger(__name__)
def build_db_uri() -> str:
"""Use information from the config file to build a PostgreSQL URI."""
return (
f"postgresql://{DatabaseConfig.username}:{DatabaseConfig... | 25.6 | 81 | 0.709375 |
89bc38fd15c708b6876c2b90e1e1e3faf9704809 | 7,979 | py | Python | verarbeitung.py | Shelicus/Krypto_discod_bot | e1b747d2cbee28511e9000b3ba87a869600f49fa | [
"Apache-2.0"
] | null | null | null | verarbeitung.py | Shelicus/Krypto_discod_bot | e1b747d2cbee28511e9000b3ba87a869600f49fa | [
"Apache-2.0"
] | null | null | null | verarbeitung.py | Shelicus/Krypto_discod_bot | e1b747d2cbee28511e9000b3ba87a869600f49fa | [
"Apache-2.0"
] | null | null | null |
def message(name):
message_btc_1 = 'Message-ID'
message_btc_2 = 'Message-ID'
message_btc_3 = 'Message-ID'
message_btc_4 = 'Message-ID'
message_btc_5 = 'Message-ID'
message_btc_6 = 'Message-ID'
message_btc_7 = 'Message-ID'
message_btc_8 = 'Message-ID'
message_btc_9 = 'Message-ID'
... | 43.840659 | 252 | 0.66274 |
987577b64f10c2dfdce72350705708dacd7225a3 | 2,910 | py | Python | TEG/past_works/gerador.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | TEG/past_works/gerador.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | TEG/past_works/gerador.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | import random as r
import math as m
def cria_ponto():
return round(r.uniform(0, 1), 4)
def gera_coordenadas(n):
pontos = []
set_x, set_y = set(), set()
while len(set_x) < n:
set_x.add(cria_ponto())
while len(set_y) < n:
set_y.add(cria_ponto())
for x, y in zip(s... | 34.235294 | 92 | 0.554983 |
98777b4a9240e64fe8852c73880b5fbb4d183bdc | 291 | py | Python | src/scheduler/api.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/scheduler/api.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/scheduler/api.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from flask_restful import Api
import scheduler.handlers as handlers
class MsiSchedulerApi(Api):
VERSION = 'v1'
PREFIX = f'{VERSION}/api'
def __init__(self, app):
super().__init__(app)
handlers.init_api(self)
def init_api(app):
return MsiSchedulerApi(app)
| 19.4 | 37 | 0.687285 |
7f42fc0d4f6be8a1dcdb464279e7b8a698c2d7f7 | 2,709 | py | Python | python_experiments/data_analysis/tkde_data_parsing/accuracy_results.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/tkde_data_parsing/accuracy_results.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/tkde_data_parsing/accuracy_results.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | from config import *
from data_analysis.util.read_file_utils_updated import *
from data_analysis.util.parsing_helpers import *
from data_analysis.tkde_data_parsing.key_word_tags import *
import json
if __name__ == '__main__':
env_tag = lccpu12_tag
with open('../../config.json') as ifs:
my_config_dict =... | 43 | 100 | 0.628645 |
7fa148607e45711e85ba4898240f1aa08d6a736f | 425 | py | Python | v602/python/bragg.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v602/python/bragg.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v602/python/bragg.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
theta, impuls = np.genfromtxt('python/bragg.txt', unpack=True)
print('28-27.6=0.4')
print('100*(28-27.6)/28=',100*(28-27.6)/28)
plt.plot(theta, impuls, 'bx')
plt.plot([28, 28], [0, 300], 'r-', label='Theoriewert')
plt.xlabel(r'$φ\;/\;\si{\degree}$')
plt.ylabel('Coun... | 23.611111 | 62 | 0.663529 |
125efd092683455eb18f4ade943b2f257b43a3bb | 1,381 | py | Python | nffb/migrations/0001_initial.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/migrations/0001_initial.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/migrations/0001_initial.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-24 10:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
initial = True
dependencies = [
('cms', '0016_a... | 40.617647 | 200 | 0.650978 |
c39bc32391b00523439d0dbfa3fc7bf448cb648e | 3,085 | py | Python | tikz/center-two-cluster/tikz.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | tikz/center-two-cluster/tikz.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | tikz/center-two-cluster/tikz.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | from random import uniform
import random
import math
print """\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{tikz}
\usepackage{tkz-fct}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{shapes, calc, decorations}
\usepackage{amsmath,amssymb}
\\begin{document... | 23.195489 | 79 | 0.575689 |
6176ffbf7a0c5caa6250bddab428652d0cb79e80 | 339 | py | Python | ELK/kafka/_resources/python-demo/kafka_consumer.py | LubinLew/lubinlew.github.io | 9a27359c8a5e2288e7203bce766407c9b9baf82f | [
"BSD-2-Clause"
] | null | null | null | ELK/kafka/_resources/python-demo/kafka_consumer.py | LubinLew/lubinlew.github.io | 9a27359c8a5e2288e7203bce766407c9b9baf82f | [
"BSD-2-Clause"
] | null | null | null | ELK/kafka/_resources/python-demo/kafka_consumer.py | LubinLew/lubinlew.github.io | 9a27359c8a5e2288e7203bce766407c9b9baf82f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from kafka import KafkaConsumer
bootstrap_servers_list="10.130.12.13:9092"
consumer = KafkaConsumer(bootstrap_servers=bootstrap_servers_list, client_id='test', group_id='test')
consumer.subscribe(pattern='^.+$')
# 循环处理数据, 如果没有数据则挂起等待新数据
for msg in consumer:
print(m... | 24.214286 | 101 | 0.746313 |
9cea07e6af14fbb44916aaf487c1cd48e287f4d0 | 2,025 | py | Python | tarefas-poo/lista-03/relogio/model/relogio.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/relogio/model/relogio.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/relogio/model/relogio.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício do relógio
# --------------------------
# Classe que representa um relógio, que é um objeto que representa um
# instante no tempo (hora, minuto e segundo).
class Relogio:
def __init__(self, hora=0, minuto=0, segundo=0):
'''Cria um relógi... | 28.125 | 83 | 0.547654 |
143194b6e92bf6e7f1995dba3738d3de5ffd6fe5 | 141 | py | Python | wagtail_localize/segments/__init__.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 6 | 2019-09-10T19:53:55.000Z | 2019-11-14T16:57:07.000Z | wagtail_localize/segments/__init__.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 17 | 2019-07-11T11:17:37.000Z | 2019-11-19T16:40:31.000Z | wagtail_localize/segments/__init__.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | from .types import ( # noqa
OverridableSegmentValue,
RelatedObjectSegmentValue,
StringSegmentValue,
TemplateSegmentValue,
)
| 20.142857 | 30 | 0.744681 |
14889714ed08ef0357ef4b022d9637f0ff5dc6a6 | 1,598 | py | Python | frds/mktstructure/measures/realized_spread.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 1 | 2022-03-06T20:36:06.000Z | 2022-03-06T20:36:06.000Z | mktstructure/measures/realized_spread.py | mgao6767/mktstructure | 5432c1bed163f838209d34b74c09629bea620ba8 | [
"MIT"
] | null | null | null | mktstructure/measures/realized_spread.py | mgao6767/mktstructure | 5432c1bed163f838209d34b74c09629bea620ba8 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from .exceptions import *
name = "RealizedSpread"
description = """
The realized spread is the temporary component of the effective spread.
It measures the revenue to liquidity providers assuming that the liquidity provider is able to close
her position at the midpoint prevaili... | 40.974359 | 100 | 0.688986 |
148d0b5abb10cac36367adc638ac171357fe35e0 | 696 | py | Python | exercises/fr/solution_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/solution_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/solution_04_11.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.tokens import Span
nlp = spacy.blank("fr")
doc1 = nlp("je suis allé à amsterdem l'an dernier et les canaux étaient magnifiques")
doc1.ents = [Span(doc1, 4, 5, label="GPE")]
doc2 = nlp("Tu devrais visiter Paris au moins une fois dans ta vie, "
"mais la Tour Eiffel ce n'est pas terrible")
d... | 38.666667 | 85 | 0.683908 |
14b72ab66d9057780cb4c24bf5c245ebdc02094b | 1,730 | py | Python | ___Python/Michael/p03_lambdaMA/m06_anwendung.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p03_lambdaMA/m06_anwendung.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p03_lambdaMA/m06_anwendung.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | from datetime import date
from p01_kennenlernern import meinebibliothek
torsten = ["Torsten", "Aachen", date(1967, 1, 1), ["C"]]
michael = ["Michael", "Moormerland", date(1981, 1, 10), ["Javascript"]]
karpoo = ["Karpoo", "Düsseldorf", date(1969, 1, 1), ["ABAP"]]
carsten = ["Carsten", "Aachen", date(1971, 2, 3)... | 34.6 | 105 | 0.672832 |
1aef913b902720a79a580194a37672fb1b26468e | 249 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.7-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.7-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.7-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 14.7 Design Grade Database
# Imagine a simple database storing info for students' grades.
# Design what this database might look like and provide a SQL query to
# return a list of the honor roll students (top 10%), sorted by their
# GPA.
| 35.571429 | 73 | 0.730924 |
2ef7df1fd6cb76663d1d28d63aba41eadabb3788 | 776 | py | Python | gemtown/copyrights/urls.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/copyrights/urls.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/copyrights/urls.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = "copyrights"
urlpatterns = [
path("music/", view=views.ListAllMusicCopyrights.as_view(), name="all_music_copyrights"),
path("music/<int:user_id>/all/", view=views.ListUserMusicCopyrights.as_view(), name="user_music_copyrights"),
pa... | 64.666667 | 133 | 0.738402 |
4ce9318151e4081cc292f176aef06796673d686e | 931 | py | Python | src/aijack/collaborative/fedmd/server.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:44.000Z | 2022-03-17T21:17:44.000Z | src/aijack/collaborative/fedmd/server.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/collaborative/fedmd/server.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:46.000Z | 2022-03-17T21:17:46.000Z | import torch
from ..core import BaseServer
class FedMDServer(BaseServer):
def __init__(
self,
clients,
server_id=0,
device="cpu",
):
super(FedMDServer, self).__init__(clients, None, server_id=server_id)
self.device = device
def forward(self, x):
pr... | 26.6 | 77 | 0.597207 |
2c6a55bb50ed877753e59016173df8d7226c7802 | 77 | py | Python | misc/kcufsj/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | 1 | 2019-06-15T11:45:41.000Z | 2019-06-15T11:45:41.000Z | misc/kcufsj/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | misc/kcufsj/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | jsfuck = open("kcufsj", "r").read()
open("jsfuck", "w").write(jsfuck[::-1])
| 19.25 | 39 | 0.571429 |
b38c6a6df4367eb6b5cd1a35c47ff15f20fff95f | 248 | py | Python | 5_ifElse/2_ifElse.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 5_ifElse/2_ifElse.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 5_ifElse/2_ifElse.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
Bedingungen und Alternative
Dieses Programm zeichnet nichts auf die Fläche, sondern schreibt in die Konsole.
"""
randomValue = random()
if randomValue > 0.5:
print("😎")
else:
print("😡")
"""
- Führe das Programm ein paar mal aus.
""" | 15.5 | 80 | 0.673387 |
20ac6764ac7f232fd7cf1e03740116acf0c5215e | 106 | py | Python | python/atexit/atexit_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | 3 | 2018-08-14T09:33:52.000Z | 2022-03-21T12:31:58.000Z | src/lesson_application_building_blocks/atexit_decorator.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | src/lesson_application_building_blocks/atexit_decorator.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | 1 | 2018-10-06T23:50:50.000Z | 2018-10-06T23:50:50.000Z | import atexit
@atexit.register
def all_done():
print('all_done()')
print('starting main program')
| 10.6 | 30 | 0.698113 |
925ee5cf29cf41823df3f03c0d4162fc46ecd044 | 33 | py | Python | python/coding_dojang/database/__init__.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/database/__init__.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/coding_dojang/database/__init__.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from .sqlite.dbapi import connect | 33 | 33 | 0.848485 |
92a4588fe8321e0a7731599b8158c6df34407e67 | 528 | py | Python | src/onegov/people/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/people/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/people/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.people.collections import AgencyCollection
from onegov.people.collections import AgencyMembershipCollection
from onegov.people.collections import PersonCollection
from onegov.people.models import Agency
from onegov.people.models import AgencyMembership
from onegov.people.models import AgencyOrganigram
from ... | 27.789474 | 64 | 0.799242 |
2baa5e74b288eef8e980b053d9cc064332cf7ccc | 2,331 | py | Python | 0-notes/job-search/SamplesDSAlgos/sort/sort_count.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/sort/sort_count.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/SamplesDSAlgos/sort/sort_count.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null |
# os.chdir("E:\\projects\\LambdaSchool\\m6\\63a1\\src\\iterative_sorting\")
# exec(open("iterative_sorting.py").read())
# COUNT SORT:
# get maximum element from array
# define count array of size [max+1]
# set all elements in the count array to 0
# increase count of each number which are found in the ... | 30.272727 | 75 | 0.589018 |
920d9835b246a99d00049f2e849faef3939b9031 | 3,797 | py | Python | simulate.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | simulate.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | simulate.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | import os
import pygame
import math
from math import sin, radians, degrees, copysign
from pygame.math import Vector2
from Display import Display
from Car import Car
from random import random
class Game:
def __init__(self):
pygame.init()
pygame.display.set_caption("Car tutorial")
width =... | 29.207692 | 91 | 0.528312 |
a6fe2aff84750252de62dba9edf9f2070096286e | 25,984 | py | Python | Python/input.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | 1 | 2019-02-11T00:45:37.000Z | 2019-02-11T00:45:37.000Z | Python/input.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | Python/input.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | import tkinter
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tkinter import filedialog
import os
import os.path
import shutil
class Input():
def __init__(self, master):
self.master = master
# SECTION 1.1: GEOMETRY AND MESH
title_section_1_1 = LabelFrame... | 52.492929 | 228 | 0.650208 |
1b009b6428e80815c8d2c434ebf6fa1fadffb9d9 | 4,316 | py | Python | imwievaluation/lecture.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/lecture.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/lecture.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | import sqlalchemy as db
import csv
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import mysql
from base import Base
from student import Student
from utils import get_or_create, clean_string
from spreadsheet import SpreadsheetHandler
participation = db.Table(
'participation', Base.metadata,
... | 38.535714 | 97 | 0.654773 |
9429a0c5f9a9aa1407f41636f0db233fe611650c | 2,496 | py | Python | Assembler/exceptions.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | 1 | 2019-01-28T01:53:20.000Z | 2019-01-28T01:53:20.000Z | Assembler/exceptions.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | null | null | null | Assembler/exceptions.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | null | null | null |
class Error(Exception): pass
class label_duplicate_error(Error):
def __init__(self, string):
self.string = string
class data_string_not_convertible_error(Error):
def __init__(self, string):
self.string = string
class label_replacement_not_successful_error(Error):
def __init__(self, strin... | 31.2 | 95 | 0.674279 |
ca03c8982286ccb5eff95160e5b30526da33deca | 136 | py | Python | basics/is_valid_regex.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | basics/is_valid_regex.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | basics/is_valid_regex.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | import re
for i in range(0, int(input())):
try:
re.compile(input())
print("True")
except re.error:
print("False") | 17 | 32 | 0.566176 |
b6e176b5ca03477790dda474c3668bb3230fcfc9 | 734 | py | Python | Zh3r0/2021/crypto/real_mersenne/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Zh3r0/2021/crypto/real_mersenne/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Zh3r0/2021/crypto/real_mersenne/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import random
from secret import flag
from fractions import Fraction
def score(a,b):
if abs(a-b)<1/2**10:
# capping score to 1024 so you dont get extra lucky
return Fraction(2**10)
return Fraction(2**53,int(2**53*a)-int(2**53*b))
total_score = 0
for _ in range(2000):
try:
x = rando... | 25.310345 | 61 | 0.583106 |
f3cb603457fb7b47792f7a466400d948db237085 | 47 | py | Python | Vorlesungsinhalte/2020-10-16-MauMau/main.py | wwi20ama-programmierung/python-intro | e779e3f600b7e54b7c5baef503b79065bdc3cdb6 | [
"MIT"
] | null | null | null | Vorlesungsinhalte/2020-10-16-MauMau/main.py | wwi20ama-programmierung/python-intro | e779e3f600b7e54b7c5baef503b79065bdc3cdb6 | [
"MIT"
] | null | null | null | Vorlesungsinhalte/2020-10-16-MauMau/main.py | wwi20ama-programmierung/python-intro | e779e3f600b7e54b7c5baef503b79065bdc3cdb6 | [
"MIT"
] | 2 | 2020-10-08T18:08:59.000Z | 2020-10-29T19:53:34.000Z | from maumau import start_maumau
start_maumau()
| 15.666667 | 31 | 0.851064 |
b631e65190724dfcbac0765e2d0d7e251e9fef66 | 1,509 | py | Python | genpath.py | AlbertMukhammadiev/SteinerProblem | 71d86a86626e093ff20e7018b7c0147a18a4b165 | [
"MIT"
] | 1 | 2019-11-14T09:50:58.000Z | 2019-11-14T09:50:58.000Z | genpath.py | AlbertMukhammadiev/SteinerProblem | 71d86a86626e093ff20e7018b7c0147a18a4b165 | [
"MIT"
] | null | null | null | genpath.py | AlbertMukhammadiev/SteinerProblem | 71d86a86626e093ff20e7018b7c0147a18a4b165 | [
"MIT"
] | null | null | null | """This is an auxiliary module for the module steiner.py
which allows to generate paths of building of Steiner tree.
Functions:
generate_paths(n) -> filterfalse obj
"""
from itertools import permutations, filterfalse
def generate_paths(n):
"""Build all sorts of ways to select two points.
Arguments:
... | 27.436364 | 74 | 0.579192 |
fcb9ddc3588d0a40e3dbb276d0cb95e6c29d7835 | 384 | py | Python | leetcode/069-Sqrt/Sqrt_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/069-Sqrt/Sqrt_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/069-Sqrt/Sqrt_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer} x
# @return {integer}
def mySqrt(self, x):
left, right = 0, x / 2 + 1
while left <= right:
m = (left + right) / 2
sq = m * m
if sq == x:
return m
elif sq < x:
left = m + 1
... | 24 | 34 | 0.369792 |
948f19805aa21d701f148206cad75fdf1f689413 | 6,744 | py | Python | vm/src/python/webpiraten.py | jascosius/web-piraten | b30830ddc9d1168513c117e4e875e5a63066827d | [
"MIT"
] | 3 | 2015-05-18T13:38:39.000Z | 2017-09-07T15:08:08.000Z | vm/src/python/webpiraten.py | jascosius/web-piraten | b30830ddc9d1168513c117e4e875e5a63066827d | [
"MIT"
] | null | null | null | vm/src/python/webpiraten.py | jascosius/web-piraten | b30830ddc9d1168513c117e4e875e5a63066827d | [
"MIT"
] | 2 | 2016-10-31T06:31:42.000Z | 2020-02-18T11:32:22.000Z | # -*- coding: utf-8 -*-
"""
All the functions and enumerations required to program WebPiraten with Python. The commands
generated by this library depend on a prefix
"""
from enum import Enum
#####
# # #### # # ###### # ####
# # # ## # # # # #
# # # # # # ##### # #
# #... | 30.242152 | 95 | 0.519128 |
bf61b7a93159e3604b18e019b207a7854ff5e60e | 2,056 | py | Python | site/public/courses/DS-2.2/Assignments/churn_preprocessing_keras_flask/test_1.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/DS-2.2/Assignments/churn_preprocessing_keras_flask/test_1.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/DS-2.2/Assignments/churn_preprocessing_keras_flask/test_1.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import keras
from keras.models import Sequential
from keras.layers import Den... | 32.125 | 123 | 0.748054 |
bfc7a1cd10444a23cce183d8e738eb83a0db4a0a | 1,360 | py | Python | Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from SetIRProceduresMarkdown import get_tasks_and_readable, set_incident_with_count, SECTIONS_TO_KEEP
def load_json(file):
with open(file, 'r') as f:
return json.load(f)
def test_set_ir_md(mocker):
"""
Given:
Tasks which are organized by `TasksWithSection... | 38.857143 | 108 | 0.722794 |
15be4e93eec47501528ae8729e9d6716aa10517c | 837 | py | Python | codejam/kickstart_2020-c/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 6 | 2018-10-15T18:45:05.000Z | 2022-03-29T04:30:10.000Z | codejam/kickstart_2020-c/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | null | null | null | codejam/kickstart_2020-c/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 4 | 2018-01-07T06:20:07.000Z | 2019-08-21T15:45:59.000Z | def input1(type=int):
return type(input())
def input2(type=int):
[a, b] = list(map(type, input().split()))
return a, b
def input3(type=int):
[a, b, c] = list(map(type, input().split()))
return a, b, c
def input_array(type=int):
return list(map(type, input().split()))
def input_string():
s = input(... | 17.4375 | 62 | 0.442055 |
da632cacc4c37358dbf002a98e518e262c750356 | 7,063 | py | Python | tests/test_workouts.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | tests/test_workouts.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | tests/test_workouts.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | from unittest import TestCase
import unittest
from rengine.config import TIME_BASED_CONDITIONS, ExerciseType, MuscleGroup
from rengine.exercises import pick_random_exercise
import dataframe_image as dfi
from rengine.workouts import AutoGeneratedWorkout, BaseWorkout, LowerBodyWorkout, UpperBodyWorkout, dictionary_additi... | 52.708955 | 205 | 0.68158 |
f91d436481f0db218238e0edb56fcabc24b648c4 | 557 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/ex4/ex4_tests.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/ex4/ex4_tests.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71e1/hashtables/ex4/ex4_tests.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import unittest
from ex4 import has_negatives
class TestEx4(unittest.TestCase):
def test_small(self):
result = has_negatives([1,2,3])
self.assertTrue(result == [])
result = has_negatives([-1,-2,1,2,3,4,-4])
result.sort()
self.assertTrue(result == [1, 2, 4])
... | 21.423077 | 50 | 0.551167 |
973efdb8e5f5b7935696dc9422b4736e573f0138 | 1,685 | py | Python | AnswerMachine/handle_list.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | AnswerMachine/handle_list.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | AnswerMachine/handle_list.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | # pylint: disable=C0114
import Persistence.log as log
from .tweet import Tweet
from .react import process_commands, process_tweet
log_ = log.getLogger(__name__)
def filter_list(tweet_list):
results = {}
for api_tweet in tweet_list:
if api_tweet is None:
continue
t = Tweet(api_tweet... | 37.444444 | 91 | 0.639169 |
97c4a23b55a08cd514ff11a811eb494434671643 | 212 | py | Python | svd.py | sivadax/NJLabs | 0273e363f6b3d1da8dbe51c1e78824b77b12eb8c | [
"MIT"
] | null | null | null | svd.py | sivadax/NJLabs | 0273e363f6b3d1da8dbe51c1e78824b77b12eb8c | [
"MIT"
] | null | null | null | svd.py | sivadax/NJLabs | 0273e363f6b3d1da8dbe51c1e78824b77b12eb8c | [
"MIT"
] | null | null | null | # Singular-value decomposition
from numpy import array
from scipy.linalg import svd
# define a matrix
A = array([[1, 2], [3, 4], [5, 6]])
print(A)
# SVD
U, s, VT = svd(A)
print(U)
print(s)
print(VT)
| 16.307692 | 36 | 0.617925 |
c108906fefdf20d340bfe9973a25402222977465 | 1,037 | py | Python | synthetic/scripts/verify.py | zhewang/rdm | b2c00c5db6ee4861c1b7214e3a63b630be30bb31 | [
"Apache-2.0"
] | null | null | null | synthetic/scripts/verify.py | zhewang/rdm | b2c00c5db6ee4861c1b7214e3a63b630be30bb31 | [
"Apache-2.0"
] | null | null | null | synthetic/scripts/verify.py | zhewang/rdm | b2c00c5db6ee4861c1b7214e3a63b630be30bb31 | [
"Apache-2.0"
] | null | null | null | import json
import requests
import numpy as np
import time
data = json.load(open('data.json'))
def naive():
count = 0
sum_a = sum_b = sum_c = 0.0
sum_aa = sum_bb = sum_cc = 0.0
sum_ab = sum_ac = sum_bc = 0.0
for r in data:
count += 1
sum_a += r[0]
sum_b += r[1]
s... | 21.163265 | 93 | 0.512054 |
de115370886d2ffcd49f90abd10dc5c0eba0d14b | 2,441 | py | Python | tests/misc/test_kernels.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | 1 | 2021-02-22T01:39:50.000Z | 2021-02-22T01:39:50.000Z | tests/misc/test_kernels.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | tests/misc/test_kernels.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
from indl.misc.kernels import sskernel
from indl.misc.kernels import Gauss
from indl.misc.kernels import Boxcar
from indl.misc.kernels import Alpha
from indl.misc.kernels import Exponential
class TestKernels:
srate = 1000
spk_rate = 13.0 ... | 40.016393 | 112 | 0.651372 |
ec4e2e0d82c860f822b178cce0ad8fb8d74aa03b | 2,814 | py | Python | python/oneflow/test/modules/test_image_flip.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/test/modules/test_image_flip.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_image_flip.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.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.740741 | 86 | 0.728145 |
d41809615443979ad76c6f862adcdd139596d93e | 1,473 | py | Python | src/python3_learn_video/lambda.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/lambda.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/lambda.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | # 匿名函数
def ds(x):
return 2 * x + 1
print('----------------------------------------------')
print(ds(3))
print('----------------------------------------------')
g = lambda x: 2 * x + 1
print(g(5))
print('----------------------------------------------')
def add(x, y):
return x + y
print(add(3, 4))
print(... | 21.347826 | 107 | 0.404616 |
d4853d8825571dc30d0858f0039a2dba84533180 | 25,968 | py | Python | tool_discovery/tool_discoverer/tool_discoverer/biotools_API_querying.py | FAIRplus/WP3_FAIR_tooling | 3c6470c4f5fc3d686b4571711bb7ed6f849a9622 | [
"Apache-2.0"
] | null | null | null | tool_discovery/tool_discoverer/tool_discoverer/biotools_API_querying.py | FAIRplus/WP3_FAIR_tooling | 3c6470c4f5fc3d686b4571711bb7ed6f849a9622 | [
"Apache-2.0"
] | 13 | 2021-06-01T10:07:02.000Z | 2022-03-24T12:16:26.000Z | tool_discovery/tool_discoverer/tool_discoverer/biotools_API_querying.py | FAIRplus/WP3_FAIR_tooling | 3c6470c4f5fc3d686b4571711bb7ed6f849a9622 | [
"Apache-2.0"
] | null | null | null | import json
import requests
import os
import pandas as pd
import biotools_parse as bp
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
cla... | 40.198142 | 318 | 0.582756 |
2e1b773d5bf181f0edf8e781582450e0e9b40f44 | 505 | py | Python | examples/prevent_update.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 1 | 2022-03-01T07:38:32.000Z | 2022-03-01T07:38:32.000Z | examples/prevent_update.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 12 | 2021-07-13T12:33:36.000Z | 2021-07-14T05:25:19.000Z | examples/prevent_update.py | xinetzone/dash-book | 1f624e87e2aa02c9931318918df969e44bdd2c07 | [
"Apache-2.0"
] | null | null | null | from dash import html
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate
from app import app
layout = html.Div([
html.Button('点击这里查看内容', id='show-secret'),
html.Div(id='body-div')
])
@app.callback(
Output(component_id='body-div', component_property='children'),
Inp... | 22.954545 | 68 | 0.714851 |
2e869f90ed4e0540bf1cdb4784f676d032587a42 | 862 | py | Python | FindMyIp-master/FindMyIp.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 10 | 2020-11-25T16:14:41.000Z | 2022-03-31T04:43:54.000Z | FindMyIp-master/FindMyIp.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | FindMyIp-master/FindMyIp.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")
## importing socket module
import socket
print("\033[1;34;40m FindMyIp tool made by AnonyminHack5\n")
print("\033[1;36;40m THIS TOOL IS SPECIALLY MADE FOR GETTING IP OF HOST USER IF YOU DONT KNOW YOUR IP\n\n\n\n")
print("""\033[1;35;40m
_____ __ ___ __ ___ _ ___
| ___ || || \ |... | 41.047619 | 111 | 0.61949 |
d8d43b40f867c13741f592012cbedd13ebc8943b | 715 | py | Python | DHParser/scripts/__init__.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | DHParser/scripts/__init__.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | DHParser/scripts/__init__.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | """__init__.py - package definition module for DHParser/scrips
Copyright 2019 by Eckhart Arnold (arnold@badw.de)
Bavarian Academy of Sciences an Humanities (badw.de)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | 37.631579 | 68 | 0.767832 |
9936369adbd59790b44eec8dd68b76db2b35a7c2 | 1,177 | py | Python | etl/transforms/primitives/df/time.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/transforms/primitives/df/time.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/transforms/primitives/df/time.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | from pytz import timezone
import numpy as np
#String to convert to an EST string safe for the database
def datetime_2_utc_str(df, tz_in_str='US/Eastern', column_list=None):
"""A slightly more general version of the TZ hack to write to DB"""
out_tsp_fmt_tmp = '%Y-%m-%dT%H:%M:%S{}:00'
# the from pytz imp... | 28.02381 | 96 | 0.641461 |
515e6c697ad388f63b6127a426b4655538c433e4 | 475 | py | Python | terminal.py | noahzhy/kendryte-standalone-sdk | d358d8aca7245669a65330180e08eaf92b8a2dd9 | [
"Apache-2.0"
] | null | null | null | terminal.py | noahzhy/kendryte-standalone-sdk | d358d8aca7245669a65330180e08eaf92b8a2dd9 | [
"Apache-2.0"
] | null | null | null | terminal.py | noahzhy/kendryte-standalone-sdk | d358d8aca7245669a65330180e08eaf92b8a2dd9 | [
"Apache-2.0"
] | null | null | null | import sys
import serial.tools.miniterm
def open_terminal(_port="COM11", reset=1):
control_signal = '0' if reset else '1'
control_signal_b = not reset
sys.argv = [sys.argv[0], _port, '115200', '--dtr='+control_signal, '--rts='+control_signal, '--filter=direct']
serial.tools.miniterm.main(default_port=... | 39.583333 | 135 | 0.724211 |
5a96f89cd145a7c851663c1314f18527a360db2b | 10,953 | py | Python | src/tango_sdp_subarray/tests/test_subarray_device.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/tango_sdp_subarray/tests/test_subarray_device.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/tango_sdp_subarray/tests/test_subarray_device.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | # coding: utf-8
"""SDP Subarray device tests."""
# pylint: disable=invalid-name
# pylint: disable=redefined-outer-name
# pylint: disable=protected-access
# pylint: disable=fixme
import json
from os.path import dirname, join
from unittest.mock import MagicMock
import tango
from tango import DevState
import pytest
fro... | 32.598214 | 79 | 0.665845 |
519969b38d143b6918d693ea9712f9cc17ba3522 | 1,269 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/make_guardian.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v7_0/make_guardian.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/make_guardian.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Student"):
student_table_cols = frappe.db.get_table_columns("Student")
if "father_name" in student_table_cols:
# 'Schools' module changed to the 'Education'
# frappe.reload_doc("schools", "doctype", "studen... | 33.394737 | 69 | 0.708432 |
51b3b4d38282fb12532dbd31cad662a1b505847d | 410,036 | py | Python | Liter_Client/PicBase64.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/PicBase64.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/PicBase64.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | from io import BytesIO
import base64
from PIL import Image, ImageQt
pic = {
'yln': b'/9j/4AAQSkZJRgABAQEASABIAAD/4R26RXhpZgAATU0AKgAAAAgADAEAAAMAAAABCvAAAAEBAAMAAAABB9YAAAECAAMAAAADAAAAngEGAAMAAAABAAIAAAESAAM \
AAAABAAEAAAEVAAMAAAABAAMAAAEaAAUAAAABAAAApAEbAAUAAAABAAAArAEoAAMAAAABAAIAAAExAAIAAAAdAAAAtA... | 139.183978 | 139 | 0.860632 |
51d40aa3bc37a7bf5470f1dca0740f499fec09c8 | 858 | py | Python | nz_django/day2/template_filter_demo/article/templatetags/my_filter.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day2/template_filter_demo/article/templatetags/my_filter.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day2/template_filter_demo/article/templatetags/my_filter.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from datetime import datetime
from django import template
register = template.Library()
@register.filter
def time_since(value): #过滤器最多有两个参数
#value 可以是我们文章的发表时间
#这个过滤器就好比是微博 发布于 刚刚 几分钟之前 几小时以前
# 将发表的时间 跟现在的时间进行对比
#判断value是否是个日期 不是 原样返回
if not isinstance(value,datetime):
return value
now... | 28.6 | 58 | 0.637529 |
51f4a52af483d3daa60945802e66e115de8f0437 | 16,857 | pyde | Python | School/G12/Asteroids/Asteroids.pyde | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | School/G12/Asteroids/Asteroids.pyde | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | School/G12/Asteroids/Asteroids.pyde | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | # Asteroids - An ICS4U Project
# Shoot asteroids and get the highest score!
# -----------------------------------------------
class Star():
def __init__(self, x, y, state):
"""initialize a new star"""
self.x = x
self.y = y
self.size = state
self.increase = True # increase st... | 34.123482 | 185 | 0.535445 |
32112e6c5ed37b7a2cf0c65e4fa3fef0ac3b554b | 2,781 | py | Python | python/get-post-server.py | kanti-glarus/server-script | 4d8a9ce1aaa00258af1f787bd7a5a79820104fa0 | [
"MIT"
] | null | null | null | python/get-post-server.py | kanti-glarus/server-script | 4d8a9ce1aaa00258af1f787bd7a5a79820104fa0 | [
"MIT"
] | null | null | null | python/get-post-server.py | kanti-glarus/server-script | 4d8a9ce1aaa00258af1f787bd7a5a79820104fa0 | [
"MIT"
] | null | null | null | # Python 3 server
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse
import cgi
hostName = "0.0.0.0"
serverPort = 8080
class EinfacherServer(BaseHTTPRequestHandler):
def get_path(self):
return urlparse(self.path).path
def get_parameters(self):
param... | 32.717647 | 90 | 0.581086 |
5c774329932ac2c77889fd1251e8f60564331d06 | 2,252 | py | Python | updatememes.py | Juhidin/blog | ffb7d67723d46dae1e1f086e6ad9fc36b177b838 | [
"CC-BY-3.0"
] | 2 | 2020-08-17T17:06:12.000Z | 2020-08-17T17:26:07.000Z | updatememes.py | sdasrc/editorial-website-extended | d8dd7e37e6a241510704ed0cbc0ed74990720b53 | [
"CC-BY-3.0"
] | null | null | null | updatememes.py | sdasrc/editorial-website-extended | d8dd7e37e6a241510704ed0cbc0ed74990720b53 | [
"CC-BY-3.0"
] | 1 | 2020-08-17T17:26:19.000Z | 2020-08-17T17:26:19.000Z | import os
import re
from os import listdir
from os.path import isfile, join
# jpg junk lq thumb webp
#/home/overlord/git/soumyadeepdas.gitlab.io/assets/images/memes/memelist.txt
basedir = 'assets/images/memes/'
memejpgs = 'assets/images/memes/jpg/'
jpgfiles = [f for f in listdir(memejpgs) if isfile(join(memejpgs,... | 42.490566 | 130 | 0.659414 |
64ea7b1ccf4b6c29ae5459aa03a21599ec541612 | 692 | py | Python | server/apps/recommendation/models.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/recommendation/models.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/recommendation/models.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
# Create your models here.
class Recommendation(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="用户")
doubanId = models.CharField("豆瓣id", max_length=20, null=False, blank=F... | 32.952381 | 86 | 0.718208 |
a475ec5a395ced2d5dd6f63c99aabba58c356f38 | 16,102 | py | Python | Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
import ipaddress
import requests
import urllib3
# Disable insecure warnings
urllib3.disable_warnings()
TOKEN_LIFE_TIME_MINUTES = 5
class Client:
def __init__(self, server_url: str, username: str, password: str, use_ssl: bool, user_conf: str):
self._base_url = server_url
... | 37.359629 | 122 | 0.6334 |
7417a8176c6f7925fa35ff78a2a9954f6ae47a97 | 5,066 | py | Python | monitoring/zabbix/zabbix_collections/zabbix-cli/tests/test_logging.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | monitoring/zabbix/zabbix_collections/zabbix-cli/tests/test_logging.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | monitoring/zabbix/zabbix_collections/zabbix-cli/tests/test_logging.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | import logging
import unittest
import zabbix_cli.logs
logger = logging.getLogger(__name__)
class CollectHandler(logging.Handler):
def __init__(self):
super(CollectHandler, self).__init__(logging.NOTSET)
self.records = []
def emit(self, record):
print('emit', repr(record))
... | 35.180556 | 78 | 0.637781 |
24843ee39271b4e528daa5a90cbdf4dc156e5633 | 12,480 | py | Python | StoryTellingGame/story_builder.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | StoryTellingGame/story_builder.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | 2 | 2017-10-26T16:52:58.000Z | 2017-11-01T16:58:52.000Z | StoryTellingGame/story_builder.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import io
import os
from datetime import datetime
from itertools import permutations
from sys import stderr
from typing import Dict, Union, Iterable, Iterator, List, Tuple, IO, Set
from storytelling_db import StoryTellingDatabase, User, Story, Edit, StoryTellingExcepti... | 38.4 | 101 | 0.564103 |
24b8c6681152fdaf564c8eb87f6d9f2d71d86d6b | 1,009 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-39-exer-3-districts-info.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-39-exer-3-districts-info.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.04-dictionary/ph-39-exer-3-districts-info.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | bd_district_info = {}
bd_district_info["Barguna"] = {"division": "Barisal", "established": 1984, "population": 892, "area": 1939}
bd_district_info["Barisal"] = {"division": "Barisal", "established": 1797, "population": 2415, "area": 2785}
bd_district_info["Bhola"] = {"division": "Barisal", "established": 1984, "populat... | 84.083333 | 252 | 0.696729 |
703fd20ef94c49f1ff10e2a222bb3e5944b046aa | 5,635 | py | Python | ProyectoTEO V3/parser_class.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | ProyectoTEO V3/parser_class.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | ProyectoTEO V3/parser_class.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | import ply.yacc as yacc
import os
import codecs
import re
from sys import stdin
from lexer_class import tokens
# Cuerpo principal
def p_program(p):
"program : include_directives declaration_l"
def p_empty(p):
'empty :'
pass
# Directivas de inclusión y declaración
def p_include_directi... | 25.730594 | 123 | 0.567879 |
8e7cd97ee3f4dd35ebfe2f6133498ba26a473834 | 3,079 | py | Python | etl/shared/logger_factory.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 7 | 2020-04-23T20:16:11.000Z | 2022-01-04T14:57:16.000Z | etl/shared/logger_factory.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 361 | 2020-04-23T17:20:14.000Z | 2022-03-02T11:29:45.000Z | etl/shared/logger_factory.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 1 | 2021-11-29T06:02:52.000Z | 2021-11-29T06:02:52.000Z | import logging
import os
ROOT_DIR = os.environ['ROOT_DIR']
class LoggerFactory:
""" This class handles the different loggers according to a singleton factory pattern """
logger_dict = dict()
# Set levels for display / writing to logfile. Levels are in ascending order:
# NOTSET
# DEBUG
# INFO
... | 39.987013 | 118 | 0.675869 |
d95dbd3c4ea6412a48168a456623b382d19eaa8f | 13,920 | py | Python | frds/io/wrds/connection.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/io/wrds/connection.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/io/wrds/connection.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | import pandas as pd
import sqlalchemy as sa
WRDS_POSTGRES_HOST = "wrds-pgdata.wharton.upenn.edu"
WRDS_POSTGRES_PORT = 9737
WRDS_POSTGRES_DB = "wrds"
WRDS_CONNECT_ARGS = {"sslmode": "require", "application_name": "frds"}
class CredentialsError(PermissionError):
pass
class NotSubscribedError(PermissionError):
... | 38.136986 | 138 | 0.54217 |
79a67b9b8f00239bfef9ac890dc43cd796760657 | 5,686 | py | Python | app/appwrite-functions/CreateDBCollection/.appwrite/appwrite/client.py | MME-Aufgaben-im-Winter-2021/projects-pagemuse-mme-2021-22 | 9f5fa9bc2dcf27520dbebde834f652188362338b | [
"MIT"
] | null | null | null | app/appwrite-functions/CreateDBCollection/.appwrite/appwrite/client.py | MME-Aufgaben-im-Winter-2021/projects-pagemuse-mme-2021-22 | 9f5fa9bc2dcf27520dbebde834f652188362338b | [
"MIT"
] | 27 | 2022-02-24T11:53:35.000Z | 2022-03-13T08:42:02.000Z | app/appwrite-functions/UpdateDBCollection/.appwrite/appwrite/client.py | MME-Aufgaben-im-Winter-2021/projects-pagemuse-mme-2021-22 | 9f5fa9bc2dcf27520dbebde834f652188362338b | [
"MIT"
] | null | null | null | import io
import requests
import os
from .input_file import InputFile
from .exception import AppwriteException
class Client:
def __init__(self):
self._chunk_size = 5*1024*1024
self._self_signed = False
self._endpoint = 'https://HOSTNAME/v1'
self._global_headers = {
'cont... | 30.569892 | 139 | 0.517939 |
79dc23a34960986a5c89e311660aedd148c63b43 | 6,233 | py | Python | experiments/tpm/parse_tpm2_event_log.py | BBBSnowball/nixcfg | 763c25033bd8e14bd315d0259cb2f9928dbfa37f | [
"MIT"
] | 2 | 2021-04-03T01:53:00.000Z | 2022-01-05T14:56:59.000Z | experiments/tpm/parse_tpm2_event_log.py | BBBSnowball/nixcfg | 763c25033bd8e14bd315d0259cb2f9928dbfa37f | [
"MIT"
] | null | null | null | experiments/tpm/parse_tpm2_event_log.py | BBBSnowball/nixcfg | 763c25033bd8e14bd315d0259cb2f9928dbfa37f | [
"MIT"
] | null | null | null | # https://github.com/google/go-attestation/blob/master/attest/eventlog.go#L588
# https://lists.ofono.org/hyperkitty/list/tpm2@lists.01.org/thread/PVR5UPADM6VYITAADIZUHWCMBD3MIEPL/
# https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf
# https://trustedcomputinggroup.org/... | 31.00995 | 109 | 0.569228 |
5c2fbaf81b765a2e1eb35969ca1ce46b9cf3de21 | 7,053 | py | Python | python/TestClient.py | EduardBartolovic/Yolov3-PythonObjectDetection | 23012ca6605aed58e05c393d6267b88bcb450d90 | [
"Apache-2.0"
] | 1 | 2019-07-03T12:13:05.000Z | 2019-07-03T12:13:05.000Z | python/TestClient.py | EduardBartolovic/Yolov3-PythonObjectDetection | 23012ca6605aed58e05c393d6267b88bcb450d90 | [
"Apache-2.0"
] | null | null | null | python/TestClient.py | EduardBartolovic/Yolov3-PythonObjectDetection | 23012ca6605aed58e05c393d6267b88bcb450d90 | [
"Apache-2.0"
] | null | null | null | """
@author Eduard Bartolovic Eduard.Bartolovic@posteo.de
test client to test object_detection-yolo.py
this program is sending a file and receives a list.
This Test will be used in CI
"""
import socket
import subprocess
import time
import sys
import shutil
HOST = '127.0.0.1' # The server's IP address
PORT01 = 42... | 41.733728 | 127 | 0.480788 |
cce7677decce7c748f70b1c89487e63cd443e165 | 1,608 | py | Python | checks/charset_test.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | checks/charset_test.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | checks/charset_test.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | import httpretty
from httpretty import httprettified
import unittest
from checks import charset
from checks import page_content
from checks.config import Config
@httprettified
class TestCharsetChecker(unittest.TestCase):
def test_http_response(self):
url = 'http://www.example.com/'
httpretty.regi... | 32.16 | 103 | 0.602612 |
ba5b32c908c18ede744083177186ad8dffa6d29f | 315 | py | Python | src/classifiers/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/classifiers/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/classifiers/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | # Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
from kff_classifier import KFFClassifier
from tf_classifier import TFClassifier
from df_classifier import DFClassifier
from itfidf_classifier import ITFIDFClassifier
from syllables_classifier import SyllablesClassifier | 28.636364 | 52 | 0.860317 |
03390ca9a2e78fb0ebfa16c8f8e78f70e6dc3e50 | 2,576 | py | Python | contracts/tests/utils.py | PerunEthereum/Perun | 0704f481e8747f6f4405e67abe1cafd5d96d2ab8 | [
"MIT"
] | 64 | 2018-04-10T19:28:59.000Z | 2020-11-10T02:56:57.000Z | contracts/tests/utils.py | PerunEthereum/Perun | 0704f481e8747f6f4405e67abe1cafd5d96d2ab8 | [
"MIT"
] | 2 | 2018-05-18T15:39:10.000Z | 2018-12-17T19:00:50.000Z | contracts/tests/utils.py | PerunEthereum/Perun | 0704f481e8747f6f4405e67abe1cafd5d96d2ab8 | [
"MIT"
] | 9 | 2018-04-10T21:17:41.000Z | 2019-12-10T11:42:34.000Z | from datetime import timedelta, datetime
from collections import defaultdict
import pytest
lcId = 0
nid = 0
sid = 42
vid = 7
version = 15
alice = 1
bob = 2
ingrid = 3
eve = 0
party_name = {alice: 'alice', bob: 'bob', ingrid: 'ingrid', eve: 'eve'}
zero = defaultdict(int)
cash = {alice: 23 * 10**9, bob: 11 * 10**9}
cas... | 33.454545 | 134 | 0.653339 |
233309014d18396e9852e8481378124bf9a8864d | 4,798 | py | Python | src/main/python/tools/dataset_build.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/tools/dataset_build.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/tools/dataset_build.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | from PIL import Image
import os
from numpy import genfromtxt
import gzip, pickle
from glob import glob
import numpy as np
import pandas as pd
from tools import logger
import theano
from context import resource_manager
from tools import file_manage
log = logger.getLogger()
class pcolors:
HEADER =... | 31.359477 | 150 | 0.557107 |
00075680b5551dcf1d5a3913c85798e70a8bd43a | 1,723 | py | Python | backend/api/btb/api/schema/types/util.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 4 | 2020-04-30T16:11:24.000Z | 2020-06-02T10:08:07.000Z | backend/api/btb/api/schema/types/util.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 291 | 2020-04-20T13:11:13.000Z | 2022-02-10T21:54:46.000Z | backend/api/btb/api/schema/types/util.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 2 | 2020-04-19T14:56:01.000Z | 2020-04-19T18:09:34.000Z | import six
from graphene import Scalar
from graphql.language.ast import StringValue
__limited_stringtype_cache = {}
def LimitedString(maxLength, **kwargs):
if maxLength < 1:
raise ValueError(f"maxLength should be equal or greater 1")
typename = f"LimitedString{maxLength}"
docstring = \
f'... | 38.288889 | 132 | 0.658735 |
aeeda5cd51a5b99a95b8d43a1bfaa27d099308a5 | 947 | py | Python | crawler/utils/BeautifulSoupParseHelper.py | macroxu/FundAnalysis | bc94f271fae5df6971aae37b873b97973d25b1c8 | [
"Apache-2.0"
] | null | null | null | crawler/utils/BeautifulSoupParseHelper.py | macroxu/FundAnalysis | bc94f271fae5df6971aae37b873b97973d25b1c8 | [
"Apache-2.0"
] | null | null | null | crawler/utils/BeautifulSoupParseHelper.py | macroxu/FundAnalysis | bc94f271fae5df6971aae37b873b97973d25b1c8 | [
"Apache-2.0"
] | null | null | null | # Beautiful Soup Parse Helper
class BeautifulSoupParseHelper:
def __init__(self):
return
@staticmethod
def parseSingleStr(soup,selector,dic,attrName):
tag=soup.select_one(selector)
tagValue=''
#check is existence, if true ,set value,if not ,set default value
if tag i... | 27.852941 | 73 | 0.581837 |
d18bdd7b2d4738e7f40100248055cc37b250f4fb | 572 | py | Python | leetcode/120-Triangle/Triangle_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/120-Triangle/Triangle_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/120-Triangle/Triangle_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param triangle, a list of lists of integers
# @return an integer
# Follow Up: Find the path
def minimumTotal(self, triangle):
m = len(triangle)
for i in range(1, m):
for j in range(i + 1):
if j == 0:
triangle[i][0] += tr... | 31.777778 | 85 | 0.452797 |
ae80e1dcb6f83e6bebd7b24cbb6572c83a93145c | 705 | py | Python | partner_ngos/fund_management/doctype/indicators/indicators.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/fund_management/doctype/indicators/indicators.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/fund_management/doctype/indicators/indicators.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Akram Mutaher and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, throw
from frappe.model.document import Document
from frappe.utils import (cstr)
class Indicators(Document):
def v... | 32.045455 | 83 | 0.761702 |
8857bcf55f237e136848bdfcb63b2aa47255cfd5 | 256 | py | Python | python/coursera_python/MICHIGAN/DataStructures/week3/romeo.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/DataStructures/week3/romeo.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/DataStructures/week3/romeo.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z |
fname = input("Enter file name: ")
fh = open(fname)
lst = list()
for line in fh:
line1 = line.rstrip()
words = line1.split()
for word in words:
if word in lst:
continue
lst.append(word)
#print(word)
#print(line1,' ==')
lst.sort()
print(lst)
| 15.058824 | 34 | 0.632813 |
c9f3b7031b58c4f53804b4fb7cead83ca5c888b5 | 11,847 | py | Python | taobao_yhh_recommend.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | taobao_yhh_recommend.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | taobao_yhh_recommend.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | """
爬取淘宝有好货推荐商品及所属类型
"""
import time
import datetime
import json
import requests
import random
import CralwerSet.connect_mysql as connect_mysql
import re
from urllib import parse
import easygui as g
import hashlib
from requests.packages import urllib3
import traceback
import pickle
import pymysql
urllib3.disable_warni... | 43.555147 | 532 | 0.528066 |
a02221acb362b7c95cf727a6ca606e6ce16cb862 | 2,755 | py | Python | roboraptorz/sim/simulator/MqttHandler.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | roboraptorz/sim/simulator/MqttHandler.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | null | null | null | roboraptorz/sim/simulator/MqttHandler.py | icebear8/roboRinth | c0789a9faf978f31b0ed020d26fee2b04fb298ee | [
"MIT"
] | 1 | 2019-10-22T07:47:51.000Z | 2019-10-22T07:47:51.000Z |
import logging
import Map
import json
import MqttClient
logger = logging.getLogger(__name__)
class Msg:
pass
_defaultHost="localhost"
_defaultPort=1883
class RobotForwarder(object):
def __init__(self, notifyFunc, topicPrefix, robot):
self._notify = notifyFunc
self.topicPrefix = topicPref... | 32.411765 | 103 | 0.658076 |
4e7d78e359480f29240a054a5b3c5577104224ac | 6,875 | py | Python | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/pipeline_graphic_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/pipeline_graphic_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/admin/pipeline_graphic_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List, Optional
from fastapi import APIRouter, Depends
from pydantic import BaseModel
from starlette.responses import Response
from watchmen_auth import PrincipalService
from watchmen_data_kernel.common import ask_all_date_formats
from watchmen_meta.admin import Pipelin... | 39.285714 | 104 | 0.818618 |
eea9d650b2fb50846e313c24e26d466acee3b062 | 2,771 | py | Python | Organisation/Recherche/pico2wave/Vergleich_gtts_pico2wave/Testaudios_Vergleich.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | Organisation/Recherche/pico2wave/Vergleich_gtts_pico2wave/Testaudios_Vergleich.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | Organisation/Recherche/pico2wave/Vergleich_gtts_pico2wave/Testaudios_Vergleich.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | from gtts import gTTS
text_eins = (f"Am Freitag ist es im Süden und Osten erst noch recht freundlich, von Westen her verdichten sich aber die Wolken und vom Nordwesten bis in die Mitte gibt es zum Teil kräftigen Regen, vereinzelt auch Gewitter. Höchstwerte 18 bis 30 Grad."
f"Am Samstagvormittag ziehen die dichten Wol... | 138.55 | 659 | 0.805125 |
0189dac9931165c573a4071b7814e05d8a7124de | 962 | py | Python | scripts/generate_test_src_folders.py | suisen-cp/cp-library-cpp | 8fbbdcdbceb60f5adc56ff4740549ce3c1a1ea43 | [
"CC0-1.0"
] | 2 | 2021-10-04T15:46:56.000Z | 2022-01-14T19:28:43.000Z | scripts/generate_test_src_folders.py | suisen-cp/cp-library-cpp | 8fbbdcdbceb60f5adc56ff4740549ce3c1a1ea43 | [
"CC0-1.0"
] | null | null | null | scripts/generate_test_src_folders.py | suisen-cp/cp-library-cpp | 8fbbdcdbceb60f5adc56ff4740549ce3c1a1ea43 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
import os
import subprocess
import argparse
from pathlib import Path
def generate(path):
dir_path = (test_gen + path).replace(".hpp", "")
if not os.path.exists(dir_path):
print("generate:", dir_path)
os.makedirs(dir_path)
gitignore = Path(dir_path) / Path(".gitignore... | 31.032258 | 98 | 0.64553 |
6d6ff3b0fda1483ab5d6a7d9261942a40a7c8cef | 354 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/34. calculate the number of upper case letters in a string.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/34. calculate the number of upper case letters in a string.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/34. calculate the number of upper case letters in a string.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that accepts a string and calculates the number of upper case letters.
sample_string = '100 Python Challenges'
expected output = 2
"""
def count_case(sample_string):
count = 0
for i in sample_string:
if i in "QWERTYUIOPASDFGHJKLZXCVBNM":
count += 1
else:... | 23.6 | 94 | 0.655367 |
284d8a81f18d568e9a16a7725488b1081cc25acd | 2,683 | py | Python | pymantic/tests/test_turtle.py | dnswd/blazegraph-python | 046a6b47406b0f56d71abc6039f4d7586a1708d2 | [
"BSD-3-Clause"
] | 42 | 2016-01-15T14:31:48.000Z | 2022-03-10T14:32:25.000Z | pymantic/tests/test_turtle.py | igor-kim/blazegraph-python | 7be8d219e00acb51d949bf49aaaed90c2c2344e5 | [
"BSD-3-Clause"
] | 3 | 2016-10-02T18:36:42.000Z | 2019-09-18T15:48:58.000Z | pymantic/tests/test_turtle.py | igor-kim/blazegraph-python | 7be8d219e00acb51d949bf49aaaed90c2c2344e5 | [
"BSD-3-Clause"
] | 11 | 2016-08-18T09:47:52.000Z | 2021-12-26T06:22:18.000Z | import os.path
import unittest
from pymantic.parsers import turtle_parser, ntriples_parser
import pymantic.rdf as rdf
turtle_tests_url = 'http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/tests/'
prefixes = {
'mf': 'http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#',
'qt': 'http://www.w3.org/2001/... | 33.962025 | 81 | 0.640328 |
953f8792250af2afa182b97163f0545f45919680 | 1,189 | py | Python | 03_SDN/ext/aufgabe0.py | kit-tm/Labs | 8e5af3a76be6e17bdb62fd3175ecc545ed6e9147 | [
"BSD-2-Clause"
] | null | null | null | 03_SDN/ext/aufgabe0.py | kit-tm/Labs | 8e5af3a76be6e17bdb62fd3175ecc545ed6e9147 | [
"BSD-2-Clause"
] | null | null | null | 03_SDN/ext/aufgabe0.py | kit-tm/Labs | 8e5af3a76be6e17bdb62fd3175ecc545ed6e9147 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.util import dpidToStr
from pox.lib.packet.ethernet import ethernet, ETHER_BROADCAST
from pox.lib.addresses import EthAddr
from pox.lib.packet.ipv4 import ipv4
from pox.lib.packet.arp import arp... | 29.725 | 73 | 0.707317 |
66e0ba1da005998bdd864a99a6a9e5fc2e966011 | 4,426 | py | Python | src/bo4e/bo/angebot.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/bo/angebot.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/bo/angebot.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Angebot class and corresponding marshmallow schema for de-/serialization
"""
from datetime import datetime
from typing import List, Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.bo.ansprechpartner import Ansprechpartner, Anspr... | 43.821782 | 168 | 0.765477 |
b0bf14bcc3625231541dd61b96c4a615cd5a4729 | 4,729 | py | Python | research/cv/ivpf/ivpf/prior.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ivpf/ivpf/prior.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ivpf/ivpf/prior.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... | 32.170068 | 116 | 0.58469 |
9fdd081c59ee685ef7dee8fc8e1159b3dcfabe4b | 40,538 | py | Python | large_vocab_adt_dafx2018/encodings.py | mcartwright/dafx2018_adt | 057ac6b1e39cd0c80554d52535cc9d88b6316c74 | [
"BSD-2-Clause"
] | 6 | 2019-02-28T05:43:58.000Z | 2021-03-02T17:05:13.000Z | large_vocab_adt_dafx2018/encodings.py | mcartwright/dafx2018_adt | 057ac6b1e39cd0c80554d52535cc9d88b6316c74 | [
"BSD-2-Clause"
] | null | null | null | large_vocab_adt_dafx2018/encodings.py | mcartwright/dafx2018_adt | 057ac6b1e39cd0c80554d52535cc9d88b6316c74 | [
"BSD-2-Clause"
] | 1 | 2020-02-07T17:10:40.000Z | 2020-02-07T17:10:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
# def input_encoding23(data_dict):
# input_dict = data_dict['input']
# ms_input_array = np.moveaxis(input_dict['logf_stft'], 1, 0)
# ms_input_array = np.expand_dims(ms_input_array, axis=2)
#
# os_input_array = np.moveaxis(input_dict['od... | 37.921422 | 132 | 0.636465 |
05badf0a17662a2121ff4073e0694cefd347e050 | 2,111 | py | Python | city-npc/ptolus_v2.py | graylion-wa/world-anvil-generators | f9718517b95997b6dfbc9ab6370d03ab87e40601 | [
"MIT"
] | 1 | 2021-06-08T17:34:24.000Z | 2021-06-08T17:34:24.000Z | city-npc/ptolus_v2.py | graylion-wa/world-anvil-generators | f9718517b95997b6dfbc9ab6370d03ab87e40601 | [
"MIT"
] | 2 | 2021-06-23T07:58:38.000Z | 2021-06-28T18:00:18.000Z | city-npc/ptolus_v2.py | graylion-wa/world-anvil-generators | f9718517b95997b6dfbc9ab6370d03ab87e40601 | [
"MIT"
] | 1 | 2021-06-19T10:03:06.000Z | 2021-06-19T10:03:06.000Z | import json
import os
import re
from typing import Any, List
import csv
origin_keys = list()
def create_payload_dict(variable: str):
router = dict()
router[variable] = dict()
return router, router[variable]
def read_table_generators(items):
payload = dict()
for item in items:
local_key... | 27.776316 | 127 | 0.555661 |
a58ec0b8fad13cbaa51176aa9b286f767753ccbf | 764 | py | Python | Webpage/arbeitsstunden/migrations/0022_auto_20211023_1531.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/arbeitsstunden/migrations/0022_auto_20211023_1531.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/arbeitsstunden/migrations/0022_auto_20211023_1531.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-23 15:31
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('arbeitsstunden', '0021_alter_project_tags'),
]
operations = [
migrations.AlterField(
model_name='project',
... | 25.466667 | 78 | 0.581152 |
59a9593087cfcc05dd9cffa0a672916973194d27 | 6,843 | py | Python | train/loss.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | 8 | 2021-03-07T10:25:21.000Z | 2022-02-20T23:57:24.000Z | train/loss.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null | train/loss.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null | import tensorflow as tf
class SOLOLoss(tf.keras.losses.Loss):
"""Loss for SOLO network
Usage: This class can be use for built-in training method (keras) or custom
training procedure
- For built-in method, get the loss functions by invoke `get_category_loss`
and `get_mask_loss` method and... | 44.148387 | 140 | 0.627795 |
e63654fc7e9bbfd94b91fdf146c0a18b1c443d6a | 1,442 | py | Python | python/en/archive/dropbox/setting_fonts/multithreading_in_python-2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/setting_fonts/multithreading_in_python-2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/setting_fonts/multithreading_in_python-2.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
multithreading_in_python-2.py
Consider the python program given below
in which we print thread name and corresponding process for each task:
Multithreading in Python | Set 1
https://www.geeksforgeeks.org/multithreading-python-set-1/
"""
# Python program to illust... | 27.207547 | 83 | 0.675451 |
552f0003644857873f53ac1399490737ee757876 | 3,087 | py | Python | src/compgen2/testdata/testdata.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | 1 | 2022-02-02T12:41:06.000Z | 2022-02-02T12:41:06.000Z | src/compgen2/testdata/testdata.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | src/compgen2/testdata/testdata.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | import logging
from pathlib import Path
import pandas as pd
from ..gov import Gov, Matcher
from ..const import FILENAME_GOV_TEST_SET
GOV_URL = "http://wiki-de.genealogy.net/Verlustlisten_Erster_Weltkrieg/Projekt/Ortsnamen"
logger = logging.getLogger(__name__)
class GovTestData:
def __init__(self, gov: Gov, url:... | 38.111111 | 130 | 0.620343 |
758641ef87f648228ce8add67bbbcd0e9daf5064 | 1,253 | py | Python | tests/integration/test_credentials.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | tests/integration/test_credentials.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | tests/integration/test_credentials.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | from skil.resources.credentials import *
import pytest
import skil
import uuid
import time
_sk = None
def _get_sk():
global _sk
if _sk is None:
_sk = skil.Skil()
return _sk
def test_creation_deletion():
sk = _get_sk()
cred = Credentials(sk, "AWS", "uri", "name")
cred_id = cred.id
... | 20.883333 | 61 | 0.575419 |
f98062dc8055432e3658884c028878cb5efa5086 | 49,777 | py | Python | ripper-master/ripper.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | ripper-master/ripper.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | ripper-master/ripper.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # Marshal Berlapis loh gan
# memangnya mau ngapain su?
import marshal
exec(marshal.loads('c\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00@\x00\x00\x00s!\x00\x00\x00d\x00\x00d\x01\x00l\x00\x00Z\x00\x00e\x00\x00j\x01\x00d\x02\x00\x83\x01\x00d\x01\x00\x04Ud\x01\x00S(\x03\x00\x00\x00i\xff\xff\xff\xffNs*Q\x00\x00c\x00\x00... | 9,955.4 | 49,706 | 0.743154 |
f99ece90f13ca4da5897182e14d4227797ee1627 | 875 | py | Python | PMIa/2014/KUCHERYAVENKO_A_I/task_4_38.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/KUCHERYAVENKO_A_I/task_4_38.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/KUCHERYAVENKO_A_I/task_4_38.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 4. Вариант 38.
# Напишите программу, которая выводит имя, под которым скрывается Симона Руссель.
# Дополнительно необходимо вывести область интересов указанной личности,
# место рождения, годы рождения и смерти (если человек умер),
# вычислить возраст на данный момент (или момент смерти).
# Для хранения всех н... | 36.458333 | 168 | 0.779429 |
9b6164b03dda4cc11568618d66559e25f435114b | 10,250 | py | Python | tuta/model/embeddings.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 36 | 2021-06-15T01:04:27.000Z | 2022-03-19T16:36:54.000Z | tuta/model/embeddings.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 6 | 2021-09-03T11:29:36.000Z | 2021-12-15T11:33:57.000Z | tuta/model/embeddings.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 8 | 2021-11-03T04:32:36.000Z | 2022-02-02T13:43:47.000Z | # -*- coding: utf-8 -*-
"""
Embedding layers with token / number / order / position / format embeddings
for TUTA-base, TUTA-explicit, and TUTA (TUTA-implicit)
"""
import torch
import torch.nn as nn
class EmbeddingForBase(nn.Module):
def __init__(self, config):
super(EmbeddingForBase, self).... | 50.995025 | 125 | 0.681951 |
9528cfd38f4952bd1fc546158a066bd9d078df57 | 1,546 | py | Python | 7-assets/past-student-repos/data_struct_and_algo-master/Sort_an_array_of_0s,_1s_and_2s.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/Sort_an_array_of_0s,_1s_and_2s.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/Sort_an_array_of_0s,_1s_and_2s.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # # Given an array of size N containing only 0s, 1s, and 2s; sort the array in ascending order.
# # Input:
# # N = 5
# # arr[]= {0 2 1 2 0}
# # Output:
# # 0 0 1 2 2
# # Explanation:
# # 0s 1s and 2s are segregated
# # into ascending order.
# def sort012(arr):
# sample={}
# result=[]
# for index in arr:... | 20.613333 | 95 | 0.477361 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.