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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00279c02c31177f13bb2f329d081ea32418d06d7 | 407 | py | Python | site/public/courses/DS-2.2/Assignments/churn_preprocessing_keras_flask/boto_s3.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/boto_s3.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/DS-2.2/Assignments/churn_preprocessing_keras_flask/boto_s3.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | import pandas as pd
import boto3
bucket = "makeschooldata"
file_name = "data/Churn_Modelling.csv"
s3 = boto3.client('s3')
# 's3' is a key word. create connection to S3 using default config and all buckets within S3
obj = s3.get_object(Bucket=bucket, Key=file_name)
# get object and file (key) from bucket
... | 29.071429 | 93 | 0.717445 |
cc3e2d852c4b457816b7c6d6df1982aa8c05622d | 958 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v6_6/fix_website_image.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/v6_6/fix_website_image.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_6/fix_website_image.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import print_function, unicode_literals
import frappe
from frappe.utils import encode
def execute():
"""Fix the File records created via item.py even if the website_image file didn't exist"""
for item in frappe.db.sql_list("""select name from `tabItem`
where website_image is not null and website_im... | 29.030303 | 91 | 0.707724 |
ae0b31c21f690da2a91532dd4b6a7505e1b743da | 790 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_primary_contact_for_customer.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/v10_0/set_primary_contact_for_customer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_primary_contact_for_customer.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype('Customer')
frappe.db.sql("""
update
`tabCustomer`, (
select `tabContact`.name, `tabContact`.mobil... | 37.619048 | 90 | 0.726582 |
ae478d59b5a44ecd59c66c38f9392e64016eb6e5 | 1,252 | py | Python | module/classification_package/src/model.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | module/classification_package/src/model.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | module/classification_package/src/model.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import torch
import torch.nn as nn
class Backbone(nn.Module):
def __init__(self, resnet: nn.Module):
super().__init__()
self.resnet = resnet
def forward(self, x: torch.Tensor):
return self.resnet(x)
class EmbeddingModel(nn.Module):
def __init__(self, backbone: nn.Module,last_lay... | 25.55102 | 74 | 0.616613 |
c9f303ef4cd46fc5f60b87703410d604e8752dee | 4,436 | py | Python | ingenium/name_maker.py | LaundryBox/ingenium | e90fc01f4a875d8a7dc791ff92b41d8145c2ddea | [
"MIT"
] | null | null | null | ingenium/name_maker.py | LaundryBox/ingenium | e90fc01f4a875d8a7dc791ff92b41d8145c2ddea | [
"MIT"
] | null | null | null | ingenium/name_maker.py | LaundryBox/ingenium | e90fc01f4a875d8a7dc791ff92b41d8145c2ddea | [
"MIT"
] | null | null | null | import os
import argparse
import collections
import random
import zipfile
MIN_SURNAME_COUNT = 100
MIN_FIRST_NAME_COUNT = 5
FirstNameStats = collections.namedtuple('FirstNameStats', ['name', 'gender', 'count'])
"""SurnameStats value definitions
rank = Rank;
count = Number of occurrences;
prop100k = Propor... | 38.912281 | 119 | 0.688007 |
0909c1d78e6a774a76e04dc2b5bc76b403884810 | 157 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/81_como_criar_modulos/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/81_como_criar_modulos/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/81_como_criar_modulos/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null |
from criando_modulos import pi, multiplica
from outro import fala_oi
lista = [10, 11, 12, 13, 14, 15]
print(multiplica(lista))
print(fala_oi())
print(pi)
| 15.7 | 42 | 0.732484 |
eedab0dc72cf97c81f92a50ea4d8d49c7c11349c | 1,694 | py | Python | RDS/circle3_central_services/research_manager/src/api/User/Research/Imports/port.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/api/User/Research/Imports/port.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/api/User/Research/Imports/port.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import Singleton
from flask import jsonify, request
import logging
logger = logging.getLogger()
def index(user_id, research_id):
return jsonify(
Singleton.ProjectService.getProject(user_id, int(research_id)).getPortIn()
)
def post(user_id, research_id):
json = request.json
logger.debug(f"g... | 28.233333 | 86 | 0.663518 |
014c25812674ea6666ab675978420b70ac409705 | 381 | py | Python | src/Raspberry Pi/Sensors/tempSensor.py | Air92/AtmosphericPollutionCollecting | 9c152b2d961535fa1e1b87f1d7c47f25573f7ca7 | [
"MIT"
] | 1 | 2018-06-07T21:54:56.000Z | 2018-06-07T21:54:56.000Z | src/Raspberry Pi/Sensors/tempSensor.py | Air92/AtmosphericPollutionCollecting | 9c152b2d961535fa1e1b87f1d7c47f25573f7ca7 | [
"MIT"
] | 1 | 2018-01-26T16:13:15.000Z | 2018-01-26T18:39:26.000Z | src/Raspberry Pi/Sensors/tempSensor.py | Air92/AtmosphericPollutionCollecting | 9c152b2d961535fa1e1b87f1d7c47f25573f7ca7 | [
"MIT"
] | 5 | 2017-11-20T09:39:07.000Z | 2019-10-28T13:10:50.000Z | from grovepi import *
from grove_rgb_lcd import *
from time import sleep
from math import isnan
dht_sensor_port = 7 # connect the DHt sensor to port 7
dht_sensor_type = 0
def getTemperature():
[temp,hum] = dht(dht_sensor_port,dht_sensor_type)
return temp
def getHumidity():
[temp,hum] = dht(dht_sensor_port,dht_se... | 17.318182 | 54 | 0.76378 |
6d6bb78672fcee0e2a66a720b1ef157526fa71f0 | 15,339 | py | Python | transonic/analyses/util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/analyses/util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/analyses/util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """Utilities for the analyses
=============================
"""
import re
from pathlib import Path
from textwrap import dedent
import gast as ast
from transonic.analyses import beniget
from transonic.analyses import extast
try:
import astunparse
dump = astunparse.dump
except ImportError:
def dump(nod... | 32.845824 | 105 | 0.568877 |
6d8b79b38c1fbb733ef194ce9de3f34315868ded | 515 | pyde | Python | sketches/pixieland/pixieland.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/pixieland/pixieland.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/pixieland/pixieland.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | font = None
headline = "OVER IN THE PIXIELAND"
para = "the quick brown fox jumps over the lazy dog"
def setup():
global h1, pl
size(600, 400)
frame.setTitle("Pixieland")
h1 = createFont("pixie-fat.otf", 32)
# pu = createFont("pixie-semibold.otf", 16)
pl = createFont("pixie-serif.otf", 32)
b... | 22.391304 | 52 | 0.61165 |
3a5b2316406fb2d96380e650cefc0237669afc11 | 8,402 | py | Python | lale/lib/sklearn/linear_svr.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 265 | 2019-08-06T14:45:43.000Z | 2022-03-30T23:57:48.000Z | lale/lib/sklearn/linear_svr.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 467 | 2019-08-08T02:01:21.000Z | 2022-03-25T16:12:00.000Z | lale/lib/sklearn/linear_svr.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 81 | 2019-08-07T19:59:31.000Z | 2022-03-31T09:11:58.000Z | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 40.786408 | 159 | 0.516901 |
6ea2db4eb8cc1c6e76da1bf01db692bd29109f56 | 608 | py | Python | rasa/shared/onstants.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | rasa/shared/onstants.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 9 | 2020-09-15T20:10:23.000Z | 2020-09-15T20:19:07.000Z | rasa/shared/onstants.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | from rasa.shared.constants import DOCS_BASE_URL
DOCS_URL_TEST_STORIES = DOCS_BASE_URL + "/testing-your-assistant"
DOCS_URL_ACTIONS = DOCS_BASE_URL + "/core/actions/"
DOCS_URL_CONNECTORS = DOCS_BASE_URL + "/user-guide/connectors/"
DOCS_URL_EVENT_BROKERS = DOCS_BASE_URL + "/api/event-brokers/"
DOCS_URL_PIKA_EVENT_BROKER... | 50.666667 | 74 | 0.804276 |
6e4933e6a79f91e9cbdac8fbb15bcc8b06c9f1db | 2,811 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/Rsync/RsyncUploadThread.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 282 | 2016-06-16T14:41:44.000Z | 2022-03-02T03:43:02.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/Rsync/RsyncUploadThread.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 146 | 2016-06-16T08:55:45.000Z | 2020-09-08T10:37:32.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/Rsync/RsyncUploadThread.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 94 | 2016-06-16T10:49:07.000Z | 2022-03-28T09:14:03.000Z | import logging
import os
from shutil import rmtree
from subprocess import Popen, PIPE
from mongodb_consistent_backup.Common import wait_popen
class RsyncUploadThread:
def __init__(self, src_path, base_path, rsync_flags, rsync_path, rsync_user, rsync_host,
rsync_port=22, rsync_ssh_key=None, remo... | 33.86747 | 94 | 0.609392 |
280b038cd7a971d37d83d42c574499c86f77ab7b | 440 | py | Python | Chapter2_Python/ListComprehension.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/ListComprehension.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/ListComprehension.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | my_list = []
for i in range(5):
my_list.append(i)
print(my_list)
my_list2 = [0, 1, 2, 3, 4]
# List Comprehension
# Was wird gespeichert (val- iterable)
my_list3 = [i for i in range(5)]
print(my_list3)
my_list4 = [i**2 for i in range(5)]
print(my_list4)
# Multi-dimensionale Liste
M = [[1, 2],
[3, 4],
... | 15.714286 | 64 | 0.625 |
95c5dd5a5ff349cfa0730a190d50f17866ce1575 | 1,628 | py | Python | src/onegov/translator_directory/collections/language.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/collections/language.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/collections/language.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from sqlalchemy import func
from onegov.core.collection import GenericCollection, Pagination
from onegov.translator_directory.models.language import Language
class LanguageCollection(GenericCollection, Pagination):
batch_size = 20
def __init__(
self, ... | 25.84127 | 75 | 0.62285 |
95d44d4b0619e139bc001c5ab2f37438179e6381 | 2,780 | py | Python | 7-assets/past-student-repos/_DS-Python/Algorithms-I-Notes-master/practice_algs/squareroot.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_DS-Python/Algorithms-I-Notes-master/practice_algs/squareroot.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_DS-Python/Algorithms-I-Notes-master/practice_algs/squareroot.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import math
def foo(n):
sq_root = int(math.sqrt(n))
count = []
for i in range(0, sq_root):
count.append(i)
return count
# For a given number n, what is the maximum number of time the loop runs?
# For a given number n, how many time units is it going to take to process?
print('n' + '\t' + 'sqr... | 20.441176 | 86 | 0.454317 |
c251f26864e432602418dd556187cddb65ba885f | 411 | py | Python | nachmittags/blatt2_4.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | 1 | 2019-09-27T13:47:20.000Z | 2019-09-27T13:47:20.000Z | nachmittags/blatt2_4.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | nachmittags/blatt2_4.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null |
# blatt 2a.4
with open("zahl.txt", "r") as zahl_file:
try:
x = int(zahl_file.readline())
y = int(zahl_file.readline())
except ValueError:
print("Ging gerade nicht.")
exit()
# Schreibt x + y und x * y in die Ausgabe datei
with open("ausgabe.txt", "w") as ausgabe_file:
ausg... | 22.833333 | 47 | 0.600973 |
6c2899e2726a2772b925b5e799ad670abd4acef6 | 6,433 | py | Python | methods/t5/dataset.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/t5/dataset.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/t5/dataset.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampler
import json
import logging
from tqdm import tqdm
import os
logger = logging.getLogger(__name__)
class InputExample(object):
def __init__(self, example_id, question, contexts, endings, label=None):
"""Construct a... | 39.466258 | 129 | 0.610135 |
dd270fc4e1b094ad4d57cf09512a038ae78c5b1d | 836 | py | Python | alleIpAdressenAnzeigen.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | alleIpAdressenAnzeigen.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | alleIpAdressenAnzeigen.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | from datetime import datetime
min = 0
max = 255
seperator = '.'
datei = open('ips.txt','a')
for b1 in range((min),(max+1)):
for b2 in range(min,(max+1)):
for b3 in range(min,(max+1)):
for b4 in range(min,(max+1)):
ipAddr = str(b1) + seperator + str(b2) + seperator + str(b3)... | 38 | 98 | 0.577751 |
06ef978e30bce475068dd3a1e2842523914e65b1 | 358 | py | Python | Python/Exercícios_Python/016_quebrando_um_número.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/016_quebrando_um_número.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/016_quebrando_um_número.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""016 - Quebrando um número
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/19hp6ccjL1yKoMaHGuTN-MKTefB4D6Y3D
"""
from math import floor
valor = float(input('Digite um valor: '))
print('O valor digitado foi {} e sua porção inte... | 29.833333 | 86 | 0.72905 |
b07892a5c812c0827ea6cdf6e0c293c640cb1b30 | 848 | py | Python | bot/exts/moderation/verification.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/moderation/verification.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/moderation/verification.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import logging
import coloredlogs
import discord
from discord.ext import commands
from bot.bot import Bot
logger = logging.getLogger(__name__)
coloredlogs.install(level="DEBUG", logger=logger)
class Verification(commands.Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot
@commands.Cog.list... | 25.69697 | 82 | 0.628538 |
9fee046d1ecc556e5631d49da91e53440f778909 | 1,579 | py | Python | research/audio/fcn-4/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/audio/fcn-4/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/audio/fcn-4/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... | 31.58 | 82 | 0.658645 |
b017ee79f04665c66f09b93a956bd81d5f0fd33a | 2,197 | py | Python | scripts/update_icons.py | BenJetson/octicons-jekyll-include | e1dd3244953041eaef1fa4f1f5b39d6fbeee999a | [
"MIT"
] | 1 | 2020-07-13T01:16:45.000Z | 2020-07-13T01:16:45.000Z | scripts/update_icons.py | BenJetson/octicons-jekyll-include | e1dd3244953041eaef1fa4f1f5b39d6fbeee999a | [
"MIT"
] | 1 | 2020-11-04T02:04:16.000Z | 2021-06-01T02:59:01.000Z | scripts/update_icons.py | BenJetson/octicons-jekyll-include | e1dd3244953041eaef1fa4f1f5b39d6fbeee999a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import base64
import random
import sys
import os
OCTICONS_REPO = "https://github.com/primer/octicons.git"
ICON_PATH = "/icons"
OUT_PATH = "/_octicons"
MD_TEMPLATE = """---
icon_id: {icon_id}
name: {name}
icon_16: {icon_16}
icon_24: {icon_24}
---
"""
OVERRIDES = {
# icon_id => name to repl... | 24.411111 | 76 | 0.613564 |
05fa7f4b90921b56725f159a056faa846d3913df | 230 | py | Python | pacman-arch/test/pacman/tests/database002.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/database002.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/database002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "-D --asexplicit"
lp = pmpkg("pkg")
lp.reason = 1
self.addpkg2db("local", lp)
self.args = "-D pkg --asexplicit"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg")
self.addrule("PKG_REASON=pkg|0")
| 19.166667 | 36 | 0.7 |
af5300e0a6242f25bd4eb532c505bcc86a9e1fc0 | 164 | py | Python | python/deep_learning/FUNCTIONAL/triangle.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/deep_learning/FUNCTIONAL/triangle.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/deep_learning/FUNCTIONAL/triangle.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import math
class RightTriangle(object):
"Class used solely as namespace for related function"
@staticmethod
def hypotenuse(a,b):
return math.sqrt(a**2, b**2)
| 23.428571 | 54 | 0.75 |
0504caaae7d4ccf0c91c4a7552825f1f7dbf50fc | 223 | py | Python | PYTHON/Itertools/permutations.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/permutations.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/permutations.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from itertools import permutations
if __name__ == '__main__':
k = input().split()
S, n = k[0], int(k[1])
res = [''.join(p) for p in permutations(S, n)]
print('\n'.join(sorted(res)))
| 22.3 | 50 | 0.591928 |
0572d8288adc6a07fc0301c1226bc4609bb95932 | 293 | py | Python | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Exercises/Solutions/P02_BonusScore.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Exercises/Solutions/P02_BonusScore.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Exercises/Solutions/P02_BonusScore.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | number = int(input())
bonus = 0
if number <= 100:
bonus = 5
elif number > 1000:
bonus = number * 0.1
else:
bonus = number * 0.2
if number % 2 == 0:
bonus = bonus + 1
if number % 10 == 5:
bonus = bonus + 2
last_number = number + bonus
print(bonus)
print(last_number)
| 12.73913 | 28 | 0.587031 |
f93ffc26eff2e5855365bc8c482a857640668c4e | 6,061 | py | Python | src/onegov/feriennet/views/notification_template.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/notification_template.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/notification_template.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from onegov.activity import PeriodCollection
from onegov.core.html import html_to_text
from onegov.core.security import Secret
from onegov.core.templates import render_template
from onegov.feriennet import _, FeriennetApp
from onegov.feriennet.collections import NotificationTemplateC... | 30.611111 | 78 | 0.653193 |
f950233721e27897e26b5bdcca0bbf5720014069 | 1,153 | py | Python | Challenges/Web/Emdee five for life/scrapeAndPost.py | augu1352/HTB | b9afc19fee32a9d3e3e34149b258d7a6893af963 | [
"MIT"
] | null | null | null | Challenges/Web/Emdee five for life/scrapeAndPost.py | augu1352/HTB | b9afc19fee32a9d3e3e34149b258d7a6893af963 | [
"MIT"
] | null | null | null | Challenges/Web/Emdee five for life/scrapeAndPost.py | augu1352/HTB | b9afc19fee32a9d3e3e34149b258d7a6893af963 | [
"MIT"
] | null | null | null | import requests
import urllib.request
from html.parser import HTMLParser
import json
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
# print("Encountered a start tag: ", tag)
self.lasttag = tag
def handle_endtag(self, tag):
# print("Encountered an end tag: ", ta... | 26.813953 | 115 | 0.603643 |
f9cf466631fe7c5fa8d6b8b6b183b96cb0b688b3 | 4,060 | py | Python | github_observer/github_api.py | dsc-sangmyung/2021GithubContest | d8fc93b2b50e98877a39cac8eafe814e5c18c4a6 | [
"MIT"
] | 12 | 2021-10-05T04:58:16.000Z | 2021-12-25T19:06:48.000Z | github_observer/github_api.py | dsc-sangmyung/2021GithubContest | d8fc93b2b50e98877a39cac8eafe814e5c18c4a6 | [
"MIT"
] | 9 | 2021-10-02T19:21:25.000Z | 2021-10-05T08:12:30.000Z | github_observer/github_api.py | dsc-sangmyung/2021GithubContest | d8fc93b2b50e98877a39cac8eafe814e5c18c4a6 | [
"MIT"
] | 1 | 2021-11-23T01:29:22.000Z | 2021-11-23T01:29:22.000Z | import requests
from datetime import datetime
from typing import List
from classes import Profile, Repo, User, Commit
from bs4 import BeautifulSoup
"""
oauth를 이용해 token을 얻는 방법. 사전에 GET https://github.com/login/oauth/authorize 으로 callback code를 얻어야함.
def getToken():
query_url = f"https://github.com/login/oauth/acce... | 32.222222 | 97 | 0.596305 |
34b5740d166b6f1cc6f58f3086a60d2c1f4a719c | 4,025 | py | Python | 7_DeepLearning-GANs/01_GAN/GAN.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/01_GAN/GAN.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/01_GAN/GAN.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | '''
kombinieren von Generator und Discriminator
sowie trainieren des GANs
'''
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import *
from tensorflow.keras.optimizers import *
import numpy as np
import matplotlib.pyplot as plt
from Generator import *
from Discriminator import *
fr... | 40.25 | 173 | 0.616646 |
9bc08c3441978c745e4cbd65d9f503b0afc06431 | 1,939 | py | Python | instruments/Tektronix/channel_marker_skew/analyze.py | thepoole/Reports | 65b2f2911475b66e699cb9cf398c4b1e672cb46d | [
"MIT"
] | 1 | 2021-04-19T11:39:09.000Z | 2021-04-19T11:39:09.000Z | instruments/Tektronix/channel_marker_skew/analyze.py | thepoole/Reports | 65b2f2911475b66e699cb9cf398c4b1e672cb46d | [
"MIT"
] | 4 | 2018-07-30T15:09:35.000Z | 2021-11-16T08:11:58.000Z | instruments/Tektronix/channel_marker_skew/analyze.py | thepoole/Reports | 65b2f2911475b66e699cb9cf398c4b1e672cb46d | [
"MIT"
] | 2 | 2018-10-17T11:47:29.000Z | 2021-11-15T18:15:46.000Z | import sys
import re
from statistics import mean
import numpy as np
import matplotlib.pyplot as plt
from sync_bench import get_all_results
def analyze_single_run(r):
channels = [r['ch1'], r['ch2'], r['ch3'], r['ch4']]
data = r['data']
sig1 = data['ch1']
r = {}
for i in range(1, 4):
ch... | 20.62766 | 57 | 0.554409 |
b5c2c4a7289f74de8af036bc4ece70acc62b5996 | 6,250 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_actions.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/gto_actions.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/gto_actions.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | from PyQt5.QtCore import Qt, QFile, QTextStream, QStandardPaths
from PyQt5.QtGui import QIcon, QPixmap, QFont, QBrush, QColor
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QAction, QWidgetAction, QDockWidget, QTreeWidgetItem, \
QSplashScreen, \
QHBoxLayout, QLabel, QToolButton, QComboBox, QSiz... | 33.967391 | 120 | 0.67968 |
1f6150bca943038166b90452ab0d220eb1447c33 | 3,599 | py | Python | CS303/lab4-6/work/algorithm_ncs/benchmark.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS303_Artifical-Intelligence/NCS/algorithm_ncs/benchmark.py | Eveneko/SUSTech-Courses | 0420873110e91e8d13e6e85a974f1856e01d28d6 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS303/lab4-6/work/algorithm_ncs/benchmark.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | import numpy as np
def benchmark_func(x, problem, parameter):
"""
:type problem: int
"""
if problem < 0 or problem >= len(func_list):
raise ValueError("none exist problem")
o = parameter.o
A = parameter.A
M = parameter.M
a = parameter.a
alpha = parameter.alpha
b = param... | 30.243697 | 94 | 0.498194 |
c81e5db83cf7fd70d164c377251458e878026a1f | 1,070 | py | Python | Algorithms/Implementation/Chocolate_feast.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Chocolate_feast.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Chocolate_feast.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # chocolate feast
# https://www.hackerrank.com/challenges/chocolate-feast/problem?h_r=internal-search
n = 15 #money
c = 3 #price
m = 2 #discount
"""
n = 15 rupees in hand
c = 3 each chocolate
m = 2 wrappers exchange by 1
inital => [1,1,1,1,1] # exchange 15rs by 3 = 5
first => [1,1,1,1,1] # exchange 4 by 2
second => ... | 16.984127 | 125 | 0.557009 |
9e3c37656313216c12f87232abfae79fc1e6eb81 | 169 | pyde | Python | sketches/pcamtest/pcamtest.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/pcamtest/pcamtest.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/pcamtest/pcamtest.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | add_library('peasycam')
def setup():
size(600, 600, OPENGL)
cam = PeasyCam(this, 1000)
def draw():
background(235)
stroke(0)
noFill()
box(600)
| 14.083333 | 30 | 0.597633 |
c8d43ab1920c16e30ed31a139f1303b3a36973f0 | 877 | py | Python | tests/__init__.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 1 | 2022-02-05T16:40:13.000Z | 2022-02-05T16:40:13.000Z | tests/__init__.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 31 | 2021-06-17T11:59:33.000Z | 2022-03-19T07:05:18.000Z | tests/__init__.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | null | null | null | import os
import shutil
from importlib_resources import files
# Test cases to run
TEST_DOWNLOAD = False
TEST_APPLICATION = False
TEST_PERFORMANCE = True
# Application test options
TEST_ALL_VERSIONS = False
DIR_TESTFILES = str(files('tests.testfiles').joinpath(''))
DIR_TMP = os.path.join(DIR_TESTFILES, 'tmp')
DIR_APK... | 22.487179 | 58 | 0.690992 |
93b4dc34dd18b437b92cd2c174226014a58cc324 | 104 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Pipeline/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 282 | 2016-06-16T14:41:44.000Z | 2022-03-02T03:43:02.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Pipeline/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 146 | 2016-06-16T08:55:45.000Z | 2020-09-08T10:37:32.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Pipeline/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 94 | 2016-06-16T10:49:07.000Z | 2022-03-28T09:14:03.000Z | from PoolThread import PoolThread # NOQA
from Stage import Stage # NOQA
from Task import Task # NOQA
| 26 | 41 | 0.769231 |
f560dc8eee02a74503cbd7210d6e89e8a6389124 | 1,759 | py | Python | config.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | 8 | 2021-03-07T10:25:21.000Z | 2022-02-20T23:57:24.000Z | config.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null | config.py | quanghona/SOLO_tf2 | 4aab0fc9115d210f08e694ec59b5f093ade8ce91 | [
"MIT"
] | null | null | null |
MODEL_HYPERPARAMETERS = {
"num_class": 91, # number of class, denoted C in paper, must include the background class (id: 0)
"input_size": 512,
"grid_sizes": [24], # Grid number, denoted S in the paper
"backbone": "resnet50", # resnet50, mobilenet, mobilenetv2, xception
"head_style": "vanilla", # d... | 38.23913 | 102 | 0.662877 |
e31774188953b15462f211c9a402dc1a68f7834d | 4,092 | py | Python | 1_DeepLearning-Basics/05_XOR_Dataset_Klassifikation/network.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/05_XOR_Dataset_Klassifikation/network.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/05_XOR_Dataset_Klassifikation/network.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
# XOR Dataset
def get_dataset():
x = np.array([[0,0], [1,0], [0,1], [1,1]]).astype(np.float32)
y = np.array([0, 1, 1, 1]).astype(np.float32)
return x, y
x, y = get_dataset()
x_train, y_train = x, y
x_test, y_test = x, y
# Dataset ... | 38.971429 | 140 | 0.626833 |
7bd92fa204bc463c4cb84503aefbbfa5efa5652c | 347 | py | Python | src/onegov/core/orm/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from sqlalchemy_utils import QueryChain as QueryChainBase
class QueryChain(QueryChainBase):
""" Extends SQLAlchemy Utils' QueryChain with some extra methods. """
def slice(self, start, end):
return self[start:end]
def first(self):
return next((o for o in self), None)
def all(self):
... | 23.133333 | 73 | 0.67147 |
efb8b880809a493144e1cbff6e38829167936853 | 7,561 | py | Python | cbm/ipycbm/ipy_view/view_panel.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | cbm/ipycbm/ipy_view/view_panel.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | cbm/ipycbm/ipy_view/view_panel.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import os
import shutil
from IPython.display import displ... | 33.017467 | 73 | 0.581537 |
ef127b0db4cc8a452f03ddf25865576f1514e07c | 179 | py | Python | extraction/test/conftest.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | extraction/test/conftest.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | extraction/test/conftest.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | import pytest
from pyspark.sql import SparkSession
@pytest.fixture(scope="session")
def spark():
return SparkSession.builder.master("local").appName("chispa").getOrCreate()
| 22.375 | 79 | 0.765363 |
ef641e6587fa87d3a7134dd0e5afb1a15b0f14bb | 1,929 | py | Python | research/cv/FaceRecognitionForTracking/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/FaceRecognitionForTracking/modelarts/start.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/FaceRecognitionForTracking/modelarts/start.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 in writing... | 29.676923 | 78 | 0.666148 |
deea310222f87de786a59925c076070be945b249 | 34,010 | py | Python | research/cvtmodel/densenet/src/densenet121.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/densenet/src/densenet121.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/densenet/src/densenet121.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | import mindspore.ops as P
from mindspore import nn
class Module0(nn.Cell):
def __init__(self, batchnorm2d_1_num_features, conv2d_3_in_channels):
super(Module0, self).__init__()
self.concat_0 = P.Concat(axis=1)
self.batchnorm2d_1 = nn.BatchNorm2d(num_features=batchnorm2d_1_num_features,
... | 62.749077 | 120 | 0.661511 |
5f0283bb19c3b540102180d75529b1658c23bafd | 392 | py | Python | registry/signals.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | registry/signals.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | 5 | 2020-10-10T00:21:37.000Z | 2021-09-22T18:01:46.000Z | registry/signals.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | from django.dispatch import receiver
from django_cas_ng.signals import cas_user_authenticated
@receiver(cas_user_authenticated)
def cas_callback(sender, **kwargs):
user = kwargs.pop('user')
attributes = kwargs.pop('attributes')
user.first_name = attributes["givenName"]
user.last_name = attributes["sn"... | 28 | 56 | 0.737245 |
cd6cebcb271f6357b7629ccaa70ec39c078a8450 | 18,137 | py | Python | wz/backend/interface_grades.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/backend/interface_grades.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/backend/interface_grades.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
core/interface_grades.py - last updated 2021-05-21
Controller/dispatcher for grade management.
==============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Licens... | 38.183158 | 80 | 0.56994 |
f83e8d258cd2359bb9f26425dcc863041fe83164 | 6,531 | py | Python | packages/watchmen-inquiry-kernel/test/watchmen_inquiry_kernel_test/test_subject.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/test/watchmen_inquiry_kernel_test/test_subject.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/test/watchmen_inquiry_kernel_test/test_subject.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from unittest import TestCase
from watchmen_auth import PrincipalService
from watchmen_data_kernel.cache import CacheService
from watchmen_inquiry_kernel.storage import ReportDataService, SubjectDataService
from watchmen_meta.admin import SpaceService, TopicService
from watchmen_meta.common import ask_meta_storage, as... | 37.751445 | 105 | 0.763742 |
f88d24c40f180b26617e2ade411c49c8a9f92519 | 6,269 | py | Python | analyze/applications.py | no-ora/solitadds | 18c5868af00441a8e67311679a0b848c836975d2 | [
"MIT"
] | null | null | null | analyze/applications.py | no-ora/solitadds | 18c5868af00441a8e67311679a0b848c836975d2 | [
"MIT"
] | null | null | null | analyze/applications.py | no-ora/solitadds | 18c5868af00441a8e67311679a0b848c836975d2 | [
"MIT"
] | null | null | null | import sys, math, pdb
from datetime import timedelta
import pandas as pd
import numpy as np
import logging
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
SESSION_THRESHOLD_IN_MINUTES = 15
def summarize_applications(odf, udf, municipality_summary):
""" Create a summary of the applications... | 40.445161 | 154 | 0.651619 |
3e5e138d09ba8d5b2e55b00c8a172ea63027ad9a | 4,695 | py | Python | opencv_tutorial/opencv_python_tutorials/Image_Processing/contour_feature.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/contour_feature.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/contour_feature.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 1 17:32:46 2019
@author: jone
"""
#%% Moments
import cv2
img = cv2.imread('img/tetris_blocks.png')
imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(imgray, 225, 255, 0)
image, contours, hierachy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.... | 25.106952 | 95 | 0.662407 |
3e8dfc2ae136b891ba106fd2603c61cfaedbfaa5 | 6,475 | py | Python | checks/load_feeds_test.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | checks/load_feeds_test.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | checks/load_feeds_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 html_head, page_content
from checks import load_feeds
from checks.config import Config
from datetime import datetime
from pprint import pprint
@httprettified
class TestFeed(unittest.TestCase):
def test_feed_rss2(self):
... | 35.382514 | 268 | 0.473977 |
f2e8ecf40d010d440b09b880228edf26be6ba985 | 287 | py | Python | nz_crawl_demo/day11/djano_celery_Demo/news/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day11/djano_celery_Demo/news/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day11/djano_celery_Demo/news/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.shortcuts import render
from .tasks import task1,task2
from django.http import JsonResponse
def do_task1(request):
task1.delay(10,20)
return JsonResponse({'msg':'task1ok'})
def do_task2(request):
task2.delay(30,40)
return JsonResponse({'msg': 'task2ok'})
| 20.5 | 43 | 0.724739 |
f2cacf411dc3f322e3494d8eeab772c8ea4a5ece | 2,569 | py | Python | evaluation-webapp/reposynergy/models.py | DLR-SC/repository-synergy | 115e48c37e659b144b2c3b89695483fd1d6dc788 | [
"MIT"
] | 5 | 2021-05-09T12:51:32.000Z | 2021-11-04T11:02:54.000Z | evaluation-webapp/reposynergy/models.py | DLR-SC/repository-synergy | 115e48c37e659b144b2c3b89695483fd1d6dc788 | [
"MIT"
] | null | null | null | evaluation-webapp/reposynergy/models.py | DLR-SC/repository-synergy | 115e48c37e659b144b2c3b89695483fd1d6dc788 | [
"MIT"
] | 3 | 2021-05-12T12:14:05.000Z | 2021-10-06T05:19:54.000Z | from django.db import models
from django.contrib.auth.models import AbstractUser
from datetime import datetime
from django.db.models import Count
from django.core.exceptions import ObjectDoesNotExist
class User(AbstractUser):
batch = models.IntegerField( null=True)
def getUser(email):
return User.obj... | 35.680556 | 104 | 0.728299 |
8ac14a077f5e7f7be6f3be5347d6f822e2aa3167 | 6,772 | py | Python | test/test_npu/test_network_ops/test_cosh.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_cosh.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_cosh.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 45.756757 | 124 | 0.685027 |
0a3f324ede488276b642e79170866593e28c6494 | 31,432 | py | Python | tests/onegov/election_day/models/test_notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/models/test_notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/models/test_notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from datetime import datetime
from datetime import timezone
from freezegun import freeze_time
from onegov.ballot import BallotResult
from onegov.ballot import Candidate
from onegov.ballot import CandidateResult
from onegov.ballot import ComplexVote
from onegov.ballot import Election
from onego... | 39.636822 | 79 | 0.580587 |
0a8470951c747a88b18f2ff0100044ae78f10cf8 | 8,599 | py | Python | methods/transformers/src/transformers/tokenization_gpt2_fast.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/src/transformers/tokenization_gpt2_fast.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/src/transformers/tokenization_gpt2_fast.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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... | 45.497354 | 127 | 0.663682 |
6b09cf57627914ab9ce433e77cd1c0e5b36e80bf | 29,048 | py | Python | Security-Admin-master/security-admin.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Security-Admin-master/security-admin.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Security-Admin-master/security-admin.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/env python3
import sys , urllib.request , os, time
def timebanner(s):
for c in s + '\n' :
sys.stdout.write(c)
sys.stdout.flush()
time.sleep( 0 / 100)
timebanner(" ")
timebanner("\033[1;1m███████╗███████╗ ██████╗██╗ ██╗██████╗ ██╗████████╗██╗ ██╗ █████╗ ██████╗ ███╗ ... | 101.566434 | 8,335 | 0.721736 |
6b0d676334005c2fa64e99a3ea31bf92d0be9ae7 | 188 | py | Python | src/extras/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/extras/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/extras/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | # Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
from logger import Logger
from psycholinguistic_db_creator import PsycholinguisticDbCreator | 23.5 | 65 | 0.829787 |
867658dfb9802ea1e03953c5b5cae49a2daf3b59 | 364 | py | Python | examples/relationship/manytoonefield/migrations/0002_auto_20210906_0125.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/relationship/manytoonefield/migrations/0002_auto_20210906_0125.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/relationship/manytoonefield/migrations/0002_auto_20210906_0125.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | # Generated by Django 3.1.5 on 2021-09-06 01:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('manytoonefield', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='Article',
),
migrations.DeleteModel(
... | 18.2 | 47 | 0.571429 |
be2b71f01f4311be30c5811eeb2e0c63c0f41c13 | 552 | py | Python | python/p001.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 4 | 2018-11-14T12:03:05.000Z | 2019-09-03T14:33:28.000Z | python/p001.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | null | null | null | python/p001.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 1 | 2018-11-17T14:39:22.000Z | 2018-11-17T14:39:22.000Z | #!/usr/bin/python3
# -*- coding:utf-8 -*-
# @author: mathm
# @email :tlming16@fudan.edu.cn
class solution:
'''
given n ,find the sum of all number from 1 to n which is the
multiples of three or five
'''
__slots__=('n')
def __init__(self,n:int):
self.n=n
def sum_of_multiples(sel... | 21.230769 | 65 | 0.557971 |
9c3d2252301bd05fb04be7e5c6869349607ac73d | 4,637 | py | Python | model_zoo/ernie-3.0/deploy/triton/models/ernie_tokenizer/1/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | model_zoo/ernie-3.0/deploy/triton/models/ernie_tokenizer/1/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | model_zoo/ernie-3.0/deploy/triton/models/ernie_tokenizer/1/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import json
import paddle
import numpy as np
import time
from paddlenlp.transformers import AutoTokenizer
# triton_python_backend_utils is available in every Triton Python model. You
# need to use this module to create inference requests and responses. It also
# contains some utility functions for extracting informat... | 44.586538 | 82 | 0.632952 |
9c745ddc70bad937bdee977f4cb82cf2ba10c499 | 2,416 | py | Python | isj_proj07.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | isj_proj07.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | isj_proj07.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
# Autor: Daniel Snášel
# Datum: 21.04.2018
# Soubor: isj_proj07_xsnase06.py
'''
''' DEKLARACE ZÁSTUPNÝCH PROMNĚNÝCH '''
NULA=0
JEDNA=1
DVA=2
TRI=3
CTYRI=4
''' Konec deklarace '''
''' import knihoven '''
import math
''' konec importu '''
class TooManyCallsError(Exception):
''' Třída TooMany... | 30.974359 | 150 | 0.691225 |
b99324c476ee5f857ec67fcec09c3fffd5006154 | 1,532 | py | Python | SoSe-21/Uebung-4/A4-Taschenrechner.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-4/A4-Taschenrechner.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-4/A4-Taschenrechner.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Aufgabe 4 - Übung 4
#
# Implementieren Sie einen einfachen Taschenrechner mit den Grundrechenoperationen (+- */).
# Sollten Sie bei der Grundrechenoperation ein q eingeben, dann endet das Programm.
# Bei allen anderen Grundrechenoperationen wird eine Fehlermeldung ausgegeben.
falsche_eingabe = True
while falsche_e... | 36.47619 | 91 | 0.699086 |
5381da4810fe3de6684ff6ddb529059c8b85bc7a | 8,588 | py | Python | PCA/GUI.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | PCA/GUI.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | PCA/GUI.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import messagebox
from analyze import readData, preprare_data, createplot, analyze_data
from observer import Publisher, Subscriber
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib.pyplot as plt
from matplotlib.figure import Figur... | 36.236287 | 150 | 0.639846 |
ab4057f38c19259f8e8a795324b1fa8e67ea6b8a | 17,067 | py | Python | bach_code/legacy/featurize.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 5 | 2015-12-08T21:47:41.000Z | 2020-10-28T12:39:08.000Z | bach_code/legacy/featurize.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | null | null | null | bach_code/legacy/featurize.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 1 | 2020-10-28T12:39:09.000Z | 2020-10-28T12:39:09.000Z | from helpers import * # includes music21
import math
import time
import sys
import os
from ordered_set import OrderedSet
from glob import glob
from random import shuffle
import numpy as npy
import h5py
#####
#
# wrangle1.py
#
# Goal: create a data representation of the entire Bach chorale set - that is, the 371 choral... | 35.335404 | 136 | 0.672116 |
db4d07d0bd1c5381b9d97e2518fec054d7c83526 | 641 | py | Python | bildungslogin-plugin/tests/unittests/test_models.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/tests/unittests/test_models.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/tests/unittests/test_models.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from bildungslogin_plugin.models import User
def test_user_with_valid_attributes(valid_user_kwargs):
kwargs = valid_user_kwargs()
user = User(**kwargs)
assert user.dict() == kwargs
@pytest.mark.parametrize(
"test_data",
(
("id", ""),
("first... | 22.103448 | 65 | 0.616225 |
dbaf2020292ed6edbb4e3e73ea45fae9f63e1bb8 | 8,214 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gcp_tpu_node_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gcp_tpu_node_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gcp_tpu_node_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 32.595238 | 124 | 0.624665 |
535490eedeb766932f7d79f047431ef9734917d2 | 3,701 | py | Python | myems-api/core/timezone.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 82 | 2021-02-19T10:24:31.000Z | 2022-03-28T06:30:18.000Z | myems-api/core/timezone.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 188 | 2021-02-22T07:08:30.000Z | 2022-03-02T04:11:03.000Z | myems-api/core/timezone.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 54 | 2021-02-19T08:48:46.000Z | 2022-03-30T06:21:34.000Z | import falcon
import simplejson as json
import mysql.connector
import config
from core.useractivity import user_logger, access_control
class TimezoneCollection:
@staticmethod
def __init__():
""""Initializes TimezoneCollection"""
pass
@staticmethod
def on_options(req, resp):
re... | 31.632479 | 105 | 0.544177 |
feb92ac190e4a0cd960c717a6ff7dc2b700ee94b | 3,156 | py | Python | research/nlp/atae_lstm/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/nlp/atae_lstm/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/nlp/atae_lstm/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... | 32.204082 | 97 | 0.684411 |
43da0d477972ab86f6fc133efef525c26c68b83d | 1,193 | py | Python | top/clearlight/base/liaoxuefeng/advanced/Slice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/advanced/Slice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/advanced/Slice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # 高级特性: 切片
L = ['Mike', 'Jerry', 'Bob', 'Luck']
# 1
print([L[0], L[1]])
# 2. 循环
r = []
n = 3
for i in range(n):
r.append(L[i])
print(r)
print(L)
# 3. 切片
print('切片')
print(L[0:3])
print(L[:3])
print(L[1:3])
# 倒数第一个元素的索引是 -1
print(L[-2:])
# 取出倒数第二个元素
print(L[-2:-1])
# 取出最后一个元素
print(L[-1:])
L = list(range(100))
p... | 15.906667 | 48 | 0.49539 |
880aa1155471ed1ec1e1105181118c4eb1c68319 | 2,586 | py | Python | research/cv/DeepID/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DeepID/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DeepID/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.792453 | 103 | 0.723898 |
71b998fb95477352624c5fc66ac1977517f77c7b | 2,236 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_attribute/item_attribute.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_attribute/item_attribute.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/item_attribute/item_attribute.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from erpnext.controllers.item_variant import (validate_is_increm... | 34.9375 | 85 | 0.758497 |
e07bf05f1a53ce5bdacce1d35fdfb175300bb15b | 707 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_1/fix_jv_remarks.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v4_1/fix_jv_remarks.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_1/fix_jv_remarks.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
reference_date = guess_reference_date()
for name in frappe.db.sql_list("""select name from `tabJournal Entry`
where d... | 32.136364 | 106 | 0.736917 |
460c6e69087bb4ac27e91542ee3c5ddb3d7f516c | 134 | py | Python | python/coursera_python/TORONTO/test/4.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/TORONTO/test/4.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/TORONTO/test/4.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def compress_list(L):
compressed_list = []
i=0
while i < len(L):
compress_list.append(L[i]+L[i+1])
i=i+2
return compress_list
| 16.75 | 35 | 0.671642 |
1caae97099e75b792ee4a495e49fdd6b3479cb7a | 10,953 | py | Python | Packs/SentinelOne/Integrations/SentinelOne-V2/SentinelOne-V2_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/SentinelOne/Integrations/SentinelOne-V2/SentinelOne-V2_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/SentinelOne/Integrations/SentinelOne-V2/SentinelOne-V2_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | import io
import json
import pytest
import demistomock as demisto
from importlib import import_module
sentinelone_v2 = import_module('SentinelOne-V2')
main = sentinelone_v2.main
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
@pytest.fixture()
... | 41.488636 | 125 | 0.628595 |
1cc56f402ab53973796f78400835014862195df7 | 2,207 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/02_grundlagen_multithreading.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/02_grundlagen_multithreading.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/02_grundlagen_multithreading.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 02_grundlagen_multithreading.py
import os, re, time, datetime, threading
max_text_length=70
max_text_delta=24
def output(title, string):
print('╔'+''.center(max_text_length+8, '═')+'╗')
print('║ '+title.center(max_text_length+7).upper()+'║')
print('╠'+''.center(max_text_length+8, '═')+'╣')
string=s... | 64.911765 | 376 | 0.74309 |
1c7b196ec055be478549ff899744550e2954c4c3 | 271 | py | Python | PYTHON/Sets/captains_room.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Sets/captains_room.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Sets/captains_room.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
if __name__ == '__main__':
d = {}
A = int(input())
room_numbers = list(map(int, input().split()))
for r in room_numbers:
d[r] = d.get(r, 0) + 1
for k, v in d.items():
if v != A:
print(k)
| 19.357143 | 50 | 0.498155 |
98f69e99d2b9993cfead40c8e0369af1f6767099 | 1,305 | py | Python | tests/nlu/selectors/test_selectors.py | techBeck03/rasa | 72fef6e7742f5ccb8614c75b6410dff68f137554 | [
"Apache-2.0"
] | 2 | 2021-10-31T01:06:08.000Z | 2021-11-08T09:43:23.000Z | tests/nlu/selectors/test_selectors.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | null | null | null | tests/nlu/selectors/test_selectors.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | null | null | null | import pytest
from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.training_data import load_data
from rasa.nlu.train import Trainer, Interpreter
from rasa.utils.tensorflow.constants import EPOCHS
from rasa.nlu.constants import RESPONSE_SELECTOR_PROPERTY_NAME
@pytest.mark.parametrize(
"pipeline",
[
... | 28.369565 | 77 | 0.697318 |
405ac7ed6f12bc00e2b90307d07cdc646d3b9cb8 | 5,832 | py | Python | open/hls4ml/code/ad/AD03/training/convert.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | 5 | 2021-06-22T15:34:37.000Z | 2022-03-29T06:12:03.000Z | open/hls4ml/code/ad/AD03/training/convert.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | null | null | null | open/hls4ml/code/ad/AD03/training/convert.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | 5 | 2021-08-02T16:39:02.000Z | 2022-03-29T06:12:04.000Z | import tensorflow as tf
from qkeras.utils import _add_supported_quantized_objects
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn import metrics
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
import numpy
import hls4ml
import matplotlib.pyplot as plt
import os
import sys
im... | 36.45 | 183 | 0.70679 |
40aabf5f2052983a7de730a62d2398eab04c6ae2 | 2,409 | py | Python | src/models/net.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/models/net.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/models/net.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null | import torch
if torch.cuda.is_available():
import torch.cuda as t
else:
import torch as t
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
def cross_entropy2d(input, target,... | 28.341176 | 87 | 0.586966 |
40e48e619f5dab8b7749631aba1aace619f3edca | 1,713 | py | Python | hello/hello_mud.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello_mud.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello_mud.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | # -*- coding: utf-8 -*-
# 导入:
from sqlalchemy import Column, Integer, String, Sequence, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# 创建对象的基类:
Base = declarative_base()
class City(Base):
__tablename__ = 'city'
id = Column(Integer, Sequence(... | 27.629032 | 78 | 0.684764 |
295fd7b5b636e7a5ff425f7cd8e9e4d77338040a | 2,911 | py | Python | AI_Engine_Development/Design_Tutorials/07-firFilter_AIEvsHLS/HLS/design/create_fir_coefs.py | jlamperez/Vitis-Tutorials | 9a5b611caabb5656bbb2879116e032227b164bfd | [
"Apache-2.0"
] | 1 | 2022-03-09T06:15:43.000Z | 2022-03-09T06:15:43.000Z | AI_Engine_Development/Design_Tutorials/07-firFilter_AIEvsHLS/HLS/design/create_fir_coefs.py | jlamperez/Vitis-Tutorials | 9a5b611caabb5656bbb2879116e032227b164bfd | [
"Apache-2.0"
] | null | null | null | AI_Engine_Development/Design_Tutorials/07-firFilter_AIEvsHLS/HLS/design/create_fir_coefs.py | jlamperez/Vitis-Tutorials | 9a5b611caabb5656bbb2879116e032227b164bfd | [
"Apache-2.0"
] | null | null | null | #-------------------------------------------------------------------------------
# (c) Copyright 2021 Xilinx, Inc.
#
# 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.or... | 33.848837 | 134 | 0.595328 |
298385ac891b2e875ed58ba6276def327bf8be64 | 237 | py | Python | historie/urls.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/historie/urls.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/historie/urls.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django.urls import path
from . import views
app_name = 'historie' # here for namespacing of urls.
urlpatterns = [
path("", views.list, name="list"),
path('ajax/fetch_entries', views.fetch_entries, name="fetch_entries")
]
| 23.7 | 73 | 0.704641 |
4633a14f1c0862f9a5b038d6daad9dd22d5e56e1 | 750 | py | Python | ___Python/KarPoo/po1_kennenlernen/p04_oop/m04_kalenderuhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p04_oop/m04_kalenderuhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p04_oop/m04_kalenderuhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | from p04_oop.m02_kalender import Kalender
from p04_oop.m03_uhr import Uhr
class KalenderUhr(Kalender, Uhr):
def __init__(self, tag, monat, jahr, stunden, minuten, sekunden):
Kalender.__init__(self, tag, monat, jahr)
Uhr.__init__(self, stunden, minuten, sekunden)
def __repr__(self):
... | 31.25 | 70 | 0.624 |
46505f9e91cff628ad668700fccc9c2a1fbe3bb9 | 273 | py | Python | Language Proficiency/Python/Sets/The Captain's Room/captain_room.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Sets/The Captain's Room/captain_room.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Sets/The Captain's Room/captain_room.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
K = int(input())
arr = map(int, input().split())
s1 = set()
s2 = set()
for e in arr:
if e in s1:
s2.add(e)
else:
s1.add(e)
print(s1.difference(s2).pop())
| 15.166667 | 35 | 0.461538 |
3108e2ad71547079046150fa38ea6b810a64a7eb | 2,787 | py | Python | src/onegov/town6/views/ticket.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/views/ticket.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/views/ticket.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Public, Private
from onegov.org.views.ticket import view_ticket, handle_new_note, \
handle_edit_note, message_to_submitter, view_ticket_status, view_tickets, \
view_archived_tickets, assign_ticket
from onegov.ticket.collection import ArchivedTicketsCollection
from onegov.town6 i... | 36.671053 | 79 | 0.766416 |
313652083bfc89d0ee1e286005cc2ad230314c06 | 1,243 | py | Python | src/bar-charts/stacked_bar.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/bar-charts/stacked_bar.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/bar-charts/stacked_bar.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | # stacked bars -
import pandas as pd
import numpy as np
import matplotlib.cm as cmp
import matplotlib.colors as cl
import matplotlib.pyplot as plt
import plotly.express as px
# matplotlib
bar_width = 1
bar_l = np.arange(0, len(x_ticks))
tick_pos = [i + (bar_width / 2) for i in bar_l]
fig, ax = plt.subplots(1, figs... | 21.807018 | 121 | 0.595334 |
b409b533c0056b2809c3ce42130c1ebb15fc4970 | 2,670 | py | Python | tests/server/integrations/test_slack.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | tests/server/integrations/test_slack.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | tests/server/integrations/test_slack.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import pytest
import server.integrations.slack as slack
@pytest.fixture
def anomalies():
return []
@pytest.fixture
def config():
return {'url': 'http://localhost:3000/notarealurl'}
@pytest.fixture
def empty_data():
return { "text": "", "blocks": [] }
@pytest.fixture
def data(empty_data):
empty_data... | 28.105263 | 95 | 0.520974 |
b46f489f34c60509de763b3b655ee26e48db0d65 | 3,608 | py | Python | siege-shell/svg2png.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | siege-shell/svg2png.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | siege-shell/svg2png.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | from collections.abc import Iterable
import numpy
import xml.etree.ElementTree as ET
import sys
input = sys.argv[1]
theme_file = sys.argv[2]
# Theme Generation
# TODO support other types of SVG element transformations.
# They should likely all produce a matrix, to make the calculation part consistent.
def matrix(a, b... | 29.818182 | 116 | 0.545732 |
c335fe75e9af0cf68df1bf03720614e206ad8cb1 | 7,358 | py | Python | src/bias_mitigator/get_model_distrib.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/bias_mitigator/get_model_distrib.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/bias_mitigator/get_model_distrib.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | """Script to analyze model's generated distribution of words."""
import os, sys
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from collections import Counter, OrderedDict
import src.constants as constants
THRESHOLD = 4000 # Max samples to analyze per demographic.
de... | 33.144144 | 87 | 0.530035 |
6f6d56c33b1e26c93e709ed551ff206e0d7df573 | 5,102 | py | Python | app/core/models.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/core/models.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/core/models.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | 1 | 2022-03-06T17:44:49.000Z | 2022-03-06T17:44:49.000Z | import os, uuid
from django.db import models
from django.core.validators import RegexValidator
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
def image_path_generator(instance, filename):
extensi... | 35.186207 | 110 | 0.693258 |
48de3542ba6bb2c3ce4f8b06d1a6744a818a8a92 | 2,308 | py | Python | tools/pythonpkg/tests/fast/types/test_nested.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/types/test_nested.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/types/test_nested.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
class TestNested(object):
def test_lists(self, duckdb_cursor):
duckdb_conn = duckdb.connect()
result = duckdb_conn.execute("SELECT LIST_VALUE(1, 2, 3, 4) ").fetchall()
assert result == [([1, 2, 3, 4],)]
result = duckdb_conn.execute("SELECT LIST_VALUE() ").fetchall()... | 43.54717 | 120 | 0.570191 |
48e4c290764f8b6599b782be9ee8a72271c716eb | 14,994 | py | Python | src/user_io.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | src/user_io.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | src/user_io.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file contains the user interface."""
import ownfunctions
import geocache
import os
PATH = [r"E:/Garmin", r"F:/Garmin", r"G:/Garmin", r"H:/Garmin", r"/media/{}/GARMIN/garmin/".format(os.environ["USER"])]
CODING = "cp1252" # coding of cmd (cp1252 recommended)
EDITOR... | 33.172566 | 123 | 0.643191 |
7dcd7c54004e430c92a3115c12466ac511884a21 | 1,318 | py | Python | other/re-risky/directors-cut/spoilers_and_source/src/gen_mixer.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | other/re-risky/directors-cut/spoilers_and_source/src/gen_mixer.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | other/re-risky/directors-cut/spoilers_and_source/src/gen_mixer.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python
# Copyright 2018 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 agre... | 25.346154 | 74 | 0.637329 |
81d259ea92deb6716cdd4e56e3c91f7aec0c356b | 9,158 | py | Python | venv/lib/python3.7/site-packages/twilio/rest/preview/trusted_comms/business/__init__.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 3 | 2020-12-14T03:29:02.000Z | 2020-12-24T22:04:48.000Z | venv/lib/python3.7/site-packages/twilio/rest/preview/trusted_comms/business/__init__.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 7 | 2020-06-03T19:08:42.000Z | 2021-09-22T19:08:32.000Z | venv/lib/python3.7/site-packages/twilio/rest/preview/trusted_comms/business/__init__.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 1 | 2020-06-03T19:22:39.000Z | 2020-06-03T19:22:39.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | 31.57931 | 94 | 0.647958 |
c4c58467823aafc95878fc235d6b96d9360c053e | 526 | py | Python | hystreet/hystreet_to_s3/upload.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | null | null | null | hystreet/hystreet_to_s3/upload.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | null | null | null | hystreet/hystreet_to_s3/upload.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | null | null | null | import boto3
import pandas as pd
import json
import datetime
df = pd.read_csv('data.csv')
for name, group in df.groupby('timestamp'):
print(group.to_json(orient='records'))
date_str = name.split('+')[0]
date = datetime.datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S.%f')
print(date.year)
client = b... | 32.875 | 99 | 0.646388 |
480eafb7021fbfcd193c667c53e12d351034dd2c | 233 | py | Python | exercises/en/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Import the German language class
from spacy.lang.de import German
# Create the nlp object
nlp = German()
# Process a text (this is German for: "Kind regards!")
doc = nlp("Liebe Grüße!")
# Print the document text
print(doc.text)
| 19.416667 | 54 | 0.72103 |
48483c52ed5815d0915966b7b91ef2d7c57e4d52 | 2,902 | py | Python | marsyas-vamp/marsyas/scripts/Python/icme2011_distance_matrix_from_pitch_contours.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/icme2011_distance_matrix_from_pitch_contours.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/icme2011_distance_matrix_from_pitch_contours.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Calculate the stats of a pitch contour txt file
#
# Stats include median, mean, min, max, std dev.
#
import sys
import os
import datetime
import commands
import re
import numpy as np
import math
#
# Normalize each element in the list to the range of 0 to 1
#
# sness - There is a more elegant w... | 23.786885 | 85 | 0.665748 |
6fc63b33a4833b11b79260328eeca0062840efac | 252 | pyde | Python | sketches/cheese02/cheese02.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/cheese02/cheese02.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/cheese02/cheese02.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | def setup():
size(1000, 500)
noLoop()
def draw():
cheese(width/2, height/2, 500, 10)
def cheese(x, y, r, level):
ellipse(x, y, r, r)
if (level > 1):
cheese(x - r/2, y, r/2, level-1)
cheese(x + r/2, y, r/2, level-1) | 21 | 40 | 0.507937 |
9641353039f8c42a105ee28af77495d02847a447 | 133 | py | Python | WeChatSecretary/utils/wechat_wiki.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatSecretary/utils/wechat_wiki.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatSecretary/utils/wechat_wiki.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
# python37
from utils.weather.main import weather
def get_weather(city):
return weather.get_weather(city) | 22.166667 | 38 | 0.729323 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.