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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39b2bc8f300932a28b242673a6e6b4c967fb1c70 | 3,195 | py | Python | AP_SS16/504/python/plot.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/504/python/plot.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | AP_SS16/504/python/plot.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import os
import numpy as np
from uncertainties.unumpy import uarray
import uncertainties
import data as d
import helpers as hel
import plot_helpers as plot
import main as m
import functions as f
import matplotlib as mpl
import matplotlib.pyplot as plt
x_volt_1 = m.gimmeTHATcolumn(d.anode_1,0)
y_current_1 = m.gi... | 35.10989 | 146 | 0.73302 |
840830608bbbd2b094266f6f80569987f14d09f5 | 256 | py | Python | Curso-Em-Video-Python/2Exercicios/096vfuncao_que_calcula_a_area.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/096vfuncao_que_calcula_a_area.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/096vfuncao_que_calcula_a_area.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | print(f'{"Controle de terreno":^30}')
def area(l, c):
a = l * c
print(f'A área de um terreno {l:.2f} x {c:.2f} é de {a}m².')
#Programa principal
largura = float(input('Largura (m): '))
comp = float(input('Comprimento (m): '))
area(largura, comp)
| 23.272727 | 64 | 0.605469 |
845230124853566bad0aac9148f9486eb00015d9 | 167 | py | Python | storage/emulated/0/qpython/projects3/reader/memory.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/projects3/reader/memory.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/projects3/reader/memory.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | m_dic={'浪潮之巅.txt': 66, '胡庆华副行长二级分行经营会议讲话20181211_33550.txt': 156, '徐文华2019劳动竞赛讲话.txt': 342, '信贷逻辑常识.txt': 357, '小微貸款失敗經驗1.txt': 948, '深度學習.txt': 279, 'start_index': 0} | 167 | 167 | 0.706587 |
29fd358a53754e7092b0ac03493b9adcdfc1818f | 1,970 | py | Python | python/pyqt/LearnPyQt/signals.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/signals.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/LearnPyQt/signals.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
# SIGNAL: The connected function will be called whenever
# the window... | 31.269841 | 75 | 0.671066 |
7c26dbb103d19badcb79b51904244fa020ccc73b | 3,116 | py | Python | Packs/McAfee-TIE/Integrations/McAfee-TIE/McAfee-Tie_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/McAfee-TIE/Integrations/McAfee-TIE/McAfee-Tie_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/McAfee-TIE/Integrations/McAfee-TIE/McAfee-Tie_test.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
import importlib
import pytest
from dxltieclient import TieClient
valid_private_key = """-----BEGIN PRIVATE KEY-----
This is a vaild Private Key
-----END PRIVATE KEY-----"""
valid_certificate = """-----BEGIN CERTIFICATE-----
This is a valid Certificate
-----END CERTIFICATE-----"""
inval... | 33.505376 | 85 | 0.687741 |
860c5c87e049782bf36b665d7bc93e0e2ded1f65 | 555 | py | Python | Python/Courses/Object-Oriented-Programming.Python-Engineer/05-Properties.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Object-Oriented-Programming.Python-Engineer/05-Properties.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Object-Oriented-Programming.Python-Engineer/05-Properties.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | class SoftwareEngineer:
def __init__(self):
self._salary = None
@property
def salary(self):
# check, constraints, calculations
return self._salary
@salary.setter
def salary(self, value):
self._salary = value
@salary.deleter
def salary(self):
del sel... | 16.818182 | 42 | 0.643243 |
86c4c6283af85d9c1cfa5ddbe81f1fee9f63ca97 | 818 | py | Python | python/en/archive/books/Python_Natural_Language_Processing/src/pnlp-5_feature_engineering-sklearn_bow.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/pnlp-5_feature_engineering-sklearn_bow.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/pnlp-5_feature_engineering-sklearn_bow.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pnlp-5_feature_engineering-sklearn_bow.py
Source: Python Natural Language Processing
Advanced machine learning and deep learning techniques for natural language processing
Jalaj Thanaki
파이썬 자연어 처리의 이론과 실제
효율적인 자연어 처리를 위한 머신 러닝과 딥러닝 구현하기
05. 피러 엔지니어링과 NLP 알고리즘 > NLP의 기본 피쳐 > BoW (Bag-of-Wor... | 29.214286 | 89 | 0.717604 |
9c765bdb51d55995e46e021f3095d32b8ba84769 | 1,872 | py | Python | official/cv/cspdarknet53/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/cspdarknet53/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/cspdarknet53/export.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... | 39.829787 | 86 | 0.709402 |
92edd85d755b0c57e14249e5a5cabad999cae7ac | 133 | py | Python | api/wsgi/src/devices/models.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 2 | 2020-06-08T19:17:10.000Z | 2020-06-08T20:45:07.000Z | api/wsgi/src/devices/models.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 14 | 2015-10-07T09:31:50.000Z | 2022-02-23T07:34:10.000Z | api/wsgi/src/devices/models.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | null | null | null | from django.db import models
class Device(models.Model):
owner = models.TextField()
live_url = models.URLField(null=True)
| 16.625 | 41 | 0.721805 |
4c7402ba2f7c7bd77d5b25177db20f12caf945cf | 220 | py | Python | setup.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | setup.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | setup.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup(
ext_modules=cythonize([Extension("src/distance/levenshtein", ["src/distance/levenshtein.pyx"])])
) | 31.428571 | 100 | 0.8 |
e68d6f6cf24ab4de9540614dd7cdfdd4f18567b3 | 502 | py | Python | exercises/en/exc_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/exc_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/exc_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.en import English
from spacy.tokens import Token
nlp = English()
# Define the getter function that takes a token and returns its reversed text
def get_reversed(token):
return token.text[::-1]
# Register the Token property extension "reversed" with the getter get_reversed
____.____(____, ____=___... | 27.888889 | 79 | 0.758964 |
e6bf5a20b81e1d297253713f04774ae7c6cc5199 | 4,911 | py | Python | experiment/deeplabv3+vocfinetuning/train.py | DRosemei/deeplabv3plus-pytorch | e35dd5e4d4ac35ea37d38316b189bf623ba81174 | [
"MIT"
] | 646 | 2018-09-20T09:28:15.000Z | 2022-03-29T11:34:14.000Z | experiment/deeplabv3+vocfinetuning/train.py | Wangyf46/deeplabv3plus-pytorch | dbbbe88d7774d6e02f7ea13e770ee4278dc528fd | [
"MIT"
] | 54 | 2018-10-23T03:03:02.000Z | 2021-04-20T11:29:47.000Z | experiment/deeplabv3+vocfinetuning/train.py | Wangyf46/deeplabv3plus-pytorch | dbbbe88d7774d6e02f7ea13e770ee4278dc528fd | [
"MIT"
] | 124 | 2018-09-28T06:48:34.000Z | 2022-03-26T13:00:43.000Z | # ----------------------------------------
# Written by Yude Wang
# ----------------------------------------
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import os
import sys
import numpy as np
from config import cfg
from datasets.generateData import generate_datas... | 35.078571 | 141 | 0.714111 |
fc05de5dc18b465ccc61c527c6cdc4afde5f264e | 950 | py | Python | 2-resources/__DATA-Structures/ds-traversal-multi-lang/python/for-in.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/ds-traversal-multi-lang/python/for-in.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/ds-traversal-multi-lang/python/for-in.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | sections = [
{
"title": "Getting started",
"reset_lesson_position": False,
"lessons": [
{"name": "Welcome"},
{"name": "Installation"},
],
},
{
"title": "Basic operator",
"reset_lesson_position": False,
"lessons": [
{... | 22.093023 | 50 | 0.516842 |
fc68414c722918cb0c3895b36c3f1e2787f11e3f | 1,751 | py | Python | kafka/cruise-control/cruise-control-client/cruisecontrolclient/client/Query.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 2,177 | 2017-08-28T15:07:01.000Z | 2022-03-30T11:06:01.000Z | kafka/cruise-control/cruise-control-client/cruisecontrolclient/client/Query.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 1,079 | 2017-08-30T07:25:06.000Z | 2022-03-31T17:49:07.000Z | kafka/cruise-control/cruise-control-client/cruisecontrolclient/client/Query.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 489 | 2017-08-28T16:17:03.000Z | 2022-03-31T15:52:18.000Z | # Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License").
# See License in the project root for license information.
# To be able to make more-precise type hints
from cruisecontrolclient.client.Endpoint import AbstractEndpoint
# To be able to signify deprecation
import warnings
def ge... | 38.911111 | 104 | 0.717875 |
fc8f2c1fb7ac070052fde318ce599a4e4d934791 | 5,493 | py | Python | car/car/Mymqtt.py | cdxxiaoge/StreetRoller | 3bb9b4ee8ddad9c1582f1aaf572591a09e5d3400 | [
"Apache-2.0"
] | null | null | null | car/car/Mymqtt.py | cdxxiaoge/StreetRoller | 3bb9b4ee8ddad9c1582f1aaf572591a09e5d3400 | [
"Apache-2.0"
] | null | null | null | car/car/Mymqtt.py | cdxxiaoge/StreetRoller | 3bb9b4ee8ddad9c1582f1aaf572591a09e5d3400 | [
"Apache-2.0"
] | null | null | null | import paho.mqtt.client as mqtt
import json
import time
import collections
class Mymqtt():
def __init__(self, name: str) -> None:
self.NAME = name
self.__HOSt = "127.0.0.1"
self.__PORT = 1883
self.__USER = "admin"
self.__PASSWD = 'admin'
# self.isConnected = Fal... | 29.853261 | 83 | 0.485345 |
5dcde00e6a8f4be0d449cddc75a546413a75bede | 6,890 | py | Python | abfahrt/classes/Passenger.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | 1 | 2022-01-30T14:30:02.000Z | 2022-01-30T14:30:02.000Z | abfahrt/classes/Passenger.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | abfahrt/classes/Passenger.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | from typing import List
# This module provides runtime support for type hints. The most fundamental support consists of the types Any, Union, Callable, TypeVar, and Generic. For a full specification, please see PEP 484. For a simplified introduction to type hints, see PEP 483. (https://docs.python.org/3/library/typing.... | 27.233202 | 301 | 0.567344 |
5de1f37b5cb26208471bc4d0b4f4146352fca838 | 432 | py | Python | pacman-termux/test/pacman/tests/query002.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/query002.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/query002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Query info on a package"
p = pmpkg("foobar")
p.files = ["bin/foobar"]
p.desc = "test description"
p.groups = ["foo"]
p.url = "http://www.archlinux.org"
p.license = "GPL2"
p.arch = "i686"
p.packager = "Arch Linux"
self.addpkg2db("local", p)
self.args = "-Qi %s" % p.name
self.addrule("PACMAN_RETCO... | 22.736842 | 55 | 0.668981 |
5d6575450d0b9c3e5223de4149e93ce2ceaebb0f | 1,914 | py | Python | ParsingAndScraping/tests.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T13:06:11.000Z | 2021-06-23T13:06:11.000Z | ParsingAndScraping/tests.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T21:21:52.000Z | 2021-06-23T21:21:52.000Z | ParsingAndScraping/tests.py | KazuruK/FilmGetter | fd84bcaddf17d4b89ad6e5d27095535346c5f4a9 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T19:14:19.000Z | 2021-06-28T19:14:19.000Z | import traceback
from functools import wraps
import time
from ParsingAndScraping.ivi import parser as parser_ivi
from ParsingAndScraping.megogo import parser as parser_megogo
from ParsingAndScraping.Netflix import parcer as parser_netflix
from ParsingAndScraping.wink import parser as parser_wink
from ParsingAndScraping... | 26.957746 | 79 | 0.683386 |
dbc46168464080a909896c28d2d39bd387b149aa | 1,111 | py | Python | tools/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | tools/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | tools/conanfile.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | from conans import ConanFile, CMake, tools
import os.path
import sys
class LocalConanFile(ConanFile):
settings = "os", "compiler", "build_type", "arch", "arch_build"
build_requires = "cmake/3.22.0"
def requirements(self):
args = sys.argv[3:]
for index, value in enumerate(args):
... | 32.676471 | 98 | 0.59856 |
37f086a613a17a4a7b579789194277505e70a7b7 | 7,543 | py | Python | BluePrint/lib/pusher/__init__.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | BluePrint/lib/pusher/__init__.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | BluePrint/lib/pusher/__init__.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | import os
import sys
import time
import httplib
import hmac
import json
import hashlib
import urllib
import re
import socket
host = 'api.pusherapp.com'
port = 80
app_id = None
key = None
secret = None
channel_name_re = re.compile('^[-a-zA-Z0-9_=@,.;]+$')
app_id_re = re.compile('^[0-9]+$')
def url2o... | 37.157635 | 137 | 0.64192 |
72dac4b796ea739300048905a84f5190258702b1 | 29,652 | py | Python | utils/attn_graph.py | oracleofnj/nmt-attention-tensorflow | 6907def51daf3b1b8f0a2b683f220494a7361a75 | [
"MIT"
] | 2 | 2018-01-10T03:12:09.000Z | 2018-02-20T14:40:28.000Z | utils/attn_graph.py | oracleofnj/nmt-attention-tensorflow | 6907def51daf3b1b8f0a2b683f220494a7361a75 | [
"MIT"
] | null | null | null | utils/attn_graph.py | oracleofnj/nmt-attention-tensorflow | 6907def51daf3b1b8f0a2b683f220494a7361a75 | [
"MIT"
] | null | null | null | """NMT without attention."""
import tensorflow as tf
from .unrolled_rnn import gru_update
class AttentionModel(object):
"""Holds the variables and produces the graphs."""
def __init__(
self,
source_language_vocab,
target_language_vocab,
embedding_size,
hidden_size,
... | 36.382822 | 77 | 0.468333 |
fe70fc4a5a0fbaee30e4da45ff1fc4db56c810c9 | 1,121 | py | Python | pytestDemo/testcases/conftest.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | pytestDemo/testcases/conftest.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | pytestDemo/testcases/conftest.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | import pytest
import os
import allure
from common.mysql_operate import db
from common.read_data import data
from common.logger import logger
BASE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
def get_data(yaml_file_name):
try:
data_file_path = os.path.join(BASE_PATH, "data", yaml_fi... | 23.354167 | 72 | 0.648528 |
22c5852b05e3e7afd8b14f76c4ee60d5a6a415e0 | 643 | py | Python | frappe-bench/apps/erpnext/erpnext/healthcare/page/medical_record/medical_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/page/medical_record/medical_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/healthcare/page/medical_record/medical_record.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint
@frappe.whitelist()
def get_feed(start, page_length, name):
"""get feed"""
result = frappe.db.sql("""select nam... | 25.72 | 66 | 0.715397 |
43a61280dabcfa1bc7b2a361d37fd171722e6f7a | 426 | py | Python | snowbootsgreedy.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | snowbootsgreedy.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | snowbootsgreedy.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | N, B = list(map(int,input().split(" ")))
tiledepths = list(map(int,input().split(" ")))
depths = []
speeds = []
for x in range(B):
depth,stepspeed = list(map(int,input().split(" ")))
depths.append(depth)
speeds.append(stepspeed)
curboot = -1
for x in tiledepths:
if curboot < 0 or depths[curboot] < depth... | 30.428571 | 55 | 0.617371 |
600161c5c53c45f003f0c66c5c1a02959bc1b0ca | 2,770 | py | Python | lib/python/qmk/cli/cformat.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/cli/cformat.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/cli/cformat.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | """Format C code according to QMK's style.
"""
import subprocess
from shutil import which
from milc import cli
from qmk.path import normpath
from qmk.c_parse import c_source_files
def cformat_run(files, all_files):
"""Spawn clang-format subprocess with proper arguments
"""
# Determine which version of c... | 41.969697 | 111 | 0.662094 |
71dcdfced0e0781e8e7e551a006d5b215af7a985 | 2,453 | py | Python | concorde/command_line.py | drcraig/concorde | 418b04d5bd93f541d3a0371b923700b767a03d29 | [
"MIT"
] | 2 | 2018-05-24T08:27:23.000Z | 2019-01-06T18:55:15.000Z | concorde/command_line.py | drcraig/concorde | 418b04d5bd93f541d3a0371b923700b767a03d29 | [
"MIT"
] | 1 | 2017-05-20T10:05:49.000Z | 2017-08-09T05:57:45.000Z | concorde/command_line.py | drcraig/concorde | 418b04d5bd93f541d3a0371b923700b767a03d29 | [
"MIT"
] | null | null | null | import os.path
import argparse
from . import get_source_files, render_articles, render_to_index, generate_feed
def main(test_args=None):
base_parser = argparse.ArgumentParser(add_help=False)
base_parser.add_argument('-t', '--template', default='', help='Template file to use when rendering')
base_parser.ad... | 53.326087 | 126 | 0.693029 |
1caa19801ad3f5a97e565df1a55724bbff477106 | 2,612 | py | Python | coding-200/chapter12/yield_from_how.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | coding-200/chapter12/yield_from_how.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | coding-200/chapter12/yield_from_how.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # #pep380
#
# #1. RESULT = yield from EXPR可以简化成下面这样
# #一些说明
# """
# _i:子生成器,同时也是一个迭代器
# _y:子生成器生产的值
# _r:yield from 表达式最终的值
# _s:调用方通过send()发送的值
# _e:异常对象
#
# """
#
# _i = iter(EXPR) # EXPR是一个可迭代对象,_i其实是子生成器;
# try:
# _y = next(_i) # 预激子生成器,把产出的第一个值存在_y中;
# except StopIteration as _e:
# _r = _e.value #... | 30.372093 | 132 | 0.553982 |
1ce187e9a3afaa2828b108ddcc2d319bc7b7f00a | 1,209 | py | Python | Termin 5/Aufgabe 2.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Termin 5/Aufgabe 2.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Termin 5/Aufgabe 2.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | 3 | 2019-11-17T01:33:07.000Z | 2020-03-26T10:13:39.000Z | """
Aufgabe 5.2
"""
import numpy as np
from skimage.io import imread, imshow
import matplotlib.pyplot as plt
from skimage.filters import sobel_h, sobel_v, gaussian
img1 = imread("./catG.png")
img_vertical = sobel_v(img1, mask = None)
img_horizontal = sobel_h(img1, mask = None)
img_Sum = np.sqrt(((img_vertical)**2)+((... | 29.487805 | 114 | 0.72622 |
1c08f1a5e0ccad0a7d93e8acea178f8e668962d0 | 3,709 | py | Python | Aufgaben/abgabe2/view.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/view.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe2/view.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | __authors__ = "Rosario Allegro (1813064), Sedat Cakici (1713179), Joshua Joost (1626034)"
# maintainer = who fixes buggs?
__maintainer = __authors__
__date__ = "2020-04-23"
__version__ = "0.0"
__status__ = "Development"
##--- TODO
# - Graph showing the learning progress of the neural network
# - Let the neural network... | 29.672 | 137 | 0.65759 |
1c209f93fc4cb71386afa80ee133079eaf7335c0 | 3,335 | py | Python | src/area-charts/stackedarea.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/area-charts/stackedarea.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/area-charts/stackedarea.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | #Stacked area plots -
#These work in the same way as area graphs do, but they use multiple data series that start each point
#from the point left by the previous data series. The entire graph represents the total of all data plotted.
#They are useful, overall, for comparing multiple variables changing over an interva... | 29 | 162 | 0.675862 |
1c5c6cee555ade4a51c5102f28d235a40d466657 | 405 | py | Python | python/data_sutram/scraper/xxx.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/scraper/xxx.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/scraper/xxx.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import os
import requests
from time import time as timer
from multiprocessing.pool import ThreadPool
start = timer()
list_get = []
for item in range(100000):
list_get.append(item)
#print(list_get)
print("GOT ITEMS")
def get_res(entry):
#print(entry)
return entry
l = ThreadPool(1000).imap_unordered(get_r... | 17.608696 | 54 | 0.718519 |
c76bd2539457634faec6fecedaec9a681910e9e2 | 2,647 | py | Python | Intro-Python-II/src/player.py | tobias-fyi/01_intro_python | c56645291b8bce94d8511c3277fefba1fe8add89 | [
"MIT"
] | null | null | null | Intro-Python-II/src/player.py | tobias-fyi/01_intro_python | c56645291b8bce94d8511c3277fefba1fe8add89 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/01_intro_python/Intro-Python-II/src/player.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
BeWilder - text adventure game :: Player definition
Write a class to hold player information.
e.g. what room they are in currently.
"""
import sys
from adv_utils import table_maker
from item import Item, Food, Artifact, Weapon, Armor
from room import Room
class Player:
def __init__(self, name: str, current... | 34.376623 | 85 | 0.595391 |
c7cb5f538684351ed8d7408ec6761e3054f96dbf | 2,311 | py | Python | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/same_path.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/same_path.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/same_path.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | # Check if two nodes are on the same path in a tree. Use DFS and the concept of intime and outtime.
# Intime - time when a node is visited for the first time
# Outtime - time when a node is visited for the second time after all its children have been visited
# For any pair of node if they are on the same path -
# intim... | 28.8875 | 100 | 0.515361 |
4026f701662a7560003e408f40a3e4c903fd7fdb | 1,463 | py | Python | actions/actions.py | fhswf/chatbot_girlsday | 66ad6ccdc6db62b7b5195e60b1583edd7ba2a237 | [
"MIT"
] | 1 | 2021-06-13T11:11:21.000Z | 2021-06-13T11:11:21.000Z | actions/actions.py | fhswf/chatbot_girlsday | 66ad6ccdc6db62b7b5195e60b1583edd7ba2a237 | [
"MIT"
] | null | null | null | actions/actions.py | fhswf/chatbot_girlsday | 66ad6ccdc6db62b7b5195e60b1583edd7ba2a237 | [
"MIT"
] | 1 | 2021-06-13T11:11:18.000Z | 2021-06-13T11:11:18.000Z | from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
class ActionAnswerAge(Action):
def name(self) -> Text:
return "action_answer_age"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
... | 32.511111 | 107 | 0.606972 |
90736668bce59023d337487e51c795a93721c333 | 294 | py | Python | exercises/es/exc_01_03_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/exc_01_03_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/exc_01_03_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Importa la clase de lenguaje "Spanish" y crea el objeto nlp
from ____ import ____
nlp = ____
# Procesa el texto
doc = ____("Me gustan las panteras negras y los leones.")
# Selecciona el primer token
first_token = doc[____]
# Imprime en pantalla el texto del token
print(first_token.____)
| 21 | 61 | 0.751701 |
29168043619d653c5b51c73ba6f4a7e48472b29c | 8,803 | py | Python | WeChatTools/monitor.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/monitor.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/monitor.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
# python35
from Utils.GateTrendUpMonitor import TrendUpMonitor
from Utils.time_utils import get_long_timestamp
from Utils.ConfigParser import ConfigParser
from Utils.MailHelper import MailHelper
from Utils.GateHelper import GateHelper
from Utils.Logger import Logger
from itchat.content import *
i... | 44.913265 | 127 | 0.634556 |
2941d66d3aee8631f7324ca29588efbff547496c | 2,981 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_aaa.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_aaa.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_aaa.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import pa... | 39.746667 | 103 | 0.739685 |
31242929b82dfa1b2966b25a136ca5f2f556ef73 | 1,580 | py | Python | Computerorietierte_Mathematik/U2/U2_A4.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | Computerorietierte_Mathematik/U2/U2_A4.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | Computerorietierte_Mathematik/U2/U2_A4.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | '''
import pysnooper
@pysnooper.snoop()
'''
__author__ = "Qianli und Nazar"
__copyright__ = "Copyright (c) 2019 qiaw99"
# https://github.com/qiaw99/WS2019-20/blob/master/LICENSE
import numpy as np
import math
from matplotlib import pyplot as plt
def plotGraphic():
# Aufgabe 4 a)
x = np.arange(0, 2 * math.pi + 1, 0.... | 22.571429 | 64 | 0.635443 |
316eaca8f025da1411d59558dac63c09169292f9 | 457 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/26. remove consecutive duplicates characters in a string.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/26. remove consecutive duplicates characters in a string.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_2_String/26. remove consecutive duplicates characters in a string.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function that accepts a string as an argument and
modifies the string so as to remove all consecutive duplicate characters.
Example:
input_string = 'mississauga'
Expected output = 'misisauga'
"""
def remove_duplicates(input_string):
output_string = ''
for chr in input_string:
if o... | 22.85 | 77 | 0.682713 |
31e8bdfb1df64bdfb74e31785e2a1f33ef6327fd | 1,365 | py | Python | aecb/urls.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/urls.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/urls.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | """api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 37.916667 | 77 | 0.753846 |
73072bee49ce27caafd7c372ddc496070d27b9c8 | 4,445 | py | Python | Packs/SMB/Integrations/SMB/SMB.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SMB/Integrations/SMB/SMB.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SMB/Integrations/SMB/SMB.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import tempfile
from smb.SMBConnection import SMBConnection
''' GLOBAL VARS '''
USER = demisto.params()['credentials']['identifier']
PASSWORD = demisto.params()['credentials']['password']
HOSTNAME ... | 36.434426 | 119 | 0.669066 |
7337dc892025c2f71aebe12d4dcfd0b95b14629b | 2,104 | py | Python | pyntcloud/geometry/areas.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/geometry/areas.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/geometry/areas.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import numpy as np
def triangle_area(triangle):
""" triangle is a (3,3) array such as triangle[i] is the ith vertex of the triangle
"""
return 0.5 * np.linalg.norm(np.cross(triangle[1] - triangle[0],
triangle[2] - triangle[0]))
def triangle_area_multi(v1, v2, v3)... | 24.183908 | 87 | 0.577471 |
81fa930a60ed10fd1a4240d324f8de6f2db97557 | 7,852 | py | Python | src/onegov/election_day/models/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot.models import Election
from onegov.ballot.models import Vote
from onegov.core.custom import json
from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import UTCDateTime
from onegov.core.orm.types import UUID
from onegov.core.templates import re... | 32.716667 | 79 | 0.615003 |
c31ff6e56f3d4e33f1f9b4af73fa536f2d3bfb0c | 985 | py | Python | IVTp/2014/TITOV_S_G/task_9_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/TITOV_S_G/task_9_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/TITOV_S_G/task_9_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 9. Вариант 22.
# Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать, есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет". Вслед за тем игрок должен попробовать о... | 29.848485 | 310 | 0.715736 |
6f45d5387a04e3baf8890647632a95390ad1229e | 2,765 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/count-overlap.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/count-overlap.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/count-overlap.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/python2.7
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2012-2014. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
# pylint: disable=missing-docstring,invalid-name
"""
Count th... | 31.067416 | 79 | 0.687884 |
7dc64633de7c5fb09808a2dbf36b4b0919f4e670 | 2,645 | py | Python | faas/vmware-dispatch/examples/python3/gettemplates.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 625 | 2017-12-19T18:54:04.000Z | 2020-11-12T01:46:00.000Z | faas/vmware-dispatch/examples/python3/gettemplates.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 407 | 2017-12-21T18:34:10.000Z | 2020-07-15T18:06:15.000Z | faas/vmware-dispatch/examples/python3/gettemplates.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 70 | 2017-12-20T01:44:16.000Z | 2020-04-05T15:03:03.000Z | #!/usr/bin/env python
#######################################################################
## Copyright (c) 2017 VMware, Inc. All Rights Reserved.
## SPDX-License-Identifier: Apache-2.0
#######################################################################
"""
Sample function to list templates in vSphere inventory... | 28.44086 | 122 | 0.59017 |
81bdcc9523fc19fd5790c6e9c80b47abd85021f1 | 679 | py | Python | opencv_tutorial/opencv_python_tutorials/Image_Processing/contour_hierarchy.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/contour_hierarchy.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/contour_hierarchy.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 3 17:09:48 2019
@author: jone
"""
#%% Hierarchy
import cv2
import random
img = cv2.imread('img/contour_hierarchy.png')
imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(imgray, 125, 255, 0)
image, contours, hierarchy = cv2.findContours(thresh... | 21.21875 | 93 | 0.662739 |
f2245f208d836691ca5787135b8cb03e52f34a1b | 640 | py | Python | tikz/convolution-linear/filter.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | tikz/convolution-linear/filter.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | tikz/convolution-linear/filter.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | #!/usr/bin/env python
import scipy.signal
import numpy as np
image = [[104, 116, 116, 112, 58, 47, 47],
[109, 97, 114, 116, 105, 110, 45],
[116, 104, 111, 109, 97, 46, 100],
[101, 47, 109, 97, 115, 116, 101],
[114, 47, 99, 97, 116, 99, 97],
[116, 99, 97, 116, 46, 112, 104]... | 30.47619 | 72 | 0.490625 |
481858fc52dc117cc3c17df6a7ddf3525c79d514 | 401 | py | Python | setup.py | WURacing/dbc_generator | aae3c8ddb20bf22f6ac3667b8e05aa2b66b74b68 | [
"Apache-2.0"
] | 1 | 2021-01-14T23:24:13.000Z | 2021-01-14T23:24:13.000Z | setup.py | WURacing/dbc_generator | aae3c8ddb20bf22f6ac3667b8e05aa2b66b74b68 | [
"Apache-2.0"
] | null | null | null | setup.py | WURacing/dbc_generator | aae3c8ddb20bf22f6ac3667b8e05aa2b66b74b68 | [
"Apache-2.0"
] | 1 | 2019-10-19T19:25:09.000Z | 2019-10-19T19:25:09.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dbc_generator",
version="0.1.0",
author="WURacing",
author_email="wuracing@gmail.com",
description="DBC Generation Server",
long_description=long_description,
long_description_cont... | 25.0625 | 52 | 0.708229 |
6fcdbf244a662fae09c9cdf918aa9e472c3f6662 | 466 | py | Python | elements/python/6/2/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/6/2/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/6/2/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def incr(a):
carry = 1
i = len(a)-1
while i >= 0 and carry:
x = a[i] + carry
a[i] = x%10
carry = x/10
i -= 1
if carry == 1:
a.insert(0, 1)
def digits_array(x):
return list(map(int, str(x)))
def test():
cases = [129, 999, 23452341, 123999]
for x in ... | 16.642857 | 40 | 0.482833 |
d2832da335dbe120a6f05817490123e97f796bc1 | 6,349 | py | Python | pupil_invisible_monitor/src/pupil_invisible_monitor/__main__.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/src/pupil_invisible_monitor/__main__.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/src/pupil_invisible_monitor/__main__.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | import logging.handlers
import os
import sys
from pathlib import Path
### Libraries for threading functions
import threading
from queue import Queue
### Libraries for the mouse and speech recognition
import mouse
import sounddevice as sd
import vosk
import argparse
import json
if getattr(sys, "fro... | 31.904523 | 108 | 0.566073 |
96bc71e29f5631e6b577d823c7ac07c2dd2b025a | 1,847 | py | Python | code-examples/convert-days.py | qasch/lf5-python-basics | 220f2619a0d18f3f1b7a8db70664dd6cd4c955af | [
"CC0-1.0"
] | null | null | null | code-examples/convert-days.py | qasch/lf5-python-basics | 220f2619a0d18f3f1b7a8db70664dd6cd4c955af | [
"CC0-1.0"
] | null | null | null | code-examples/convert-days.py | qasch/lf5-python-basics | 220f2619a0d18f3f1b7a8db70664dd6cd4c955af | [
"CC0-1.0"
] | null | null | null | # Funktionsdefinition (es gibt diese Funktion mit entsprechender Funktionalität)
def convert_days(num_of_days): # Kopf einer Funktion / Signatur
"""Convert given number of days to hours."""
conversion = num_of_days * 24
# F-String (Formatierter String)
print(f"{num_of_days} Tage sind {conversion} Stun... | 41.044444 | 115 | 0.69085 |
737c8f67f8ef163d373f3222f3fd447f7e81a802 | 2,205 | py | Python | research/cv/STGAN/src/dataset/datasets.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/STGAN/src/dataset/datasets.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/STGAN/src/dataset/datasets.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.923077 | 78 | 0.611791 |
73c82b08cac3d993ce3d0e9cf707247b92f8b9dd | 1,808 | py | Python | src/onegov/activity/models/volunteer.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/volunteer.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/volunteer.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.mixins import ContentMixin, TimestampMixin
from onegov.core.orm.types import UUID
from sqlalchemy import Column, Text, Date, Enum, ForeignKey
from uuid import uuid4
class Volunteer(Base, ContentMixin, TimestampMixin):
""" Describes a volunteer that has signed ... | 28.25 | 75 | 0.672566 |
f77618f4283f4c36414d10bfae0f75ab58f1adf2 | 980 | py | Python | hm/state.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | hm/state.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | hm/state.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | from .valueType import ValueType, ValueSubType
class State:
def __init__(self, name, ise_id, datapoints):
self.name = name
self.ise_id = ise_id
self.datapoints = datapoints
def __str__(self):
return self.tostring()
def get_name(self):
return self.name
def get... | 27.222222 | 101 | 0.570408 |
e3b562e8fb2068351ff46773c81cf953a9a3e9a1 | 428 | py | Python | wagtail_localize/migrations/0013_translationsource_schema_version.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 6 | 2019-09-10T19:53:55.000Z | 2019-11-14T16:57:07.000Z | wagtail_localize/migrations/0013_translationsource_schema_version.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 17 | 2019-07-11T11:17:37.000Z | 2019-11-19T16:40:31.000Z | wagtail_localize/migrations/0013_translationsource_schema_version.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | # Generated by Django 3.1.6 on 2021-02-19 11:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtail_localize", "0012_localesynchronization"),
]
operations = [
migrations.AddField(
model_name="translationsource",
... | 22.526316 | 63 | 0.630841 |
54c573e22af69687d913dc34643ceb4078e76830 | 527 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/106_polimorfismo_e_sobreposicao/app.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/106_polimorfismo_e_sobreposicao/app.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/106_polimorfismo_e_sobreposicao/app.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
Polimorfismo é o principio que permite que classes derivadas de uma mesma superclasse tenham metodos iguais(de mesma
assinatura) mas comportamentos diferentes
mesma assinatura = mesma quantidade e tipos de parametros
"""
from abc import ABC, abstractmethod
class A(ABC):
@abstractmethod
def fala(self, msg... | 18.172414 | 116 | 0.675522 |
49cc53cdf4518b4bed346af51ce7b040759544c8 | 1,810 | py | Python | src/onegov/translator_directory/security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Personal
from onegov.file import File
from onegov.org.models import GeneralFileCollection, GeneralFile
from onegov.translator_directory import TranslatorDirectoryApp
from onegov.translator_directory.collections.documents import \
TranslatorDocumentCollection
from onegov.translator_d... | 34.150943 | 78 | 0.805525 |
49cf5d64caf5232cee7853ce53db2523aa11bdc9 | 3,510 | py | Python | models/amazon.py | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | 4 | 2015-07-09T21:14:22.000Z | 2019-07-02T21:53:50.000Z | models/amazon.py | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | null | null | null | models/amazon.py | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | null | null | null | # Copyright 2014 John Reese
# Licensed under the MIT license
from core import app
amazon_links = [
('Complete Series',
'http://www.amazon.com/gp/product/B000VECAEE/ref=as_li_ss_il?ie=UTF8&camp=1789&creative=390957&creativeASIN=B000VECAEE&linkCode=as2&tag=noswap-20',
'http://ws.assoc-amazon.com/widgets/q... | 73.125 | 161 | 0.753276 |
4d0b370a86b824364d3e196404f81cbd573a2730 | 63,676 | py | Python | visualizer/visualizer/gui.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 29 | 2017-06-21T19:29:07.000Z | 2022-02-17T12:26:24.000Z | visualizer/visualizer/gui.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 34 | 2017-06-26T14:31:02.000Z | 2022-02-03T16:40:41.000Z | visualizer/visualizer/gui.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 22 | 2017-06-29T11:08:42.000Z | 2022-02-03T16:16:49.000Z | from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from . import configuration
import os
import sys
VIZ_STATE_MOVED = 0x01
VIZ_STATE_DELIVERED = 0x02
VIZ_STATE_PICKED_UP = 0x04
VIZ_STATE_PUT_DOWN = 0x08
VIZ_STATE_MOVE = 0x10
VIZ_STATE_DELIVER = 0x20
VIZ_STATE_PICK_UP = 0x4... | 37.085614 | 125 | 0.588825 |
150b98eef3bfea0736ee6efc55de9743264af0b8 | 12,707 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/test/py/tests/test_vboot.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/test/py/tests/test_vboot.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/test/py/tests/test_vboot.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016, Google Inc.
#
# U-Boot Verified Boot Test
"""
This tests verified boot in the following ways:
For image verification:
- Create FIT (unsigned) with mkimage
- Check that verification shows that no keys are verified
- Sign image
- Check that verification shows th... | 38.506061 | 82 | 0.604076 |
12a8fe83147d55f97431d6756ba510be410caa70 | 2,355 | py | Python | LoPy/LoAirRohr01/lib/DHT22RinusW.py | OffenesJena/JenLoRa | 332114edc8927b577f9c4775d7c721ba63daa77b | [
"Apache-2.0"
] | 1 | 2017-08-23T20:45:35.000Z | 2017-08-23T20:45:35.000Z | LoPy/LoAirRohr01/lib/DHT22RinusW.py | OffenesJena/JenLoRa | 332114edc8927b577f9c4775d7c721ba63daa77b | [
"Apache-2.0"
] | null | null | null | LoPy/LoAirRohr01/lib/DHT22RinusW.py | OffenesJena/JenLoRa | 332114edc8927b577f9c4775d7c721ba63daa77b | [
"Apache-2.0"
] | null | null | null | from machine import enable_irq, disable_irq
import time
# this onewire protocol code tested with Pycom LoPy device and AM2302/DHT22 sensor
def getval(pin):
ms = [1]*700 # needs long sample size to grab all the bits from the DHT
time.sleep(1)
pin(0)
time.sleep_us(10000)
pin(1)
irqf = dis... | 34.130435 | 248 | 0.548195 |
12e88fcee2753af3262671a370e045ad8fcc8c0e | 906 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/01_webscraping_grundlagen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/01_webscraping_grundlagen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/01_webscraping_grundlagen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 01_webscraping_grundlagen.py
import re
maxl, dv=50, 15
def output(string):
print(''.center(maxl, '█'))
delta=len(string) % maxl
string+=' '*(maxl)
suchmuster=re.compile(r'.{'+str(maxl-dv) + r',' + str(maxl) +r'}[,|\.|\n| ]', re.DOTALL)
ergebnis=suchmuster.findall(string)
for abschnitt in ergeb... | 28.3125 | 115 | 0.711921 |
423b9f24ef4e80383009fb29bda8a9bb0abf7adb | 368 | py | Python | Curso-Em-Video-Python/2Exercicios/054_Grupo_da_marioridade.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/054_Grupo_da_marioridade.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/054_Grupo_da_marioridade.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from datetime import date
atual = date.today().year
soma = 0
menor = 0
for c in range(1, 8):
nascimento = int(input('Digite o ano do seu Nascimento: '))
idade = atual - nascimento
if idade >= 21:
soma += 1
else:
menor += 1
print('Ao total {} são maiores de idade.'.format(soma))
print('Ao... | 26.285714 | 63 | 0.625 |
42a943d5add8e6e4845f8459d211f5e10096e2c3 | 3,589 | py | Python | src/main/python/context/resource_manager.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/context/resource_manager.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/context/resource_manager.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | import os
import platform
import time
"""
用于配置常用的初始化信息类
"""
def getSeparator():
"""
if 'Windows' in platform.system():
separator = '\\'
else:
separator = '/'
:return:
"""
separator=os.path.sep
return separator
def findPath(file):
"""
to locate the... | 22.43125 | 68 | 0.527724 |
6730c2ed0702291dfae589ce62586c025791b029 | 30,840 | py | Python | Generators/python/javadocExtraction.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | null | null | null | Generators/python/javadocExtraction.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | null | null | null | Generators/python/javadocExtraction.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | null | null | null | import logging
import os
import shutil
import re
from collections import defaultdict
import sys
from bs4 import BeautifulSoup
def _getSubstring(block, delimiters):
# No error checking...don't do anything dumb
return block[delimiters[0]:delimiters[1]]
def _textify(block):
"""
Smash down any html for... | 40.472441 | 151 | 0.58784 |
6782c961ae2dc0844e770533b82d68f21488d7f1 | 455 | py | Python | _posts/code/docopt/use_docopt.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/docopt/use_docopt.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/docopt/use_docopt.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | """Usage: use_docopt.py [-s=<win>] <input> <output>
Process input and write text file output. Uses window size provided, or default of 10.
Arguments:
input required input file
output required output file
Options:
-h --help. Show this screen.
-s=<win> --size Window Size [default: 1... | 19.782609 | 86 | 0.635165 |
2214bc687692f8899efebe657ed2756c1a1507bf | 3,226 | py | Python | research/nlp/gpt2/src/finetune_eval_config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/gpt2/src/finetune_eval_config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/gpt2/src/finetune_eval_config.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... | 30.72381 | 101 | 0.621823 |
2239f80f822ae40e944ca60988549917dfd0dff6 | 731 | py | Python | INBa/2015/Shemenev_A_V/task_7_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_7_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_7_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 7. Вариант 30.
# Создайте игру, в которой компьютер загадывает название одного из двенадцати месяцев, а игрок должен его угадать.
# Shemenev A.V
# 11.04.2016
import random
month=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"] #Список месяцев
print("Данн... | 43 | 127 | 0.715458 |
58f4625b77a0385111f54b2fe116d14ae82a95e5 | 3,174 | py | Python | dash/urls.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/urls.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/urls.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | """dash_board URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 43.479452 | 91 | 0.706364 |
18b878ccc1660aa428a8bc9f962f03c3c5d08853 | 294 | py | Python | exercises/en/exc_02_05_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/en/exc_02_05_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/en/exc_02_05_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("en")
# Import the Doc class
from ____ import ____
# Desired text: "spaCy is cool!"
words = ["spaCy", "is", "cool", "!"]
spaces = [True, True, False, False]
# Create a Doc from the words and spaces
doc = ____(____, words=words, spaces=spaces)
print(doc.text)
| 19.6 | 44 | 0.676871 |
e16fe825dd0e47d9dc39e8a139a27463de079472 | 446 | py | Python | Algorithms/BitManipulation/Xor-sequence.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/BitManipulation/Xor-sequence.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/BitManipulation/Xor-sequence.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def get_value(i):
if i % 4 == 0: return i
if i % 4 == 1: return 1
if i % 4 == 2: return i + 1
if i % 4 == 3: return 0
for _ in xrange(input()):
l, r = map(int, raw_input().split())
num_of_2 = r/4 - l/4 - 1
mid = 0 if num_of_2%2 == 0 else 2
lam = lambda x,y: x^y
prin... | 26.235294 | 133 | 0.533632 |
bef6c39ae52b810af88b696ee633ad0f375c6733 | 1,422 | py | Python | Python/kivy/basic_kivy.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/kivy/basic_kivy.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/kivy/basic_kivy.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | import kivy
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
class MyGrid(GridLayout):
def __init__(self, **kwargs):
super(MyGrid, self).__init__(**kwargs)
self.cols = 1... | 27.882353 | 73 | 0.654712 |
36361e0a2ebf5a36669f622555f24c52655b8740 | 551 | py | Python | ryu/app/otherApp/topo/iperf.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/otherApp/topo/iperf.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | ryu/app/otherApp/topo/iperf.py | yuesir137/SDN-CLB | 58b12a9412cffdf2945440528b1885c8899edd08 | [
"Apache-2.0"
] | null | null | null | """
author:Yuegb
date:2021,06,07
"""
import sys,os,time
import numpy as np
if __name__=='__main__':
local=sys.argv[1]
print('iperf ...............')
while True:
dst=np.random.randint(1,9)
if dst==local:
continue
dstAdr='10.0.0.%d'%dst
bw=np.random.poisson(10)
... | 25.045455 | 68 | 0.544465 |
366bd0b562dfc407448c78169bf77118bee5d97c | 269 | py | Python | py_client/delete.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | py_client/delete.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | py_client/delete.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | from urllib import response
import requests
p_id = input("Enter product id: \n")
p_id = int(p_id)
endpoint = f"http://localhost:8000/api/products/{p_id}/delete/"
get_response = requests.delete(endpoint)
print(get_response.status_code, get_response.status_code==204)
| 24.454545 | 63 | 0.773234 |
36d4e953bd4a6df9e54fd3615b82445e05a8760e | 5,149 | py | Python | tests/test_server_streams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | tests/test_server_streams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | tests/test_server_streams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""test_server_streams.py - tests of the server module of DHParser,
connection with streams.
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2019 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except... | 33.653595 | 101 | 0.634298 |
9aa47b06fc48ff41233d1fa2a47db8ef53f06591 | 2,226 | py | Python | wagtail_localize/migrations/0011_segmentoverride.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 6 | 2019-09-10T19:53:55.000Z | 2019-11-14T16:57:07.000Z | wagtail_localize/migrations/0011_segmentoverride.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 17 | 2019-07-11T11:17:37.000Z | 2019-11-19T16:40:31.000Z | wagtail_localize/migrations/0011_segmentoverride.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | 2 | 2019-09-30T20:23:39.000Z | 2019-10-31T14:09:31.000Z | # Generated by Django 3.1.2 on 2020-10-23 10:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("wagtailcore", "0059_appl... | 34.246154 | 72 | 0.440701 |
4912eabfc67c9d0d0a7b166edf17242948411736 | 3,333 | py | Python | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-3_vectorize_with_tf_idf.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-3_vectorize_with_tf_idf.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-3_vectorize_with_tf_idf.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pnlp-4_english-3_vectorize_with_tf_idf.py
pnlp-4_text_classification-english_sentiment_analysis-3_vectorize_with_tf_idf.py
Source: Python Natural Language Processing
Advanced machine learning and deep learning techniques for natural language processing
Jalaj T... | 32.359223 | 130 | 0.70357 |
491f0275536118f07edf8dcbf9e382ea20179063 | 9,288 | py | Python | Utils/py/MotionAnalysis/average_current_consumption.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/MotionAnalysis/average_current_consumption.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/MotionAnalysis/average_current_consumption.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import BehaviorParser
from matplotlib import pyplot
import numpy as np
JointID = {
"HeadPitch": 0,
"HeadYaw": 1,
"RShoulderRoll": 2,
"LShoulderRoll": 3,
"RShoulderPitch": 4,
"LShoulderPitch": 5,
"RElbowRoll": 6,
"LElbowRoll": 7,
"RElbowYaw": 8,
"LElbowYaw": 9,
"RHipYawPitch": 10,
"LHipYawPitch... | 35.049057 | 110 | 0.662791 |
02b51da84e92cd50b5e43ddb1b21c82c45468172 | 1,934 | py | Python | hardware_control.py | bioPunkKitchen/climate.local | ccd29da3d84542d5f9c73a5d75bc3ceefeef1f08 | [
"MIT"
] | 1 | 2019-05-28T18:33:49.000Z | 2019-05-28T18:33:49.000Z | hardware_control.py | bioPunkKitchen/climate.local | ccd29da3d84542d5f9c73a5d75bc3ceefeef1f08 | [
"MIT"
] | 1 | 2019-12-30T14:52:02.000Z | 2020-01-04T11:41:08.000Z | hardware_control.py | bioPunkKitchen/climate.local | ccd29da3d84542d5f9c73a5d75bc3ceefeef1f08 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import datetime
import time
import os
"""
/ o---Cooling
/ o---x |-----o-/
|---o-/ | o---Heating (relais light on)
... | 29.30303 | 103 | 0.588935 |
b865e61fada65fe28ef84d28ce02d9b8edc5f574 | 6,469 | py | Python | research/nlp/senta/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/senta/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/senta/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.178161 | 115 | 0.680785 |
b866a0fa106cab1cbd4dd06d1635efa3f83cb3bd | 1,089 | py | Python | BtmManager-Prototyp-py/BtM_Manager.py | datend3nker/JuFo-BtM | a01e931ec4862c12e8a4861eed0661806ee2d19e | [
"BSD-Source-Code"
] | null | null | null | BtmManager-Prototyp-py/BtM_Manager.py | datend3nker/JuFo-BtM | a01e931ec4862c12e8a4861eed0661806ee2d19e | [
"BSD-Source-Code"
] | null | null | null | BtmManager-Prototyp-py/BtM_Manager.py | datend3nker/JuFo-BtM | a01e931ec4862c12e8a4861eed0661806ee2d19e | [
"BSD-Source-Code"
] | null | null | null | import sys, os, yaml
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog, QDialog
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtGui import QIcon
from BtM_gui import Ui_MainWindow
class MainWindow(QMainWindow):
def __init__(self):
super(MainWi... | 24.75 | 109 | 0.635445 |
b8c0b71cdfcad778a98ae325ec7bc4a60659db4c | 1,257 | py | Python | Algorithms/2_Implementation/63.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/63.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/63.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/the-grid-search/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'gridSearch' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. STRING_ARRAY G
# 2. STRING_ARRAY P... | 20.95 | 96 | 0.57677 |
b2801673b5f19d58ff124e7ba5c8580555f28dce | 4,806 | py | Python | task_1/similarity/positive_comments.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | 1 | 2022-02-28T22:02:50.000Z | 2022-02-28T22:02:50.000Z | task_1/similarity/positive_comments.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | task_1/similarity/positive_comments.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | # This is not generating that many great charts. Maybe look for improvements or redo...
# %% Setup
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
# %% Read Comments
events = ['2020Nov', '2020Oct', '2020Sept', '2020Jun', '2019Sept','2019Jun', '2019Mar', '2018Oct', '2018Sept', '2018Jun... | 31.827815 | 137 | 0.709946 |
0c07ce54d87b1c1e03aede84eba07b189246cd5a | 10,710 | py | Python | Utils/MatlabDeepLearning/tools/data_augmentation.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2015-01-12T10:46:29.000Z | 2022-03-28T05:13:14.000Z | Utils/MatlabDeepLearning/tools/data_augmentation.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-01-20T21:07:50.000Z | 2020-01-22T14:00:28.000Z | Utils/MatlabDeepLearning/tools/data_augmentation.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-02-07T18:18:10.000Z | 2019-10-15T17:01:41.000Z | import sys
from os import listdir
from os.path import isfile, join, splitext, isdir, exists
import cv2
import numpy as np
import operator
import os
import random
import string
# HACK: this parameter has different name in opencv3
MY_CV_LOAD_IMAGE_UNCHANGED = -1
# TODO: move changed images in seperate subfolder
'''
fol... | 41.673152 | 141 | 0.634267 |
a7a1046ed12c1370e902e61f47ce6c6bd57d3280 | 500 | py | Python | exercises/fr/exc_03_10_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_03_10_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/exc_03_10_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.tokens import Doc
nlp = spacy.blank("fr")
# Définis la fonction getter
def get_has_number(doc):
# Retourne si un token quelconque du doc renvoie True pour token.like_num
return any(____ for token in doc)
# Déclare l'extension de propriété de Doc "has_number"
# avec le getter get_has_... | 26.315789 | 77 | 0.752 |
ce125c6432efdce8af215827474c7a7a0f1b6742 | 1,751 | py | Python | src/Sephrasto/CharakterItemsWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterItemsWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/CharakterItemsWrapper.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 18 18:53:43 2017
@author: Aeolitus
"""
from Wolke import Wolke
import UI.CharakterItems
from PyQt5 import QtWidgets, QtCore
import logging
from Hilfsmethoden import Hilfsmethoden
class CharakterItemsWrapper(QtCore.QObject):
modified = QtCore.pyqtSignal()
def... | 31.267857 | 88 | 0.611079 |
ce3866be1474d7cfdd0e69115ce0043e573c6e31 | 1,198 | py | Python | code/snake/Algorithms/PerfectButBoring.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 1 | 2020-03-30T09:25:53.000Z | 2020-03-30T09:25:53.000Z | code/snake/Algorithms/PerfectButBoring.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 2 | 2020-02-05T14:00:23.000Z | 2020-03-30T19:57:19.000Z | code/snake/Algorithms/PerfectButBoring.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | null | null | null | from Algorithms.Algorithms import Algorithm
from GameData import GameData
class PerfectButBoring(Algorithm):
"""
This algorithm implements the most obvious Hamilton cycle.
Thus, the result will be perfect, but the snake is very slow because it simply visits every available
pixel of the playfield to ma... | 29.95 | 105 | 0.585142 |
023bfce2b7495098ecf98067b5a28f51cf0b9841 | 5,540 | py | Python | week4/use_2class_on_multiclass_sigmoid.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 12 | 2020-05-25T08:21:25.000Z | 2022-02-22T09:02:00.000Z | week4/use_2class_on_multiclass_sigmoid.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | null | null | null | week4/use_2class_on_multiclass_sigmoid.py | anjiang2016/CVFundamentals | 783c2efcaa2336d674661ae18cdec744b91223c3 | [
"MIT"
] | 6 | 2020-06-02T11:54:03.000Z | 2022-02-22T09:03:05.000Z | #coding:utf-8
# code for week2,recognize_computer_vision.py
# houchangligong,zhaomingming,20200601,
import torch
from itertools import product
import pdb
import sys
def generate_data():
# 本函数生成0-9,10个数字的图片矩阵
image_data=[]
num_0 = torch.tensor(
[[0,0,1,1,0,0],
[0,1,0,0,1,0],
[0,1,0,0,1,0],
[... | 26.00939 | 119 | 0.551264 |
ce7db8a8cd34174315f15409884d2a19e41dfe00 | 371 | py | Python | etc code/multi.py | gusghrlrl101/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 11 | 2019-06-17T02:59:01.000Z | 2021-05-24T14:10:04.000Z | etc code/multi.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | null | null | null | etc code/multi.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 3 | 2019-06-17T02:59:32.000Z | 2019-07-03T04:31:30.000Z | from multiprocessing import Process
from functools import partial
def singleCount(cnt, name):
for i in range(100000000):
cnt += 1
if i % 2500000 == 0:
print name, ':', i
cnt = 0
name = ['hyunho1', 'hyunho2']
p1 = Process(target=singleCount, args=(cnt, name[0]))
p2 = Process(target=singleCount, args=(cnt, na... | 17.666667 | 53 | 0.668464 |
684257de559b400032add5fd3b00ab82cf973294 | 518 | py | Python | exercises/de/exc_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("de_core_news_sm")
doc = nlp("Berlin gefällt mir sehr gut")
# Finde alle Tokens und Wortarten
token_texts = [token.text for token in doc]
pos_tags = [token.pos_ for token in doc]
for index, pos in enumerate(pos_tags):
# Teste, ob der aktuelle Token ein Eigenname ist
if pos == "P... | 30.470588 | 57 | 0.664093 |
cc0bd8c2dcc1ff1d28a33ee5d4e069f4ea48aa42 | 30 | py | Python | pkg/pkg/graph/__init__.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 1 | 2021-01-20T00:37:31.000Z | 2021-01-20T00:37:31.000Z | pkg/pkg/graph/__init__.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 17 | 2021-03-03T14:48:54.000Z | 2021-09-08T15:52:50.000Z | pkg/pkg/graph/__init__.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | 2 | 2021-03-05T12:23:20.000Z | 2021-03-29T11:49:53.000Z | from .graph import MaggotGraph | 30 | 30 | 0.866667 |
cc176971327a0a11df56ad25e327ab81421b071b | 3,062 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_0/fields_to_be_renamed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v4_0/fields_to_be_renamed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_0/fields_to_be_renamed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
from frappe.modules import scrub, get_doctype_module
rename_map = {
"Quotation ... | 27.836364 | 68 | 0.673743 |
0b0c2f6c34d24dbd38d70d6f0d8c251b5a0d1340 | 659 | py | Python | Projects/Opencv/date and time in video.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2021-10-06T13:55:02.000Z | 2021-10-06T13:55:02.000Z | Projects/Opencv/date and time in video.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Projects/Opencv/date and time in video.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | import cv2
import datetime
cap = cv2.VideoCapture(0)
print(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
print(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
while cap.isOpened():
ret ,frame = cap.read()
if ret:
font = cv2.FONT_HERSHEY_SIMPLEX
text = 'Width:'+str(cap.get(3)) +'XHeight:'+str(cap.get(4))
dd... | 24.407407 | 98 | 0.617602 |
accd09134decd56c3bf8b3ac194c05fb40abbf54 | 1,198 | py | Python | Classes/Screen_codes/Activation_screen.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Screen_codes/Activation_screen.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Screen_codes/Activation_screen.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | from PyQt5.QtWidgets import QDialog
from PyQt5.QtCore import pyqtSlot
from PyQt5 import uic
import http.client
import json
qtCreatorFile = "Classes/GUI/activation.ui"
Ui_Dialog, QtBaseClass = uic.loadUiType(qtCreatorFile)
class Activation(QDialog, Ui_Dialog):
# def __init__(self, nickname, parent = None):
d... | 28.52381 | 73 | 0.66778 |
c57b3c548b83e140443e2bd31d989b6c13cdf69b | 5,553 | py | Python | packages/watchmen-meta/src/watchmen_meta/analysis/topic_index_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/analysis/topic_index_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/analysis/topic_index_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Dict, List
from watchmen_meta.common import ask_engine_index_enabled, StorageService
from watchmen_model.admin import Factor, Topic
from watchmen_model.analysis import FactorIndex
from watchmen_model.common import FactorId, TenantId, TopicId
from watchmen_storage import... | 37.02 | 114 | 0.774536 |
4ffd4bdef4729aee0076bd09efc69522d2e1363a | 103 | py | Python | Webpage/arbeitsstunden/apps.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/arbeitsstunden/apps.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/arbeitsstunden/apps.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class ArbeitsstundenConfig(AppConfig):
name = 'arbeitsstunden'
| 17.166667 | 38 | 0.786408 |
8cac5874bb95d444b5db109521f8378e991978fc | 937 | py | Python | other/re-risky/split-version/task2/spoilers_and_source/src/gen_checker.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | other/re-risky/split-version/task2/spoilers_and_source/src/gen_checker.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | other/re-risky/split-version/task2/spoilers_and_source/src/gen_checker.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 30.225806 | 80 | 0.719317 |
50d5fc1429b85ed74a8f0a3cc9b3e167d45dbf5d | 6,339 | py | Python | file-management/multimedia/folder.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | null | null | null | file-management/multimedia/folder.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | 1 | 2022-03-02T10:43:58.000Z | 2022-03-02T10:43:58.000Z | file-management/multimedia/folder.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | null | null | null | from typing import Tuple, List
import os
import re
import datetime
import file_messages
from file import File
import audio_file
import picture_file
import video_file
class Folder:
def __init__(self, folder_path: str):
self.folder_path: str = folder_path
def get_folder_path(self) -> str:
... | 42.26 | 220 | 0.566493 |
0facda5e70664f579136fc8c1edb74d26825d982 | 4,106 | py | Python | src/onegov/election_day/utils/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/utils/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/utils/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from onegov.ballot import ComplexVote
from onegov.ballot import Vote
def sublist_name_from_connection_id(conn_name, subconn_name):
"""
Removes prefixed parent_connection_id from connection_id
as introduced by sesam 2019.09
:param conn_name: list connection name aka... | 32.078125 | 76 | 0.56454 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.