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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fd8db46922d7135b340c2afd1b37875c3701372b | 335 | py | Python | setup.py | shaneoc/dircheck | 4fd5d3943feb5e052f3b2beb0842b8e9f2c6fc7e | [
"MIT"
] | 1 | 2020-07-30T19:33:10.000Z | 2020-07-30T19:33:10.000Z | setup.py | shaneoc/dircheck | 4fd5d3943feb5e052f3b2beb0842b8e9f2c6fc7e | [
"MIT"
] | null | null | null | setup.py | shaneoc/dircheck | 4fd5d3943feb5e052f3b2beb0842b8e9f2c6fc7e | [
"MIT"
] | null | null | null | import sys
from distutils.core import setup
if sys.version_info[0] < 3 or sys.version_info[1] < 3:
sys.exit('Error: Python 3.3 or later required')
setup(name='dircheck',
version='0.1',
author="Shane O'Connell",
author_email='shane@oconnell.cc',
packages=['dircheck'],
scripts=['script... | 23.928571 | 54 | 0.656716 |
e36a0cb788601ed05ea887b2bbd05236ffbd68c2 | 3,987 | py | Python | build/pyinstaller/a.py | AlexandreMPDias/WinInstaller | c6f813ae460dca3f0a2f6a3346fe118f2ae97fe4 | [
"MIT"
] | null | null | null | build/pyinstaller/a.py | AlexandreMPDias/WinInstaller | c6f813ae460dca3f0a2f6a3346fe118f2ae97fe4 | [
"MIT"
] | null | null | null | build/pyinstaller/a.py | AlexandreMPDias/WinInstaller | c6f813ae460dca3f0a2f6a3346fe118f2ae97fe4 | [
"MIT"
] | null | null | null | # -*- mode: python -*-
block_cipher = None
MAIN_FILE = 'main'
"""
Name of your main script file
"""
project_path = 'C:\\Users\\tijuk\\Projects\\ads\\'
"""
Path to your Project. This sould contain your MAIN_FILE
"""
env_path = 'C:\\Users\\tijuk\\Envs\\ads\\'
"""
Path to your Python environment.
"""
... | 33.788136 | 112 | 0.606471 |
8b531eb86bbd2339f8cdf969e3ab7e539dbef512 | 5,199 | py | Python | slcySensors.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | slcySensors.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | slcySensors.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | # Python 3.5.1
import RPi.GPIO as GPIO
import slcypi.slcyDataStructures as DataStructures
import slcypi.slcyGeneral as General
import time
class UltrasonicSensor():
"""Initialize with list of GPIO pins according to:
pins <list> or <dict>, {'trig':1, 'echo':2}
[name] <str>, identify this sensor
[verbo... | 40.302326 | 116 | 0.582997 |
47f60682e00c0b7f90bfb8504d2ea3cd72178c4c | 668 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex06_array_min.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex06_array_min.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex06_array_min.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import sys
def min_rec(values):
# Integer-MAX_VALUE = sys.maxsize
return min_helper(values, 0, sys.maxsize)
def min_helper(values, pos, min_value):
# rekursiver Abbruch
if pos >= len(values):
return min_... | 19.085714 | 50 | 0.61976 |
9a375f8e1230cf9bf39d48b481d4c941ef805666 | 1,575 | py | Python | 数据结构/NowCode/18_EntryNodeOfLoop.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/18_EntryNodeOfLoop.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/18_EntryNodeOfLoop.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | # 链表中环的入口结点
# 给一个链表,若其中包含环,请找出该链表的环的入口结点,否则,输出null
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def EntryNodeOfLoop(self, pHead):
# 首先需要定义两个指针,其中一个快,跳两步,一个慢跳一步。
# 循环跳
# 要么是快的指针 为 none(没有环),要么是快慢指针相等(有环)。
if pHead == None:
... | 31.5 | 60 | 0.567619 |
d01943809dbb1164a1a7a6be576db94956c36286 | 977 | py | Python | RDS/circle2_use_cases/metadata/src/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle2_use_cases/metadata/src/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle2_use_cases/metadata/src/__init__.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import os
import logging
from RDS import Util as RDSUtil
from json import JSONEncoder, JSONDecoder
from connexion_plus import App, MultipleResourceResolver, Util
from jaeger_client import Config as jConfig
from jaeger_client.metrics.prometheus import PrometheusMetricsFactory
from gevent import monkey
monkey.patch_all(... | 26.405405 | 70 | 0.714432 |
ef0d53f5f2a1c936c9f7e2ff6823c753fd640f64 | 1,839 | py | Python | tintz/core/formfields.py | dcfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | 4 | 2016-05-06T20:52:42.000Z | 2018-11-18T08:29:33.000Z | core/formfields.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | 2 | 2021-03-19T21:51:51.000Z | 2021-06-10T18:22:50.000Z | core/formfields.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.forms import DateTimeField
from django.forms.widgets import DateTimeInput
from django.conf import settings
from django.utils.html import format_html
from django.utils.encoding import force_unicode
from django.utils.safe... | 32.839286 | 78 | 0.541055 |
32bf6d937ee45cc5d22812354290692ecdfd5535 | 1,907 | py | Python | books/PythonAutomate/webscrap/link_check.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/link_check.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/link_check.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """link_click.py - 링크확인
웹페이지의 URL이 주어지면 그 페이지에 링크된 모든 페이지를 다운로드
"""
import argparse
import os
import requests
from urllib import parse
from bs4 import BeautifulSoup
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("url", help="url path")
parser.add_argument("-d", "--dir", default="... | 27.242857 | 80 | 0.553225 |
3ed03fbc03086782ea2d6ec3fcdbb3a5b2af6b7a | 317 | py | Python | src/python/py-accepted/71A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/71A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/71A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 71A
# Created on : 2019-01-14 20:52:39
def Main():
n = int(input())
for i in range(0, n):
s = input()
if len(s) > 10:
s2 = s[0] + str(len(s) - 2) + s[-1]
print(s2)
else:
print(s)
if __name__ == '__main__':
Main()
| 17.611111 | 47 | 0.425868 |
f5c466e8d5b06ae148bd77f2acb8fc2aca0b57c3 | 2,096 | py | Python | tests/test_entry.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 6 | 2018-03-29T02:07:44.000Z | 2018-09-26T00:17:31.000Z | tests/test_entry.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 82 | 2018-04-01T08:53:59.000Z | 2018-09-28T23:45:05.000Z | tests/test_entry.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | null | null | null | """ Unit tests for entry objects """
import flask
from pony import orm
from publ import entry, model
from . import PublMock
def test_get_permissions():
""" Test the permissions on entry attributes """
app = PublMock()
# Test logged-out
with app.test_request_context('/'), orm.db_session():
... | 33.269841 | 87 | 0.638359 |
f5d38228e44543f22bd6967398e73ca3a7358b7c | 1,516 | py | Python | interface.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | interface.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | interface.py | tentacle-project/tentacle | 78aa1b9c6d25d964c1360cd05cd372505daedb34 | [
"MIT"
] | null | null | null | # coding: utf-8
from logging import info, critical
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
class Interface:
''' sensor mqtt interface '''
def __init__(self, hostname, port, sensor):
self.hostname = hostname self.port = port
self.sensor = sensor
self.sid ... | 28.074074 | 77 | 0.574538 |
5f0fe0de5a14b89ee8f23da28f0dc098e48cf527 | 145 | py | Python | oldp/apps/homepage/urls.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/homepage/urls.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/homepage/urls.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
app_name = 'homepage'
urlpatterns = [
url(r'^$', views.index_view, name='index'),
]
| 13.181818 | 47 | 0.668966 |
a0394739b5f6c7d975314309ee5a11944e2bc3ee | 1,100 | py | Python | NLTK_test/test.py | g-ghosh/Final-Thesis | 3f49bbb43bb1f67f927ba4d9c8887f4e3ada8ff0 | [
"MIT"
] | 1 | 2021-08-21T06:19:44.000Z | 2021-08-21T06:19:44.000Z | NLTK_test/test.py | Swastik1993/Final-Thesis | 86b809c7ffea5b6d456a57f38ff278e45ea82d9a | [
"MIT"
] | null | null | null | NLTK_test/test.py | Swastik1993/Final-Thesis | 86b809c7ffea5b6d456a57f38ff278e45ea82d9a | [
"MIT"
] | 1 | 2019-03-13T15:12:50.000Z | 2019-03-13T15:12:50.000Z | import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, sent_tokenize
stop_words = set(stopwords.words('english'))
# Dummy text
txt = "Sukanya, Rajib and Naba are my good friends. " \
"Sukanya is getting married next year. " \
"Marriage is a big step in one’s life." \
"It is both... | 30.555556 | 61 | 0.721818 |
cd309dea038c37acb73d70f7ce2631b27f2afdf5 | 895 | py | Python | day27/miles_to_km_convert.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day27/miles_to_km_convert.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day27/miles_to_km_convert.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | import tkinter as t
window = t.Tk()
window.title("Mile to Km Converter")
window.minsize(width=300, height=100)
window.config(padx=10, pady=10)
input = t.Entry(width=10)
input.insert(t.END, string="0")
input.grid(row=0, column=1, padx=(10, 1), pady=(5, 5))
label_miles = t.Label(text="Miles")
label_miles.grid(row=0, ... | 27.96875 | 63 | 0.672626 |
f86fc6ff3f42ddedb4d8fac0ce59752951ce7d6d | 3,710 | py | Python | app/models/abtms/Payment.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/abtms/Payment.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/abtms/Payment.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z | # encoding: utf-8
from gerencianet import Gerencianet
class Payment():
def create_transation(self, value=0):
credentials = {
'client_id': 'Client_Id_b566548b1a24e22fd6f0232c40eb95fb9e9b2a01',
'client_secret': 'Client_Secret_e0b31bb41de41041921819ed90c6d68fd201cd81',
'sa... | 28.106061 | 86 | 0.490566 |
90057b65f100bef1b1ac21788ab8aa2ed9f75a77 | 461 | py | Python | apps/utils/nets.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/utils/nets.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/utils/nets.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | import socket
from django.core.cache import cache
def get_host_ip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
ip = s.getsockname()[0]
finally:
s.close()
return ip
def get_host_ip_cache():
key = 'host_ip'
if key in cache... | 19.208333 | 60 | 0.590022 |
3958cb2158111ce9cd995d4684992e3f021aeea9 | 633 | py | Python | pyventskalender/tag07_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag07_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag07_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null |
def kuehe_machen_muehe(anzahl: int) -> str:
if anzahl == 0:
return "0 Kühe machen keine Mühe"
elif anzahl == 1:
return "1 Kuh macht Muh"
else:
return "{} Kühe machen {} mal Mühe".format(anzahl, anzahl)
def kuh_sinnsprueche(anzahl_min: int, anzahl_max: int) -> None:
"""
Gib ... | 33.315789 | 73 | 0.657188 |
f2dbb92bfdcf4e57c539deee4a5f86878d205132 | 1,518 | py | Python | lib/statics.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/statics.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/statics.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | from lib.services.config import get_const
# Color list for node types
COLOR_LIST = [(1.0, 0.8941176, 0.7686275),
(0.545098, 0.5372549, 0.5372549),
(1.0, 0.9803922, 0.8039216),
(0.9019608, 0.9019608, 0.9803922),
(0.1921569, 0.3098039, 0.3098039),
... | 37.02439 | 106 | 0.488142 |
f2ec73805d1155aa815c3fa6ce155722752f9e4d | 852 | py | Python | v703/python/totzeit.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v703/python/totzeit.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v703/python/totzeit.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
from uncertainties import ufloat
from scipy.stats import sem
import uncertainties.unumpy as unp
u, tt = np.genfromtxt('python/daten/totzeit.txt', unpack=True)
tt = tt*10**(-6)
ttmean = np.mean(tt)
ttsem = sem(tt)
ttm = ufloat(ttmean, ttsem)
print('ttm', ttm)
tt = tt/u
ttmean = np.mean(tt)
ttsem = ... | 19.363636 | 79 | 0.669014 |
0811a40d4ae24311b0060f626ae09a181a9dccea | 3,936 | py | Python | IdeaProjects/PandasProj/PandasCourse4.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | IdeaProjects/PandasProj/PandasCourse4.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | IdeaProjects/PandasProj/PandasCourse4.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import pandas as pd
import numpy as np
# 1.1 实验内容
#
# Pandas 是非常著名的开源数据处理工具,我们可以通过它对数据集进行快速读取、转换、过滤、分析等一系列操作。除此之外,Pandas 拥有强大的缺失数据处理与数据透视功能,可谓是数据预处理中的必备利器。这是 Pandas 使用教程的第 3 章节,将学会使用 Pandas 对数据进行选择与变换。
#
# 1.2 实验知识点
#
# 缺失值标记
# 缺失值填充
# 缺失值插值
# 二、认识缺失值
#
# 在真实的生产环境中,我们需要处理的数据文件往往没有想象中的那么美好。其中,很大几率会... | 26.24 | 278 | 0.731453 |
29981519ce9e91ce58e17f4c5d38db6f3eb67cd1 | 788 | py | Python | StarCTF/2021/web/oh-my-socket/source/webserver/webserver/app.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 91 | 2021-01-21T07:37:47.000Z | 2021-11-18T03:08:58.000Z | StarCTF/2021/web/oh-my-socket/source/webserver/webserver/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 2 | 2021-01-22T01:21:19.000Z | 2021-01-22T18:29:33.000Z | StarCTF/2021/web/oh-my-socket/source/webserver/webserver/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 13 | 2021-01-21T10:11:19.000Z | 2021-03-14T13:10:49.000Z | from flask import Flask, render_template, request
from subprocess import STDOUT, check_output
import os
app = Flask(__name__)
@app.route('/')
def index():
return open(__file__).read()
@app.route('/upload', methods=['GET', 'POST'])
def upload_file():
if request.method == 'GET':
return render_templat... | 23.878788 | 85 | 0.609137 |
d9bb178c74ec2e6e628930ab6e10532c29be9536 | 1,668 | py | Python | HackerEarth_problems/Paths in the Graph/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | HackerEarth_problems/Paths in the Graph/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | HackerEarth_problems/Paths in the Graph/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | import math
k = int(input())
#The Solution for this problem is simple
#consider the following edges 1--> 2 , 1-->3, 2 -->4, 3-->4, these edges create a square and this graph has 2 ways
# and if we add these edges 4-->5 , 4--> 6, 5-->7 , 6-->7 no of ways is doubled
#i.e adding three edges we can double the no of ways... | 26.47619 | 115 | 0.583933 |
d9c6ecd0fb7125e8c3e77c4d94224a2b4a167b22 | 4,169 | py | Python | lld/test/MachO/tools/generate-cfi-funcs.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | lld/test/MachO/tools/generate-cfi-funcs.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | lld/test/MachO/tools/generate-cfi-funcs.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | 1 | 2021-11-23T17:16:34.000Z | 2021-11-23T17:16:34.000Z | #!/usr/bin/env python
"""Generate skeletal functions with a variety .cfi_ directives.
The purpose is to produce object-file test inputs to lld with a
variety of compact unwind encodings.
"""
from __future__ import print_function
import random
import argparse
import string
from math import factorial
from itertools impo... | 30.210145 | 91 | 0.669705 |
0a3867b1fe35069477fb78e040dcb5e2fa986f4d | 1,012 | py | Python | WeChatTools/app/routes.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/app/routes.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/app/routes.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
# python35
from flask import request, url_for
from app import app
import time
@app.route('/')
@app.route('/index')
def index():
return "Hello, World!"
@app.route('/recieve', methods=['get', 'post'])
def recieve():
try:
timestamp = request.values['timestamp']
msg_from =... | 26.631579 | 96 | 0.587945 |
86e0365526e81892dcb548dcbd22fb1a9315b303 | 2,141 | py | Python | spider/master_Health_Environment_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/master_Health_Environment_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/master_Health_Environment_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
# 获得爬取“宗教”推文所需信息
import json
from Config_Health_Environment_od import get_noau_config
from datetime import datetime, timedelta
_, db, r = get_noau_config() # 数据库配置
def get_date(date):
# 获取日期集合
dates = date.split('\n')
date_list = []
for i in dates:
if not... | 30.585714 | 120 | 0.565156 |
8100277e0f733ec8f1e59fde7cd4becc771fb058 | 335 | py | Python | src/server/middleware/scheduler.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/middleware/scheduler.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/middleware/scheduler.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import logging
from scheduler.manager import JobManager
from server.config import Config
# Initialize scheduler process
manager = JobManager(db_url=Config.SQLALCHEMY_DATABASE_URI)
def init_scheduler(app):
try:
manager.init_app(app)
except:
logging.warn("Scheduler already started.")
retur... | 19.705882 | 59 | 0.743284 |
d4df8f55cace0a8a01447a3f7556e15c5ca759a0 | 745 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/defs_class.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/defs_class.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/defs_class.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null |
class Defs:
def __init__(self):
self.BPM_MIN = 40
self.BPM_MAX = 180 # marsyas
self.OSS_WINDOWSIZE = 256
self.OSS_HOPSIZE = 128
self.OSS_LOWPASS_CUTOFF = 6.0 # Hz
#self.OSS_LOWPASS_CUTOFF = 0 # Hz
self.OSS_LOWPASS_N = 15
se... | 21.285714 | 42 | 0.528859 |
be25249f9bba4b7985f7171f29f3bc74f62031d9 | 2,449 | py | Python | test/test_npu/test_network_ops/test_slow_conv_transpose3d.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_slow_conv_transpose3d.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_slow_conv_transpose3d.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... | 41.508475 | 90 | 0.676194 |
07858368a365a7a488bf8c0dc9ed71f2f532f66d | 299 | py | Python | exercises/pt/solution_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_02_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("pt")
doc = nlp("Eu tenho um gato amarelo.")
# Consulte o código hash da palavra "gato"
gato_hash = nlp.vocab.strings["gato"]
print(gato_hash)
# Agora consulte o gato_hash para obter a palavra novamente
gato_string = nlp.vocab.strings[gato_hash]
print(gato_string)
| 23 | 59 | 0.755853 |
71f47d7b8cf7b860f70687e3845f93de21eff5dc | 1,362 | py | Python | src/bo4e/com/tarifpreis.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/tarifpreis.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/tarifpreis.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Tarifpreis class
and corresponding marshmallow schema for de-/serialization
"""
from typing import Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.preis import Preis, PreisSchema
from bo4e.enum.preistyp import Preistyp
# p... | 28.978723 | 175 | 0.743759 |
92de367d48aafe9d3fc5677d5607cb4faa6635b0 | 2,416 | py | Python | Get_List_WordPress-main/get.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Get_List_WordPress-main/get.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Get_List_WordPress-main/get.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #Get Wordpress SiteList
#!/usr/bin/python
# -*- coding: utf-8 -*
#JametKNTLS - h0d3_g4n - Moslem - Jenderal92
# Blog : https://www.blog-gan.org
#DONATE ME :(
# BTC = 31mtLHqhaXXyCMnT2EU73U8fwYwigiEEU1
# PERFECT MONEY = U22270614
##############################
import sys, os, re, socket, binascii, time, js... | 50.333333 | 277 | 0.655629 |
131273f5bebc7da79effdc536d5730f0c4fa80cd | 5,624 | py | Python | .venv/Lib/site-packages/dexpy/tests/test_factorial.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 21 | 2016-10-19T18:13:03.000Z | 2021-11-02T13:58:31.000Z | .venv/Lib/site-packages/dexpy/tests/test_factorial.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 43 | 2016-10-11T20:56:28.000Z | 2020-08-20T16:39:38.000Z | .venv/Lib/site-packages/dexpy/tests/test_factorial.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 6 | 2017-12-22T03:47:37.000Z | 2021-03-13T03:45:26.000Z | from unittest import TestCase
from dexpy.factorial import build_factorial
from dexpy.alias import alias_list
class TestFactorial(TestCase):
def test_full(self):
"""Tests a full two-level factorial."""
factor_count = 3
run_count = 8
design = build_factorial(factor_count, run_count)... | 46.866667 | 97 | 0.508001 |
138d48db527d04589ab1695bb4d504c64c5decf4 | 1,886 | py | Python | message/Message.py | francisar/wechat | 8932feb4aacc6df27a472e3278780fcdd41bc47c | [
"MIT"
] | null | null | null | message/Message.py | francisar/wechat | 8932feb4aacc6df27a472e3278780fcdd41bc47c | [
"MIT"
] | null | null | null | message/Message.py | francisar/wechat | 8932feb4aacc6df27a472e3278780fcdd41bc47c | [
"MIT"
] | null | null | null | #coding=utf-8
#from django.core.exceptions import PermissionDenied
from bs4 import BeautifulSoup
from base.function import switch
from message.Text import Texthandler
import time
class Handler(object):
def __init__(self,body):
self.__soup=BeautifulSoup(body)
self.__MsgType=self.__soup.msgtype.str... | 28.575758 | 65 | 0.530753 |
167504e96ba13b99316109e6082effb703badaa3 | 1,173 | pyde | Python | sketches/phyllotaxis01/phyllotaxis01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/phyllotaxis01/phyllotaxis01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/phyllotaxis01/phyllotaxis01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | magma11 = ['#000003', '#140D35', '#3B0F6F', '#63197F', '#8C2980', '#B53679', '#DD4968',
'#F66E5B', '#FD9F6C', '#FDCD90', '#FBFCBF']
# magma10 = ['#000003', '#170F3C', '#430F75', '#711F81', '#9E2E7E', '#CB3E71', '#F0605D',
# '#FC9366', '#FEC78B', '#FBFCBF']
# magma9 = ['#000003', '#1B1044', '#4F117... | 32.583333 | 89 | 0.505541 |
4c20f72782cfae96b56dbf0a8a0c78224c4cd663 | 6,057 | py | Python | 03_filter.py | melandresen/Ich-Daten | 87362aa8060865d2d33443054297214bd80526fe | [
"Apache-2.0"
] | null | null | null | 03_filter.py | melandresen/Ich-Daten | 87362aa8060865d2d33443054297214bd80526fe | [
"Apache-2.0"
] | null | null | null | 03_filter.py | melandresen/Ich-Daten | 87362aa8060865d2d33443054297214bd80526fe | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from collections import Counter
def map_star_categories(data_table):
"""Codes mit Sternchen in die ohne Sternchen überführen"""
coders = ["annotator1", "annotator2", "annotator3", "annotator4"]
mapping_dict = {
"Verfasser-Ich*": "Verfasser-Ich",
"Forscher-Ich*": "Fors... | 45.541353 | 100 | 0.721149 |
e684ba6d256250ac838f26f50221e0ddf484ad63 | 70,756 | py | Python | src/onegov/town6/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import namedtuple
from cached_property import cached_property
from dateutil.rrule import rrulestr
from dateutil import rrule
from onegov.core.utils import linkify, to_html_ul
from onegov.directory import DirectoryCollection
from onegov.event import OccurrenceCollection
from onegov.file import File
fr... | 31.843384 | 79 | 0.467508 |
fc94fe5359d34c60827efd52daaafa31006e61d1 | 1,152 | py | Python | docker/partialsum.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | docker/partialsum.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | docker/partialsum.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | import time
import numpy as np
import numpy .linalg as nl
import random
#import matplotlib.pyplot as plt
import sys
import os
print(os.environ['nmax'])
n_max=int(os.environ['nmax'])
# Iteration über sämtliche Argumente:
#for eachArg in sys.argv:
# print(eachArg)
#t1 = np.linspace(1,5,10)
#t2 = np.linspace(1,5,2... | 15.567568 | 59 | 0.561632 |
f8f2c6af58a1c87779676e4a5256ef7db689d61e | 2,180 | py | Python | fence/blueprints/privacy.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | fence/blueprints/privacy.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | fence/blueprints/privacy.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | """
This blueprint defines the /privacy-policy enpdoint to serve a privacy policy from
fence, which will be linked to in the OAuth2 consent screens.
The logic as to where to get this thing from is as follows.
- If there is a PRIVACY_POLICY_URL environment variable (which should come from the
manifest, exposed here ... | 36.949153 | 87 | 0.712385 |
f8f5851fa3073dead4b282d21b818e97daa00c30 | 6,501 | py | Python | GZP_GTO_ArcMap/scripts/SCR_ValidateSchema.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_ArcMap/scripts/SCR_ValidateSchema.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_ArcMap/scripts/SCR_ValidateSchema.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | # -*- coding: utf-8 -*-
"""
@author: ms.gis, June 2020
Script for ArcGIS GTO for Modul GZP
"""
##
import arcpy
import pythonaddins
import arcpy.da
import json
import inspect
import os
import sys
## -------------------------
# Open progress dialog
with pythonaddins.ProgressDialog as dialog:
dialog.title = "PRUE... | 31.867647 | 157 | 0.512844 |
53ad61cc6dcaad8ea216de1c5fbee32d5272edde | 818 | py | Python | Image_Recognition/Show_Scan.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | Image_Recognition/Show_Scan.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | Image_Recognition/Show_Scan.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | """
Shows the bounding boxes of the recognized objects
"""
import matplotlib.pyplot as plt
def get_extremes(rect, img):
_min = (rect[0][0], rect[0][1])
# calculates the maximal position using the formula from creates_bounding_car
_max = (rect[1][0] + _min[0] - 1, rect[1][1] + _min[1] - 1)
# draws... | 23.371429 | 81 | 0.58802 |
db7db502a6ba8c402cf99e5b8bd8b4853bce293b | 3,503 | py | Python | solutions/item_based_recommend/service/src/mysql_toolkits.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/item_based_recommend/service/src/mysql_toolkits.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/item_based_recommend/service/src/mysql_toolkits.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import pymysql
import time
from src.config import TABLE_NAME, temp_file_path, MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, categories_num, texts_num
# TABLE_NAME = 'image_search_1'
def connect_mysql():
try:
conn = pymysql.connect(host="127.0.0.1",user="root",port=3306,password="12... | 25.021429 | 172 | 0.640308 |
db85b1d77aa632c43622f8bfbadbc5799782ad60 | 793 | py | Python | __manifest__.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | __manifest__.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | __manifest__.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
{
'name': 'Sotras Employee Full',
'description': """
Jobs, Departments and Employees Details from OCA and custom.
Original module from Cogito
""",
'author': "Cogito / IDSYS",
'license': 'OPL-1',
'category': 'Human Resources',
'version': '0.2',
... | 20.333333 | 68 | 0.534678 |
72ea02f3db1183a0651286a8d273018b75c4e0dd | 424 | py | Python | crypto/crypto-srsa/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | 2 | 2021-08-09T17:08:12.000Z | 2021-08-09T17:08:17.000Z | crypto/crypto-srsa/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | crypto/crypto-srsa/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | 1 | 2021-10-09T16:51:56.000Z | 2021-10-09T16:51:56.000Z | from Crypto.Util.number import long_to_bytes
n = 5496273377454199065242669248583423666922734652724977923256519661692097814683426757178129328854814879115976202924927868808744465886633837487140240744798219
e = 431136
ct = 325894984105551626497885160200157467875865999059137741861995616898135402969750169263341940660767780... | 60.571429 | 159 | 0.919811 |
be99bf1769eff4778402fedd25a61e8251003a92 | 1,317 | py | Python | lbry/tests/unit/comments/test_comment_signing.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | null | null | null | lbry/tests/unit/comments/test_comment_signing.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/tests/unit/comments/test_comment_signing.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | from torba.testcase import AsyncioTestCase
from lbry.extras.daemon.comment_client import sign_comment
from lbry.extras.daemon.comment_client import is_comment_signed_by_channel
from tests.unit.wallet.test_schema_signing import get_stream, get_channel
class TestSigningComments(AsyncioTestCase):
@staticmethod
... | 38.735294 | 115 | 0.721336 |
fe693b743a5af16bc5c3b6feabc7fe7aa6a29863 | 2,593 | py | Python | resources/mechanics_lib/utils/dimensions.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | resources/mechanics_lib/utils/dimensions.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | resources/mechanics_lib/utils/dimensions.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z | class Dimensions:
def __init__(self, params):
self.parameters = params.copy()
def setParameter(self, name, val):
self.parameters[name] = val
def getParameter(self, name):
return self.parameters[name]
class BrainDimensions(Dimensions):
def __init__(self):
params = {}
params.setd... | 23.572727 | 47 | 0.673351 |
fe9f5434e0b5deffb25e7766f061987ef71e2323 | 1,984 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/build/buildPyDoc.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/build/buildPyDoc.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/build/buildPyDoc.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 36.072727 | 100 | 0.753024 |
22ae303d0510dc2e1afc185de6eb8c565929cd75 | 1,126 | py | Python | deutschland/jobsuche/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/jobsuche/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/jobsuche/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
"""
Bundesagentur für Arbeit: Jobsuche API
Die größte Stellendatenbank Deutschlands durchsuchen, Details zu Stellenanzeigen und Informationen über Arbeitgeber abrufen. <br><br> Die Authentifizierung funktioniert per OAuth 2 Client Credentials mit JWTs. Folgende Client-Credentials können dafür v... | 40.214286 | 405 | 0.818828 |
a3d6aacd5012becc6b4ba71243c12208e921a091 | 250 | py | Python | nffb/admin.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/admin.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/admin.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from cms.extensions import PageExtensionAdmin
from .models import BackgroundExtension
class BackgroundExtensionAdmin(PageExtensionAdmin):
pass
admin.site.register(BackgroundExtension, BackgroundExtensionAdmin)
| 25 | 66 | 0.86 |
a3dad95b9cd6b2dec198e84aeea6ab72c95c966c | 7,027 | py | Python | contest_server/pjkiserver/event.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/event.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/event.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | from flask import Blueprint, request, Response
import json
import time
from datetime import datetime
from .storage.storage import storage, syncDB
from . import schemas, timer, rules, util
_eventstream_update_interval = 0.05 # seconds
_eventstream_heartbeat_interval = 8 # seconds
api = Blueprint('event', __name__)
... | 31.79638 | 101 | 0.702718 |
43298be16ef35b4e014601abef19d873c9b7c90c | 5,227 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/train_lstm/scenario_lib/accuracy_metrics.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-19T09:58:37.000Z | 2022-03-19T09:58:37.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/train_lstm/scenario_lib/accuracy_metrics.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/train_lstm/scenario_lib/accuracy_metrics.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applic... | 34.615894 | 122 | 0.629424 |
435474e1b5d2a78c3bd911f10e928d294458f570 | 13,763 | py | Python | contest_server/pjkiserver/ruleserver/bitboard.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/ruleserver/bitboard.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/ruleserver/bitboard.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | import numpy as np
import re
"""
import random
ZOBRIST_INDICES = {"q": np.uint64(0), # queen
"k": np.uint64(1), # king
"p": np.uint64(2), # pawn
"b": np.uint64(3), # bishop
"n": np.uint64(4), # knight
"r": np.uint64(5), # rook
"Q": np.uint64(6), #... | 33.243961 | 317 | 0.484923 |
602b1d3655f88a635cb15859fa9ce79063d2aaf6 | 563 | py | Python | pacman-arch/test/pacman/tests/sync405.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/sync405.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/sync405.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "phonon/qt issue"
sp1 = pmpkg("kdelibs")
sp1.depends = ["phonon"]
self.addpkg2db("sync", sp1);
sp2 = pmpkg("qt", "4.6.1-1")
self.addpkg2db("sync", sp2)
sp3 = pmpkg("phonon")
self.addpkg2db("sync", sp3)
lp = pmpkg("qt", "4.5.3-1")
lp.provides = ["phonon"]
lp.conflicts = ["phonon"]
self.addpkg2db("... | 22.52 | 60 | 0.662522 |
605d06d894fcd044e3a1271039740f409f70a869 | 3,053 | py | Python | movies/project/ORM.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | movies/project/ORM.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | movies/project/ORM.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | """
FILE: ORM.py
This file handles all SQLAlchemy ORM related operations and classes for
the UCLA Extension Python Programming 1 Movie Project
"""
import logging
import os
import traceback
import pandas as pd
import sqlalchemy
import sqlalchemy.ext.declarative
import sqlalchemy.orm
# Global Setup
user = "postgres... | 29.640777 | 74 | 0.712414 |
71830e4f9ec61e23505df89d9bd844be57b9f7b9 | 148,448 | py | Python | paddlenlp/transformers/tokenizer_utils_base.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/tokenizer_utils_base.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/tokenizer_utils_base.py | AI-Mart/PaddleNLP | 0ababea960427e8b70220ea06d908ed58cbed0ed | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | 46.462598 | 159 | 0.605572 |
e81c5fe5532328dfdbc7fc0ec6b62987ab84a472 | 493 | py | Python | python/en/archive/dropbox/cvxpy/cvxpy-test1.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/cvxpy/cvxpy-test1.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/cvxpy/cvxpy-test1.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import cvxpy as cvx
#f = np.array( [[1, 4]] )
f = np.array( [[1], [4]] )
H = np.array( [[1,0],[0,4]])
A = np.array( [[-2, -4],[1, 5 ],[2, 2]] )
b = np.array( [[-35],[50],[40]] )
lb = np.array( [[0],[0]] )
x = cvx.Variable( 2,1 )
objective = cv... | 22.409091 | 55 | 0.576065 |
1c037200af21a91f09e3b5d2ec89a4f843f3016b | 3,553 | py | Python | official/cv/unet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/unet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/unet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020-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 agre... | 50.757143 | 114 | 0.681677 |
c79211a3016b42bfbdfb88669a2839d62490fc5f | 1,822 | py | Python | scar.py | Shrodunt/advantage- | 981a126e4048724d3c87757be452b2e9e40a8768 | [
"Unlicense"
] | 1 | 2022-02-13T03:31:27.000Z | 2022-02-13T03:31:27.000Z | scar.py | Shrodunt/scar | 981a126e4048724d3c87757be452b2e9e40a8768 | [
"Unlicense"
] | null | null | null | scar.py | Shrodunt/scar | 981a126e4048724d3c87757be452b2e9e40a8768 | [
"Unlicense"
] | null | null | null | import requests, time
from colorama import *
from lib.core import *
init()
try:
tokens = open('input/tokens.txt', 'r').read().splitlines()
except:
print(Fore.RED + 'Paste your tokens into input/tokens.txt OR create a text file named tokens')
time.sleep(3)
quit()
if len(tokens) == 0:
print(Fore... | 35.038462 | 267 | 0.540615 |
9096d54993984161bb017ce91c934505173c3f24 | 428 | py | Python | 2016-maximum-difference-between-increasing-elements/2016-maximum-difference-between-increasing-elements.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 2016-maximum-difference-between-increasing-elements/2016-maximum-difference-between-increasing-elements.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 2016-maximum-difference-between-increasing-elements/2016-maximum-difference-between-increasing-elements.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def maximumDifference(self, nums: List[int]) -> int:
mini=nums[0]
maxj=-1
output = [-1]
for num in nums[1:]:
if num < mini:
mini=num
maxj=-1
continue
if num > mini and num > maxj:
... | 26.75 | 56 | 0.453271 |
313d90747e1c0f9ba93596037a85a0622a7c887e | 334 | py | Python | exercise6.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | 1 | 2020-11-21T16:57:40.000Z | 2020-11-21T16:57:40.000Z | exercise6.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null | exercise6.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null |
def celcius_to_fahrenheit(celcius_float):
"""Convert Celcius to Fahrenheit"""
return celcius_float*1.8+32
print("Convert Celcius to Fahrenheit.")
celcius_float=float(input("Enter a Celcius temp: "))
fahrenheit_float=celcius_to_fahrenheit(celcius_float)
print(celcius_float, "converts to ", fahrenheit_float, ... | 27.833333 | 68 | 0.781437 |
5b0871f18b06c020e0ca073e7efb7dc71660b972 | 4,761 | py | Python | src/xml_parser/parser.py | BugliL/Exercise-CSV-Import-Sanitize | 85385fc5a8edd3ca44742faad0a19a1e1ef0f93d | [
"MIT"
] | null | null | null | src/xml_parser/parser.py | BugliL/Exercise-CSV-Import-Sanitize | 85385fc5a8edd3ca44742faad0a19a1e1ef0f93d | [
"MIT"
] | null | null | null | src/xml_parser/parser.py | BugliL/Exercise-CSV-Import-Sanitize | 85385fc5a8edd3ca44742faad0a19a1e1ef0f93d | [
"MIT"
] | null | null | null | import io
from datetime import datetime
from typing import Sequence, Dict, List
from xml.etree import ElementTree as ET, ElementTree
class Contants(object):
fields_to_ignore = ['Rev', 'Due Date', 'Transmittal', 'Status', ]
BASIC_NAMESPACE = 'urn:schemas-microsoft-com:office'
ALL_NS = {
'': BASIC... | 29.943396 | 105 | 0.610796 |
82a3d88926f91505919f5eb0b0960796a07437b4 | 1,261 | py | Python | official/cv/resnet/infer/ResNet152/convert/data.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/resnet/infer/ResNet152/convert/data.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/resnet/infer/ResNet152/convert/data.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... | 33.184211 | 78 | 0.632831 |
81487862441bb05c07439c3cf5d40be4b41ae1b2 | 636 | py | Python | 数据结构/NowCode/28_PrintFromTopToBottom.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/28_PrintFromTopToBottom.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/28_PrintFromTopToBottom.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# 返回从上到下每个节点值列表,例:[1,2,3]
def PrintFromTopToBottom(self, root):
if root == None:
return []
# 将输入的节点存入support中
support = [root]
ret = []
... | 27.652174 | 46 | 0.512579 |
1ef1fe9f19cb4d27bb3741b8201f2a717d73f84b | 10,037 | py | Python | test/test_npu/test_network_ops/test_celu.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_celu.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_celu.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... | 42.350211 | 99 | 0.593604 |
d2043f55ccb6f45de2eeced35c54abb998c293a0 | 1,790 | py | Python | deeplearning2020/submission.py | jaki7799/KI | 90df86c5fb5b45f6478e6032cbfcd34d8b26ded6 | [
"MIT"
] | null | null | null | deeplearning2020/submission.py | jaki7799/KI | 90df86c5fb5b45f6478e6032cbfcd34d8b26ded6 | [
"MIT"
] | null | null | null | deeplearning2020/submission.py | jaki7799/KI | 90df86c5fb5b45f6478e6032cbfcd34d8b26ded6 | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
import kerasltisubmission as klti
from kerasltisubmission.exceptions import KerasLTISubmissionBadResponseException
if TYPE_CHECKING: # pragma: no cover
import keras.models
class Submission:
def __init__(
self,
user_token: klti.AnyIDType,
assignment_i... | 38.085106 | 136 | 0.627374 |
d20c36ce612b3868aab45a5a2fef982f3e0ab67a | 40 | py | Python | src/server/__init__.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/__init__.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/__init__.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | print("server package initialisiert...") | 40 | 40 | 0.775 |
d25b1f667b28c5c9b110dc4c1de7bd8e25e13284 | 103,206 | py | Python | beispielanwendungen/packaging/src/helloworld/ui/helloworld_rc.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/packaging/src/helloworld/ui/helloworld_rc.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/packaging/src/helloworld/ui/helloworld_rc.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Di. Aug 9 10:01:29 2011
# by: The Resource Compiler for PyQt (Qt v4.7.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x01\x2c\
\x3c\
\xb8\x64\x18\xca\xef\x9c\x95\xcd\x21\x1c\xbf\x60\xa... | 64.50375 | 121 | 0.72709 |
d261fffc39333ac39acc9bd809d7876dafad71cc | 5,459 | py | Python | bestimmeVolumen.py | jkerpe/TroubleBubble | 813ad797398b9f338f136bcb96c6c92186d92ebf | [
"MIT"
] | null | null | null | bestimmeVolumen.py | jkerpe/TroubleBubble | 813ad797398b9f338f136bcb96c6c92186d92ebf | [
"MIT"
] | null | null | null | bestimmeVolumen.py | jkerpe/TroubleBubble | 813ad797398b9f338f136bcb96c6c92186d92ebf | [
"MIT"
] | 1 | 2021-08-09T14:57:57.000Z | 2021-08-09T14:57:57.000Z | import cv2
import glob
import time
from tracker import Tracker
import numpy as np
def getCoord(blb):
"""
Funktion zur Berechnung der Koordinaten eines BLOBs als Liste mit [xmin, xmax, xmid, ymid]
:param blb: BLOB (Rückgabe von cv2.findContours)
:return: [x_min, x_max, mid_x,mid_y]
"""
x_min, y... | 40.437037 | 127 | 0.609819 |
fba12913929df7a3ff817dfa8932d97c0c384dc6 | 1,587 | py | Python | server/bumf/core/migrations/0001_initial.py | bumfiness/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | 6 | 2017-01-07T17:59:46.000Z | 2017-02-10T13:19:46.000Z | server/bumf/core/migrations/0001_initial.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | server/bumf/core/migrations/0001_initial.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-06 18:56
from __future__ import unicode_literals
import bumf.core.models.auth
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateMo... | 45.342857 | 232 | 0.6339 |
f755badbdf5f194d6461e343108a59a63ae33c0c | 2,710 | py | Python | Generator/guid.py | Design-Computation-RWTH/ILC_Demonstrator | 60046366383de053026a0d03b213f6af3610f608 | [
"MIT"
] | 1 | 2021-06-08T10:04:35.000Z | 2021-06-08T10:04:35.000Z | mvdXMLGen/ILC_Demonstrator-master/Generator/guid.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | null | null | null | mvdXMLGen/ILC_Demonstrator-master/Generator/guid.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | 1 | 2021-05-04T09:38:20.000Z | 2021-05-04T09:38:20.000Z | #https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcopenshell-python/ifcopenshell/guid.py#L56
#Thomas Krijnen
#Matthis Thorade
#buildingSMART
###############################################################################
# #
# Th... | 38.714286 | 114 | 0.471956 |
542ae543ea5f6e7c9b12191d96d98033d8cc06b2 | 14,191 | py | Python | src/arcgis_download.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | 1 | 2021-05-02T09:53:25.000Z | 2021-05-02T09:53:25.000Z | src/arcgis_download.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | null | null | null | src/arcgis_download.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 10 22:43:48 2021
@author: David
"""
import sys
import os
import os.path
import tempfile
import requests
import gzip
import shutil
import pandas as pd
import numpy as np
import urllib.request, json
# Download URL for arcgis NPGEO Hub RKI Data:
#ARCGIS_RKI_URL = 'https:/... | 40.315341 | 184 | 0.574308 |
5853cc52a53299b77ec601d51011a95f278ac49a | 2,362 | py | Python | oneflow/python/test/onnx/nodes/test_add_n.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/onnx/nodes/test_add_n.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/onnx/nodes/test_add_n.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 28.457831 | 72 | 0.594412 |
b71f96b8975fe5b15ab05b0404c99c4f832ee5a9 | 15,411 | py | Python | scripts/align_investigation.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 1 | 2021-01-20T00:37:31.000Z | 2021-01-20T00:37:31.000Z | scripts/align_investigation.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 17 | 2021-03-03T14:48:54.000Z | 2021-09-08T15:52:50.000Z | scripts/align_investigation.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 2 | 2021-03-05T12:23:20.000Z | 2021-03-29T11:49:53.000Z | #%% [markdown]
# # Investigating alignment
# In {doc}`./bilateral_symmetry`, we saw how odd some of the embedding alignments can
# be, and how large of an effect they have on downstream analysis.
#
# Here, we investigate some of these embedding alignments in more detail. In summary, we
# will:
# - Look at the known pai... | 31.386965 | 100 | 0.727727 |
3f7a021228f1dd0e09fd83143c7903f6fa705dcc | 1,153 | py | Python | pacman-arch/test/pacman/tests/upgrade100.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/upgrade100.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/upgrade100.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Indirect dependency ordering (FS#32764)"
lp1 = pmpkg("fcitx-gtk2", "1.0-1");
lp1.depends = ["gtk2"]
self.addpkg2db("local", lp1)
lp2 = pmpkg("gtk2", "1.0-1");
lp2.depends = ["pango"]
self.addpkg2db("local", lp2)
lp3 = pmpkg("pango", "1.0-1");
lp3.depends = ["harfbuzz"]
self.addpkg2db("local", lp3... | 25.622222 | 76 | 0.65915 |
b7d859eb0ae1954807a5941ea45dcd7d0b88fb02 | 629 | py | Python | PYTHON/Math/triangle_quest_2.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Math/triangle_quest_2.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Math/triangle_quest_2.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
if __name__ == '__main__':
for i in range(1,int(input())+1):
print((10 ** i - 1) ** 2 // 81)
# Weired.. This one is alse one line
for i in range(1,int(input())+1):
print(int(''.join([str(j) for j in range(1, i + 1)] + [str(j) for j in range(i - 1, 0, -1)])))
'''... | 26.208333 | 102 | 0.394277 |
c434bae1d817a0aab906d6035b15411672fc8252 | 15,641 | py | Python | src/view/ConfigView.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-26T16:16:14.000Z | 2020-05-26T16:16:14.000Z | src/view/ConfigView.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | null | null | null | src/view/ConfigView.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-16T20:09:17.000Z | 2020-05-16T20:09:17.000Z | from PyQt5.QtWidgets import QWidget, QVBoxLayout, QTreeWidget, \
QTreeWidgetItem, QFileDialog, QPushButton, QHBoxLayout, \
QPlainTextEdit, QCheckBox, QHeaderView, QMessageBox, \
QInputDialog
from PyQt5.QtCore import Qt
import xml.etree.ElementTree as ET
from defusedxml.ElementTree import parse
from functool... | 39.597468 | 79 | 0.524391 |
db1cbd629de0e4b35d197f83d9abb18835b0af4a | 2,008 | py | Python | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/two_cliques.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/two_cliques.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/two_cliques.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | """
Find if a graph can be divided into two cliques
A clique is a subgraph such that all vertices in it are completely
connected with each other
Solution -
A bipartite graph is a graph which can be divided into two sets U and V such
that every edge from u or v has a destination in the other.
So take the complement o... | 26.773333 | 92 | 0.572709 |
58be1066ca2ba7fc93e65d4e5478a1ab832cd6d2 | 16,922 | py | Python | research/cv/proxylessnas/src/proxylessnas_mobile.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/proxylessnas/src/proxylessnas_mobile.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/proxylessnas/src/proxylessnas_mobile.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... | 28.926496 | 106 | 0.484399 |
e16238c89fadd792402e2171432299314f87163e | 2,417 | py | Python | leetcode/057-Insert-Interval/InsertInterval_001_ugly.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/057-Insert-Interval/InsertInterval_001_ugly.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/057-Insert-Interval/InsertInterval_001_ugly.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for an interval.
# class Interval:
# def __init__(self, s=0, e=0):
# self.start = s
# self.end = e
class Solution:
# @param {Interval[]} intervals
# @param {Interval} newInterval
# @return {Interval[]}
def insert(self, intervals, newInterval):
if intervals == []... | 26.855556 | 86 | 0.381878 |
831fbb141f3839c8118bac710e0189a196a81a8d | 17,337 | py | Python | egs/avspeech/looking-to-listen/model.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-12-18T02:42:23.000Z | 2020-12-18T02:42:23.000Z | egs/avspeech/looking-to-listen/model.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | egs/avspeech/looking-to-listen/model.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | import torch
import numpy as np
from torch import nn
import torchvision
import torch.nn.functional as F
from pathlib import Path
from asteroid import torch_utils
from asteroid.engine.optimizers import make_optimizer
from asteroid.filterbanks import transforms
# Reference: https://github.com/bill9800/speech_separation... | 31.294224 | 102 | 0.56913 |
36c54d0750421b54fd8c5e12db3e84b29110b49f | 5,403 | py | Python | Integrations/python/deephaven/jvm_init.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | null | null | null | Integrations/python/deephaven/jvm_init.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 1 | 2022-03-03T21:24:40.000Z | 2022-03-03T21:24:54.000Z | Integrations/python/deephaven/jvm_init.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
#
"""Utilities for initializing the Deephaven JVM."""
import jpy
import jpyutil
import logging
import os
from glob import glob
from deephaven import initialize
def jvm_init(devroot=None,
workspace=None,
propfile=None,
... | 36.261745 | 116 | 0.621136 |
36f4e120ac53cc3570f0582c0542ddda354ac74a | 98 | py | Python | Python/Math/find_angle.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Math/find_angle.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Math/find_angle.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | import math
print str(int(round(math.degrees(math.atan2(int(raw_input()),int(raw_input()))))))+'°' | 49 | 86 | 0.714286 |
3d19d884449e0939fcda50cb91613fe87ce85112 | 471 | py | Python | Curso-Em-Video-Python/2Exercicios/080_lista_ordenada_sem_repeticao.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/080_lista_ordenada_sem_repeticao.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/080_lista_ordenada_sem_repeticao.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | lista = []
for c in range(0, 5):
n = int(input('Digite um valor: '))
if c == 0 or n > lista[-1]:
lista.append(n)
print('Adicionado no final da lista...')
else:
pos = 0
while pos < len(lista):
if n <= lista[pos]:
lista.insert(pos, n)
... | 29.4375 | 64 | 0.4862 |
18651d16966374bd3cecd0940f42929050a72a22 | 320 | py | Python | 7_funktionen/4_eigeneFunktionCircle.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 7_funktionen/4_eigeneFunktionCircle.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 7_funktionen/4_eigeneFunktionCircle.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Funktionen als Werkzeuge
Kannst du die Funktion so umschreiben, dass der Kreis immer auf der
Position x/y eingemittet wird?
"""
def circle(x, y, dia):
# zeichnet einen Kreis an Position x/y
# mit Durchmesser dia
oval(x-dia/2, y-dia/2, dia, dia)
newPage(1000, 1000)
circle(width()/2, height()/2, 200) | 22.857143 | 67 | 0.6875 |
a1930447a22b6c9d2364a7dea678e8c130bcbf5b | 3,463 | py | Python | src/test/tests/hybrid/mesh_quality.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/mesh_quality.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/hybrid/mesh_quality.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: mesh_quality.py
#
# Tests: mesh - 3D unstructured
# plots - Pseudocolor
#
# Programmer: Hank Childs
# Date: November 25, 2003
#
# Modifications:
#
# Hank Childs, Fr... | 21.64375 | 78 | 0.675426 |
62ebc5ea68e7bfa66dd6fd018c562630fbb0d6f6 | 20,592 | py | Python | src/unittest/python/server/test_server.py | mwintersperger-tgm/sew5-simple-user-database-mwintersperger-tgm | aa638ef1399807403312a0597596412d69e6f20f | [
"MIT"
] | null | null | null | src/unittest/python/server/test_server.py | mwintersperger-tgm/sew5-simple-user-database-mwintersperger-tgm | aa638ef1399807403312a0597596412d69e6f20f | [
"MIT"
] | null | null | null | src/unittest/python/server/test_server.py | mwintersperger-tgm/sew5-simple-user-database-mwintersperger-tgm | aa638ef1399807403312a0597596412d69e6f20f | [
"MIT"
] | null | null | null | import sys
sys.path.append(".")
from src.main.python.server.app import app as App
import json
import pytest
@pytest.fixture
def client():
app = App
client = app.test_client()
return client
# Sanity Tests
def test_ping_code(client):
res = client.get('/ping')
assert res.status_code == 200
def tes... | 32.842105 | 323 | 0.587655 |
a7f5bdb62f854340ba0de48e1a8cd54050ba4704 | 2,391 | py | Python | app/views/users.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/users.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/users.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | import logging
from flask import request
from flask_login import login_required
from flask_restplus import Namespace, Resource, abort
from app.services import UserService
from .models.commons import paginate
from .models.users import user_input, user_output, users_output, user_basic
_logger = logging.getLogger(__nam... | 29.158537 | 75 | 0.67545 |
49263bb43bb6bbfa7cab5841856f011f881be2b8 | 11,401 | py | Python | TestBot/test_cogs/pokerouletteFunctions/battling.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | TestBot/test_cogs/pokerouletteFunctions/battling.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | TestBot/test_cogs/pokerouletteFunctions/battling.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | from . import rarity_info, Page, chunk
from .pokemon import get_pokemon_info, get_random_pokemon_by_rarity, PokeBattle
from random import choices, randint, random
import logging
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_format = logging.Formatter('[%(... | 27.739659 | 118 | 0.65889 |
62832535f75b0f89c00be16299e069e7f2764ad0 | 1,507 | py | Python | transformer/Encoder.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | null | null | null | transformer/Encoder.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | null | null | null | transformer/Encoder.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | 1 | 2021-02-03T07:35:20.000Z | 2021-02-03T07:35:20.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020-06-20-19:46
# @Author : TuringEmmy
# @Email : yonglonggeng@163.com
# @WeChat : csy_lgy
# @File : Encoder.py
# @Project : PaperProject
import tensorflow as tf
from tensorflow import keras
from MultiHeadAttention import MultiHeadAttention
from ... | 35.880952 | 72 | 0.698076 |
658bc45e35dffd5c987e6b837356aa3ad15ab229 | 635 | py | Python | MoPulseGen/plot_interactive_figs.py | tushar-agarwal2909/MoPulseGen | a0edeaf67f956e7db27e70f07e47d2f992bcb6f3 | [
"BSD-2-Clause"
] | null | null | null | MoPulseGen/plot_interactive_figs.py | tushar-agarwal2909/MoPulseGen | a0edeaf67f956e7db27e70f07e47d2f992bcb6f3 | [
"BSD-2-Clause"
] | null | null | null | MoPulseGen/plot_interactive_figs.py | tushar-agarwal2909/MoPulseGen | a0edeaf67f956e7db27e70f07e47d2f992bcb6f3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 6 22:34:42 2020
@author: agarwal.270a
"""
import pickle
def load_pickled_figs(filepath):
#open the file and get the fig object list
with open(filepath, 'rb') as file:
fig_list=pickle.load(file)
#show the figures. Maybe automat... | 25.4 | 58 | 0.64252 |
b8c46a51d6bb60084bc16af9249e5c25e1009d86 | 55 | py | Python | projects/g3h1-cp-fml-interpreter/src/actuator/__init__.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/actuator/__init__.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/actuator/__init__.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | from .actuator import Actuator
__all__ = ['Actuator']
| 13.75 | 30 | 0.745455 |
a284d3c492ff906b88848dd23e20069819496fa9 | 2,673 | py | Python | Packs/GoogleChronicleBackstory/Scripts/ChronicleListDeviceEventsByEventTypeWidgetScript/ChronicleListDeviceEventsByEventTypeWidgetScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleListDeviceEventsByEventTypeWidgetScript/ChronicleListDeviceEventsByEventTypeWidgetScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleListDeviceEventsByEventTypeWidgetScript/ChronicleListDeviceEventsByEventTypeWidgetScript.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
import traceback
from typing import Any, Dict
def extract_list_of_events_from_indicator(indicator_data: Dict[str, Any]) -> Dict[str, Any]:
list_of_events = indicator_data.get("CustomFields", {}).get('chronicleassetsummary', [])
number_of_events =... | 33.835443 | 117 | 0.4841 |
a2f3343825b916a1fde2cdd1949035b520c339e9 | 999 | py | Python | src/bin/visitcinemamain.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/bin/visitcinemamain.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/bin/visitcinemamain.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | import sys
###############################################################################
# Function: main
#
# Purpose: This is the main function for the program.
#
# Programmer: Brad Whitlock
# Date: Mon Sep 11 17:26:02 PDT 2017
#
# Modifications:
#
##########################################################... | 24.975 | 84 | 0.50951 |
3bfc10dda556c954b1cf37fc4693a29cf6a72c40 | 2,676 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
test_dependencies = ["Customer", "Supplier"]
from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool im... | 33.873418 | 126 | 0.71861 |
ce57b66f214a40ab57a5c02941b42d43d2b7c87f | 143 | py | Python | hardware/chip/rtl872xd/hal/hal_test/pwm/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | hardware/chip/rtl872xd/hal/hal_test/pwm/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | hardware/chip/rtl872xd/hal/hal_test/pwm/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | src = Split('''
pwm_test.c
''')
component = aos_component('pwm_test', src)
component.add_cflags('-Wall')
component.add_cflags('-Werror')
| 15.888889 | 42 | 0.685315 |
ce624ee71f0a936c042665304f219cdb0831c5b3 | 989 | py | Python | 6_ObjectOriented/abstract_classes_methods.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 6_ObjectOriented/abstract_classes_methods.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 6_ObjectOriented/abstract_classes_methods.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | import abc
# quasi wie ein Interface, gibt an welche Methoden die Klassen implementieren müssen
# ansonsten kann davon kein Objekt erstellt werden -> TypeError
# Elternklasse
class Base(metaclass=abc.ABCMeta):
@abc.abstractmethod # wenn Kindklasse diese Methode unbedingt implementieren muss
def m1(self):
... | 20.183673 | 94 | 0.624874 |
0cbc4a678e77cc200610827c1faa28bf7bd48c3f | 398 | py | Python | python_intro/task4.py | Anni-065/ml-kurs-ws21 | 7f9e5e062da2997b5625e1c9a5086afbbd21b949 | [
"MIT"
] | null | null | null | python_intro/task4.py | Anni-065/ml-kurs-ws21 | 7f9e5e062da2997b5625e1c9a5086afbbd21b949 | [
"MIT"
] | null | null | null | python_intro/task4.py | Anni-065/ml-kurs-ws21 | 7f9e5e062da2997b5625e1c9a5086afbbd21b949 | [
"MIT"
] | 1 | 2022-03-16T09:22:36.000Z | 2022-03-16T09:22:36.000Z | import random
numbers = [random.randint(0, 9) for i in range(0, 1000)]
count_dict = {}
for n in numbers:
if n in count_dict:
count_dict[n] += 1
else:
count_dict[n] = 1
greater_90 = [n for n in count_dict.keys() if count_dict[n] > 90]
print("Numbers created more than 90 times:", greater_90)
max_number = max(co... | 23.411765 | 65 | 0.703518 |
f049727fcf2675f44331ed43087ba9efd803353d | 964 | py | Python | python/unittest/mock/medium/intro_to_mock.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/medium/intro_to_mock.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/medium/intro_to_mock.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from unittest import mock
m = mock.Mock()
assert isinstance(m.foo, mock.Mock)
assert isinstance(m.bar, mock.Mock)
assert isinstance(m(), mock.Mock)
assert m.foo is not m.bar
assert m.bar is not m()
m.foo = "bar"
assert m.foo == "bar"
m.configure_mock(bar="baz")
assert m.bar == "baz"
m2 = mock.Mock(bar="baz")
m2.bar... | 16.066667 | 45 | 0.66805 |
f06cd9882ad0d9bc72e56e0d0c2fbc32ee5ad31b | 3,005 | py | Python | test/test_npu/test_network_ops/test_affine_grid_generator_backward.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_affine_grid_generator_backward.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_affine_grid_generator_backward.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... | 41.736111 | 94 | 0.673544 |
d7e9bc265332beccebb2300dce341e39d0ecfcaa | 353 | py | Python | MzituCrawler/randomUserAgent.py | yeming1001/-MzituCrawler | 3e3dad298734658266fb4c12cd863be73eb4f4a2 | [
"Apache-2.0"
] | 1 | 2018-02-09T05:36:06.000Z | 2018-02-09T05:36:06.000Z | MzituCrawler/randomUserAgent.py | yeming1001/-MzituCrawler | 3e3dad298734658266fb4c12cd863be73eb4f4a2 | [
"Apache-2.0"
] | null | null | null | MzituCrawler/randomUserAgent.py | yeming1001/-MzituCrawler | 3e3dad298734658266fb4c12cd863be73eb4f4a2 | [
"Apache-2.0"
] | 1 | 2017-03-30T07:44:49.000Z | 2017-03-30T07:44:49.000Z | import random
from scrapy.conf import settings
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
class RandomUserAgentMiddleware(UserAgentMiddleware):
def process_request(self, request, spider):
ua = random.choice(settings.get('USER_AGENT_LIST'))
if ua:
request.hea... | 39.222222 | 70 | 0.759207 |
0be7b8b2c2912e07d3afebb3abda981fbf3ec653 | 6,221 | py | Python | test/example_2.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | test/example_2.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | 3 | 2020-03-24T18:18:21.000Z | 2021-08-23T20:37:09.000Z | test/example_2.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | #############################################################
#
# Example 2. entropy estimation
#
#############################################################
import sys, os
sys.path.append("../..")
sys.path.append("..")
sys.path.append(os.getcwd())
import numpy as np
import pandas as pd
import copy
import pickle
fro... | 34.75419 | 176 | 0.607941 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.