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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
827ab82158624953dae52eaf741a8c042d8591c4 | 520 | pyde | Python | sketches/cheese04/cheese04.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/cheese04/cheese04.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/cheese04/cheese04.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | maxlevel = 7
def setup():
global i
i = 1
size(500, 500)
# colorMode(HSB, 100, 100, 100)
background(255)
noFill()
def draw():
pass
def cheese(x, y, r, level):
ellipse(x, y, r, r)
if (level > 1):
cheese(x - r/4, y, r/2, level-1)
cheese(x, y - r/4, r/2, level-1)
... | 19.259259 | 40 | 0.498077 |
827ebe8a79087517948719e3e272970b46b9ec52 | 2,222 | py | Python | bach_code/legacy/oracle.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 5 | 2015-12-08T21:47:41.000Z | 2020-10-28T12:39:08.000Z | bach_code/legacy/oracle.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | null | null | null | bach_code/legacy/oracle.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 1 | 2020-10-28T12:39:09.000Z | 2020-10-28T12:39:09.000Z | #########
##
## File: oracle.py
## Author: Hugh Zabriskie (c) 2016
## Description: Preprocess the original data for an Oracle experiment so that the last feature of the
## example at time t is the harmony chosen at time t. During training, that harmony is the
## correct harmony that occurs on the previous beat.
#... | 26.771084 | 101 | 0.716472 |
82b8459044b742ef6029d6629b5ac32385c76d2f | 538 | py | Python | Coursera/Using Python to Access Web Data/Week-4/Assignment/ScrapingHTMLDataWithBeautifulSoup.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Using Python to Access Web Data/Week-4/Assignment/ScrapingHTMLDataWithBeautifulSoup.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Using Python to Access Web Data/Week-4/Assignment/ScrapingHTMLDataWithBeautifulSoup.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
#Get SSL Certification Error handeling
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
#Data Collect From the Website
link = input('Enter - ')
html = urllib.request.urlopen(link, co... | 20.692308 | 57 | 0.711896 |
82e94da81b3b70ab0524022bc093dad01319ddf7 | 602 | py | Python | src/tools/data/DataManualExamples/CreatingCompatible/vwucd2d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/tools/data/DataManualExamples/CreatingCompatible/vwucd2d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/tools/data/DataManualExamples/CreatingCompatible/vwucd2d.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | import visit_writer
# Node coordinates
pts = (0., 0., 0., 2., 0., 0., 5., 0., 0.,
3., 3., 0., 5., 3., 0., 0., 5., 0.,
2., 5., 0., 4., 5., 0., 5., 5., 0.)
# Connectivity
connectivity = (
(visit_writer.triangle, 1,3,6),
(visit_writer.triangle, 3,7,6),
(visit_writer.quad, 0,1,6,5),
(visit_writer... | 25.083333 | 77 | 0.569767 |
81a9dd9ff139c9eef85b6d9d6a55658cb6e17e2a | 2,308 | py | Python | day34/ui.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day34/ui.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day34/ui.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from tkinter import *
from quiz_brain import QuizBrain
THEME_COLOR = "#375362"
class Ui():
def __init__(self, quiz_brain: QuizBrain) -> None:
self.quiz = quiz_brain
self.app = Tk()
self.app.title("Quizzler")
self.app.config(padx=20, pady=20, bg=THEME_COLOR)
self.lbl_sc... | 34.969697 | 98 | 0.633449 |
481ff6bb2a19b7a9a85b5ebe4621c7a3d04cb561 | 437 | py | Python | bin/cls/repository.py | rongworks/open-gecko-de | 37ec52bbea1fa13fbb44bbd7162c96afffcf9f16 | [
"MIT"
] | 2 | 2018-03-27T21:11:20.000Z | 2018-11-11T19:49:55.000Z | bin/cls/repository.py | rongworks/open-gecko-de | 37ec52bbea1fa13fbb44bbd7162c96afffcf9f16 | [
"MIT"
] | 9 | 2018-03-18T19:14:04.000Z | 2018-06-29T07:35:00.000Z | bin/cls/repository.py | rongworks/open-gecko-de | 37ec52bbea1fa13fbb44bbd7162c96afffcf9f16 | [
"MIT"
] | null | null | null | class Repository:
def __init__(self):
self.name = ""
self.command = ""
self.info = ""
self.child_packages = []
def as_string(self):
return ", ".join((self.name,self.command,self.info))
def list(self):
str = self.name + ": \n"
for package in self.child_packages:
... | 21.85 | 58 | 0.578947 |
9651866ea3e62058d8ffffd9bd78ff737646cbc0 | 1,018 | py | Python | challenges/isSuspiciousRespondent/python3/isSuspiciousRespondent.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/isSuspiciousRespondent/python3/isSuspiciousRespondent.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/isSuspiciousRespondent/python3/isSuspiciousRespondent.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def isSuspiciousRespondent(ans1, ans2, ans3):
return ans1 == ans2 and ans1 == ans3
if __name__ == '__main__':
input0 = [False, True, True, True, False]
input1 = [False, True, False, True, True]
input2 = [False, False, False, True, False]
expectedOutput = [True, False, False, True, False]
assert len(input0) == le... | 67.866667 | 152 | 0.691552 |
fb9fdc567ada3765687d34a1fa68c77b38d9665a | 3,724 | py | Python | test/test_npu/test_network_ops/test_sort.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_sort.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_sort.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... | 39.617021 | 97 | 0.629699 |
fbb1a69e6d2ba7dd48fe757a856a477678b67c05 | 1,529 | py | Python | Blockwelt/app.py | flikkes/intelligente_agenten | 340ca9b9d98b4525b330292f16444e106dec9d66 | [
"MIT"
] | null | null | null | Blockwelt/app.py | flikkes/intelligente_agenten | 340ca9b9d98b4525b330292f16444e106dec9d66 | [
"MIT"
] | null | null | null | Blockwelt/app.py | flikkes/intelligente_agenten | 340ca9b9d98b4525b330292f16444e106dec9d66 | [
"MIT"
] | null | null | null | import sys
import Agent
import Blockworld
from Agent import Agent
from Blockworld import World
rawWorld = sys.argv[1]
rawGoal = sys.argv[2]
rawWorldSplit = rawWorld.split('-')
rawGoalSplit = rawGoal.split('-')
wA = []
wB = []
wC = []
gA = []
gB = []
gC = []
print(rawWorldSplit)
for elem in rawWorldSplit[0].split(','):... | 26.362069 | 41 | 0.611511 |
fbb462dbc31d57a0ddfea55fe5168eb99a80bb49 | 438 | py | Python | Coursera/Using Python to Access Web Data/Week-4/Excercise/urllinks.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Using Python to Access Web Data/Week-4/Excercise/urllinks.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Using Python to Access Web Data/Week-4/Excercise/urllinks.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
#SSL Certification Error
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
#Link input from user
link = input('Enter website link: ')
html = urllib.request.urlopen(link, context=ctx).... | 23.052632 | 55 | 0.748858 |
836bbe99ae65d634c7c306fc776935f124567ca2 | 1,408 | py | Python | research/audio/deepspeech2/src/lr_generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/audio/deepspeech2/src/lr_generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/audio/deepspeech2/src/lr_generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.52381 | 78 | 0.651278 |
83b0d40e8d994dcfa781b78228068b2a65a13e2a | 1,198 | py | Python | Packs/Cryptocurrency/Scripts/CryptoCurrenciesFormat/CryptoCurrenciesFormat.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Cryptocurrency/Scripts/CryptoCurrenciesFormat/CryptoCurrenciesFormat.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Cryptocurrency/Scripts/CryptoCurrenciesFormat/CryptoCurrenciesFormat.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from hashlib import sha256
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
from typing import Union
DIGITS58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def decode_base58(address, length) -> bytes:
n = 0
for char in address:
... | 29.219512 | 99 | 0.689482 |
3f7d97af14171d631b212211a25e9b4c3a41937d | 18,655 | py | Python | rfvision/models/detectors3d/category_ppf/category_ppf_dataset.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 6 | 2021-09-25T03:53:06.000Z | 2022-02-19T03:25:11.000Z | rfvision/models/detectors3d/category_ppf/category_ppf_dataset.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 1 | 2021-07-21T13:14:54.000Z | 2021-07-21T13:14:54.000Z | rfvision/models/detectors3d/category_ppf/category_ppf_dataset.py | mvig-robotflow/rfvision | cc662f213dfe5a3e8864a6b5685a668a4436e397 | [
"Apache-2.0"
] | 2 | 2021-07-16T03:25:04.000Z | 2021-11-22T06:04:01.000Z | import os
import cv2
os.environ.update(PYOPENGL_PLATFORM='egl',)
import trimesh
import pyrender
from tqdm import tqdm
import pickle
from rfvision.datasets import DATASETS
from rfvision.datasets.pipelines import Compose
from rfvision.models.detectors3d.category_ppf.utils.utils import *
category_dict = {1:'02876657',
... | 38.783784 | 143 | 0.555347 |
4d9cf430417b679c5f0361a39eb1322d4e2664e8 | 703 | py | Python | backend/app/tests/utils/test_utils.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/tests/utils/test_utils.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/tests/utils/test_utils.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from math import hypot
from app.schemas.polygon_data import Point
from app.utils.utils import get_path_length
def test_get_path_length_one():
points = []
points.append(Point(x=1, y=0))
points.append(Point(x=0, y=0))
assert get_path_length(points) == 1
def test_get_path_length_multiple():
points... | 23.433333 | 44 | 0.658606 |
4288c9ecff3dd83ba04d0b43bc5e140171b5c5fe | 398 | py | Python | sandbox/schedule/schedule.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | sandbox/schedule/schedule.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | 1 | 2022-03-22T23:50:32.000Z | 2022-03-22T23:50:32.000Z | sandbox/schedule/schedule.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | from sandbox.schedule.calendarevent import CalendarEvent
class Schedule:
events: list[CalendarEvent] = []
def add_event(self, event: CalendarEvent):
self.events.append(event)
def get_current_events(self, time: int) -> list[CalendarEvent]:
events: list[CalendarEvent] = [
e for... | 24.875 | 67 | 0.663317 |
c4215496ca2f12c156ae8cdc46085ebfe21f1fe5 | 22,012 | pyw | Python | InsPigiModule_gui.pyw | Pigi-bytes/Registration-with-sha-256-encryption | cda4c67af344a9fd791db74fee4e3a9f42e995cc | [
"MIT"
] | null | null | null | InsPigiModule_gui.pyw | Pigi-bytes/Registration-with-sha-256-encryption | cda4c67af344a9fd791db74fee4e3a9f42e995cc | [
"MIT"
] | null | null | null | InsPigiModule_gui.pyw | Pigi-bytes/Registration-with-sha-256-encryption | cda4c67af344a9fd791db74fee4e3a9f42e995cc | [
"MIT"
] | null | null | null | import base64
import hashlib
import json
import os
import tkinter.font as tkFont
from tkinter import *
from tkinter.messagebox import askyesno
# pip install cryptography
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
fro... | 38.482517 | 150 | 0.593949 |
67fdd47db8fc6b98239db48b4a9c63b5ae9769ba | 1,343 | py | Python | Prototype/main prototype/Parser.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/main prototype/Parser.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/main prototype/Parser.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | import LayerData
import TabData
class Parser:
def __init__(self, filename):
self.filename = filename
def parse(self):
f = open(self.filename, "r")
td = TabData.TabData(0, "")
for line in f.readlines():
data = line.split(": ")
if len(data) >= 2:
... | 31.232558 | 130 | 0.405063 |
226fd7db61e5fed0d352d8257b2e14f9f84741c6 | 1,871 | py | Python | MA/Car.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/Car.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/Car.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null |
# Import statements
import sys
import time
import atexit
sys.path.append("L:/test") ### ADD PATH
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor
class Car():
"""Initialize car and control functions"""
def __init__(self) -> None:
"""Initialize method"""
mh = Adafruit_MotorHAT... | 33.410714 | 65 | 0.600748 |
e1b1b721a828a53729ce8a269320036b106baf52 | 69,137 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cloudengine/ce_ospf_vrf.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cloudengine/ce_ospf_vrf.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/cloudengine/ce_ospf_vrf.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 option) any later version.
#
# Ansible is distribut... | 42.572044 | 140 | 0.573803 |
830e79c271335e763778ed5bea5673dad94996dd | 5,262 | py | Python | Packs/ServiceNow/Integrations/ServiceNow_CMDB/ServiceNow_CMDB_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ServiceNow/Integrations/ServiceNow_CMDB/ServiceNow_CMDB_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ServiceNow/Integrations/ServiceNow_CMDB/ServiceNow_CMDB_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from ServiceNow_CMDB import Client, records_list_command, get_record_command, create_record_command, \
update_record_command, add_relation_command, delete_relation_command
from test_data.result_constants import EXPECTED_RECORDS_LIST_NO_RECORDS, \
EXPECTED_RECORDS_LIST_WITH_RECORDS, EXPECTED_GET_RE... | 44.59322 | 120 | 0.713797 |
832ae5a44911b16bdd1fca19dfbec206702a0697 | 1,021 | py | Python | python/en/_numpy/organize_this/test_LayerNormBasicLSTMCell.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/organize_this/test_LayerNormBasicLSTMCell.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/organize_this/test_LayerNormBasicLSTMCell.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 25 22:07:43 2018
@author: the.kim
"""
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import variables
from tenso... | 32.935484 | 138 | 0.669931 |
36c32478b26382f21f64c23a7b3947654df21f15 | 754 | py | Python | utils/string_util.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | utils/string_util.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | utils/string_util.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | import re
import hashlib
import random
def random_digits(length):
list = []
for i in range(int(length)):
list.append(str(random.randrange(10)))
digits = ''.join(list)
return digits
# str就是unicode了.Python3中的str对应2中的Unicode
def get_md5(url):
if isinstance(url, str):
url = url.encod... | 17.136364 | 46 | 0.603448 |
3d30cf7dc4b6e3370bf8927d11a83e42c1a57b3d | 1,343 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/meta/tenant_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/meta/tenant_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/meta/tenant_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional
from watchmen_auth import PrincipalService
from watchmen_data_kernel.cache import CacheService
from watchmen_meta.common import ask_meta_storage, ask_snowflake_generator
from watchmen_meta.system import TenantService as TenantStorageService
from watchmen_model.common import TenantId
f... | 32.756098 | 110 | 0.807893 |
a19ae2a572a0fb0cf6d6fe0153a39bf0a4f98fb0 | 1,821 | py | Python | official/cv/deeplabv3plus/src/tools/get_multicards_json.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/deeplabv3plus/src/tools/get_multicards_json.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/deeplabv3plus/src/tools/get_multicards_json.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | import os
import sys
def get_multicards_json(server_id):
hccn_configs = open('/etc/hccn.conf', 'r').readlines()
device_ips = {}
for hccn_item in hccn_configs:
hccn_item = hccn_item.strip()
if hccn_item.startswith('address_'):
device_id, device_ip = hccn_item.split('=')
... | 35.019231 | 119 | 0.61944 |
1a27a43c81b54badd842bcdea971bd66909c2e63 | 1,090 | py | Python | SoSe-21/Code-Vorlesungen/VL-4/VL-Monatsrechner-3.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Code-Vorlesungen/VL-4/VL-Monatsrechner-3.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Code-Vorlesungen/VL-4/VL-Monatsrechner-3.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # while-Schleife
# for-Schleife
# Schleifen solange, bis die Abbruchbedingung erfüllt ist
# Ermittlung der Anzahl der Tage für einen bestimmten Monat (1-12)
# EVA
## E = Eingabe
## V = Verarbeitung
## A = Ausgabe
# int = ganzzahlige Werte
# float = Dezimalzahlen
# Intialisieren einen Zustand für die Schleife
schleife... | 28.684211 | 116 | 0.653211 |
b183781d28dc086a595d9cfa022526521cc17dfd | 632 | py | Python | crypto/no-stone-left-unturned/src/no-stone-left-unturned.py | b01lers/circle-city-ctf-2021 | 5d6c341f8d9647487dc69df84a4bea5e61d7ca43 | [
"MIT"
] | 9 | 2021-06-13T19:33:53.000Z | 2021-10-04T13:17:26.000Z | CircleCityCon/2021/crypto/No_Stone_Left_Unturned/no-stone-left-unturned.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-06-13T23:20:05.000Z | 2021-06-13T23:20:05.000Z | CircleCityCon/2021/crypto/No_Stone_Left_Unturned/no-stone-left-unturned.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-06-14T02:09:46.000Z | 2021-06-14T02:09:46.000Z | from gmpy2 import next_prime, is_prime
import random, os, sys
if __name__ == "__main__":
random.seed(os.urandom(32))
p = next_prime(random.randrange((1<<1024), (1<<1024) + (1<<600)))
pp = (p * 7) // 11
q = next_prime(random.randrange(pp - (1<<520), pp + (1 << 520)))
with open(sys.argv[1], "rb") as ... | 28.727273 | 69 | 0.53481 |
b8e26cb0021bf667f72cd69b94de73070bea706b | 1,070 | py | Python | scripts/import_props.py | jdehotin/IFC4.3.x-development | 5652a25dac27242af8c60f1a33206d1697948ffa | [
"FSFAP"
] | 1 | 2021-08-31T16:12:09.000Z | 2021-08-31T16:12:09.000Z | scripts/import_props.py | Moult/IFC4.3.x-development | 5dfacdc91f04b446f9d7386b950099fc14e6587e | [
"FSFAP"
] | null | null | null | scripts/import_props.py | Moult/IFC4.3.x-development | 5dfacdc91f04b446f9d7386b950099fc14e6587e | [
"FSFAP"
] | null | null | null | # imports the markdown definitions for properties from the bSI/IFC repository
import os
import sys
import glob
from collections import defaultdict
dr = sys.argv[1]
odr = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "docs", "properties")
prop_files = glob.glob(os.path.join(dr, "**", "Documentation.... | 33.4375 | 96 | 0.668224 |
02c1fd0da58a970b44fd03ca84512a406fa9f04c | 157 | py | Python | Licence 2/I33/TP 2/ex_9.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 2/ex_9.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 2/ex_9.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def pgcd(a, b):
if b > 0:
return pgcd(b, a % b)
return a
def generateurs(n):
return [i for i in range(n) if pgcd(i, n) == 1]
print(generateurs(6))
| 15.7 | 51 | 0.592357 |
a78e275a3ccf349cfff6a4d993071ba297fb6339 | 2,185 | py | Python | Imagenes/vdWColumn/Fuerza/Fuerza.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/vdWColumn/Fuerza/Fuerza.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/vdWColumn/Fuerza/Fuerza.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import os
import argparse
import locale
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,
AutoMinorLocator)
if __name__ == "__main__":
# Argumentos de consola
parser = argparse.ArgumentParser(descr... | 20.420561 | 150 | 0.521281 |
ac1df7ab6fc6c75a3e70747a42e59928583c0328 | 1,938 | py | Python | Get_Website_List-main/get.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Get_Website_List-main/get.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Get_Website_List-main/get.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*
#####################################
import requests, sys, re, os, time, random, json
from colorama import Fore, Back, Style
from re import findall as reg
abang = Fore.RED
ijo = Fore.GREEN
putih = Fore.WHITE
biru = Fore.BLUE
kuning = Fore.YELLOW
mbohopo = Fore.MAGENTA
def cl... | 30.28125 | 180 | 0.579979 |
ce983d258f5c1ad1138114551358b74b04bbed0a | 1,317 | py | Python | baralho2_sad.py | saliciafs/AliciaSAD | d4eb68a0b52fd4e75eed5cde4d7d39f46dd16c01 | [
"Apache-2.0"
] | null | null | null | baralho2_sad.py | saliciafs/AliciaSAD | d4eb68a0b52fd4e75eed5cde4d7d39f46dd16c01 | [
"Apache-2.0"
] | null | null | null | baralho2_sad.py | saliciafs/AliciaSAD | d4eb68a0b52fd4e75eed5cde4d7d39f46dd16c01 | [
"Apache-2.0"
] | null | null | null | from random import randint
naipes = {
0: "Paus",
1: "Ouros",
2: "Copas",
3: "Espadas",
4: "Paus do baralho 1",
5: "Ouros do baralho 1",
6: "Copas do baralho 1",
7: "Espadas do baralho 1",
8: "Paus do baralho 2",
9: "Ouros do baralho 2",
10: "Copas do baralho 2",
11: "Es... | 19.086957 | 66 | 0.528474 |
cec2cc110c8283e820f2dc8f7cd61c3206f13140 | 2,215 | py | Python | TimeSeries/neural_prophet/ar_net.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | null | null | null | TimeSeries/neural_prophet/ar_net.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-02-11T23:44:52.000Z | 2021-02-11T23:44:52.000Z | TimeSeries/neural_prophet/ar_net.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:02:23.000Z | 2021-12-16T01:02:23.000Z | # %% [markdown]
# # Neural prophet - ARNet
# Build a model to predict multiple future time steps.
# This is broken at the moment. Increasing `n_forecasts` > 1 causes the library to crash.
#
# Import some relevant libraries:
# %%
import numpy as np
import pandas as pd
from time import process_time, time
import matplotl... | 25.755814 | 89 | 0.688939 |
0c9f8262d4c85a95e0aebfaf3e7740d3a6fe2173 | 3,361 | py | Python | auswertung/auswertung.py | jerluebke/SOWAS | d606bcd6757503257d01381da56602016261f578 | [
"MIT"
] | null | null | null | auswertung/auswertung.py | jerluebke/SOWAS | d606bcd6757503257d01381da56602016261f578 | [
"MIT"
] | null | null | null | auswertung/auswertung.py | jerluebke/SOWAS | d606bcd6757503257d01381da56602016261f578 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This script creates the visualisation of the results of 2018s SOWAS Project at
Ruhr-University
Considered is a chain of evenly spaced and evenly shaped dominoes
Two plots are drawn:
1. Development of transversal velocity for spacing=3cm along the x axis
(posit... | 33.949495 | 80 | 0.623029 |
f01893da81707bbb7ad82c0d6437fd3551744972 | 3,285 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/facts/lldp_global/lldp_global.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/facts/lldp_global/lldp_global.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/exos/facts/lldp_global/lldp_global.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The exos lldp_global fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on t... | 33.520408 | 110 | 0.650228 |
b2c1cddf531c1cea4089df8a0e34ec22201de31b | 1,994 | py | Python | research/hpc/pinns/src/Schrodinger/eval_sch.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/pinns/src/Schrodinger/eval_sch.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/pinns/src/Schrodinger/eval_sch.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.622642 | 84 | 0.695085 |
65451e6fbc18d5c6735b28a730bb298bb0f5cbfa | 1,730 | py | Python | tests/onegov/recipient/test_model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/recipient/test_model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/recipient/test_model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.recipient.collection import GenericRecipientCollection
from onegov.recipient.model import GenericRecipient
def test_recipient_model_order(session):
session.add(GenericRecipient(
name="Peter's Cellphone",
medium="phone",
address="+12 345 67 89"
))
session.add(GenericRec... | 27.03125 | 68 | 0.647977 |
04267e44e31a039914a75701746dafd6d65091e4 | 1,370 | py | Python | DCTF/2021/crypto/A_Simple_SP_Box/sp_box.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | DCTF/2021/crypto/A_Simple_SP_Box/sp_box.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | DCTF/2021/crypto/A_Simple_SP_Box/sp_box.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from string import ascii_letters, digits
from random import SystemRandom
from math import ceil, log
from signal import signal, alarm, SIGALRM
from secret import flag
random = SystemRandom()
ALPHABET = ascii_letters + digits + "_!@#$%.'\"+:;<=}{"
shuffled = list(ALPHABET)
random.shuffle(shuffled)
S_box = {... | 26.346154 | 133 | 0.570803 |
f0fd21885134b20b80f728e88bf98e84241dfd9c | 1,189 | py | Python | workSpace/wifi/up.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | 5 | 2018-07-24T17:41:15.000Z | 2021-02-07T13:59:42.000Z | workSpace/wifi/up.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | null | null | null | workSpace/wifi/up.py | fibeule/Micropython-Tutorial-for-esp32 | eea251efd7b7b6b15af96f6f84d3281e1119234a | [
"MIT"
] | 5 | 2018-07-24T17:41:03.000Z | 2021-10-01T07:06:16.000Z | import network
from time import sleep_ms
from machine import I2C, Pin
# I2C-Bus init
bus = I2C(scl=Pin(22), sda=Pin(21))
SSID, PASSWORD = "ssid", "password"
oled=None
try:
from lib.display.ssd1306 import SSD1306_I2C
oled = SSD1306_I2C(128, 64, bus)
except OSError:
print("No ssd1306 on I2C-Bus")
except Im... | 23.313725 | 67 | 0.627418 |
ace345f7722fb0b8edfe30012afca37e16be53fd | 3,047 | py | Python | tools/datasets_convert/voc_aug.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | tools/datasets_convert/voc_aug.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | tools/datasets_convert/voc_aug.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | import argparse
import os.path as osp
from functools import partial
import numpy as np
from PIL import Image
from scipy.io import loadmat
AUG_LEN = 10582
def convert_mat(mat_file, in_dir, out_dir):
data = loadmat(osp.join(in_dir, mat_file))
mask = data['GTcls'][0]['Segmentation'][0].astype(np.uint8)
seg... | 33.483516 | 79 | 0.629143 |
c5ad4838601526311adfb23890ac397521c1400b | 272 | py | Python | pyramid-creator/app/crud/crud_task_image.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | pyramid-creator/app/crud/crud_task_image.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | pyramid-creator/app/crud/crud_task_image.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from app.crud.base import CRUDBase
from app.schemas.task_image import TaskImage, CreateTaskImage, UpdateTaskImage
class CRUDTaskImage(CRUDBase[TaskImage, CreateTaskImage, UpdateTaskImage]):
pass
crud_task_image = CRUDTaskImage(TaskImage, "task_image_id")
| 27.2 | 79 | 0.797794 |
76b5edef1e34d386c8e725435de16ebec69f1dce | 695 | py | Python | jumeaux/sample/addon/addon_sample/reqs2reqs/add_path.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/sample/addon/addon_sample/reqs2reqs/add_path.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/sample/addon/addon_sample/reqs2reqs/add_path.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
from owlmixin import OwlMixin
from jumeaux.addons.reqs2reqs import Reqs2ReqsExecutor
from jumeaux.domain.config.vo import Config as JumeauxConfig
from jumeaux.models import Reqs2ReqsAddOnPayload, Request
class Config(OwlMixin):
path: str
class Executor(Reqs2ReqsExecutor):
def __ini... | 27.8 | 99 | 0.700719 |
96dfe633c2407e6ef068ee445082e1ea5e452d39 | 3,816 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/output/vehrouteDiff.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/output/vehrouteDiff.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/output/vehrouteDiff.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) 2012-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is avail... | 43.862069 | 110 | 0.632338 |
50ee3b85dc57152218271d8a3f86e14806da98e4 | 1,434 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m7/71a1/applications/expensive_seq/expensive_seq.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71a1/applications/expensive_seq/expensive_seq.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m7/71a1/applications/expensive_seq/expensive_seq.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null |
# In Python, a dict key can be any immutable type, including a tuple.
cache = {}
def check_cache(string):
cache.get(string)
def expensive_seq(x, y, z):
if x <= 0:
return y + z
if x > 0:
# calc prev/nexts
prevX1 = x - 1
prevX2 = x - 2
prevX3 = x - 3
nex... | 24.724138 | 69 | 0.529986 |
e8d0d19297ca18aaae46233d05028a3ebc146d90 | 1,257 | py | Python | disenn/datasets/get_dataloader.py | AmanDaVinci/DiSENN | ca84a8d646ad8e5e3675ffd19165c20933b81ef7 | [
"MIT"
] | 1 | 2020-08-28T05:06:36.000Z | 2020-08-28T05:06:36.000Z | disenn/datasets/get_dataloader.py | AmanDaVinci/DiSENN | ca84a8d646ad8e5e3675ffd19165c20933b81ef7 | [
"MIT"
] | null | null | null | disenn/datasets/get_dataloader.py | AmanDaVinci/DiSENN | ca84a8d646ad8e5e3675ffd19165c20933b81ef7 | [
"MIT"
] | null | null | null | from torch.utils.data import DataLoader
from .celeba_dataset import CelebA
def get_dataloader(config):
"""Generate the train and valid dataloaders given the dataset in config
Parameters
----------
config : dict
dictionary must have the "data" key with value among the following:
["celeb... | 43.344828 | 140 | 0.686555 |
ad697f1043e1b83886afb8e9dfe3e29bd1b4d752 | 35,662 | py | Python | research/cvtmodel/regnet/src/regnet_y_8gf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/regnet/src/regnet_y_8gf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/regnet/src/regnet_y_8gf.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... | 60.341794 | 119 | 0.512338 |
d13b9bed0d7a03a65dbeb676561fc011238925c2 | 2,568 | py | Python | tests/make_testfiles.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 1 | 2022-02-05T16:40:13.000Z | 2022-02-05T16:40:13.000Z | tests/make_testfiles.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 31 | 2021-06-17T11:59:33.000Z | 2022-03-19T07:05:18.000Z | tests/make_testfiles.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | null | null | null | import copy
import os
import random
from xml.etree import ElementTree
import tests
from spotify_gender_ex import replacement_table
"""
This program can be used to generate language files and replacement tables
filled with mock data. Useful for testing.
"""
def fantasy_string(min_len, max_len):
vovels = 'aeiou'
... | 25.68 | 105 | 0.643692 |
0f38177beee89eebfe2b8c6cf40becac28275c42 | 760 | py | Python | tests/__init__.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | tests/__init__.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | tests/__init__.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | """ test framework stuff """
import logging
import uuid
import flask
from publ import config
logging.basicConfig(level=logging.DEBUG)
logging.getLogger().setLevel(logging.DEBUG)
class MockIndexer():
""" Mock out the indexer for test purposes """
# pylint:disable=too-few-public-methods
@staticmethod
... | 24.516129 | 69 | 0.663158 |
0e6579eb3ec67cc8cda9777affa4bada32e69778 | 100 | py | Python | src/onegov/onboarding/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.onboarding.forms.town import FinishForm, TownForm
__all__ = ['FinishForm', 'TownForm']
| 25 | 61 | 0.78 |
1de93b7f6b0f30e5857b0fa684d237614070500d | 594 | py | Python | Python/Programação_em_Python_Essencial/3- Estruturas Lógicas e Condicionais/estruturas_logicas_and_or_not_is.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Programação_em_Python_Essencial/3- Estruturas Lógicas e Condicionais/estruturas_logicas_and_or_not_is.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Programação_em_Python_Essencial/3- Estruturas Lógicas e Condicionais/estruturas_logicas_and_or_not_is.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | """
Estruturas Lógicas: and (e), or (ou), not (não), is (é)
Operadores unários:
- not
Operadores binários:
- and, or, is
Regras de funcionamento:
Para o 'and', ambos os valores precisam ser True
Para o 'or', um ou outro valor precisa ser True
Para o 'not', o valor do booleano é invertido, ou seja, se for True, vi... | 21.214286 | 104 | 0.693603 |
aa5845d587d8f545f2152bb4ccdce732807ecab6 | 1,019 | py | Python | ryu/app/App/my_load_balancer.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/App/my_load_balancer.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/App/my_load_balancer.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | """
author:Yuegb
date:2021,05,06
"""
from pymongo import MongoClient
client = MongoClient('192.168.136.149', 27017)
#client = MongoClient('mongodb://18.219.185.25:27017/')
db = client.elastiCon #db name: elastiCon
controllers = db.controllers #Document name: controllers - To keep track of controller data
flags = db.fla... | 32.870968 | 91 | 0.648675 |
aabc23ea53c0c4d15f7425fde94acff0b59556e9 | 420 | py | Python | fcsc-2020/tarte-tatin/solve.py | mboultoureau/ctf | 7ddf8c2583da0e1556a2a3ec32b196cc4fdd883e | [
"MIT"
] | 1 | 2020-05-05T06:14:35.000Z | 2020-05-05T06:14:35.000Z | fcsc-2020/tarte-tatin/solve.py | mboultoureau/ctf | 7ddf8c2583da0e1556a2a3ec32b196cc4fdd883e | [
"MIT"
] | null | null | null | fcsc-2020/tarte-tatin/solve.py | mboultoureau/ctf | 7ddf8c2583da0e1556a2a3ec32b196cc4fdd883e | [
"MIT"
] | 1 | 2020-05-05T06:14:45.000Z | 2020-05-05T06:14:45.000Z | #!/usr/bin/python3
data = "56 64 6b 6b 1f 63 6e 6d 64 20 1f 53 67 64 1f 65 6b 60 66 1f 68 72 39 1f 45 42 52 42 7a 37 32 65 33 30 33 32 30 62 30 30 30 2f 35 31 63 2f 2f 32 63 63 2f 31 30 32 62 65 37 31 33 63 35 35 65 36 36 2f 60 2f 61 64 30 32 2f 34 64 31 37 30 32 65 30 34 63 63 36 35 34 2f 32 60 38 30 63 7c"
result = ... | 46.666667 | 290 | 0.633333 |
355f9d6d2735fb48e56f42145b7e0e37fb430fe3 | 739 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_05_Kontrollstrukturen/09_kapitel_05_repetitionsaufgabe_08_print_pattern.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_05_Kontrollstrukturen/09_kapitel_05_repetitionsaufgabe_08_print_pattern.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_05_Kontrollstrukturen/09_kapitel_05_repetitionsaufgabe_08_print_pattern.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 09_kapitel_05_repetitionsaufgabe_08_print_pattern.py
# Project: Kapitel_05_Kontrollstrukturen
# Created Date: Saturday 23.02.2019, 23:44
# Author: Apop85
# -----
# Last Modified: Saturday 23.02.2019, 23:58
# -----
# Copyright (c) 2019 Apop85
# This software is p... | 23.09375 | 84 | 0.663058 |
35730b41934eb3bc0c863b621a506282bc3ff151 | 1,021 | py | Python | web/master-dukun/app.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | web/master-dukun/app.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | web/master-dukun/app.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | from flask import Flask, render_template, request, redirect, url_for, session
import json
app = Flask(__name__, template_folder='./templates')
f_f = open('flag.txt', 'r')
f_k = open('key', 'r')
flag = f_f.read()
key = f_k.read()
f_k.close()
f_f.close()
flag_enc = ''
for i, x in enumerate(flag):
flag_enc += chr(ord(x... | 20.836735 | 83 | 0.624878 |
aa2851c1daf47f01cb1798ea9302312d05608320 | 1,922 | py | Python | official/recommend/ncf/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/ncf/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/ncf/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... | 40.893617 | 82 | 0.665973 |
351c68b1fea1b38632489ff2bc1ce4a0e2874484 | 813 | py | Python | Compendium_attachments/GetStartedWithHPCDA/machine_learning_example.py | lazariv/hpc-compendium | 1fe5f7b78009f08aa9a5cd30be1dc6c6138ff947 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2021-12-07T19:26:43.000Z | 2021-12-07T19:26:43.000Z | Compendium_attachments/GetStartedWithHPCDA/machine_learning_example.py | lazariv/hpc-compendium | 1fe5f7b78009f08aa9a5cd30be1dc6c6138ff947 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | Compendium_attachments/GetStartedWithHPCDA/machine_learning_example.py | lazariv/hpc-compendium | 1fe5f7b78009f08aa9a5cd30be1dc6c6138ff947 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import tensorflow as tf
# Load and prepare the MNIST dataset. Convert the samples from integers to floating-point numbers:
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
# Build the tf.keras model by stacking layers. Select an ... | 36.954545 | 102 | 0.734317 |
10a4145c371104769059efdd18a1d5b019817eb3 | 400 | py | Python | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import lib.lorasense as lorasense
from lora_sync_layer import Lora_Sync_Layer
from lora_feed_layer import Lora_Feed_Layer
from lora_test_sensor_layer import Lora_Test_Sensor_Layer
try:
os.remove("Sensor_Feed.pcap")
os.remove("Control_Feed.pcap")
except:
pass
self.feed_layer = Lora_Feed_Layer()
self.test_se... | 30.769231 | 57 | 0.8275 |
5e0933c5d52ec34788600e527f1e26c7f80cc2b0 | 2,359 | py | Python | PlaidCTF/2021/crypto/leaky_block_cipher/leaky_block_cipher.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | PlaidCTF/2021/crypto/leaky_block_cipher/leaky_block_cipher.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | PlaidCTF/2021/crypto/leaky_block_cipher/leaky_block_cipher.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import flag
import hashcash
import secrets
from Crypto.Cipher import AES
def gf128(a, b):
a = int.from_bytes(a, byteorder="big")
b = int.from_bytes(b, byteorder="big")
R = 128
P = sum(1 << x for x in [R, 7, 2, 1, 0])
r = 0
for i in range(R):
if a & (1 << i):
r ^= b << i
... | 30.24359 | 79 | 0.529038 |
f4b208e671dd05cad30756d2a45bdb6248a26daf | 203 | py | Python | Code/Exhibitions/exhibitions.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | Code/Exhibitions/exhibitions.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | Code/Exhibitions/exhibitions.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null |
import pandas as pd
dfs = pd.read_html("https://de.wikipedia.org/wiki/Museen_in_Deutschland", decimal=',', thousands='.')
df = dfs[3]
df["BPA"] = df["Besucher (2016)"] / df["Ausstel-lungen"]
print(df)
| 25.375 | 101 | 0.674877 |
0d8084dcb09cac3db166c5666dc7232926727a26 | 92 | py | Python | admin-tutorial/AdminFilter/ordering_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | admin-tutorial/AdminFilter/ordering_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | admin-tutorial/AdminFilter/ordering_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.apps import AppConfig
class OrderingConfig(AppConfig):
name = 'ordering_'
| 15.333333 | 33 | 0.76087 |
21702c8f051e47085150ef386c7b7dfa1bf08472 | 3,682 | py | Python | lib/encounter_builder.py | jyurkiw/EncounterRoller | 42d036874f6b65bb276003fc9c166917464e4a3b | [
"MIT"
] | null | null | null | lib/encounter_builder.py | jyurkiw/EncounterRoller | 42d036874f6b65bb276003fc9c166917464e4a3b | [
"MIT"
] | null | null | null | lib/encounter_builder.py | jyurkiw/EncounterRoller | 42d036874f6b65bb276003fc9c166917464e4a3b | [
"MIT"
] | null | null | null | from EncounterRoller.lib.table_manager import TableManager
from EncounterRoller.lib.settings_manager import SettingsManager
from EncounterRoller.lib.xp import challenge_rating, multipliers, xp_table
from random import choices
import json
class EncounterBuilder(object):
def __init__(self, settings:SettingsManager, ... | 40.911111 | 114 | 0.605106 |
33a0e8b1d95c329829b39e60b3e470db187777de | 5,616 | py | Python | python_experiments/data_analysis/parallel_statistics/parallel_time_speedup.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/parallel_statistics/parallel_time_speedup.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/parallel_statistics/parallel_time_speedup.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import os
import json
time_tag = 'computation time'
task_gen_tag = 'gen accumulation'
thread_lst_tag = 'thread num lst'
speedup_tag = 'speedup lst'
def get_tag_info(file_path, tag, functor):
if not os.path.exists(file_path):
return None
with open(file_path) as ifs:
# assume unit seconds
... | 40.114286 | 114 | 0.588497 |
d54a25c4284bcf1204d10e8075045cb100cf9eca | 353 | py | Python | scripts/rotateLatLong.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 2 | 2021-03-23T20:32:38.000Z | 2021-04-21T11:20:12.000Z | scripts/rotateLatLong.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 4 | 2021-04-19T11:00:55.000Z | 2021-04-20T08:21:48.000Z | scripts/rotateLatLong.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json
with open("in.json", "r") as f:
data = json.loads(f.read())
def rotateWorker(x):
if isinstance(x[0], list):
for el in x:
rotateWorker(el)
else:
first = x[0]
x[0] = x[1]
x[1] = first
rotateWorker(data)
with open("out.json", "... | 16.809524 | 32 | 0.532578 |
d56918078c27c38f88488690168d713ed1b078b7 | 136 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/46_47_ 48_49_50_51_funcoes_2/ex1.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/46_47_ 48_49_50_51_funcoes_2/ex1.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/46_47_ 48_49_50_51_funcoes_2/ex1.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | def ola(saudação, nome):
print(f'{saudação}, {nome}!!')
nome1 = input('Qual o seu nome: ')
saudação1 = 'Olá'
ola(saudação1, nome1) | 19.428571 | 34 | 0.639706 |
d578167ae00a839e6bb39b3f3df7e651b819f6df | 3,065 | py | Python | betriebstechnik/rufzeichen_2.py | mw-ste/amateurfunkausbildung | 92c7670a47faec9e20d08e4ab2c0373fbeb4a49e | [
"MIT"
] | null | null | null | betriebstechnik/rufzeichen_2.py | mw-ste/amateurfunkausbildung | 92c7670a47faec9e20d08e4ab2c0373fbeb4a49e | [
"MIT"
] | null | null | null | betriebstechnik/rufzeichen_2.py | mw-ste/amateurfunkausbildung | 92c7670a47faec9e20d08e4ab2c0373fbeb4a49e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 15 15:14:06 2021
@author: Michael
"""
import re
"""
"KS": "Klubstation",
"RL": "Relais",
"PZ": "Person",
"AB": "Ausbildung",
"FB": "Funkbake",
"SZ": "Experimental"
"""
# In[]
def any_match(string, patterns):
for pattern in patterns:
if ... | 23.576923 | 76 | 0.432953 |
9864586a0c7cf1b18cba8bb8b730b36e9ad9ee19 | 153 | py | Python | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/16.00-Polymorphism.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/16.00-Polymorphism.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/16.00-Polymorphism.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | # Polymorphism
# There are three-way implementing Polymorphism
# 1. Duck Typing
# 2. Operator Overloading
# 3. Method Overloading
# 4. Method Overriding
| 21.857143 | 47 | 0.771242 |
89edf3b8e989dcb2591d27b348c8044ed9033fa6 | 4,162 | py | Python | test/test_npu/test_dynamic_ops/test_dynamic_mul.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_dynamic_ops/test_dynamic_mul.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_dynamic_ops/test_dynamic_mul.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 37.160714 | 110 | 0.617251 |
612f1c902a7371c44159ef0caa85ae05ad052673 | 860 | py | Python | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/calculator.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/calculator.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/calculator.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | formation_num = 32 # defining no of signs, we are using it on on multiple places
print('*' * formation_num) # for formation
title = ' A simple python calculator'
print(title)
print('-' * formation_num) # for formation
num1 = float(input(' Type first number: '))
num2 = float(input(' Type second number: '))
opera... | 30.714286 | 80 | 0.639535 |
f671e12a5057349fc45d231de636cbf6f3865389 | 251 | py | Python | Algorithms/Implementation/beautiful_triplets.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/beautiful_triplets.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/beautiful_triplets.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
n, d = list(map(int, input().strip().split(' ')))
arr = list(map(int, input().strip().split(' ')))
arr = sorted(arr)
print(len([i for i in range(0, len(arr) - 2) if arr[i] + d in arr and arr[i] + (2 * d) in arr]))
| 25.1 | 96 | 0.581673 |
1434f3fd6c340aba097c5d719b5975cdf262d926 | 596 | py | Python | Online-Judges/HackerRank/Algorithms/Sorting/Insertion_Sort_Part_2.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/HackerRank/Algorithms/Sorting/Insertion_Sort_Part_2.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/HackerRank/Algorithms/Sorting/Insertion_Sort_Part_2.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'insertionSort2' function below.
#
# The function accepts following parameters:
# 1. INTEGER n
# 2. INTEGER_ARRAY arr
#
def insertionSort2(n, a):
for i in range(1, n):
for j in range(i, 0, -1):
if a[j-1... | 18.060606 | 50 | 0.54698 |
9f1e821bef19221460127990dab6e17074ad37da | 544 | py | Python | doc/examples/bench_row_sum/util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/bench_row_sum/util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/bench_row_sum/util.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from transonic.util import timeit
from transonic.config import backend_default
def check(functions, arr, columns):
res0 = functions[0](arr, columns)
for func in functions[1:]:
assert np.allclose(res0, func(arr, columns))
print("Checks passed: results are consistent")
def benc... | 27.2 | 63 | 0.6875 |
2ca790f81aca70b7ade0b918c5b2b7b9a8525e9d | 1,567 | py | Python | Veranstaltungen/migrations/0007_auto_20170511_1008.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Veranstaltungen/migrations/0007_auto_20170511_1008.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Veranstaltungen/migrations/0007_auto_20170511_1008.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-05-11 08:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Veranstaltungen', '0006_auto_20170510_0046'),
]
operations = [
migrations.R... | 29.566038 | 72 | 0.574984 |
1a68eee93d71f4fd1913bb399851c26d7a581f59 | 1,698 | py | Python | python/odml/WIP/validation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/WIP/validation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/WIP/validation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | import odml
def print_val(rank, curr):
# Cleanup the odml object print strings
print_str = str(curr).split()[0].split("[")[0].split(":")[0]
# Document has no name attribute and should not print id or name info
if hasattr(curr, "name"):
if curr.name and curr.name != curr.id:
print_s... | 26.952381 | 87 | 0.634276 |
458821584fb58c9611ba6a732b40c68097f27d86 | 2,278 | py | Python | simple-sklearn-demo/test9/titanicTest2.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-sklearn-demo/test9/titanicTest2.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-sklearn-demo/test9/titanicTest2.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | """
集成学习方法
生成多种分类器/模型, 各自独立学习和预测, 最后再结合成组合预测, 使得最终结果优于单一预测结果.
随机森林
包含多个决策树的分类器, 其输出是多个决策树输出的众数决定(投票). 其特点是训练集随机, 特征也随机.
bootstrap抽样, 随机有放回的抽样:
原始训练集有N个样本, M个特征.
训练集随机, 是指从N个样本中, 随机有放回抽样出N个.
特征随机, 是指从M个特征中, 随机抽取m个特征, 且m远远小于M, 形成决策树. m相对小的话, 一方面可以降维, 另一方面使得错误的决策树互相抵消.
假设训练集包含5个样本[1, 2, 3, 4, 5], 随机抽出一个样本, 假设是2, 得到测试样本2... | 31.205479 | 120 | 0.71554 |
b33428f513047632f72bbe1267248dca6fd0af71 | 14,207 | py | Python | projects/g4h1-wsn/src/wsn/node.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h1-wsn/src/wsn/node.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g4h1-wsn/src/wsn/node.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | import logging
import threading
import time
from enum import Enum
from typing import Any, Callable, Dict, List, Tuple, Optional, Set
from utils import node_want_to_terminate
from .message import NormalMessage
class WsnNode(object):
"""无线传感网络中的一个节点
"""
# 日志配置
logger: logging.Logger = l... | 34.56691 | 119 | 0.551278 |
2fbe3e1b6659bafc9218957b4e60c8a533126406 | 1,013 | py | Python | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/datatypes.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/datatypes.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/datatypes.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | x = 5
y = "7"
# Write a print statement that combines x + y into the integer value 12
print(x + int(y))
# Write a print statement that combines x + y into the string value 57
print(str(x) + y)
type(x) # <class 'int'>
type(y) # <class 'str'>
type(int(y)) # <class 'int'>
type(str(x)) # <class 'str'>
int... | 32.677419 | 81 | 0.551826 |
2ffbff444dc0bb494e5738309ba6d78862982799 | 741 | py | Python | ladon-server/software/src/python/kafka-file-wrapper/utils.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | 1 | 2018-04-29T22:33:42.000Z | 2018-04-29T22:33:42.000Z | ladon-server/software/src/python/kafka-file-wrapper/utils.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | ladon-server/software/src/python/kafka-file-wrapper/utils.py | LucasRGoes/ladon-io | ab55219b461e918cc0ba45e6cdc9bcdfbce8c0d6 | [
"MIT"
] | null | null | null | ## IMPORTS ##
import argparse # Argparse: the recommended command-line parsing module
# argumentParserFactory
# ------------
# Handles ArgumentParser creator
#
# returns {ArgumentParser}: The parser created
def argumentParserFactory():
# Creates an argument parser
parser = argparse.ArgumentParser(description="captur... | 35.285714 | 124 | 0.736842 |
642ceecada7c435aeaf08fb62eae6a548a9db9ad | 3,188 | py | Python | hausse/lib/selector.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | hausse/lib/selector.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | hausse/lib/selector.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | from abc import ABC, abstractmethod
from inspect import isclass
from typing import Iterable
from .project import Project
class BaseSelector(ABC):
@abstractmethod
def __init__(self):
"""Plugin initialisation"""
raise NotImplementedError
@abstractmethod
def __call__(self, project: Proj... | 28.212389 | 86 | 0.654329 |
ff2932db64d811ed99790d95e82e148688f10cf5 | 1,009 | py | Python | Calculation/column_01.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | 2 | 2020-11-25T07:53:48.000Z | 2021-09-19T14:19:51.000Z | Calculation/column_01.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | null | null | null | Calculation/column_01.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | null | null | null | from math import pi
class Column(object):
'''
geometry: [diameter cm, length cm]
particle_size: diameter cm
porosity: porosity of the column
n_columns: number of columns default n_columns=1
A: cross-section area cm**2
Dm: diffusion coufficient cm**2/sec
norm_velocity: normalized veloci... | 37.37037 | 107 | 0.660059 |
ff8a226c0e251caca6113a3a486551a5b6b82c16 | 101 | py | Python | tests/test_tree_utils.py | KeepSafe/html-structure-diff | 83ea2b8ad4b78b140bb5f69e3f2966c9fda01a89 | [
"Apache-2.0"
] | 3 | 2016-05-10T13:57:14.000Z | 2016-09-29T21:01:53.000Z | tests/test_tree_utils.py | KeepSafe/html-structure-diff | 83ea2b8ad4b78b140bb5f69e3f2966c9fda01a89 | [
"Apache-2.0"
] | 3 | 2015-10-20T22:29:37.000Z | 2022-01-18T18:20:06.000Z | tests/test_tree_utils.py | KeepSafe/html-structure-diff | 83ea2b8ad4b78b140bb5f69e3f2966c9fda01a89 | [
"Apache-2.0"
] | 1 | 2016-11-05T04:23:05.000Z | 2016-11-05T04:23:05.000Z | from unittest import TestCase
class TestTraverse(TestCase):
def test_name(self):
pass
| 12.625 | 29 | 0.70297 |
92abc1a92d197b890fa511ee3a2a013f066e350c | 12,202 | py | Python | Anime/ecchi_pics.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | Anime/ecchi_pics.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | Anime/ecchi_pics.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | import discord, logging, json
from datetime import datetime as dt, timedelta as td
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import requests as r
import os, sys
from os.path import getmtime, isfile, join as pjoin
from praw import Reddit
from PIL import Image
from io import Byt... | 32.538667 | 195 | 0.696361 |
2ba2534c36108e0f846bf59f34978f8e270e0e39 | 30,644 | py | Python | pycharts.py | Slin-Miraka/EF | 9a4372e5ba8f0416715314e7e8a7af156bb6923c | [
"BSD-2-Clause"
] | null | null | null | pycharts.py | Slin-Miraka/EF | 9a4372e5ba8f0416715314e7e8a7af156bb6923c | [
"BSD-2-Clause"
] | null | null | null | pycharts.py | Slin-Miraka/EF | 9a4372e5ba8f0416715314e7e8a7af156bb6923c | [
"BSD-2-Clause"
] | null | null | null | import streamlit as st
import yfinance as yf
import numpy as np
import pandas as pd
import scipy.optimize as sco
import plotly.graph_objects as go
import datetime
from data_storage import get_list
from scipy.stats import norm
import akshare as ak
########################################################initial... | 43.777143 | 193 | 0.482737 |
750a3801dbddf3ea8187d4c34d42f02bbdb9615d | 4,687 | py | Python | paper_evaluation/IV.B_ablation_study/test.py | rafaspadilha/timestampVerificationTIFS | bad325e676b0b6087e54f2e280c3600c3b0b767f | [
"MIT"
] | 5 | 2022-03-11T18:08:32.000Z | 2022-03-31T13:47:49.000Z | paper_evaluation/IV.B_ablation_study/test.py | rafaspadilha/timestampVerificationTIFS | bad325e676b0b6087e54f2e280c3600c3b0b767f | [
"MIT"
] | null | null | null | paper_evaluation/IV.B_ablation_study/test.py | rafaspadilha/timestampVerificationTIFS | bad325e676b0b6087e54f2e280c3600c3b0b767f | [
"MIT"
] | null | null | null | #####################################################
# Content-Aware Detection of Timestamp Manipulation #
# IEEE Trans. on Information Forensics and Security #
# R. Padilha, T. Salem, S. Workman, #
# F. A. Andalo, A. Rocha, N. Jacobs #
##################################################... | 28.065868 | 99 | 0.612119 |
3410d7cf77014040f934baa96779b0798a6b59a6 | 37,502 | py | Python | lib/features.py | jxtrbtk/bindex | 8feee8ff9db371d9e691e10ea70467446c0412b1 | [
"MIT"
] | 1 | 2022-03-09T20:44:33.000Z | 2022-03-09T20:44:33.000Z | lib/features.py | jxtrbtk/bindex | 8feee8ff9db371d9e691e10ea70467446c0412b1 | [
"MIT"
] | null | null | null | lib/features.py | jxtrbtk/bindex | 8feee8ff9db371d9e691e10ea70467446c0412b1 | [
"MIT"
] | null | null | null | import os
import sys
import datetime
import random
import json
import numpy as np
import pandas as pd
# import xgboost as xgb
from xgboost import XGBClassifier, XGBRegressor
from . import config
from . import api
from . import finta
from . import market
STORAGE = os.path.join("collector","data")
PRECISION = 0.025
... | 51.726897 | 275 | 0.638793 |
34640f150dab6ad771ccaa50607bb8d9a0506b78 | 526 | py | Python | python/python_backup/PRAC_PYTHON/ab39.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab39.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab39.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | class fibo:
def __init__(self):
self.n=0
self.a=0
self.b=1
self.c=0
def input(self,k):
self.n=k
print self.a,
print self.b,
for i in range(1,((self.n+1)-2),1):
... | 22.869565 | 52 | 0.344106 |
cabca71cce00718f4cbea12bd7e299e76a42e44d | 1,493 | py | Python | Project Euler Qusetions 11 - 20/Project Euler Question 14.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 11 - 20/Project Euler Question 14.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 11 - 20/Project Euler Question 14.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 14
#The following iterative sequence is defined for the set of positive integers:
#n → n/2 (n is even)
#n → 3n + 1 (n is odd)
#Using the rule above and starting with 13, we generate the following sequence:
#13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1
#It can be seen that this sequence (starti... | 33.177778 | 108 | 0.657066 |
1b93a68ccd840cc50fb2cf49c70755408771c21b | 363 | py | Python | rotating_triangles/rotating_triangle1.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | rotating_triangles/rotating_triangle1.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | rotating_triangles/rotating_triangle1.py | kantel/py5 | 1bed40dbf732fce28412a206e7c043bd9a01a521 | [
"MIT"
] | null | null | null | def setup():
size(600, 600)
t = 0
def draw():
global t
translate(width/2, height/2)
rotate(radians(t))
tri(200)
t += 0.5
def tri(length):
"""Zeichnet ein gleichseitiges Dreieck
rund um den Mittelpunkt des Dreiecks."""
triangle(0, -length,
-length*sqrt(3)/2, length/... | 20.166667 | 47 | 0.570248 |
84e563bb56c0a174a25293d76ee6640886a9efa4 | 3,614 | py | Python | test/test_npu/test_network_ops/test_trapz_x.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_trapz_x.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_trapz_x.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... | 39.282609 | 74 | 0.667128 |
ca156ca86263109aeb2f78b347c69f5a5250e5d0 | 233 | py | Python | LINE/2021/web/babyweb/public/src/utils.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | LINE/2021/web/babyweb/public/src/utils.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | LINE/2021/web/babyweb/public/src/utils.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import hyper
from uuid import uuid4
from config import cfg
def create_connection():
hyper.tls.cert_loc="./cert.pem"
return hyper.HTTPConnection(cfg["INTERNAL"]["HOST"], secure=True)
def get_uuid():
return str(uuid4()) | 19.416667 | 69 | 0.716738 |
04e220baadda01b2e88c9fd850735301b68de914 | 508 | py | Python | ilswbot/db.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | ilswbot/db.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | ilswbot/db.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | """Helper class to get a database engine and to get a session."""
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from ilswbot.config import config
engine = create_engine(config['data... | 29.882353 | 65 | 0.783465 |
edc3d55b41ec874bcfaaa7106c4d07f80f4293fe | 3,717 | py | Python | Poker_verteilen.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Poker_verteilen.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Poker_verteilen.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Poker verteilen
https://www.programmieraufgaben.ch/aufgabe/poker-verteilen/i4si4ts5
"""
# Programmieraufgabe:
# Schreiben Sie ein Programm, das vier Spielerinnen je fünf Pokerkarten verteilt.
# Dabei ist ein Array zunächst mit den Zahlen 1 bis 55 zu füllen. A... | 33.790909 | 108 | 0.630885 |
1ed625c8ab911a187835b12053e7aaa1b9e4858e | 2,064 | py | Python | books/PythonCleanCode/ch7_generator/generators_coroutines_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/generators_coroutines_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch7_generator/generators_coroutines_2.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 7: Using Generators
> Using Coroutines.
"""
import logging
def _stream_db_records(db_handler):
retrieved_data = None
previous_page_size = 10
try:
while True:
page_size = yield retrieved_data
if page_size is None:
... | 27.891892 | 77 | 0.638566 |
44cafbb765bb8c188cdd7be19aede0c5920a0de9 | 1,059 | py | Python | pyntcloud/io/npz.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/io/npz.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/io/npz.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | # HAKUNA MATATA
import numpy as np
import pandas as pd
def read_npz(filename, points_name="points", mesh_name="mesh"):
""" Read a .npz file and store all possible elements in pandas DataFrame
Parameters
----------
filename: str
Path to the filename
Returns
-------
data: dict... | 22.531915 | 76 | 0.600567 |
78508d86e6051f5a9939bdac2a62a2ca8b214fe2 | 3,721 | py | Python | code/fetch_nowcasts/RKI_weekly_report2nowcast.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | code/fetch_nowcasts/RKI_weekly_report2nowcast.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | code/fetch_nowcasts/RKI_weekly_report2nowcast.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | from urllib.request import urlretrieve
import pandas as pd
from datetime import datetime,timedelta
shortcuts = ["DE",'DE-BW', 'DE-BY', 'DE-HB', 'DE-HH', 'DE-HE', 'DE-NI', 'DE-NW', 'DE-RP', 'DE-SL', 'DE-SH', 'DE-BB', 'DE-MV', 'DE-SN', 'DE-ST', 'DE-TH', 'DE-BE']
regions = ['Bundesgebiet','Baden-Württemberg', 'Bayern','Br... | 57.246154 | 385 | 0.714324 |
154caab9d726ef2a3803171a1060771bd82b3ded | 647 | py | Python | display/_display.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_display.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_display.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | class Display:
_views: dict = dict()
_current_view = None
def __init__(self, views: list):
for view in views:
self._views[view.name()] = view
def start(self):
self.switch_view("main_view")
def switch_view(self, name: str):
view = self._views.get(name)
i... | 21.566667 | 43 | 0.582689 |
e55868f8bf59d32875c1df68e217abd7cc714e0c | 3,395 | py | Python | code/3/PokerHand.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/3/PokerHand.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/3/PokerHand.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | """This module contains code from
Think Python by Allen B. Downey
http://thinkpython.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import sys
from Card import *
class Hist(dict):
"""A map from each item (x) to its frequency."""
def __init__(self, seq=[]):
... | 25.526316 | 72 | 0.546392 |
970bc3b7dd9d1efcbf345ea9a994206d978d4ff4 | 1,499 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C02LinkedLists/python/2.5-answer.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C02LinkedLists/python/2.5-answer.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C02LinkedLists/python/2.5-answer.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 2.5 Sum Lists:
# You have two numbers represented by a linked list, where each node contains a single digit.
# The digits are stored in reverse order, such that the 1s digit is at the head of the list.
# Write a function that adds the two numbers and returns the sum as a linked list.
# You are not allowed to "cheat"... | 29.392157 | 93 | 0.599733 |
a9b4205c11054bf6e8098d5789e49fa4614fe56b | 2,237 | py | Python | packages/watchmen-data-surface/src/watchmen_data_surface/cache/cache_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-surface/src/watchmen_data_surface/cache/cache_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-surface/src/watchmen_data_surface/cache/cache_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from fastapi import APIRouter, Depends
from starlette.responses import Response
from watchmen_auth import PrincipalService
from watchmen_data_kernel.cache import CacheService
from watchmen_model.admin import UserRole
from watchmen_rest import get_super_admin_principal
router = APIRouter()
# noinspection PyUnusedLoc... | 39.946429 | 118 | 0.820295 |
a9b4d0e7eb72d30f7bca338a1c0ee7c37ac02762 | 6,049 | py | Python | official/nlp/dgu/src/args.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/dgu/src/args.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/dgu/src/args.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... | 36.439759 | 107 | 0.626385 |
68c4abfaf8d02c7c45dd402850dcc107374cfc89 | 578 | py | Python | solve1.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | 1 | 2021-06-15T11:19:43.000Z | 2021-06-15T11:19:43.000Z | solve1.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | null | null | null | solve1.py | yue1234567/QuantumCircuitZJY | 097275a633bc0f0c92bb14ad63e94f460fa8567d | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
from Reader import ReadU
from ops import MakeR, Fidelity
from utils import Minimize
INPUT_TXT = 'Questions/Question_1_Unitary.txt'
ANSWER_TXT = '../Answer/Question_1_Answer.txt'
def main(in_txt=INPUT_TXT, out_txt=ANSWER_TXT):
U = ReadU(in_txt)
func = lambda t:Fidelity(M... | 26.272727 | 48 | 0.641869 |
68cf7838b31ce7299d29d3cec97cd1ed89882f76 | 102 | py | Python | AccessPoint03/AccessPoint/apps.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | AccessPoint03/AccessPoint/apps.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | 5 | 2021-03-30T13:53:38.000Z | 2021-09-22T19:18:06.000Z | AccessPoint03/AccessPoint/apps.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class AccesspointConfig(AppConfig):
name = 'AccessPoint'
| 17 | 36 | 0.735294 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.