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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9495c3109bdb039b9f126d4e1a54c6057406077c | 3,284 | py | Python | Packs/Cyberpion/Integrations/Cyberpion/Cyberpion_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Cyberpion/Integrations/Cyberpion/Cyberpion_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Cyberpion/Integrations/Cyberpion/Cyberpion_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import io
MOCKED_BASE_URL = 'https://api.test.com/api/'
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def test_get_domain_state(requests_mock):
from Cyberpion import Client
mock_response = util_load_json('test_data/domain_... | 32.514851 | 85 | 0.665043 |
78526dcba3ffdad2571905c8709a981e0d9b19ce | 274 | py | Python | PYTHON/Strings/text_wrap.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/text_wrap.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/text_wrap.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import textwrap
def wrap(string, max_width):
return '\n'.join(textwrap.wrap(string, max_width))
if __name__ == '__main__':
# S = input()
# w = int(input())
S = 'ABCDEFGHIJKLIMNOQRSTUVWXYZ'
w = 4
print(wrap(S, w))
| 18.266667 | 54 | 0.627737 |
78b45052e8ff6efede6b5fcb04c0a4e2f63fd70b | 794 | py | Python | source/pkgsrc/finance/py-eth-keyfile/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/finance/py-eth-keyfile/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/finance/py-eth-keyfile/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2021/02/08 07:02:27 adam Exp $
setuptools-markdown is deprecated.
--- setup.py.orig 2018-02-13 17:56:42.000000000 +0000
+++ setup.py
@@ -19,7 +19,8 @@ setup(
"A library for handling the encrypted keyfiles used to store ethereum "
"private keys."
),
- long_descri... | 31.76 | 80 | 0.638539 |
01d3adeeb17737e485c385d664d27e155dd5055d | 1,013 | py | Python | src/lecture1/new_classifier/get_data/My_Explorer.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture1/new_classifier/get_data/My_Explorer.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture1/new_classifier/get_data/My_Explorer.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | import numpy as np
import cv2
from matplotlib import pyplot as plt
ipath = "allfull.jpg"
lpath = "label.npy"
class MyExplorer():
def __init__(self, img_path, label_path, fps=25, size=(40, 40)):
self.img = cv2.imread(img_path,cv2.IMREAD_GRAYSCALE)
self.l = np.load(label_path)
... | 23.55814 | 86 | 0.552813 |
bf05a27adbaac8fc1877648814d9baa033d8792c | 1,001 | py | Python | challenges/depositProfit/python3/depositProfit.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/depositProfit/python3/depositProfit.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/depositProfit/python3/depositProfit.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def depositProfit(deposit, rate, threshold):
years = 0
while deposit < threshold:
deposit *= 1 + rate/100
years += 1
return years
if __name__ == '__main__':
input0 = [100, 100, 1, 20, 50]
input1 = [20, 1, 100, 20, 25]
input2 = [170, 101, 64, 50, 100]
expectedOutput = [3, 1, 6, 6, 4]
assert len(input0) == l... | 52.684211 | 143 | 0.666334 |
da513f9d0d86a18486659f33c14726047c6a8b37 | 151 | py | Python | scripts/hello_world_abaruchi.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_abaruchi.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_abaruchi.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | # LANGUAGE: Python
# ENV: Python3.5
# AUTHOR: Artur Baruchi
# GITHUB: https://github.com/abaruchi
a = "Hello"
b = "World"
print("{} {}".format(a, b))
| 16.777778 | 37 | 0.635762 |
e5fb25200cd81d5460ef480cc747e7eb1369d2e3 | 492 | py | Python | python/coursera_python/MICHIGAN/DataStructures/week6/hours.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/DataStructures/week6/hours.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/DataStructures/week6/hours.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import operator
fname = input("Enter file name: ")
fh = open(fname)
counts = dict()
for line in fh:
line1 = line.rstrip()
if "From:" in line1:
continue
if "From " in line1:
col_pos = line1.find(':')
#print("col_pos : ",col_pos)
ext_hr = line[col_pos-2:col_pos]
#print("ext_hr : ",ext_hr)
counts[ext_hr] ... | 21.391304 | 61 | 0.664634 |
006bf3cd6024a692e2c187808ba21c63a4f5ed78 | 1,502 | py | Python | data/soccer.py | Lyceoth/DataEngineeringProject | bc3c230a23eb5f3e8d7dd5322e3b22995801dc29 | [
"Apache-2.0"
] | null | null | null | data/soccer.py | Lyceoth/DataEngineeringProject | bc3c230a23eb5f3e8d7dd5322e3b22995801dc29 | [
"Apache-2.0"
] | null | null | null | data/soccer.py | Lyceoth/DataEngineeringProject | bc3c230a23eb5f3e8d7dd5322e3b22995801dc29 | [
"Apache-2.0"
] | null | null | null | #!/bin/bash
#"true" '''\' #allow running from vs code, cf. http://rosettacode.org/wiki/Multiline_shebang#Python
#CUR_DIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
#CUR_FILE=`basename "$0"`
#CMD="docker run -it --rm -v \"$PWD/data:/data\" -v \"$CUR_DIR:/src\" --name=pyspark jupyter/pyspark-notebook spark-subm... | 45.515152 | 188 | 0.671771 |
009a87d37ea149660b269eb6ad6252f0479f5630 | 764 | py | Python | reverse_linked_list.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | reverse_linked_list.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | reverse_linked_list.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param {ListNode} head
# @return {ListNode}
def reverseList(self, head):
prev = head
current = head.next
future = current.next
#... | 15.591837 | 36 | 0.633508 |
00ef28d858c03a95ff1b7f639fd342330b85a672 | 84 | py | Python | ds/practice/daily_practice/20-11/color_ranger.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | ds/practice/daily_practice/20-11/color_ranger.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | ds/practice/daily_practice/20-11/color_ranger.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Helper functions for creating color ranges and programmatic color palettes.
"""
| 21 | 75 | 0.77381 |
975b3f6b2c690444ae253d3679afab281264a4f9 | 971 | py | Python | daten_ergaenzen.py | JD46/data-frame | 1f9a73abb3dccc939583739c293274f1bc4f54d1 | [
"CC0-1.0"
] | null | null | null | daten_ergaenzen.py | JD46/data-frame | 1f9a73abb3dccc939583739c293274f1bc4f54d1 | [
"CC0-1.0"
] | null | null | null | daten_ergaenzen.py | JD46/data-frame | 1f9a73abb3dccc939583739c293274f1bc4f54d1 | [
"CC0-1.0"
] | null | null | null | import pandas as pd
dt_filename = 'Datensammlung.xlsx'
# Hier den Dateinamen der Quelldatein der fehldenden Werte angeben
new_data_filename = 'Daten_fehlende.xlsx'
# Dateien einlesen und die Spalten bennenen
dt = pd.read_csv(dt_filename, index_col = [0,1])
new_data = pd.read_excel(new_data_filename, index_col = [0,3]... | 26.243243 | 91 | 0.661174 |
a9c6627766b5a31fb30793d339ac0daee7fa731a | 5,464 | py | Python | gpmf.py | sethitow/gpmf | fdccefbb1df67739469d7f8c6ec8a057b50575cf | [
"MIT"
] | 2 | 2020-01-31T22:55:07.000Z | 2020-10-23T09:23:19.000Z | gpmf.py | sethitow/gpmf | fdccefbb1df67739469d7f8c6ec8a057b50575cf | [
"MIT"
] | null | null | null | gpmf.py | sethitow/gpmf | fdccefbb1df67739469d7f8c6ec8a057b50575cf | [
"MIT"
] | null | null | null | import argparse
import datetime
import io
import json
import logging
import os
import struct
import sys
import dateutil.parser
LOG = logging.getLogger(__name__)
def parse(f, file_size):
node_list = []
while True:
if f.tell() >= file_size:
break
four_cc = f.read(4).decode("ASCII"... | 35.025641 | 98 | 0.497804 |
a9fe528765a72aa6cce9f51d10d3c8c917892129 | 20,111 | py | Python | db.py | BackInBash/cov19-ki | 793239f5ed2de985f367c590316fe0b710724d82 | [
"MIT"
] | null | null | null | db.py | BackInBash/cov19-ki | 793239f5ed2de985f367c590316fe0b710724d82 | [
"MIT"
] | null | null | null | db.py | BackInBash/cov19-ki | 793239f5ed2de985f367c590316fe0b710724d82 | [
"MIT"
] | null | null | null | # Create SQLite Database
import sqlite3
from sqlite3 import Error
import threading
threadLimiter = threading.BoundedSemaphore(2)
lock = threading.Lock()
def create_connection():
""" create a database connection to a SQLite database """
conn = None
try:
conn = sqlite3.connect("file:data.db?cache=s... | 54.061828 | 291 | 0.498881 |
e78c589ebf5f395397ebb83dfe26470cf76e5a58 | 803 | py | Python | BeautifulData/BeautifulData/views/account.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | BeautifulData/BeautifulData/views/account.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | BeautifulData/BeautifulData/views/account.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Datetime: 2019/1/1
@Author: Zhang Yafei
"""
from flask import Blueprint,render_template, redirect, request, session
from BeautifulData.forms import LoginForm
from settings import NICKNAME
ac = Blueprint('ac', __name__)
@ac.route('/login', methods=['GET','POST'])
def login():
if requ... | 25.09375 | 80 | 0.655044 |
e7d2bade26bc8f7788b7213ec7841c306e417dd5 | 10,721 | py | Python | research/cv/tinynet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/tinynet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/tinynet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 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... | 46.411255 | 101 | 0.618879 |
99f0d69c53fb5765405973c23a5145b0d8d8daa1 | 3,456 | py | Python | kollektiv5gui/generators/AbstractGenerator.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | kollektiv5gui/generators/AbstractGenerator.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | kollektiv5gui/generators/AbstractGenerator.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | import time
from multiprocessing import Process
from threading import Thread
from kollektiv5gui.util import api, logging
class AbstractGenerator(Thread):
"""
Base class for image generators
"""
# How many images are created at once
IMAGE_COUNT = 1
# Does this generator provide options?
PR... | 26.790698 | 76 | 0.602141 |
82221d10d164b1eb94952172dbe98a8a7fb3fc8f | 1,375 | py | Python | nz_crawl_demo/day4/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day4/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day4/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | #encoding:utf-8
import re
import requests
#深度爬取 递归
from lxml import etree
headers = {
"User-Agent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
}
def getHTML(url):
try:
res = requests.get(url,headers=headers)
# pri... | 28.645833 | 140 | 0.581818 |
ec4c5c4ab9e1b31389b31a483720be7f4a0f3bee | 1,109 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Search/Minimum Time Required/minimum_time.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Search/Minimum Time Required/minimum_time.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Search/Minimum Time Required/minimum_time.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the minTime function below.
def minTime(machines, goal):
length = len(machines)
slow = max(machines)
fast = min(machines)
upper = math.ceil(goal / length) * slow
lower = goal // length * fast
days = (upper + low... | 22.18 | 66 | 0.569883 |
6b9d76fe80bd95a5c455fc776c4ba151bc426309 | 1,739 | py | Python | SQL_python/DataBasePython/py_insert.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | SQL_python/DataBasePython/py_insert.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | SQL_python/DataBasePython/py_insert.py | cartellefo/projet | 23c67e847b415fb47f71e830b89a227fffed109b | [
"MIT"
] | null | null | null | #import psycopg2
#conn = psycopg2.connect("dbname='postgres' user='postgres' host='localhost' password='dbpass'")
#cur = conn.cursor()
#cur.execute(vendeur, (15,catherine))
import psycopg2
#from config import config
def insert_vendor(vendor_name):
sql = """INSERT INTO vendors(vendor_name)
... | 22.881579 | 103 | 0.566417 |
d479ece8a698f6096f30e5742f8c77c9043c95ef | 487 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/save_system_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_0/save_system_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/save_system_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint
def execute():
"""
save system settings document
"""
frappe.reload_doc("core", "doctype", "system_settings")
doc = frappe.g... | 23.190476 | 57 | 0.753593 |
2e3fbcfaae400aa6f837deb87b75bb2b97c8a949 | 1,825 | py | Python | modeling/__init__.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | modeling/__init__.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | modeling/__init__.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@description:
@author: LiuXin
@contact: xinliu1996@163.com
@Created on: 2020/11/10 下午2:44
"""
import torch
import torch.nn as nn
from modeling.backbone import build_backbone
from modeling.head import build_head,build_auxiliary_head
from modeling.skmtnet import SkmtNet
from modeling.sync_ba... | 26.838235 | 115 | 0.725479 |
cf051ebad89c43cd1d90a7c69e925164af635d5a | 662 | py | Python | TestCodeArchive/PythonCode/Pathfinding/uiTest.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | TestCodeArchive/PythonCode/Pathfinding/uiTest.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | TestCodeArchive/PythonCode/Pathfinding/uiTest.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | import tkinter as tk
def create_grid(event=None):
w = c.winfo_width() # Get current width of canvas
h = c.winfo_height() # Get current height of canvas
c.delete('grid_line') # Will only remove the grid_line
# Creates all vertical lines at intevals of 100
for i in range(0, w, 50):
c.create_... | 28.782609 | 58 | 0.648036 |
cf31a2d84b12302c2bee7c94cc5e85225a74c617 | 1,088 | py | Python | src/visitpy/pyavt/examples/visit_py_expr_test.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/pyavt/examples/visit_py_expr_test.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/pyavt/examples/visit_py_expr_test.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # [VisIt Python Script]
#
# Driver to test example python expression.
#
# Usage:
# visit -o path/to/rect2d.silo -nowin -cli -s visit_py_expr_test.py
#
def script_path():
# path magic to make sure we can locate the script file
# no matter where we run visit from
script_dir = os.path.split(__visit_source_f... | 24.177778 | 68 | 0.673713 |
5aefa058b2f4861309267ab5977655cb973084a4 | 640 | py | Python | ProjectEuler_plus/euler_036.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_036.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_036.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from math import sqrt
def is_palindromic(n):
return n == n[::-1]
def convert(n, base):
T = "0123456789ABCDEF"
q, r = divmod(n, base)
if q == 0:
return T[r]
else:
return convert(q, base) + T[r]
ret = []
max_n, base = map(int, input().split())
if b... | 22.068966 | 72 | 0.559375 |
51b84484a9f9638b65a81aba39a806dd04fc0716 | 3,182 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/generateStationEdges.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/generateStationEdges.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/generateStationEdges.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) 2012-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... | 43.589041 | 110 | 0.637335 |
5ce239a7fd8618ec21c9fc97915d15cb85d59bbf | 1,818 | py | Python | Kapitel_6/_1_pythons_weg.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | 1 | 2020-12-24T15:42:54.000Z | 2020-12-24T15:42:54.000Z | Kapitel_6/_1_pythons_weg.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | Kapitel_6/_1_pythons_weg.py | Geralonx/Classes_Tutorial | 9499db8159efce1e3c38975b66a9c649631c6727 | [
"MIT"
] | null | null | null | # Helper Klasse um im Beispiel mit Bases arbeiten zu könne.
class Base:
pass
# # Class-Head
# class MyClass(Base):
# # Class-Body
# class_attr = 42
# def __init__(self, arg1):
# self.arg1 = arg1
# def say_hi(self):
# print("hi")
# Der Class-Header wird in den Namen und die Elter... | 30.3 | 169 | 0.731023 |
8fdb63c8b63000426287016e40fbc0220dc66d11 | 1,369 | py | Python | src/server/app/repository/standby/WorkspaceRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/repository/standby/WorkspaceRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/repository/standby/WorkspaceRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ..models.Workspace import Workspace
from ..db.settings import mongoclient
from .CustomException import CustomException
import time
import json
import random
class WorkspaceRepository():
def __init__(self, testing):
self.testing = testing
def createWorkspace(self, name, users, creator):
... | 29.12766 | 122 | 0.636231 |
8f2f072637aa24d1e100a77124d15315370eb0d3 | 1,636 | py | Python | opencv/thresh.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | opencv/thresh.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | opencv/thresh.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | '''
图像阈值操作
'''
import cv2
import matplotlib.pyplot as plt
import numpy as np
'''
res, dst = cv2.threshold(src, thresh, maxval, type)
thresh: 阈值,一般取127。
maxval: 当像素值超过阈值(或小于阈值, 根据type来决定), 所赋予的值
type: 二值化操作的类型, 包含以下5种类型:
- cv2.THRESH_BINARY 二值法, 超过阈值thresh部分取最大值,否则取0
- cv2.THRESH_BINARY_INV ... | 29.745455 | 119 | 0.68154 |
713c2ba2d3258d09c11f2fabe536c7a7cc26e04b | 3,731 | py | Python | Webpage/member/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/member/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/member/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from PIL import Image
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
import os
from phonenumber_field.modelfields import PhoneNumberField
from django_resized import ResizedImageField
import secrets
# from arbei... | 34.546296 | 160 | 0.678638 |
a4774c400211bf5de00a255f0596d556b72ef372 | 2,122 | py | Python | cs/lambda_cs/07_computer_architecture/notes/674/twoscomplement.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/07_computer_architecture/notes/674/twoscomplement.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/07_computer_architecture/notes/674/twoscomplement.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Why does bitwise NOT (~) produce negative numbers?
It has to do with how negative numbers are represented in memory. It's done
with something called _2's Complement_.
For this week, we've been assuming all numbers are unsigned, i.e. only
positive.
Which means that an 8 bit 255 is 0b11111111. And 0 is 0b00000000.... | 22.817204 | 79 | 0.655514 |
f11e39f47ae5e16b9250e35099a3d783bc593957 | 30 | py | Python | rdlcompiler/systemrdl/test/Parser.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | 4 | 2016-05-10T20:40:34.000Z | 2020-04-09T13:23:33.000Z | rdlcompiler/systemrdl/test/Parser.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | rdlcompiler/systemrdl/test/Parser.py | MegabytePhreak/rdl | b97912751738da9fddb42a9155f5823716809fc0 | [
"MIT"
] | null | null | null | __author__ = 'MegabytePhreak'
| 15 | 29 | 0.8 |
2d2402a4686ab5e353cab18b76faba3043e2e99b | 1,139 | py | Python | tests/onegov/org/test_views_photoalbum.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_views_photoalbum.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_views_photoalbum.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import re
from webtest import Upload
from tests.shared.utils import create_image
def test_manage_album(client):
client.login_editor()
albums = client.get('/photoalbums')
assert "Noch keine Fotoalben" in albums
new = albums.click('Fotoalbum')
new.form['title'] = "Comicon 2016"
new.form.subm... | 26.488372 | 76 | 0.667252 |
747524ebf5d7c67de174c34e1b43535ac77ff2c6 | 3,103 | py | Python | db_config.py | Joseorina/upgraded-adventure | c925963def44225a34212fdd7d0cc5b453727b60 | [
"MIT"
] | 1 | 2019-10-07T02:01:17.000Z | 2019-10-07T02:01:17.000Z | db_config.py | Joseorina/upgraded-adventure | c925963def44225a34212fdd7d0cc5b453727b60 | [
"MIT"
] | null | null | null | db_config.py | Joseorina/upgraded-adventure | c925963def44225a34212fdd7d0cc5b453727b60 | [
"MIT"
] | null | null | null | import os
import psycopg2 as p
from database import Postgres
DATABASE_URL = os.getenv('DATABASE_URL')
class PostgresConfig(Postgres):
def connect(self, database_url):
"""
Create a connection to postgres database
Arguments:
database_url {URl containing user login details}
"""
try:
connectio... | 22.323741 | 91 | 0.678376 |
7013a2e99e15582811ac4f449b136e60a06745f6 | 665 | py | Python | servers/docker-python/topic_kafka.py | veaba/ncov | 6019f6b90761fd39363f8a7182ffcee22b9cb7ed | [
"MIT"
] | 288 | 2020-01-21T06:12:03.000Z | 2022-01-16T08:03:13.000Z | servers/docker-python/topic_kafka.py | kayan12/ncov | 90f828208d1eea7cc20e933da41638f328e0411d | [
"MIT"
] | 26 | 2020-01-20T05:07:31.000Z | 2022-03-12T00:24:56.000Z | servers/docker-python/topic_kafka.py | kayan12/ncov | 90f828208d1eea7cc20e933da41638f328e0411d | [
"MIT"
] | 48 | 2020-01-22T09:05:59.000Z | 2022-01-16T08:03:11.000Z | from config import KAFKA_NEWS_TOPIC, KAFKA_HOST,KAFKA_HOT_TOPIC
from kafka import KafkaAdminClient
# 删除一个topic
def delete_kafka(topic_name):
adminClient = KafkaAdminClient(
bootstrap_servers=[KAFKA_HOST],
)
adminClient.delete_topics(topics=[topic_name])
# 创建一个topic
def create_topic(topic_name):
... | 24.62963 | 63 | 0.744361 |
565621a692b7fc36403c2da6a2a10c24327947bb | 1,971 | py | Python | Packs/CortexXDR/Scripts/CortexXDRIdentityInformationWidget/CortexXDRIdentityInformationWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CortexXDR/Scripts/CortexXDRIdentityInformationWidget/CortexXDRIdentityInformationWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CortexXDR/Scripts/CortexXDRIdentityInformationWidget/CortexXDRIdentityInformationWidget.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
import traceback
''' COMMAND FUNCTION '''
def get_identity_info() -> List[Dict]:
context = demisto.context()
alerts = demisto.get(context, 'PaloAltoNetworksXDR.OriginalAlert')
if not alerts:
raise DemistoException('PaloAltoNetworksXDR.OriginalAlert is not in the ... | 35.836364 | 108 | 0.631659 |
3b56de564641180005587c54e3ab6349189eda55 | 785 | py | Python | mcsf/services/ssh.py | beremaran/mcsf | 7651e849b860cf4f0517fa8e4fc4b7a417bbc3a4 | [
"MIT"
] | null | null | null | mcsf/services/ssh.py | beremaran/mcsf | 7651e849b860cf4f0517fa8e4fc4b7a417bbc3a4 | [
"MIT"
] | null | null | null | mcsf/services/ssh.py | beremaran/mcsf | 7651e849b860cf4f0517fa8e4fc4b7a417bbc3a4 | [
"MIT"
] | null | null | null | import logging
import paramiko
class SshService:
def __init__(self, ip_address: str):
assert ip_address is not None
self.ssh = paramiko.client.SSHClient()
self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
self.ssh.load_system_host_keys()
while True:
... | 23.787879 | 70 | 0.573248 |
8ec80b9233761eb74a8d145356f29b99275881f8 | 79,341 | py | Python | crow-2.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | crow-2.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | crow-2.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #Compiled By Ahmad Riswanto
#Facebook : https://www.facebook.com/ahmad.riswanto.180
import marshal
exec(marshal.loads('c\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00@\x00\x00\x00s\xe5\x02\x00\x00d\x00\x00d\x01\x00l\x00\x00Z\x00\x00d\x00\x00d\x01\x00l\x01\x00Z\x01\x00d\x00\x00d\x01\x00l\x02\x00Z\x02\x00d\x00\x00d\... | 19,835.25 | 79,239 | 0.752423 |
7962ba24b6af40691e7ce6e88ffcdb4fcd69196e | 989 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/Gs/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 282 | 2016-06-16T14:41:44.000Z | 2022-03-02T03:43:02.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/Gs/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 146 | 2016-06-16T08:55:45.000Z | 2020-09-08T10:37:32.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/Gs/__init__.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 94 | 2016-06-16T10:49:07.000Z | 2022-03-28T09:14:03.000Z | from Gs import Gs # NOQA
def config(parser):
parser.add_argument("--upload.gs.project_id", dest="upload.gs.project_id", type=str,
help="Google Cloud Storage Project ID (required for GS upload)")
parser.add_argument("--upload.gs.access_key", dest="upload.gs.access_key", type=str,
... | 61.8125 | 109 | 0.665319 |
7969c5eeae7450f0ca99407497aa667caa0bfb61 | 3,174 | py | Python | wz/ui/pupil_grid.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui/pupil_grid.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/ui/pupil_grid.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ui/pupil_grid.py
Last updated: 2021-05-21
Manage the grid for the pupil-data editor.
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License... | 32.387755 | 77 | 0.575614 |
8dc35ae0cf518bd534e81c316b9b751a18648c00 | 513 | py | Python | Python/kivy/multiple_screens.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/kivy/multiple_screens.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/kivy/multiple_screens.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.label import Label
# Define our different screens
class FirstWindow(Screen):
pass
class SecondWindow(Screen):
pass
class WindowManager(ScreenManage... | 17.1 | 56 | 0.738791 |
8df83bf2f8bd64d7eeca34bb461ace12f25ac066 | 1,219 | py | Python | tools/compare.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 10 | 2017-03-17T13:13:44.000Z | 2022-02-09T17:12:03.000Z | tools/compare.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 74 | 2017-12-14T18:42:43.000Z | 2022-03-08T16:22:52.000Z | tools/compare.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 36 | 2017-12-19T17:00:24.000Z | 2022-03-04T13:06:52.000Z | #!/usr/bin/env python3
import argparse
import logging
import xml.etree.ElementTree as et
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
nsmap = {
'dc': '{http://purl.org/dc/elements/1.1/}'
}
parser = argparse.ArgumentParser(description='Compare xml files and show which urls are not in the ... | 27.088889 | 118 | 0.641509 |
30f5b25ab25198db2390aedd6ff987f2952039fa | 1,042 | py | Python | exercises/es/test_04_11_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_04_11_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_04_11_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
len(TRAINING_DATA) == 3
), "Parece que hay algo mal con los datos. Esperaba 3 ejemplos."
assert all(
len(entry) == 2 and isinstance(entry[1], dict) for entry in TRAINING_DATA
), "Formato incorrecto de los datos de entrenamiento. Esperaba una lista de tuples dónde el ... | 57.888889 | 125 | 0.653551 |
ccfa25b752cc63aaf149ce1bcb01eb78d10a3c23 | 756 | py | Python | src/onegov/winterthur/theme/winterthur_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/theme/winterthur_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/theme/winterthur_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import module_path
from onegov.org.theme import OrgTheme
NEWSGOT = '"NewsGot", Verdana, Arial, sans-serif;'
# options editable by the user
user_options = {
'primary-color': '#e33521',
'font-family-sans-serif': NEWSGOT
}
class WinterthurTheme(OrgTheme):
name = 'onegov.winterthur.fo... | 23.625 | 78 | 0.652116 |
cef34fee675c0cf570b6aad65501dccc63bbc39a | 7,382 | py | Python | Packs/ML/main.py | sunflowerslj/content-1 | 79f984555f8d0b33231af3f9bab41d9246106bc7 | [
"MIT"
] | null | null | null | Packs/ML/main.py | sunflowerslj/content-1 | 79f984555f8d0b33231af3f9bab41d9246106bc7 | [
"MIT"
] | null | null | null | Packs/ML/main.py | sunflowerslj/content-1 | 79f984555f8d0b33231af3f9bab41d9246106bc7 | [
"MIT"
] | null | null | null | #Creating GUI with tkinter
import tkinter
from tkinter import *
import pandas as pd
import os
import torch
import pickle
from abc import ABC
import yaml
from pytorch_pretrained_bert import BertTokenizer
import numpy as np
from abc import abstractmethod
import warnings
warnings.filterwarnings("ignore")
import webbrowse... | 27.856604 | 195 | 0.626118 |
0672c1d4e52cd8c11967aa776e8415b5b68d39a8 | 5,735 | py | Python | verto/tests/SaveTitleTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/tests/SaveTitleTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/tests/SaveTitleTest.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | import markdown
from unittest.mock import Mock
from verto.VertoExtension import VertoExtension
from verto.processors.SaveTitlePreprocessor import SaveTitlePreprocessor
from verto.tests.ProcessorTest import ProcessorTest
class SaveTitleTest(ProcessorTest):
'''Tests to check the 'save-title' preprocesser works as in... | 45.88 | 131 | 0.727986 |
9da81f7126102aca39b1f8bc4ef2d838a6a3747a | 698 | py | Python | scripts/input-sqlmap.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T22:29:44.000Z | 2022-01-28T22:29:44.000Z | scripts/input-sqlmap.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | null | null | null | scripts/input-sqlmap.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T21:10:41.000Z | 2022-01-28T21:10:41.000Z | import os
import argparse
import re
def main(input_file):
# use input file
with open(input_file, "r") as myfile:
content = myfile.readlines()
for line in content:
start_wizard(line.strip())
def start_wizard(url):
print("Start with: " + url)
match = re.search(r"\d+$", url)
... | 31.727273 | 86 | 0.626074 |
ae5aa2c75df4cf2902b3c44cf85928dfc8d382c7 | 628 | py | Python | exam_notes/exam_notes/web/migrations/0002_note.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | exam_notes/exam_notes/web/migrations/0002_note.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | exam_notes/exam_notes/web/migrations/0002_note.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-22 17:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Note',
fields=[
('id', models.... | 27.304348 | 117 | 0.562102 |
c996be9aa8e8479c9630893641d81d96d475a682 | 1,308 | py | Python | Packs/GetFields/Scripts/GetFields/GetFields.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GetFields/Scripts/GetFields/GetFields.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GetFields/Scripts/GetFields/GetFields.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def get_fields(args):
"""
Retrieves fields from an object using dot notation by leveraging demisto.get().
:param args: dictionary containing the Demisto arguments object.
:return: hr_string as a human readable s... | 30.418605 | 95 | 0.651376 |
14ef49aaa1efddf87fb6ae4ae3571fff6959412d | 282 | py | Python | demos/Multiscale/ThreeSidedBasic/model/parts/kpis.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/ThreeSidedBasic/model/parts/kpis.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/ThreeSidedBasic/model/parts/kpis.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | # Behaviors
def kpis(params, step, history, current_state):
return {'Stat': 1}
# Mechanisms
def COGS(params, step, sL, s, _input):
y = 'COGS'
if _input['Stat'] == 1:
x = (s['product_cost'] * s['tx_volume'])
else:
x = s['COGS']
return (y, x)
| 17.625 | 49 | 0.542553 |
14f19d47ac079de49d644eae537ad95c014c89b5 | 2,908 | py | Python | year_3/databases_sem2/lab2/wikimanager/page.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem2/lab2/wikimanager/page.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem2/lab2/wikimanager/page.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | import os
import urllib.request
import wikitextparser as wtp
from lxml import etree
def get_wiki_xml_page(wiki_url):
request = urllib.request.Request(wiki_url, headers={'User-Agent': 'Lab2/1.0'})
url = urllib.request.urlopen(request)
content = url.read().decode('utf-8')
return content
def parse_wik... | 38.773333 | 118 | 0.624828 |
0936fce8635dff4b0d2e8b1233fb0ae6369d1e61 | 973 | py | Python | top/clearlight/base/liaoxuefeng/base/Dict.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/base/Dict.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/base/Dict.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # dict: 使用键-值存储
d = {'Mike': 90, 'Bob': 70, 'Luck': 100}
print(d['Luck'])
# 最后放入key的value, 将会把前面的值冲掉
d['Mike'] = 98
print(d)
# 避免key不存在的错误
# 1. 通过in判断key是否存在
if 'Mike' in d:
print(d['Mike'])
# get(): 如果key不存在可以返回None或者返回指定的value, 若存在则返回key对应的value
print(d.get('Bob'))
print(d.get('Blue', -1))
print(d.get('Bob', 9... | 15.203125 | 56 | 0.585817 |
fef2ca75c4aaf466e8dd3f5010a23411e53d7a10 | 683 | py | Python | Lab6/markdown.py/CustomTest.py | zwimer/IntroToOpenSourceLabs | 2c8592d84355cd4c80b2693e08c931902bb85e6f | [
"MIT"
] | null | null | null | Lab6/markdown.py/CustomTest.py | zwimer/IntroToOpenSourceLabs | 2c8592d84355cd4c80b2693e08c931902bb85e6f | [
"MIT"
] | null | null | null | Lab6/markdown.py/CustomTest.py | zwimer/IntroToOpenSourceLabs | 2c8592d84355cd4c80b2693e08c931902bb85e6f | [
"MIT"
] | null | null | null | import unittest
from markdown_adapter import run_markdown
class TestMarkdownPy(unittest.TestCase):
def setUp(self):
pass
def testOneOctothorpe(self):
self.assertEqual(run_markdown('#OneOct'), '<p><h1>OneOct</h1></p>')
def testTwoOctothorpe(self):
self.assertEqual(run_mark... | 27.32 | 81 | 0.635432 |
fefe77f1c893fe0bfe13eba7d4b552e99db48fe8 | 8,706 | py | Python | pupil_invisible_monitor/src/pupil_invisible_monitor/window.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/src/pupil_invisible_monitor/window.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/src/pupil_invisible_monitor/window.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | import logging
import typing as T
from contextlib import contextmanager
import glfw.GLFW as glfw
import numpy as np
from pyglui import cygl, ui
from . import gl_utils
from .event_loop import WindowEventLoop
from .observable import Observable
logger = logging.getLogger(__name__)
def normalize(pos, ... | 34.547619 | 89 | 0.623133 |
28e30f7b493108b5a7b85c0e4018b95004ff13dc | 593 | py | Python | src/compgen2/correction/trie_levenshtein.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | 1 | 2022-02-02T12:41:06.000Z | 2022-02-02T12:41:06.000Z | src/compgen2/correction/trie_levenshtein.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | src/compgen2/correction/trie_levenshtein.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | # Keep some interesting statistics
NodeCount = 0
WordCount = 0
# The Trie data structure keeps a set of words, organized with one node for
# each letter. Each node has a branch for each letter that may follow it in the
# set of words.
class TrieNode:
def __init__(self):
self.word = None
self.child... | 25.782609 | 79 | 0.625632 |
3a7a907a45bd78ddb7427a5cf20a22d11678dbf3 | 6,483 | py | Python | 20-fs-ias-lec/groups/07-logStore/src/tests/test_verify_insertion.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/07-logStore/src/tests/test_verify_insertion.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/07-logStore/src/tests/test_verify_insertion.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import secrets # Comes with python
from contextlib import contextmanager
import os
import unittest
from nacl.signing import SigningKey
from ..logStore.funcs.EventCreationTool import EventFactory
from ..logStore.funcs.log import create_logger
from ..logStore.verific.verify_insertion import Verification
from ..logStore.... | 37.045714 | 102 | 0.625945 |
a365b8744375c0428fb1d342a7d63a4ae914f42c | 1,496 | py | Python | scripts/HelloPython/bsp03_Vererbung.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/HelloPython/bsp03_Vererbung.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/HelloPython/bsp03_Vererbung.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | class PersonKl: #Basisklasse
# Konstruktor
def __init__(self, vorname, nachname, geburtsdatum):
#setzen der private Attribute
self._vorname = vorname
self._nachname = nachname
self._geburtsdatum = geburtsdatum
# Funnktion der Basisklasse
# Wenn eine Klas... | 37.4 | 88 | 0.650401 |
6e8f324aa951aaa8eff9dc112b164e5464b7177b | 1,308 | py | Python | 数据结构/NowCode/20_Add.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/20_Add.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/20_Add.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | # 链表中环的入口结点
# 给一个链表,若其中包含环,请找出该链表的环的入口结点,否则,输出null
# -*- coding:utf-8 -*-
class Solution:
def Add(self, num1, num2):
# 第一种代码:循环。简洁但是原理相同,那么我们以下面第二段代码为例;来解析。
# while (num2):
# num1, num2 = (num1 ^ num2) & 0xFFFFFFFF, ((num1 & num2) << 1) & 0xFFFFFFFF
# return num1 if num1 <= 0x7F... | 37.371429 | 88 | 0.567278 |
42e8ef2235438c70147a2fbf7da297c57141fb6d | 2,583 | py | Python | Packs/CommonScripts/Scripts/PortListenCheck/PortListenCheck_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-11-02T05:36:38.000Z | 2021-11-02T05:36:38.000Z | Packs/CommonScripts/Scripts/PortListenCheck/PortListenCheck_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/CommonScripts/Scripts/PortListenCheck/PortListenCheck_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-12-20T15:12:22.000Z | 2021-12-20T15:12:22.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def test_port_listen_check_success(mocker):
"""
Given:
Valid port and host
When:
Attempting to connect to a host on a given port
Then:
- human_readable should indicate the connection was ... | 31.120482 | 93 | 0.695316 |
6e47cc8f0838990ef6887fbd2e012ac0c0eeeb71 | 1,707 | py | Python | packages/watchmen-storage-mongodb/src/watchmen_storage_mongodb/data_source_mongo.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-mongodb/src/watchmen_storage_mongodb/data_source_mongo.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-mongodb/src/watchmen_storage_mongodb/data_source_mongo.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from watchmen_model.common import DataModel
from watchmen_model.system import DataSource
from watchmen_storage import DataSourceHelper
from .engine_mongo import MongoEngine
from .storage_mongo import StorageMongoDB, TopicDataStorageMongoDB
def redress_url(value: str) -> str:
if value is None:
return ''
else:
re... | 30.482143 | 102 | 0.782074 |
956d800bc32e9d50c7529b6ef1886ad9a7a1db85 | 101,228 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/landuse/landuse.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/contributed/sumopy/coremodules/landuse/landuse.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/contributed/sumopy/coremodules/landuse/landuse.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 44.810978 | 182 | 0.486782 |
2556cd64fcccdebf330d0a7d365de1c8477fdb4c | 9,399 | py | Python | scripts/regression_test.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | scripts/regression_test.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | scripts/regression_test.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | # This script runs in the Regression Test CI.
# We build the current commit and compare it with the Master branch.
# If there is a diference of 10% in regression on any query the build breaks.
import statistics
import time
import subprocess
import math
import duckdb
import duckcurrent
import sys
import requests
def do... | 52.50838 | 209 | 0.703266 |
b048b399aedc8a153d15e1b3876a2b3e136bad28 | 401 | py | Python | app/controllers/abtms/ComprovanteController.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/controllers/abtms/ComprovanteController.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/controllers/abtms/ComprovanteController.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z |
from app.models.abtms.Payment import Payment
from app.models.abtms.ComprovantePF import ComprovantePF
from app import app
from flask import send_from_directory
@app.route("/abtms/comprovantes/<charge_id>/")
def get_comprovante(charge_id):
comprovante = ComprovantePF().getComprovanteByCharge(charge_id)
retur... | 30.846154 | 89 | 0.802993 |
05fa4ba3d7dcf2a9559fe1bd65f8aee73c862100 | 718 | py | Python | app/utils/temp_toke.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | app/utils/temp_toke.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | app/utils/temp_toke.py | jorgearojas25/FlaskLogin | 24dd5353643a46bbb34ed1097c11d84c203f8f38 | [
"MIT"
] | null | null | null | from threading import Timer,Thread,Event
# clase que ejecuta una funcion cada cierto tiempo
class perpetualTimer():
def __init__(self,t):
self.t=t
self.thread = Timer(self.t,self.handle_function)
# anexar funcion qeu sera ejecutada
def setFunction(self, hFunction):
... | 24.758621 | 56 | 0.608635 |
af3459a3d818b387aa68c038fa09277373dadf4a | 416 | py | Python | nz_django/day1/urlparams_demo/book/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day1/urlparams_demo/book/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day1/urlparams_demo/book/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse('图书首页')
def book_detail(request,book_id,category_id):
text = '您获取的图书id是:%s,图书分类是:%s' % (book_id,category_id)
return HttpResponse(text)
#http://127.0.0.1:8000/book/author/?id=666
def author(request):
... | 26 | 58 | 0.709135 |
afbeebc110d8c9415abf3030ee723f00b8ddb4bf | 3,138 | py | Python | tests/test_regionaletarifpreisposition.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_regionaletarifpreisposition.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_regionaletarifpreisposition.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.kriteriumwert import KriteriumWert
from bo4e.com.regionalegueltigkeit import RegionaleGueltigkeit
from bo4e.com.regionalepreisstaffel import RegionalePreisstaffel
from bo4e.com.regionaletarifpreisposition import RegionaleTarifpreisposition... | 40.753247 | 111 | 0.629063 |
3c39b9557d615351b8538dfece98d77598ffb3a7 | 3,568 | py | Python | Abiturklassen/Python/list.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 2 | 2020-09-24T12:11:16.000Z | 2022-03-31T04:47:24.000Z | Abiturklassen/Python/list.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 1 | 2021-02-27T15:06:27.000Z | 2021-03-01T16:32:48.000Z | Abiturklassen/Python/list.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 1 | 2021-02-24T05:12:35.000Z | 2021-02-24T05:12:35.000Z | # -*- coding: utf-8 -*-
class List(object):
class ListNode(object):
def __init__(self, pContent):
self._contentObject = pContent
self._next = None
def getContentObject(self):
return self._contentObject
def setContentObject(self, pContent):
... | 29.245902 | 77 | 0.536996 |
b1b6a91777501cdfa846d81b35c7e0da5ca89ffd | 4,091 | py | Python | src/onegov/org/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.org.models.atoz import AtoZ
from onegov.org.models.clipboard import Clipboard
from onegov.org.models.dashboard import Boardlet
from onegov.org.models.dashboard import BoardletFact
from onegov.org.models.dashboard import Dashboard
from onegov.org.models.directory import DirectorySubmissionAction
from onegov.... | 37.190909 | 78 | 0.801271 |
595134ad94188410088662556d21b7249af3a32f | 306 | py | Python | scripts/get_item_types.py | innun/CDDAdb | 372c0e999b5a9d1eb1f579fdb4875250cccfa189 | [
"MIT"
] | 2 | 2020-09-05T13:15:03.000Z | 2021-02-20T09:54:17.000Z | scripts/get_item_types.py | innun/CDDAdb | 372c0e999b5a9d1eb1f579fdb4875250cccfa189 | [
"MIT"
] | 1 | 2020-12-20T12:14:19.000Z | 2020-12-20T12:14:19.000Z | scripts/get_item_types.py | innun/CDDAdb | 372c0e999b5a9d1eb1f579fdb4875250cccfa189 | [
"MIT"
] | null | null | null | import glob
import json
types = set()
for filename in glob.iglob("../data/cdda/data/json/items/" + '**/*.json', recursive=True):
with open(filename) as file:
arr = json.load(file)
for obj in arr:
v = obj['type']
if v:
types.add(v)
print(types)
| 21.857143 | 90 | 0.542484 |
e6310ca5734547405e3bd418846f0a2128a9ac24 | 2,372 | py | Python | backend/apps/use_statistics/views.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/use_statistics/views.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/apps/use_statistics/views.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
import django_tables2 as tables
import os
import pandas as pd
from datetime import datetime
from django.conf impor... | 30.805195 | 108 | 0.712479 |
55bd6124764861a56751e7870cf0f88f47d141db | 1,181 | py | Python | WiSe-2122/Wiederholung/Gruppe-B/Online-Banking.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Wiederholung/Gruppe-B/Online-Banking.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Wiederholung/Gruppe-B/Online-Banking.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
# Entwickeln Sie eine Eingabemaske, in welche der Kunde einen Überweisungsbetrag
# eingeben und abschicken kann. Der Betrag soll auf seine Höhe geprüft werden (betrag > 0 and betrag <= 50.000).
# Außerdem sollen Fehleingaben durch den Nutzer abgefangen werden.
richtige_eingabe = False
kontostand = 2500
def trenner(a... | 42.178571 | 170 | 0.679086 |
34dc82e017b5e4e9b48f890ad1f2c423505a16ea | 20,385 | py | Python | Parsers.py | Turidus/Minecraft-MapMaker | 16e4015d03d67f04cfd247c11c9e3e2a5429b79f | [
"MIT"
] | 1 | 2018-10-24T16:02:08.000Z | 2018-10-24T16:02:08.000Z | Parsers.py | Turidus/Minecraft-MapMaker | 16e4015d03d67f04cfd247c11c9e3e2a5429b79f | [
"MIT"
] | 2 | 2018-07-16T19:04:00.000Z | 2018-07-29T11:43:53.000Z | Parsers.py | Turidus/Minecraft-MapMaker | 16e4015d03d67f04cfd247c11c9e3e2a5429b79f | [
"MIT"
] | null | null | null | """
Provides funcions to transform the differnent data representations into each other.
Uses Pillow for image processing.
Made by Turidus https://github.com/Turidus/Minecraft-MapMaker
Copyright (c) 2018 Turidus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associat... | 32.720706 | 129 | 0.546186 |
9b8feff3eb6cf04212437488d6cd2fe9151d04bf | 967 | py | Python | apps/extensions.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | apps/extensions.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | apps/extensions.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | #导入扩展
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_mail import Mail
from flask_login import LoginManager
from flask_moment import Moment
#创建扩展的对象
bootstrap = Bootstrap()
db = SQLAlchemy()
migrate = Migrate(db=db)
mail = Mail()
login_manager =... | 25.447368 | 47 | 0.759049 |
9ba6bd3e4b157ce9243ee33b536143e790ac63de | 2,685 | py | Python | frappe-bench/apps/erpnext/erpnext/education/doctype/course_schedule/test_course_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/course_schedule/test_course_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/course_schedule/test_course_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import datetime
from frappe.utils import today, to_timedelta
from erpnext.education.utils import OverlapError
# test_records = frappe.get_test_rec... | 38.357143 | 113 | 0.78473 |
fd078cdb03696a06b366334cdf36be82d3b17dc2 | 586 | py | Python | m0leCon/2021/Quals/misc/Proof-of-Work/pow_template.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | m0leCon/2021/Quals/misc/Proof-of-Work/pow_template.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | m0leCon/2021/Quals/misc/Proof-of-Work/pow_template.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from pwn import remote #pip install pwntools
from hashlib import sha256
def solvepow(p, n):
s = p.recvline()
starting = s.split(b'with ')[1][:10].decode()
s1 = s.split(b'in ')[-1][:n]
i = 0
print("Solving PoW...")
while True:
if sha256((starting+str(i)).encode('ascii')).hexdigest()[-n:]... | 24.416667 | 85 | 0.552901 |
1ff4a65bd6644f22ce7b057bec8f5c000acd5bf1 | 318 | py | Python | backend/api/migrations/0002_alter_parking_table.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/migrations/0002_alter_parking_table.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/migrations/0002_alter_parking_table.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-09-04 15:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterModelTable(
name='parking',
table='PPV_Parking',
),
]
| 17.666667 | 47 | 0.578616 |
1ffb8f8201de9ff1584cb9daa99b369a9eea26fd | 4,811 | py | Python | src/visitpy/common/sort_method_doc.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/common/sort_method_doc.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/common/sort_method_doc.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | #!/usr/bin/env python
copyright = '// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt\n'
copyright += '// Project developers. See the top-level LICENSE file for dates and other\n'
copyright += '// details. No copyright assignment is required to contribute to VisIt.\n'
copyright += '\n'
# ... | 26.58011 | 91 | 0.542715 |
1f974b38901bf67048856a9824614ef642689e6d | 138 | py | Python | Chapter4_Intermediate/MultiDimLists.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 2 | 2021-02-13T19:18:00.000Z | 2021-11-10T09:54:49.000Z | Chapter4_Intermediate/MultiDimLists.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | Chapter4_Intermediate/MultiDimLists.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | null | null | null | # (3,)
vector = [1, 2, 3]
print(vector)
# (3, 2)
matrix = [[1, 2], [3, 4], [5, 6]]
print(matrix)
print(matrix[0])
print(matrix[1][0])
| 10.615385 | 33 | 0.514493 |
2f91d380be5533dc12f73793614144cb10f0c3e2 | 624 | py | Python | code/concept/catalog.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | code/concept/catalog.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null | code/concept/catalog.py | lcordier/pfse | 27db9329d12bc804fa322446c14c59fe8f814264 | [
"MIT"
] | null | null | null |
def simple(k, n):
""" Simple example function with no additional parameters.
"""
if (n % 2) == 0:
return((k + 3) % 255)
else:
return((k + 5) % 255)
def simplep(k, n, a, b):
""" Simple example function with additional parameters.
"""
if (n % 2) == 0:
return((k + a) ... | 20.8 | 62 | 0.49359 |
c84b1dae0edffe2dc5d559b6e8e63ac136386e5d | 1,836 | py | Python | official/cv/unet/ascend310_quant_infer/export_bin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/unet/ascend310_quant_infer/export_bin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/unet/ascend310_quant_infer/export_bin.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... | 37.469388 | 116 | 0.685185 |
9e5196cd23c2fe957338cd671fb633d8f03d992c | 1,846 | py | Python | benwaonline/gateways/parameter.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/gateways/parameter.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/gateways/parameter.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | import json
class Parameter(object):
'''
Container for a variety of parameters related to FLASK-REST-JSONAPI/requests.
Args:
include: is a list of strings containing the resources you want included
filters: is a list of dicts forming the filter query (see query.py)
page_size: is an... | 32.964286 | 109 | 0.588841 |
8d2bd092705d8e4281c5450c132bc66091441e72 | 663 | py | Python | Algorithms/Implementation/Breaking_the_record.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Breaking_the_record.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Breaking_the_record.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/breaking-best-and-worst-records/problem?h_r=internal-search
def breakingRecords(scores):
l, h = scores[0], scores[0]
b, w = 0, 0
lowest = []
highest = []
for i in scores:
if i > h:
h = i
b += 1
if i < l:
l = ... | 25.5 | 99 | 0.508296 |
57265b0d40f9b1c9f0bbe4e80364cd3221d8d403 | 294 | py | Python | Cracking_the_Coding_Interview/heaps_find_the_running_median.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Cracking_the_Coding_Interview/heaps_find_the_running_median.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Cracking_the_Coding_Interview/heaps_find_the_running_median.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from bisect import insort_left
arr = []
for _ in range(int(input().strip())):
insort_left(arr, int(input().strip()))
len_arr = len(arr)
mid = len_arr // 2
if len_arr % 2 == 1:
print(arr[mid] / 1)
else:
print((arr[mid] + arr[mid - 1]) / 2)
| 19.6 | 43 | 0.568027 |
f523d1b8141d76f930ed6c5ecd19a234bd97a63c | 2,862 | py | Python | hystreet/geotogemeindeschluessel.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | hystreet/geotogemeindeschluessel.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | hystreet/geotogemeindeschluessel.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | """ Dieses Script kann als Vorlage verwendet werden um lon/lat auf Gemeindeschlüssel
(=ags [amtlicher Gemeindeschlüssel]) zu mappen.
Ich verwende für die Zuordnung einen nearest-neighbor approach.
install geopy by "pip install geopy"
@author Parzival
"""
import pandas as pd
import geopy.distance
import os
import m... | 35.333333 | 124 | 0.674703 |
19555c0f7f2e11bb7259ff109cfcfa5e70866a3e | 308 | py | Python | packages/watchmen-model/src/watchmen_model/console/connected_space.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/connected_space.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/connected_space.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from pydantic import BaseModel
from watchmen_model.common import Auditable, ConnectedSpaceId, LastVisit, SpaceId, UserBasedTuple
class ConnectedSpace(UserBasedTuple, Auditable, LastVisit, BaseModel):
connectId: ConnectedSpaceId = None
spaceId: SpaceId = None
name: str = None
isTemplate: bool = False
| 28 | 97 | 0.808442 |
5fe78c6915d552e55353782df7d652c668f81a15 | 1,043 | py | Python | test.py | HSZemi/wahlskripte | c5251befce64c8bb7a8c0c82f0ad60ea42796e67 | [
"MIT"
] | null | null | null | test.py | HSZemi/wahlskripte | c5251befce64c8bb7a8c0c82f0ad60ea42796e67 | [
"MIT"
] | null | null | null | test.py | HSZemi/wahlskripte | c5251befce64c8bb7a8c0c82f0ad60ea42796e67 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import csv
wvz = {}
with open("wvz.csv", "r") as f:
reader = csv.DictReader(f, delimiter="\t")
for line in reader:
lfdnr = line['Lfd.Nr.'].strip()
vname = line['Vorname'].strip()
nname = line['Nachname'].strip()
matnr = line['Matrikelnummer'].strip()
wvz[matnr] = line
with ope... | 32.59375 | 121 | 0.605944 |
2733d126d0c74bca89147e12697b7f235bfd025c | 2,193 | py | Python | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_AdaptiveMaxPool2d_demo.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_AdaptiveMaxPool2d_demo.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_AdaptiveMaxPool2d_demo.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... | 30.887324 | 115 | 0.609667 |
fda8aab47ff357200414a4d6491b2a502fd39205 | 211 | py | Python | Python/Random/File-Handling/04-write-file.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Random/File-Handling/04-write-file.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Random/File-Handling/04-write-file.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | with open("text2.txt", 'w') as file:
file.write("Test")
file.seek(0)
file.write("st")
with open("text.txt", 'r') as rf, open("text-copy.txt", 'w') as wf:
for line in rf:
wf.write(line)
| 21.1 | 67 | 0.559242 |
e37a2d7aca3fee61da5f8a4fbbddaee78ed08612 | 656 | py | Python | backend/sentiment_analysis/services/twitter/api.py | Matt-Tessitore/sentiment_analysis | 3728825bd1923a83af53a34f99f91ccc52abbc08 | [
"MIT"
] | 1 | 2017-05-12T00:27:46.000Z | 2017-05-12T00:27:46.000Z | backend/sentiment_analysis/services/twitter/api.py | Matt-Tessitore/Sentiment_Analysis | 3728825bd1923a83af53a34f99f91ccc52abbc08 | [
"MIT"
] | null | null | null | backend/sentiment_analysis/services/twitter/api.py | Matt-Tessitore/Sentiment_Analysis | 3728825bd1923a83af53a34f99f91ccc52abbc08 | [
"MIT"
] | 1 | 2017-05-23T03:41:41.000Z | 2017-05-23T03:41:41.000Z | from functools import lru_cache
from tweepy import StreamListener, OAuthHandler, Stream
import settings
@lru_cache()
def get_stream():
auth = OAuthHandler(settings.CONSUMER_KEY,
settings.CONSUMER_SECRET)
auth.set_access_token(settings.ACCESS_TOKEN,
settings.A... | 21.16129 | 55 | 0.679878 |
8b6c451673394800a00afedb6ade9c4847b6c478 | 339 | py | Python | qmk_firmware/lib/python/qmk/cli/list/keyboards.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | qmk_firmware/lib/python/qmk/cli/list/keyboards.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/list/keyboards.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """List the keyboards currently defined within QMK
"""
from milc import cli
import qmk.keyboard
@cli.subcommand("List the keyboards currently defined within QMK")
def list_keyboards(cli):
"""List the keyboards currently defined within QMK
"""
for keyboard_name in qmk.keyboard.list_keyboards():
pr... | 24.214286 | 66 | 0.740413 |
47b3593c50ef343057a1387b6075ecf317618ce2 | 2,507 | py | Python | spo/spo/report/rechnungsabgrenzung/rechnungsabgrenzung.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | null | null | null | spo/spo/report/rechnungsabgrenzung/rechnungsabgrenzung.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/spo/report/rechnungsabgrenzung/rechnungsabgrenzung.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # Copyright (c) 2013, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.data import getdate, date_diff
from frappe import _
def execute(filters=None):
columns, data = get_columns(filters), get_data(filters)
return col... | 41.098361 | 135 | 0.701635 |
9a2f4cddfce54f0d990bbb6783729564f289be61 | 1,039 | py | Python | docker/django/restaurant/restapps/models/models.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 3 | 2019-08-29T10:14:40.000Z | 2021-03-05T09:50:15.000Z | docker/django/restaurant/restapps/models/models.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | null | null | null | docker/django/restaurant/restapps/models/models.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 1 | 2021-03-05T09:50:29.000Z | 2021-03-05T09:50:29.000Z | from django.db import models
from django.utils import timezone
class Restaurant(models.Model):
name = models.CharField(max_length=200,unique=True)
contact = models.CharField(max_length=14)
active = models.BooleanField(default=True)
class Meta:
constraints = [
models.UniqueConstrai... | 28.081081 | 103 | 0.681424 |
d0093e50b1d261722735469bebe6c0aff8ffb200 | 6,145 | py | Python | tests/onegov/user/test_forms.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/user/test_forms.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/user/test_forms.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.custom import json
from onegov.user.auth import Auth
from onegov.user.collections import UserCollection
from onegov.user.forms import LoginForm
from onegov.user.forms import PasswordResetForm
from onegov.user.forms import RegistrationForm
from onegov.user.forms import RequestPasswordResetForm
from oneg... | 26.148936 | 75 | 0.618552 |
d0df60f6bbceead943ff61cc640eb67b936b898d | 47 | py | Python | python/python_backup/PRAC_PYTHON/qwer.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/qwer.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/qwer.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | s=0
for i in range(2,100,2):
s=s*2
print i | 11.75 | 25 | 0.574468 |
ef5e4419ff5bf3b647fab15fd49c08b3a8ec0cf3 | 1,684 | py | Python | notebooks/utils/syntax/syntax.py | k4t0mono/ipln | ba71860bc38df52780903f647fb2404c61a6b3f2 | [
"BSD-2-Clause"
] | null | null | null | notebooks/utils/syntax/syntax.py | k4t0mono/ipln | ba71860bc38df52780903f647fb2404c61a6b3f2 | [
"BSD-2-Clause"
] | 2 | 2020-03-24T17:06:03.000Z | 2020-03-31T02:16:40.000Z | notebooks/utils/syntax/syntax.py | k4t0mono/ipln | ba71860bc38df52780903f647fb2404c61a6b3f2 | [
"BSD-2-Clause"
] | null | null | null | import spacy
class SyntaxPreprocessing:
def __init__(self):
self.nlp = spacy.load('pt_core_news_sm')
def parse_text(self, text):
"Retora uma lista de (palavra, dependencia, pai) do texto de entrada"
doc = self.nlp(text)
tokens = []
for t in doc:
... | 24.057143 | 77 | 0.423397 |
3ee5b038239e5955ae0cdb08f29adc750c0e03e1 | 1,883 | py | Python | scripts/turtlesim_odom.py | marvinferber/turtlebot_easyprog | 8d6bca3a112cc78aa46b1a3e4a293eb4041b071c | [
"Apache-2.0"
] | null | null | null | scripts/turtlesim_odom.py | marvinferber/turtlebot_easyprog | 8d6bca3a112cc78aa46b1a3e4a293eb4041b071c | [
"Apache-2.0"
] | null | null | null | scripts/turtlesim_odom.py | marvinferber/turtlebot_easyprog | 8d6bca3a112cc78aa46b1a3e4a293eb4041b071c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Marc Donner
#
# 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 req... | 33.625 | 103 | 0.739246 |
a08ec535cc446c4155cb6458e318046e63056ecb | 1,645 | py | Python | tarefas-poo/lista-03/tribo/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/tribo/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/tribo/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5663
# Exercício da Tribo
# --------------------------
# Classe que representa a interface com o usuário
#
from view.menu import Menu
from view.paineis.painel_cria_tribo import PainelCriaTribo
from view.paineis.painel_destroi_tribo import PainelDestroiTribo
from vie... | 30.462963 | 71 | 0.575684 |
261c8ff538bf9d1346002233673acb24510df5ca | 2,202 | py | Python | day24/snake/game.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day24/snake/game.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day24/snake/game.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from turtle import Screen
from game_board import GameBoard
from snake import Snake
from food import Food
from scoreboard import ScoreBoard
import time
SCREEN_WIDTH = 650
SCREEN_HIGHT = 700
COLLISION_DISTANCE = 18
class Game():
def __init__(self):
self.gameRunns = True
self.gamePaused = True
... | 25.604651 | 118 | 0.565395 |
f84ef353db83452f93b4b1cde8cf5b4d715158f5 | 4,083 | py | Python | bigbench/models/dummy_model.py | tanujdhiman/BIG-bench | 38f16ffb3d4cae77324a71d6b63c1a5bcdadc445 | [
"Apache-2.0"
] | null | null | null | bigbench/models/dummy_model.py | tanujdhiman/BIG-bench | 38f16ffb3d4cae77324a71d6b63c1a5bcdadc445 | [
"Apache-2.0"
] | null | null | null | bigbench/models/dummy_model.py | tanujdhiman/BIG-bench | 38f16ffb3d4cae77324a71d6b63c1a5bcdadc445 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 40.029412 | 164 | 0.622826 |
f85cbf28f74988bcc8746065282708270cde03a1 | 2,867 | py | Python | python/fastcampus/chapter05_02.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter05_02.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter05_02.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """
파이썬 클래스 특별 메소드 심화 활용 및 상속
class ABC
"""
class VectorP(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __iter__(self):
return (i for i in (self.__x, self.__y)) # Generator
@property
def x(self):
return self.__x
@x.setter
def x(self, v):
... | 17.588957 | 61 | 0.597837 |
3e1caf2bf1a2d79c94dcd4336100145638a91c82 | 2,057 | py | Python | apps/tess/views.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/tess/views.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/tess/views.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.shortcuts import render, HttpResponseRedirect
from apps.calc.measurement import measurement_obj
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
import json
from apps.analysis.json import NumPyArangeEncoder
@login_required
d... | 37.4 | 121 | 0.724842 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.