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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
80e65231e0ada30d59726a405691fc84a35a1141 | 18,945 | py | Python | tst2next.py | frederic-loui/RARE-web | 8ee13e292777579725cc1e0288653fc76dbe3aa3 | [
"Apache-2.0"
] | 1 | 2022-02-22T07:14:53.000Z | 2022-02-22T07:14:53.000Z | tst2next.py | frederic-loui/RARE-web | 8ee13e292777579725cc1e0288653fc76dbe3aa3 | [
"Apache-2.0"
] | null | null | null | tst2next.py | frederic-loui/RARE-web | 8ee13e292777579725cc1e0288653fc76dbe3aa3 | [
"Apache-2.0"
] | 1 | 2019-11-06T20:21:12.000Z | 2019-11-06T20:21:12.000Z | #!/usr/bin/python3
from connector import *
from edge import *
from ipaddress import *
from ciscoconfparse import CiscoConfParse
import glob,re
from pprint import pprint
import os
import json
CONNS={}
EDGES={}
CONFIGS={}
topology_data = { 'nodes':[], 'links':[] }
NEXT_TEMPLATE="""
"""
def netMask2CIDR(netmask):
... | 39.884211 | 146 | 0.573661 |
20be138abc2402cc9bca1394c02fdc9e736c75de | 1,699 | py | Python | Packs/DemistoRESTAPI/Scripts/GetTasksWithSections/GetTasksWithSections_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DemistoRESTAPI/Scripts/GetTasksWithSections/GetTasksWithSections_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DemistoRESTAPI/Scripts/GetTasksWithSections/GetTasksWithSections_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
from GetTasksWithSections import traverse_tasks, find_start_task, get_tasks_and_readable
def load_json(file):
with open(file, 'r') as f:
return json.load(f)
tasks = load_json('test_data/tasks_example.json')
def test_find_start_task():
"""
Given:
tasks from `/investigation/{... | 33.98 | 111 | 0.625074 |
45ba881913c2599efb971cb43aa9c02ec00b55ac | 2,307 | py | Python | x2paddle/core/util.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/core/util.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/core/util.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.000Z | # -*- coding:UTF-8 -*-
# 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
#
# Un... | 30.76 | 92 | 0.627221 |
b34a2f87b3c614b98d271c7946fc6a9074ccfd16 | 601 | py | Python | ProjectEuler_plus/euler_081.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_081.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_081.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
n = int(input().strip())
matrix = []
for _ in range(n):
matrix.append(list(map(int, input().strip().split())))
sum_list = [[0 for x in range(n)] for x in range(n)]
sum_list[0][0] = matrix[0][0]
for i in range(1, n): # set 1st sum of row
sum_list[0][i] = sum_list[0][i - 1] +... | 27.318182 | 82 | 0.575707 |
92905601e5f54ca233b32983912ba916a0696810 | 2,102 | py | Python | MaterialLib/SolidModels/MFront/Lubby2.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 1 | 2016-09-02T11:49:52.000Z | 2016-09-02T11:49:52.000Z | MaterialLib/SolidModels/MFront/Lubby2.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 13 | 2015-01-09T13:08:57.000Z | 2018-01-25T12:56:17.000Z | MaterialLib/SolidModels/MFront/Lubby2.py | fwitte/ogs | 0b367872fc58ecd4e1dbfe1dcebbc847da6639d7 | [
"BSD-3-Clause"
] | 2 | 2019-08-13T13:37:03.000Z | 2021-02-01T10:19:03.000Z | import mtest
import numpy as np
import matplotlib.pyplot as plt
GM0 = 9.54e3
KM0 = 2.78e4
GK0 = 6.27e4
mK = -0.254
mvK = -0.327
mvM = -0.267
etaK0= 1.66e5
etaM0= 4.03e7
tmax = 15.
m = mtest.MTest()
mtest.setVerboseMode(mtest.VerboseLevel.VERBOSE_QUIET)
m.setMaximumNumberOfSubSteps(10)
m.setBehaviour('gene... | 30.028571 | 118 | 0.714558 |
2bbea601e0dbeb9214c2840013e1fb462881c883 | 685 | py | Python | 0038count-and-say.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0038count-and-say.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0038count-and-say.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Solution:
def countAndSay(self, n: int) -> str:
# if n == 1:
# return "1"
pre = "1"
for cnt in range(1, n):
cntQ = list()
cntStr = str()
for s in pre:
if len(cntQ) != 0 and c... | 26.346154 | 54 | 0.424818 |
5b4b748e5dcc8b912110947fbd77105d12a3724a | 587 | py | Python | examples/blink.py | Elecrow-RD/Raspberry-Pi-Starter-Kit | 9adad7bfb403a697119bf80bbc2290bc3832750d | [
"MIT"
] | 1 | 2020-08-11T23:39:23.000Z | 2020-08-11T23:39:23.000Z | examples/blink.py | Elecrow-RD/Raspberry-Pi-Starter-Kit | 9adad7bfb403a697119bf80bbc2290bc3832750d | [
"MIT"
] | null | null | null | examples/blink.py | Elecrow-RD/Raspberry-Pi-Starter-Kit | 9adad7bfb403a697119bf80bbc2290bc3832750d | [
"MIT"
] | 1 | 2020-08-05T18:30:45.000Z | 2020-08-05T18:30:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# http://elecrow.com/
import time
import RPi.GPIO as GPIO
# define LED pin
led_pin = 17
# set GPIO mode to GPIO.BCM
GPIO.setmode(GPIO.BCM)
# set puin as input
GPIO.setup(led_pin, GPIO.OUT)
try:
while True:
# turn on LED
GPIO.output(led_pin, GPIO.HIGH)
... | 20.241379 | 55 | 0.626917 |
5b695629291084a5c9de1f68fbf4091898fae5f9 | 274 | py | Python | api/finance/fund.py | HerbLee/sanicweb | f5177ca715ed704ebceffdd59710406b2659c514 | [
"Apache-2.0"
] | null | null | null | api/finance/fund.py | HerbLee/sanicweb | f5177ca715ed704ebceffdd59710406b2659c514 | [
"Apache-2.0"
] | null | null | null | api/finance/fund.py | HerbLee/sanicweb | f5177ca715ed704ebceffdd59710406b2659c514 | [
"Apache-2.0"
] | null | null | null | # @time : 2020/7/12 16:35
# @author : HerbLee
# @file : finance.py
from sanic import Blueprint
from sanic.response import text
fund = Blueprint("fund", url_prefix="/fund")
@fund.route("/get_data")
async def get_v2_data(request):
return text("it is finance")
| 19.571429 | 44 | 0.682482 |
943d7ae17911f4d8bac6a1670f9637cbcb3a9eeb | 81 | py | Python | top/clearlight/base/runoob/os/mkdir.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/runoob/os/mkdir.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/runoob/os/mkdir.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import os, sys
# 创建目录
path = "F://testOSmkdir"
os.mkdir(path)
print("目录已创建")
| 8.1 | 24 | 0.641975 |
943ec06b9cf3990e5a153a12478a7b28cf3ce190 | 592 | py | Python | haas_lib_bundles/python/docs/examples/humiture_panel/m5stack/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/humiture_panel/m5stack/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/humiture_panel/m5stack/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | from humiturePanel import HumiturePanel
import utime
import sht3x
from driver import I2C
# 创建I2C对象,用于创建I2C类型的温湿度设备
i2cObj = I2C()
# 打开I2C对象
i2cObj.open("sht3x")
# 创建SHT3X温湿度传感器对象
humitureDev = sht3x.SHT3X(i2cObj)
print('create humiture device')
humiturePage = HumiturePanel()
print('create humiture panel')
while Tru... | 19.733333 | 52 | 0.761824 |
ca0f92b1cecb6189c8ad784a85d4992754beb4e3 | 226 | py | Python | exercises/zh/exc_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/exc_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/exc_02_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy
nlp = spacy.load("zh_core_web_sm")
doc = nlp("周杰伦是一个人物。")
# 查找标签是"人物"的字符串的哈希值
person_hash = ____.____.____[____]
print(person_hash)
# 查找person_hash来拿到字符串
person_string = ____.____.____[____]
print(person_string)
| 17.384615 | 36 | 0.765487 |
04a52fc2cb498eaa581b0bccde517957124d0115 | 313 | py | Python | source/pkgsrc/devel/py-sysctl/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/py-sysctl/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/py-sysctl/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2019/09/09 07:09:47 maya Exp $
--- setup.py.orig 2010-04-10 17:41:18.000000000 +0000
+++ setup.py
@@ -2,5 +2,5 @@
from distutils.core import setup, Extension
-module1 = Extension('sysctlmodule',
+module1 = Extension('sysctl',
sources = ['sysctlmodule.c'])
| 26.083333 | 60 | 0.632588 |
6d6585ff45ba7c34e3b09141a4f547e80752ffc1 | 3,480 | py | Python | dnnlib/util.py | x6rulin/AiLab | b810590d4da645915b8472554794d0c6908109e3 | [
"MIT"
] | 2 | 2019-08-08T07:54:54.000Z | 2019-08-26T23:14:08.000Z | dnnlib/util.py | x6rulin/AiLab | b810590d4da645915b8472554794d0c6908109e3 | [
"MIT"
] | null | null | null | dnnlib/util.py | x6rulin/AiLab | b810590d4da645915b8472554794d0c6908109e3 | [
"MIT"
] | 1 | 2019-08-08T07:55:03.000Z | 2019-08-08T07:55:03.000Z | """Miscellaneous utility classes and functions. """
import sys
from typing import Any
class Logger:
"""Redirect stderr to stdout, optionally print stdout to a file, and optionally force flushing
on both stdout and the file.
"""
def __init__(self, file_name: str = None, file_mode: str = 'w', shou... | 30.26087 | 98 | 0.583333 |
ec5f67c7f4ed740577a40454acb624faf3eb0006 | 12,738 | py | Python | transonic/justintime.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/justintime.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/justintime.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """Cached JIT compilation
=========================
User API
--------
.. autofunction:: jit
.. autofunction:: set_compile_jit
Internal API
------------
.. autoclass:: ModuleJIT
:members:
:private-members:
.. autofunction:: _get_module_jit
.. autoclass:: JIT
:members:
:private-members:
Notes
-----
S... | 30.917476 | 104 | 0.584629 |
01bb2301f7ad8c96418fa86a28383a3d97001ecb | 279 | py | Python | src/bo4e/enum/medium.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/medium.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/medium.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Medium(StrEnum):
"""
Gibt ein physikalisches Medium an.
"""
STROM = "STROM" #: STROM
GAS = "GAS" #: GAS
WASSER = "WASSER" #: WASSER
DAMPF = "DAMPF" #: DAMPF
| 19.928571 | 42 | 0.612903 |
bf235c7c3dd06d89d97c293b4e5b02c42752d9b9 | 1,124 | py | Python | icons/theme-icons.py | NuGetHub/Pr0 | 028c97efe953a4c679c06320a1b6bd0c37c85e3c | [
"MIT"
] | 1 | 2021-11-22T12:12:35.000Z | 2021-11-22T12:12:35.000Z | icons/theme-icons.py | pr0-dev/Pr0 | 6fe1980ad152f866b5c0ccfa60e9aa10c06be4bf | [
"MIT"
] | null | null | null | icons/theme-icons.py | pr0-dev/Pr0 | 6fe1980ad152f866b5c0ccfa60e9aa10c06be4bf | [
"MIT"
] | null | null | null | import subprocess
source_colors = ["#d23b22", "#b83621"]
themes = {
"orange": None,
"green": ["#1db992", "#137e64"],
"olive": ["#b0ad05", "#797703"],
"pink": ["#ff0082", "#b7005d"],
"blue": ["#008fff", "#0067b6"],
"black": ["#444444", "#1a1a1a"],
}
for name, target_colors in themes.items():
... | 29.578947 | 90 | 0.579181 |
16f9792aa87e81d2ca026692162fd8d2b83b1546 | 884 | py | Python | Projekteuler/Loesungen/projecteuler_aufgabe002_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | Projekteuler/Loesungen/projecteuler_aufgabe002_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | Projekteuler/Loesungen/projecteuler_aufgabe002_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | """
Jeder neue Term in der Fibonacci-Reihe wird gebildet, indem die beiden
vorherigen Zahlen addiert werden. Wenn man mit 1 und 2 beginnt, sind die
ersten 10 Terme wie folgt:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Finden Sie die Summe aller geraden Terme der Fibonacci-Reihe,
die 4 Millionen nicht überschreiten.
"""... | 22.666667 | 72 | 0.676471 |
006fd5caf91b1125ef8b74f448d35b433848fd0c | 4,326 | py | Python | main.py | Bodia2cat/ToS | 1b8c19fd4ab5f8458f5dc1832b764430ac6e02d9 | [
"Unlicense"
] | null | null | null | main.py | Bodia2cat/ToS | 1b8c19fd4ab5f8458f5dc1832b764430ac6e02d9 | [
"Unlicense"
] | null | null | null | main.py | Bodia2cat/ToS | 1b8c19fd4ab5f8458f5dc1832b764430ac6e02d9 | [
"Unlicense"
] | null | null | null | #-----------------------#
i = 10 #
#-----------------------#
import subprocess #
import time #
import os #
import requests #-------------#
from terminaltables import SingleTable#
#-------------------------------------#
#log function
def log():
log = datetime.datetime.now().time()
handle = open(".... | 22.888889 | 81 | 0.540222 |
c10309899b1286d1f71d0f2eafa347057ab3f599 | 1,216 | py | Python | Algorithms/Tree/Binary_Lifting/Binary Lifting.py | PriyanshuMay/DS_ALGO | 6c754fd7d817ea3f0470b42f5224c620c77fffb7 | [
"MIT"
] | 182 | 2020-10-01T17:16:42.000Z | 2021-10-04T17:52:49.000Z | Algorithms/Tree/Binary_Lifting/Binary Lifting.py | PriyanshuMay/DS_ALGO | 6c754fd7d817ea3f0470b42f5224c620c77fffb7 | [
"MIT"
] | 759 | 2020-10-01T00:12:21.000Z | 2021-10-04T19:35:11.000Z | Algorithms/Tree/Binary_Lifting/Binary Lifting.py | PriyanshuMay/DS_ALGO | 6c754fd7d817ea3f0470b42f5224c620c77fffb7 | [
"MIT"
] | 1,176 | 2020-10-01T16:02:13.000Z | 2021-10-04T19:20:19.000Z | import math
# Pre-processing to calculate values of memo[][]
def dfs(u, p, memo, lev, log, g):
memo[u][0] = p
for i in range(1, log + 1):
memo[u][i] = memo[memo[u][i - 1]][i - 1]
for v in g[u]:
if v != p:
lev[v] = lev[u] + 1
dfs(v, u, memo, lev, log, g)
... | 20.610169 | 48 | 0.469572 |
c104e2e8133ac92658b7c48f173584b401ce164d | 509 | py | Python | exercises/en/exc_03_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/en/exc_03_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/en/exc_03_06.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.language import Language
# Define the custom component
@Language.component("length_component")
def length_component_function(doc):
# Get the doc's length
doc_length = ____
print(f"This document is {doc_length} tokens long.")
# Return the doc
____
# Load the small English p... | 22.130435 | 66 | 0.744597 |
41b91560d070f0a57f8d92aca7e4e8c92d58e2d2 | 5,146 | py | Python | src/main/python/cluster/dcluster/run.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/cluster/dcluster/run.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/cluster/dcluster/run.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | # -*- coding: utf-8 -*-
import numpy as np
from numpy.linalg import *
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mds import mds
from readfile import readfile
from rhodelta import rhodelta
from DCplot import DCplot
from context import resource_manager
from tools import logger
import os... | 31.570552 | 146 | 0.602021 |
68eaa594ec13314a7b34a13ce8449b2d9dff6fc2 | 1,719 | py | Python | SystemInfos/main.py | urss1/RPiTutorialSystemInfos | 4888824a66b9add228e9ee9979ad70018a7b9022 | [
"MIT"
] | null | null | null | SystemInfos/main.py | urss1/RPiTutorialSystemInfos | 4888824a66b9add228e9ee9979ad70018a7b9022 | [
"MIT"
] | null | null | null | SystemInfos/main.py | urss1/RPiTutorialSystemInfos | 4888824a66b9add228e9ee9979ad70018a7b9022 | [
"MIT"
] | null | null | null | # **************************************************
# My first Python Project
# 26.10.2018 V1.0 - sumali - Create Project
# **************************************************
# Imports
import sys
import platform
import os
import socket
import fcntl
import struct
import io.consolePrinter as console
import io.infoPrint... | 26.045455 | 59 | 0.598604 |
cf34972c78889290baeed825c6703cfb5be6c5b2 | 1,293 | py | Python | top/clearlight/base/csdn/encoded/decode_encode.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/csdn/encoded/decode_encode.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/csdn/encoded/decode_encode.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # -*-coding:utf-8
import sys
'''
首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,
即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。
decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串str1转换成unicode编码。
encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode('gb2312'),表示将unicode编码的字符串str2转换... | 28.733333 | 112 | 0.776489 |
d84370cccaae26ae38725ccc3b4922fe1f97da28 | 2,054 | py | Python | scriptsForPreprocessing/create_mask_folder_using_folder.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | scriptsForPreprocessing/create_mask_folder_using_folder.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | scriptsForPreprocessing/create_mask_folder_using_folder.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import numpy as np
import pandas as pd
import os, json
import xlrd
import os.path as path
import re
from shutil import copyfile
# Settings
# Set ipython's max row display
pd.set_option('display.max_row', 1000)
# Set iPython's max column width to 50
pd.set_option('display.max_columns', 1000)
# directory with mask
name... | 33.672131 | 86 | 0.683544 |
d860d9fb242b20f9e66a642f7bcac10c0731a877 | 976 | py | Python | Bibliothek/migrations/0002_auto_20170511_0008.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Bibliothek/migrations/0002_auto_20170511_0008.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Bibliothek/migrations/0002_auto_20170511_0008.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-10 22:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Bibliothek', '0001_initial'),
]
operations = [
migrations.AddField(
... | 27.111111 | 66 | 0.579918 |
d8729b8579b7255de80f949423a04e6500b311ed | 1,661 | py | Python | extract-data.py | luki-ev/membermap | abae08c06fadc64f267ba67d64898301bc0e1b64 | [
"BSD-2-Clause"
] | null | null | null | extract-data.py | luki-ev/membermap | abae08c06fadc64f267ba67d64898301bc0e1b64 | [
"BSD-2-Clause"
] | null | null | null | extract-data.py | luki-ev/membermap | abae08c06fadc64f267ba67d64898301bc0e1b64 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import sys
import pyexcel as pe
def get_country_code(country):
if len(country) == 2:
return country.lower()
# In case more country codes need to be supported, this list might be
# considered:
# https://gist.github.com/walterrenner/1e72fad092b00ae7d998c703c0d41832
country_cod... | 34.604167 | 149 | 0.64419 |
2b21268269aea2220ab30f6e112ea2ab1badc5bb | 3,786 | py | Python | scripts/check-exchange.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T22:29:44.000Z | 2022-01-28T22:29:44.000Z | scripts/check-exchange.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | null | null | null | scripts/check-exchange.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T21:10:41.000Z | 2022-01-28T21:10:41.000Z | from concurrent.futures import ThreadPoolExecutor
import argparse
import requests
import re
from datetime import datetime
import colorama
requests.packages.urllib3.disable_warnings()
colorama.init(autoreset = True)
def main():
if len(input_domain) >= 1:
input_url = input_domain
s... | 35.055556 | 131 | 0.539356 |
994afdc0f16fcb9e722342e9148c58152583aecd | 1,082 | py | Python | generate.py | LeiShi1313/alembic | 8426b0c558d279493f55f02e5e09b9aa05806218 | [
"MIT"
] | null | null | null | generate.py | LeiShi1313/alembic | 8426b0c558d279493f55f02e5e09b9aa05806218 | [
"MIT"
] | null | null | null | generate.py | LeiShi1313/alembic | 8426b0c558d279493f55f02e5e09b9aa05806218 | [
"MIT"
] | null | null | null | languages = {
'en': {
'title': 'Wall frid',
'name': 'Wall frid',
'description': 'No description.'
},
'zh': {
'title': '墙体槽板',
'name': '墙体槽板',
'description': '暂无简介。'
}
}
path = '_i18n/{}/_posts/produc... | 23.021277 | 75 | 0.472274 |
cfd06a3cc3c983a8b3315095c6a8babf7c35d890 | 405 | py | Python | Lehrjahr_2/Modul_122/python/ggt_python.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 5 | 2015-05-19T14:26:53.000Z | 2016-06-24T17:03:03.000Z | Lehrjahr_2/Modul_122/python/ggt_python.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | null | null | null | Lehrjahr_2/Modul_122/python/ggt_python.py | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 6 | 2015-05-26T06:25:05.000Z | 2020-04-30T07:25:30.000Z | #!/usr/bin/python3.4
#
#SCRIPT: ggt_python.py
#AUTHOR: Severin Kaderli
#PURPOSE: calculate ggt in python
#USAGE: ./ggt_python.py
a = input("Erste Zahl angeben: ")
b = input("Zweite Zahl angeben: ")
def ggt(a, b):
while True:
a, b = b, int(a) % int(b)
yield int(a), int(b)
if b == 0: break
g = ggt(a, b)
counter... | 18.409091 | 50 | 0.619753 |
8f851e154eb5475a49040760237c2b6b1fc58e56 | 438 | py | Python | set_e1_link_cfg.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | set_e1_link_cfg.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | set_e1_link_cfg.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | file_in = 'e1_link_stat.csv'
file_ot = 'e1_link_cfg.csv'
f_in = open(file_in, 'r')
f_ot = open(file_ot, 'a')
for line in f_in:
linkid = line.split(',')[1]
sp1 = line.split(',')[6]
sp2 = line.split(',')[8]
ip = line.split(',')[4]
# print(linkid)
# print(sp1)
# print(sp2)
s =... | 21.9 | 60 | 0.520548 |
8f9528a94d855402306291a7f6161e654aca1783 | 3,763 | py | Python | Songfiles + Wavepattern/visualize_decoding.py | TheGadgeteer/Music-Sheet-Synchronizer | 7f5dcf99bda85dac17085ac6f3c79e5a257b901b | [
"MIT"
] | 2 | 2019-01-31T17:10:38.000Z | 2021-06-06T21:15:49.000Z | Songfiles + Wavepattern/visualize_decoding.py | TheGadgeteer/Music-Sheet-Synchronizer | 7f5dcf99bda85dac17085ac6f3c79e5a257b901b | [
"MIT"
] | null | null | null | Songfiles + Wavepattern/visualize_decoding.py | TheGadgeteer/Music-Sheet-Synchronizer | 7f5dcf99bda85dac17085ac6f3c79e5a257b901b | [
"MIT"
] | null | null | null | import turtle
filename = "decoded_wavepattern.txt"
#filename = "all about you cutted - decoded.txt"
drawStamps = True
drawRightLine = False
def min(a, b):
if (a < b):
return a
return b
def drawgrid():
for i in range(int(len_vert / step_mark * 2)):
a.forward(step_mark)
... | 25.425676 | 100 | 0.599787 |
f100f028c78342171f4f56e87c6671879dc59615 | 3,783 | py | Python | menucard/urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | menucard/urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | menucard/urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.dashboard, name='menucard_dashboard'),
path('profil/', views.profil_bearbeiten, name="profil"),
# Vorspeisen URLs
path('vorspeisen/', views.vorspeisen, name='vorspeisen'),
path('vorspeisen-add/', views.vorsp... | 51.821918 | 119 | 0.744911 |
f145aeab5abe79576f3a44d932925564152bea01 | 635 | py | Python | SoSe-21/Code-Vorlesungen/VL-4/ueberweisung.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Code-Vorlesungen/VL-4/ueberweisung.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Code-Vorlesungen/VL-4/ueberweisung.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
ungueltige_eingabe = True
while ungueltige_eingabe:
try:
ueberweisungsbetrag = float(input("Bitte geben Sie den Überweisungsbetrag an: "))
if ueberweisungsbetrag < 50_000 and ueberweisungsbetrag > 0:
print("Der von Ihnen angegebene Überweisungsbetrag lautet", ueberweisungsbetrag)
... | 45.357143 | 115 | 0.691339 |
74c04dbae4697b3a478f483fae4501ece4f5442c | 180 | py | Python | Computerorietierte_Mathematik/U1/Tutorium/test.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | Computerorietierte_Mathematik/U1/Tutorium/test.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | Computerorietierte_Mathematik/U1/Tutorium/test.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | import numpy as np
ls = []
for i in range(1,100,2):
ls.append(i)
for i in range(len(ls)):
ls[i] *= 3
"""
ls = np.array(ls) * 3
"""
print(ls[26])
print(np.array(ls)*3)
| 11.25 | 24 | 0.544444 |
77cfccb201f256fc8ce6fe16fb2ca4e2806dbf45 | 605 | py | Python | IVTp/2014/Karamyan/Karamyan 3_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Karamyan/Karamyan 3_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Karamyan/Karamyan 3_8.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 3, Вариант 8
# Напишите программу, которая выводит имя "Борис Николаевич Бугаев", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
# Карамян Н.Г.
# 17.05.2016
print ("Герой нашей сегодняшней программы — Бори... | 31.842105 | 210 | 0.712397 |
56510f7d84b916c828c3883e87272acda768ae11 | 567 | py | Python | 2020-09-04-1052-gma_person_main.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-04-1052-gma_person_main.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-04-1052-gma_person_main.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
os.chdir("D:\Selfcoding\WillmsBis040920\scara64anaconda\Klassen")
from person import *
# Test Person - Konstruktor
a = Person(v = "Georg", n = "Maubach", a = 50)
print(a.getVorname())
print(a.getNachname())
print(a.getAlter())
# Test Person - Getter/Setter
a.setVornam... | 17.71875 | 66 | 0.647266 |
56738a8787bee412791687c8421a867411a16577 | 2,929 | py | Python | Theory-of-Algorithms/binary_search_trees/binary_search_trees.py | yehorbk/kpi_programming | c096cd5467c3c165777ba35ab66d953937c5b253 | [
"MIT"
] | 1 | 2020-09-09T11:21:08.000Z | 2020-09-09T11:21:08.000Z | Theory-of-Algorithms/binary_search_trees/binary_search_trees.py | yehorbk/kpi_programming | c096cd5467c3c165777ba35ab66d953937c5b253 | [
"MIT"
] | null | null | null | Theory-of-Algorithms/binary_search_trees/binary_search_trees.py | yehorbk/kpi_programming | c096cd5467c3c165777ba35ab66d953937c5b253 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, item = None):
self.item = item
self.left = None
self.right = None
def printArray(self):
if self.left:
self.left.printArray()
print(self.item),
if self.right:
self.right.printArray()
def printTree(self):... | 30.510417 | 63 | 0.506316 |
baef27b645e6ba5ac94061f96ae07e354f3449a9 | 620 | py | Python | order/migrations/0017_auto_20201208_1402.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | order/migrations/0017_auto_20201208_1402.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | order/migrations/0017_auto_20201208_1402.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.16 on 2020-12-08 06:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0016_auto_20201208_0936'),
]
operations = [
migrations.RemoveField(
model_name='orderlist',
... | 26.956522 | 147 | 0.546774 |
301bdb1a4448e533189be8d5c0a610288f8a27c0 | 1,536 | py | Python | Simple Wave Analysis/comtest1.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/comtest1.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/comtest1.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | #-*- coding: utf-8 -*-
# 串口测试程序
import serial
import matplotlib.pyplot as plt
import numpy as np
import time
import re
# User input comport and bundrate
comport = input('Please input comport (like COM3) for your connected device: ')
baudrate = input('Please input baudrate (like 9600) for your connected device: ')
byt... | 26.482759 | 98 | 0.593099 |
064c6670155138354029152ff5fc0450e7f675d3 | 807 | py | Python | Packs/Confluera/Scripts/ConflueraDetectionsData/ConflueraDetectionsData.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Confluera/Scripts/ConflueraDetectionsData/ConflueraDetectionsData.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Confluera/Scripts/ConflueraDetectionsData/ConflueraDetectionsData.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from CommonServerUserPython import *
import json
# Executes confluera-fetch-detections command/script
detections_data = demisto.executeCommand('confluera-fetch-detections', {'hours': '72'})
if detections_data[1] and detections_data[1]['Contents']:
detections = detections_data[1][... | 23.735294 | 87 | 0.662949 |
23128b736d2b9d357ef6c6305638defaf3f9c4ea | 69 | py | Python | globals/source_sans_pro_locales.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | globals/source_sans_pro_locales.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | globals/source_sans_pro_locales.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | source_sans_pro_locales = ('de', 'en', 'es', 'fr', 'it', 'nl', 'pt')
| 34.5 | 68 | 0.536232 |
236b4a8833d12974e927eb28a7f23f4225b13abd | 929 | py | Python | src/visitpy/pyavt/py_src/templates/advanced_query.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/pyavt/py_src/templates/advanced_query.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/pyavt/py_src/templates/advanced_query.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | #
# Template for an Advanced Python Query.
#
class PyQuery(PythonQuery):
def __init__(self):
"""
Constructor.
"""
PythonQuery.__init__(self)
# set to provide a name & description for your query.
self.name = "PyQuery"
self.description = "Custom Python Query"
... | 23.820513 | 77 | 0.575888 |
00264e362200c9a3e74f7e8e90eddfdabbca1e80 | 5,866 | py | Python | Packs/DeveloperTools/Integrations/APIMetricsValidation/APIMetricsValidation_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/DeveloperTools/Integrations/APIMetricsValidation/APIMetricsValidation_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/DeveloperTools/Integrations/APIMetricsValidation/APIMetricsValidation_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | import APIMetricsValidation
import demistomock as demisto
from CommonServerPython import * # noqa: F401
def test_scenario_one():
"""
Given: 10 successful API Calls
When: API Metrics Validation scenario one is run
Then: API Metrics Validation should return an execution_metrics object with 10 successfu... | 33.907514 | 125 | 0.689397 |
003feaf1b980b553cc392990ab963d5c6ebc832b | 186 | py | Python | 1528-shuffle-string/1528-shuffle-string.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1528-shuffle-string/1528-shuffle-string.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1528-shuffle-string/1528-shuffle-string.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def restoreString(self, s: str, indices: List[int]) -> str:
len_indices = len(indices)
return "".join(s[indices.index(i)] for i in range(len_indices)) | 46.5 | 71 | 0.650538 |
aeafe6445037109516d1e559e9bfdef26f0c9a37 | 12,856 | py | Python | docs/generate_docs.py | PeggyYuchunWang/deeplearning4j | e739fe6c15267be74f8021795e9866b929234d4b | [
"Apache-2.0"
] | 1 | 2018-06-28T21:43:38.000Z | 2018-06-28T21:43:38.000Z | docs/generate_docs.py | PeggyYuchunWang/deeplearning4j | e739fe6c15267be74f8021795e9866b929234d4b | [
"Apache-2.0"
] | null | null | null | docs/generate_docs.py | PeggyYuchunWang/deeplearning4j | e739fe6c15267be74f8021795e9866b929234d4b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import os
import shutil
import json
import argparse
class DocumentationGenerator:
def __init__(self, args):
self.template_dir = args.templates
self.target_dir = args.sources
self.project_name = args.project + '/'
self.language = args.language
... | 41.073482 | 119 | 0.596375 |
aed728559bd8cb9a9f6d73db612b201fc134e4ab | 332 | py | Python | scripts/hello_world_maximus12793.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_maximus12793.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_maximus12793.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | # AUTHOR: Max R.
# LANGUAGE: Python
# GITHUB: https://github.com/maximus12793
def main():
table = ['d', 'e', 'h', 'l', 'o', 'r', 'w']
h = table[2] + table[1] + table[3] + table[3] + table[4]
w = table[-1] + table[-3] + table[-2] + table[-4] + table[0]
print ' '.join([h, w])
if __name__ == '__main__':... | 23.714286 | 64 | 0.512048 |
aefdee1972b963005d7016eec06bf347739d74a6 | 1,091 | py | Python | sketches/Fluffy_Fish/pipes.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/Fluffy_Fish/pipes.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/Fluffy_Fish/pipes.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class Pipe():
def __init__(self):
self.top = random(height) - 60
if self.top < 60:
self.top = 60
if self.top > height - 180:
self.top = height - 180
self.bottom = height - self.top - 120
# self.bottom = random(height/2)
self.x = width
... | 27.974359 | 96 | 0.504125 |
4e0f9aba93a4d17514c022841077f3d529210320 | 614 | pyde | Python | sketches/wahlen/wahlen.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/wahlen/wahlen.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/wahlen/wahlen.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | import random as r
fps = 25
rep = 0
dem = 1
row = 10
col = 10
iconSize = 34
neighboorhood = []
def setup():
frameRate(fps)
size(row*iconSize, col*iconSize)
repIcon = loadImage("rep.png")
demIcon = loadImage("dem.png")
i = 0
while (i < row):
j = 0
while (j < col):
rn... | 20.466667 | 54 | 0.485342 |
ae2aef5711636979de2ebca6b35d7d55e380ebec | 1,645 | py | Python | convnet.py | asfer/mnist_sandbox | 69be6d623e948afdf92a3ca4c7ce77f93eafc0a8 | [
"MIT"
] | null | null | null | convnet.py | asfer/mnist_sandbox | 69be6d623e948afdf92a3ca4c7ce77f93eafc0a8 | [
"MIT"
] | null | null | null | convnet.py | asfer/mnist_sandbox | 69be6d623e948afdf92a3ca4c7ce77f93eafc0a8 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from data import mnist
m = 60000
w0, h0, c0 = 28, 28, 1
X_train = mnist.train_data.astype(np.float32).reshape((m, w0, h0, c0))
# one hot encoding
Y_train = np.eye(10)[mnist.train_labels[:, 0]]
Y_train = Y_train.astype(np.float32)
X = tf.placeholder(tf.float32, shape=(m, ... | 33.571429 | 92 | 0.674772 |
88166720fdbacdc1f81f2fd93a9dee4847f07d63 | 5,767 | py | Python | shinrl/__init__.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/__init__.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/__init__.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | from gym.envs.registration import register # NOQA isort:skip
# Common mathmetical (jitted) functions & classes.
from ._calc.backup_dp import calc_optimal_q # NOQA isort:skip
from ._calc.backup_dp import calc_q # NOQA isort:skip
from ._calc.backup_dp import calc_return # NOQA isort:skip
from ._calc.backup_dp import... | 37.448052 | 88 | 0.764696 |
8891713c332131fadc9764e716fff78f569ec3e6 | 8,231 | py | Python | kts/api/decorators.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/api/decorators.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/api/decorators.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | from typing import Union
from warnings import warn
from IPython.display import display
from kts.api.helper import Helper
from kts.core.backend.run_manager import run_manager, run_cache
from kts.core.feature_constructor.base import BaseFeatureConstructor
from kts.core.feature_constructor.generic import GenericFeatureC... | 34.153527 | 118 | 0.632973 |
ee1b8a8aec1951e2bfdd51c74f5fae129916514b | 162 | py | Python | synchroload/plugins/vimeo.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 3 | 2020-07-08T08:58:46.000Z | 2020-12-01T20:23:30.000Z | synchroload/plugins/vimeo.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 1 | 2020-12-30T12:49:43.000Z | 2021-01-04T11:05:48.000Z | synchroload/plugins/vimeo.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 2 | 2018-06-21T17:45:11.000Z | 2020-12-30T00:30:45.000Z | HOSTER_NAME = "vimeo"
HOSTER_HAS_DIRECT_LINKS = False
HOSTER_KEEP_UNAVAILABLE_UPLOADS = False
def linkFromId(videoId):
return "https://vimeo.com/" + videoId
| 23.142857 | 41 | 0.777778 |
c9c10da47c89069f495366cefa41240d9b25f0ec | 1,128 | py | Python | 数据结构/NowCode/26_HasSubtree.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | null | null | null | 数据结构/NowCode/26_HasSubtree.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 3 | 2020-08-14T07:50:27.000Z | 2020-08-14T08:51:06.000Z | 数据结构/NowCode/26_HasSubtree.py | Blankwhiter/LearningNotes | 83e570bf386a8e2b5aa699c3d38b83e5dcdd9cb0 | [
"MIT"
] | 2 | 2021-03-14T05:58:45.000Z | 2021-08-29T17:25:52.000Z | class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def HasSubtree(self, pRoot1, pRoot2):
if pRoot1 == None or pRoot2 == None:
return None
def hasEqual(pRoot1, pRoot2):
if pRoot2 == None:
... | 30.486486 | 69 | 0.490248 |
14ec738a43ddf31962406e7ed662bf15a1dd73a2 | 2,476 | py | Python | Packs/FiltersAndTransformers/Scripts/MapRangeValues/MapRangeValues.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/FiltersAndTransformers/Scripts/MapRangeValues/MapRangeValues.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/FiltersAndTransformers/Scripts/MapRangeValues/MapRangeValues.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from CommonServerPython import *
import demistomock as demisto
from typing import Union, List, Text
VALUE_TYPE = Union[Text, int]
class Replace(object):
def __init__(self, value: Text, replacement: Text):
self._value = self.get_typed_value(value)
self.replacement = self.get_typed_value(replacem... | 32.155844 | 100 | 0.651858 |
095691905a507667e1b4dc90c6a28c58d0ba8057 | 277 | py | Python | pi/setup.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 4 | 2018-11-14T12:03:05.000Z | 2019-09-03T14:33:28.000Z | pi/setup.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | null | null | null | pi/setup.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 1 | 2018-11-17T14:39:22.000Z | 2018-11-17T14:39:22.000Z | #!/usr/bin/env python3
from distutils.core import setup
import os
os.system("make ")
setup(name='pi',
version='1.0',
description='pi digits compute',
author='mathm',
author_email='mingtinglai@58.com',
url="https://igit.58corp.com/mingtinglai/pi",
)
| 18.466667 | 49 | 0.66065 |
11763b2f50c43d222e7f5040a0c7bf92646e84a3 | 352 | py | Python | packages/watchmen-utilities/src/watchmen_utilities/string_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-utilities/src/watchmen_utilities/string_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-utilities/src/watchmen_utilities/string_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from decimal import Decimal
from typing import Optional, Union
def is_blank(text: Optional[Union[str, int, float, Decimal]]) -> bool:
if text is None:
return True
text = str(text)
if len(text) == 0:
return True
if len(text.strip()) == 0:
return True
return False
def is_not_blank(text: Optional[str]) -> b... | 19.555556 | 70 | 0.701705 |
09cad39af8e70d4a95be819fd25a322f363fd1d2 | 3,045 | py | Python | Webpage/cruises/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/cruises/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/cruises/models.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from pprint import pprint
from django.utils.translation import gettext_lazy as _
from django.db import models
# Create your models here.
import datetime
from django.contrib.auth.models import User
class patent(models.Model):
SKIPPER = 'S'
WATCH = 'W'
CREW = 'C'
PATENT_TYPE = [
(SKIPPER, 'Schif... | 30.757576 | 120 | 0.656158 |
28aba66ead2acbeb7cc38c2005b7693e9e09c8c2 | 421 | py | Python | Lab2/task[13-15].py | ValeriyMartsyshyn/HelloPython | badcf85bc54e889eed0286b420e5cabe68da8572 | [
"MIT"
] | null | null | null | Lab2/task[13-15].py | ValeriyMartsyshyn/HelloPython | badcf85bc54e889eed0286b420e5cabe68da8572 | [
"MIT"
] | null | null | null | Lab2/task[13-15].py | ValeriyMartsyshyn/HelloPython | badcf85bc54e889eed0286b420e5cabe68da8572 | [
"MIT"
] | null | null | null | #task 13
alist= ["q", "", "w", "e", ""]
a=[]
for string in alist:
if (string!=""):
a.append(string)
print(a)
#task 14
n=int(input())
def sumDigits(n):
sum=0
while(n!=0):
sum=sum+int(n%10)
n=int(n/10)
return sum
print(sumDigits(n))
#task 15
def is_sorted(mylist):
return my... | 14.517241 | 33 | 0.584323 |
3aa4857f5a7e8799f90f6d9d4482ca09e0b66188 | 7,848 | py | Python | test/test_npu/test_network_ops/test_format_cast.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_format_cast.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_format_cast.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... | 44.338983 | 99 | 0.68871 |
c92077f24a47287f5aadaad330b0be71a25f277a | 668 | py | Python | noc/e_1_7_motion_101_velocity/walker.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | noc/e_1_7_motion_101_velocity/walker.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | noc/e_1_7_motion_101_velocity/walker.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class Walker:
def __init__(self):
self.location = PVector(100, 100)
self.velocity = PVector(2.5, 5)
self.d = 20
def update(self):
self.location.add(self.velocity)
def checkEdges(self):
if (self.location.x > width):
self.location.x = 0
... | 25.692308 | 56 | 0.520958 |
a31a5b8638405d472a9a73b22cbfa8a94f57484e | 5,832 | py | Python | scripts/signal_marker_processing/main.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/signal_marker_processing/main.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/signal_marker_processing/main.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
__title__ = "CbM"
__author__ = ["Daniele Borio"]
__copyright__ = "Cop... | 32.581006 | 123 | 0.641632 |
6e81f4a36b1800837a174fb037a709f5fc4c618f | 754 | py | Python | contest_server/setup.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/setup.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/setup.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pjkiserver",
version="0.1.0",
author="2020 AOT PJKI Course @ TU Berlin",
author_email="winkels@campus.tu-berlin.de",
description="Gameserver for the 2020 AOT AI Tournament at TU Berlin",
long_description=l... | 23.5625 | 70 | 0.702918 |
95afe974b29c71f12a7d055df9574ecc2003a6b3 | 2,645 | py | Python | frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/quotes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/quotes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/setup/doctype/email_digest/quotes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
def get_random_quote():
quotes = [
("Start by doing what's necessary; then do what's possible; and suddenly you are doing the impossible.", "Francis of Assisi"),
("The best and most beautiful things in the world cannot be seen or even t... | 73.472222 | 230 | 0.710775 |
c2884fa99116969e01596ce0d98d201fad2345a6 | 207 | py | Python | data_tests/exterior_import_boost.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/exterior_import_boost.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/exterior_import_boost.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import gast
import numpy as np
from exterior_import_boost_2 import func_import_2
const = 1
foo = 1
def func_import():
return const + func_import_2() + np.pi - np.pi
def use_gast():
print(gast)
| 12.9375 | 50 | 0.710145 |
66cc8acfc34821d27d34aa5f48c77408bcc7bd80 | 6,936 | py | Python | sample/rpz-sensor/python3/bme280i2c.py | yappy/RpzIrSensor | 8ff11ad594e81380975ff84e2394ff0834d380cf | [
"MIT"
] | null | null | null | sample/rpz-sensor/python3/bme280i2c.py | yappy/RpzIrSensor | 8ff11ad594e81380975ff84e2394ff0834d380cf | [
"MIT"
] | null | null | null | sample/rpz-sensor/python3/bme280i2c.py | yappy/RpzIrSensor | 8ff11ad594e81380975ff84e2394ff0834d380cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
BME280 Control Module via I2C
2019/11/30
"""
import smbus
import time
class BME280I2C:
# Return signed int from 16bit uint
@staticmethod
def get_signed8(uint):
if uint>127:
return uint-256
return uint
# Return signed int from 16bit uint
@st... | 35.569231 | 91 | 0.568051 |
b014367a2ca8553425de242e8392bed22125f65c | 281 | py | Python | 2_Iterables/Tuples/named_tuple.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 2_Iterables/Tuples/named_tuple.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 2_Iterables/Tuples/named_tuple.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | from collections import namedtuple
User = namedtuple('User', ['firstname', 'lastname', 'birthday'])
user_peter = User(firstname='Peter',lastname='Heinrich', birthday='30.01.1980')
print(user_peter)
print(user_peter.firstname)
print(user_peter.lastname)
print(user_peter.birthday) | 31.222222 | 79 | 0.779359 |
b042ab9aa3b1a1ffffdd4faa60404ddb9368cc54 | 3,241 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/05_textformatierung_in_zellen/05_textformatierung_in_zellen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/05_textformatierung_in_zellen/05_textformatierung_in_zellen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/05_textformatierung_in_zellen/05_textformatierung_in_zellen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 05_textformatierung_in_zellen.py
# In diesem Beispielscript geht es darum die Formatierung der Zellen zu beeinflussen
# Aus textfile.txt wird gezählt welche wörter wie oft vorkommen um diese dann entsprechend
# ihrer Anzahl in anderer Schriftart/-grösse darzustellen
import openpyxl, os
from openpyxl.styles import Fo... | 41.551282 | 127 | 0.7473 |
05e80bb8493f3e18eae205d5c08d16f8e69524c8 | 481 | py | Python | dashboard/app.py | manojpandey/abtest-hack | def6b7d756e880d5833acb8d95625ecdea05f0f0 | [
"MIT"
] | null | null | null | dashboard/app.py | manojpandey/abtest-hack | def6b7d756e880d5833acb8d95625ecdea05f0f0 | [
"MIT"
] | null | null | null | dashboard/app.py | manojpandey/abtest-hack | def6b7d756e880d5833acb8d95625ecdea05f0f0 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
import os
app = Flask(__name__)
@app.route('/')
def main():
return render_template('index.html')
@app.route('/chart')
def chart():
return render_template('file.html')
@app.route('/pie')
def pie():
return render_template('pie.html')
if __name__ == '__main... | 22.904762 | 58 | 0.656965 |
a54093293e2436434cfbfa7c4f4c7eae929342e3 | 2,215 | py | Python | fileOperate/views.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | 8 | 2020-07-11T14:11:11.000Z | 2022-01-27T05:06:07.000Z | fileOperate/views.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | null | null | null | fileOperate/views.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | 4 | 2020-07-11T14:11:17.000Z | 2022-01-27T05:06:11.000Z | import coloredlogs
import logging
import os
from django.shortcuts import render
from django.views.decorators.http import require_GET, require_POST
from django.http import HttpResponse
from django.conf import settings
from django.core.files import File
from .utils import get_FileSize, get_ip
SAVED_FILES_DIR = setting... | 30.342466 | 90 | 0.674944 |
a5af6de5154ccb7c5b2db1265335915828fcb50d | 4,952 | py | Python | servers/docker-python/spider_app.py | veaba/ncov | 6019f6b90761fd39363f8a7182ffcee22b9cb7ed | [
"MIT"
] | 288 | 2020-01-21T06:12:03.000Z | 2022-01-16T08:03:13.000Z | servers/docker-python/spider_app.py | kayan12/ncov | 90f828208d1eea7cc20e933da41638f328e0411d | [
"MIT"
] | 26 | 2020-01-20T05:07:31.000Z | 2022-03-12T00:24:56.000Z | servers/docker-python/spider_app.py | kayan12/ncov | 90f828208d1eea7cc20e933da41638f328e0411d | [
"MIT"
] | 48 | 2020-01-22T09:05:59.000Z | 2022-01-16T08:03:11.000Z | # todo爬取关于疫情的微博
# todo 权威媒体:央视微博、人民日报、环球网、澎湃新闻
# todo 省市级 建委:
import re
import time
from selenium import webdriver
from config import CCTV_WEB_URL, CCTV_M_WEIBO_URL
from mongo import update_news, fond_one
from utils import parser_weibo_time
import threading
import platform
def spider_cctv_web_single(page):
page_u... | 35.371429 | 97 | 0.596931 |
3c4bdafc4b99efcce196eb16153d2637cb423120 | 200 | py | Python | Python/zzz_training_challenge/UdemyPythonPro/Chapter13_C_Python_Numba/1_numba/setup.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | 4 | 2020-12-28T23:43:35.000Z | 2022-01-01T18:34:18.000Z | Python/zzz_training_challenge/UdemyPythonPro/Chapter13_C_Python_Numba/1_numba/setup.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/UdemyPythonPro/Chapter13_C_Python_Numba/1_numba/setup.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | 9 | 2020-09-26T19:29:28.000Z | 2022-02-07T06:41:00.000Z | from distutils.core import setup
from math_numba import cc
setup(name="math_numba",
version="1.0.0",
description="Numba module in Python",
ext_modules=[cc.distutils_extension()])
| 20 | 45 | 0.705 |
599d5345526c1abae5176ca5fa62eb8d7cdadd17 | 1,328 | py | Python | PMIa/2014/VINOGRADOVA_J_S/task_6_48.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/VINOGRADOVA_J_S/task_6_48.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/VINOGRADOVA_J_S/task_6_48.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 48.
# Создайте игру, в которой компьютер загадывает название одной из двадцати
# башен Московского кремля, а игрок должен его угадать.
# Vinogradova J.
# 31.03.2016
import random
name = random.randint(1,12)
if name == 1 :
name = 'Беклемишевская'
elif name == 2 :
name = ... | 22.508475 | 75 | 0.588855 |
59b3c2dfbde26edba15d5d671d5427294efcc4cd | 365 | py | Python | code/ZipEnumerate.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/ZipEnumerate.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/ZipEnumerate.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | list_a = [10, 20, 30]
list_b = ["Jan", "Peter", "Max"]
list_c = [True, False, True]
# zip (Voraussetzung: gleiche Länge der Listen)
# Ausgabe: Wert
for a, b, c in zip(list_a, list_b, list_c):
print(a, b, c)
# Ausgabe: index und Wert
for i in range(len(list_a)):
val = list_a[i]
print(i, val)
# besser
for i,... | 22.8125 | 47 | 0.630137 |
5537e12258008888e3c341502fb3ce5e7da41729 | 138 | py | Python | LIT/2021/rev/shuffle/shuffle.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | LIT/2021/rev/shuffle/shuffle.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | LIT/2021/rev/shuffle/shuffle.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import random
f = open("flag.txt", "r").read()
random.seed(random.randint(0, 1000))
l = list(f[:-1])
random.shuffle(l)
print(''.join(l))
| 17.25 | 36 | 0.637681 |
555e108e01ddc142519df27658ed65a550a62a71 | 312 | py | Python | zencad/examples/1.GeomPrim/2.prim2d/widewire.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/1.GeomPrim/2.prim2d/widewire.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/1.GeomPrim/2.prim2d/widewire.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: widewire
"""
from zencad import *
wr = wire_builder()
wr.line(10,10)
wr.line(20,20)
wr.line(30,0)
wr.interpolate([
[40, -20],
[30, -40]
])
wr.interpolate([
[50, -60],
[60, -110]
])
w = widewire(wr.doit(), 5)
disp(wr.doit(), zencad.color.red)
disp(w)
show()
| 12 | 33 | 0.612179 |
f9406efd585a9897a8659e857076495f0632075f | 3,653 | py | Python | WiSe-2122/Uebung-11/Gruppe-B/U11-A2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Uebung-11/Gruppe-B/U11-A2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Uebung-11/Gruppe-B/U11-A2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Entwickeln Sie eine Version von Hangman in Python. Hierbei soll randomisiert aus einer Liste von Ihnen
# vorgegebener Wörter eines ausgewählt und dem Nutzer zugewiesen werden. Dieser rät dann einzelne Buchstaben.
# Ist der Buchstabe korrekt, wird dieser in der nächsten Ausgabe an der richtigen Stelle angezeigt. Ist e... | 43.488095 | 160 | 0.708185 |
f96c1475523dd3305a7164a487c87511a2642818 | 350 | py | Python | pyconuk/migrations/0002_delete_newsitem.py | PyconUK/2017.pyconuk.org | 337a00c034a15e5b41a8ea8683dd44310e14fb9c | [
"MIT"
] | 3 | 2017-10-24T13:33:29.000Z | 2017-10-30T10:47:28.000Z | pyconuk/migrations/0002_delete_newsitem.py | PyconUK/2017.pyconuk.org | 337a00c034a15e5b41a8ea8683dd44310e14fb9c | [
"MIT"
] | 78 | 2017-02-14T16:49:58.000Z | 2018-04-19T06:28:42.000Z | pyconuk/migrations/0002_delete_newsitem.py | PyconUK/2017.pyconuk.org | 337a00c034a15e5b41a8ea8683dd44310e14fb9c | [
"MIT"
] | 36 | 2017-06-19T07:48:38.000Z | 2018-01-19T11:08:10.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-08-07 06:28
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pyconuk', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name... | 18.421053 | 47 | 0.614286 |
95127f6da456a4fc579fc6ef867e521da137f573 | 528 | py | Python | tests/test_p_12_caesar_verschluesselung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tests/test_p_12_caesar_verschluesselung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tests/test_p_12_caesar_verschluesselung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
Teste die Cäsar-Verschlüsselungsfunktion.
"""
import pytest
from tag_3.p_12_caesar_verschluesselung import caesar
@pytest.mark.parametrize('wort, k, resultat',
[('Caesar', 3, 'fdhvdu'),
('HAL', 1, 'ibm'),
('Shrdlu', 13, 'fueqyh'),
... | 29.333333 | 55 | 0.477273 |
1f8bb445dacd4288a855a76fe7c10e3398eb5b1f | 4,419 | py | Python | Python/checkmail2.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/checkmail2.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/checkmail2.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import email
import imaplib
import urllib
import requests
import time
import os
from os.path import expanduser
from time import gmtime, strftime
HOME = expanduser("~")
logtime = time.strftime('%d.%m.%Y - %H:%M:%S')
logmessage = logti... | 38.426087 | 117 | 0.490609 |
7b1856b1251475a71a111dffb859c7def19ad6d9 | 171 | py | Python | WD/Cwiczenia/WykorzystanieObliczenia.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | 1 | 2020-02-29T14:38:33.000Z | 2020-02-29T14:38:33.000Z | WD/Cwiczenia/WykorzystanieObliczenia.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | WD/Cwiczenia/WykorzystanieObliczenia.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | from obliczenia import wielokrotnosc4 as w4
from obliczenia import wyswietlJakoListe as wL
print(w4.wielokrotnosc4(3))
wL.wyswietlJakoListe(1,'jablko','banany',2)
| 24.428571 | 47 | 0.783626 |
7bb10a7b543b3a98653ff5a96a2be43a2ac25689 | 328 | py | Python | asyncio_demos/gather.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | asyncio_demos/gather.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | asyncio_demos/gather.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | import asyncio
async def greeting(delay=0.0):
await asyncio.sleep(delay)
print(f"hey little hollywood:{delay}")
async def main():
r = asyncio.gather(*[greeting(i) for i in range(5)])
print("THER SHOW MUST GO ON")
await asyncio.sleep(10)
await r
if __name__ == "__main__":
asyncio.run(ma... | 17.263158 | 56 | 0.646341 |
c8a24c6f54abf7291c954f3963ef4ed291786377 | 246 | py | Python | src/utils/constant.py | AakashMallik/cnn-firefly | 6c8ed58a035e62682263753436b124cb979ed240 | [
"MIT"
] | null | null | null | src/utils/constant.py | AakashMallik/cnn-firefly | 6c8ed58a035e62682263753436b124cb979ed240 | [
"MIT"
] | 7 | 2020-11-27T12:24:31.000Z | 2020-11-29T09:41:09.000Z | src/utils/constant.py | AakashMallik/cnn-firefly | 6c8ed58a035e62682263753436b124cb979ed240 | [
"MIT"
] | null | null | null | from enum import Enum
class PipelineType(Enum):
TRAIN = 1
TEST = 2
class PredictionType(Enum):
CLASSIFICATION = 1
REGRESSION = 2
class TuningType(Enum):
FINE_TUNING = 1
FEATURE_EXTRACTION = 2 | 18.923077 | 30 | 0.605691 |
74083c7baebaf69ab467a92424536e010c26c472 | 662 | py | Python | pacman-termux/test/pacman/tests/smoke003.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/smoke003.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/smoke003.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Remove a thousand packages in a single transaction"
for i in range(1000):
p = pmpkg("pkg%03dname" % i)
p.files = ["usr/share/pkg%03d/file" % i]
self.addpkg2db("local", p)
pkglist = ["pkg%03dname" % i for i in range(100, 1000)]
self.args = "-R %s" % " ".join(pkglist)
self.addrule("PACMAN_RETCOD... | 33.1 | 72 | 0.729607 |
b54e015b4167d9506a6b856c6b0bf092be1c31d3 | 4,228 | py | Python | Packs/SecureWorks/Integrations/TaegisXDR/TaegisXDR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SecureWorks/Integrations/TaegisXDR/TaegisXDR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SecureWorks/Integrations/TaegisXDR/TaegisXDR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from TaegisXDR import (
Client,
fetch_alerts_command,
fetch_investigation_command,
fetch_investigation_alerts_command,
create_investigation_command,
update_investigation_command,
)
TAEGIS_ALERT = {
"id": "c4f33b53-eaba-47ac-8272-199af0f7935b",
"description": "Test Alert",
"message":... | 22.489362 | 87 | 0.626301 |
938d4c1d89c7730f5181fc44864537a1b0f0dc1c | 1,282 | py | Python | official/nlp/pangu_alpha/serving_increment/pangu_distributed/serving_server.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/pangu_alpha/serving_increment/pangu_distributed/serving_server.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/pangu_alpha/serving_increment/pangu_distributed/serving_server.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... | 38.848485 | 99 | 0.696568 |
93942728d031043c8608ee93d098ed6cb0002763 | 157 | py | Python | chapter_eleven/keep_it_simple_with_piping/input.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 21 | 2021-09-10T12:46:26.000Z | 2022-03-23T02:50:39.000Z | chapter_eleven/keep_it_simple_with_piping/input.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | null | null | null | chapter_eleven/keep_it_simple_with_piping/input.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 6 | 2021-09-02T08:32:37.000Z | 2022-03-17T21:15:25.000Z | import sys
sys.stdout.write("5\n")
sys.stdout.write("6\n")
sys.stdout.write("7\n")
sys.stdout.write("8\n")
sys.stdout.write("9\n")
sys.stdout.write("10\n")
| 17.444444 | 24 | 0.675159 |
f53f31dca47c42113185eb388fda70d24172e447 | 146 | py | Python | 3.Python/Manueljohnson.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | 8 | 2020-10-01T14:15:53.000Z | 2021-10-03T06:10:03.000Z | 3.Python/Manueljohnson.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | null | null | null | 3.Python/Manueljohnson.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | 29 | 2020-10-02T14:24:53.000Z | 2020-10-12T10:52:31.000Z | name, age = "MANUEL JOHNSON", 19
username = "Manueljohnson"
print ('Hello!')
print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
| 29.2 | 68 | 0.657534 |
190fe3b587ff5df05e54a6a1ac787adc32b9625f | 115 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.03-set/ph-30-convert-list-or-tuple-to-set.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.03-set/ph-30-convert-list-or-tuple-to-set.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.03-set/ph-30-convert-list-or-tuple-to-set.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | li = [1, 2, 3, 4, 5]
tpl = (1, 2, 3, 4)
A = set(li)
print(A, "\n", type(A))
B = set(tpl)
print(B, '\n', type(B))
| 12.777778 | 23 | 0.443478 |
fd7f7c4652ba22f842b04e95a567ad21472df8e7 | 1,187 | py | Python | beispielanwendungen/hellogl/hellogl.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/hellogl/hellogl.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/hellogl/hellogl.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
import sys, numpy
from PyQt4 import QtCore, QtGui, QtOpenGL
from OpenGL.GL import *
def main(argv):
app = QtGui.QApplication(argv)
mainwindow = MainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MainWindow(QtOpenGL.QGLWidget):
def __init__(self, *args):
Qt... | 25.255319 | 78 | 0.603201 |
e3289ce69f53eb3024f0bc5bd5361f8912b1db42 | 2,620 | py | Python | examples/seq2seq/att_all_need/Layers.py | yym6472/transformers | abd01205561e5caec167c1fbb20bccea24d7ba46 | [
"Apache-2.0"
] | 1 | 2021-12-30T05:41:37.000Z | 2021-12-30T05:41:37.000Z | examples/seq2seq/att_all_need/Layers.py | yym6472/transformers | abd01205561e5caec167c1fbb20bccea24d7ba46 | [
"Apache-2.0"
] | null | null | null | examples/seq2seq/att_all_need/Layers.py | yym6472/transformers | abd01205561e5caec167c1fbb20bccea24d7ba46 | [
"Apache-2.0"
] | null | null | null | ''' Define the Layers '''
import torch.nn as nn
import torch
from att_all_need.SubLayers import MultiHeadAttention, PositionwiseFeedForward, MultiHeadAttention_extra_mask
__author__ = "Yu-Hsiang Huang"
class EncoderLayer(nn.Module):
''' Compose with two layers '''
def __init__(self, d_model, d_inner, n_hea... | 51.372549 | 109 | 0.727863 |
47fab90a5d4307b1fb4d5d1b4565f0393a2140e2 | 4,516 | py | Python | code/tests/test_abstractchain.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_abstractchain.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_abstractchain.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | 1 | 2019-06-05T09:10:30.000Z | 2019-06-05T09:10:30.000Z | import unittest
from chain import Block
from strategy import BlockOrigin
from bitcoin.core import CBlockHeader
from bitcoin.core import CBlock
import test_util
class AbstractChainTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(AbstractChainTest, self).__init__(*args, **kwargs)
... | 47.536842 | 75 | 0.736935 |
efe85a89f7d3eaad0c68b92d6c61937f64dc5c29 | 3,905 | py | Python | tools/pollers/lraEbeArcgisImpfungenNachEinrichtung.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 10 | 2021-01-28T21:43:22.000Z | 2022-01-15T16:50:34.000Z | tools/pollers/lraEbeArcgisImpfungenNachEinrichtung.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 7 | 2021-06-10T07:19:21.000Z | 2022-03-22T15:11:17.000Z | tools/pollers/lraEbeArcgisImpfungenNachEinrichtung.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 5 | 2021-01-29T14:14:45.000Z | 2022-01-09T15:37:36.000Z | from typing import Dict, List, Optional
from arcgis.features import FeatureLayer
from arcgis.features.feature import Feature
from datetime import datetime
import itertools
import os
import time
import pollers.poller
class Poller(pollers.poller.Poller):
def run(self):
layer = FeatureLayer("https://services-eu1.a... | 35.18018 | 151 | 0.714469 |
de7f9232c9caf163af60e1830db313669a4d64a9 | 3,065 | py | Python | source/pkgsrc/lang/python37/patches/patch-Lib___osx__support.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python37/patches/patch-Lib___osx__support.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python37/patches/patch-Lib___osx__support.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib___osx__support.py,v 1.1 2020/11/17 19:33:26 sjmulder Exp $
Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
https://github.com/python/cpython/pull/22855
--- Lib/_osx_support.py.orig 2020-08-15 05:20:16.000000000 +0000
+++ Lib/_osx_support.py
@@ -110,6 +110,25 @@ def _get_system... | 37.839506 | 86 | 0.639804 |
dfdd44aafa8ffb23514c1c5aa8efad6e6f7cc056 | 217 | py | Python | httpconnection.py | fundthmcalculus/reserautomation | 31fb18815885815dffbb775dd019e28f57ac9228 | [
"MIT"
] | null | null | null | httpconnection.py | fundthmcalculus/reserautomation | 31fb18815885815dffbb775dd019e28f57ac9228 | [
"MIT"
] | null | null | null | httpconnection.py | fundthmcalculus/reserautomation | 31fb18815885815dffbb775dd019e28f57ac9228 | [
"MIT"
] | null | null | null | import requests
class HttpConnectionBase:
@staticmethod
def _handle_response(response: requests.Response) -> None:
if response.status_code >= 300:
raise RuntimeError(f"Error {response}")
| 24.111111 | 62 | 0.695853 |
5f21c9cd18f4a596dc8e04ed16ff5924cfc6eb66 | 1,242 | py | Python | frds/mktstructure/cmd_clean.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 1 | 2022-03-06T20:36:06.000Z | 2022-03-06T20:36:06.000Z | mktstructure/cmd_clean.py | mgao6767/mktstructure | 5432c1bed163f838209d34b74c09629bea620ba8 | [
"MIT"
] | null | null | null | mktstructure/cmd_clean.py | mgao6767/mktstructure | 5432c1bed163f838209d34b74c09629bea620ba8 | [
"MIT"
] | null | null | null | import argparse
import os
from datetime import datetime as dt
from .utils import _sort_and_rm_duplicates
def cmd_clean(args: argparse.Namespace):
# sort by time and remove duplicates
if args.all:
for root, _, files in os.walk(args.data_dir):
for f in files:
path = os.path... | 33.567568 | 86 | 0.518519 |
a07eca92580a9d1968f0f00bf52bd1d429adbbf1 | 2,526 | py | Python | Packs/GoogleChronicleBackstory/Scripts/ChronicleDomainIntelligenceSourcesWidgetScript/ChronicleDomainIntelligenceSourcesWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleDomainIntelligenceSourcesWidgetScript/ChronicleDomainIntelligenceSourcesWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleChronicleBackstory/Scripts/ChronicleDomainIntelligenceSourcesWidgetScript/ChronicleDomainIntelligenceSourcesWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from unittest.mock import patch
import ChronicleDomainIntelligenceSourcesWidgetScript
import demistomock as demisto
INCIDENT_DETAILS = [{'details': {"Artifact": "e9428.b.akamaiedge.net", "IocIngestTime": "2020-07-17T20:00:00Z",
"FirstAccessedTime": "2018-11-05T12:01:29Z",
... | 49.529412 | 120 | 0.649248 |
cd641b9d9d2f6c4f278b55b5325cf857f27538d3 | 497 | py | Python | source/pkgsrc/audio/py-mpd/patches/patch-mpd.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/audio/py-mpd/patches/patch-mpd.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/audio/py-mpd/patches/patch-mpd.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-mpd.py,v 1.1 2014/01/17 14:47:25 wiz Exp $
python-3.x compatibility.
--- mpd.py.orig 2010-12-14 00:46:05.000000000 +0000
+++ mpd.py
@@ -396,7 +396,7 @@ class MPDClient(object):
sock = socket.socket(af, socktype, proto)
sock.connect(sa)
return sock
- ... | 31.0625 | 58 | 0.529175 |
cd775e5ded3774842f8d1c40693e02f250c546cb | 2,040 | py | Python | src/main/python/start.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/start.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/start.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | import collections
from scipy.stats import norm
import matplotlib.pyplot as plt
import numpy as np
def readFile(file="input.txt"):
try:
f=open(file)
except:
print("file not found, in current directory.")
data=[]
for line in f:
line=f.readline()
line=line+" "... | 24 | 69 | 0.559314 |
26a3b72f079b31fab68d2424fd0178e4890f7543 | 1,473 | py | Python | ParsingAndScraping/kinopoisk/kinopoiskAPI.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T13:06:11.000Z | 2021-06-23T13:06:11.000Z | ParsingAndScraping/kinopoisk/kinopoiskAPI.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T21:21:52.000Z | 2021-06-23T21:21:52.000Z | ParsingAndScraping/kinopoisk/kinopoiskAPI.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T19:14:19.000Z | 2021-06-28T19:14:19.000Z | import requests
class KinopoiskAPIError(Exception):
pass
class KinopoiskAPI:
def __init__(self):
self.key = '8fcf6015-6f7e-408c-9ced-d7c67167b5a2'
self.domen = 'https://kinopoiskapiunofficial.tech'
self.headersAPI = {
'X-API-KEY': '8fcf6015-6f7e-408c-9ced-d7c67167b5a2'
... | 31.340426 | 85 | 0.596741 |
f81abada5d2f080089ce1fcff2bf4a2c0e5fb5b3 | 311,728 | py | Python | style-Termux-main/Termux.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | style-Termux-main/Termux.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | style-Termux-main/Termux.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # coding=utf-8
# Obfuscate BY Aldi Bachtiar Rifa
Aldi=['00000000000000000000000000000000000', '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 11,545.481481 | 311,597 | 0.951682 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.