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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fafab7c8944e0a8e0532b2c858deaf1264bd067e | 2,449 | py | Python | dokumentation/video_detection/examples/face_detection.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | dokumentation/video_detection/examples/face_detection.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | dokumentation/video_detection/examples/face_detection.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | # Phyton Example File
import numpy as np
import cv2
import matplotlib.pyplot as plt
import sys
from time import sleep
import picamera
print "Version: " + cv2.__version__+" Beispieldatei"
face_cascade = cv2.CascadeClassifier('./data/haarcascades/haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifi... | 33.547945 | 95 | 0.639445 |
8782cad640e1f6f035fe73df7cacebe0e4bb1a1e | 10,955 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/remote_management/dellemc/test_ome_device_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/remote_management/dellemc/test_ome_device_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/remote_management/dellemc/test_ome_device_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 2.0
# Copyright (C) 2019 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# All rights reserved. Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trad... | 57.657895 | 191 | 0.730625 |
35c776f1010653dc19b6a76ea51faa6ac98698ae | 5,584 | py | Python | abfahrt/Plan.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | 1 | 2022-01-30T14:30:02.000Z | 2022-01-30T14:30:02.000Z | abfahrt/Plan.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | abfahrt/Plan.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | """
This is Plan for depicting line plan and calculating the shortest route with dijkstra
"""
from typing import List
# This module provides runtime support for type hints. The most fundamental support consists of the types Any, Union, Callable, TypeVar, and Generic. For a full specification, please see PEP 484. Fo... | 33.842424 | 301 | 0.575394 |
35ce974065db157278fb77bc2df2b1b45953c69a | 2,119 | py | Python | TG-Bridger-master/bot.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | TG-Bridger-master/bot.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | TG-Bridger-master/bot.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | from telethon import TelegramClient, events
from telethon.errors import SessionPasswordNeededError
from telethon.errors.rpcerrorlist import PeerFloodError
import json
import os
import re
import sys
import asyncio
from dotenv import load_dotenv
load_dotenv()
api_id = int(os.getenv("API_ID"))
api_hash = os.getenv("API_... | 29.430556 | 109 | 0.583294 |
5770fcea4667448931f20c701b213d826f19d160 | 1,077 | py | Python | examples/docs/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 17 | 2020-11-20T15:58:02.000Z | 2022-02-06T19:18:20.000Z | examples/docs/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 3 | 2021-02-17T13:47:44.000Z | 2021-10-14T13:53:15.000Z | examples/docs/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 6 | 2020-11-23T09:51:26.000Z | 2022-02-11T13:46:57.000Z | import os
from universal_build import build_utils
from universal_build.helpers import build_mkdocs
HERE = os.path.abspath(os.path.dirname(__file__))
def main(args: dict) -> None:
# set current path as working dir
os.chdir(HERE)
if args.get(build_utils.FLAG_MAKE):
# Install pipenv dev requiremen... | 28.342105 | 59 | 0.706592 |
57e4b8a9f7647e0a0eab8fa3bb475267c12f867a | 1,379 | py | Python | research/cv/DnCNN/src/show_image.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DnCNN/src/show_image.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DnCNN/src/show_image.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.787879 | 96 | 0.683829 |
aa2c709aae6fabbc61c2704afa48a3a7823910d2 | 569 | py | Python | verto/errors/ArgumentValueError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/errors/ArgumentValueError.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/errors/ArgumentValueError.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from verto.errors.Error import Error
class ArgumentValueError(Error):
'''Exception raised when an argument is not one of the required
values.
Attributes:
tag: tag which was not matched
argument: the argument that was not found
value: the value that was not matched
message:... | 27.095238 | 67 | 0.650264 |
10817766be061eb42a091ef56cd8af1f88706b84 | 240 | py | Python | integers_sizes.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | integers_sizes.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | integers_sizes.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | def integers(a, b, c, d):
output = ((a**b) + (c**d))
return output
if __name__ == '__main__':
a = int(input())
b = int(input())
c = int(input())
d = int(input())
result = integers(a, b, c, d)
print(result)
| 18.461538 | 33 | 0.5 |
52c02a47d234d37df58b75e1312380d05438bf1b | 980 | py | Python | src/aijack/defense/ckks/plaintext.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/ckks/plaintext.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/ckks/plaintext.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | from numpy.polynomial import Polynomial
class CKKSPlaintext:
def __init__(self, p: Polynomial, N: int, scale: int):
self.p = p
self.N = N
self.scale = scale
self.poly_modulo = Polynomial(
[1 if i == 0 or i == N else 0 for i in range(N + 1)]
)
def __add__(s... | 31.612903 | 88 | 0.556122 |
52ddd10ff4395d08a84904ff31a9e066c6cb7229 | 92 | py | Python | Python/Sets/intersection_operation.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/intersection_operation.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/intersection_operation.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | _ = input()
n = set(input().split())
_ = input()
b = set(input().split())
print(len(n & b)) | 15.333333 | 24 | 0.543478 |
d804c3f7c9a942bcc4fff79c988716b2a5ceb2a9 | 10,836 | py | Python | src/diagrams/icons/VRT_dark_png.py | kkaruso/niv | 67ba82c93279db4dae503d4dceec7ba5e9931c0a | [
"MIT"
] | null | null | null | src/diagrams/icons/VRT_dark_png.py | kkaruso/niv | 67ba82c93279db4dae503d4dceec7ba5e9931c0a | [
"MIT"
] | null | null | null | src/diagrams/icons/VRT_dark_png.py | kkaruso/niv | 67ba82c93279db4dae503d4dceec7ba5e9931c0a | [
"MIT"
] | null | null | null | # This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _ICONS
class _Vrt_Dark_DarkPng(_ICONS):
_type = "VRT_dark_DarkPng"
_icon_dir = "../resources/icons/VRT_Icons/VRT_png/VRT_dark_png"
class LaserScanner1DarkPng(_Vrt_Dark_DarkPng):
_icon = "zweidlaserscanner1.png"
class L... | 21.715431 | 69 | 0.791897 |
f4d11ca5e5359a8fed73650986c74d688da6136e | 968 | py | Python | TimeLoopLib/ExternalDynamicTimeStepping.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TimeLoopLib/ExternalDynamicTimeStepping.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TimeLoopLib/ExternalDynamicTimeStepping.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: jasper.bathmann@ufz.de
"""
from TimeLoopLib.TreeDynamicTimeStepping import TreeDynamicTimeStepping
class ExternalDynamicTimeStepping(TreeDynamicTimeStepping):
def __init__(self, project, t_0):
super().__init__(project)
#... | 33.37931 | 78 | 0.652893 |
7628e5d1268801c61c6b71135c3a70056622a2e5 | 168 | py | Python | SuperRandCMDs/test.py | jztech101/Loggy | 1883a09ebbb6c8120cae648aebeb2771e7f39d9b | [
"MIT"
] | null | null | null | SuperRandCMDs/test.py | jztech101/Loggy | 1883a09ebbb6c8120cae648aebeb2771e7f39d9b | [
"MIT"
] | 6 | 2018-02-09T18:39:37.000Z | 2018-08-31T18:40:02.000Z | SuperRandCMDs/test.py | jztech101/Loggy | 1883a09ebbb6c8120cae648aebeb2771e7f39d9b | [
"MIT"
] | null | null | null |
from supybot.test import *
class SuperRandCMDsTestCase(PluginTestCase):
plugins = ('SuperRandCMDs',)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
| 15.272727 | 56 | 0.75 |
52780fed17aa5e698a8d2ba10ee1230ac0048325 | 3,749 | py | Python | kts/models/common.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/models/common.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/models/common.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | from kts.modelling.mixins import ProgressMixin, Placeholder
try:
from xgboost import XGBClassifier as _XGBClassifier
from xgboost import XGBRegressor as _XGBRegressor
except ImportError:
_XGBClassifier = Placeholder
_XGBRegressor = Placeholder
try:
from lightgbm import LGBMClassifier as _LGBMClass... | 29.289063 | 102 | 0.616698 |
5e4b391411d129529bffba2348667709f3c82318 | 5,947 | py | Python | lib/python/qmk/cli/info.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/cli/info.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/cli/info.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | """Keyboard information script.
Compile an info.json for a particular keyboard and pretty-print it.
"""
import json
from milc import cli
from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.keyboard import render_layouts, render_layout
from qmk.keymap import locate_keymap
from qmk.info import inf... | 37.402516 | 148 | 0.656465 |
5e59f7e75d30031b3b98072caa55f25d946fb752 | 604 | py | Python | ComputerNetworks/tcp.py | creyD/uni | 83786e5f18701ce28324d33748ebbf49cc7a53f2 | [
"MIT"
] | null | null | null | ComputerNetworks/tcp.py | creyD/uni | 83786e5f18701ce28324d33748ebbf49cc7a53f2 | [
"MIT"
] | null | null | null | ComputerNetworks/tcp.py | creyD/uni | 83786e5f18701ce28324d33748ebbf49cc7a53f2 | [
"MIT"
] | null | null | null | import socket
def recieveLine(conn):
data = ''
while True:
d = conn.recv(1024).decode("utf-8")
if d == '\r\n':
return data
data += d
return 0
HOST = ""
PORT = 8081
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
connection_obj, a... | 15.894737 | 55 | 0.589404 |
0d659e995006702b06d3e88affe96b4623267514 | 381 | py | Python | exercises/zh/test_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/test_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/test_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Token.has_extension(
"reversed"
), "你有在词符上注册这个扩展吗?"
ext = Token.get_extension("reversed")
assert ext[2] is not None, "你有正确设置取值器getter吗?"
assert (
"getter=get_reversed" in __solution__
), "你有正确把get_reversed赋给getter吗?"
assert "token._.reversed" in __solution_... | 29.307692 | 62 | 0.669291 |
804bffe3fe7f84990827910b169d48b9f8333887 | 295 | py | Python | src/Themes/Theme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/Themes/Theme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/Themes/Theme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | class Theme:
def __init__(self):
pass
def determine_kind(self, graph, shapes, shape):
raise NotImplementedError("This function was not yet implemented.")
def prepare(self, graph, shapes):
raise NotImplementedError("This function was not yet implemented.")
| 26.818182 | 75 | 0.688136 |
33f2ea296e92ed1401a029b515b882e9db006479 | 4,113 | py | Python | src/pvn.py | whfuyn/fyzero | c4c258849a29c84531b54fb67109be6675c28151 | [
"MIT"
] | 1 | 2019-02-16T06:27:32.000Z | 2019-02-16T06:27:32.000Z | src/pvn.py | whfuyn/AlphaFy | c4c258849a29c84531b54fb67109be6675c28151 | [
"MIT"
] | null | null | null | src/pvn.py | whfuyn/AlphaFy | c4c258849a29c84531b54fb67109be6675c28151 | [
"MIT"
] | null | null | null | import os
import keras
import numpy as np
from keras import regularizers
from keras.models import Model, Input, load_model
from keras.losses import categorical_crossentropy, mean_squared_error
from keras.layers import (
Add, Dense, Conv2D, Reshape, Flatten, BatchNormalization, Activation
)
from config import (
... | 33.169355 | 72 | 0.59397 |
6364c6155302f31b794177916f1a77cb5a65eb4e | 996 | py | Python | cogs/earth2.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | 1 | 2021-04-21T09:01:26.000Z | 2021-04-21T09:01:26.000Z | cogs/earth2.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | cogs/earth2.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
import requests
class Earth2(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(name="earth2")
async def earth2_command(self, ctx):
url = "https://earth2stats.net/api/get_countries/199"
response = reque... | 35.571429 | 126 | 0.675703 |
8982d6a0581fa2fed1c57a0ddfe6c29cba7e821b | 1,282 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/113_desafio-POO/contas/conta.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/113_desafio-POO/contas/conta.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/113_desafio-POO/contas/conta.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from datetime import datetime
class Cliente:
def __init__(self, nome, idade):
self._nome = nome
self._idade = idade
@property
def nome(self):
return self._nome
@nome.getter
def nome(self):
return self._nome
@property
de... | 20.03125 | 77 | 0.586583 |
c39a64a38c35834a72cbcddd21f8ab904151ff55 | 6,261 | py | Python | main/plot.py | WolfMy/Event-Driven-Backtest | 2d39492589373a4639ec13cb94790537edb8d25f | [
"MIT"
] | 1 | 2020-05-12T10:31:18.000Z | 2020-05-12T10:31:18.000Z | main/plot.py | WolfMy/Event-Driven-Backtest | 2d39492589373a4639ec13cb94790537edb8d25f | [
"MIT"
] | null | null | null | main/plot.py | WolfMy/Event-Driven-Backtest | 2d39492589373a4639ec13cb94790537edb8d25f | [
"MIT"
] | null | null | null | import datetime
import pandas as pd
import numpy as np
from pyecharts.charts import Kline, Line
from pyecharts import options as opts
from event import FillEvent
class pyechartsPlotor(object):
"""
绘图类负责收集bars数据以及fill买卖点,在回测完成时,绘制出K线图。
"""
def __init__(self, bars, events):
self.bars = bars
... | 40.393548 | 112 | 0.476122 |
c39cc09bbdc7b3af3c1122b0add1162c27e3fae4 | 6,821 | py | Python | main.py | billalxcode/ATM-cli | 68e295b1e3c152ee5c35913af84d72468cab06e0 | [
"MIT"
] | null | null | null | main.py | billalxcode/ATM-cli | 68e295b1e3c152ee5c35913af84d72468cab06e0 | [
"MIT"
] | null | null | null | main.py | billalxcode/ATM-cli | 68e295b1e3c152ee5c35913af84d72468cab06e0 | [
"MIT"
] | null | null | null | import time
import getpass
from system.cmd import CMD
from system.database import Database
from system.account import Account
from system.withdraw import Withdraw
from system.transfer import Transfer
from system.deposit import Deposit
class ATM(object):
def __init__(self) -> None:
super().__init__()
... | 35.526042 | 98 | 0.449348 |
614cb33f9d749f947a587d92b15370100e50242c | 2,609 | py | Python | tests/onegov/wtfs/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os
import yaml
from click.testing import CliRunner
from onegov.wtfs.cli import cli
def write_config(path, postgres_dsn, temporary_directory, redis_url):
cfg = {
'applications': [
{
'path': '/onegov_wtfs/*',
'application': 'onegov.wtfs.WtfsApp',
... | 32.6125 | 78 | 0.60138 |
6168e0752108b79c4a2a4cb2e9764ec410be7741 | 2,484 | py | Python | research/cv/wgan/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/wgan/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/wgan/src/dataset.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.4 | 111 | 0.683172 |
1afa607aa307a9568315e3a0ed0ddae6dfc7ee61 | 125 | py | Python | geol/utils/__init__.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | geol/utils/__init__.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | geol/geometry/__init__.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | """
File description
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com> Michele Ferretti <mic.ferretti@gmail.com>
| 20.833333 | 98 | 0.752 |
dcf564c4b5c954871852f8b44d585ad5ac85d0e0 | 973 | py | Python | sftpserver/setup.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | sftpserver/setup.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | sftpserver/setup.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | import os
from setuptools import setup, find_packages
classifiers = """\
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Topic :: Internet :: File Transfer Protocol (FTP)
Operating System :: Unix
"""
def read(*rel_names):
return open(os.path.join(os.path.dir... | 25.605263 | 75 | 0.675231 |
dcf59acdfd0968302657b0a9c409dea08e5dba30 | 1,633 | py | Python | semdial_to_acl.py | briemadu/semdial-proceedings | 59f13adcc73dc9433c3c07ee929fadd8d271b022 | [
"Apache-2.0"
] | null | null | null | semdial_to_acl.py | briemadu/semdial-proceedings | 59f13adcc73dc9433c3c07ee929fadd8d271b022 | [
"Apache-2.0"
] | null | null | null | semdial_to_acl.py | briemadu/semdial-proceedings | 59f13adcc73dc9433c3c07ee929fadd8d271b022 | [
"Apache-2.0"
] | 2 | 2021-09-16T07:16:15.000Z | 2021-10-30T06:41:55.000Z | from xml.etree.ElementTree import Element, SubElement, Comment, tostring
import os, shutil
def make_xml(counter, title, names, year):
top = Element('paper')
top.set('id', str(counter))
title_xml = SubElement(top, 'title')
title_xml.text = title
for name in names:
name = name.split()
... | 31.403846 | 85 | 0.56583 |
0d185837a47dfeb44b74671b5b0c4145c70f339c | 5,472 | py | Python | server/scebase.py | cutec-chris/sce | da1f906ff4a049722b8968eeab8a07b411c92a8c | [
"MIT"
] | null | null | null | server/scebase.py | cutec-chris/sce | da1f906ff4a049722b8968eeab8a07b411c92a8c | [
"MIT"
] | null | null | null | server/scebase.py | cutec-chris/sce | da1f906ff4a049722b8968eeab8a07b411c92a8c | [
"MIT"
] | null | null | null | import pathlib,json,time
from vectormath.vector import Vector3
class GameObject:
def __init__(self,World,name,Position=Vector3(0,0,0),Direction=Vector3(0,0,0)):
if not hasattr(self,'Folder'):
self.Folder = 'tiles/%d_%d_%d' % (Position[0] / World.TileSize,
... | 39.085714 | 116 | 0.559393 |
2ea67d4d325cc7fa541216fcb6266e3a7f292f1f | 1,592 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/heads/transnetv2_head.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/heads/transnetv2_head.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/heads/transnetv2_head.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:51:21.000Z | 2022-03-07T10:51:21.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 34.608696 | 74 | 0.667085 |
257c7d85558ed9a1ec1c9f43abc55af1cb274820 | 4,644 | py | Python | tspdb/src/tslb/src/utils.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 43 | 2019-12-10T00:05:51.000Z | 2022-03-31T21:21:20.000Z | tspdb/src/tslb/src/utils.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 5 | 2021-05-09T01:12:31.000Z | 2022-03-29T17:34:15.000Z | tspdb/src/tslb/src/utils.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 14 | 2020-01-13T21:20:07.000Z | 2022-03-31T02:11:26.000Z | ######################################################
#
# Utility functions
#
######################################################
import numpy as np
from numpy.linalg import eig
from math import log, e
# multinomial
def multinomial(n,p = [1/3,1/3,1/3]):
final = []
for i in range(n):
result = np.ran... | 24.062176 | 112 | 0.524332 |
6cce875d3717941c9d88f66e1d1f490111c6b610 | 1,043 | py | Python | example/data_encryption_and_storage.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | example/data_encryption_and_storage.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | example/data_encryption_and_storage.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | # Test
# acc_des = 'This is a test account.2'
# acc_username = '2'
# acc_password = '2'
# secret_msg = 'Hello :)'
# enc_acc_dess = enc.encrypt_data(
# 'b2001bccdcb7ea5556526cb70e58206996c3039282dd62e2ddc4a1d55be6c1d6',
# data=acc_des)
# enc_username = enc.encrypt_data(
# 'b2001bccdcb7ea5556526cb70e58206996c... | 35.965517 | 76 | 0.715244 |
9f8d55d510acfb7ca681c391aa9a87c707464d03 | 5,247 | py | Python | repo/service.vpn.manager/table.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/service.vpn.manager/table.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/service.vpn.manager/table.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Zomboided
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 53.540816 | 158 | 0.65142 |
9f9c49f49124fce38089e27bbdcbe1cd2f5662a3 | 584 | py | Python | leetcode/315-Count-of-Smaller-Numbers-After-Self/CntSmllerNumAftSelf_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/315-Count-of-Smaller-Numbers-After-Self/CntSmllerNumAftSelf_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/315-Count-of-Smaller-Numbers-After-Self/CntSmllerNumAftSelf_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def countSmaller(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
if nums == []:
return []
res = []
sorted_nums = []
rev = nums[::-1]
for num in rev:
l, r = 0, len(res) - 1
... | 23.36 | 41 | 0.349315 |
981b52086c3f6784e82176fe3dced67c061dadcb | 1,725 | py | Python | pythonProj/FZPython/demo/import_daily_price.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/demo/import_daily_price.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/demo/import_daily_price.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | #!/usr/bin/env python
# coding: utf8
import tushare as ts
from pyquant.db_models import Symbol
from pyquant.db_models import DailyPrice
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
engine = create_engine("mysql+pymysql://root:root@121.42.26.144/fzquant?charset=utf8")
# 创建DBSession... | 22.402597 | 125 | 0.685217 |
2c7b6438f0402c9000f0b1ee3b9e6620bc936f01 | 6,067 | py | Python | weather.py | phucdev/weatherbot | 2a88ebb5fb52cc8309f6ce133d850328320a5f5f | [
"Apache-2.0"
] | null | null | null | weather.py | phucdev/weatherbot | 2a88ebb5fb52cc8309f6ce133d850328320a5f5f | [
"Apache-2.0"
] | 10 | 2016-06-21T17:25:23.000Z | 2016-07-19T09:07:02.000Z | weather.py | phucdev/weatherbot | 2a88ebb5fb52cc8309f6ce133d850328320a5f5f | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
"""
Author: Phuc Tran Truong, Marcus Ding
Date: 17.07.2016
What it is supposed to do:
1. retrieve data from the openweathermap API
2. save it in a dictionary
3. send the information back in a human friendly way as a string
arguments: place, time and type of query
"""
import math # for rou... | 34.471591 | 274 | 0.667711 |
2cc624371156cb48595523c9138d36f52a3256e2 | 5,213 | py | Python | python-bildungslogin/src/univention/bildungslogin/license_import/__init__.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/src/univention/bildungslogin/license_import/__init__.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/src/univention/bildungslogin/license_import/__init__.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2021 Univention GmbH
#
# http://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions o... | 38.330882 | 108 | 0.648763 |
1ab56164f1f972993d89f85d61f33d1380e68514 | 2,616 | py | Python | Django/ballon/schema.py | ballon3/GRAD | c630e32272fe34ead590c04d8360169e02be87f1 | [
"MIT"
] | null | null | null | Django/ballon/schema.py | ballon3/GRAD | c630e32272fe34ead590c04d8360169e02be87f1 | [
"MIT"
] | null | null | null | Django/ballon/schema.py | ballon3/GRAD | c630e32272fe34ead590c04d8360169e02be87f1 | [
"MIT"
] | null | null | null | import graphene
from graphene_django.types import DjangoObjectType
from ballon.models import Pkg, Resume, Main, Education, Testimonial, Address, Social, Work, Skill, Project
class PkgType(DjangoObjectType):
class Meta:
model = Pkg
class ResumeType(DjangoObjectType):
class Meta:
model = Res... | 21.619835 | 108 | 0.655199 |
b3919818c8f37cbd5a836f64c2bd3a6161b7c63a | 1,196 | py | Python | py_projects/stopwatch/stopwatchgui.py | Anwesha-dash811/hacktober-1 | 188c859864f06f94a94cb91e63979366db62b9ac | [
"MIT"
] | 1 | 2020-10-04T12:36:45.000Z | 2020-10-04T12:36:45.000Z | py_projects/stopwatch/stopwatchgui.py | Anwesha-dash811/hacktober-1 | 188c859864f06f94a94cb91e63979366db62b9ac | [
"MIT"
] | 1 | 2021-09-30T16:20:57.000Z | 2021-09-30T16:20:57.000Z | py_projects/stopwatch/stopwatchgui.py | Anwesha-dash811/hacktober-1 | 188c859864f06f94a94cb91e63979366db62b9ac | [
"MIT"
] | 3 | 2020-10-04T09:49:36.000Z | 2020-10-25T15:26:56.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 18:43:42 2020
@author: DELL
"""
import tkinter as tk
import tkinter.font as TkFont
from datetime import datetime
def run():
current_time=datetime.now()
diff=current_time - start_time
txt_var.set('%d.%02d'%(diff.seconds,diff.microseconds//10000))
... | 20.62069 | 65 | 0.674749 |
3790942b063f1e64a3bb522ed7fb7c75023e6270 | 5,741 | py | Python | src/test/tests/operators/ic_pathlines.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/ic_pathlines.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/operators/ic_pathlines.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: ic_pathlines.py
#
# Tests: operator - integralcurve
#
# Defect ID: -
#
# Programmer: Allen Sanderson
# Date: March 10, 2016
#
# Modifications:
# Kathleen Biagas, Thu Sep 17 11:35:... | 35.88125 | 83 | 0.811357 |
37c87607e48fd160344e7af244678fc9656c62a5 | 1,628 | py | Python | Tam/exercise1redo.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | Tam/exercise1redo.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | Tam/exercise1redo.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | # APPFS Tam Tran Exercise 1 Redo
import sys
import pandas as pd
from scipy.stats.mstats import gmean
f = open(sys.argv[1])
data = f.readlines()
df_data = pd.DataFrame(data, columns = ['original'])[:100]
print('File: ', sys.argv[1], " with " , df_data.shape[0], " lines")
df_data['afterHashtag'] = df_data.apply(lamb... | 54.266667 | 169 | 0.664005 |
457e1c4a1c29d7156e36126c54b94e4fea1f70d7 | 10,101 | py | Python | Packs/HPEArubaClearPass/Integrations/HPEArubaClearPass/HPEArubaClearPass_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/HPEArubaClearPass/Integrations/HPEArubaClearPass/HPEArubaClearPass_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/HPEArubaClearPass/Integrations/HPEArubaClearPass/HPEArubaClearPass_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import io
import HPEArubaClearPass
from HPEArubaClearPass import *
from freezegun import freeze_time
import pytest
from pytest import raises
CLIENT_ID = "id123"
CLIENT_SECRET = "secret123"
CLIENT_AUTH = \
{
"access_token": "auth123",
"expires_in": 28800,
"token_type": "Bearer",
... | 37.411111 | 118 | 0.702208 |
b32b56b276ca2ade002b5e73528cf4615cc71cbf | 1,572 | py | Python | src/ard_comm.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | src/ard_comm.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | src/ard_comm.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | import serial
def __arduino_wr(ser: serial.Serial, mode='r', random_str='') -> str:
ser.reset_input_buffer()
mode_ind = '=' if mode == 'r' else '?'
payload = mode_ind + random_str + '\n'
card_uid = ''
card_data = ''
# print(payload)
while True:
s = ser.readline()
s = s.st... | 32.081633 | 72 | 0.557888 |
ff245fcfe5c726e2c6925b4e1e49bddb0cba4da1 | 2,286 | py | Python | src/constants.py | jschito/project_structure_template | e8834129cca72988e08bea78a8a16f4fe071b2ef | [
"BSD-3-Clause"
] | null | null | null | src/constants.py | jschito/project_structure_template | e8834129cca72988e08bea78a8a16f4fe071b2ef | [
"BSD-3-Clause"
] | null | null | null | src/constants.py | jschito/project_structure_template | e8834129cca72988e08bea78a8a16f4fe071b2ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Set of tools used in various modules"""
__author__ = 'XYZ'
__copyright__ = "Copyright 2021, YOUR_COMPANY"
__license__ = "BSD-3-Clause License"
__version__ = "0.0.1"
__status__ = "Development"
import os
import json
import helper
# ----- STRUCTURE DEFINITION
# Defin... | 33.130435 | 114 | 0.754593 |
924b1f9d027aab5a09167a35387072413249ed0f | 1,771 | py | Python | elements/python/8/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/8/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/8/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Node(object):
def __init__(self, x, nxt):
self.x = x
self.next = nxt
def traverse_list(n):
"""
Traverse the whole list. Return the last node and the number of steps to
the last node.
"""
steps = 0
while n.next is not None:
n = n.next
steps += 1
ret... | 17.888889 | 76 | 0.543761 |
a6616ead2b2cb9a7bc647a5f48df3c0f4b84ab88 | 12,206 | py | Python | attackdefense/old/Real-World-Webapps/RCE/exploits/16246.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 21 | 2016-02-06T14:30:01.000Z | 2020-09-11T05:39:17.000Z | attackdefense/old/Real-World-Webapps/RCE/exploits/16246.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | null | null | null | attackdefense/old/Real-World-Webapps/RCE/exploits/16246.py | Kan1shka9/CTFs | 33ab33e094ea8b52714d5dad020c25730e91c0b0 | [
"MIT"
] | 7 | 2017-02-02T16:27:02.000Z | 2021-04-30T17:14:53.000Z | #!/usr/bin/python
#
# Joomla component (com_xcloner-backupandrestore) remote code execution exploit
# Vendor: http://www.xcloner.com/
#
# "Our true divinity is in our ability to create. And armed with the understanding of the symbiotic connections
# of life, while being guided by the emergent nature of reality, there ... | 43.592857 | 146 | 0.651565 |
a6813dd1dba84cfe5917104a2eb4197d501ed49d | 229 | py | Python | 7-assets/past-student-repos/Python-II-Notes-master/src/product.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Python-II-Notes-master/src/product.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Python-II-Notes-master/src/product.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | class Product:
def __init__(self, name, price):
self.name = name
self.price = price
def __repr__(self):
return self.name + '\t$' + str(self.price)
# p = Product('baseball bat', 19.99)
# print(p)
| 20.818182 | 50 | 0.580786 |
5b827925bc75136b10af20c0bd54d86808ab400d | 1,826 | py | Python | apps/facepong2/pongFaceDetector.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | apps/facepong2/pongFaceDetector.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | apps/facepong2/pongFaceDetector.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import cv2
import robolib.modelmanager.downloader as downloader
from apps.facepong2.pongConfig import CONFIG
PONG_FACE_DETECTOR_DEBUG = CONFIG.debug.face_detector_debug
class PongFaceDetector:
def __init__(self):
print()
file = downloader.get_model(downloader.HAARCASCADE_FRONTALFACE_ALT, False)... | 38.851064 | 112 | 0.638554 |
5bb3c9c99ef4963d022d12da84af1c13a29e4ecc | 6,750 | py | Python | tensorflow/basic-rl/tutorial8/gym/doom/doom.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial8/gym/doom/doom.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial8/gym/doom/doom.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | '''
DOOM AI player using random actions (WIP)
@author: Victor Mayoral Vilches <victor@erlerobotics.com>
'''
import gym
import ppaquette_gym_doom
import random
import pandas
import os
from random import sample as rsample
import numpy as np
from keras.models import Sequential
from keras.layers.convolutional import C... | 30.542986 | 109 | 0.581037 |
5bfa8c3f9af296350674c712b49061fa7e1fa048 | 561 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v9_0/revert_manufacturing_user_role.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v9_0/revert_manufacturing_user_role.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v9_0/revert_manufacturing_user_role.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
if 'Manufacturing' in frappe.get_active_domains(): return
role = 'Manufacturing User'
frappe.db.set_value('Role', role, 'restrict_to_domain', '')
frappe.db.set_value('Role', role, 'disabled', 0)
users = frappe.get_all('Has Role', filters = {
'parenttype': 'User',
'role': ('in', ... | 25.5 | 61 | 0.668449 |
f39c0b27e2710ef394c5d1193c1c41ca99180ca9 | 1,432 | py | Python | test/roslab/python/pin_matching_sim.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | test/roslab/python/pin_matching_sim.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | test/roslab/python/pin_matching_sim.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z | import numpy as np
import random
sims = 1
min_dim = 3
max_dim = 8
for i in range(sims):
result = []
step = 1
matrix = np.array([[1, 1, 0, 0, 0], [1, 0, 1, 1, 0], [0, 1, 1, 0, 1], [1, 0, 1, 1, 0], [0, 1, 0, 0, 1]])
#matrix = np.random.randint(2, size=(random.randint(min_dim, max_dim), random.randint(min_dim, m... | 29.833333 | 107 | 0.581704 |
1bd7c42520c7d7a896cdbe71e70eeba03f2c13e7 | 8,323 | py | Python | easyp2p/p2p_chrome.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/p2p_chrome.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/p2p_chrome.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""Module implementing P2PWebDriver."""
import logging
from typing import Optional, Tuple
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import ... | 38.354839 | 78 | 0.617446 |
9471bbd22a20cd9c2c351f874a59d23e478a3d68 | 369 | py | Python | rfvision/models/detectors3d/__init__.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | rfvision/models/detectors3d/__init__.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | rfvision/models/detectors3d/__init__.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | from .base import Base3DDetector
from .single_stage import SingleStage3DDetector
from .votenet import VoteNet
from .imvotenet import ImVoteNet
from .skeleton_merger import SkeletonMerger
from .category_ppf import CategoryPPF
__all__ = ['Base3DDetector', 'SingleStage3DDetector', 'VoteNet',
'ImVoteNet', 'Skele... | 33.545455 | 64 | 0.753388 |
8486d3f79d42469cec577952a770f0d5ea9ef2a1 | 1,600 | py | Python | matrix path DFS.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | matrix path DFS.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | matrix path DFS.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
class Solution:
matrix=[]
xlimit=0
ylimit=0
endpoint=[]
stack=[]
result=0
def findpath(self,matrix,startpoint,endpoint):
self.matrix = matrix
self.xlimit=len(matrix)
self.ylimit=len(matrix[0])
self.endpoint=endpoint
self.stack.append([startpoint[0],startpoint[1]])
self.DFS(start... | 19.512195 | 79 | 0.641875 |
048368a4bf59eee11010d7223a189213f2f3ca38 | 11,780 | py | Python | volley/engine.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | volley/engine.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | volley/engine.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | # Copyright (c) Shipt, Inc.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import builtins
import time
from dataclasses import dataclass, field
from functools import wraps
from typing import Any, Awaitable, Callable, Dict, List, Optional, Tup... | 47.12 | 119 | 0.636248 |
b6c7469133a68fdfe974717ea93281246ed645cb | 857 | py | Python | src/test/tests/operators/revolve.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/revolve.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/operators/revolve.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ---------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: revolve.py
#
# Tests: mesh - 2D unstructured, single domain,
# plots - pseudocolor
# operators - revolve
#
# Programmer: Alister Maguire
# Date: Fri Jun 19 13:30... | 24.485714 | 78 | 0.52042 |
b6df8c58d8f0fad464a1c190334367ca632e5296 | 5,324 | py | Python | frappe-bench/apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from frappe.utils impor... | 35.972973 | 139 | 0.746243 |
6102e5232d0ec9b9a156c3ff7fbd167f0230e106 | 11,837 | py | Python | benchmarks/matbench_v0.1_Ax_10_90_CrabNet_v1.2.7/utils/fractional.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 1 | 2022-01-08T07:36:38.000Z | 2022-01-08T07:36:38.000Z | benchmarks/matbench_v0.1_Ax_10_90_CrabNet_v1.2.7/utils/fractional.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 3 | 2022-03-10T23:09:02.000Z | 2022-03-30T18:32:35.000Z | benchmarks/matbench_v0.1_Ax_10_90_CrabNet_v1.2.7/utils/fractional.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | null | null | null | """Helper functions related to fractional encoding and decoding."""
from collections.abc import Iterable
import numpy as np
import pandas as pd
from scipy.sparse import coo_matrix
def flatten(list_of_lists):
"""Flatten ragged list of lists.
Modified from: https://stackoverflow.com/a/2158532/13697228
Par... | 38.183871 | 146 | 0.640618 |
fcd1a99a41cb35d189506bb7b05097e9c7675c34 | 757 | py | Python | lang-python/wochentag/wochentag.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/wochentag/wochentag.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/wochentag/wochentag.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | # Python Script
#
# Anmerkungen zur Wochentagsunktion.
#
# Die eckige Klammer ist die Gaußklammer:
# Sie gibt die größte ganze Zahl kleiner oder gleich x an.
#
# https://de.wikipedia.org/wiki/Wochentagsberechnung
#
from math import *
# Eingabe
tag = 24
monat = 12
jahr = 2019
tage = ['So', 'Mo', 'Di', 'Mi', 'Do', 'F... | 21.628571 | 145 | 0.5786 |
94b73b3d14fce74298767fd2e3453e70e5385d5e | 4,215 | py | Python | autojail/config/devices.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/config/devices.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/config/devices.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | from collections import namedtuple
from copy import deepcopy
from typing import Optional, Tuple
from autojail.model.board import Board, DeviceMemoryRegion
from autojail.model.jailhouse import JailhouseConfig
from ..model import DebugConsole
from .passes import BasePass
ConsoleSettings = namedtuple("ConsoleSettings",... | 38.669725 | 93 | 0.584816 |
a2100bc8aede9d1a98450e8da947c83baa03ab41 | 1,142 | py | Python | elements/python/10/3/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/10/3/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/10/3/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Node(object):
def __init__(self, v, l=None, r=None):
self.value = v
self.left = l
self.right = r
def is_symmetric(t):
"""
Returns whether the binary tree t is symmetric.
"""
return t is None or equal_mirror(t.left, t.right)
def equal_mirror(t, s):
"""
Return... | 20.392857 | 74 | 0.521891 |
ecef7769aef854b154f8b0e940e9b7b484ad8e04 | 876 | py | Python | jiuzhang/Nine Chapters/3 Binary Tree & Divide Conquer/py/BalancedBinaryTree_rec.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | jiuzhang/Nine Chapters/3 Binary Tree & Divide Conquer/py/BalancedBinaryTree_rec.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | jiuzhang/Nine Chapters/3 Binary Tree & Divide Conquer/py/BalancedBinaryTree_rec.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | """
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: The root of binary tree.
@return: True if this Binary tree is Balanced, or false.
"""
def isBalanced(self, root):
... | 23.052632 | 60 | 0.577626 |
177f57964484197a37fecb7bbdc03af93b39ad97 | 1,537 | py | Python | venv/Lib/site-packages/pynance/tst/unit/tech/test_movave.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/tst/unit/tech/test_movave.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/tst/unit/tech/test_movave.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
Copyright (c) 2014 Marshall Farrier
license http://opensource.org/licenses/MIT
@author: Marshall Farrier
@contact: marshalldfarrier@gmail.com
@since: 2014-11-02
@summary: Unit tests for data module
"""
import unittest
import numpy as np
import pandas as pd
import pynance as pn
class TestMovAve(unittest.TestCas... | 30.137255 | 97 | 0.567339 |
de04d33893a6533f345099236db03c47cc65a313 | 6,774 | py | Python | lbry/lbry/wallet/server/session.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | lbry/lbry/wallet/server/session.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/wallet/server/session.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import os
import math
import base64
import asyncio
from binascii import hexlify
from torba.rpc.jsonrpc import RPCError
from torba.server.session import ElectrumX, SessionManager
from torba.server import util
from lbry.wallet.server.block_processor import LBRYBlockProcessor
from lbry.wallet.server.db.writer import LBR... | 40.08284 | 109 | 0.650576 |
e7cabca986b0365ccfa4624eed67117c1b9b5f0c | 6 | py | Python | Tests/scripts/infrastructure_tests/tests_data/fake_pack/Integrations/fake_changelog/fake_chanelog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/scripts/infrastructure_tests/tests_data/fake_pack/Integrations/fake_changelog/fake_chanelog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/scripts/infrastructure_tests/tests_data/fake_pack/Integrations/fake_changelog/fake_chanelog.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | a = 2
| 3 | 5 | 0.333333 |
41cb7084a4ade0927493bbeebbaa5d71b6b7522f | 3,586 | py | Python | plugins/tff_backend/api/investor.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/api/investor.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/api/investor.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | 51.228571 | 117 | 0.813162 |
ec103648397c73615a15ec37c7c1095911368acd | 937 | py | Python | Tutorials/30_days_of_code/Binary_Numbers.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Tutorials/30_days_of_code/Binary_Numbers.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Tutorials/30_days_of_code/Binary_Numbers.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | import re
# https://www.hackerrank.com/challenges/30-binary-numbers/problem?h_r=internal-search
if __name__ == '__main__':
# method 1
"""
N = 6
binary_string = bin(N).replace('0b','')
# print(binary_string)
pattern = r'1+'
matches = re.findall(pattern, binary_string)
# print(matches)
... | 25.324324 | 85 | 0.504803 |
ec47d4343af4bd70cfa96569276efbb2b29fd4dd | 697 | py | Python | src/lcdoc/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | src/lcdoc/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | src/lcdoc/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | """
docutools package.
Documentation tools for lc projects
"""
import os, sys
# for apps on gevent we must patch early => Set that env variable:
# (see docs lp tips.md)
_ = os.environ.get
af, tp = _('async_framework'), _('try_preload', '')
if af == 'gevent' or 'gevent' in tp:
try:
from gevent import monke... | 24.892857 | 81 | 0.638451 |
6b8940dce57b01bedfcd93c629d296ce12a1bdfd | 12,358 | py | Python | scripts/signal_marker_processing/data_displayer.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/signal_marker_processing/data_displayer.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/signal_marker_processing/data_displayer.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Daniele Borio
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
imp... | 35.409742 | 108 | 0.538113 |
d87de84ee88e0d9760be54ec41a3545953f8c363 | 940 | py | Python | FCN/src/model_exist.py | JNingWei/Image_Segmentation | 4b1663c8b294cfa29da29a0f94dab066af69cd1e | [
"Python-2.0",
"OLDAP-2.7"
] | 13 | 2018-01-21T03:38:06.000Z | 2021-01-16T05:23:53.000Z | FCN/src/model_exist.py | JNingWei/Image-Segmentation | 4b1663c8b294cfa29da29a0f94dab066af69cd1e | [
"Python-2.0",
"OLDAP-2.7"
] | 11 | 2020-01-28T21:40:15.000Z | 2022-03-11T23:16:37.000Z | FCN/src/model_exist.py | JNingWei/Image_Segmentation | 4b1663c8b294cfa29da29a0f94dab066af69cd1e | [
"Python-2.0",
"OLDAP-2.7"
] | 6 | 2018-01-09T06:44:27.000Z | 2020-07-07T07:03:55.000Z | # coding=utf-8
"""
Image-Segmentation
Query whether the model exists.
__author__ = 'JNingWei'
"""
import os
import urllib
import logging
import sys
logging.basicConfig(
format='%(asctime)s %(levelname)s %(message)s',
level=logging.INFO,
stream=sys.stdout)
model_path = os.path.join(os.getcwd(),'model/vgg... | 22.926829 | 64 | 0.656383 |
9937e91623ff76813616f1611acc7a09c24aa5ea | 427 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/7. return the decimal part of a number.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 _1_Basic_Coding_Exercises/7. return the decimal part of a number.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 _1_Basic_Coding_Exercises/7. return the decimal part of a number.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function that returns the decimal part of a number. The output can be rounded to 2 decimal places.
If decimal part is zero, the function should return the string "INTEGER".
example 1:
num = 1.5
expected output = 0.50
example 2:
num = 2
expected output = "INTEGER"
"""
def decimal_part(num):
nums = ... | 18.565217 | 106 | 0.653396 |
997d0220ded38e122515b7217a298332c1a31129 | 967 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/04_bubblesort_algorithm.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/04_bubblesort_algorithm.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/04_bubblesort_algorithm.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 04_bubblesort_algorithm.py
# Project: Kapitel_07_Sequenzen_Mengen_und_Generatoren
# Created Date: Sunday 03.03.2019, 19:49
# Author: Apop85
# -----
# Last Modified: Monday 04.03.2019, 12:16
# -----
# Copyright (c) 2019 Apop85
# This software is published under t... | 31.193548 | 109 | 0.664943 |
514812545dec2573a2563e83dd595e5697e91232 | 27,418 | py | Python | src/onegov/core/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import base64
import bleach
import errno
import fcntl
import gzip
import hashlib
import importlib
import inspect
import magic
import mimetypes
import morepath
import operator
import os.path
import re
import shutil
import sqlalchemy
import urllib.request
from collections.abc import Iterable
from contextlib import conte... | 27.528112 | 79 | 0.631483 |
5ae8bc7a5025b20886790c80b1f61f90afe59c57 | 417 | py | Python | robolib/networks/debug.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | robolib/networks/debug.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | robolib/networks/debug.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import matplotlib.pyplot as plt
import numpy as np
def debug_train_data(data, input_size, stride):
for a, b in data:
shape = (int(input_size[0]/stride), int(input_size[1]/stride))
a = np.reshape(a, shape)
b = np.reshape(b, shape)
plt.imshow(np.concatenate((a, b)).T, cmap='Greys_r')... | 24.529412 | 70 | 0.623501 |
cfc4507a2c19709b04e7b2bc8c5a122e6b14e700 | 3,040 | py | Python | etl/transforms/primitives/df/tests/test_pandas_utils.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/transforms/primitives/df/tests/test_pandas_utils.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/transforms/primitives/df/tests/test_pandas_utils.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | from etl.transforms.primitives.df import pandas_utils
from etl.core import test_utils
import pandas as pd
import numpy as np
import pytest
def test_unlistify_lists_of_same_lengths():
df = pd.DataFrame([
{
'A': 'A_' + str(j) + '_1',
'B': ['B_' + str(j) + '_' + str(i) for i in range(3)],
'C': 'C_... | 37.073171 | 72 | 0.535526 |
5c855fc45541f795f3244dc5eb06a38cac70634f | 1,797 | py | Python | Python1/aula10_projeto_final.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula10_projeto_final.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula10_projeto_final.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | '''
Como sugestão de prática, indicamos você a criar um novo script python seguindo as orientações a seguir:
1-Deve se criar 5 funções diferentes, sendo elas somar, subtrair, dividir, multiplicar e listar.
2-Deve se criar um MENU com if else sendo que o usuário escolha qual função deve acessar.
3-Ao ser escolhido a ... | 30.457627 | 134 | 0.593767 |
7a591026ae9e448b7be21d9bb32c70e7be92a892 | 2,545 | py | Python | Tests/test_simulations/test_BaseSimulation.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | Tests/test_simulations/test_BaseSimulation.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | Tests/test_simulations/test_BaseSimulation.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | from savageml.models import BaseModel
from savageml.simulations import BaseSimulation, SimulationState
def test_initial_state_initialized():
simulation = BaseSimulation()
assert simulation.get_state() == SimulationState.INITIALIZED
def test_state_after_run_completed():
simulation = BaseSimulation()
... | 26.510417 | 77 | 0.737917 |
64f2e7dc38f6169819984d90485c94c7f3946daf | 5,835 | py | Python | src/onegov/fsi/layouts/course_attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/layouts/course_attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/layouts/course_attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.core.elements import Link, Confirm, Intercooler
from onegov.fsi.collections.attendee import CourseAttendeeCollection
from onegov.fsi.collections.subscription import SubscriptionsCollection
from onegov.fsi.layout import DefaultLayout
from onegov.fsi import _
cla... | 33.342857 | 77 | 0.513625 |
8f3161d3fd9d84181b3cdc4b8f78f60785631d1f | 9,862 | py | Python | src/lcdoc/tools.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | src/lcdoc/tools.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | src/lcdoc/tools.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | """
Common tools for all modules
"""
import collections
import hashlib
import json
import os
import socket
import sys
import time
import toml
from lcdoc.log import app, now
exists = os.path.exists
# fastest algo:
def file_hash(fn, algo='blake2b'):
return getattr(hashlib, algo)(open(fn, 'rb').read()).hexdigest(... | 27.168044 | 88 | 0.515007 |
711c11f5eca6dd449e7549736b281d7cdbf6f6ea | 65 | py | Python | src/main/python/client/clientModel.py | mfentler-tgm/sew5-simple-user-database-mfentler-tgm | 98fba2cdca4243c3b2f25c45ceb043c258a5db53 | [
"MIT"
] | null | null | null | src/main/python/client/clientModel.py | mfentler-tgm/sew5-simple-user-database-mfentler-tgm | 98fba2cdca4243c3b2f25c45ceb043c258a5db53 | [
"MIT"
] | null | null | null | src/main/python/client/clientModel.py | mfentler-tgm/sew5-simple-user-database-mfentler-tgm | 98fba2cdca4243c3b2f25c45ceb043c258a5db53 | [
"MIT"
] | null | null | null | class Model():
def __init__(self):
self.students = [] | 21.666667 | 26 | 0.569231 |
a4111b65ae5cf2268c311b413808da64f5aeae7b | 3,254 | py | Python | research/nlp/hypertext/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/hypertext/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/hypertext/preprocess.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... | 42.25974 | 108 | 0.713276 |
77a1af4fe438035248ad5e02b33e05a747df73a3 | 803 | py | Python | assets/__init__.py | Yoann-Renard/Dimension-Y-DesktopApp | f2c6d4834338e88fb536cdd57d9c95e07079aed1 | [
"MIT"
] | null | null | null | assets/__init__.py | Yoann-Renard/Dimension-Y-DesktopApp | f2c6d4834338e88fb536cdd57d9c95e07079aed1 | [
"MIT"
] | null | null | null | assets/__init__.py | Yoann-Renard/Dimension-Y-DesktopApp | f2c6d4834338e88fb536cdd57d9c95e07079aed1 | [
"MIT"
] | null | null | null | from random import choice
from pygame import image, display, transform
from os.path import join
from settings import WIN_HEIGHT, WIN_WIDTH
#### IMAGES ####
WIN_ICON = image.load(join("assets", "res", "images", "icons", "app-icon.png"))
RANDOM_BG = choice(("bg1.png", "bg2.png", "bg3.png",
"bg4.png",... | 33.458333 | 105 | 0.647572 |
77a36e20077c5c26f3e33d59590441dab3fd60d8 | 4,277 | py | Python | haas_lib_bundles/python/libraries/cht8305/cht8305.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/cht8305/cht8305.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/cht8305/cht8305.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2015-2021 Alibaba Group Holding Limited
MicroPython's driver for CHT8305
Author: HaaS
Date: 2021/09/14
"""
from micropython import const
from utime import sleep_ms
from driver import I2C
CHT8305_REG_TEMP = 0x00
CHT8305_REG_HUMI = 0x01
# The register address in CHT8305 controller.
c... | 28.898649 | 88 | 0.604863 |
24d36a14da685f1478859391225870f3f222a5fa | 1,477 | py | Python | follow-tutorial/mysite/polls/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | follow-tutorial/mysite/polls/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | follow-tutorial/mysite/polls/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.contrib import admin
from .models import Question, Choice
# Register your models here.
class ChoiceInline(admin.StackedInline): # admin.StackedInline 栈排列
model = Choice
extra = 1 # 展示几条数据空数据(不含已由数据)
verbose_name_plural = "投票关联表" ... | 29.54 | 84 | 0.574137 |
563cca694ca23390d875a4d8c2059ce97962dfac | 307 | py | Python | Algorithms/Implementation/angry_professor.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/angry_professor.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/angry_professor.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
t = int(input().strip())
for a0 in range(t):
n,k = input().strip().split(' ')
n,k = [int(n),int(k)]
arr = [int(a_temp) for a_temp in input().strip().split(' ')]
if k > len([a for a in arr if a <= 0]):
print("YES")
else:
print("NO")
| 18.058824 | 64 | 0.508143 |
8ea453ab0971887771cb1ba1c81ca4123e8713cf | 4,906 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/xml/protobuf2xml.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/xml/protobuf2xml.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/xml/protobuf2xml.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2014-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 avail... | 37.450382 | 103 | 0.615573 |
8ef40a270f2ae52f03a3d54a6657583f3d183872 | 188 | py | Python | Curso-Em-Video-Python/2Exercicios/012_Calculando_Descontos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/012_Calculando_Descontos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/012_Calculando_Descontos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | prod = float(input('Qual é o valor do produto? '))
desc = prod-((prod*5)/100)
print('O produto que custava R${:.2f}, na promoção com desconto de 5% vai custar R${:.2f}'.format(prod, desc)) | 62.666667 | 110 | 0.670213 |
d946085623e1b4b9a2cb4661929f7136e813e03e | 348 | py | Python | ISTp/2014/GOMAN_D_V/task_2_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/GOMAN_D_V/task_2_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/GOMAN_D_V/task_2_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2. Вариант 45
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам
# высказывание, автором которого является Эзоп. Не забудьте о том, что автор
# должен быть упомянут на отдельной строке.
# Goman D.V.
# 29.03.2016
print ('Невсегда будет лето.')
print ('\n\t\tЭзоп')
input ('\n\n... | 26.769231 | 81 | 0.738506 |
8df2d980ed168cff211caf24a8fe94accc883c77 | 691 | py | Python | Packs/SophosXGFirewall/Integrations/SophosXGFirewall/.vulture_whitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SophosXGFirewall/Integrations/SophosXGFirewall/.vulture_whitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SophosXGFirewall/Integrations/SophosXGFirewall/.vulture_whitelist.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | source_networks # unused variable (SophosXGFirewall.py:996)
source_zones # unused variable (SophosXGFirewall.py:996)
destination_networks # unused variable (SophosXGFirewall.py:997)
destination_zones # unused variable (SophosXGFirewall.py:997)
members # unused variable (SophosXGFirewall.py:998)
services # unused ... | 49.357143 | 65 | 0.807525 |
ba80e26e9fa5bd662d51f046dfad31f91b3a99bb | 753 | py | Python | djangoForm/member/forms.py | lanuxos/djangoForm | 4a0f02eaf27735c7eaaa4c282426cc911e2a399a | [
"MIT"
] | null | null | null | djangoForm/member/forms.py | lanuxos/djangoForm | 4a0f02eaf27735c7eaaa4c282426cc911e2a399a | [
"MIT"
] | null | null | null | djangoForm/member/forms.py | lanuxos/djangoForm | 4a0f02eaf27735c7eaaa4c282426cc911e2a399a | [
"MIT"
] | null | null | null | from django import forms
from .models import *
class AddMemberForm(forms.ModelForm):
class DatesInput(forms.DateInput):
input_type = 'date'
firstName = forms.CharField(label="First Name", max_length=100, required=False)
lastName = forms.CharField(label="Last Name", max_length=100, required=False)
... | 41.833333 | 85 | 0.707835 |
bab2b159719200e57113fcd9d21f7a34b33e932c | 154 | py | Python | lib/widgets/elements/__init__.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/elements/__init__.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/elements/__init__.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | from .algoptions import AlgorithmOptions
from .graphctrl import GraphControl
from .algctrl import AlgorithmControl
from .importctrl import ImportControl
| 25.666667 | 40 | 0.863636 |
03391ecf277b2fb585e3449154e1cce1fd2ffc32 | 1,368 | py | Python | src/onegov/user/forms/signup_link.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/signup_link.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/signup_link.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.user import _
from wtforms import RadioField, validators
from wtforms.fields.html5 import IntegerField
class SignupLinkForm(Form):
""" A form to generate signup links for specific roles. """
role = RadioField(
label=_("Role"),
validators=[validators.In... | 26.307692 | 71 | 0.521199 |
062c529cdda46b2d708497d627ab02e799cf5333 | 416 | py | Python | rabbitmq/tutorial/send.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/send.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | rabbitmq/tutorial/send.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pika
credentials = pika.PlainCredentials('admin', '1q2w3e')
parameters = pika.ConnectionParameters('192.168.1.197', 5672, '/', credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
routing_ke... | 26 | 79 | 0.721154 |
066e7babde6da26fa2d660c2ced4e9ce9bcc1021 | 62,221 | py | Python | repo/service.vpn.manager/libs/vpnproviders.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/service.vpn.manager/libs/vpnproviders.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/service.vpn.manager/libs/vpnproviders.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 46.02145 | 542 | 0.610051 |
aeaf3cf9d73bb7ced33f92cf930962d8f2acaff4 | 5,471 | py | Python | test/test_npu/test_network_ops/test_clamp_max.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_clamp_max.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_clamp_max.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... | 33.771605 | 81 | 0.655822 |
aeb081d3e60744ddfc04b8161bcbf5e546631104 | 1,380 | py | Python | begin-python/cp3/chapter3.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | begin-python/cp3/chapter3.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | begin-python/cp3/chapter3.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
# ##使用字符串
# ###3.1基本的字符串操作
# 分片、索引、乘法、判断成员资格等,前面几章已经提到过
website = 'www.baidu.com'
print website[0:3]
# ###3.2字符串格式化精简版
format = 'Pi with three decimals: %9.3f'
from math import pi
print format % pi
# ###3.3字符串格式化完整版
# ####3.3.1简单转换
print 'Price of egg $%d' % 45
print 'My nam... | 21.5625 | 64 | 0.630435 |
aededdbe4cb8835458240d6096fc4b4d8c799c0d | 35,782 | py | Python | pyScript/custom_src/NodeInstance.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/NodeInstance.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/NodeInstance.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QGraphicsItem, QGraphicsProxyWidget, QGraphicsScene, QLineEdit, QMenu, QAction, QToolTip
from PySide2.QtCore import Qt, QRectF, QPointF, Signal
from PySide2.QtGui import QColor, QBrush, QPen, QPainterPath, QFont, QFontMetricsF, QLinearGradient, QRadialGradient, QPainter, QPixmap, QImage
im... | 43.583435 | 174 | 0.585602 |
aee307d5198d24219a7aa58374224347b17a93c8 | 266 | py | Python | BITs/2014/VOROSHIN_S_I/task_1_7.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/VOROSHIN_S_I/task_1_7.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/VOROSHIN_S_I/task_1_7.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача №1, Вариант 7
#Компьютер пишет род деятельности и псевдоним Эдуарда Георгиевича Зюбина
#Ворошин С.И.
#28.02.2016
print ("Эдуард Георгиевич Зюбин более известен, как русский поэт, переводчик и драматург Эдуард Багрицкий")
input("Нажмите Enter для выхода.")
| 29.555556 | 107 | 0.785714 |
d1eca06ab85ffeac04b976f3986ab03b54d71f39 | 404 | py | Python | INBa/2015/Perepyelkov_Y_A/task_5_33.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Perepyelkov_Y_A/task_5_33.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Perepyelkov_Y_A/task_5_33.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 5. Вариант 33
#Напишите программу, которая бы при запуске случайным образом отображала имя одной из шести официальных жен Ивана IV Грозного.
#Perepyelkov Y.A.
#28.03.2016
print("Программа выводит на экран имя одной из шести официальных жен Ивана IV Грозного.")
import random
a = random.choice(['Анастасия', 'Мар... | 40.4 | 126 | 0.752475 |
ae76c6e548dd8178c2f6633c8fdef4de69252450 | 180 | py | Python | src/ingestion/transformers/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/ingestion/transformers/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/ingestion/transformers/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from .base import (
Transformer
)
from .monosi import (
AnomalyTransformer,
IssueTransformer,
MetricTransformer,
MonitorTransformer,
ZScoreTransformer,
)
| 13.846154 | 23 | 0.705556 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.