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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c78ee23f0ec2b51ecec55b71bab0016ff4d0e628 | 3,881 | py | Python | xiaohongshu/xiaohsClass.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | xiaohongshu/xiaohsClass.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | xiaohongshu/xiaohsClass.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | """
一个小红书的类
用户调用小红书微信小程序api的爬虫
"""
import requests
import time
import json
import random
import traceback
import hashlib
class xhs():
def __init__(self):
# 小红书账户请求头
self.headers = {
'device-fingerprint': 'WHJMrwNw1k/HHeHdJP9eciZQM1EIuxb06bdwsL2b8Thw5qsGHcWmXEi2/NlTzrKoNtHPzOLrvAPQmwetCd... | 46.759036 | 293 | 0.567637 |
40433f5e91da8c779ea834b5ea93101da8e7f5c6 | 370 | py | Python | pacman-termux/test/pacman/tests/reason001.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/reason001.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/reason001.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Copy reason (to-be-replaced -> replacement)"
sp = pmpkg("libfoo-ng")
sp.replaces = [ "libfoo" ]
self.addpkg2db("sync", sp)
lp = pmpkg("libfoo")
lp.reason = 1
self.addpkg2db("local", lp)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=libfoo")
self.addrule("PKG_EXIST=l... | 21.764706 | 64 | 0.702703 |
dc0d051f66cd9c0efe55dbbf81c1b18a2efbfcfa | 614 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_8_Classes/94. vehicle class.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_8_Classes/94. vehicle class.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_8_Classes/94. vehicle class.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | '''
Write a Vehicle class that has 4 instance variables:
model
year
type_of_car
unique_id
Add an additional class variable 'no_of_objects' which counts the total number of instances created.
Define a method 'no_of_vehicles' in the Vehicle class that returns the total number of instances created.
'''
class Car:
... | 22.740741 | 105 | 0.692182 |
905c69bed4ddef0790357211eaf1f16657edf0e7 | 2,162 | py | Python | tests/test_regionalegueltigkeit.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_regionalegueltigkeit.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_regionalegueltigkeit.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import pytest # type:ignore[import]
from bo4e.com.kriteriumwert import KriteriumWert
from bo4e.com.regionalegueltigkeit import RegionaleGueltigkeit, RegionaleGueltigkeitSchema
from bo4e.enum.gueltigkeitstyp import Gueltigkeitstyp
from bo4e.enum.tarifregionskriterium import Tarifregionskriterium
from tests.serializati... | 37.929825 | 110 | 0.59482 |
90b0ce81061215b59478e8505f77f08dee3f2b86 | 1,536 | py | Python | research/cv/LightCNN/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/LightCNN/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/LightCNN/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.571429 | 78 | 0.683594 |
90cb25a1ba439f4979cef5adf0e9960dfc5b6c64 | 8,429 | py | Python | python_gui_tkinter/KALU/GARBAGE/TEST/GUIfunctions.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE/TEST/GUIfunctions.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE/TEST/GUIfunctions.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import tkinter as tk
from tkinter import *
from tkinter import font
from tkinter.filedialog import askopenfilename
from tkinter import ttk
import textwrap
from AppOperations import AppOperations as ao # the class build for this purpose
from CommandsGUI import CommandsGUI
from Generic import Generic
#from GUIfun... | 31.451493 | 110 | 0.658085 |
2915cb1ca1e1d2c6d07642ac2fd5e3f2b11806e9 | 251 | py | Python | 1018-binary-prefix-divisible-by-5/1018-binary-prefix-divisible-by-5.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1018-binary-prefix-divisible-by-5/1018-binary-prefix-divisible-by-5.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1018-binary-prefix-divisible-by-5/1018-binary-prefix-divisible-by-5.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def prefixesDivBy5(self, nums: List[int]) -> List[bool]:
strnums = [str(num) for num in nums]
strlen = len(nums)
return [True if int("".join(strnums[:i+1]), 2)%5==0 else False for i in range(strlen)] | 50.2 | 102 | 0.589641 |
4691d1918c739d1c3332240721bd0b1ab2483a03 | 961 | py | Python | books/PythonCleanCode/ch7_generator/test_generators.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/test_generators.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/test_generators.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 07: Using generators
> Test for: generators_1.py
"""
from unittest import TestCase, main
from generators_1 import PurchasesStats
from generators_2 import process_purchases
class TestPurchaseStats(TestCase):
def test_calculations(self):
stats = PurchasesStats... | 25.972973 | 62 | 0.665973 |
3148111b762fb34f1c28bbdd7f206965c6629192 | 3,410 | py | Python | IdeaProjects/MachineLearning/Kmeans.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | IdeaProjects/MachineLearning/Kmeans.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | IdeaProjects/MachineLearning/Kmeans.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: miko
"""
import numpy as np
# Function: K Means
# -------------
# K-Means is an algorithm that takes in a dataset and a constant
# k and returns k centroids (which define clusters of data in the
# dataset which are similar to one another).
# 定义kmeans方法 (数据集,划分为k类,停止的条件)
def kmean... | 30.446429 | 83 | 0.646334 |
c342155ccee2478d88b55a5da334012e2871803b | 1,003 | py | Python | exercises/fr/test_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/test_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/test_04_11_02.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
), "Il semble que quelque chose ne va pas avec les données. Attendu 3 exemples."
assert all(
len(entry) == 2 and isinstance(entry[1], dict) for entry in TRAINING_DATA
), "Format incorrect des données d'apprentissage. Attendu une liste de tuple... | 45.590909 | 118 | 0.65005 |
488c0b95ec651094be8e96d90117c6c3db758501 | 2,208 | py | Python | robot/csdn/proxys.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | robot/csdn/proxys.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | robot/csdn/proxys.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | # !/usr/bin/env python
# -*- coding:utf-8 -*-
import json
import random
import requests
from lxml import etree
import time
url = "https://www.kuaidaili.com/free/inha/"
req_headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'
}
# 获取... | 32.470588 | 126 | 0.57654 |
d29dda47713f5cef2e26fe7d4112bfbc18483992 | 2,503 | py | Python | 2018/quals/web-gcalc/app/main.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2018/quals/web-gcalc/app/main.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2018/quals/web-gcalc/app/main.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 30.52439 | 128 | 0.635238 |
d2fbbec8200f66cd86754a4b84b1804487e8c3f2 | 2,502 | py | Python | scripts/component_graph/surveyor/util.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/component_graph/surveyor/util.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/component_graph/surveyor/util.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utilities to survey and analyze the relationships between components in the system.
"""
import json
import os
import re
from server... | 34.75 | 105 | 0.676259 |
827eb0a292990c1c4854218ba15d388c257ad630 | 5,801 | py | Python | packages/watchmen-rest/src/watchmen_rest/authentication.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest/src/watchmen_rest/authentication.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest/src/watchmen_rest/authentication.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from logging import getLogger
from typing import Callable, List, Optional, Tuple
from jose import JWTError
from jose.jwt import decode, encode
from jsonschema.exceptions import ValidationError
from starlette.requests import Request
from watchmen_auth import AuthenticationDetai... | 35.808642 | 119 | 0.795552 |
c4c09e9183c314e2c3b811876098c5f899caac63 | 7,259 | py | Python | src/built_in_functions/__import__function.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/built_in_functions/__import__function.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/built_in_functions/__import__function.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------
# 在一行内导入多个模块,可读性不如 多行导入
import os, sys
---------------------------------------------------------------------------------------------
# import语句的模块顺序,使用一个空行分隔
python标准库模块
pyt... | 24.945017 | 127 | 0.516325 |
1efa7775afb597d33b6b4eb0134da916dd3b939b | 650 | py | Python | source/pkgsrc/devel/breezy/patches/patch-breezy_tests_test__server.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/breezy/patches/patch-breezy_tests_test__server.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/breezy/patches/patch-breezy_tests_test__server.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-breezy_tests_test__server.py,v 1.1 2019/10/27 13:05:46 rhialto Exp $
Stub out call to shutdown() since it mysteriously fails with
an OSError exception with EINVAL.
See https://bugs.launchpad.net/brz/+bug/1849971
--- breezy/tests/test_server.py.orig 2019-06-16 22:18:58.000000000 +0000
+++ breezy/tests/... | 36.111111 | 83 | 0.658462 |
4850fc9f9a40a052b33922d79e029336e8b103e7 | 3,591 | py | Python | solve4.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | null | null | null | solve4.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | null | null | null | solve4.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
from Reader import ReadU, ReadSystem
import paddle
from ops import Fidelity
from utils import RandomCNOTs, EnumAllCNOT, CostCompute
from ArchitectureSearch import RandomSearch, SequenceJitter
from paddle_model import BackwardParams, ParseFromQSystem, GetQSystem, TryRemoveZeros
... | 34.2 | 132 | 0.658869 |
6f80253add7b7bf4fd1197d014f968be88942306 | 1,946 | py | Python | system/database.py | billalxcode/ATM-cli | 68e295b1e3c152ee5c35913af84d72468cab06e0 | [
"MIT"
] | null | null | null | system/database.py | billalxcode/ATM-cli | 68e295b1e3c152ee5c35913af84d72468cab06e0 | [
"MIT"
] | null | null | null | system/database.py | billalxcode/ATM-cli | 68e295b1e3c152ee5c35913af84d72468cab06e0 | [
"MIT"
] | null | null | null | import sqlite3
from os.path import isfile
from typing import ValuesView
from .cmd import CMD
class Database(object):
def __init__(self, filename="") -> None:
super().__init__()
self.cmds = CMD()
self.filename = filename
self.connection = None
def _checkFile(self):
r... | 30.40625 | 60 | 0.535457 |
6fb8472f6ba336b8f0ac7c87449c2d90e50f3680 | 2,528 | py | Python | sketches/xmaspenguin/penguin.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/xmaspenguin/penguin.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/xmaspenguin/penguin.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class Penguin(object):
def __init__(self, posX, posY):
self.x = posX
self.y = posY
self.dir = 0
self.dx = 0
def loadPics(self):
# nach rechts laufen
self.pingrt1 = loadImage("pingrt1.png")
self.pingrt2 = loadImage("pingrt2.png")
self.... | 35.605634 | 50 | 0.535997 |
6fd0367bac1d57d7710102df477dcd820420ee28 | 6,371 | py | Python | tests/onegov/form/test_fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/form/test_fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/form/test_fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import re
import tempfile
from cgi import FieldStorage
from datetime import datetime
from gzip import GzipFile
from io import BytesIO
from onegov.core.utils import Bunch
from onegov.core.utils import dictionary_to_binary
from onegov.form import Form
from onegov.form.fields import ChosenSelectField
from onegov.form.fie... | 27.580087 | 73 | 0.636792 |
b50fea896f6cf6a547d1df3c77f06a13b77f574d | 1,212 | py | Python | packages/watchmen-auth/src/watchmen_auth/authorization.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-auth/src/watchmen_auth/authorization.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-auth/src/watchmen_auth/authorization.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional
from watchmen_model.admin import User, UserRole
from .authentication import AuthenticationManager
class AuthFailOn401(Exception):
pass
class AuthFailOn403(Exception):
pass
class Authorization:
"""
raise AuthFailOn401 or AuthFailOn403 o authorization failed
"""
def __init_... | 25.787234 | 81 | 0.757426 |
963284d4717f5ec85d0cd8ac4a77c58c88d5cc5d | 3,943 | py | Python | python/oneflow/compatible/single_client/framework/ofblob.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/framework/ofblob.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/framework/ofblob.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.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... | 37.198113 | 88 | 0.723307 |
737fd4540a9ad5185e1cfa99e43ef4915c2acd54 | 1,828 | py | Python | platform/mcu/haas1000/prebuild/data/lib/micropython/network.py | NEXTLEO/AliOS-Things | 117ca103144a7bf6a394455bcc59698b7e1dd79d | [
"Apache-2.0"
] | 1 | 2021-04-09T03:18:41.000Z | 2021-04-09T03:18:41.000Z | platform/mcu/haas1000/prebuild/data/lib/micropython/network.py | NEXTLEO/AliOS-Things | 117ca103144a7bf6a394455bcc59698b7e1dd79d | [
"Apache-2.0"
] | 1 | 2021-09-11T05:53:30.000Z | 2021-09-11T05:53:30.000Z | hardware/chip/haas1000/prebuild/data/lib/micropython/network.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1 | 2021-06-20T06:43:12.000Z | 2021-06-20T06:43:12.000Z | # -*- coding: UTF-8 -*-
import netmgr as nm
class NetWorkClient(object):
"""
该模块实现网络管理相关的功能,包括初始化,联网,状态信息等.
"""
def __init__(self):
nm.init()
def __str_is_empty(self,value):
if value is None or value == "":
return True
else:
return False
def c... | 21.011494 | 72 | 0.462254 |
fb7384f07ad255f4ad26b89d16abcfc5817fc82b | 554 | py | Python | exercises/python/data-types/collections/deque.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/collections/deque.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/collections/deque.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | # Given an set of operations and values, execute the operations with the
# values and print the resultant deque
#
# Sample Input
# 6
# append 1
# append 2
# append 3
# appendleft 4
# pop
# popleft
# Sample Output
# 1 2
from collections import deque
if __name__ == '__main__':
d = deque()
for _ in range(int... | 17.870968 | 73 | 0.602888 |
836cb55ed9722c0be806a683d23842a66ccc1193 | 691 | py | Python | pvs_suban/migrations/0010_auto_20210621_1804.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | pvs_suban/migrations/0010_auto_20210621_1804.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | pvs_suban/migrations/0010_auto_20210621_1804.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-21 18:04
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pvs_suban', '0009_auto_20210621_1753'),
]
operations = [
migrations.AddField(
model_name='addre... | 27.64 | 143 | 0.625181 |
8602bc39c55e852b5f5ea4d0ad617dd38f59eb88 | 182 | py | Python | excelstaticweb.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | 1 | 2020-06-29T12:33:15.000Z | 2020-06-29T12:33:15.000Z | excelstaticweb.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | null | null | null | excelstaticweb.py | Pusnow/ExcelStaticWeb | 8f42240f03b0d666cf111334f142a212ef43c324 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('sbtmwebport', 'templates'))
template = env.get_template('index.html') | 30.333333 | 67 | 0.741758 |
f7bf8f255cd0888970a47fa0b2e2726717fe6ced | 34 | py | Python | feint/__init__.py | wrobstory/feint | 9420e48d47052e14227cd6c878ebf67a4cbf5fd9 | [
"MIT"
] | 1 | 2017-06-12T17:37:54.000Z | 2017-06-12T17:37:54.000Z | feint/__init__.py | wrobstory/feint | 9420e48d47052e14227cd6c878ebf67a4cbf5fd9 | [
"MIT"
] | null | null | null | feint/__init__.py | wrobstory/feint | 9420e48d47052e14227cd6c878ebf67a4cbf5fd9 | [
"MIT"
] | null | null | null | from .core import (Chart, Scatter) | 34 | 34 | 0.764706 |
f7f8d53ff94d325fea3cbf1ba33884d9a79bcf0c | 851 | py | Python | LOOCV.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-03-28T11:50:45.000Z | 2020-12-08T13:36:26.000Z | LOOCV.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-04-20T11:12:59.000Z | 2020-05-11T05:37:36.000Z | LOOCV.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | null | null | null |
from IProcess import IProcess, EDataType
from ImageData import PipelineManager
#from euclideanDistance import euclideanDistance
#from kNearestNeighbour import kNearestNeighbour
class LOOCV(IProcess):
def __init__(self):
IProcess.__init__(self)
pass
def toId(self):
return self.getTypeAsString()
def getTyp... | 21.275 | 82 | 0.726204 |
f75fb41ee1694cfc73d85bd395b0651c35512be9 | 10,547 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/lvg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/lvg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/lvg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# Based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print... | 35.996587 | 130 | 0.576372 |
e39022d5775953c2b1e45ea37c3e40d356187e6b | 3,100 | py | Python | research/cv/tgcn/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/tgcn/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/tgcn/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.349398 | 116 | 0.652903 |
582cba37ff1e54533e6c30da99c0446058842a0a | 3,232 | py | Python | python-bildungslogin/tests/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/tests/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/tests/conftest.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# UCS test
#
# Copyright 2013-2021 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
... | 33.666667 | 92 | 0.663057 |
5844ed690bfcb4c966948ca19694b630acd62f57 | 950 | py | Python | showcase1/com/aaron/threadexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase1/com/aaron/threadexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase1/com/aaron/threadexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # _*_ encoding:utf-8 _*_
"""a test module"""
__author__ = 'Aaron.qiu'
import threading
from threading import Timer
import time
class MyThread(threading.Thread):
"""custom thread"""
def __init__(self, x):
self.__x = x
threading.Thread.__init__(self)
def run(self):
print(str(self.... | 18.627451 | 40 | 0.597895 |
42a262c52d87e41cbf922b5d853e3fe6b040cbc4 | 238 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/tester.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/tester.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/tester.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from browser import inputhandler
import os
if __name__ == "__main__":
session_inputhandler = inputhandler.InputHandler()
while True:
result = session_inputhandler.get_input()
if result == "END":
break
| 23.8 | 54 | 0.668067 |
2240dac6dbb8d08291febc6db2c5300bb4d2231f | 1,039 | py | Python | INBa/2015/SOSNOVY_M_S/task_7_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/SOSNOVY_M_S/task_7_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/SOSNOVY_M_S/task_7_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 7. Вариант 26.
#Создайте игру, в которой компьютер загадывает название одного из восьми категорий, на которые разделяются дорожные знаки в соответствии с Венской конвенцией о дорожных знаках и сигналах, а игрок должен его угадать.
#Sosnovy M.S.
#16.03.2016
import random
print("компьютер загадывает название од... | 39.961538 | 215 | 0.729548 |
58b859965991ee0542f661d6eb9f6fbc73a68de9 | 1,129 | py | Python | official/cv/ADNet/src/utils/get_benchmark_info.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ADNet/src/utils/get_benchmark_info.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ADNet/src/utils/get_benchmark_info.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... | 34.212121 | 83 | 0.687334 |
18f1b54dae06f9826eae6ad80587f7585fc2a3fb | 1,624 | py | Python | PyCompile-master/kompiler.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | PyCompile-master/kompiler.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | PyCompile-master/kompiler.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import marshal, os, time
banner=("""\033[1;36m
_ _
_| || |_ \033[1;32mCOMPILER PYTHON\033[1;36m
|_ .. _|
|_ _| \033[1;31mContact=>https://t.me/kang_nuubi\033[1;36m
|_||_| \033[1;31mGithub=>https://github.com/KANG-NEWBIE
""")
def py():
try:
os.system('clear')
print(banner)
a=in... | 27.525424 | 140 | 0.639163 |
18f788f86ed69e3cddad96ba4f5c04927a323a93 | 10,728 | py | Python | python_playground/data/data.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_playground/data/data.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_playground/data/data.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | # load data from datasets
import os
import pickle
from pprint import pprint
from linearization import *
C = 0.6
BASE_DIR = "./datasets/"
UPPER_BOUND_OF_EDGES = 222000
DATASETS = [
("ca-AstroPh", "u"),
("ca-HepPh", "u"),
("facebook_combined", "u"),
("com-dblp-ungraph", "u"),
("test_g", "d"),
("... | 32.707317 | 124 | 0.628915 |
e1b39b55300e4c8dc2e45e4014892f4b7865c323 | 1,011 | py | Python | Contests/ECOO 2018/ECOO '18 R1 P3 - Missing Art.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/ECOO 2018/ECOO '18 R1 P3 - Missing Art.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/ECOO 2018/ECOO '18 R1 P3 - Missing Art.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | for a in range(10):
au = list(map(int, input().split()))
OUR = []
FAIL = []
# case 1
for b in range(au[0]):
number = list(input())
number = list(map(int, number))
for i in range(len(number)):
if number[i] == 0:
number[i] = au[3]
elif nu... | 24.658537 | 41 | 0.382789 |
55f1e1fc51838741faf26ca353a1da48dfe42f6a | 880 | py | Python | sumOfArray/sumOfArray.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | sumOfArray/sumOfArray.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | sumOfArray/sumOfArray.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def runningSum(self, nums: List[int]) -> List[int]:
result = []
for num in nums:
if len(result) != 0:
result.append(num + result[-1])
else:
result.append(num)
return result
def convertList(l, d... | 25.142857 | 57 | 0.535227 |
18252a5c9584a058f5311f1433fd42ad663c9714 | 285 | py | Python | exercises/python/data-types/basic/runner-up.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/basic/runner-up.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/basic/runner-up.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
winner = max(arr)
runner_up = 0
for i in reversed(range(len(arr))):
if arr[i] < winner:
runner_up = arr[i]
break
print(runner_up)
| 20.357143 | 41 | 0.519298 |
a1313b4b3eb10da826f0dd4dca1d54edd60c9f9c | 1,787 | py | Python | pythonProj/FZPython/pyquant/libs/tusharelib.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/libs/tusharelib.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/libs/tusharelib.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | ##
import json
import datetime
import tushare as ts
import pandas as pd
from pyquant.libs.cachelib import cache
def get_daily_data(ticker, index=False, output='df', fromdate=None, todate=None, isCache=True, **kwargs):
"""
从 tushare 下载 股票 日数据
光从code不能判断是否是index,要用code+market
tusharelib 需要知道code, ind... | 25.528571 | 121 | 0.599888 |
a1d3366f418a4119db4b0d6ff925c9490deb6a92 | 550 | py | Python | software/sensor/thirdparty/wireless/ble_smart_sdk/apps/debughooks.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/sensor/thirdparty/wireless/ble_smart_sdk/apps/debughooks.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/sensor/thirdparty/wireless/ble_smart_sdk/apps/debughooks.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | """
This function is called when the target is reset. The address
where the reset went to is 'reset_address'.
"""
def on_reset(api,resetAdr):
api.Write32(0x4000F040,0x00) # Trigger cold boot
api.Write32(0x4000F044,0x12345678) # Trigger cold boot
api.Write32(0x4000B004,0xFFFFFFF1) # Set SPI flash reset
lpmcu ... | 42.307692 | 69 | 0.730909 |
c52f64607a9e3066a978d2227f3bdfcf90804997 | 92 | py | Python | 2015/03/nurse-pay-gender-20150323/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/03/nurse-pay-gender-20150323/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/03/nurse-pay-gender-20150323/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1kTdU0IpVYzKWRi078_8qZT2xHSsx7fKHUzTGFaJXM54'
| 23 | 68 | 0.847826 |
c56a1e1aaba5726873331a1aea288c5554e8c866 | 528 | py | Python | tests/onegov/election_day/collections/test_upload_token_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/collections/test_upload_token_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/collections/test_upload_token_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day.collections import UploadTokenCollection
def test_upload_token_collection(session):
collection = UploadTokenCollection(session)
assert collection.query().all() == []
token = collection.create()
assert collection.query().all() == [token]
assert collection.by_id(token.id)... | 27.789474 | 71 | 0.715909 |
49279de401c714f2227004844949ef1c67336900 | 484 | py | Python | site/public/courses/BEW-1.1/Lessons/05-URLs-HTTP-REST-and-Reading-Errors/demo/apis_demo_flask.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/BEW-1.1/Lessons/05-URLs-HTTP-REST-and-Reading-Errors/demo/apis_demo_flask.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/BEW-1.1/Lessons/05-URLs-HTTP-REST-and-Reading-Errors/demo/apis_demo_flask.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | import requests
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/joke')
def make_joke():
params = {
"limitTo": "nerdy",
"firstName": "Bruce",
"lastName": "Wayne"
}
r = requests.get("http://api.icndb.com/jokes/random", params=params)
... | 25.473684 | 73 | 0.597107 |
4942f86a93a566b81f2d85b85396a54d7d87cf0b | 2,056 | py | Python | src/onegov/translator_directory/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.translator_directory import TranslatorDirectoryApp
from onegov.translator_directory.collections.documents import \
TranslatorDocumentCollection
from onegov.translator_directory.collections.language import LanguageCollection
from onegov.translator_directory.collections.translator import \
TranslatorC... | 34.847458 | 79 | 0.752432 |
7724439d634d54377384d1e1b1e41aacd1da8fec | 417 | py | Python | ___Python/Thomas/pycurs_180625/p06_persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p06_persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p06_persistence/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import json
#json.dumps(anObject, default=json_util.default)
from p01_kennenlernen.m01_kennenlernen import teilnehmerliste
with open("teilnehmer.json", "w") as datei:
json.dumps(teilnehmerliste, datei, default=str) # In diesem Beispiel werden Datumsangaben nicht exportiert -> Umwandlung aller Daten in str... | 32.076923 | 148 | 0.7506 |
623dee0047652f5854cc366a37c6c34790ad5eeb | 229 | py | Python | python/encoding/encoding_decoding.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/encoding/encoding_decoding.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/encoding/encoding_decoding.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | print("Encoding".center(20, "="))
print("résumé".encode("utf-8"))
print("El Niño".encode("utf-8"))
print("Decoding".center(20, "="))
print(b"r\xc3\xa9sum\xc3\xa9".decode("utf-8"))
print(b"El Ni\xc3\xb1o".decode("utf-8"))
| 28.625 | 47 | 0.624454 |
623ece4b04393932c6dcd1614be1dc10715ade2b | 3,201 | py | Python | mnist_utils/util.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | 3 | 2022-02-09T21:35:14.000Z | 2022-02-10T15:31:43.000Z | mnist_utils/util.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | null | null | null | mnist_utils/util.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | null | null | null | #imports for dataset downloader
import gzip
import os
from urllib.request import urlretrieve
import numpy as np
import matplotlib.pyplot as plt
def mnist(path=None):
r"""Return (train_images, train_labels, test_images, test_labels).
Args:
path (str): Directory containing MNIST. Default is
... | 34.793478 | 98 | 0.634802 |
b8448fd6624be138d63a71f0f77bde82777afa13 | 260 | py | Python | Cplusplus/Bootcamp/CodingProject4/plotting.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Cplusplus/Bootcamp/CodingProject4/plotting.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Cplusplus/Bootcamp/CodingProject4/plotting.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
threads = [
0,
2,
4,
6,
8,
10,
12,
]
times = [
3521,
1880,
1050,
842,
851,
737,
668,
]
plt.bar(threads, times)
plt.xlabel("#Threads")
plt.ylabel("Time (ms)")
plt.show()
| 9.62963 | 31 | 0.492308 |
b888c02c49d8844fa62c7f43402d698595f559cd | 9,275 | py | Python | tests/onegov/fsi/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import namedtuple
from datetime import timedelta, datetime
from uuid import uuid4
import pytz
import transaction
from onegov.core.crypto import hash_password
from onegov.fsi.models import CourseAttendee, Course, CourseEvent, \
CourseSubscription
from onegov.fsi.models.course_notification_template... | 30.016181 | 80 | 0.652507 |
ac115f778e17d39d3ec803132349c6154933a8f1 | 306 | py | Python | PYTHON/Numpy/mean_var_and_std.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Numpy/mean_var_and_std.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Numpy/mean_var_and_std.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import numpy
s = list(map(int, input().split()))
N, M = s[0], s[1]
arr = []
for _ in range(0, N):
temp = list(map(int, input().split()))
arr.append(temp)
n = numpy.array(arr)
print(numpy.mean(n, axis=1))
print(numpy.var(n, axis=0))
print(numpy.std(n, axis=None))
| 20.4 | 42 | 0.624183 |
021e1c6bf628e1f6b910d852d927f6cfc3acef09 | 224 | py | Python | pages/themes/beginners/dictAndSetDataTypes/Tasks_and_HW/task1_students_scores.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/dictAndSetDataTypes/Tasks_and_HW/task1_students_scores.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/dictAndSetDataTypes/Tasks_and_HW/task1_students_scores.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | students = {
"Ivan": 5.00,
"Alex": 3.50,
"Maria": 5.50,
"Georgy": 5.00,
}
# Print out the names of the students, which scores > 4.00
for name in students:
if( students[name] > 4.00):
print(name)
| 18.666667 | 58 | 0.558036 |
0283f57112e1494b9a33c31f04d38c8a6905643c | 2,475 | py | Python | official/cv/posenet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/posenet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/posenet/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.25 | 99 | 0.650101 |
0c7ef08ed4afef9fda231ea46046c90a8c210826 | 16,232 | py | Python | Assignments/2017_Spring/pa4/auto_grader/auto_grader.py | USMC1941/CS211_Rutgers | dfcac8b9c719edc04d3e79fee3f95bf3aa40a4e8 | [
"MIT"
] | 24 | 2018-12-30T18:05:26.000Z | 2022-01-18T08:36:59.000Z | Assignments/2017_Spring/pa4/auto_grader/auto_grader.py | USMC1941/CS211_Rutgers | dfcac8b9c719edc04d3e79fee3f95bf3aa40a4e8 | [
"MIT"
] | null | null | null | Assignments/2017_Spring/pa4/auto_grader/auto_grader.py | USMC1941/CS211_Rutgers | dfcac8b9c719edc04d3e79fee3f95bf3aa40a4e8 | [
"MIT"
] | 12 | 2018-02-16T20:25:23.000Z | 2021-06-29T22:39:46.000Z | #!/usr/bin/python
import os
import sys
import glob
import time
import subprocess
import signal
import popen2
import time
subdirectories = ['first']
# If a program has single liner input and output, we put all test cases in single file.
# Otherwise, we have a file for test and associated file with results
formats = {... | 36.151448 | 172 | 0.521686 |
0c8fd2e90ea4e459c1ad59c25caa4e361fda0ed6 | 448 | py | Python | pacman-arch/test/pacman/tests/sync044.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/sync044.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/sync044.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "A dependency induces a replacement"
lp1 = pmpkg("pkg1")
self.addpkg2db("local", lp1);
sp2 = pmpkg("pkg2")
sp2.depends = ["pkg3"]
self.addpkg2db("sync", sp2);
sp3 = pmpkg("pkg3")
sp3.conflicts = ["pkg1"]
self.addpkg2db("sync", sp3);
self.args = "-S pkg2 --ask=4"
self.addrule("PACMAN_RETCODE=0")
... | 21.333333 | 55 | 0.698661 |
0b2c92115198ae36fa2e451767bd547d5c8403c6 | 351 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_0/set_default_company_in_bom.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_0/set_default_company_in_bom.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_0/set_default_company_in_bom.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
frappe.reload_doc("manufacturing", "doctype", "bom")
company = frappe.db.get_value("Global Defaults", None, "default_company")
frappe.db.sql("""update `tabBOM... | 35.1 | 74 | 0.732194 |
0b78ce4a68ee0363d87c09cbbef070a2a72281b7 | 362 | py | Python | pages/themes/beginners/OOP/examples/dice.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/OOP/examples/dice.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/OOP/examples/dice.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | from random import randint
class Die():
"""docstring for Die"""
def __init__(self):
self.value = None
def throw(self):
self.value = randint(1,6)
def show(self):
print(self.value)
die1 = Die()
die2 = Die()
for i in range(1000):
die1.throw()
die2.throw()
if die1.value == 6 and die2.value == 6:
print(... | 15.083333 | 41 | 0.640884 |
e7faf3ceeeedc39d278c7f4c5c5e8c76449b13a5 | 1,081 | py | Python | official_examples/Using_Hetero_Cluster_Framework_to_train_a_Pong_Player_with_Rllib/worker_data_url/external_env.py | RuichunWang/ModelArts-Lab | cfa9a853e3a76a21eac2818f055b36978ac2bb69 | [
"Apache-2.0"
] | null | null | null | official_examples/Using_Hetero_Cluster_Framework_to_train_a_Pong_Player_with_Rllib/worker_data_url/external_env.py | RuichunWang/ModelArts-Lab | cfa9a853e3a76a21eac2818f055b36978ac2bb69 | [
"Apache-2.0"
] | null | null | null | official_examples/Using_Hetero_Cluster_Framework_to_train_a_Pong_Player_with_Rllib/worker_data_url/external_env.py | RuichunWang/ModelArts-Lab | cfa9a853e3a76a21eac2818f055b36978ac2bb69 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
def system_cmd(cmd_list):
cmd = subprocess.run(cmd_list, shell=False)
if cmd.returncode != 0:
print('cannot exec cmd: {}, exit with {}'.format(cmd_list, cmd.returncode))
raise EnvironmentError
return
def install_gym(mode=None):
system_cmd(['pi... | 27.717949 | 108 | 0.636448 |
f0670f40891d1027779a550b0dc9f0824d7545df | 156 | py | Python | 002 Variablen und Zinsformel.py | Gravitar64/KESS | 174bf9ee853f7bfb0c2e652b83150045197b6425 | [
"MIT"
] | null | null | null | 002 Variablen und Zinsformel.py | Gravitar64/KESS | 174bf9ee853f7bfb0c2e652b83150045197b6425 | [
"MIT"
] | null | null | null | 002 Variablen und Zinsformel.py | Gravitar64/KESS | 174bf9ee853f7bfb0c2e652b83150045197b6425 | [
"MIT"
] | null | null | null | # Zinsformel ist k * p * t / (100 * 360)
zins = 1000 * 2 * 45 / (100 *360)
print(zins)
k = 1000
p = 2
t = 45
zins = k * p * t / (100 * 360)
print(zins)
| 12 | 40 | 0.512821 |
0431aa617d4183f2eca8037adcf60917a99d298c | 530 | py | Python | exercises/de/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/exc_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("de")
# Verarbeite den Text
doc = nlp(
"Im Jahr 1990 lebten über 60% der Menschen in Ostasien in äußerster Armut. "
"Heute sind es nur noch 4%."
)
# Iteriere über die Tokens im Doc
for token in doc:
# Teste ob der Token einer Zahl ähnelt
if ____.____:
# Wähle de... | 26.5 | 80 | 0.641509 |
76619db3f4d1f8d923bf3579fe6db967b90305cd | 14,506 | py | Python | python/generate_apc_report.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 89 | 2015-02-13T13:46:06.000Z | 2022-03-13T16:42:44.000Z | python/generate_apc_report.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 91 | 2015-03-12T13:31:36.000Z | 2022-01-14T07:37:37.000Z | python/generate_apc_report.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 138 | 2015-03-04T15:23:43.000Z | 2022-03-09T15:11:52.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import argparse
import csv
from datetime import date
from functools import reduce
import json
from math import sqrt, nan
from os import listdir
from subprocess import run
import ssl
import sys
from time import sleep
from urllib.request import Request, urlopen
from urllib.... | 40.977401 | 227 | 0.5739 |
76b7894b21f7e3ff57907714659815d5cc7d7fdb | 490 | py | Python | dailyprogrammer/314i/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | dailyprogrammer/314i/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | dailyprogrammer/314i/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import sys
def rotate(s, n):
"""
Circularly rotate s by n positions.
"""
return s[n:] + s[:n]
def first_lexicographic_rotation(s):
"""
Sub-optimal but "obviously" correct solution.
"""
n = len(s)
ordering = sorted(range(n), key=lambda i: rotate(s, i))
best = ordering[0]
r... | 16.896552 | 59 | 0.593878 |
76bb64896afba3cce45e9e63d8244b3015d486b9 | 4,008 | py | Python | archives/codelibraries/CompetitiveProgramming-master/code/mathematics/intx.test.gen.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 549 | 2015-02-13T00:46:04.000Z | 2022-03-10T07:35:32.000Z | archives/codelibraries/CompetitiveProgramming-master/code/mathematics/intx.test.gen.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 6 | 2016-12-02T10:51:31.000Z | 2022-02-22T16:47:42.000Z | archives/codelibraries/CompetitiveProgramming-master/code/mathematics/intx.test.gen.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 143 | 2015-06-14T17:59:20.000Z | 2022-01-07T19:47:49.000Z | # This file was *autogenerated* from the file intx.test.gen.sage.
from sage.all_cmdline import * # import sage library
_sage_const_3 = Integer(3); _sage_const_1 = Integer(1); _sage_const_0 = Integer(0); _sage_const_100 = Integer(100); _sage_const_9 = Integer(9); _sage_const_10 = Integer(10); _sage_const_1000 = Intege... | 75.622642 | 266 | 0.713074 |
8c4c47b08414f7766179fc5dd69c5d04639b8a75 | 814 | py | Python | StackStorm/st2-docker/images/stackstorm/bin/inject_env.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | StackStorm/st2-docker/images/stackstorm/bin/inject_env.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | StackStorm/st2-docker/images/stackstorm/bin/inject_env.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/opt/stackstorm/st2/bin/python
"""
jinja2 template converter script
This script will accept template input from STDIN, then render output to STDOUT
Within a template, you can access environment variables with `env['YOUR_ENVVAR']`
Usage example:
env HOGE=fuga inject_env.py < template_file > outp... | 27.133333 | 85 | 0.7543 |
4fe38b246c218af0ab8bafaf7c5c90e20a3f46f9 | 1,931 | py | Python | etl/main.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 7 | 2020-04-23T20:16:11.000Z | 2022-01-04T14:57:16.000Z | etl/main.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 361 | 2020-04-23T17:20:14.000Z | 2022-03-02T11:29:45.000Z | etl/main.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 1 | 2021-11-29T06:02:52.000Z | 2021-11-29T06:02:52.000Z | import os
import sys
import time
from datetime import datetime
# Root Directory (/etl)
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
os.environ['ROOT_DIR'] = ROOT_DIR
# Adds path of the data extraction modules
sys.path.extend([f'{ROOT_DIR}/data_extraction', f'{ROOT_DIR}/shared'])
from data_enhancement import... | 34.482143 | 107 | 0.756085 |
0fcea65017951f375eb7c603f9a86e2125c26828 | 1,096 | py | Python | average-of-levels-in-binary-tree/average-of-levels-in-binary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | average-of-levels-in-binary-tree/average-of-levels-in-binary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | average-of-levels-in-binary-tree/average-of-levels-in-binary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def averageOfLevels(self, root: Optional[TreeNode]) -> List[float]:
output=[]
stack = [(root... | 31.314286 | 71 | 0.507299 |
e878a653bed6af4c77d6e7170a7f48e98f6714ab | 1,797 | py | Python | crypto/CBC/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | 1 | 2019-06-15T11:45:41.000Z | 2019-06-15T11:45:41.000Z | crypto/CBC/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | crypto/CBC/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.7
import os
BLOCK_SIZE = 256
P = [
(0, [1, 7]),
(1, [0, 8]),
(0, [5, 3]),
(1, [8, 6]),
(0, [3, 9]),
(1, [4, 0]),
(0, [9, 1]),
(1, [6, 2]),
(0, [7, 5]),
(1, [2, 4]),
]
def n2B(b,length=BLOCK_SIZE):
return list(map(int, bin(b)[2:].rjust(BLOCK_SIZE, '0'... | 22.185185 | 172 | 0.532554 |
e8a4634bc15e49eef74cf7cc5d6cbc6bb3170353 | 2,661 | py | Python | controller/pbutton_pc.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | 1 | 2021-06-15T08:59:02.000Z | 2021-06-15T08:59:02.000Z | controller/pbutton_pc.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | controller/pbutton_pc.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | '''Pushbutton simulation on Linux PC keyboard
Uses keys 1, 2, 3, 4, 5, 6, 7 and 0 (Auto Off)
'''
import conf
import logging
from pynput import keyboard
logger = logging.getLogger(conf.TSGRAIN_LOGGER)
# Panelkeys
PB1 = 'PB1'
PB2 = 'PB2'
PB3 = 'PB3'
PB4 = 'PB4'
PB5 = 'PB5'
PB6 = 'PB6'
PB7 = 'PB7'
PBAutoOff = 'PBAutoOf... | 23.548673 | 73 | 0.525366 |
d753c414f8f1a9ff4d24202bf678ca9e720b2cf3 | 146 | py | Python | exercises/ja/test_03_14_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/test_03_14_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/test_03_14_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"for doc in nlp.pipe(TEXTS)" in __solution__
), "nlp.pipeによって生成されたdocをイテレートしましたか?"
__msg__.good("Nice!")
| 24.333333 | 52 | 0.630137 |
d772bc8af73d13822cd730998ac58795a6ce1a94 | 406 | py | Python | SBTK_League_Helper/src/interfacing/ogs/tournaments.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/tournaments.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/tournaments.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from .abstract import OGSElement, OGSBetaElement
from ..tournaments import Tournament
class OGSTournament(OGSElement, Tournament):
...
# TO BE IMPLEMENTED PRETTY SOON
class OGSBetaTournament(OGSBetaElement, Tournament):
...
# TO BE IMPLEMENTED PRETTY SOON
#Both classes could be essentially the same... | 23.882353 | 61 | 0.753695 |
ad5731462d3553ce47737d9826b3ee4fde52f9e7 | 5,348 | py | Python | contrib/0.挖宝行动/pr0d1gy-狗狗品种分类/support.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | contrib/0.挖宝行动/pr0d1gy-狗狗品种分类/support.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | contrib/0.挖宝行动/pr0d1gy-狗狗品种分类/support.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | import numpy as np
import requests
from os.path import join
import matplotlib.pyplot as plt
from keras.preprocessing import image
from keras.preprocessing.image import ImageDataGenerator, img_to_array, array_to_img, load_img
from keras.applications import xception
from mpl_toolkits.axes_grid1 import ImageGrid
impor... | 37.661972 | 125 | 0.64641 |
66ff8a1bb5d3be4c1eb7d950f47ff6bd6a8604f0 | 358 | py | Python | day02/lifeInWeeks.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day02/lifeInWeeks.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day02/lifeInWeeks.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | # 🚨 Don't change the code below 👇
age = input("What is your current age?")
# 🚨 Don't change the code above 👆
#Write your code below this line 👇
yearsRemain = 90 - int(age)
monthRemain = yearsRemain * 12
weeksRemain = yearsRemain * 52
daysRemain = yearsRemain * 365
print(f"You have {daysRemain} days, {weeksRemai... | 29.833333 | 90 | 0.715084 |
0f9129eae787d9bd8be9ee455aa33331b4e95cd1 | 591 | py | Python | energielenker/energielenker/task/task.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | null | null | null | energielenker/energielenker/task/task.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | null | null | null | energielenker/energielenker/task/task.py | libracore/energielenker | 97169f2f7b21f636ab473c7561cc8e147c4b12ab | [
"MIT"
] | 1 | 2021-08-14T22:22:57.000Z | 2021-08-14T22:22:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore and contributors
# For license information, please see license.txt
import frappe
from energielenker.energielenker.project.project import PowerProject
def on_update(task, event):
if task.project and not task.flags.from_project:
update_project(task.project)
d... | 23.64 | 68 | 0.766497 |
0e566186faa93ab01e1fa05ce7671afb75986cb6 | 279 | py | Python | src/onegov/org/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger('onegov.org') # noqa
log.addHandler(logging.NullHandler()) # noqa
from translationstring import TranslationStringFactory # noqa
_ = TranslationStringFactory('onegov.org') # noqa
from onegov.org.app import OrgApp
__all__ = ['OrgApp']
| 25.363636 | 62 | 0.767025 |
0e6db414e012cd6c5a8a8bdddc8c0771edebe176 | 161 | py | Python | tests/resources/docker/docker-project/docker_project/api/v1/__init__.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 14 | 2021-03-27T22:18:56.000Z | 2022-03-21T19:04:48.000Z | tests/resources/docker/docker-project/docker_project/api/v1/__init__.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 33 | 2021-03-28T21:06:22.000Z | 2022-03-07T14:18:26.000Z | tests/resources/docker/docker-project/docker_project/api/v1/__init__.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from docker_project.api.v1.home import router as home_router
router = APIRouter(prefix="/v1")
router.include_router(home_router)
| 23 | 60 | 0.819876 |
0e88e889db5f2eed246327a97b90615b7cf57099 | 305 | py | Python | exercises/zh/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # 导入中文语言类并创建nlp对象
from spacy.lang.zh import Chinese
nlp = Chinese()
# 处理文本
doc = nlp("我喜欢老虎和狮子。")
# 遍历打印doc中的内容
for i, token in enumerate(doc):
print(i, token.text)
# 截取Doc中"老虎"的部分
laohu = doc[2:3]
print(laohu.text)
# 截取Doc中"老虎和狮子"的部分(不包括"。")
laohu_he_shizi = doc[2:5]
print(laohu_he_shizi.text)
| 15.25 | 33 | 0.701639 |
7ed15ab010e7af40f5150fefe8d7f20bc84bd9d7 | 3,199 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v6_4/fix_expense_included_in_valuation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v6_4/fix_expense_included_in_valuation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_4/fix_expense_included_in_valuation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.utils import cstr
def execute():
for company in frappe.db.sql("select name, expenses_included_in_valuation f... | 42.653333 | 104 | 0.7593 |
cb5dbc8eb010de7634ffacc7b78790657f27a499 | 2,865 | py | Python | tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py | jomue/fastapi | bee35f5ae1fc58e7ab125427ad4287210e99d8b3 | [
"MIT"
] | 53,007 | 2018-12-08T10:05:29.000Z | 2022-03-31T23:30:02.000Z | tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py | jomue/fastapi | bee35f5ae1fc58e7ab125427ad4287210e99d8b3 | [
"MIT"
] | 4,155 | 2019-01-05T05:07:49.000Z | 2022-03-31T21:25:38.000Z | tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py | jomue/fastapi | bee35f5ae1fc58e7ab125427ad4287210e99d8b3 | [
"MIT"
] | 4,092 | 2018-12-09T16:21:00.000Z | 2022-03-31T07:59:45.000Z | from fastapi.testclient import TestClient
from docs_src.path_operation_advanced_configuration.tutorial007 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/items/": {
"post": {
"sum... | 29.234694 | 86 | 0.412565 |
cb9cf932f38730bf24e2679c83498502e2534c4d | 2,736 | py | Python | my_tools/logger_tool.py | FelixLukk/netease_music_cat | 97f4487e74e09661a1dd46b7b00c01845311436b | [
"MIT"
] | 2 | 2020-02-20T18:05:45.000Z | 2020-02-22T06:40:52.000Z | my_tools/logger_tool.py | FelixLukk/netease_music_cat | 97f4487e74e09661a1dd46b7b00c01845311436b | [
"MIT"
] | 1 | 2021-06-01T23:45:58.000Z | 2021-06-01T23:45:58.000Z | data_acquire_store/my_tools/logger_tool.py | PatrickNgZh/RecommenderSystem | 0dbd3ac05ca8c1b5948a2605f1a9407f1ec59d39 | [
"Apache-2.0"
] | 1 | 2020-03-17T09:17:18.000Z | 2020-03-17T09:17:18.000Z | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# author: humingk
# ----------------------
import logging
import config
def singleton(cls):
instances = {}
def _singleton(*args, **kwargs):
if cls not in instances:
instances[cls] = cls(*args, **kwargs)
return instances[cls]
ret... | 31.813953 | 108 | 0.660088 |
1dc93251733864f7364496ed7eec9faedaba7573 | 1,208 | py | Python | wordtest-master/options.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | wordtest-master/options.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | 3 | 2021-03-10T13:18:31.000Z | 2021-05-11T09:20:11.000Z | wordtest-master/options.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | class Options():
YES = 1
NO = 2
NONE = 3
def option(self, question, default_answer):
while True:
selection = input("{} {}: ".format(question,
'(y/n)' if default_answer is self.NONE else '(Y/n)' if default_answer is self.YES else '(y/N)'... | 36.606061 | 143 | 0.530629 |
380616c2260eb0cbc490bd0820afc87673db2969 | 480 | py | Python | ipsc/2018/G2.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 6 | 2018-10-15T18:45:05.000Z | 2022-03-29T04:30:10.000Z | ipsc/2018/G2.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | null | null | null | ipsc/2018/G2.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 4 | 2018-01-07T06:20:07.000Z | 2019-08-21T15:45:59.000Z | import subprocess
# process = subprocess.Popen(['git', 'ls-tree', '-r', '--name-only f3a57af82'], stdout=subprocess.PIPE)
# stdout = process.communicate()[0]
# print(stdout)
def git(*args):
return subprocess.Popen(['git'] + list(args))
process = git('ls-tree', '-r', '--name-only', ' f3a57af82')
while True:
o... | 28.235294 | 103 | 0.627083 |
69dea3df778ec8dad0e949265ace7e097c5285fa | 362 | py | Python | 1_basics/6_stroke.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 1_basics/6_stroke.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 1_basics/6_stroke.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Linienfarbe
- Probiere einige Formen so zu positionieren, dass sie sich überlagern.
- Schalte die Füll- und Linienfarben an/aus.
"""
newPage(1000, 1000)
fill(None)
stroke(0, 0, 1)
strokeWidth(2)
line((178, 82), (width(), height()))
line((0, 0), (width(), height()))
oval(100, 100, 800, 800)
oval(160, 160, 800, 8... | 19.052632 | 71 | 0.660221 |
934dcb35f04c681b87637199c0a36282abca2487 | 2,526 | py | Python | test/sqlserver/scrape.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | test/sqlserver/scrape.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | test/sqlserver/scrape.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | from bs4 import BeautifulSoup
import requests
import re
pages = ['avg', 'count', 'max', 'min', 'stdev', 'sum', 'var', 'cume-dist', 'first-value', 'last-value', 'lag', 'lead', 'percent-rank', 'dense-rank', 'ntile', 'rank', 'row-number']
# crash!
# url = 'https://docs.microsoft.com/en-us/sql/t-sql/functions/first-val... | 26.87234 | 179 | 0.596991 |
aa01e86e27c5eeca7c4f9f7186242f3744b8ebd8 | 3,520 | py | Python | nlp2go/model.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 25 | 2020-02-20T14:25:58.000Z | 2022-01-05T03:32:37.000Z | nlp2go/model.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 3 | 2020-10-21T15:03:39.000Z | 2020-10-21T15:03:48.000Z | nlp2go/model.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 1 | 2020-09-15T15:22:49.000Z | 2020-09-15T15:22:49.000Z | import inspect
import nlp2
import tfkit
from transformers import pipeline, pipelines, BertTokenizer, cached_path, AutoTokenizer
from nlp2go.modelhub import MODELMAP
from nlp2go.parser import Parser
class Model:
def __init__(self, model_path, panel=False, **param):
self.model = None
self.enable_... | 46.315789 | 116 | 0.64858 |
3532b9076f04c369b01f67c771cef06bab34c490 | 251 | py | Python | src/onegov/onboarding/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.onboarding.models.assistant import (
Assistant,
DefaultAssistant,
Step
)
from onegov.onboarding.models.town_assistant import TownAssistant
__all__ = [
'Assistant',
'DefaultAssistant',
'Step',
'TownAssistant'
]
| 17.928571 | 65 | 0.709163 |
dc416e454ef6ebfa3502f33ccc2e60ae6d159b67 | 391 | py | Python | project/custom_session_interface.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/custom_session_interface.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/custom_session_interface.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from flask import request
from flask.sessions import SecureCookieSessionInterface
class CustomSessionInterface(SecureCookieSessionInterface):
"""Prevent creating session from API requests."""
def save_session(self, *args, **kwargs):
if "authorization" in request.headers:
return
re... | 32.583333 | 80 | 0.741688 |
5e473b408e7351857d3fdb7b0b9da9e0a1a57b9e | 451 | py | Python | src/python3_learn_video/pickle_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/pickle_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/pickle_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | """
pickle:泡菜
数据类型和二进制数据之间的转换工具
将一些json或者数据写入到单独的一个文件里,使代码更加的有逻辑性,更优雅
"""
import pickle
print('--------------------------------------------------')
my_list = [123, 3.14, '小甲鱼', ['another list']]
pickle_file = open('wyz.pkl', 'wb') # 二进制的写入形式
pickle.dump(my_list, pickle_file)
pickle_file.close()
pickle_file = ope... | 20.5 | 59 | 0.552106 |
5e666e5b69a5a824114d2a5f45054efe39abef12 | 1,616 | py | Python | THC/2021/crypto/Kidsign/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | THC/2021/crypto/Kidsign/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | THC/2021/crypto/Kidsign/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from Crypto.Util.number import inverse, isPrime
from random import SystemRandom
from hashlib import sha256
from flag import FLAG
import os
rand = SystemRandom()
class ElGamal:
def __init__(self):
self.q = 8966609407579935833391255375154491466554551538628382401199255823112028665721378555915151305602728086902061611... | 29.381818 | 319 | 0.683168 |
0d8304b3213befdfe53a4b73456ba0b4e4fd1ed6 | 1,166 | py | Python | examples/chained_callback.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 1 | 2022-03-01T07:38:32.000Z | 2022-03-01T07:38:32.000Z | examples/chained_callback.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 12 | 2021-07-13T12:33:36.000Z | 2021-07-14T05:25:19.000Z | examples/chained_callback.py | xinetzone/dash-book | 1f624e87e2aa02c9931318918df969e44bdd2c07 | [
"Apache-2.0"
] | null | null | null | from dash import dcc, html
from dash.dependencies import Input, Output
from app import app
all_options = {
'America': ['New York City', 'San Francisco', 'Cincinnati'],
'Canada': [u'Montréal', 'Toronto', 'Ottawa']
}
layout = html.Div([
dcc.RadioItems(
id='countries-radio',
options=[{'label... | 26.5 | 76 | 0.661235 |
33e46927a19f3a509e25d19dab9de278944cac8a | 332 | py | Python | 20-fs-ias-lec/groups/01-dev2dev/Code/BTonly/test.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/01-dev2dev/Code/BTonly/test.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/01-dev2dev/Code/BTonly/test.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import impexp
import lib.pcap as pcap
try:
print("eigene DB")
pcap.dump("test.pcap")
except Exception as e:
print(e)
try:
print("eigener Payload")
pcap.dump("payload.pcap")
except Exception as e:
print(e)
try:
print("peer Payload")
pcap.dump("peerPayload.pcap")
except Exception as e:
... | 19.529412 | 33 | 0.656627 |
d51456af4becf2973ae5afeb3d1852a2c3b22fe9 | 84,184 | py | Python | experimental/OUTDATED/ts2dataclass/testdata/lsp-specification.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | experimental/OUTDATED/ts2dataclass/testdata/lsp-specification.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | experimental/OUTDATED/ts2dataclass/testdata/lsp-specification.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null |
from collections import ChainMap
from dataclasses import dataclass
from enum import Enum, IntEnum
from typing import Union, List, Tuple, Optional, Dict, Any, Generic, TypeVar, TypedDict
class _TypedDictMeta(type):
def __new__(cls, name, bases, ns, total=True):
"""Create new typed dict class object.
... | 32.935837 | 731 | 0.773615 |
1d76a1271b75f9fa0087f7a0704be0a5bcb8d5df | 1,141 | py | Python | day21/snake/scoreboard.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day21/snake/scoreboard.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day21/snake/scoreboard.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from turtle import Turtle
ALIGNMENT = "center"
FONT = "Verdana"
FONT_SIZE = 12
class ScoreBoard(Turtle):
def __init__(self) -> None:
super().__init__()
self.score = 0
self.shape("circle")
self.color("white")
self.speed("fastest")
self.hideturtle()
self.... | 24.276596 | 67 | 0.550394 |
d541db214fb721091352e15564692248d115ca69 | 1,404 | py | Python | cNoise.py | rsautter/NRDA | 82279ae70ade4e6fe6378e4c571bb7c79395f7e1 | [
"MIT"
] | null | null | null | cNoise.py | rsautter/NRDA | 82279ae70ade4e6fe6378e4c571bb7c79395f7e1 | [
"MIT"
] | null | null | null | cNoise.py | rsautter/NRDA | 82279ae70ade4e6fe6378e4c571bb7c79395f7e1 | [
"MIT"
] | null | null | null | from numpy.random import normal
import numpy as np
def cNoise(beta,shape=(1024,),std=0.001):
'''
Wrote by: Rubens Andreas Sautter (2021)
Approximating spectral decay by the squared root of the 1/(f^n).
Frequency are measured in multidimensional space by the frequency euclidian distance... | 29.87234 | 91 | 0.635328 |
8950c9bc177d907a45428b3a1075033b05b310e8 | 107 | py | Python | Algorithms/Implementation/mini_max_sum.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Algorithms/Implementation/mini_max_sum.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Algorithms/Implementation/mini_max_sum.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | X = list(map(int, input().split()))
X.sort()
l = sum(X[:4])
h = sum(X[1:])
print(str(l) + ' ' + str(h))
| 11.888889 | 35 | 0.476636 |
895558875072a40e27822772212eb2afa8be4ece | 478 | py | Python | Projeto/laser.py | joaoantonio17/Space-war | e348164698df56dd89665410734516fc69f4c8ac | [
"MIT"
] | null | null | null | Projeto/laser.py | joaoantonio17/Space-war | e348164698df56dd89665410734516fc69f4c8ac | [
"MIT"
] | null | null | null | Projeto/laser.py | joaoantonio17/Space-war | e348164698df56dd89665410734516fc69f4c8ac | [
"MIT"
] | null | null | null | import pygame
class laser():
def __init__(self, janela, nave):
self.janela = janela
self.janela_rect = self.janela.get_rect()
self.nave_rect = nave.nave_rect
self.laser = pygame.Rect(0, 0, 3, 5)
self.laser.centerx = self.nave_rect.centerx
self.laser.y = self.nave_rect... | 34.142857 | 62 | 0.623431 |
8959c4576e7a5d6f256bf228785a84d118b2a2eb | 4,287 | py | Python | rfvision/models/detectors/usd_seg.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | rfvision/models/detectors/usd_seg.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | rfvision/models/detectors/usd_seg.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | import torch
import numpy as np
from rfvision.models.builder import DETECTORS
from .yolo import YOLOV3
from .fcos import FCOS
from rfvision.core import bbox_mask2result
@DETECTORS.register_module()
class USDSegYOLOV3(YOLOV3):
def __init__(self,
backbone,
neck,
b... | 33.755906 | 108 | 0.534173 |
895dfa8b94d963d79be359b32a90dc4440843cd5 | 14,436 | py | Python | web/src/container.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | 1 | 2016-05-31T06:52:53.000Z | 2016-05-31T06:52:53.000Z | web/src/container.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | null | null | null | web/src/container.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import subprocess, os, json, random
import imagemgr
from log import logger
import env
class Container(object):
def __init__(self, addr, etcdclient):
self.addr = addr
self.etcd=etcdclient
self.libpath = env.getenv('DOCKLET_LIB')
self.confpath = env.getenv('DOCKLET... | 45.974522 | 178 | 0.587213 |
f6f684dc0b78ee77982068bdeb55583ef8014114 | 7,721 | py | Python | domain/actions/actions.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 7 | 2020-02-05T20:42:48.000Z | 2020-02-09T15:39:07.000Z | domain/actions/actions.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 7 | 2020-02-04T17:26:35.000Z | 2020-02-04T17:27:45.000Z | domain/actions/actions.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 1 | 2021-09-30T13:56:26.000Z | 2021-09-30T13:56:26.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.actions import Action
from rasa_core.actions.forms import FormAction, EntityFormField
from rasa_core.events import AllSlotsReset
from rasa_core.events impo... | 38.034483 | 172 | 0.661702 |
d64f5006b12eeab1be57be3fd636991a193c0452 | 990 | py | Python | Dataset_Generation/Umwandlungsskript_v2.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | 4 | 2019-03-17T19:55:43.000Z | 2019-04-30T15:22:36.000Z | Dataset_Generation/Umwandlungsskript_v2.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | null | null | null | Dataset_Generation/Umwandlungsskript_v2.py | simi48/Ef-If_Jassen | 6076839492bff591cf9b457e949999e9167903e6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# This script modifies textfiles in order to work with YOLOv2
#
# Author: Michael Siebenmann
# Date : 29.04.2019
#
# History:
# Version Date Who Changes
# 1.0 29.04.2019 M7ma cr... | 34.137931 | 113 | 0.454545 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.