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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
295a4b1a87d04961064f8ca5236568c1da82a6f3 | 460 | py | Python | gshiw/quotes_web/config/migrations/0002_auto_20171211_2206.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/config/migrations/0002_auto_20171211_2206.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/config/migrations/0002_auto_20171211_2206.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-11 14:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('config', '0001_initial'),
]
operations = [
migrations.RemoveField(
mode... | 20 | 48 | 0.584783 |
468601502b68dd5b1c9a98ec103524a6998fe3e4 | 2,630 | py | Python | scrapers/scrape_ur.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_ur.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_ur.py | AryaVashisht/covid_19 | 0c734615a1190a5b2fff4697f47731ef2b8b6918 | [
"CC-BY-4.0"
] | 1 | 2020-08-25T06:45:56.000Z | 2020-08-25T06:45:56.000Z | #!/usr/bin/env python3
import re
from bs4 import BeautifulSoup
import scrape_common as sc
url = 'https://www.ur.ch/themen/2962'
d = sc.download(url, silent=True)
# 2020-03-26 (and possibly earlier) from https://www.ur.ch/themen/2962
# 2020-07-07 they changed the title, so we're using the table header to find the tab... | 29.550562 | 105 | 0.655513 |
d3ec28991001811d22a6eda7da3cb86b7ee4aa02 | 14,523 | py | Python | test/test_npu/test_network_ops/test_gt.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_gt.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_gt.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... | 43.482036 | 88 | 0.613923 |
d3ecf2378e8f5d5b40accf670017dfdeaf6282c9 | 11,362 | py | Python | rat.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | rat.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | rat.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # uncompyle6 version 3.7.4
# Python bytecode 2.7
# Decompiled from: Python 2.7.18 (default, Mar 20 2021, 14:58:25)
# [GCC 4.2.1 Compatible Android (6454773 based on r365631c2) Clang 9.0.8 (https:/
# Embedded file name: <Sazxt>
import os, sys, time, datetime, random, hashlib, re, threading, json, urllib, cookielib, get... | 53.093458 | 2,229 | 0.501584 |
3150ad1d0d1267eb9da4d6c4e3e2355bc29432cb | 4,152 | py | Python | parse.py | roeetal/D.W.A | 352049c7e36b716c6344f95c0e369004646adaf4 | [
"MIT"
] | null | null | null | parse.py | roeetal/D.W.A | 352049c7e36b716c6344f95c0e369004646adaf4 | [
"MIT"
] | null | null | null | parse.py | roeetal/D.W.A | 352049c7e36b716c6344f95c0e369004646adaf4 | [
"MIT"
] | null | null | null | import os
import json
import ipywidgets as widgets
import tensorflow as tf
from IPython import display
from dragnn.protos import spec_pb2
from dragnn.python import graph_builder
from dragnn.python import spec_builder
from dragnn.python import load_dragnn_cc_impl # This loads the actual op definitions
from dragnn.pytho... | 39.923077 | 129 | 0.680636 |
31e8549dd0eada6106f6afd8ea2ede170b942ca6 | 11,017 | py | Python | examples/machine_translation/seq2seq/seq2seq_attn.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/seq2seq/seq2seq_attn.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/seq2seq/seq2seq_attn.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 37.729452 | 92 | 0.593265 |
8259ce02f66d0c6ad031bac3519cc58c0c22f61d | 540 | py | Python | books/PythonCleanCode/ch1_code_format/src/test_annotations.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch1_code_format/src/test_annotations.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch1_code_format/src/test_annotations.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 01: Introduction, Tools, and Formatting
Tests for annotations examples
"""
import pytest
from src.annotations import NewPoint, Point, locate
@pytest.mark.parametrize(
"element,expected",
(
(locate, {'latitude': float, 'longitude': float, 'return': Point}),
... | 25.714286 | 75 | 0.685185 |
7dbef07e4bcaf8ab4014629a1a4354b84f150f36 | 3,546 | py | Python | jinjagen.py | prakhar2b/testgen | 6c896a299d7d62bf57a72c698562181783aec73f | [
"MIT"
] | null | null | null | jinjagen.py | prakhar2b/testgen | 6c896a299d7d62bf57a72c698562181783aec73f | [
"MIT"
] | null | null | null | jinjagen.py | prakhar2b/testgen | 6c896a299d7d62bf57a72c698562181783aec73f | [
"MIT"
] | null | null | null | import jinja2
from jinja2 import Environment, FileSystemLoader
import sys
file_loader = FileSystemLoader(searchpath="./")
env = Environment(loader=file_loader)
t = env.get_template('t.txt')
# t.txt generated by cookiecutter
class Feature(object):
def __init__(self, d):
for a, b in d.items():
if isinstance(b... | 39.842697 | 1,044 | 0.534687 |
7dcff83935721d69ee961884ee39c6e0541c8d24 | 1,445 | py | Python | src/onegov/user/forms/registration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/registration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/registration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.user import _
from onegov.user.collections import MIN_PASSWORD_LENGTH
from wtforms import StringField, PasswordField, validators
class RegistrationForm(Form):
""" A generic registration form for onegov.user """
username = StringField(
label=_("E-Mail Address")... | 32.840909 | 74 | 0.648443 |
81abaf293ce585bcddbe8c029886fd532e780204 | 1,432 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C04TreesGraphs/python/4.3-answer.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C04TreesGraphs/python/4.3-answer.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C04TreesGraphs/python/4.3-answer.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 4.3 List of Depths
# Given a binary tree, design an algorithm which creates a linked list
# of all the nodes at each depth.
# E.G. if you have a tree with depth D, you'll have D linked lists.
class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
de... | 26.518519 | 71 | 0.551676 |
81d9d71fce5b219fc36d6bef55d20525f56756d4 | 12,863 | py | Python | flask_admin/tests/mongoengine/test_basic.py | carlozamagni/flask-admin | a76c004d22cce82dab685b67ae1a2b51be2b8bd7 | [
"BSD-3-Clause"
] | 1 | 2015-10-26T10:38:32.000Z | 2015-10-26T10:38:32.000Z | pythonlib/flask_admin/tests/mongoengine/test_basic.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | pythonlib/flask_admin/tests/mongoengine/test_basic.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | 1 | 2020-02-14T10:26:18.000Z | 2020-02-14T10:26:18.000Z | from nose.tools import eq_, ok_
from nose.plugins.skip import SkipTest
# Skip test on PY3
from flask.ext.admin._compat import PY2, as_unicode
if not PY2:
raise SkipTest('MongoEngine is not Python 3 compatible')
from wtforms import fields
from flask.ext.admin import form
from flask.ext.admin.contrib.mongoengine i... | 25.623506 | 90 | 0.603048 |
6f93dc32e7ce9db143c1e9f3bc52f974d6e6e09e | 343 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_16_Mails_und_SMS_senden/06_versenden_von_nachrichten_per_telegram.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_16_Mails_und_SMS_senden/06_versenden_von_nachrichten_per_telegram.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_16_Mails_und_SMS_senden/06_versenden_von_nachrichten_per_telegram.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 06_versenden_von_nachrichten_per_telegram.py
import requests
print('Chat-ID eingeben:')
chat_id=input()
print('Bot-Token eingeben:')
bot_token=input()
print('Zu sendende Nachricht eingeben:')
message=input()
telegram_api='https://api.telegram.org/bot'+bot_token+'/sendMessage?chat_id='+chat_id+'&text='+message
requ... | 24.5 | 102 | 0.784257 |
9656f2678fb391868218d707ac9a6f6d2cf57733 | 5,818 | py | Python | udm-bildungslogin/ucs-test/97_bildungslogin_udm/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | udm-bildungslogin/ucs-test/97_bildungslogin_udm/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | udm-bildungslogin/ucs-test/97_bildungslogin_udm/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of... | 30.946809 | 90 | 0.67549 |
fb8e186b87e5134c46dc6ff8561677bec81b0d77 | 547 | py | Python | MAIN/STM32F405/V01/main.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405/V01/main.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405/V01/main.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | import pyb
from pyb import Pin, ExtInt, CAN
import time
from SX1239 import SX1239
RF_RECEIVER = 0
RF_SYNTHESIZER = 1
RF_STANDBY = 2
RF_SLEEP = 3
RED = Pin('Y1', Pin.OUT_PP)
USERBTN = Pin('Y2', Pin.IN, Pin.PULL_UP)
SX1239 = SX1239()
def USERBTNCallback(value):
if value is 1:
RED.high()
else:
... | 17.09375 | 44 | 0.603291 |
fbcf19804446afe49ad2ca0010fda85e9496d6cc | 59 | py | Python | Python/Strings/text_wrap.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/text_wrap.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/text_wrap.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | import textwrap
print(textwrap.fill(input(), int(input()))) | 29.5 | 43 | 0.745763 |
860637ed5f45f43fb5d8bbad6e487cdb9a471472 | 1,207 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_09_Dateien_verwalten/02_files_mit_regex_durchsuchen/23_files_mit_regex_durchsuchen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_09_Dateien_verwalten/02_files_mit_regex_durchsuchen/23_files_mit_regex_durchsuchen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_09_Dateien_verwalten/02_files_mit_regex_durchsuchen/23_files_mit_regex_durchsuchen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 23_files_mit_regex_durchsuchen.py
# Dieses Script durchsucht alle txt Dateien in einem vorgegebenen Ordner und sucht nach entsprechenden Strings
import os, re
total, counter=0, 0
pfad=os.path.dirname(__file__)
ordnerinhalt=' '.join(os.listdir(pfad))
os.chdir(pfad)
def scan_4_dir():
unterordner=[]
suchmuster=re.... | 28.069767 | 122 | 0.728252 |
e3fc0733e3bc6ab1c762990bf200686bc68d235a | 1,241 | py | Python | pyUnnenberg/play_buffer.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | pyUnnenberg/play_buffer.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | pyUnnenberg/play_buffer.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import alsaaudio, time
from array import array
from itertools import izip_longest
def _chunks(n, iterable, padvalue=None):
return izip_longest(*[iter(iterable)]*n, fillvalue=padvalue)
class PlayFloatBuffer:
CHUNK = 32
FORMAT = alsaaudio.PCM_FORMAT_FLOAT_LE
C... | 27.577778 | 101 | 0.661563 |
585e25f439159d0b9bae46f3732ea81c9b5f96e2 | 1,454 | py | Python | pythonProj/FZPython/pyquant/models/signal_explorer.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/models/signal_explorer.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/models/signal_explorer.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | #!/usr/bin/env python
# coding: utf8
import backtrader as bt
from pyquant.models.symbol_data import SymbolData, Symbol
class SignalExplorer(object):
"""
返回策略有opensignal的stocklist
"""
def explore_signal(self, strategy, symbol):
"""
根据 stratety 跑 symbols,返回有open signal的symbols
:... | 23.836066 | 73 | 0.590784 |
3fea365e76da9e452d361ab29cea34fa2c49d282 | 2,904 | py | Python | andinopy/interfaces/andino_hardware_interface.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/interfaces/andino_hardware_interface.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/interfaces/andino_hardware_interface.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | # _ _ _
# / \ _ __ __| (_)_ __ ___ _ __ _ _
# / _ \ | '_ \ / _` | | '_ \ / _ \| '_ \| | | |
# / ___ \| | | | (_| | | | | | (_) | |_) | |_| |
# /_/ \_\_| |_|\__,_|_|_| |_|\___/| .__/ \__, |
# |_| |___/
# by Jakob Groß
import abc
class ... | 35.414634 | 70 | 0.658058 |
4d884964a708464dfd38284bcac4e71c852bacd8 | 365 | py | Python | 1043-partition-array-for-maximum-sum/1043-partition-array-for-maximum-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1043-partition-array-for-maximum-sum/1043-partition-array-for-maximum-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1043-partition-array-for-maximum-sum/1043-partition-array-for-maximum-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def maxSumAfterPartitioning(self, arr: List[int], k: int) -> int:
dp=[max(arr[0:1+i])*(i+1) for i in range(k)]
for i in range(k, len(arr)):
cur = 0
for window in range(k):
cur = max(cur, dp[i-k+window]+max(arr[i-k+1+window:i+1])*(k-window))
... | 40.555556 | 84 | 0.512329 |
4dcd9f6a6b0f4c7197b15620610c5751dc336351 | 454 | py | Python | SHELL/2021/crypto/Puny_Factors/secret.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | SHELL/2021/crypto/Puny_Factors/secret.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | SHELL/2021/crypto/Puny_Factors/secret.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from Crypto.Util.number import getPrime,inverse,long_to_bytes,bytes_to_long
from Crypto.PublicKey import RSA
flag = "shellctf{something_here}"
n = getPrime(4096)
e = 65537
phi = (n-1)*(n-1)
d = inverse(e,phi)
encrypted_flag = pow(bytes_to_long(flag.encode()),e,n)
decrypted_flag = long_to_bytes(pow(encrypted_flag,d,n... | 26.705882 | 75 | 0.748899 |
150425e4d92d7e3af213a55b00bf661a4fdd2fa1 | 11,953 | py | Python | scripts/flow_rank.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 1 | 2021-01-20T00:37:31.000Z | 2021-01-20T00:37:31.000Z | scripts/flow_rank.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 17 | 2021-03-03T14:48:54.000Z | 2021-09-08T15:52:50.000Z | scripts/flow_rank.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 2 | 2021-03-05T12:23:20.000Z | 2021-03-29T11:49:53.000Z | #%% [markdown]
# # Flow
#%%
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from graspologic.utils import binarize, get_lcc, is_fully_connected
from scipy.stats import rankdata, spearmanr
import SpringRank as sr
from pkg.data import load_data
from pkg.io import savefig, s... | 28.80241 | 88 | 0.611562 |
42398e5f906ceb96e130f017a48b464da410dd58 | 2,875 | py | Python | official/cv/unet3d/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/unet3d/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/unet3d/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... | 45.634921 | 111 | 0.638957 |
c41ac4ee216aaa13102b6e17d17b0cf672a572b9 | 782 | py | Python | individual.py | MaksimSimanskiy/2.10 | 82ffd1677e250bb79d4c5fe0a0d357d91afd989e | [
"MIT"
] | null | null | null | individual.py | MaksimSimanskiy/2.10 | 82ffd1677e250bb79d4c5fe0a0d357d91afd989e | [
"MIT"
] | null | null | null | individual.py | MaksimSimanskiy/2.10 | 82ffd1677e250bb79d4c5fe0a0d357d91afd989e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Напишите функцию, находящую сумму положительных аргументов, расположенных до максимального аргумента,
принимающую произвольное количество аргументов, и возвращающую требуемое значение.
Если функции передается пустой список аргументов, то она должна возвращать знач... | 27.928571 | 102 | 0.569054 |
670aae1e6b30d86660b8d7743e6165a783b8ce73 | 596 | py | Python | NeuralNet/Alex/stat.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | 6 | 2017-04-12T14:05:19.000Z | 2021-01-29T11:23:50.000Z | NeuralNet/Alex/stat.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | NeuralNet/Alex/stat.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | from dataloader import plot
# plot epoch csv as image
for i in range(10):
plot.plot_csv_multipath("models/model_0"+str(i)+"/plot.csv", figure="Model_"+str(i)).savefig("model"+str(i)+".png")
# Plot Model as Image
#from modelpipe import pipe
#from keras.utils import plot_model
#for i in range(10):
# plot.plot_csv_m... | 37.25 | 117 | 0.723154 |
c0671faa8121a4d4086a67cc449c1dd5d949f8e5 | 495 | py | Python | PYTHON/Regex_and_Parsing/hex_color_code.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/hex_color_code.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/hex_color_code.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re
for _ in range(int(input())):
for m in re.finditer(r'(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6})(?=[,;)])', input()):
print(m.group())
# It was solve the problem, but length check logic is not a good idea.
'''
if re.search('^[^#](\w+|\s+)', n) is None:
continue... | 23.571429 | 81 | 0.486869 |
450de7a85582469c1f70c371470c73918307eb2d | 2,712 | py | Python | Chapter10_Cython/2_CythonCode/fastvector/computations.py | tomex74/UdemyPythonPro | b4b83483fa2d3337a2860d53ff38e68eb38b3ac4 | [
"MIT"
] | null | null | null | Chapter10_Cython/2_CythonCode/fastvector/computations.py | tomex74/UdemyPythonPro | b4b83483fa2d3337a2860d53ff38e68eb38b3ac4 | [
"MIT"
] | null | null | null | Chapter10_Cython/2_CythonCode/fastvector/computations.py | tomex74/UdemyPythonPro | b4b83483fa2d3337a2860d53ff38e68eb38b3ac4 | [
"MIT"
] | null | null | null | """Own implementation of a vector computations.
"""
from .cython_computations import _cython_clip_vector
from .cython_computations import _naive_cython_clip_vector
from .dtypes import Number
from .vector import VectorND
def python_clip_vector(vector_in: VectorND, min_value: Number, max_value: Number, vector_out: Vect... | 29.478261 | 110 | 0.698378 |
18110bc81bf3193f03c547c8ad24e6c4b059531a | 5,103 | py | Python | 01_Suchen/Loesungen/binaere_suche_V3.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | 01_Suchen/Loesungen/binaere_suche_V3.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | 01_Suchen/Loesungen/binaere_suche_V3.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | """
Aufgabe 02: Binäre Suche
a) Beschreibe in wenigen Sätzen, wie du in einem (großen) Speicher an
sortierten Dingen ein bestimmtes Ding findest.
Lösung:
Wiederhole, solange mehr als ein Dinge im betrachteten Speicher ist:
Nimm das Ding, das sich genau in der Mitte des betrachteten Speichers
... | 32.297468 | 92 | 0.666471 |
43f879b223514c72ddc28f2f8d487452687460be | 6,834 | py | Python | code/snake/GameData.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 1 | 2020-03-30T09:25:53.000Z | 2020-03-30T09:25:53.000Z | code/snake/GameData.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 2 | 2020-02-05T14:00:23.000Z | 2020-03-30T19:57:19.000Z | code/snake/GameData.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | null | null | null | import copy
import math
from Field import Field
class GameData:
def __init__(self):
self.snake_length: int = 0
self.head_x: int = 0
self.head_y: int = 0
self.direction: str = "o"
self.walldistance_n: int = 0
self.walldistance_e: int = 0
self.walldistance_s... | 36.545455 | 109 | 0.558531 |
c507fcfaa9d34e15c77ca78c7cb4f40434a50592 | 659 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/shareholder/shareholder.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/accounts/doctype/shareholder/shareholder.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/shareholder/shareholder.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.contacts.address_and_contact import load_address_and_contact, delet... | 31.380952 | 100 | 0.789074 |
b18a7d5d2c9324f60534b4d4b5ada439cbdf6c69 | 2,358 | py | Python | ciphey/basemods/Decoders/multi_tap.py | Marnick39/Ciphey | fc854ecf37b688832f25cdec094bcada739bfae3 | [
"MIT"
] | 2 | 2020-09-28T23:27:22.000Z | 2021-09-09T17:24:26.000Z | ciphey/basemods/Decoders/multi_tap.py | drpacket/Ciphey | b46e00c611ee4b5f5795e967a50b05a63cbb5ef0 | [
"MIT"
] | null | null | null | ciphey/basemods/Decoders/multi_tap.py | drpacket/Ciphey | b46e00c611ee4b5f5795e967a50b05a63cbb5ef0 | [
"MIT"
] | 1 | 2021-02-13T13:10:13.000Z | 2021-02-13T13:10:13.000Z | from typing import Optional, Dict, List
from ciphey.iface import ParamSpec, Config, T, U, Decoder, registry
@registry.register
class multiTap(Decoder[str, str]):
def decode(self, ctext: str) -> Optional[str]:
decode_text = ""
for x in ctext.split():
if x == self.SPACE_DIGIT: # check ... | 26.2 | 79 | 0.603053 |
77426d43cf88ed9ad9275bdf2518d72f6dc84fda | 1,204 | py | Python | day47/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day47/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day47/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | import random
from flask import Flask
app = Flask(__name__)
number_to_guess = None
def text_style(style):
def decorator(func):
def wrapped_func(*args, **kwargs):
value = "<" + style + ">"
value += func(*args, **kwargs)
value += "</" + style + ">"
return val... | 28.666667 | 91 | 0.609635 |
0295baba97b13ad8c06e4a303b63802e83423548 | 3,877 | py | Python | 20-fs-ias-lec/groups/Demo_D/createlessfulldb.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/Demo_D/createlessfulldb.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/Demo_D/createlessfulldb.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import secrets
import nacl.signing
import hashlib
import nacl.encoding
from BACnetstuff import Event
from BACnetstuff import Content
from BACnetstuff import Meta
from BACnetstuff import pcap
SIGN_INFO = {'ed25519': 0, 'hmac_sha256': 1}
HASH_INFO = {'sha256': 0}
# Only save private key, get signing_key again and then g... | 33.713043 | 102 | 0.762703 |
02a20d809c291c0f782e2f6d0c141a0827e95e5d | 4,990 | py | Python | test/test_npu/test_network_ops/test_max_pool2d_with_indices.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_max_pool2d_with_indices.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_max_pool2d_with_indices.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 54.23913 | 148 | 0.577956 |
b8ac42f7830713a228dd8ec3acd6385286c4ac33 | 2,773 | py | Python | hist_db/main.py | apragacz/hist-db | a2631a7eab004499dae98a0495bc17ee78c6be8a | [
"MIT"
] | 1 | 2021-12-14T22:52:46.000Z | 2021-12-14T22:52:46.000Z | hist_db/main.py | apragacz/hist-db | a2631a7eab004499dae98a0495bc17ee78c6be8a | [
"MIT"
] | null | null | null | hist_db/main.py | apragacz/hist-db | a2631a7eab004499dae98a0495bc17ee78c6be8a | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
import argparse
import logging
import sys
import os.path
from functools import partial
from .config import load_config
logger = logging.getLogger(__name__)
FILE_LOG_FORMAT = "%(levelname).3s %(asctime)s %(name)s: %(message)s [%(filename)s:%(lin... | 31.873563 | 109 | 0.741435 |
a2a9e5afad13215e9973a8ae1a2de787425a1a84 | 137 | py | Python | aiotftp/__main__.py | JulianOrteil/aiotftp | 67026f2c43429ee2649d769188fb8121ded6be80 | [
"MIT"
] | null | null | null | aiotftp/__main__.py | JulianOrteil/aiotftp | 67026f2c43429ee2649d769188fb8121ded6be80 | [
"MIT"
] | null | null | null | aiotftp/__main__.py | JulianOrteil/aiotftp | 67026f2c43429ee2649d769188fb8121ded6be80 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Launch file of aiotftp."""
import sys
from . import main
if __name__ == '__main__':
sys.exit(main())
| 11.416667 | 29 | 0.591241 |
38f8b8c72e28bd0c6e8a3ae66269843f788b667c | 1,626 | py | Python | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalHostPairsParentsWidgetScript/RiskIQPassiveTotalHostPairsParentsWidgetScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalHostPairsParentsWidgetScript/RiskIQPassiveTotalHostPairsParentsWidgetScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalHostPairsParentsWidgetScript/RiskIQPassiveTotalHostPairsParentsWidgetScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
import traceback
from typing import Dict, Union, Any
def set_arguments_for_widget_view(indicator_data: Dict[str, Any]) -> Union[Dict[str, str], str]:
"""
Prepare argument for commands or message to set custom layout of indicator
"""
indicator_type = indicator_data... | 36.133333 | 117 | 0.630381 |
02608bc6e02d385f8e6b129526976c5274917875 | 402 | py | Python | Language Proficiency/Python/Strings/Alphabet Rangoli/rangoli.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Strings/Alphabet Rangoli/rangoli.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Strings/Alphabet Rangoli/rangoli.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import string
alphabet = string.ascii_lowercase
def print_rangoli(size):
# your code goes here
patterns = []
for i in range(n):
pattern = '-'.join(alphabet[i:n])
patterns.append((pattern[::-1]+pattern[1:]).center(4*n-3, '-'))
print('\n'.join(patterns[::-1]+patte... | 20.1 | 71 | 0.60199 |
e7ffb03ff606af3be44862efcadae422d7ecf940 | 476 | py | Python | app/master.py | mattiasgiese/squeezie | d01187952b1b9bc704337d6763d495fe966a6f99 | [
"MIT"
] | null | null | null | app/master.py | mattiasgiese/squeezie | d01187952b1b9bc704337d6763d495fe966a6f99 | [
"MIT"
] | null | null | null | app/master.py | mattiasgiese/squeezie | d01187952b1b9bc704337d6763d495fe966a6f99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from flask import Flask, jsonify, request, abort, render_template
app = Flask(__name__)
@app.route("/",methods=['GET'])
def index():
if request.method == 'GET':
return render_template('index.html')
else:
abort(400)
@app.route("/devices",methods=['GET'])
def devices():
if request.m... | 19.833333 | 65 | 0.655462 |
653c1ec7a7cda966551e88bfe2e8b83b9f4cf729 | 3,704 | py | Python | research/cv/metric_learn/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/metric_learn/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/metric_learn/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.26087 | 105 | 0.715983 |
33409cedc00a5cf3811599dd879abfdadd1144c6 | 68 | py | Python | hotspot/package/__init__.py | chenfei0328/faultLocalization | af03fd5f726549be7b3aa7aa1230592035d9bc40 | [
"Apache-2.0"
] | 13 | 2019-03-13T06:07:18.000Z | 2022-02-22T03:34:35.000Z | hotspot/code/package/__init__.py | FudanYuan/faultLocalization | 5133ee5af48f7d4c8ba05ef9a545139a38f417da | [
"Apache-2.0"
] | 1 | 2019-03-28T12:05:12.000Z | 2019-03-28T12:05:12.000Z | hotspot/package/__init__.py | chenfei0328/faultLocalization | af03fd5f726549be7b3aa7aa1230592035d9bc40 | [
"Apache-2.0"
] | 4 | 2019-03-13T06:07:32.000Z | 2019-06-11T11:35:52.000Z |
from .utils import *
from .HotSpot import *
__version__ = '0.8.0'
| 11.333333 | 22 | 0.676471 |
68aa5abf8b1ed71878bf172d5645dac0c97e119f | 13,846 | py | Python | Utils.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | null | null | null | Utils.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | 5 | 2020-01-18T21:10:46.000Z | 2020-01-25T20:58:19.000Z | Utils.py | Berserker66/ALttPEntranceRandomizer | 9c681cc65d7281ccded03484b050e8f80ea65dc6 | [
"MIT"
] | 2 | 2020-01-18T17:36:50.000Z | 2020-01-22T16:52:08.000Z | from __future__ import annotations
import typing
def tuplize_version(version: str) -> typing.Tuple[int, ...]:
return Version(*(int(piece, 10) for piece in version.split(".")))
class Version(typing.NamedTuple):
major: int
minor: int
micro: int
__version__ = "4.1.3"
_version_tuple = tuplize_version... | 32.966667 | 116 | 0.605157 |
041261d803bde893ed4e28a8ff3f1318c7b60871 | 2,282 | py | Python | src/onegov/server/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/server/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/server/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import inspect
from onegov.server import errors
class CachedApplication(object):
""" Wraps an application class with a configuration, returning a new
instance the first time `get()` is called and the same instance very
time after that.
"""
def __init__(self, application_class, namespace, config... | 30.426667 | 78 | 0.635408 |
043e4a49b92e119dba7f4ba036cc67f16c7f3cb0 | 755 | py | Python | packages/watchmen-auth/src/watchmen_auth/auth_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-auth/src/watchmen_auth/auth_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-auth/src/watchmen_auth/auth_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Callable, List
from watchmen_model.admin import UserRole
from .authentication import AuthenticationManager
from .authorization import Authorization
from .principal_service import PrincipalService
def authorize_token(
authentication_manager: AuthenticationManager,
scheme: str, token: str,
rol... | 32.826087 | 101 | 0.817219 |
9bdfce0572874b6704774bbfffd1e706acfdbfd0 | 1,763 | py | Python | server/data/address_store.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | server/data/address_store.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | server/data/address_store.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | """
A class to facilitate storing and retrieving data.
"""
import server.mongo_helpers as db
from server.maps_api import get_coordinates, google_api_key
COLLECTION_NAME = 'locations'
MAPPING_KEY = 'mapping'
class AddressStore:
def __init__(self) -> None:
"""
Initializes the class.
"""
... | 29.881356 | 92 | 0.660805 |
50133428c9c576bc4e234a6c10747adba294f222 | 5,634 | py | Python | pyScript_ui_stuff/ui_class.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_ui_stuff/ui_class.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_ui_stuff/ui_class.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'class_new.ui'
##
## Created by: Qt User Interface Compiler version 5.14.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################... | 48.991304 | 104 | 0.725062 |
502a632758ac9799b6bec3f0d4c078758cae89e4 | 2,272 | py | Python | verto/processors/GlossaryLinkPattern.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/processors/GlossaryLinkPattern.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/processors/GlossaryLinkPattern.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from markdown.inlinepatterns import Pattern
from verto.processors.utils import parse_arguments
from verto.utils.HtmlParser import HtmlParser
import re
class GlossaryLinkPattern(Pattern):
'''Return a glossary link element from the given match
Matches:
{glossary-link term="super-serious-term"}Super Ser... | 35.5 | 100 | 0.635563 |
aca5c7f220fc9a91fc48778eed58b3d7341ade18 | 6,158 | py | Python | .vscode/extensions/ms-vscode.cpptools-1.9.0/debugAdapters/lldb/lib/python2.7/site-packages/lldb/diagnose/diagnose_nsstring.py | Kvahn-ui/dotfiles | 3f1364410f5bebcaacca6ae38a8e5fbb9bb51285 | [
"MIT"
] | 3 | 2016-02-10T14:18:40.000Z | 2018-02-05T03:15:56.000Z | .vscode/extensions/ms-vscode.cpptools-1.9.0/debugAdapters/lldb/lib/python2.7/site-packages/lldb/diagnose/diagnose_nsstring.py | Kvahn-ui/dotfiles | 3f1364410f5bebcaacca6ae38a8e5fbb9bb51285 | [
"MIT"
] | 4 | 2019-06-16T09:52:03.000Z | 2019-08-18T02:11:35.000Z | .vscode/extensions/ms-vscode.cpptools-1.9.0/debugAdapters/lldb/lib/python2.7/site-packages/lldb/diagnose/diagnose_nsstring.py | Kvahn-ui/dotfiles | 3f1364410f5bebcaacca6ae38a8e5fbb9bb51285 | [
"MIT"
] | null | null | null | # This implements the "diagnose-nsstring" command, usually installed in the debug session like
# command script import lldb.diagnose
# it is used when NSString summary formatter fails to replicate the logic that went into LLDB making the
# decisions it did and providing some useful context information that can be us... | 36.011696 | 200 | 0.712894 |
c5aad74a91aecf95f28fb6952e73d8b8d93a4c4d | 2,099 | py | Python | src/bo4e/bo/energiemenge.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/bo/energiemenge.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/bo/energiemenge.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Energiemenge class
and corresponding marshmallow schema for de-/serialization
"""
from typing import List
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt, GeschaeftsobjektSchema
from bo4e.com.ve... | 36.824561 | 178 | 0.762744 |
a86c0d119aa6ad9d4634d967de013f7aa51082d3 | 832 | py | Python | PMIa/2014/KHASANOVA_I_F/task_4_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/KHASANOVA_I_F/task_4_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/KHASANOVA_I_F/task_4_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 4. Вариант 30.
# Напишите программу, которая выводит имя, под которым скрывается Вильгельм
# Аполлинарий Костровицкий. Дополнительно необходимо вывести область
# интересов указанной личности, место рождения, годы рождения и смерти (если
# человек умер), вычислить возраст на данный момент (или момент смерти). П... | 34.666667 | 97 | 0.780048 |
a87adc6725570fd58e9c2146a8f50af41ae46983 | 14,281 | py | Python | scripts/signal_marker_processing/parcel_data_sources.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/signal_marker_processing/parcel_data_sources.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/signal_marker_processing/parcel_data_sources.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).
# Authors : Daniele Borio, Fernando Urbano, Csaba WIRNHARDT
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import geopandas as gpd
import num... | 33.602353 | 184 | 0.591695 |
4fedbc1d5899aaed56a71d411f07e41eca09cd0a | 2,914 | py | Python | Kamele_beladen.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Kamele_beladen.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Kamele_beladen.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Kamele beladen
https://www.programmieraufgaben.ch/aufgabe/kamele-beladen/6gddr4zm
"""
# Programmieraufgabe:
# Ein Kamel soll optimal beladen werden. Das Kamel kann maximal 270 kg tragen.
# Aktuell sind Waren mit den folgenden Gewichten zu transportieren: 5, 1... | 39.917808 | 88 | 0.685312 |
8cf3b68999d0bc950d57909eb236a4406d7ae293 | 1,605 | py | Python | Hackerrank_problems/counting_valleys/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/counting_valleys/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/counting_valleys/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z |
# Importing the required Libraries
import math
import os
import random
import re
import sys
# Fuction For Counting the Valleys Traversed. Takes the number of steps(n) and The path(s[D/U]). Returns the Number.
def countingValleys(n, s):
count = 0
number_of_valleys = 0 # Initialized Variables... | 39.146341 | 126 | 0.611215 |
8cfc815730dd2b2e6b7cd702688519638db97393 | 2,351 | py | Python | StationaryWaveletPic.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-03-28T11:50:45.000Z | 2020-12-08T13:36:26.000Z | StationaryWaveletPic.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-04-20T11:12:59.000Z | 2020-05-11T05:37:36.000Z | StationaryWaveletPic.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | null | null | null |
from IProcess import IProcess, EDataType
from PIL import Image
import pywt
import pywt.data
class StationaryWaveletPic(IProcess):
def __init__(self, waveletMode='bior1.3', level=1):
IProcess.__init__(self)
# See: https://pywavelets.readthedocs.io/en/latest/regression/wavelet.html
waveletFamilyValidated = Fa... | 30.532468 | 99 | 0.721821 |
2cf9a4040bdb38970d6af1f2677a16fb61f7ec9e | 34,861 | py | Python | personen.py | MaliziaGrimm/Lohnvorerfassung-50a-fuer-DATEV | 41b99deacc5bfee6562907de109a8ad5af917d01 | [
"MIT"
] | null | null | null | personen.py | MaliziaGrimm/Lohnvorerfassung-50a-fuer-DATEV | 41b99deacc5bfee6562907de109a8ad5af917d01 | [
"MIT"
] | null | null | null | personen.py | MaliziaGrimm/Lohnvorerfassung-50a-fuer-DATEV | 41b99deacc5bfee6562907de109a8ad5af917d01 | [
"MIT"
] | null | null | null | from flask import Flask
from flask import request
import os, time
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, Text, MetaData, Table, DATE
from sqlalchemy.sql import select, update
import datenbank_obj, funktionen
import numpy as np
... | 65.160748 | 251 | 0.581567 |
fa37f5e38741402b6a592ea930932d202e6b8ce3 | 385 | py | Python | pocketthrone/entities/region.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | 4 | 2016-06-05T16:48:04.000Z | 2020-03-23T20:06:06.000Z | pocketthrone/entities/region.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | pocketthrone/entities/region.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | class Region:
# parent city
capital = None
# name
name = "No Man's Land"
name_de = "Niemandland"
# tiles
tiles = []
def __init__(self, capital, radius=3, name=None):
self.capital = capital
if name:
self.name = name
else:
self.name = self.get_default_name()
def get_default_name(self):
capital_... | 17.5 | 50 | 0.677922 |
d704c077bdf4cf3372fd9f3d057030ce87216d93 | 437 | py | Python | quick_start/quickstart/permissions.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | quick_start/quickstart/permissions.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | quick_start/quickstart/permissions.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import sys
from rest_framework import permissions
class IsOwnerOrReadOnly(permissions.BasePermission):
"""
自定义权限只允许对象的所有者编辑它。
"""
def has_object_permission(self, request, view, obj):
# 读取权限允许任何请求,
# 所以我们总是允许GET,HEAD或OPTIONS请求。
if request.method in permis... | 24.277778 | 56 | 0.663616 |
d1135b258da4bb49b4f97f05c3fc1826e33babff | 1,196 | py | Python | google_places_popularity/coords_to_kreis.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | google_places_popularity/coords_to_kreis.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | google_places_popularity/coords_to_kreis.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | #To run this file you NEED
#pip install Rtree AND
#sudo apt-get update && apt-get install -y libspatialindex-dev OR brew install spatialindex
import geopandas.tools
from shapely.geometry import Point
import pandas as pd
countries = geopandas.GeoDataFrame.from_file(
"https://raw.githubusercontent.com/AliceWi/TopoJSO... | 31.473684 | 117 | 0.713211 |
7eb170ca18a2c62deb7af763e50e3061c446bf50 | 1,760 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_18_Maus_und_Tastatur_steuern/04_auto_form.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_18_Maus_und_Tastatur_steuern/04_auto_form.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_18_Maus_und_Tastatur_steuern/04_auto_form.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 04_auto_form.py
# In dieser Übung geht es darum ein Forumlar automatisch mit unterschiedlichen Daten auszufüllen
import pyautogui, os, webbrowser, time, logging
from random import randint as rng
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
os.chdir(os.path.dirname(__f... | 40 | 202 | 0.688068 |
7d4309e32cfb253a338dca45f81440927a4cec87 | 1,115 | py | Python | src/gvz/migrations/0010_auto_20210425_1327.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 7 | 2021-04-24T19:11:15.000Z | 2021-10-30T12:59:16.000Z | src/gvz/migrations/0010_auto_20210425_1327.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 10 | 2021-04-25T10:25:12.000Z | 2021-04-26T17:55:20.000Z | src/gvz/migrations/0010_auto_20210425_1327.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2 on 2021-04-25 13:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gvz', '0009_auto_20210425_0937'),
]
operations = [
migrations.AddIndex(
model_name='administrativedivision',
index=mod... | 32.794118 | 100 | 0.6287 |
3897dfe58007cf9d7f6c1f811605ee6bb64d4b85 | 1,010 | py | Python | analysis/roi.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 794 | 2018-09-06T07:38:41.000Z | 2022-03-16T06:30:37.000Z | analysis/roi.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 111 | 2018-12-04T11:18:27.000Z | 2022-03-31T07:39:11.000Z | analysis/roi.py | JasperMorrison/PytorchToCaffe | 04f0066cdc8a9da92591d7361907c3ea53271707 | [
"MIT"
] | 221 | 2018-11-22T08:11:03.000Z | 2022-03-16T07:11:43.000Z | import numpy as np
from .blob import Blob
from .layers import Base
class Flatten(Base):
def __init__(self,input, name='permute'):
super(Flatten, self).__init__(input, name)
dim=[np.prod(input.data.shape)]
self.out = Blob(dim, self)
class PSROIPool(Base):
def __init__(self,input,rois,o... | 33.666667 | 77 | 0.663366 |
aa97d6c5afdc149760b5dfef5c86e12ccb026baa | 1,619 | py | Python | src/tango_sdp_subarray/setup.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/setup.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/setup.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PIP setup script for the SDP Subarray Device package."""
# pylint: disable=exec-used
import os
from setuptools import setup
RELEASE_INFO = {}
RELEASE_PATH = os.path.join('SDPSubarray', 'release.py')
exec(open(RELEASE_PATH).read(), RELEASE_INFO)
with open('README.pypi... | 26.540984 | 61 | 0.617665 |
2d4c3809294d772964cda02c512f440c91439016 | 480 | py | Python | check_copynumber.py | YueYvetteHao/Sandbox | db2b8b0e751bfb7d86e7f2506fb81a75f8c3a3e5 | [
"MIT"
] | null | null | null | check_copynumber.py | YueYvetteHao/Sandbox | db2b8b0e751bfb7d86e7f2506fb81a75f8c3a3e5 | [
"MIT"
] | null | null | null | check_copynumber.py | YueYvetteHao/Sandbox | db2b8b0e751bfb7d86e7f2506fb81a75f8c3a3e5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Check copy number
import sys
Copynumber = {}
filename = sys.argv[1]
file = open(filename, 'r')
for line in file:
line = line.rstrip("\n")
array = line.split("\t")
if array[1][0:4] not in Copynumber:
Copynumber[array[1][0:4]] = 1
else:
Copynumber[array[1][0:4]] += 1
file.close()
cn = 0
... | 17.777778 | 53 | 0.63125 |
93226421366fb67f18712a85fb2521bb7b16655b | 2,317 | py | Python | official/cv/srcnn/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2021-07-08T13:10:42.000Z | 2021-11-08T02:48:57.000Z | official/cv/srcnn/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/srcnn/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... | 41.375 | 100 | 0.698317 |
9356436d61d9d7d69d507040156e95b4e42175ee | 9,088 | py | Python | src/server/db/ParticipationMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/db/ParticipationMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/db/ParticipationMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | import mysql.connector
from server.bo.Participation import Participation
from server.db.Mapper import Mapper
class ParticipationMapper(Mapper):
"""This is a mapper-class, which represents particpation objects into
a relational database. For this reason you can find some methods,
which help to find, insert,... | 38.184874 | 170 | 0.6568 |
e20207d4b6d07339c6cdbc84e6ac8362cb11850b | 426 | py | Python | 2-resources/__CHEAT-SHEETS/cheatsheets-master/cheatsheets-master/aws-python/ec2/examples/ec2_list_instances.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 103 | 2019-08-30T10:04:40.000Z | 2022-03-30T22:14:44.000Z | 2-resources/__CHEAT-SHEETS/cheatsheets-master/cheatsheets-master/aws-python/ec2/examples/ec2_list_instances.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 6 | 2021-04-08T08:36:27.000Z | 2021-10-01T07:47:17.000Z | 2-resources/__CHEAT-SHEETS/cheatsheets-master/cheatsheets-master/aws-python/ec2/examples/ec2_list_instances.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 51 | 2019-06-10T06:11:46.000Z | 2022-03-30T16:33:05.000Z | import boto3
profile_name = ''
region_name = ''
ec2 = boto3.Session(profile_name=profile_name, region_name=region_name).client('ec2')
instances = ec2.instances.filter(
Filters=[
{'Name': 'instance-state-name', 'Values': ['running']},
{'Name': 'tag-key', 'Values': ['my-instance-group-name']}
]
... | 26.625 | 85 | 0.683099 |
3576793a198aed4d5aa6e0de6e8a2887b0838bae | 9,959 | py | Python | SequentialBayesianRegression/sequential_bayesian_linear_regression.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | null | null | null | SequentialBayesianRegression/sequential_bayesian_linear_regression.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-02-11T23:44:52.000Z | 2021-02-11T23:44:52.000Z | SequentialBayesianRegression/sequential_bayesian_linear_regression.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:02:23.000Z | 2021-12-16T01:02:23.000Z | # %% [markdown]
# # Bayesian Linear Regression
# In this post I talk about reformulating linear regression in a Bayesian framework.
# This gives us the notion of epistemic uncertainty which allows us to generate probabilistic model predictions.
# I formulate a model class which can perform linear regression via Bayes r... | 35.315603 | 154 | 0.705392 |
35cf2f0c7af566dff3e39cc7456558c64116c8e3 | 24,271 | py | Python | tests/testdummy.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | tests/testdummy.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | tests/testdummy.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import io
from datetime import datetime
from os import path as osp
from dotmap import DotMap
import pandas as pd
import matplotlib.pyplot as plt
from flask import Response
from sqlalchemy import MetaData
from safrs import jsonapi_rpc
from isp.mpdf import PdfGenerator
from isp.config import... | 36.663142 | 306 | 0.468872 |
17f5210bed072d404bdffdeca9db76467d8b21cd | 1,965 | py | Python | display/main.py | HackYourOffice/monitoring-with-intelligence | 9ae3226e2b4e87d21d764c33c4bb6e621892be1b | [
"Unlicense"
] | 2 | 2017-11-17T15:14:11.000Z | 2017-11-17T23:04:39.000Z | display/main.py | HackYourOffice/monitoring-with-intelligence | 9ae3226e2b4e87d21d764c33c4bb6e621892be1b | [
"Unlicense"
] | null | null | null | display/main.py | HackYourOffice/monitoring-with-intelligence | 9ae3226e2b4e87d21d764c33c4bb6e621892be1b | [
"Unlicense"
] | null | null | null | ##
# @filename : main.cpp
# @brief : 2.13inch e-paper display demo
# @author : Yehui from Waveshare
#
# Copyright (C) Waveshare September 9 2017
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "S... | 30.703125 | 80 | 0.716031 |
17fad58163a5db5bed534d14382500c5de3df583 | 9,321 | py | Python | spht/jobs.py | consbio/spht | 96ec6a0931851b33eace08720d4d18ab34775a52 | [
"BSD-2-Clause"
] | 1 | 2019-08-04T21:13:41.000Z | 2019-08-04T21:13:41.000Z | spht/jobs.py | consbio/spht | 96ec6a0931851b33eace08720d4d18ab34775a52 | [
"BSD-2-Clause"
] | 23 | 2018-04-12T20:43:15.000Z | 2022-02-10T12:10:53.000Z | spht/jobs.py | consbio/spht | 96ec6a0931851b33eace08720d4d18ab34775a52 | [
"BSD-2-Clause"
] | null | null | null | import asyncio
import math
import os
from asyncio import ensure_future
from base64 import b64encode
from io import BytesIO
from uuid import uuid4
import aiohttp
import mercantile
import numpy
from PIL import Image
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.ti... | 40.176724 | 131 | 0.632657 |
354b19c6631cb33d74f09478161887cd8b15aaa0 | 537 | py | Python | data_tests/saved__backend__py3.9/cython/block_fluidsim.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__py3.9/cython/block_fluidsim.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__py3.9/cython/block_fluidsim.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | try:
import cython
except ImportError:
from transonic_cl import cython
def rk2_step0(state_spect_n12, state_spect, tendencies_n, diss2, dt):
# transonic block (
# complex128[][][] state_spect_n12, state_spect,
# tendencies_n;
# float64[][] diss2;
# float d... | 23.347826 | 82 | 0.614525 |
dc8a1a4a0ca3871b06fe26268bde59f7f5aed3fc | 319 | py | Python | utils/class_utils.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | utils/class_utils.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | utils/class_utils.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | import importlib
def get_cls_from_path(path):
"""
:param path: str, eg: "agents.dgn.DGNAgent"
:return: class, eg: agents.dgn.DGNAgent
"""
pkg = ".".join(path.split(".")[:-1])
cls_name = path.split(".")[-1]
cls_object = getattr(importlib.import_module(pkg), cls_name)
return cls_object
| 24.538462 | 64 | 0.630094 |
52861891aa021e454fcecda58e7513fb64672738 | 3,319 | py | Python | src/classifier/torch_helpers/regard_classifier.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/classifier/torch_helpers/regard_classifier.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/classifier/torch_helpers/regard_classifier.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | import torch
import torch.nn as nn
import pytorch_lightning as pl
from torch.nn import functional as F
from pytorch_lightning.metrics.functional import accuracy, f1
class RegardClassifier(pl.LightningModule):
def __init__(self, n_embed, n_hidden_lin, n_output, lr, weight_vector, drop_p):
super(RegardClass... | 39.047059 | 83 | 0.636939 |
876e37cbc9fbc4b4b1e0fc74c49e9d3d9516105c | 498 | py | Python | tag_1/p_2_1_sortiere_zwei_zahlen.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_2_1_sortiere_zwei_zahlen.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_2_1_sortiere_zwei_zahlen.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
2 If-Abfragen (Tag 1)
2.1 Sortiere zwei vorher festgelegte Zahlen nach Größe und gib sie in der richtigen Reighenfolge aus.
"""
from hilfprogramme import float_number_input
if __name__ == '__main__':
print('Vergleich von zwei Zahlen a und b und Ausgabe in aufsteigender Reihenfolge.')
a = float_number_input... | 29.294118 | 101 | 0.644578 |
0d713011556e3125201af80431694103357e0a8b | 397 | py | Python | exercises/de/test_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
'spacy.load("en_core_web_md")' in __solution__
), "Lädst du das mittelgroße Modell?"
assert "doc[1].vector" in __solution__, "Greifst du auf den richtigen Vector zu?"
__msg__.good(
"Bravo! In der nächsten Übung wirst du spaCy benutzen, um mithilfe von "
"Wort... | 39.7 | 85 | 0.677582 |
df7d9d33692efdf51c05302dd241a129737a9368 | 419 | py | Python | Shivani/old.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/old.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/old.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | age1 = int(input("enter age\n"))
age2 = int(input("enter age\n"))
age3 = int(input("enter age\n"))
age4 = int(input("enter age\n"))
if(age1>age2 and age1>age3 and age1>age4):
print(age1,"year old is oldest")
elif(age2>age1 and age2>age3 and age2>age4):
print(age2,"year old is oldest")
elif(age3>age1 and age3>ag... | 32.230769 | 44 | 0.677804 |
d502876b3434ad46b03fc78e5b8130768cbccaed | 1,608 | py | Python | Python/plotCoefficientsConvergence.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | 1 | 2019-02-11T00:45:37.000Z | 2019-02-11T00:45:37.000Z | Python/plotCoefficientsConvergence.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | Python/plotCoefficientsConvergence.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | import numpy as np
import math
import string
import matplotlib
import matplotlib.pyplot as plt
class plotCoefficientsConvergence(object):
#Plot Cl vs Alpha graph
def __init__(self , npIterations, npConvergenceCl, npConvergenceCd, npConverenceCmx, npConverenceCmy, npConverenceCmz):
print("plotC... | 48.727273 | 124 | 0.622512 |
1d25676ef78ee66b58673517fc19e736944c1cf9 | 157 | py | Python | Contests/CCC/CCC '08 J1 - Body Mass Index.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '08 J1 - Body Mass Index.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '08 J1 - Body Mass Index.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | w = float(input())
h = float(input())
b = w/(h*h)
if b > 25:
print("Overweight")
elif b < 18.5:
print("Underweight")
else:
print("Normal weight") | 17.444444 | 26 | 0.579618 |
988b25a8daae4c1befb0a111b10007a7d0035046 | 158 | py | Python | hausse/lib/__init__.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | hausse/lib/__init__.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | hausse/lib/__init__.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | from .element import Element
from .plugin import LayoutPlugin, PathPlugin, Plugin, SelectorPlugin
from .project import Project
from .selector import Selector
| 31.6 | 68 | 0.835443 |
63da89712c82ff22414f954b652fe329626d076a | 103 | py | Python | 20-fs-ias-lec/groups/06-longFi/localEther/split.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/06-longFi/localEther/split.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/06-longFi/localEther/split.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z |
def split_data(data):
data = [data[i:i+1500] for i in range(0, len(data), 1500)]
return data | 17.166667 | 62 | 0.621359 |
143387e3ea15c1574a7d06ce571525e85fedaba0 | 23,314 | py | Python | src/onegov/org/views/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import re
import transaction
from collections import namedtuple, defaultdict
from onegov.core.security import Public, Private, Secret
from onegov.core.utils import render_file
from onegov.directory import Directory
from onegov.directory import DirectoryCollection
from onegov.directory import DirectoryEntry
from onegov... | 32.470752 | 79 | 0.619799 |
d30c991c03e2d6206b3de3a8da256f9e70792562 | 592 | py | Python | example.py | SConaway/py-FakeRobot | c27a9da922ab8402a46d1718047c9d36025bbbe5 | [
"MIT"
] | 1 | 2021-04-21T17:13:49.000Z | 2021-04-21T17:13:49.000Z | example.py | SConaway/py-FakeRobot | c27a9da922ab8402a46d1718047c9d36025bbbe5 | [
"MIT"
] | null | null | null | example.py | SConaway/py-FakeRobot | c27a9da922ab8402a46d1718047c9d36025bbbe5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Import FakeRobot
from FakeRobot import FakeRobot
# Create Robot
robot = FakeRobot()
# Set speed of robot. Speed is between 1 and 100
robot.speed = 2
# Turn robot by x degrees.
robot.turn(45)
# Alternatively,
# robot.set_heading(-34)
# to set an absolute heading
# Mov... | 17.939394 | 48 | 0.726351 |
4ce3b8d77b14bbad719c326b6627148753ccf52a | 308 | py | Python | Problems/Dynamic Programming/Medium/CountSortedVowelStrings/test_count_sorted_vowel_strings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Dynamic Programming/Medium/CountSortedVowelStrings/test_count_sorted_vowel_strings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Dynamic Programming/Medium/CountSortedVowelStrings/test_count_sorted_vowel_strings.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from count_sorted_vowel_strings import countVowelStrings
class Test(TestCase):
def test_count_vowel_strings(self):
self.assertTrue(countVowelStrings(1) == 5)
self.assertTrue(countVowelStrings(2) == 15)
self.assertTrue(countVowelStrings(33) == 66045) | 38.5 | 56 | 0.753247 |
2c3aa09961cc69dfb374bb6788d8c740492039b5 | 3,281 | py | Python | virus-master/anvima.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | virus-master/anvima.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | virus-master/anvima.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # uncompyle6 version 3.3.4
# Python bytecode 2.7
# Decompiled from: Python 2.7.16 (default, Apr 14 2019, 17:57:24)
# [GCC 4.2.1 Compatible Android (5058415 based on r339409) Clang 8.0.2 (https://a
# Embedded file name: <s>
import os, sys
R = '\x1b[1;31m'
N = '\x1b[0m'
Y = '\x1b[1;33m'
G = '\x1b[1;37m'
print '%s+------... | 57.561404 | 244 | 0.486437 |
2c601ef70981f1365c2eb8f62adbbfdce83da1dd | 452 | py | Python | python/magic_method/call.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/magic_method/call.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/magic_method/call.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class MyClass(object):
def __init__(self, var_one, var_two, var_three):
self.var_1 = var_one
self.var_2 = var_two
self.var_3 = var_three
def __call__(self, *vars):
self.var_1, self.var_2 = vars
if __name__ == '__main__':
obj = MyClass(1, 2, 3)
print(obj.__dict__)
... | 20.545455 | 52 | 0.595133 |
46ca5a2b1d27d2c46f4bf3e7a29fdce6115b2f6c | 92 | py | Python | 2014/08/men-labor-force-participation/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/08/men-labor-force-participation/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/08/men-labor-force-participation/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '19kL2pMrwjcwYXc_xuQZd11qjU-YciW9NW6llaKckzP0'
| 23 | 68 | 0.836957 |
649754da95e338a2690f924bbd3b98a5de3a3a02 | 2,059 | py | Python | python/bc/handle_citation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/bc/handle_citation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/bc/handle_citation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | """
Parse DOI information from entries in a json file and print all formatted DOI
citations to the command line.
"""
import argparse
import json
from datetime import date
from typing import Dict, Any
def citation_info(item: Dict[str, Any]) -> (str, str):
"""
Parse citation information from a dict item and re... | 33.209677 | 94 | 0.628946 |
64c2d167982cc37094b5d291f0c29f65042a8796 | 4,240 | py | Python | python/en/archive/dropbox/sagemaker_hyperparametertuning/cnn_fashion_mnist.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/sagemaker_hyperparametertuning/cnn_fashion_mnist.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/sagemaker_hyperparametertuning/cnn_fashion_mnist.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | import os
import tensorflow as tf
from tensorflow.python.estimator.model_fn import ModeKeys as Modes
from sagemaker_tensorflow import PipeModeDataset
from tensorflow.contrib.data import map_and_batch
INPUT_TENSOR_NAME = 'inputs'
SIGNATURE_NAME = 'predictions'
PREFETCH_SIZE = 10
BATCH_SIZE = 256
NUM_PARALLEL_... | 35.333333 | 109 | 0.652594 |
b3c60eb6c1b6f7afe543af27b8dbd1a46b35335f | 501 | py | Python | src/onegov/user/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.user.forms.group import UserGroupForm
from onegov.user.forms.login import LoginForm
from onegov.user.forms.registration import RegistrationForm
from onegov.user.forms.reset_password import PasswordResetForm
from onegov.user.forms.reset_password import RequestPasswordResetForm
from onegov.user.forms.signup_l... | 31.3125 | 69 | 0.806387 |
ff0178e0e91e66269fcb0b963693a796b730337f | 418 | py | Python | flat_world/flatWorld.py | Devoxx4KidsDE/workshop-minecraft-modding-raspberry-pi | 7fcae0e43de51843565c2403fa66da26cb79a04b | [
"MIT"
] | 3 | 2016-02-29T09:22:05.000Z | 2018-05-16T23:10:38.000Z | flat_world/flatWorld.py | Devoxx4KidsDE/workshop-minecraft-modding-raspberry-pi | 7fcae0e43de51843565c2403fa66da26cb79a04b | [
"MIT"
] | 3 | 2016-01-20T20:58:28.000Z | 2017-02-06T08:28:30.000Z | flat_world/flatWorld.py | Devoxx4KidsDE/workshop-minecraft-modding-raspberry-pi | 7fcae0e43de51843565c2403fa66da26cb79a04b | [
"MIT"
] | 3 | 2016-01-20T20:02:57.000Z | 2021-03-10T20:21:59.000Z | from mcpi import minecraft, block
import time
def flatWorld(mc, x, z):
mc.setBlocks(-10 + x,-10,-10 + z,10 + x,0,10 + z, block.GRASS.id)
mc.setBlocks(-10 + x,0,-10 + z,10 + x,35,10 + z, block.AIR.id)
mc = minecraft.Minecraft.create()
for xVal in range(-7, 7):
for zVal in range(-7, 7):
flatWorld... | 29.857143 | 69 | 0.574163 |
ff0d2e4d682f6ace60fe27826fb788b61e166d97 | 22,158 | py | Python | Packs/VirusTotal-Private_API/Integrations/VirusTotal-Private_API/VirusTotal-Private_API_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/VirusTotal-Private_API/Integrations/VirusTotal-Private_API/VirusTotal-Private_API_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/VirusTotal-Private_API/Integrations/VirusTotal-Private_API/VirusTotal-Private_API_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import importlib
import json
import demistomock as demisto
queued_response = {u'response_code': -2,
u'resource': u'YES_THIS_IS_A_UID',
u'scan_id': u'YES_THIS_IS_A_UID',
u'verbose_msg': u'Your resource is queued for analysis'}
def load_test_data(json_path):
... | 59.564516 | 123 | 0.581867 |
2fb8b63e365462c9bceaf91673fdc48be7fa13ff | 2,543 | py | Python | app/views/documents.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/documents.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/documents.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | import logging
from flask import request
from flask_login import login_required, current_user
from flask_restplus import Namespace, Resource, abort
from app.services import DocumentService
from .models.commons import paginate as paginate_parser
from .models.documents import document_input, document_output, documents_... | 33.025974 | 91 | 0.716083 |
2fff1aac2f7c52922f419a05ecf34112f4e2ecd0 | 884 | py | Python | tests/data/test_wrds_comp_fundq.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | tests/data/test_wrds_comp_fundq.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | tests/data/test_wrds_comp_fundq.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | import unittest
import pandas as pd
from frds.data.wrds.comp import Fundq
from frds.io.wrds import load
class FundqLoadTestCase(unittest.TestCase):
def setUp(self) -> None:
self.FUNDQ = load(Fundq, use_cache=False, save=False, obs=100)
def test_load_fundq(self):
self.assertIsInstance(self.FUN... | 28.516129 | 70 | 0.651584 |
6418086ea781b44d1e5fd5f59c1f48e6a8daa7e7 | 11,011 | py | Python | awsrun/common/configuration.py | eec289q-f21/stdsw | 93604a1b947e39496e6559982eea6d41c77d0204 | [
"MIT"
] | null | null | null | awsrun/common/configuration.py | eec289q-f21/stdsw | 93604a1b947e39496e6559982eea6d41c77d0204 | [
"MIT"
] | null | null | null | awsrun/common/configuration.py | eec289q-f21/stdsw | 93604a1b947e39496e6559982eea6d41c77d0204 | [
"MIT"
] | 1 | 2021-10-07T23:10:33.000Z | 2021-10-07T23:10:33.000Z | import os
import pathlib
import re
import uuid
from abc import ABC, abstractmethod
from datetime import datetime
from enum import Enum
import objectfactory
from aws import S3Handler, SqsHandler, subscribe, list_subscriptions, get_topic, create_or_get_topic, delete_topic, \
create_topic, AWSBackend
from common.res... | 27.665829 | 117 | 0.625465 |
444a9d1b96584a0a1ecf5cd673df5b72d45238a5 | 270 | py | Python | angstrom/2019/crypto/Half_and_Half/half_and_half.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2019/crypto/Half_and_Half/half_and_half.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2019/crypto/Half_and_Half/half_and_half.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from secret import flag
def xor(x, y):
o = ''
for i in range(len(x)):
o += chr(ord(x[i])^ord(y[i]))
return o
assert len(flag) % 2 == 0
half = len(flag)//2
milk = flag[:half]
cream = flag[half:]
assert xor(milk, cream) == '\x15\x02\x07\x12\x1e\x100\x01\t\n\x01"' | 18 | 67 | 0.6 |
2b8ec037049a830d8e96a9c8b4db42aec3ceede8 | 666 | py | Python | listings/chapter07/book1.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 6 | 2021-08-04T19:42:53.000Z | 2022-01-17T14:24:45.000Z | listings/chapter07/book1.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2021-08-30T06:32:08.000Z | 2021-08-30T06:42:46.000Z | listings/chapter07/book1.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2022-02-17T10:32:17.000Z | 2022-02-17T10:32:17.000Z | class Book:
# Konstruktor
def __init__(self, author, title, year):
self.author = author
self.title = title
self.year = year
# String-Darstellung
def __str__(self):
return "{author}: '{title}' ({year})".format(
author = self.author,
title = self.tit... | 24.666667 | 66 | 0.555556 |
7501c5536c68d7d2c7d4eb9323b4ce90714f079e | 4,275 | py | Python | calculator.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | calculator.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | calculator.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | 1 | 2020-09-30T18:53:05.000Z | 2020-09-30T18:53:05.000Z | from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.scrollview import ScrollView
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.config import Config
Config.set('graphics', 'resizable', 0)
Config.set('graphics', 'widt... | 22.5 | 70 | 0.639298 |
752df9d2482cb534c0fda0b82716c3115b5bfb1e | 410 | py | Python | Python/Exercícios_Python/056_maior_e_menor_da_sequência.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/056_maior_e_menor_da_sequência.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/056_maior_e_menor_da_sequência.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""056 - Maior e Menor da Sequência
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1-RmYLOW85mV31Tpi2dQ285vIwO3wR3tL
"""
pesos = [ ]
for p in range(0,5):
peso = float(input('Digite o peso: '))
pesos.append(peso)
print('... | 27.333333 | 77 | 0.682927 |
f35ac33f27a262f6c0ecc828a84cb27bdbd0a000 | 831 | py | Python | tests/onegov/fsi/test_cronjobs.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/test_cronjobs.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/test_cronjobs.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.fsi.collections.course_event import CourseEventCollection
from tests.onegov.org.common import get_cronjob_by_name, get_cronjob_url, \
get_mail
def test_send_reminder_mails(client_with_db, smtp):
app = client_with_db.app
session = app.session()
events = CourseEventCollection(session).get_p... | 34.625 | 79 | 0.742479 |
3402c5fdcc3a090925e1752051004e6dbbe914ed | 263 | py | Python | polls/views.py | Murphy-KS/MyTimeMashine | a1cd5b17b239a556b1d234aace9b333f71ec2045 | [
"MIT"
] | null | null | null | polls/views.py | Murphy-KS/MyTimeMashine | a1cd5b17b239a556b1d234aace9b333f71ec2045 | [
"MIT"
] | null | null | null | polls/views.py | Murphy-KS/MyTimeMashine | a1cd5b17b239a556b1d234aace9b333f71ec2045 | [
"MIT"
] | null | null | null | import imp
from django.http import HttpResponse
from django.shortcuts import render
from .models import Poll
def index(request):
context = {'umfragen': Poll.objects.all()}
return render(request=request, template_name='polls/index.html', context=context) | 29.222222 | 85 | 0.771863 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.