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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9079f5850aff6aa35612f5291d6ad89d7c8e00dd | 4,083 | py | Python | 20-fs-ias-lec/groups/11-sensUI/sensui/ViewWidget.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/11-sensUI/sensui/ViewWidget.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/11-sensUI/sensui/ViewWidget.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import pyqtgraph as pg
from View import View
from DateAxisItem import DateAxisItem
class ViewWidget (pg.PlotWidget):
def __init__(self, view):
super().__init__()
self.__view = view
'''
data = [
0:Left Y-Axis
1:Right Y-Axis
{
... | 36.132743 | 104 | 0.606417 |
31a0700960592083733212246d34a917a1712124 | 1,763 | py | Python | bets/admin.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/admin.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/admin.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import ChoiceBet, Choice, PlacedChoiceBet, DateBet, PlacedDateBet
class ChoiceInLine(admin.TabularInline):
model = Choice
extra = 2
class ChoiceBetAdmin(admin.ModelAdmin):
fieldsets = [
('General', {'fields': ['name', 'description', 'account']}),
... | 29.881356 | 78 | 0.613159 |
7353fb8f826e769c1dbd3fac4afb246f8503579e | 3,585 | py | Python | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-3_vectorize_with_tf_idf-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-3_vectorize_with_tf_idf-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-3_vectorize_with_tf_idf-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pnlp-4_english-3_vectorize_with_tf_idf-refactored.py
pnlp-4_text_classification-english_sentiment_analysis-...
This is a refactorized version.
There're some minor changes in the variable names and so on.
Source: Python Natural Language Processing
Advanced machine learning and deep... | 31.725664 | 130 | 0.683682 |
b410fb7c229cc720134d59875e50f6100405ada3 | 254 | py | Python | src/onegov/file/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.file.models.file import File, SearchableFile
from onegov.file.models.fileset import FileSet
from onegov.file.models.associated_files import AssociatedFiles
__all__ = (
'AssociatedFiles',
'File',
'FileSet',
'SearchableFile'
)
| 23.090909 | 63 | 0.755906 |
b46c31b30162128ea9297f7fbe2a55d26e16af18 | 253 | py | Python | python_experiments/data_analysis/util/get_configurations.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/util/get_configurations.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/util/get_configurations.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | from config import *
def get_config_dict_via_hostname(hostname):
if hostname.startswith('lccpu12'):
config_tag = lccpu12_tag
else:
config_tag = None
config_dict = get_config_dict(config_tag, '../..')
return config_dict
| 23 | 54 | 0.687747 |
c4cee0447258bc703426ee82f3b2b6277ef9f619 | 4,270 | py | Python | tests/testVersion.py | HazelTheWitch/SemVer | 3ca3663990b1e0451b9eab25d411a68d50c90554 | [
"MIT"
] | null | null | null | tests/testVersion.py | HazelTheWitch/SemVer | 3ca3663990b1e0451b9eab25d411a68d50c90554 | [
"MIT"
] | null | null | null | tests/testVersion.py | HazelTheWitch/SemVer | 3ca3663990b1e0451b9eab25d411a68d50c90554 | [
"MIT"
] | null | null | null | import unittest
from src.semver import *
class TestInit(unittest.TestCase):
def test_valid(self):
Version(1, 0, 0)
Version(1, 2, 0)
Version(1, 2, 3)
Version(1, 2, 3, 'pre1')
def test_negativeMajor(self):
with self.assertRaises(ValueError) as ve:
Version(-1... | 27.908497 | 78 | 0.589461 |
4823260873ca9a25ed781cf76a568b5586cfca26 | 3,477 | py | Python | haas_lib_bundles/python/docs/examples/hcho_detector/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/hcho_detector/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/hcho_detector/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件
import network # Wi-Fi功能所在库
import utime # 延时API所在组件
import ujson # json字串解析库
from driver import ADC # ADC类,通过微处理器的ADC模块读取ADC通道输入电压
import hcho # 甲醛h... | 25.379562 | 92 | 0.621513 |
487365459605977b3a5e65308b4ac294f3c44750 | 3,173 | py | Python | site/public/courses/CS-1.1/Projects/Spaceman/spaceman.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.1/Projects/Spaceman/spaceman.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.1/Projects/Spaceman/spaceman.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | import random
def load_word():
'''
A function that reads a text file of words and randomly selects one to use as the secret word
from the list.
Returns:
string: The secret word to be used in the spaceman guessing game
'''
f = open('words.txt', 'r')
words_list = f... | 32.71134 | 258 | 0.682635 |
d22ae806f57187230cb15bb59d041afa8c647dac | 857 | py | Python | _Dist/NeuralNetworks/_Tests/SVM/TestSVM.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/NeuralNetworks/_Tests/SVM/TestSVM.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/NeuralNetworks/_Tests/SVM/TestSVM.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
root_path = os.path.abspath("../../../../")
if root_path not in sys.path:
sys.path.append(root_path)
from copy import deepcopy
from Util.Util import DataUtil
from _Dist.NeuralNetworks._Tests.TestUtil import draw_acc
from _Dist.NeuralNetworks.b_TraditionalML.SVM import SVM
from _Dist.NeuralNet... | 40.809524 | 113 | 0.756126 |
d261aa9e02a16b0f7fa06e693093c534378e46a3 | 3,671 | py | Python | NaiveBayes/src/utils.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2018-04-25T18:00:28.000Z | 2018-08-08T09:39:18.000Z | NaiveBayes/src/utils.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | null | null | null | NaiveBayes/src/utils.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2019-03-03T02:55:48.000Z | 2021-01-21T04:50:46.000Z | # Conventional Machine Learning Algorithms
# Helper functions for Class of "NaiveBayes".
# Author: Qixun Qu
# Create on: 2018/04/25
# Modify on: 2018/04/25
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$... | 27.395522 | 72 | 0.583492 |
963f756690f1a70da2091f9f711d259e95f37492 | 6,058 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/models/bmn_infer.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/models/bmn_infer.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/models/bmn_infer.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.000Z | """
ppTSM InferModel
"""
import sys
import numpy as np
import json
import pickle
import time
sys.path.append('../')
from utils.preprocess import get_images
from utils.config_utils import parse_config
from utils.process_result import process_proposal
import reader
from paddle.inference import Config
from paddle.infere... | 38.585987 | 109 | 0.618686 |
73f39ea1196b9eaad321d060f7c1531936cd8c11 | 234 | py | Python | 1588-sum-of-all-odd-length-subarrays/1588-sum-of-all-odd-length-subarrays.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1588-sum-of-all-odd-length-subarrays/1588-sum-of-all-odd-length-subarrays.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1588-sum-of-all-odd-length-subarrays/1588-sum-of-all-odd-length-subarrays.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def sumOddLengthSubarrays(self, arr: List[int]) -> int:
result=0
N = len(arr)
for i, val in enumerate(arr):
result+=int(((i+1)*(N-i)+((i+1)%2)*(N%2))/2)*val
return result | 33.428571 | 60 | 0.525641 |
7923f43debee9f91bf49587c11d167d8d1fb01e4 | 6,046 | py | Python | methods/t5/predict.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/t5/predict.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/t5/predict.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | import torch
import csv
import argparse
from trainer import *
from tqdm import tqdm
import random
import numpy as np
import os
import re
import glob
from transformers import (
AdamW,
T5ForConditionalGeneration,
T5Tokenizer,
get_linear_schedule_with_warmup,
AutoTokenizer
)
from datas... | 40.851351 | 134 | 0.644724 |
e39b6ab02148742e1e6cf4cd99b79bae33d5e553 | 1,816 | py | Python | python/asyncio/example_8.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/example_8.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/example_8.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """
example_8.py
Just a short example demonstrating a simple state machine in Python
This versin is doing actual work, downloading the contents of
URL's it gets from a queue. This version uses the Twisted
framework to provide the concurrency
"""
from twisted.internet import defer
from twisted.web.client import getPag... | 22.987342 | 67 | 0.612335 |
e3dc790ff9ccf904fdb0118d33479772bc6fa6e9 | 113 | py | Python | examples/adminEx2/reverse_filter_query/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/adminEx2/reverse_filter_query/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/adminEx2/reverse_filter_query/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 ReverseFilterQueryConfig(AppConfig):
name = 'reverse_filter_query'
| 18.833333 | 42 | 0.80531 |
542654a49b5c46dd220ec06d634eb5732aac7a4d | 1,114 | py | Python | tests/cli/test_user.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | tests/cli/test_user.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | tests/cli/test_user.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from tests.utils import UtilActions
def test_delete_old_anonymous(app, db, utils: UtilActions):
now = utils.mock_now(2022, 3, 9)
with app.app_context():
from datetime import timedelta
from project.services.user import create_user, create_user_anonymous
normal_user = create_user("tes... | 34.8125 | 76 | 0.711849 |
5810cc07ea4cc226580421da57698be093c2ab77 | 1,420 | py | Python | solvemyproblem/tigeralgebra.py | sah-py/SolveMyProblem | e569027b6aae65a1b7a4d480633adbb32becb329 | [
"MIT"
] | null | null | null | solvemyproblem/tigeralgebra.py | sah-py/SolveMyProblem | e569027b6aae65a1b7a4d480633adbb32becb329 | [
"MIT"
] | null | null | null | solvemyproblem/tigeralgebra.py | sah-py/SolveMyProblem | e569027b6aae65a1b7a4d480633adbb32becb329 | [
"MIT"
] | 1 | 2020-03-07T22:03:13.000Z | 2020-03-07T22:03:13.000Z | import asyncio
import sys
from os import path
from arsenic import get_session, browsers, services, keys
class AsyncTigerAlgebra:
def __init__(self, loop=asyncio.get_event_loop()):
apath = path.dirname(path.dirname(__file__))
sys.path.append(path.abspath(apath))
self.bin = apa... | 33.809524 | 82 | 0.587324 |
589afaf1b66dc55c30e74ea1eaa0b92d3d8ca32c | 4,181 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/helloworld_pwm.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/helloworld_pwm.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/helloworld_pwm.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# HelloWorld, Marsyas!
# This is a HelloWorld tutorial in Marsyas - PWM version.
# It is the first part of the source-code python tutorial to marsyas.
# It should help the newbie user to understand the basic marsyas stuff.
#
#
# The following people have changed this text / source code:
# Tiago ... | 49.77381 | 131 | 0.757713 |
54c44f59e5829087f8296a8e523b2f5702035739 | 16,995 | py | Python | research/cv/centernet/src/decode.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/centernet/src/decode.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/centernet/src/decode.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.548387 | 117 | 0.569462 |
b753a4df68b3843bd81e4c765aaa0201155d19fc | 144 | py | Python | python/coursera_python/TORONTO/test/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/TORONTO/test/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/TORONTO/test/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def announce_location(country):
print(country)
return country
instructor_location = announce_location('Canada')
print(instructor_location)
| 16 | 49 | 0.819444 |
4d9dc4eda74cbce775268dda9eb3c3db48ef54c6 | 621 | py | Python | tools/pythonpkg/tests/fast/api/test_dbapi08.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/api/test_dbapi08.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/api/test_dbapi08.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | # test fetchdf with various types
import pandas
import numpy
class TestType(object):
def test_fetchdf(self, duckdb_cursor):
duckdb_cursor.execute("CREATE TABLE items(item VARCHAR)")
duckdb_cursor.execute("INSERT INTO items VALUES ('jeans'), (''), (NULL)")
res = duckdb_cursor.execute("SELECT... | 34.5 | 81 | 0.657005 |
675b14bbda63abc7d94f5bde1b27bf97576040ca | 4,158 | py | Python | tests/nlu/featurizers/test_lexical_syntactic_featurizer.py | wtoalabi/rasa | 1106845b5628dc1f739a09f75270926b572af918 | [
"Apache-2.0"
] | 2 | 2020-02-27T16:41:52.000Z | 2020-02-27T16:41:57.000Z | tests/nlu/featurizers/test_lexical_syntactic_featurizer.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 56 | 2020-06-09T00:16:14.000Z | 2020-11-16T00:25:20.000Z | tests/nlu/featurizers/test_lexical_syntactic_featurizer.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3 | 2019-02-27T10:13:16.000Z | 2019-07-26T08:33:45.000Z | import numpy as np
import pytest
import scipy.sparse
from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
from rasa.nlu.featurizers.sparse_featurizer.lexical_syntactic_featurizer import (
LexicalSyntacticFeaturizer,
)
from rasa.nlu... | 29.489362 | 82 | 0.579125 |
67badeba4af6c3983c7c69846c39048b7ba19ecc | 15,692 | py | Python | hisim/inputs/heat_pump_hplib/hplib.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/inputs/heat_pump_hplib/hplib.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | hisim/inputs/heat_pump_hplib/hplib.py | sdickler/HiSim | 09a11d99f220f7cadb3cb7b09a6fce8f147243c8 | [
"MIT"
] | null | null | null | """
The ``hplib`` module provides a set of functions for simulating the performance of heat pumps.
"""
import pandas as pd
import scipy
from scipy.optimize import curve_fit
from typing import Any, Tuple
import os
import inspect
def load_database() -> pd.DataFrame:
"""
Loads data from hplib_database.
Retu... | 41.957219 | 239 | 0.577364 |
18897684b76390badb6cc0a8705639d0a3860ec3 | 944 | py | Python | module3-adding-data-science-to-a-web-application/app.py | bs3537/DS-Unit-3-Sprint-3-Productization-and-Cloud | 49579885504059c685b39f19cf59cb19c05ca705 | [
"MIT"
] | 1 | 2020-05-07T20:46:42.000Z | 2020-05-07T20:46:42.000Z | module3-adding-data-science-to-a-web-application/app.py | bs3537/DS-Unit-3-Sprint-3-Productization-and-Cloud | 49579885504059c685b39f19cf59cb19c05ca705 | [
"MIT"
] | null | null | null | module3-adding-data-science-to-a-web-application/app.py | bs3537/DS-Unit-3-Sprint-3-Productization-and-Cloud | 49579885504059c685b39f19cf59cb19c05ca705 | [
"MIT"
] | null | null | null |
import os
from dotenv import load_dotenv
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from web_app.models import db, User, Tweet, migrate
from web_app.routes import my_routes
#from web_app.more_routes import more_routes
from web_app.twitter_service impo... | 28.606061 | 72 | 0.740466 |
188dad7ae5bbcbf8279f799a74c00a52e6d11668 | 3,388 | py | Python | pocketthrone/managers/modmanager.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | 4 | 2016-06-05T16:48:04.000Z | 2020-03-23T20:06:06.000Z | pocketthrone/managers/modmanager.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | pocketthrone/managers/modmanager.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | __all__ = ('ModManager')
import os
import json
from pocketthrone.managers.filemanager import FileManager
from pocketthrone.managers.unitmanager import UnitManager
from pocketthrone.managers.eventmanager import EventManager
from pocketthrone.entities.event import *
from pocketthrone.managers.pipe import L
from pocket... | 29.982301 | 93 | 0.735537 |
beea14aa1259185dbd81e949d8900f6e155ffd63 | 447 | py | Python | Packs/ShiftManagement/Scripts/TimeToNextShift/TimeToNextShift_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ShiftManagement/Scripts/TimeToNextShift/TimeToNextShift_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ShiftManagement/Scripts/TimeToNextShift/TimeToNextShift_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import time
from TimeToNextShift import get_time_to_next_shift
from freezegun import freeze_time
# set shift on Saturday from 10:00 to 22:00
ROLES = [{'shifts': [{'fromDay': 6, 'fromHour': 10, 'fromMinute': 0, 'toDay': 6, 'toHour': 22, 'toMinute': 0}]}]
# set time to Saturday, December 12, 2020 12:12:12 PM
@freeze_t... | 31.928571 | 112 | 0.727069 |
55c523b550810325df4b6bced8fc684be2577198 | 3,815 | py | Python | modules/comments.py | git2samus/SubscriptionBot | d90aa4a854308b5dbf229da2699ba27a56adf0fa | [
"MIT"
] | 2 | 2020-01-19T15:18:06.000Z | 2021-02-09T00:56:20.000Z | modules/comments.py | git2samus/SubscriptionBot | d90aa4a854308b5dbf229da2699ba27a56adf0fa | [
"MIT"
] | null | null | null | modules/comments.py | git2samus/SubscriptionBot | d90aa4a854308b5dbf229da2699ba27a56adf0fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Reddit SubscriptionBot - Comment Parser
Usage: subscription_bot.py comments <subreddit> [(--after=<comment-url>|--reset-after)] [--debug]
subscription_bot.py comments -h | --help
Options:
--after=<comment-url> Only process submissions newer than <comment-url> (if omitted wil... | 40.585106 | 182 | 0.657929 |
365b9999134297881a2bdb54aa579ae2d8dffef2 | 832 | py | Python | Packs/PANOSPolicyOptimizer/Scripts/EntryWidgetUnusedApplications/EntryWidgetUnusedApplications.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PANOSPolicyOptimizer/Scripts/EntryWidgetUnusedApplications/EntryWidgetUnusedApplications.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PANOSPolicyOptimizer/Scripts/EntryWidgetUnusedApplications/EntryWidgetUnusedApplications.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
no_apps = demisto.get(demisto.context(), 'PanOS.PolicyOptimizer.UnusedApps', [])
data = {
"Type": 17,
"ContentsFormat": "number",
"Contents": {
"stats": len(no_apps),
"params": {
"layout"... | 24.470588 | 80 | 0.36899 |
186d66ff42cec78720213d3867b548776fe3d8e2 | 6,473 | py | Python | official/nlp/gnmt_v2/src/gnmt_model/gnmt.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/gnmt_v2/src/gnmt_model/gnmt.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/gnmt_v2/src/gnmt_model/gnmt.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.711656 | 118 | 0.629847 |
c521e538b9ae5008d35255e928c5c33d29d2580a | 8,821 | py | Python | programm/video_detection.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/video_detection.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/video_detection.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf8
"""
Python Module for face, qr-code and object detection with obencv 3.2 and zbar module
@author: wimmer, simon-justus
"""
import numpy as np
import cv2
import zbar
import logging
import threading
import random
import general
from speech_output import Speaker
from PIL import Im... | 41.608491 | 146 | 0.530665 |
9a7b8d54b6859a7f57dea35d433ec875bcfb15e7 | 5,523 | py | Python | gemtown/songs/migrations/0001_initial.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/songs/migrations/0001_initial.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/songs/migrations/0001_initial.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-04-20 06:10
from django.db import migrations, models
import django.db.models.deletion
import gemtown.songs.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CommentOf... | 51.616822 | 264 | 0.554409 |
b17cac3639c49ca301e4b775fedea407533b027f | 263 | py | Python | src/aijack/defense/dp/manager/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/dp/manager/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/dp/manager/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | from .accountant import ( # noqa: F401
GeneralMomentAccountant,
culc_tightupperbound_lowerbound_of_rdp_with_theorem6and8_of_zhu_2019,
culc_upperbound_of_rdp_with_Sampled_Gaussian_Mechanism,
)
from .privacy_manager import PrivacyManager # noqa: F401
| 37.571429 | 73 | 0.836502 |
498b1dd58b80131dd0cc0fb7126b1dfc2e2f4b52 | 1,319 | py | Python | pythonProj/FZPython/demo/backtest/simple_run_demo.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/demo/backtest/simple_run_demo.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/demo/backtest/simple_run_demo.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | #!/usr/bin/env python
# coding: utf8
#=========== 实现脚本运行操作 ============
import os
import sys
module_path = os.path.abspath(os.getcwd())
if module_path not in sys.path:
sys.path.append(module_path)
#=========== 实现脚本运行操作 ============
import backtrader as bt
from backtrader.analyzers import (SQN, AnnualReturn, Time... | 24.425926 | 104 | 0.727824 |
b8cfd8d969c241642fd3ab43802ab338247ba3a3 | 2,079 | py | Python | paper_evaluation/_SupMat_III_satellite_exploration/dataLoaderSatExploration.py | rafaspadilha/timestampVerificationTIFS | bad325e676b0b6087e54f2e280c3600c3b0b767f | [
"MIT"
] | 5 | 2022-03-11T18:08:32.000Z | 2022-03-31T13:47:49.000Z | paper_evaluation/_SupMat_III_satellite_exploration/dataLoaderSatExploration.py | rafaspadilha/timestampVerificationTIFS | bad325e676b0b6087e54f2e280c3600c3b0b767f | [
"MIT"
] | null | null | null | paper_evaluation/_SupMat_III_satellite_exploration/dataLoaderSatExploration.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 #
##################################################... | 31.029851 | 70 | 0.488696 |
b8d8db3246de349955c4e031051c01ac988af822 | 359 | py | Python | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Exercises/Solutions/P09_Volleyball.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Exercises/Solutions/P09_Volleyball.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L03_ConditionalStatementsAdvanced/Exercises/Solutions/P09_Volleyball.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | import math
year = input()
p = int(input()) # празници в годината
h = int(input()) # брой уикенди на село
weekends_Sofia = (48 - h) * 3/4
play_in_holidays = p * 2/3
total_play = weekends_Sofia + play_in_holidays + h
total_visokosna = total_play * 1.15
if year == "normal":
print(math.floor(total_play))
else:
... | 19.944444 | 50 | 0.688022 |
91f70bf3d955cdb0906fea73601ac2b07e56b670 | 274 | py | Python | code/products/redis/connect.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 13 | 2021-05-04T07:46:38.000Z | 2022-03-31T15:46:59.000Z | code/products/redis/connect.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 656 | 2021-04-16T12:05:11.000Z | 2022-03-31T19:33:26.000Z | code/products/redis/connect.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 24 | 2021-04-21T04:17:13.000Z | 2022-03-31T19:14:39.000Z | import redis
def main():
redis_uri = 'REDIS_URI'
redis_client = redis.from_url(redis_uri)
redis_client.set('key', 'hello world')
key = redis_client.get('key').decode('utf-8')
print('The value of key is:', key)
if __name__ == '__main__':
main()
| 17.125 | 49 | 0.635036 |
02cba8b352a9e679e3846a438936897a3f4c145a | 816 | py | Python | examples/seq2seq/initialization_utils.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 47 | 2021-04-16T22:29:25.000Z | 2022-02-11T08:19:13.000Z | examples/seq2seq/initialization_utils.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 12 | 2021-04-28T19:45:02.000Z | 2021-08-31T13:56:02.000Z | examples/seq2seq/initialization_utils.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 5 | 2021-12-19T03:22:08.000Z | 2022-02-14T04:41:04.000Z | from typing import List
from torch import nn
def init_student(student, teacher):
teacher_state_dict = teacher.state_dict()
info = student.load_state_dict(teacher_state_dict, strict=False)
assert info.missing_keys == [], info.missing_keys
return student, info
def copy_decoder_layers(teacher, student... | 38.857143 | 108 | 0.758578 |
02dbf9c4d6e815abdfe9aba09add996b9338787d | 1,555 | py | Python | Projects/CLI-Txt-Adventure/items.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 37 | 2020-10-01T15:20:12.000Z | 2021-10-04T14:17:06.000Z | Projects/CLI-Txt-Adventure/items.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 27 | 2020-10-01T12:32:41.000Z | 2021-10-04T11:05:34.000Z | Projects/CLI-Txt-Adventure/items.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 57 | 2020-10-01T11:24:26.000Z | 2022-02-16T05:09:50.000Z | # this is where all of my classes have been initialized
# Super classes are here on top and specific subclasses follow
class Weapon:
def __init__(self):
raise NotImplementedError("Do not create Raw Weapon Objects!!!")
def __str__(self):
return self.name
class Consumable:
def __init__(self... | 25.080645 | 83 | 0.621222 |
b856f700e40744cb3a48defa45fac4a01e68b811 | 1,227 | py | Python | dmx/_dmx.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | dmx/_dmx.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | dmx/_dmx.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | import serial
import sys
DMXOPEN = bytes([126])
DMXCLOSE = bytes([231])
DMXINTENSITY = bytes([6]) + bytes([1]) + bytes([2])
DMXINIT1 = bytes([3]) + bytes([2]) + bytes([0]) + bytes([0]) + bytes([0])
DMXINIT2 = bytes([10]) + bytes([2]) + bytes([0]) + bytes([0]) + bytes([0])
class Dmx:
def __init__(self, serial_por... | 29.926829 | 74 | 0.555827 |
a2e5c88739941f5656244d545c9ff6debf8107d5 | 92 | py | Python | 2014/05/audio-trustworthy-voice/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/05/audio-trustworthy-voice/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/05/audio-trustworthy-voice/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1tmuCTtMZHfczCE1bYc-lOSS4up80dl57Pj3rHI5fHPc'
| 23 | 68 | 0.836957 |
0c4499e9aadfd6a97c27aba6ea8a974b380afca3 | 3,249 | py | Python | Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/font2cpp.py | tom-2273/Tronxy_SKR_mini_E3_V20 | bc4a8dc2c6c627e4bd7aa423794246f5b051448d | [
"CC0-1.0"
] | null | null | null | Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/font2cpp.py | tom-2273/Tronxy_SKR_mini_E3_V20 | bc4a8dc2c6c627e4bd7aa423794246f5b051448d | [
"CC0-1.0"
] | null | null | null | Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/font2cpp.py | tom-2273/Tronxy_SKR_mini_E3_V20 | bc4a8dc2c6c627e4bd7aa423794246f5b051448d | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python
# Written By Marcio Teixeira 2019 - Aleph Objects, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | 29.807339 | 133 | 0.651585 |
0c6b6ac293b9475bc8edec23ed7466c1c8aebc47 | 14,579 | py | Python | ui/lbClientButton.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | ui/lbClientButton.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | 9 | 2019-05-11T19:53:01.000Z | 2020-11-10T07:24:14.000Z | ui/lbClientButton.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | """
Created on Jan 20, 2019
@author: sven
"""
import time
from time import asctime
from PySide2 import QtCore
from PySide2.QtCore import QThreadPool, QRunnable, QObject
from PySide2.QtWidgets import QPushButton, QMenu, QInputDialog, QMessageBox
from ui.ecManRemoteTerminal import EcManRemoteTerminal
from worker.compu... | 36.538847 | 114 | 0.615474 |
0cb424a7a0150e812753a635a86ac43401e2c5c5 | 2,665 | py | Python | fhirclient/r4models/medicinalproductinteraction_tests.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/medicinalproductinteraction_tests.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/medicinalproductinteraction_tests.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import medicinalproductinteraction
from .fhirdate import FHIRDate
class MedicinalProductInteractionTests(unittest.Tes... | 53.3 | 178 | 0.718949 |
e7e7295e2b1497431a44a5aad9d3e556d2db130c | 342 | py | Python | exercises/fr/test_02_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/test_02_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/test_02_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"token1.similarity(token2)" or "token2.similarity(token1)" in __solution__
), "Compares-tu la similarité entre les deux tokens ?"
assert (
0 <= float(similarity) <= 1
), "La valeur de similarité doit être un nombre flottant. L'as-tu calculé correctement ?"
__msg_... | 38 | 93 | 0.652047 |
f08034314182dc8b35ac66d146d87c13313986c5 | 709 | py | Python | Coursera/Interfacing with the Raspberry Pi/Week-2/Excercise/Client.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Interfacing with the Raspberry Pi/Week-2/Excercise/Client.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Interfacing with the Raspberry Pi/Week-2/Excercise/Client.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import socket
import sys
if __name__ == '__main__':
ip = 'x.x.x.x'
port = 1234
try:
mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.errror:
print("Failed to create socket")
sys.exit()
'''
try:
host = socket.gethostbyname("www.goog... | 18.657895 | 68 | 0.558533 |
68b1506071859e0b451485a3c688ceb47f572f6f | 1,272 | py | Python | tools/sanitizer/lib/argparse.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 10 | 2017-03-17T13:13:44.000Z | 2022-02-09T17:12:03.000Z | tools/sanitizer/lib/argparse.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 74 | 2017-12-14T18:42:43.000Z | 2022-03-08T16:22:52.000Z | tools/sanitizer/lib/argparse.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 36 | 2017-12-19T17:00:24.000Z | 2022-03-04T13:06:52.000Z | import argparse
from os.path import abspath
def parse_args(dirs):
default_uri_prefix = 'https://rdmorganiser.github.io/terms'
parser = argparse.ArgumentParser(
description='Rdmo catalog sanitizer replacing accidentally used uris',
formatter_class=argparse.RawTextHelpFormatter
)
parser.... | 35.333333 | 78 | 0.65173 |
d7e5a35ce571ab4ce1ad7c4af81cff218570e139 | 1,874 | py | Python | src/view/MultipleSpecView.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-26T16:16:14.000Z | 2020-05-26T16:16:14.000Z | src/view/MultipleSpecView.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | null | null | null | src/view/MultipleSpecView.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-16T20:09:17.000Z | 2020-05-16T20:09:17.000Z | import os
import sys
import glob
from PyQt5.QtWidgets import QWidget, QTableWidget, \
QTableWidgetItem, QVBoxLayout, QHeaderView
sys.path.append(os.getcwd()+'/../view')
from SpecViewer import Specviewer # noqa E402
class MultipleSpecView(QWidget):
"""
Displays the SpecviewerWidget and additionally a
... | 32.310345 | 75 | 0.646211 |
cc2d020370b0afd362e3b6d97ffbd32893d056eb | 8,916 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Sharding.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 282 | 2016-06-16T14:41:44.000Z | 2022-03-02T03:43:02.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Sharding.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 146 | 2016-06-16T08:55:45.000Z | 2020-09-08T10:37:32.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Sharding.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 94 | 2016-06-16T10:49:07.000Z | 2022-03-28T09:14:03.000Z | import logging
from pymongo import DESCENDING
from time import sleep
from mongodb_consistent_backup.Common import DB, MongoUri
from mongodb_consistent_backup.Errors import DBConnectionError, DBOperationError, Error, OperationError
from mongodb_consistent_backup.Replication import Replset
class Sharding:
def __i... | 44.138614 | 116 | 0.572005 |
042e71f9a52b5b612b63313356e2ca990fed8636 | 297 | py | Python | software/test/ModulePackageTest.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/test/ModulePackageTest.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | software/test/ModulePackageTest.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | import time
class ModulePackage(object):
def __init__(self, name, voltage):
self.name = name
self.voltage = voltage
self.timestamp = time.time()
testmodul1 = ModulePackage("testname", 15)
print(testmodul1.name)
print(testmodul1.voltage)
print(testmodul1.timestamp)
| 19.8 | 42 | 0.703704 |
f0e6580ffdaed758c5e6c1d3261f624e59bde0d7 | 2,098 | py | Python | hmtoinflux/influxDataBuilder.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | hmtoinflux/influxDataBuilder.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | hmtoinflux/influxDataBuilder.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | import inspect
import sys
from hm.valueType import ValueType
from hm.deviceType import DeviceType
from . import stateSeriesHelper
from .stateSeriesHelper import STHStateSeriesHelper, STHOStateSeriesHelper, SWDOStateSeriesHelper, PSMStateSeriesHelper
def format_wrapper(obj, name):
datapoint = obj.get_datapoint_by... | 33.83871 | 119 | 0.660629 |
a86198f88718cecb8d03ff44e3267d3c1605aab3 | 4,767 | py | Python | src/bo4e/bo/tarifinfo.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/bo/tarifinfo.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/bo/tarifinfo.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Tarifinfo class
and corresponding marshmallow schema for de-/serialization
"""
from typing import List, Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt, GeschaeftsobjektSchema
from bo4e... | 43.336364 | 172 | 0.759178 |
4f6147819a4448113ead638c82234ed4eae0228a | 422 | py | Python | 7-assets/past-student-repos/data_struct_and_algo-master/single_rotation.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/single_rotation.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/single_rotation.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Cyclically rotate an array by one
# Input:
# N = 5
# A[] = {1, 2, 3, 4, 5}
# Output:
# 5 1 2 3 4
def SingleCyclicallyRotate(arr,n):
temp=arr[n-1]
for i in range(n-1,0,-1):
arr[i]=arr[i-1]
arr[0]=temp
return arr
def CyclicallyRotate(arr,turns):
for j in range(turns+1):
SingleCyc... | 18.347826 | 44 | 0.611374 |
506d29ff0b97899950e7d3bd2d9e67f2b9798ccc | 419 | py | Python | tests/hm/testRoomList.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | tests/hm/testRoomList.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | tests/hm/testRoomList.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | import unittest
from hm import RoomList
class HmRoomListTest(unittest.TestCase):
def testRoomList(self):
xml = open("testdata/roomlist.xml", "r", encoding="ISO-8859-1")
xml_string = xml.read()
rl = RoomList(xml_string)
self.assertEqual(rl.get_xml(), xml_string)
self.assertE... | 24.647059 | 71 | 0.651551 |
50f43faebe02f159be74d67824704fc92e127122 | 435 | py | Python | pacman-arch/test/pacman/tests/sync891.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/sync891.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/sync891.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "conflict 'db vs targ'"
sp1 = pmpkg("pkg2")
sp2 = pmpkg("pkg3")
for p in sp1, sp2:
self.addpkg2db("sync", p)
lp1 = pmpkg("pkg1")
lp2 = pmpkg("pkg2")
lp2.conflicts = ["pkg3"]
for p in lp1, lp2:
self.addpkg2db("local", p)
self.args = "-S %s" % " ".join([p.name for p in (sp1, sp2)])
self.addrul... | 18.913043 | 60 | 0.655172 |
ba1c748c5a82193ab0770ee0ae79adbdc9e70d33 | 2,595 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/cache/pipeline_cache.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/cache/pipeline_cache.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/cache/pipeline_cache.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import List, Optional
from watchmen_model.admin import Pipeline
from watchmen_model.common import PipelineId
from watchmen_utilities import ArrayHelper
from .cache_manager import get_pipeline_by_id_cache
from .internal_cache import InternalCache
from .pipeline_by_topic_cache ... | 31.646341 | 82 | 0.792293 |
e8653cf045d533964590f7824bc61a99164ab886 | 1,672 | py | Python | PMIa/2015/Donkor_A_H/task_7_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Donkor_A_H/task_7_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Donkor_A_H/task_7_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 7(6). Вариант 10.
#Создайте игру, в которой компьютер загадывает название одной из трех стран, входящих в военно-политический блок "Тройственный союз", а игрок должен его угадать.
#Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее... | 47.771429 | 169 | 0.754785 |
d742e3b6fee54987fad989166cb28934934d51b8 | 4,522 | py | Python | MA/Robot_ImageExplore_V001.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/Robot_ImageExplore_V001.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/Robot_ImageExplore_V001.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | # Import statements
import sys
sys.path.append("/home/pi/Documents/Robots/slcypi/MA") ### ADD PATH
import cv2
import numpy as np
import matplotlib.pyplot as plt
import picamera
import picamera.array
import time
import pygame
from scipy import ndimage
from time import sleep
# Settings
WIDTH = 160
HEIGHT = WIDTH * 0.75
... | 37.683333 | 90 | 0.391641 |
ad722ae6fe03be9e8598eda55314620f5374f469 | 1,857 | py | Python | machine_learning/numpy/basics.py | shaft49/tools-ref | b819338151d3a57f82fd03d4655da85d08ebfeea | [
"MIT"
] | null | null | null | machine_learning/numpy/basics.py | shaft49/tools-ref | b819338151d3a57f82fd03d4655da85d08ebfeea | [
"MIT"
] | 4 | 2020-09-26T06:23:09.000Z | 2020-11-04T15:24:20.000Z | machine_learning/numpy/basics.py | shaft49/tools-ref | b819338151d3a57f82fd03d4655da85d08ebfeea | [
"MIT"
] | null | null | null | import numpy as np
a = np.array([1, 2, 3])
print(a)
print(a.shape) # tuple of ndim elements
print(a.dtype) # data types
print(a.ndim) # number of dimensions
print(a.size) # total number of elements
print(a.itemsize) # return size of each elements in bytes
b = a * np.array([2, 0, 2]) # element wise multiplication
c = a... | 22.925926 | 78 | 0.632202 |
a8f6622ee23c0a2132d17077702e6be78005202f | 10,661 | py | Python | RFInv.py | bailejor/Behav_Interventions | 8ef238ed913ee9b2744787a0bb2a67318df3fd3d | [
"MIT"
] | null | null | null | RFInv.py | bailejor/Behav_Interventions | 8ef238ed913ee9b2744787a0bb2a67318df3fd3d | [
"MIT"
] | null | null | null | RFInv.py | bailejor/Behav_Interventions | 8ef238ed913ee9b2744787a0bb2a67318df3fd3d | [
"MIT"
] | null | null | null | from sklearn.model_selection import LeaveOneOut
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.neighbors import RadiusN... | 41.972441 | 169 | 0.716349 |
d13bf5656498e87e143bbb0ffa44d1db7b79c8d4 | 58,979 | py | Python | wz/timetable0/fet_data.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/timetable0/fet_data.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/timetable0/fet_data.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TT/fet_data.py - last updated 2021-08-27
Prepare fet-timetables input from the various sources ...
==============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... | 37.470775 | 82 | 0.477577 |
0f0279e4c017ca50c779b44e06c80cfbc682fd30 | 1,893 | py | Python | lldb/test/API/commands/expression/import-std-module/vector-bool/TestVectorBoolFromStdModule.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | lldb/test/API/commands/expression/import-std-module/vector-bool/TestVectorBoolFromStdModule.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | lldb/test/API/commands/expression/import-std-module/vector-bool/TestVectorBoolFromStdModule.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | """
Test basic std::vector<bool> functionality.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestBoolVector(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(["libc++"])
@skipIf(compiler=no_match("clan... | 36.403846 | 79 | 0.510829 |
7e7a8b4956261b858f2e81a4a480b0c04f2651a3 | 2,645 | py | Python | WiSe-2122/Webscraper/amazon-webscraper.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Webscraper/amazon-webscraper.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Webscraper/amazon-webscraper.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Requests wird benötigt, um einen GET Request zu stellen
import requests
from requests import get
# Übersetzung der Website in Text
from bs4 import BeautifulSoup
# Zusammensetzen der Daten in DataFrames
import pandas as pd
# Übernehmen der URL von Amazon
url = "https://www.amazon.de/s?k=macbook+pro&__mk_de_DE=%C3%8... | 31.117647 | 115 | 0.65482 |
cb9317c482fcde5198c8dc3f83ccd4864430028f | 11,070 | py | Python | research/cv/Neighbor2Neighbor/src/models.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/Neighbor2Neighbor/src/models.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/Neighbor2Neighbor/src/models.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 45.368852 | 113 | 0.569648 |
698e533a71e27484a1181db0f9afd61d1a1f776b | 8,107 | py | Python | src/main/python/atorlib/serialbase.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/atorlib/serialbase.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/atorlib/serialbase.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
from abc import abstractmethod
import time
import threading
import logging
import serial
from cffi.pkgconfig import call
# read data from serial interface
class SerialBase():
verbose = False
port = None
id = None
ports = {"/dev/ttyUSB0", "/dev/ttyUSB1", "/dev/ttyUSB2... | 32.955285 | 124 | 0.46577 |
69966cb96c81bacf2d1f0dd741c6a2e131f83eb4 | 988 | py | Python | verto/tests/BaseTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/tests/BaseTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/tests/BaseTest.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | import unittest
import pkg_resources
class BaseTest(unittest.TestCase):
'''A base test class for individual test classes.'''
def __init__(self, *args, **kwargs):
'''Creates BaseTest Case class.
Create class inheiriting from TestCase, while also storing
the path to test files and the ... | 34.068966 | 86 | 0.65587 |
0e140797a3f2c0892f291e49a5374ed4c1cff89a | 11,073 | py | Python | Packs/PerimeterX/Integrations/BotDefender/BotDefender.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PerimeterX/Integrations/BotDefender/BotDefender.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PerimeterX/Integrations/BotDefender/BotDefender.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Dict
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
# CONSTANTS
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
class pXScoring:
"""
Class to handle all current and future scoring for PerimeterX object... | 32.955357 | 128 | 0.623589 |
3867edf0af80ec1545a5307f301df7bf211690e7 | 2,195 | py | Python | scripts/add-orginfo.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T22:29:44.000Z | 2022-01-28T22:29:44.000Z | scripts/add-orginfo.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | null | null | null | scripts/add-orginfo.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T21:10:41.000Z | 2022-01-28T21:10:41.000Z | import os
import subprocess
import argparse
import re
def main(input_file, output_file):
if os.path.exists(input_file):
with open(input_file, "r") as myfile:
content = myfile.readlines()
for line in content:
output_string = []
try:
... | 44.795918 | 156 | 0.518451 |
631f76279221264576f861d09b362a04b240679a | 1,110 | py | Python | data_preprocess.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | data_preprocess.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | data_preprocess.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from keras_malicious_url_detector.library.utility.url_data_loader import load_url_data
from keras_malicious_url_detector.library.utility.text_model_extractor import extract_text_model
def extract_training_data(text_model, data):
data_size = data.shape[0]
X = np.zeros(sh... | 31.714286 | 96 | 0.693694 |
2dbe1d2d3069d39b2c707501de8218cfd61f2870 | 4,396 | py | Python | src/classifier/network.py | msei/insectcounter | 1e9356e5639789b70c614da6c74307ec2b8c8304 | [
"MIT"
] | null | null | null | src/classifier/network.py | msei/insectcounter | 1e9356e5639789b70c614da6c74307ec2b8c8304 | [
"MIT"
] | null | null | null | src/classifier/network.py | msei/insectcounter | 1e9356e5639789b70c614da6c74307ec2b8c8304 | [
"MIT"
] | 2 | 2020-02-05T05:19:18.000Z | 2020-02-05T15:04:32.000Z | import sys
import json
import requests
import os.path
from urllib.parse import urlparse
from json import JSONDecodeError
def check_url(url):
"""
Checks if a given url is a valid url.
:param url: A string describing an url.
:return: True if the url is valid, false otherwise.
"""
try:
... | 37.254237 | 106 | 0.599636 |
faca6fa33e676d152cbbfd7d1ebbdf83938dcd11 | 7,704 | py | Python | code/02_study_population/CCU013_14_paper_events_severity.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | code/02_study_population/CCU013_14_paper_events_severity.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | code/02_study_population/CCU013_14_paper_events_severity.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | # Databricks notebook source
# MAGIC %md
# MAGIC # COVID-19 Severity Phenotypes: Build Events Table
# MAGIC
# MAGIC **Description**
# MAGIC
# MAGIC This notebook runs a list of pyspark operations to produce an events table from the trajectory table for the **paper_cohort**
# MAGIC <br>
# MAGIC
# MAGIC 1. Extract... | 26.027027 | 195 | 0.676272 |
3551c27caba7d5287369f5603ed236b4967bfc70 | 1,149 | py | Python | listings/chapter05/data_structures.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | loesungen/chapter05/data_structures.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | loesungen/chapter05/data_structures.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | from heapq import heappush, heappop
class Stack:
def __init__(self):
self.data = []
@property
def empty(self):
return len(self.data) == 0
def push(self, element):
self.data.append(element)
def pop(self):
return self.data.pop()
class Queue:
def __init__(sel... | 16.414286 | 36 | 0.542211 |
ea613d5a7ab7b8bcc12a9d763922435ea1e6472c | 1,844 | py | Python | app/submission/models.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/submission/models.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/submission/models.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from app import db
from datetime import datetime
from utils import ModelParent
class JudgementStatus:
COMPILE_ERROR = -2
WRONG_ANSWER = -1
ACCEPTED = 0
CPU_TIME_LIMIT_EXCEEDED = 1
REAL_TIME_LIMIT_EXCEEDED = 2
MEMORY_LIMIT_EXCEEDED = 3
RUNTIME_ERROR = 4
SYSTEM_ERROR = 5... | 29.741935 | 68 | 0.64154 |
a4d56bd5409e6ab1574ba15894d58e512e9f1f9e | 231 | py | Python | python/gdal_cookbook/cookbook_general/enable_exception.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_general/enable_exception.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_general/enable_exception.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from osgeo import gdal
# Enable GDAL/OGR exceptions
gdal.UseExceptions()
# open dataset that does not exist
gs = gdal.Open('test.tif')
# results in python RuntimeError exception that
# 'test.tif' does not exist in the file system | 25.666667 | 47 | 0.766234 |
103a7ab32372ece80f9d036e89ce4ec37a15ce99 | 818 | py | Python | CH341SER_LINUX/read.py | schaibo/wiringPi | dd22fed180dd96c937070c9da6cc57e0efbf531c | [
"Apache-2.0"
] | null | null | null | CH341SER_LINUX/read.py | schaibo/wiringPi | dd22fed180dd96c937070c9da6cc57e0efbf531c | [
"Apache-2.0"
] | null | null | null | CH341SER_LINUX/read.py | schaibo/wiringPi | dd22fed180dd96c937070c9da6cc57e0efbf531c | [
"Apache-2.0"
] | null | null | null | import time
import serial
import sys
ser=serial.Serial('/dev/ttyUSB0',57600,parity=serial.PARITY_NONE)
def main():
if ser.isOpen == False:
ser.open()
#ser.write(b"serial turn on")
while True:
size = ser.inWaiting()
if size != 0:
response = ser.read(size)
... | 22.722222 | 67 | 0.466993 |
529ca78550289451facea520d256fdb736bb481d | 351 | py | Python | python/testlint/test/test_unittest.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/testlint/test/test_unittest.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/testlint/test/test_unittest.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import testlint
class testutiladdyourself(unittest.TestCase):
def setUp(self):
self.setupvar = 2
def test_add_yourself_success(self):
self.assertEqual(testlint.util.add_yourself(self.setupvar), 4)
def test_add_yourself_fail(self):
self.assertEqual(testlint.util.a... | 23.4 | 70 | 0.735043 |
5e2c41371580e4e258c6767f42eb16211627a7a6 | 3,465 | py | Python | parkhaeuser/Freiburg.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | parkhaeuser/Freiburg.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | parkhaeuser/Freiburg.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 11:33:53 2020
@author: Peter
"""
import time
from bs4 import BeautifulSoup
from selenium import webdriver
landkreis = 'Freiburg'
url = 'https://www.freiburg.de/pb/,Lde/231355.html'
sek = 10
locations_t = {'Bahnhofsgarage': 219,
'Konzer... | 32.688679 | 106 | 0.490332 |
dc5461f5c849176533f9281d82fc246f2506e151 | 811 | py | Python | backend/python/django/rest/blog/views.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | 1 | 2021-02-08T17:07:54.000Z | 2021-02-08T17:07:54.000Z | backend/python/django/rest/blog/views.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | null | null | null | backend/python/django/rest/blog/views.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | 1 | 2021-02-08T17:08:01.000Z | 2021-02-08T17:08:01.000Z | from rest_framework.decorators import api_view
from sqlalchemy import create_engine
from handlers import PostController
import sys, os
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/../../../dao/src"))
from PostDAO import PostDAO
postDAO = PostDAO(create_engine("postgres://root:root@database:5432/blog"))... | 33.791667 | 80 | 0.726264 |
dc6c97f2248f00dd503916d04e4bc2b3cbd49eeb | 1,673 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/lib/rmsd.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/lib/rmsd.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/lib/rmsd.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.... | 34.142857 | 77 | 0.690377 |
5219f7f1ee4749589d036e8fb5282ae9a10e1242 | 3,475 | py | Python | Utils/py/exportEdgels/drawEdgels.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/exportEdgels/drawEdgels.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/exportEdgels/drawEdgels.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import argparse
parser = argparse.ArgumentParser(description='script to display edgels from log files')
parser.add_argument("logfile", help='log file to draw edgels from')
args = parser.parse_args()
from naoth.LogReader import LogReader
from naoth.LogReader import Parser
import matplotlib.pyplot as... | 28.958333 | 131 | 0.725468 |
528b1d926ba9991108e6122d752718ed254620a7 | 793 | py | Python | selfservice/migrations/0001_initial.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | selfservice/migrations/0001_initial.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | 5 | 2020-10-10T00:21:37.000Z | 2021-09-22T18:01:46.000Z | selfservice/migrations/0001_initial.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-09 18:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('registry', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='... | 30.5 | 114 | 0.602774 |
8743cbba94fb3db0be96de90e0c3b186caf94de1 | 6,884 | py | Python | research/cv/DBPN/train_dbpn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DBPN/train_dbpn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DBPN/train_dbpn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 42.757764 | 119 | 0.670395 |
87532c8c81ee6c8dc09a2740f404755f5d8e5c83 | 1,643 | py | Python | 1-projects/Python-OOP-Toy-master/src/ball.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 1-projects/Python-OOP-Toy-master/src/ball.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 1-projects/Python-OOP-Toy-master/src/ball.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import math
from pygame.math import Vector2
class Ball:
"""
base class for bouncing objects
"""
def __init__(self, bounds, position, velocity, color, radius):
self.position = position
self.velocity = velocity
self.bounds = bounds
self.color = color
self.radius =... | 26.5 | 111 | 0.589775 |
8770ee6ea3fc5c6f9e8960d93fedd7fa8b93f5da | 933 | py | Python | src/third_party_module/deal_with_excel/a.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/third_party_module/deal_with_excel/a.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/third_party_module/deal_with_excel/a.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from openpyxl import load_workbook
# 定义目录名
DIR_NAME = u"E:\\"
# 定义文件名
FILE_NAME = u"数据集成每日作业运行情况登记表_20161224.xlsx"
# 获取第一行的表头信息
def get_excel_title_list():
templist = []
for cx in range(ws.min_column, ws.max_column + 1):
templist.append(ws.cell(row=1, column=cx).value)
... | 21.204545 | 59 | 0.691318 |
0d6ee5ed4cb54c70dd0b014b265459bf62041417 | 429 | py | Python | IS201/continued_fraction.py | czx99/my_IScourse | 24a63c6a1874a89df1e48fe558df37e2fa777083 | [
"MIT"
] | 2 | 2020-10-29T16:25:37.000Z | 2020-11-22T11:19:19.000Z | IS201/continued_fraction.py | Snowfall99/my_IScourse | 24a63c6a1874a89df1e48fe558df37e2fa777083 | [
"MIT"
] | null | null | null | IS201/continued_fraction.py | Snowfall99/my_IScourse | 24a63c6a1874a89df1e48fe558df37e2fa777083 | [
"MIT"
] | 1 | 2020-09-17T14:36:23.000Z | 2020-09-17T14:36:23.000Z | a = 20200609
b = 547
P0 = 0
P1 = 1
Q0 = 1
Q1 = 0
a0 = int(a/b)
x0 = a - a0 * b
P2 = a0 * P1 + P0
Q2 = a0 * Q1 + Q0
print(str(a0)+" ("+str(P2)+","+str(Q2)+")")
Q0 = Q1
Q1 = Q2
P0 = P1
P1 = P2
while x0 != 0:
tmp = b
a0 = int(b/(x0))
b = x0
x0 = tmp - a0 * x0
P2 = a0 * P1 + P0
Q2 = a0 * Q1 + Q0... | 12.617647 | 57 | 0.405594 |
6348a0f68cc856d8521e388f5e87a7c65bcb0247 | 464 | py | Python | pacman-arch/test/pacman/tests/upgrade032.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/upgrade032.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/upgrade032.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install packages explicitly"
lp1 = pmpkg("pkg1")
lp1.reason = 1
self.addpkg2db("local", lp1)
p1 = pmpkg("pkg1", "1.0-2")
p2 = pmpkg("pkg2", "1.0-2")
for p in p1, p2:
self.addpkg(p)
self.args = "-U --asexplicit %s" % " ".join([p.filename() for p in (p1, p2)])
self.addrule("PACMAN_RETCODE=0")
se... | 23.2 | 77 | 0.670259 |
6357ae9b6343e9b879487c21329e7e769c27b13a | 16,413 | py | Python | weibo/spider/html_parser.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/spider/html_parser.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/spider/html_parser.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | # coding:utf8
'''
Created on 2016年4月8日
@author: wb-zhaohaibo
'''
from bs4 import BeautifulSoup
import re
import urlparse
import urllib
from weibo.spider import html_outputer, html_downloader
#html 解析器
class HtmlParser(object):
def __init__(self):
self.html_outputer = html_outputer.Output()
... | 45.97479 | 260 | 0.511546 |
893cd624c1ff883c30bf95a09d2a3e6321723ce9 | 1,497 | py | Python | Lab8/Lab8_K-means_exm.py | jay281/014_JayBhingradiya | 6a5e9112a35f5b014e5ef624604a35dbbfa42a15 | [
"MIT"
] | null | null | null | Lab8/Lab8_K-means_exm.py | jay281/014_JayBhingradiya | 6a5e9112a35f5b014e5ef624604a35dbbfa42a15 | [
"MIT"
] | null | null | null | Lab8/Lab8_K-means_exm.py | jay281/014_JayBhingradiya | 6a5e9112a35f5b014e5ef624604a35dbbfa42a15 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""lab8_0.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1lMQC3LxEgQGDKHXIIfDivpf-0-i-1XZy
Import Libraries
"""
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn.cluster import KMeans
""... | 24.95 | 135 | 0.762859 |
f6a7f290444d2ad638a527fff1e7fb9ef343bdbf | 2,265 | py | Python | Vargi_Bots/ros_packages/pkg_ros_iot_bridge/scripts/pyiot/iot.py | ROBODITYA/Eyantra-2021-Vargi-Bots | f1c6a82c46e6e84486a4832b3fbcd02625849447 | [
"MIT"
] | 1 | 2021-07-13T07:05:29.000Z | 2021-07-13T07:05:29.000Z | Vargi_Bots/ros_packages/pkg_ros_iot_bridge/scripts/pyiot/iot.py | TejasPhutane/Eyantra-2021-Vargi-Bots | ab84a1304101850be8c0f69cfe6de70d53c33189 | [
"MIT"
] | 1 | 2021-06-05T07:58:03.000Z | 2021-06-05T07:58:03.000Z | Vargi_Bots/ros_packages/pkg_ros_iot_bridge/scripts/pyiot/iot.py | ROBODITYA/Eyantra-2021-Vargi-Bots | f1c6a82c46e6e84486a4832b3fbcd02625849447 | [
"MIT"
] | null | null | null | from multiprocessing.dummy import Pool
import time
import sys
import requests
import paho.mqtt.client as mqtt #import the client1
class print_colour:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UND... | 33.308824 | 106 | 0.646799 |
d64d153634ab6683384546e732626e9673181282 | 429 | py | Python | musterloesungen/6.4/min_max.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/6.4/min_max.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/6.4/min_max.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kurs: Python: Grundlagen der Programmierung für Nicht-Informatiker
# Semester: Herbstsemester 2018
# Homepage: http://accaputo.ch/kurs/python-uzh-hs-2018/
# Author: Giuseppe Accaputo
# Aufgabe: 6.4
def min_max(zahlen):
min_wert = min(zahlen)
max_wert = max(z... | 28.6 | 76 | 0.659674 |
6167d75cbe0fd4566d0b5fb5ba3524f30fe02bd9 | 1,546 | py | Python | aoc2020/solution_abc.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/solution_abc.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/solution_abc.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from typing import ContextManager, IO, Generator
from contextlib import contextmanager
from os.path import join as join_path
class SolutionABC(ABC):
def __init__(self, resource_path: str, testing: bool = False, *args, **kwargs):
self.testing = testing
self.reso... | 30.313725 | 83 | 0.598965 |
1475dc8cc80869ddc11b8f09856e3abf62a65aed | 40 | py | Python | zypher_backtester/__init__.py | SebastianOderland/zypher_backtest | 3c16d0832f53e12eb1f2699676793e7c2b7c8ab7 | [
"MIT"
] | null | null | null | zypher_backtester/__init__.py | SebastianOderland/zypher_backtest | 3c16d0832f53e12eb1f2699676793e7c2b7c8ab7 | [
"MIT"
] | null | null | null | zypher_backtester/__init__.py | SebastianOderland/zypher_backtest | 3c16d0832f53e12eb1f2699676793e7c2b7c8ab7 | [
"MIT"
] | null | null | null | from zypher_backtester.main import run
| 20 | 39 | 0.85 |
0d55b5298c4a6e77ffe84bfcf1488b961ac1501b | 3,781 | py | Python | modules/mmm.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | modules/mmm.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | modules/mmm.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | """Runs MMM using the provided wrapper
This module controls all operation of MMM. Input data is first written to an
input file in MMM format. Next, the MMM wrapper is ran using a terminal
command, which produces an output CSV upon completion. Afterwards, the
output data is read into an OutputVariables object.
TODO... | 37.81 | 98 | 0.706162 |
b4a60fd2ac61623f0db209d05acdec6daf5b3d81 | 555 | py | Python | fractalDesignHandler.py | devenramani/fractalArt | bd83b94e9a6d82e998979340c8b5fe0e69b669ac | [
"MIT"
] | null | null | null | fractalDesignHandler.py | devenramani/fractalArt | bd83b94e9a6d82e998979340c8b5fe0e69b669ac | [
"MIT"
] | null | null | null | fractalDesignHandler.py | devenramani/fractalArt | bd83b94e9a6d82e998979340c8b5fe0e69b669ac | [
"MIT"
] | null | null | null | from Snowflake import Snowflake
from Tree import Tree
class fractalDesignHandler:
fractalDesign = ""
def __init__(self, fractalDesign):
self.fractalDesign = fractalDesign
def draw(self, turtle):
print(self.fractalDesign)
if(self.fractalDesign == "Snowflake"):
... | 21.346154 | 46 | 0.538739 |
25d34e6656c8def6eeb502eb9a9ff45b2f6a5e6f | 380 | py | Python | INBa/2015/Ermashov_A_V/task_3_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_3_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_3_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Напишите программу, которая выводит имя "Жан Батист Поклен", и запрашивает его псевдоним.
#Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
# Ермашов А.В.,
#26.05.2016
name = "Жан-Батист Поклен "
print("Ведите псевдоним Жана-Батиста Поклена: ")
ps = inp... | 34.545455 | 112 | 0.747368 |
6cf17842b891dbc5f95bebee45c231069c14043b | 1,526 | py | Python | plugins/tff_backend/migrations/_011_move_nodes.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/migrations/_011_move_nodes.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/migrations/_011_move_nodes.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 34.681818 | 114 | 0.665138 |
9fc7c5539ec2731ca3652119e112d58abc0ef219 | 1,442 | py | Python | ufr/config/ufr.py | RodrikCL/ufr | 0ad09decd7b5270763b6a58815ed89253cedb271 | [
"MIT"
] | null | null | null | ufr/config/ufr.py | RodrikCL/ufr | 0ad09decd7b5270763b6a58815ed89253cedb271 | [
"MIT"
] | null | null | null | ufr/config/ufr.py | RodrikCL/ufr | 0ad09decd7b5270763b6a58815ed89253cedb271 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Asistente para Informes"),
"items": [
{
"type": "doctype",
"name": "Crear Informe Standard",
},
{
"type": "doctype",
"name": "Crear Informe Certificacion",
},
{
"typ... | 15.020833 | 43 | 0.435506 |
3901fcb85fc150863164b04b06421c7921ae2bf9 | 837 | py | Python | sketches/sidescroller2/backgrounds.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/sidescroller1/backgrounds.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/sidescroller1/backgrounds.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # coding=utf-8
class Hill(object):
def __init__(self, x, r, s, c):
self.xpos = x
self.radius = r
self.step = s
self.col = c
def update(self):
self.xpos += self.step
if self.xpos <= -self.radius:
self.xpos = width + self.radius
def s... | 22.026316 | 45 | 0.498208 |
1a6c9e72431709b886361aba44e1264ff3418777 | 662 | py | Python | Packs/FeedCloudflare/Integrations/FeedCloudflare/FeedCloudflare.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedCloudflare/Integrations/FeedCloudflare/FeedCloudflare.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedCloudflare/Integrations/FeedCloudflare/FeedCloudflare.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
def main():
params = {k: v for k, v in demisto.params().items() if v is not None}
feed_url_to_config = {
'https://www.cloudflare.com/ips-v4': {
'indicator_type': FeedIndicatorType.CIDR
},
'https://www.cloudflare.com/ips-v6': {
'... | 25.461538 | 73 | 0.635952 |
2011a34aa3391cc956c39aaec1bf3cb6d6d868d0 | 827 | py | Python | Packs/CommonScripts/Scripts/PDFUnlocker/PDFUnlocker.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/PDFUnlocker/PDFUnlocker.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/PDFUnlocker/PDFUnlocker.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from PyPDF2 import PdfFileReader, PdfFileWriter
def unlock_pdf(entry_id):
res = demisto.getFilePath(entry_id)
origin_path = res['path']
output_name = "UNLOCKED_" + res['name']
input1 = PdfFileReader(open(origin... | 26.677419 | 59 | 0.702539 |
64b23d44b67e40664c01e31e25374c4810a8090b | 3,367 | py | Python | chord_rec/models/lit_baseline.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/models/lit_baseline.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | chord_rec/models/lit_baseline.py | TianxueHu/ChordSymbolRec | d64a5be4f4914e6f682cb6d4079d7ba8a6fc2eac | [
"Unlicense",
"MIT"
] | null | null | null | """
Simple Baseline Model for AV-Sync. Organinzed in PyTorch Lightning
Flatten both audio and video features; concat them and feed into sequential linear layers.
"""
import numpy as np
import torch
import torch.nn as nn
import pytorch_lightning as pl
class PrintSize(nn.Module):
def __init__(self):
super(P... | 35.072917 | 100 | 0.626671 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.